diff --git a/snapshots/master/demos/android/energy-monitor.apk b/snapshots/master/demos/android/energy-monitor.apk index 6dd170e75..a4bc80c85 100644 Binary files a/snapshots/master/demos/android/energy-monitor.apk and b/snapshots/master/demos/android/energy-monitor.apk differ diff --git a/snapshots/master/demos/android/todo_lib.apk b/snapshots/master/demos/android/todo_lib.apk index 0b35d2f0e..e0ce2d520 100644 Binary files a/snapshots/master/demos/android/todo_lib.apk and b/snapshots/master/demos/android/todo_lib.apk differ diff --git a/snapshots/master/demos/carousel/pkg/carousel.d.ts b/snapshots/master/demos/carousel/pkg/carousel.d.ts index 7194162d9..a523478a3 100644 --- a/snapshots/master/demos/carousel/pkg/carousel.d.ts +++ b/snapshots/master/demos/carousel/pkg/carousel.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/carousel/pkg/carousel.js b/snapshots/master/demos/carousel/pkg/carousel.js index d0c67cc21..85b94849c 100644 --- a/snapshots/master/demos/carousel/pkg/carousel.js +++ b/snapshots/master/demos/carousel/pkg/carousel.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1643,43 +1643,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 153, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4359 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4360 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5586 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5587 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5621 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5622 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5626 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5627 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5647 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5648 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5668 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5669 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5711 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5712 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5729 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5730 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5735 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5736 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5740 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5741 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 390, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm index 274b6dead..005d33f7a 100644 Binary files a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm and b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm differ diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts index 901c988f6..d5ff85243 100644 --- a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts +++ b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts index 453e7cf52..f274a5772 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19748af9fb7d8676: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3087ce34e714ce47: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js index d632ec0a4..7e3f237f4 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19748af9fb7d8676(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3087ce34e714ce47(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1677,64 +1677,64 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7903 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3510, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7904 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3511, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7905 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3510, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7906 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3511, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7907 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3510, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7908 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3511, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7909 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3510, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7910 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3511, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7911 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3510, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7912 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3511, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9360 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9361 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9362 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9363 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9364 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9365 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9366 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_44); + imports.wbg.__wbindgen_closure_wrapper9367 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9368 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9369 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9370 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_49); + imports.wbg.__wbindgen_closure_wrapper9371 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9372 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9373 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9375 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9376 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9383 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9384 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4000, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10067 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 4043, __wbg_adapter_58); + imports.wbg.__wbindgen_closure_wrapper10068 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4044, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm index 969259d73..2d4dc6126 100644 Binary files a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm and b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm differ diff --git a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts index 689a0d238..821ba1d28 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h19748af9fb7d8676(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3087ce34e714ce47(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts b/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts index 6f98b6434..6b9901260 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js index 674c208ab..927af4b2e 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1639,63 +1639,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6888 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3287, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6883 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3288, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6890 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3287, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6885 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3288, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6891 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3287, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6886 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3288, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6892 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3287, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6887 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3288, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6893 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3287, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6888 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3288, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10105 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10106 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11332 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11333 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11367 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11368 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11372 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11373 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11393 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11394 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11414 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11415 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11457 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11458 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11475 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11476 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11481 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11482 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11486 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11487 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3523, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm index dc241175a..f296b85b5 100644 Binary files a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts index d45e64259..6d359ee37 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts b/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts index 6f98b6434..6b9901260 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js index e2eed08b1..6f0508a01 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1639,63 +1639,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6596 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3068, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6591 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3069, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6598 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3068, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6593 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3069, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6599 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3068, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6594 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3069, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6600 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3068, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6595 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3069, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6601 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3068, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6596 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3069, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9816 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9817 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11043 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11044 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11078 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11079 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11083 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11084 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11104 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11105 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11125 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11126 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11168 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11169 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11186 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11187 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11192 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11193 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11197 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11198 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3304, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm index 0c5acf5ba..2f3c91b48 100644 Binary files a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts index d45e64259..6d359ee37 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts b/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts index 6f98b6434..6b9901260 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery.js b/snapshots/master/demos/gallery/pkg/fluent/gallery.js index aa6e2e576..ed3d3f189 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.js +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1639,63 +1639,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5708 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2605, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5703 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2606, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5710 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2605, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5705 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2606, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5711 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2605, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5706 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2606, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5712 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2605, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5707 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2606, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5713 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2605, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5708 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2606, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8925 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper8926 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10152 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10153 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10187 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10188 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10192 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10193 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10213 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10214 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10234 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10235 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10277 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10278 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10295 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10296 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10301 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10302 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10306 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10307 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2841, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm index d2bf51a75..e20554bda 100644 Binary files a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts index d45e64259..6d359ee37 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery.d.ts b/snapshots/master/demos/gallery/pkg/material/gallery.d.ts index 6f98b6434..6b9901260 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.d.ts +++ b/snapshots/master/demos/gallery/pkg/material/gallery.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery.js b/snapshots/master/demos/gallery/pkg/material/gallery.js index 9e578deca..efd15f150 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.js +++ b/snapshots/master/demos/gallery/pkg/material/gallery.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1639,63 +1639,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5159 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2439, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5153 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2440, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5161 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2439, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5155 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2440, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5162 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2439, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5156 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2440, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5163 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2439, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5157 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2440, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5164 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2439, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5158 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2440, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8384 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper8383 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9611 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9610 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9646 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9645 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9651 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9650 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9672 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9671 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9693 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9692 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9736 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9735 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9754 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9753 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9760 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9759 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9765 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9764 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2675, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm index b2f613de3..65796a8e2 100644 Binary files a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm and b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm differ diff --git a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts index d45e64259..6d359ee37 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts +++ b/snapshots/master/demos/gallery/pkg/material/gallery_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h070feb863beb5c73(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0610d8dab4a322ee(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts b/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts index 19c72858c..cd384e7de 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter.js b/snapshots/master/demos/imagefilter/pkg/imagefilter.js index 2fc4c5141..e38fab7a7 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.js +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1623,63 +1623,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1284 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1283 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 280, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1286 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1285 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 280, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1287 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1286 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 280, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1288 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1287 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 280, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1289 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1288 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 280, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4641 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4644 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5868 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5871 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5903 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5906 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5908 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5911 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5929 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5932 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5950 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5953 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5993 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5996 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6011 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6014 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6017 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6020 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6022 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6025 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm index 6aae01579..7a0d100be 100644 Binary files a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm and b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm differ diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts index 8b8a8b771..b2adcd116 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/memory/pkg/memory.d.ts b/snapshots/master/demos/memory/pkg/memory.d.ts index 19c72858c..cd384e7de 100644 --- a/snapshots/master/demos/memory/pkg/memory.d.ts +++ b/snapshots/master/demos/memory/pkg/memory.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/memory/pkg/memory.js b/snapshots/master/demos/memory/pkg/memory.js index 295cb257b..0e898abbd 100644 --- a/snapshots/master/demos/memory/pkg/memory.js +++ b/snapshots/master/demos/memory/pkg/memory.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_30(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1680,63 +1680,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1021 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1020 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 119, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1023 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1022 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 119, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1024 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1023 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 119, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1025 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1024 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 119, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1026 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1025 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 119, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4345 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4346 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5572 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5573 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5607 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5608 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5612 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5613 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5633 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5634 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5654 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5655 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5697 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5698 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5715 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5716 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5721 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5722 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5726 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5727 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_61); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm b/snapshots/master/demos/memory/pkg/memory_bg.wasm index f209606de..6f03ab603 100644 Binary files a/snapshots/master/demos/memory/pkg/memory_bg.wasm and b/snapshots/master/demos/memory/pkg/memory_bg.wasm differ diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts b/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts index 8b8a8b771..b2adcd116 100644 --- a/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts +++ b/snapshots/master/demos/memory/pkg/memory_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts index 19c72858c..cd384e7de 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js index 06f54790a..bade70209 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1658,63 +1658,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1138 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1135 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 176, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1140 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1137 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 176, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1141 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1138 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 176, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1142 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1139 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 176, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1143 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1140 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 176, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4456 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4458 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5683 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5685 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5718 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5720 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5723 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5725 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5744 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5746 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5765 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5767 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5808 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5810 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5826 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5828 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5832 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5834 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5837 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5839 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 417, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm index 0ed9e3149..bc9e7d161 100644 Binary files a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm and b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm differ diff --git a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts index 8b8a8b771..b2adcd116 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/plotter/pkg/plotter.d.ts b/snapshots/master/demos/plotter/pkg/plotter.d.ts index 19c72858c..cd384e7de 100644 --- a/snapshots/master/demos/plotter/pkg/plotter.d.ts +++ b/snapshots/master/demos/plotter/pkg/plotter.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/plotter/pkg/plotter.js b/snapshots/master/demos/plotter/pkg/plotter.js index 13438757c..dae9d4b50 100644 --- a/snapshots/master/demos/plotter/pkg/plotter.js +++ b/snapshots/master/demos/plotter/pkg/plotter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1642,43 +1642,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3543 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3544 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4771 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4772 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4806 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4807 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4811 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4812 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4832 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4833 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4853 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4854 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4896 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4897 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4914 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4915 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4920 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4921 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4925 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4926 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 320, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm index 1d41e614f..d9a3e891b 100644 Binary files a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm and b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm differ diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts index 8b8a8b771..b2adcd116 100644 --- a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts +++ b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts index 0555ba299..9f3c85eb9 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09769e58704e9e66: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8272e54ac9cf92c4: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js index f13f97cd2..2de47aba1 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09769e58704e9e66(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8272e54ac9cf92c4(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1661,63 +1661,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4593 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4592 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2121, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4595 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4594 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2121, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4597 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4596 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2121, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4599 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4598 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2121, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4601 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4600 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2121, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6050 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6049 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6052 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6051 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6054 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6053 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6056 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6055 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6058 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6057 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6060 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6059 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6062 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6061 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6065 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6064 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6073 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6072 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6757 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6756 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2654, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm index d106a3943..f080cd98f 100644 Binary files a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm and b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts index 60bf8adf5..9eb240159 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09769e58704e9e66(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8272e54ac9cf92c4(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts index 19c72858c..cd384e7de 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js index 1c7df79ec..c0342fff6 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1622,63 +1622,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1936 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1935 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 645, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1938 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1937 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 645, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1939 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1938 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 645, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1940 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1939 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 645, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1941 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1940 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 645, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5358 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5359 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6585 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6586 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6620 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6621 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6625 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6626 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6646 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6647 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6667 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6668 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6710 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6711 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6728 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6729 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6734 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6735 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6739 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6740 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 887, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm index 30950a4cf..838315e15 100644 Binary files a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm and b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm differ diff --git a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts index 8b8a8b771..b2adcd116 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h48296a89c6f51b7e(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ae013f90f3d28e0(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h244cdec477705644(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e0268d57010a93(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h725302ba204f3fa2(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts index 5897878ed..c4928f29a 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e7812152b46ec07: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317033bbdf194817: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f15d35de115d253: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6dc35c6612a10d78: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2055ca8d5cc9755b: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js index 02e3ad2c3..846e20fc9 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_30(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e7812152b46ec07(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317033bbdf194817(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1680,63 +1680,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1382 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 294, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1380 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 293, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1384 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 294, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1382 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 293, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1385 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 294, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1383 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 293, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1386 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 294, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1384 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 293, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1387 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 294, __wbg_adapter_30); + imports.wbg.__wbindgen_closure_wrapper1385 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 293, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4788 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4790 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6026 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6028 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6059 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6061 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6073 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6076 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6082 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6085 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6092 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6095 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6107 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6110 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6113 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6116 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6137 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6140 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6142 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6145 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_61); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm index 3f5ae030b..43871c38b 100644 Binary files a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm and b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm differ diff --git a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts index c525c78c1..f7ecc70a1 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function main(): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e7812152b46ec07(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317033bbdf194817(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f15d35de115d253(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6dc35c6612a10d78(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2055ca8d5cc9755b(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts index a05ea0c27..920fd1d45 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h216e7f43a6ba0093: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ac004b58ef7152b: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js index 58228598a..74a654f9a 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h216e7f43a6ba0093(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ac004b58ef7152b(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm index d2887bf8b..4e1cfbc56 100644 Binary files a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm and b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm differ diff --git a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts index 9ed8c91f4..ffdab2c0a 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h216e7f43a6ba0093(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ac004b58ef7152b(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/todo/pkg/todo_lib.d.ts b/snapshots/master/demos/todo/pkg/todo_lib.d.ts index 88e7ddfdc..aa7008a5c 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib.d.ts +++ b/snapshots/master/demos/todo/pkg/todo_lib.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0495472ba0d64dc3: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2e5cca879dcdf47: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/todo/pkg/todo_lib.js b/snapshots/master/demos/todo/pkg/todo_lib.js index 156cab681..be1dd563c 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib.js +++ b/snapshots/master/demos/todo/pkg/todo_lib.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0495472ba0d64dc3(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2e5cca879dcdf47(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1661,63 +1661,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2428 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper2427 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 957, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2430 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper2429 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 957, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2432 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper2431 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 957, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2434 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper2433 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 957, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2436 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper2435 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 957, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3883 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3882 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3885 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3884 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3887 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3886 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3889 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3888 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3891 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3890 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3893 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3892 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3895 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3894 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3898 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3897 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3906 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper3905 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4590 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4589 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 1490, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm index 076b861df..3b561dab1 100644 Binary files a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm and b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm differ diff --git a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts index 1d0d19666..df8342efe 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts +++ b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0495472ba0d64dc3(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2e5cca879dcdf47(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts b/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts index b8cfa6784..0f2035263 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo.d.ts @@ -17,7 +17,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1c1512f32a1f05cb: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h291377b4b7cb6ded: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo.js b/snapshots/master/demos/weather-demo/pkg/weather_demo.js index d20a6b940..c08228729 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo.js +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1c1512f32a1f05cb(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h291377b4b7cb6ded(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1692,63 +1692,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4893 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4892 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1972, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4895 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4894 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1972, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4897 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4896 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1972, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4899 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4898 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1972, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4901 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4900 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1972, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6354 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6353 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6356 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6355 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6358 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6357 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6360 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6359 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6362 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6361 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6364 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6363 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6366 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6365 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6369 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6368 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6377 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6376 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2459, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7061 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7060 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2503, __wbg_adapter_58); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm index c52efda88..5b6ac26db 100644 Binary files a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm and b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm differ diff --git a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts index aff6845de..2415150c6 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm.d.ts @@ -10,7 +10,7 @@ export function send_keyboard_string_sequence(a: number, b: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1c1512f32a1f05cb(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h291377b4b7cb6ded(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h041de744d037b7dd(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h33a1fc8dea1a116d(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8bee68100d61e980(a: number, b: number, c: number, d: number): void; diff --git a/snapshots/master/docs/cpp/api/library_root.html b/snapshots/master/docs/cpp/api/library_root.html index 63faa10a3..534807ab0 100644 --- a/snapshots/master/docs/cpp/api/library_root.html +++ b/snapshots/master/docs/cpp/api/library_root.html @@ -423,7 +423,7 @@

Class Hierarchy
  • diff --git a/snapshots/master/docs/cpp/searchindex.js b/snapshots/master/docs/cpp/searchindex.js index fc00d0999..327c6a02b 100644 --- a/snapshots/master/docs/cpp/searchindex.js +++ b/snapshots/master/docs/cpp/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["api/classslint_1_1Brush", "api/classslint_1_1Color", "api/classslint_1_1ComponentHandle", "api/classslint_1_1ComponentWeakHandle", "api/classslint_1_1FilterModel", "api/classslint_1_1MapModel", "api/classslint_1_1Model", "api/classslint_1_1ReverseModel", "api/classslint_1_1SortModel", "api/classslint_1_1VectorModel", "api/classslint_1_1Window", "api/classslint_1_1interpreter_1_1ComponentCompiler", "api/classslint_1_1interpreter_1_1ComponentDefinition", "api/classslint_1_1interpreter_1_1ComponentInstance", "api/classslint_1_1interpreter_1_1Value", "api/classslint_1_1platform_1_1AbstractRenderer", "api/classslint_1_1platform_1_1NativeWindowHandle", "api/classslint_1_1platform_1_1Platform", "api/classslint_1_1platform_1_1Platform_1_1Task", "api/classslint_1_1platform_1_1SkiaRenderer", "api/classslint_1_1platform_1_1SoftwareRenderer", "api/classslint_1_1platform_1_1WindowAdapter", "api/classslint_1_1testing_1_1ElementHandle", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95", "api/dir__home_runner_work_slint_slint_api", "api/dir__home_runner_work_slint_slint_api_cpp", "api/dir__home_runner_work_slint_slint_api_cpp_include", "api/dir_cppdocs", "api/dir_cppdocs_generated_include", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/file_cppdocs_generated_include_slint_brush_internal.h", "api/file_cppdocs_generated_include_slint_builtin_structs.h", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/file_cppdocs_generated_include_slint_color_internal.h", "api/file_cppdocs_generated_include_slint_enums.h", "api/file_cppdocs_generated_include_slint_enums_internal.h", "api/file_cppdocs_generated_include_slint_generated_public.h", "api/file_cppdocs_generated_include_slint_image_internal.h", "api/file_cppdocs_generated_include_slint_internal.h", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/file_cppdocs_generated_include_slint_interpreter_internal.h", "api/file_cppdocs_generated_include_slint_pathdata_internal.h", "api/file_cppdocs_generated_include_slint_platform_internal.h", "api/file_cppdocs_generated_include_slint_properties_internal.h", "api/file_cppdocs_generated_include_slint_qt_internal.h", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/file_cppdocs_generated_include_slint_string_internal.h", "api/file_cppdocs_generated_include_slint_testing_internal.h", "api/file_cppdocs_generated_include_slint_timer_internal.h", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505", "api/library_root", "api/namespace_slint", "api/namespace_slint__interpreter", "api/namespace_slint__platform", "api/namespace_slint__platform__key_codes", "api/namespace_slint__testing", "api/page_deprecated", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_enums.h", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h", "api/structslint_1_1HsvaColor", "api/structslint_1_1Image", "api/structslint_1_1LogicalPosition", "api/structslint_1_1LogicalSize", "api/structslint_1_1PhysicalPosition", "api/structslint_1_1PhysicalSize", "api/structslint_1_1Point", "api/structslint_1_1Rgb8Pixel", "api/structslint_1_1Rgba8Pixel", "api/structslint_1_1RgbaColor", "api/structslint_1_1SharedPixelBuffer", "api/structslint_1_1SharedString", "api/structslint_1_1SharedVector", "api/structslint_1_1Size", "api/structslint_1_1StandardListViewItem", "api/structslint_1_1Timer", "api/structslint_1_1interpreter_1_1Diagnostic", "api/structslint_1_1interpreter_1_1PropertyDescriptor", "api/structslint_1_1interpreter_1_1Struct", "api/structslint_1_1interpreter_1_1Struct_1_1iterator", "api/structslint_1_1platform_1_1Rgb565Pixel", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints", "api/unabridged_orphan", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec", "cmake", "cmake_reference", "generated_code", "genindex", "getting_started", "index", "overview", "types"], "filenames": ["api/classslint_1_1Brush.rst", "api/classslint_1_1Color.rst", "api/classslint_1_1ComponentHandle.rst", "api/classslint_1_1ComponentWeakHandle.rst", "api/classslint_1_1FilterModel.rst", "api/classslint_1_1MapModel.rst", "api/classslint_1_1Model.rst", "api/classslint_1_1ReverseModel.rst", "api/classslint_1_1SortModel.rst", "api/classslint_1_1VectorModel.rst", "api/classslint_1_1Window.rst", "api/classslint_1_1interpreter_1_1ComponentCompiler.rst", "api/classslint_1_1interpreter_1_1ComponentDefinition.rst", "api/classslint_1_1interpreter_1_1ComponentInstance.rst", "api/classslint_1_1interpreter_1_1Value.rst", "api/classslint_1_1platform_1_1AbstractRenderer.rst", "api/classslint_1_1platform_1_1NativeWindowHandle.rst", "api/classslint_1_1platform_1_1Platform.rst", "api/classslint_1_1platform_1_1Platform_1_1Task.rst", "api/classslint_1_1platform_1_1SkiaRenderer.rst", "api/classslint_1_1platform_1_1SoftwareRenderer.rst", "api/classslint_1_1platform_1_1WindowAdapter.rst", "api/classslint_1_1testing_1_1ElementHandle.rst", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7.rst", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9.rst", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f.rst", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d.rst", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4.rst", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79.rst", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd.rst", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9.rst", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0.rst", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a.rst", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552.rst", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5.rst", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9.rst", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3.rst", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a.rst", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853.rst", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364.rst", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95.rst", "api/dir__home_runner_work_slint_slint_api.rst", "api/dir__home_runner_work_slint_slint_api_cpp.rst", "api/dir__home_runner_work_slint_slint_api_cpp_include.rst", "api/dir_cppdocs.rst", "api/dir_cppdocs_generated_include.rst", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0.rst", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d.rst", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d.rst", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1.rst", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e.rst", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290.rst", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b.rst", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af.rst", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/file_cppdocs_generated_include_slint_color_internal.h.rst", "api/file_cppdocs_generated_include_slint_enums.h.rst", "api/file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/file_cppdocs_generated_include_slint_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_image_internal.h.rst", "api/file_cppdocs_generated_include_slint_internal.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/file_cppdocs_generated_include_slint_string_internal.h.rst", "api/file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658.rst", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3.rst", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64.rst", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4.rst", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0.rst", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430.rst", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c.rst", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b.rst", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505.rst", "api/library_root.rst", "api/namespace_slint.rst", "api/namespace_slint__interpreter.rst", "api/namespace_slint__platform.rst", "api/namespace_slint__platform__key_codes.rst", "api/namespace_slint__testing.rst", "api/page_deprecated.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/structslint_1_1HsvaColor.rst", "api/structslint_1_1Image.rst", "api/structslint_1_1LogicalPosition.rst", "api/structslint_1_1LogicalSize.rst", "api/structslint_1_1PhysicalPosition.rst", "api/structslint_1_1PhysicalSize.rst", "api/structslint_1_1Point.rst", "api/structslint_1_1Rgb8Pixel.rst", "api/structslint_1_1Rgba8Pixel.rst", "api/structslint_1_1RgbaColor.rst", "api/structslint_1_1SharedPixelBuffer.rst", "api/structslint_1_1SharedString.rst", "api/structslint_1_1SharedVector.rst", "api/structslint_1_1Size.rst", "api/structslint_1_1StandardListViewItem.rst", "api/structslint_1_1Timer.rst", "api/structslint_1_1interpreter_1_1Diagnostic.rst", "api/structslint_1_1interpreter_1_1PropertyDescriptor.rst", "api/structslint_1_1interpreter_1_1Struct.rst", "api/structslint_1_1interpreter_1_1Struct_1_1iterator.rst", "api/structslint_1_1platform_1_1Rgb565Pixel.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints.rst", "api/unabridged_orphan.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec.rst", "cmake.md", "cmake_reference.md", "generated_code.md", "genindex.rst", "getting_started.md", "index.rst", "overview.md", "types.md"], "titles": ["Class Brush", "Class Color", "Template Class ComponentHandle", "Template Class ComponentWeakHandle", "Template Class FilterModel", "Template Class MapModel", "Template Class Model", "Template Class ReverseModel", "Template Class SortModel", "Template Class VectorModel", "Class Window", "Class ComponentCompiler", "Class ComponentDefinition", "Class ComponentInstance", "Class Value", "Class AbstractRenderer", "Class NativeWindowHandle", "Class Platform", "Class Platform::Task", "Class SkiaRenderer", "Class SoftwareRenderer", "Class WindowAdapter", "Class ElementHandle", "Define SLINT_FEATURE_BACKEND_QT", "Define SLINT_FEATURE_GETTEXT", "Define SLINT_FEATURE_INTERPRETER", "Define SLINT_VERSION_PATCH", "Define SLINT_FEATURE_BACKEND_LINUXKMS", "Define SLINT_FEATURE_EXPERIMENTAL", "Define SLINT_VERSION_STRING", "Define SLINT_FEATURE_RENDERER_FEMTOVG", "Define SLINT_FEATURE_RENDERER_SKIA", "Define SLINT_FEATURE_SYSTEM_TESTING", "Define SLINT_FEATURE_ACCESSIBILITY", "Define SLINT_FEATURE_RENDERER_SOFTWARE", "Define SLINT_VERSION_MINOR", "Define SLINT_FEATURE_FREESTANDING", "Define SLINT_FEATURE_TESTING", "Define SLINT_VERSION_MAJOR", "Define SLINT_FEATURE_BACKEND_WINIT", "Define assert_eq", "Directory api", "Directory cpp", "Directory include", "Directory cppdocs", "Directory generated_include", "Enum ValueType", "Enum DiagnosticLevel", "Enum AccessibleRole", "Enum SetRenderingNotifierError", "Enum PointerEventButton", "Enum EventLoopMode", "Enum GraphicsAPI", "Enum RenderingState", "Enum CloseRequestResponse", "File slint-interpreter.h", "File slint-platform.h", "File slint-testing.h", "File slint.h", "File slint_brush.h", "File slint_callbacks.h", "File slint_color.h", "File slint_config.h", "File slint_image.h", "File slint_interpreter.h", "File slint_pathdata.h", "File slint_point.h", "File slint_properties.h", "File slint_sharedvector.h", "File slint_size.h", "File slint_string.h", "File slint_tests_helpers.h", "File slint_timer.h", "File slint_window.h", "File slint_brush_internal.h", "File slint_builtin_structs.h", "File slint_builtin_structs_internal.h", "File slint_color_internal.h", "File slint_enums.h", "File slint_enums_internal.h", "File slint_generated_public.h", "File slint_image_internal.h", "File slint_internal.h", "File slint_interpreter_generated_public.h", "File slint_interpreter_internal.h", "File slint_pathdata_internal.h", "File slint_platform_internal.h", "File slint_properties_internal.h", "File slint_qt_internal.h", "File slint_sharedvector_internal.h", "File slint_string_internal.h", "File slint_testing_internal.h", "File slint_timer_internal.h", "Function slint::platform::duration_until_next_timer_update", "Function slint::platform::update_timers_and_animations", "Function slint::platform::set_platform", "Function slint::testing::init", "Function slint::quit_event_loop", "Template Function slint::invoke_from_event_loop", "Template Function slint::blocking_invoke_from_event_loop", "Function slint::run_event_loop", "Function slint::update_all_translations", "C++ API Reference", "Namespace slint", "Namespace slint::interpreter", "Namespace slint::platform", "Namespace slint::platform::key_codes", "Namespace slint::testing", "Deprecated List", "Program Listing for File slint-interpreter.h", "Program Listing for File slint-platform.h", "Program Listing for File slint-testing.h", "Program Listing for File slint.h", "Program Listing for File slint_brush.h", "Program Listing for File slint_callbacks.h", "Program Listing for File slint_color.h", "Program Listing for File slint_config.h", "Program Listing for File slint_image.h", "Program Listing for File slint_interpreter.h", "Program Listing for File slint_pathdata.h", "Program Listing for File slint_point.h", "Program Listing for File slint_properties.h", "Program Listing for File slint_sharedvector.h", "Program Listing for File slint_size.h", "Program Listing for File slint_string.h", "Program Listing for File slint_tests_helpers.h", "Program Listing for File slint_timer.h", "Program Listing for File slint_window.h", "Program Listing for File slint_brush_internal.h", "Program Listing for File slint_builtin_structs.h", "Program Listing for File slint_builtin_structs_internal.h", "Program Listing for File slint_color_internal.h", "Program Listing for File slint_enums.h", "Program Listing for File slint_enums_internal.h", "Program Listing for File slint_generated_public.h", "Program Listing for File slint_image_internal.h", "Program Listing for File slint_internal.h", "Program Listing for File slint_interpreter_generated_public.h", "Program Listing for File slint_interpreter_internal.h", "Program Listing for File slint_pathdata_internal.h", "Program Listing for File slint_platform_internal.h", "Program Listing for File slint_properties_internal.h", "Program Listing for File slint_qt_internal.h", "Program Listing for File slint_sharedvector_internal.h", "Program Listing for File slint_string_internal.h", "Program Listing for File slint_testing_internal.h", "Program Listing for File slint_timer_internal.h", "Struct HsvaColor", "Struct Image", "Struct LogicalPosition", "Struct LogicalSize", "Struct PhysicalPosition", "Struct PhysicalSize", "Template Struct Point", "Struct Rgb8Pixel", "Struct Rgba8Pixel", "Template Struct RgbaColor", "Template Struct SharedPixelBuffer", "Struct SharedString", "Template Struct SharedVector", "Template Struct Size", "Struct StandardListViewItem", "Struct Timer", "Struct Diagnostic", "Struct PropertyDescriptor", "Struct Struct", "Struct Struct::iterator", "Struct Rgb565Pixel", "Struct SoftwareRenderer::PhysicalRegion", "Struct PhysicalRegion::Rect", "Struct WindowAdapter::WindowProperties", "Struct WindowProperties::LayoutConstraints", "Full API", "Variable slint::platform::key_codes::F24", "Variable slint::platform::key_codes::F1", "Variable slint::platform::key_codes::CapsLock", "Variable slint::platform::key_codes::Space", "Variable slint::platform::key_codes::Menu", "Variable slint::platform::key_codes::LeftArrow", "Variable slint::platform::key_codes::MetaR", "Variable slint::platform::key_codes::Pause", "Variable slint::platform::key_codes::F4", "Variable slint::platform::key_codes::F12", "Variable slint::platform::key_codes::Insert", "Variable slint::platform::key_codes::DownArrow", "Variable slint::platform::key_codes::AltGr", "Variable slint::platform::key_codes::Alt", "Variable slint::platform::key_codes::F23", "Variable slint::platform::key_codes::Stop", "Variable slint::platform::key_codes::F19", "Variable slint::platform::key_codes::ScrollLock", "Variable slint::platform::key_codes::F13", "Variable slint::platform::key_codes::F15", "Variable slint::platform::key_codes::F14", "Variable slint::platform::key_codes::Backspace", "Variable slint::platform::key_codes::F5", "Variable slint::platform::key_codes::F6", "Variable slint::platform::key_codes::Meta", "Variable slint::platform::key_codes::F9", "Variable slint::platform::key_codes::F20", "Variable slint::platform::key_codes::UpArrow", "Variable slint::platform::key_codes::F10", "Variable slint::platform::key_codes::F2", "Variable slint::platform::key_codes::F8", "Variable slint::platform::key_codes::F18", "Variable slint::platform::key_codes::PageDown", "Variable slint::platform::key_codes::F11", "Variable slint::platform::key_codes::F3", "Variable slint::platform::key_codes::Control", "Variable slint::platform::key_codes::F16", "Variable slint::platform::key_codes::ControlR", "Variable slint::platform::key_codes::Return", "Variable slint::platform::key_codes::F7", "Variable slint::platform::key_codes::Backtab", "Variable slint::platform::key_codes::Home", "Variable slint::platform::key_codes::RightArrow", "Variable slint::platform::key_codes::Escape", "Variable slint::platform::key_codes::SysReq", "Variable slint::platform::key_codes::F21", "Variable slint::platform::key_codes::F17", "Variable slint::platform::key_codes::PageUp", "Variable slint::platform::key_codes::Tab", "Variable slint::platform::key_codes::End", "Variable slint::platform::key_codes::ShiftR", "Variable slint::platform::key_codes::Delete", "Variable slint::platform::key_codes::Shift", "Variable slint::platform::key_codes::F22", "Set Up Development Environment", "CMake Reference", "Generated Code", "Index (C++)", "Getting Started", "Slint C++ documentation", "Overview", "Type Mappings"], "terms": {"defin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 109, 110, 112, 115, 116, 117, 122, 125, 127, 134, 135, 136, 138, 139, 142, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 229, 234], "file": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234], "slint_brush": [0, 43, 61, 70, 74, 82, 102, 136, 172], "h": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 97, 98, 99, 100, 101, 103, 104, 105, 107, 109, 110, 112, 113, 118, 120, 122, 123, 129, 130, 132, 133, 142, 144, 148, 153, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234], "us": [0, 1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 17, 20, 21, 22, 26, 29, 35, 38, 46, 48, 50, 51, 52, 53, 98, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 119, 120, 121, 123, 125, 126, 127, 128, 130, 133, 135, 136, 138, 140, 141, 142, 148, 153, 157, 158, 159, 160, 162, 164, 165, 166, 168, 170, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 233, 234], "how": [0, 20, 103, 157, 227, 231, 232, 233], "fill": [0, 20, 133, 136], "outlin": 0, "shape": [0, 148], "rectangl": [0, 20, 110, 136, 168, 169], "path": [0, 11, 41, 42, 43, 44, 45, 109, 117, 127, 135, 136, 138, 140, 148, 163, 227, 228], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232], "A": [0, 3, 6, 9, 13, 14, 17, 18, 20, 22, 40, 46, 50, 105, 112, 114, 125, 127, 148, 149, 150, 151, 152, 158, 162, 165, 166, 167, 168, 169, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 234], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 233, 234], "linear": [0, 136], "gradient": [0, 113], "public": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 123, 127, 128, 135, 139, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 234], "function": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 51, 104, 106, 109, 112, 125, 127, 138, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 169, 170, 172, 228, 229, 231, 233], "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 93, 94, 95, 96, 97, 100, 101, 109, 110, 111, 112, 113, 115, 117, 121, 124, 125, 127, 136, 142, 148, 149, 150, 151, 152, 156, 157, 158, 159, 162, 165, 166, 167, 168, 170, 229], "construct": [0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 14, 19, 20, 21, 22, 109, 148, 149, 151, 156, 157, 158, 159, 162, 165, 166, 167], "new": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 19, 20, 21, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 111, 112, 114, 121, 122, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 156, 157, 158, 159, 165, 166, 229, 231, 233], "transpar": [0, 1], "const": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 108, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 170, 229, 234], "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 54, 78, 93, 97, 99, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 153, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 231], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229], "thi": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 46, 48, 49, 50, 52, 53, 54, 94, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 112, 113, 115, 121, 122, 124, 125, 127, 128, 129, 130, 132, 133, 135, 139, 142, 148, 156, 157, 158, 159, 162, 165, 166, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233], "stop": [0, 22, 78, 102, 106, 113, 126, 132, 162], "brighter": [0, 1, 113, 115], "float": [0, 1, 10, 22, 46, 109, 111, 112, 113, 115, 120, 121, 123, 125, 127, 128, 130, 131, 135, 136, 139, 140, 141, 142, 147, 149, 150, 156, 234], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 234], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 233], "bright": [0, 1], "increas": [0, 1, 22, 110], "specifi": [0, 1, 5, 8, 9, 10, 11, 12, 13, 17, 19, 21, 98, 99, 158, 162, 165, 227, 228], "done": [0, 1, 52, 227], "call": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 18, 19, 20, 21, 22, 51, 94, 95, 96, 97, 98, 99, 105, 109, 110, 112, 114, 127, 148, 162, 165, 166, 228, 229, 231], "all": [0, 5, 7, 8, 9, 12, 14, 20, 22, 51, 100, 101, 102, 103, 112, 157, 159, 165, 168, 227, 228, 229, 233, 234], "darker": [0, 1, 113, 115], "decreas": [0, 1, 22, 228], "transparent": [0, 1, 113, 115], "opac": [0, 1, 136], "with_alpha": [0, 1, 113, 115], "alpha": [0, 1, 113, 115, 131, 147, 155, 156, 234], "relat": 0, "": [0, 1, 4, 5, 8, 9, 10, 13, 19, 20, 22, 48, 105, 107, 109, 113, 115, 123, 124, 127, 131, 148, 150, 152, 158, 159, 164, 165, 166, 227, 228, 229, 231, 232, 233], "set": [0, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 22, 49, 98, 100, 105, 112, 121, 148, 165, 170, 171, 228, 229, 231, 233], "friend": [0, 1, 4, 5, 7, 8, 14, 109, 110, 112, 113, 115, 117, 119, 121, 122, 124, 127, 129, 130, 134, 136, 148, 158, 159, 165, 166, 167], "struct": [0, 1, 4, 5, 7, 8, 14, 20, 21, 46, 55, 56, 61, 63, 66, 68, 69, 70, 72, 75, 80, 83, 103, 104, 105, 106, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 234], "private_api": [0, 1, 2, 4, 5, 7, 8, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 124, 125, 127, 136, 142], "properti": [0, 10, 12, 13, 14, 21, 22, 48, 98, 99, 109, 112, 113, 115, 121, 136, 138, 142, 148, 164, 170, 227, 228, 229, 231, 232, 233, 234], "bool": [0, 1, 4, 8, 10, 13, 14, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 145, 146, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 229, 234], "oper": [0, 1, 2, 6, 10, 12, 14, 16, 17, 18, 19, 20, 109, 110, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 134, 135, 136, 139, 141, 142, 144, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 227], "b": [0, 14, 40, 109, 110, 112, 113, 117, 119, 122, 124, 125, 134, 136, 138, 148, 154, 155, 158, 159, 165, 166, 167], "true": [0, 1, 4, 10, 13, 14, 21, 22, 101, 109, 110, 111, 112, 121, 125, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 167, 170], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 233], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 227, 229], "also": [0, 4, 5, 6, 7, 8, 9, 10, 14, 46, 98, 99, 158, 159, 228, 229, 231, 232], "ident": [0, 167], "fals": [0, 1, 10, 13, 21, 22, 109, 110, 111, 112, 122, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 170], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233], "what": [0, 17, 111, 136], "thei": [0, 153, 156, 157, 160], "respect": 0, "ar": [0, 10, 11, 13, 14, 16, 20, 21, 49, 51, 93, 95, 100, 101, 102, 103, 106, 109, 112, 120, 123, 148, 153, 156, 157, 159, 160, 163, 165, 167, 227, 228, 229, 231, 233, 234], "otherwis": [0, 1, 3, 13, 14, 21, 22, 99, 110, 148, 153, 158, 159, 160, 162, 165, 166, 170], "listview": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 229, 230, 232, 233], "slint_color": [1, 43, 59, 67, 77, 82, 102, 113, 136, 147, 156, 172], "repres": [1, 10, 13, 14, 20, 21, 46, 48, 153, 154, 155, 160, 161, 165, 168, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 234], "slint": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52, 53, 54, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 108, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 149, 150, 151, 152, 157, 158, 159, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 228, 229, 231, 234], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 234], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 234], "8": [1, 115, 134, 138, 142, 158, 167, 234], "bit": [1, 167, 234], "channel": 1, "red": [1, 110, 115, 131, 154, 155, 156, 167], "green": [1, 110, 115, 131, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 154, 155, 156, 167, 231, 232], "default": [1, 3, 4, 6, 7, 8, 9, 10, 17, 21, 22, 46, 54, 100, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 123, 126, 127, 129, 130, 133, 134, 135, 136, 139, 144, 148, 149, 151, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 171, 227, 228, 234], "entir": [1, 234], "rgbacolor": [1, 61, 102, 103, 115], "uint8_t": [1, 47, 49, 52, 53, 54, 109, 110, 111, 112, 115, 117, 122, 124, 127, 130, 131, 134, 135, 136, 137, 138, 140, 142, 143, 145, 146, 154, 155, 156, 167], "col": [1, 115, 131, 156], "from": [1, 3, 9, 11, 12, 13, 14, 16, 17, 18, 21, 97, 98, 99, 100, 105, 110, 112, 120, 122, 123, 127, 129, 130, 132, 133, 136, 141, 148, 156, 157, 158, 164, 165, 166, 167, 228, 229, 231, 232, 233], "given": [1, 4, 5, 7, 8, 9, 13, 16, 17, 19, 22, 110, 150, 152, 156, 157, 158, 159, 162, 165, 228], "uint32_t": [1, 16, 20, 110, 112, 115, 117, 123, 127, 135, 136, 140, 142, 148, 152, 157], "as_argb_encod": [1, 115], "encod": [1, 20, 158, 167, 234], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 234], "an": [1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 17, 18, 20, 22, 46, 47, 48, 95, 98, 105, 112, 136, 148, 154, 155, 157, 158, 161, 163, 165, 167, 168, 169, 227, 228, 229, 231, 232, 233, 234], "easi": [1, 233], "destructur": [1, 165, 166], "to_argb_float": [1, 115], "hsvacolor": [1, 61, 102, 103, 115], "to_hsva": [1, 115], "hsv": [1, 115, 147], "space": [1, 78, 102, 106, 112, 132, 136, 147], "u8": [1, 132, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "rang": [1, 56, 110, 156, 157, 159, 165], "0": [1, 6, 13, 14, 17, 21, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 152, 154, 155, 156, 167, 227, 228, 229, 231], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 234], "valu": [1, 4, 5, 7, 8, 9, 10, 13, 17, 20, 21, 22, 26, 35, 38, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 99, 102, 104, 109, 111, 112, 113, 115, 121, 122, 127, 136, 138, 140, 141, 142, 147, 148, 154, 155, 156, 159, 165, 166, 167, 170, 171, 228, 229, 233, 234], "1": [1, 13, 26, 29, 35, 38, 109, 110, 112, 113, 115, 122, 134, 135, 136, 137, 138, 142, 147, 148, 156, 163, 227, 228, 231], "The": [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 98, 99, 100, 101, 102, 103, 104, 105, 106, 113, 120, 123, 147, 148, 153, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 227, 228, 229, 231, 233, 234], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 53, 97, 227, 229], "rgb": [1, 20, 135, 148, 154], "unchang": 1, "so": [1, 7, 10, 20, 112, 136, 165, 166, 167, 168, 227, 228, 231], "exampl": [1, 5, 10, 13, 26, 29, 35, 38, 50, 53, 98, 99, 101, 105, 106, 109, 112, 148, 156, 157, 158, 227, 228, 233, 234], "2": [1, 13, 26, 29, 35, 38, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 228, 231, 232], "20": [1, 142, 227], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": 1, "3": [1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 231], "30": [1, 142], "obtain": 1, "mix": [1, 115], "other": [1, 3, 10, 12, 14, 16, 17, 18, 46, 50, 53, 96, 98, 105, 109, 110, 112, 115, 117, 120, 122, 123, 124, 125, 127, 128, 131, 132, 135, 136, 137, 138, 139, 141, 153, 157, 158, 159, 160, 165, 166, 227], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 233], "while": [1, 10, 11, 99, 227], "static": [1, 16, 22, 109, 110, 111, 112, 113, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 136, 139, 142, 148, 158, 162, 227], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 234], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 233], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233], "from_argb_float": [1, 115], "from_rgb_float": [1, 115], "from_hsva": [1, 115], "v": [1, 14, 17, 21, 109, 112, 115, 121, 125, 131], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 233], "hue": [1, 115, 147], "expect": 1, "360": [1, 147], "lineargradientbrush": [1, 113, 115, 128], "lh": [1, 110, 115, 167], "rh": [1, 110, 115, 167], "same": [1, 14, 20, 110, 148, 159, 165, 166, 229, 234], "individu": 1, "std": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 93, 95, 98, 99, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 130, 132, 142, 148, 158, 159, 162, 165, 166, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 229, 233, 234], "ostream": [1, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 115, 124, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 158], "stream": [1, 115, 124, 158], "write": [1, 158, 231], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234], "typenam": [2, 3, 4, 5, 6, 7, 8, 9, 20, 22, 109, 110, 111, 112, 114, 115, 117, 120, 121, 122, 123, 125, 127, 135, 136, 138, 143, 144, 153, 156, 157, 159, 160, 165, 229], "t": [2, 3, 13, 17, 22, 48, 109, 111, 112, 115, 120, 121, 122, 123, 125, 136, 138, 143, 144, 153, 156, 159, 160, 229, 233], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 233], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231], "share": [2, 10, 12, 148, 157, 158, 159, 227], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 233], "gener": [2, 122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 228, 231, 233, 234], "code": [2, 10, 11, 14, 98, 104, 109, 112, 148, 164, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 231, 232, 233, 234], "In": [2, 13, 15, 21, 112, 227, 232], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 234], "get": [2, 109, 112, 121, 167, 227, 233], "creat": [2, 10, 12, 13, 14, 16, 17, 19, 53, 95, 98, 99, 104, 109, 112, 115, 127, 148, 156, 158, 159, 165, 166, 228, 229, 231, 232, 233], "where": [2, 15, 163, 233], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 234], "give": 2, "you": [2, 10, 12, 13, 14, 19, 21, 26, 29, 35, 38, 98, 102, 104, 105, 107, 148, 157, 165, 166, 227, 228, 229, 231, 232, 233], "vtabl": [2, 13, 82, 109, 111, 112, 127, 135, 136, 138, 141, 142], "vrc": [2, 109, 111, 112, 127, 135, 136, 138], "itemtreevt": [2, 109, 112, 127, 136, 138], "inner": [2, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 127, 138], "intern": [2, 14, 15, 16, 20, 46, 98, 109, 125, 142, 157], "constructor": [2, 14, 16, 17, 18, 19, 109, 136, 148, 157, 158, 165, 167, 229], "arrow": 2, "implement": [2, 4, 6, 7, 8, 9, 10, 14, 15, 17, 20, 21, 105, 112, 156, 165, 166, 227, 229], "semant": 2, "derefer": [2, 158, 165, 166], "into_dyn": [2, 111, 112, 127], "weak": [3, 127], "can": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 20, 21, 22, 95, 96, 98, 102, 104, 105, 106, 112, 136, 148, 157, 159, 162, 165, 166, 168, 170, 171, 227, 228, 229, 231, 232, 233, 234], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 233], "null": [3, 13, 158, 162], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 234], "empti": [3, 9, 12, 13, 14, 112, 122, 124, 127, 136, 157, 158, 159, 165], "copi": [3, 12, 14, 17, 109, 133, 148, 157, 158, 159, 165, 166, 231], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 72, 93, 107, 109, 110, 111, 112, 117, 126, 127, 136, 148, 162, 165, 170, 171, 227, 228, 233], "strong": [3, 10, 13], "point": [3, 11, 66, 102, 103, 104, 105, 110, 119, 120, 127, 136, 139, 149, 151, 158, 159, 165, 166, 231, 233, 234], "still": [3, 13, 20, 22, 107, 112, 229], "referenc": [3, 10, 14, 19, 158, 165, 166], "ani": [3, 10, 11, 13, 16, 17, 18, 21, 22, 96, 98, 148, 227, 228, 232, 234], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 233], "modeldata": [4, 6, 7, 8, 9, 112], "act": [4, 5, 7, 8, 12, 17], "adapt": [4, 5, 7, 8, 21, 53, 227], "sourc": [4, 5, 7, 8, 112, 136, 148, 163, 228, 231, 233], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 234], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229], "e": [4, 22, 122, 227, 231], "visibl": [4, 10, 17, 21, 22, 110, 112, 116, 228], "shared_ptr": [4, 5, 7, 8, 14, 109, 112, 121, 229, 233], "source_model": [4, 5, 7, 8, 112], "filter_fn": [4, 112], "provid": [4, 5, 6, 7, 8, 10, 16, 17, 19, 20, 21, 22, 48, 53, 54, 98, 158, 165, 166, 170, 228, 229, 231, 232, 233], "limit": [4, 112, 229], "view": [4, 5, 6, 7, 8, 20, 21, 110, 112, 124, 158, 165, 166, 168, 169], "expos": [4, 5, 165, 166, 227, 229, 231], "virtual": [4, 5, 6, 7, 8, 9, 17, 19, 20, 21, 110, 112, 142], "size_t": [4, 5, 6, 7, 8, 9, 20, 109, 110, 112, 113, 119, 122, 127, 159], "row_count": [4, 5, 6, 7, 8, 9, 109, 112, 138], "overrid": [4, 5, 7, 8, 9, 21, 109, 110, 112], "amount": [4, 5, 6, 7, 8, 9, 17, 20], "row_data": [4, 5, 6, 7, 8, 9, 109, 112, 138], "data": [4, 5, 6, 7, 8, 9, 16, 109, 110, 111, 112, 113, 117, 119, 121, 124, 126, 127, 135, 136, 140, 142, 148, 157, 158, 159, 229, 232, 233, 234], "particular": [4, 5, 6, 7, 8, 9, 227], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228], "void": [4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 22, 46, 94, 95, 96, 97, 98, 100, 101, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 131, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 159, 162, 165, 229], "set_row_data": [4, 6, 7, 8, 9, 109, 112, 138], "onli": [4, 5, 6, 7, 8, 9, 13, 14, 17, 18, 20, 21, 95, 98, 101, 104, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 158, 159, 227, 228, 229], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 233], "ok": [4, 6, 7, 8, 9, 112, 133], "do": [4, 6, 7, 8, 9, 13, 17, 20, 21, 104, 110, 112, 125, 148, 168, 227, 229], "noth": [4, 6, 7, 8, 9, 17, 21, 162], "print": [4, 6, 7, 8, 9], "warn": [4, 6, 7, 8, 9, 11, 47, 109, 118, 125, 137, 163], "stderr": [4, 6, 7, 8, 9], "updat": [4, 6, 7, 8, 9, 21, 112, 165], "row_chang": [4, 6, 7, 8, 9, 109, 112], "reset": [4, 5, 6, 8, 109, 112, 133], "re": [4, 5, 8, 10, 13, 15, 17, 20, 21, 26, 29, 35, 38, 101, 105, 162, 165, 166, 227, 229], "state": [4, 5, 8, 10, 21, 53, 112, 127, 232], "extern": [4, 5, 8, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 157, 227], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 234], "unfiltered_row": [4, 112], "filtered_row": [4, 112], "index": [4, 6, 8, 9, 109, 111, 112, 122, 135, 136, 142, 159], "correspond": [4, 8, 17, 21, 46, 231], "filtermodelinn": [4, 112], "sourcemodeldata": [5, 6, 112], "mappedmodeldata": [5, 6, 112], "map": [5, 228, 229, 233], "allow": [5, 10, 54, 104, 229, 233], "transform": [5, 13, 110, 229], "fly": [5, 11], "two": [5, 20, 21, 153, 157, 160, 231], "underli": [5, 9, 14, 22, 148, 158, 159], "permit": 5, "itself": [5, 13, 158], "For": [5, 13, 26, 29, 35, 38, 46, 50, 148, 156, 158, 227, 229, 231, 232, 234], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 233], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 233, 234], "to_str": [5, 13, 14, 109], "lambda": 5, "express": [5, 46], "map_fn": [5, 112], "alter": 5, "mapmodelinn": [5, 112], "filtermodel": [6, 58, 102, 103, 112], "mapmodel": [6, 58, 102, 103, 112], "reversemodel": [6, 58, 102, 103, 112], "sortmodel": [6, 58, 102, 103, 112], "vectormodel": [6, 58, 102, 103, 112, 229], "repetit": [6, 229, 233], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 233], "languag": [6, 101, 112, 227, 229, 231, 233], "subclass": [6, 15, 21, 105, 233], "delet": [6, 10, 16, 17, 18, 19, 20, 78, 102, 106, 109, 110, 112, 114, 121, 126, 127, 132, 142, 148, 162, 165, 166], "protect": [6, 112], "notifi": [6, 49, 98, 109, 138], "specif": [6, 10, 21, 52, 232, 234], "wa": [6, 10, 13, 14, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 53, 110, 112, 127, 148, 162, 231], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 234], "were": [6, 11, 20, 21], "ad": 6, "row_remov": [6, 109, 112], "remov": [6, 9, 159], "been": [6, 21, 22, 53, 162, 165], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 233], "revers": 7, "reversemodelinn": [7, 112], "sort": [8, 112], "pair": [8, 109, 130, 165, 166], "comp": [8, 112], "unsorted_row": [8, 112], "sorted_row_index": [8, 112], "sortmodelinn": [8, 112], "sharedvector": [9, 11, 12, 14, 22, 68, 102, 103, 109, 110, 111, 112, 113, 117, 119, 122, 128, 135, 136, 138, 139, 140, 143, 145], "vector": [9, 11, 12, 14, 58, 112, 159, 163, 164, 229], "arrai": [9, 14, 46, 109, 112, 157, 229], "push_back": [9, 112, 113, 122, 159], "append": [9, 158, 159], "eras": [9, 112], "insert": [9, 78, 102, 106, 112, 132, 227], "clear": [9, 11, 112, 122, 159], "set_vector": [9, 112], "replac": [9, 229], "slint_window": [10, 43, 58, 82, 102, 112, 172], "toward": [10, 229], "system": [10, 13, 16, 17, 21, 100, 105, 148, 227, 228, 229, 232, 233], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229], "scene": [10, 19, 20, 53, 105], "It": [10, 12, 14, 17, 20, 21, 48, 51, 54, 148, 157, 158, 159, 164, 165, 166, 168, 170, 171, 227, 231, 232, 233], "api": [10, 13, 21, 42, 43, 52, 98, 103, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 227, 229, 231, 232, 233], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227], "aspect": [10, 13, 163, 227], "posit": [10, 13, 21, 22, 110, 113, 127, 128, 136, 140, 149, 151], "screen": [10, 13, 16, 20, 21, 48, 96, 100, 110, 140, 148, 168, 229], "destroi": [10, 11, 12, 14, 16, 53, 158, 159, 165, 166], "instanc": [10, 11, 12, 13, 17, 104, 109, 112, 148, 156, 158, 165, 229, 233], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 233], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231], "addit": [10, 227], "associ": [10, 13, 20, 21, 229, 231], "maintain": 10, "hide": [10, 13, 21, 109, 122, 127, 229], "make": [10, 158, 159, 162, 165, 166, 227, 233], "invis": 10, "again": [10, 21], "drop": [10, 109, 122, 136, 138, 140], "anymor": [10, 22, 96, 148], "when": [10, 11, 12, 17, 19, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 49, 51, 53, 54, 100, 101, 105, 109, 127, 148, 158, 159, 162, 165, 166, 227, 228, 229], "is_vis": [10, 127, 138], "even": [10, 51, 233], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 233, 234], "minim": [10, 21, 127, 158, 170, 231], "templat": [10, 13, 20, 22, 58, 61, 63, 66, 68, 69, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 120, 121, 122, 123, 125, 126, 127, 135, 136, 138, 143, 144, 149, 150, 151, 152, 162, 165, 229, 233], "invoc": [10, 13, 20, 22, 98, 99, 109, 111, 112, 126, 127, 148, 162], "renderingst": [10, 80, 102, 103, 127, 134, 136], "graphicsapi": [10, 80, 102, 103, 127, 134, 136], "f": [10, 13, 98, 99, 109, 112, 114, 115, 121, 126, 127, 162], "setrenderingnotifiererror": [10, 80, 102, 103, 127, 134, 136], "set_rendering_notifi": [10, 53, 127, 148], "callback": [10, 12, 13, 20, 21, 22, 53, 54, 97, 109, 110, 114, 126, 127, 136, 138, 141, 146, 148, 162, 229, 231, 233], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": 10, "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231], "success": 10, "without": [10, 46, 105, 165, 227], "error": [10, 11, 47, 49, 112, 136, 137, 163], "on_close_request": [10, 54, 127], "tri": [10, 54], "close": [10, 21, 51, 54, 100, 133, 139, 231], "closerequestrespons": [10, 80, 102, 103, 127, 134, 136], "request_redraw": [10, 21, 110, 127, 140], "issu": 10, "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 234], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 234], "includ": [10, 11, 16, 21, 42, 46, 98, 99, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 227, 228, 229, 231], "frame": [10, 20, 21], "present": [10, 21, 22, 53, 102], "set_posit": [10, 21, 110, 127, 140], "logicalposit": [10, 22, 66, 102, 103, 111, 120, 127, 136, 151, 234], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 234], "some": [10, 11, 125, 136, 231], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 227, 229, 233], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169], "size": [10, 19, 20, 21, 22, 69, 102, 103, 109, 110, 111, 112, 113, 117, 122, 123, 124, 127, 135, 136, 140, 143, 148, 150, 152, 157, 159, 168, 169, 170, 171, 227, 234], "exclud": [10, 21, 227], "set_siz": [10, 21, 110, 127, 140], "logicals": [10, 21, 22, 69, 102, 103, 110, 111, 123, 127, 136, 152, 170, 171], "resiz": [10, 21, 112, 127, 136, 170, 171], "logic": [10, 13, 21, 112, 149, 150, 228, 229, 232, 234], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 234], "scale_factor": [10, 127, 136], "scale": [10, 21, 148], "is_fullscreen": [10, 21, 108, 110, 127, 170], "current": [10, 11, 53, 142, 148], "fullscreen": [10, 21, 108, 110, 127, 170], "set_fullscreen": [10, 127], "unset": [10, 21, 170, 171], "displai": [10, 16, 20, 53, 105, 110, 140, 148, 232], "is_maxim": [10, 21, 110, 127, 170], "maxim": [10, 21, 127, 170], "set_maxim": [10, 127], "unmaxim": 10, "is_minim": [10, 21, 110, 127, 170], "set_minim": [10, 127], "unminimz": 10, "dispatch_key_press_ev": [10, 106, 127, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "sharedstr": [10, 11, 12, 13, 14, 17, 21, 22, 70, 102, 103, 106, 109, 110, 111, 112, 117, 119, 124, 125, 127, 129, 130, 135, 136, 137, 138, 139, 140, 142, 144, 145, 148, 161, 163, 164, 170, 229, 233, 234], "dispatch": 10, "kei": [10, 106, 109, 165, 166, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "press": [10, 125, 127, 136, 142], "event": [10, 13, 17, 18, 21, 50, 51, 94, 97, 98, 99, 100, 110, 119, 127, 136, 139, 140, 229, 231, 233], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233], "own": [10, 105, 110, 227, 229, 233], "backend": [10, 13, 49, 96, 105, 136, 142], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 109, 112, 127], "input": [10, 13, 21, 94, 100, 229], "unicod": 10, "represent": [10, 12, 29, 158], "dispatch_key_press_repeat_ev": [10, 127], "auto": [10, 13, 20, 22, 98, 99, 109, 110, 111, 112, 117, 121, 122, 124, 127, 129, 130, 132, 133, 158, 165, 166, 168, 227, 229, 231], "repeat": [10, 112, 126, 130, 133, 136, 146, 162], "dispatch_key_release_ev": [10, 106, 127], "releas": [10, 53, 110, 127, 136, 142, 227, 231], "dispatch_pointer_press_ev": [10, 127], "pointereventbutton": [10, 78, 102, 103, 127, 130, 132, 133, 136], "button": [10, 22, 48, 50, 127, 130, 132, 136], "mous": [10, 13, 50], "rel": [10, 11, 162, 234], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 233], "dispatch_pointer_move_ev": [10, 127], "move": [10, 14, 16, 17, 18, 109, 110, 111, 112, 114, 121, 122, 126, 127, 133, 136, 158, 159, 165, 166], "dispatch_pointer_scroll_ev": [10, 127], "delta_x": [10, 127, 130, 136], "delta_i": [10, 127, 130, 136], "scroll": 10, "wheel": [10, 127, 136], "delta": 10, "x": [10, 20, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 227, 229, 231, 232, 234], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 234], "direct": [10, 14, 21], "dispatch_resize_ev": [10, 21, 127], "after": [10, 11, 20, 21, 97, 162], "send": [10, 17, 21], "ensur": [10, 16, 227], "width": [10, 20, 21, 110, 111, 112, 117, 123, 127, 130, 135, 136, 142, 148, 157, 160, 231, 232], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172], "right": [10, 20, 50, 117, 132, 133, 135, 148], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165], "creation": 10, "dispatch_window_active_changed_ev": [10, 127], "activ": [10, 109, 127, 162], "de": [10, 13, 14, 165, 166, 229], "gain": 10, "focu": 10, "lose": 10, "dispatch_close_requested_ev": [10, 21, 127], "effect": 10, "depend": [10, 112, 141, 227], "has_active_anim": [10, 21, 127], "anim": [10, 21, 94, 121], "interpret": [11, 12, 13, 14, 43, 46, 47, 64, 83, 102, 103, 115, 118, 137, 138, 163, 164, 165, 166, 172], "entri": [11, 103, 104, 105, 165, 166, 233], "load": [11, 102, 103, 104, 148, 228, 233], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 227, 231], "up": [11, 20, 98, 133, 228, 231, 233], "import": [11, 105, 148, 228], "set_styl": [11, 109], "string_view": [11, 12, 13, 22, 57, 59, 63, 65, 67, 70, 109, 111, 113, 117, 119, 121, 124, 158, 165, 166, 234], "style": [11, 109, 138], "widget": [11, 48], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 233, 234], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228], "diagnost": [11, 47, 83, 102, 104, 109, 112, 137, 138], "produc": [11, 165], "build_from_path": [11, 12, 104, 109], "componentdefinit": [11, 13, 55, 102, 104, 109, 164, 233], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": 11, "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 234], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 233], "And": 12, "instanti": [12, 229, 233], "factori": [12, 17], "ve": [12, 229], "finish": [12, 99], "safe": [12, 98, 158], "assign": [12, 14, 148, 158, 159, 165, 166], "componentinst": [12, 55, 102, 104, 109, 138, 233], "propertydescriptor": [12, 83, 102, 104, 109, 137, 138], "describ": [12, 20, 21, 47, 48, 49, 50, 52, 53, 54, 148, 163, 164, 170, 171, 232], "list": [12, 48, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 172], "read": [12, 99, 112, 165, 227, 231], "written": [12, 165, 232], "set_properti": [12, 13, 109, 228], "get_properti": [12, 13, 109], "set_callback": [12, 13, 109], "global": [12, 13, 101, 109, 138, 227, 228, 233], "export": [12, 13, 22, 229, 231, 232, 233, 234], "singleton": [12, 13, 233], "global_properti": [12, 109], "global_nam": [12, 109, 138], "descriptor": 12, "publicli": 12, "exist": [12, 13, 15, 22, 112, 148, 157, 158, 165, 227, 228], "under": [12, 158], "global_callback": [12, 109], "global_funct": [12, 109], "privat": [13, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 139, 228, 229, 231], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 233], "put": [13, 228], "mark": [13, 231], "window": [13, 16, 17, 19, 20, 21, 49, 51, 53, 54, 73, 95, 96, 100, 102, 103, 105, 106, 109, 110, 112, 125, 127, 140, 148, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 234], "shown": [13, 21, 54, 98, 170, 233], "react": [13, 100, 229, 233], "draw": [13, 148], "touch": 13, "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231], "run_event_loop": [13, 17, 51, 58, 97, 102, 103, 109, 110, 112, 140, 229], "receiv": [13, 21, 98, 100], "further": [13, 229], "integr": [13, 103, 157, 227, 232, 233], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231], "world": [13, 231, 232], "correctli": 13, "could": [13, 227], "becaus": [13, 110, 122, 148, 231], "proper": 13, "behind": 13, "span": [13, 20, 58, 63, 109, 110, 112, 117, 136], "arg": [13, 109, 114, 122, 136, 138, 141, 159, 165, 229], "imagin": 13, "contain": [13, 14, 20, 21, 46, 106, 125, 133, 157, 158, 159, 170, 228, 229, 231, 233], "foo": [13, 14, 22, 109, 234], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136], "match": [13, 22, 112, 227], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 233], "did": 13, "handler": [13, 94, 229], "functor": [13, 98, 99, 112, 229], "take": [13, 109, 148, 228, 229], "slice": [13, 109, 111, 112, 117, 122, 124, 135, 136, 138, 140, 144, 145, 148], "cout": 13, "to_numb": [13, 14, 109], "n": [13, 112, 124, 125, 136, 144, 158], "sinc": [13, 17, 20, 227], "captur": 13, "set_global_properti": [13, 109, 233], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 233], "set_global_callback": [13, 109, 233], "preview": [13, 22, 232], "pure": 13, "to_uppercas": [13, 229], "arg1": 13, "begin": [13, 20, 109, 110, 112, 113, 117, 122, 124, 133, 136, 148, 157, 158, 159, 165, 166, 229], "end": [13, 20, 78, 102, 106, 109, 110, 112, 113, 117, 122, 124, 132, 133, 136, 157, 158, 159, 165, 166, 227, 229], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 233], "type": [14, 18, 22, 46, 50, 54, 102, 103, 104, 105, 109, 113, 115, 117, 119, 120, 123, 125, 128, 131, 135, 136, 139, 148, 157, 158, 164, 166, 169, 171, 229, 233], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 233], "queri": [14, 21, 22], "c": [14, 17, 20, 103, 112, 127, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 165, 166, 168, 227, 228, 229, 231, 233, 234], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 234], "liter": 14, "bar": [14, 22, 48, 234], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 232], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166], "valuetyp": [14, 83, 102, 104, 109, 137, 138, 164], "alia": [14, 133, 231], "enum": [14, 17, 20, 110, 112, 117, 128, 130, 132, 133, 134, 135, 136, 137, 139, 146, 148, 172], "to_bool": [14, 109], "to_arrai": [14, 109], "serial": 14, "brush": [14, 21, 46, 59, 102, 103, 109, 110, 113, 115, 121, 128, 136, 137, 138, 140, 141, 142, 170, 234], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 227, 228, 234], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 227], "struc": [14, 109, 138], "img": [14, 109, 117, 138], "variant": [14, 20, 46], "vale": 14, "skiarender": [15, 21, 56, 102, 105, 110, 127], "softwarerender": [15, 21, 56, 102, 105, 110, 127, 169], "interfac": [15, 105, 227, 229, 232, 233], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": 15, "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233], "opaqu": [16, 109, 112, 124], "low": [16, 52], "level": [16, 52, 137, 163], "exchang": [16, 110], "messag": [16, 21, 98, 99, 112, 137, 163], "connect": [16, 110, 140], "server": 16, "kind": [16, 109, 130, 136, 233], "ownership": [16, 109, 110], "caller": 16, "respons": [16, 148], "suppli": [16, 229], "valid": [16, 22, 112, 136, 148, 158], "throughout": 16, "lifetim": 16, "from_x11_xcb": [16, 110], "visual_id": [16, 110, 140], "xcb_connection_t": [16, 110], "xcb_window_t": [16, 110], "xcb_visualid_t": [16, 110], "xcb": 16, "from_x11_xlib": [16, 110], "unsign": [16, 109, 110, 111, 117, 124, 125, 140, 142, 148], "long": [16, 22, 110, 112, 140, 158, 229, 233], "xlib": 16, "visualid": [16, 110], "from_wayland": [16, 110], "wl_surfac": [16, 110], "surfac": [16, 110, 140], "wl_displai": [16, 110], "from_appkit": [16, 110], "nsview": [16, 110], "nswindow": [16, 110], "from_win32": [16, 110], "hwnd": [16, 21, 110, 140], "hinstanc": [16, 110], "task": [17, 56, 102, 105, 110], "set_platform": [17, 56, 102, 105, 110], "befor": [17, 21, 94, 95, 96, 165, 166], "subsequ": 17, "create_window_adapt": [17, 21, 110], "clipboard": [17, 110, 136, 140], "clipboard_text": [17, 110, 140], "set_clipboard_text": [17, 110, 140], "enumer": [17, 20, 46, 47, 48, 49, 50, 51, 52, 53, 54, 148], "defaultclipboard": [17, 110, 136], "action": [17, 22, 54, 111, 133, 136], "ctrl": 17, "secondari": 17, "x11": [17, 227], "selectionclipboard": [17, 110, 136], "primari": [17, 103, 142, 233], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 234], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 126, 162], "quit_event_loop": [17, 51, 58, 102, 103, 110, 112, 140], "thread": [17, 18, 98, 99, 127], "enter": [17, 100], "run_in_event_loop": [17, 18, 110], "invoke_from_event_loop": [17, 58, 99, 102, 103, 112, 127, 140], "pass": [17, 18, 20, 21, 97, 148, 158, 159, 227, 228], "reimplement": [17, 21], "longer": [17, 18], "onc": [17, 18, 95, 97, 98, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 231, 233], "abstractrender": [19, 20, 21, 56, 102, 105, 110], "skia": 19, "nativ": [19, 21, 232], "non": [19, 46, 106], "zero": 19, "explicit": [19, 20, 21, 109, 110, 111, 117, 120, 121, 122, 123, 124, 127, 142, 149, 150, 151, 152, 159, 167], "nativewindowhandl": [19, 56, 102, 105, 110], "window_handl": [19, 110, 112, 125, 127, 136], "initial_s": [19, 110], "windowhandl": 19, "physicalregion": [20, 56, 102, 105, 110, 136, 140], "rect": [20, 56, 102, 105, 110, 111, 112, 135, 136, 168], "softwar": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228], "To": [20, 107, 227, 233], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157], "repaintbuffertyp": [20, 110], "part": [20, 158], "speed": [20, 228], "paint": 20, "newbuff": [20, 110], "full": 20, "redrawn": 20, "No": [20, 133], "attempt": 20, "partial": [20, 168], "made": [20, 159, 228], "reusedbuff": [20, 110], "assum": [20, 98, 148, 158, 228, 229], "everi": [20, 162, 229], "swappedbuff": [20, 110], "drawn": [20, 148], "swap": [20, 53, 110, 121, 122, 124], "renderingrot": [20, 110], "rotat": [20, 110, 112, 136, 140], "set_rendering_rot": [20, 110], "norot": [20, 110], "rotate90": [20, 110], "90": [20, 110, 142], "left": [20, 21, 50, 117, 132, 133, 135, 148, 170, 171], "rotate180": [20, 110], "180": [20, 110, 142], "upsid": 20, "down": [20, 133], "rotate270": [20, 110], "buffer_typ": [20, 110], "strategi": 20, "rgb8pixel": [20, 80, 102, 103, 110, 117, 134, 135, 140, 148, 167], "pixel_strid": [20, 110, 140], "least": [20, 158, 227, 229, 233], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232], "rgb565pixel": [20, 56, 102, 105, 110], "565": 20, "render_by_lin": [20, 110], "process_line_callback": [20, 110], "cach": [20, 112, 227, 228], "dirti": [20, 112, 141], "region": [20, 140, 168], "consid": [20, 157], "signatur": 20, "render_fn": [20, 110], "third": 20, "fourth": [20, 50], "free": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 140, 158], "flush": 20, "typic": [20, 21, 50, 105, 148, 163, 165, 166], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 233], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168], "bounding_box_origin": [20, 110, 168], "origin": [20, 110, 112, 117, 135, 148, 149, 151, 168, 169], "overlap": [20, 168], "over": [20, 165, 168, 169], "someth": [20, 22, 46, 168, 229], "member": [20, 21, 108, 136, 147, 153, 154, 155, 156, 160, 161, 163, 164, 167, 168, 169, 170, 171, 229, 234], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231], "being": [21, 115, 148], "etc": [21, 22, 233], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": 21, "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38], "fulfil": 21, "method": [21, 148, 162], "mywindowadapt": 21, "m_render": 21, "nativehandl": 21, "m_native_window": 21, "refresh": 21, "els": [21, 109, 110, 111, 112, 116, 117, 122, 125, 127], "repaint_callback": 21, "asynchron": 21, "would": [21, 110, 122, 227], "update_timers_and_anim": [21, 56, 102, 105, 110], "schedul": [21, 97], "next": [21, 93, 109, 162, 165, 166, 227, 231, 232], "good": 21, "initialis": [21, 228], "detect": [21, 165, 227], "repaint": 21, "manag": 21, "instead": [21, 108, 162, 170, 227, 231, 233], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 233], "propag": 21, "titl": [21, 110, 130, 136, 142, 170], "layout": [21, 110, 112, 135, 136, 148, 170, 171], "constraint": [21, 53, 136, 170, 171], "case": [21, 112, 113, 128, 135, 139, 148, 231, 234], "getter": [21, 170, 229, 233], "background": [21, 110, 136, 142, 170], "deprec": [21, 102, 110, 112, 170, 172], "layout_constraint": [21, 110, 170, 171], "min": [21, 110, 112, 136, 140, 170, 171], "minimum": [21, 22, 142, 170, 171], "abl": [21, 170, 171], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 233], "max": [21, 110, 112, 136, 140, 170, 171], "maximum": [21, 22, 142, 170, 171], "larger": [21, 170, 171], "prefer": [21, 110, 112, 136, 140, 170, 171, 231], "test": [22, 43, 48, 71, 78, 102, 103, 109, 125, 132, 133, 172], "purpos": [22, 112, 229], "is_valid": [22, 111], "id": [22, 111, 126, 136, 146, 148], "qualifi": 22, "none": [22, 48, 50, 119, 132, 133, 139, 227], "consist": 22, "surround": 22, "well": [22, 158, 165, 166], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163], "checkbox": [22, 48, 132], "accessible_label": [22, 111], "label": [22, 111, 136, 145, 231], "accessible_valu": [22, 111], "accessible_placeholder_text": [22, 111], "placehold": 22, "accessible_descript": [22, 111], "descript": [22, 102, 111, 136, 163, 227], "accessible_value_maximum": [22, 111], "accessible_value_minimum": [22, 111], "accessible_value_step": [22, 111], "step": [22, 227, 231], "accessible_check": [22, 111], "checkabl": [22, 111, 136, 142], "set_accessible_valu": [22, 111], "invoke_accessible_increment_act": [22, 111], "increment": [22, 111, 136], "invoke_accessible_decrement_act": [22, 111], "decrement": [22, 111, 136], "invoke_accessible_default_act": [22, 111], "absolute_posit": [22, 111], "absolut": [22, 228], "visitor": [22, 111, 112, 136, 145], "r": [22, 109, 110, 111, 112, 114, 121, 129, 130, 132, 133, 134, 140, 142, 154, 155, 167], "invoke_result_t": [22, 99, 109, 111, 112, 121, 127], "visit_el": [22, 111], "visit": [22, 112, 165], "continu": [22, 112, 229], "until": [22, 51, 93, 99, 109, 162, 165, 231], "convers": [22, 148, 158], "never": [22, 162], "convertt": 22, "eh": 22, "make_opt": 22, "find_by_accessible_label": [22, 111], "find": [22, 112, 227], "find_by_element_id": [22, 111], "element_id": [22, 111, 145], "find_by_element_type_nam": [22, 111], "slint_generated_publ": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 49, 52, 53, 54, 63, 70, 82, 102, 117, 136, 154, 155, 172], "macro": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 227], "flag": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 233], "expand": [26, 29, 35, 38, 120, 123], "numer": [26, 35, 38], "patch": [26, 112], "against": [26, 29, 35, 38, 148, 227], "minor": [35, 112], "major": [38, 112], "slint_tests_help": [40, 43, 57, 102, 172], "home": [41, 42, 43, 78, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 132, 172], "runner": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 172], "work": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 172, 227, 231], "cpp": [41, 43, 105, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 172, 227, 228, 231], "parent": [42, 43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 112, 127, 136, 231, 232], "slint_callback": [43, 82, 87, 102, 136, 172], "slint_config": [43, 82, 102, 136, 172], "slint_imag": [43, 68, 69, 70, 80, 81, 82, 102, 136, 148, 157, 172], "slint_interpret": [43, 55, 102, 172], "slint_pathdata": [43, 82, 85, 102, 136, 172], "slint_point": [43, 58, 82, 102, 112, 136, 149, 151, 153, 172], "slint_properti": [43, 61, 76, 82, 87, 102, 115, 136, 172], "slint_sharedvector": [43, 58, 63, 82, 89, 102, 117, 136, 159, 172], "slint_siz": [43, 58, 63, 102, 112, 117, 150, 152, 160, 172], "slint_str": [43, 59, 63, 80, 82, 90, 102, 113, 117, 134, 136, 158, 172], "slint_tim": [43, 82, 92, 102, 136, 162, 172], "generated_includ": [44, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [45, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "slint_brush_intern": [45, 59, 79, 102, 113, 172], "slint_builtin_struct": [45, 76, 102, 130, 161, 172], "slint_builtin_structs_intern": [45, 67, 75, 79, 82, 102, 121, 136, 172], "slint_color_intern": [45, 61, 79, 102, 115, 172], "slint_enum": [45, 48, 50, 79, 102, 133, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_enums_intern": [45, 74, 76, 77, 78, 81, 82, 85, 102, 128, 130, 131, 135, 136, 139, 172], "slint_image_intern": [45, 63, 79, 86, 102, 117, 140, 172], "slint_intern": [45, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 70, 72, 73, 76, 79, 80, 84, 86, 88, 102, 112, 127, 138, 140, 142, 172], "slint_interpreter_generated_publ": [45, 46, 47, 84, 102, 138, 163, 164, 172], "slint_interpreter_intern": [45, 55, 82, 83, 102, 109, 172], "slint_pathdata_intern": [45, 65, 79, 102, 119, 172], "slint_platform_intern": [45, 58, 81, 82, 102, 112, 172], "slint_properties_intern": [45, 60, 67, 102, 114, 121, 172], "slint_qt_intern": [45, 58, 82, 102, 112, 172], "slint_sharedvector_intern": [45, 68, 102, 122, 172], "slint_string_intern": [45, 70, 102, 124, 172], "slint_testing_intern": [45, 57, 102, 111, 172], "slint_timer_intern": [45, 72, 102, 126, 172], "class": [46, 47, 48, 49, 50, 51, 52, 53, 54, 109, 110, 111, 112, 113, 115, 117, 122, 127, 128, 130, 132, 133, 134, 135, 136, 137, 139, 141, 146, 148, 158, 159, 165, 166, 168, 170, 172, 228, 229, 231, 233, 234], "int8_t": [46, 137], "unit": [46, 234], "length": [46, 228, 234], "angl": [46, 113, 234], "solidcolor": [46, 113, 128], "sever": 47, "belong": 47, "context": [48, 53, 112, 136, 148], "assist": 48, "technologi": 48, "reader": 48, "isn": 48, "behav": 48, "combobox": [48, 132, 142], "slider": [48, 132], "spinbox": [48, 132], "tab": [48, 78, 102, 106, 132], "tablist": [48, 132], "similar": [48, 159, 228, 229, 233], "automat": [48, 158, 233, 234], "tabl": [48, 132, 234], "tree": [48, 105, 132], "treeview": 48, "Not": [48, 122], "yet": [48, 53, 107, 122, 162, 165], "progressind": [48, 132], "textinput": [48, 132, 136], "edit": [48, 136, 142, 229, 232], "switch": [48, 113, 128, 132, 135, 139], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227], "pencil": 50, "middl": [50, 132], "mani": [50, 112], "center": [50, 133], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 233], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "item": [53, 111, 112, 127, 136, 142, 145, 161], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": 53, "whether": [54, 110, 227], "hidewindow": [54, 134], "keepwindowshown": [54, 134], "reject": [54, 133], "kept": 54, "directori": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 227, 228], "program": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 172, 227, 228, 231], "cassert": [56, 110], "cstdint": [56, 62, 66, 69, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 110, 116, 120, 123, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "util": [56, 110, 227], "duration_until_next_timer_upd": [56, 102, 105, 110], "type_trait": [57, 111], "elementhandl": [57, 102, 107, 111, 145], "init": [57, 102, 107, 111, 112, 121, 136], "algorithm": [58, 68, 112, 122], "concept": [58, 112], "memori": [58, 67, 68, 112, 121, 122, 148, 158, 231, 233], "componentweakhandl": [58, 98, 102, 103, 112], "eventloopmod": [58, 100, 102, 103, 112], "blocking_invoke_from_event_loop": [58, 98, 102, 103, 112], "update_all_transl": [58, 102, 103, 112], "tupl": [60, 112, 114, 130, 234], "stdint": [61, 115], "sharedpixelbuff": [63, 102, 103, 117, 135, 148], "initializer_list": [65, 68, 109, 119, 122, 159, 165], "atom": [68, 122], "iostream": [71, 125, 127], "assert_eq": [71, 102, 125], "timer": [72, 93, 94, 102, 103, 126], "cstdarg": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "cstdlib": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "standardlistviewitem": [75, 102, 103, 129, 130, 142], "key_cod": [78, 102, 105, 132], "alt": [78, 102, 106, 130, 132], "altgr": [78, 102, 106, 132], "backspac": [78, 102, 106, 132], "backtab": [78, 102, 106, 132], "capslock": [78, 102, 106, 132], "controlr": [78, 102, 106, 132], "downarrow": [78, 102, 106, 132], "escap": [78, 102, 106, 132], "f1": [78, 102, 106, 132], "f10": [78, 102, 106, 132], "f11": [78, 102, 106, 132], "f12": [78, 102, 106, 132], "f13": [78, 102, 106, 132], "f14": [78, 102, 106, 132], "f15": [78, 102, 106, 132], "f16": [78, 102, 106, 132], "f17": [78, 102, 106, 132], "f18": [78, 102, 106, 132], "f19": [78, 102, 106, 132], "f2": [78, 102, 106, 132], "f20": [78, 102, 106, 132], "f21": [78, 102, 106, 132], "f22": [78, 102, 106, 132], "f23": [78, 102, 106, 132], "f24": [78, 102, 106, 132], "f3": [78, 102, 106, 132], "f4": [78, 102, 106, 132], "f5": [78, 102, 106, 132], "f6": [78, 102, 106, 132], "f7": [78, 102, 106, 132], "f8": [78, 102, 106, 132], "f9": [78, 102, 106, 132], "leftarrow": [78, 102, 106, 132], "menu": [78, 102, 106, 132], "meta": [78, 102, 106, 130, 132], "metar": [78, 102, 106, 132], "pagedown": [78, 102, 106, 132], "pageup": [78, 102, 106, 132], "paus": [78, 102, 106, 132], "rightarrow": [78, 102, 106, 132], "scrolllock": [78, 102, 106, 132], "shift": [78, 102, 106, 130, 132, 167], "shiftr": [78, 102, 106, 132], "sysreq": [78, 102, 106, 132], "uparrow": [78, 102, 106, 132], "rgba8pixel": [80, 102, 103, 117, 134, 135, 148], "slint_feature_access": [80, 102, 134], "slint_feature_backend_linuxkm": [80, 102, 134], "slint_feature_backend_qt": [80, 102, 109, 134], "slint_feature_backend_winit": [80, 102, 134, 227], "slint_feature_experiment": [80, 102, 107, 110, 111, 134], "slint_feature_gettext": [80, 101, 102, 112, 134], "slint_feature_interpret": [80, 102, 109, 134], "slint_feature_renderer_femtovg": [80, 102, 134, 227], "slint_feature_renderer_skia": [80, 102, 110, 134, 227], "slint_feature_renderer_softwar": [80, 102, 110, 134], "slint_feature_system_test": [80, 102, 134], "slint_feature_test": [80, 102, 107, 111, 134], "slint_version_major": [80, 102, 134], "slint_version_minor": [80, 102, 134], "slint_version_patch": [80, 102, 134], "slint_version_str": [80, 102, 134], "diagnosticlevel": [83, 102, 104, 137, 163], "durat": [93, 126, 136, 146, 148, 162, 234], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": 96, "appear": 96, "termin": [97, 158], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232], "immedi": 97, "add": [98, 122, 165, 227], "queue": 98, "wake": 98, "woken": 98, "queu": 98, "statu": [98, 110], "network": 98, "my_application_ui": [98, 99, 231], "argc": [98, 99, 231], "char": [98, 99, 109, 111, 112, 115, 124, 125, 136, 144, 148, 158, 231, 234], "argv": [98, 99, 231], "networkstatusui": 98, "set_status_label": [98, 99], "weak_ui_handl": 98, "network_thread": 98, "read_message_blocking_from_network": 98, "see": [98, 103, 112, 157, 227], "block": [98, 99], "just": [99, 109, 112], "But": 99, "execut": [99, 227], "deadlock": 99, "forev": 99, "anoth": [99, 105, 148], "myapplicationui": 99, "worker_thread": 99, "get_messag": 99, "By": [100, 172, 227, 228], "forc": 101, "tr": 101, "evalu": [101, 121], "my_ui": 101, "languageset": 101, "on_french_select": 101, "setenv": 101, "lang": 101, "l": [101, 112], "section": [102, 227, 229, 231, 232, 233], "header": [102, 118, 229, 231], "choos": [102, 227], "slintnamespac": 102, "interpreterstruct": 102, "diagnosticstruct": 102, "propertydescriptorstruct": 102, "structstruct": 102, "iteratorclass": 102, "componentcompilerclass": 102, "componentdefinitionclass": 102, "componentinstanceclass": 102, "valueenum": 102, "diagnosticlevelenum": 102, "valuetypenamespac": 102, "platformstruct": 102, "rgb565pixelclass": 102, "abstractrendererclass": 102, "nativewindowhandleclass": 102, "platformclass": 102, "taskclass": 102, "skiarendererclass": 102, "softwarerendererstruct": 102, "physicalregionstruct": 102, "rectclass": 102, "windowadapterstruct": 102, "windowpropertiesstruct": 102, "layoutconstraintsnamespac": 102, "testingclass": 102, "elementhandleenum": 102, "accessibleroleenum": 102, "closerequestresponseenum": 102, "eventloopmodeenum": 102, "graphicsapienum": 102, "pointereventbuttonenum": 102, "renderingstateenum": 102, "setrenderingnotifiererrorstruct": 102, "hsvacolorstruct": 102, "imagestruct": 102, "logicalpositionstruct": 102, "logicalsizestruct": 102, "physicalpositionstruct": 102, "physicalsizetempl": 102, "pointstruct": 102, "rgb8pixelstruct": 102, "rgba8pixeltempl": 102, "rgbacolortempl": 102, "sharedpixelbufferstruct": 102, "sharedstringtempl": 102, "sharedvectortempl": 102, "sizestruct": 102, "standardlistviewitemstruct": 102, "timerclass": 102, "brushclass": 102, "colortempl": 102, "componenthandletempl": 102, "componentweakhandletempl": 102, "filtermodeltempl": 102, "mapmodeltempl": 102, "modeltempl": 102, "reversemodeltempl": 102, "sortmodeltempl": 102, "vectormodelclass": 102, "apidirectori": 102, "cppdirectori": 102, "includefil": 102, "hfile": 102, "hdirectori": 102, "cppdocsdirectori": 102, "generated_includefil": 102, "detail": [102, 232], "document": [102, 103, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": 103, "design": [103, 232, 234], "its": [104, 157, 163], "pre": [104, 227, 228], "normal": [104, 156], "wai": [104, 148, 227, 228, 232, 233], "come": [105, 227, 232, 233], "built": [105, 227, 231, 233], "modul": [105, 107, 227], "interact": [105, 136, 227, 232, 233], "environ": 105, "microcontrol": 105, "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": [105, 231], "http": [105, 112, 227, 231], "github": [105, 227, 231], "com": [105, 112, 227, 231], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": 105, "idf": 105, "src": [105, 129, 130, 132, 133], "constant": [106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "special": [106, 112, 156], "printabl": 106, "experiment": [107, 227], "subject": 107, "stabil": 107, "ON": [107, 227], "cmake": [107, 227, 231, 232, 233], "page": 108, "copyright": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "sixtyfp": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "gmbh": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "info": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "dev": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "spdx": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "licens": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "identifi": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "gpl": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "OR": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "licenseref": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "royalti": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "pragma": [109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "ifndef": [109, 110, 112, 127], "ifdef": [109, 110, 111, 112], "endif": [109, 110, 111, 112, 115, 116, 117, 122, 127, 135, 138, 139, 227, 231], "namespac": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 228, 233], "cbindgen_priv": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146], "stai": 109, "eraseditemtreebox": [109, 138], "slint_interpreter_struct_new": [109, 138], "slint_interpreter_struct_clon": [109, 138], "slint_interpreter_struct_destructor": [109, 138], "inputiter": [109, 165], "doxygen": [109, 110, 112, 115, 116, 117, 122, 127], "understand": 109, "wizardri": 109, "enable_if_t": [109, 121], "is_convert": 109, "decltyp": [109, 112, 121], "declval": 109, "set_field": [109, 165], "fixm": [109, 112, 115], "probabl": 109, "miss": 109, "lot": 109, "value_typ": [109, 165, 166], "structiteratoropaqu": [109, 138], "k": [109, 138], "believ": 109, "suppos": [109, 231], "slint_interpreter_struct_make_it": [109, 138], "get_field": [109, 165], "structopaqu": [109, 138], "slint_interpreter_value_new": [109, 138], "slint_interpreter_value_clon": [109, 138], "slint_interpreter_value_destructor": [109, 138], "to_int": 109, "to_float": 109, "slint_interpreter_value_to_numb": [109, 138], "slint_interpreter_value_to_str": [109, 138], "slint_interpreter_value_to_bool": [109, 138], "slint_interpreter_value_to_brush": [109, 138], "opaque_struct": 109, "slint_interpreter_value_to_struct": [109, 138], "slint_interpreter_value_to_imag": [109, 138], "reinterpret_cast": [109, 110, 111, 112, 114, 117, 121, 122, 124, 126, 127, 144], "slint_interpreter_value_new_doubl": [109, 138], "static_cast": [109, 110, 112, 148], "slint_interpreter_value_new_str": [109, 138], "slint_interpreter_value_new_bool": [109, 138], "slint_interpreter_value_new_brush": [109, 138], "slint_interpreter_value_new_struct": [109, 138], "slint_interpreter_value_new_imag": [109, 138], "slint_interpreter_value_typ": [109, 138], "slint_interpreter_value_eq": [109, 138], "avoid": [109, 115, 125], "turn": [109, 227], "slint_interpreter_value_new_array_model": [109, 138], "slint_interpreter_value_to_arrai": [109, 138], "modeladaptorvt": [109, 138], "vref": [109, 112, 127, 135, 136, 138], "modelwrapp": 109, "modelchangelisten": [109, 112], "modelnotifyopaqu": [109, 138], "rust": [109, 110, 112], "slint_interpreter_model_notify_destructor": [109, 138], "slint_interpreter_model_notify_row_ad": [109, 138], "slint_interpreter_model_notify_row_chang": [109, 138], "slint_interpreter_model_notify_row_remov": [109, 138], "slint_interpreter_model_notify_reset": [109, 138], "wrapper": 109, "make_shar": [109, 112, 121], "slint_interpreter_model_notify_new": [109, 138], "attach_p": [109, 112], "uintptr_t": [109, 110, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 163], "has_valu": [109, 110, 111, 112], "rval": 109, "get_notifi": [109, 138], "vrefmut": [109, 112, 135, 136, 138], "vt": 109, "slint_interpreter_value_new_model": [109, 138], "name_view": 109, "const_cast": [109, 111, 112, 117, 121, 122, 124, 127, 144], "field_val": 109, "slint_interpreter_struct_get_field": [109, 138], "slint_interpreter_struct_set_field": [109, 138], "name_slic": 109, "nextval_inn": 109, "slint_interpreter_struct_iterator_next": [109, 138], "ptr": [109, 112, 122, 135, 136, 143, 144], "len": [109, 112, 122, 127, 136, 144], "slint_interpreter_struct_iterator_destructor": [109, 138], "fact": 109, "assert_main_thread": [109, 110, 112, 127], "slint_interpreter_component_instance_show": [109, 138], "windowadapterrcopaqu": [109, 110, 112, 127, 136, 138, 140], "win_ptr": 109, "slint_interpreter_component_instance_window": [109, 138], "wid": 109, "slint_qt_get_widget": [109, 142], "windowadapterrc": [109, 127, 136, 142], "slint_interpreter_component_instance_set_properti": [109, 138], "string_to_slic": [109, 124], "prop_inn": 109, "slint_interpreter_component_instance_get_properti": [109, 138], "args_view": 109, "rval_inn": 109, "slint_interpreter_component_instance_invok": [109, 138], "is_convertible_v": [109, 127], "actual_cb": [109, 127], "slint_interpreter_component_instance_set_callback": [109, 138], "slint_interpreter_component_instance_set_global_properti": [109, 138], "slint_interpreter_component_instance_get_global_properti": [109, 138], "slint_interpreter_component_instance_set_global_callback": [109, 138], "slint_interpreter_component_instance_invoke_glob": [109, 138], "componentdefinitionopaqu": [109, 138], "slint_interpreter_component_definition_clon": [109, 138], "slint_interpreter_component_definition_destructor": [109, 138], "union": [109, 111, 128, 135, 136, 139], "ci": 109, "u": [109, 110, 112, 136], "slint_interpreter_component_instance_cr": [109, 138], "prop": [109, 138], "slint_interpreter_component_definition_properti": [109, 138], "slint_interpreter_component_definition_callback": [109, 138], "slint_interpreter_component_definition_funct": [109, 138], "slint_interpreter_component_definition_nam": [109, 138], "slint_interpreter_component_definition_glob": [109, 138], "slint_interpreter_component_definition_global_properti": [109, 138], "slint_interpreter_component_definition_global_callback": [109, 138], "slint_interpreter_component_definition_global_funct": [109, 138], "slint_interpreter_component_instance_component_definit": [109, 138], "componentcompileropaqu": [109, 138], "slint_interpreter_component_compiler_new": [109, 138], "slint_interpreter_component_compiler_destructor": [109, 138], "slint_interpreter_component_compiler_set_include_path": [109, 138], "slint_interpreter_component_compiler_set_styl": [109, 138], "slint_interpreter_component_compiler_get_styl": [109, 138], "slint_interpreter_component_compiler_set_translation_domain": [109, 138], "slint_interpreter_component_compiler_get_include_path": [109, 138], "slint_interpreter_component_compiler_get_diagnost": [109, 138], "slint_interpreter_component_compiler_build_from_sourc": [109, 138], "slint_interpreter_component_compiler_build_from_path": [109, 138], "send_keyboard_string_sequ": [109, 125, 136], "__apple__": [110, 112], "_win32": [110, 112, 116], "_win64": [110, 112, 116], "__objc__": 110, "typedef": [110, 165, 166], "objc_object": 110, "rendererptr": [110, 140], "renderer_handl": 110, "was_initi": 110, "slint_window_adapter_new": [110, 140], "intsiz": [110, 135, 136, 140], "p": [110, 112, 120, 127, 140, 149, 151], "point2d": [110, 120, 136, 140], "int32_t": [110, 120, 121, 130, 135, 136, 140, 141, 142, 151], "out": [110, 131, 136, 138, 139, 140, 141, 144, 145, 159, 229, 232], "slint_window_properties_get_titl": [110, 140], "slint_window_properties_get_background": [110, 140], "renam": [110, 118], "slint_window_properties_get_fullscreen": [110, 140], "slint_window_properties_get_minim": [110, 140], "slint_window_properties_get_maxim": [110, 140], "lc": 110, "slint_window_properties_get_layout_constraint": [110, 140], "has_min": [110, 140], "has_max": [110, 140], "abort": [110, 112, 125, 127, 133], "platformtaskopaqu": [110, 140], "_0": [110, 112, 113, 121, 127, 128, 135, 136, 138, 139, 140, 141], "slint_platform_task_drop": [110, 140], "assert": 110, "form": [110, 229, 233], "slint_platform_task_run": [110, 140], "slint_platform_regist": [110, 140], "w": [110, 112], "maybe_unus": [110, 112], "uint64_t": [110, 112, 121, 125, 126, 130, 135, 136, 138, 140, 141, 146], "out_text": 110, "maybe_clipboard": 110, "uint16_t": [110, 135, 136, 140, 167], "g": [110, 134, 154, 155, 167, 227], "6": [110, 135, 138, 142, 167, 227], "constexpr": [110, 111, 112, 123, 125, 132, 136, 142, 144, 150, 152, 167, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "4": [110, 112, 135, 136, 138, 142], "mutabl": [110, 112, 121], "softwarerendereropaqu": [110, 140], "slint_software_renderer_handl": [110, 140], "intrect": [110, 135, 136, 140], "slint_software_renderer_region_to_rect": [110, 140], "__cpp_lib_rang": 110, "202110l": 110, "dr20": 110, "p2415r2": 110, "owning_view": 110, "view_interfac": 110, "slint_software_renderer_drop": [110, 140], "slint_software_renderer_new": [110, 140], "slint_software_renderer_render_rgb8": [110, 140], "slint_software_renderer_render_rgb565": [110, 140], "slint_software_renderer_render_by_line_rgb565": [110, 140], "process_line_callback_ptr": 110, "line_start": 110, "line_end": 110, "render_fn_data": 110, "line_span": 110, "270": [110, 142], "slint_software_renderer_set_rendering_rot": [110, 140], "cpprawhandleopaqu": [110, 140], "slint_raw_window_handle_drop": [110, 140], "slint_new_raw_window_handle_x11_xcb": [110, 140], "slint_new_raw_window_handle_x11_xlib": [110, 140], "slint_new_raw_window_handle_wayland": [110, 140], "slint_new_raw_window_handle_appkit": [110, 140], "slint_new_raw_window_handle_win32": [110, 140], "skiarendereropaqu": [110, 140], "slint_skia_renderer_handl": [110, 140], "slint_skia_renderer_drop": [110, 140], "slint_skia_renderer_new": [110, 140], "slint_skia_renderer_rend": [110, 140], "slint_platform_update_timers_and_anim": [110, 140], "val": [110, 126, 136, 138, 141], "slint_platform_duration_until_next_timer_upd": [110, 140], "numeric_limit": [110, 112], "slint_testing_init_backend": [111, 145], "is_constructible_v": 111, "is_default_constructible_v": 111, "is_void_v": [111, 112], "slint_testing_element_visit_el": [111, 145], "visitorandresult": 111, "visitor_and_result": 111, "user_data": [111, 114, 121, 127, 136, 138, 140, 141, 145, 146], "label_view": 111, "slint_testing_element_find_by_accessible_label": [111, 145], "element_id_view": 111, "slint_testing_element_find_by_element_id": [111, 145], "element_type_name_view": 111, "slint_testing_element_find_by_element_type_nam": [111, 145], "upgrade_item_weak": [111, 112], "slint_testing_element_id": [111, 145], "slint_testing_element_type_nam": [111, 145], "slint_testing_element_bas": [111, 145], "element_index": [111, 145], "item_tre": [111, 112, 136], "borrow": [111, 148], "get_accessible_string_properti": 111, "accessiblestringproperti": [111, 136], "placeholdertext": [111, 136], "valuemaximum": [111, 136], "slint_string_to_float": [111, 140], "valueminimum": [111, 136], "valuestep": [111, 136], "setvaluehelp": 111, "accessibilityact": [111, 136], "set_valu": [111, 136], "setvalue_bodi": [111, 136], "tag": [111, 112, 113, 117, 119, 127, 128, 135, 136, 139], "setvalu": [111, 136], "accessibility_act": [111, 136], "increaseactionhelp": 111, "decreaseactionhelp": 111, "defaultactionhelp": 111, "item_geometri": [111, 136], "logicalrect": [111, 136], "logicalpoint": [111, 136], "ab": 111, "slint_item_absolute_posit": [111, 136], "accessible_string_properti": [111, 136], "__gnuc__": [112, 116], "__clang__": 112, "17": [112, 142, 165, 166], "condition": 112, "care": [112, 228], "gcc": 112, "ignor": [112, 126, 133], "winvalid": 112, "offsetof": 112, "mutex": 112, "condition_vari": 112, "bring": 112, "structur": [112, 153, 160, 164, 165, 228], "scope": [112, 229, 233], "itemtreeref": [112, 136], "indexrang": [112, 136], "itemref": 112, "itemvt": [112, 136, 142], "itemvisitorrefmut": 112, "itemvisitorvt": [112, 136], "itemtreenod": [112, 136], "itemarrayentri": 112, "voffset": [112, 136], "allowpin": [112, 136], "itemarrai": [112, 127], "make_item_nod": 112, "child_count": 112, "child_index": 112, "parent_index": [112, 136], "item_array_index": [112, 136], "is_access": [112, 136], "item_bodi": [112, 136], "make_dyn_nod": 112, "offset": 112, "dynamictree_bodi": [112, 136], "dynamictre": [112, 136], "get_item_ref": [112, 136], "item_tree_arrai": [112, 136], "item_arrai": [112, 136], "convert_anonymous_rect": 112, "alphabet": [112, 234], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143], "elif": [112, 116], "mac_os_x_version_min_requir": 112, "mac_os_x_version_10_14": 112, "drop_in_plac": [112, 135, 136], "sizeof": [112, 122, 144], "alignof": [112, 122], "cross": 112, "dll": [112, 231], "reloc": 112, "doc": 112, "microsoft": 112, "en": 112, "rule": 112, "dllimport": [112, 116], "dllexport": 112, "msvc": [112, 227], "160": [112, 142], "address": 112, "seek": 112, "That": [112, 231], "resolv": 112, "stub": 112, "librari": [112, 159, 227, 228, 231, 232], "slint_get_item_vt": 112, "vtablenam": 112, "slint_get_": [112, 136, 142], "itemrc": [112, 127, 136], "itemweak": [112, 136, 145], "item_weak": 112, "item_tree_strong": 112, "debug": 112, "slint_debug": [112, 140], "vweak": [112, 136], "layoutinfo": [112, 136], "merg": [112, 136], "duplic": [112, 142], "max_perc": [112, 136], "min_perc": [112, 136], "stretch": [112, 133, 136], "easingcurv": [112, 136], "cubicbezi": [112, 136], "cubic_bezi": [112, 136], "register_item_tre": 112, "maybe_window": 112, "window_ptr": 112, "slint_register_item_tre": [112, 136], "solve_box_layout": 112, "boxlayoutdata": [112, 136], "repeater_index": [112, 136], "ri": 112, "slint_solve_box_layout": [112, 136], "solve_grid_layout": 112, "gridlayoutdata": [112, 136], "slint_solve_grid_layout": [112, 136], "grid_layout_info": 112, "gridlayoutcelldata": [112, 136], "cell": [112, 136], "pad": [112, 122, 136], "slint_grid_layout_info": [112, 136], "box_layout_info": 112, "boxlayoutcelldata": [112, 136], "layoutalign": [112, 133, 136, 142], "slint_box_layout_info": [112, 136], "box_layout_info_ortho": 112, "slint_box_layout_info_ortho": [112, 136], "layout_cache_access": 112, "idx": 112, "modelp": 112, "weak_ptr": 112, "access_array_index": 112, "row_data_track": 112, "model_length": 112, "track_row_count_chang": 112, "cerr": [112, 125, 127], "endl": [112, 125, 127], "peer": 112, "model_row_count_dirty_properti": 112, "track_row_data_chang": 112, "lower_bound": 112, "tracked_row": 112, "model_row_data_dirty_properti": 112, "binary_search": 112, "mark_dirti": [112, 121], "for_each_p": 112, "remove_if": 112, "pp": 112, "arraymodel": 112, "our": [112, 229, 231, 232], "uintmodel": 112, "d": [112, 121, 136, 231], "target_model": 112, "filtered_rows_dirti": 112, "added_accepted_row": 112, "insertion_point": 112, "accepted_row": 112, "existing_row": 112, "existing_row_index": 112, "distanc": [112, 122], "is_contain": 112, "accepted_updated_row": 112, "mapped_row_start": 112, "mapped_row_end": 112, "mapped_removed_len": 112, "mapped_removed_index": 112, "update_map": 112, "source_data": 112, "first_inserted_row": 112, "sorted_rows_dirti": 112, "adjust": 112, "indic": 112, "sorted_row": 112, "inserted_valu": 112, "sorted_elem": 112, "changed_row": 112, "removed_row_it": 112, "removed_row": 112, "changed_valu": 112, "inserted_row": 112, "first_removed_row": 112, "ensure_sort": 112, "lhs_index": 112, "rhs_index": 112, "lhs_elem": 112, "rhs_elem": 112, "old_row_count": 112, "repeaterinn": 112, "clean": 112, "repeatedinstancewithst": 112, "is_dirti": [112, 121], "update_data": 112, "set_model_bind": 112, "bind": [112, 114, 121, 136, 141, 232], "set_bind": [112, 121], "ensure_upd": 112, "tracker": 112, "ensure_updated_listview": 112, "viewport_width": [112, 136], "viewport_height": [112, 136], "viewport_i": [112, 136], "listview_width": 112, "listview_height": 112, "todo": 112, "try": 112, "alloc": 112, "compute_layout_listview": 112, "traversalord": [112, 136], "backtofront": [112, 136], "ref": 112, "item_at": 112, "visit_children_item": [112, 136], "static_vt": [112, 127], "instance_at": 112, "index_rang": 112, "listview_layout": 112, "model_set_row_data": 112, "plural": [112, 136], "slint_transl": [112, 136], "slint_translations_mark_dirti": [112, 136], "flickabl": [112, 136], "slint_flickable_data_init": [112, 136], "slint_flickable_data_fre": [112, 136], "nativestylemetr": [112, 142], "slint_native_style_metrics_init": [112, 142], "slint_native_style_metrics_deinit": [112, 142], "nativepalett": [112, 142], "slint_native_palette_init": [112, 142], "slint_native_palette_deinit": [112, 142], "mismatch": 112, "versioncheckhelp": 112, "slint_run_event_loop": [112, 140], "slint_quit_event_loop": [112, 140], "slint_post_ev": [112, 140], "mtx": 112, "cv": 112, "unique_lock": 112, "notify_on": 112, "wait": [112, 133], "clang": [112, 127], "format": [112, 127, 135, 136, 148, 158], "off": [112, 127, 227], "gradientstop": [113, 115, 128], "firststop": 113, "stopcount": 113, "make_linear_gradi": 113, "fake": 113, "stopsbegin": 113, "stopsend": 113, "radialgradientbrush": [113, 128], "make_circle_gradi": 113, "lineargradi": [113, 128], "radialgradi": [113, 128], "nodiscard": [113, 115, 117], "solid_color": [113, 128], "break": [113, 128, 135, 139], "linear_gradi": [113, 128], "radial_gradi": [113, 128], "slint_color_bright": [113, 115, 131], "slint_color_dark": [113, 115, 131], "slint_color_transparent": [113, 115, 131], "slint_color_with_alpha": [113, 115, 131], "set_animated_valu": [113, 115, 121], "new_valu": [113, 115, 121], "propertyanim": [113, 115, 121, 136, 141], "animation_data": [113, 115, 121, 136, 141], "slint_property_set_animated_value_brush": [113, 136, 141], "ret": [114, 115, 136, 141], "slint_callback_init": [114, 136, 141], "slint_callback_drop": [114, 136, 141], "set_handl": 114, "slint_callback_set_handl": [114, 136, 141], "slint_callback_cal": [114, 136, 141], "callbackopaqu": [114, 136, 141], "0x1": 114, "callbacksignaturehelp": 114, "callbackhelp": [114, 136, 142], "satur": [115, 147], "16": [115, 142, 227], "0xff": 115, "24": [115, 142], "slint_color_from_hsva": [115, 131], "slint_color_to_hsva": [115, 131], "cast": [115, 125], "argb": 115, "slint_color_mix": [115, 131], "slint_property_set_animated_value_color": [115, 136, 141], "uintptr_max": 116, "0xffffffff": 116, "slint_target_32": [116, 138], "0xffffffffffffffffu": 116, "slint_target_64": [116, 138], "_msc_ver": 116, "slint_dll_import": [116, 136, 142], "__declspec": 116, "__attribute__": 116, "m_width": 117, "m_height": 117, "m_data": 117, "cbegin": [117, 122, 157, 159], "cend": [117, 122, 157, 159], "borrowedopengltextureorigin": [117, 135, 148], "topleft": [117, 135, 148], "bottomleft": [117, 135, 148], "imageinner_non": [117, 135], "load_from_path": [117, 148], "file_path": [117, 148], "slint_image_load_from_path": [117, 135], "create_from_borrowed_gl_2d_rgba_textur": [117, 148], "texture_id": [117, 135, 148], "origin_priv": 117, "imageinner_borrowedopengltextur": [117, 135], "borrowedopengltextur": [117, 135], "imageinner_embeddedimag": [117, 135], "imagecachekei": [117, 135], "invalid": [117, 135, 148, 165, 166], "sharedimagebuff": [117, 135], "rgb8": [117, 135], "rgba8": [117, 135], "slint_image_s": [117, 135], "slint_image_path": [117, 135], "set_nine_slice_edg": [117, 148], "short": [117, 148], "bottom": [117, 133, 135, 148], "slint_image_set_nine_slice_edg": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232], "slint_image_load_from_embedded_data": [117, 135], "image_from_embedded_textur": 117, "statictextur": [117, 135], "textur": [117, 135, 148], "slint_image_from_embedded_textur": [117, 135], "pathev": [119, 133, 139], "patharcto": [119, 139], "pathcubicto": [119, 139], "pathel": [119, 139], "pathlineto": [119, 139], "pathmoveto": [119, 139], "pathquadraticto": [119, 139], "pathdata": [119, 136, 139], "firstel": 119, "elements_from_arrai": 119, "firstev": 119, "event_count": [119, 139], "firstcoordin": 119, "coordinate_count": [119, 139], "events_from_arrai": 119, "command": [119, 139, 227, 231, 232, 233], "tmp": 119, "slint_new_path_el": [119, 139], "slint_new_path_ev": [119, 139], "euclid": [120, 123], "crate": [120, 123], "binari": [120, 123, 228, 231], "compat": [120, 123], "changetrack": [121, 136, 141], "stateinfo": [121, 130], "slint_property_set_animated_binding_help": 121, "propertyhandleopaqu": [121, 136, 141], "drop_user_data": [121, 136, 138, 140, 141, 146], "transition_data": [121, 136, 141], "slint_property_set_animated_binding_int": [121, 136, 141], "slint_property_set_animated_binding_float": [121, 136, 141], "slint_property_set_animated_binding_color": [121, 136, 141], "slint_property_set_animated_binding_brush": [121, 136, 141], "slint_property_init": [121, 136, 141], "slint_property_drop": [121, 136, 141], "implicit": [121, 158, 159], "0b10": 121, "slint_property_set_chang": [121, 136, 141], "slint_property_upd": [121, 136, 141], "slint_property_set_bind": [121, 136, 141], "set_animated_bind": 121, "tran": 121, "set_animated_binding_for_transit": 121, "userdata": 121, "instant": [121, 136], "slint_property_is_dirti": [121, 136, 141], "slint_property_mark_dirti": [121, 136, 141], "link_two_wai": 121, "p1": 121, "p2": 121, "common_properti": 121, "twowaybind": 121, "del_fn": 121, "call_fn": 121, "intercept_fn": 121, "intercept_binding_fn": 121, "slint_property_set_binding_intern": [121, 136, 141], "set_state_bind": 121, "slint_property_set_animated_value_int": [121, 136, 141], "slint_property_set_animated_value_float": [121, 136, 141], "slint_property_set_state_bind": [121, 136, 141], "propertytrack": 121, "slint_property_tracker_init": [121, 136, 141], "slint_property_tracker_drop": [121, 136, 141], "slint_property_tracker_is_dirti": [121, 136, 141], "is_same_v": 121, "slint_property_tracker_evalu": [121, 136, 141], "evaluate_as_dependency_root": 121, "slint_property_tracker_evaluate_as_dependency_root": [121, 136, 141], "propertytrackeropaqu": [121, 136, 141], "slint_change_tracker_construct": [121, 136, 141], "slint_change_tracker_drop": [121, 136, 141], "fneval": 121, "fnnotifi": 121, "fn_eval": 121, "fn_notifi": 121, "data_ptr": 121, "slint_change_tracker_init": [121, 136, 141], "sharedvectorhead": 122, "slint_shared_vector_empti": [122, 136, 143], "with_capac": 122, "new_data": 122, "input_it": 122, "inputit": [122, 159], "uninitialized_copi": 122, "capac": [122, 159], "refcount": 122, "detach": 122, "expected_capac": 122, "new_arrai": 122, "old_data": 122, "slint_shared_vector_fre": [122, 136, 143], "mem": 122, "slint_shared_vector_alloc": [122, 136, 143], "unfortun": 122, "cbindgen": [122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "understood": 122, "intptr_t": [122, 136], "static_assert": 122, "size2d": [123, 135, 136], "slint_shared_string_from_byt": [124, 136, 144], "char8_t": [124, 158], "u8string_view": [124, 132, 158, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_shared_string_clon": [124, 136, 144], "slint_shared_string_drop": [124, 136, 144], "slint_shared_string_byt": [124, 136, 144], "starts_with": [124, 158], "prefix": [124, 158, 165, 166, 227], "substr": 124, "ends_with": [124, 158], "self_view": 124, "compar": [124, 125, 153, 157, 159, 160, 165, 166], "npo": 124, "from_numb": [124, 158], "shared_str": [124, 158], "a2": 124, "slint_shared_string_append": [124, 136, 144], "slint_shared_string_from_numb": [124, 136, 144], "mock_elapsed_tim": 125, "int64_t": [125, 126, 136, 146, 234], "time_in_m": [125, 136], "slint_mock_elapsed_tim": [125, 136], "get_mocked_tim": 125, "slint_get_mocked_tim": [125, 136], "send_mouse_click": 125, "slint_send_mouse_click": [125, 136], "send_keyboard_char": 125, "slint_send_keyboard_char": [125, 136], "assert_eq_impl": 125, "__file__": 125, "__line__": 125, "equality_comparable_with": 125, "a_str": 125, "b_str": 125, "nok": 125, "is_integral_v": 125, "common": [125, 229, 231, 233], "sign": [125, 228, 234], "common_type_t": 125, "is_floating_point_v": 125, "depsilon": 125, "000001": 125, "small": 125, "fab": 125, "fail": 125, "cspell": 126, "singleshot": [126, 146], "timermod": [126, 146, 162], "interv": [126, 162], "slint_timer_start": [126, 146], "slint_timer_destroi": [126, 146], "slint_timer_stop": [126, 146], "restart": [126, 162], "slint_timer_restart": [126, 146], "slint_timer_run": [126, 146], "slint_timer_interv": [126, 136, 146], "single_shot": [126, 162], "slint_timer_singleshot": [126, 146], "ndebug": 127, "main_thread_id": 127, "this_thread": 127, "get_id": 127, "most": [127, 148, 227], "itemtreerc": [127, 136, 145], "adopted_inn": 127, "slint_windowrc_clon": [127, 136], "slint_windowrc_init": [127, 140], "slint_windowrc_drop": [127, 136], "slint_windowrc_show": [127, 136], "slint_windowrc_hid": [127, 136], "slint_windowrc_is_vis": [127, 136], "slint_windowrc_get_scale_factor": [127, 136], "set_scale_factor": 127, "slint_windowrc_set_scale_factor": [127, 136], "colorschem": [127, 133, 136, 142], "color_schem": [127, 142], "slint_windowrc_color_schem": [127, 136], "text_input_focus": 127, "slint_windowrc_get_text_input_focus": [127, 136], "set_text_input_focus": 127, "slint_windowrc_set_text_input_focus": [127, 136], "unregister_item_tre": 127, "slint_unregister_item_tre": [127, 136], "set_focus_item": 127, "component_rc": 127, "item_index": [127, 136], "set_focu": [127, 136], "item_rc": 127, "slint_windowrc_set_focus_item": [127, 136], "set_compon": 127, "itemtreeweak": [127, 136], "item_tree_rc": [127, 136], "slint_windowrc_set_compon": [127, 136], "posgett": 127, "show_popup": 127, "parent_compon": 127, "close_on_click": [127, 136], "parent_item": [127, 136], "popup": [127, 136], "popup_dyn": 127, "slint_windowrc_show_popup": [127, 136], "close_popup": 127, "slint_windowrc_close_popup": [127, 136], "graphics_api": [127, 136], "err": 127, "slint_windowrc_set_rendering_notifi": [127, 136], "slint_windowrc_on_close_request": [127, 136], "slint_windowrc_request_redraw": [127, 136], "slint_windowrc_posit": [127, 136], "set_logical_posit": 127, "slint_windowrc_set_logical_posit": [127, 136], "set_physical_posit": 127, "slint_windowrc_set_physical_posit": [127, 136], "slint_windowrc_s": [127, 136], "set_logical_s": 127, "slint_windowrc_set_logical_s": [127, 136], "set_physical_s": 127, "slint_windowrc_set_physical_s": [127, 136], "dispatch_pointer_ev": 127, "mouseev": [127, 136], "slint_windowrc_dispatch_pointer_ev": [127, 136], "register_font_from_path": 127, "maybe_err": 127, "slint_register_font_from_path": [127, 140], "register_font_from_data": 127, "slint_register_font_from_data": [127, 140], "register_bitmap_font": 127, "bitmapfont": [127, 136, 140], "font": [127, 227, 228, 234], "slint_register_bitmap_font": [127, 140], "default_font_s": [127, 136, 142], "slint_windowrc_default_font_s": [127, 136], "windowrc": 127, "slint_windowrc_is_fullscreen": [127, 136], "slint_windowrc_set_fullscreen": [127, 136], "slint_windowrc_is_maxim": [127, 136], "slint_windowrc_set_maxim": [127, 136], "slint_windowrc_is_minim": [127, 136], "slint_windowrc_set_minim": [127, 136], "slint_windowrc_dispatch_key_ev": [127, 136], "keyeventtyp": [127, 130, 136], "keypress": [127, 136], "keyreleas": [127, 136], "pressed_bodi": [127, 136], "click_count": [127, 136], "released_bodi": [127, 136], "moved_bodi": [127, 136], "wheel_bodi": [127, 136], "windowev": [127, 136], "resized_bodi": [127, 136], "slint_windowrc_dispatch_ev": [127, 136], "scale_factor_chang": [127, 136], "scalefactorchanged_bodi": [127, 136], "scalefactorchang": [127, 136], "window_active_chang": [127, 136], "windowactivechanged_bodi": [127, 136], "windowactivechang": [127, 136], "closerequest": [127, 136], "slint_windowrc_has_active_anim": [127, 140], "26": [128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "solidcolor_bodi": 128, "lineargradient_bodi": 128, "radialgradient_bodi": 128, "issolidcolor": 128, "islineargradi": 128, "isradialgradi": 128, "xtask": [129, 130, 132, 133], "keyboardmodifi": 130, "pointerev": [130, 136], "pointereventkind": [130, 133], "modifi": 130, "pointerscrollev": [130, 136], "keyev": [130, 136], "event_typ": [130, 136], "replacement_rang": 130, "preedit_text": [130, 136], "preedit_select": [130, 136], "cursor_posit": 130, "anchor_posit": 130, "tablecolumn": [130, 142], "min_width": 130, "horizontal_stretch": 130, "sortord": [130, 133], "sort_ord": 130, "current_st": 130, "previous_st": 130, "change_tim": 130, "col1": 131, "col2": 131, "u0008": [132, 194], "u0009": [132, 221], "u000a": [132, 211], "u001b": [132, 216], "u0019": [132, 213], "u007f": [132, 224], "u0010": [132, 225], "u0011": [132, 208], "u0012": [132, 186], "u0013": [132, 185], "u0014": [132, 175], "u0015": [132, 223], "u0016": [132, 210], "u0017": [132, 197], "u0018": [132, 179], "u0020": [132, 176], "uf700": [132, 200], "uf701": [132, 184], "uf702": [132, 178], "uf703": [132, 215], "uf704": [132, 174], "uf705": [132, 202], "uf706": [132, 207], "uf707": [132, 181], "uf708": [132, 195], "uf709": [132, 196], "uf70a": [132, 212], "uf70b": [132, 203], "uf70c": [132, 198], "uf70d": [132, 201], "uf70": [132, 206], "uf70f": [132, 182], "uf710": [132, 191], "uf711": [132, 193], "uf712": [132, 192], "uf713": [132, 209], "uf714": [132, 219], "uf715": [132, 204], "uf716": [132, 189], "uf717": [132, 199], "uf718": [132, 218], "uf719": [132, 226], "uf71a": [132, 187], "uf71b": [132, 173], "uf727": [132, 183], "uf729": [132, 214], "uf72b": [132, 222], "uf72c": [132, 220], "uf72d": [132, 205], "uf72f": [132, 190], "uf730": [132, 180], "uf731": [132, 217], "uf734": [132, 188], "uf735": [132, 177], "texthorizontalalign": [133, 136], "textverticalalign": [133, 136], "textwrap": [133, 136], "nowrap": 133, "wordwrap": 133, "charwrap": 133, "textoverflow": [133, 136], "clip": [133, 136], "elid": 133, "textstrokestyl": [133, 136], "outsid": 133, "eventresult": [133, 136], "fillrul": [133, 136], "nonzero": 133, "evenodd": 133, "standardbuttonkind": [133, 142], "cancel": [133, 136], "help": [133, 227, 233], "ye": 133, "retri": 133, "dialogbuttonrol": [133, 136], "mousecursor": [133, 136], "progress": [133, 142], "crosshair": 133, "nodrop": 133, "notallow": 133, "grab": [133, 136], "colres": 133, "rowres": 133, "nresiz": 133, "eres": 133, "sresiz": 133, "wresiz": 133, "neres": 133, "nwresiz": 133, "seres": 133, "swresiz": 133, "ewres": 133, "nsresiz": 133, "neswres": 133, "nwseres": 133, "imagefit": [133, 136], "cover": [133, 231], "preserv": 133, "imagehorizontalalign": [133, 136], "imageverticalalign": [133, 136], "imagerend": [133, 136], "smooth": 133, "imagetil": [133, 136], "round": 133, "inputtyp": [133, 136, 142], "password": 133, "decim": 133, "spacebetween": 133, "spacearound": 133, "quadrat": 133, "cubic": 133, "endopen": 133, "endclos": 133, "unsort": 133, "ascend": 133, "descend": 133, "orient": [133, 136, 142], "horizont": 133, "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "parsedsvg": 135, "htmlimag": 135, "ninesliceimag": 135, "pixelformat": 135, "rgba": [135, 148, 155], "rgbapremultipli": 135, "alphamap": 135, "cachedpath": 135, "last_modifi": 135, "slint_target_wasm": [135, 139], "url": [135, 228], "embeddeddata": 135, "path_bodi": 135, "url_bodi": 135, "embeddeddata_bodi": 135, "embedded_data": 135, "isinvalid": 135, "ispath": 135, "isurl": 135, "isembeddeddata": 135, "rgba8premultipli": 135, "rgb8_bodi": 135, "rgba8_bodi": 135, "rgba8premultiplied_bodi": 135, "rgba8_premultipli": 135, "isrgb8": 135, "isrgba8": 135, "isrgba8premultipli": 135, "opaqueimagevt": 135, "cache_kei": 135, "original_s": 135, "imageinner_svg": 135, "imageinner_statictextur": 135, "imageinner_htmlimag": 135, "imageinner_backendstorag": 135, "imageinner_nineslic": 135, "7": [135, 142], "imageinner_embeddedimage_bodi": 135, "imageinner_svg_bodi": 135, "imageinner_statictextures_bodi": 135, "imageinner_htmlimage_bodi": 135, "imageinner_backendstorage_bodi": 135, "imageinner_borrowedopengltexture_bodi": 135, "imageinner_nineslice_bodi": 135, "embedded_imag": 135, "svg": 135, "static_textur": 135, "html_imag": 135, "backend_storag": 135, "borrowed_open_gl_textur": 135, "nine_slic": 135, "isimageinner_non": 135, "isimageinner_embeddedimag": 135, "isimageinner_svg": 135, "isimageinner_statictextur": 135, "isimageinner_htmlimag": 135, "isimageinner_backendstorag": 135, "isimageinner_borrowedopengltextur": 135, "isimageinner_nineslic": 135, "image1": 135, "image2": 135, "logicallength": [136, 142], "physical_region_max_s": 136, "delegatefocu": 136, "focusev": 136, "focusin": 136, "focusout": 136, "windowreceivedfocu": 136, "windowlostfocu": 136, "focuseventresult": 136, "focusaccept": 136, "focusignor": 136, "inputeventresult": 136, "eventaccept": 136, "eventignor": 136, "grabmous": 136, "keyeventresult": 136, "updatecomposit": 136, "commitcomposit": 136, "renderingresult": 136, "continuerenderingchildren": 136, "continuerenderingwithoutchildren": 136, "fronttoback": 136, "undoitemkind": 136, "textinsert": 136, "textremov": 136, "flickabledata": 136, "itemrendererref": 136, "physicalpx": 136, "visitchildrenresult": 136, "visitchildrenresult_continu": 136, "uint64_max": 136, "inputeventfilterresult": 136, "forwardev": 136, "forwardandignor": 136, "forwardandinterceptgrab": 136, "intercept": 136, "delayforward": 136, "delayforwarding_bodi": 136, "delay_forward": 136, "pin": [136, 142], "my_item": 136, "cached_rendering_data_offset": 136, "layout_info": 136, "window_adapt": [136, 142], "input_event_filter_before_children": 136, "self_rc": 136, "input_ev": 136, "focus_ev": 136, "key_ev": 136, "visit_item": 136, "children_count": 136, "children_index": 136, "dynamic_tre": 136, "replaceselectedtext": 136, "replaceselectedtext_bodi": 136, "replace_selected_text": 136, "supportedaccessibilityact": 136, "supportedaccessibilityaction_default": 136, "supportedaccessibilityaction_decr": 136, "supportedaccessibilityaction_incr": 136, "supportedaccessibilityaction_replaceselectedtext": 136, "supportedaccessibilityaction_setvalu": 136, "get_subtree_rang": 136, "get_subtre": 136, "subindex": 136, "get_item_tre": 136, "parent_nod": 136, "embed_compon": 136, "parent_item_tree_index": 136, "subtree_index": 136, "supported_accessibility_act": 136, "item_element_info": 136, "do_creat": 136, "_1": [136, 139, 140, 141], "itemtreerefpin": 136, "flickabledatabox": 136, "preeditselect": 136, "cachedrenderingdata": [136, 142], "cache_index": 136, "cache_gener": 136, "undoitem": 136, "cursor": 136, "anchor": 136, "font_famili": 136, "font_siz": 136, "font_weight": 136, "font_ital": 136, "selection_foreground_color": 136, "selection_background_color": 136, "horizontal_align": 136, "vertical_align": 136, "wrap": [136, 229, 233], "input_typ": [136, 142], "letter_spac": 136, "cursor_position_byte_offset": 136, "anchor_position_byte_offset": 136, "text_cursor_width": [136, 142], "cursor_vis": 136, "has_focu": [136, 142], "cursor_position_chang": 136, "single_lin": 136, "read_onli": 136, "cached_rendering_data": [136, 142], "preferred_x_po": 136, "undo_item": 136, "redo_item": 136, "col_or_row": 136, "easeinelast": 136, "easeoutelast": 136, "easeinoutelast": 136, "easeinbounc": 136, "easeoutbounc": 136, "easeinoutbounc": 136, "cubicbezier_bodi": 136, "delai": [136, 146], "iteration_count": 136, "eas": 136, "pointerpress": 136, "pointerreleas": 136, "pointermov": 136, "pointerscrol": 136, "pointerexit": 136, "keypressrep": 136, "pointerpressed_bodi": 136, "pointerreleased_bodi": 136, "pointermoved_bodi": 136, "pointerscrolled_bodi": 136, "keypressed_bodi": 136, "keypressrepeated_bodi": 136, "keyreleased_bodi": 136, "pointer_press": 136, "pointer_releas": 136, "pointer_mov": 136, "pointer_scrol": 136, "key_press": 136, "key_press_rep": 136, "key_releas": 136, "destructor": [136, 162, 229], "thankfulli": 136, "charactermapentri": 136, "code_point": 136, "glyph_index": 136, "bitmapglyph": 136, "int16_t": 136, "x_advanc": 136, "pixel_s": 136, "glyph_data": 136, "family_nam": 136, "character_map": 136, "units_per_em": 136, "ascent": 136, "descent": 136, "glyph": [136, 228], "weight": 136, "ital": 136, "box2d": 136, "basicborderrectangl": 136, "border_width": 136, "border_radiu": 136, "border_color": 136, "borderrectangl": 136, "border_top_left_radiu": 136, "border_top_right_radiu": 136, "border_bottom_left_radiu": 136, "border_bottom_right_radiu": 136, "imageitem": 136, "image_fit": 136, "image_rend": 136, "clippedimag": 136, "source_clip_x": 136, "source_clip_i": 136, "source_clip_width": 136, "source_clip_height": 136, "horizontal_til": 136, "vertical_til": 136, "toucharea": 136, "has_hov": [136, 142], "pressed_x": [136, 142], "pressed_i": [136, 142], "mouse_x": 136, "mouse_i": 136, "mouse_cursor": 136, "click": [136, 142, 227], "double_click": 136, "pointer_ev": 136, "scroll_ev": 136, "focusscop": 136, "focus_changed_ev": 136, "swipegesturerecogn": 136, "swipe_left": 136, "swipe_right": 136, "swipe_up": 136, "swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "pressed_tim": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": 136, "stroke": 136, "stroke_width": 136, "stroke_styl": 136, "fill_rul": 136, "viewbox_x": 136, "viewbox_i": 136, "viewbox_width": 136, "viewbox_height": 136, "windowitem": 136, "no_fram": 136, "resize_border_width": 136, "always_on_top": 136, "icon": [136, 142], "default_font_famili": 136, "default_font_weight": 136, "boxshadow": 136, "offset_x": 136, "offset_i": 136, "blur": 136, "rotation_angl": 136, "rotation_origin_x": 136, "rotation_origin_i": 136, "cache_rendering_hint": 136, "sig": [136, 141], "slint_date_time_use_24_hour_format": 136, "slint_date_time_month_day_count": 136, "month": 136, "year": 136, "slint_date_time_month_offset": 136, "slint_date_time_format_d": 136, "dai": 136, "slint_date_time_date_now": 136, "slint_date_time_parse_d": 136, "date": 136, "slint_visit_item_tre": 136, "visit_dynam": 136, "dyn_index": 136, "self_compon": 136, "self_index": 136, "slint_textinput_set_selection_offset": 136, "text_input": 136, "slint_textinput_select_al": 136, "slint_textinput_clear_select": 136, "slint_textinput_cut": 136, "slint_textinput_copi": 136, "slint_textinput_past": 136, "slint_reorder_dialog_button_layout": 136, "pointer_to_valu": [136, 141], "intercept_set": [136, 141], "intercept_set_bind": [136, 141], "new_bind": [136, 141], "start_inst": [136, 141], "ct": [136, 141], "eval_fn": [136, 141], "notify_fn": [136, 141], "slint_animation_tick": [136, 141], "ss": [136, 144], "byte": [136, 144], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231], "focus_item": 136, "rendering_st": 136, "slint_decl_item": [136, 142], "itemnam": [136, 142], "undef": [136, 142], "source_fil": [137, 163], "column": [137, 163], "property_nam": [137, 138, 164, 229], "property_typ": [137, 164], "12": [138, 142], "dynamiccomponentvrc": 138, "double_": 138, "stru": [138, 165, 166], "inst": 138, "def": 138, "component_definition_ptr": 138, "translation_domain": 138, "style_out": 138, "out_diag": 138, "radius_x": 139, "radius_i": 139, "x_rotat": 139, "large_arc": 139, "sweep": 139, "control_1_x": 139, "control_1_i": 139, "control_2_x": 139, "control_2_i": 139, "control_x": 139, "control_i": 139, "moveto": 139, "lineto": 139, "arcto": 139, "cubicto": 139, "quadraticto": 139, "moveto_bodi": 139, "lineto_bodi": 139, "arcto_bodi": 139, "cubicto_bodi": 139, "quadraticto_bodi": 139, "move_to": 139, "line_to": 139, "arc_to": 139, "cubic_to": 139, "quadratic_to": 139, "ismoveto": 139, "islineto": 139, "isarcto": 139, "iscubicto": 139, "isquadraticto": 139, "isclos": 139, "elements_bodi": 139, "events_bodi": 139, "commands_bodi": 139, "isnon": 139, "isel": 139, "isev": 139, "iscommand": 139, "first_el": 139, "out_ev": 139, "out_coordin": 139, "first_ev": 139, "first_coordin": 139, "layoutconstraintsreprc": 140, "windowadapteruserdata": 140, "_a": 140, "_b": 140, "platformuserdata": 140, "slint_ensure_backend": 140, "quit_on_last_window_clos": 140, "win": 140, "error_str": 140, "font_data": 140, "wp": 140, "get_renderer_ref": 140, "window_factori": 140, "buffer_ag": 140, "buffer_len": 140, "process_line_fn": 140, "_hinstanc": 140, "ns_view": 140, "_ns_window": 140, "handle_opaqu": 140, "malloc": 140, "propertyhandl": 141, "dep_nod": 141, "hack": 142, "alert": 142, "qt_widget": 142, "sync": 142, "slinttypeerasedwidget": 142, "slinttypeerasedwidgetptr": 142, "layout_spac": 142, "layout_pad": 142, "window_background": 142, "default_text_color": 142, "textedit_background": 142, "textedit_text_color": 142, "textedit_background_dis": 142, "textedit_text_color_dis": 142, "placeholder_color": 142, "placeholder_color_dis": 142, "dark_color_schem": 142, "tab_bar_align": 142, "style_change_listen": 142, "foreground": 142, "alternate_background": 142, "alternate_foreground": 142, "accent_background": 142, "accent_foreground": 142, "control_background": 142, "control_foreground": 142, "selection_background": 142, "selection_foreground": 142, "border": 142, "qstyle_standardpixmap": 142, "qaccessible_ev": 142, "qaccessible_rol": 142, "qaccessible_text": 142, "qt_keyboardmodifi": 142, "qt_alignmentflag": 142, "qt_textflag": 142, "qt_kei": 142, "qt_cursorshap": 142, "qt_fillrul": 142, "nativebutton": 142, "colorize_icon": 142, "standard_button_kind": 142, "is_standard_button": 142, "widget_ptr": 142, "animation_track": 142, "nativespinboxdata": 142, "active_control": 142, "nativespinbox": 142, "step_siz": 142, "nativecheckbox": 142, "toggl": [142, 227], "nativesliderdata": 142, "pressed_v": 142, "nativeslid": 142, "nativeprogressind": 142, "indetermin": 142, "nativegroupbox": 142, "native_padding_left": 142, "native_padding_right": 142, "native_padding_top": 142, "native_padding_bottom": 142, "nativelineedit": 142, "nativescrollview": 142, "horizontal_max": 142, "horizontal_page_s": 142, "horizontal_valu": 142, "vertical_max": 142, "vertical_page_s": 142, "vertical_valu": 142, "nativestandardlistviewitem": 142, "is_select": 142, "nativetableheadersect": 142, "nativecombobox": 142, "is_open": 142, "current_valu": 142, "nativecomboboxpopup": 142, "nativetabwidget": 142, "content_min_height": 142, "content_min_width": 142, "tabbar_preferred_height": 142, "tabbar_preferred_width": 142, "current_index": 142, "current_focus": 142, "content_x": 142, "content_i": 142, "content_height": 142, "content_width": 142, "tabbar_x": 142, "tabbar_i": 142, "tabbar_height": 142, "tabbar_width": 142, "nativetab": 142, "tab_index": 142, "num_tab": 142, "qstyle_standardpixmap_sp_titlebarmenubutton": 142, "qstyle_standardpixmap_sp_titlebarminbutton": 142, "qstyle_standardpixmap_sp_titlebarmaxbutton": 142, "qstyle_standardpixmap_sp_titlebarclosebutton": 142, "qstyle_standardpixmap_sp_titlebarnormalbutton": 142, "qstyle_standardpixmap_sp_titlebarshadebutton": 142, "qstyle_standardpixmap_sp_titlebarunshadebutton": 142, "qstyle_standardpixmap_sp_titlebarcontexthelpbutton": 142, "qstyle_standardpixmap_sp_dockwidgetclosebutton": 142, "qstyle_standardpixmap_sp_messageboxinform": 142, "9": [142, 148], "qstyle_standardpixmap_sp_messageboxwarn": 142, "10": 142, "qstyle_standardpixmap_sp_messageboxcrit": 142, "11": 142, "qstyle_standardpixmap_sp_messageboxquest": 142, "qstyle_standardpixmap_sp_desktopicon": 142, "13": 142, "qstyle_standardpixmap_sp_trashicon": 142, "14": 142, "qstyle_standardpixmap_sp_computericon": 142, "15": 142, "qstyle_standardpixmap_sp_drivefdicon": 142, "qstyle_standardpixmap_sp_drivehdicon": 142, "qstyle_standardpixmap_sp_drivecdicon": 142, "18": 142, "qstyle_standardpixmap_sp_drivedvdicon": 142, "19": 142, "qstyle_standardpixmap_sp_driveneticon": 142, "qstyle_standardpixmap_sp_diropenicon": 142, "21": [142, 227, 231], "qstyle_standardpixmap_sp_dirclosedicon": 142, "22": 142, "qstyle_standardpixmap_sp_dirlinkicon": 142, "23": 142, "qstyle_standardpixmap_sp_dirlinkopenicon": 142, "qstyle_standardpixmap_sp_fileicon": 142, "25": 142, "qstyle_standardpixmap_sp_filelinkicon": 142, "qstyle_standardpixmap_sp_toolbarhorizontalextensionbutton": 142, "27": 142, "qstyle_standardpixmap_sp_toolbarverticalextensionbutton": 142, "28": 142, "qstyle_standardpixmap_sp_filedialogstart": 142, "29": 142, "qstyle_standardpixmap_sp_filedialogend": 142, "qstyle_standardpixmap_sp_filedialogtopar": 142, "31": 142, "qstyle_standardpixmap_sp_filedialognewfold": 142, "32": 142, "qstyle_standardpixmap_sp_filedialogdetailedview": 142, "33": 142, "qstyle_standardpixmap_sp_filedialoginfoview": 142, "34": 142, "qstyle_standardpixmap_sp_filedialogcontentsview": 142, "35": 142, "qstyle_standardpixmap_sp_filedialoglistview": 142, "36": 142, "qstyle_standardpixmap_sp_filedialogback": 142, "37": 142, "qstyle_standardpixmap_sp_diricon": 142, "38": 142, "qstyle_standardpixmap_sp_dialogokbutton": 142, "39": 142, "qstyle_standardpixmap_sp_dialogcancelbutton": 142, "40": 142, "qstyle_standardpixmap_sp_dialoghelpbutton": 142, "41": 142, "qstyle_standardpixmap_sp_dialogopenbutton": 142, "qstyle_standardpixmap_sp_dialogsavebutton": 142, "43": 142, "qstyle_standardpixmap_sp_dialogclosebutton": 142, "44": 142, "qstyle_standardpixmap_sp_dialogapplybutton": 142, "45": 142, "qstyle_standardpixmap_sp_dialogresetbutton": 142, "46": 142, "qstyle_standardpixmap_sp_dialogdiscardbutton": 142, "47": 142, "qstyle_standardpixmap_sp_dialogyesbutton": 142, "48": 142, "qstyle_standardpixmap_sp_dialognobutton": 142, "49": 142, "qstyle_standardpixmap_sp_arrowup": 142, "qstyle_standardpixmap_sp_arrowdown": 142, "51": 142, "qstyle_standardpixmap_sp_arrowleft": 142, "52": 142, "qstyle_standardpixmap_sp_arrowright": 142, "53": 142, "qstyle_standardpixmap_sp_arrowback": 142, "54": 142, "qstyle_standardpixmap_sp_arrowforward": 142, "55": 142, "qstyle_standardpixmap_sp_dirhomeicon": 142, "56": 142, "qstyle_standardpixmap_sp_commandlink": 142, "57": 142, "qstyle_standardpixmap_sp_vistashield": 142, "58": 142, "qstyle_standardpixmap_sp_browserreload": 142, "59": 142, "qstyle_standardpixmap_sp_browserstop": 142, "60": 142, "qstyle_standardpixmap_sp_mediaplai": 142, "61": 142, "qstyle_standardpixmap_sp_mediastop": 142, "62": 142, "qstyle_standardpixmap_sp_mediapaus": 142, "63": 142, "qstyle_standardpixmap_sp_mediaskipforward": 142, "64": [142, 227, 234], "qstyle_standardpixmap_sp_mediaskipbackward": 142, "65": 142, "qstyle_standardpixmap_sp_mediaseekforward": 142, "66": 142, "qstyle_standardpixmap_sp_mediaseekbackward": 142, "67": 142, "qstyle_standardpixmap_sp_mediavolum": 142, "68": 142, "qstyle_standardpixmap_sp_mediavolumemut": 142, "69": 142, "qstyle_standardpixmap_sp_lineeditclearbutton": 142, "70": 142, "qstyle_standardpixmap_sp_dialogyestoallbutton": 142, "71": 142, "qstyle_standardpixmap_sp_dialognotoallbutton": 142, "72": 142, "qstyle_standardpixmap_sp_dialogsaveallbutton": 142, "73": [142, 227], "qstyle_standardpixmap_sp_dialogabortbutton": 142, "74": 142, "qstyle_standardpixmap_sp_dialogretrybutton": 142, "75": 142, "qstyle_standardpixmap_sp_dialogignorebutton": 142, "76": 142, "qstyle_standardpixmap_sp_restoredefaultsbutton": 142, "77": 142, "qstyle_standardpixmap_sp_custombas": 142, "4026531840": 142, "qaccessible_event_soundplai": 142, "qaccessible_event_alert": 142, "qaccessible_event_foregroundchang": 142, "qaccessible_event_menustart": 142, "qaccessible_event_menuend": 142, "qaccessible_event_popupmenustart": 142, "qaccessible_event_popupmenuend": 142, "qaccessible_event_contexthelpstart": 142, "qaccessible_event_contexthelpend": 142, "qaccessible_event_dragdropstart": 142, "qaccessible_event_dragdropend": 142, "qaccessible_event_dialogstart": 142, "qaccessible_event_dialogend": 142, "qaccessible_event_scrollingstart": 142, "qaccessible_event_scrollingend": 142, "qaccessible_event_menucommand": 142, "qaccessible_event_actionchang": 142, "257": 142, "qaccessible_event_activedescendantchang": 142, "258": 142, "qaccessible_event_attributechang": 142, "259": 142, "qaccessible_event_documentcontentchang": 142, "260": 142, "qaccessible_event_documentloadcomplet": 142, "261": 142, "qaccessible_event_documentloadstop": 142, "262": 142, "qaccessible_event_documentreload": 142, "263": 142, "qaccessible_event_hyperlinkendindexchang": 142, "264": 142, "qaccessible_event_hyperlinknumberofanchorschang": 142, "265": 142, "qaccessible_event_hyperlinkselectedlinkchang": 142, "266": 142, "qaccessible_event_hypertextlinkactiv": 142, "267": 142, "qaccessible_event_hypertextlinkselect": 142, "268": 142, "qaccessible_event_hyperlinkstartindexchang": 142, "269": 142, "qaccessible_event_hypertextchang": 142, "qaccessible_event_hypertextnlinkschang": 142, "271": 142, "qaccessible_event_objectattributechang": 142, "272": 142, "qaccessible_event_pagechang": 142, "273": 142, "qaccessible_event_sectionchang": 142, "274": 142, "qaccessible_event_tablecaptionchang": 142, "275": 142, "qaccessible_event_tablecolumndescriptionchang": 142, "276": 142, "qaccessible_event_tablecolumnheaderchang": 142, "277": 142, "qaccessible_event_tablemodelchang": 142, "278": 142, "qaccessible_event_tablerowdescriptionchang": 142, "279": 142, "qaccessible_event_tablerowheaderchang": 142, "280": 142, "qaccessible_event_tablesummarychang": 142, "281": 142, "qaccessible_event_textattributechang": 142, "282": 142, "qaccessible_event_textcaretmov": 142, "283": 142, "qaccessible_event_textcolumnchang": 142, "285": 142, "qaccessible_event_textinsert": 142, "286": 142, "qaccessible_event_textremov": 142, "287": 142, "qaccessible_event_textupd": 142, "288": 142, "qaccessible_event_textselectionchang": 142, "289": 142, "qaccessible_event_visibledatachang": 142, "290": 142, "qaccessible_event_objectcr": 142, "32768": 142, "qaccessible_event_objectdestroi": 142, "32769": 142, "qaccessible_event_objectshow": 142, "32770": 142, "qaccessible_event_objecthid": 142, "32771": 142, "qaccessible_event_objectreord": 142, "32772": 142, "qaccessible_event_focu": 142, "32773": 142, "qaccessible_event_select": 142, "32774": 142, "qaccessible_event_selectionadd": 142, "32775": 142, "qaccessible_event_selectionremov": 142, "32776": 142, "qaccessible_event_selectionwithin": 142, "32777": 142, "qaccessible_event_statechang": 142, "32778": 142, "qaccessible_event_locationchang": 142, "32779": 142, "qaccessible_event_namechang": 142, "32780": 142, "qaccessible_event_descriptionchang": 142, "32781": 142, "qaccessible_event_valuechang": 142, "32782": 142, "qaccessible_event_parentchang": 142, "32783": 142, "qaccessible_event_helpchang": 142, "32928": 142, "qaccessible_event_defaultactionchang": 142, "32944": 142, "qaccessible_event_acceleratorchang": 142, "32960": 142, "qaccessible_event_invalidev": 142, "32961": 142, "qaccessible_role_norol": 142, "qaccessible_role_titlebar": 142, "qaccessible_role_menubar": 142, "qaccessible_role_scrollbar": 142, "qaccessible_role_grip": 142, "qaccessible_role_sound": 142, "qaccessible_role_cursor": 142, "qaccessible_role_caret": 142, "qaccessible_role_alertmessag": 142, "qaccessible_role_window": 142, "qaccessible_role_cli": 142, "qaccessible_role_popupmenu": 142, "qaccessible_role_menuitem": 142, "qaccessible_role_tooltip": 142, "qaccessible_role_appl": 142, "qaccessible_role_docu": 142, "qaccessible_role_pan": 142, "qaccessible_role_chart": 142, "qaccessible_role_dialog": 142, "qaccessible_role_bord": 142, "qaccessible_role_group": 142, "qaccessible_role_separ": 142, "qaccessible_role_toolbar": 142, "qaccessible_role_statusbar": 142, "qaccessible_role_t": 142, "qaccessible_role_columnhead": 142, "qaccessible_role_rowhead": 142, "qaccessible_role_column": 142, "qaccessible_role_row": 142, "qaccessible_role_cel": 142, "qaccessible_role_link": 142, "qaccessible_role_helpballoon": 142, "qaccessible_role_assist": 142, "qaccessible_role_list": 142, "qaccessible_role_listitem": 142, "qaccessible_role_tre": 142, "qaccessible_role_treeitem": 142, "qaccessible_role_pagetab": 142, "qaccessible_role_propertypag": 142, "qaccessible_role_ind": 142, "qaccessible_role_graph": 142, "qaccessible_role_statictext": 142, "qaccessible_role_editabletext": 142, "qaccessible_role_button": 142, "qaccessible_role_pushbutton": 142, "qaccessible_role_checkbox": 142, "qaccessible_role_radiobutton": 142, "qaccessible_role_combobox": 142, "qaccessible_role_progressbar": 142, "qaccessible_role_di": 142, "qaccessible_role_hotkeyfield": 142, "qaccessible_role_slid": 142, "qaccessible_role_spinbox": 142, "qaccessible_role_canva": 142, "qaccessible_role_anim": 142, "qaccessible_role_equ": 142, "qaccessible_role_buttondropdown": 142, "qaccessible_role_buttonmenu": 142, "qaccessible_role_buttondropgrid": 142, "qaccessible_role_whitespac": 142, "qaccessible_role_pagetablist": 142, "qaccessible_role_clock": 142, "qaccessible_role_splitt": 142, "qaccessible_role_layeredpan": 142, "128": 142, "qaccessible_role_termin": 142, "129": 142, "qaccessible_role_desktop": 142, "130": 142, "qaccessible_role_paragraph": 142, "131": 142, "qaccessible_role_webdocu": 142, "132": 142, "qaccessible_role_sect": 142, "133": 142, "qaccessible_role_notif": 142, "134": 142, "qaccessible_role_colorchoos": 142, "1028": 142, "qaccessible_role_foot": 142, "1038": 142, "qaccessible_role_form": 142, "1040": 142, "qaccessible_role_head": 142, "1044": 142, "qaccessible_role_not": 142, "1051": 142, "qaccessible_role_complementarycont": 142, "1068": 142, "qaccessible_role_userrol": 142, "65535": 142, "qaccessible_text_nam": 142, "qaccessible_text_descript": 142, "qaccessible_text_valu": 142, "qaccessible_text_help": 142, "qaccessible_text_acceler": 142, "qaccessible_text_debugdescript": 142, "qaccessible_text_usertext": 142, "qt_keyboardmodifier_nomodifi": 142, "qt_keyboardmodifier_shiftmodifi": 142, "33554432": 142, "qt_keyboardmodifier_controlmodifi": 142, "67108864": 142, "qt_keyboardmodifier_altmodifi": 142, "134217728": 142, "qt_keyboardmodifier_metamodifi": 142, "268435456": 142, "qt_keyboardmodifier_keypadmodifi": 142, "536870912": 142, "qt_keyboardmodifier_groupswitchmodifi": 142, "1073741824": 142, "qt_keyboardmodifier_keyboardmodifiermask": 142, "4261412864": 142, "qt_alignmentflag_alignleft": 142, "qt_alignmentflag_alignlead": 142, "qt_alignmentflag_alignright": 142, "qt_alignmentflag_aligntrail": 142, "qt_alignmentflag_alignhcent": 142, "qt_alignmentflag_alignjustifi": 142, "qt_alignmentflag_alignabsolut": 142, "qt_alignmentflag_alignhorizontal_mask": 142, "qt_alignmentflag_aligntop": 142, "qt_alignmentflag_alignbottom": 142, "qt_alignmentflag_alignvcent": 142, "qt_alignmentflag_alignbaselin": 142, "256": 142, "qt_alignmentflag_alignvertical_mask": 142, "480": 142, "qt_alignmentflag_aligncent": 142, "qt_textflag_textsinglelin": 142, "qt_textflag_textdontclip": 142, "512": 142, "qt_textflag_textexpandtab": 142, "1024": 142, "qt_textflag_textshowmnemon": 142, "2048": 142, "qt_textflag_textwordwrap": 142, "4096": 142, "qt_textflag_textwrapanywher": 142, "8192": 142, "qt_textflag_textdontprint": 142, "16384": 142, "qt_textflag_textincludetrailingspac": 142, "qt_textflag_texthidemnemon": 142, "qt_textflag_textjustificationforc": 142, "65536": 142, "qt_textflag_textforcelefttoright": 142, "131072": 142, "qt_textflag_textforcerighttoleft": 142, "262144": 142, "qt_textflag_textlongestvari": 142, "524288": 142, "qt_textflag_textbypassshap": 142, "1048576": 142, "qt_key_key_escap": 142, "16777216": 142, "qt_key_key_tab": 142, "16777217": 142, "qt_key_key_backtab": 142, "16777218": 142, "qt_key_key_backspac": 142, "16777219": 142, "qt_key_key_return": 142, "16777220": 142, "qt_key_key_ent": 142, "16777221": 142, "qt_key_key_insert": 142, "16777222": 142, "qt_key_key_delet": 142, "16777223": 142, "qt_key_key_paus": 142, "16777224": 142, "qt_key_key_print": 142, "16777225": 142, "qt_key_key_sysreq": 142, "16777226": 142, "qt_key_key_clear": 142, "16777227": 142, "qt_key_key_hom": 142, "16777232": 142, "qt_key_key_end": 142, "16777233": 142, "qt_key_key_left": 142, "16777234": 142, "qt_key_key_up": 142, "16777235": 142, "qt_key_key_right": 142, "16777236": 142, "qt_key_key_down": 142, "16777237": 142, "qt_key_key_pageup": 142, "16777238": 142, "qt_key_key_pagedown": 142, "16777239": 142, "qt_key_key_shift": 142, "16777248": 142, "qt_key_key_control": 142, "16777249": 142, "qt_key_key_meta": 142, "16777250": 142, "qt_key_key_alt": 142, "16777251": 142, "qt_key_key_capslock": 142, "16777252": 142, "qt_key_key_numlock": 142, "16777253": 142, "qt_key_key_scrolllock": 142, "16777254": 142, "qt_key_key_f1": 142, "16777264": 142, "qt_key_key_f2": 142, "16777265": 142, "qt_key_key_f3": 142, "16777266": 142, "qt_key_key_f4": 142, "16777267": 142, "qt_key_key_f5": 142, "16777268": 142, "qt_key_key_f6": 142, "16777269": 142, "qt_key_key_f7": 142, "16777270": 142, "qt_key_key_f8": 142, "16777271": 142, "qt_key_key_f9": 142, "16777272": 142, "qt_key_key_f10": 142, "16777273": 142, "qt_key_key_f11": 142, "16777274": 142, "qt_key_key_f12": 142, "16777275": 142, "qt_key_key_f13": 142, "16777276": 142, "qt_key_key_f14": 142, "16777277": 142, "qt_key_key_f15": 142, "16777278": 142, "qt_key_key_f16": 142, "16777279": 142, "qt_key_key_f17": 142, "16777280": 142, "qt_key_key_f18": 142, "16777281": 142, "qt_key_key_f19": 142, "16777282": 142, "qt_key_key_f20": 142, "16777283": 142, "qt_key_key_f21": 142, "16777284": 142, "qt_key_key_f22": 142, "16777285": 142, "qt_key_key_f23": 142, "16777286": 142, "qt_key_key_f24": 142, "16777287": 142, "qt_key_key_f25": 142, "16777288": 142, "qt_key_key_f26": 142, "16777289": 142, "qt_key_key_f27": 142, "16777290": 142, "qt_key_key_f28": 142, "16777291": 142, "qt_key_key_f29": 142, "16777292": 142, "qt_key_key_f30": 142, "16777293": 142, "qt_key_key_f31": 142, "16777294": 142, "qt_key_key_f32": 142, "16777295": 142, "qt_key_key_f33": 142, "16777296": 142, "qt_key_key_f34": 142, "16777297": 142, "qt_key_key_f35": 142, "16777298": 142, "qt_key_key_super_l": 142, "16777299": 142, "qt_key_key_super_r": 142, "16777300": 142, "qt_key_key_menu": 142, "16777301": 142, "qt_key_key_hyper_l": 142, "16777302": 142, "qt_key_key_hyper_r": 142, "16777303": 142, "qt_key_key_help": 142, "16777304": 142, "qt_key_key_direction_l": 142, "16777305": 142, "qt_key_key_direction_r": 142, "16777312": 142, "qt_key_key_spac": 142, "qt_key_key_ani": 142, "qt_key_key_exclam": 142, "qt_key_key_quotedbl": 142, "qt_key_key_numbersign": 142, "qt_key_key_dollar": 142, "qt_key_key_perc": 142, "qt_key_key_ampersand": 142, "qt_key_key_apostroph": 142, "qt_key_key_parenleft": 142, "qt_key_key_parenright": 142, "qt_key_key_asterisk": 142, "qt_key_key_plu": 142, "qt_key_key_comma": 142, "qt_key_key_minu": 142, "qt_key_key_period": 142, "qt_key_key_slash": 142, "qt_key_key_0": 142, "qt_key_key_1": 142, "qt_key_key_2": 142, "qt_key_key_3": 142, "qt_key_key_4": 142, "qt_key_key_5": 142, "qt_key_key_6": 142, "qt_key_key_7": 142, "qt_key_key_8": 142, "qt_key_key_9": 142, "qt_key_key_colon": 142, "qt_key_key_semicolon": 142, "qt_key_key_less": 142, "qt_key_key_equ": 142, "qt_key_key_great": 142, "qt_key_key_quest": 142, "qt_key_key_at": 142, "qt_key_key_a": 142, "qt_key_key_b": 142, "qt_key_key_c": 142, "qt_key_key_d": 142, "qt_key_key_": 142, "qt_key_key_f": 142, "qt_key_key_g": 142, "qt_key_key_h": 142, "qt_key_key_i": 142, "qt_key_key_j": 142, "qt_key_key_k": 142, "qt_key_key_l": 142, "qt_key_key_m": 142, "qt_key_key_n": 142, "78": 142, "qt_key_key_o": 142, "79": 142, "qt_key_key_p": 142, "80": 142, "qt_key_key_q": 142, "81": 142, "qt_key_key_r": 142, "82": 142, "83": 142, "qt_key_key_t": 142, "84": 142, "qt_key_key_u": 142, "85": 142, "qt_key_key_v": 142, "86": 142, "qt_key_key_w": 142, "87": 142, "qt_key_key_x": 142, "88": 142, "89": 142, "qt_key_key_z": 142, "qt_key_key_bracketleft": 142, "91": 142, "qt_key_key_backslash": 142, "92": 142, "qt_key_key_bracketright": 142, "93": 142, "qt_key_key_asciicircum": 142, "94": 142, "qt_key_key_underscor": 142, "95": 142, "qt_key_key_quoteleft": 142, "96": 142, "qt_key_key_braceleft": 142, "123": 142, "qt_key_key_bar": 142, "124": 142, "qt_key_key_braceright": 142, "125": 142, "qt_key_key_asciitild": 142, "126": 142, "qt_key_key_nobreakspac": 142, "qt_key_key_exclamdown": 142, "161": 142, "162": 142, "qt_key_key_sterl": 142, "163": 142, "qt_key_key_curr": 142, "164": 142, "qt_key_key_yen": 142, "165": 142, "qt_key_key_brokenbar": 142, "166": 142, "qt_key_key_sect": 142, "167": 142, "qt_key_key_diaeresi": 142, "168": 142, "qt_key_key_copyright": 142, "169": 142, "qt_key_key_ordfeminin": 142, "170": 142, "qt_key_key_guillemotleft": 142, "171": 142, "qt_key_key_notsign": 142, "172": 142, "qt_key_key_hyphen": 142, "173": 142, "qt_key_key_regist": 142, "174": 142, "qt_key_key_macron": 142, "175": 142, "qt_key_key_degre": 142, "176": 142, "qt_key_key_plusminu": 142, "177": 142, "qt_key_key_twosuperior": 142, "178": 142, "qt_key_key_threesuperior": 142, "179": 142, "qt_key_key_acut": 142, "qt_key_key_mu": 142, "181": 142, "qt_key_key_paragraph": 142, "182": 142, "qt_key_key_periodcent": 142, "183": 142, "qt_key_key_cedilla": 142, "184": 142, "qt_key_key_onesuperior": 142, "185": 142, "qt_key_key_masculin": 142, "186": 142, "qt_key_key_guillemotright": 142, "187": 142, "qt_key_key_onequart": 142, "188": 142, "qt_key_key_onehalf": 142, "189": 142, "qt_key_key_threequart": 142, "190": 142, "qt_key_key_questiondown": 142, "191": 142, "qt_key_key_agrav": 142, "192": 142, "qt_key_key_aacut": 142, "193": 142, "qt_key_key_acircumflex": 142, "194": 142, "qt_key_key_atild": 142, "195": 142, "qt_key_key_adiaeresi": 142, "196": 142, "qt_key_key_ar": 142, "197": 142, "198": 142, "qt_key_key_ccedilla": 142, "199": 142, "qt_key_key_egrav": 142, "200": [142, 148], "qt_key_key_eacut": 142, "201": 142, "qt_key_key_ecircumflex": 142, "202": 142, "qt_key_key_ediaeresi": 142, "203": 142, "qt_key_key_igrav": 142, "204": 142, "qt_key_key_iacut": 142, "205": 142, "qt_key_key_icircumflex": 142, "206": 142, "qt_key_key_idiaeresi": 142, "207": 142, "qt_key_key_eth": 142, "208": 142, "qt_key_key_ntild": 142, "209": 142, "qt_key_key_ograv": 142, "210": 142, "qt_key_key_oacut": 142, "211": 142, "qt_key_key_ocircumflex": 142, "212": 142, "qt_key_key_otild": 142, "213": 142, "qt_key_key_odiaeresi": 142, "214": 142, "qt_key_key_multipli": 142, "215": 142, "qt_key_key_oobliqu": 142, "216": 142, "qt_key_key_ugrav": 142, "217": 142, "qt_key_key_uacut": 142, "218": 142, "qt_key_key_ucircumflex": 142, "219": 142, "qt_key_key_udiaeresi": 142, "220": 142, "qt_key_key_yacut": 142, "221": 142, "qt_key_key_thorn": 142, "222": 142, "qt_key_key_ssharp": 142, "223": 142, "qt_key_key_divis": 142, "247": 142, "qt_key_key_ydiaeresi": 142, "qt_key_key_altgr": 142, "16781571": 142, "qt_key_key_multi_kei": 142, "16781600": 142, "qt_key_key_codeinput": 142, "16781623": 142, "qt_key_key_singlecandid": 142, "16781628": 142, "qt_key_key_multiplecandid": 142, "16781629": 142, "qt_key_key_previouscandid": 142, "16781630": 142, "qt_key_key_mode_switch": 142, "16781694": 142, "qt_key_key_kanji": 142, "16781601": 142, "qt_key_key_muhenkan": 142, "16781602": 142, "qt_key_key_henkan": 142, "16781603": 142, "qt_key_key_romaji": 142, "16781604": 142, "qt_key_key_hiragana": 142, "16781605": 142, "qt_key_key_katakana": 142, "16781606": 142, "qt_key_key_hiragana_katakana": 142, "16781607": 142, "qt_key_key_zenkaku": 142, "16781608": 142, "qt_key_key_hankaku": 142, "16781609": 142, "qt_key_key_zenkaku_hankaku": 142, "16781610": 142, "qt_key_key_touroku": 142, "16781611": 142, "qt_key_key_massyo": 142, "16781612": 142, "qt_key_key_kana_lock": 142, "16781613": 142, "qt_key_key_kana_shift": 142, "16781614": 142, "qt_key_key_eisu_shift": 142, "16781615": 142, "qt_key_key_eisu_toggl": 142, "16781616": 142, "qt_key_key_hangul": 142, "16781617": 142, "qt_key_key_hangul_start": 142, "16781618": 142, "qt_key_key_hangul_end": 142, "16781619": 142, "qt_key_key_hangul_hanja": 142, "16781620": 142, "qt_key_key_hangul_jamo": 142, "16781621": 142, "qt_key_key_hangul_romaja": 142, "16781622": 142, "qt_key_key_hangul_jeonja": 142, "16781624": 142, "qt_key_key_hangul_banja": 142, "16781625": 142, "qt_key_key_hangul_prehanja": 142, "16781626": 142, "qt_key_key_hangul_posthanja": 142, "16781627": 142, "qt_key_key_hangul_speci": 142, "16781631": 142, "qt_key_key_dead_grav": 142, "16781904": 142, "qt_key_key_dead_acut": 142, "16781905": 142, "qt_key_key_dead_circumflex": 142, "16781906": 142, "qt_key_key_dead_tild": 142, "16781907": 142, "qt_key_key_dead_macron": 142, "16781908": 142, "qt_key_key_dead_brev": 142, "16781909": 142, "qt_key_key_dead_abovedot": 142, "16781910": 142, "qt_key_key_dead_diaeresi": 142, "16781911": 142, "qt_key_key_dead_abov": 142, "16781912": 142, "qt_key_key_dead_doubleacut": 142, "16781913": 142, "qt_key_key_dead_caron": 142, "16781914": 142, "qt_key_key_dead_cedilla": 142, "16781915": 142, "qt_key_key_dead_ogonek": 142, "16781916": 142, "qt_key_key_dead_iota": 142, "16781917": 142, "qt_key_key_dead_voiced_sound": 142, "16781918": 142, "qt_key_key_dead_semivoiced_sound": 142, "16781919": 142, "qt_key_key_dead_belowdot": 142, "16781920": 142, "qt_key_key_dead_hook": 142, "16781921": 142, "qt_key_key_dead_horn": 142, "16781922": 142, "qt_key_key_dead_strok": 142, "16781923": 142, "qt_key_key_dead_abovecomma": 142, "16781924": 142, "qt_key_key_dead_abovereversedcomma": 142, "16781925": 142, "qt_key_key_dead_doublegrav": 142, "16781926": 142, "qt_key_key_dead_belowr": 142, "16781927": 142, "qt_key_key_dead_belowmacron": 142, "16781928": 142, "qt_key_key_dead_belowcircumflex": 142, "16781929": 142, "qt_key_key_dead_belowtild": 142, "16781930": 142, "qt_key_key_dead_belowbrev": 142, "16781931": 142, "qt_key_key_dead_belowdiaeresi": 142, "16781932": 142, "qt_key_key_dead_invertedbrev": 142, "16781933": 142, "qt_key_key_dead_belowcomma": 142, "16781934": 142, "qt_key_key_dead_curr": 142, "16781935": 142, "qt_key_key_dead_a": 142, "16781952": 142, "16781953": 142, "qt_key_key_dead_": 142, "16781954": 142, "16781955": 142, "qt_key_key_dead_i": 142, "16781956": 142, "16781957": 142, "qt_key_key_dead_o": 142, "16781958": 142, "16781959": 142, "qt_key_key_dead_u": 142, "16781960": 142, "16781961": 142, "qt_key_key_dead_small_schwa": 142, "16781962": 142, "qt_key_key_dead_capital_schwa": 142, "16781963": 142, "qt_key_key_dead_greek": 142, "16781964": 142, "qt_key_key_dead_lowlin": 142, "16781968": 142, "qt_key_key_dead_aboveverticallin": 142, "16781969": 142, "qt_key_key_dead_belowverticallin": 142, "16781970": 142, "qt_key_key_dead_longsolidusoverlai": 142, "16781971": 142, "qt_key_key_back": 142, "16777313": 142, "qt_key_key_forward": 142, "16777314": 142, "qt_key_key_stop": 142, "16777315": 142, "qt_key_key_refresh": 142, "16777316": 142, "qt_key_key_volumedown": 142, "16777328": 142, "qt_key_key_volumemut": 142, "16777329": 142, "qt_key_key_volumeup": 142, "16777330": 142, "qt_key_key_bassboost": 142, "16777331": 142, "qt_key_key_bassup": 142, "16777332": 142, "qt_key_key_bassdown": 142, "16777333": 142, "qt_key_key_trebleup": 142, "16777334": 142, "qt_key_key_trebledown": 142, "16777335": 142, "qt_key_key_mediaplai": 142, "16777344": 142, "qt_key_key_mediastop": 142, "16777345": 142, "qt_key_key_mediaprevi": 142, "16777346": 142, "qt_key_key_medianext": 142, "16777347": 142, "qt_key_key_mediarecord": 142, "16777348": 142, "qt_key_key_mediapaus": 142, "16777349": 142, "qt_key_key_mediatoggleplaypaus": 142, "16777350": 142, "qt_key_key_homepag": 142, "16777360": 142, "qt_key_key_favorit": 142, "16777361": 142, "qt_key_key_search": 142, "16777362": 142, "qt_key_key_standbi": 142, "16777363": 142, "qt_key_key_openurl": 142, "16777364": 142, "qt_key_key_launchmail": 142, "16777376": 142, "qt_key_key_launchmedia": 142, "16777377": 142, "qt_key_key_launch0": 142, "16777378": 142, "qt_key_key_launch1": 142, "16777379": 142, "qt_key_key_launch2": 142, "16777380": 142, "qt_key_key_launch3": 142, "16777381": 142, "qt_key_key_launch4": 142, "16777382": 142, "qt_key_key_launch5": 142, "16777383": 142, "qt_key_key_launch6": 142, "16777384": 142, "qt_key_key_launch7": 142, "16777385": 142, "qt_key_key_launch8": 142, "16777386": 142, "qt_key_key_launch9": 142, "16777387": 142, "qt_key_key_launcha": 142, "16777388": 142, "qt_key_key_launchb": 142, "16777389": 142, "qt_key_key_launchc": 142, "16777390": 142, "qt_key_key_launchd": 142, "16777391": 142, "qt_key_key_launch": 142, "16777392": 142, "qt_key_key_launchf": 142, "16777393": 142, "qt_key_key_monbrightnessup": 142, "16777394": 142, "qt_key_key_monbrightnessdown": 142, "16777395": 142, "qt_key_key_keyboardlightonoff": 142, "16777396": 142, "qt_key_key_keyboardbrightnessup": 142, "16777397": 142, "qt_key_key_keyboardbrightnessdown": 142, "16777398": 142, "qt_key_key_poweroff": 142, "16777399": 142, "qt_key_key_wakeup": 142, "16777400": 142, "qt_key_key_eject": 142, "16777401": 142, "qt_key_key_screensav": 142, "16777402": 142, "qt_key_key_www": 142, "16777403": 142, "qt_key_key_memo": 142, "16777404": 142, "qt_key_key_lightbulb": 142, "16777405": 142, "qt_key_key_shop": 142, "16777406": 142, "qt_key_key_histori": 142, "16777407": 142, "qt_key_key_addfavorit": 142, "16777408": 142, "qt_key_key_hotlink": 142, "16777409": 142, "qt_key_key_brightnessadjust": 142, "16777410": 142, "qt_key_key_fin": 142, "16777411": 142, "qt_key_key_commun": 142, "16777412": 142, "qt_key_key_audiorewind": 142, "16777413": 142, "qt_key_key_backforward": 142, "16777414": 142, "qt_key_key_applicationleft": 142, "16777415": 142, "qt_key_key_applicationright": 142, "16777416": 142, "qt_key_key_book": 142, "16777417": 142, "qt_key_key_cd": 142, "16777418": 142, "qt_key_key_calcul": 142, "16777419": 142, "qt_key_key_todolist": 142, "16777420": 142, "qt_key_key_cleargrab": 142, "16777421": 142, "qt_key_key_clos": 142, "16777422": 142, "qt_key_key_copi": 142, "16777423": 142, "qt_key_key_cut": 142, "16777424": 142, "qt_key_key_displai": 142, "16777425": 142, "qt_key_key_do": 142, "16777426": 142, "qt_key_key_docu": 142, "16777427": 142, "qt_key_key_excel": 142, "16777428": 142, "qt_key_key_explor": 142, "16777429": 142, "qt_key_key_gam": 142, "16777430": 142, "qt_key_key_go": 142, "16777431": 142, "qt_key_key_itouch": 142, "16777432": 142, "qt_key_key_logoff": 142, "16777433": 142, "qt_key_key_market": 142, "16777434": 142, "qt_key_key_meet": 142, "16777435": 142, "qt_key_key_menukb": 142, "16777436": 142, "qt_key_key_menupb": 142, "16777437": 142, "qt_key_key_mysit": 142, "16777438": 142, "qt_key_key_new": 142, "16777439": 142, "qt_key_key_officehom": 142, "16777440": 142, "qt_key_key_opt": 142, "16777441": 142, "qt_key_key_past": 142, "16777442": 142, "qt_key_key_phon": 142, "16777443": 142, "qt_key_key_calendar": 142, "16777444": 142, "qt_key_key_repli": 142, "16777445": 142, "qt_key_key_reload": 142, "16777446": 142, "qt_key_key_rotatewindow": 142, "16777447": 142, "qt_key_key_rotationpb": 142, "16777448": 142, "qt_key_key_rotationkb": 142, "16777449": 142, "qt_key_key_sav": 142, "16777450": 142, "qt_key_key_send": 142, "16777451": 142, "qt_key_key_spel": 142, "16777452": 142, "qt_key_key_splitscreen": 142, "16777453": 142, "qt_key_key_support": 142, "16777454": 142, "qt_key_key_taskpan": 142, "16777455": 142, "qt_key_key_termin": 142, "16777456": 142, "qt_key_key_tool": 142, "16777457": 142, "qt_key_key_travel": 142, "16777458": 142, "qt_key_key_video": 142, "16777459": 142, "qt_key_key_word": 142, "16777460": 142, "qt_key_key_xf": 142, "16777461": 142, "qt_key_key_zoomin": 142, "16777462": 142, "qt_key_key_zoomout": 142, "16777463": 142, "qt_key_key_awai": 142, "16777464": 142, "qt_key_key_messeng": 142, "16777465": 142, "qt_key_key_webcam": 142, "16777466": 142, "qt_key_key_mailforward": 142, "16777467": 142, "qt_key_key_pictur": 142, "16777468": 142, "qt_key_key_mus": 142, "16777469": 142, "qt_key_key_batteri": 142, "16777470": 142, "qt_key_key_bluetooth": 142, "16777471": 142, "qt_key_key_wlan": 142, "16777472": 142, "qt_key_key_uwb": 142, "16777473": 142, "qt_key_key_audioforward": 142, "16777474": 142, "qt_key_key_audiorepeat": 142, "16777475": 142, "qt_key_key_audiorandomplai": 142, "16777476": 142, "qt_key_key_subtitl": 142, "16777477": 142, "qt_key_key_audiocycletrack": 142, "16777478": 142, "qt_key_key_tim": 142, "16777479": 142, "qt_key_key_hibern": 142, "16777480": 142, "qt_key_key_view": 142, "16777481": 142, "qt_key_key_topmenu": 142, "16777482": 142, "qt_key_key_powerdown": 142, "16777483": 142, "qt_key_key_suspend": 142, "16777484": 142, "qt_key_key_contrastadjust": 142, "16777485": 142, "qt_key_key_launchg": 142, "16777486": 142, "qt_key_key_launchh": 142, "16777487": 142, "qt_key_key_touchpadtoggl": 142, "16777488": 142, "qt_key_key_touchpadon": 142, "16777489": 142, "qt_key_key_touchpadoff": 142, "16777490": 142, "qt_key_key_micmut": 142, "16777491": 142, "16777492": 142, "qt_key_key_green": 142, "16777493": 142, "qt_key_key_yellow": 142, "16777494": 142, "qt_key_key_blu": 142, "16777495": 142, "qt_key_key_channelup": 142, "16777496": 142, "qt_key_key_channeldown": 142, "16777497": 142, "qt_key_key_guid": 142, "16777498": 142, "qt_key_key_info": 142, "16777499": 142, "qt_key_key_set": 142, "16777500": 142, "qt_key_key_micvolumeup": 142, "16777501": 142, "qt_key_key_micvolumedown": 142, "16777502": 142, "16777504": 142, "qt_key_key_open": 142, "16777505": 142, "qt_key_key_find": 142, "16777506": 142, "qt_key_key_undo": 142, "16777507": 142, "qt_key_key_redo": 142, "16777508": 142, "qt_key_key_medialast": 142, "16842751": 142, "qt_key_key_select": 142, "16842752": 142, "qt_key_key_y": 142, "16842753": 142, "qt_key_key_no": 142, "16842754": 142, "qt_key_key_cancel": 142, "16908289": 142, "16908290": 142, "qt_key_key_execut": 142, "16908291": 142, "qt_key_key_sleep": 142, "16908292": 142, "qt_key_key_plai": 142, "16908293": 142, "qt_key_key_zoom": 142, "16908294": 142, "qt_key_key_exit": 142, "16908298": 142, "qt_key_key_context1": 142, "17825792": 142, "qt_key_key_context2": 142, "17825793": 142, "qt_key_key_context3": 142, "17825794": 142, "qt_key_key_context4": 142, "17825795": 142, "qt_key_key_cal": 142, "17825796": 142, "qt_key_key_hangup": 142, "17825797": 142, "qt_key_key_flip": 142, "17825798": 142, "qt_key_key_togglecallhangup": 142, "17825799": 142, "qt_key_key_voicedi": 142, "17825800": 142, "qt_key_key_lastnumberredi": 142, "17825801": 142, "qt_key_key_camera": 142, "17825824": 142, "qt_key_key_camerafocu": 142, "17825825": 142, "qt_key_key_unknown": 142, "33554431": 142, "qt_cursorshape_arrowcursor": 142, "qt_cursorshape_uparrowcursor": 142, "qt_cursorshape_crosscursor": 142, "qt_cursorshape_waitcursor": 142, "qt_cursorshape_ibeamcursor": 142, "qt_cursorshape_sizevercursor": 142, "qt_cursorshape_sizehorcursor": 142, "qt_cursorshape_sizebdiagcursor": 142, "qt_cursorshape_sizefdiagcursor": 142, "qt_cursorshape_sizeallcursor": 142, "qt_cursorshape_blankcursor": 142, "qt_cursorshape_splitvcursor": 142, "qt_cursorshape_splithcursor": 142, "qt_cursorshape_pointinghandcursor": 142, "qt_cursorshape_forbiddencursor": 142, "qt_cursorshape_whatsthiscursor": 142, "qt_cursorshape_busycursor": 142, "qt_cursorshape_openhandcursor": 142, "qt_cursorshape_closedhandcursor": 142, "qt_cursorshape_dragcopycursor": 142, "qt_cursorshape_dragmovecursor": 142, "qt_cursorshape_draglinkcursor": 142, "qt_cursorshape_lastcursor": 142, "qt_cursorshape_bitmapcursor": 142, "qt_cursorshape_customcursor": 142, "qt_fillrule_oddevenfil": 142, "qt_fillrule_windingfil": 142, "degre": [147, 234], "disk": [148, 228], "effici": [148, 158, 227, 232], "dimens": 148, "afterward": 148, "320x200": 148, "pixel_buff": 148, "320": 148, "low_level_rend": 148, "through": [148, 231, 232], "the_width": 148, "the_height": 148, "the_data": 148, "raw_data": 148, "bgr_data": 148, "flip": 148, "nine": 148, "edg": 148, "corner": 148, "distort": 148, "cut": 148, "remain": [148, 159, 228], "bindabl": 148, "gl_texture_2d": 148, "gl_rgba": 148, "safeti": 148, "unsaf": 148, "lead": 148, "undefin": 148, "driver": 148, "consequ": 148, "dimension": [153, 160], "precis": [156, 234], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": [158, 231], "hood": 158, "utf": [158, 234], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": 158, "lexicograph": 158, "less": [158, 233], "greater": [158, 228], "concaten": 158, "primarili": 159, "dereferenc": [159, 165, 166], "th": 159, "unaffect": 159, "standardlistview": 161, "standardtableview": 161, "singl": [162, 228], "shot": 162, "equival": 162, "fire": 162, "calcul": 162, "along": [163, 227], "simpl": [164, 231], "introduc": 165, "keyword": 165, "anonym": [165, 234], "notat": 165, "lst": 165, "field": [165, 166, 229, 234], "sure": [165, 166, 227], "retain": [165, 166], "syntax": [165, 166, 232], "go": [165, 166], "field_nam": [165, 166], "field_valu": [165, 166], "16bit": 167, "subdirectori": 172, "variabl": [172, 227, 228], "mit": [227, 228, 229, 231, 233, 234], "2019": 227, "newer": 227, "autom": 227, "offer": 227, "linkag": 227, "recommend": 227, "ninja": 227, "track": 227, "gninja": 227, "cmake_gener": 227, "download": 227, "linux": 227, "x86": 227, "architectur": 227, "flexibl": [227, 233], "open": 227, "latest": [227, 231], "asset": 227, "xxx": 227, "x86_64": 227, "tar": 227, "gz": 227, "win64": 227, "ex": 227, "unpack": 227, "archiv": 227, "cmake_prefix_path": 227, "altern": 227, "dcmake_prefix_path": 227, "find_packag": [227, 231], "cmakelist": [227, 231], "txt": [227, 231], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232], "guid": [227, 231], "rustc": 227, "cargo": [227, 232], "project": [227, 231], "fetchcont": [227, 231], "snippet": 227, "fetchcontent_declar": [227, 231], "git_repositori": [227, 231], "git": [227, 231], "upgrad": [227, 231], "git_tag": [227, 231], "source_subdir": [227, 231], "fetchcontent_makeavail": [227, 231], "regular": 227, "choic": 227, "optim": [227, 228, 233], "stack": 227, "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": 227, "ccmake": 227, "more": [227, 229, 231, 232, 233], "discov": 227, "disabl": 227, "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": 227, "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 233], "inform": [227, 233], "slint_feature_backend_": 227, "stabl": [227, 228], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": 227, "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": 227, "rustup": 227, "iconfigur": 227, "drust_cargo_target": 227, "arm64": 227, "board": 227, "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": 227, "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 227, "dslint_feature_freestand": 227, "standard": 227, "dbuild_shared_lib": 227, "dslint_feature_renderer_softwar": 227, "ddefault_slint_embed_resourc": 227, "emb": [227, 228], "mcu": 227, "arm": 227, "cortex": 227, "complet": 227, "thumbv7em": 227, "eabihf": 227, "library_path": 228, "name1": 228, "lib1": 228, "name2": 228, "lib2": 228, "compilation_unit": 228, "num": 228, "tell": 228, "builtin": 228, "target_sourc": 228, "build": [228, 229, 231, 232], "extend": 228, "the_window": 228, "thewindow": 228, "output": 228, "mycomponentlib": 228, "redirect": 228, "add_execut": [228, 231], "my_appl": [228, 231], "target_link_librari": [228, 231], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 233], "split": 228, "across": 228, "abil": 228, "perform": [228, 233], "minimis": 228, "anywher": 228, "slint_embed_resourc": 228, "default_slint_embed_resourc": 228, "devic": [228, 232, 234], "ratio": [228, 234], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 233], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 233], "aliv": [229, 233], "complex": [229, 233], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232], "mainwindow": 229, "get_count": 229, "set_count": 229, "get_user_nam": 229, "set_user_nam": 229, "invoke_hello": 229, "on_hello": 229, "callback_handl": 229, "invoke_do_someth": 229, "omit": 229, "togeth": 229, "on_to_uppercas": 229, "per": 229, "slint_target_sourc": [231, 233], "cmake_minimum_requir": 231, "cxx": 231, "three": 231, "packag": 231, "approach": [231, 233], "add_custom_command": 231, "post_build": 231, "cmake_command": 231, "target_runtime_dl": 231, "target_file_dir": 231, "command_expand_list": 231, "helloworld": [231, 232], "400px": [231, 232], "my_label": 231, "200px": [231, 232], "hello_world": 231, "set_my_label": 231, "depth": 231, "walk": 231, "game": 231, "Of": 231, "cours": 231, "recip": 231, "toolkit": 232, "fluid": 232, "desktop": 232, "power": 232, "placement": 232, "flow": 232, "familiar": 232, "hierarchi": 232, "obligatori": 232, "visual": 232, "studio": 232, "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": 232, "instal": 232, "explain": 233, "veri": 233, "ahead": 233, "smallest": 233, "footprint": 233, "best": 233, "price": 233, "opportun": 233, "popul": 233, "slower": 233, "With": 233, "polymorph": 233, "commonli": 233, "consum": 233, "invoke_global_callback": 233, "summar": 234, "easili": 234, "physical_length": 234, "At": 234, "camelcas": 234, "mystruct": 234, "camel": 234, "myenum": 234, "beta": 234, "gamma": 234, "omicron": 234, "betagamma": 234}, "objects": {"": [[33, 0, 1, "c.SLINT_FEATURE_ACCESSIBILITY", "SLINT_FEATURE_ACCESSIBILITY"], [27, 0, 1, "c.SLINT_FEATURE_BACKEND_LINUXKMS", "SLINT_FEATURE_BACKEND_LINUXKMS"], [23, 0, 1, "c.SLINT_FEATURE_BACKEND_QT", "SLINT_FEATURE_BACKEND_QT"], [39, 0, 1, "c.SLINT_FEATURE_BACKEND_WINIT", "SLINT_FEATURE_BACKEND_WINIT"], [28, 0, 1, "c.SLINT_FEATURE_EXPERIMENTAL", "SLINT_FEATURE_EXPERIMENTAL"], [36, 0, 1, "c.SLINT_FEATURE_FREESTANDING", "SLINT_FEATURE_FREESTANDING"], [24, 0, 1, "c.SLINT_FEATURE_GETTEXT", "SLINT_FEATURE_GETTEXT"], [25, 0, 1, "c.SLINT_FEATURE_INTERPRETER", "SLINT_FEATURE_INTERPRETER"], [30, 0, 1, "c.SLINT_FEATURE_RENDERER_FEMTOVG", "SLINT_FEATURE_RENDERER_FEMTOVG"], [31, 0, 1, "c.SLINT_FEATURE_RENDERER_SKIA", "SLINT_FEATURE_RENDERER_SKIA"], [34, 0, 1, "c.SLINT_FEATURE_RENDERER_SOFTWARE", "SLINT_FEATURE_RENDERER_SOFTWARE"], [32, 0, 1, "c.SLINT_FEATURE_SYSTEM_TESTING", "SLINT_FEATURE_SYSTEM_TESTING"], [37, 0, 1, "c.SLINT_FEATURE_TESTING", "SLINT_FEATURE_TESTING"], [38, 0, 1, "c.SLINT_VERSION_MAJOR", "SLINT_VERSION_MAJOR"], [35, 0, 1, "c.SLINT_VERSION_MINOR", "SLINT_VERSION_MINOR"], [26, 0, 1, "c.SLINT_VERSION_PATCH", "SLINT_VERSION_PATCH"], [29, 0, 1, "c.SLINT_VERSION_STRING", "SLINT_VERSION_STRING"], [40, 0, 1, "c.assert_eq", "assert_eq"], [0, 1, 1, "_CPPv4N5slint5BrushE", "slint::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushEv", "slint::Brush::Brush"], [0, 3, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter"], [0, 3, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush5colorEv", "slint::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker"], [0, 3, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker::factor"], [0, 2, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!="], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::a"], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::b"], [0, 2, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator=="], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::a"], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::b"], [0, 2, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize"], [0, 3, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha"], [0, 3, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha::alpha"], [54, 4, 1, "_CPPv4N5slint20CloseRequestResponseE", "slint::CloseRequestResponse"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse10HideWindowE", "slint::CloseRequestResponse::HideWindow"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE", "slint::CloseRequestResponse::KeepWindowShown"], [1, 1, 1, "_CPPv4N5slint5ColorE", "slint::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorEv", "slint::Color::Color"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color::col"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color::col"], [1, 2, 1, "_CPPv4NK5slint5Color5alphaEv", "slint::Color::alpha"], [1, 2, 1, "_CPPv4NK5slint5Color15as_argb_encodedEv", "slint::Color::as_argb_encoded"], [1, 2, 1, "_CPPv4NK5slint5Color4blueEv", "slint::Color::blue"], [1, 2, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter"], [1, 3, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter::factor"], [1, 2, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker"], [1, 3, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker::factor"], [1, 2, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded"], [1, 3, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded::argb_encoded"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::red"], [1, 2, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::a"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::h"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::s"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::v"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::red"], [1, 2, 1, "_CPPv4NK5slint5Color5greenEv", "slint::Color::green"], [1, 2, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::factor"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::other"], [1, 2, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::color"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::stream"], [1, 2, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator=="], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::lhs"], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::rhs"], [1, 2, 1, "_CPPv4NK5slint5Color3redEv", "slint::Color::red"], [1, 2, 1, "_CPPv4NK5slint5Color13to_argb_floatEv", "slint::Color::to_argb_float"], [1, 2, 1, "_CPPv4NK5slint5Color12to_argb_uintEv", "slint::Color::to_argb_uint"], [1, 2, 1, "_CPPv4NK5slint5Color7to_hsvaEv", "slint::Color::to_hsva"], [1, 2, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize"], [1, 3, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize::factor"], [1, 2, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha"], [1, 3, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha::alpha"], [2, 1, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle"], [2, 2, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle"], [2, 3, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle::inner"], [2, 6, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle::T"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandle8into_dynEv", "slint::ComponentHandle::into_dyn"], [2, 2, 1, "_CPPv4N5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4N5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [3, 1, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 3, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle::other"], [3, 6, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle::T"], [3, 2, 1, "_CPPv4NK5slint19ComponentWeakHandle4lockEv", "slint::ComponentWeakHandle::lock"], [51, 4, 1, "_CPPv4N5slint13EventLoopModeE", "slint::EventLoopMode"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE", "slint::EventLoopMode::QuitOnLastWindowClosed"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE", "slint::EventLoopMode::RunUntilQuit"], [4, 1, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel"], [4, 2, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::filter_fn"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::source_model"], [4, 6, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel::ModelData"], [4, 2, 1, "_CPPv4N5slint11FilterModel5resetEv", "slint::FilterModel::reset"], [4, 2, 1, "_CPPv4NK5slint11FilterModel9row_countEv", "slint::FilterModel::row_count"], [4, 2, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data"], [4, 3, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data::i"], [4, 2, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::i"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::value"], [4, 2, 1, "_CPPv4NK5slint11FilterModel12source_modelEv", "slint::FilterModel::source_model"], [4, 2, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row"], [4, 3, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row::filtered_row"], [52, 4, 1, "_CPPv4N5slint11GraphicsAPIE", "slint::GraphicsAPI"], [52, 5, 1, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE", "slint::GraphicsAPI::NativeOpenGL"], [147, 1, 1, "_CPPv4N5slint9HsvaColorE", "slint::HsvaColor"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5alphaE", "slint::HsvaColor::alpha"], [147, 7, 1, "_CPPv4N5slint9HsvaColor3hueE", "slint::HsvaColor::hue"], [147, 7, 1, "_CPPv4N5slint9HsvaColor10saturationE", "slint::HsvaColor::saturation"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5valueE", "slint::HsvaColor::value"], [148, 1, 1, "_CPPv4N5slint5ImageE", "slint::Image"], [148, 4, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE", "slint::Image::BorrowedOpenGLTextureOrigin"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::BottomLeft"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::TopLeft"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageEv", "slint::Image::Image"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image::buffer"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image::buffer"], [148, 2, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::origin"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::size"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::texture_id"], [148, 2, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path"], [148, 3, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path::file_path"], [148, 2, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!="], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::a"], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::b"], [148, 2, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator=="], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::a"], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::b"], [148, 2, 1, "_CPPv4NK5slint5Image4pathEv", "slint::Image::path"], [148, 2, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::bottom"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::left"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::right"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::top"], [148, 2, 1, "_CPPv4NK5slint5Image4sizeEv", "slint::Image::size"], [149, 1, 1, "_CPPv4N5slint15LogicalPositionE", "slint::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv", "slint::LogicalPosition::LogicalPosition"], [149, 3, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition::p"], [150, 1, 1, "_CPPv4N5slint11LogicalSizeE", "slint::LogicalSize"], [150, 2, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize"], [150, 3, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize::s"], [5, 1, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel"], [5, 2, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::map_fn"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::source_model"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::MappedModelData"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::SourceModelData"], [5, 2, 1, "_CPPv4N5slint8MapModel5resetEv", "slint::MapModel::reset"], [5, 2, 1, "_CPPv4NK5slint8MapModel9row_countEv", "slint::MapModel::row_count"], [5, 2, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data"], [5, 3, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data::i"], [5, 2, 1, "_CPPv4NK5slint8MapModel12source_modelEv", "slint::MapModel::source_model"], [6, 1, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelERK5Model", "slint::Model::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelEv", "slint::Model::Model"], [6, 6, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model::ModelData"], [6, 2, 1, "_CPPv4N5slint5ModelaSERK5Model", "slint::Model::operator="], [6, 2, 1, "_CPPv4N5slint5Model5resetEv", "slint::Model::reset"], [6, 2, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::count"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::index"], [6, 2, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed"], [6, 3, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed::row"], [6, 2, 1, "_CPPv4NK5slint5Model9row_countEv", "slint::Model::row_count"], [6, 2, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data"], [6, 3, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data::i"], [6, 2, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::count"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::index"], [6, 2, 1, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData", "slint::Model::set_row_data"], [6, 2, 1, "_CPPv4N5slint5ModelD0Ev", "slint::Model::~Model"], [151, 1, 1, "_CPPv4N5slint16PhysicalPositionE", "slint::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv", "slint::PhysicalPosition::PhysicalPosition"], [151, 3, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition::p"], [152, 1, 1, "_CPPv4N5slint12PhysicalSizeE", "slint::PhysicalSize"], [152, 2, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize"], [152, 3, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize::s"], [153, 1, 1, "_CPPv4I0EN5slint5PointE", "slint::Point"], [153, 6, 1, "_CPPv4I0EN5slint5PointE", "slint::Point::T"], [153, 2, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator=="], [153, 3, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator==::other"], [153, 7, 1, "_CPPv4N5slint5Point1xE", "slint::Point::x"], [153, 7, 1, "_CPPv4N5slint5Point1yE", "slint::Point::y"], [50, 4, 1, "_CPPv4N5slint18PointerEventButtonE", "slint::PointerEventButton"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4LeftE", "slint::PointerEventButton::Left"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton6MiddleE", "slint::PointerEventButton::Middle"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5OtherE", "slint::PointerEventButton::Other"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5RightE", "slint::PointerEventButton::Right"], [53, 4, 1, "_CPPv4N5slint14RenderingStateE", "slint::RenderingState"], [53, 5, 1, "_CPPv4N5slint14RenderingState14AfterRenderingE", "slint::RenderingState::AfterRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState15BeforeRenderingE", "slint::RenderingState::BeforeRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState14RenderingSetupE", "slint::RenderingState::RenderingSetup"], [53, 5, 1, "_CPPv4N5slint14RenderingState17RenderingTeardownE", "slint::RenderingState::RenderingTeardown"], [7, 1, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel"], [7, 6, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel::ModelData"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel::source_model"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel9row_countEv", "slint::ReverseModel::row_count"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data"], [7, 3, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data::i"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::i"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::value"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel12source_modelEv", "slint::ReverseModel::source_model"], [154, 1, 1, "_CPPv4N5slint9Rgb8PixelE", "slint::Rgb8Pixel"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1bE", "slint::Rgb8Pixel::b"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1gE", "slint::Rgb8Pixel::g"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1rE", "slint::Rgb8Pixel::r"], [155, 1, 1, "_CPPv4N5slint10Rgba8PixelE", "slint::Rgba8Pixel"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1aE", "slint::Rgba8Pixel::a"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1bE", "slint::Rgba8Pixel::b"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1gE", "slint::Rgba8Pixel::g"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1rE", "slint::Rgba8Pixel::r"], [156, 1, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::col"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 6, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor::T"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5alphaE", "slint::RgbaColor::alpha"], [156, 7, 1, "_CPPv4N5slint9RgbaColor4blueE", "slint::RgbaColor::blue"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5greenE", "slint::RgbaColor::green"], [156, 7, 1, "_CPPv4N5slint9RgbaColor3redE", "slint::RgbaColor::red"], [49, 4, 1, "_CPPv4N5slint25SetRenderingNotifierErrorE", "slint::SetRenderingNotifierError"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE", "slint::SetRenderingNotifierError::AlreadySet"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE", "slint::SetRenderingNotifierError::Unsupported"], [157, 1, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer"], [157, 6, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer::Pixel"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::data"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv", "slint::SharedPixelBuffer::cbegin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer4cendEv", "slint::SharedPixelBuffer::cend"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6heightEv", "slint::SharedPixelBuffer::height"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator=="], [157, 3, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator==::other"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5widthEv", "slint::SharedPixelBuffer::width"], [158, 1, 1, "_CPPv4N5slint12SharedStringE", "slint::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEv", "slint::SharedString::SharedString"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString::other"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString::s"], [158, 2, 1, "_CPPv4NK5slint12SharedString5beginEv", "slint::SharedString::begin"], [158, 2, 1, "_CPPv4NK5slint12SharedString4dataEv", "slint::SharedString::data"], [158, 2, 1, "_CPPv4NK5slint12SharedString5emptyEv", "slint::SharedString::empty"], [158, 2, 1, "_CPPv4NK5slint12SharedString3endEv", "slint::SharedString::end"], [158, 2, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number"], [158, 3, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number::n"], [158, 2, 1, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv", "slint::SharedString::operator std::string_view"], [158, 2, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!="], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+="], [158, 3, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+=::other"], [158, 2, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::shared_string"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::stream"], [158, 2, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<="], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator="], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator=::s"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator=::s"], [158, 2, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator=="], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>="], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::b"], [158, 2, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedStringD0Ev", "slint::SharedString::~SharedString"], [159, 1, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector"], [159, 2, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorEv", "slint::SharedVector::SharedVector"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::InputIt"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector::args"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::first"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::last"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector::other"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::value"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector::T"], [159, 2, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at"], [159, 3, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector6cbeginEv", "slint::SharedVector::cbegin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4cendEv", "slint::SharedVector::cend"], [159, 2, 1, "_CPPv4N5slint12SharedVector5clearEv", "slint::SharedVector::clear"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5emptyEv", "slint::SharedVector::empty"], [159, 2, 1, "_CPPv4N5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4NK5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator="], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator="], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator=::other"], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator=::other"], [159, 2, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator=="], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::a"], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::b"], [159, 2, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 2, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 3, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 3, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back::value"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back::value"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4sizeEv", "slint::SharedVector::size"], [159, 2, 1, "_CPPv4N5slint12SharedVectorD0Ev", "slint::SharedVector::~SharedVector"], [160, 1, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size"], [160, 6, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size::T"], [160, 7, 1, "_CPPv4N5slint4Size6heightE", "slint::Size::height"], [160, 2, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator=="], [160, 3, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator==::other"], [160, 7, 1, "_CPPv4N5slint4Size5widthE", "slint::Size::width"], [8, 1, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel"], [8, 6, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel::ModelData"], [8, 2, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::comp"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::source_model"], [8, 2, 1, "_CPPv4N5slint9SortModel5resetEv", "slint::SortModel::reset"], [8, 2, 1, "_CPPv4NK5slint9SortModel9row_countEv", "slint::SortModel::row_count"], [8, 2, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data"], [8, 3, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data::i"], [8, 2, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::i"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::value"], [8, 2, 1, "_CPPv4NK5slint9SortModel12source_modelEv", "slint::SortModel::source_model"], [8, 2, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row"], [8, 3, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row::sorted_row_index"], [161, 1, 1, "_CPPv4N5slint20StandardListViewItemE", "slint::StandardListViewItem"], [161, 7, 1, "_CPPv4N5slint20StandardListViewItem4textE", "slint::StandardListViewItem::text"], [162, 1, 1, "_CPPv4N5slint5TimerE", "slint::Timer"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerERK5Timer", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerEv", "slint::Timer::Timer"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::interval"], [162, 2, 1, "_CPPv4NK5slint5Timer8intervalEv", "slint::Timer::interval"], [162, 2, 1, "_CPPv4N5slint5TimeraSERK5Timer", "slint::Timer::operator="], [162, 2, 1, "_CPPv4N5slint5Timer7restartEv", "slint::Timer::restart"], [162, 2, 1, "_CPPv4NK5slint5Timer7runningEv", "slint::Timer::running"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::duration"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::interval"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::mode"], [162, 2, 1, "_CPPv4N5slint5Timer4stopEv", "slint::Timer::stop"], [162, 2, 1, "_CPPv4N5slint5TimerD0Ev", "slint::Timer::~Timer"], [9, 1, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel"], [9, 6, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel::ModelData"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelEv", "slint::VectorModel::VectorModel"], [9, 3, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel::array"], [9, 2, 1, "_CPPv4N5slint11VectorModel5clearEv", "slint::VectorModel::clear"], [9, 2, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase"], [9, 3, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase::index"], [9, 2, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::index"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back"], [9, 3, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back::value"], [9, 2, 1, "_CPPv4NK5slint11VectorModel9row_countEv", "slint::VectorModel::row_count"], [9, 2, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data"], [9, 3, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data::i"], [9, 2, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::i"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector"], [9, 3, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector::array"], [10, 1, 1, "_CPPv4N5slint6WindowE", "slint::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window::other"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window::other"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv", "slint::Window::dispatch_close_requested_event"], [10, 2, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event"], [10, 3, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event::text"], [10, 2, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event"], [10, 3, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event::text"], [10, 2, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event"], [10, 3, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event::text"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv", "slint::Window::dispatch_pointer_exit_event"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event"], [10, 3, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::button"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::button"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_x"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_y"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event"], [10, 3, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event::s"], [10, 2, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event"], [10, 3, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event::factor"], [10, 2, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event"], [10, 3, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event::active"], [10, 2, 1, "_CPPv4NK5slint6Window21has_active_animationsEv", "slint::Window::has_active_animations"], [10, 2, 1, "_CPPv4N5slint6Window4hideEv", "slint::Window::hide"], [10, 2, 1, "_CPPv4NK5slint6Window13is_fullscreenEv", "slint::Window::is_fullscreen"], [10, 2, 1, "_CPPv4NK5slint6Window12is_maximizedEv", "slint::Window::is_maximized"], [10, 2, 1, "_CPPv4NK5slint6Window12is_minimizedEv", "slint::Window::is_minimized"], [10, 2, 1, "_CPPv4NK5slint6Window10is_visibleEv", "slint::Window::is_visible"], [10, 2, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested"], [10, 6, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::F"], [10, 3, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::callback"], [10, 2, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator="], [10, 2, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator="], [10, 3, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator=::other"], [10, 3, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator=::other"], [10, 2, 1, "_CPPv4NK5slint6Window8positionEv", "slint::Window::position"], [10, 2, 1, "_CPPv4NK5slint6Window14request_redrawEv", "slint::Window::request_redraw"], [10, 2, 1, "_CPPv4NK5slint6Window12scale_factorEv", "slint::Window::scale_factor"], [10, 2, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen"], [10, 3, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen::fullscreen"], [10, 2, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized"], [10, 3, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized::maximized"], [10, 2, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized"], [10, 3, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized::minimized"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position::pos"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position::pos"], [10, 2, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier"], [10, 6, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::F"], [10, 3, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::callback"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size::size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size::size"], [10, 2, 1, "_CPPv4N5slint6Window4showEv", "slint::Window::show"], [10, 2, 1, "_CPPv4NK5slint6Window4sizeEv", "slint::Window::size"], [10, 2, 1, "_CPPv4N5slint6WindowD0Ev", "slint::Window::~Window"], [99, 2, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop"], [99, 6, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::Functor"], [99, 3, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::f"], [11, 1, 1, "_CPPv4N5slint11interpreter17ComponentCompilerE", "slint::interpreter::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv", "slint::interpreter::ComponentCompiler::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path::path"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::source_code"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv", "slint::interpreter::ComponentCompiler::diagnostics"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv", "slint::interpreter::ComponentCompiler::include_paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths::paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain::domain"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv", "slint::interpreter::ComponentCompiler::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev", "slint::interpreter::ComponentCompiler::~ComponentCompiler"], [12, 1, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionE", "slint::interpreter::ComponentDefinition"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition"], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv", "slint::interpreter::ComponentDefinition::callbacks"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv", "slint::interpreter::ComponentDefinition::create"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv", "slint::interpreter::ComponentDefinition::functions"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv", "slint::interpreter::ComponentDefinition::globals"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv", "slint::interpreter::ComponentDefinition::name"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator="], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator=::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv", "slint::interpreter::ComponentDefinition::properties"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev", "slint::interpreter::ComponentDefinition::~ComponentDefinition"], [13, 1, 1, "_CPPv4N5slint11interpreter17ComponentInstanceE", "slint::interpreter::ComponentInstance"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv", "slint::interpreter::ComponentInstance::definition"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::prop_name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv", "slint::interpreter::ComponentInstance::hide"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::callable_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::global"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv", "slint::interpreter::ComponentInstance::qwidget"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv", "slint::interpreter::ComponentInstance::run"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::name"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::global"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::prop_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv", "slint::interpreter::ComponentInstance::show"], [13, 2, 1, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv", "slint::interpreter::ComponentInstance::window"], [163, 1, 1, "_CPPv4N5slint11interpreter10DiagnosticE", "slint::interpreter::Diagnostic"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic6columnE", "slint::interpreter::Diagnostic::column"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic5levelE", "slint::interpreter::Diagnostic::level"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic4lineE", "slint::interpreter::Diagnostic::line"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic7messageE", "slint::interpreter::Diagnostic::message"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE", "slint::interpreter::Diagnostic::source_file"], [47, 4, 1, "_CPPv4N5slint11interpreter15DiagnosticLevelE", "slint::interpreter::DiagnosticLevel"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE", "slint::interpreter::DiagnosticLevel::Error"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE", "slint::interpreter::DiagnosticLevel::Warning"], [164, 1, 1, "_CPPv4N5slint11interpreter18PropertyDescriptorE", "slint::interpreter::PropertyDescriptor"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE", "slint::interpreter::PropertyDescriptor::property_name"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE", "slint::interpreter::PropertyDescriptor::property_type"], [165, 1, 1, "_CPPv4N5slint11interpreter6StructE", "slint::interpreter::Struct"], [165, 2, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructEv", "slint::interpreter::Struct::Struct"], [165, 6, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::InputIterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct::args"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::end"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::it"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct::other"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct5beginEv", "slint::interpreter::Struct::begin"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct3endEv", "slint::interpreter::Struct::end"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field"], [165, 3, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field::name"], [165, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [166, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [166, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [165, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [166, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator=::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::name"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::value"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructD0Ev", "slint::interpreter::Struct::~Struct"], [14, 1, 1, "_CPPv4N5slint11interpreter5ValueE", "slint::interpreter::Value"], [14, 8, 1, "_CPPv4N5slint11interpreter5Value4TypeE", "slint::interpreter::Value::Type"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEv", "slint::interpreter::Value::Value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value::b"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value::brush"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value::img"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value::m"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value::str"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value::struc"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value::v"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value::value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value::value"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator="], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator=::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator=::other"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator=="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::a"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::b"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_arrayEv", "slint::interpreter::Value::to_array"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value7to_boolEv", "slint::interpreter::Value::to_bool"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_brushEv", "slint::interpreter::Value::to_brush"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_imageEv", "slint::interpreter::Value::to_image"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_numberEv", "slint::interpreter::Value::to_number"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_stringEv", "slint::interpreter::Value::to_string"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_structEv", "slint::interpreter::Value::to_struct"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value4typeEv", "slint::interpreter::Value::type"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueD0Ev", "slint::interpreter::Value::~Value"], [46, 4, 1, "_CPPv4N5slint11interpreter9ValueTypeE", "slint::interpreter::ValueType"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4BoolE", "slint::interpreter::ValueType::Bool"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5BrushE", "slint::interpreter::ValueType::Brush"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ImageE", "slint::interpreter::ValueType::Image"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ModelE", "slint::interpreter::ValueType::Model"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6NumberE", "slint::interpreter::ValueType::Number"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5OtherE", "slint::interpreter::ValueType::Other"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StringE", "slint::interpreter::ValueType::String"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StructE", "slint::interpreter::ValueType::Struct"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4VoidE", "slint::interpreter::ValueType::Void"], [98, 2, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop"], [98, 6, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::Functor"], [98, 3, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::f"], [15, 1, 1, "_CPPv4N5slint8platform16AbstractRendererE", "slint::platform::AbstractRenderer"], [16, 1, 1, "_CPPv4N5slint8platform18NativeWindowHandleE", "slint::platform::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nsview"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nswindow"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::surface"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hinstance"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hwnd"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::connection"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator=::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev", "slint::platform::NativeWindowHandle::~NativeWindowHandle"], [17, 1, 1, "_CPPv4N5slint8platform8PlatformE", "slint::platform::Platform"], [17, 4, 1, "_CPPv4N5slint8platform8Platform9ClipboardE", "slint::platform::Platform::Clipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE", "slint::platform::Platform::Clipboard::DefaultClipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE", "slint::platform::Platform::Clipboard::SelectionClipboard"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform", "slint::platform::Platform::Platform"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformEv", "slint::platform::Platform::Platform"], [17, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [18, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [17, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [17, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [17, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [18, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard", "slint::platform::Platform::clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8Platform21create_window_adapterEv", "slint::platform::Platform::create_window_adapter"], [17, 2, 1, "_CPPv4N5slint8platform8Platform20duration_since_startEv", "slint::platform::Platform::duration_since_start"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformaSERK8Platform", "slint::platform::Platform::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform15quit_event_loopEv", "slint::platform::Platform::quit_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14run_event_loopEv", "slint::platform::Platform::run_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task", "slint::platform::Platform::run_in_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard", "slint::platform::Platform::set_clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformD0Ev", "slint::platform::Platform::~Platform"], [167, 1, 1, "_CPPv4N5slint8platform11Rgb565PixelE", "slint::platform::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel::pixel"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1bE", "slint::platform::Rgb565Pixel::b"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv", "slint::platform::Rgb565Pixel::blue"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1gE", "slint::platform::Rgb565Pixel::g"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv", "slint::platform::Rgb565Pixel::green"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv", "slint::platform::Rgb565Pixel::operator Rgb8Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator=="], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::lhs"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::rhs"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1rE", "slint::platform::Rgb565Pixel::r"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv", "slint::platform::Rgb565Pixel::red"], [19, 1, 1, "_CPPv4N5slint8platform12SkiaRendererE", "slint::platform::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::initial_size"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::window_handle"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer", "slint::platform::SkiaRenderer::operator="], [19, 2, 1, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv", "slint::platform::SkiaRenderer::render"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendererD0Ev", "slint::platform::SkiaRenderer::~SkiaRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRendererE", "slint::platform::SoftwareRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [169, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE", "slint::platform::SoftwareRenderer::RenderingRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE", "slint::platform::SoftwareRenderer::RenderingRotation::NoRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate180"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate270"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate90"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE", "slint::platform::SoftwareRenderer::RepaintBufferType"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::NewBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::ReusedBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE", "slint::platform::SoftwareRenderer::RepaintBufferType::SwappedBuffers"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer::buffer_type"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::operator="], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 2, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line"], [20, 6, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::Callback"], [20, 3, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::process_line_callback"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation::rotation"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendererD0Ev", "slint::platform::SoftwareRenderer::~SoftwareRenderer"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapterE", "slint::platform::WindowAdapter"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv", "slint::platform::WindowAdapter::WindowAdapter"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [171, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8positionEv", "slint::platform::WindowAdapter::position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8rendererEv", "slint::platform::WindowAdapter::renderer"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv", "slint::platform::WindowAdapter::request_redraw"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE", "slint::platform::WindowAdapter::set_position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE", "slint::platform::WindowAdapter::set_size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb", "slint::platform::WindowAdapter::set_visible"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter4sizeEv", "slint::platform::WindowAdapter::size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties", "slint::platform::WindowAdapter::update_window_properties"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapterD0Ev", "slint::platform::WindowAdapter::~WindowAdapter"], [93, 2, 1, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv", "slint::platform::duration_until_next_timer_update"], [95, 2, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform"], [95, 3, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform::platform"], [94, 2, 1, "_CPPv4N5slint8platform28update_timers_and_animationsEv", "slint::platform::update_timers_and_animations"], [97, 2, 1, "_CPPv4N5slint15quit_event_loopEv", "slint::quit_event_loop"], [100, 2, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop"], [100, 3, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop::mode"], [48, 4, 1, "_CPPv4N5slint7testing14AccessibleRoleE", "slint::testing::AccessibleRole"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6ButtonE", "slint::testing::AccessibleRole::Button"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE", "slint::testing::AccessibleRole::Checkbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE", "slint::testing::AccessibleRole::Combobox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4ListE", "slint::testing::AccessibleRole::List"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4NoneE", "slint::testing::AccessibleRole::None"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE", "slint::testing::AccessibleRole::ProgressIndicator"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SliderE", "slint::testing::AccessibleRole::Slider"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE", "slint::testing::AccessibleRole::Spinbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SwitchE", "slint::testing::AccessibleRole::Switch"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole3TabE", "slint::testing::AccessibleRole::Tab"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7TabListE", "slint::testing::AccessibleRole::TabList"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole5TableE", "slint::testing::AccessibleRole::Table"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TextE", "slint::testing::AccessibleRole::Text"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole9TextInputE", "slint::testing::AccessibleRole::TextInput"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TreeE", "slint::testing::AccessibleRole::Tree"], [22, 1, 1, "_CPPv4N5slint7testing13ElementHandleE", "slint::testing::ElementHandle"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv", "slint::testing::ElementHandle::absolute_position"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv", "slint::testing::ElementHandle::accessible_checkable"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv", "slint::testing::ElementHandle::accessible_checked"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv", "slint::testing::ElementHandle::accessible_description"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv", "slint::testing::ElementHandle::accessible_label"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv", "slint::testing::ElementHandle::accessible_placeholder_text"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv", "slint::testing::ElementHandle::accessible_role"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv", "slint::testing::ElementHandle::accessible_value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv", "slint::testing::ElementHandle::accessible_value_maximum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv", "slint::testing::ElementHandle::accessible_value_minimum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv", "slint::testing::ElementHandle::accessible_value_step"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle5basesEv", "slint::testing::ElementHandle::bases"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::label"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::element_id"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::type_name"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle2idEv", "slint::testing::ElementHandle::id"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv", "slint::testing::ElementHandle::invoke_accessible_decrement_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv", "slint::testing::ElementHandle::invoke_accessible_default_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv", "slint::testing::ElementHandle::invoke_accessible_increment_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle8is_validEv", "slint::testing::ElementHandle::is_valid"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value"], [22, 3, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value::value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle4sizeEv", "slint::testing::ElementHandle::size"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv", "slint::testing::ElementHandle::type_name"], [22, 2, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::R"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::T"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::Visitor"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::component"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::visitor"], [96, 2, 1, "_CPPv4N5slint7testing4initEv", "slint::testing::init"], [101, 2, 1, "_CPPv4N5slint23update_all_translationsEv", "slint::update_all_translations"]]}, "objtypes": {"0": "c:macro", "1": "cpp:class", "2": "cpp:function", "3": "cpp:functionParam", "4": "cpp:enum", "5": "cpp:enumerator", "6": "cpp:templateParam", "7": "cpp:member", "8": "cpp:type"}, "objnames": {"0": ["c", "macro", "C macro"], "1": ["cpp", "class", "C++ class"], "2": ["cpp", "function", "C++ function"], "3": ["cpp", "functionParam", "C++ function parameter"], "4": ["cpp", "enum", "C++ enum"], "5": ["cpp", "enumerator", "C++ enumerator"], "6": ["cpp", "templateParam", "C++ template parameter"], "7": ["cpp", "member", "C++ member"], "8": ["cpp", "type", "C++ type"]}, "titleterms": {"class": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 55, 56, 57, 58, 59, 61, 63, 66, 68, 69, 70, 72, 73, 75, 80, 83, 102, 103, 104, 105, 107], "brush": 0, "document": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 232], "color": 1, "templat": [2, 3, 4, 5, 6, 7, 8, 9, 98, 99, 153, 156, 157, 159, 160, 231], "componenthandl": 2, "componentweakhandl": 3, "filtermodel": 4, "inherit": [4, 5, 6, 7, 8, 9, 13, 15, 19, 20, 149, 150, 151, 152], "relationship": [4, 5, 6, 7, 8, 9, 13, 15, 17, 18, 19, 20, 21, 149, 150, 151, 152, 165, 166, 168, 169, 170, 171], "base": [4, 5, 7, 8, 9, 13, 19, 20, 149, 150, 151, 152], "type": [4, 5, 6, 7, 8, 9, 13, 15, 17, 19, 20, 21, 149, 150, 151, 152, 165, 168, 170, 234], "mapmodel": 5, "model": 6, "deriv": [6, 15], "reversemodel": 7, "sortmodel": 8, "vectormodel": 9, "window": 10, "componentcompil": 11, "componentdefinit": 12, "componentinst": 13, "valu": 14, "abstractrender": 15, "nativewindowhandl": 16, "platform": [17, 18, 56, 93, 94, 95, 105, 106, 110, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227], "nest": [17, 18, 20, 21, 165, 166, 168, 169, 170, 171], "task": 18, "skiarender": 19, "softwarerender": [20, 168], "windowadapt": [21, 170], "exampl": [21, 229], "elementhandl": 22, "defin": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 71, 80, 102], "slint_feature_backend_qt": 23, "slint_feature_gettext": 24, "slint_feature_interpret": 25, "slint_version_patch": 26, "slint_feature_backend_linuxkm": 27, "slint_feature_experiment": 28, "slint_version_str": 29, "slint_feature_renderer_femtovg": 30, "slint_feature_renderer_skia": 31, "slint_feature_system_test": 32, "slint_feature_access": 33, "slint_feature_renderer_softwar": 34, "slint_version_minor": 35, "slint_feature_freestand": 36, "slint_feature_test": 37, "slint_version_major": 38, "slint_feature_backend_winit": 39, "assert_eq": 40, "directori": [41, 42, 43, 44, 45, 172], "api": [41, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 102, 172], "subdirectori": [41, 42, 44], "cpp": [42, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "includ": [43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "file": [43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [44, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "generated_includ": [45, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "enum": [46, 47, 48, 49, 50, 51, 52, 53, 54, 58, 78, 80, 83, 102, 103, 104, 107, 234], "valuetyp": 46, "diagnosticlevel": 47, "accessiblerol": 48, "setrenderingnotifiererror": 49, "pointereventbutton": 50, "eventloopmod": 51, "graphicsapi": 52, "renderingst": 53, "closerequestrespons": 54, "slint": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 111, 112, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 232, 233], "interpret": [55, 104, 109, 233], "h": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "definit": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "home": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 214], "runner": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "work": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "By": [55, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92], "namespac": [55, 56, 57, 58, 59, 60, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 103, 104, 105, 106, 107], "function": [56, 57, 58, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 105, 107], "test": [57, 96, 107, 111], "slint_brush": [59, 113], "slint_callback": [60, 114], "slint_color": [61, 115], "slint_config": [62, 116], "slint_imag": [63, 117], "slint_interpret": [64, 118], "slint_pathdata": [65, 119], "slint_point": [66, 120], "slint_properti": [67, 121], "slint_sharedvector": [68, 122], "slint_siz": [69, 123], "slint_str": [70, 124], "slint_tests_help": [71, 125], "slint_tim": [72, 126], "slint_window": [73, 127], "slint_brush_intern": [74, 128], "slint_builtin_struct": [75, 129], "slint_builtin_structs_intern": [76, 130], "slint_color_intern": [77, 131], "slint_enum": [78, 132], "variabl": [78, 102, 106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_enums_intern": [79, 133], "slint_generated_publ": [80, 134], "slint_image_intern": [81, 135], "slint_intern": [82, 136], "slint_interpreter_generated_publ": [83, 137], "slint_interpreter_intern": [84, 138], "slint_pathdata_intern": [85, 139], "slint_platform_intern": [86, 140], "slint_properties_intern": [87, 141], "slint_qt_intern": [88, 142], "slint_sharedvector_intern": [89, 143], "slint_string_intern": [90, 144], "slint_testing_intern": [91, 145], "slint_timer_intern": [92, 146], "duration_until_next_timer_upd": 93, "update_timers_and_anim": 94, "set_platform": 95, "init": 96, "quit_event_loop": 97, "invoke_from_event_loop": 98, "blocking_invoke_from_event_loop": 99, "run_event_loop": 100, "update_all_transl": 101, "c": [102, 230, 232], "refer": [102, 228], "page": [102, 172], "hierarchi": 102, "full": [102, 172], "struct": [102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], "detail": [103, 104, 105, 106, 107], "descript": [103, 104, 105, 106, 107], "key_cod": [106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "deprec": 108, "list": [108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "program": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "hsvacolor": 147, "imag": 148, "logicalposit": 149, "logicals": 150, "physicalposit": 151, "physicals": 152, "point": 153, "rgb8pixel": 154, "rgba8pixel": 155, "rgbacolor": 156, "sharedpixelbuff": 157, "sharedstr": 158, "sharedvector": 159, "size": 160, "standardlistviewitem": 161, "timer": 162, "diagnost": 163, "propertydescriptor": 164, "iter": 166, "rgb565pixel": 167, "physicalregion": [168, 169], "rect": 169, "windowproperti": [170, 171], "layoutconstraint": 171, "f24": 173, "f1": 174, "capslock": 175, "space": 176, "menu": 177, "leftarrow": 178, "metar": 179, "paus": 180, "f4": 181, "f12": 182, "insert": 183, "downarrow": 184, "altgr": 185, "alt": 186, "f23": 187, "stop": 188, "f19": 189, "scrolllock": 190, "f13": 191, "f15": 192, "f14": 193, "backspac": 194, "f5": 195, "f6": 196, "meta": 197, "f9": 198, "f20": 199, "uparrow": 200, "f10": 201, "f2": 202, "f8": 203, "f18": 204, "pagedown": 205, "f11": 206, "f3": 207, "control": 208, "f16": 209, "controlr": 210, "return": 211, "f7": 212, "backtab": 213, "rightarrow": 215, "escap": 216, "sysreq": 217, "f21": 218, "f17": 219, "pageup": 220, "tab": 221, "end": 222, "shiftr": 223, "delet": 224, "shift": 225, "f22": 226, "set": 227, "up": 227, "develop": [227, 232], "environ": 227, "prerequisit": 227, "instal": 227, "binari": 227, "packag": 227, "build": 227, "from": 227, "sourc": 227, "featur": 227, "rust": 227, "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233], "microcontrol": [227, 228], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "gener": 229, "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": 232, "markup": 232, "languag": 232, "architectur": 232, "overview": 233, "design": 233, "run": 233, "time": 233, "map": 234, "structur": 234}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 58}, "alltitles": {"Class Brush": [[0, "class-brush"]], "Class Documentation": [[0, "class-documentation"], [1, "class-documentation"], [2, "class-documentation"], [3, "class-documentation"], [4, "class-documentation"], [5, "class-documentation"], [6, "class-documentation"], [7, "class-documentation"], [8, "class-documentation"], [9, "class-documentation"], [10, "class-documentation"], [11, "class-documentation"], [12, "class-documentation"], [13, "class-documentation"], [14, "class-documentation"], [15, "class-documentation"], [16, "class-documentation"], [17, "class-documentation"], [18, "class-documentation"], [19, "class-documentation"], [20, "class-documentation"], [21, "class-documentation"], [22, "class-documentation"]], "Class Color": [[1, "class-color"]], "Template Class ComponentHandle": [[2, "template-class-componenthandle"]], "Template Class ComponentWeakHandle": [[3, "template-class-componentweakhandle"]], "Template Class FilterModel": [[4, "template-class-filtermodel"]], "Inheritance Relationships": [[4, "inheritance-relationships"], [5, "inheritance-relationships"], [6, "inheritance-relationships"], [7, "inheritance-relationships"], [8, "inheritance-relationships"], [9, "inheritance-relationships"], [13, "inheritance-relationships"], [15, "inheritance-relationships"], [19, "inheritance-relationships"], [20, "inheritance-relationships"], [149, "inheritance-relationships"], [150, "inheritance-relationships"], [151, "inheritance-relationships"], [152, "inheritance-relationships"]], "Base Type": [[4, "base-type"], [5, "base-type"], [7, "base-type"], [8, "base-type"], [9, "base-type"], [13, "base-type"], [19, "base-type"], [20, "base-type"], [149, "base-type"], [150, "base-type"], [151, "base-type"], [152, "base-type"]], "Template Class MapModel": [[5, "template-class-mapmodel"]], "Template Class Model": [[6, "template-class-model"]], "Derived Types": [[6, "derived-types"], [15, "derived-types"]], "Template Class ReverseModel": [[7, "template-class-reversemodel"]], "Template Class SortModel": [[8, "template-class-sortmodel"]], "Template Class VectorModel": [[9, "template-class-vectormodel"]], "Class Window": [[10, "class-window"]], "Class ComponentCompiler": [[11, "class-componentcompiler"]], "Class ComponentDefinition": [[12, "class-componentdefinition"]], "Class ComponentInstance": [[13, "class-componentinstance"]], "Class Value": [[14, "class-value"]], "Class AbstractRenderer": [[15, "class-abstractrenderer"]], "Class NativeWindowHandle": [[16, "class-nativewindowhandle"]], "Class Platform": [[17, "class-platform"]], "Nested Relationships": [[17, "nested-relationships"], [18, "nested-relationships"], [20, "nested-relationships"], [21, "nested-relationships"], [165, "nested-relationships"], [166, "nested-relationships"], [168, "nested-relationships"], [169, "nested-relationships"], [170, "nested-relationships"], [171, "nested-relationships"]], "Nested Types": [[17, "nested-types"], [20, "nested-types"], [21, "nested-types"], [165, "nested-types"], [168, "nested-types"], [170, "nested-types"]], "Class Platform::Task": [[18, "class-platform-task"]], "Class SkiaRenderer": [[19, "class-skiarenderer"]], "Class SoftwareRenderer": [[20, "class-softwarerenderer"]], "Class WindowAdapter": [[21, "class-windowadapter"]], "Example": [[21, "classslint_1_1platform_1_1WindowAdapter_1autotoc_md0"], [229, "example"]], "Class ElementHandle": [[22, "class-elementhandle"]], "Define SLINT_FEATURE_BACKEND_QT": [[23, "define-slint-feature-backend-qt"]], "Define Documentation": [[23, "define-documentation"], [24, "define-documentation"], [25, "define-documentation"], [26, "define-documentation"], [27, "define-documentation"], [28, "define-documentation"], [29, "define-documentation"], [30, "define-documentation"], [31, "define-documentation"], [32, "define-documentation"], [33, "define-documentation"], [34, "define-documentation"], [35, "define-documentation"], [36, "define-documentation"], [37, "define-documentation"], [38, "define-documentation"], [39, "define-documentation"], [40, "define-documentation"]], "Define SLINT_FEATURE_GETTEXT": [[24, "define-slint-feature-gettext"]], "Define SLINT_FEATURE_INTERPRETER": [[25, "define-slint-feature-interpreter"]], "Define SLINT_VERSION_PATCH": [[26, "define-slint-version-patch"]], "Define SLINT_FEATURE_BACKEND_LINUXKMS": [[27, "define-slint-feature-backend-linuxkms"]], "Define SLINT_FEATURE_EXPERIMENTAL": [[28, "define-slint-feature-experimental"]], "Define SLINT_VERSION_STRING": [[29, "define-slint-version-string"]], "Define SLINT_FEATURE_RENDERER_FEMTOVG": [[30, "define-slint-feature-renderer-femtovg"]], "Define SLINT_FEATURE_RENDERER_SKIA": [[31, "define-slint-feature-renderer-skia"]], "Define SLINT_FEATURE_SYSTEM_TESTING": [[32, "define-slint-feature-system-testing"]], "Define SLINT_FEATURE_ACCESSIBILITY": [[33, "define-slint-feature-accessibility"]], "Define SLINT_FEATURE_RENDERER_SOFTWARE": [[34, "define-slint-feature-renderer-software"]], "Define SLINT_VERSION_MINOR": [[35, "define-slint-version-minor"]], "Define SLINT_FEATURE_FREESTANDING": [[36, "define-slint-feature-freestanding"]], "Define SLINT_FEATURE_TESTING": [[37, "define-slint-feature-testing"]], "Define SLINT_VERSION_MAJOR": [[38, "define-slint-version-major"]], "Define SLINT_FEATURE_BACKEND_WINIT": [[39, "define-slint-feature-backend-winit"]], "Define assert_eq": [[40, "define-assert-eq"]], "Directory api": [[41, "directory-api"]], "Subdirectories": [[41, "subdirectories"], [42, "subdirectories"], [44, "subdirectories"]], "Directory cpp": [[42, "directory-cpp"]], "Directory include": [[43, "directory-include"]], "Files": [[43, "files"], [45, "files"], [172, "files"]], "Directory cppdocs": [[44, "directory-cppdocs"]], "Directory generated_include": [[45, "directory-generated-include"]], "Enum ValueType": [[46, "enum-valuetype"]], "Enum Documentation": [[46, "enum-documentation"], [47, "enum-documentation"], [48, "enum-documentation"], [49, "enum-documentation"], [50, "enum-documentation"], [51, "enum-documentation"], [52, "enum-documentation"], [53, "enum-documentation"], [54, "enum-documentation"]], "Enum DiagnosticLevel": [[47, "enum-diagnosticlevel"]], "Enum AccessibleRole": [[48, "enum-accessiblerole"]], "Enum SetRenderingNotifierError": [[49, "enum-setrenderingnotifiererror"]], "Enum PointerEventButton": [[50, "enum-pointereventbutton"]], "Enum EventLoopMode": [[51, "enum-eventloopmode"]], "Enum GraphicsAPI": [[52, "enum-graphicsapi"]], "Enum RenderingState": [[53, "enum-renderingstate"]], "Enum CloseRequestResponse": [[54, "enum-closerequestresponse"]], "File slint-interpreter.h": [[55, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-interpreter.h)": [[55, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "Includes": [[55, "includes"], [56, "includes"], [57, "includes"], [58, "includes"], [59, "includes"], [60, "includes"], [61, "includes"], [62, "includes"], [63, "includes"], [64, "includes"], [65, "includes"], [66, "includes"], [67, "includes"], [68, "includes"], [69, "includes"], [70, "includes"], [71, "includes"], [72, "includes"], [73, "includes"], [74, "includes"], [76, "includes"], [77, "includes"], [79, "includes"], [80, "includes"], [81, "includes"], [82, "includes"], [83, "includes"], [84, "includes"], [85, "includes"], [86, "includes"], [87, "includes"], [88, "includes"], [89, "includes"], [90, "includes"], [91, "includes"], [92, "includes"]], "Included By": [[55, "included-by"], [57, "included-by"], [59, "included-by"], [60, "included-by"], [61, "included-by"], [62, "included-by"], [63, "included-by"], [65, "included-by"], [66, "included-by"], [67, "included-by"], [68, "included-by"], [69, "included-by"], [70, "included-by"], [72, "included-by"], [73, "included-by"], [74, "included-by"], [75, "included-by"], [76, "included-by"], [77, "included-by"], [78, "included-by"], [79, "included-by"], [80, "included-by"], [81, "included-by"], [82, "included-by"], [83, "included-by"], [85, "included-by"], [86, "included-by"], [87, "included-by"], [88, "included-by"], [89, "included-by"], [90, "included-by"], [91, "included-by"], [92, "included-by"]], "Namespaces": [[55, "namespaces"], [56, "namespaces"], [57, "namespaces"], [58, "namespaces"], [59, "namespaces"], [60, "namespaces"], [61, "namespaces"], [63, "namespaces"], [65, "namespaces"], [66, "namespaces"], [67, "namespaces"], [68, "namespaces"], [69, "namespaces"], [70, "namespaces"], [71, "namespaces"], [72, "namespaces"], [73, "namespaces"], [74, "namespaces"], [75, "namespaces"], [76, "namespaces"], [77, "namespaces"], [78, "namespaces"], [79, "namespaces"], [80, "namespaces"], [81, "namespaces"], [82, "namespaces"], [83, "namespaces"], [84, "namespaces"], [85, "namespaces"], [86, "namespaces"], [87, "namespaces"], [88, "namespaces"], [89, "namespaces"], [90, "namespaces"], [91, "namespaces"], [92, "namespaces"], [102, "namespaces"], [103, "namespaces"], [105, "namespaces"]], "Classes": [[55, "classes"], [56, "classes"], [57, "classes"], [58, "classes"], [59, "classes"], [61, "classes"], [63, "classes"], [66, "classes"], [68, "classes"], [69, "classes"], [70, "classes"], [72, "classes"], [73, "classes"], [75, "classes"], [80, "classes"], [83, "classes"], [103, "classes"], [104, "classes"], [105, "classes"], [107, "classes"]], "File slint-platform.h": [[56, "file-slint-platform-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-platform.h)": [[56, "definition-home-runner-work-slint-slint-api-cpp-include-slint-platform-h"]], "Functions": [[56, "functions"], [57, "functions"], [58, "functions"], [102, "functions"], [103, "functions"], [105, "functions"], [107, "functions"]], "File slint-testing.h": [[57, "file-slint-testing-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-testing.h)": [[57, "definition-home-runner-work-slint-slint-api-cpp-include-slint-testing-h"]], "File slint.h": [[58, "file-slint-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint.h)": [[58, "definition-home-runner-work-slint-slint-api-cpp-include-slint-h"]], "Enums": [[58, "enums"], [78, "enums"], [80, "enums"], [83, "enums"], [102, "enums"], [103, "enums"], [104, "enums"], [107, "enums"], [234, "enums"]], "File slint_brush.h": [[59, "file-slint-brush-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_brush.h)": [[59, "definition-home-runner-work-slint-slint-api-cpp-include-slint-brush-h"]], "File slint_callbacks.h": [[60, "file-slint-callbacks-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_callbacks.h)": [[60, "definition-home-runner-work-slint-slint-api-cpp-include-slint-callbacks-h"]], "File slint_color.h": [[61, "file-slint-color-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_color.h)": [[61, "definition-home-runner-work-slint-slint-api-cpp-include-slint-color-h"]], "File slint_config.h": [[62, "file-slint-config-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_config.h)": [[62, "definition-home-runner-work-slint-slint-api-cpp-include-slint-config-h"]], "File slint_image.h": [[63, "file-slint-image-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_image.h)": [[63, "definition-home-runner-work-slint-slint-api-cpp-include-slint-image-h"]], "File slint_interpreter.h": [[64, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_interpreter.h)": [[64, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "File slint_pathdata.h": [[65, "file-slint-pathdata-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_pathdata.h)": [[65, "definition-home-runner-work-slint-slint-api-cpp-include-slint-pathdata-h"]], "File slint_point.h": [[66, "file-slint-point-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_point.h)": [[66, "definition-home-runner-work-slint-slint-api-cpp-include-slint-point-h"]], "File slint_properties.h": [[67, "file-slint-properties-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_properties.h)": [[67, "definition-home-runner-work-slint-slint-api-cpp-include-slint-properties-h"]], "File slint_sharedvector.h": [[68, "file-slint-sharedvector-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_sharedvector.h)": [[68, "definition-home-runner-work-slint-slint-api-cpp-include-slint-sharedvector-h"]], "File slint_size.h": [[69, "file-slint-size-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_size.h)": [[69, "definition-home-runner-work-slint-slint-api-cpp-include-slint-size-h"]], "File slint_string.h": [[70, "file-slint-string-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_string.h)": [[70, "definition-home-runner-work-slint-slint-api-cpp-include-slint-string-h"]], "File slint_tests_helpers.h": [[71, "file-slint-tests-helpers-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_tests_helpers.h)": [[71, "definition-home-runner-work-slint-slint-api-cpp-include-slint-tests-helpers-h"]], "Defines": [[71, "defines"], [80, "defines"], [102, "defines"]], "File slint_timer.h": [[72, "file-slint-timer-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_timer.h)": [[72, "definition-home-runner-work-slint-slint-api-cpp-include-slint-timer-h"]], "File slint_window.h": [[73, "file-slint-window-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_window.h)": [[73, "definition-home-runner-work-slint-slint-api-cpp-include-slint-window-h"]], "File slint_brush_internal.h": [[74, "file-slint-brush-internal-h"]], "Definition (cppdocs/generated_include/slint_brush_internal.h)": [[74, "definition-cppdocs-generated-include-slint-brush-internal-h"]], "File slint_builtin_structs.h": [[75, "file-slint-builtin-structs-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs.h)": [[75, "definition-cppdocs-generated-include-slint-builtin-structs-h"]], "File slint_builtin_structs_internal.h": [[76, "file-slint-builtin-structs-internal-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs_internal.h)": [[76, "definition-cppdocs-generated-include-slint-builtin-structs-internal-h"]], "File slint_color_internal.h": [[77, "file-slint-color-internal-h"]], "Definition (cppdocs/generated_include/slint_color_internal.h)": [[77, "definition-cppdocs-generated-include-slint-color-internal-h"]], "File slint_enums.h": [[78, "file-slint-enums-h"]], "Definition (cppdocs/generated_include/slint_enums.h)": [[78, "definition-cppdocs-generated-include-slint-enums-h"]], "Variables": [[78, "variables"], [102, "variables"], [106, "variables"]], "File slint_enums_internal.h": [[79, "file-slint-enums-internal-h"]], "Definition (cppdocs/generated_include/slint_enums_internal.h)": [[79, "definition-cppdocs-generated-include-slint-enums-internal-h"]], "File slint_generated_public.h": [[80, "file-slint-generated-public-h"]], "Definition (cppdocs/generated_include/slint_generated_public.h)": [[80, "definition-cppdocs-generated-include-slint-generated-public-h"]], "File slint_image_internal.h": [[81, "file-slint-image-internal-h"]], "Definition (cppdocs/generated_include/slint_image_internal.h)": [[81, "definition-cppdocs-generated-include-slint-image-internal-h"]], "File slint_internal.h": [[82, "file-slint-internal-h"]], "Definition (cppdocs/generated_include/slint_internal.h)": [[82, "definition-cppdocs-generated-include-slint-internal-h"]], "File slint_interpreter_generated_public.h": [[83, "file-slint-interpreter-generated-public-h"]], "Definition (cppdocs/generated_include/slint_interpreter_generated_public.h)": [[83, "definition-cppdocs-generated-include-slint-interpreter-generated-public-h"]], "File slint_interpreter_internal.h": [[84, "file-slint-interpreter-internal-h"]], "Definition (cppdocs/generated_include/slint_interpreter_internal.h)": [[84, "definition-cppdocs-generated-include-slint-interpreter-internal-h"]], "File slint_pathdata_internal.h": [[85, "file-slint-pathdata-internal-h"]], "Definition (cppdocs/generated_include/slint_pathdata_internal.h)": [[85, "definition-cppdocs-generated-include-slint-pathdata-internal-h"]], "File slint_platform_internal.h": [[86, "file-slint-platform-internal-h"]], "Definition (cppdocs/generated_include/slint_platform_internal.h)": [[86, "definition-cppdocs-generated-include-slint-platform-internal-h"]], "File slint_properties_internal.h": [[87, "file-slint-properties-internal-h"]], "Definition (cppdocs/generated_include/slint_properties_internal.h)": [[87, "definition-cppdocs-generated-include-slint-properties-internal-h"]], "File slint_qt_internal.h": [[88, "file-slint-qt-internal-h"]], "Definition (cppdocs/generated_include/slint_qt_internal.h)": [[88, "definition-cppdocs-generated-include-slint-qt-internal-h"]], "File slint_sharedvector_internal.h": [[89, "file-slint-sharedvector-internal-h"]], "Definition (cppdocs/generated_include/slint_sharedvector_internal.h)": [[89, "definition-cppdocs-generated-include-slint-sharedvector-internal-h"]], "File slint_string_internal.h": [[90, "file-slint-string-internal-h"]], "Definition (cppdocs/generated_include/slint_string_internal.h)": [[90, "definition-cppdocs-generated-include-slint-string-internal-h"]], "File slint_testing_internal.h": [[91, "file-slint-testing-internal-h"]], "Definition (cppdocs/generated_include/slint_testing_internal.h)": [[91, "definition-cppdocs-generated-include-slint-testing-internal-h"]], "File slint_timer_internal.h": [[92, "file-slint-timer-internal-h"]], "Definition (cppdocs/generated_include/slint_timer_internal.h)": [[92, "definition-cppdocs-generated-include-slint-timer-internal-h"]], "Function slint::platform::duration_until_next_timer_update": [[93, "function-slint-platform-duration-until-next-timer-update"]], "Function Documentation": [[93, "function-documentation"], [94, "function-documentation"], [95, "function-documentation"], [96, "function-documentation"], [97, "function-documentation"], [98, "function-documentation"], [99, "function-documentation"], [100, "function-documentation"], [101, "function-documentation"]], "Function slint::platform::update_timers_and_animations": [[94, "function-slint-platform-update-timers-and-animations"]], "Function slint::platform::set_platform": [[95, "function-slint-platform-set-platform"]], "Function slint::testing::init": [[96, "function-slint-testing-init"]], "Function slint::quit_event_loop": [[97, "function-slint-quit-event-loop"]], "Template Function slint::invoke_from_event_loop": [[98, "template-function-slint-invoke-from-event-loop"]], "Template Function slint::blocking_invoke_from_event_loop": [[99, "template-function-slint-blocking-invoke-from-event-loop"]], "Function slint::run_event_loop": [[100, "function-slint-run-event-loop"]], "Function slint::update_all_translations": [[101, "function-slint-update-all-translations"]], "C++ API Reference": [[102, "c-api-reference"]], "Page Hierarchy": [[102, "page-hierarchy"]], "Class Hierarchy": [[102, "class-hierarchy"]], "File Hierarchy": [[102, "file-hierarchy"]], "Full API": [[102, "full-api"], [172, "full-api"]], "Classes and Structs": [[102, "classes-and-structs"]], "Namespace slint": [[103, "namespace-slint"]], "Detailed Description": [[103, "detailed-description"], [104, "detailed-description"], [105, "detailed-description"], [106, "detailed-description"], [107, "detailed-description"]], "Namespace slint::interpreter": [[104, "namespace-slint-interpreter"]], "Namespace slint::platform": [[105, "namespace-slint-platform"]], "Namespace slint::platform::key_codes": [[106, "namespace-slint-platform-key-codes"]], "Namespace slint::testing": [[107, "namespace-slint-testing"]], "Deprecated List": [[108, "deprecated-list"]], "Program Listing for File slint-interpreter.h": [[109, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint-platform.h": [[110, "program-listing-for-file-slint-platform-h"]], "Program Listing for File slint-testing.h": [[111, "program-listing-for-file-slint-testing-h"]], "Program Listing for File slint.h": [[112, "program-listing-for-file-slint-h"]], "Program Listing for File slint_brush.h": [[113, "program-listing-for-file-slint-brush-h"]], "Program Listing for File slint_callbacks.h": [[114, "program-listing-for-file-slint-callbacks-h"]], "Program Listing for File slint_color.h": [[115, "program-listing-for-file-slint-color-h"]], "Program Listing for File slint_config.h": [[116, "program-listing-for-file-slint-config-h"]], "Program Listing for File slint_image.h": [[117, "program-listing-for-file-slint-image-h"]], "Program Listing for File slint_interpreter.h": [[118, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint_pathdata.h": [[119, "program-listing-for-file-slint-pathdata-h"]], "Program Listing for File slint_point.h": [[120, "program-listing-for-file-slint-point-h"]], "Program Listing for File slint_properties.h": [[121, "program-listing-for-file-slint-properties-h"]], "Program Listing for File slint_sharedvector.h": [[122, "program-listing-for-file-slint-sharedvector-h"]], "Program Listing for File slint_size.h": [[123, "program-listing-for-file-slint-size-h"]], "Program Listing for File slint_string.h": [[124, "program-listing-for-file-slint-string-h"]], "Program Listing for File slint_tests_helpers.h": [[125, "program-listing-for-file-slint-tests-helpers-h"]], "Program Listing for File slint_timer.h": [[126, "program-listing-for-file-slint-timer-h"]], "Program Listing for File slint_window.h": [[127, "program-listing-for-file-slint-window-h"]], "Program Listing for File slint_brush_internal.h": [[128, "program-listing-for-file-slint-brush-internal-h"]], "Program Listing for File slint_builtin_structs.h": [[129, "program-listing-for-file-slint-builtin-structs-h"]], "Program Listing for File slint_builtin_structs_internal.h": [[130, "program-listing-for-file-slint-builtin-structs-internal-h"]], "Program Listing for File slint_color_internal.h": [[131, "program-listing-for-file-slint-color-internal-h"]], "Program Listing for File slint_enums.h": [[132, "program-listing-for-file-slint-enums-h"]], "Program Listing for File slint_enums_internal.h": [[133, "program-listing-for-file-slint-enums-internal-h"]], "Program Listing for File slint_generated_public.h": [[134, "program-listing-for-file-slint-generated-public-h"]], "Program Listing for File slint_image_internal.h": [[135, "program-listing-for-file-slint-image-internal-h"]], "Program Listing for File slint_internal.h": [[136, "program-listing-for-file-slint-internal-h"]], "Program Listing for File slint_interpreter_generated_public.h": [[137, "program-listing-for-file-slint-interpreter-generated-public-h"]], "Program Listing for File slint_interpreter_internal.h": [[138, "program-listing-for-file-slint-interpreter-internal-h"]], "Program Listing for File slint_pathdata_internal.h": [[139, "program-listing-for-file-slint-pathdata-internal-h"]], "Program Listing for File slint_platform_internal.h": [[140, "program-listing-for-file-slint-platform-internal-h"]], "Program Listing for File slint_properties_internal.h": [[141, "program-listing-for-file-slint-properties-internal-h"]], "Program Listing for File slint_qt_internal.h": [[142, "program-listing-for-file-slint-qt-internal-h"]], "Program Listing for File slint_sharedvector_internal.h": [[143, "program-listing-for-file-slint-sharedvector-internal-h"]], "Program Listing for File slint_string_internal.h": [[144, "program-listing-for-file-slint-string-internal-h"]], "Program Listing for File slint_testing_internal.h": [[145, "program-listing-for-file-slint-testing-internal-h"]], "Program Listing for File slint_timer_internal.h": [[146, "program-listing-for-file-slint-timer-internal-h"]], "Struct HsvaColor": [[147, "struct-hsvacolor"]], "Struct Documentation": [[147, "struct-documentation"], [148, "struct-documentation"], [149, "struct-documentation"], [150, "struct-documentation"], [151, "struct-documentation"], [152, "struct-documentation"], [153, "struct-documentation"], [154, "struct-documentation"], [155, "struct-documentation"], [156, "struct-documentation"], [157, "struct-documentation"], [158, "struct-documentation"], [159, "struct-documentation"], [160, "struct-documentation"], [161, "struct-documentation"], [162, "struct-documentation"], [163, "struct-documentation"], [164, "struct-documentation"], [165, "struct-documentation"], [166, "struct-documentation"], [167, "struct-documentation"], [168, "struct-documentation"], [169, "struct-documentation"], [170, "struct-documentation"], [171, "struct-documentation"]], "Struct Image": [[148, "struct-image"]], "Struct LogicalPosition": [[149, "struct-logicalposition"]], "Struct LogicalSize": [[150, "struct-logicalsize"]], "Struct PhysicalPosition": [[151, "struct-physicalposition"]], "Struct PhysicalSize": [[152, "struct-physicalsize"]], "Template Struct Point": [[153, "template-struct-point"]], "Struct Rgb8Pixel": [[154, "struct-rgb8pixel"]], "Struct Rgba8Pixel": [[155, "struct-rgba8pixel"]], "Template Struct RgbaColor": [[156, "template-struct-rgbacolor"]], "Template Struct SharedPixelBuffer": [[157, "template-struct-sharedpixelbuffer"]], "Struct SharedString": [[158, "struct-sharedstring"]], "Template Struct SharedVector": [[159, "template-struct-sharedvector"]], "Template Struct Size": [[160, "template-struct-size"]], "Struct StandardListViewItem": [[161, "struct-standardlistviewitem"]], "Struct Timer": [[162, "struct-timer"]], "Struct Diagnostic": [[163, "struct-diagnostic"]], "Struct PropertyDescriptor": [[164, "struct-propertydescriptor"]], "Struct Struct": [[165, "struct-struct"]], "Struct Struct::iterator": [[166, "struct-struct-iterator"]], "Struct Rgb565Pixel": [[167, "struct-rgb565pixel"]], "Struct SoftwareRenderer::PhysicalRegion": [[168, "struct-softwarerenderer-physicalregion"]], "Struct PhysicalRegion::Rect": [[169, "struct-physicalregion-rect"]], "Struct WindowAdapter::WindowProperties": [[170, "struct-windowadapter-windowproperties"]], "Struct WindowProperties::LayoutConstraints": [[171, "struct-windowproperties-layoutconstraints"]], "Directories": [[172, "directories"]], "Pages": [[172, "pages"]], "Variable slint::platform::key_codes::F24": [[173, "variable-slint-platform-key-codes-f24"]], "Variable Documentation": [[173, "variable-documentation"], [174, "variable-documentation"], [175, "variable-documentation"], [176, "variable-documentation"], [177, "variable-documentation"], [178, "variable-documentation"], [179, "variable-documentation"], [180, "variable-documentation"], [181, "variable-documentation"], [182, "variable-documentation"], [183, "variable-documentation"], [184, "variable-documentation"], [185, "variable-documentation"], [186, "variable-documentation"], [187, "variable-documentation"], [188, "variable-documentation"], [189, "variable-documentation"], [190, "variable-documentation"], [191, "variable-documentation"], [192, "variable-documentation"], [193, "variable-documentation"], [194, "variable-documentation"], [195, "variable-documentation"], [196, "variable-documentation"], [197, "variable-documentation"], [198, "variable-documentation"], [199, "variable-documentation"], [200, "variable-documentation"], [201, "variable-documentation"], [202, "variable-documentation"], [203, "variable-documentation"], [204, "variable-documentation"], [205, "variable-documentation"], [206, "variable-documentation"], [207, "variable-documentation"], [208, "variable-documentation"], [209, "variable-documentation"], [210, "variable-documentation"], [211, "variable-documentation"], [212, "variable-documentation"], [213, "variable-documentation"], [214, "variable-documentation"], [215, "variable-documentation"], [216, "variable-documentation"], [217, "variable-documentation"], [218, "variable-documentation"], [219, "variable-documentation"], [220, "variable-documentation"], [221, "variable-documentation"], [222, "variable-documentation"], [223, "variable-documentation"], [224, "variable-documentation"], [225, "variable-documentation"], [226, "variable-documentation"]], "Variable slint::platform::key_codes::F1": [[174, "variable-slint-platform-key-codes-f1"]], "Variable slint::platform::key_codes::CapsLock": [[175, "variable-slint-platform-key-codes-capslock"]], "Variable slint::platform::key_codes::Space": [[176, "variable-slint-platform-key-codes-space"]], "Variable slint::platform::key_codes::Menu": [[177, "variable-slint-platform-key-codes-menu"]], "Variable slint::platform::key_codes::LeftArrow": [[178, "variable-slint-platform-key-codes-leftarrow"]], "Variable slint::platform::key_codes::MetaR": [[179, "variable-slint-platform-key-codes-metar"]], "Variable slint::platform::key_codes::Pause": [[180, "variable-slint-platform-key-codes-pause"]], "Variable slint::platform::key_codes::F4": [[181, "variable-slint-platform-key-codes-f4"]], "Variable slint::platform::key_codes::F12": [[182, "variable-slint-platform-key-codes-f12"]], "Variable slint::platform::key_codes::Insert": [[183, "variable-slint-platform-key-codes-insert"]], "Variable slint::platform::key_codes::DownArrow": [[184, "variable-slint-platform-key-codes-downarrow"]], "Variable slint::platform::key_codes::AltGr": [[185, "variable-slint-platform-key-codes-altgr"]], "Variable slint::platform::key_codes::Alt": [[186, "variable-slint-platform-key-codes-alt"]], "Variable slint::platform::key_codes::F23": [[187, "variable-slint-platform-key-codes-f23"]], "Variable slint::platform::key_codes::Stop": [[188, "variable-slint-platform-key-codes-stop"]], "Variable slint::platform::key_codes::F19": [[189, "variable-slint-platform-key-codes-f19"]], "Variable slint::platform::key_codes::ScrollLock": [[190, "variable-slint-platform-key-codes-scrolllock"]], "Variable slint::platform::key_codes::F13": [[191, "variable-slint-platform-key-codes-f13"]], "Variable slint::platform::key_codes::F15": [[192, "variable-slint-platform-key-codes-f15"]], "Variable slint::platform::key_codes::F14": [[193, "variable-slint-platform-key-codes-f14"]], "Variable slint::platform::key_codes::Backspace": [[194, "variable-slint-platform-key-codes-backspace"]], "Variable slint::platform::key_codes::F5": [[195, "variable-slint-platform-key-codes-f5"]], "Variable slint::platform::key_codes::F6": [[196, "variable-slint-platform-key-codes-f6"]], "Variable slint::platform::key_codes::Meta": [[197, "variable-slint-platform-key-codes-meta"]], "Variable slint::platform::key_codes::F9": [[198, "variable-slint-platform-key-codes-f9"]], "Variable slint::platform::key_codes::F20": [[199, "variable-slint-platform-key-codes-f20"]], "Variable slint::platform::key_codes::UpArrow": [[200, "variable-slint-platform-key-codes-uparrow"]], "Variable slint::platform::key_codes::F10": [[201, "variable-slint-platform-key-codes-f10"]], "Variable slint::platform::key_codes::F2": [[202, "variable-slint-platform-key-codes-f2"]], "Variable slint::platform::key_codes::F8": [[203, "variable-slint-platform-key-codes-f8"]], "Variable slint::platform::key_codes::F18": [[204, "variable-slint-platform-key-codes-f18"]], "Variable slint::platform::key_codes::PageDown": [[205, "variable-slint-platform-key-codes-pagedown"]], "Variable slint::platform::key_codes::F11": [[206, "variable-slint-platform-key-codes-f11"]], "Variable slint::platform::key_codes::F3": [[207, "variable-slint-platform-key-codes-f3"]], "Variable slint::platform::key_codes::Control": [[208, "variable-slint-platform-key-codes-control"]], "Variable slint::platform::key_codes::F16": [[209, "variable-slint-platform-key-codes-f16"]], "Variable slint::platform::key_codes::ControlR": [[210, "variable-slint-platform-key-codes-controlr"]], "Variable slint::platform::key_codes::Return": [[211, "variable-slint-platform-key-codes-return"]], "Variable slint::platform::key_codes::F7": [[212, "variable-slint-platform-key-codes-f7"]], "Variable slint::platform::key_codes::Backtab": [[213, "variable-slint-platform-key-codes-backtab"]], "Variable slint::platform::key_codes::Home": [[214, "variable-slint-platform-key-codes-home"]], "Variable slint::platform::key_codes::RightArrow": [[215, "variable-slint-platform-key-codes-rightarrow"]], "Variable slint::platform::key_codes::Escape": [[216, "variable-slint-platform-key-codes-escape"]], "Variable slint::platform::key_codes::SysReq": [[217, "variable-slint-platform-key-codes-sysreq"]], "Variable slint::platform::key_codes::F21": [[218, "variable-slint-platform-key-codes-f21"]], "Variable slint::platform::key_codes::F17": [[219, "variable-slint-platform-key-codes-f17"]], "Variable slint::platform::key_codes::PageUp": [[220, "variable-slint-platform-key-codes-pageup"]], "Variable slint::platform::key_codes::Tab": [[221, "variable-slint-platform-key-codes-tab"]], "Variable slint::platform::key_codes::End": [[222, "variable-slint-platform-key-codes-end"]], "Variable slint::platform::key_codes::ShiftR": [[223, "variable-slint-platform-key-codes-shiftr"]], "Variable slint::platform::key_codes::Delete": [[224, "variable-slint-platform-key-codes-delete"]], "Variable slint::platform::key_codes::Shift": [[225, "variable-slint-platform-key-codes-shift"]], "Variable slint::platform::key_codes::F22": [[226, "variable-slint-platform-key-codes-f22"]], "Set Up Development Environment": [[227, "set-up-development-environment"]], "Prerequisites": [[227, "prerequisites"]], "Install Slint": [[227, "install-slint"]], "Install Binary Packages": [[227, "install-binary-packages"]], "Build From Sources": [[227, "build-from-sources"]], "Features": [[227, "features"]], "Rust Flags": [[227, "rust-flags"]], "Platform Backends": [[227, "platform-backends"]], "Cross-compiling": [[227, "cross-compiling"]], "Microcontrollers": [[227, "microcontrollers"]], "CMake Reference": [[228, "cmake-reference"]], "slint_target_sources": [[228, "slint-target-sources"]], "Resource Embedding": [[228, "resource-embedding"]], "Scale Factor for Microcontrollers": [[228, "scale-factor-for-microcontrollers"]], "Generated Code": [[229, "generated-code"]], "Global Singletons": [[229, "global-singletons"]], "Index (C++)": [[230, "index-c"]], "Getting Started": [[231, "getting-started"]], "Tutorial": [[231, "tutorial"]], "Template": [[231, "template"]], "Slint C++ documentation": [[232, "slint-c-documentation"]], "The .slint Markup Language": [[232, "the-slint-markup-language"]], "Architecture": [[232, "architecture"]], "Developing": [[232, "developing"]], "Overview": [[233, "overview"]], "Compiled .slint Designs": [[233, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[233, "run-time-interpreted-slint-designs"]], "Type Mappings": [[234, "type-mappings"]], "Structures": [[234, "structures"]]}, "indexentries": {"brush (c++ class)": [[0, "_CPPv4N5slint5BrushE"]], "brush::brush (c++ function)": [[0, "_CPPv4N5slint5Brush5BrushERK5Color"], [0, "_CPPv4N5slint5Brush5BrushEv"]], "brush::brighter (c++ function)": [[0, "_CPPv4NK5slint5Brush8brighterEf"]], "brush::color (c++ function)": [[0, "_CPPv4NK5slint5Brush5colorEv"]], "brush::darker (c++ function)": [[0, "_CPPv4NK5slint5Brush6darkerEf"]], "brush::operator!= (c++ function)": [[0, "_CPPv4N5slint5BrushneERK5BrushRK5Brush"]], "brush::operator== (c++ function)": [[0, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush"]], "brush::transparentize (c++ function)": [[0, "_CPPv4NK5slint5Brush14transparentizeEf"]], "brush::with_alpha (c++ function)": [[0, "_CPPv4NK5slint5Brush10with_alphaEf"]], "color (c++ class)": [[1, "_CPPv4N5slint5ColorE"]], "color::color (c++ function)": [[1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE"], [1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE"], [1, "_CPPv4N5slint5Color5ColorEv"]], "color::alpha (c++ function)": [[1, "_CPPv4NK5slint5Color5alphaEv"]], "color::as_argb_encoded (c++ function)": [[1, "_CPPv4NK5slint5Color15as_argb_encodedEv"]], "color::blue (c++ function)": [[1, "_CPPv4NK5slint5Color4blueEv"]], "color::brighter (c++ function)": [[1, "_CPPv4NK5slint5Color8brighterEf"]], "color::darker (c++ function)": [[1, "_CPPv4NK5slint5Color6darkerEf"]], "color::from_argb_encoded (c++ function)": [[1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t"]], "color::from_argb_float (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_floatEffff"]], "color::from_argb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t"]], "color::from_hsva (c++ function)": [[1, "_CPPv4N5slint5Color9from_hsvaEffff"]], "color::from_rgb_float (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_floatEfff"]], "color::from_rgb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t"]], "color::green (c++ function)": [[1, "_CPPv4NK5slint5Color5greenEv"]], "color::mix (c++ function)": [[1, "_CPPv4NK5slint5Color3mixERK5Colorf"]], "color::operator<< (c++ function)": [[1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color"]], "color::operator== (c++ function)": [[1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color"]], "color::red (c++ function)": [[1, "_CPPv4NK5slint5Color3redEv"]], "color::to_argb_float (c++ function)": [[1, "_CPPv4NK5slint5Color13to_argb_floatEv"]], "color::to_argb_uint (c++ function)": [[1, "_CPPv4NK5slint5Color12to_argb_uintEv"]], "color::to_hsva (c++ function)": [[1, "_CPPv4NK5slint5Color7to_hsvaEv"]], "color::transparentize (c++ function)": [[1, "_CPPv4NK5slint5Color14transparentizeEf"]], "color::with_alpha (c++ function)": [[1, "_CPPv4NK5slint5Color10with_alphaEf"]], "componenthandle (c++ class)": [[2, "_CPPv4I0EN5slint15ComponentHandleE"]], "componenthandle::componenthandle (c++ function)": [[2, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE"]], "componenthandle::into_dyn (c++ function)": [[2, "_CPPv4NK5slint15ComponentHandle8into_dynEv"]], "componenthandle::operator* (c++ function)": [[2, "_CPPv4N5slint15ComponentHandlemlEv"], [2, "_CPPv4NK5slint15ComponentHandlemlEv"]], "componenthandle::operator-> (c++ function)": [[2, "_CPPv4N5slint15ComponentHandleptEv"], [2, "_CPPv4NK5slint15ComponentHandleptEv"]], "componentweakhandle (c++ class)": [[3, "_CPPv4I0EN5slint19ComponentWeakHandleE"]], "componentweakhandle::componentweakhandle (c++ function)": [[3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE"], [3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv"]], "componentweakhandle::lock (c++ function)": [[3, "_CPPv4NK5slint19ComponentWeakHandle4lockEv"]], "filtermodel (c++ class)": [[4, "_CPPv4I0EN5slint11FilterModelE"]], "filtermodel::filtermodel (c++ function)": [[4, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE"]], "filtermodel::reset (c++ function)": [[4, "_CPPv4N5slint11FilterModel5resetEv"]], "filtermodel::row_count (c++ function)": [[4, "_CPPv4NK5slint11FilterModel9row_countEv"]], "filtermodel::row_data (c++ function)": [[4, "_CPPv4NK5slint11FilterModel8row_dataE6size_t"]], "filtermodel::set_row_data (c++ function)": [[4, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData"]], "filtermodel::source_model (c++ function)": [[4, "_CPPv4NK5slint11FilterModel12source_modelEv"]], "filtermodel::unfiltered_row (c++ function)": [[4, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi"]], "mapmodel (c++ class)": [[5, "_CPPv4I00EN5slint8MapModelE"]], "mapmodel::mapmodel (c++ function)": [[5, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE"]], "mapmodel::reset (c++ function)": [[5, "_CPPv4N5slint8MapModel5resetEv"]], "mapmodel::row_count (c++ function)": [[5, "_CPPv4NK5slint8MapModel9row_countEv"]], "mapmodel::row_data (c++ function)": [[5, "_CPPv4NK5slint8MapModel8row_dataE6size_t"]], "mapmodel::source_model (c++ function)": [[5, "_CPPv4NK5slint8MapModel12source_modelEv"]], "model (c++ class)": [[6, "_CPPv4I0EN5slint5ModelE"]], "model::model (c++ function)": [[6, "_CPPv4N5slint5Model5ModelERK5Model"], [6, "_CPPv4N5slint5Model5ModelEv"]], "model::operator= (c++ function)": [[6, "_CPPv4N5slint5ModelaSERK5Model"]], "model::reset (c++ function)": [[6, "_CPPv4N5slint5Model5resetEv"]], "model::row_added (c++ function)": [[6, "_CPPv4N5slint5Model9row_addedE6size_t6size_t"]], "model::row_changed (c++ function)": [[6, "_CPPv4N5slint5Model11row_changedE6size_t"]], "model::row_count (c++ function)": [[6, "_CPPv4NK5slint5Model9row_countEv"]], "model::row_data (c++ function)": [[6, "_CPPv4NK5slint5Model8row_dataE6size_t"]], "model::row_removed (c++ function)": [[6, "_CPPv4N5slint5Model11row_removedE6size_t6size_t"]], "model::set_row_data (c++ function)": [[6, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData"]], "model::~model (c++ function)": [[6, "_CPPv4N5slint5ModelD0Ev"]], "reversemodel (c++ class)": [[7, "_CPPv4I0EN5slint12ReverseModelE"]], "reversemodel::reversemodel (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE"]], "reversemodel::row_count (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel9row_countEv"]], "reversemodel::row_data (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t"]], "reversemodel::set_row_data (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData"]], "reversemodel::source_model (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel12source_modelEv"]], "sortmodel (c++ class)": [[8, "_CPPv4I0EN5slint9SortModelE"]], "sortmodel::sortmodel (c++ function)": [[8, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE"]], "sortmodel::reset (c++ function)": [[8, "_CPPv4N5slint9SortModel5resetEv"]], "sortmodel::row_count (c++ function)": [[8, "_CPPv4NK5slint9SortModel9row_countEv"]], "sortmodel::row_data (c++ function)": [[8, "_CPPv4NK5slint9SortModel8row_dataE6size_t"]], "sortmodel::set_row_data (c++ function)": [[8, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData"]], "sortmodel::source_model (c++ function)": [[8, "_CPPv4NK5slint9SortModel12source_modelEv"]], "sortmodel::unsorted_row (c++ function)": [[8, "_CPPv4NK5slint9SortModel12unsorted_rowEi"]], "vectormodel (c++ class)": [[9, "_CPPv4I0EN5slint11VectorModelE"]], "vectormodel::vectormodel (c++ function)": [[9, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE"], [9, "_CPPv4N5slint11VectorModel11VectorModelEv"]], "vectormodel::clear (c++ function)": [[9, "_CPPv4N5slint11VectorModel5clearEv"]], "vectormodel::erase (c++ function)": [[9, "_CPPv4N5slint11VectorModel5eraseE6size_t"]], "vectormodel::insert (c++ function)": [[9, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData"]], "vectormodel::push_back (c++ function)": [[9, "_CPPv4N5slint11VectorModel9push_backERK9ModelData"]], "vectormodel::row_count (c++ function)": [[9, "_CPPv4NK5slint11VectorModel9row_countEv"]], "vectormodel::row_data (c++ function)": [[9, "_CPPv4NK5slint11VectorModel8row_dataE6size_t"]], "vectormodel::set_row_data (c++ function)": [[9, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData"]], "vectormodel::set_vector (c++ function)": [[9, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE"]], "window (c++ class)": [[10, "_CPPv4N5slint6WindowE"]], "window::window (c++ function)": [[10, "_CPPv4N5slint6Window6WindowERK6Window"], [10, "_CPPv4N5slint6Window6WindowERR6Window"]], "window::dispatch_close_requested_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv"]], "window::dispatch_key_press_event (c++ function)": [[10, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString"]], "window::dispatch_key_press_repeat_event (c++ function)": [[10, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString"]], "window::dispatch_key_release_event (c++ function)": [[10, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString"]], "window::dispatch_pointer_exit_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv"]], "window::dispatch_pointer_move_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition"]], "window::dispatch_pointer_press_event (c++ function)": [[10, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_release_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_scroll_event (c++ function)": [[10, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff"]], "window::dispatch_resize_event (c++ function)": [[10, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE"]], "window::dispatch_scale_factor_change_event (c++ function)": [[10, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf"]], "window::dispatch_window_active_changed_event (c++ function)": [[10, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb"]], "window::has_active_animations (c++ function)": [[10, "_CPPv4NK5slint6Window21has_active_animationsEv"]], "window::hide (c++ function)": [[10, "_CPPv4N5slint6Window4hideEv"]], "window::is_fullscreen (c++ function)": [[10, "_CPPv4NK5slint6Window13is_fullscreenEv"]], "window::is_maximized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_maximizedEv"]], "window::is_minimized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_minimizedEv"]], "window::is_visible (c++ function)": [[10, "_CPPv4NK5slint6Window10is_visibleEv"]], "window::on_close_requested (c++ function)": [[10, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F"]], "window::operator= (c++ function)": [[10, "_CPPv4N5slint6WindowaSERK6Window"], [10, "_CPPv4N5slint6WindowaSERR6Window"]], "window::position (c++ function)": [[10, "_CPPv4NK5slint6Window8positionEv"]], "window::request_redraw (c++ function)": [[10, "_CPPv4NK5slint6Window14request_redrawEv"]], "window::scale_factor (c++ function)": [[10, "_CPPv4NK5slint6Window12scale_factorEv"]], "window::set_fullscreen (c++ function)": [[10, "_CPPv4N5slint6Window14set_fullscreenEb"]], "window::set_maximized (c++ function)": [[10, "_CPPv4N5slint6Window13set_maximizedEb"]], "window::set_minimized (c++ function)": [[10, "_CPPv4N5slint6Window13set_minimizedEb"]], "window::set_position (c++ function)": [[10, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE"], [10, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE"]], "window::set_rendering_notifier (c++ function)": [[10, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F"]], "window::set_size (c++ function)": [[10, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE"], [10, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE"]], "window::show (c++ function)": [[10, "_CPPv4N5slint6Window4showEv"]], "window::size (c++ function)": [[10, "_CPPv4NK5slint6Window4sizeEv"]], "window::~window (c++ function)": [[10, "_CPPv4N5slint6WindowD0Ev"]], "componentcompiler (c++ class)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerE"]], "componentcompiler::componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv"]], "componentcompiler::build_from_path (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE"]], "componentcompiler::build_from_source (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE"]], "componentcompiler::diagnostics (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv"]], "componentcompiler::include_paths (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv"]], "componentcompiler::set_include_paths (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE"]], "componentcompiler::set_style (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE"]], "componentcompiler::set_translation_domain (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE"]], "componentcompiler::style (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv"]], "componentcompiler::~componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev"]], "componentdefinition (c++ class)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionE"]], "componentdefinition::componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition"]], "componentdefinition::callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv"]], "componentdefinition::create (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv"]], "componentdefinition::functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv"]], "componentdefinition::global_callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE"]], "componentdefinition::global_functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE"]], "componentdefinition::global_properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE"]], "componentdefinition::globals (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv"]], "componentdefinition::name (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv"]], "componentdefinition::operator= (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition"]], "componentdefinition::properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv"]], "componentdefinition::~componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev"]], "componentinstance (c++ class)": [[13, "_CPPv4N5slint11interpreter17ComponentInstanceE"]], "componentinstance::definition (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv"]], "componentinstance::get_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE"]], "componentinstance::get_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE"]], "componentinstance::hide (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv"]], "componentinstance::invoke (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::invoke_global (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::qwidget (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv"]], "componentinstance::run (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv"]], "componentinstance::set_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F"]], "componentinstance::set_global_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F"]], "componentinstance::set_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value"]], "componentinstance::set_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value"]], "componentinstance::show (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv"]], "componentinstance::window (c++ function)": [[13, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv"]], "value (c++ class)": [[14, "_CPPv4N5slint11interpreter5ValueE"]], "value::type (c++ type)": [[14, "_CPPv4N5slint11interpreter5Value4TypeE"]], "value::value (c++ function)": [[14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Image"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERR5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueEb"], [14, "_CPPv4N5slint11interpreter5Value5ValueEd"], [14, "_CPPv4N5slint11interpreter5Value5ValueEi"], [14, "_CPPv4N5slint11interpreter5Value5ValueEv"]], "value::operator= (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueaSERK5Value"], [14, "_CPPv4N5slint11interpreter5ValueaSERR5Value"]], "value::operator== (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value"]], "value::to_array (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_arrayEv"]], "value::to_bool (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value7to_boolEv"]], "value::to_brush (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_brushEv"]], "value::to_image (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_imageEv"]], "value::to_number (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_numberEv"]], "value::to_string (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_stringEv"]], "value::to_struct (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_structEv"]], "value::type (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value4typeEv"]], "value::~value (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueD0Ev"]], "platform::abstractrenderer (c++ class)": [[15, "_CPPv4N5slint8platform16AbstractRendererE"]], "platform::nativewindowhandle (c++ class)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleE"]], "platform::nativewindowhandle::nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv"]], "platform::nativewindowhandle::from_appkit (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow"]], "platform::nativewindowhandle::from_wayland (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display"]], "platform::nativewindowhandle::from_win32 (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv"]], "platform::nativewindowhandle::from_x11_xcb (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti"]], "platform::nativewindowhandle::from_x11_xlib (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi"]], "platform::nativewindowhandle::operator= (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle"]], "platform::nativewindowhandle::~nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev"]], "platform::platform (c++ class)": [[17, "_CPPv4N5slint8platform8PlatformE"]], "platform::platform::clipboard (c++ enum)": [[17, "_CPPv4N5slint8platform8Platform9ClipboardE"]], "platform::platform::clipboard::defaultclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE"]], "platform::platform::clipboard::selectionclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE"]], "platform::platform::platform (c++ function)": [[17, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform"], [17, "_CPPv4N5slint8platform8Platform8PlatformEv"]], "platform::platform::task (c++ class)": [[17, "_CPPv4N5slint8platform8Platform4TaskE"], [18, "_CPPv4N5slint8platform8Platform4TaskE"]], "platform::platform::task::task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [17, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"]], "platform::platform::task::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [17, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"]], "platform::platform::task::run (c++ function)": [[17, "_CPPv4NO5slint8platform8Platform4Task3runEv"], [18, "_CPPv4NO5slint8platform8Platform4Task3runEv"]], "platform::platform::task::~task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskD0Ev"], [18, "_CPPv4N5slint8platform8Platform4TaskD0Ev"]], "platform::platform::clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard"]], "platform::platform::create_window_adapter (c++ function)": [[17, "_CPPv4N5slint8platform8Platform21create_window_adapterEv"]], "platform::platform::duration_since_start (c++ function)": [[17, "_CPPv4N5slint8platform8Platform20duration_since_startEv"]], "platform::platform::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformaSERK8Platform"]], "platform::platform::quit_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform15quit_event_loopEv"]], "platform::platform::run_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14run_event_loopEv"]], "platform::platform::run_in_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task"]], "platform::platform::set_clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard"]], "platform::platform::~platform (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformD0Ev"]], "platform::skiarenderer (c++ class)": [[19, "_CPPv4N5slint8platform12SkiaRendererE"]], "platform::skiarenderer::skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer"], [19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize"]], "platform::skiarenderer::operator= (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer"]], "platform::skiarenderer::render (c++ function)": [[19, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv"]], "platform::skiarenderer::~skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendererD0Ev"]], "platform::softwarerenderer (c++ class)": [[20, "_CPPv4N5slint8platform16SoftwareRendererE"]], "platform::softwarerenderer::physicalregion (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"]], "platform::softwarerenderer::physicalregion::rect (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"]], "platform::softwarerenderer::physicalregion::rect::origin (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"]], "platform::softwarerenderer::physicalregion::rect::size (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"]], "platform::softwarerenderer::physicalregion::bounding_box_origin (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"]], "platform::softwarerenderer::physicalregion::bounding_box_size (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"]], "platform::softwarerenderer::physicalregion::rectangles (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"]], "platform::softwarerenderer::renderingrotation (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE"]], "platform::softwarerenderer::renderingrotation::norotation (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE"]], "platform::softwarerenderer::renderingrotation::rotate180 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E"]], "platform::softwarerenderer::renderingrotation::rotate270 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E"]], "platform::softwarerenderer::renderingrotation::rotate90 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E"]], "platform::softwarerenderer::repaintbuffertype (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE"]], "platform::softwarerenderer::repaintbuffertype::newbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE"]], "platform::softwarerenderer::repaintbuffertype::reusedbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE"]], "platform::softwarerenderer::repaintbuffertype::swappedbuffers (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE"]], "platform::softwarerenderer::softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType"], [20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer"]], "platform::softwarerenderer::operator= (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer"]], "platform::softwarerenderer::render (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE"], [20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE"]], "platform::softwarerenderer::render_by_line (c++ function)": [[20, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback"]], "platform::softwarerenderer::set_rendering_rotation (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation"]], "platform::softwarerenderer::~softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendererD0Ev"]], "platform::windowadapter (c++ class)": [[21, "_CPPv4N5slint8platform13WindowAdapterE"]], "platform::windowadapter::windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv"]], "platform::windowadapter::windowproperties (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"]], "platform::windowadapter::windowproperties::layoutconstraints (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"]], "platform::windowadapter::windowproperties::layoutconstraints::max (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"]], "platform::windowadapter::windowproperties::layoutconstraints::min (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"]], "platform::windowadapter::windowproperties::layoutconstraints::preferred (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"]], "platform::windowadapter::windowproperties::background (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"]], "platform::windowadapter::windowproperties::fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"]], "platform::windowadapter::windowproperties::is_fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"]], "platform::windowadapter::windowproperties::is_maximized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"]], "platform::windowadapter::windowproperties::is_minimized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"]], "platform::windowadapter::windowproperties::layout_constraints (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"]], "platform::windowadapter::windowproperties::title (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"]], "platform::windowadapter::position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8positionEv"]], "platform::windowadapter::renderer (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8rendererEv"]], "platform::windowadapter::request_redraw (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv"]], "platform::windowadapter::set_position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE"]], "platform::windowadapter::set_size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE"]], "platform::windowadapter::set_visible (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb"]], "platform::windowadapter::size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter4sizeEv"]], "platform::windowadapter::update_window_properties (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties"]], "platform::windowadapter::window (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter6windowEv"], [21, "_CPPv4NK5slint8platform13WindowAdapter6windowEv"]], "platform::windowadapter::~windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapterD0Ev"]], "testing::elementhandle (c++ class)": [[22, "_CPPv4N5slint7testing13ElementHandleE"]], "testing::elementhandle::absolute_position (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv"]], "testing::elementhandle::accessible_checkable (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv"]], "testing::elementhandle::accessible_checked (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv"]], "testing::elementhandle::accessible_description (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv"]], "testing::elementhandle::accessible_label (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv"]], "testing::elementhandle::accessible_placeholder_text (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv"]], "testing::elementhandle::accessible_role (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv"]], "testing::elementhandle::accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv"]], "testing::elementhandle::accessible_value_maximum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv"]], "testing::elementhandle::accessible_value_minimum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv"]], "testing::elementhandle::accessible_value_step (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv"]], "testing::elementhandle::bases (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle5basesEv"]], "testing::elementhandle::find_by_accessible_label (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_id (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_type_name (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::id (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle2idEv"]], "testing::elementhandle::invoke_accessible_decrement_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv"]], "testing::elementhandle::invoke_accessible_default_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv"]], "testing::elementhandle::invoke_accessible_increment_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv"]], "testing::elementhandle::is_valid (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle8is_validEv"]], "testing::elementhandle::set_accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString"]], "testing::elementhandle::size (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle4sizeEv"]], "testing::elementhandle::type_name (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv"]], "testing::elementhandle::visit_elements (c++ function)": [[22, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor"]], "slint_feature_backend_qt (c macro)": [[23, "c.SLINT_FEATURE_BACKEND_QT"]], "slint_feature_gettext (c macro)": [[24, "c.SLINT_FEATURE_GETTEXT"]], "slint_feature_interpreter (c macro)": [[25, "c.SLINT_FEATURE_INTERPRETER"]], "slint_version_patch (c macro)": [[26, "c.SLINT_VERSION_PATCH"]], "slint_feature_backend_linuxkms (c macro)": [[27, "c.SLINT_FEATURE_BACKEND_LINUXKMS"]], "slint_feature_experimental (c macro)": [[28, "c.SLINT_FEATURE_EXPERIMENTAL"]], "slint_version_string (c macro)": [[29, "c.SLINT_VERSION_STRING"]], "slint_feature_renderer_femtovg (c macro)": [[30, "c.SLINT_FEATURE_RENDERER_FEMTOVG"]], "slint_feature_renderer_skia (c macro)": [[31, "c.SLINT_FEATURE_RENDERER_SKIA"]], "slint_feature_system_testing (c macro)": [[32, "c.SLINT_FEATURE_SYSTEM_TESTING"]], "slint_feature_accessibility (c macro)": [[33, "c.SLINT_FEATURE_ACCESSIBILITY"]], "slint_feature_renderer_software (c macro)": [[34, "c.SLINT_FEATURE_RENDERER_SOFTWARE"]], "slint_version_minor (c macro)": [[35, "c.SLINT_VERSION_MINOR"]], "slint_feature_freestanding (c macro)": [[36, "c.SLINT_FEATURE_FREESTANDING"]], "slint_feature_testing (c macro)": [[37, "c.SLINT_FEATURE_TESTING"]], "slint_version_major (c macro)": [[38, "c.SLINT_VERSION_MAJOR"]], "slint_feature_backend_winit (c macro)": [[39, "c.SLINT_FEATURE_BACKEND_WINIT"]], "assert_eq (c macro)": [[40, "c.assert_eq"]], "valuetype (c++ enum)": [[46, "_CPPv4N5slint11interpreter9ValueTypeE"]], "valuetype::bool (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4BoolE"]], "valuetype::brush (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5BrushE"]], "valuetype::image (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ImageE"]], "valuetype::model (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ModelE"]], "valuetype::number (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6NumberE"]], "valuetype::other (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5OtherE"]], "valuetype::string (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StringE"]], "valuetype::struct (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StructE"]], "valuetype::void (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4VoidE"]], "diagnosticlevel (c++ enum)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevelE"]], "diagnosticlevel::error (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE"]], "diagnosticlevel::warning (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE"]], "testing::accessiblerole (c++ enum)": [[48, "_CPPv4N5slint7testing14AccessibleRoleE"]], "testing::accessiblerole::button (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6ButtonE"]], "testing::accessiblerole::checkbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE"]], "testing::accessiblerole::combobox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE"]], "testing::accessiblerole::list (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4ListE"]], "testing::accessiblerole::none (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4NoneE"]], "testing::accessiblerole::progressindicator (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE"]], "testing::accessiblerole::slider (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SliderE"]], "testing::accessiblerole::spinbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE"]], "testing::accessiblerole::switch (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SwitchE"]], "testing::accessiblerole::tab (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole3TabE"]], "testing::accessiblerole::tablist (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7TabListE"]], "testing::accessiblerole::table (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole5TableE"]], "testing::accessiblerole::text (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TextE"]], "testing::accessiblerole::textinput (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole9TextInputE"]], "testing::accessiblerole::tree (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TreeE"]], "setrenderingnotifiererror (c++ enum)": [[49, "_CPPv4N5slint25SetRenderingNotifierErrorE"]], "setrenderingnotifiererror::alreadyset (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE"]], "setrenderingnotifiererror::unsupported (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE"]], "pointereventbutton (c++ enum)": [[50, "_CPPv4N5slint18PointerEventButtonE"]], "pointereventbutton::left (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4LeftE"]], "pointereventbutton::middle (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton6MiddleE"]], "pointereventbutton::other (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5OtherE"]], "pointereventbutton::right (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5RightE"]], "eventloopmode (c++ enum)": [[51, "_CPPv4N5slint13EventLoopModeE"]], "eventloopmode::quitonlastwindowclosed (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE"]], "eventloopmode::rununtilquit (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE"]], "graphicsapi (c++ enum)": [[52, "_CPPv4N5slint11GraphicsAPIE"]], "graphicsapi::nativeopengl (c++ enumerator)": [[52, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE"]], "renderingstate (c++ enum)": [[53, "_CPPv4N5slint14RenderingStateE"]], "renderingstate::afterrendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14AfterRenderingE"]], "renderingstate::beforerendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState15BeforeRenderingE"]], "renderingstate::renderingsetup (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14RenderingSetupE"]], "renderingstate::renderingteardown (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState17RenderingTeardownE"]], "closerequestresponse (c++ enum)": [[54, "_CPPv4N5slint20CloseRequestResponseE"]], "closerequestresponse::hidewindow (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse10HideWindowE"]], "closerequestresponse::keepwindowshown (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE"]], "platform::duration_until_next_timer_update (c++ function)": [[93, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv"]], "platform::update_timers_and_animations (c++ function)": [[94, "_CPPv4N5slint8platform28update_timers_and_animationsEv"]], "platform::set_platform (c++ function)": [[95, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE"]], "testing::init (c++ function)": [[96, "_CPPv4N5slint7testing4initEv"]], "quit_event_loop (c++ function)": [[97, "_CPPv4N5slint15quit_event_loopEv"]], "invoke_from_event_loop (c++ function)": [[98, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor"]], "blocking_invoke_from_event_loop (c++ function)": [[99, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor"]], "run_event_loop (c++ function)": [[100, "_CPPv4N5slint14run_event_loopE13EventLoopMode"]], "update_all_translations (c++ function)": [[101, "_CPPv4N5slint23update_all_translationsEv"]], "hsvacolor (c++ struct)": [[147, "_CPPv4N5slint9HsvaColorE"]], "hsvacolor::alpha (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5alphaE"]], "hsvacolor::hue (c++ member)": [[147, "_CPPv4N5slint9HsvaColor3hueE"]], "hsvacolor::saturation (c++ member)": [[147, "_CPPv4N5slint9HsvaColor10saturationE"]], "hsvacolor::value (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5valueE"]], "image (c++ struct)": [[148, "_CPPv4N5slint5ImageE"]], "image::borrowedopengltextureorigin (c++ enum)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE"]], "image::borrowedopengltextureorigin::bottomleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE"]], "image::borrowedopengltextureorigin::topleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE"]], "image::image (c++ function)": [[148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE"], [148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE"], [148, "_CPPv4N5slint5Image5ImageEv"]], "image::create_from_borrowed_gl_2d_rgba_texture (c++ function)": [[148, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin"]], "image::load_from_path (c++ function)": [[148, "_CPPv4N5slint5Image14load_from_pathERK12SharedString"]], "image::operator!= (c++ function)": [[148, "_CPPv4N5slint5ImageneERK5ImageRK5Image"]], "image::operator== (c++ function)": [[148, "_CPPv4N5slint5ImageeqERK5ImageRK5Image"]], "image::path (c++ function)": [[148, "_CPPv4NK5slint5Image4pathEv"]], "image::set_nine_slice_edges (c++ function)": [[148, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt"]], "image::size (c++ function)": [[148, "_CPPv4NK5slint5Image4sizeEv"]], "logicalposition (c++ struct)": [[149, "_CPPv4N5slint15LogicalPositionE"]], "logicalposition::logicalposition (c++ function)": [[149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE"], [149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv"]], "logicalsize (c++ struct)": [[150, "_CPPv4N5slint11LogicalSizeE"]], "logicalsize::logicalsize (c++ function)": [[150, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE"]], "physicalposition (c++ struct)": [[151, "_CPPv4N5slint16PhysicalPositionE"]], "physicalposition::physicalposition (c++ function)": [[151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE"], [151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv"]], "physicalsize (c++ struct)": [[152, "_CPPv4N5slint12PhysicalSizeE"]], "physicalsize::physicalsize (c++ function)": [[152, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE"]], "point (c++ struct)": [[153, "_CPPv4I0EN5slint5PointE"]], "point::operator== (c++ function)": [[153, "_CPPv4NK5slint5PointeqERK5Point"]], "point::x (c++ member)": [[153, "_CPPv4N5slint5Point1xE"]], "point::y (c++ member)": [[153, "_CPPv4N5slint5Point1yE"]], "rgb8pixel (c++ struct)": [[154, "_CPPv4N5slint9Rgb8PixelE"]], "rgb8pixel::b (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1bE"]], "rgb8pixel::g (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1gE"]], "rgb8pixel::r (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1rE"]], "rgba8pixel (c++ struct)": [[155, "_CPPv4N5slint10Rgba8PixelE"]], "rgba8pixel::a (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1aE"]], "rgba8pixel::b (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1bE"]], "rgba8pixel::g (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1gE"]], "rgba8pixel::r (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1rE"]], "rgbacolor (c++ struct)": [[156, "_CPPv4I0EN5slint9RgbaColorE"]], "rgbacolor::rgbacolor (c++ function)": [[156, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color"]], "rgbacolor::alpha (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5alphaE"]], "rgbacolor::blue (c++ member)": [[156, "_CPPv4N5slint9RgbaColor4blueE"]], "rgbacolor::green (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5greenE"]], "rgbacolor::red (c++ member)": [[156, "_CPPv4N5slint9RgbaColor3redE"]], "sharedpixelbuffer (c++ struct)": [[157, "_CPPv4I0EN5slint17SharedPixelBufferE"]], "sharedpixelbuffer::sharedpixelbuffer (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv"]], "sharedpixelbuffer::begin (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer5beginEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer5beginEv"]], "sharedpixelbuffer::cbegin (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv"]], "sharedpixelbuffer::cend (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer4cendEv"]], "sharedpixelbuffer::end (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer3endEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer3endEv"]], "sharedpixelbuffer::height (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6heightEv"]], "sharedpixelbuffer::operator== (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer"]], "sharedpixelbuffer::width (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer5widthEv"]], "sharedstring (c++ struct)": [[158, "_CPPv4N5slint12SharedStringE"]], "sharedstring::sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKDu"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKc"], [158, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString"], [158, "_CPPv4N5slint12SharedString12SharedStringEv"]], "sharedstring::begin (c++ function)": [[158, "_CPPv4NK5slint12SharedString5beginEv"]], "sharedstring::data (c++ function)": [[158, "_CPPv4NK5slint12SharedString4dataEv"]], "sharedstring::empty (c++ function)": [[158, "_CPPv4NK5slint12SharedString5emptyEv"]], "sharedstring::end (c++ function)": [[158, "_CPPv4NK5slint12SharedString3endEv"]], "sharedstring::ends_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE"]], "sharedstring::from_number (c++ function)": [[158, "_CPPv4N5slint12SharedString11from_numberEd"]], "sharedstring::operator std::string_view (c++ function)": [[158, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv"]], "sharedstring::operator!= (c++ function)": [[158, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString"]], "sharedstring::operator+ (c++ function)": [[158, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE"]], "sharedstring::operator+= (c++ function)": [[158, "_CPPv4N5slint12SharedStringpLENSt11string_viewE"]], "sharedstring::operator< (c++ function)": [[158, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString"]], "sharedstring::operator<< (c++ function)": [[158, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString"]], "sharedstring::operator<= (c++ function)": [[158, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString"]], "sharedstring::operator= (c++ function)": [[158, "_CPPv4N5slint12SharedStringaSENSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringaSEPKc"], [158, "_CPPv4N5slint12SharedStringaSERK12SharedString"], [158, "_CPPv4N5slint12SharedStringaSERR12SharedString"]], "sharedstring::operator== (c++ function)": [[158, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString"]], "sharedstring::operator> (c++ function)": [[158, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString"]], "sharedstring::operator>= (c++ function)": [[158, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString"]], "sharedstring::starts_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE"]], "sharedstring::~sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedStringD0Ev"]], "sharedvector (c++ struct)": [[159, "_CPPv4I0EN5slint12SharedVectorE"]], "sharedvector::sharedvector (c++ function)": [[159, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T"], [159, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE"], [159, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector"], [159, "_CPPv4N5slint12SharedVector12SharedVectorEv"]], "sharedvector::at (c++ function)": [[159, "_CPPv4NK5slint12SharedVector2atENSt6size_tE"]], "sharedvector::begin (c++ function)": [[159, "_CPPv4N5slint12SharedVector5beginEv"], [159, "_CPPv4NK5slint12SharedVector5beginEv"]], "sharedvector::cbegin (c++ function)": [[159, "_CPPv4NK5slint12SharedVector6cbeginEv"]], "sharedvector::cend (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4cendEv"]], "sharedvector::clear (c++ function)": [[159, "_CPPv4N5slint12SharedVector5clearEv"]], "sharedvector::empty (c++ function)": [[159, "_CPPv4NK5slint12SharedVector5emptyEv"]], "sharedvector::end (c++ function)": [[159, "_CPPv4N5slint12SharedVector3endEv"], [159, "_CPPv4NK5slint12SharedVector3endEv"]], "sharedvector::operator= (c++ function)": [[159, "_CPPv4N5slint12SharedVectoraSERK12SharedVector"], [159, "_CPPv4N5slint12SharedVectoraSERR12SharedVector"]], "sharedvector::operator== (c++ function)": [[159, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector"]], "sharedvector::operator[] (c++ function)": [[159, "_CPPv4N5slint12SharedVectorixENSt6size_tE"], [159, "_CPPv4NK5slint12SharedVectorixENSt6size_tE"]], "sharedvector::push_back (c++ function)": [[159, "_CPPv4N5slint12SharedVector9push_backERK1T"], [159, "_CPPv4N5slint12SharedVector9push_backERR1T"]], "sharedvector::size (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4sizeEv"]], "sharedvector::~sharedvector (c++ function)": [[159, "_CPPv4N5slint12SharedVectorD0Ev"]], "size (c++ struct)": [[160, "_CPPv4I0EN5slint4SizeE"]], "size::height (c++ member)": [[160, "_CPPv4N5slint4Size6heightE"]], "size::operator== (c++ function)": [[160, "_CPPv4NK5slint4SizeeqERK4Size"]], "size::width (c++ member)": [[160, "_CPPv4N5slint4Size5widthE"]], "standardlistviewitem (c++ struct)": [[161, "_CPPv4N5slint20StandardListViewItemE"]], "standardlistviewitem::text (c++ member)": [[161, "_CPPv4N5slint20StandardListViewItem4textE"]], "timer (c++ struct)": [[162, "_CPPv4N5slint5TimerE"]], "timer::timer (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F"], [162, "_CPPv4N5slint5Timer5TimerERK5Timer"], [162, "_CPPv4N5slint5Timer5TimerEv"]], "timer::interval (c++ function)": [[162, "_CPPv4NK5slint5Timer8intervalEv"]], "timer::operator= (c++ function)": [[162, "_CPPv4N5slint5TimeraSERK5Timer"]], "timer::restart (c++ function)": [[162, "_CPPv4N5slint5Timer7restartEv"]], "timer::running (c++ function)": [[162, "_CPPv4NK5slint5Timer7runningEv"]], "timer::single_shot (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F"]], "timer::start (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F"]], "timer::stop (c++ function)": [[162, "_CPPv4N5slint5Timer4stopEv"]], "timer::~timer (c++ function)": [[162, "_CPPv4N5slint5TimerD0Ev"]], "diagnostic (c++ struct)": [[163, "_CPPv4N5slint11interpreter10DiagnosticE"]], "diagnostic::column (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic6columnE"]], "diagnostic::level (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic5levelE"]], "diagnostic::line (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic4lineE"]], "diagnostic::message (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic7messageE"]], "diagnostic::source_file (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE"]], "propertydescriptor (c++ struct)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptorE"]], "propertydescriptor::property_name (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE"]], "propertydescriptor::property_type (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE"]], "struct (c++ struct)": [[165, "_CPPv4N5slint11interpreter6StructE"]], "struct::struct (c++ function)": [[165, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator"], [165, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE"], [165, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructEv"]], "struct::begin (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct5beginEv"]], "struct::end (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct3endEv"]], "struct::get_field (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE"]], "struct::iterator (c++ struct)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorE"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorE"]], "struct::iterator::iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"]], "struct::iterator::operator!= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"]], "struct::iterator::operator* (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"], [166, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"]], "struct::iterator::operator++ (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"]], "struct::iterator::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"]], "struct::iterator::operator== (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"]], "struct::iterator::value_type (c++ type)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"], [166, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"]], "struct::iterator::~iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"]], "struct::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructaSERK6Struct"], [165, "_CPPv4N5slint11interpreter6StructaSERR6Struct"]], "struct::set_field (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value"]], "struct::~struct (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructD0Ev"]], "platform::rgb565pixel (c++ struct)": [[167, "_CPPv4N5slint8platform11Rgb565PixelE"]], "platform::rgb565pixel::rgb565pixel (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel"], [167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv"]], "platform::rgb565pixel::b (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1bE"]], "platform::rgb565pixel::blue (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv"]], "platform::rgb565pixel::g (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1gE"]], "platform::rgb565pixel::green (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv"]], "platform::rgb565pixel::operator rgb8pixel (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv"]], "platform::rgb565pixel::operator== (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel"]], "platform::rgb565pixel::r (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1rE"]], "platform::rgb565pixel::red (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["api/classslint_1_1Brush", "api/classslint_1_1Color", "api/classslint_1_1ComponentHandle", "api/classslint_1_1ComponentWeakHandle", "api/classslint_1_1FilterModel", "api/classslint_1_1MapModel", "api/classslint_1_1Model", "api/classslint_1_1ReverseModel", "api/classslint_1_1SortModel", "api/classslint_1_1VectorModel", "api/classslint_1_1Window", "api/classslint_1_1interpreter_1_1ComponentCompiler", "api/classslint_1_1interpreter_1_1ComponentDefinition", "api/classslint_1_1interpreter_1_1ComponentInstance", "api/classslint_1_1interpreter_1_1Value", "api/classslint_1_1platform_1_1AbstractRenderer", "api/classslint_1_1platform_1_1NativeWindowHandle", "api/classslint_1_1platform_1_1Platform", "api/classslint_1_1platform_1_1Platform_1_1Task", "api/classslint_1_1platform_1_1SkiaRenderer", "api/classslint_1_1platform_1_1SoftwareRenderer", "api/classslint_1_1platform_1_1WindowAdapter", "api/classslint_1_1testing_1_1ElementHandle", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95", "api/dir__home_runner_work_slint_slint_api", "api/dir__home_runner_work_slint_slint_api_cpp", "api/dir__home_runner_work_slint_slint_api_cpp_include", "api/dir_cppdocs", "api/dir_cppdocs_generated_include", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/file_cppdocs_generated_include_slint_brush_internal.h", "api/file_cppdocs_generated_include_slint_builtin_structs.h", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/file_cppdocs_generated_include_slint_color_internal.h", "api/file_cppdocs_generated_include_slint_enums.h", "api/file_cppdocs_generated_include_slint_enums_internal.h", "api/file_cppdocs_generated_include_slint_generated_public.h", "api/file_cppdocs_generated_include_slint_image_internal.h", "api/file_cppdocs_generated_include_slint_internal.h", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/file_cppdocs_generated_include_slint_interpreter_internal.h", "api/file_cppdocs_generated_include_slint_pathdata_internal.h", "api/file_cppdocs_generated_include_slint_platform_internal.h", "api/file_cppdocs_generated_include_slint_properties_internal.h", "api/file_cppdocs_generated_include_slint_qt_internal.h", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/file_cppdocs_generated_include_slint_string_internal.h", "api/file_cppdocs_generated_include_slint_testing_internal.h", "api/file_cppdocs_generated_include_slint_timer_internal.h", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505", "api/library_root", "api/namespace_slint", "api/namespace_slint__interpreter", "api/namespace_slint__platform", "api/namespace_slint__platform__key_codes", "api/namespace_slint__testing", "api/page_deprecated", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_enums.h", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h", "api/structslint_1_1HsvaColor", "api/structslint_1_1Image", "api/structslint_1_1LogicalPosition", "api/structslint_1_1LogicalSize", "api/structslint_1_1PhysicalPosition", "api/structslint_1_1PhysicalSize", "api/structslint_1_1Point", "api/structslint_1_1Rgb8Pixel", "api/structslint_1_1Rgba8Pixel", "api/structslint_1_1RgbaColor", "api/structslint_1_1SharedPixelBuffer", "api/structslint_1_1SharedString", "api/structslint_1_1SharedVector", "api/structslint_1_1Size", "api/structslint_1_1StandardListViewItem", "api/structslint_1_1Timer", "api/structslint_1_1interpreter_1_1Diagnostic", "api/structslint_1_1interpreter_1_1PropertyDescriptor", "api/structslint_1_1interpreter_1_1Struct", "api/structslint_1_1interpreter_1_1Struct_1_1iterator", "api/structslint_1_1platform_1_1Rgb565Pixel", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints", "api/unabridged_orphan", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec", "cmake", "cmake_reference", "generated_code", "genindex", "getting_started", "index", "overview", "types"], "filenames": ["api/classslint_1_1Brush.rst", "api/classslint_1_1Color.rst", "api/classslint_1_1ComponentHandle.rst", "api/classslint_1_1ComponentWeakHandle.rst", "api/classslint_1_1FilterModel.rst", "api/classslint_1_1MapModel.rst", "api/classslint_1_1Model.rst", "api/classslint_1_1ReverseModel.rst", "api/classslint_1_1SortModel.rst", "api/classslint_1_1VectorModel.rst", "api/classslint_1_1Window.rst", "api/classslint_1_1interpreter_1_1ComponentCompiler.rst", "api/classslint_1_1interpreter_1_1ComponentDefinition.rst", "api/classslint_1_1interpreter_1_1ComponentInstance.rst", "api/classslint_1_1interpreter_1_1Value.rst", "api/classslint_1_1platform_1_1AbstractRenderer.rst", "api/classslint_1_1platform_1_1NativeWindowHandle.rst", "api/classslint_1_1platform_1_1Platform.rst", "api/classslint_1_1platform_1_1Platform_1_1Task.rst", "api/classslint_1_1platform_1_1SkiaRenderer.rst", "api/classslint_1_1platform_1_1SoftwareRenderer.rst", "api/classslint_1_1platform_1_1WindowAdapter.rst", "api/classslint_1_1testing_1_1ElementHandle.rst", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7.rst", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9.rst", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f.rst", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d.rst", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4.rst", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79.rst", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd.rst", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9.rst", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0.rst", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a.rst", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552.rst", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5.rst", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9.rst", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3.rst", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a.rst", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853.rst", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364.rst", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95.rst", "api/dir__home_runner_work_slint_slint_api.rst", "api/dir__home_runner_work_slint_slint_api_cpp.rst", "api/dir__home_runner_work_slint_slint_api_cpp_include.rst", "api/dir_cppdocs.rst", "api/dir_cppdocs_generated_include.rst", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0.rst", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d.rst", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d.rst", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1.rst", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e.rst", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290.rst", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b.rst", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af.rst", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/file_cppdocs_generated_include_slint_color_internal.h.rst", "api/file_cppdocs_generated_include_slint_enums.h.rst", "api/file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/file_cppdocs_generated_include_slint_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_image_internal.h.rst", "api/file_cppdocs_generated_include_slint_internal.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/file_cppdocs_generated_include_slint_string_internal.h.rst", "api/file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658.rst", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3.rst", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64.rst", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4.rst", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0.rst", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430.rst", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c.rst", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b.rst", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505.rst", "api/library_root.rst", "api/namespace_slint.rst", "api/namespace_slint__interpreter.rst", "api/namespace_slint__platform.rst", "api/namespace_slint__platform__key_codes.rst", "api/namespace_slint__testing.rst", "api/page_deprecated.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/structslint_1_1HsvaColor.rst", "api/structslint_1_1Image.rst", "api/structslint_1_1LogicalPosition.rst", "api/structslint_1_1LogicalSize.rst", "api/structslint_1_1PhysicalPosition.rst", "api/structslint_1_1PhysicalSize.rst", "api/structslint_1_1Point.rst", "api/structslint_1_1Rgb8Pixel.rst", "api/structslint_1_1Rgba8Pixel.rst", "api/structslint_1_1RgbaColor.rst", "api/structslint_1_1SharedPixelBuffer.rst", "api/structslint_1_1SharedString.rst", "api/structslint_1_1SharedVector.rst", "api/structslint_1_1Size.rst", "api/structslint_1_1StandardListViewItem.rst", "api/structslint_1_1Timer.rst", "api/structslint_1_1interpreter_1_1Diagnostic.rst", "api/structslint_1_1interpreter_1_1PropertyDescriptor.rst", "api/structslint_1_1interpreter_1_1Struct.rst", "api/structslint_1_1interpreter_1_1Struct_1_1iterator.rst", "api/structslint_1_1platform_1_1Rgb565Pixel.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints.rst", "api/unabridged_orphan.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec.rst", "cmake.md", "cmake_reference.md", "generated_code.md", "genindex.rst", "getting_started.md", "index.rst", "overview.md", "types.md"], "titles": ["Class Brush", "Class Color", "Template Class ComponentHandle", "Template Class ComponentWeakHandle", "Template Class FilterModel", "Template Class MapModel", "Template Class Model", "Template Class ReverseModel", "Template Class SortModel", "Template Class VectorModel", "Class Window", "Class ComponentCompiler", "Class ComponentDefinition", "Class ComponentInstance", "Class Value", "Class AbstractRenderer", "Class NativeWindowHandle", "Class Platform", "Class Platform::Task", "Class SkiaRenderer", "Class SoftwareRenderer", "Class WindowAdapter", "Class ElementHandle", "Define SLINT_FEATURE_BACKEND_QT", "Define SLINT_FEATURE_GETTEXT", "Define SLINT_FEATURE_INTERPRETER", "Define SLINT_VERSION_PATCH", "Define SLINT_FEATURE_BACKEND_LINUXKMS", "Define SLINT_FEATURE_EXPERIMENTAL", "Define SLINT_VERSION_STRING", "Define SLINT_FEATURE_RENDERER_FEMTOVG", "Define SLINT_FEATURE_RENDERER_SKIA", "Define SLINT_FEATURE_SYSTEM_TESTING", "Define SLINT_FEATURE_ACCESSIBILITY", "Define SLINT_FEATURE_RENDERER_SOFTWARE", "Define SLINT_VERSION_MINOR", "Define SLINT_FEATURE_FREESTANDING", "Define SLINT_FEATURE_TESTING", "Define SLINT_VERSION_MAJOR", "Define SLINT_FEATURE_BACKEND_WINIT", "Define assert_eq", "Directory api", "Directory cpp", "Directory include", "Directory cppdocs", "Directory generated_include", "Enum ValueType", "Enum DiagnosticLevel", "Enum AccessibleRole", "Enum SetRenderingNotifierError", "Enum PointerEventButton", "Enum EventLoopMode", "Enum GraphicsAPI", "Enum RenderingState", "Enum CloseRequestResponse", "File slint-interpreter.h", "File slint-platform.h", "File slint-testing.h", "File slint.h", "File slint_brush.h", "File slint_callbacks.h", "File slint_color.h", "File slint_config.h", "File slint_image.h", "File slint_interpreter.h", "File slint_pathdata.h", "File slint_point.h", "File slint_properties.h", "File slint_sharedvector.h", "File slint_size.h", "File slint_string.h", "File slint_tests_helpers.h", "File slint_timer.h", "File slint_window.h", "File slint_brush_internal.h", "File slint_builtin_structs.h", "File slint_builtin_structs_internal.h", "File slint_color_internal.h", "File slint_enums.h", "File slint_enums_internal.h", "File slint_generated_public.h", "File slint_image_internal.h", "File slint_internal.h", "File slint_interpreter_generated_public.h", "File slint_interpreter_internal.h", "File slint_pathdata_internal.h", "File slint_platform_internal.h", "File slint_properties_internal.h", "File slint_qt_internal.h", "File slint_sharedvector_internal.h", "File slint_string_internal.h", "File slint_testing_internal.h", "File slint_timer_internal.h", "Function slint::platform::duration_until_next_timer_update", "Function slint::platform::update_timers_and_animations", "Function slint::platform::set_platform", "Function slint::testing::init", "Function slint::quit_event_loop", "Template Function slint::invoke_from_event_loop", "Template Function slint::blocking_invoke_from_event_loop", "Function slint::run_event_loop", "Function slint::update_all_translations", "C++ API Reference", "Namespace slint", "Namespace slint::interpreter", "Namespace slint::platform", "Namespace slint::platform::key_codes", "Namespace slint::testing", "Deprecated List", "Program Listing for File slint-interpreter.h", "Program Listing for File slint-platform.h", "Program Listing for File slint-testing.h", "Program Listing for File slint.h", "Program Listing for File slint_brush.h", "Program Listing for File slint_callbacks.h", "Program Listing for File slint_color.h", "Program Listing for File slint_config.h", "Program Listing for File slint_image.h", "Program Listing for File slint_interpreter.h", "Program Listing for File slint_pathdata.h", "Program Listing for File slint_point.h", "Program Listing for File slint_properties.h", "Program Listing for File slint_sharedvector.h", "Program Listing for File slint_size.h", "Program Listing for File slint_string.h", "Program Listing for File slint_tests_helpers.h", "Program Listing for File slint_timer.h", "Program Listing for File slint_window.h", "Program Listing for File slint_brush_internal.h", "Program Listing for File slint_builtin_structs.h", "Program Listing for File slint_builtin_structs_internal.h", "Program Listing for File slint_color_internal.h", "Program Listing for File slint_enums.h", "Program Listing for File slint_enums_internal.h", "Program Listing for File slint_generated_public.h", "Program Listing for File slint_image_internal.h", "Program Listing for File slint_internal.h", "Program Listing for File slint_interpreter_generated_public.h", "Program Listing for File slint_interpreter_internal.h", "Program Listing for File slint_pathdata_internal.h", "Program Listing for File slint_platform_internal.h", "Program Listing for File slint_properties_internal.h", "Program Listing for File slint_qt_internal.h", "Program Listing for File slint_sharedvector_internal.h", "Program Listing for File slint_string_internal.h", "Program Listing for File slint_testing_internal.h", "Program Listing for File slint_timer_internal.h", "Struct HsvaColor", "Struct Image", "Struct LogicalPosition", "Struct LogicalSize", "Struct PhysicalPosition", "Struct PhysicalSize", "Template Struct Point", "Struct Rgb8Pixel", "Struct Rgba8Pixel", "Template Struct RgbaColor", "Template Struct SharedPixelBuffer", "Struct SharedString", "Template Struct SharedVector", "Template Struct Size", "Struct StandardListViewItem", "Struct Timer", "Struct Diagnostic", "Struct PropertyDescriptor", "Struct Struct", "Struct Struct::iterator", "Struct Rgb565Pixel", "Struct SoftwareRenderer::PhysicalRegion", "Struct PhysicalRegion::Rect", "Struct WindowAdapter::WindowProperties", "Struct WindowProperties::LayoutConstraints", "Full API", "Variable slint::platform::key_codes::F24", "Variable slint::platform::key_codes::F1", "Variable slint::platform::key_codes::CapsLock", "Variable slint::platform::key_codes::Space", "Variable slint::platform::key_codes::Menu", "Variable slint::platform::key_codes::LeftArrow", "Variable slint::platform::key_codes::MetaR", "Variable slint::platform::key_codes::Pause", "Variable slint::platform::key_codes::F4", "Variable slint::platform::key_codes::F12", "Variable slint::platform::key_codes::Insert", "Variable slint::platform::key_codes::DownArrow", "Variable slint::platform::key_codes::AltGr", "Variable slint::platform::key_codes::Alt", "Variable slint::platform::key_codes::F23", "Variable slint::platform::key_codes::Stop", "Variable slint::platform::key_codes::F19", "Variable slint::platform::key_codes::ScrollLock", "Variable slint::platform::key_codes::F13", "Variable slint::platform::key_codes::F15", "Variable slint::platform::key_codes::F14", "Variable slint::platform::key_codes::Backspace", "Variable slint::platform::key_codes::F5", "Variable slint::platform::key_codes::F6", "Variable slint::platform::key_codes::Meta", "Variable slint::platform::key_codes::F9", "Variable slint::platform::key_codes::F20", "Variable slint::platform::key_codes::UpArrow", "Variable slint::platform::key_codes::F10", "Variable slint::platform::key_codes::F2", "Variable slint::platform::key_codes::F8", "Variable slint::platform::key_codes::F18", "Variable slint::platform::key_codes::PageDown", "Variable slint::platform::key_codes::F11", "Variable slint::platform::key_codes::F3", "Variable slint::platform::key_codes::Control", "Variable slint::platform::key_codes::F16", "Variable slint::platform::key_codes::ControlR", "Variable slint::platform::key_codes::Return", "Variable slint::platform::key_codes::F7", "Variable slint::platform::key_codes::Backtab", "Variable slint::platform::key_codes::Home", "Variable slint::platform::key_codes::RightArrow", "Variable slint::platform::key_codes::Escape", "Variable slint::platform::key_codes::SysReq", "Variable slint::platform::key_codes::F21", "Variable slint::platform::key_codes::F17", "Variable slint::platform::key_codes::PageUp", "Variable slint::platform::key_codes::Tab", "Variable slint::platform::key_codes::End", "Variable slint::platform::key_codes::ShiftR", "Variable slint::platform::key_codes::Delete", "Variable slint::platform::key_codes::Shift", "Variable slint::platform::key_codes::F22", "Set Up Development Environment", "CMake Reference", "Generated Code", "Index (C++)", "Getting Started", "Slint C++ documentation", "Overview", "Type Mappings"], "terms": {"defin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 109, 110, 112, 115, 116, 117, 122, 125, 127, 134, 135, 136, 138, 139, 142, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 229, 234], "file": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234], "slint_brush": [0, 43, 61, 70, 74, 82, 102, 136, 172], "h": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 97, 98, 99, 100, 101, 103, 104, 105, 107, 109, 110, 112, 113, 118, 120, 122, 123, 129, 130, 132, 133, 142, 144, 148, 153, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234], "us": [0, 1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 17, 20, 21, 22, 26, 29, 35, 38, 46, 48, 50, 51, 52, 53, 98, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 119, 120, 121, 123, 125, 126, 127, 128, 130, 133, 135, 136, 138, 140, 141, 142, 148, 153, 157, 158, 159, 160, 162, 164, 165, 166, 168, 170, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 233, 234], "how": [0, 20, 103, 157, 227, 231, 232, 233], "fill": [0, 20, 133, 136], "outlin": 0, "shape": [0, 148], "rectangl": [0, 20, 110, 136, 168, 169], "path": [0, 11, 41, 42, 43, 44, 45, 109, 117, 127, 135, 136, 138, 140, 148, 163, 227, 228], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232], "A": [0, 3, 6, 9, 13, 14, 17, 18, 20, 22, 40, 46, 50, 105, 112, 114, 125, 127, 148, 149, 150, 151, 152, 158, 162, 165, 166, 167, 168, 169, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 234], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 233, 234], "linear": [0, 136], "gradient": [0, 113], "public": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 123, 127, 128, 135, 139, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 234], "function": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 51, 104, 106, 109, 112, 125, 127, 138, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 169, 170, 172, 228, 229, 231, 233], "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 93, 94, 95, 96, 97, 100, 101, 109, 110, 111, 112, 113, 115, 117, 121, 124, 125, 127, 136, 142, 148, 149, 150, 151, 152, 156, 157, 158, 159, 162, 165, 166, 167, 168, 170, 229], "construct": [0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 14, 19, 20, 21, 22, 109, 148, 149, 151, 156, 157, 158, 159, 162, 165, 166, 167], "new": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 19, 20, 21, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 111, 112, 114, 121, 122, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 156, 157, 158, 159, 165, 166, 229, 231, 233], "transpar": [0, 1], "const": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 108, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 170, 229, 234], "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 54, 78, 93, 97, 99, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 153, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 231], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229], "thi": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 46, 48, 49, 50, 52, 53, 54, 94, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 112, 113, 115, 121, 122, 124, 125, 127, 128, 129, 130, 132, 133, 135, 139, 142, 148, 156, 157, 158, 159, 162, 165, 166, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233], "stop": [0, 22, 78, 102, 106, 113, 126, 132, 162], "brighter": [0, 1, 113, 115], "float": [0, 1, 10, 22, 46, 109, 111, 112, 113, 115, 120, 121, 123, 125, 127, 128, 130, 131, 135, 136, 139, 140, 141, 142, 147, 149, 150, 156, 234], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 234], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 233], "bright": [0, 1], "increas": [0, 1, 22, 110], "specifi": [0, 1, 5, 8, 9, 10, 11, 12, 13, 17, 19, 21, 98, 99, 158, 162, 165, 227, 228], "done": [0, 1, 52, 227], "call": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 18, 19, 20, 21, 22, 51, 94, 95, 96, 97, 98, 99, 105, 109, 110, 112, 114, 127, 148, 162, 165, 166, 228, 229, 231], "all": [0, 5, 7, 8, 9, 12, 14, 20, 22, 51, 100, 101, 102, 103, 112, 157, 159, 165, 168, 227, 228, 229, 233, 234], "darker": [0, 1, 113, 115], "decreas": [0, 1, 22, 228], "transparent": [0, 1, 113, 115], "opac": [0, 1, 136], "with_alpha": [0, 1, 113, 115], "alpha": [0, 1, 113, 115, 131, 147, 155, 156, 234], "relat": 0, "": [0, 1, 4, 5, 8, 9, 10, 13, 19, 20, 22, 48, 105, 107, 109, 113, 115, 123, 124, 127, 131, 148, 150, 152, 158, 159, 164, 165, 166, 227, 228, 229, 231, 232, 233], "set": [0, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 22, 49, 98, 100, 105, 112, 121, 148, 165, 170, 171, 228, 229, 231, 233], "friend": [0, 1, 4, 5, 7, 8, 14, 109, 110, 112, 113, 115, 117, 119, 121, 122, 124, 127, 129, 130, 134, 136, 148, 158, 159, 165, 166, 167], "struct": [0, 1, 4, 5, 7, 8, 14, 20, 21, 46, 55, 56, 61, 63, 66, 68, 69, 70, 72, 75, 80, 83, 103, 104, 105, 106, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 234], "private_api": [0, 1, 2, 4, 5, 7, 8, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 124, 125, 127, 136, 142], "properti": [0, 10, 12, 13, 14, 21, 22, 48, 98, 99, 109, 112, 113, 115, 121, 136, 138, 142, 148, 164, 170, 227, 228, 229, 231, 232, 233, 234], "bool": [0, 1, 4, 8, 10, 13, 14, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 145, 146, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 229, 234], "oper": [0, 1, 2, 6, 10, 12, 14, 16, 17, 18, 19, 20, 109, 110, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 134, 135, 136, 139, 141, 142, 144, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 227], "b": [0, 14, 40, 109, 110, 112, 113, 117, 119, 122, 124, 125, 134, 136, 138, 148, 154, 155, 158, 159, 165, 166, 167], "true": [0, 1, 4, 10, 13, 14, 21, 22, 101, 109, 110, 111, 112, 121, 125, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 167, 170], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 233], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 227, 229], "also": [0, 4, 5, 6, 7, 8, 9, 10, 14, 46, 98, 99, 158, 159, 228, 229, 231, 232], "ident": [0, 167], "fals": [0, 1, 10, 13, 21, 22, 109, 110, 111, 112, 122, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 170], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233], "what": [0, 17, 111, 136], "thei": [0, 153, 156, 157, 160], "respect": 0, "ar": [0, 10, 11, 13, 14, 16, 20, 21, 49, 51, 93, 95, 100, 101, 102, 103, 106, 109, 112, 120, 123, 148, 153, 156, 157, 159, 160, 163, 165, 167, 227, 228, 229, 231, 233, 234], "otherwis": [0, 1, 3, 13, 14, 21, 22, 99, 110, 148, 153, 158, 159, 160, 162, 165, 166, 170], "listview": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 229, 230, 232, 233], "slint_color": [1, 43, 59, 67, 77, 82, 102, 113, 136, 147, 156, 172], "repres": [1, 10, 13, 14, 20, 21, 46, 48, 153, 154, 155, 160, 161, 165, 168, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 234], "slint": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52, 53, 54, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 108, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 149, 150, 151, 152, 157, 158, 159, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 228, 229, 231, 234], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 234], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 234], "8": [1, 115, 134, 138, 142, 158, 167, 234], "bit": [1, 167, 234], "channel": 1, "red": [1, 110, 115, 131, 154, 155, 156, 167], "green": [1, 110, 115, 131, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 154, 155, 156, 167, 231, 232], "default": [1, 3, 4, 6, 7, 8, 9, 10, 17, 21, 22, 46, 54, 100, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 123, 126, 127, 129, 130, 133, 134, 135, 136, 139, 144, 148, 149, 151, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 171, 227, 228, 234], "entir": [1, 234], "rgbacolor": [1, 61, 102, 103, 115], "uint8_t": [1, 47, 49, 52, 53, 54, 109, 110, 111, 112, 115, 117, 122, 124, 127, 130, 131, 134, 135, 136, 137, 138, 140, 142, 143, 145, 146, 154, 155, 156, 167], "col": [1, 115, 131, 156], "from": [1, 3, 9, 11, 12, 13, 14, 16, 17, 18, 21, 97, 98, 99, 100, 105, 110, 112, 120, 122, 123, 127, 129, 130, 132, 133, 136, 141, 148, 156, 157, 158, 164, 165, 166, 167, 228, 229, 231, 232, 233], "given": [1, 4, 5, 7, 8, 9, 13, 16, 17, 19, 22, 110, 150, 152, 156, 157, 158, 159, 162, 165, 228], "uint32_t": [1, 16, 20, 110, 112, 115, 117, 123, 127, 135, 136, 140, 142, 148, 152, 157], "as_argb_encod": [1, 115], "encod": [1, 20, 158, 167, 234], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 234], "an": [1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 17, 18, 20, 22, 46, 47, 48, 95, 98, 105, 112, 136, 148, 154, 155, 157, 158, 161, 163, 165, 167, 168, 169, 227, 228, 229, 231, 232, 233, 234], "easi": [1, 233], "destructur": [1, 165, 166], "to_argb_float": [1, 115], "hsvacolor": [1, 61, 102, 103, 115], "to_hsva": [1, 115], "hsv": [1, 115, 147], "space": [1, 78, 102, 106, 112, 132, 136, 147], "u8": [1, 132, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "rang": [1, 56, 110, 156, 157, 159, 165], "0": [1, 6, 13, 14, 17, 21, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 152, 154, 155, 156, 167, 227, 228, 229, 231], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 234], "valu": [1, 4, 5, 7, 8, 9, 10, 13, 17, 20, 21, 22, 26, 35, 38, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 99, 102, 104, 109, 111, 112, 113, 115, 121, 122, 127, 136, 138, 140, 141, 142, 147, 148, 154, 155, 156, 159, 165, 166, 167, 170, 171, 228, 229, 233, 234], "1": [1, 13, 26, 29, 35, 38, 109, 110, 112, 113, 115, 122, 134, 135, 136, 137, 138, 142, 147, 148, 156, 163, 227, 228, 231], "The": [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 98, 99, 100, 101, 102, 103, 104, 105, 106, 113, 120, 123, 147, 148, 153, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 227, 228, 229, 231, 233, 234], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 53, 97, 227, 229], "rgb": [1, 20, 135, 148, 154], "unchang": 1, "so": [1, 7, 10, 20, 112, 136, 165, 166, 167, 168, 227, 228, 231], "exampl": [1, 5, 10, 13, 26, 29, 35, 38, 50, 53, 98, 99, 101, 105, 106, 109, 112, 148, 156, 157, 158, 227, 228, 233, 234], "2": [1, 13, 26, 29, 35, 38, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 228, 231, 232], "20": [1, 142, 227], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": 1, "3": [1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 231], "30": [1, 142], "obtain": 1, "mix": [1, 115], "other": [1, 3, 10, 12, 14, 16, 17, 18, 46, 50, 53, 96, 98, 105, 109, 110, 112, 115, 117, 120, 122, 123, 124, 125, 127, 128, 131, 132, 135, 136, 137, 138, 139, 141, 153, 157, 158, 159, 160, 165, 166, 227], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 233], "while": [1, 10, 11, 99, 227], "static": [1, 16, 22, 109, 110, 111, 112, 113, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 136, 139, 142, 148, 158, 162, 227], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 234], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 233], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233], "from_argb_float": [1, 115], "from_rgb_float": [1, 115], "from_hsva": [1, 115], "v": [1, 14, 17, 21, 109, 112, 115, 121, 125, 131], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 233], "hue": [1, 115, 147], "expect": 1, "360": [1, 147], "lineargradientbrush": [1, 113, 115, 128], "lh": [1, 110, 115, 167], "rh": [1, 110, 115, 167], "same": [1, 14, 20, 110, 148, 159, 165, 166, 229, 234], "individu": 1, "std": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 93, 95, 98, 99, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 130, 132, 142, 148, 158, 159, 162, 165, 166, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 229, 233, 234], "ostream": [1, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 115, 124, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 158], "stream": [1, 115, 124, 158], "write": [1, 158, 231], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234], "typenam": [2, 3, 4, 5, 6, 7, 8, 9, 20, 22, 109, 110, 111, 112, 114, 115, 117, 120, 121, 122, 123, 125, 127, 135, 136, 138, 143, 144, 153, 156, 157, 159, 160, 165, 229], "t": [2, 3, 13, 17, 22, 48, 109, 111, 112, 115, 120, 121, 122, 123, 125, 136, 138, 143, 144, 153, 156, 159, 160, 229, 233], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 233], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231], "share": [2, 10, 12, 148, 157, 158, 159, 227], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 233], "gener": [2, 122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 228, 231, 233, 234], "code": [2, 10, 11, 14, 98, 104, 109, 112, 148, 164, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 231, 232, 233, 234], "In": [2, 13, 15, 21, 112, 227, 232], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 234], "get": [2, 109, 112, 121, 167, 227, 233], "creat": [2, 10, 12, 13, 14, 16, 17, 19, 53, 95, 98, 99, 104, 109, 112, 115, 127, 148, 156, 158, 159, 165, 166, 228, 229, 231, 232, 233], "where": [2, 15, 163, 233], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 234], "give": 2, "you": [2, 10, 12, 13, 14, 19, 21, 26, 29, 35, 38, 98, 102, 104, 105, 107, 148, 157, 165, 166, 227, 228, 229, 231, 232, 233], "vtabl": [2, 13, 82, 109, 111, 112, 127, 135, 136, 138, 141, 142], "vrc": [2, 109, 111, 112, 127, 135, 136, 138], "itemtreevt": [2, 109, 112, 127, 136, 138], "inner": [2, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 127, 138], "intern": [2, 14, 15, 16, 20, 46, 98, 109, 125, 142, 157], "constructor": [2, 14, 16, 17, 18, 19, 109, 136, 148, 157, 158, 165, 167, 229], "arrow": 2, "implement": [2, 4, 6, 7, 8, 9, 10, 14, 15, 17, 20, 21, 105, 112, 156, 165, 166, 227, 229], "semant": 2, "derefer": [2, 158, 165, 166], "into_dyn": [2, 111, 112, 127], "weak": [3, 127], "can": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 20, 21, 22, 95, 96, 98, 102, 104, 105, 106, 112, 136, 148, 157, 159, 162, 165, 166, 168, 170, 171, 227, 228, 229, 231, 232, 233, 234], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 233], "null": [3, 13, 158, 162], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 234], "empti": [3, 9, 12, 13, 14, 112, 122, 124, 127, 136, 157, 158, 159, 165], "copi": [3, 12, 14, 17, 109, 133, 148, 157, 158, 159, 165, 166, 231], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 72, 93, 107, 109, 110, 111, 112, 117, 126, 127, 136, 148, 162, 165, 170, 171, 227, 228, 233], "strong": [3, 10, 13], "point": [3, 11, 66, 102, 103, 104, 105, 110, 119, 120, 127, 136, 139, 149, 151, 158, 159, 165, 166, 231, 233, 234], "still": [3, 13, 20, 22, 107, 112, 229], "referenc": [3, 10, 14, 19, 158, 165, 166], "ani": [3, 10, 11, 13, 16, 17, 18, 21, 22, 96, 98, 148, 227, 228, 232, 234], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 233], "modeldata": [4, 6, 7, 8, 9, 112], "act": [4, 5, 7, 8, 12, 17], "adapt": [4, 5, 7, 8, 21, 53, 227], "sourc": [4, 5, 7, 8, 112, 136, 148, 163, 228, 231, 233], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 234], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229], "e": [4, 22, 122, 227, 231], "visibl": [4, 10, 17, 21, 22, 110, 112, 116, 228], "shared_ptr": [4, 5, 7, 8, 14, 109, 112, 121, 229, 233], "source_model": [4, 5, 7, 8, 112], "filter_fn": [4, 112], "provid": [4, 5, 6, 7, 8, 10, 16, 17, 19, 20, 21, 22, 48, 53, 54, 98, 158, 165, 166, 170, 228, 229, 231, 232, 233], "limit": [4, 112, 229], "view": [4, 5, 6, 7, 8, 20, 21, 110, 112, 124, 158, 165, 166, 168, 169], "expos": [4, 5, 165, 166, 227, 229, 231], "virtual": [4, 5, 6, 7, 8, 9, 17, 19, 20, 21, 110, 112, 142], "size_t": [4, 5, 6, 7, 8, 9, 20, 109, 110, 112, 113, 119, 122, 127, 159], "row_count": [4, 5, 6, 7, 8, 9, 109, 112, 138], "overrid": [4, 5, 7, 8, 9, 21, 109, 110, 112], "amount": [4, 5, 6, 7, 8, 9, 17, 20], "row_data": [4, 5, 6, 7, 8, 9, 109, 112, 138], "data": [4, 5, 6, 7, 8, 9, 16, 109, 110, 111, 112, 113, 117, 119, 121, 124, 126, 127, 135, 136, 140, 142, 148, 157, 158, 159, 229, 232, 233, 234], "particular": [4, 5, 6, 7, 8, 9, 227], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228], "void": [4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 22, 46, 94, 95, 96, 97, 98, 100, 101, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 131, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 159, 162, 165, 229], "set_row_data": [4, 6, 7, 8, 9, 109, 112, 138], "onli": [4, 5, 6, 7, 8, 9, 13, 14, 17, 18, 20, 21, 95, 98, 101, 104, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 158, 159, 227, 228, 229], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 233], "ok": [4, 6, 7, 8, 9, 112, 133], "do": [4, 6, 7, 8, 9, 13, 17, 20, 21, 104, 110, 112, 125, 148, 168, 227, 229], "noth": [4, 6, 7, 8, 9, 17, 21, 162], "print": [4, 6, 7, 8, 9], "warn": [4, 6, 7, 8, 9, 11, 47, 109, 118, 125, 137, 163], "stderr": [4, 6, 7, 8, 9], "updat": [4, 6, 7, 8, 9, 21, 112, 165], "row_chang": [4, 6, 7, 8, 9, 109, 112], "reset": [4, 5, 6, 8, 109, 112, 133], "re": [4, 5, 8, 10, 13, 15, 17, 20, 21, 26, 29, 35, 38, 101, 105, 162, 165, 166, 227, 229], "state": [4, 5, 8, 10, 21, 53, 112, 127, 232], "extern": [4, 5, 8, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 157, 227], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 234], "unfiltered_row": [4, 112], "filtered_row": [4, 112], "index": [4, 6, 8, 9, 109, 111, 112, 122, 135, 136, 142, 159], "correspond": [4, 8, 17, 21, 46, 231], "filtermodelinn": [4, 112], "sourcemodeldata": [5, 6, 112], "mappedmodeldata": [5, 6, 112], "map": [5, 228, 229, 233], "allow": [5, 10, 54, 104, 229, 233], "transform": [5, 13, 110, 229], "fly": [5, 11], "two": [5, 20, 21, 153, 157, 160, 231], "underli": [5, 9, 14, 22, 148, 158, 159], "permit": 5, "itself": [5, 13, 158], "For": [5, 13, 26, 29, 35, 38, 46, 50, 148, 156, 158, 227, 229, 231, 232, 234], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 233], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 233, 234], "to_str": [5, 13, 14, 109], "lambda": 5, "express": [5, 46], "map_fn": [5, 112], "alter": 5, "mapmodelinn": [5, 112], "filtermodel": [6, 58, 102, 103, 112], "mapmodel": [6, 58, 102, 103, 112], "reversemodel": [6, 58, 102, 103, 112], "sortmodel": [6, 58, 102, 103, 112], "vectormodel": [6, 58, 102, 103, 112, 229], "repetit": [6, 229, 233], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 233], "languag": [6, 101, 112, 227, 229, 231, 233], "subclass": [6, 15, 21, 105, 233], "delet": [6, 10, 16, 17, 18, 19, 20, 78, 102, 106, 109, 110, 112, 114, 121, 126, 127, 132, 142, 148, 162, 165, 166], "protect": [6, 112], "notifi": [6, 49, 98, 109, 138], "specif": [6, 10, 21, 52, 232, 234], "wa": [6, 10, 13, 14, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 53, 110, 112, 127, 148, 162, 231], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 234], "were": [6, 11, 20, 21], "ad": 6, "row_remov": [6, 109, 112], "remov": [6, 9, 159], "been": [6, 21, 22, 53, 162, 165], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 233], "revers": 7, "reversemodelinn": [7, 112], "sort": [8, 112], "pair": [8, 109, 130, 165, 166], "comp": [8, 112], "unsorted_row": [8, 112], "sorted_row_index": [8, 112], "sortmodelinn": [8, 112], "sharedvector": [9, 11, 12, 14, 22, 68, 102, 103, 109, 110, 111, 112, 113, 117, 119, 122, 128, 135, 136, 138, 139, 140, 143, 145], "vector": [9, 11, 12, 14, 58, 112, 159, 163, 164, 229], "arrai": [9, 14, 46, 109, 112, 157, 229], "push_back": [9, 112, 113, 122, 159], "append": [9, 158, 159], "eras": [9, 112], "insert": [9, 78, 102, 106, 112, 132, 227], "clear": [9, 11, 112, 122, 159], "set_vector": [9, 112], "replac": [9, 229], "slint_window": [10, 43, 58, 82, 102, 112, 172], "toward": [10, 229], "system": [10, 13, 16, 17, 21, 100, 105, 148, 227, 228, 229, 232, 233], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229], "scene": [10, 19, 20, 53, 105], "It": [10, 12, 14, 17, 20, 21, 48, 51, 54, 148, 157, 158, 159, 164, 165, 166, 168, 170, 171, 227, 231, 232, 233], "api": [10, 13, 21, 42, 43, 52, 98, 103, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 227, 229, 231, 232, 233], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227], "aspect": [10, 13, 163, 227], "posit": [10, 13, 21, 22, 110, 113, 127, 128, 136, 140, 149, 151], "screen": [10, 13, 16, 20, 21, 48, 96, 100, 110, 140, 148, 168, 229], "destroi": [10, 11, 12, 14, 16, 53, 158, 159, 165, 166], "instanc": [10, 11, 12, 13, 17, 104, 109, 112, 148, 156, 158, 165, 229, 233], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 233], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231], "addit": [10, 227], "associ": [10, 13, 20, 21, 229, 231], "maintain": 10, "hide": [10, 13, 21, 109, 122, 127, 229], "make": [10, 158, 159, 162, 165, 166, 227, 233], "invis": 10, "again": [10, 21], "drop": [10, 109, 122, 136, 138, 140], "anymor": [10, 22, 96, 148], "when": [10, 11, 12, 17, 19, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 49, 51, 53, 54, 100, 101, 105, 109, 127, 148, 158, 159, 162, 165, 166, 227, 228, 229], "is_vis": [10, 127, 138], "even": [10, 51, 233], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 233, 234], "minim": [10, 21, 127, 158, 170, 231], "templat": [10, 13, 20, 22, 58, 61, 63, 66, 68, 69, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 120, 121, 122, 123, 125, 126, 127, 135, 136, 138, 143, 144, 149, 150, 151, 152, 162, 165, 229, 233], "invoc": [10, 13, 20, 22, 98, 99, 109, 111, 112, 126, 127, 148, 162], "renderingst": [10, 80, 102, 103, 127, 134, 136], "graphicsapi": [10, 80, 102, 103, 127, 134, 136], "f": [10, 13, 98, 99, 109, 112, 114, 115, 121, 126, 127, 162], "setrenderingnotifiererror": [10, 80, 102, 103, 127, 134, 136], "set_rendering_notifi": [10, 53, 127, 148], "callback": [10, 12, 13, 20, 21, 22, 53, 54, 97, 109, 110, 114, 126, 127, 136, 138, 141, 146, 148, 162, 229, 231, 233], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": 10, "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231], "success": 10, "without": [10, 46, 105, 165, 227], "error": [10, 11, 47, 49, 112, 136, 137, 163], "on_close_request": [10, 54, 127], "tri": [10, 54], "close": [10, 21, 51, 54, 100, 133, 139, 231], "closerequestrespons": [10, 80, 102, 103, 127, 134, 136], "request_redraw": [10, 21, 110, 127, 140], "issu": 10, "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 234], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 234], "includ": [10, 11, 16, 21, 42, 46, 98, 99, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 227, 228, 229, 231], "frame": [10, 20, 21], "present": [10, 21, 22, 53, 102], "set_posit": [10, 21, 110, 127, 140], "logicalposit": [10, 22, 66, 102, 103, 111, 120, 127, 136, 151, 234], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 234], "some": [10, 11, 125, 136, 231], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 227, 229, 233], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169], "size": [10, 19, 20, 21, 22, 69, 102, 103, 109, 110, 111, 112, 113, 117, 122, 123, 124, 127, 135, 136, 140, 143, 148, 150, 152, 157, 159, 168, 169, 170, 171, 227, 234], "exclud": [10, 21, 227], "set_siz": [10, 21, 110, 127, 140], "logicals": [10, 21, 22, 69, 102, 103, 110, 111, 123, 127, 136, 152, 170, 171], "resiz": [10, 21, 112, 127, 136, 170, 171], "logic": [10, 13, 21, 112, 149, 150, 228, 229, 232, 234], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 234], "scale_factor": [10, 127, 136], "scale": [10, 21, 148], "is_fullscreen": [10, 21, 108, 110, 127, 170], "current": [10, 11, 53, 142, 148], "fullscreen": [10, 21, 108, 110, 127, 170], "set_fullscreen": [10, 127], "unset": [10, 21, 170, 171], "displai": [10, 16, 20, 53, 105, 110, 140, 148, 232], "is_maxim": [10, 21, 110, 127, 170], "maxim": [10, 21, 127, 170], "set_maxim": [10, 127], "unmaxim": 10, "is_minim": [10, 21, 110, 127, 170], "set_minim": [10, 127], "unminimz": 10, "dispatch_key_press_ev": [10, 106, 127, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "sharedstr": [10, 11, 12, 13, 14, 17, 21, 22, 70, 102, 103, 106, 109, 110, 111, 112, 117, 119, 124, 125, 127, 129, 130, 135, 136, 137, 138, 139, 140, 142, 144, 145, 148, 161, 163, 164, 170, 229, 233, 234], "dispatch": 10, "kei": [10, 106, 109, 165, 166, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "press": [10, 125, 127, 136, 142], "event": [10, 13, 17, 18, 21, 50, 51, 94, 97, 98, 99, 100, 110, 119, 127, 136, 139, 140, 229, 231, 233], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233], "own": [10, 105, 110, 227, 229, 233], "backend": [10, 13, 49, 96, 105, 136, 142], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 109, 112, 127], "input": [10, 13, 21, 94, 100, 229], "unicod": 10, "represent": [10, 12, 29, 158], "dispatch_key_press_repeat_ev": [10, 127], "auto": [10, 13, 20, 22, 98, 99, 109, 110, 111, 112, 117, 121, 122, 124, 127, 129, 130, 132, 133, 158, 165, 166, 168, 227, 229, 231], "repeat": [10, 112, 126, 130, 133, 136, 146, 162], "dispatch_key_release_ev": [10, 106, 127], "releas": [10, 53, 110, 127, 136, 142, 227, 231], "dispatch_pointer_press_ev": [10, 127], "pointereventbutton": [10, 78, 102, 103, 127, 130, 132, 133, 136], "button": [10, 22, 48, 50, 127, 130, 132, 136], "mous": [10, 13, 50], "rel": [10, 11, 162, 234], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 233], "dispatch_pointer_move_ev": [10, 127], "move": [10, 14, 16, 17, 18, 109, 110, 111, 112, 114, 121, 122, 126, 127, 133, 136, 158, 159, 165, 166], "dispatch_pointer_scroll_ev": [10, 127], "delta_x": [10, 127, 130, 136], "delta_i": [10, 127, 130, 136], "scroll": 10, "wheel": [10, 127, 136], "delta": 10, "x": [10, 20, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 227, 229, 231, 232, 234], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 234], "direct": [10, 14, 21], "dispatch_resize_ev": [10, 21, 127], "after": [10, 11, 20, 21, 97, 162], "send": [10, 17, 21], "ensur": [10, 16, 227], "width": [10, 20, 21, 110, 111, 112, 117, 123, 127, 130, 135, 136, 142, 148, 157, 160, 231, 232], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172], "right": [10, 20, 50, 117, 132, 133, 135, 148], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165], "creation": 10, "dispatch_window_active_changed_ev": [10, 127], "activ": [10, 109, 127, 162], "de": [10, 13, 14, 165, 166, 229], "gain": 10, "focu": 10, "lose": 10, "dispatch_close_requested_ev": [10, 21, 127], "effect": 10, "depend": [10, 112, 141, 227], "has_active_anim": [10, 21, 127], "anim": [10, 21, 94, 121], "interpret": [11, 12, 13, 14, 43, 46, 47, 64, 83, 102, 103, 115, 118, 137, 138, 163, 164, 165, 166, 172], "entri": [11, 103, 104, 105, 165, 166, 233], "load": [11, 102, 103, 104, 148, 228, 233], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 227, 231], "up": [11, 20, 98, 133, 228, 231, 233], "import": [11, 105, 148, 228], "set_styl": [11, 109], "string_view": [11, 12, 13, 22, 57, 59, 63, 65, 67, 70, 109, 111, 113, 117, 119, 121, 124, 158, 165, 166, 234], "style": [11, 109, 138], "widget": [11, 48], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 233, 234], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228], "diagnost": [11, 47, 83, 102, 104, 109, 112, 137, 138], "produc": [11, 165], "build_from_path": [11, 12, 104, 109], "componentdefinit": [11, 13, 55, 102, 104, 109, 164, 233], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": 11, "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 234], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 233], "And": 12, "instanti": [12, 229, 233], "factori": [12, 17], "ve": [12, 229], "finish": [12, 99], "safe": [12, 98, 158], "assign": [12, 14, 148, 158, 159, 165, 166], "componentinst": [12, 55, 102, 104, 109, 138, 233], "propertydescriptor": [12, 83, 102, 104, 109, 137, 138], "describ": [12, 20, 21, 47, 48, 49, 50, 52, 53, 54, 148, 163, 164, 170, 171, 232], "list": [12, 48, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 172], "read": [12, 99, 112, 165, 227, 231], "written": [12, 165, 232], "set_properti": [12, 13, 109, 228], "get_properti": [12, 13, 109], "set_callback": [12, 13, 109], "global": [12, 13, 101, 109, 138, 227, 228, 233], "export": [12, 13, 22, 229, 231, 232, 233, 234], "singleton": [12, 13, 233], "global_properti": [12, 109], "global_nam": [12, 109, 138], "descriptor": 12, "publicli": 12, "exist": [12, 13, 15, 22, 112, 148, 157, 158, 165, 227, 228], "under": [12, 158], "global_callback": [12, 109], "global_funct": [12, 109], "privat": [13, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 139, 228, 229, 231], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 233], "put": [13, 228], "mark": [13, 231], "window": [13, 16, 17, 19, 20, 21, 49, 51, 53, 54, 73, 95, 96, 100, 102, 103, 105, 106, 109, 110, 112, 125, 127, 140, 148, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 231, 232, 234], "shown": [13, 21, 54, 98, 170, 233], "react": [13, 100, 229, 233], "draw": [13, 148], "touch": 13, "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231], "run_event_loop": [13, 17, 51, 58, 97, 102, 103, 109, 110, 112, 140, 229], "receiv": [13, 21, 98, 100], "further": [13, 229], "integr": [13, 103, 157, 227, 232, 233], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231], "world": [13, 231, 232], "correctli": 13, "could": [13, 227], "becaus": [13, 110, 122, 148, 231], "proper": 13, "behind": 13, "span": [13, 20, 58, 63, 109, 110, 112, 117, 136], "arg": [13, 109, 114, 122, 136, 138, 141, 159, 165, 229], "imagin": 13, "contain": [13, 14, 20, 21, 46, 106, 125, 133, 157, 158, 159, 170, 228, 229, 231, 233], "foo": [13, 14, 22, 109, 234], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136], "match": [13, 22, 112, 227], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 233], "did": 13, "handler": [13, 94, 229], "functor": [13, 98, 99, 112, 229], "take": [13, 109, 148, 228, 229], "slice": [13, 109, 111, 112, 117, 122, 124, 135, 136, 138, 140, 144, 145, 148], "cout": 13, "to_numb": [13, 14, 109], "n": [13, 112, 124, 125, 136, 144, 158], "sinc": [13, 17, 20, 227], "captur": 13, "set_global_properti": [13, 109, 233], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 233], "set_global_callback": [13, 109, 233], "preview": [13, 22, 232], "pure": 13, "to_uppercas": [13, 229], "arg1": 13, "begin": [13, 20, 109, 110, 112, 113, 117, 122, 124, 133, 136, 148, 157, 158, 159, 165, 166, 229], "end": [13, 20, 78, 102, 106, 109, 110, 112, 113, 117, 122, 124, 132, 133, 136, 157, 158, 159, 165, 166, 227, 229], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 233], "type": [14, 18, 22, 46, 50, 54, 102, 103, 104, 105, 109, 113, 115, 117, 119, 120, 123, 125, 128, 131, 135, 136, 139, 148, 157, 158, 164, 166, 169, 171, 229, 233], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 233], "queri": [14, 21, 22], "c": [14, 17, 20, 103, 112, 127, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 165, 166, 168, 227, 228, 229, 231, 233, 234], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 234], "liter": 14, "bar": [14, 22, 48, 234], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 232], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166], "valuetyp": [14, 83, 102, 104, 109, 137, 138, 164], "alia": [14, 133, 231], "enum": [14, 17, 20, 110, 112, 117, 128, 130, 132, 133, 134, 135, 136, 137, 139, 146, 148, 172], "to_bool": [14, 109], "to_arrai": [14, 109], "serial": 14, "brush": [14, 21, 46, 59, 102, 103, 109, 110, 113, 115, 121, 128, 136, 137, 138, 140, 141, 142, 170, 234], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 227, 228, 234], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 227], "struc": [14, 109, 138], "img": [14, 109, 117, 138], "variant": [14, 20, 46], "vale": 14, "skiarender": [15, 21, 56, 102, 105, 110, 127], "softwarerender": [15, 21, 56, 102, 105, 110, 127, 169], "interfac": [15, 105, 227, 229, 232, 233], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": 15, "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233], "opaqu": [16, 109, 112, 124], "low": [16, 52], "level": [16, 52, 137, 163], "exchang": [16, 110], "messag": [16, 21, 98, 99, 112, 137, 163], "connect": [16, 110, 140], "server": 16, "kind": [16, 109, 130, 136, 233], "ownership": [16, 109, 110], "caller": 16, "respons": [16, 148], "suppli": [16, 229], "valid": [16, 22, 112, 136, 148, 158], "throughout": 16, "lifetim": 16, "from_x11_xcb": [16, 110], "visual_id": [16, 110, 140], "xcb_connection_t": [16, 110], "xcb_window_t": [16, 110], "xcb_visualid_t": [16, 110], "xcb": 16, "from_x11_xlib": [16, 110], "unsign": [16, 109, 110, 111, 117, 124, 125, 140, 142, 148], "long": [16, 22, 110, 112, 140, 158, 229, 233], "xlib": 16, "visualid": [16, 110], "from_wayland": [16, 110], "wl_surfac": [16, 110], "surfac": [16, 110, 140], "wl_displai": [16, 110], "from_appkit": [16, 110], "nsview": [16, 110], "nswindow": [16, 110], "from_win32": [16, 110], "hwnd": [16, 21, 110, 140], "hinstanc": [16, 110], "task": [17, 56, 102, 105, 110], "set_platform": [17, 56, 102, 105, 110], "befor": [17, 21, 94, 95, 96, 165, 166], "subsequ": 17, "create_window_adapt": [17, 21, 110], "clipboard": [17, 110, 136, 140], "clipboard_text": [17, 110, 140], "set_clipboard_text": [17, 110, 140], "enumer": [17, 20, 46, 47, 48, 49, 50, 51, 52, 53, 54, 148], "defaultclipboard": [17, 110, 136], "action": [17, 22, 54, 111, 133, 136], "ctrl": 17, "secondari": 17, "x11": [17, 227], "selectionclipboard": [17, 110, 136], "primari": [17, 103, 142, 233], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 234], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 126, 162], "quit_event_loop": [17, 51, 58, 102, 103, 110, 112, 140], "thread": [17, 18, 98, 99, 127], "enter": [17, 100], "run_in_event_loop": [17, 18, 110], "invoke_from_event_loop": [17, 58, 99, 102, 103, 112, 127, 140], "pass": [17, 18, 20, 21, 97, 148, 158, 159, 227, 228], "reimplement": [17, 21], "longer": [17, 18], "onc": [17, 18, 95, 97, 98, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 231, 233], "abstractrender": [19, 20, 21, 56, 102, 105, 110], "skia": 19, "nativ": [19, 21, 232], "non": [19, 46, 106], "zero": 19, "explicit": [19, 20, 21, 109, 110, 111, 117, 120, 121, 122, 123, 124, 127, 142, 149, 150, 151, 152, 159, 167], "nativewindowhandl": [19, 56, 102, 105, 110], "window_handl": [19, 110, 112, 125, 127, 136], "initial_s": [19, 110], "windowhandl": 19, "physicalregion": [20, 56, 102, 105, 110, 136, 140], "rect": [20, 56, 102, 105, 110, 111, 112, 135, 136, 168], "softwar": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228], "To": [20, 107, 227, 233], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157], "repaintbuffertyp": [20, 110], "part": [20, 158], "speed": [20, 228], "paint": 20, "newbuff": [20, 110], "full": 20, "redrawn": 20, "No": [20, 133], "attempt": 20, "partial": [20, 168], "made": [20, 159, 228], "reusedbuff": [20, 110], "assum": [20, 98, 148, 158, 228, 229], "everi": [20, 162, 229], "swappedbuff": [20, 110], "drawn": [20, 148], "swap": [20, 53, 110, 121, 122, 124], "renderingrot": [20, 110], "rotat": [20, 110, 112, 136, 140], "set_rendering_rot": [20, 110], "norot": [20, 110], "rotate90": [20, 110], "90": [20, 110, 142], "left": [20, 21, 50, 117, 132, 133, 135, 148, 170, 171], "rotate180": [20, 110], "180": [20, 110, 142], "upsid": 20, "down": [20, 133], "rotate270": [20, 110], "buffer_typ": [20, 110], "strategi": 20, "rgb8pixel": [20, 80, 102, 103, 110, 117, 134, 135, 140, 148, 167], "pixel_strid": [20, 110, 140], "least": [20, 158, 227, 229, 233], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232], "rgb565pixel": [20, 56, 102, 105, 110], "565": 20, "render_by_lin": [20, 110], "process_line_callback": [20, 110], "cach": [20, 112, 227, 228], "dirti": [20, 112, 141], "region": [20, 140, 168], "consid": [20, 157], "signatur": 20, "render_fn": [20, 110], "third": 20, "fourth": [20, 50], "free": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 140, 158], "flush": 20, "typic": [20, 21, 50, 105, 148, 163, 165, 166], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 233], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168], "bounding_box_origin": [20, 110, 168], "origin": [20, 110, 112, 117, 135, 148, 149, 151, 168, 169], "overlap": [20, 168], "over": [20, 165, 168, 169], "someth": [20, 22, 46, 168, 229], "member": [20, 21, 108, 136, 147, 153, 154, 155, 156, 160, 161, 163, 164, 167, 168, 169, 170, 171, 229, 234], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231], "being": [21, 115, 148], "etc": [21, 22, 233], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": 21, "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38], "fulfil": 21, "method": [21, 148, 162], "mywindowadapt": 21, "m_render": 21, "nativehandl": 21, "m_native_window": 21, "refresh": 21, "els": [21, 109, 110, 111, 112, 116, 117, 122, 125, 127], "repaint_callback": 21, "asynchron": 21, "would": [21, 110, 122, 227], "update_timers_and_anim": [21, 56, 102, 105, 110], "schedul": [21, 97], "next": [21, 93, 109, 162, 165, 166, 227, 231, 232], "good": 21, "initialis": [21, 228], "detect": [21, 165, 227], "repaint": 21, "manag": 21, "instead": [21, 108, 162, 170, 227, 231, 233], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 233], "propag": 21, "titl": [21, 110, 130, 136, 142, 170], "layout": [21, 110, 112, 135, 136, 148, 170, 171], "constraint": [21, 53, 136, 170, 171], "case": [21, 112, 113, 128, 135, 139, 148, 231, 234], "getter": [21, 170, 229, 233], "background": [21, 110, 136, 142, 170], "deprec": [21, 102, 110, 112, 170, 172], "layout_constraint": [21, 110, 170, 171], "min": [21, 110, 112, 136, 140, 170, 171], "minimum": [21, 22, 142, 170, 171], "abl": [21, 170, 171], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 233], "max": [21, 110, 112, 136, 140, 170, 171], "maximum": [21, 22, 142, 170, 171], "larger": [21, 170, 171], "prefer": [21, 110, 112, 136, 140, 170, 171, 231], "test": [22, 43, 48, 71, 78, 102, 103, 109, 125, 132, 133, 172], "purpos": [22, 112, 229], "is_valid": [22, 111], "id": [22, 111, 126, 136, 146, 148], "qualifi": 22, "none": [22, 48, 50, 119, 132, 133, 139, 227], "consist": 22, "surround": 22, "well": [22, 158, 165, 166], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163], "checkbox": [22, 48, 132], "accessible_label": [22, 111], "label": [22, 111, 136, 145, 231], "accessible_valu": [22, 111], "accessible_placeholder_text": [22, 111], "placehold": 22, "accessible_descript": [22, 111], "descript": [22, 102, 111, 136, 163, 227], "accessible_value_maximum": [22, 111], "accessible_value_minimum": [22, 111], "accessible_value_step": [22, 111], "step": [22, 227, 231], "accessible_check": [22, 111], "checkabl": [22, 111, 136, 142], "set_accessible_valu": [22, 111], "invoke_accessible_increment_act": [22, 111], "increment": [22, 111, 136], "invoke_accessible_decrement_act": [22, 111], "decrement": [22, 111, 136], "invoke_accessible_default_act": [22, 111], "absolute_posit": [22, 111], "absolut": [22, 228], "visitor": [22, 111, 112, 136, 145], "r": [22, 109, 110, 111, 112, 114, 121, 129, 130, 132, 133, 134, 140, 142, 154, 155, 167], "invoke_result_t": [22, 99, 109, 111, 112, 121, 127], "visit_el": [22, 111], "visit": [22, 112, 165], "continu": [22, 112, 229], "until": [22, 51, 93, 99, 109, 162, 165, 231], "convers": [22, 148, 158], "never": [22, 162], "convertt": 22, "eh": 22, "make_opt": 22, "find_by_accessible_label": [22, 111], "find": [22, 112, 227], "find_by_element_id": [22, 111], "element_id": [22, 111, 145], "find_by_element_type_nam": [22, 111], "slint_generated_publ": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 49, 52, 53, 54, 63, 70, 82, 102, 117, 136, 154, 155, 172], "macro": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 227], "flag": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 233], "expand": [26, 29, 35, 38, 120, 123], "numer": [26, 35, 38], "patch": [26, 112], "against": [26, 29, 35, 38, 148, 227], "minor": [35, 112], "major": [38, 112], "slint_tests_help": [40, 43, 57, 102, 172], "home": [41, 42, 43, 78, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 132, 172], "runner": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 172], "work": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 172, 227, 231], "cpp": [41, 43, 105, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 172, 227, 228, 231], "parent": [42, 43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 112, 127, 136, 231, 232], "slint_callback": [43, 82, 87, 102, 136, 172], "slint_config": [43, 82, 102, 136, 172], "slint_imag": [43, 68, 69, 70, 80, 81, 82, 102, 136, 148, 157, 172], "slint_interpret": [43, 55, 102, 172], "slint_pathdata": [43, 82, 85, 102, 136, 172], "slint_point": [43, 58, 82, 102, 112, 136, 149, 151, 153, 172], "slint_properti": [43, 61, 76, 82, 87, 102, 115, 136, 172], "slint_sharedvector": [43, 58, 63, 82, 89, 102, 117, 136, 159, 172], "slint_siz": [43, 58, 63, 102, 112, 117, 150, 152, 160, 172], "slint_str": [43, 59, 63, 80, 82, 90, 102, 113, 117, 134, 136, 158, 172], "slint_tim": [43, 82, 92, 102, 136, 162, 172], "generated_includ": [44, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [45, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "slint_brush_intern": [45, 59, 79, 102, 113, 172], "slint_builtin_struct": [45, 76, 102, 130, 161, 172], "slint_builtin_structs_intern": [45, 67, 75, 79, 82, 102, 121, 136, 172], "slint_color_intern": [45, 61, 79, 102, 115, 172], "slint_enum": [45, 48, 50, 79, 102, 133, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_enums_intern": [45, 74, 76, 77, 78, 81, 82, 85, 102, 128, 130, 131, 135, 136, 139, 172], "slint_image_intern": [45, 63, 79, 86, 102, 117, 140, 172], "slint_intern": [45, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 70, 72, 73, 76, 79, 80, 84, 86, 88, 102, 112, 127, 138, 140, 142, 172], "slint_interpreter_generated_publ": [45, 46, 47, 84, 102, 138, 163, 164, 172], "slint_interpreter_intern": [45, 55, 82, 83, 102, 109, 172], "slint_pathdata_intern": [45, 65, 79, 102, 119, 172], "slint_platform_intern": [45, 58, 81, 82, 102, 112, 172], "slint_properties_intern": [45, 60, 67, 102, 114, 121, 172], "slint_qt_intern": [45, 58, 82, 102, 112, 172], "slint_sharedvector_intern": [45, 68, 102, 122, 172], "slint_string_intern": [45, 70, 102, 124, 172], "slint_testing_intern": [45, 57, 102, 111, 172], "slint_timer_intern": [45, 72, 102, 126, 172], "class": [46, 47, 48, 49, 50, 51, 52, 53, 54, 109, 110, 111, 112, 113, 115, 117, 122, 127, 128, 130, 132, 133, 134, 135, 136, 137, 139, 141, 146, 148, 158, 159, 165, 166, 168, 170, 172, 228, 229, 231, 233, 234], "int8_t": [46, 137], "unit": [46, 234], "length": [46, 228, 234], "angl": [46, 113, 234], "solidcolor": [46, 113, 128], "sever": 47, "belong": 47, "context": [48, 53, 112, 136, 148], "assist": 48, "technologi": 48, "reader": 48, "isn": 48, "behav": 48, "combobox": [48, 132, 142], "slider": [48, 132], "spinbox": [48, 132], "tab": [48, 78, 102, 106, 132], "tablist": [48, 132], "similar": [48, 159, 228, 229, 233], "automat": [48, 158, 233, 234], "tabl": [48, 132, 234], "tree": [48, 105, 132], "treeview": 48, "Not": [48, 122], "yet": [48, 53, 107, 122, 162, 165], "progressind": [48, 132], "textinput": [48, 132, 136], "edit": [48, 136, 142, 229, 232], "switch": [48, 113, 128, 132, 135, 139], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227], "pencil": 50, "middl": [50, 132], "mani": [50, 112], "center": [50, 133], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 233], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "item": [53, 111, 112, 127, 136, 142, 145, 161], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": 53, "whether": [54, 110, 227], "hidewindow": [54, 134], "keepwindowshown": [54, 134], "reject": [54, 133], "kept": 54, "directori": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 227, 228], "program": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 172, 227, 228, 231], "cassert": [56, 110], "cstdint": [56, 62, 66, 69, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 110, 116, 120, 123, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "util": [56, 110, 227], "duration_until_next_timer_upd": [56, 102, 105, 110], "type_trait": [57, 111], "elementhandl": [57, 102, 107, 111, 145], "init": [57, 102, 107, 111, 112, 121, 136], "algorithm": [58, 68, 112, 122], "concept": [58, 112], "memori": [58, 67, 68, 112, 121, 122, 148, 158, 231, 233], "componentweakhandl": [58, 98, 102, 103, 112], "eventloopmod": [58, 100, 102, 103, 112], "blocking_invoke_from_event_loop": [58, 98, 102, 103, 112], "update_all_transl": [58, 102, 103, 112], "tupl": [60, 112, 114, 130, 234], "stdint": [61, 115], "sharedpixelbuff": [63, 102, 103, 117, 135, 148], "initializer_list": [65, 68, 109, 119, 122, 159, 165], "atom": [68, 122], "iostream": [71, 125, 127], "assert_eq": [71, 102, 125], "timer": [72, 93, 94, 102, 103, 126], "cstdarg": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "cstdlib": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "standardlistviewitem": [75, 102, 103, 129, 130, 142], "key_cod": [78, 102, 105, 132], "alt": [78, 102, 106, 130, 132], "altgr": [78, 102, 106, 132], "backspac": [78, 102, 106, 132], "backtab": [78, 102, 106, 132], "capslock": [78, 102, 106, 132], "controlr": [78, 102, 106, 132], "downarrow": [78, 102, 106, 132], "escap": [78, 102, 106, 132], "f1": [78, 102, 106, 132], "f10": [78, 102, 106, 132], "f11": [78, 102, 106, 132], "f12": [78, 102, 106, 132], "f13": [78, 102, 106, 132], "f14": [78, 102, 106, 132], "f15": [78, 102, 106, 132], "f16": [78, 102, 106, 132], "f17": [78, 102, 106, 132], "f18": [78, 102, 106, 132], "f19": [78, 102, 106, 132], "f2": [78, 102, 106, 132], "f20": [78, 102, 106, 132], "f21": [78, 102, 106, 132], "f22": [78, 102, 106, 132], "f23": [78, 102, 106, 132], "f24": [78, 102, 106, 132], "f3": [78, 102, 106, 132], "f4": [78, 102, 106, 132], "f5": [78, 102, 106, 132], "f6": [78, 102, 106, 132], "f7": [78, 102, 106, 132], "f8": [78, 102, 106, 132], "f9": [78, 102, 106, 132], "leftarrow": [78, 102, 106, 132], "menu": [78, 102, 106, 132], "meta": [78, 102, 106, 130, 132], "metar": [78, 102, 106, 132], "pagedown": [78, 102, 106, 132], "pageup": [78, 102, 106, 132], "paus": [78, 102, 106, 132], "rightarrow": [78, 102, 106, 132], "scrolllock": [78, 102, 106, 132], "shift": [78, 102, 106, 130, 132, 167], "shiftr": [78, 102, 106, 132], "sysreq": [78, 102, 106, 132], "uparrow": [78, 102, 106, 132], "rgba8pixel": [80, 102, 103, 117, 134, 135, 148], "slint_feature_access": [80, 102, 134], "slint_feature_backend_linuxkm": [80, 102, 134], "slint_feature_backend_qt": [80, 102, 109, 134], "slint_feature_backend_winit": [80, 102, 134, 227], "slint_feature_experiment": [80, 102, 107, 110, 111, 134], "slint_feature_gettext": [80, 101, 102, 112, 134], "slint_feature_interpret": [80, 102, 109, 134], "slint_feature_renderer_femtovg": [80, 102, 134, 227], "slint_feature_renderer_skia": [80, 102, 110, 134, 227], "slint_feature_renderer_softwar": [80, 102, 110, 134], "slint_feature_system_test": [80, 102, 134], "slint_feature_test": [80, 102, 107, 111, 134], "slint_version_major": [80, 102, 134], "slint_version_minor": [80, 102, 134], "slint_version_patch": [80, 102, 134], "slint_version_str": [80, 102, 134], "diagnosticlevel": [83, 102, 104, 137, 163], "durat": [93, 126, 136, 146, 148, 162, 234], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": 96, "appear": 96, "termin": [97, 158], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232], "immedi": 97, "add": [98, 122, 165, 227], "queue": 98, "wake": 98, "woken": 98, "queu": 98, "statu": [98, 110], "network": 98, "my_application_ui": [98, 99, 231], "argc": [98, 99, 231], "char": [98, 99, 109, 111, 112, 115, 124, 125, 136, 144, 148, 158, 231, 234], "argv": [98, 99, 231], "networkstatusui": 98, "set_status_label": [98, 99], "weak_ui_handl": 98, "network_thread": 98, "read_message_blocking_from_network": 98, "see": [98, 103, 112, 157, 227], "block": [98, 99], "just": [99, 109, 112], "But": 99, "execut": [99, 227], "deadlock": 99, "forev": 99, "anoth": [99, 105, 148], "myapplicationui": 99, "worker_thread": 99, "get_messag": 99, "By": [100, 172, 227, 228], "forc": 101, "tr": 101, "evalu": [101, 121], "my_ui": 101, "languageset": 101, "on_french_select": 101, "setenv": 101, "lang": 101, "l": [101, 112], "section": [102, 227, 229, 231, 232, 233], "header": [102, 118, 229, 231], "choos": [102, 227], "slintnamespac": 102, "interpreterstruct": 102, "diagnosticstruct": 102, "propertydescriptorstruct": 102, "structstruct": 102, "iteratorclass": 102, "componentcompilerclass": 102, "componentdefinitionclass": 102, "componentinstanceclass": 102, "valueenum": 102, "diagnosticlevelenum": 102, "valuetypenamespac": 102, "platformstruct": 102, "rgb565pixelclass": 102, "abstractrendererclass": 102, "nativewindowhandleclass": 102, "platformclass": 102, "taskclass": 102, "skiarendererclass": 102, "softwarerendererstruct": 102, "physicalregionstruct": 102, "rectclass": 102, "windowadapterstruct": 102, "windowpropertiesstruct": 102, "layoutconstraintsnamespac": 102, "testingclass": 102, "elementhandleenum": 102, "accessiblerolestruct": 102, "hsvacolorstruct": 102, "imagestruct": 102, "logicalpositionstruct": 102, "logicalsizestruct": 102, "physicalpositionstruct": 102, "physicalsizetempl": 102, "pointstruct": 102, "rgb8pixeltempl": 102, "sharedpixelbufferstruct": 102, "sharedstringtempl": 102, "sharedvectortempl": 102, "sizestruct": 102, "standardlistviewitemstruct": 102, "timerclass": 102, "brushclass": 102, "colortempl": 102, "componenthandletempl": 102, "componentweakhandletempl": 102, "filtermodeltempl": 102, "mapmodeltempl": 102, "modeltempl": 102, "reversemodeltempl": 102, "sortmodeltempl": 102, "vectormodelclass": 102, "windowenum": 102, "closerequestresponseenum": 102, "graphicsapienum": 102, "pointereventbuttonenum": 102, "renderingstateenum": 102, "setrenderingnotifiererrorstruct": 102, "rgba8pixeltempl": 102, "rgbacolorenum": 102, "apidirectori": 102, "cppdirectori": 102, "includefil": 102, "hfile": 102, "hdirectori": 102, "cppdocsdirectori": 102, "generated_includefil": 102, "detail": [102, 232], "document": [102, 103, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": 103, "design": [103, 232, 234], "its": [104, 157, 163], "pre": [104, 227, 228], "normal": [104, 156], "wai": [104, 148, 227, 228, 232, 233], "come": [105, 227, 232, 233], "built": [105, 227, 231, 233], "modul": [105, 107, 227], "interact": [105, 136, 227, 232, 233], "environ": 105, "microcontrol": 105, "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": [105, 231], "http": [105, 112, 227, 231], "github": [105, 227, 231], "com": [105, 112, 227, 231], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": 105, "idf": 105, "src": [105, 129, 130, 132, 133], "constant": [106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "special": [106, 112, 156], "printabl": 106, "experiment": [107, 227], "subject": 107, "stabil": 107, "ON": [107, 227], "cmake": [107, 227, 231, 232, 233], "page": 108, "copyright": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "sixtyfp": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "gmbh": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "info": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "dev": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "spdx": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "licens": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "identifi": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234], "gpl": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "OR": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "licenseref": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "royalti": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "pragma": [109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "ifndef": [109, 110, 112, 127], "ifdef": [109, 110, 111, 112], "endif": [109, 110, 111, 112, 115, 116, 117, 122, 127, 135, 138, 139, 227, 231], "namespac": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 228, 233], "cbindgen_priv": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146], "stai": 109, "eraseditemtreebox": [109, 138], "slint_interpreter_struct_new": [109, 138], "slint_interpreter_struct_clon": [109, 138], "slint_interpreter_struct_destructor": [109, 138], "inputiter": [109, 165], "doxygen": [109, 110, 112, 115, 116, 117, 122, 127], "understand": 109, "wizardri": 109, "enable_if_t": [109, 121], "is_convert": 109, "decltyp": [109, 112, 121], "declval": 109, "set_field": [109, 165], "fixm": [109, 112, 115], "probabl": 109, "miss": 109, "lot": 109, "value_typ": [109, 165, 166], "structiteratoropaqu": [109, 138], "k": [109, 138], "believ": 109, "suppos": [109, 231], "slint_interpreter_struct_make_it": [109, 138], "get_field": [109, 165], "structopaqu": [109, 138], "slint_interpreter_value_new": [109, 138], "slint_interpreter_value_clon": [109, 138], "slint_interpreter_value_destructor": [109, 138], "to_int": 109, "to_float": 109, "slint_interpreter_value_to_numb": [109, 138], "slint_interpreter_value_to_str": [109, 138], "slint_interpreter_value_to_bool": [109, 138], "slint_interpreter_value_to_brush": [109, 138], "opaque_struct": 109, "slint_interpreter_value_to_struct": [109, 138], "slint_interpreter_value_to_imag": [109, 138], "reinterpret_cast": [109, 110, 111, 112, 114, 117, 121, 122, 124, 126, 127, 144], "slint_interpreter_value_new_doubl": [109, 138], "static_cast": [109, 110, 112, 148], "slint_interpreter_value_new_str": [109, 138], "slint_interpreter_value_new_bool": [109, 138], "slint_interpreter_value_new_brush": [109, 138], "slint_interpreter_value_new_struct": [109, 138], "slint_interpreter_value_new_imag": [109, 138], "slint_interpreter_value_typ": [109, 138], "slint_interpreter_value_eq": [109, 138], "avoid": [109, 115, 125], "turn": [109, 227], "slint_interpreter_value_new_array_model": [109, 138], "slint_interpreter_value_to_arrai": [109, 138], "modeladaptorvt": [109, 138], "vref": [109, 112, 127, 135, 136, 138], "modelwrapp": 109, "modelchangelisten": [109, 112], "modelnotifyopaqu": [109, 138], "rust": [109, 110, 112], "slint_interpreter_model_notify_destructor": [109, 138], "slint_interpreter_model_notify_row_ad": [109, 138], "slint_interpreter_model_notify_row_chang": [109, 138], "slint_interpreter_model_notify_row_remov": [109, 138], "slint_interpreter_model_notify_reset": [109, 138], "wrapper": 109, "make_shar": [109, 112, 121], "slint_interpreter_model_notify_new": [109, 138], "attach_p": [109, 112], "uintptr_t": [109, 110, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 163], "has_valu": [109, 110, 111, 112], "rval": 109, "get_notifi": [109, 138], "vrefmut": [109, 112, 135, 136, 138], "vt": 109, "slint_interpreter_value_new_model": [109, 138], "name_view": 109, "const_cast": [109, 111, 112, 117, 121, 122, 124, 127, 144], "field_val": 109, "slint_interpreter_struct_get_field": [109, 138], "slint_interpreter_struct_set_field": [109, 138], "name_slic": 109, "nextval_inn": 109, "slint_interpreter_struct_iterator_next": [109, 138], "ptr": [109, 112, 122, 135, 136, 143, 144], "len": [109, 112, 122, 127, 136, 144], "slint_interpreter_struct_iterator_destructor": [109, 138], "fact": 109, "assert_main_thread": [109, 110, 112, 127], "slint_interpreter_component_instance_show": [109, 138], "windowadapterrcopaqu": [109, 110, 112, 127, 136, 138, 140], "win_ptr": 109, "slint_interpreter_component_instance_window": [109, 138], "wid": 109, "slint_qt_get_widget": [109, 142], "windowadapterrc": [109, 127, 136, 142], "slint_interpreter_component_instance_set_properti": [109, 138], "string_to_slic": [109, 124], "prop_inn": 109, "slint_interpreter_component_instance_get_properti": [109, 138], "args_view": 109, "rval_inn": 109, "slint_interpreter_component_instance_invok": [109, 138], "is_convertible_v": [109, 127], "actual_cb": [109, 127], "slint_interpreter_component_instance_set_callback": [109, 138], "slint_interpreter_component_instance_set_global_properti": [109, 138], "slint_interpreter_component_instance_get_global_properti": [109, 138], "slint_interpreter_component_instance_set_global_callback": [109, 138], "slint_interpreter_component_instance_invoke_glob": [109, 138], "componentdefinitionopaqu": [109, 138], "slint_interpreter_component_definition_clon": [109, 138], "slint_interpreter_component_definition_destructor": [109, 138], "union": [109, 111, 128, 135, 136, 139], "ci": 109, "u": [109, 110, 112, 136], "slint_interpreter_component_instance_cr": [109, 138], "prop": [109, 138], "slint_interpreter_component_definition_properti": [109, 138], "slint_interpreter_component_definition_callback": [109, 138], "slint_interpreter_component_definition_funct": [109, 138], "slint_interpreter_component_definition_nam": [109, 138], "slint_interpreter_component_definition_glob": [109, 138], "slint_interpreter_component_definition_global_properti": [109, 138], "slint_interpreter_component_definition_global_callback": [109, 138], "slint_interpreter_component_definition_global_funct": [109, 138], "slint_interpreter_component_instance_component_definit": [109, 138], "componentcompileropaqu": [109, 138], "slint_interpreter_component_compiler_new": [109, 138], "slint_interpreter_component_compiler_destructor": [109, 138], "slint_interpreter_component_compiler_set_include_path": [109, 138], "slint_interpreter_component_compiler_set_styl": [109, 138], "slint_interpreter_component_compiler_get_styl": [109, 138], "slint_interpreter_component_compiler_set_translation_domain": [109, 138], "slint_interpreter_component_compiler_get_include_path": [109, 138], "slint_interpreter_component_compiler_get_diagnost": [109, 138], "slint_interpreter_component_compiler_build_from_sourc": [109, 138], "slint_interpreter_component_compiler_build_from_path": [109, 138], "send_keyboard_string_sequ": [109, 125, 136], "__apple__": [110, 112], "_win32": [110, 112, 116], "_win64": [110, 112, 116], "__objc__": 110, "typedef": [110, 165, 166], "objc_object": 110, "rendererptr": [110, 140], "renderer_handl": 110, "was_initi": 110, "slint_window_adapter_new": [110, 140], "intsiz": [110, 135, 136, 140], "p": [110, 112, 120, 127, 140, 149, 151], "point2d": [110, 120, 136, 140], "int32_t": [110, 120, 121, 130, 135, 136, 140, 141, 142, 151], "out": [110, 131, 136, 138, 139, 140, 141, 144, 145, 159, 229, 232], "slint_window_properties_get_titl": [110, 140], "slint_window_properties_get_background": [110, 140], "renam": [110, 118], "slint_window_properties_get_fullscreen": [110, 140], "slint_window_properties_get_minim": [110, 140], "slint_window_properties_get_maxim": [110, 140], "lc": 110, "slint_window_properties_get_layout_constraint": [110, 140], "has_min": [110, 140], "has_max": [110, 140], "abort": [110, 112, 125, 127, 133], "platformtaskopaqu": [110, 140], "_0": [110, 112, 113, 121, 127, 128, 135, 136, 138, 139, 140, 141], "slint_platform_task_drop": [110, 140], "assert": 110, "form": [110, 229, 233], "slint_platform_task_run": [110, 140], "slint_platform_regist": [110, 140], "w": [110, 112], "maybe_unus": [110, 112], "uint64_t": [110, 112, 121, 125, 126, 130, 135, 136, 138, 140, 141, 146], "out_text": 110, "maybe_clipboard": 110, "uint16_t": [110, 135, 136, 140, 167], "g": [110, 134, 154, 155, 167, 227], "6": [110, 135, 138, 142, 167, 227], "constexpr": [110, 111, 112, 123, 125, 132, 136, 142, 144, 150, 152, 167, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "4": [110, 112, 135, 136, 138, 142], "mutabl": [110, 112, 121], "softwarerendereropaqu": [110, 140], "slint_software_renderer_handl": [110, 140], "intrect": [110, 135, 136, 140], "slint_software_renderer_region_to_rect": [110, 140], "__cpp_lib_rang": 110, "202110l": 110, "dr20": 110, "p2415r2": 110, "owning_view": 110, "view_interfac": 110, "slint_software_renderer_drop": [110, 140], "slint_software_renderer_new": [110, 140], "slint_software_renderer_render_rgb8": [110, 140], "slint_software_renderer_render_rgb565": [110, 140], "slint_software_renderer_render_by_line_rgb565": [110, 140], "process_line_callback_ptr": 110, "line_start": 110, "line_end": 110, "render_fn_data": 110, "line_span": 110, "270": [110, 142], "slint_software_renderer_set_rendering_rot": [110, 140], "cpprawhandleopaqu": [110, 140], "slint_raw_window_handle_drop": [110, 140], "slint_new_raw_window_handle_x11_xcb": [110, 140], "slint_new_raw_window_handle_x11_xlib": [110, 140], "slint_new_raw_window_handle_wayland": [110, 140], "slint_new_raw_window_handle_appkit": [110, 140], "slint_new_raw_window_handle_win32": [110, 140], "skiarendereropaqu": [110, 140], "slint_skia_renderer_handl": [110, 140], "slint_skia_renderer_drop": [110, 140], "slint_skia_renderer_new": [110, 140], "slint_skia_renderer_rend": [110, 140], "slint_platform_update_timers_and_anim": [110, 140], "val": [110, 126, 136, 138, 141], "slint_platform_duration_until_next_timer_upd": [110, 140], "numeric_limit": [110, 112], "slint_testing_init_backend": [111, 145], "is_constructible_v": 111, "is_default_constructible_v": 111, "is_void_v": [111, 112], "slint_testing_element_visit_el": [111, 145], "visitorandresult": 111, "visitor_and_result": 111, "user_data": [111, 114, 121, 127, 136, 138, 140, 141, 145, 146], "label_view": 111, "slint_testing_element_find_by_accessible_label": [111, 145], "element_id_view": 111, "slint_testing_element_find_by_element_id": [111, 145], "element_type_name_view": 111, "slint_testing_element_find_by_element_type_nam": [111, 145], "upgrade_item_weak": [111, 112], "slint_testing_element_id": [111, 145], "slint_testing_element_type_nam": [111, 145], "slint_testing_element_bas": [111, 145], "element_index": [111, 145], "item_tre": [111, 112, 136], "borrow": [111, 148], "get_accessible_string_properti": 111, "accessiblestringproperti": [111, 136], "placeholdertext": [111, 136], "valuemaximum": [111, 136], "slint_string_to_float": [111, 140], "valueminimum": [111, 136], "valuestep": [111, 136], "setvaluehelp": 111, "accessibilityact": [111, 136], "set_valu": [111, 136], "setvalue_bodi": [111, 136], "tag": [111, 112, 113, 117, 119, 127, 128, 135, 136, 139], "setvalu": [111, 136], "accessibility_act": [111, 136], "increaseactionhelp": 111, "decreaseactionhelp": 111, "defaultactionhelp": 111, "item_geometri": [111, 136], "logicalrect": [111, 136], "logicalpoint": [111, 136], "ab": 111, "slint_item_absolute_posit": [111, 136], "accessible_string_properti": [111, 136], "__gnuc__": [112, 116], "__clang__": 112, "17": [112, 142, 165, 166], "condition": 112, "care": [112, 228], "gcc": 112, "ignor": [112, 126, 133], "winvalid": 112, "offsetof": 112, "mutex": 112, "condition_vari": 112, "bring": 112, "structur": [112, 153, 160, 164, 165, 228], "scope": [112, 229, 233], "itemtreeref": [112, 136], "indexrang": [112, 136], "itemref": 112, "itemvt": [112, 136, 142], "itemvisitorrefmut": 112, "itemvisitorvt": [112, 136], "itemtreenod": [112, 136], "itemarrayentri": 112, "voffset": [112, 136], "allowpin": [112, 136], "itemarrai": [112, 127], "make_item_nod": 112, "child_count": 112, "child_index": 112, "parent_index": [112, 136], "item_array_index": [112, 136], "is_access": [112, 136], "item_bodi": [112, 136], "make_dyn_nod": 112, "offset": 112, "dynamictree_bodi": [112, 136], "dynamictre": [112, 136], "get_item_ref": [112, 136], "item_tree_arrai": [112, 136], "item_arrai": [112, 136], "convert_anonymous_rect": 112, "alphabet": [112, 234], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143], "elif": [112, 116], "mac_os_x_version_min_requir": 112, "mac_os_x_version_10_14": 112, "drop_in_plac": [112, 135, 136], "sizeof": [112, 122, 144], "alignof": [112, 122], "cross": 112, "dll": [112, 231], "reloc": 112, "doc": 112, "microsoft": 112, "en": 112, "rule": 112, "dllimport": [112, 116], "dllexport": 112, "msvc": [112, 227], "160": [112, 142], "address": 112, "seek": 112, "That": [112, 231], "resolv": 112, "stub": 112, "librari": [112, 159, 227, 228, 231, 232], "slint_get_item_vt": 112, "vtablenam": 112, "slint_get_": [112, 136, 142], "itemrc": [112, 127, 136], "itemweak": [112, 136, 145], "item_weak": 112, "item_tree_strong": 112, "debug": 112, "slint_debug": [112, 140], "vweak": [112, 136], "layoutinfo": [112, 136], "merg": [112, 136], "duplic": [112, 142], "max_perc": [112, 136], "min_perc": [112, 136], "stretch": [112, 133, 136], "easingcurv": [112, 136], "cubicbezi": [112, 136], "cubic_bezi": [112, 136], "register_item_tre": 112, "maybe_window": 112, "window_ptr": 112, "slint_register_item_tre": [112, 136], "solve_box_layout": 112, "boxlayoutdata": [112, 136], "repeater_index": [112, 136], "ri": 112, "slint_solve_box_layout": [112, 136], "solve_grid_layout": 112, "gridlayoutdata": [112, 136], "slint_solve_grid_layout": [112, 136], "grid_layout_info": 112, "gridlayoutcelldata": [112, 136], "cell": [112, 136], "pad": [112, 122, 136], "slint_grid_layout_info": [112, 136], "box_layout_info": 112, "boxlayoutcelldata": [112, 136], "layoutalign": [112, 133, 136, 142], "slint_box_layout_info": [112, 136], "box_layout_info_ortho": 112, "slint_box_layout_info_ortho": [112, 136], "layout_cache_access": 112, "idx": 112, "modelp": 112, "weak_ptr": 112, "access_array_index": 112, "row_data_track": 112, "model_length": 112, "track_row_count_chang": 112, "cerr": [112, 125, 127], "endl": [112, 125, 127], "peer": 112, "model_row_count_dirty_properti": 112, "track_row_data_chang": 112, "lower_bound": 112, "tracked_row": 112, "model_row_data_dirty_properti": 112, "binary_search": 112, "mark_dirti": [112, 121], "for_each_p": 112, "remove_if": 112, "pp": 112, "arraymodel": 112, "our": [112, 229, 231, 232], "uintmodel": 112, "d": [112, 121, 136, 231], "target_model": 112, "filtered_rows_dirti": 112, "added_accepted_row": 112, "insertion_point": 112, "accepted_row": 112, "existing_row": 112, "existing_row_index": 112, "distanc": [112, 122], "is_contain": 112, "accepted_updated_row": 112, "mapped_row_start": 112, "mapped_row_end": 112, "mapped_removed_len": 112, "mapped_removed_index": 112, "update_map": 112, "source_data": 112, "first_inserted_row": 112, "sorted_rows_dirti": 112, "adjust": 112, "indic": 112, "sorted_row": 112, "inserted_valu": 112, "sorted_elem": 112, "changed_row": 112, "removed_row_it": 112, "removed_row": 112, "changed_valu": 112, "inserted_row": 112, "first_removed_row": 112, "ensure_sort": 112, "lhs_index": 112, "rhs_index": 112, "lhs_elem": 112, "rhs_elem": 112, "old_row_count": 112, "repeaterinn": 112, "clean": 112, "repeatedinstancewithst": 112, "is_dirti": [112, 121], "update_data": 112, "set_model_bind": 112, "bind": [112, 114, 121, 136, 141, 232], "set_bind": [112, 121], "ensure_upd": 112, "tracker": 112, "ensure_updated_listview": 112, "viewport_width": [112, 136], "viewport_height": [112, 136], "viewport_i": [112, 136], "listview_width": 112, "listview_height": 112, "todo": 112, "try": 112, "alloc": 112, "compute_layout_listview": 112, "traversalord": [112, 136], "backtofront": [112, 136], "ref": 112, "item_at": 112, "visit_children_item": [112, 136], "static_vt": [112, 127], "instance_at": 112, "index_rang": 112, "listview_layout": 112, "model_set_row_data": 112, "plural": [112, 136], "slint_transl": [112, 136], "slint_translations_mark_dirti": [112, 136], "flickabl": [112, 136], "slint_flickable_data_init": [112, 136], "slint_flickable_data_fre": [112, 136], "nativestylemetr": [112, 142], "slint_native_style_metrics_init": [112, 142], "slint_native_style_metrics_deinit": [112, 142], "nativepalett": [112, 142], "slint_native_palette_init": [112, 142], "slint_native_palette_deinit": [112, 142], "mismatch": 112, "versioncheckhelp": 112, "slint_run_event_loop": [112, 140], "slint_quit_event_loop": [112, 140], "slint_post_ev": [112, 140], "mtx": 112, "cv": 112, "unique_lock": 112, "notify_on": 112, "wait": [112, 133], "clang": [112, 127], "format": [112, 127, 135, 136, 148, 158], "off": [112, 127, 227], "gradientstop": [113, 115, 128], "firststop": 113, "stopcount": 113, "make_linear_gradi": 113, "fake": 113, "stopsbegin": 113, "stopsend": 113, "radialgradientbrush": [113, 128], "make_circle_gradi": 113, "lineargradi": [113, 128], "radialgradi": [113, 128], "nodiscard": [113, 115, 117], "solid_color": [113, 128], "break": [113, 128, 135, 139], "linear_gradi": [113, 128], "radial_gradi": [113, 128], "slint_color_bright": [113, 115, 131], "slint_color_dark": [113, 115, 131], "slint_color_transparent": [113, 115, 131], "slint_color_with_alpha": [113, 115, 131], "set_animated_valu": [113, 115, 121], "new_valu": [113, 115, 121], "propertyanim": [113, 115, 121, 136, 141], "animation_data": [113, 115, 121, 136, 141], "slint_property_set_animated_value_brush": [113, 136, 141], "ret": [114, 115, 136, 141], "slint_callback_init": [114, 136, 141], "slint_callback_drop": [114, 136, 141], "set_handl": 114, "slint_callback_set_handl": [114, 136, 141], "slint_callback_cal": [114, 136, 141], "callbackopaqu": [114, 136, 141], "0x1": 114, "callbacksignaturehelp": 114, "callbackhelp": [114, 136, 142], "satur": [115, 147], "16": [115, 142, 227], "0xff": 115, "24": [115, 142], "slint_color_from_hsva": [115, 131], "slint_color_to_hsva": [115, 131], "cast": [115, 125], "argb": 115, "slint_color_mix": [115, 131], "slint_property_set_animated_value_color": [115, 136, 141], "uintptr_max": 116, "0xffffffff": 116, "slint_target_32": [116, 138], "0xffffffffffffffffu": 116, "slint_target_64": [116, 138], "_msc_ver": 116, "slint_dll_import": [116, 136, 142], "__declspec": 116, "__attribute__": 116, "m_width": 117, "m_height": 117, "m_data": 117, "cbegin": [117, 122, 157, 159], "cend": [117, 122, 157, 159], "borrowedopengltextureorigin": [117, 135, 148], "topleft": [117, 135, 148], "bottomleft": [117, 135, 148], "imageinner_non": [117, 135], "load_from_path": [117, 148], "file_path": [117, 148], "slint_image_load_from_path": [117, 135], "create_from_borrowed_gl_2d_rgba_textur": [117, 148], "texture_id": [117, 135, 148], "origin_priv": 117, "imageinner_borrowedopengltextur": [117, 135], "borrowedopengltextur": [117, 135], "imageinner_embeddedimag": [117, 135], "imagecachekei": [117, 135], "invalid": [117, 135, 148, 165, 166], "sharedimagebuff": [117, 135], "rgb8": [117, 135], "rgba8": [117, 135], "slint_image_s": [117, 135], "slint_image_path": [117, 135], "set_nine_slice_edg": [117, 148], "short": [117, 148], "bottom": [117, 133, 135, 148], "slint_image_set_nine_slice_edg": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232], "slint_image_load_from_embedded_data": [117, 135], "image_from_embedded_textur": 117, "statictextur": [117, 135], "textur": [117, 135, 148], "slint_image_from_embedded_textur": [117, 135], "pathev": [119, 133, 139], "patharcto": [119, 139], "pathcubicto": [119, 139], "pathel": [119, 139], "pathlineto": [119, 139], "pathmoveto": [119, 139], "pathquadraticto": [119, 139], "pathdata": [119, 136, 139], "firstel": 119, "elements_from_arrai": 119, "firstev": 119, "event_count": [119, 139], "firstcoordin": 119, "coordinate_count": [119, 139], "events_from_arrai": 119, "command": [119, 139, 227, 231, 232, 233], "tmp": 119, "slint_new_path_el": [119, 139], "slint_new_path_ev": [119, 139], "euclid": [120, 123], "crate": [120, 123], "binari": [120, 123, 228, 231], "compat": [120, 123], "changetrack": [121, 136, 141], "stateinfo": [121, 130], "slint_property_set_animated_binding_help": 121, "propertyhandleopaqu": [121, 136, 141], "drop_user_data": [121, 136, 138, 140, 141, 146], "transition_data": [121, 136, 141], "slint_property_set_animated_binding_int": [121, 136, 141], "slint_property_set_animated_binding_float": [121, 136, 141], "slint_property_set_animated_binding_color": [121, 136, 141], "slint_property_set_animated_binding_brush": [121, 136, 141], "slint_property_init": [121, 136, 141], "slint_property_drop": [121, 136, 141], "implicit": [121, 158, 159], "0b10": 121, "slint_property_set_chang": [121, 136, 141], "slint_property_upd": [121, 136, 141], "slint_property_set_bind": [121, 136, 141], "set_animated_bind": 121, "tran": 121, "set_animated_binding_for_transit": 121, "userdata": 121, "instant": [121, 136], "slint_property_is_dirti": [121, 136, 141], "slint_property_mark_dirti": [121, 136, 141], "link_two_wai": 121, "p1": 121, "p2": 121, "common_properti": 121, "twowaybind": 121, "del_fn": 121, "call_fn": 121, "intercept_fn": 121, "intercept_binding_fn": 121, "slint_property_set_binding_intern": [121, 136, 141], "set_state_bind": 121, "slint_property_set_animated_value_int": [121, 136, 141], "slint_property_set_animated_value_float": [121, 136, 141], "slint_property_set_state_bind": [121, 136, 141], "propertytrack": 121, "slint_property_tracker_init": [121, 136, 141], "slint_property_tracker_drop": [121, 136, 141], "slint_property_tracker_is_dirti": [121, 136, 141], "is_same_v": 121, "slint_property_tracker_evalu": [121, 136, 141], "evaluate_as_dependency_root": 121, "slint_property_tracker_evaluate_as_dependency_root": [121, 136, 141], "propertytrackeropaqu": [121, 136, 141], "slint_change_tracker_construct": [121, 136, 141], "slint_change_tracker_drop": [121, 136, 141], "fneval": 121, "fnnotifi": 121, "fn_eval": 121, "fn_notifi": 121, "data_ptr": 121, "slint_change_tracker_init": [121, 136, 141], "sharedvectorhead": 122, "slint_shared_vector_empti": [122, 136, 143], "with_capac": 122, "new_data": 122, "input_it": 122, "inputit": [122, 159], "uninitialized_copi": 122, "capac": [122, 159], "refcount": 122, "detach": 122, "expected_capac": 122, "new_arrai": 122, "old_data": 122, "slint_shared_vector_fre": [122, 136, 143], "mem": 122, "slint_shared_vector_alloc": [122, 136, 143], "unfortun": 122, "cbindgen": [122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "understood": 122, "intptr_t": [122, 136], "static_assert": 122, "size2d": [123, 135, 136], "slint_shared_string_from_byt": [124, 136, 144], "char8_t": [124, 158], "u8string_view": [124, 132, 158, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_shared_string_clon": [124, 136, 144], "slint_shared_string_drop": [124, 136, 144], "slint_shared_string_byt": [124, 136, 144], "starts_with": [124, 158], "prefix": [124, 158, 165, 166, 227], "substr": 124, "ends_with": [124, 158], "self_view": 124, "compar": [124, 125, 153, 157, 159, 160, 165, 166], "npo": 124, "from_numb": [124, 158], "shared_str": [124, 158], "a2": 124, "slint_shared_string_append": [124, 136, 144], "slint_shared_string_from_numb": [124, 136, 144], "mock_elapsed_tim": 125, "int64_t": [125, 126, 136, 146, 234], "time_in_m": [125, 136], "slint_mock_elapsed_tim": [125, 136], "get_mocked_tim": 125, "slint_get_mocked_tim": [125, 136], "send_mouse_click": 125, "slint_send_mouse_click": [125, 136], "send_keyboard_char": 125, "slint_send_keyboard_char": [125, 136], "assert_eq_impl": 125, "__file__": 125, "__line__": 125, "equality_comparable_with": 125, "a_str": 125, "b_str": 125, "nok": 125, "is_integral_v": 125, "common": [125, 229, 231, 233], "sign": [125, 228, 234], "common_type_t": 125, "is_floating_point_v": 125, "depsilon": 125, "000001": 125, "small": 125, "fab": 125, "fail": 125, "cspell": 126, "singleshot": [126, 146], "timermod": [126, 146, 162], "interv": [126, 162], "slint_timer_start": [126, 146], "slint_timer_destroi": [126, 146], "slint_timer_stop": [126, 146], "restart": [126, 162], "slint_timer_restart": [126, 146], "slint_timer_run": [126, 146], "slint_timer_interv": [126, 136, 146], "single_shot": [126, 162], "slint_timer_singleshot": [126, 146], "ndebug": 127, "main_thread_id": 127, "this_thread": 127, "get_id": 127, "most": [127, 148, 227], "itemtreerc": [127, 136, 145], "adopted_inn": 127, "slint_windowrc_clon": [127, 136], "slint_windowrc_init": [127, 140], "slint_windowrc_drop": [127, 136], "slint_windowrc_show": [127, 136], "slint_windowrc_hid": [127, 136], "slint_windowrc_is_vis": [127, 136], "slint_windowrc_get_scale_factor": [127, 136], "set_scale_factor": 127, "slint_windowrc_set_scale_factor": [127, 136], "colorschem": [127, 133, 136, 142], "color_schem": [127, 142], "slint_windowrc_color_schem": [127, 136], "text_input_focus": 127, "slint_windowrc_get_text_input_focus": [127, 136], "set_text_input_focus": 127, "slint_windowrc_set_text_input_focus": [127, 136], "unregister_item_tre": 127, "slint_unregister_item_tre": [127, 136], "set_focus_item": 127, "component_rc": 127, "item_index": [127, 136], "set_focu": [127, 136], "item_rc": 127, "slint_windowrc_set_focus_item": [127, 136], "set_compon": 127, "itemtreeweak": [127, 136], "item_tree_rc": [127, 136], "slint_windowrc_set_compon": [127, 136], "posgett": 127, "show_popup": 127, "parent_compon": 127, "close_on_click": [127, 136], "parent_item": [127, 136], "popup": [127, 136], "popup_dyn": 127, "slint_windowrc_show_popup": [127, 136], "close_popup": 127, "slint_windowrc_close_popup": [127, 136], "graphics_api": [127, 136], "err": 127, "slint_windowrc_set_rendering_notifi": [127, 136], "slint_windowrc_on_close_request": [127, 136], "slint_windowrc_request_redraw": [127, 136], "slint_windowrc_posit": [127, 136], "set_logical_posit": 127, "slint_windowrc_set_logical_posit": [127, 136], "set_physical_posit": 127, "slint_windowrc_set_physical_posit": [127, 136], "slint_windowrc_s": [127, 136], "set_logical_s": 127, "slint_windowrc_set_logical_s": [127, 136], "set_physical_s": 127, "slint_windowrc_set_physical_s": [127, 136], "dispatch_pointer_ev": 127, "mouseev": [127, 136], "slint_windowrc_dispatch_pointer_ev": [127, 136], "register_font_from_path": 127, "maybe_err": 127, "slint_register_font_from_path": [127, 140], "register_font_from_data": 127, "slint_register_font_from_data": [127, 140], "register_bitmap_font": 127, "bitmapfont": [127, 136, 140], "font": [127, 227, 228, 234], "slint_register_bitmap_font": [127, 140], "default_font_s": [127, 136, 142], "slint_windowrc_default_font_s": [127, 136], "windowrc": 127, "slint_windowrc_is_fullscreen": [127, 136], "slint_windowrc_set_fullscreen": [127, 136], "slint_windowrc_is_maxim": [127, 136], "slint_windowrc_set_maxim": [127, 136], "slint_windowrc_is_minim": [127, 136], "slint_windowrc_set_minim": [127, 136], "slint_windowrc_dispatch_key_ev": [127, 136], "keyeventtyp": [127, 130, 136], "keypress": [127, 136], "keyreleas": [127, 136], "pressed_bodi": [127, 136], "click_count": [127, 136], "released_bodi": [127, 136], "moved_bodi": [127, 136], "wheel_bodi": [127, 136], "windowev": [127, 136], "resized_bodi": [127, 136], "slint_windowrc_dispatch_ev": [127, 136], "scale_factor_chang": [127, 136], "scalefactorchanged_bodi": [127, 136], "scalefactorchang": [127, 136], "window_active_chang": [127, 136], "windowactivechanged_bodi": [127, 136], "windowactivechang": [127, 136], "closerequest": [127, 136], "slint_windowrc_has_active_anim": [127, 140], "26": [128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "solidcolor_bodi": 128, "lineargradient_bodi": 128, "radialgradient_bodi": 128, "issolidcolor": 128, "islineargradi": 128, "isradialgradi": 128, "xtask": [129, 130, 132, 133], "keyboardmodifi": 130, "pointerev": [130, 136], "pointereventkind": [130, 133], "modifi": 130, "pointerscrollev": [130, 136], "keyev": [130, 136], "event_typ": [130, 136], "replacement_rang": 130, "preedit_text": [130, 136], "preedit_select": [130, 136], "cursor_posit": 130, "anchor_posit": 130, "tablecolumn": [130, 142], "min_width": 130, "horizontal_stretch": 130, "sortord": [130, 133], "sort_ord": 130, "current_st": 130, "previous_st": 130, "change_tim": 130, "col1": 131, "col2": 131, "u0008": [132, 194], "u0009": [132, 221], "u000a": [132, 211], "u001b": [132, 216], "u0019": [132, 213], "u007f": [132, 224], "u0010": [132, 225], "u0011": [132, 208], "u0012": [132, 186], "u0013": [132, 185], "u0014": [132, 175], "u0015": [132, 223], "u0016": [132, 210], "u0017": [132, 197], "u0018": [132, 179], "u0020": [132, 176], "uf700": [132, 200], "uf701": [132, 184], "uf702": [132, 178], "uf703": [132, 215], "uf704": [132, 174], "uf705": [132, 202], "uf706": [132, 207], "uf707": [132, 181], "uf708": [132, 195], "uf709": [132, 196], "uf70a": [132, 212], "uf70b": [132, 203], "uf70c": [132, 198], "uf70d": [132, 201], "uf70": [132, 206], "uf70f": [132, 182], "uf710": [132, 191], "uf711": [132, 193], "uf712": [132, 192], "uf713": [132, 209], "uf714": [132, 219], "uf715": [132, 204], "uf716": [132, 189], "uf717": [132, 199], "uf718": [132, 218], "uf719": [132, 226], "uf71a": [132, 187], "uf71b": [132, 173], "uf727": [132, 183], "uf729": [132, 214], "uf72b": [132, 222], "uf72c": [132, 220], "uf72d": [132, 205], "uf72f": [132, 190], "uf730": [132, 180], "uf731": [132, 217], "uf734": [132, 188], "uf735": [132, 177], "texthorizontalalign": [133, 136], "textverticalalign": [133, 136], "textwrap": [133, 136], "nowrap": 133, "wordwrap": 133, "charwrap": 133, "textoverflow": [133, 136], "clip": [133, 136], "elid": 133, "textstrokestyl": [133, 136], "outsid": 133, "eventresult": [133, 136], "fillrul": [133, 136], "nonzero": 133, "evenodd": 133, "standardbuttonkind": [133, 142], "cancel": [133, 136], "help": [133, 227, 233], "ye": 133, "retri": 133, "dialogbuttonrol": [133, 136], "mousecursor": [133, 136], "progress": [133, 142], "crosshair": 133, "nodrop": 133, "notallow": 133, "grab": [133, 136], "colres": 133, "rowres": 133, "nresiz": 133, "eres": 133, "sresiz": 133, "wresiz": 133, "neres": 133, "nwresiz": 133, "seres": 133, "swresiz": 133, "ewres": 133, "nsresiz": 133, "neswres": 133, "nwseres": 133, "imagefit": [133, 136], "cover": [133, 231], "preserv": 133, "imagehorizontalalign": [133, 136], "imageverticalalign": [133, 136], "imagerend": [133, 136], "smooth": 133, "imagetil": [133, 136], "round": 133, "inputtyp": [133, 136, 142], "password": 133, "decim": 133, "spacebetween": 133, "spacearound": 133, "quadrat": 133, "cubic": 133, "endopen": 133, "endclos": 133, "unsort": 133, "ascend": 133, "descend": 133, "orient": [133, 136, 142], "horizont": 133, "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "parsedsvg": 135, "htmlimag": 135, "ninesliceimag": 135, "pixelformat": 135, "rgba": [135, 148, 155], "rgbapremultipli": 135, "alphamap": 135, "cachedpath": 135, "last_modifi": 135, "slint_target_wasm": [135, 139], "url": [135, 228], "embeddeddata": 135, "path_bodi": 135, "url_bodi": 135, "embeddeddata_bodi": 135, "embedded_data": 135, "isinvalid": 135, "ispath": 135, "isurl": 135, "isembeddeddata": 135, "rgba8premultipli": 135, "rgb8_bodi": 135, "rgba8_bodi": 135, "rgba8premultiplied_bodi": 135, "rgba8_premultipli": 135, "isrgb8": 135, "isrgba8": 135, "isrgba8premultipli": 135, "opaqueimagevt": 135, "cache_kei": 135, "original_s": 135, "imageinner_svg": 135, "imageinner_statictextur": 135, "imageinner_htmlimag": 135, "imageinner_backendstorag": 135, "imageinner_nineslic": 135, "7": [135, 142], "imageinner_embeddedimage_bodi": 135, "imageinner_svg_bodi": 135, "imageinner_statictextures_bodi": 135, "imageinner_htmlimage_bodi": 135, "imageinner_backendstorage_bodi": 135, "imageinner_borrowedopengltexture_bodi": 135, "imageinner_nineslice_bodi": 135, "embedded_imag": 135, "svg": 135, "static_textur": 135, "html_imag": 135, "backend_storag": 135, "borrowed_open_gl_textur": 135, "nine_slic": 135, "isimageinner_non": 135, "isimageinner_embeddedimag": 135, "isimageinner_svg": 135, "isimageinner_statictextur": 135, "isimageinner_htmlimag": 135, "isimageinner_backendstorag": 135, "isimageinner_borrowedopengltextur": 135, "isimageinner_nineslic": 135, "image1": 135, "image2": 135, "logicallength": [136, 142], "physical_region_max_s": 136, "delegatefocu": 136, "focusev": 136, "focusin": 136, "focusout": 136, "windowreceivedfocu": 136, "windowlostfocu": 136, "focuseventresult": 136, "focusaccept": 136, "focusignor": 136, "inputeventresult": 136, "eventaccept": 136, "eventignor": 136, "grabmous": 136, "keyeventresult": 136, "updatecomposit": 136, "commitcomposit": 136, "renderingresult": 136, "continuerenderingchildren": 136, "continuerenderingwithoutchildren": 136, "fronttoback": 136, "undoitemkind": 136, "textinsert": 136, "textremov": 136, "flickabledata": 136, "itemrendererref": 136, "physicalpx": 136, "visitchildrenresult": 136, "visitchildrenresult_continu": 136, "uint64_max": 136, "inputeventfilterresult": 136, "forwardev": 136, "forwardandignor": 136, "forwardandinterceptgrab": 136, "intercept": 136, "delayforward": 136, "delayforwarding_bodi": 136, "delay_forward": 136, "pin": [136, 142], "my_item": 136, "cached_rendering_data_offset": 136, "layout_info": 136, "window_adapt": [136, 142], "input_event_filter_before_children": 136, "self_rc": 136, "input_ev": 136, "focus_ev": 136, "key_ev": 136, "visit_item": 136, "children_count": 136, "children_index": 136, "dynamic_tre": 136, "replaceselectedtext": 136, "replaceselectedtext_bodi": 136, "replace_selected_text": 136, "supportedaccessibilityact": 136, "supportedaccessibilityaction_default": 136, "supportedaccessibilityaction_decr": 136, "supportedaccessibilityaction_incr": 136, "supportedaccessibilityaction_replaceselectedtext": 136, "supportedaccessibilityaction_setvalu": 136, "get_subtree_rang": 136, "get_subtre": 136, "subindex": 136, "get_item_tre": 136, "parent_nod": 136, "embed_compon": 136, "parent_item_tree_index": 136, "subtree_index": 136, "supported_accessibility_act": 136, "item_element_info": 136, "do_creat": 136, "_1": [136, 139, 140, 141], "itemtreerefpin": 136, "flickabledatabox": 136, "preeditselect": 136, "cachedrenderingdata": [136, 142], "cache_index": 136, "cache_gener": 136, "undoitem": 136, "cursor": 136, "anchor": 136, "font_famili": 136, "font_siz": 136, "font_weight": 136, "font_ital": 136, "selection_foreground_color": 136, "selection_background_color": 136, "horizontal_align": 136, "vertical_align": 136, "wrap": [136, 229, 233], "input_typ": [136, 142], "letter_spac": 136, "cursor_position_byte_offset": 136, "anchor_position_byte_offset": 136, "text_cursor_width": [136, 142], "cursor_vis": 136, "has_focu": [136, 142], "cursor_position_chang": 136, "single_lin": 136, "read_onli": 136, "cached_rendering_data": [136, 142], "preferred_x_po": 136, "undo_item": 136, "redo_item": 136, "col_or_row": 136, "easeinelast": 136, "easeoutelast": 136, "easeinoutelast": 136, "easeinbounc": 136, "easeoutbounc": 136, "easeinoutbounc": 136, "cubicbezier_bodi": 136, "delai": [136, 146], "iteration_count": 136, "eas": 136, "pointerpress": 136, "pointerreleas": 136, "pointermov": 136, "pointerscrol": 136, "pointerexit": 136, "keypressrep": 136, "pointerpressed_bodi": 136, "pointerreleased_bodi": 136, "pointermoved_bodi": 136, "pointerscrolled_bodi": 136, "keypressed_bodi": 136, "keypressrepeated_bodi": 136, "keyreleased_bodi": 136, "pointer_press": 136, "pointer_releas": 136, "pointer_mov": 136, "pointer_scrol": 136, "key_press": 136, "key_press_rep": 136, "key_releas": 136, "destructor": [136, 162, 229], "thankfulli": 136, "charactermapentri": 136, "code_point": 136, "glyph_index": 136, "bitmapglyph": 136, "int16_t": 136, "x_advanc": 136, "pixel_s": 136, "glyph_data": 136, "family_nam": 136, "character_map": 136, "units_per_em": 136, "ascent": 136, "descent": 136, "glyph": [136, 228], "weight": 136, "ital": 136, "box2d": 136, "basicborderrectangl": 136, "border_width": 136, "border_radiu": 136, "border_color": 136, "borderrectangl": 136, "border_top_left_radiu": 136, "border_top_right_radiu": 136, "border_bottom_left_radiu": 136, "border_bottom_right_radiu": 136, "imageitem": 136, "image_fit": 136, "image_rend": 136, "clippedimag": 136, "source_clip_x": 136, "source_clip_i": 136, "source_clip_width": 136, "source_clip_height": 136, "horizontal_til": 136, "vertical_til": 136, "toucharea": 136, "has_hov": [136, 142], "pressed_x": [136, 142], "pressed_i": [136, 142], "mouse_x": 136, "mouse_i": 136, "mouse_cursor": 136, "click": [136, 142, 227], "double_click": 136, "pointer_ev": 136, "scroll_ev": 136, "focusscop": 136, "focus_changed_ev": 136, "swipegesturerecogn": 136, "swipe_left": 136, "swipe_right": 136, "swipe_up": 136, "swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "pressed_tim": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": 136, "stroke": 136, "stroke_width": 136, "stroke_styl": 136, "fill_rul": 136, "viewbox_x": 136, "viewbox_i": 136, "viewbox_width": 136, "viewbox_height": 136, "windowitem": 136, "no_fram": 136, "resize_border_width": 136, "always_on_top": 136, "icon": [136, 142], "default_font_famili": 136, "default_font_weight": 136, "boxshadow": 136, "offset_x": 136, "offset_i": 136, "blur": 136, "rotation_angl": 136, "rotation_origin_x": 136, "rotation_origin_i": 136, "cache_rendering_hint": 136, "sig": [136, 141], "slint_date_time_use_24_hour_format": 136, "slint_date_time_month_day_count": 136, "month": 136, "year": 136, "slint_date_time_month_offset": 136, "slint_date_time_format_d": 136, "dai": 136, "slint_date_time_date_now": 136, "slint_date_time_parse_d": 136, "date": 136, "slint_visit_item_tre": 136, "visit_dynam": 136, "dyn_index": 136, "self_compon": 136, "self_index": 136, "slint_textinput_set_selection_offset": 136, "text_input": 136, "slint_textinput_select_al": 136, "slint_textinput_clear_select": 136, "slint_textinput_cut": 136, "slint_textinput_copi": 136, "slint_textinput_past": 136, "slint_reorder_dialog_button_layout": 136, "pointer_to_valu": [136, 141], "intercept_set": [136, 141], "intercept_set_bind": [136, 141], "new_bind": [136, 141], "start_inst": [136, 141], "ct": [136, 141], "eval_fn": [136, 141], "notify_fn": [136, 141], "slint_animation_tick": [136, 141], "ss": [136, 144], "byte": [136, 144], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231], "focus_item": 136, "rendering_st": 136, "slint_decl_item": [136, 142], "itemnam": [136, 142], "undef": [136, 142], "source_fil": [137, 163], "column": [137, 163], "property_nam": [137, 138, 164, 229], "property_typ": [137, 164], "12": [138, 142], "dynamiccomponentvrc": 138, "double_": 138, "stru": [138, 165, 166], "inst": 138, "def": 138, "component_definition_ptr": 138, "translation_domain": 138, "style_out": 138, "out_diag": 138, "radius_x": 139, "radius_i": 139, "x_rotat": 139, "large_arc": 139, "sweep": 139, "control_1_x": 139, "control_1_i": 139, "control_2_x": 139, "control_2_i": 139, "control_x": 139, "control_i": 139, "moveto": 139, "lineto": 139, "arcto": 139, "cubicto": 139, "quadraticto": 139, "moveto_bodi": 139, "lineto_bodi": 139, "arcto_bodi": 139, "cubicto_bodi": 139, "quadraticto_bodi": 139, "move_to": 139, "line_to": 139, "arc_to": 139, "cubic_to": 139, "quadratic_to": 139, "ismoveto": 139, "islineto": 139, "isarcto": 139, "iscubicto": 139, "isquadraticto": 139, "isclos": 139, "elements_bodi": 139, "events_bodi": 139, "commands_bodi": 139, "isnon": 139, "isel": 139, "isev": 139, "iscommand": 139, "first_el": 139, "out_ev": 139, "out_coordin": 139, "first_ev": 139, "first_coordin": 139, "layoutconstraintsreprc": 140, "windowadapteruserdata": 140, "_a": 140, "_b": 140, "platformuserdata": 140, "slint_ensure_backend": 140, "quit_on_last_window_clos": 140, "win": 140, "error_str": 140, "font_data": 140, "wp": 140, "get_renderer_ref": 140, "window_factori": 140, "buffer_ag": 140, "buffer_len": 140, "process_line_fn": 140, "_hinstanc": 140, "ns_view": 140, "_ns_window": 140, "handle_opaqu": 140, "malloc": 140, "propertyhandl": 141, "dep_nod": 141, "hack": 142, "alert": 142, "qt_widget": 142, "sync": 142, "slinttypeerasedwidget": 142, "slinttypeerasedwidgetptr": 142, "layout_spac": 142, "layout_pad": 142, "window_background": 142, "default_text_color": 142, "textedit_background": 142, "textedit_text_color": 142, "textedit_background_dis": 142, "textedit_text_color_dis": 142, "placeholder_color": 142, "placeholder_color_dis": 142, "dark_color_schem": 142, "tab_bar_align": 142, "style_change_listen": 142, "foreground": 142, "alternate_background": 142, "alternate_foreground": 142, "accent_background": 142, "accent_foreground": 142, "control_background": 142, "control_foreground": 142, "selection_background": 142, "selection_foreground": 142, "border": 142, "qstyle_standardpixmap": 142, "qaccessible_ev": 142, "qaccessible_rol": 142, "qaccessible_text": 142, "qt_keyboardmodifi": 142, "qt_alignmentflag": 142, "qt_textflag": 142, "qt_kei": 142, "qt_cursorshap": 142, "qt_fillrul": 142, "nativebutton": 142, "colorize_icon": 142, "standard_button_kind": 142, "is_standard_button": 142, "widget_ptr": 142, "animation_track": 142, "nativespinboxdata": 142, "active_control": 142, "nativespinbox": 142, "step_siz": 142, "nativecheckbox": 142, "toggl": [142, 227], "nativesliderdata": 142, "pressed_v": 142, "nativeslid": 142, "nativeprogressind": 142, "indetermin": 142, "nativegroupbox": 142, "native_padding_left": 142, "native_padding_right": 142, "native_padding_top": 142, "native_padding_bottom": 142, "nativelineedit": 142, "nativescrollview": 142, "horizontal_max": 142, "horizontal_page_s": 142, "horizontal_valu": 142, "vertical_max": 142, "vertical_page_s": 142, "vertical_valu": 142, "nativestandardlistviewitem": 142, "is_select": 142, "nativetableheadersect": 142, "nativecombobox": 142, "is_open": 142, "current_valu": 142, "nativecomboboxpopup": 142, "nativetabwidget": 142, "content_min_height": 142, "content_min_width": 142, "tabbar_preferred_height": 142, "tabbar_preferred_width": 142, "current_index": 142, "current_focus": 142, "content_x": 142, "content_i": 142, "content_height": 142, "content_width": 142, "tabbar_x": 142, "tabbar_i": 142, "tabbar_height": 142, "tabbar_width": 142, "nativetab": 142, "tab_index": 142, "num_tab": 142, "qstyle_standardpixmap_sp_titlebarmenubutton": 142, "qstyle_standardpixmap_sp_titlebarminbutton": 142, "qstyle_standardpixmap_sp_titlebarmaxbutton": 142, "qstyle_standardpixmap_sp_titlebarclosebutton": 142, "qstyle_standardpixmap_sp_titlebarnormalbutton": 142, "qstyle_standardpixmap_sp_titlebarshadebutton": 142, "qstyle_standardpixmap_sp_titlebarunshadebutton": 142, "qstyle_standardpixmap_sp_titlebarcontexthelpbutton": 142, "qstyle_standardpixmap_sp_dockwidgetclosebutton": 142, "qstyle_standardpixmap_sp_messageboxinform": 142, "9": [142, 148], "qstyle_standardpixmap_sp_messageboxwarn": 142, "10": 142, "qstyle_standardpixmap_sp_messageboxcrit": 142, "11": 142, "qstyle_standardpixmap_sp_messageboxquest": 142, "qstyle_standardpixmap_sp_desktopicon": 142, "13": 142, "qstyle_standardpixmap_sp_trashicon": 142, "14": 142, "qstyle_standardpixmap_sp_computericon": 142, "15": 142, "qstyle_standardpixmap_sp_drivefdicon": 142, "qstyle_standardpixmap_sp_drivehdicon": 142, "qstyle_standardpixmap_sp_drivecdicon": 142, "18": 142, "qstyle_standardpixmap_sp_drivedvdicon": 142, "19": 142, "qstyle_standardpixmap_sp_driveneticon": 142, "qstyle_standardpixmap_sp_diropenicon": 142, "21": [142, 227, 231], "qstyle_standardpixmap_sp_dirclosedicon": 142, "22": 142, "qstyle_standardpixmap_sp_dirlinkicon": 142, "23": 142, "qstyle_standardpixmap_sp_dirlinkopenicon": 142, "qstyle_standardpixmap_sp_fileicon": 142, "25": 142, "qstyle_standardpixmap_sp_filelinkicon": 142, "qstyle_standardpixmap_sp_toolbarhorizontalextensionbutton": 142, "27": 142, "qstyle_standardpixmap_sp_toolbarverticalextensionbutton": 142, "28": 142, "qstyle_standardpixmap_sp_filedialogstart": 142, "29": 142, "qstyle_standardpixmap_sp_filedialogend": 142, "qstyle_standardpixmap_sp_filedialogtopar": 142, "31": 142, "qstyle_standardpixmap_sp_filedialognewfold": 142, "32": 142, "qstyle_standardpixmap_sp_filedialogdetailedview": 142, "33": 142, "qstyle_standardpixmap_sp_filedialoginfoview": 142, "34": 142, "qstyle_standardpixmap_sp_filedialogcontentsview": 142, "35": 142, "qstyle_standardpixmap_sp_filedialoglistview": 142, "36": 142, "qstyle_standardpixmap_sp_filedialogback": 142, "37": 142, "qstyle_standardpixmap_sp_diricon": 142, "38": 142, "qstyle_standardpixmap_sp_dialogokbutton": 142, "39": 142, "qstyle_standardpixmap_sp_dialogcancelbutton": 142, "40": 142, "qstyle_standardpixmap_sp_dialoghelpbutton": 142, "41": 142, "qstyle_standardpixmap_sp_dialogopenbutton": 142, "qstyle_standardpixmap_sp_dialogsavebutton": 142, "43": 142, "qstyle_standardpixmap_sp_dialogclosebutton": 142, "44": 142, "qstyle_standardpixmap_sp_dialogapplybutton": 142, "45": 142, "qstyle_standardpixmap_sp_dialogresetbutton": 142, "46": 142, "qstyle_standardpixmap_sp_dialogdiscardbutton": 142, "47": 142, "qstyle_standardpixmap_sp_dialogyesbutton": 142, "48": 142, "qstyle_standardpixmap_sp_dialognobutton": 142, "49": 142, "qstyle_standardpixmap_sp_arrowup": 142, "qstyle_standardpixmap_sp_arrowdown": 142, "51": 142, "qstyle_standardpixmap_sp_arrowleft": 142, "52": 142, "qstyle_standardpixmap_sp_arrowright": 142, "53": 142, "qstyle_standardpixmap_sp_arrowback": 142, "54": 142, "qstyle_standardpixmap_sp_arrowforward": 142, "55": 142, "qstyle_standardpixmap_sp_dirhomeicon": 142, "56": 142, "qstyle_standardpixmap_sp_commandlink": 142, "57": 142, "qstyle_standardpixmap_sp_vistashield": 142, "58": 142, "qstyle_standardpixmap_sp_browserreload": 142, "59": 142, "qstyle_standardpixmap_sp_browserstop": 142, "60": 142, "qstyle_standardpixmap_sp_mediaplai": 142, "61": 142, "qstyle_standardpixmap_sp_mediastop": 142, "62": 142, "qstyle_standardpixmap_sp_mediapaus": 142, "63": 142, "qstyle_standardpixmap_sp_mediaskipforward": 142, "64": [142, 227, 234], "qstyle_standardpixmap_sp_mediaskipbackward": 142, "65": 142, "qstyle_standardpixmap_sp_mediaseekforward": 142, "66": 142, "qstyle_standardpixmap_sp_mediaseekbackward": 142, "67": 142, "qstyle_standardpixmap_sp_mediavolum": 142, "68": 142, "qstyle_standardpixmap_sp_mediavolumemut": 142, "69": 142, "qstyle_standardpixmap_sp_lineeditclearbutton": 142, "70": 142, "qstyle_standardpixmap_sp_dialogyestoallbutton": 142, "71": 142, "qstyle_standardpixmap_sp_dialognotoallbutton": 142, "72": 142, "qstyle_standardpixmap_sp_dialogsaveallbutton": 142, "73": [142, 227], "qstyle_standardpixmap_sp_dialogabortbutton": 142, "74": 142, "qstyle_standardpixmap_sp_dialogretrybutton": 142, "75": 142, "qstyle_standardpixmap_sp_dialogignorebutton": 142, "76": 142, "qstyle_standardpixmap_sp_restoredefaultsbutton": 142, "77": 142, "qstyle_standardpixmap_sp_custombas": 142, "4026531840": 142, "qaccessible_event_soundplai": 142, "qaccessible_event_alert": 142, "qaccessible_event_foregroundchang": 142, "qaccessible_event_menustart": 142, "qaccessible_event_menuend": 142, "qaccessible_event_popupmenustart": 142, "qaccessible_event_popupmenuend": 142, "qaccessible_event_contexthelpstart": 142, "qaccessible_event_contexthelpend": 142, "qaccessible_event_dragdropstart": 142, "qaccessible_event_dragdropend": 142, "qaccessible_event_dialogstart": 142, "qaccessible_event_dialogend": 142, "qaccessible_event_scrollingstart": 142, "qaccessible_event_scrollingend": 142, "qaccessible_event_menucommand": 142, "qaccessible_event_actionchang": 142, "257": 142, "qaccessible_event_activedescendantchang": 142, "258": 142, "qaccessible_event_attributechang": 142, "259": 142, "qaccessible_event_documentcontentchang": 142, "260": 142, "qaccessible_event_documentloadcomplet": 142, "261": 142, "qaccessible_event_documentloadstop": 142, "262": 142, "qaccessible_event_documentreload": 142, "263": 142, "qaccessible_event_hyperlinkendindexchang": 142, "264": 142, "qaccessible_event_hyperlinknumberofanchorschang": 142, "265": 142, "qaccessible_event_hyperlinkselectedlinkchang": 142, "266": 142, "qaccessible_event_hypertextlinkactiv": 142, "267": 142, "qaccessible_event_hypertextlinkselect": 142, "268": 142, "qaccessible_event_hyperlinkstartindexchang": 142, "269": 142, "qaccessible_event_hypertextchang": 142, "qaccessible_event_hypertextnlinkschang": 142, "271": 142, "qaccessible_event_objectattributechang": 142, "272": 142, "qaccessible_event_pagechang": 142, "273": 142, "qaccessible_event_sectionchang": 142, "274": 142, "qaccessible_event_tablecaptionchang": 142, "275": 142, "qaccessible_event_tablecolumndescriptionchang": 142, "276": 142, "qaccessible_event_tablecolumnheaderchang": 142, "277": 142, "qaccessible_event_tablemodelchang": 142, "278": 142, "qaccessible_event_tablerowdescriptionchang": 142, "279": 142, "qaccessible_event_tablerowheaderchang": 142, "280": 142, "qaccessible_event_tablesummarychang": 142, "281": 142, "qaccessible_event_textattributechang": 142, "282": 142, "qaccessible_event_textcaretmov": 142, "283": 142, "qaccessible_event_textcolumnchang": 142, "285": 142, "qaccessible_event_textinsert": 142, "286": 142, "qaccessible_event_textremov": 142, "287": 142, "qaccessible_event_textupd": 142, "288": 142, "qaccessible_event_textselectionchang": 142, "289": 142, "qaccessible_event_visibledatachang": 142, "290": 142, "qaccessible_event_objectcr": 142, "32768": 142, "qaccessible_event_objectdestroi": 142, "32769": 142, "qaccessible_event_objectshow": 142, "32770": 142, "qaccessible_event_objecthid": 142, "32771": 142, "qaccessible_event_objectreord": 142, "32772": 142, "qaccessible_event_focu": 142, "32773": 142, "qaccessible_event_select": 142, "32774": 142, "qaccessible_event_selectionadd": 142, "32775": 142, "qaccessible_event_selectionremov": 142, "32776": 142, "qaccessible_event_selectionwithin": 142, "32777": 142, "qaccessible_event_statechang": 142, "32778": 142, "qaccessible_event_locationchang": 142, "32779": 142, "qaccessible_event_namechang": 142, "32780": 142, "qaccessible_event_descriptionchang": 142, "32781": 142, "qaccessible_event_valuechang": 142, "32782": 142, "qaccessible_event_parentchang": 142, "32783": 142, "qaccessible_event_helpchang": 142, "32928": 142, "qaccessible_event_defaultactionchang": 142, "32944": 142, "qaccessible_event_acceleratorchang": 142, "32960": 142, "qaccessible_event_invalidev": 142, "32961": 142, "qaccessible_role_norol": 142, "qaccessible_role_titlebar": 142, "qaccessible_role_menubar": 142, "qaccessible_role_scrollbar": 142, "qaccessible_role_grip": 142, "qaccessible_role_sound": 142, "qaccessible_role_cursor": 142, "qaccessible_role_caret": 142, "qaccessible_role_alertmessag": 142, "qaccessible_role_window": 142, "qaccessible_role_cli": 142, "qaccessible_role_popupmenu": 142, "qaccessible_role_menuitem": 142, "qaccessible_role_tooltip": 142, "qaccessible_role_appl": 142, "qaccessible_role_docu": 142, "qaccessible_role_pan": 142, "qaccessible_role_chart": 142, "qaccessible_role_dialog": 142, "qaccessible_role_bord": 142, "qaccessible_role_group": 142, "qaccessible_role_separ": 142, "qaccessible_role_toolbar": 142, "qaccessible_role_statusbar": 142, "qaccessible_role_t": 142, "qaccessible_role_columnhead": 142, "qaccessible_role_rowhead": 142, "qaccessible_role_column": 142, "qaccessible_role_row": 142, "qaccessible_role_cel": 142, "qaccessible_role_link": 142, "qaccessible_role_helpballoon": 142, "qaccessible_role_assist": 142, "qaccessible_role_list": 142, "qaccessible_role_listitem": 142, "qaccessible_role_tre": 142, "qaccessible_role_treeitem": 142, "qaccessible_role_pagetab": 142, "qaccessible_role_propertypag": 142, "qaccessible_role_ind": 142, "qaccessible_role_graph": 142, "qaccessible_role_statictext": 142, "qaccessible_role_editabletext": 142, "qaccessible_role_button": 142, "qaccessible_role_pushbutton": 142, "qaccessible_role_checkbox": 142, "qaccessible_role_radiobutton": 142, "qaccessible_role_combobox": 142, "qaccessible_role_progressbar": 142, "qaccessible_role_di": 142, "qaccessible_role_hotkeyfield": 142, "qaccessible_role_slid": 142, "qaccessible_role_spinbox": 142, "qaccessible_role_canva": 142, "qaccessible_role_anim": 142, "qaccessible_role_equ": 142, "qaccessible_role_buttondropdown": 142, "qaccessible_role_buttonmenu": 142, "qaccessible_role_buttondropgrid": 142, "qaccessible_role_whitespac": 142, "qaccessible_role_pagetablist": 142, "qaccessible_role_clock": 142, "qaccessible_role_splitt": 142, "qaccessible_role_layeredpan": 142, "128": 142, "qaccessible_role_termin": 142, "129": 142, "qaccessible_role_desktop": 142, "130": 142, "qaccessible_role_paragraph": 142, "131": 142, "qaccessible_role_webdocu": 142, "132": 142, "qaccessible_role_sect": 142, "133": 142, "qaccessible_role_notif": 142, "134": 142, "qaccessible_role_colorchoos": 142, "1028": 142, "qaccessible_role_foot": 142, "1038": 142, "qaccessible_role_form": 142, "1040": 142, "qaccessible_role_head": 142, "1044": 142, "qaccessible_role_not": 142, "1051": 142, "qaccessible_role_complementarycont": 142, "1068": 142, "qaccessible_role_userrol": 142, "65535": 142, "qaccessible_text_nam": 142, "qaccessible_text_descript": 142, "qaccessible_text_valu": 142, "qaccessible_text_help": 142, "qaccessible_text_acceler": 142, "qaccessible_text_debugdescript": 142, "qaccessible_text_usertext": 142, "qt_keyboardmodifier_nomodifi": 142, "qt_keyboardmodifier_shiftmodifi": 142, "33554432": 142, "qt_keyboardmodifier_controlmodifi": 142, "67108864": 142, "qt_keyboardmodifier_altmodifi": 142, "134217728": 142, "qt_keyboardmodifier_metamodifi": 142, "268435456": 142, "qt_keyboardmodifier_keypadmodifi": 142, "536870912": 142, "qt_keyboardmodifier_groupswitchmodifi": 142, "1073741824": 142, "qt_keyboardmodifier_keyboardmodifiermask": 142, "4261412864": 142, "qt_alignmentflag_alignleft": 142, "qt_alignmentflag_alignlead": 142, "qt_alignmentflag_alignright": 142, "qt_alignmentflag_aligntrail": 142, "qt_alignmentflag_alignhcent": 142, "qt_alignmentflag_alignjustifi": 142, "qt_alignmentflag_alignabsolut": 142, "qt_alignmentflag_alignhorizontal_mask": 142, "qt_alignmentflag_aligntop": 142, "qt_alignmentflag_alignbottom": 142, "qt_alignmentflag_alignvcent": 142, "qt_alignmentflag_alignbaselin": 142, "256": 142, "qt_alignmentflag_alignvertical_mask": 142, "480": 142, "qt_alignmentflag_aligncent": 142, "qt_textflag_textsinglelin": 142, "qt_textflag_textdontclip": 142, "512": 142, "qt_textflag_textexpandtab": 142, "1024": 142, "qt_textflag_textshowmnemon": 142, "2048": 142, "qt_textflag_textwordwrap": 142, "4096": 142, "qt_textflag_textwrapanywher": 142, "8192": 142, "qt_textflag_textdontprint": 142, "16384": 142, "qt_textflag_textincludetrailingspac": 142, "qt_textflag_texthidemnemon": 142, "qt_textflag_textjustificationforc": 142, "65536": 142, "qt_textflag_textforcelefttoright": 142, "131072": 142, "qt_textflag_textforcerighttoleft": 142, "262144": 142, "qt_textflag_textlongestvari": 142, "524288": 142, "qt_textflag_textbypassshap": 142, "1048576": 142, "qt_key_key_escap": 142, "16777216": 142, "qt_key_key_tab": 142, "16777217": 142, "qt_key_key_backtab": 142, "16777218": 142, "qt_key_key_backspac": 142, "16777219": 142, "qt_key_key_return": 142, "16777220": 142, "qt_key_key_ent": 142, "16777221": 142, "qt_key_key_insert": 142, "16777222": 142, "qt_key_key_delet": 142, "16777223": 142, "qt_key_key_paus": 142, "16777224": 142, "qt_key_key_print": 142, "16777225": 142, "qt_key_key_sysreq": 142, "16777226": 142, "qt_key_key_clear": 142, "16777227": 142, "qt_key_key_hom": 142, "16777232": 142, "qt_key_key_end": 142, "16777233": 142, "qt_key_key_left": 142, "16777234": 142, "qt_key_key_up": 142, "16777235": 142, "qt_key_key_right": 142, "16777236": 142, "qt_key_key_down": 142, "16777237": 142, "qt_key_key_pageup": 142, "16777238": 142, "qt_key_key_pagedown": 142, "16777239": 142, "qt_key_key_shift": 142, "16777248": 142, "qt_key_key_control": 142, "16777249": 142, "qt_key_key_meta": 142, "16777250": 142, "qt_key_key_alt": 142, "16777251": 142, "qt_key_key_capslock": 142, "16777252": 142, "qt_key_key_numlock": 142, "16777253": 142, "qt_key_key_scrolllock": 142, "16777254": 142, "qt_key_key_f1": 142, "16777264": 142, "qt_key_key_f2": 142, "16777265": 142, "qt_key_key_f3": 142, "16777266": 142, "qt_key_key_f4": 142, "16777267": 142, "qt_key_key_f5": 142, "16777268": 142, "qt_key_key_f6": 142, "16777269": 142, "qt_key_key_f7": 142, "16777270": 142, "qt_key_key_f8": 142, "16777271": 142, "qt_key_key_f9": 142, "16777272": 142, "qt_key_key_f10": 142, "16777273": 142, "qt_key_key_f11": 142, "16777274": 142, "qt_key_key_f12": 142, "16777275": 142, "qt_key_key_f13": 142, "16777276": 142, "qt_key_key_f14": 142, "16777277": 142, "qt_key_key_f15": 142, "16777278": 142, "qt_key_key_f16": 142, "16777279": 142, "qt_key_key_f17": 142, "16777280": 142, "qt_key_key_f18": 142, "16777281": 142, "qt_key_key_f19": 142, "16777282": 142, "qt_key_key_f20": 142, "16777283": 142, "qt_key_key_f21": 142, "16777284": 142, "qt_key_key_f22": 142, "16777285": 142, "qt_key_key_f23": 142, "16777286": 142, "qt_key_key_f24": 142, "16777287": 142, "qt_key_key_f25": 142, "16777288": 142, "qt_key_key_f26": 142, "16777289": 142, "qt_key_key_f27": 142, "16777290": 142, "qt_key_key_f28": 142, "16777291": 142, "qt_key_key_f29": 142, "16777292": 142, "qt_key_key_f30": 142, "16777293": 142, "qt_key_key_f31": 142, "16777294": 142, "qt_key_key_f32": 142, "16777295": 142, "qt_key_key_f33": 142, "16777296": 142, "qt_key_key_f34": 142, "16777297": 142, "qt_key_key_f35": 142, "16777298": 142, "qt_key_key_super_l": 142, "16777299": 142, "qt_key_key_super_r": 142, "16777300": 142, "qt_key_key_menu": 142, "16777301": 142, "qt_key_key_hyper_l": 142, "16777302": 142, "qt_key_key_hyper_r": 142, "16777303": 142, "qt_key_key_help": 142, "16777304": 142, "qt_key_key_direction_l": 142, "16777305": 142, "qt_key_key_direction_r": 142, "16777312": 142, "qt_key_key_spac": 142, "qt_key_key_ani": 142, "qt_key_key_exclam": 142, "qt_key_key_quotedbl": 142, "qt_key_key_numbersign": 142, "qt_key_key_dollar": 142, "qt_key_key_perc": 142, "qt_key_key_ampersand": 142, "qt_key_key_apostroph": 142, "qt_key_key_parenleft": 142, "qt_key_key_parenright": 142, "qt_key_key_asterisk": 142, "qt_key_key_plu": 142, "qt_key_key_comma": 142, "qt_key_key_minu": 142, "qt_key_key_period": 142, "qt_key_key_slash": 142, "qt_key_key_0": 142, "qt_key_key_1": 142, "qt_key_key_2": 142, "qt_key_key_3": 142, "qt_key_key_4": 142, "qt_key_key_5": 142, "qt_key_key_6": 142, "qt_key_key_7": 142, "qt_key_key_8": 142, "qt_key_key_9": 142, "qt_key_key_colon": 142, "qt_key_key_semicolon": 142, "qt_key_key_less": 142, "qt_key_key_equ": 142, "qt_key_key_great": 142, "qt_key_key_quest": 142, "qt_key_key_at": 142, "qt_key_key_a": 142, "qt_key_key_b": 142, "qt_key_key_c": 142, "qt_key_key_d": 142, "qt_key_key_": 142, "qt_key_key_f": 142, "qt_key_key_g": 142, "qt_key_key_h": 142, "qt_key_key_i": 142, "qt_key_key_j": 142, "qt_key_key_k": 142, "qt_key_key_l": 142, "qt_key_key_m": 142, "qt_key_key_n": 142, "78": 142, "qt_key_key_o": 142, "79": 142, "qt_key_key_p": 142, "80": 142, "qt_key_key_q": 142, "81": 142, "qt_key_key_r": 142, "82": 142, "83": 142, "qt_key_key_t": 142, "84": 142, "qt_key_key_u": 142, "85": 142, "qt_key_key_v": 142, "86": 142, "qt_key_key_w": 142, "87": 142, "qt_key_key_x": 142, "88": 142, "89": 142, "qt_key_key_z": 142, "qt_key_key_bracketleft": 142, "91": 142, "qt_key_key_backslash": 142, "92": 142, "qt_key_key_bracketright": 142, "93": 142, "qt_key_key_asciicircum": 142, "94": 142, "qt_key_key_underscor": 142, "95": 142, "qt_key_key_quoteleft": 142, "96": 142, "qt_key_key_braceleft": 142, "123": 142, "qt_key_key_bar": 142, "124": 142, "qt_key_key_braceright": 142, "125": 142, "qt_key_key_asciitild": 142, "126": 142, "qt_key_key_nobreakspac": 142, "qt_key_key_exclamdown": 142, "161": 142, "162": 142, "qt_key_key_sterl": 142, "163": 142, "qt_key_key_curr": 142, "164": 142, "qt_key_key_yen": 142, "165": 142, "qt_key_key_brokenbar": 142, "166": 142, "qt_key_key_sect": 142, "167": 142, "qt_key_key_diaeresi": 142, "168": 142, "qt_key_key_copyright": 142, "169": 142, "qt_key_key_ordfeminin": 142, "170": 142, "qt_key_key_guillemotleft": 142, "171": 142, "qt_key_key_notsign": 142, "172": 142, "qt_key_key_hyphen": 142, "173": 142, "qt_key_key_regist": 142, "174": 142, "qt_key_key_macron": 142, "175": 142, "qt_key_key_degre": 142, "176": 142, "qt_key_key_plusminu": 142, "177": 142, "qt_key_key_twosuperior": 142, "178": 142, "qt_key_key_threesuperior": 142, "179": 142, "qt_key_key_acut": 142, "qt_key_key_mu": 142, "181": 142, "qt_key_key_paragraph": 142, "182": 142, "qt_key_key_periodcent": 142, "183": 142, "qt_key_key_cedilla": 142, "184": 142, "qt_key_key_onesuperior": 142, "185": 142, "qt_key_key_masculin": 142, "186": 142, "qt_key_key_guillemotright": 142, "187": 142, "qt_key_key_onequart": 142, "188": 142, "qt_key_key_onehalf": 142, "189": 142, "qt_key_key_threequart": 142, "190": 142, "qt_key_key_questiondown": 142, "191": 142, "qt_key_key_agrav": 142, "192": 142, "qt_key_key_aacut": 142, "193": 142, "qt_key_key_acircumflex": 142, "194": 142, "qt_key_key_atild": 142, "195": 142, "qt_key_key_adiaeresi": 142, "196": 142, "qt_key_key_ar": 142, "197": 142, "198": 142, "qt_key_key_ccedilla": 142, "199": 142, "qt_key_key_egrav": 142, "200": [142, 148], "qt_key_key_eacut": 142, "201": 142, "qt_key_key_ecircumflex": 142, "202": 142, "qt_key_key_ediaeresi": 142, "203": 142, "qt_key_key_igrav": 142, "204": 142, "qt_key_key_iacut": 142, "205": 142, "qt_key_key_icircumflex": 142, "206": 142, "qt_key_key_idiaeresi": 142, "207": 142, "qt_key_key_eth": 142, "208": 142, "qt_key_key_ntild": 142, "209": 142, "qt_key_key_ograv": 142, "210": 142, "qt_key_key_oacut": 142, "211": 142, "qt_key_key_ocircumflex": 142, "212": 142, "qt_key_key_otild": 142, "213": 142, "qt_key_key_odiaeresi": 142, "214": 142, "qt_key_key_multipli": 142, "215": 142, "qt_key_key_oobliqu": 142, "216": 142, "qt_key_key_ugrav": 142, "217": 142, "qt_key_key_uacut": 142, "218": 142, "qt_key_key_ucircumflex": 142, "219": 142, "qt_key_key_udiaeresi": 142, "220": 142, "qt_key_key_yacut": 142, "221": 142, "qt_key_key_thorn": 142, "222": 142, "qt_key_key_ssharp": 142, "223": 142, "qt_key_key_divis": 142, "247": 142, "qt_key_key_ydiaeresi": 142, "qt_key_key_altgr": 142, "16781571": 142, "qt_key_key_multi_kei": 142, "16781600": 142, "qt_key_key_codeinput": 142, "16781623": 142, "qt_key_key_singlecandid": 142, "16781628": 142, "qt_key_key_multiplecandid": 142, "16781629": 142, "qt_key_key_previouscandid": 142, "16781630": 142, "qt_key_key_mode_switch": 142, "16781694": 142, "qt_key_key_kanji": 142, "16781601": 142, "qt_key_key_muhenkan": 142, "16781602": 142, "qt_key_key_henkan": 142, "16781603": 142, "qt_key_key_romaji": 142, "16781604": 142, "qt_key_key_hiragana": 142, "16781605": 142, "qt_key_key_katakana": 142, "16781606": 142, "qt_key_key_hiragana_katakana": 142, "16781607": 142, "qt_key_key_zenkaku": 142, "16781608": 142, "qt_key_key_hankaku": 142, "16781609": 142, "qt_key_key_zenkaku_hankaku": 142, "16781610": 142, "qt_key_key_touroku": 142, "16781611": 142, "qt_key_key_massyo": 142, "16781612": 142, "qt_key_key_kana_lock": 142, "16781613": 142, "qt_key_key_kana_shift": 142, "16781614": 142, "qt_key_key_eisu_shift": 142, "16781615": 142, "qt_key_key_eisu_toggl": 142, "16781616": 142, "qt_key_key_hangul": 142, "16781617": 142, "qt_key_key_hangul_start": 142, "16781618": 142, "qt_key_key_hangul_end": 142, "16781619": 142, "qt_key_key_hangul_hanja": 142, "16781620": 142, "qt_key_key_hangul_jamo": 142, "16781621": 142, "qt_key_key_hangul_romaja": 142, "16781622": 142, "qt_key_key_hangul_jeonja": 142, "16781624": 142, "qt_key_key_hangul_banja": 142, "16781625": 142, "qt_key_key_hangul_prehanja": 142, "16781626": 142, "qt_key_key_hangul_posthanja": 142, "16781627": 142, "qt_key_key_hangul_speci": 142, "16781631": 142, "qt_key_key_dead_grav": 142, "16781904": 142, "qt_key_key_dead_acut": 142, "16781905": 142, "qt_key_key_dead_circumflex": 142, "16781906": 142, "qt_key_key_dead_tild": 142, "16781907": 142, "qt_key_key_dead_macron": 142, "16781908": 142, "qt_key_key_dead_brev": 142, "16781909": 142, "qt_key_key_dead_abovedot": 142, "16781910": 142, "qt_key_key_dead_diaeresi": 142, "16781911": 142, "qt_key_key_dead_abov": 142, "16781912": 142, "qt_key_key_dead_doubleacut": 142, "16781913": 142, "qt_key_key_dead_caron": 142, "16781914": 142, "qt_key_key_dead_cedilla": 142, "16781915": 142, "qt_key_key_dead_ogonek": 142, "16781916": 142, "qt_key_key_dead_iota": 142, "16781917": 142, "qt_key_key_dead_voiced_sound": 142, "16781918": 142, "qt_key_key_dead_semivoiced_sound": 142, "16781919": 142, "qt_key_key_dead_belowdot": 142, "16781920": 142, "qt_key_key_dead_hook": 142, "16781921": 142, "qt_key_key_dead_horn": 142, "16781922": 142, "qt_key_key_dead_strok": 142, "16781923": 142, "qt_key_key_dead_abovecomma": 142, "16781924": 142, "qt_key_key_dead_abovereversedcomma": 142, "16781925": 142, "qt_key_key_dead_doublegrav": 142, "16781926": 142, "qt_key_key_dead_belowr": 142, "16781927": 142, "qt_key_key_dead_belowmacron": 142, "16781928": 142, "qt_key_key_dead_belowcircumflex": 142, "16781929": 142, "qt_key_key_dead_belowtild": 142, "16781930": 142, "qt_key_key_dead_belowbrev": 142, "16781931": 142, "qt_key_key_dead_belowdiaeresi": 142, "16781932": 142, "qt_key_key_dead_invertedbrev": 142, "16781933": 142, "qt_key_key_dead_belowcomma": 142, "16781934": 142, "qt_key_key_dead_curr": 142, "16781935": 142, "qt_key_key_dead_a": 142, "16781952": 142, "16781953": 142, "qt_key_key_dead_": 142, "16781954": 142, "16781955": 142, "qt_key_key_dead_i": 142, "16781956": 142, "16781957": 142, "qt_key_key_dead_o": 142, "16781958": 142, "16781959": 142, "qt_key_key_dead_u": 142, "16781960": 142, "16781961": 142, "qt_key_key_dead_small_schwa": 142, "16781962": 142, "qt_key_key_dead_capital_schwa": 142, "16781963": 142, "qt_key_key_dead_greek": 142, "16781964": 142, "qt_key_key_dead_lowlin": 142, "16781968": 142, "qt_key_key_dead_aboveverticallin": 142, "16781969": 142, "qt_key_key_dead_belowverticallin": 142, "16781970": 142, "qt_key_key_dead_longsolidusoverlai": 142, "16781971": 142, "qt_key_key_back": 142, "16777313": 142, "qt_key_key_forward": 142, "16777314": 142, "qt_key_key_stop": 142, "16777315": 142, "qt_key_key_refresh": 142, "16777316": 142, "qt_key_key_volumedown": 142, "16777328": 142, "qt_key_key_volumemut": 142, "16777329": 142, "qt_key_key_volumeup": 142, "16777330": 142, "qt_key_key_bassboost": 142, "16777331": 142, "qt_key_key_bassup": 142, "16777332": 142, "qt_key_key_bassdown": 142, "16777333": 142, "qt_key_key_trebleup": 142, "16777334": 142, "qt_key_key_trebledown": 142, "16777335": 142, "qt_key_key_mediaplai": 142, "16777344": 142, "qt_key_key_mediastop": 142, "16777345": 142, "qt_key_key_mediaprevi": 142, "16777346": 142, "qt_key_key_medianext": 142, "16777347": 142, "qt_key_key_mediarecord": 142, "16777348": 142, "qt_key_key_mediapaus": 142, "16777349": 142, "qt_key_key_mediatoggleplaypaus": 142, "16777350": 142, "qt_key_key_homepag": 142, "16777360": 142, "qt_key_key_favorit": 142, "16777361": 142, "qt_key_key_search": 142, "16777362": 142, "qt_key_key_standbi": 142, "16777363": 142, "qt_key_key_openurl": 142, "16777364": 142, "qt_key_key_launchmail": 142, "16777376": 142, "qt_key_key_launchmedia": 142, "16777377": 142, "qt_key_key_launch0": 142, "16777378": 142, "qt_key_key_launch1": 142, "16777379": 142, "qt_key_key_launch2": 142, "16777380": 142, "qt_key_key_launch3": 142, "16777381": 142, "qt_key_key_launch4": 142, "16777382": 142, "qt_key_key_launch5": 142, "16777383": 142, "qt_key_key_launch6": 142, "16777384": 142, "qt_key_key_launch7": 142, "16777385": 142, "qt_key_key_launch8": 142, "16777386": 142, "qt_key_key_launch9": 142, "16777387": 142, "qt_key_key_launcha": 142, "16777388": 142, "qt_key_key_launchb": 142, "16777389": 142, "qt_key_key_launchc": 142, "16777390": 142, "qt_key_key_launchd": 142, "16777391": 142, "qt_key_key_launch": 142, "16777392": 142, "qt_key_key_launchf": 142, "16777393": 142, "qt_key_key_monbrightnessup": 142, "16777394": 142, "qt_key_key_monbrightnessdown": 142, "16777395": 142, "qt_key_key_keyboardlightonoff": 142, "16777396": 142, "qt_key_key_keyboardbrightnessup": 142, "16777397": 142, "qt_key_key_keyboardbrightnessdown": 142, "16777398": 142, "qt_key_key_poweroff": 142, "16777399": 142, "qt_key_key_wakeup": 142, "16777400": 142, "qt_key_key_eject": 142, "16777401": 142, "qt_key_key_screensav": 142, "16777402": 142, "qt_key_key_www": 142, "16777403": 142, "qt_key_key_memo": 142, "16777404": 142, "qt_key_key_lightbulb": 142, "16777405": 142, "qt_key_key_shop": 142, "16777406": 142, "qt_key_key_histori": 142, "16777407": 142, "qt_key_key_addfavorit": 142, "16777408": 142, "qt_key_key_hotlink": 142, "16777409": 142, "qt_key_key_brightnessadjust": 142, "16777410": 142, "qt_key_key_fin": 142, "16777411": 142, "qt_key_key_commun": 142, "16777412": 142, "qt_key_key_audiorewind": 142, "16777413": 142, "qt_key_key_backforward": 142, "16777414": 142, "qt_key_key_applicationleft": 142, "16777415": 142, "qt_key_key_applicationright": 142, "16777416": 142, "qt_key_key_book": 142, "16777417": 142, "qt_key_key_cd": 142, "16777418": 142, "qt_key_key_calcul": 142, "16777419": 142, "qt_key_key_todolist": 142, "16777420": 142, "qt_key_key_cleargrab": 142, "16777421": 142, "qt_key_key_clos": 142, "16777422": 142, "qt_key_key_copi": 142, "16777423": 142, "qt_key_key_cut": 142, "16777424": 142, "qt_key_key_displai": 142, "16777425": 142, "qt_key_key_do": 142, "16777426": 142, "qt_key_key_docu": 142, "16777427": 142, "qt_key_key_excel": 142, "16777428": 142, "qt_key_key_explor": 142, "16777429": 142, "qt_key_key_gam": 142, "16777430": 142, "qt_key_key_go": 142, "16777431": 142, "qt_key_key_itouch": 142, "16777432": 142, "qt_key_key_logoff": 142, "16777433": 142, "qt_key_key_market": 142, "16777434": 142, "qt_key_key_meet": 142, "16777435": 142, "qt_key_key_menukb": 142, "16777436": 142, "qt_key_key_menupb": 142, "16777437": 142, "qt_key_key_mysit": 142, "16777438": 142, "qt_key_key_new": 142, "16777439": 142, "qt_key_key_officehom": 142, "16777440": 142, "qt_key_key_opt": 142, "16777441": 142, "qt_key_key_past": 142, "16777442": 142, "qt_key_key_phon": 142, "16777443": 142, "qt_key_key_calendar": 142, "16777444": 142, "qt_key_key_repli": 142, "16777445": 142, "qt_key_key_reload": 142, "16777446": 142, "qt_key_key_rotatewindow": 142, "16777447": 142, "qt_key_key_rotationpb": 142, "16777448": 142, "qt_key_key_rotationkb": 142, "16777449": 142, "qt_key_key_sav": 142, "16777450": 142, "qt_key_key_send": 142, "16777451": 142, "qt_key_key_spel": 142, "16777452": 142, "qt_key_key_splitscreen": 142, "16777453": 142, "qt_key_key_support": 142, "16777454": 142, "qt_key_key_taskpan": 142, "16777455": 142, "qt_key_key_termin": 142, "16777456": 142, "qt_key_key_tool": 142, "16777457": 142, "qt_key_key_travel": 142, "16777458": 142, "qt_key_key_video": 142, "16777459": 142, "qt_key_key_word": 142, "16777460": 142, "qt_key_key_xf": 142, "16777461": 142, "qt_key_key_zoomin": 142, "16777462": 142, "qt_key_key_zoomout": 142, "16777463": 142, "qt_key_key_awai": 142, "16777464": 142, "qt_key_key_messeng": 142, "16777465": 142, "qt_key_key_webcam": 142, "16777466": 142, "qt_key_key_mailforward": 142, "16777467": 142, "qt_key_key_pictur": 142, "16777468": 142, "qt_key_key_mus": 142, "16777469": 142, "qt_key_key_batteri": 142, "16777470": 142, "qt_key_key_bluetooth": 142, "16777471": 142, "qt_key_key_wlan": 142, "16777472": 142, "qt_key_key_uwb": 142, "16777473": 142, "qt_key_key_audioforward": 142, "16777474": 142, "qt_key_key_audiorepeat": 142, "16777475": 142, "qt_key_key_audiorandomplai": 142, "16777476": 142, "qt_key_key_subtitl": 142, "16777477": 142, "qt_key_key_audiocycletrack": 142, "16777478": 142, "qt_key_key_tim": 142, "16777479": 142, "qt_key_key_hibern": 142, "16777480": 142, "qt_key_key_view": 142, "16777481": 142, "qt_key_key_topmenu": 142, "16777482": 142, "qt_key_key_powerdown": 142, "16777483": 142, "qt_key_key_suspend": 142, "16777484": 142, "qt_key_key_contrastadjust": 142, "16777485": 142, "qt_key_key_launchg": 142, "16777486": 142, "qt_key_key_launchh": 142, "16777487": 142, "qt_key_key_touchpadtoggl": 142, "16777488": 142, "qt_key_key_touchpadon": 142, "16777489": 142, "qt_key_key_touchpadoff": 142, "16777490": 142, "qt_key_key_micmut": 142, "16777491": 142, "16777492": 142, "qt_key_key_green": 142, "16777493": 142, "qt_key_key_yellow": 142, "16777494": 142, "qt_key_key_blu": 142, "16777495": 142, "qt_key_key_channelup": 142, "16777496": 142, "qt_key_key_channeldown": 142, "16777497": 142, "qt_key_key_guid": 142, "16777498": 142, "qt_key_key_info": 142, "16777499": 142, "qt_key_key_set": 142, "16777500": 142, "qt_key_key_micvolumeup": 142, "16777501": 142, "qt_key_key_micvolumedown": 142, "16777502": 142, "16777504": 142, "qt_key_key_open": 142, "16777505": 142, "qt_key_key_find": 142, "16777506": 142, "qt_key_key_undo": 142, "16777507": 142, "qt_key_key_redo": 142, "16777508": 142, "qt_key_key_medialast": 142, "16842751": 142, "qt_key_key_select": 142, "16842752": 142, "qt_key_key_y": 142, "16842753": 142, "qt_key_key_no": 142, "16842754": 142, "qt_key_key_cancel": 142, "16908289": 142, "16908290": 142, "qt_key_key_execut": 142, "16908291": 142, "qt_key_key_sleep": 142, "16908292": 142, "qt_key_key_plai": 142, "16908293": 142, "qt_key_key_zoom": 142, "16908294": 142, "qt_key_key_exit": 142, "16908298": 142, "qt_key_key_context1": 142, "17825792": 142, "qt_key_key_context2": 142, "17825793": 142, "qt_key_key_context3": 142, "17825794": 142, "qt_key_key_context4": 142, "17825795": 142, "qt_key_key_cal": 142, "17825796": 142, "qt_key_key_hangup": 142, "17825797": 142, "qt_key_key_flip": 142, "17825798": 142, "qt_key_key_togglecallhangup": 142, "17825799": 142, "qt_key_key_voicedi": 142, "17825800": 142, "qt_key_key_lastnumberredi": 142, "17825801": 142, "qt_key_key_camera": 142, "17825824": 142, "qt_key_key_camerafocu": 142, "17825825": 142, "qt_key_key_unknown": 142, "33554431": 142, "qt_cursorshape_arrowcursor": 142, "qt_cursorshape_uparrowcursor": 142, "qt_cursorshape_crosscursor": 142, "qt_cursorshape_waitcursor": 142, "qt_cursorshape_ibeamcursor": 142, "qt_cursorshape_sizevercursor": 142, "qt_cursorshape_sizehorcursor": 142, "qt_cursorshape_sizebdiagcursor": 142, "qt_cursorshape_sizefdiagcursor": 142, "qt_cursorshape_sizeallcursor": 142, "qt_cursorshape_blankcursor": 142, "qt_cursorshape_splitvcursor": 142, "qt_cursorshape_splithcursor": 142, "qt_cursorshape_pointinghandcursor": 142, "qt_cursorshape_forbiddencursor": 142, "qt_cursorshape_whatsthiscursor": 142, "qt_cursorshape_busycursor": 142, "qt_cursorshape_openhandcursor": 142, "qt_cursorshape_closedhandcursor": 142, "qt_cursorshape_dragcopycursor": 142, "qt_cursorshape_dragmovecursor": 142, "qt_cursorshape_draglinkcursor": 142, "qt_cursorshape_lastcursor": 142, "qt_cursorshape_bitmapcursor": 142, "qt_cursorshape_customcursor": 142, "qt_fillrule_oddevenfil": 142, "qt_fillrule_windingfil": 142, "degre": [147, 234], "disk": [148, 228], "effici": [148, 158, 227, 232], "dimens": 148, "afterward": 148, "320x200": 148, "pixel_buff": 148, "320": 148, "low_level_rend": 148, "through": [148, 231, 232], "the_width": 148, "the_height": 148, "the_data": 148, "raw_data": 148, "bgr_data": 148, "flip": 148, "nine": 148, "edg": 148, "corner": 148, "distort": 148, "cut": 148, "remain": [148, 159, 228], "bindabl": 148, "gl_texture_2d": 148, "gl_rgba": 148, "safeti": 148, "unsaf": 148, "lead": 148, "undefin": 148, "driver": 148, "consequ": 148, "dimension": [153, 160], "precis": [156, 234], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": [158, 231], "hood": 158, "utf": [158, 234], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": 158, "lexicograph": 158, "less": [158, 233], "greater": [158, 228], "concaten": 158, "primarili": 159, "dereferenc": [159, 165, 166], "th": 159, "unaffect": 159, "standardlistview": 161, "standardtableview": 161, "singl": [162, 228], "shot": 162, "equival": 162, "fire": 162, "calcul": 162, "along": [163, 227], "simpl": [164, 231], "introduc": 165, "keyword": 165, "anonym": [165, 234], "notat": 165, "lst": 165, "field": [165, 166, 229, 234], "sure": [165, 166, 227], "retain": [165, 166], "syntax": [165, 166, 232], "go": [165, 166], "field_nam": [165, 166], "field_valu": [165, 166], "16bit": 167, "subdirectori": 172, "variabl": [172, 227, 228], "mit": [227, 228, 229, 231, 233, 234], "2019": 227, "newer": 227, "autom": 227, "offer": 227, "linkag": 227, "recommend": 227, "ninja": 227, "track": 227, "gninja": 227, "cmake_gener": 227, "download": 227, "linux": 227, "x86": 227, "architectur": 227, "flexibl": [227, 233], "open": 227, "latest": [227, 231], "asset": 227, "xxx": 227, "x86_64": 227, "tar": 227, "gz": 227, "win64": 227, "ex": 227, "unpack": 227, "archiv": 227, "cmake_prefix_path": 227, "altern": 227, "dcmake_prefix_path": 227, "find_packag": [227, 231], "cmakelist": [227, 231], "txt": [227, 231], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232], "guid": [227, 231], "rustc": 227, "cargo": [227, 232], "project": [227, 231], "fetchcont": [227, 231], "snippet": 227, "fetchcontent_declar": [227, 231], "git_repositori": [227, 231], "git": [227, 231], "upgrad": [227, 231], "git_tag": [227, 231], "source_subdir": [227, 231], "fetchcontent_makeavail": [227, 231], "regular": 227, "choic": 227, "optim": [227, 228, 233], "stack": 227, "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": 227, "ccmake": 227, "more": [227, 229, 231, 232, 233], "discov": 227, "disabl": 227, "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": 227, "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 233], "inform": [227, 233], "slint_feature_backend_": 227, "stabl": [227, 228], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": 227, "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": 227, "rustup": 227, "iconfigur": 227, "drust_cargo_target": 227, "arm64": 227, "board": 227, "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": 227, "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 227, "dslint_feature_freestand": 227, "standard": 227, "dbuild_shared_lib": 227, "dslint_feature_renderer_softwar": 227, "ddefault_slint_embed_resourc": 227, "emb": [227, 228], "mcu": 227, "arm": 227, "cortex": 227, "complet": 227, "thumbv7em": 227, "eabihf": 227, "library_path": 228, "name1": 228, "lib1": 228, "name2": 228, "lib2": 228, "compilation_unit": 228, "num": 228, "tell": 228, "builtin": 228, "target_sourc": 228, "build": [228, 229, 231, 232], "extend": 228, "the_window": 228, "thewindow": 228, "output": 228, "mycomponentlib": 228, "redirect": 228, "add_execut": [228, 231], "my_appl": [228, 231], "target_link_librari": [228, 231], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 233], "split": 228, "across": 228, "abil": 228, "perform": [228, 233], "minimis": 228, "anywher": 228, "slint_embed_resourc": 228, "default_slint_embed_resourc": 228, "devic": [228, 232, 234], "ratio": [228, 234], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 233], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 233], "aliv": [229, 233], "complex": [229, 233], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232], "mainwindow": 229, "get_count": 229, "set_count": 229, "get_user_nam": 229, "set_user_nam": 229, "invoke_hello": 229, "on_hello": 229, "callback_handl": 229, "invoke_do_someth": 229, "omit": 229, "togeth": 229, "on_to_uppercas": 229, "per": 229, "slint_target_sourc": [231, 233], "cmake_minimum_requir": 231, "cxx": 231, "three": 231, "packag": 231, "approach": [231, 233], "add_custom_command": 231, "post_build": 231, "cmake_command": 231, "target_runtime_dl": 231, "target_file_dir": 231, "command_expand_list": 231, "helloworld": [231, 232], "400px": [231, 232], "my_label": 231, "200px": [231, 232], "hello_world": 231, "set_my_label": 231, "depth": 231, "walk": 231, "game": 231, "Of": 231, "cours": 231, "recip": 231, "toolkit": 232, "fluid": 232, "desktop": 232, "power": 232, "placement": 232, "flow": 232, "familiar": 232, "hierarchi": 232, "obligatori": 232, "visual": 232, "studio": 232, "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": 232, "instal": 232, "explain": 233, "veri": 233, "ahead": 233, "smallest": 233, "footprint": 233, "best": 233, "price": 233, "opportun": 233, "popul": 233, "slower": 233, "With": 233, "polymorph": 233, "commonli": 233, "consum": 233, "invoke_global_callback": 233, "summar": 234, "easili": 234, "physical_length": 234, "At": 234, "camelcas": 234, "mystruct": 234, "camel": 234, "myenum": 234, "beta": 234, "gamma": 234, "omicron": 234, "betagamma": 234}, "objects": {"": [[33, 0, 1, "c.SLINT_FEATURE_ACCESSIBILITY", "SLINT_FEATURE_ACCESSIBILITY"], [27, 0, 1, "c.SLINT_FEATURE_BACKEND_LINUXKMS", "SLINT_FEATURE_BACKEND_LINUXKMS"], [23, 0, 1, "c.SLINT_FEATURE_BACKEND_QT", "SLINT_FEATURE_BACKEND_QT"], [39, 0, 1, "c.SLINT_FEATURE_BACKEND_WINIT", "SLINT_FEATURE_BACKEND_WINIT"], [28, 0, 1, "c.SLINT_FEATURE_EXPERIMENTAL", "SLINT_FEATURE_EXPERIMENTAL"], [36, 0, 1, "c.SLINT_FEATURE_FREESTANDING", "SLINT_FEATURE_FREESTANDING"], [24, 0, 1, "c.SLINT_FEATURE_GETTEXT", "SLINT_FEATURE_GETTEXT"], [25, 0, 1, "c.SLINT_FEATURE_INTERPRETER", "SLINT_FEATURE_INTERPRETER"], [30, 0, 1, "c.SLINT_FEATURE_RENDERER_FEMTOVG", "SLINT_FEATURE_RENDERER_FEMTOVG"], [31, 0, 1, "c.SLINT_FEATURE_RENDERER_SKIA", "SLINT_FEATURE_RENDERER_SKIA"], [34, 0, 1, "c.SLINT_FEATURE_RENDERER_SOFTWARE", "SLINT_FEATURE_RENDERER_SOFTWARE"], [32, 0, 1, "c.SLINT_FEATURE_SYSTEM_TESTING", "SLINT_FEATURE_SYSTEM_TESTING"], [37, 0, 1, "c.SLINT_FEATURE_TESTING", "SLINT_FEATURE_TESTING"], [38, 0, 1, "c.SLINT_VERSION_MAJOR", "SLINT_VERSION_MAJOR"], [35, 0, 1, "c.SLINT_VERSION_MINOR", "SLINT_VERSION_MINOR"], [26, 0, 1, "c.SLINT_VERSION_PATCH", "SLINT_VERSION_PATCH"], [29, 0, 1, "c.SLINT_VERSION_STRING", "SLINT_VERSION_STRING"], [40, 0, 1, "c.assert_eq", "assert_eq"], [0, 1, 1, "_CPPv4N5slint5BrushE", "slint::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushEv", "slint::Brush::Brush"], [0, 3, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter"], [0, 3, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush5colorEv", "slint::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker"], [0, 3, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker::factor"], [0, 2, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!="], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::a"], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::b"], [0, 2, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator=="], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::a"], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::b"], [0, 2, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize"], [0, 3, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha"], [0, 3, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha::alpha"], [54, 4, 1, "_CPPv4N5slint20CloseRequestResponseE", "slint::CloseRequestResponse"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse10HideWindowE", "slint::CloseRequestResponse::HideWindow"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE", "slint::CloseRequestResponse::KeepWindowShown"], [1, 1, 1, "_CPPv4N5slint5ColorE", "slint::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorEv", "slint::Color::Color"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color::col"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color::col"], [1, 2, 1, "_CPPv4NK5slint5Color5alphaEv", "slint::Color::alpha"], [1, 2, 1, "_CPPv4NK5slint5Color15as_argb_encodedEv", "slint::Color::as_argb_encoded"], [1, 2, 1, "_CPPv4NK5slint5Color4blueEv", "slint::Color::blue"], [1, 2, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter"], [1, 3, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter::factor"], [1, 2, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker"], [1, 3, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker::factor"], [1, 2, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded"], [1, 3, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded::argb_encoded"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::red"], [1, 2, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::a"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::h"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::s"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::v"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::red"], [1, 2, 1, "_CPPv4NK5slint5Color5greenEv", "slint::Color::green"], [1, 2, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::factor"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::other"], [1, 2, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::color"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::stream"], [1, 2, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator=="], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::lhs"], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::rhs"], [1, 2, 1, "_CPPv4NK5slint5Color3redEv", "slint::Color::red"], [1, 2, 1, "_CPPv4NK5slint5Color13to_argb_floatEv", "slint::Color::to_argb_float"], [1, 2, 1, "_CPPv4NK5slint5Color12to_argb_uintEv", "slint::Color::to_argb_uint"], [1, 2, 1, "_CPPv4NK5slint5Color7to_hsvaEv", "slint::Color::to_hsva"], [1, 2, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize"], [1, 3, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize::factor"], [1, 2, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha"], [1, 3, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha::alpha"], [2, 1, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle"], [2, 2, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle"], [2, 3, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle::inner"], [2, 6, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle::T"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandle8into_dynEv", "slint::ComponentHandle::into_dyn"], [2, 2, 1, "_CPPv4N5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4N5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [3, 1, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 3, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle::other"], [3, 6, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle::T"], [3, 2, 1, "_CPPv4NK5slint19ComponentWeakHandle4lockEv", "slint::ComponentWeakHandle::lock"], [51, 4, 1, "_CPPv4N5slint13EventLoopModeE", "slint::EventLoopMode"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE", "slint::EventLoopMode::QuitOnLastWindowClosed"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE", "slint::EventLoopMode::RunUntilQuit"], [4, 1, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel"], [4, 2, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::filter_fn"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::source_model"], [4, 6, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel::ModelData"], [4, 2, 1, "_CPPv4N5slint11FilterModel5resetEv", "slint::FilterModel::reset"], [4, 2, 1, "_CPPv4NK5slint11FilterModel9row_countEv", "slint::FilterModel::row_count"], [4, 2, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data"], [4, 3, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data::i"], [4, 2, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::i"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::value"], [4, 2, 1, "_CPPv4NK5slint11FilterModel12source_modelEv", "slint::FilterModel::source_model"], [4, 2, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row"], [4, 3, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row::filtered_row"], [52, 4, 1, "_CPPv4N5slint11GraphicsAPIE", "slint::GraphicsAPI"], [52, 5, 1, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE", "slint::GraphicsAPI::NativeOpenGL"], [147, 1, 1, "_CPPv4N5slint9HsvaColorE", "slint::HsvaColor"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5alphaE", "slint::HsvaColor::alpha"], [147, 7, 1, "_CPPv4N5slint9HsvaColor3hueE", "slint::HsvaColor::hue"], [147, 7, 1, "_CPPv4N5slint9HsvaColor10saturationE", "slint::HsvaColor::saturation"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5valueE", "slint::HsvaColor::value"], [148, 1, 1, "_CPPv4N5slint5ImageE", "slint::Image"], [148, 4, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE", "slint::Image::BorrowedOpenGLTextureOrigin"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::BottomLeft"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::TopLeft"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageEv", "slint::Image::Image"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image::buffer"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image::buffer"], [148, 2, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::origin"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::size"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::texture_id"], [148, 2, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path"], [148, 3, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path::file_path"], [148, 2, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!="], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::a"], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::b"], [148, 2, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator=="], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::a"], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::b"], [148, 2, 1, "_CPPv4NK5slint5Image4pathEv", "slint::Image::path"], [148, 2, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::bottom"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::left"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::right"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::top"], [148, 2, 1, "_CPPv4NK5slint5Image4sizeEv", "slint::Image::size"], [149, 1, 1, "_CPPv4N5slint15LogicalPositionE", "slint::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv", "slint::LogicalPosition::LogicalPosition"], [149, 3, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition::p"], [150, 1, 1, "_CPPv4N5slint11LogicalSizeE", "slint::LogicalSize"], [150, 2, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize"], [150, 3, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize::s"], [5, 1, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel"], [5, 2, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::map_fn"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::source_model"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::MappedModelData"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::SourceModelData"], [5, 2, 1, "_CPPv4N5slint8MapModel5resetEv", "slint::MapModel::reset"], [5, 2, 1, "_CPPv4NK5slint8MapModel9row_countEv", "slint::MapModel::row_count"], [5, 2, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data"], [5, 3, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data::i"], [5, 2, 1, "_CPPv4NK5slint8MapModel12source_modelEv", "slint::MapModel::source_model"], [6, 1, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelERK5Model", "slint::Model::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelEv", "slint::Model::Model"], [6, 6, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model::ModelData"], [6, 2, 1, "_CPPv4N5slint5ModelaSERK5Model", "slint::Model::operator="], [6, 2, 1, "_CPPv4N5slint5Model5resetEv", "slint::Model::reset"], [6, 2, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::count"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::index"], [6, 2, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed"], [6, 3, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed::row"], [6, 2, 1, "_CPPv4NK5slint5Model9row_countEv", "slint::Model::row_count"], [6, 2, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data"], [6, 3, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data::i"], [6, 2, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::count"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::index"], [6, 2, 1, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData", "slint::Model::set_row_data"], [6, 2, 1, "_CPPv4N5slint5ModelD0Ev", "slint::Model::~Model"], [151, 1, 1, "_CPPv4N5slint16PhysicalPositionE", "slint::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv", "slint::PhysicalPosition::PhysicalPosition"], [151, 3, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition::p"], [152, 1, 1, "_CPPv4N5slint12PhysicalSizeE", "slint::PhysicalSize"], [152, 2, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize"], [152, 3, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize::s"], [153, 1, 1, "_CPPv4I0EN5slint5PointE", "slint::Point"], [153, 6, 1, "_CPPv4I0EN5slint5PointE", "slint::Point::T"], [153, 2, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator=="], [153, 3, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator==::other"], [153, 7, 1, "_CPPv4N5slint5Point1xE", "slint::Point::x"], [153, 7, 1, "_CPPv4N5slint5Point1yE", "slint::Point::y"], [50, 4, 1, "_CPPv4N5slint18PointerEventButtonE", "slint::PointerEventButton"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4LeftE", "slint::PointerEventButton::Left"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton6MiddleE", "slint::PointerEventButton::Middle"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5OtherE", "slint::PointerEventButton::Other"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5RightE", "slint::PointerEventButton::Right"], [53, 4, 1, "_CPPv4N5slint14RenderingStateE", "slint::RenderingState"], [53, 5, 1, "_CPPv4N5slint14RenderingState14AfterRenderingE", "slint::RenderingState::AfterRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState15BeforeRenderingE", "slint::RenderingState::BeforeRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState14RenderingSetupE", "slint::RenderingState::RenderingSetup"], [53, 5, 1, "_CPPv4N5slint14RenderingState17RenderingTeardownE", "slint::RenderingState::RenderingTeardown"], [7, 1, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel"], [7, 6, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel::ModelData"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel::source_model"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel9row_countEv", "slint::ReverseModel::row_count"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data"], [7, 3, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data::i"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::i"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::value"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel12source_modelEv", "slint::ReverseModel::source_model"], [154, 1, 1, "_CPPv4N5slint9Rgb8PixelE", "slint::Rgb8Pixel"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1bE", "slint::Rgb8Pixel::b"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1gE", "slint::Rgb8Pixel::g"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1rE", "slint::Rgb8Pixel::r"], [155, 1, 1, "_CPPv4N5slint10Rgba8PixelE", "slint::Rgba8Pixel"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1aE", "slint::Rgba8Pixel::a"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1bE", "slint::Rgba8Pixel::b"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1gE", "slint::Rgba8Pixel::g"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1rE", "slint::Rgba8Pixel::r"], [156, 1, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::col"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 6, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor::T"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5alphaE", "slint::RgbaColor::alpha"], [156, 7, 1, "_CPPv4N5slint9RgbaColor4blueE", "slint::RgbaColor::blue"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5greenE", "slint::RgbaColor::green"], [156, 7, 1, "_CPPv4N5slint9RgbaColor3redE", "slint::RgbaColor::red"], [49, 4, 1, "_CPPv4N5slint25SetRenderingNotifierErrorE", "slint::SetRenderingNotifierError"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE", "slint::SetRenderingNotifierError::AlreadySet"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE", "slint::SetRenderingNotifierError::Unsupported"], [157, 1, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer"], [157, 6, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer::Pixel"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::data"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv", "slint::SharedPixelBuffer::cbegin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer4cendEv", "slint::SharedPixelBuffer::cend"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6heightEv", "slint::SharedPixelBuffer::height"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator=="], [157, 3, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator==::other"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5widthEv", "slint::SharedPixelBuffer::width"], [158, 1, 1, "_CPPv4N5slint12SharedStringE", "slint::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEv", "slint::SharedString::SharedString"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString::other"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString::s"], [158, 2, 1, "_CPPv4NK5slint12SharedString5beginEv", "slint::SharedString::begin"], [158, 2, 1, "_CPPv4NK5slint12SharedString4dataEv", "slint::SharedString::data"], [158, 2, 1, "_CPPv4NK5slint12SharedString5emptyEv", "slint::SharedString::empty"], [158, 2, 1, "_CPPv4NK5slint12SharedString3endEv", "slint::SharedString::end"], [158, 2, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number"], [158, 3, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number::n"], [158, 2, 1, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv", "slint::SharedString::operator std::string_view"], [158, 2, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!="], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+="], [158, 3, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+=::other"], [158, 2, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::shared_string"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::stream"], [158, 2, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<="], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator="], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator=::s"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator=::s"], [158, 2, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator=="], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>="], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::b"], [158, 2, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedStringD0Ev", "slint::SharedString::~SharedString"], [159, 1, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector"], [159, 2, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorEv", "slint::SharedVector::SharedVector"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::InputIt"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector::args"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::first"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::last"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector::other"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::value"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector::T"], [159, 2, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at"], [159, 3, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector6cbeginEv", "slint::SharedVector::cbegin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4cendEv", "slint::SharedVector::cend"], [159, 2, 1, "_CPPv4N5slint12SharedVector5clearEv", "slint::SharedVector::clear"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5emptyEv", "slint::SharedVector::empty"], [159, 2, 1, "_CPPv4N5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4NK5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator="], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator="], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator=::other"], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator=::other"], [159, 2, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator=="], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::a"], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::b"], [159, 2, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 2, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 3, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 3, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back::value"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back::value"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4sizeEv", "slint::SharedVector::size"], [159, 2, 1, "_CPPv4N5slint12SharedVectorD0Ev", "slint::SharedVector::~SharedVector"], [160, 1, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size"], [160, 6, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size::T"], [160, 7, 1, "_CPPv4N5slint4Size6heightE", "slint::Size::height"], [160, 2, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator=="], [160, 3, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator==::other"], [160, 7, 1, "_CPPv4N5slint4Size5widthE", "slint::Size::width"], [8, 1, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel"], [8, 6, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel::ModelData"], [8, 2, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::comp"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::source_model"], [8, 2, 1, "_CPPv4N5slint9SortModel5resetEv", "slint::SortModel::reset"], [8, 2, 1, "_CPPv4NK5slint9SortModel9row_countEv", "slint::SortModel::row_count"], [8, 2, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data"], [8, 3, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data::i"], [8, 2, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::i"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::value"], [8, 2, 1, "_CPPv4NK5slint9SortModel12source_modelEv", "slint::SortModel::source_model"], [8, 2, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row"], [8, 3, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row::sorted_row_index"], [161, 1, 1, "_CPPv4N5slint20StandardListViewItemE", "slint::StandardListViewItem"], [161, 7, 1, "_CPPv4N5slint20StandardListViewItem4textE", "slint::StandardListViewItem::text"], [162, 1, 1, "_CPPv4N5slint5TimerE", "slint::Timer"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerERK5Timer", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerEv", "slint::Timer::Timer"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::interval"], [162, 2, 1, "_CPPv4NK5slint5Timer8intervalEv", "slint::Timer::interval"], [162, 2, 1, "_CPPv4N5slint5TimeraSERK5Timer", "slint::Timer::operator="], [162, 2, 1, "_CPPv4N5slint5Timer7restartEv", "slint::Timer::restart"], [162, 2, 1, "_CPPv4NK5slint5Timer7runningEv", "slint::Timer::running"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::duration"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::interval"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::mode"], [162, 2, 1, "_CPPv4N5slint5Timer4stopEv", "slint::Timer::stop"], [162, 2, 1, "_CPPv4N5slint5TimerD0Ev", "slint::Timer::~Timer"], [9, 1, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel"], [9, 6, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel::ModelData"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelEv", "slint::VectorModel::VectorModel"], [9, 3, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel::array"], [9, 2, 1, "_CPPv4N5slint11VectorModel5clearEv", "slint::VectorModel::clear"], [9, 2, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase"], [9, 3, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase::index"], [9, 2, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::index"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back"], [9, 3, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back::value"], [9, 2, 1, "_CPPv4NK5slint11VectorModel9row_countEv", "slint::VectorModel::row_count"], [9, 2, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data"], [9, 3, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data::i"], [9, 2, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::i"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector"], [9, 3, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector::array"], [10, 1, 1, "_CPPv4N5slint6WindowE", "slint::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window::other"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window::other"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv", "slint::Window::dispatch_close_requested_event"], [10, 2, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event"], [10, 3, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event::text"], [10, 2, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event"], [10, 3, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event::text"], [10, 2, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event"], [10, 3, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event::text"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv", "slint::Window::dispatch_pointer_exit_event"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event"], [10, 3, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::button"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::button"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_x"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_y"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event"], [10, 3, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event::s"], [10, 2, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event"], [10, 3, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event::factor"], [10, 2, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event"], [10, 3, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event::active"], [10, 2, 1, "_CPPv4NK5slint6Window21has_active_animationsEv", "slint::Window::has_active_animations"], [10, 2, 1, "_CPPv4N5slint6Window4hideEv", "slint::Window::hide"], [10, 2, 1, "_CPPv4NK5slint6Window13is_fullscreenEv", "slint::Window::is_fullscreen"], [10, 2, 1, "_CPPv4NK5slint6Window12is_maximizedEv", "slint::Window::is_maximized"], [10, 2, 1, "_CPPv4NK5slint6Window12is_minimizedEv", "slint::Window::is_minimized"], [10, 2, 1, "_CPPv4NK5slint6Window10is_visibleEv", "slint::Window::is_visible"], [10, 2, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested"], [10, 6, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::F"], [10, 3, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::callback"], [10, 2, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator="], [10, 2, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator="], [10, 3, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator=::other"], [10, 3, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator=::other"], [10, 2, 1, "_CPPv4NK5slint6Window8positionEv", "slint::Window::position"], [10, 2, 1, "_CPPv4NK5slint6Window14request_redrawEv", "slint::Window::request_redraw"], [10, 2, 1, "_CPPv4NK5slint6Window12scale_factorEv", "slint::Window::scale_factor"], [10, 2, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen"], [10, 3, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen::fullscreen"], [10, 2, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized"], [10, 3, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized::maximized"], [10, 2, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized"], [10, 3, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized::minimized"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position::pos"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position::pos"], [10, 2, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier"], [10, 6, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::F"], [10, 3, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::callback"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size::size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size::size"], [10, 2, 1, "_CPPv4N5slint6Window4showEv", "slint::Window::show"], [10, 2, 1, "_CPPv4NK5slint6Window4sizeEv", "slint::Window::size"], [10, 2, 1, "_CPPv4N5slint6WindowD0Ev", "slint::Window::~Window"], [99, 2, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop"], [99, 6, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::Functor"], [99, 3, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::f"], [11, 1, 1, "_CPPv4N5slint11interpreter17ComponentCompilerE", "slint::interpreter::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv", "slint::interpreter::ComponentCompiler::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path::path"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::source_code"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv", "slint::interpreter::ComponentCompiler::diagnostics"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv", "slint::interpreter::ComponentCompiler::include_paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths::paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain::domain"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv", "slint::interpreter::ComponentCompiler::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev", "slint::interpreter::ComponentCompiler::~ComponentCompiler"], [12, 1, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionE", "slint::interpreter::ComponentDefinition"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition"], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv", "slint::interpreter::ComponentDefinition::callbacks"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv", "slint::interpreter::ComponentDefinition::create"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv", "slint::interpreter::ComponentDefinition::functions"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv", "slint::interpreter::ComponentDefinition::globals"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv", "slint::interpreter::ComponentDefinition::name"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator="], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator=::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv", "slint::interpreter::ComponentDefinition::properties"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev", "slint::interpreter::ComponentDefinition::~ComponentDefinition"], [13, 1, 1, "_CPPv4N5slint11interpreter17ComponentInstanceE", "slint::interpreter::ComponentInstance"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv", "slint::interpreter::ComponentInstance::definition"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::prop_name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv", "slint::interpreter::ComponentInstance::hide"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::callable_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::global"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv", "slint::interpreter::ComponentInstance::qwidget"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv", "slint::interpreter::ComponentInstance::run"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::name"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::global"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::prop_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv", "slint::interpreter::ComponentInstance::show"], [13, 2, 1, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv", "slint::interpreter::ComponentInstance::window"], [163, 1, 1, "_CPPv4N5slint11interpreter10DiagnosticE", "slint::interpreter::Diagnostic"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic6columnE", "slint::interpreter::Diagnostic::column"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic5levelE", "slint::interpreter::Diagnostic::level"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic4lineE", "slint::interpreter::Diagnostic::line"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic7messageE", "slint::interpreter::Diagnostic::message"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE", "slint::interpreter::Diagnostic::source_file"], [47, 4, 1, "_CPPv4N5slint11interpreter15DiagnosticLevelE", "slint::interpreter::DiagnosticLevel"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE", "slint::interpreter::DiagnosticLevel::Error"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE", "slint::interpreter::DiagnosticLevel::Warning"], [164, 1, 1, "_CPPv4N5slint11interpreter18PropertyDescriptorE", "slint::interpreter::PropertyDescriptor"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE", "slint::interpreter::PropertyDescriptor::property_name"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE", "slint::interpreter::PropertyDescriptor::property_type"], [165, 1, 1, "_CPPv4N5slint11interpreter6StructE", "slint::interpreter::Struct"], [165, 2, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructEv", "slint::interpreter::Struct::Struct"], [165, 6, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::InputIterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct::args"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::end"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::it"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct::other"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct5beginEv", "slint::interpreter::Struct::begin"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct3endEv", "slint::interpreter::Struct::end"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field"], [165, 3, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field::name"], [165, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [166, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [166, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [165, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [166, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator=::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::name"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::value"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructD0Ev", "slint::interpreter::Struct::~Struct"], [14, 1, 1, "_CPPv4N5slint11interpreter5ValueE", "slint::interpreter::Value"], [14, 8, 1, "_CPPv4N5slint11interpreter5Value4TypeE", "slint::interpreter::Value::Type"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEv", "slint::interpreter::Value::Value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value::b"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value::brush"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value::img"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value::m"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value::str"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value::struc"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value::v"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value::value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value::value"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator="], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator=::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator=::other"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator=="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::a"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::b"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_arrayEv", "slint::interpreter::Value::to_array"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value7to_boolEv", "slint::interpreter::Value::to_bool"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_brushEv", "slint::interpreter::Value::to_brush"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_imageEv", "slint::interpreter::Value::to_image"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_numberEv", "slint::interpreter::Value::to_number"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_stringEv", "slint::interpreter::Value::to_string"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_structEv", "slint::interpreter::Value::to_struct"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value4typeEv", "slint::interpreter::Value::type"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueD0Ev", "slint::interpreter::Value::~Value"], [46, 4, 1, "_CPPv4N5slint11interpreter9ValueTypeE", "slint::interpreter::ValueType"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4BoolE", "slint::interpreter::ValueType::Bool"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5BrushE", "slint::interpreter::ValueType::Brush"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ImageE", "slint::interpreter::ValueType::Image"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ModelE", "slint::interpreter::ValueType::Model"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6NumberE", "slint::interpreter::ValueType::Number"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5OtherE", "slint::interpreter::ValueType::Other"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StringE", "slint::interpreter::ValueType::String"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StructE", "slint::interpreter::ValueType::Struct"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4VoidE", "slint::interpreter::ValueType::Void"], [98, 2, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop"], [98, 6, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::Functor"], [98, 3, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::f"], [15, 1, 1, "_CPPv4N5slint8platform16AbstractRendererE", "slint::platform::AbstractRenderer"], [16, 1, 1, "_CPPv4N5slint8platform18NativeWindowHandleE", "slint::platform::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nsview"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nswindow"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::surface"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hinstance"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hwnd"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::connection"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator=::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev", "slint::platform::NativeWindowHandle::~NativeWindowHandle"], [17, 1, 1, "_CPPv4N5slint8platform8PlatformE", "slint::platform::Platform"], [17, 4, 1, "_CPPv4N5slint8platform8Platform9ClipboardE", "slint::platform::Platform::Clipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE", "slint::platform::Platform::Clipboard::DefaultClipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE", "slint::platform::Platform::Clipboard::SelectionClipboard"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform", "slint::platform::Platform::Platform"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformEv", "slint::platform::Platform::Platform"], [17, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [18, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [17, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [17, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [17, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [18, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard", "slint::platform::Platform::clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8Platform21create_window_adapterEv", "slint::platform::Platform::create_window_adapter"], [17, 2, 1, "_CPPv4N5slint8platform8Platform20duration_since_startEv", "slint::platform::Platform::duration_since_start"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformaSERK8Platform", "slint::platform::Platform::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform15quit_event_loopEv", "slint::platform::Platform::quit_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14run_event_loopEv", "slint::platform::Platform::run_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task", "slint::platform::Platform::run_in_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard", "slint::platform::Platform::set_clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformD0Ev", "slint::platform::Platform::~Platform"], [167, 1, 1, "_CPPv4N5slint8platform11Rgb565PixelE", "slint::platform::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel::pixel"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1bE", "slint::platform::Rgb565Pixel::b"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv", "slint::platform::Rgb565Pixel::blue"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1gE", "slint::platform::Rgb565Pixel::g"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv", "slint::platform::Rgb565Pixel::green"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv", "slint::platform::Rgb565Pixel::operator Rgb8Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator=="], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::lhs"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::rhs"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1rE", "slint::platform::Rgb565Pixel::r"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv", "slint::platform::Rgb565Pixel::red"], [19, 1, 1, "_CPPv4N5slint8platform12SkiaRendererE", "slint::platform::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::initial_size"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::window_handle"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer", "slint::platform::SkiaRenderer::operator="], [19, 2, 1, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv", "slint::platform::SkiaRenderer::render"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendererD0Ev", "slint::platform::SkiaRenderer::~SkiaRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRendererE", "slint::platform::SoftwareRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [169, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE", "slint::platform::SoftwareRenderer::RenderingRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE", "slint::platform::SoftwareRenderer::RenderingRotation::NoRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate180"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate270"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate90"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE", "slint::platform::SoftwareRenderer::RepaintBufferType"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::NewBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::ReusedBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE", "slint::platform::SoftwareRenderer::RepaintBufferType::SwappedBuffers"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer::buffer_type"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::operator="], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 2, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line"], [20, 6, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::Callback"], [20, 3, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::process_line_callback"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation::rotation"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendererD0Ev", "slint::platform::SoftwareRenderer::~SoftwareRenderer"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapterE", "slint::platform::WindowAdapter"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv", "slint::platform::WindowAdapter::WindowAdapter"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [171, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8positionEv", "slint::platform::WindowAdapter::position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8rendererEv", "slint::platform::WindowAdapter::renderer"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv", "slint::platform::WindowAdapter::request_redraw"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE", "slint::platform::WindowAdapter::set_position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE", "slint::platform::WindowAdapter::set_size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb", "slint::platform::WindowAdapter::set_visible"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter4sizeEv", "slint::platform::WindowAdapter::size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties", "slint::platform::WindowAdapter::update_window_properties"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapterD0Ev", "slint::platform::WindowAdapter::~WindowAdapter"], [93, 2, 1, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv", "slint::platform::duration_until_next_timer_update"], [95, 2, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform"], [95, 3, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform::platform"], [94, 2, 1, "_CPPv4N5slint8platform28update_timers_and_animationsEv", "slint::platform::update_timers_and_animations"], [97, 2, 1, "_CPPv4N5slint15quit_event_loopEv", "slint::quit_event_loop"], [100, 2, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop"], [100, 3, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop::mode"], [48, 4, 1, "_CPPv4N5slint7testing14AccessibleRoleE", "slint::testing::AccessibleRole"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6ButtonE", "slint::testing::AccessibleRole::Button"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE", "slint::testing::AccessibleRole::Checkbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE", "slint::testing::AccessibleRole::Combobox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4ListE", "slint::testing::AccessibleRole::List"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4NoneE", "slint::testing::AccessibleRole::None"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE", "slint::testing::AccessibleRole::ProgressIndicator"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SliderE", "slint::testing::AccessibleRole::Slider"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE", "slint::testing::AccessibleRole::Spinbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SwitchE", "slint::testing::AccessibleRole::Switch"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole3TabE", "slint::testing::AccessibleRole::Tab"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7TabListE", "slint::testing::AccessibleRole::TabList"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole5TableE", "slint::testing::AccessibleRole::Table"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TextE", "slint::testing::AccessibleRole::Text"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole9TextInputE", "slint::testing::AccessibleRole::TextInput"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TreeE", "slint::testing::AccessibleRole::Tree"], [22, 1, 1, "_CPPv4N5slint7testing13ElementHandleE", "slint::testing::ElementHandle"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv", "slint::testing::ElementHandle::absolute_position"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv", "slint::testing::ElementHandle::accessible_checkable"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv", "slint::testing::ElementHandle::accessible_checked"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv", "slint::testing::ElementHandle::accessible_description"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv", "slint::testing::ElementHandle::accessible_label"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv", "slint::testing::ElementHandle::accessible_placeholder_text"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv", "slint::testing::ElementHandle::accessible_role"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv", "slint::testing::ElementHandle::accessible_value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv", "slint::testing::ElementHandle::accessible_value_maximum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv", "slint::testing::ElementHandle::accessible_value_minimum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv", "slint::testing::ElementHandle::accessible_value_step"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle5basesEv", "slint::testing::ElementHandle::bases"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::label"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::element_id"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::type_name"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle2idEv", "slint::testing::ElementHandle::id"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv", "slint::testing::ElementHandle::invoke_accessible_decrement_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv", "slint::testing::ElementHandle::invoke_accessible_default_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv", "slint::testing::ElementHandle::invoke_accessible_increment_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle8is_validEv", "slint::testing::ElementHandle::is_valid"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value"], [22, 3, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value::value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle4sizeEv", "slint::testing::ElementHandle::size"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv", "slint::testing::ElementHandle::type_name"], [22, 2, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::R"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::T"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::Visitor"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::component"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::visitor"], [96, 2, 1, "_CPPv4N5slint7testing4initEv", "slint::testing::init"], [101, 2, 1, "_CPPv4N5slint23update_all_translationsEv", "slint::update_all_translations"]]}, "objtypes": {"0": "c:macro", "1": "cpp:class", "2": "cpp:function", "3": "cpp:functionParam", "4": "cpp:enum", "5": "cpp:enumerator", "6": "cpp:templateParam", "7": "cpp:member", "8": "cpp:type"}, "objnames": {"0": ["c", "macro", "C macro"], "1": ["cpp", "class", "C++ class"], "2": ["cpp", "function", "C++ function"], "3": ["cpp", "functionParam", "C++ function parameter"], "4": ["cpp", "enum", "C++ enum"], "5": ["cpp", "enumerator", "C++ enumerator"], "6": ["cpp", "templateParam", "C++ template parameter"], "7": ["cpp", "member", "C++ member"], "8": ["cpp", "type", "C++ type"]}, "titleterms": {"class": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 55, 56, 57, 58, 59, 61, 63, 66, 68, 69, 70, 72, 73, 75, 80, 83, 102, 103, 104, 105, 107], "brush": 0, "document": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 232], "color": 1, "templat": [2, 3, 4, 5, 6, 7, 8, 9, 98, 99, 153, 156, 157, 159, 160, 231], "componenthandl": 2, "componentweakhandl": 3, "filtermodel": 4, "inherit": [4, 5, 6, 7, 8, 9, 13, 15, 19, 20, 149, 150, 151, 152], "relationship": [4, 5, 6, 7, 8, 9, 13, 15, 17, 18, 19, 20, 21, 149, 150, 151, 152, 165, 166, 168, 169, 170, 171], "base": [4, 5, 7, 8, 9, 13, 19, 20, 149, 150, 151, 152], "type": [4, 5, 6, 7, 8, 9, 13, 15, 17, 19, 20, 21, 149, 150, 151, 152, 165, 168, 170, 234], "mapmodel": 5, "model": 6, "deriv": [6, 15], "reversemodel": 7, "sortmodel": 8, "vectormodel": 9, "window": 10, "componentcompil": 11, "componentdefinit": 12, "componentinst": 13, "valu": 14, "abstractrender": 15, "nativewindowhandl": 16, "platform": [17, 18, 56, 93, 94, 95, 105, 106, 110, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227], "nest": [17, 18, 20, 21, 165, 166, 168, 169, 170, 171], "task": 18, "skiarender": 19, "softwarerender": [20, 168], "windowadapt": [21, 170], "exampl": [21, 229], "elementhandl": 22, "defin": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 71, 80, 102], "slint_feature_backend_qt": 23, "slint_feature_gettext": 24, "slint_feature_interpret": 25, "slint_version_patch": 26, "slint_feature_backend_linuxkm": 27, "slint_feature_experiment": 28, "slint_version_str": 29, "slint_feature_renderer_femtovg": 30, "slint_feature_renderer_skia": 31, "slint_feature_system_test": 32, "slint_feature_access": 33, "slint_feature_renderer_softwar": 34, "slint_version_minor": 35, "slint_feature_freestand": 36, "slint_feature_test": 37, "slint_version_major": 38, "slint_feature_backend_winit": 39, "assert_eq": 40, "directori": [41, 42, 43, 44, 45, 172], "api": [41, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 102, 172], "subdirectori": [41, 42, 44], "cpp": [42, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "includ": [43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "file": [43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [44, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "generated_includ": [45, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "enum": [46, 47, 48, 49, 50, 51, 52, 53, 54, 58, 78, 80, 83, 102, 103, 104, 107, 234], "valuetyp": 46, "diagnosticlevel": 47, "accessiblerol": 48, "setrenderingnotifiererror": 49, "pointereventbutton": 50, "eventloopmod": 51, "graphicsapi": 52, "renderingst": 53, "closerequestrespons": 54, "slint": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 111, 112, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 232, 233], "interpret": [55, 104, 109, 233], "h": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "definit": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "home": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 214], "runner": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "work": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "By": [55, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92], "namespac": [55, 56, 57, 58, 59, 60, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 103, 104, 105, 106, 107], "function": [56, 57, 58, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 105, 107], "test": [57, 96, 107, 111], "slint_brush": [59, 113], "slint_callback": [60, 114], "slint_color": [61, 115], "slint_config": [62, 116], "slint_imag": [63, 117], "slint_interpret": [64, 118], "slint_pathdata": [65, 119], "slint_point": [66, 120], "slint_properti": [67, 121], "slint_sharedvector": [68, 122], "slint_siz": [69, 123], "slint_str": [70, 124], "slint_tests_help": [71, 125], "slint_tim": [72, 126], "slint_window": [73, 127], "slint_brush_intern": [74, 128], "slint_builtin_struct": [75, 129], "slint_builtin_structs_intern": [76, 130], "slint_color_intern": [77, 131], "slint_enum": [78, 132], "variabl": [78, 102, 106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "slint_enums_intern": [79, 133], "slint_generated_publ": [80, 134], "slint_image_intern": [81, 135], "slint_intern": [82, 136], "slint_interpreter_generated_publ": [83, 137], "slint_interpreter_intern": [84, 138], "slint_pathdata_intern": [85, 139], "slint_platform_intern": [86, 140], "slint_properties_intern": [87, 141], "slint_qt_intern": [88, 142], "slint_sharedvector_intern": [89, 143], "slint_string_intern": [90, 144], "slint_testing_intern": [91, 145], "slint_timer_intern": [92, 146], "duration_until_next_timer_upd": 93, "update_timers_and_anim": 94, "set_platform": 95, "init": 96, "quit_event_loop": 97, "invoke_from_event_loop": 98, "blocking_invoke_from_event_loop": 99, "run_event_loop": 100, "update_all_transl": 101, "c": [102, 230, 232], "refer": [102, 228], "page": [102, 172], "hierarchi": 102, "full": [102, 172], "struct": [102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], "detail": [103, 104, 105, 106, 107], "descript": [103, 104, 105, 106, 107], "key_cod": [106, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226], "deprec": 108, "list": [108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "program": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "hsvacolor": 147, "imag": 148, "logicalposit": 149, "logicals": 150, "physicalposit": 151, "physicals": 152, "point": 153, "rgb8pixel": 154, "rgba8pixel": 155, "rgbacolor": 156, "sharedpixelbuff": 157, "sharedstr": 158, "sharedvector": 159, "size": 160, "standardlistviewitem": 161, "timer": 162, "diagnost": 163, "propertydescriptor": 164, "iter": 166, "rgb565pixel": 167, "physicalregion": [168, 169], "rect": 169, "windowproperti": [170, 171], "layoutconstraint": 171, "f24": 173, "f1": 174, "capslock": 175, "space": 176, "menu": 177, "leftarrow": 178, "metar": 179, "paus": 180, "f4": 181, "f12": 182, "insert": 183, "downarrow": 184, "altgr": 185, "alt": 186, "f23": 187, "stop": 188, "f19": 189, "scrolllock": 190, "f13": 191, "f15": 192, "f14": 193, "backspac": 194, "f5": 195, "f6": 196, "meta": 197, "f9": 198, "f20": 199, "uparrow": 200, "f10": 201, "f2": 202, "f8": 203, "f18": 204, "pagedown": 205, "f11": 206, "f3": 207, "control": 208, "f16": 209, "controlr": 210, "return": 211, "f7": 212, "backtab": 213, "rightarrow": 215, "escap": 216, "sysreq": 217, "f21": 218, "f17": 219, "pageup": 220, "tab": 221, "end": 222, "shiftr": 223, "delet": 224, "shift": 225, "f22": 226, "set": 227, "up": 227, "develop": [227, 232], "environ": 227, "prerequisit": 227, "instal": 227, "binari": 227, "packag": 227, "build": 227, "from": 227, "sourc": 227, "featur": 227, "rust": 227, "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233], "microcontrol": [227, 228], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "gener": 229, "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": 232, "markup": 232, "languag": 232, "architectur": 232, "overview": 233, "design": 233, "run": 233, "time": 233, "map": 234, "structur": 234}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 58}, "alltitles": {"Class Brush": [[0, "class-brush"]], "Class Documentation": [[0, "class-documentation"], [1, "class-documentation"], [2, "class-documentation"], [3, "class-documentation"], [4, "class-documentation"], [5, "class-documentation"], [6, "class-documentation"], [7, "class-documentation"], [8, "class-documentation"], [9, "class-documentation"], [10, "class-documentation"], [11, "class-documentation"], [12, "class-documentation"], [13, "class-documentation"], [14, "class-documentation"], [15, "class-documentation"], [16, "class-documentation"], [17, "class-documentation"], [18, "class-documentation"], [19, "class-documentation"], [20, "class-documentation"], [21, "class-documentation"], [22, "class-documentation"]], "Class Color": [[1, "class-color"]], "Template Class ComponentHandle": [[2, "template-class-componenthandle"]], "Template Class ComponentWeakHandle": [[3, "template-class-componentweakhandle"]], "Template Class FilterModel": [[4, "template-class-filtermodel"]], "Inheritance Relationships": [[4, "inheritance-relationships"], [5, "inheritance-relationships"], [6, "inheritance-relationships"], [7, "inheritance-relationships"], [8, "inheritance-relationships"], [9, "inheritance-relationships"], [13, "inheritance-relationships"], [15, "inheritance-relationships"], [19, "inheritance-relationships"], [20, "inheritance-relationships"], [149, "inheritance-relationships"], [150, "inheritance-relationships"], [151, "inheritance-relationships"], [152, "inheritance-relationships"]], "Base Type": [[4, "base-type"], [5, "base-type"], [7, "base-type"], [8, "base-type"], [9, "base-type"], [13, "base-type"], [19, "base-type"], [20, "base-type"], [149, "base-type"], [150, "base-type"], [151, "base-type"], [152, "base-type"]], "Template Class MapModel": [[5, "template-class-mapmodel"]], "Template Class Model": [[6, "template-class-model"]], "Derived Types": [[6, "derived-types"], [15, "derived-types"]], "Template Class ReverseModel": [[7, "template-class-reversemodel"]], "Template Class SortModel": [[8, "template-class-sortmodel"]], "Template Class VectorModel": [[9, "template-class-vectormodel"]], "Class Window": [[10, "class-window"]], "Class ComponentCompiler": [[11, "class-componentcompiler"]], "Class ComponentDefinition": [[12, "class-componentdefinition"]], "Class ComponentInstance": [[13, "class-componentinstance"]], "Class Value": [[14, "class-value"]], "Class AbstractRenderer": [[15, "class-abstractrenderer"]], "Class NativeWindowHandle": [[16, "class-nativewindowhandle"]], "Class Platform": [[17, "class-platform"]], "Nested Relationships": [[17, "nested-relationships"], [18, "nested-relationships"], [20, "nested-relationships"], [21, "nested-relationships"], [165, "nested-relationships"], [166, "nested-relationships"], [168, "nested-relationships"], [169, "nested-relationships"], [170, "nested-relationships"], [171, "nested-relationships"]], "Nested Types": [[17, "nested-types"], [20, "nested-types"], [21, "nested-types"], [165, "nested-types"], [168, "nested-types"], [170, "nested-types"]], "Class Platform::Task": [[18, "class-platform-task"]], "Class SkiaRenderer": [[19, "class-skiarenderer"]], "Class SoftwareRenderer": [[20, "class-softwarerenderer"]], "Class WindowAdapter": [[21, "class-windowadapter"]], "Example": [[21, "classslint_1_1platform_1_1WindowAdapter_1autotoc_md0"], [229, "example"]], "Class ElementHandle": [[22, "class-elementhandle"]], "Define SLINT_FEATURE_BACKEND_QT": [[23, "define-slint-feature-backend-qt"]], "Define Documentation": [[23, "define-documentation"], [24, "define-documentation"], [25, "define-documentation"], [26, "define-documentation"], [27, "define-documentation"], [28, "define-documentation"], [29, "define-documentation"], [30, "define-documentation"], [31, "define-documentation"], [32, "define-documentation"], [33, "define-documentation"], [34, "define-documentation"], [35, "define-documentation"], [36, "define-documentation"], [37, "define-documentation"], [38, "define-documentation"], [39, "define-documentation"], [40, "define-documentation"]], "Define SLINT_FEATURE_GETTEXT": [[24, "define-slint-feature-gettext"]], "Define SLINT_FEATURE_INTERPRETER": [[25, "define-slint-feature-interpreter"]], "Define SLINT_VERSION_PATCH": [[26, "define-slint-version-patch"]], "Define SLINT_FEATURE_BACKEND_LINUXKMS": [[27, "define-slint-feature-backend-linuxkms"]], "Define SLINT_FEATURE_EXPERIMENTAL": [[28, "define-slint-feature-experimental"]], "Define SLINT_VERSION_STRING": [[29, "define-slint-version-string"]], "Define SLINT_FEATURE_RENDERER_FEMTOVG": [[30, "define-slint-feature-renderer-femtovg"]], "Define SLINT_FEATURE_RENDERER_SKIA": [[31, "define-slint-feature-renderer-skia"]], "Define SLINT_FEATURE_SYSTEM_TESTING": [[32, "define-slint-feature-system-testing"]], "Define SLINT_FEATURE_ACCESSIBILITY": [[33, "define-slint-feature-accessibility"]], "Define SLINT_FEATURE_RENDERER_SOFTWARE": [[34, "define-slint-feature-renderer-software"]], "Define SLINT_VERSION_MINOR": [[35, "define-slint-version-minor"]], "Define SLINT_FEATURE_FREESTANDING": [[36, "define-slint-feature-freestanding"]], "Define SLINT_FEATURE_TESTING": [[37, "define-slint-feature-testing"]], "Define SLINT_VERSION_MAJOR": [[38, "define-slint-version-major"]], "Define SLINT_FEATURE_BACKEND_WINIT": [[39, "define-slint-feature-backend-winit"]], "Define assert_eq": [[40, "define-assert-eq"]], "Directory api": [[41, "directory-api"]], "Subdirectories": [[41, "subdirectories"], [42, "subdirectories"], [44, "subdirectories"]], "Directory cpp": [[42, "directory-cpp"]], "Directory include": [[43, "directory-include"]], "Files": [[43, "files"], [45, "files"], [172, "files"]], "Directory cppdocs": [[44, "directory-cppdocs"]], "Directory generated_include": [[45, "directory-generated-include"]], "Enum ValueType": [[46, "enum-valuetype"]], "Enum Documentation": [[46, "enum-documentation"], [47, "enum-documentation"], [48, "enum-documentation"], [49, "enum-documentation"], [50, "enum-documentation"], [51, "enum-documentation"], [52, "enum-documentation"], [53, "enum-documentation"], [54, "enum-documentation"]], "Enum DiagnosticLevel": [[47, "enum-diagnosticlevel"]], "Enum AccessibleRole": [[48, "enum-accessiblerole"]], "Enum SetRenderingNotifierError": [[49, "enum-setrenderingnotifiererror"]], "Enum PointerEventButton": [[50, "enum-pointereventbutton"]], "Enum EventLoopMode": [[51, "enum-eventloopmode"]], "Enum GraphicsAPI": [[52, "enum-graphicsapi"]], "Enum RenderingState": [[53, "enum-renderingstate"]], "Enum CloseRequestResponse": [[54, "enum-closerequestresponse"]], "File slint-interpreter.h": [[55, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-interpreter.h)": [[55, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "Includes": [[55, "includes"], [56, "includes"], [57, "includes"], [58, "includes"], [59, "includes"], [60, "includes"], [61, "includes"], [62, "includes"], [63, "includes"], [64, "includes"], [65, "includes"], [66, "includes"], [67, "includes"], [68, "includes"], [69, "includes"], [70, "includes"], [71, "includes"], [72, "includes"], [73, "includes"], [74, "includes"], [76, "includes"], [77, "includes"], [79, "includes"], [80, "includes"], [81, "includes"], [82, "includes"], [83, "includes"], [84, "includes"], [85, "includes"], [86, "includes"], [87, "includes"], [88, "includes"], [89, "includes"], [90, "includes"], [91, "includes"], [92, "includes"]], "Included By": [[55, "included-by"], [57, "included-by"], [59, "included-by"], [60, "included-by"], [61, "included-by"], [62, "included-by"], [63, "included-by"], [65, "included-by"], [66, "included-by"], [67, "included-by"], [68, "included-by"], [69, "included-by"], [70, "included-by"], [72, "included-by"], [73, "included-by"], [74, "included-by"], [75, "included-by"], [76, "included-by"], [77, "included-by"], [78, "included-by"], [79, "included-by"], [80, "included-by"], [81, "included-by"], [82, "included-by"], [83, "included-by"], [85, "included-by"], [86, "included-by"], [87, "included-by"], [88, "included-by"], [89, "included-by"], [90, "included-by"], [91, "included-by"], [92, "included-by"]], "Namespaces": [[55, "namespaces"], [56, "namespaces"], [57, "namespaces"], [58, "namespaces"], [59, "namespaces"], [60, "namespaces"], [61, "namespaces"], [63, "namespaces"], [65, "namespaces"], [66, "namespaces"], [67, "namespaces"], [68, "namespaces"], [69, "namespaces"], [70, "namespaces"], [71, "namespaces"], [72, "namespaces"], [73, "namespaces"], [74, "namespaces"], [75, "namespaces"], [76, "namespaces"], [77, "namespaces"], [78, "namespaces"], [79, "namespaces"], [80, "namespaces"], [81, "namespaces"], [82, "namespaces"], [83, "namespaces"], [84, "namespaces"], [85, "namespaces"], [86, "namespaces"], [87, "namespaces"], [88, "namespaces"], [89, "namespaces"], [90, "namespaces"], [91, "namespaces"], [92, "namespaces"], [102, "namespaces"], [103, "namespaces"], [105, "namespaces"]], "Classes": [[55, "classes"], [56, "classes"], [57, "classes"], [58, "classes"], [59, "classes"], [61, "classes"], [63, "classes"], [66, "classes"], [68, "classes"], [69, "classes"], [70, "classes"], [72, "classes"], [73, "classes"], [75, "classes"], [80, "classes"], [83, "classes"], [103, "classes"], [104, "classes"], [105, "classes"], [107, "classes"]], "File slint-platform.h": [[56, "file-slint-platform-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-platform.h)": [[56, "definition-home-runner-work-slint-slint-api-cpp-include-slint-platform-h"]], "Functions": [[56, "functions"], [57, "functions"], [58, "functions"], [102, "functions"], [103, "functions"], [105, "functions"], [107, "functions"]], "File slint-testing.h": [[57, "file-slint-testing-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-testing.h)": [[57, "definition-home-runner-work-slint-slint-api-cpp-include-slint-testing-h"]], "File slint.h": [[58, "file-slint-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint.h)": [[58, "definition-home-runner-work-slint-slint-api-cpp-include-slint-h"]], "Enums": [[58, "enums"], [78, "enums"], [80, "enums"], [83, "enums"], [102, "enums"], [103, "enums"], [104, "enums"], [107, "enums"], [234, "enums"]], "File slint_brush.h": [[59, "file-slint-brush-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_brush.h)": [[59, "definition-home-runner-work-slint-slint-api-cpp-include-slint-brush-h"]], "File slint_callbacks.h": [[60, "file-slint-callbacks-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_callbacks.h)": [[60, "definition-home-runner-work-slint-slint-api-cpp-include-slint-callbacks-h"]], "File slint_color.h": [[61, "file-slint-color-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_color.h)": [[61, "definition-home-runner-work-slint-slint-api-cpp-include-slint-color-h"]], "File slint_config.h": [[62, "file-slint-config-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_config.h)": [[62, "definition-home-runner-work-slint-slint-api-cpp-include-slint-config-h"]], "File slint_image.h": [[63, "file-slint-image-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_image.h)": [[63, "definition-home-runner-work-slint-slint-api-cpp-include-slint-image-h"]], "File slint_interpreter.h": [[64, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_interpreter.h)": [[64, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "File slint_pathdata.h": [[65, "file-slint-pathdata-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_pathdata.h)": [[65, "definition-home-runner-work-slint-slint-api-cpp-include-slint-pathdata-h"]], "File slint_point.h": [[66, "file-slint-point-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_point.h)": [[66, "definition-home-runner-work-slint-slint-api-cpp-include-slint-point-h"]], "File slint_properties.h": [[67, "file-slint-properties-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_properties.h)": [[67, "definition-home-runner-work-slint-slint-api-cpp-include-slint-properties-h"]], "File slint_sharedvector.h": [[68, "file-slint-sharedvector-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_sharedvector.h)": [[68, "definition-home-runner-work-slint-slint-api-cpp-include-slint-sharedvector-h"]], "File slint_size.h": [[69, "file-slint-size-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_size.h)": [[69, "definition-home-runner-work-slint-slint-api-cpp-include-slint-size-h"]], "File slint_string.h": [[70, "file-slint-string-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_string.h)": [[70, "definition-home-runner-work-slint-slint-api-cpp-include-slint-string-h"]], "File slint_tests_helpers.h": [[71, "file-slint-tests-helpers-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_tests_helpers.h)": [[71, "definition-home-runner-work-slint-slint-api-cpp-include-slint-tests-helpers-h"]], "Defines": [[71, "defines"], [80, "defines"], [102, "defines"]], "File slint_timer.h": [[72, "file-slint-timer-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_timer.h)": [[72, "definition-home-runner-work-slint-slint-api-cpp-include-slint-timer-h"]], "File slint_window.h": [[73, "file-slint-window-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_window.h)": [[73, "definition-home-runner-work-slint-slint-api-cpp-include-slint-window-h"]], "File slint_brush_internal.h": [[74, "file-slint-brush-internal-h"]], "Definition (cppdocs/generated_include/slint_brush_internal.h)": [[74, "definition-cppdocs-generated-include-slint-brush-internal-h"]], "File slint_builtin_structs.h": [[75, "file-slint-builtin-structs-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs.h)": [[75, "definition-cppdocs-generated-include-slint-builtin-structs-h"]], "File slint_builtin_structs_internal.h": [[76, "file-slint-builtin-structs-internal-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs_internal.h)": [[76, "definition-cppdocs-generated-include-slint-builtin-structs-internal-h"]], "File slint_color_internal.h": [[77, "file-slint-color-internal-h"]], "Definition (cppdocs/generated_include/slint_color_internal.h)": [[77, "definition-cppdocs-generated-include-slint-color-internal-h"]], "File slint_enums.h": [[78, "file-slint-enums-h"]], "Definition (cppdocs/generated_include/slint_enums.h)": [[78, "definition-cppdocs-generated-include-slint-enums-h"]], "Variables": [[78, "variables"], [102, "variables"], [106, "variables"]], "File slint_enums_internal.h": [[79, "file-slint-enums-internal-h"]], "Definition (cppdocs/generated_include/slint_enums_internal.h)": [[79, "definition-cppdocs-generated-include-slint-enums-internal-h"]], "File slint_generated_public.h": [[80, "file-slint-generated-public-h"]], "Definition (cppdocs/generated_include/slint_generated_public.h)": [[80, "definition-cppdocs-generated-include-slint-generated-public-h"]], "File slint_image_internal.h": [[81, "file-slint-image-internal-h"]], "Definition (cppdocs/generated_include/slint_image_internal.h)": [[81, "definition-cppdocs-generated-include-slint-image-internal-h"]], "File slint_internal.h": [[82, "file-slint-internal-h"]], "Definition (cppdocs/generated_include/slint_internal.h)": [[82, "definition-cppdocs-generated-include-slint-internal-h"]], "File slint_interpreter_generated_public.h": [[83, "file-slint-interpreter-generated-public-h"]], "Definition (cppdocs/generated_include/slint_interpreter_generated_public.h)": [[83, "definition-cppdocs-generated-include-slint-interpreter-generated-public-h"]], "File slint_interpreter_internal.h": [[84, "file-slint-interpreter-internal-h"]], "Definition (cppdocs/generated_include/slint_interpreter_internal.h)": [[84, "definition-cppdocs-generated-include-slint-interpreter-internal-h"]], "File slint_pathdata_internal.h": [[85, "file-slint-pathdata-internal-h"]], "Definition (cppdocs/generated_include/slint_pathdata_internal.h)": [[85, "definition-cppdocs-generated-include-slint-pathdata-internal-h"]], "File slint_platform_internal.h": [[86, "file-slint-platform-internal-h"]], "Definition (cppdocs/generated_include/slint_platform_internal.h)": [[86, "definition-cppdocs-generated-include-slint-platform-internal-h"]], "File slint_properties_internal.h": [[87, "file-slint-properties-internal-h"]], "Definition (cppdocs/generated_include/slint_properties_internal.h)": [[87, "definition-cppdocs-generated-include-slint-properties-internal-h"]], "File slint_qt_internal.h": [[88, "file-slint-qt-internal-h"]], "Definition (cppdocs/generated_include/slint_qt_internal.h)": [[88, "definition-cppdocs-generated-include-slint-qt-internal-h"]], "File slint_sharedvector_internal.h": [[89, "file-slint-sharedvector-internal-h"]], "Definition (cppdocs/generated_include/slint_sharedvector_internal.h)": [[89, "definition-cppdocs-generated-include-slint-sharedvector-internal-h"]], "File slint_string_internal.h": [[90, "file-slint-string-internal-h"]], "Definition (cppdocs/generated_include/slint_string_internal.h)": [[90, "definition-cppdocs-generated-include-slint-string-internal-h"]], "File slint_testing_internal.h": [[91, "file-slint-testing-internal-h"]], "Definition (cppdocs/generated_include/slint_testing_internal.h)": [[91, "definition-cppdocs-generated-include-slint-testing-internal-h"]], "File slint_timer_internal.h": [[92, "file-slint-timer-internal-h"]], "Definition (cppdocs/generated_include/slint_timer_internal.h)": [[92, "definition-cppdocs-generated-include-slint-timer-internal-h"]], "Function slint::platform::duration_until_next_timer_update": [[93, "function-slint-platform-duration-until-next-timer-update"]], "Function Documentation": [[93, "function-documentation"], [94, "function-documentation"], [95, "function-documentation"], [96, "function-documentation"], [97, "function-documentation"], [98, "function-documentation"], [99, "function-documentation"], [100, "function-documentation"], [101, "function-documentation"]], "Function slint::platform::update_timers_and_animations": [[94, "function-slint-platform-update-timers-and-animations"]], "Function slint::platform::set_platform": [[95, "function-slint-platform-set-platform"]], "Function slint::testing::init": [[96, "function-slint-testing-init"]], "Function slint::quit_event_loop": [[97, "function-slint-quit-event-loop"]], "Template Function slint::invoke_from_event_loop": [[98, "template-function-slint-invoke-from-event-loop"]], "Template Function slint::blocking_invoke_from_event_loop": [[99, "template-function-slint-blocking-invoke-from-event-loop"]], "Function slint::run_event_loop": [[100, "function-slint-run-event-loop"]], "Function slint::update_all_translations": [[101, "function-slint-update-all-translations"]], "C++ API Reference": [[102, "c-api-reference"]], "Page Hierarchy": [[102, "page-hierarchy"]], "Class Hierarchy": [[102, "class-hierarchy"]], "File Hierarchy": [[102, "file-hierarchy"]], "Full API": [[102, "full-api"], [172, "full-api"]], "Classes and Structs": [[102, "classes-and-structs"]], "Namespace slint": [[103, "namespace-slint"]], "Detailed Description": [[103, "detailed-description"], [104, "detailed-description"], [105, "detailed-description"], [106, "detailed-description"], [107, "detailed-description"]], "Namespace slint::interpreter": [[104, "namespace-slint-interpreter"]], "Namespace slint::platform": [[105, "namespace-slint-platform"]], "Namespace slint::platform::key_codes": [[106, "namespace-slint-platform-key-codes"]], "Namespace slint::testing": [[107, "namespace-slint-testing"]], "Deprecated List": [[108, "deprecated-list"]], "Program Listing for File slint-interpreter.h": [[109, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint-platform.h": [[110, "program-listing-for-file-slint-platform-h"]], "Program Listing for File slint-testing.h": [[111, "program-listing-for-file-slint-testing-h"]], "Program Listing for File slint.h": [[112, "program-listing-for-file-slint-h"]], "Program Listing for File slint_brush.h": [[113, "program-listing-for-file-slint-brush-h"]], "Program Listing for File slint_callbacks.h": [[114, "program-listing-for-file-slint-callbacks-h"]], "Program Listing for File slint_color.h": [[115, "program-listing-for-file-slint-color-h"]], "Program Listing for File slint_config.h": [[116, "program-listing-for-file-slint-config-h"]], "Program Listing for File slint_image.h": [[117, "program-listing-for-file-slint-image-h"]], "Program Listing for File slint_interpreter.h": [[118, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint_pathdata.h": [[119, "program-listing-for-file-slint-pathdata-h"]], "Program Listing for File slint_point.h": [[120, "program-listing-for-file-slint-point-h"]], "Program Listing for File slint_properties.h": [[121, "program-listing-for-file-slint-properties-h"]], "Program Listing for File slint_sharedvector.h": [[122, "program-listing-for-file-slint-sharedvector-h"]], "Program Listing for File slint_size.h": [[123, "program-listing-for-file-slint-size-h"]], "Program Listing for File slint_string.h": [[124, "program-listing-for-file-slint-string-h"]], "Program Listing for File slint_tests_helpers.h": [[125, "program-listing-for-file-slint-tests-helpers-h"]], "Program Listing for File slint_timer.h": [[126, "program-listing-for-file-slint-timer-h"]], "Program Listing for File slint_window.h": [[127, "program-listing-for-file-slint-window-h"]], "Program Listing for File slint_brush_internal.h": [[128, "program-listing-for-file-slint-brush-internal-h"]], "Program Listing for File slint_builtin_structs.h": [[129, "program-listing-for-file-slint-builtin-structs-h"]], "Program Listing for File slint_builtin_structs_internal.h": [[130, "program-listing-for-file-slint-builtin-structs-internal-h"]], "Program Listing for File slint_color_internal.h": [[131, "program-listing-for-file-slint-color-internal-h"]], "Program Listing for File slint_enums.h": [[132, "program-listing-for-file-slint-enums-h"]], "Program Listing for File slint_enums_internal.h": [[133, "program-listing-for-file-slint-enums-internal-h"]], "Program Listing for File slint_generated_public.h": [[134, "program-listing-for-file-slint-generated-public-h"]], "Program Listing for File slint_image_internal.h": [[135, "program-listing-for-file-slint-image-internal-h"]], "Program Listing for File slint_internal.h": [[136, "program-listing-for-file-slint-internal-h"]], "Program Listing for File slint_interpreter_generated_public.h": [[137, "program-listing-for-file-slint-interpreter-generated-public-h"]], "Program Listing for File slint_interpreter_internal.h": [[138, "program-listing-for-file-slint-interpreter-internal-h"]], "Program Listing for File slint_pathdata_internal.h": [[139, "program-listing-for-file-slint-pathdata-internal-h"]], "Program Listing for File slint_platform_internal.h": [[140, "program-listing-for-file-slint-platform-internal-h"]], "Program Listing for File slint_properties_internal.h": [[141, "program-listing-for-file-slint-properties-internal-h"]], "Program Listing for File slint_qt_internal.h": [[142, "program-listing-for-file-slint-qt-internal-h"]], "Program Listing for File slint_sharedvector_internal.h": [[143, "program-listing-for-file-slint-sharedvector-internal-h"]], "Program Listing for File slint_string_internal.h": [[144, "program-listing-for-file-slint-string-internal-h"]], "Program Listing for File slint_testing_internal.h": [[145, "program-listing-for-file-slint-testing-internal-h"]], "Program Listing for File slint_timer_internal.h": [[146, "program-listing-for-file-slint-timer-internal-h"]], "Struct HsvaColor": [[147, "struct-hsvacolor"]], "Struct Documentation": [[147, "struct-documentation"], [148, "struct-documentation"], [149, "struct-documentation"], [150, "struct-documentation"], [151, "struct-documentation"], [152, "struct-documentation"], [153, "struct-documentation"], [154, "struct-documentation"], [155, "struct-documentation"], [156, "struct-documentation"], [157, "struct-documentation"], [158, "struct-documentation"], [159, "struct-documentation"], [160, "struct-documentation"], [161, "struct-documentation"], [162, "struct-documentation"], [163, "struct-documentation"], [164, "struct-documentation"], [165, "struct-documentation"], [166, "struct-documentation"], [167, "struct-documentation"], [168, "struct-documentation"], [169, "struct-documentation"], [170, "struct-documentation"], [171, "struct-documentation"]], "Struct Image": [[148, "struct-image"]], "Struct LogicalPosition": [[149, "struct-logicalposition"]], "Struct LogicalSize": [[150, "struct-logicalsize"]], "Struct PhysicalPosition": [[151, "struct-physicalposition"]], "Struct PhysicalSize": [[152, "struct-physicalsize"]], "Template Struct Point": [[153, "template-struct-point"]], "Struct Rgb8Pixel": [[154, "struct-rgb8pixel"]], "Struct Rgba8Pixel": [[155, "struct-rgba8pixel"]], "Template Struct RgbaColor": [[156, "template-struct-rgbacolor"]], "Template Struct SharedPixelBuffer": [[157, "template-struct-sharedpixelbuffer"]], "Struct SharedString": [[158, "struct-sharedstring"]], "Template Struct SharedVector": [[159, "template-struct-sharedvector"]], "Template Struct Size": [[160, "template-struct-size"]], "Struct StandardListViewItem": [[161, "struct-standardlistviewitem"]], "Struct Timer": [[162, "struct-timer"]], "Struct Diagnostic": [[163, "struct-diagnostic"]], "Struct PropertyDescriptor": [[164, "struct-propertydescriptor"]], "Struct Struct": [[165, "struct-struct"]], "Struct Struct::iterator": [[166, "struct-struct-iterator"]], "Struct Rgb565Pixel": [[167, "struct-rgb565pixel"]], "Struct SoftwareRenderer::PhysicalRegion": [[168, "struct-softwarerenderer-physicalregion"]], "Struct PhysicalRegion::Rect": [[169, "struct-physicalregion-rect"]], "Struct WindowAdapter::WindowProperties": [[170, "struct-windowadapter-windowproperties"]], "Struct WindowProperties::LayoutConstraints": [[171, "struct-windowproperties-layoutconstraints"]], "Directories": [[172, "directories"]], "Pages": [[172, "pages"]], "Variable slint::platform::key_codes::F24": [[173, "variable-slint-platform-key-codes-f24"]], "Variable Documentation": [[173, "variable-documentation"], [174, "variable-documentation"], [175, "variable-documentation"], [176, "variable-documentation"], [177, "variable-documentation"], [178, "variable-documentation"], [179, "variable-documentation"], [180, "variable-documentation"], [181, "variable-documentation"], [182, "variable-documentation"], [183, "variable-documentation"], [184, "variable-documentation"], [185, "variable-documentation"], [186, "variable-documentation"], [187, "variable-documentation"], [188, "variable-documentation"], [189, "variable-documentation"], [190, "variable-documentation"], [191, "variable-documentation"], [192, "variable-documentation"], [193, "variable-documentation"], [194, "variable-documentation"], [195, "variable-documentation"], [196, "variable-documentation"], [197, "variable-documentation"], [198, "variable-documentation"], [199, "variable-documentation"], [200, "variable-documentation"], [201, "variable-documentation"], [202, "variable-documentation"], [203, "variable-documentation"], [204, "variable-documentation"], [205, "variable-documentation"], [206, "variable-documentation"], [207, "variable-documentation"], [208, "variable-documentation"], [209, "variable-documentation"], [210, "variable-documentation"], [211, "variable-documentation"], [212, "variable-documentation"], [213, "variable-documentation"], [214, "variable-documentation"], [215, "variable-documentation"], [216, "variable-documentation"], [217, "variable-documentation"], [218, "variable-documentation"], [219, "variable-documentation"], [220, "variable-documentation"], [221, "variable-documentation"], [222, "variable-documentation"], [223, "variable-documentation"], [224, "variable-documentation"], [225, "variable-documentation"], [226, "variable-documentation"]], "Variable slint::platform::key_codes::F1": [[174, "variable-slint-platform-key-codes-f1"]], "Variable slint::platform::key_codes::CapsLock": [[175, "variable-slint-platform-key-codes-capslock"]], "Variable slint::platform::key_codes::Space": [[176, "variable-slint-platform-key-codes-space"]], "Variable slint::platform::key_codes::Menu": [[177, "variable-slint-platform-key-codes-menu"]], "Variable slint::platform::key_codes::LeftArrow": [[178, "variable-slint-platform-key-codes-leftarrow"]], "Variable slint::platform::key_codes::MetaR": [[179, "variable-slint-platform-key-codes-metar"]], "Variable slint::platform::key_codes::Pause": [[180, "variable-slint-platform-key-codes-pause"]], "Variable slint::platform::key_codes::F4": [[181, "variable-slint-platform-key-codes-f4"]], "Variable slint::platform::key_codes::F12": [[182, "variable-slint-platform-key-codes-f12"]], "Variable slint::platform::key_codes::Insert": [[183, "variable-slint-platform-key-codes-insert"]], "Variable slint::platform::key_codes::DownArrow": [[184, "variable-slint-platform-key-codes-downarrow"]], "Variable slint::platform::key_codes::AltGr": [[185, "variable-slint-platform-key-codes-altgr"]], "Variable slint::platform::key_codes::Alt": [[186, "variable-slint-platform-key-codes-alt"]], "Variable slint::platform::key_codes::F23": [[187, "variable-slint-platform-key-codes-f23"]], "Variable slint::platform::key_codes::Stop": [[188, "variable-slint-platform-key-codes-stop"]], "Variable slint::platform::key_codes::F19": [[189, "variable-slint-platform-key-codes-f19"]], "Variable slint::platform::key_codes::ScrollLock": [[190, "variable-slint-platform-key-codes-scrolllock"]], "Variable slint::platform::key_codes::F13": [[191, "variable-slint-platform-key-codes-f13"]], "Variable slint::platform::key_codes::F15": [[192, "variable-slint-platform-key-codes-f15"]], "Variable slint::platform::key_codes::F14": [[193, "variable-slint-platform-key-codes-f14"]], "Variable slint::platform::key_codes::Backspace": [[194, "variable-slint-platform-key-codes-backspace"]], "Variable slint::platform::key_codes::F5": [[195, "variable-slint-platform-key-codes-f5"]], "Variable slint::platform::key_codes::F6": [[196, "variable-slint-platform-key-codes-f6"]], "Variable slint::platform::key_codes::Meta": [[197, "variable-slint-platform-key-codes-meta"]], "Variable slint::platform::key_codes::F9": [[198, "variable-slint-platform-key-codes-f9"]], "Variable slint::platform::key_codes::F20": [[199, "variable-slint-platform-key-codes-f20"]], "Variable slint::platform::key_codes::UpArrow": [[200, "variable-slint-platform-key-codes-uparrow"]], "Variable slint::platform::key_codes::F10": [[201, "variable-slint-platform-key-codes-f10"]], "Variable slint::platform::key_codes::F2": [[202, "variable-slint-platform-key-codes-f2"]], "Variable slint::platform::key_codes::F8": [[203, "variable-slint-platform-key-codes-f8"]], "Variable slint::platform::key_codes::F18": [[204, "variable-slint-platform-key-codes-f18"]], "Variable slint::platform::key_codes::PageDown": [[205, "variable-slint-platform-key-codes-pagedown"]], "Variable slint::platform::key_codes::F11": [[206, "variable-slint-platform-key-codes-f11"]], "Variable slint::platform::key_codes::F3": [[207, "variable-slint-platform-key-codes-f3"]], "Variable slint::platform::key_codes::Control": [[208, "variable-slint-platform-key-codes-control"]], "Variable slint::platform::key_codes::F16": [[209, "variable-slint-platform-key-codes-f16"]], "Variable slint::platform::key_codes::ControlR": [[210, "variable-slint-platform-key-codes-controlr"]], "Variable slint::platform::key_codes::Return": [[211, "variable-slint-platform-key-codes-return"]], "Variable slint::platform::key_codes::F7": [[212, "variable-slint-platform-key-codes-f7"]], "Variable slint::platform::key_codes::Backtab": [[213, "variable-slint-platform-key-codes-backtab"]], "Variable slint::platform::key_codes::Home": [[214, "variable-slint-platform-key-codes-home"]], "Variable slint::platform::key_codes::RightArrow": [[215, "variable-slint-platform-key-codes-rightarrow"]], "Variable slint::platform::key_codes::Escape": [[216, "variable-slint-platform-key-codes-escape"]], "Variable slint::platform::key_codes::SysReq": [[217, "variable-slint-platform-key-codes-sysreq"]], "Variable slint::platform::key_codes::F21": [[218, "variable-slint-platform-key-codes-f21"]], "Variable slint::platform::key_codes::F17": [[219, "variable-slint-platform-key-codes-f17"]], "Variable slint::platform::key_codes::PageUp": [[220, "variable-slint-platform-key-codes-pageup"]], "Variable slint::platform::key_codes::Tab": [[221, "variable-slint-platform-key-codes-tab"]], "Variable slint::platform::key_codes::End": [[222, "variable-slint-platform-key-codes-end"]], "Variable slint::platform::key_codes::ShiftR": [[223, "variable-slint-platform-key-codes-shiftr"]], "Variable slint::platform::key_codes::Delete": [[224, "variable-slint-platform-key-codes-delete"]], "Variable slint::platform::key_codes::Shift": [[225, "variable-slint-platform-key-codes-shift"]], "Variable slint::platform::key_codes::F22": [[226, "variable-slint-platform-key-codes-f22"]], "Set Up Development Environment": [[227, "set-up-development-environment"]], "Prerequisites": [[227, "prerequisites"]], "Install Slint": [[227, "install-slint"]], "Install Binary Packages": [[227, "install-binary-packages"]], "Build From Sources": [[227, "build-from-sources"]], "Features": [[227, "features"]], "Rust Flags": [[227, "rust-flags"]], "Platform Backends": [[227, "platform-backends"]], "Cross-compiling": [[227, "cross-compiling"]], "Microcontrollers": [[227, "microcontrollers"]], "CMake Reference": [[228, "cmake-reference"]], "slint_target_sources": [[228, "slint-target-sources"]], "Resource Embedding": [[228, "resource-embedding"]], "Scale Factor for Microcontrollers": [[228, "scale-factor-for-microcontrollers"]], "Generated Code": [[229, "generated-code"]], "Global Singletons": [[229, "global-singletons"]], "Index (C++)": [[230, "index-c"]], "Getting Started": [[231, "getting-started"]], "Tutorial": [[231, "tutorial"]], "Template": [[231, "template"]], "Slint C++ documentation": [[232, "slint-c-documentation"]], "The .slint Markup Language": [[232, "the-slint-markup-language"]], "Architecture": [[232, "architecture"]], "Developing": [[232, "developing"]], "Overview": [[233, "overview"]], "Compiled .slint Designs": [[233, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[233, "run-time-interpreted-slint-designs"]], "Type Mappings": [[234, "type-mappings"]], "Structures": [[234, "structures"]]}, "indexentries": {"brush (c++ class)": [[0, "_CPPv4N5slint5BrushE"]], "brush::brush (c++ function)": [[0, "_CPPv4N5slint5Brush5BrushERK5Color"], [0, "_CPPv4N5slint5Brush5BrushEv"]], "brush::brighter (c++ function)": [[0, "_CPPv4NK5slint5Brush8brighterEf"]], "brush::color (c++ function)": [[0, "_CPPv4NK5slint5Brush5colorEv"]], "brush::darker (c++ function)": [[0, "_CPPv4NK5slint5Brush6darkerEf"]], "brush::operator!= (c++ function)": [[0, "_CPPv4N5slint5BrushneERK5BrushRK5Brush"]], "brush::operator== (c++ function)": [[0, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush"]], "brush::transparentize (c++ function)": [[0, "_CPPv4NK5slint5Brush14transparentizeEf"]], "brush::with_alpha (c++ function)": [[0, "_CPPv4NK5slint5Brush10with_alphaEf"]], "color (c++ class)": [[1, "_CPPv4N5slint5ColorE"]], "color::color (c++ function)": [[1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE"], [1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE"], [1, "_CPPv4N5slint5Color5ColorEv"]], "color::alpha (c++ function)": [[1, "_CPPv4NK5slint5Color5alphaEv"]], "color::as_argb_encoded (c++ function)": [[1, "_CPPv4NK5slint5Color15as_argb_encodedEv"]], "color::blue (c++ function)": [[1, "_CPPv4NK5slint5Color4blueEv"]], "color::brighter (c++ function)": [[1, "_CPPv4NK5slint5Color8brighterEf"]], "color::darker (c++ function)": [[1, "_CPPv4NK5slint5Color6darkerEf"]], "color::from_argb_encoded (c++ function)": [[1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t"]], "color::from_argb_float (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_floatEffff"]], "color::from_argb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t"]], "color::from_hsva (c++ function)": [[1, "_CPPv4N5slint5Color9from_hsvaEffff"]], "color::from_rgb_float (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_floatEfff"]], "color::from_rgb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t"]], "color::green (c++ function)": [[1, "_CPPv4NK5slint5Color5greenEv"]], "color::mix (c++ function)": [[1, "_CPPv4NK5slint5Color3mixERK5Colorf"]], "color::operator<< (c++ function)": [[1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color"]], "color::operator== (c++ function)": [[1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color"]], "color::red (c++ function)": [[1, "_CPPv4NK5slint5Color3redEv"]], "color::to_argb_float (c++ function)": [[1, "_CPPv4NK5slint5Color13to_argb_floatEv"]], "color::to_argb_uint (c++ function)": [[1, "_CPPv4NK5slint5Color12to_argb_uintEv"]], "color::to_hsva (c++ function)": [[1, "_CPPv4NK5slint5Color7to_hsvaEv"]], "color::transparentize (c++ function)": [[1, "_CPPv4NK5slint5Color14transparentizeEf"]], "color::with_alpha (c++ function)": [[1, "_CPPv4NK5slint5Color10with_alphaEf"]], "componenthandle (c++ class)": [[2, "_CPPv4I0EN5slint15ComponentHandleE"]], "componenthandle::componenthandle (c++ function)": [[2, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE"]], "componenthandle::into_dyn (c++ function)": [[2, "_CPPv4NK5slint15ComponentHandle8into_dynEv"]], "componenthandle::operator* (c++ function)": [[2, "_CPPv4N5slint15ComponentHandlemlEv"], [2, "_CPPv4NK5slint15ComponentHandlemlEv"]], "componenthandle::operator-> (c++ function)": [[2, "_CPPv4N5slint15ComponentHandleptEv"], [2, "_CPPv4NK5slint15ComponentHandleptEv"]], "componentweakhandle (c++ class)": [[3, "_CPPv4I0EN5slint19ComponentWeakHandleE"]], "componentweakhandle::componentweakhandle (c++ function)": [[3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE"], [3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv"]], "componentweakhandle::lock (c++ function)": [[3, "_CPPv4NK5slint19ComponentWeakHandle4lockEv"]], "filtermodel (c++ class)": [[4, "_CPPv4I0EN5slint11FilterModelE"]], "filtermodel::filtermodel (c++ function)": [[4, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE"]], "filtermodel::reset (c++ function)": [[4, "_CPPv4N5slint11FilterModel5resetEv"]], "filtermodel::row_count (c++ function)": [[4, "_CPPv4NK5slint11FilterModel9row_countEv"]], "filtermodel::row_data (c++ function)": [[4, "_CPPv4NK5slint11FilterModel8row_dataE6size_t"]], "filtermodel::set_row_data (c++ function)": [[4, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData"]], "filtermodel::source_model (c++ function)": [[4, "_CPPv4NK5slint11FilterModel12source_modelEv"]], "filtermodel::unfiltered_row (c++ function)": [[4, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi"]], "mapmodel (c++ class)": [[5, "_CPPv4I00EN5slint8MapModelE"]], "mapmodel::mapmodel (c++ function)": [[5, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE"]], "mapmodel::reset (c++ function)": [[5, "_CPPv4N5slint8MapModel5resetEv"]], "mapmodel::row_count (c++ function)": [[5, "_CPPv4NK5slint8MapModel9row_countEv"]], "mapmodel::row_data (c++ function)": [[5, "_CPPv4NK5slint8MapModel8row_dataE6size_t"]], "mapmodel::source_model (c++ function)": [[5, "_CPPv4NK5slint8MapModel12source_modelEv"]], "model (c++ class)": [[6, "_CPPv4I0EN5slint5ModelE"]], "model::model (c++ function)": [[6, "_CPPv4N5slint5Model5ModelERK5Model"], [6, "_CPPv4N5slint5Model5ModelEv"]], "model::operator= (c++ function)": [[6, "_CPPv4N5slint5ModelaSERK5Model"]], "model::reset (c++ function)": [[6, "_CPPv4N5slint5Model5resetEv"]], "model::row_added (c++ function)": [[6, "_CPPv4N5slint5Model9row_addedE6size_t6size_t"]], "model::row_changed (c++ function)": [[6, "_CPPv4N5slint5Model11row_changedE6size_t"]], "model::row_count (c++ function)": [[6, "_CPPv4NK5slint5Model9row_countEv"]], "model::row_data (c++ function)": [[6, "_CPPv4NK5slint5Model8row_dataE6size_t"]], "model::row_removed (c++ function)": [[6, "_CPPv4N5slint5Model11row_removedE6size_t6size_t"]], "model::set_row_data (c++ function)": [[6, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData"]], "model::~model (c++ function)": [[6, "_CPPv4N5slint5ModelD0Ev"]], "reversemodel (c++ class)": [[7, "_CPPv4I0EN5slint12ReverseModelE"]], "reversemodel::reversemodel (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE"]], "reversemodel::row_count (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel9row_countEv"]], "reversemodel::row_data (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t"]], "reversemodel::set_row_data (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData"]], "reversemodel::source_model (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel12source_modelEv"]], "sortmodel (c++ class)": [[8, "_CPPv4I0EN5slint9SortModelE"]], "sortmodel::sortmodel (c++ function)": [[8, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE"]], "sortmodel::reset (c++ function)": [[8, "_CPPv4N5slint9SortModel5resetEv"]], "sortmodel::row_count (c++ function)": [[8, "_CPPv4NK5slint9SortModel9row_countEv"]], "sortmodel::row_data (c++ function)": [[8, "_CPPv4NK5slint9SortModel8row_dataE6size_t"]], "sortmodel::set_row_data (c++ function)": [[8, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData"]], "sortmodel::source_model (c++ function)": [[8, "_CPPv4NK5slint9SortModel12source_modelEv"]], "sortmodel::unsorted_row (c++ function)": [[8, "_CPPv4NK5slint9SortModel12unsorted_rowEi"]], "vectormodel (c++ class)": [[9, "_CPPv4I0EN5slint11VectorModelE"]], "vectormodel::vectormodel (c++ function)": [[9, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE"], [9, "_CPPv4N5slint11VectorModel11VectorModelEv"]], "vectormodel::clear (c++ function)": [[9, "_CPPv4N5slint11VectorModel5clearEv"]], "vectormodel::erase (c++ function)": [[9, "_CPPv4N5slint11VectorModel5eraseE6size_t"]], "vectormodel::insert (c++ function)": [[9, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData"]], "vectormodel::push_back (c++ function)": [[9, "_CPPv4N5slint11VectorModel9push_backERK9ModelData"]], "vectormodel::row_count (c++ function)": [[9, "_CPPv4NK5slint11VectorModel9row_countEv"]], "vectormodel::row_data (c++ function)": [[9, "_CPPv4NK5slint11VectorModel8row_dataE6size_t"]], "vectormodel::set_row_data (c++ function)": [[9, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData"]], "vectormodel::set_vector (c++ function)": [[9, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE"]], "window (c++ class)": [[10, "_CPPv4N5slint6WindowE"]], "window::window (c++ function)": [[10, "_CPPv4N5slint6Window6WindowERK6Window"], [10, "_CPPv4N5slint6Window6WindowERR6Window"]], "window::dispatch_close_requested_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv"]], "window::dispatch_key_press_event (c++ function)": [[10, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString"]], "window::dispatch_key_press_repeat_event (c++ function)": [[10, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString"]], "window::dispatch_key_release_event (c++ function)": [[10, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString"]], "window::dispatch_pointer_exit_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv"]], "window::dispatch_pointer_move_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition"]], "window::dispatch_pointer_press_event (c++ function)": [[10, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_release_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_scroll_event (c++ function)": [[10, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff"]], "window::dispatch_resize_event (c++ function)": [[10, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE"]], "window::dispatch_scale_factor_change_event (c++ function)": [[10, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf"]], "window::dispatch_window_active_changed_event (c++ function)": [[10, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb"]], "window::has_active_animations (c++ function)": [[10, "_CPPv4NK5slint6Window21has_active_animationsEv"]], "window::hide (c++ function)": [[10, "_CPPv4N5slint6Window4hideEv"]], "window::is_fullscreen (c++ function)": [[10, "_CPPv4NK5slint6Window13is_fullscreenEv"]], "window::is_maximized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_maximizedEv"]], "window::is_minimized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_minimizedEv"]], "window::is_visible (c++ function)": [[10, "_CPPv4NK5slint6Window10is_visibleEv"]], "window::on_close_requested (c++ function)": [[10, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F"]], "window::operator= (c++ function)": [[10, "_CPPv4N5slint6WindowaSERK6Window"], [10, "_CPPv4N5slint6WindowaSERR6Window"]], "window::position (c++ function)": [[10, "_CPPv4NK5slint6Window8positionEv"]], "window::request_redraw (c++ function)": [[10, "_CPPv4NK5slint6Window14request_redrawEv"]], "window::scale_factor (c++ function)": [[10, "_CPPv4NK5slint6Window12scale_factorEv"]], "window::set_fullscreen (c++ function)": [[10, "_CPPv4N5slint6Window14set_fullscreenEb"]], "window::set_maximized (c++ function)": [[10, "_CPPv4N5slint6Window13set_maximizedEb"]], "window::set_minimized (c++ function)": [[10, "_CPPv4N5slint6Window13set_minimizedEb"]], "window::set_position (c++ function)": [[10, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE"], [10, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE"]], "window::set_rendering_notifier (c++ function)": [[10, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F"]], "window::set_size (c++ function)": [[10, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE"], [10, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE"]], "window::show (c++ function)": [[10, "_CPPv4N5slint6Window4showEv"]], "window::size (c++ function)": [[10, "_CPPv4NK5slint6Window4sizeEv"]], "window::~window (c++ function)": [[10, "_CPPv4N5slint6WindowD0Ev"]], "componentcompiler (c++ class)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerE"]], "componentcompiler::componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv"]], "componentcompiler::build_from_path (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE"]], "componentcompiler::build_from_source (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE"]], "componentcompiler::diagnostics (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv"]], "componentcompiler::include_paths (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv"]], "componentcompiler::set_include_paths (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE"]], "componentcompiler::set_style (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE"]], "componentcompiler::set_translation_domain (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE"]], "componentcompiler::style (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv"]], "componentcompiler::~componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev"]], "componentdefinition (c++ class)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionE"]], "componentdefinition::componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition"]], "componentdefinition::callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv"]], "componentdefinition::create (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv"]], "componentdefinition::functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv"]], "componentdefinition::global_callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE"]], "componentdefinition::global_functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE"]], "componentdefinition::global_properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE"]], "componentdefinition::globals (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv"]], "componentdefinition::name (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv"]], "componentdefinition::operator= (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition"]], "componentdefinition::properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv"]], "componentdefinition::~componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev"]], "componentinstance (c++ class)": [[13, "_CPPv4N5slint11interpreter17ComponentInstanceE"]], "componentinstance::definition (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv"]], "componentinstance::get_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE"]], "componentinstance::get_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE"]], "componentinstance::hide (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv"]], "componentinstance::invoke (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::invoke_global (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::qwidget (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv"]], "componentinstance::run (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv"]], "componentinstance::set_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F"]], "componentinstance::set_global_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F"]], "componentinstance::set_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value"]], "componentinstance::set_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value"]], "componentinstance::show (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv"]], "componentinstance::window (c++ function)": [[13, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv"]], "value (c++ class)": [[14, "_CPPv4N5slint11interpreter5ValueE"]], "value::type (c++ type)": [[14, "_CPPv4N5slint11interpreter5Value4TypeE"]], "value::value (c++ function)": [[14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Image"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERR5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueEb"], [14, "_CPPv4N5slint11interpreter5Value5ValueEd"], [14, "_CPPv4N5slint11interpreter5Value5ValueEi"], [14, "_CPPv4N5slint11interpreter5Value5ValueEv"]], "value::operator= (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueaSERK5Value"], [14, "_CPPv4N5slint11interpreter5ValueaSERR5Value"]], "value::operator== (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value"]], "value::to_array (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_arrayEv"]], "value::to_bool (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value7to_boolEv"]], "value::to_brush (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_brushEv"]], "value::to_image (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_imageEv"]], "value::to_number (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_numberEv"]], "value::to_string (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_stringEv"]], "value::to_struct (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_structEv"]], "value::type (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value4typeEv"]], "value::~value (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueD0Ev"]], "platform::abstractrenderer (c++ class)": [[15, "_CPPv4N5slint8platform16AbstractRendererE"]], "platform::nativewindowhandle (c++ class)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleE"]], "platform::nativewindowhandle::nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv"]], "platform::nativewindowhandle::from_appkit (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow"]], "platform::nativewindowhandle::from_wayland (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display"]], "platform::nativewindowhandle::from_win32 (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv"]], "platform::nativewindowhandle::from_x11_xcb (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti"]], "platform::nativewindowhandle::from_x11_xlib (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi"]], "platform::nativewindowhandle::operator= (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle"]], "platform::nativewindowhandle::~nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev"]], "platform::platform (c++ class)": [[17, "_CPPv4N5slint8platform8PlatformE"]], "platform::platform::clipboard (c++ enum)": [[17, "_CPPv4N5slint8platform8Platform9ClipboardE"]], "platform::platform::clipboard::defaultclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE"]], "platform::platform::clipboard::selectionclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE"]], "platform::platform::platform (c++ function)": [[17, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform"], [17, "_CPPv4N5slint8platform8Platform8PlatformEv"]], "platform::platform::task (c++ class)": [[17, "_CPPv4N5slint8platform8Platform4TaskE"], [18, "_CPPv4N5slint8platform8Platform4TaskE"]], "platform::platform::task::task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [17, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"]], "platform::platform::task::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [17, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"]], "platform::platform::task::run (c++ function)": [[17, "_CPPv4NO5slint8platform8Platform4Task3runEv"], [18, "_CPPv4NO5slint8platform8Platform4Task3runEv"]], "platform::platform::task::~task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskD0Ev"], [18, "_CPPv4N5slint8platform8Platform4TaskD0Ev"]], "platform::platform::clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard"]], "platform::platform::create_window_adapter (c++ function)": [[17, "_CPPv4N5slint8platform8Platform21create_window_adapterEv"]], "platform::platform::duration_since_start (c++ function)": [[17, "_CPPv4N5slint8platform8Platform20duration_since_startEv"]], "platform::platform::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformaSERK8Platform"]], "platform::platform::quit_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform15quit_event_loopEv"]], "platform::platform::run_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14run_event_loopEv"]], "platform::platform::run_in_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task"]], "platform::platform::set_clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard"]], "platform::platform::~platform (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformD0Ev"]], "platform::skiarenderer (c++ class)": [[19, "_CPPv4N5slint8platform12SkiaRendererE"]], "platform::skiarenderer::skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer"], [19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize"]], "platform::skiarenderer::operator= (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer"]], "platform::skiarenderer::render (c++ function)": [[19, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv"]], "platform::skiarenderer::~skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendererD0Ev"]], "platform::softwarerenderer (c++ class)": [[20, "_CPPv4N5slint8platform16SoftwareRendererE"]], "platform::softwarerenderer::physicalregion (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"]], "platform::softwarerenderer::physicalregion::rect (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"]], "platform::softwarerenderer::physicalregion::rect::origin (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"]], "platform::softwarerenderer::physicalregion::rect::size (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"]], "platform::softwarerenderer::physicalregion::bounding_box_origin (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"]], "platform::softwarerenderer::physicalregion::bounding_box_size (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"]], "platform::softwarerenderer::physicalregion::rectangles (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"]], "platform::softwarerenderer::renderingrotation (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE"]], "platform::softwarerenderer::renderingrotation::norotation (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE"]], "platform::softwarerenderer::renderingrotation::rotate180 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E"]], "platform::softwarerenderer::renderingrotation::rotate270 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E"]], "platform::softwarerenderer::renderingrotation::rotate90 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E"]], "platform::softwarerenderer::repaintbuffertype (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE"]], "platform::softwarerenderer::repaintbuffertype::newbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE"]], "platform::softwarerenderer::repaintbuffertype::reusedbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE"]], "platform::softwarerenderer::repaintbuffertype::swappedbuffers (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE"]], "platform::softwarerenderer::softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType"], [20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer"]], "platform::softwarerenderer::operator= (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer"]], "platform::softwarerenderer::render (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE"], [20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE"]], "platform::softwarerenderer::render_by_line (c++ function)": [[20, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback"]], "platform::softwarerenderer::set_rendering_rotation (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation"]], "platform::softwarerenderer::~softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendererD0Ev"]], "platform::windowadapter (c++ class)": [[21, "_CPPv4N5slint8platform13WindowAdapterE"]], "platform::windowadapter::windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv"]], "platform::windowadapter::windowproperties (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"]], "platform::windowadapter::windowproperties::layoutconstraints (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"]], "platform::windowadapter::windowproperties::layoutconstraints::max (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"]], "platform::windowadapter::windowproperties::layoutconstraints::min (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"]], "platform::windowadapter::windowproperties::layoutconstraints::preferred (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"]], "platform::windowadapter::windowproperties::background (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"]], "platform::windowadapter::windowproperties::fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"]], "platform::windowadapter::windowproperties::is_fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"]], "platform::windowadapter::windowproperties::is_maximized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"]], "platform::windowadapter::windowproperties::is_minimized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"]], "platform::windowadapter::windowproperties::layout_constraints (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"]], "platform::windowadapter::windowproperties::title (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"]], "platform::windowadapter::position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8positionEv"]], "platform::windowadapter::renderer (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8rendererEv"]], "platform::windowadapter::request_redraw (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv"]], "platform::windowadapter::set_position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE"]], "platform::windowadapter::set_size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE"]], "platform::windowadapter::set_visible (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb"]], "platform::windowadapter::size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter4sizeEv"]], "platform::windowadapter::update_window_properties (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties"]], "platform::windowadapter::window (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter6windowEv"], [21, "_CPPv4NK5slint8platform13WindowAdapter6windowEv"]], "platform::windowadapter::~windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapterD0Ev"]], "testing::elementhandle (c++ class)": [[22, "_CPPv4N5slint7testing13ElementHandleE"]], "testing::elementhandle::absolute_position (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv"]], "testing::elementhandle::accessible_checkable (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv"]], "testing::elementhandle::accessible_checked (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv"]], "testing::elementhandle::accessible_description (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv"]], "testing::elementhandle::accessible_label (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv"]], "testing::elementhandle::accessible_placeholder_text (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv"]], "testing::elementhandle::accessible_role (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv"]], "testing::elementhandle::accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv"]], "testing::elementhandle::accessible_value_maximum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv"]], "testing::elementhandle::accessible_value_minimum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv"]], "testing::elementhandle::accessible_value_step (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv"]], "testing::elementhandle::bases (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle5basesEv"]], "testing::elementhandle::find_by_accessible_label (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_id (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_type_name (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::id (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle2idEv"]], "testing::elementhandle::invoke_accessible_decrement_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv"]], "testing::elementhandle::invoke_accessible_default_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv"]], "testing::elementhandle::invoke_accessible_increment_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv"]], "testing::elementhandle::is_valid (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle8is_validEv"]], "testing::elementhandle::set_accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString"]], "testing::elementhandle::size (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle4sizeEv"]], "testing::elementhandle::type_name (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv"]], "testing::elementhandle::visit_elements (c++ function)": [[22, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor"]], "slint_feature_backend_qt (c macro)": [[23, "c.SLINT_FEATURE_BACKEND_QT"]], "slint_feature_gettext (c macro)": [[24, "c.SLINT_FEATURE_GETTEXT"]], "slint_feature_interpreter (c macro)": [[25, "c.SLINT_FEATURE_INTERPRETER"]], "slint_version_patch (c macro)": [[26, "c.SLINT_VERSION_PATCH"]], "slint_feature_backend_linuxkms (c macro)": [[27, "c.SLINT_FEATURE_BACKEND_LINUXKMS"]], "slint_feature_experimental (c macro)": [[28, "c.SLINT_FEATURE_EXPERIMENTAL"]], "slint_version_string (c macro)": [[29, "c.SLINT_VERSION_STRING"]], "slint_feature_renderer_femtovg (c macro)": [[30, "c.SLINT_FEATURE_RENDERER_FEMTOVG"]], "slint_feature_renderer_skia (c macro)": [[31, "c.SLINT_FEATURE_RENDERER_SKIA"]], "slint_feature_system_testing (c macro)": [[32, "c.SLINT_FEATURE_SYSTEM_TESTING"]], "slint_feature_accessibility (c macro)": [[33, "c.SLINT_FEATURE_ACCESSIBILITY"]], "slint_feature_renderer_software (c macro)": [[34, "c.SLINT_FEATURE_RENDERER_SOFTWARE"]], "slint_version_minor (c macro)": [[35, "c.SLINT_VERSION_MINOR"]], "slint_feature_freestanding (c macro)": [[36, "c.SLINT_FEATURE_FREESTANDING"]], "slint_feature_testing (c macro)": [[37, "c.SLINT_FEATURE_TESTING"]], "slint_version_major (c macro)": [[38, "c.SLINT_VERSION_MAJOR"]], "slint_feature_backend_winit (c macro)": [[39, "c.SLINT_FEATURE_BACKEND_WINIT"]], "assert_eq (c macro)": [[40, "c.assert_eq"]], "valuetype (c++ enum)": [[46, "_CPPv4N5slint11interpreter9ValueTypeE"]], "valuetype::bool (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4BoolE"]], "valuetype::brush (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5BrushE"]], "valuetype::image (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ImageE"]], "valuetype::model (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ModelE"]], "valuetype::number (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6NumberE"]], "valuetype::other (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5OtherE"]], "valuetype::string (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StringE"]], "valuetype::struct (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StructE"]], "valuetype::void (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4VoidE"]], "diagnosticlevel (c++ enum)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevelE"]], "diagnosticlevel::error (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE"]], "diagnosticlevel::warning (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE"]], "testing::accessiblerole (c++ enum)": [[48, "_CPPv4N5slint7testing14AccessibleRoleE"]], "testing::accessiblerole::button (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6ButtonE"]], "testing::accessiblerole::checkbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE"]], "testing::accessiblerole::combobox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE"]], "testing::accessiblerole::list (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4ListE"]], "testing::accessiblerole::none (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4NoneE"]], "testing::accessiblerole::progressindicator (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE"]], "testing::accessiblerole::slider (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SliderE"]], "testing::accessiblerole::spinbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE"]], "testing::accessiblerole::switch (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SwitchE"]], "testing::accessiblerole::tab (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole3TabE"]], "testing::accessiblerole::tablist (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7TabListE"]], "testing::accessiblerole::table (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole5TableE"]], "testing::accessiblerole::text (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TextE"]], "testing::accessiblerole::textinput (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole9TextInputE"]], "testing::accessiblerole::tree (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TreeE"]], "setrenderingnotifiererror (c++ enum)": [[49, "_CPPv4N5slint25SetRenderingNotifierErrorE"]], "setrenderingnotifiererror::alreadyset (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE"]], "setrenderingnotifiererror::unsupported (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE"]], "pointereventbutton (c++ enum)": [[50, "_CPPv4N5slint18PointerEventButtonE"]], "pointereventbutton::left (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4LeftE"]], "pointereventbutton::middle (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton6MiddleE"]], "pointereventbutton::other (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5OtherE"]], "pointereventbutton::right (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5RightE"]], "eventloopmode (c++ enum)": [[51, "_CPPv4N5slint13EventLoopModeE"]], "eventloopmode::quitonlastwindowclosed (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE"]], "eventloopmode::rununtilquit (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE"]], "graphicsapi (c++ enum)": [[52, "_CPPv4N5slint11GraphicsAPIE"]], "graphicsapi::nativeopengl (c++ enumerator)": [[52, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE"]], "renderingstate (c++ enum)": [[53, "_CPPv4N5slint14RenderingStateE"]], "renderingstate::afterrendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14AfterRenderingE"]], "renderingstate::beforerendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState15BeforeRenderingE"]], "renderingstate::renderingsetup (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14RenderingSetupE"]], "renderingstate::renderingteardown (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState17RenderingTeardownE"]], "closerequestresponse (c++ enum)": [[54, "_CPPv4N5slint20CloseRequestResponseE"]], "closerequestresponse::hidewindow (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse10HideWindowE"]], "closerequestresponse::keepwindowshown (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE"]], "platform::duration_until_next_timer_update (c++ function)": [[93, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv"]], "platform::update_timers_and_animations (c++ function)": [[94, "_CPPv4N5slint8platform28update_timers_and_animationsEv"]], "platform::set_platform (c++ function)": [[95, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE"]], "testing::init (c++ function)": [[96, "_CPPv4N5slint7testing4initEv"]], "quit_event_loop (c++ function)": [[97, "_CPPv4N5slint15quit_event_loopEv"]], "invoke_from_event_loop (c++ function)": [[98, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor"]], "blocking_invoke_from_event_loop (c++ function)": [[99, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor"]], "run_event_loop (c++ function)": [[100, "_CPPv4N5slint14run_event_loopE13EventLoopMode"]], "update_all_translations (c++ function)": [[101, "_CPPv4N5slint23update_all_translationsEv"]], "hsvacolor (c++ struct)": [[147, "_CPPv4N5slint9HsvaColorE"]], "hsvacolor::alpha (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5alphaE"]], "hsvacolor::hue (c++ member)": [[147, "_CPPv4N5slint9HsvaColor3hueE"]], "hsvacolor::saturation (c++ member)": [[147, "_CPPv4N5slint9HsvaColor10saturationE"]], "hsvacolor::value (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5valueE"]], "image (c++ struct)": [[148, "_CPPv4N5slint5ImageE"]], "image::borrowedopengltextureorigin (c++ enum)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE"]], "image::borrowedopengltextureorigin::bottomleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE"]], "image::borrowedopengltextureorigin::topleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE"]], "image::image (c++ function)": [[148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE"], [148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE"], [148, "_CPPv4N5slint5Image5ImageEv"]], "image::create_from_borrowed_gl_2d_rgba_texture (c++ function)": [[148, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin"]], "image::load_from_path (c++ function)": [[148, "_CPPv4N5slint5Image14load_from_pathERK12SharedString"]], "image::operator!= (c++ function)": [[148, "_CPPv4N5slint5ImageneERK5ImageRK5Image"]], "image::operator== (c++ function)": [[148, "_CPPv4N5slint5ImageeqERK5ImageRK5Image"]], "image::path (c++ function)": [[148, "_CPPv4NK5slint5Image4pathEv"]], "image::set_nine_slice_edges (c++ function)": [[148, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt"]], "image::size (c++ function)": [[148, "_CPPv4NK5slint5Image4sizeEv"]], "logicalposition (c++ struct)": [[149, "_CPPv4N5slint15LogicalPositionE"]], "logicalposition::logicalposition (c++ function)": [[149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE"], [149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv"]], "logicalsize (c++ struct)": [[150, "_CPPv4N5slint11LogicalSizeE"]], "logicalsize::logicalsize (c++ function)": [[150, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE"]], "physicalposition (c++ struct)": [[151, "_CPPv4N5slint16PhysicalPositionE"]], "physicalposition::physicalposition (c++ function)": [[151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE"], [151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv"]], "physicalsize (c++ struct)": [[152, "_CPPv4N5slint12PhysicalSizeE"]], "physicalsize::physicalsize (c++ function)": [[152, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE"]], "point (c++ struct)": [[153, "_CPPv4I0EN5slint5PointE"]], "point::operator== (c++ function)": [[153, "_CPPv4NK5slint5PointeqERK5Point"]], "point::x (c++ member)": [[153, "_CPPv4N5slint5Point1xE"]], "point::y (c++ member)": [[153, "_CPPv4N5slint5Point1yE"]], "rgb8pixel (c++ struct)": [[154, "_CPPv4N5slint9Rgb8PixelE"]], "rgb8pixel::b (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1bE"]], "rgb8pixel::g (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1gE"]], "rgb8pixel::r (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1rE"]], "rgba8pixel (c++ struct)": [[155, "_CPPv4N5slint10Rgba8PixelE"]], "rgba8pixel::a (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1aE"]], "rgba8pixel::b (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1bE"]], "rgba8pixel::g (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1gE"]], "rgba8pixel::r (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1rE"]], "rgbacolor (c++ struct)": [[156, "_CPPv4I0EN5slint9RgbaColorE"]], "rgbacolor::rgbacolor (c++ function)": [[156, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color"]], "rgbacolor::alpha (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5alphaE"]], "rgbacolor::blue (c++ member)": [[156, "_CPPv4N5slint9RgbaColor4blueE"]], "rgbacolor::green (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5greenE"]], "rgbacolor::red (c++ member)": [[156, "_CPPv4N5slint9RgbaColor3redE"]], "sharedpixelbuffer (c++ struct)": [[157, "_CPPv4I0EN5slint17SharedPixelBufferE"]], "sharedpixelbuffer::sharedpixelbuffer (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv"]], "sharedpixelbuffer::begin (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer5beginEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer5beginEv"]], "sharedpixelbuffer::cbegin (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv"]], "sharedpixelbuffer::cend (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer4cendEv"]], "sharedpixelbuffer::end (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer3endEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer3endEv"]], "sharedpixelbuffer::height (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6heightEv"]], "sharedpixelbuffer::operator== (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer"]], "sharedpixelbuffer::width (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer5widthEv"]], "sharedstring (c++ struct)": [[158, "_CPPv4N5slint12SharedStringE"]], "sharedstring::sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKDu"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKc"], [158, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString"], [158, "_CPPv4N5slint12SharedString12SharedStringEv"]], "sharedstring::begin (c++ function)": [[158, "_CPPv4NK5slint12SharedString5beginEv"]], "sharedstring::data (c++ function)": [[158, "_CPPv4NK5slint12SharedString4dataEv"]], "sharedstring::empty (c++ function)": [[158, "_CPPv4NK5slint12SharedString5emptyEv"]], "sharedstring::end (c++ function)": [[158, "_CPPv4NK5slint12SharedString3endEv"]], "sharedstring::ends_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE"]], "sharedstring::from_number (c++ function)": [[158, "_CPPv4N5slint12SharedString11from_numberEd"]], "sharedstring::operator std::string_view (c++ function)": [[158, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv"]], "sharedstring::operator!= (c++ function)": [[158, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString"]], "sharedstring::operator+ (c++ function)": [[158, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE"]], "sharedstring::operator+= (c++ function)": [[158, "_CPPv4N5slint12SharedStringpLENSt11string_viewE"]], "sharedstring::operator< (c++ function)": [[158, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString"]], "sharedstring::operator<< (c++ function)": [[158, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString"]], "sharedstring::operator<= (c++ function)": [[158, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString"]], "sharedstring::operator= (c++ function)": [[158, "_CPPv4N5slint12SharedStringaSENSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringaSEPKc"], [158, "_CPPv4N5slint12SharedStringaSERK12SharedString"], [158, "_CPPv4N5slint12SharedStringaSERR12SharedString"]], "sharedstring::operator== (c++ function)": [[158, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString"]], "sharedstring::operator> (c++ function)": [[158, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString"]], "sharedstring::operator>= (c++ function)": [[158, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString"]], "sharedstring::starts_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE"]], "sharedstring::~sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedStringD0Ev"]], "sharedvector (c++ struct)": [[159, "_CPPv4I0EN5slint12SharedVectorE"]], "sharedvector::sharedvector (c++ function)": [[159, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T"], [159, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE"], [159, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector"], [159, "_CPPv4N5slint12SharedVector12SharedVectorEv"]], "sharedvector::at (c++ function)": [[159, "_CPPv4NK5slint12SharedVector2atENSt6size_tE"]], "sharedvector::begin (c++ function)": [[159, "_CPPv4N5slint12SharedVector5beginEv"], [159, "_CPPv4NK5slint12SharedVector5beginEv"]], "sharedvector::cbegin (c++ function)": [[159, "_CPPv4NK5slint12SharedVector6cbeginEv"]], "sharedvector::cend (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4cendEv"]], "sharedvector::clear (c++ function)": [[159, "_CPPv4N5slint12SharedVector5clearEv"]], "sharedvector::empty (c++ function)": [[159, "_CPPv4NK5slint12SharedVector5emptyEv"]], "sharedvector::end (c++ function)": [[159, "_CPPv4N5slint12SharedVector3endEv"], [159, "_CPPv4NK5slint12SharedVector3endEv"]], "sharedvector::operator= (c++ function)": [[159, "_CPPv4N5slint12SharedVectoraSERK12SharedVector"], [159, "_CPPv4N5slint12SharedVectoraSERR12SharedVector"]], "sharedvector::operator== (c++ function)": [[159, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector"]], "sharedvector::operator[] (c++ function)": [[159, "_CPPv4N5slint12SharedVectorixENSt6size_tE"], [159, "_CPPv4NK5slint12SharedVectorixENSt6size_tE"]], "sharedvector::push_back (c++ function)": [[159, "_CPPv4N5slint12SharedVector9push_backERK1T"], [159, "_CPPv4N5slint12SharedVector9push_backERR1T"]], "sharedvector::size (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4sizeEv"]], "sharedvector::~sharedvector (c++ function)": [[159, "_CPPv4N5slint12SharedVectorD0Ev"]], "size (c++ struct)": [[160, "_CPPv4I0EN5slint4SizeE"]], "size::height (c++ member)": [[160, "_CPPv4N5slint4Size6heightE"]], "size::operator== (c++ function)": [[160, "_CPPv4NK5slint4SizeeqERK4Size"]], "size::width (c++ member)": [[160, "_CPPv4N5slint4Size5widthE"]], "standardlistviewitem (c++ struct)": [[161, "_CPPv4N5slint20StandardListViewItemE"]], "standardlistviewitem::text (c++ member)": [[161, "_CPPv4N5slint20StandardListViewItem4textE"]], "timer (c++ struct)": [[162, "_CPPv4N5slint5TimerE"]], "timer::timer (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F"], [162, "_CPPv4N5slint5Timer5TimerERK5Timer"], [162, "_CPPv4N5slint5Timer5TimerEv"]], "timer::interval (c++ function)": [[162, "_CPPv4NK5slint5Timer8intervalEv"]], "timer::operator= (c++ function)": [[162, "_CPPv4N5slint5TimeraSERK5Timer"]], "timer::restart (c++ function)": [[162, "_CPPv4N5slint5Timer7restartEv"]], "timer::running (c++ function)": [[162, "_CPPv4NK5slint5Timer7runningEv"]], "timer::single_shot (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F"]], "timer::start (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F"]], "timer::stop (c++ function)": [[162, "_CPPv4N5slint5Timer4stopEv"]], "timer::~timer (c++ function)": [[162, "_CPPv4N5slint5TimerD0Ev"]], "diagnostic (c++ struct)": [[163, "_CPPv4N5slint11interpreter10DiagnosticE"]], "diagnostic::column (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic6columnE"]], "diagnostic::level (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic5levelE"]], "diagnostic::line (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic4lineE"]], "diagnostic::message (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic7messageE"]], "diagnostic::source_file (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE"]], "propertydescriptor (c++ struct)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptorE"]], "propertydescriptor::property_name (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE"]], "propertydescriptor::property_type (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE"]], "struct (c++ struct)": [[165, "_CPPv4N5slint11interpreter6StructE"]], "struct::struct (c++ function)": [[165, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator"], [165, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE"], [165, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructEv"]], "struct::begin (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct5beginEv"]], "struct::end (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct3endEv"]], "struct::get_field (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE"]], "struct::iterator (c++ struct)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorE"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorE"]], "struct::iterator::iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"]], "struct::iterator::operator!= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"]], "struct::iterator::operator* (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"], [166, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"]], "struct::iterator::operator++ (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"]], "struct::iterator::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"]], "struct::iterator::operator== (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"]], "struct::iterator::value_type (c++ type)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"], [166, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"]], "struct::iterator::~iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"]], "struct::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructaSERK6Struct"], [165, "_CPPv4N5slint11interpreter6StructaSERR6Struct"]], "struct::set_field (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value"]], "struct::~struct (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructD0Ev"]], "platform::rgb565pixel (c++ struct)": [[167, "_CPPv4N5slint8platform11Rgb565PixelE"]], "platform::rgb565pixel::rgb565pixel (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel"], [167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv"]], "platform::rgb565pixel::b (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1bE"]], "platform::rgb565pixel::blue (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv"]], "platform::rgb565pixel::g (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1gE"]], "platform::rgb565pixel::green (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv"]], "platform::rgb565pixel::operator rgb8pixel (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv"]], "platform::rgb565pixel::operator== (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel"]], "platform::rgb565pixel::r (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1rE"]], "platform::rgb565pixel::red (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv"]]}}) \ No newline at end of file diff --git a/snapshots/master/docs/node/classes/ArrayModel.html b/snapshots/master/docs/node/classes/ArrayModel.html index f8e3d87dd..13fa824d1 100644 --- a/snapshots/master/docs/node/classes/ArrayModel.html +++ b/snapshots/master/docs/node/classes/ArrayModel.html @@ -1,6 +1,6 @@ ArrayModel | slint-ui

    Class ArrayModel<T>

    ArrayModel wraps a JavaScript array for use in .slint views. The underlying array can be modified with the [[ArrayModel.push]] and [[ArrayModel.remove]] methods.

    -

    Type Parameters

    • T

    Hierarchy (view full)

    Constructors

    Type Parameters

    • T

    Hierarchy (view full)

    Constructors

    Accessors

    Methods

    [iterator] entries @@ -16,32 +16,32 @@ setRowData values

    Constructors

    Accessors

    • get length(): number
    • Returns the number of entries in the array model.

      -

      Returns number

    Methods

    • Returns an iterable of key, value pairs for every entry in the array.

      -

      Returns IterableIterator<[number, T]>

    • Notifies the view that the complete data must be reload.

      -

      Returns void

    Accessors

    • get length(): number
    • Returns the number of entries in the array model.

      +

      Returns number

    Methods

    • Returns an iterable of key, value pairs for every entry in the array.

      +

      Returns IterableIterator<[number, T]>

    • Notifies the view that the complete data must be reload.

      +

      Returns void

    • Notifies the view that multiple rows are added to the model.

      Parameters

      • row: number

        index of the first added row.

      • count: number

        the number of added items.

        -

      Returns void

    • Notifies the view that the data of the current row is changed.

      +

    Returns void

    • Notifies the view that the data of the current row is changed.

      Parameters

      • row: number

        index of the changed row.

        -

      Returns void

    • Notifies the view that multiple rows are removed to the model.

      +

    Returns void

    • Notifies the view that multiple rows are removed to the model.

      Parameters

      • row: number

        index of the first removed row.

      • count: number

        the number of removed items.

        -

      Returns void

    • Removes the last element from the array and returns it.

      +

    Returns void

    Returns void

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/classes/CompileError.html b/snapshots/master/docs/node/classes/CompileError.html index f246b0f33..000c85440 100644 --- a/snapshots/master/docs/node/classes/CompileError.html +++ b/snapshots/master/docs/node/classes/CompileError.html @@ -1,5 +1,5 @@ CompileError | slint-ui

    Class CompileError

    Represents an errors that can be emitted by the compiler.

    -

    Hierarchy

    • Error
      • CompileError

    Constructors

    Hierarchy

    • Error
      • CompileError

    Constructors

    Properties

    cause? diagnostics message @@ -11,8 +11,8 @@

    Constructors

    • Creates a new CompileError.

      Parameters

      • message: string

        human-readable description of the error.

      • diagnostics: Diagnostic[]

        represent a list of diagnostic items emitted while compiling .slint code.

        -

      Returns CompileError

    Properties

    cause?: unknown
    diagnostics: Diagnostic[]

    List of Diagnostic items emitted while compiling .slint code.

    -
    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err, stackTraces) => any)

    Optional override for formatting stack traces

    +

    Returns CompileError

    Properties

    cause?: unknown
    diagnostics: Diagnostic[]

    List of Diagnostic items emitted while compiling .slint code.

    +
    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err, stackTraces) => any)

    Optional override for formatting stack traces

    Type declaration

      • (err, stackTraces): any
      • Parameters

        • err: Error
        • stackTraces: CallSite[]

        Returns any

    stackTraceLimit: number

    Methods

    • Create .stack property on a target object

      Parameters

      • targetObject: object
      • Optional constructorOpt: Function

      Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/classes/Model.html b/snapshots/master/docs/node/classes/Model.html index 07bd44167..79fd8d8fa 100644 --- a/snapshots/master/docs/node/classes/Model.html +++ b/snapshots/master/docs/node/classes/Model.html @@ -6,7 +6,7 @@

    Example

    As an example let's see the implementation of ArrayModel

    export class ArrayModel<T> extends Model<T> {
    private a: Array<T>

    constructor(arr: Array<T>) {
    super();
    this.a = arr;
    }

    rowCount() {
    return this.a.length;
    }

    rowData(row: number) {
    return this.a[row];
    }

    setRowData(row: number, data: T) {
    this.a[row] = data;
    this.notifyRowDataChanged(row);
    }

    push(...values: T[]) {
    let size = this.a.length;
    Array.prototype.push.apply(this.a, values);
    this.notifyRowAdded(size, arguments.length);
    }

    remove(index: number, size: number) {
    let r = this.a.splice(index, size);
    this.notifyRowRemoved(index, size);
    }

    get length(): number {
    return this.a.length;
    }

    values(): IterableIterator<T> {
    return this.a.values();
    }

    entries(): IterableIterator<[number, T]> {
    return this.a.entries()
    }
    }
    -

    Hierarchy (view full)

    Implements

    Constructors

    Hierarchy (view full)

    Implements

    • Iterable<T>

    Constructors

    Methods

    • Returns Iterator<T, any, undefined>

    • Notifies the view that the complete data must be reload.

      -

      Returns void

    • Notifies the view that multiple rows are added to the model.

      +

    Constructors

    Methods

    Returns void

    Returns void

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadFile.html b/snapshots/master/docs/node/functions/loadFile.html index 5106910f0..192a7d591 100644 --- a/snapshots/master/docs/node/functions/loadFile.html +++ b/snapshots/master/docs/node/functions/loadFile.html @@ -15,4 +15,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

    Throws

    CompileError if errors occur during compilation.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/loadSource.html b/snapshots/master/docs/node/functions/loadSource.html index 7b06a6428..4737e038c 100644 --- a/snapshots/master/docs/node/functions/loadSource.html +++ b/snapshots/master/docs/node/functions/loadSource.html @@ -13,4 +13,4 @@ These instances offer properties and event handlers, adhering to the ComponentHandle interface. For further information on the available properties, refer to Instantiating A Component.

    Throws

    CompileError if errors occur during compilation.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/quitEventLoop.html b/snapshots/master/docs/node/functions/quitEventLoop.html index a85a7d0a1..568fdbde9 100644 --- a/snapshots/master/docs/node/functions/quitEventLoop.html +++ b/snapshots/master/docs/node/functions/quitEventLoop.html @@ -1,3 +1,3 @@ quitEventLoop | slint-ui

    Function quitEventLoop

    • Stops a spinning event loop. This function returns immediately, and the promise returned from run_event_loop() will resolve in a later tick of the nodejs event loop.

      -

      Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/node/functions/runEventLoop.html b/snapshots/master/docs/node/functions/runEventLoop.html index 4b2e4a9ff..23bfe5b79 100644 --- a/snapshots/master/docs/node/functions/runEventLoop.html +++ b/snapshots/master/docs/node/functions/runEventLoop.html @@ -2,4 +2,4 @@

    If the event loop is already running, then this function returns the same promise as from the earlier invocation.

    Parameters

    Returns Promise<unknown>

    \ No newline at end of file +

    Returns Promise<unknown>

    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ComponentHandle.html b/snapshots/master/docs/node/interfaces/ComponentHandle.html index a08682de3..b4eee237e 100644 --- a/snapshots/master/docs/node/interfaces/ComponentHandle.html +++ b/snapshots/master/docs/node/interfaces/ComponentHandle.html @@ -1,16 +1,16 @@ ComponentHandle | slint-ui

    Interface ComponentHandle

    This interface describes the public API of a Slint component that is common to all instances. Use this to show() the window on the screen, access the window and subsequent window properties, or start the Slint event loop with run().

    -
    interface ComponentHandle {
        get window(): Window;
        hide(): any;
        run(): Promise<unknown>;
        show(): any;
    }

    Accessors

    interface ComponentHandle {
        get window(): Window;
        hide(): any;
        run(): Promise<unknown>;
        show(): any;
    }

    Accessors

    Methods

    Accessors

    • get window(): Window
    • Returns the Window associated with this component instance. The window API can be used to control different aspects of the integration into the windowing system, such as the position on the screen.

      -

      Returns Window

    Methods

    • Hides the component's window, so that it is not visible anymore.

      -

      Returns any

    • Shows the window and runs the event loop. The returned promise is resolved when the event loop +

      Returns Window

    Methods

    • Hides the component's window, so that it is not visible anymore.

      +

      Returns any

    • Shows the window and runs the event loop. The returned promise is resolved when the event loop is terminated, for example when the last window was closed, or quitEventLoop was called.

      This function is a convenience for calling show, followed by runEventLoop, and hide when the event loop's promise is resolved.

      -

      Returns Promise<unknown>

    • Shows the component's window on the screen.

      -

      Returns any

    \ No newline at end of file +

    Returns Promise<unknown>

    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ImageData.html b/snapshots/master/docs/node/interfaces/ImageData.html index 2a0efa84a..852dd0e31 100644 --- a/snapshots/master/docs/node/interfaces/ImageData.html +++ b/snapshots/master/docs/node/interfaces/ImageData.html @@ -1,12 +1,12 @@ ImageData | slint-ui

    Interface ImageData

    An image data type that can be displayed by the Image element.

    This interface is inspired by the web ImageData interface.

    -
    interface ImageData {
        path?: string;
        get data(): Uint8Array;
        get height(): number;
        get width(): number;
    }

    Properties

    interface ImageData {
        path?: string;
        get data(): Uint8Array;
        get height(): number;
        get width(): number;
    }

    Properties

    Accessors

    Properties

    path?: string

    Returns the path of the image, if it was loaded from disk. Otherwise the property is undefined.

    -

    Accessors

    • get data(): Uint8Array
    • Returns the image as buffer.

      -

      Returns Uint8Array

    • get height(): number
    • Returns the height of the image in pixels.

      -

      Returns number

    • get width(): number
    • Returns the width of the image in pixels.

      -

      Returns number

    \ No newline at end of file +

    Accessors

    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/LoadFileOptions.html b/snapshots/master/docs/node/interfaces/LoadFileOptions.html index ec45573d3..508ef672d 100644 --- a/snapshots/master/docs/node/interfaces/LoadFileOptions.html +++ b/snapshots/master/docs/node/interfaces/LoadFileOptions.html @@ -1,10 +1,10 @@ LoadFileOptions | slint-ui

    Interface LoadFileOptions

    LoadFileOptions are used to defines different optional parameters that can be used to configure the compiler.

    -
    interface LoadFileOptions {
        includePaths?: string[];
        libraryPaths?: Record<string, string>;
        quiet?: boolean;
        style?: string;
    }

    Properties

    interface LoadFileOptions {
        includePaths?: string[];
        libraryPaths?: Record<string, string>;
        quiet?: boolean;
        style?: string;
    }

    Properties

    includePaths?: string[]

    Sets the include paths used for looking up .slint imports to the specified vector of paths.

    -
    libraryPaths?: Record<string, string>

    Sets library paths used for looking up @library imports to the specified map of library names to paths.

    -
    quiet?: boolean

    If set to true warnings from the compiler will not be printed to the console.

    -
    style?: string

    Sets the widget style the compiler is currently using when compiling .slint files.

    -
    \ No newline at end of file +
    libraryPaths?: Record<string, string>

    Sets library paths used for looking up @library imports to the specified map of library names to paths.

    +
    quiet?: boolean

    If set to true warnings from the compiler will not be printed to the console.

    +
    style?: string

    Sets the widget style the compiler is currently using when compiling .slint files.

    +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Point.html b/snapshots/master/docs/node/interfaces/Point.html index e96cc4da7..4e548754e 100644 --- a/snapshots/master/docs/node/interfaces/Point.html +++ b/snapshots/master/docs/node/interfaces/Point.html @@ -1,6 +1,6 @@ Point | slint-ui

    Interface Point

    Represents a two-dimensional point.

    -
    interface Point {
        x: number;
        y: number;
    }

    Properties

    x +
    interface Point {
        x: number;
        y: number;
    }

    Properties

    x y

    Properties

    x: number

    Defines the x coordinate of the point.

    -
    y: number

    Defines the y coordinate of the point.

    -
    \ No newline at end of file +
    y: number

    Defines the y coordinate of the point.

    +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Size.html b/snapshots/master/docs/node/interfaces/Size.html index ad83b44ad..170567e62 100644 --- a/snapshots/master/docs/node/interfaces/Size.html +++ b/snapshots/master/docs/node/interfaces/Size.html @@ -1,6 +1,6 @@ Size | slint-ui

    Interface Size

    Represents a two-dimensional size.

    -
    interface Size {
        height: number;
        width: number;
    }

    Properties

    interface Size {
        height: number;
        width: number;
    }

    Properties

    Properties

    height: number

    Defines the height length of the size.

    -
    width: number

    Defines the width length of the size.

    -
    \ No newline at end of file +
    width: number

    Defines the width length of the size.

    +
    \ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/Window.html b/snapshots/master/docs/node/interfaces/Window.html index 76542675e..7f3777395 100644 --- a/snapshots/master/docs/node/interfaces/Window.html +++ b/snapshots/master/docs/node/interfaces/Window.html @@ -1,7 +1,7 @@ Window | slint-ui

    Interface Window

    This type represents a window towards the windowing system, that's used to render the scene of a component. It provides API to control windowing system specific aspects such as the position on the screen.

    -
    interface Window {
        fullscreen: boolean;
        logicalPosition: Point;
        logicalSize: Size;
        maximized: boolean;
        minimized: boolean;
        physicalPosition: Point;
        physicalSize: Size;
        get visible(): boolean;
        hide(): void;
        requestRedraw(): void;
        show(): void;
    }

    Properties

    interface Window {
        fullscreen: boolean;
        logicalPosition: Point;
        logicalSize: Size;
        maximized: boolean;
        minimized: boolean;
        physicalPosition: Point;
        physicalSize: Size;
        get visible(): boolean;
        hide(): void;
        requestRedraw(): void;
        show(): void;
    }

    Properties

    fullscreen: boolean

    Gets or sets the window's fullscreen state *

    -
    logicalPosition: Point

    Gets or sets the logical position of the window on the screen.

    -
    logicalSize: Size

    Gets or sets the logical size of the window on the screen,

    -
    maximized: boolean

    Gets or sets the window's maximized state *

    -
    minimized: boolean

    Gets or sets teh window's minimized state *

    -
    physicalPosition: Point

    Gets or sets the physical position of the window on the screen.

    -
    physicalSize: Size

    Gets or sets the physical size of the window on the screen,

    -

    Accessors

    • get visible(): boolean
    • Returns the visibility state of the window. This function can return false even if you previously called show() +

    logicalPosition: Point

    Gets or sets the logical position of the window on the screen.

    +
    logicalSize: Size

    Gets or sets the logical size of the window on the screen,

    +
    maximized: boolean

    Gets or sets the window's maximized state *

    +
    minimized: boolean

    Gets or sets teh window's minimized state *

    +
    physicalPosition: Point

    Gets or sets the physical position of the window on the screen.

    +
    physicalSize: Size

    Gets or sets the physical size of the window on the screen,

    +

    Accessors

    • get visible(): boolean
    • Returns the visibility state of the window. This function can return false even if you previously called show() on it, for example if the user minimized the window.

      -

      Returns boolean

    Methods

    • Hides the window, so that it is not visible anymore.

      -

      Returns void

    • Issues a request to the windowing system to re-render the contents of the window.

      -

      Returns void

    • Shows the window on the screen. An additional strong reference on the +

      Returns boolean

    Methods

    • Hides the window, so that it is not visible anymore.

      +

      Returns void

    • Issues a request to the windowing system to re-render the contents of the window.

      +

      Returns void

    • Shows the window on the screen. An additional strong reference on the associated component is maintained while the window is visible.

      -

      Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/snapshots/master/docs/rust/help.html b/snapshots/master/docs/rust/help.html index b57e431ae..d979a7991 100644 --- a/snapshots/master/docs/rust/help.html +++ b/snapshots/master/docs/rust/help.html @@ -1,4 +1,4 @@ -Help

    Rustdoc help

    Back
    \ No newline at end of file +

    Rustdoc help

    Back
    \ No newline at end of file diff --git a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html index dea0678ae..2fe03758c 100644 --- a/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html +++ b/snapshots/master/docs/rust/i_slint_backend_android_activity/all.html @@ -1,4 +1,4 @@ -List of all items in this crate

    Rustdoc settings

    Back
    \ No newline at end of file +

    Rustdoc settings

    Back
    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint/all.html b/snapshots/master/docs/rust/slint/all.html index f87103ae5..b9cb7f201 100644 --- a/snapshots/master/docs/rust/slint/all.html +++ b/snapshots/master/docs/rust/slint/all.html @@ -1,4 +1,4 @@ -List of all items in this crate"),typeof Ut!="string"&&!_r(Ut))if(typeof Ut.toString=="function"){if(Ut=Ut.toString(),typeof Ut!="string")throw n5("dirty is not a string, aborting")}else throw n5("toString is not a function");if(!e.isSupported)return Ut;if(gs||Mo(G),e.removed=[],typeof Ut=="string"&&(to=!1),to){if(Ut.nodeName){const je=nr(Ut.nodeName);if(!Oe[je]||Gn[je])throw n5("root node is forbidden and cannot be sanitized in-place")}}else if(Ut instanceof a)de=Cc(""),L=de.ownerDocument.importNode(Ut,!0),L.nodeType===1&&L.nodeName==="BODY"||L.nodeName==="HTML"?de=L:de.appendChild(L);else{if(!Hn&&!ba&&!ki&&Ut.indexOf("<")===-1)return C&&gh?C.createHTML(Ut):Ut;if(de=Cc(Ut),!de)return Hn?null:gh?y:""}de&&ir&&sr(de.firstChild);const H=Ou(to?Ut:de);for(;ne=H.nextNode();)mn(ne)||(ne.content instanceof o&&Ei(ne.content),Ht(ne));if(to)return Ut;if(Hn){if(_c)for(R=k.call(de.ownerDocument);de.firstChild;)R.appendChild(de.firstChild);else R=de;return(Nt.shadowroot||Nt.shadowrootmode)&&(R=N.call(t,R,!0)),R}let ie=ki?de.outerHTML:de.innerHTML;return ki&&Oe["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Pm(nje,de.ownerDocument.doctype.name)&&(ie=" -`+ie),ba&&(ie=Ww(ie,U," "),ie=Ww(ie,J," "),ie=Ww(ie,j," ")),C&&gh?C.createHTML(ie):ie},e.setConfig=function(Ut){Mo(Ut),gs=!0},e.clearConfig=function(){Rs=null,gs=!1},e.isValidAttribute=function(Ut,G,de){Rs||Mo({});const L=nr(Ut),ne=nr(G);return ve(L,ne,de)},e.addHook=function(Ut,G){typeof G=="function"&&(z[Ut]=z[Ut]||[],i5(z[Ut],G))},e.removeHook=function(Ut){if(z[Ut])return d2e(z[Ut])},e.removeHooks=function(Ut){z[Ut]&&(z[Ut]=[])},e.removeAllHooks=function(){z={}},e}var oMe=sje();const oje=oMe.sanitize,rje=oMe.addHook,aje=oMe.removeHook;function Ed(n){return jle(n,0)}function jle(n,e){switch(typeof n){case"object":return n===null?_E(349,e):Array.isArray(n)?Eut(n,e):xut(n,e);case"string":return rMe(n,e);case"boolean":return Aut(n,e);case"number":return _E(n,e);case"undefined":return _E(937,e);default:return _E(617,e)}}function _E(n,e){return(e<<5)-e+n|0}function Aut(n,e){return _E(n?433:863,e)}function rMe(n,e){e=_E(149417,e);for(let t=0,i=n.length;tjle(i,t),e)}function xut(n,e){return e=_E(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=rMe(i,t),jle(n[i],t)),e)}var tv;(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(tv||(tv={}));function Rge(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function m2e(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):Dut((n>>>0).toString(16),e/4)}const nae=class nae{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(tv.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let c=r;if(wl(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=tv.BLOCK_SIZE&&(this._step(),t-=tv.BLOCK_SIZE,this._totalLen+=tv.BLOCK_SIZE,e[0]=e[tv.BLOCK_SIZE+0],e[1]=e[tv.BLOCK_SIZE+1],e[2]=e[tv.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,tv.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),s5(this._h0)+s5(this._h1)+s5(this._h2)+s5(this._h3)+s5(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,m2e(this._buff,this._buffLen),this._buffLen>56&&(this._step(),m2e(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=nae._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,Rge(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=s&o|~s&r,l=1518500249):h<40?(c=s^o^r,l=1859775393):h<60?(c=s&o|s&r|o&r,l=2400959708):(c=s^o^r,l=3395469782),d=Rge(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=Rge(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};nae._bigBlock32=new DataView(new ArrayBuffer(320));let Tve=nae;const{registerWindow:Uli,getWindow:gt,getDocument:Vli,getWindows:N9,getWindowsCount:kut,getWindowId:FU,getWindowById:vZ,hasWindow:zli,onDidRegisterWindow:Vb,onWillUnregisterWindow:Iut,onDidUnregisterWindow:Lut}=function(){const n=new Map;Aht(yi,1);const e={window:yi,disposables:new Z};n.set(yi.vscodeWindowId,e);const t=new I,i=new I,s=new I;function o(r,a){return(typeof r=="number"?n.get(r):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(r){if(n.has(r.vscodeWindowId))return $.None;const a=new Z,c={window:r,disposables:a.add(new Z)};return n.set(r.vscodeWindowId,c),a.add(Ee(()=>{n.delete(r.vscodeWindowId),i.fire(r)})),a.add(pe(r,xe.BEFORE_UNLOAD,()=>{s.fire(r)})),t.fire(c),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return n.has(r)},getWindowById:o,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=r;return c?.view?c.view.window:yi},getDocument(r){return gt(r).document}}}();function Yo(n){for(;n.firstChild;)n.firstChild.remove()}class Tut{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function pe(n,e,t,i){return new Tut(n,e,t,i)}function cje(n,e){return function(t){return e(new yu(n,t))}}function Rut(n){return function(e){return n(new os(e))}}const Xo=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=cje(gt(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Rut(i)),pe(e,t,o,s)},Mut=function(e,t,i){const s=cje(gt(e),t);return Nut(e,s,i)};function Nut(n,e,t){return pe(n,I_&&nMe.pointerEvents?xe.POINTER_DOWN:xe.MOUSE_DOWN,e,t)}function UB(n,e,t){return AW(n,e,t)}class d$ extends ZQe{constructor(e,t){super(e,t)}}let wZ,xd;function Put(n,e,t,i){let s=0;const o=n.setInterval(()=>{s++,(s>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{n.clearInterval(o)});return r}class sQ extends nQ{constructor(e){super(),this.defaultTarget=e&>(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Mge{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const n=new Map,e=new Map,t=new Map,i=new Map,s=o=>{t.set(o,!1);const r=n.get(o)??[];for(e.set(o,r),n.set(o,[]),i.set(o,!0);r.length>0;)r.sort(Mge.sort),r.shift().execute();i.set(o,!1)};xd=(o,r,a=0)=>{const c=FU(o),l=new Mge(r,a);let d=n.get(c);return d||(d=[],n.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>s(c))),l},wZ=(o,r,a)=>{const c=FU(o);if(i.get(c)){const l=new Mge(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return xd(o,r,a)}})();const Fut=8,Out=function(n,e){return e};class But extends ${constructor(e,t,i,s=Out,o=Fut){super();let r=null,a=0;const c=this._register(new O_),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(pe(e,t,d=>{r=s(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function Wut(n,e,t,i,s){return new But(n,e,t,i,s)}function Kle(n){return gt(n).getComputedStyle(n,null)}function uw(n,e){const t=gt(n),i=t.document;if(n!==i.body)return new Tn(n.clientWidth,n.clientHeight);if(I_&&t?.visualViewport)return new Tn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new Tn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Tn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Tn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ha{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=Kle(e),o=s?s.getPropertyValue(t):"0";return ha.convertToPixels(e,o)}static getBorderLeftWidth(e){return ha.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ha.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ha.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ha.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ha.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ha.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ha.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ha.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ha.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ha.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ha.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ha.getDimension(e,"margin-bottom","marginBottom")}}const KT=class KT{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new KT(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof KT?e:new KT(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};KT.None=new KT(0,0);let Tn=KT;function bZ(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=hje(n)?null:Kle(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=ha.getBorderLeftWidth(n),t+=ha.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Hut(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function ia(n){const e=n.getBoundingClientRect(),t=gt(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function lje(n){let e=n,t=1;do{const i=Kle(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function du(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.offsetWidth+e}function h$(n){const e=ha.getBorderLeftWidth(n)+ha.getBorderRightWidth(n),t=ha.getPaddingLeft(n)+ha.getPaddingRight(n);return n.offsetWidth-e-t}function Uut(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.scrollWidth+e}function aMe(n){const e=ha.getBorderTopWidth(n)+ha.getBorderBottomWidth(n),t=ha.getPaddingTop(n)+ha.getPaddingBottom(n);return n.offsetHeight-e-t}function Zf(n){const e=ha.getMarginTop(n)+ha.getMarginBottom(n);return n.offsetHeight+e}function Vut(n,e){if(n===null)return 0;const t=bZ(n),i=bZ(e);return t.left-i.left}function zut(n,e){const t=e.map(s=>Math.max(Uut(s),du(s))+Vut(s,n)||0);return Math.max(...t)}function al(n,e){return!!e?.contains(n)}const dje="parentFlowToElementId";function $ut(n,e){n.dataset[dje]=e.id}function Gut(n){const e=n.dataset[dje];return typeof e=="string"?n.ownerDocument.getElementById(e):null}function qut(n,e){let t=n;for(;t;){if(t===e)return!0;if(Ra(t)){const i=Gut(t);if(i){t=i;continue}}t=t.parentNode}return!1}function Qut(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function GY(n,e,t){return!!Qut(n,e,t)}function hje(n){return n&&!!n.host&&!!n.mode}function P9(n){return!!cF(n)}function cF(n){for(;n.parentNode;){if(n===n.ownerDocument?.body)return null;n=n.parentNode}return hje(n)?n:null}function xl(){let n=Kg().activeElement;for(;n?.shadowRoot;)n=n.shadowRoot.activeElement;return n}function kw(n){return xl()===n}function cMe(n){return al(xl(),n)}function jut(n){return n.ownerDocument===Kg()}function Kg(){return kut()<=1?yi.document:Array.from(N9()).map(({window:e})=>e.document).find(e=>e.hasFocus())??yi.document}function ax(){return Kg().defaultView?.window??yi}const lMe=new Map;function uje(){return new Kut}class Kut{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=od(yi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function od(n=yi.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),n.appendChild(i),t&&t.add(Ee(()=>n.removeChild(i))),n===yi.document.head){const s=new Set;lMe.set(i,s);for(const{window:o,disposables:r}of N9()){if(o===yi)continue;const a=r.add(Yut(i,s,o));t?.add(a)}}return i}function Yut(n,e,t){const i=new Z,s=n.cloneNode(!0);t.document.head.appendChild(s),i.add(Ee(()=>t.document.head.removeChild(s)));for(const o of fje(n))s.sheet?.insertRule(o.cssText,s.sheet?.cssRules.length);return i.add(Jut.observe(n,i,{childList:!0})(()=>{s.textContent=n.textContent})),e.add(s),i.add(Ee(()=>e.delete(s))),i}const Jut=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));const s=Ed(t);let o=i.get(s);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(n,t);const c=o={users:1,observer:a,onDidMutate:r.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(r.dispose(),a.disconnect(),i?.delete(s),i?.size===0&&this.mutationObservers.delete(n))})),i.set(s,o)}return o.onDidMutate}};let Nge=null;function gje(){return Nge||(Nge=od()),Nge}function fje(n){return n?.sheet?.rules?n.sheet.rules:n?.sheet?.cssRules?n.sheet.cssRules:[]}function Kp(n,e,t=gje()){if(!(!t||!e)){t.sheet?.insertRule(`${n} {${e}}`,0);for(const i of lMe.get(t)??[])Kp(n,e,i)}}function vE(n,e=gje()){if(!e)return;const t=fje(e),i=[];for(let s=0;s=0;s--)e.sheet?.deleteRule(i[s]);for(const s of lMe.get(e)??[])vE(n,s)}function Xut(n){return typeof n.selectorText=="string"}function Ra(n){return n instanceof HTMLElement||n instanceof gt(n).HTMLElement}function _2e(n){return n instanceof HTMLAnchorElement||n instanceof gt(n).HTMLAnchorElement}function Zut(n){return n instanceof HTMLTextAreaElement||n instanceof gt(n).HTMLTextAreaElement}function egt(n){return n instanceof HTMLInputElement||n instanceof gt(n).HTMLInputElement}function dMe(n){return n instanceof MouseEvent||n instanceof gt(n).MouseEvent}function Sv(n){return n instanceof KeyboardEvent||n instanceof gt(n).KeyboardEvent}function tgt(n){return n instanceof DragEvent||n instanceof gt(n).DragEvent}const xe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:dM?"webkitAnimationStart":"animationstart",ANIMATION_END:dM?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dM?"webkitAnimationIteration":"animationiteration"};function igt(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const un={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function ngt(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function sgt(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class CZ extends ${static hasFocusWithin(e){if(Ra(e)){const t=cF(e),i=t?t.activeElement:e.ownerDocument.activeElement;return al(i,e)}else{const t=e;return al(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event;let t=CZ.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Ra(e)?gt(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{CZ.hasFocusWithin(e)!==t&&(t?o():s())},this._register(pe(e,xe.FOCUS,s,!0)),this._register(pe(e,xe.BLUR,o,!0)),Ra(e)&&(this._register(pe(e,xe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(pe(e,xe.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Dd(n){return new CZ(n)}function pje(n,e){return n.after(e),e}function he(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Yle(n,e){return n.insertBefore(e,n.firstChild),e}function _a(n,...e){n.innerText="",he(n,...e)}const ogt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var F9;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(F9||(F9={}));function mje(n,e,t,...i){const s=ogt.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==F9.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?r[a]=c:a==="selected"?c&&r.setAttribute(a,"true"):r.setAttribute(a,c))}),r.append(...i),r}function we(n,e,...t){return mje(F9.HTML,n,e,...t)}we.SVG=function(n,e,...t){return mje(F9.SVG,n,e,...t)};function _je(n,...e){n?Oh(...e):Jl(...e)}function Oh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Jl(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function v2e(n,e){const t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function vje(n){yi.open(n,"_blank","noopener")}function rgt(n,e){const t=()=>{e(),i=xd(n,t)};let i=xd(n,t);return Ee(()=>i.dispose())}T9.setPreferredWebSchema(/^https:/.test(yi.location.href)?"https":"http");function uf(n){return n?`url('${lp.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function qY(n){return`'${n.replace(/'/g,"%27")}'`}function hS(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=hS(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function agt(n,e){let t;if(P.isUri(n))t=n.toString(!0);else{const o=new Blob([n]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=ax(),s=document.createElement("a");i.document.body.appendChild(s),s.download=e,s.href=t,s.click(),setTimeout(()=>i.document.body.removeChild(s))}function cgt(){return new Promise(n=>{const e=ax(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,T.once(T.fromDOMEventEmitter(t,"input"))(()=>{n(t.files??void 0)}),t.click(),setTimeout(()=>e.document.body.removeChild(t))})}var u$;(function(n){n[n.DOCUMENT=1]="DOCUMENT",n[n.BROWSER=2]="BROWSER"})(u$||(u$={}));function lgt(n){return n.document.fullscreenElement||n.document.webkitFullscreenElement||n.document.webkitIsFullScreen?{mode:u$.DOCUMENT,guess:!1}:n.innerHeight===n.screen.height?{mode:u$.BROWSER,guess:!1}:(ei||jr)&&n.outerHeight===n.screen.height&&n.outerWidth===n.screen.width?{mode:u$.BROWSER,guess:!0}:null}function dgt(n,e=!1){const t=document.createElement("a");return rje("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ee(()=>{aje("afterSanitizeAttributes")})}_e.http,_e.https,_e.command;const hgt=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);function ugt(n){const e=new Uint16Array(n.length);for(let s=0;sthis.registerListeners(e,t),{window:yi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(pe(e,"keydown",i=>{if(i.defaultPrevented)return;const s=new os(i);if(!(s.keyCode===E.Alt&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(s.keyCode!==E.Alt)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(pe(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(pe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(pe(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Nb.instance||(Nb.instance=new Nb),Nb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class yZ extends ${constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(pe(this.element,xe.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(pe(this.element,xe.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(pe(this.element,xe.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(pe(this.element,xe.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(pe(this.element,xe.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(pe(this.element,xe.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(pe(this.element,xe.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const ggt=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function di(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=ggt.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const l of s.groups.class.split("."))l!==""&&a.push(l);if(t.className!==void 0)for(const l of t.className.split("."))l!==""&&a.push(l);a.length>0&&(r.className=a.join(" "));const c={};if(s.groups.name&&(c[s.groups.name]=r),i)for(const l of i)Ra(l)?r.appendChild(l):typeof l=="string"?r.append(l):"root"in l&&(Object.assign(c,l),r.appendChild(l.root));for(const[l,d]of Object.entries(t))if(l!=="className")if(l==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(w2e(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(w2e(l),d.toString());return c.root=r,c}function w2e(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class fgt extends ${constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class pgt extends ${get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new fgt(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s}}class mgt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=FU(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=xU(new pgt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),xU(T.once(Lut)(({vscodeWindowId:s})=>{s===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const B9=new mgt;class wje{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Ep(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Ep(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Ep(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Ep(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Ep(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Ep(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Ep(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=Ep(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=Ep(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=Ep(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=Ep(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Ep(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Ep(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Ep(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Ep(n){return typeof n=="number"?`${n}px`:n}function ks(n){return new wje(n)}function Sd(n,e){n instanceof wje?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}var Bc;(function(n){n[n.Regular=0]="Regular",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold"})(Bc||(Bc={}));class _gt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class hMe{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Sd(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Sd(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Sd(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===Bc.Regular&&(a=t),r.type===Bc.Bold&&(a=i),r.type===Bc.Italic&&(a=s),a.appendChild(document.createElement("br"));const c=document.createElement("span");hMe._render(c,r),a.appendChild(c),o.push(c)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let s=!1;for(const o of i)o.isTrusted||(s=!0,t.remove(o));s&&this._onDidChange.fire()}serializeFontInfo(e){return this._ensureCache(e).getValues().filter(i=>i.isTrusted)}restoreFontInfo(e,t){for(const i of t){if(i.version!==bje)continue;const s=new QY(i,!1);this._writeToCache(e,s,s)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let s=this._actualReadFontInfo(e,t);(s.typicalHalfwidthCharacterWidth<=2||s.typicalFullwidthCharacterWidth<=2||s.spaceWidth<=2||s.maxDigitWidth<=2)&&(s=new QY({pixelRatio:B9.getInstance(e).value,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontSize:s.fontSize,fontFeatureSettings:s.fontFeatureSettings,fontVariationSettings:s.fontVariationSettings,lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,isMonospace:s.isMonospace,typicalHalfwidthCharacterWidth:Math.max(s.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(s.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:s.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(s.spaceWidth,5),middotWidth:Math.max(s.middotWidth,5),wsmiddotWidth:Math.max(s.wsmiddotWidth,5),maxDigitWidth:Math.max(s.maxDigitWidth,5)},!1)),this._writeToCache(e,t,s)}return i.get(t)}_createRequest(e,t,i,s){const o=new _gt(e,t);return i.push(o),s?.push(o),o}_actualReadFontInfo(e,t){const i=[],s=[],o=this._createRequest("n",Bc.Regular,i,s),r=this._createRequest("m",Bc.Regular,i,null),a=this._createRequest(" ",Bc.Regular,i,s),c=this._createRequest("0",Bc.Regular,i,s),l=this._createRequest("1",Bc.Regular,i,s),d=this._createRequest("2",Bc.Regular,i,s),h=this._createRequest("3",Bc.Regular,i,s),u=this._createRequest("4",Bc.Regular,i,s),f=this._createRequest("5",Bc.Regular,i,s),p=this._createRequest("6",Bc.Regular,i,s),m=this._createRequest("7",Bc.Regular,i,s),v=this._createRequest("8",Bc.Regular,i,s),w=this._createRequest("9",Bc.Regular,i,s),b=this._createRequest("→",Bc.Regular,i,s),C=this._createRequest("→",Bc.Regular,i,null),y=this._createRequest("·",Bc.Regular,i,s),S=this._createRequest("⸱",Bc.Regular,i,null),M="|/-_ilm%";for(let U=0,J=M.length;U.001){F=!1;break}}let z=!0;return F&&C.width!==N&&(z=!1),C.width>b.width&&(z=!1),new QY({pixelRatio:B9.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:F,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:y.width,wsmiddotWidth:S.width,maxDigitWidth:k},!0)}}class Cgt{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const Rve=new bgt;var Ov;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Ov||(Ov={}));const be=ae("instantiationService");function ygt(n,e,t){e[Ov.DI_TARGET]===e?e[Ov.DI_DEPENDENCIES].push({id:n,index:t}):(e[Ov.DI_DEPENDENCIES]=[{id:n,index:t}],e[Ov.DI_TARGET]=e)}function ae(n){if(Ov.serviceIds.has(n))return Ov.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ygt(e,t,s)};return e.toString=()=>n,Ov.serviceIds.set(n,e),e}const Qt=ae("codeEditorService"),Ai=ae("modelService"),Rn=ae("textModelService");function D(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function _(n,e){return function(t,i){e(t,i,n)}}const Sgt="vs/base/common/actions";class xn extends ${constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}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,t){this._actionCallback&&await this._actionCallback(e)}}class gw extends ${constructor(){super(...arguments),this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const z8=class z8{constructor(){this.id=z8.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new z8,...i]:t=i);return t}async run(){}};z8.ID="vs.actions.separator";let Kr=z8;class u1{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}async run(){}}const sae=class sae extends xn{constructor(){super(sae.ID,g(Sgt,0,"(empty)"),void 0,!1)}};sae.ID="vs.actions.empty";let Mve=sae;function _l(n){return{id:n.id,label:n.label,tooltip:n.tooltip??n.label,class:n.class,enabled:n.enabled??!0,checked:n.checked,run:async(...e)=>n.run(...e)}}var OU;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(OU||(OU={}));function b2e(n){return{id:n}}var $e;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(Ce.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}n.asClassNameArray=t;function i(u){return t(u).join(" ")}n.asClassName=i;function s(u){return"."+t(u).join(".")}n.asCSSSelector=s;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||OU.isThemeColor(u.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}n.fromString=a;function c(u){return{id:u}}n.fromId=c;function l(u,f){let p=u.id;const m=p.lastIndexOf("~");return m!==-1&&(p=p.substring(0,m)),f&&(p=`${p}~${f}`),{id:p}}n.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}n.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}n.isEqual=h})($e||($e={}));const Qi=ae("commandService"),yt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const r=[];for(const c of n.metadata.args)r.push(c.constraint);const a=n.handler;n.handler=function(c,...l){return Uct(l,r),a(c,...l)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new td,this._commands.set(t,i));const s=i.unshift(n),o=Ee(()=>{s(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return yt.registerCommand(n,(t,...i)=>t.get(Qi).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return fi.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};yt.registerCommand("noop",()=>{});const Pe=ae("contextKeyService");function nm(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function oQ(n,e="Unreachable"){throw new Error(e)}function Agt(n,e="unexpected state"){if(!n)throw new cn(`Assertion Failed: ${e}`)}function C2e(n){n||bt(new cn("Soft Assertion Failed"))}function fw(n){if(!n()){debugger;n(),bt(new cn("Assertion Failed"))}}function gz(n,e){let t=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Dgt)),this._cachedMergedKeybindings.slice(0)}}const xr=new uMe,xgt={EditorModes:"platform.keybindingsRegistry"};it.add(xgt.EditorModes,xr);function Dgt(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var jY;function lR(n){return n.command!==void 0}function kgt(n){return n.submenu!==void 0}const te=class te{static for(e){return te._instances.get(e)??new te(e)}constructor(e){if(te._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);te._instances.set(e,this),this.id=e}};te._instances=new Map,te.CommandPalette=new te("CommandPalette"),te.DebugBreakpointsContext=new te("DebugBreakpointsContext"),te.DebugCallStackContext=new te("DebugCallStackContext"),te.DebugConsoleContext=new te("DebugConsoleContext"),te.DebugVariablesContext=new te("DebugVariablesContext"),te.NotebookVariablesContext=new te("NotebookVariablesContext"),te.DebugHoverContext=new te("DebugHoverContext"),te.DebugWatchContext=new te("DebugWatchContext"),te.DebugToolBar=new te("DebugToolBar"),te.DebugToolBarStop=new te("DebugToolBarStop"),te.EditorContext=new te("EditorContext"),te.SimpleEditorContext=new te("SimpleEditorContext"),te.EditorContent=new te("EditorContent"),te.EditorLineNumberContext=new te("EditorLineNumberContext"),te.EditorContextCopy=new te("EditorContextCopy"),te.EditorContextPeek=new te("EditorContextPeek"),te.EditorContextShare=new te("EditorContextShare"),te.EditorTitle=new te("EditorTitle"),te.EditorTitleRun=new te("EditorTitleRun"),te.EditorTitleContext=new te("EditorTitleContext"),te.EditorTitleContextShare=new te("EditorTitleContextShare"),te.EmptyEditorGroup=new te("EmptyEditorGroup"),te.EmptyEditorGroupContext=new te("EmptyEditorGroupContext"),te.EditorTabsBarContext=new te("EditorTabsBarContext"),te.EditorTabsBarShowTabsSubmenu=new te("EditorTabsBarShowTabsSubmenu"),te.EditorTabsBarShowTabsZenModeSubmenu=new te("EditorTabsBarShowTabsZenModeSubmenu"),te.EditorActionsPositionSubmenu=new te("EditorActionsPositionSubmenu"),te.ExplorerContext=new te("ExplorerContext"),te.ExplorerContextShare=new te("ExplorerContextShare"),te.ExtensionContext=new te("ExtensionContext"),te.GlobalActivity=new te("GlobalActivity"),te.CommandCenter=new te("CommandCenter"),te.CommandCenterCenter=new te("CommandCenterCenter"),te.LayoutControlMenuSubmenu=new te("LayoutControlMenuSubmenu"),te.LayoutControlMenu=new te("LayoutControlMenu"),te.MenubarMainMenu=new te("MenubarMainMenu"),te.MenubarAppearanceMenu=new te("MenubarAppearanceMenu"),te.MenubarDebugMenu=new te("MenubarDebugMenu"),te.MenubarEditMenu=new te("MenubarEditMenu"),te.MenubarCopy=new te("MenubarCopy"),te.MenubarFileMenu=new te("MenubarFileMenu"),te.MenubarGoMenu=new te("MenubarGoMenu"),te.MenubarHelpMenu=new te("MenubarHelpMenu"),te.MenubarLayoutMenu=new te("MenubarLayoutMenu"),te.MenubarNewBreakpointMenu=new te("MenubarNewBreakpointMenu"),te.PanelAlignmentMenu=new te("PanelAlignmentMenu"),te.PanelPositionMenu=new te("PanelPositionMenu"),te.ActivityBarPositionMenu=new te("ActivityBarPositionMenu"),te.MenubarPreferencesMenu=new te("MenubarPreferencesMenu"),te.MenubarRecentMenu=new te("MenubarRecentMenu"),te.MenubarSelectionMenu=new te("MenubarSelectionMenu"),te.MenubarShare=new te("MenubarShare"),te.MenubarSwitchEditorMenu=new te("MenubarSwitchEditorMenu"),te.MenubarSwitchGroupMenu=new te("MenubarSwitchGroupMenu"),te.MenubarTerminalMenu=new te("MenubarTerminalMenu"),te.MenubarViewMenu=new te("MenubarViewMenu"),te.MenubarHomeMenu=new te("MenubarHomeMenu"),te.OpenEditorsContext=new te("OpenEditorsContext"),te.OpenEditorsContextShare=new te("OpenEditorsContextShare"),te.ProblemsPanelContext=new te("ProblemsPanelContext"),te.SCMInputBox=new te("SCMInputBox"),te.SCMChangesSeparator=new te("SCMChangesSeparator"),te.SCMIncomingChanges=new te("SCMIncomingChanges"),te.SCMIncomingChangesContext=new te("SCMIncomingChangesContext"),te.SCMIncomingChangesSetting=new te("SCMIncomingChangesSetting"),te.SCMOutgoingChanges=new te("SCMOutgoingChanges"),te.SCMOutgoingChangesContext=new te("SCMOutgoingChangesContext"),te.SCMOutgoingChangesSetting=new te("SCMOutgoingChangesSetting"),te.SCMIncomingChangesAllChangesContext=new te("SCMIncomingChangesAllChangesContext"),te.SCMIncomingChangesHistoryItemContext=new te("SCMIncomingChangesHistoryItemContext"),te.SCMOutgoingChangesAllChangesContext=new te("SCMOutgoingChangesAllChangesContext"),te.SCMOutgoingChangesHistoryItemContext=new te("SCMOutgoingChangesHistoryItemContext"),te.SCMChangeContext=new te("SCMChangeContext"),te.SCMResourceContext=new te("SCMResourceContext"),te.SCMResourceContextShare=new te("SCMResourceContextShare"),te.SCMResourceFolderContext=new te("SCMResourceFolderContext"),te.SCMResourceGroupContext=new te("SCMResourceGroupContext"),te.SCMSourceControl=new te("SCMSourceControl"),te.SCMSourceControlInline=new te("SCMSourceControlInline"),te.SCMSourceControlTitle=new te("SCMSourceControlTitle"),te.SCMTitle=new te("SCMTitle"),te.SearchContext=new te("SearchContext"),te.SearchActionMenu=new te("SearchActionContext"),te.StatusBarWindowIndicatorMenu=new te("StatusBarWindowIndicatorMenu"),te.StatusBarRemoteIndicatorMenu=new te("StatusBarRemoteIndicatorMenu"),te.StickyScrollContext=new te("StickyScrollContext"),te.TestItem=new te("TestItem"),te.TestItemGutter=new te("TestItemGutter"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TouchBarContext=new te("TouchBarContext"),te.TitleBarContext=new te("TitleBarContext"),te.TitleBarTitleContext=new te("TitleBarTitleContext"),te.TunnelContext=new te("TunnelContext"),te.TunnelPrivacy=new te("TunnelPrivacy"),te.TunnelProtocol=new te("TunnelProtocol"),te.TunnelPortInline=new te("TunnelInline"),te.TunnelTitle=new te("TunnelTitle"),te.TunnelLocalAddressInline=new te("TunnelLocalAddressInline"),te.TunnelOriginInline=new te("TunnelOriginInline"),te.ViewItemContext=new te("ViewItemContext"),te.ViewContainerTitle=new te("ViewContainerTitle"),te.ViewContainerTitleContext=new te("ViewContainerTitleContext"),te.ViewTitle=new te("ViewTitle"),te.ViewTitleContext=new te("ViewTitleContext"),te.CommentEditorActions=new te("CommentEditorActions"),te.CommentThreadTitle=new te("CommentThreadTitle"),te.CommentThreadActions=new te("CommentThreadActions"),te.CommentThreadAdditionalActions=new te("CommentThreadAdditionalActions"),te.CommentThreadTitleContext=new te("CommentThreadTitleContext"),te.CommentThreadCommentContext=new te("CommentThreadCommentContext"),te.CommentTitle=new te("CommentTitle"),te.CommentActions=new te("CommentActions"),te.CommentsViewThreadActions=new te("CommentsViewThreadActions"),te.InteractiveToolbar=new te("InteractiveToolbar"),te.InteractiveCellTitle=new te("InteractiveCellTitle"),te.InteractiveCellDelete=new te("InteractiveCellDelete"),te.InteractiveCellExecute=new te("InteractiveCellExecute"),te.InteractiveInputExecute=new te("InteractiveInputExecute"),te.IssueReporter=new te("IssueReporter"),te.NotebookToolbar=new te("NotebookToolbar"),te.NotebookStickyScrollContext=new te("NotebookStickyScrollContext"),te.NotebookCellTitle=new te("NotebookCellTitle"),te.NotebookCellDelete=new te("NotebookCellDelete"),te.NotebookCellInsert=new te("NotebookCellInsert"),te.NotebookCellBetween=new te("NotebookCellBetween"),te.NotebookCellListTop=new te("NotebookCellTop"),te.NotebookCellExecute=new te("NotebookCellExecute"),te.NotebookCellExecuteGoTo=new te("NotebookCellExecuteGoTo"),te.NotebookCellExecutePrimary=new te("NotebookCellExecutePrimary"),te.NotebookDiffCellInputTitle=new te("NotebookDiffCellInputTitle"),te.NotebookDiffCellMetadataTitle=new te("NotebookDiffCellMetadataTitle"),te.NotebookDiffCellOutputsTitle=new te("NotebookDiffCellOutputsTitle"),te.NotebookOutputToolbar=new te("NotebookOutputToolbar"),te.NotebookOutlineFilter=new te("NotebookOutlineFilter"),te.NotebookOutlineActionMenu=new te("NotebookOutlineActionMenu"),te.NotebookEditorLayoutConfigure=new te("NotebookEditorLayoutConfigure"),te.NotebookKernelSource=new te("NotebookKernelSource"),te.BulkEditTitle=new te("BulkEditTitle"),te.BulkEditContext=new te("BulkEditContext"),te.TimelineItemContext=new te("TimelineItemContext"),te.TimelineTitle=new te("TimelineTitle"),te.TimelineTitleContext=new te("TimelineTitleContext"),te.TimelineFilterSubMenu=new te("TimelineFilterSubMenu"),te.AccountsContext=new te("AccountsContext"),te.SidebarTitle=new te("SidebarTitle"),te.PanelTitle=new te("PanelTitle"),te.AuxiliaryBarTitle=new te("AuxiliaryBarTitle"),te.AuxiliaryBarHeader=new te("AuxiliaryBarHeader"),te.TerminalInstanceContext=new te("TerminalInstanceContext"),te.TerminalEditorInstanceContext=new te("TerminalEditorInstanceContext"),te.TerminalNewDropdownContext=new te("TerminalNewDropdownContext"),te.TerminalTabContext=new te("TerminalTabContext"),te.TerminalTabEmptyAreaContext=new te("TerminalTabEmptyAreaContext"),te.TerminalStickyScrollContext=new te("TerminalStickyScrollContext"),te.WebviewContext=new te("WebviewContext"),te.InlineCompletionsActions=new te("InlineCompletionsActions"),te.InlineEditActions=new te("InlineEditActions"),te.NewFile=new te("NewFile"),te.MergeInput1Toolbar=new te("MergeToolbar1Toolbar"),te.MergeInput2Toolbar=new te("MergeToolbar2Toolbar"),te.MergeBaseToolbar=new te("MergeBaseToolbar"),te.MergeInputResultToolbar=new te("MergeToolbarResultToolbar"),te.InlineSuggestionToolbar=new te("InlineSuggestionToolbar"),te.InlineEditToolbar=new te("InlineEditToolbar"),te.ChatContext=new te("ChatContext"),te.ChatCodeBlock=new te("ChatCodeblock"),te.ChatCompareBlock=new te("ChatCompareBlock"),te.ChatMessageTitle=new te("ChatMessageTitle"),te.ChatExecute=new te("ChatExecute"),te.ChatExecuteSecondary=new te("ChatExecuteSecondary"),te.ChatInputSide=new te("ChatInputSide"),te.AccessibleView=new te("AccessibleView"),te.MultiDiffEditorFileToolbar=new te("MultiDiffEditorFileToolbar"),te.DiffEditorHunkToolbar=new te("DiffEditorHunkToolbar"),te.DiffEditorSelectionToolbar=new te("DiffEditorSelectionToolbar");let Te=te;const $8=class $8{static for(e){let t=this._all.get(e);return t||(t=new $8(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof $8&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};$8._all=new Map;let vT=$8;const Xs=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new wlt({merge:vT.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(vT.for(Te.CommandPalette)),Ee(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(vT.for(Te.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new td,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(vT.for(n)),Ee(()=>{i(),this._onDidChangeMenu.fire(vT.for(n))})}appendMenuItems(n){const e=new Z;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===Te.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)lR(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class uS extends u1{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let id=jY=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r,a){this.hideActions=s,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=jY.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&$e.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=$e.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new jY(t,void 0,i,s,void 0,r,a):void 0,this._options=i,this.class=c&&$e.asClassName(c)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};id=jY=D([_(5,Pe),_(6,Qi)],id);class pi{constructor(e){this.desc=e}}function At(n){const e=[],t=new n,{f1:i,menu:s,keybinding:o,...r}=t.desc;if(yt.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(yt.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(s))for(const a of s)e.push(Xs.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else s&&e.push(Xs.appendMenuItem(s.id,{command:{...r,precondition:s.precondition===null?void 0:r.precondition},...s}));if(i&&(e.push(Xs.appendMenuItem(Te.CommandPalette,{command:r,when:r.precondition})),e.push(Xs.addCommand(r))),Array.isArray(o))for(const a of o)e.push(xr.registerKeybindingRule({...a,id:r.id,when:r.precondition?ge.and(r.precondition,a.when):a.when}));else o&&e.push(xr.registerKeybindingRule({...o,id:r.id,when:r.precondition?ge.and(r.precondition,o.when):o.when}));return{dispose(){St(e)}}}const on=ae("telemetryService"),Igt=ae("customEndpointTelemetryService"),Ze=ae("logService"),wp=ae("loggerService"),BU="vs/editor/browser/editorExtensions";var mi;(function(n){n[n.Eager=0]="Eager",n[n.AfterFirstRender=1]="AfterFirstRender",n[n.BeforeFirstInteraction=2]="BeforeFirstInteraction",n[n.Eventually=3]="Eventually",n[n.Lazy=4]="Lazy"})(mi||(mi={}));let Jle=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=ge.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};xr.registerKeybindingRule(s)}}yt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Xs.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class Z1 extends Jle{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Pe).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return Yc.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class lt extends Yc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=Te.EditorContext),s.title||(s.title=e.label),s.when=ge.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(lt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(on).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class yje extends lt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Pe),a=o.get(Ze);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(o,s,...t)})}}function nA(n,e){yt.registerCommand(n,function(t,...i){const s=t.get(be),[o,r]=i;Bt(P.isUri(o)),Bt(oe.isIPosition(r));const a=t.get(Ai).getModel(o);if(a){const c=oe.lift(r);return s.invokeFunction(e,a,c,...i.slice(2))}return t.get(Rn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=s.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function Ke(n){return sm.INSTANCE.registerEditorCommand(n),n}function Fe(n){const e=new n;return sm.INSTANCE.registerEditorAction(e),e}function Sje(n){return sm.INSTANCE.registerEditorAction(n),n}function Lgt(n){sm.INSTANCE.registerEditorAction(n)}function vn(n,e,t){sm.INSTANCE.registerEditorContribution(n,e,t)}function Aje(n,e){sm.INSTANCE.registerDiffEditorContribution(n,e)}var b_;(function(n){function e(r){return sm.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return sm.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return sm.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return sm.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return sm.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(b_||(b_={}));const Tgt={EditorCommonContributions:"editor.contributions"},oae=class oae{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}registerDiffEditorContribution(e,t){this.diffEditorContributions.push({id:e,ctor:t})}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};oae.INSTANCE=new oae;let sm=oae;it.add(Tgt.EditorCommonContributions,sm.INSTANCE);function rQ(n){return n.register(),n}const Eje=rQ(new Z1({id:"undo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyZ},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,0,"&&Undo"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,1,"Undo"),order:1}]}));rQ(new Cje(Eje,{id:"default:undo",precondition:void 0}));const xje=rQ(new Z1({id:"redo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyY,secondary:[V.CtrlCmd|V.Shift|E.KeyZ],mac:{primary:V.CtrlCmd|V.Shift|E.KeyZ}},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,2,"&&Redo"),order:2},{menuId:Te.CommandPalette,group:"",title:g(BU,3,"Redo"),order:1}]}));rQ(new Cje(xje,{id:"default:redo",precondition:void 0}));const Rgt=rQ(new Z1({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:null,primary:V.CtrlCmd|E.KeyA},menuOpts:[{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(BU,4,"&&Select All"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,5,"Select All"),order:1}]})),Mgt="$initialize";let y2e=!1;function Nve(n){Jn&&(y2e||(y2e=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}var qp;(function(n){n[n.Request=0]="Request",n[n.Reply=1]="Reply",n[n.SubscribeEvent=2]="SubscribeEvent",n[n.Event=3]="Event",n[n.UnsubscribeEvent=4]="UnsubscribeEvent"})(qp||(qp={}));class Ngt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=qp.Request}}class S2e{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=qp.Reply}}class Pgt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=qp.SubscribeEvent}}class Fgt{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=qp.Event}}class Ogt{constructor(e,t){this.vsWorker=e,this.req=t,this.type=qp.UnsubscribeEvent}}class Bgt{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new Ngt(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Pgt(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Ogt(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case qp.Reply:return this._handleReplyMessage(e);case qp.Request:return this._handleRequestMessage(e);case qp.SubscribeEvent:return this._handleSubscribeEventMessage(e);case qp.Event:return this._handleEventMessage(e);case qp.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new S2e(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=EU(s.detail)),this._send(new S2e(this._workerId,t,void 0,EU(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new Fgt(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===qp.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{s?.(l)})),this._protocol=new Bgt({sendMessage:(l,d)=>{this._worker.postMessage(l,d)},handleMessage:(l,d)=>{if(typeof i[l]!="function")return Promise.reject(new Error("Missing method "+l+" on main thread host."));try{return Promise.resolve(i[l].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(l,d)=>{if(kje(l)){const h=i[l].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${l} on main thread host.`);return h}if(Dje(l)){const h=i[l];if(typeof h!="function")throw new Error(`Missing event ${l} on main thread host.`);return h}throw new Error(`Malformed event name ${l}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const r=ORe(i);this._onModuleLoaded=this._protocol.sendMessage(Mgt,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(l,d)=>this._request(l,d),c=(l,d)=>this._protocol.listen(l,d);this._lazyProxy=new Promise((l,d)=>{s=d,this._onModuleLoaded.then(h=>{l(Hgt(h,a,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function Dje(n){return n[0]==="o"&&n[1]==="n"&&fy(n.charCodeAt(2))}function kje(n){return/^onDynamic/.test(n)&&fy(n.charCodeAt(9))}function Hgt(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(kje(r)){o[r]=s(r);continue}if(Dje(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function Jx(n,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(i){bt(i);return}try{return yi.trustedTypes?.createPolicy(n,e)}catch(i){bt(i);return}}const A2e=Jx("defaultWorkerFactory",{createScriptURL:n=>n});function Ugt(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(A2e?A2e.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Vgt(n){return typeof n.then=="function"}class zgt extends ${constructor(e,t,i,s,o){super(),this.id=t,this.label=i;const r=Ugt(i);Vgt(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){s(c.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",o),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(s){bt(s),bt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:s}))}})}}const rae=class rae{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++rae.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new zgt(e,s,this._label||"anonymous"+s,t,o=>{Nve(o),this._webWorkerFailedBeforeError=o,i(o)})}};rae.LAST_WORKER_ID=0;let Pve=rae;var Ga;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ga||(Ga={}));class Fge{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew Fge(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Fge({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Fge({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Edt extends Hr{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(x.minimap,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:g(ee,67,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:g(ee,68,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[g(ee,69,"The minimap has the same size as the editor contents (and might scroll)."),g(ee,70,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),g(ee,71,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:g(ee,72,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:g(ee,73,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:g(ee,74,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:g(ee,75,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:g(ee,76,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:g(ee,77,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:g(ee,78,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:g(ee,79,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:g(ee,80,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:g(ee,81,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),autohide:It(t.autohide,this.defaultValue.autohide),size:La(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:La(t.side,this.defaultValue.side,["right","left"]),showSlider:La(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:It(t.renderCharacters,this.defaultValue.renderCharacters),scale:Bo.clampedInt(t.scale,1,1,3),maxColumn:Bo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:It(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:It(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:dm.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:dm.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function xdt(n){return n==="ctrlCmd"?ei?"metaKey":"ctrlKey":"altKey"}class Ddt extends Hr{constructor(){super(x.padding,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:g(ee,82,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:g(ee,83,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Bo.clampedInt(t.top,0,0,1e3),bottom:Bo.clampedInt(t.bottom,0,0,1e3)}}}class kdt extends Hr{constructor(){const e={enabled:!0,cycle:!0};super(x.parameterHints,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:g(ee,84,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:g(ee,85,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),cycle:It(t.cycle,this.defaultValue.cycle)}}}class Idt extends Zq{constructor(){super(x.pixelRatio)}compute(e,t,i){return e.pixelRatio}}class Ldt extends Hr{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[g(ee,86,"Quick suggestions show inside the suggest widget"),g(ee,87,"Quick suggestions show as ghost text"),g(ee,88,"Quick suggestions are disabled")]}];super(x.quickSuggestions,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:g(ee,89,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:g(ee,90,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:g(ee,91,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:g(ee,92,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const l=e?"on":"off";return{comments:l,strings:l,other:l}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,o=["on","inline","off"];let r,a,c;return typeof t=="boolean"?r=t?"on":"off":r=La(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=La(i,this.defaultValue.comments,o),typeof s=="boolean"?c=s?"on":"off":c=La(s,this.defaultValue.strings,o),{other:r,comments:a,strings:c}}}var Qr;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(Qr||(Qr={}));class Tdt extends Hr{constructor(){super(x.lineNumbers,"lineNumbers",{renderType:Qr.On,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[g(ee,93,"Line numbers are not rendered."),g(ee,94,"Line numbers are rendered as absolute number."),g(ee,95,"Line numbers are rendered as distance in lines to cursor position."),g(ee,96,"Line numbers are rendered every 10 lines.")],default:"on",description:g(ee,97,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=Qr.Custom,i=e):e==="interval"?t=Qr.Interval:e==="relative"?t=Qr.Relative:e==="on"?t=Qr.On:t=Qr.Off),{renderType:t,renderFn:i}}}function aZ(n){const e=n.get(x.renderValidationDecorations);return e==="editable"?n.get(x.readOnly):e!=="on"}class Rdt extends Hr{constructor(){const e=[],t={type:"number",description:g(ee,98,"Number of monospace characters at which this editor ruler will render.")};super(x.rulers,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:g(ee,99,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:g(ee,100,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:Bo.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:Bo.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class Mdt extends Hr{constructor(){super(x.readOnlyMessage,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function JBe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return zo.Hidden;case"visible":return zo.Visible;default:return zo.Auto}}let Ndt=class extends Hr{constructor(){const e={vertical:zo.Auto,horizontal:zo.Auto,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(x.scrollbar,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(ee,101,"The vertical scrollbar will be visible only when necessary."),g(ee,102,"The vertical scrollbar will always be visible."),g(ee,103,"The vertical scrollbar will always be hidden.")],default:"auto",description:g(ee,104,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(ee,105,"The horizontal scrollbar will be visible only when necessary."),g(ee,106,"The horizontal scrollbar will always be visible."),g(ee,107,"The horizontal scrollbar will always be hidden.")],default:"auto",description:g(ee,108,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:g(ee,109,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:g(ee,110,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:g(ee,111,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:g(ee,112,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=Bo.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=Bo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Bo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:JBe(t.vertical,this.defaultValue.vertical),horizontal:JBe(t.horizontal,this.defaultValue.horizontal),useShadows:It(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:It(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:It(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:It(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:It(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Bo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:Bo.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:It(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:It(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Rp="inUntrustedWorkspace",Ug={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"};class Pdt extends Hr{constructor(){const e={nonBasicASCII:Rp,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Rp,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(x.unicodeHighlighting,"unicodeHighlight",e,{[Ug.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rp],default:e.nonBasicASCII,description:g(ee,113,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Ug.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:g(ee,114,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ug.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:g(ee,115,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Ug.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rp],default:e.includeComments,description:g(ee,116,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ug.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Rp],default:e.includeStrings,description:g(ee,117,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ug.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g(ee,118,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ug.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:g(ee,119,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Io(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Io(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const s=super.applyUpdate(e,t);return i?new a$(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:SW(t.nonBasicASCII,Rp,[!0,!1,Rp]),invisibleCharacters:It(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:It(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:SW(t.includeComments,Rp,[!0,!1,Rp]),includeStrings:SW(t.includeStrings,Rp,[!0,!1,Rp]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,o]of Object.entries(e))o===!0&&(i[s]=!0);return i}}class Fdt extends Hr{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(x.inlineSuggest,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:g(ee,120,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(ee,121,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),g(ee,122,"Show the inline suggestion toolbar when hovering over an inline suggestion."),g(ee,123,"Never show the inline suggestion toolbar.")],description:g(ee,124,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:g(ee,125,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:g(ee,126,"Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),mode:La(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:La(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:It(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:It(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Gu.string(t.fontFamily,this.defaultValue.fontFamily)}}}class Odt extends Hr{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(x.inlineEdit,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:g(ee,127,"Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(ee,128,"Show the inline edit toolbar whenever an inline suggestion is shown."),g(ee,129,"Show the inline edit toolbar when hovering over an inline suggestion."),g(ee,130,"Never show the inline edit toolbar.")],description:g(ee,131,"Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:g(ee,132,"Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:g(ee,133,"Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),showToolbar:La(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:Gu.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:It(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:It(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class Bdt extends Hr{constructor(){const e={enabled:Ph.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ph.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(x.bracketPairColorization,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(ee,134,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:g(ee,135,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:It(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Wdt extends Hr{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(x.guides,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(ee,136,"Enables bracket pair guides."),g(ee,137,"Enables bracket pair guides only for the active bracket pair."),g(ee,138,"Disables bracket pair guides.")],default:e.bracketPairs,description:g(ee,139,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(ee,140,"Enables horizontal guides as addition to vertical bracket pair guides."),g(ee,141,"Enables horizontal guides only for the active bracket pair."),g(ee,142,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:g(ee,143,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:g(ee,144,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:g(ee,145,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[g(ee,146,"Highlights the active indent guide."),g(ee,147,"Highlights the active indent guide even if bracket guides are highlighted."),g(ee,148,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:g(ee,149,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:SW(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:SW(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:It(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:It(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:SW(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function SW(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class Hdt extends Hr{constructor(){const e={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(x.suggest,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[g(ee,150,"Insert suggestion without overwriting text right of the cursor."),g(ee,151,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:g(ee,152,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:g(ee,153,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:g(ee,154,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:g(ee,155,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[g(ee,156,"Always select a suggestion when automatically triggering IntelliSense."),g(ee,157,"Never select a suggestion when automatically triggering IntelliSense."),g(ee,158,"Select a suggestion only when triggering IntelliSense from a trigger character."),g(ee,159,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:g(ee,160,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:g(ee,161,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:g(ee,162,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:g(ee,163,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:g(ee,164,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:g(ee,165,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:g(ee,166,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:g(ee,167,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:g(ee,168,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:g(ee,169,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:g(ee,170,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:g(ee,171,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:g(ee,172,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:g(ee,173,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:g(ee,174,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:g(ee,175,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:g(ee,176,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:g(ee,177,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:g(ee,178,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:g(ee,179,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:g(ee,180,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:g(ee,181,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:g(ee,182,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:g(ee,183,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:g(ee,184,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:g(ee,185,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:g(ee,186,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:g(ee,187,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:g(ee,188,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:g(ee,189,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:g(ee,190,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:g(ee,191,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:g(ee,192,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:g(ee,193,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:g(ee,194,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:g(ee,195,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:g(ee,196,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:g(ee,197,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:La(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:It(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:It(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:It(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:It(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:La(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:It(t.showIcons,this.defaultValue.showIcons),showStatusBar:It(t.showStatusBar,this.defaultValue.showStatusBar),preview:It(t.preview,this.defaultValue.preview),previewMode:La(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:It(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:It(t.showMethods,this.defaultValue.showMethods),showFunctions:It(t.showFunctions,this.defaultValue.showFunctions),showConstructors:It(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:It(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:It(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:It(t.showFields,this.defaultValue.showFields),showVariables:It(t.showVariables,this.defaultValue.showVariables),showClasses:It(t.showClasses,this.defaultValue.showClasses),showStructs:It(t.showStructs,this.defaultValue.showStructs),showInterfaces:It(t.showInterfaces,this.defaultValue.showInterfaces),showModules:It(t.showModules,this.defaultValue.showModules),showProperties:It(t.showProperties,this.defaultValue.showProperties),showEvents:It(t.showEvents,this.defaultValue.showEvents),showOperators:It(t.showOperators,this.defaultValue.showOperators),showUnits:It(t.showUnits,this.defaultValue.showUnits),showValues:It(t.showValues,this.defaultValue.showValues),showConstants:It(t.showConstants,this.defaultValue.showConstants),showEnums:It(t.showEnums,this.defaultValue.showEnums),showEnumMembers:It(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:It(t.showKeywords,this.defaultValue.showKeywords),showWords:It(t.showWords,this.defaultValue.showWords),showColors:It(t.showColors,this.defaultValue.showColors),showFiles:It(t.showFiles,this.defaultValue.showFiles),showReferences:It(t.showReferences,this.defaultValue.showReferences),showFolders:It(t.showFolders,this.defaultValue.showFolders),showTypeParameters:It(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:It(t.showSnippets,this.defaultValue.showSnippets),showUsers:It(t.showUsers,this.defaultValue.showUsers),showIssues:It(t.showIssues,this.defaultValue.showIssues)}}}class Udt extends Hr{constructor(){super(x.smartSelect,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:g(ee,198,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:g(ee,199,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:It(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:It(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Vdt extends Hr{constructor(){const e=[];super(x.wordSegmenterLocales,"wordSegmenterLocales",e,{anyOf:[{description:g(ee,200,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:g(ee,200,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}var Vg;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(Vg||(Vg={}));class zdt extends Hr{constructor(){super(x.wrappingIndent,"wrappingIndent",Vg.Same,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[g(ee,201,"No indentation. Wrapped lines begin at column 1."),g(ee,202,"Wrapped lines get the same indentation as the parent."),g(ee,203,"Wrapped lines get +1 indentation toward the parent."),g(ee,204,"Wrapped lines get +2 indentation toward the parent.")],description:g(ee,205,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return Vg.None;case"same":return Vg.Same;case"indent":return Vg.Indent;case"deepIndent":return Vg.DeepIndent}return Vg.Same}compute(e,t,i){return t.get(x.accessibilitySupport)===Kd.Enabled?Vg.None:i}}class $dt extends Zq{constructor(){super(x.wrappingInfo)}compute(e,t,i){const s=t.get(x.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class Gdt extends Hr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(x.dropIntoEditor,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(ee,206,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:g(ee,207,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[g(ee,208,"Show the drop selector widget after a file is dropped into the editor."),g(ee,209,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),showDropSelector:La(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class qdt extends Hr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(x.pasteAs,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(ee,210,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:g(ee,211,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[g(ee,212,"Show the paste selector widget after content is pasted into the editor."),g(ee,213,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:It(t.enabled,this.defaultValue.enabled),showPasteSelector:La(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Qdt="Consolas, 'Courier New', monospace",jdt="Menlo, Monaco, 'Courier New', monospace",Kdt="'Droid Sans Mono', 'monospace', monospace",Gh={fontFamily:ei?jdt:jr?Kdt:Qdt,fontWeight:"normal",fontSize:ei?12:14,lineHeight:0,letterSpacing:0},HB=[];function Ve(n){return HB[n.id]=n,n}var x;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.inlineEdit=63]="inlineEdit",n[n.letterSpacing=64]="letterSpacing",n[n.lightbulb=65]="lightbulb",n[n.lineDecorationsWidth=66]="lineDecorationsWidth",n[n.lineHeight=67]="lineHeight",n[n.lineNumbers=68]="lineNumbers",n[n.lineNumbersMinChars=69]="lineNumbersMinChars",n[n.linkedEditing=70]="linkedEditing",n[n.links=71]="links",n[n.matchBrackets=72]="matchBrackets",n[n.minimap=73]="minimap",n[n.mouseStyle=74]="mouseStyle",n[n.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=76]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",n[n.multiCursorModifier=78]="multiCursorModifier",n[n.multiCursorPaste=79]="multiCursorPaste",n[n.multiCursorLimit=80]="multiCursorLimit",n[n.occurrencesHighlight=81]="occurrencesHighlight",n[n.overviewRulerBorder=82]="overviewRulerBorder",n[n.overviewRulerLanes=83]="overviewRulerLanes",n[n.padding=84]="padding",n[n.pasteAs=85]="pasteAs",n[n.parameterHints=86]="parameterHints",n[n.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",n[n.quickSuggestions=89]="quickSuggestions",n[n.quickSuggestionsDelay=90]="quickSuggestionsDelay",n[n.readOnly=91]="readOnly",n[n.readOnlyMessage=92]="readOnlyMessage",n[n.renameOnType=93]="renameOnType",n[n.renderControlCharacters=94]="renderControlCharacters",n[n.renderFinalNewline=95]="renderFinalNewline",n[n.renderLineHighlight=96]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=98]="renderValidationDecorations",n[n.renderWhitespace=99]="renderWhitespace",n[n.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",n[n.roundedSelection=101]="roundedSelection",n[n.rulers=102]="rulers",n[n.scrollbar=103]="scrollbar",n[n.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=105]="scrollBeyondLastLine",n[n.scrollPredominantAxis=106]="scrollPredominantAxis",n[n.selectionClipboard=107]="selectionClipboard",n[n.selectionHighlight=108]="selectionHighlight",n[n.selectOnLineNumbers=109]="selectOnLineNumbers",n[n.showFoldingControls=110]="showFoldingControls",n[n.showUnused=111]="showUnused",n[n.snippetSuggestions=112]="snippetSuggestions",n[n.smartSelect=113]="smartSelect",n[n.smoothScrolling=114]="smoothScrolling",n[n.stickyScroll=115]="stickyScroll",n[n.stickyTabStops=116]="stickyTabStops",n[n.stopRenderingLineAfter=117]="stopRenderingLineAfter",n[n.suggest=118]="suggest",n[n.suggestFontSize=119]="suggestFontSize",n[n.suggestLineHeight=120]="suggestLineHeight",n[n.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",n[n.suggestSelection=122]="suggestSelection",n[n.tabCompletion=123]="tabCompletion",n[n.tabIndex=124]="tabIndex",n[n.unicodeHighlighting=125]="unicodeHighlighting",n[n.unusualLineTerminators=126]="unusualLineTerminators",n[n.useShadowDOM=127]="useShadowDOM",n[n.useTabStops=128]="useTabStops",n[n.wordBreak=129]="wordBreak",n[n.wordSegmenterLocales=130]="wordSegmenterLocales",n[n.wordSeparators=131]="wordSeparators",n[n.wordWrap=132]="wordWrap",n[n.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=135]="wordWrapColumn",n[n.wordWrapOverride1=136]="wordWrapOverride1",n[n.wordWrapOverride2=137]="wordWrapOverride2",n[n.wrappingIndent=138]="wrappingIndent",n[n.wrappingStrategy=139]="wrappingStrategy",n[n.showDeprecated=140]="showDeprecated",n[n.inlayHints=141]="inlayHints",n[n.editorClassName=142]="editorClassName",n[n.pixelRatio=143]="pixelRatio",n[n.tabFocusMode=144]="tabFocusMode",n[n.layoutInfo=145]="layoutInfo",n[n.wrappingInfo=146]="wrappingInfo",n[n.defaultColorDecorators=147]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(x||(x={}));const _u={acceptSuggestionOnCommitCharacter:Ve(new Un(x.acceptSuggestionOnCommitCharacter,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:g(ee,214,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Ve(new oa(x.acceptSuggestionOnEnter,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",g(ee,215,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:g(ee,216,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Ve(new adt),accessibilityPageSize:Ve(new Bo(x.accessibilityPageSize,"accessibilityPageSize",10,1,Zn.MAX_SAFE_SMALL_INTEGER,{description:g(ee,217,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Ve(new Gu(x.ariaLabel,"ariaLabel",g(ee,218,"Editor content"))),ariaRequired:Ve(new Un(x.ariaRequired,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ve(new Un(x.screenReaderAnnounceInlineSuggestion,"screenReaderAnnounceInlineSuggestion",!0,{description:g(ee,219,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ve(new oa(x.autoClosingBrackets,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(ee,220,"Use language configurations to determine when to autoclose brackets."),g(ee,221,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:g(ee,222,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Ve(new oa(x.autoClosingComments,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(ee,223,"Use language configurations to determine when to autoclose comments."),g(ee,224,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:g(ee,225,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Ve(new oa(x.autoClosingDelete,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",g(ee,226,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:g(ee,227,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Ve(new oa(x.autoClosingOvertype,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",g(ee,228,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:g(ee,229,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Ve(new oa(x.autoClosingQuotes,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(ee,230,"Use language configurations to determine when to autoclose quotes."),g(ee,231,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:g(ee,232,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Ve(new fj(x.autoIndent,"autoIndent",ed.Full,"full",["none","keep","brackets","advanced","full"],rdt,{enumDescriptions:[g(ee,233,"The editor will not insert indentation automatically."),g(ee,234,"The editor will keep the current line's indentation."),g(ee,235,"The editor will keep the current line's indentation and honor language defined brackets."),g(ee,236,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),g(ee,237,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:g(ee,238,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Ve(new Un(x.automaticLayout,"automaticLayout",!1)),autoSurround:Ve(new oa(x.autoSurround,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[g(ee,239,"Use language configurations to determine when to automatically surround selections."),g(ee,240,"Surround with quotes but not brackets."),g(ee,241,"Surround with brackets but not quotes."),""],description:g(ee,242,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Ve(new Bdt),bracketPairGuides:Ve(new Wdt),stickyTabStops:Ve(new Un(x.stickyTabStops,"stickyTabStops",!1,{description:g(ee,243,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Ve(new Un(x.codeLens,"codeLens",!0,{description:g(ee,244,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ve(new Gu(x.codeLensFontFamily,"codeLensFontFamily","",{description:g(ee,245,"Controls the font family for CodeLens.")})),codeLensFontSize:Ve(new Bo(x.codeLensFontSize,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:g(ee,246,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Ve(new Un(x.colorDecorators,"colorDecorators",!0,{description:g(ee,247,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ve(new oa(x.colorDecoratorsActivatedOn,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[g(ee,248,"Make the color picker appear both on click and hover of the color decorator"),g(ee,249,"Make the color picker appear on hover of the color decorator"),g(ee,250,"Make the color picker appear on click of the color decorator")],description:g(ee,251,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Ve(new Bo(x.colorDecoratorsLimit,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:g(ee,252,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Ve(new Un(x.columnSelection,"columnSelection",!1,{description:g(ee,253,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ve(new cdt),contextmenu:Ve(new Un(x.contextmenu,"contextmenu",!0)),copyWithSyntaxHighlighting:Ve(new Un(x.copyWithSyntaxHighlighting,"copyWithSyntaxHighlighting",!0,{description:g(ee,254,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ve(new fj(x.cursorBlinking,"cursorBlinking",xh.Blink,"blink",["blink","smooth","phase","expand","solid"],ldt,{description:g(ee,255,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ve(new oa(x.cursorSmoothCaretAnimation,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[g(ee,256,"Smooth caret animation is disabled."),g(ee,257,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),g(ee,258,"Smooth caret animation is always enabled.")],description:g(ee,259,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Ve(new fj(x.cursorStyle,"cursorStyle",fa.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],hdt,{description:g(ee,260,"Controls the cursor style.")})),cursorSurroundingLines:Ve(new Bo(x.cursorSurroundingLines,"cursorSurroundingLines",0,0,Zn.MAX_SAFE_SMALL_INTEGER,{description:g(ee,261,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Ve(new oa(x.cursorSurroundingLinesStyle,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[g(ee,262,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),g(ee,263,"`cursorSurroundingLines` is enforced always.")],markdownDescription:g(ee,264,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Ve(new Bo(x.cursorWidth,"cursorWidth",0,0,Zn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(ee,265,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ve(new Un(x.disableLayerHinting,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ve(new Un(x.disableMonospaceOptimizations,"disableMonospaceOptimizations",!1)),domReadOnly:Ve(new Un(x.domReadOnly,"domReadOnly",!1)),dragAndDrop:Ve(new Un(x.dragAndDrop,"dragAndDrop",!0,{description:g(ee,266,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ve(new gdt),dropIntoEditor:Ve(new Gdt),stickyScroll:Ve(new Cdt),experimentalWhitespaceRendering:Ve(new oa(x.experimentalWhitespaceRendering,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[g(ee,267,"Use a new rendering method with svgs."),g(ee,268,"Use a new rendering method with font characters."),g(ee,269,"Use the stable rendering method.")],description:g(ee,270,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Ve(new Gu(x.extraEditorClassName,"extraEditorClassName","")),fastScrollSensitivity:Ve(new dm(x.fastScrollSensitivity,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:g(ee,271,"Scrolling speed multiplier when pressing `Alt`.")})),find:Ve(new fdt),fixedOverflowWidgets:Ve(new Un(x.fixedOverflowWidgets,"fixedOverflowWidgets",!1)),folding:Ve(new Un(x.folding,"folding",!0,{description:g(ee,272,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Ve(new oa(x.foldingStrategy,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[g(ee,273,"Use a language-specific folding strategy if available, else the indentation-based one."),g(ee,274,"Use the indentation-based folding strategy.")],description:g(ee,275,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Ve(new Un(x.foldingHighlight,"foldingHighlight",!0,{description:g(ee,276,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ve(new Un(x.foldingImportsByDefault,"foldingImportsByDefault",!1,{description:g(ee,277,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ve(new Bo(x.foldingMaximumRegions,"foldingMaximumRegions",5e3,10,65e3,{description:g(ee,278,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Ve(new Un(x.unfoldOnClickAfterEndOfLine,"unfoldOnClickAfterEndOfLine",!1,{description:g(ee,279,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ve(new Gu(x.fontFamily,"fontFamily",Gh.fontFamily,{description:g(ee,280,"Controls the font family.")})),fontInfo:Ve(new pdt),fontLigatures2:Ve(new l1),fontSize:Ve(new mdt),fontWeight:Ve(new y_e),fontVariations:Ve(new S9),formatOnPaste:Ve(new Un(x.formatOnPaste,"formatOnPaste",!1,{description:g(ee,281,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Ve(new Un(x.formatOnType,"formatOnType",!1,{description:g(ee,282,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ve(new Un(x.glyphMargin,"glyphMargin",!0,{description:g(ee,283,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Ve(new _dt),hideCursorInOverviewRuler:Ve(new Un(x.hideCursorInOverviewRuler,"hideCursorInOverviewRuler",!1,{description:g(ee,284,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ve(new vdt),inDiffEditor:Ve(new Un(x.inDiffEditor,"inDiffEditor",!1)),letterSpacing:Ve(new dm(x.letterSpacing,"letterSpacing",Gh.letterSpacing,n=>dm.clamp(n,-5,20),{description:g(ee,285,"Controls the letter spacing in pixels.")})),lightbulb:Ve(new bdt),lineDecorationsWidth:Ve(new Sdt),lineHeight:Ve(new Adt),lineNumbers:Ve(new Tdt),lineNumbersMinChars:Ve(new Bo(x.lineNumbersMinChars,"lineNumbersMinChars",5,1,300)),linkedEditing:Ve(new Un(x.linkedEditing,"linkedEditing",!1,{description:g(ee,286,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Ve(new Un(x.links,"links",!0,{description:g(ee,287,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ve(new oa(x.matchBrackets,"matchBrackets","always",["always","near","never"],{description:g(ee,288,"Highlight matching brackets.")})),minimap:Ve(new Edt),mouseStyle:Ve(new oa(x.mouseStyle,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ve(new dm(x.mouseWheelScrollSensitivity,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:g(ee,289,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Ve(new Un(x.mouseWheelZoom,"mouseWheelZoom",!1,{markdownDescription:ei?g(ee,290,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):g(ee,291,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Ve(new Un(x.multiCursorMergeOverlapping,"multiCursorMergeOverlapping",!0,{description:g(ee,292,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ve(new fj(x.multiCursorModifier,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],xdt,{markdownEnumDescriptions:[g(ee,293,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(ee,294,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:g(ee,295,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Ve(new oa(x.multiCursorPaste,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[g(ee,296,"Each cursor pastes a single line of the text."),g(ee,297,"Each cursor pastes the full text.")],markdownDescription:g(ee,298,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Ve(new Bo(x.multiCursorLimit,"multiCursorLimit",1e4,1,1e5,{markdownDescription:g(ee,299,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Ve(new oa(x.occurrencesHighlight,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[g(ee,300,"Does not highlight occurrences."),g(ee,301,"Highlights occurrences only in the current file."),g(ee,302,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:g(ee,303,"Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Ve(new Un(x.overviewRulerBorder,"overviewRulerBorder",!0,{description:g(ee,304,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ve(new Bo(x.overviewRulerLanes,"overviewRulerLanes",3,0,3)),padding:Ve(new Ddt),pasteAs:Ve(new qdt),parameterHints:Ve(new kdt),peekWidgetDefaultFocus:Ve(new oa(x.peekWidgetDefaultFocus,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[g(ee,305,"Focus the tree when opening peek"),g(ee,306,"Focus the editor when opening peek")],description:g(ee,307,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Ve(new Un(x.definitionLinkOpensInPeek,"definitionLinkOpensInPeek",!1,{description:g(ee,308,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ve(new Ldt),quickSuggestionsDelay:Ve(new Bo(x.quickSuggestionsDelay,"quickSuggestionsDelay",10,0,Zn.MAX_SAFE_SMALL_INTEGER,{description:g(ee,309,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ve(new Un(x.readOnly,"readOnly",!1)),readOnlyMessage:Ve(new Mdt),renameOnType:Ve(new Un(x.renameOnType,"renameOnType",!1,{description:g(ee,310,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:g(ee,311,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ve(new Un(x.renderControlCharacters,"renderControlCharacters",!0,{description:g(ee,312,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ve(new oa(x.renderFinalNewline,"renderFinalNewline",jr?"dimmed":"on",["off","on","dimmed"],{description:g(ee,313,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Ve(new oa(x.renderLineHighlight,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",g(ee,314,"Highlights both the gutter and the current line.")],description:g(ee,315,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Ve(new Un(x.renderLineHighlightOnlyWhenFocus,"renderLineHighlightOnlyWhenFocus",!1,{description:g(ee,316,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ve(new oa(x.renderValidationDecorations,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ve(new oa(x.renderWhitespace,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",g(ee,317,"Render whitespace characters except for single spaces between words."),g(ee,318,"Render whitespace characters only on selected text."),g(ee,319,"Render only trailing whitespace characters."),""],description:g(ee,320,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Ve(new Bo(x.revealHorizontalRightPadding,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ve(new Un(x.roundedSelection,"roundedSelection",!0,{description:g(ee,321,"Controls whether selections should have rounded corners.")})),rulers:Ve(new Rdt),scrollbar:Ve(new Ndt),scrollBeyondLastColumn:Ve(new Bo(x.scrollBeyondLastColumn,"scrollBeyondLastColumn",4,0,Zn.MAX_SAFE_SMALL_INTEGER,{description:g(ee,322,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ve(new Un(x.scrollBeyondLastLine,"scrollBeyondLastLine",!0,{description:g(ee,323,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ve(new Un(x.scrollPredominantAxis,"scrollPredominantAxis",!0,{description:g(ee,324,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Ve(new Un(x.selectionClipboard,"selectionClipboard",!0,{description:g(ee,325,"Controls whether the Linux primary clipboard should be supported."),included:jr})),selectionHighlight:Ve(new Un(x.selectionHighlight,"selectionHighlight",!0,{description:g(ee,326,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ve(new Un(x.selectOnLineNumbers,"selectOnLineNumbers",!0)),showFoldingControls:Ve(new oa(x.showFoldingControls,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[g(ee,327,"Always show the folding controls."),g(ee,328,"Never show the folding controls and reduce the gutter size."),g(ee,329,"Only show the folding controls when the mouse is over the gutter.")],description:g(ee,330,"Controls when the folding controls on the gutter are shown.")})),showUnused:Ve(new Un(x.showUnused,"showUnused",!0,{description:g(ee,331,"Controls fading out of unused code.")})),showDeprecated:Ve(new Un(x.showDeprecated,"showDeprecated",!0,{description:g(ee,332,"Controls strikethrough deprecated variables.")})),inlayHints:Ve(new ydt),snippetSuggestions:Ve(new oa(x.snippetSuggestions,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[g(ee,333,"Show snippet suggestions on top of other suggestions."),g(ee,334,"Show snippet suggestions below other suggestions."),g(ee,335,"Show snippets suggestions with other suggestions."),g(ee,336,"Do not show snippet suggestions.")],description:g(ee,337,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Ve(new Udt),smoothScrolling:Ve(new Un(x.smoothScrolling,"smoothScrolling",!1,{description:g(ee,338,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ve(new Bo(x.stopRenderingLineAfter,"stopRenderingLineAfter",1e4,-1,Zn.MAX_SAFE_SMALL_INTEGER)),suggest:Ve(new Hdt),inlineSuggest:Ve(new Fdt),inlineEdit:Ve(new Odt),inlineCompletionsAccessibilityVerbose:Ve(new Un(x.inlineCompletionsAccessibilityVerbose,"inlineCompletionsAccessibilityVerbose",!1,{description:g(ee,339,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Ve(new Bo(x.suggestFontSize,"suggestFontSize",0,0,1e3,{markdownDescription:g(ee,340,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Ve(new Bo(x.suggestLineHeight,"suggestLineHeight",0,0,1e3,{markdownDescription:g(ee,341,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Ve(new Un(x.suggestOnTriggerCharacters,"suggestOnTriggerCharacters",!0,{description:g(ee,342,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ve(new oa(x.suggestSelection,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[g(ee,343,"Always select the first suggestion."),g(ee,344,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),g(ee,345,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:g(ee,346,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Ve(new oa(x.tabCompletion,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[g(ee,347,"Tab complete will insert the best matching suggestion when pressing tab."),g(ee,348,"Disable tab completions."),g(ee,349,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:g(ee,350,"Enables tab completions.")})),tabIndex:Ve(new Bo(x.tabIndex,"tabIndex",0,-1,Zn.MAX_SAFE_SMALL_INTEGER)),unicodeHighlight:Ve(new Pdt),unusualLineTerminators:Ve(new oa(x.unusualLineTerminators,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[g(ee,351,"Unusual line terminators are automatically removed."),g(ee,352,"Unusual line terminators are ignored."),g(ee,353,"Unusual line terminators prompt to be removed.")],description:g(ee,354,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Ve(new Un(x.useShadowDOM,"useShadowDOM",!0)),useTabStops:Ve(new Un(x.useTabStops,"useTabStops",!0,{description:g(ee,355,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Ve(new oa(x.wordBreak,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[g(ee,356,"Use the default line break rule."),g(ee,357,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:g(ee,358,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Ve(new Vdt),wordSeparators:Ve(new Gu(x.wordSeparators,"wordSeparators",fQe,{description:g(ee,359,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ve(new oa(x.wordWrap,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[g(ee,360,"Lines will never wrap."),g(ee,361,"Lines will wrap at the viewport width."),g(ee,362,"Lines will wrap at `#editor.wordWrapColumn#`."),g(ee,363,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:g(ee,364,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Ve(new Gu(x.wordWrapBreakAfterCharacters,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ve(new Gu(x.wordWrapBreakBeforeCharacters,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ve(new Bo(x.wordWrapColumn,"wordWrapColumn",80,1,Zn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(ee,365,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Ve(new oa(x.wordWrapOverride1,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ve(new oa(x.wordWrapOverride2,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ve(new udt),defaultColorDecorators:Ve(new Un(x.defaultColorDecorators,"defaultColorDecorators",!1,{markdownDescription:g(ee,366,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ve(new Idt),tabFocusMode:Ve(new Un(x.tabFocusMode,"tabFocusMode",!1,{markdownDescription:g(ee,367,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ve(new yW),wrappingInfo:Ve(new $dt),wrappingIndent:Ve(new zdt),wrappingStrategy:Ve(new wdt)};var E;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(E||(E={}));var ue;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.None=0]="None",n[n.Hyper=1]="Hyper",n[n.Super=2]="Super",n[n.Fn=3]="Fn",n[n.FnLock=4]="FnLock",n[n.Suspend=5]="Suspend",n[n.Resume=6]="Resume",n[n.Turbo=7]="Turbo",n[n.Sleep=8]="Sleep",n[n.WakeUp=9]="WakeUp",n[n.KeyA=10]="KeyA",n[n.KeyB=11]="KeyB",n[n.KeyC=12]="KeyC",n[n.KeyD=13]="KeyD",n[n.KeyE=14]="KeyE",n[n.KeyF=15]="KeyF",n[n.KeyG=16]="KeyG",n[n.KeyH=17]="KeyH",n[n.KeyI=18]="KeyI",n[n.KeyJ=19]="KeyJ",n[n.KeyK=20]="KeyK",n[n.KeyL=21]="KeyL",n[n.KeyM=22]="KeyM",n[n.KeyN=23]="KeyN",n[n.KeyO=24]="KeyO",n[n.KeyP=25]="KeyP",n[n.KeyQ=26]="KeyQ",n[n.KeyR=27]="KeyR",n[n.KeyS=28]="KeyS",n[n.KeyT=29]="KeyT",n[n.KeyU=30]="KeyU",n[n.KeyV=31]="KeyV",n[n.KeyW=32]="KeyW",n[n.KeyX=33]="KeyX",n[n.KeyY=34]="KeyY",n[n.KeyZ=35]="KeyZ",n[n.Digit1=36]="Digit1",n[n.Digit2=37]="Digit2",n[n.Digit3=38]="Digit3",n[n.Digit4=39]="Digit4",n[n.Digit5=40]="Digit5",n[n.Digit6=41]="Digit6",n[n.Digit7=42]="Digit7",n[n.Digit8=43]="Digit8",n[n.Digit9=44]="Digit9",n[n.Digit0=45]="Digit0",n[n.Enter=46]="Enter",n[n.Escape=47]="Escape",n[n.Backspace=48]="Backspace",n[n.Tab=49]="Tab",n[n.Space=50]="Space",n[n.Minus=51]="Minus",n[n.Equal=52]="Equal",n[n.BracketLeft=53]="BracketLeft",n[n.BracketRight=54]="BracketRight",n[n.Backslash=55]="Backslash",n[n.IntlHash=56]="IntlHash",n[n.Semicolon=57]="Semicolon",n[n.Quote=58]="Quote",n[n.Backquote=59]="Backquote",n[n.Comma=60]="Comma",n[n.Period=61]="Period",n[n.Slash=62]="Slash",n[n.CapsLock=63]="CapsLock",n[n.F1=64]="F1",n[n.F2=65]="F2",n[n.F3=66]="F3",n[n.F4=67]="F4",n[n.F5=68]="F5",n[n.F6=69]="F6",n[n.F7=70]="F7",n[n.F8=71]="F8",n[n.F9=72]="F9",n[n.F10=73]="F10",n[n.F11=74]="F11",n[n.F12=75]="F12",n[n.PrintScreen=76]="PrintScreen",n[n.ScrollLock=77]="ScrollLock",n[n.Pause=78]="Pause",n[n.Insert=79]="Insert",n[n.Home=80]="Home",n[n.PageUp=81]="PageUp",n[n.Delete=82]="Delete",n[n.End=83]="End",n[n.PageDown=84]="PageDown",n[n.ArrowRight=85]="ArrowRight",n[n.ArrowLeft=86]="ArrowLeft",n[n.ArrowDown=87]="ArrowDown",n[n.ArrowUp=88]="ArrowUp",n[n.NumLock=89]="NumLock",n[n.NumpadDivide=90]="NumpadDivide",n[n.NumpadMultiply=91]="NumpadMultiply",n[n.NumpadSubtract=92]="NumpadSubtract",n[n.NumpadAdd=93]="NumpadAdd",n[n.NumpadEnter=94]="NumpadEnter",n[n.Numpad1=95]="Numpad1",n[n.Numpad2=96]="Numpad2",n[n.Numpad3=97]="Numpad3",n[n.Numpad4=98]="Numpad4",n[n.Numpad5=99]="Numpad5",n[n.Numpad6=100]="Numpad6",n[n.Numpad7=101]="Numpad7",n[n.Numpad8=102]="Numpad8",n[n.Numpad9=103]="Numpad9",n[n.Numpad0=104]="Numpad0",n[n.NumpadDecimal=105]="NumpadDecimal",n[n.IntlBackslash=106]="IntlBackslash",n[n.ContextMenu=107]="ContextMenu",n[n.Power=108]="Power",n[n.NumpadEqual=109]="NumpadEqual",n[n.F13=110]="F13",n[n.F14=111]="F14",n[n.F15=112]="F15",n[n.F16=113]="F16",n[n.F17=114]="F17",n[n.F18=115]="F18",n[n.F19=116]="F19",n[n.F20=117]="F20",n[n.F21=118]="F21",n[n.F22=119]="F22",n[n.F23=120]="F23",n[n.F24=121]="F24",n[n.Open=122]="Open",n[n.Help=123]="Help",n[n.Select=124]="Select",n[n.Again=125]="Again",n[n.Undo=126]="Undo",n[n.Cut=127]="Cut",n[n.Copy=128]="Copy",n[n.Paste=129]="Paste",n[n.Find=130]="Find",n[n.AudioVolumeMute=131]="AudioVolumeMute",n[n.AudioVolumeUp=132]="AudioVolumeUp",n[n.AudioVolumeDown=133]="AudioVolumeDown",n[n.NumpadComma=134]="NumpadComma",n[n.IntlRo=135]="IntlRo",n[n.KanaMode=136]="KanaMode",n[n.IntlYen=137]="IntlYen",n[n.Convert=138]="Convert",n[n.NonConvert=139]="NonConvert",n[n.Lang1=140]="Lang1",n[n.Lang2=141]="Lang2",n[n.Lang3=142]="Lang3",n[n.Lang4=143]="Lang4",n[n.Lang5=144]="Lang5",n[n.Abort=145]="Abort",n[n.Props=146]="Props",n[n.NumpadParenLeft=147]="NumpadParenLeft",n[n.NumpadParenRight=148]="NumpadParenRight",n[n.NumpadBackspace=149]="NumpadBackspace",n[n.NumpadMemoryStore=150]="NumpadMemoryStore",n[n.NumpadMemoryRecall=151]="NumpadMemoryRecall",n[n.NumpadMemoryClear=152]="NumpadMemoryClear",n[n.NumpadMemoryAdd=153]="NumpadMemoryAdd",n[n.NumpadMemorySubtract=154]="NumpadMemorySubtract",n[n.NumpadClear=155]="NumpadClear",n[n.NumpadClearEntry=156]="NumpadClearEntry",n[n.ControlLeft=157]="ControlLeft",n[n.ShiftLeft=158]="ShiftLeft",n[n.AltLeft=159]="AltLeft",n[n.MetaLeft=160]="MetaLeft",n[n.ControlRight=161]="ControlRight",n[n.ShiftRight=162]="ShiftRight",n[n.AltRight=163]="AltRight",n[n.MetaRight=164]="MetaRight",n[n.BrightnessUp=165]="BrightnessUp",n[n.BrightnessDown=166]="BrightnessDown",n[n.MediaPlay=167]="MediaPlay",n[n.MediaRecord=168]="MediaRecord",n[n.MediaFastForward=169]="MediaFastForward",n[n.MediaRewind=170]="MediaRewind",n[n.MediaTrackNext=171]="MediaTrackNext",n[n.MediaTrackPrevious=172]="MediaTrackPrevious",n[n.MediaStop=173]="MediaStop",n[n.Eject=174]="Eject",n[n.MediaPlayPause=175]="MediaPlayPause",n[n.MediaSelect=176]="MediaSelect",n[n.LaunchMail=177]="LaunchMail",n[n.LaunchApp2=178]="LaunchApp2",n[n.LaunchApp1=179]="LaunchApp1",n[n.SelectTask=180]="SelectTask",n[n.LaunchScreenSaver=181]="LaunchScreenSaver",n[n.BrowserSearch=182]="BrowserSearch",n[n.BrowserHome=183]="BrowserHome",n[n.BrowserBack=184]="BrowserBack",n[n.BrowserForward=185]="BrowserForward",n[n.BrowserStop=186]="BrowserStop",n[n.BrowserRefresh=187]="BrowserRefresh",n[n.BrowserFavorites=188]="BrowserFavorites",n[n.ZoomToggle=189]="ZoomToggle",n[n.MailReply=190]="MailReply",n[n.MailForward=191]="MailForward",n[n.MailSend=192]="MailSend",n[n.MAX_VALUE=193]="MAX_VALUE"})(ue||(ue={}));class ZRe{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||E.Unknown}}const UY=new ZRe,S_e=new ZRe,A_e=new ZRe,LQe=new Array(230),Ydt=Object.create(null),Jdt=Object.create(null),eMe=[],E_e=[];for(let n=0;n<=ue.MAX_VALUE;n++)eMe[n]=E.DependsOnKbLayout;for(let n=0;n<=E.MAX_VALUE;n++)E_e[n]=ue.DependsOnKbLayout;(function(){const n="",e=[[1,ue.None,"None",E.Unknown,"unknown",0,"VK_UNKNOWN",n,n],[1,ue.Hyper,"Hyper",E.Unknown,n,0,n,n,n],[1,ue.Super,"Super",E.Unknown,n,0,n,n,n],[1,ue.Fn,"Fn",E.Unknown,n,0,n,n,n],[1,ue.FnLock,"FnLock",E.Unknown,n,0,n,n,n],[1,ue.Suspend,"Suspend",E.Unknown,n,0,n,n,n],[1,ue.Resume,"Resume",E.Unknown,n,0,n,n,n],[1,ue.Turbo,"Turbo",E.Unknown,n,0,n,n,n],[1,ue.Sleep,"Sleep",E.Unknown,n,0,"VK_SLEEP",n,n],[1,ue.WakeUp,"WakeUp",E.Unknown,n,0,n,n,n],[0,ue.KeyA,"KeyA",E.KeyA,"A",65,"VK_A",n,n],[0,ue.KeyB,"KeyB",E.KeyB,"B",66,"VK_B",n,n],[0,ue.KeyC,"KeyC",E.KeyC,"C",67,"VK_C",n,n],[0,ue.KeyD,"KeyD",E.KeyD,"D",68,"VK_D",n,n],[0,ue.KeyE,"KeyE",E.KeyE,"E",69,"VK_E",n,n],[0,ue.KeyF,"KeyF",E.KeyF,"F",70,"VK_F",n,n],[0,ue.KeyG,"KeyG",E.KeyG,"G",71,"VK_G",n,n],[0,ue.KeyH,"KeyH",E.KeyH,"H",72,"VK_H",n,n],[0,ue.KeyI,"KeyI",E.KeyI,"I",73,"VK_I",n,n],[0,ue.KeyJ,"KeyJ",E.KeyJ,"J",74,"VK_J",n,n],[0,ue.KeyK,"KeyK",E.KeyK,"K",75,"VK_K",n,n],[0,ue.KeyL,"KeyL",E.KeyL,"L",76,"VK_L",n,n],[0,ue.KeyM,"KeyM",E.KeyM,"M",77,"VK_M",n,n],[0,ue.KeyN,"KeyN",E.KeyN,"N",78,"VK_N",n,n],[0,ue.KeyO,"KeyO",E.KeyO,"O",79,"VK_O",n,n],[0,ue.KeyP,"KeyP",E.KeyP,"P",80,"VK_P",n,n],[0,ue.KeyQ,"KeyQ",E.KeyQ,"Q",81,"VK_Q",n,n],[0,ue.KeyR,"KeyR",E.KeyR,"R",82,"VK_R",n,n],[0,ue.KeyS,"KeyS",E.KeyS,"S",83,"VK_S",n,n],[0,ue.KeyT,"KeyT",E.KeyT,"T",84,"VK_T",n,n],[0,ue.KeyU,"KeyU",E.KeyU,"U",85,"VK_U",n,n],[0,ue.KeyV,"KeyV",E.KeyV,"V",86,"VK_V",n,n],[0,ue.KeyW,"KeyW",E.KeyW,"W",87,"VK_W",n,n],[0,ue.KeyX,"KeyX",E.KeyX,"X",88,"VK_X",n,n],[0,ue.KeyY,"KeyY",E.KeyY,"Y",89,"VK_Y",n,n],[0,ue.KeyZ,"KeyZ",E.KeyZ,"Z",90,"VK_Z",n,n],[0,ue.Digit1,"Digit1",E.Digit1,"1",49,"VK_1",n,n],[0,ue.Digit2,"Digit2",E.Digit2,"2",50,"VK_2",n,n],[0,ue.Digit3,"Digit3",E.Digit3,"3",51,"VK_3",n,n],[0,ue.Digit4,"Digit4",E.Digit4,"4",52,"VK_4",n,n],[0,ue.Digit5,"Digit5",E.Digit5,"5",53,"VK_5",n,n],[0,ue.Digit6,"Digit6",E.Digit6,"6",54,"VK_6",n,n],[0,ue.Digit7,"Digit7",E.Digit7,"7",55,"VK_7",n,n],[0,ue.Digit8,"Digit8",E.Digit8,"8",56,"VK_8",n,n],[0,ue.Digit9,"Digit9",E.Digit9,"9",57,"VK_9",n,n],[0,ue.Digit0,"Digit0",E.Digit0,"0",48,"VK_0",n,n],[1,ue.Enter,"Enter",E.Enter,"Enter",13,"VK_RETURN",n,n],[1,ue.Escape,"Escape",E.Escape,"Escape",27,"VK_ESCAPE",n,n],[1,ue.Backspace,"Backspace",E.Backspace,"Backspace",8,"VK_BACK",n,n],[1,ue.Tab,"Tab",E.Tab,"Tab",9,"VK_TAB",n,n],[1,ue.Space,"Space",E.Space,"Space",32,"VK_SPACE",n,n],[0,ue.Minus,"Minus",E.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,ue.Equal,"Equal",E.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,ue.BracketLeft,"BracketLeft",E.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,ue.BracketRight,"BracketRight",E.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,ue.Backslash,"Backslash",E.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,ue.IntlHash,"IntlHash",E.Unknown,n,0,n,n,n],[0,ue.Semicolon,"Semicolon",E.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,ue.Quote,"Quote",E.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,ue.Backquote,"Backquote",E.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,ue.Comma,"Comma",E.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,ue.Period,"Period",E.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,ue.Slash,"Slash",E.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,ue.CapsLock,"CapsLock",E.CapsLock,"CapsLock",20,"VK_CAPITAL",n,n],[1,ue.F1,"F1",E.F1,"F1",112,"VK_F1",n,n],[1,ue.F2,"F2",E.F2,"F2",113,"VK_F2",n,n],[1,ue.F3,"F3",E.F3,"F3",114,"VK_F3",n,n],[1,ue.F4,"F4",E.F4,"F4",115,"VK_F4",n,n],[1,ue.F5,"F5",E.F5,"F5",116,"VK_F5",n,n],[1,ue.F6,"F6",E.F6,"F6",117,"VK_F6",n,n],[1,ue.F7,"F7",E.F7,"F7",118,"VK_F7",n,n],[1,ue.F8,"F8",E.F8,"F8",119,"VK_F8",n,n],[1,ue.F9,"F9",E.F9,"F9",120,"VK_F9",n,n],[1,ue.F10,"F10",E.F10,"F10",121,"VK_F10",n,n],[1,ue.F11,"F11",E.F11,"F11",122,"VK_F11",n,n],[1,ue.F12,"F12",E.F12,"F12",123,"VK_F12",n,n],[1,ue.PrintScreen,"PrintScreen",E.Unknown,n,0,n,n,n],[1,ue.ScrollLock,"ScrollLock",E.ScrollLock,"ScrollLock",145,"VK_SCROLL",n,n],[1,ue.Pause,"Pause",E.PauseBreak,"PauseBreak",19,"VK_PAUSE",n,n],[1,ue.Insert,"Insert",E.Insert,"Insert",45,"VK_INSERT",n,n],[1,ue.Home,"Home",E.Home,"Home",36,"VK_HOME",n,n],[1,ue.PageUp,"PageUp",E.PageUp,"PageUp",33,"VK_PRIOR",n,n],[1,ue.Delete,"Delete",E.Delete,"Delete",46,"VK_DELETE",n,n],[1,ue.End,"End",E.End,"End",35,"VK_END",n,n],[1,ue.PageDown,"PageDown",E.PageDown,"PageDown",34,"VK_NEXT",n,n],[1,ue.ArrowRight,"ArrowRight",E.RightArrow,"RightArrow",39,"VK_RIGHT","Right",n],[1,ue.ArrowLeft,"ArrowLeft",E.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",n],[1,ue.ArrowDown,"ArrowDown",E.DownArrow,"DownArrow",40,"VK_DOWN","Down",n],[1,ue.ArrowUp,"ArrowUp",E.UpArrow,"UpArrow",38,"VK_UP","Up",n],[1,ue.NumLock,"NumLock",E.NumLock,"NumLock",144,"VK_NUMLOCK",n,n],[1,ue.NumpadDivide,"NumpadDivide",E.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,ue.NumpadMultiply,"NumpadMultiply",E.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,ue.NumpadSubtract,"NumpadSubtract",E.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,ue.NumpadAdd,"NumpadAdd",E.NumpadAdd,"NumPad_Add",107,"VK_ADD",n,n],[1,ue.NumpadEnter,"NumpadEnter",E.Enter,n,0,n,n,n],[1,ue.Numpad1,"Numpad1",E.Numpad1,"NumPad1",97,"VK_NUMPAD1",n,n],[1,ue.Numpad2,"Numpad2",E.Numpad2,"NumPad2",98,"VK_NUMPAD2",n,n],[1,ue.Numpad3,"Numpad3",E.Numpad3,"NumPad3",99,"VK_NUMPAD3",n,n],[1,ue.Numpad4,"Numpad4",E.Numpad4,"NumPad4",100,"VK_NUMPAD4",n,n],[1,ue.Numpad5,"Numpad5",E.Numpad5,"NumPad5",101,"VK_NUMPAD5",n,n],[1,ue.Numpad6,"Numpad6",E.Numpad6,"NumPad6",102,"VK_NUMPAD6",n,n],[1,ue.Numpad7,"Numpad7",E.Numpad7,"NumPad7",103,"VK_NUMPAD7",n,n],[1,ue.Numpad8,"Numpad8",E.Numpad8,"NumPad8",104,"VK_NUMPAD8",n,n],[1,ue.Numpad9,"Numpad9",E.Numpad9,"NumPad9",105,"VK_NUMPAD9",n,n],[1,ue.Numpad0,"Numpad0",E.Numpad0,"NumPad0",96,"VK_NUMPAD0",n,n],[1,ue.NumpadDecimal,"NumpadDecimal",E.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,ue.IntlBackslash,"IntlBackslash",E.IntlBackslash,"OEM_102",226,"VK_OEM_102",n,n],[1,ue.ContextMenu,"ContextMenu",E.ContextMenu,"ContextMenu",93,n,n,n],[1,ue.Power,"Power",E.Unknown,n,0,n,n,n],[1,ue.NumpadEqual,"NumpadEqual",E.Unknown,n,0,n,n,n],[1,ue.F13,"F13",E.F13,"F13",124,"VK_F13",n,n],[1,ue.F14,"F14",E.F14,"F14",125,"VK_F14",n,n],[1,ue.F15,"F15",E.F15,"F15",126,"VK_F15",n,n],[1,ue.F16,"F16",E.F16,"F16",127,"VK_F16",n,n],[1,ue.F17,"F17",E.F17,"F17",128,"VK_F17",n,n],[1,ue.F18,"F18",E.F18,"F18",129,"VK_F18",n,n],[1,ue.F19,"F19",E.F19,"F19",130,"VK_F19",n,n],[1,ue.F20,"F20",E.F20,"F20",131,"VK_F20",n,n],[1,ue.F21,"F21",E.F21,"F21",132,"VK_F21",n,n],[1,ue.F22,"F22",E.F22,"F22",133,"VK_F22",n,n],[1,ue.F23,"F23",E.F23,"F23",134,"VK_F23",n,n],[1,ue.F24,"F24",E.F24,"F24",135,"VK_F24",n,n],[1,ue.Open,"Open",E.Unknown,n,0,n,n,n],[1,ue.Help,"Help",E.Unknown,n,0,n,n,n],[1,ue.Select,"Select",E.Unknown,n,0,n,n,n],[1,ue.Again,"Again",E.Unknown,n,0,n,n,n],[1,ue.Undo,"Undo",E.Unknown,n,0,n,n,n],[1,ue.Cut,"Cut",E.Unknown,n,0,n,n,n],[1,ue.Copy,"Copy",E.Unknown,n,0,n,n,n],[1,ue.Paste,"Paste",E.Unknown,n,0,n,n,n],[1,ue.Find,"Find",E.Unknown,n,0,n,n,n],[1,ue.AudioVolumeMute,"AudioVolumeMute",E.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,ue.AudioVolumeUp,"AudioVolumeUp",E.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,ue.AudioVolumeDown,"AudioVolumeDown",E.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,ue.NumpadComma,"NumpadComma",E.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,ue.IntlRo,"IntlRo",E.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,ue.KanaMode,"KanaMode",E.Unknown,n,0,n,n,n],[0,ue.IntlYen,"IntlYen",E.Unknown,n,0,n,n,n],[1,ue.Convert,"Convert",E.Unknown,n,0,n,n,n],[1,ue.NonConvert,"NonConvert",E.Unknown,n,0,n,n,n],[1,ue.Lang1,"Lang1",E.Unknown,n,0,n,n,n],[1,ue.Lang2,"Lang2",E.Unknown,n,0,n,n,n],[1,ue.Lang3,"Lang3",E.Unknown,n,0,n,n,n],[1,ue.Lang4,"Lang4",E.Unknown,n,0,n,n,n],[1,ue.Lang5,"Lang5",E.Unknown,n,0,n,n,n],[1,ue.Abort,"Abort",E.Unknown,n,0,n,n,n],[1,ue.Props,"Props",E.Unknown,n,0,n,n,n],[1,ue.NumpadParenLeft,"NumpadParenLeft",E.Unknown,n,0,n,n,n],[1,ue.NumpadParenRight,"NumpadParenRight",E.Unknown,n,0,n,n,n],[1,ue.NumpadBackspace,"NumpadBackspace",E.Unknown,n,0,n,n,n],[1,ue.NumpadMemoryStore,"NumpadMemoryStore",E.Unknown,n,0,n,n,n],[1,ue.NumpadMemoryRecall,"NumpadMemoryRecall",E.Unknown,n,0,n,n,n],[1,ue.NumpadMemoryClear,"NumpadMemoryClear",E.Unknown,n,0,n,n,n],[1,ue.NumpadMemoryAdd,"NumpadMemoryAdd",E.Unknown,n,0,n,n,n],[1,ue.NumpadMemorySubtract,"NumpadMemorySubtract",E.Unknown,n,0,n,n,n],[1,ue.NumpadClear,"NumpadClear",E.Clear,"Clear",12,"VK_CLEAR",n,n],[1,ue.NumpadClearEntry,"NumpadClearEntry",E.Unknown,n,0,n,n,n],[1,ue.None,n,E.Ctrl,"Ctrl",17,"VK_CONTROL",n,n],[1,ue.None,n,E.Shift,"Shift",16,"VK_SHIFT",n,n],[1,ue.None,n,E.Alt,"Alt",18,"VK_MENU",n,n],[1,ue.None,n,E.Meta,"Meta",91,"VK_COMMAND",n,n],[1,ue.ControlLeft,"ControlLeft",E.Ctrl,n,0,"VK_LCONTROL",n,n],[1,ue.ShiftLeft,"ShiftLeft",E.Shift,n,0,"VK_LSHIFT",n,n],[1,ue.AltLeft,"AltLeft",E.Alt,n,0,"VK_LMENU",n,n],[1,ue.MetaLeft,"MetaLeft",E.Meta,n,0,"VK_LWIN",n,n],[1,ue.ControlRight,"ControlRight",E.Ctrl,n,0,"VK_RCONTROL",n,n],[1,ue.ShiftRight,"ShiftRight",E.Shift,n,0,"VK_RSHIFT",n,n],[1,ue.AltRight,"AltRight",E.Alt,n,0,"VK_RMENU",n,n],[1,ue.MetaRight,"MetaRight",E.Meta,n,0,"VK_RWIN",n,n],[1,ue.BrightnessUp,"BrightnessUp",E.Unknown,n,0,n,n,n],[1,ue.BrightnessDown,"BrightnessDown",E.Unknown,n,0,n,n,n],[1,ue.MediaPlay,"MediaPlay",E.Unknown,n,0,n,n,n],[1,ue.MediaRecord,"MediaRecord",E.Unknown,n,0,n,n,n],[1,ue.MediaFastForward,"MediaFastForward",E.Unknown,n,0,n,n,n],[1,ue.MediaRewind,"MediaRewind",E.Unknown,n,0,n,n,n],[1,ue.MediaTrackNext,"MediaTrackNext",E.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,ue.MediaTrackPrevious,"MediaTrackPrevious",E.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,ue.MediaStop,"MediaStop",E.MediaStop,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,ue.Eject,"Eject",E.Unknown,n,0,n,n,n],[1,ue.MediaPlayPause,"MediaPlayPause",E.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,ue.MediaSelect,"MediaSelect",E.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,ue.LaunchMail,"LaunchMail",E.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,ue.LaunchApp2,"LaunchApp2",E.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,ue.LaunchApp1,"LaunchApp1",E.Unknown,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,ue.SelectTask,"SelectTask",E.Unknown,n,0,n,n,n],[1,ue.LaunchScreenSaver,"LaunchScreenSaver",E.Unknown,n,0,n,n,n],[1,ue.BrowserSearch,"BrowserSearch",E.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,ue.BrowserHome,"BrowserHome",E.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,ue.BrowserBack,"BrowserBack",E.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,ue.BrowserForward,"BrowserForward",E.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,ue.BrowserStop,"BrowserStop",E.Unknown,n,0,"VK_BROWSER_STOP",n,n],[1,ue.BrowserRefresh,"BrowserRefresh",E.Unknown,n,0,"VK_BROWSER_REFRESH",n,n],[1,ue.BrowserFavorites,"BrowserFavorites",E.Unknown,n,0,"VK_BROWSER_FAVORITES",n,n],[1,ue.ZoomToggle,"ZoomToggle",E.Unknown,n,0,n,n,n],[1,ue.MailReply,"MailReply",E.Unknown,n,0,n,n,n],[1,ue.MailForward,"MailForward",E.Unknown,n,0,n,n,n],[1,ue.MailSend,"MailSend",E.Unknown,n,0,n,n,n],[1,ue.None,n,E.KEY_IN_COMPOSITION,"KeyInComposition",229,n,n,n],[1,ue.None,n,E.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,ue.None,n,E.OEM_8,"OEM_8",223,"VK_OEM_8",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_KANA",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_HANGUL",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_JUNJA",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_FINAL",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_HANJA",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_KANJI",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_CONVERT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_NONCONVERT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_ACCEPT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_MODECHANGE",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_SELECT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_PRINT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_EXECUTE",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_SNAPSHOT",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_HELP",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_APPS",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_PROCESSKEY",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_PACKET",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_DBE_SBCSCHAR",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_DBE_DBCSCHAR",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_ATTN",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_CRSEL",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_EXSEL",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_EREOF",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_PLAY",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_ZOOM",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_NONAME",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_PA1",n,n],[1,ue.None,n,E.Unknown,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[o,r,a,c,l,d,h,u,f]=s;if(i[r]||(i[r]=!0,Ydt[a]=r,Jdt[a.toLowerCase()]=r,o&&(eMe[r]=c,c!==E.Unknown&&c!==E.Enter&&c!==E.Ctrl&&c!==E.Shift&&c!==E.Alt&&c!==E.Meta&&(E_e[c]=r))),!t[c]){if(t[c]=!0,!l)throw new Error(`String representation missing for key code ${c} around scan code ${a}`);UY.define(c,l),S_e.define(c,u||l),A_e.define(c,f||u||l)}d&&(LQe[d]=c)}E_e[E.Enter]=ue.Enter})();var iE;(function(n){function e(a){return UY.keyCodeToStr(a)}n.toString=e;function t(a){return UY.strToKeyCode(a)}n.fromString=t;function i(a){return S_e.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return A_e.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return S_e.strToKeyCode(a)||A_e.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=E.Numpad0&&a<=E.NumpadDivide)return null;switch(a){case E.UpArrow:return"Up";case E.DownArrow:return"Down";case E.LeftArrow:return"Left";case E.RightArrow:return"Right"}return UY.keyCodeToStr(a)}n.toElectronAccelerator=r})(iE||(iE={}));var V;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl"})(V||(V={}));function Br(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var Fs;(function(n){n[n.Uri=1]="Uri",n[n.Regexp=2]="Regexp",n[n.ScmResource=3]="ScmResource",n[n.ScmResourceGroup=4]="ScmResourceGroup",n[n.ScmProvider=5]="ScmProvider",n[n.CommentController=6]="CommentController",n[n.CommentThread=7]="CommentThread",n[n.CommentThreadInstance=8]="CommentThreadInstance",n[n.CommentThreadReply=9]="CommentThreadReply",n[n.CommentNode=10]="CommentNode",n[n.CommentThreadNode=11]="CommentThreadNode",n[n.TimelineActionContext=12]="TimelineActionContext",n[n.NotebookCellActionContext=13]="NotebookCellActionContext",n[n.NotebookActionContext=14]="NotebookActionContext",n[n.TerminalContext=15]="TerminalContext",n[n.TestItemContext=16]="TestItemContext",n[n.Date=17]="Date",n[n.TestMessageMenuArgs=18]="TestMessageMenuArgs"})(Fs||(Fs={}));var XBe={};let cM;const xge=globalThis.vscode;if(typeof xge<"u"&&typeof xge.process<"u"){const n=xge.process;cM={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?cM={get platform(){return process.platform},get arch(){return process.arch},get env(){return XBe},cwd(){return XBe.VSCODE_CWD||process.cwd()}}:cM={get platform(){return Is?"win32":ei?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const kU=cM.cwd,IU=cM.env,Xdt=cM.platform,Zdt=cM.arch,eht=65,tht=97,iht=90,nht=122,xI=46,ou=47,Dp=92,gD=58,sht=63;class TQe extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function oht(n,e){if(n===null||typeof n!="object")throw new TQe(e,"Object",n)}function Gl(n,e){if(typeof n!="string")throw new TQe(e,"string",n)}const Dw=Xdt==="win32";function js(n){return n===ou||n===Dp}function x_e(n){return n===ou}function fD(n){return n>=eht&&n<=iht||n>=tht&&n<=nht}function cZ(n,e,t,i){let s="",o=0,r=-1,a=0,c=0;for(let l=0;l<=n.length;++l){if(l2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=l,a=0;continue}else if(s.length!==0){s="",o=0,r=l,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,l)}`:s=n.slice(r+1,l),o=l-r-1;r=l,a=0}else c===xI&&a!==-1?++a:a=-1}return s}function RQe(n,e){oht(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Gc={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],Gl(o,"path"),o.length===0)continue}else e.length===0?o=kU():(o=IU[`=${e}`]||kU(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Dp)&&(o=`${e}\\`));const r=o.length;let a=0,c="",l=!1;const d=o.charCodeAt(0);if(r===1)js(d)&&(a=1,l=!0);else if(js(d))if(l=!0,js(o.charCodeAt(1))){let h=2,u=h;for(;h2&&js(o.charCodeAt(2))&&(l=!0,a=3));if(c.length>0)if(e.length>0){if(c.toLowerCase()!==e.toLowerCase())continue}else e=c;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=l,l&&e.length>0)break}return t=cZ(t,!i,"\\",js),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Gl(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return x_e(o)?"\\":n;if(js(o))if(s=!0,js(n.charCodeAt(1))){let a=2,c=a;for(;a2&&js(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&js(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){Gl(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return js(t)||e>2&&fD(t)&&n.charCodeAt(1)===gD&&js(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&js(t.charCodeAt(0))){++s;const o=t.length;o>1&&js(t.charCodeAt(1))&&(++s,o>2&&(js(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return Gc.normalize(e)},relative(n,e){if(Gl(n,"from"),Gl(e,"to"),n===e)return"";const t=Gc.resolve(n),i=Gc.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===Dp;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(c-1)===Dp;)c--;const l=c-a,d=rd){if(e.charCodeAt(a+u)===Dp)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>d&&(n.charCodeAt(s+u)===Dp?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=s+h+1;u<=o;++u)(u===o||n.charCodeAt(u)===Dp)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${i.slice(a,c)}`:(i.charCodeAt(a)===Dp&&++a,i.slice(a,c))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Gc.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===Dp){if(e.charCodeAt(1)===Dp){const t=e.charCodeAt(2);if(t!==sht&&t!==xI)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fD(e.charCodeAt(0))&&e.charCodeAt(1)===gD&&e.charCodeAt(2)===Dp)return`\\\\?\\${e}`;return n},dirname(n){Gl(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return js(s)?n:".";if(js(s)){if(t=i=1,js(n.charCodeAt(1))){let a=2,c=a;for(;a2&&js(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(js(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&Gl(e,"ext"),Gl(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&fD(n.charCodeAt(0))&&n.charCodeAt(1)===gD&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const c=n.charCodeAt(o);if(js(c)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(js(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Gl(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===gD&&fD(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const c=n.charCodeAt(a);if(js(c)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),c===xI?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:RQe.bind(null,"\\"),parse(n){Gl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return js(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(js(s)){if(i=1,js(n.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,c=!0,l=n.length-1,d=0;for(;l>=i;--l){if(s=n.charCodeAt(l),js(s)){if(!c){r=l+1;break}continue}a===-1&&(c=!1,a=l+1),s===xI?o===-1?o=l:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},rht=(()=>{if(Dw){const n=/\\/g;return()=>{const e=kU().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>kU()})(),Qi={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:rht();Gl(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===ou)}return e=cZ(e,!t,"/",x_e),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Gl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ou,t=n.charCodeAt(n.length-1)===ou;return n=cZ(n,!e,"/",x_e),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Gl(n,"path"),n.length>0&&n.charCodeAt(0)===ou},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Qi.normalize(e)},relative(n,e){if(Gl(n,"from"),Gl(e,"to"),n===e||(n=Qi.resolve(n),e=Qi.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=sa){if(e.charCodeAt(o+l)===ou)return e.slice(o+l+1);if(l===0)return e.slice(o+l)}else s>a&&(n.charCodeAt(t+l)===ou?c=l:l===0&&(c=0));let d="";for(l=t+c+1;l<=i;++l)(l===i||n.charCodeAt(l)===ou)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+c)}`},toNamespacedPath(n){return n},dirname(n){if(Gl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ou;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===ou){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&Gl(e,"ext"),Gl(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const c=n.charCodeAt(o);if(c===ou){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===ou){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Gl(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===ou){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===xI?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:RQe.bind(null,"/"),parse(n){Gl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===ou;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,c=n.length-1,l=0;for(;c>=i;--c){const d=n.charCodeAt(c);if(d===ou){if(!a){o=c+1;break}continue}r===-1&&(a=!1,r=c+1),d===xI?s===-1?s=c:l!==1&&(l=1):s!==-1&&(l=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||l===0||l===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Qi.win32=Gc.win32=Gc;Qi.posix=Gc.posix=Qi;const d1=Dw?Gc.normalize:Qi.normalize,oF=Dw?Gc.isAbsolute:Qi.isAbsolute,D_e=Dw?Gc.join:Qi.join,aht=Dw?Gc.resolve:Qi.resolve,LU=Dw?Gc.relative:Qi.relative,lS=Dw?Gc.dirname:Qi.dirname,yr=Dw?Gc.basename:Qi.basename,T_=Dw?Gc.extname:Qi.extname,cht=Dw?Gc.parse:Qi.parse,dg=Dw?Gc.sep:Qi.sep;Dw?Gc.delimiter:Qi.delimiter;const lht=/^\w[\w\d+.-]*$/,dht=/^\//,hht=/^\/\//;function uht(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!lht.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!dht.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(hht.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function ght(n,e){return!n&&!e?"file":n}function fht(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==_b&&(e=_b+e):e=_b;break}return e}const tc="",_b="/",pht=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;let P=class VY{static isUri(e){return e instanceof VY?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||tc,this.authority=e.authority||tc,this.path=e.path||tc,this.query=e.query||tc,this.fragment=e.fragment||tc):(this.scheme=ght(e,r),this.authority=t||tc,this.path=fht(this.scheme,i||tc),this.query=s||tc,this.fragment=o||tc,uht(this,r))}get fsPath(){return dZ(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=tc),i===void 0?i=this.authority:i===null&&(i=tc),s===void 0?s=this.path:s===null&&(s=tc),o===void 0?o=this.query:o===null&&(o=tc),r===void 0?r=this.fragment:r===null&&(r=tc),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new FO(t,i,s,o,r)}static parse(e,t=!1){const i=pht.exec(e);return i?new FO(i[2]||tc,pj(i[4]||tc),pj(i[5]||tc),pj(i[7]||tc),pj(i[9]||tc),t):new FO(tc,tc,tc,tc,tc)}static file(e){let t=tc;if(Is&&(e=e.replace(/\\/g,_b)),e[0]===_b&&e[1]===_b){const i=e.indexOf(_b,2);i===-1?(t=e.substring(2),e=_b):(t=e.substring(2,i),e=e.substring(i)||_b)}return new FO("file",t,e,tc,tc)}static from(e,t){return new FO(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Is&&e.scheme==="file"?i=VY.file(Gc.join(dZ(e,!0),...t)).path:i=Qi.join(e.path,...t),e.with({path:i})}toString(e=!1){return k_e(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof VY)return e;{const t=new FO(e);return t._formatted=e.external??null,t._fsPath=e._sep===MQe?e.fsPath??null:null,t}}else return e}};function lZ(n){return!n||typeof n!="object"?!1:typeof n.scheme=="string"&&(typeof n.authority=="string"||typeof n.authority>"u")&&(typeof n.path=="string"||typeof n.path>"u")&&(typeof n.query=="string"||typeof n.query>"u")&&(typeof n.fragment=="string"||typeof n.fragment>"u")}const MQe=Is?1:void 0;let FO=class extends P{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=dZ(this,!1)),this._fsPath}toString(e=!1){return e?k_e(this,!0):(this._formatted||(this._formatted=k_e(this,!1)),this._formatted)}toJSON(){const e={$mid:Fs.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=MQe),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}};const NQe={[Q.Colon]:"%3A",[Q.Slash]:"%2F",[Q.QuestionMark]:"%3F",[Q.Hash]:"%23",[Q.OpenSquareBracket]:"%5B",[Q.CloseSquareBracket]:"%5D",[Q.AtSign]:"%40",[Q.ExclamationMark]:"%21",[Q.DollarSign]:"%24",[Q.Ampersand]:"%26",[Q.SingleQuote]:"%27",[Q.OpenParen]:"%28",[Q.CloseParen]:"%29",[Q.Asterisk]:"%2A",[Q.Plus]:"%2B",[Q.Comma]:"%2C",[Q.Semicolon]:"%3B",[Q.Equals]:"%3D",[Q.Space]:"%20"};function ZBe(n,e,t){let i,s=-1;for(let o=0;o=Q.a&&r<=Q.z||r>=Q.A&&r<=Q.Z||r>=Q.Digit0&&r<=Q.Digit9||r===Q.Dash||r===Q.Period||r===Q.Underline||r===Q.Tilde||e&&r===Q.Slash||t&&r===Q.OpenSquareBracket||t&&r===Q.CloseSquareBracket||t&&r===Q.Colon)s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=NQe[r];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i+=a):s===-1&&(s=o)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function mht(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===Q.Slash&&(n.path.charCodeAt(1)>=Q.A&&n.path.charCodeAt(1)<=Q.Z||n.path.charCodeAt(1)>=Q.a&&n.path.charCodeAt(1)<=Q.z)&&n.path.charCodeAt(2)===Q.Colon?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Is&&(t=t.replace(/\//g,"\\")),t}function k_e(n,e){const t=e?mht:ZBe;let i="",{scheme:s,authority:o,path:r,query:a,fragment:c}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=_b,i+=_b),o){let l=o.indexOf("@");if(l!==-1){const d=o.substr(0,l);o=o.substr(l+1),l=d.lastIndexOf(":"),l===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,l),!1,!1),i+=":",i+=t(d.substr(l+1),!1,!0)),i+="@"}o=o.toLowerCase(),l=o.lastIndexOf(":"),l===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,l),!1,!0),i+=o.substr(l))}if(r){if(r.length>=3&&r.charCodeAt(0)===Q.Slash&&r.charCodeAt(2)===Q.Colon){const l=r.charCodeAt(1);l>=Q.A&&l<=Q.Z&&(r=`/${String.fromCharCode(l+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===Q.Colon){const l=r.charCodeAt(0);l>=Q.A&&l<=Q.Z&&(r=`${String.fromCharCode(l+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),c&&(i+="#",i+=e?c:ZBe(c,!1,!1)),i}function PQe(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+PQe(n.substr(3)):n}}const e2e=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pj(n){return n.match(e2e)?n.replace(e2e,e=>PQe(e)):n}let oe=class zL{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new zL(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return zL.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return zL.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return dd.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return dd.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return dd.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return dd.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return dd.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new dd(i,s,o,r)}intersectRanges(e){return dd.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,c=t.startColumn,l=t.endLineNumber,d=t.endColumn;return il?(o=l,r=d):o===l&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new dd(i,s,o,r)}equalsRange(e){return dd.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return dd.getEndPosition(this)}static getEndPosition(e){return new oe(e.endLineNumber,e.endColumn)}getStartPosition(){return dd.getStartPosition(this)}static getStartPosition(e){return new oe(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new dd(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new dd(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return dd.collapseToStart(this)}static collapseToStart(e){return new dd(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return dd.collapseToEnd(this)}static collapseToEnd(e){return new dd(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new dd(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new dd(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new dd(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Cv;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(Cv||(Cv={}));let mt=class K_ extends O{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return K_.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?Cv.LTR:Cv.RTL}setEndPosition(e,t){return this.getDirection()===Cv.LTR?new K_(this.startLineNumber,this.startColumn,e,t):new K_(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new oe(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new oe(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===Cv.LTR?new K_(e,t,this.endLineNumber,this.endColumn):new K_(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new K_(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===Cv.LTR?new K_(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new K_(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new K_(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i>>$i.LANGUAGEID_OFFSET}static getTokenType(e){return(e&$i.TOKEN_TYPE_MASK)>>>$i.TOKEN_TYPE_OFFSET}static containsBalancedBrackets(e){return(e&$i.BALANCED_BRACKETS_MASK)!==0}static getFontStyle(e){return(e&$i.FONT_STYLE_MASK)>>>$i.FONT_STYLE_OFFSET}static getForeground(e){return(e&$i.FOREGROUND_MASK)>>>$i.FOREGROUND_OFFSET}static getBackground(e){return(e&$i.BACKGROUND_MASK)>>>$i.BACKGROUND_OFFSET}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&ar.Italic&&(i+=" mtki"),s&ar.Bold&&(i+=" mtkb"),s&ar.Underline&&(i+=" mtku"),s&ar.Strikethrough&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;s&ar.Italic&&(o+="font-style: italic;"),s&ar.Bold&&(o+="font-weight: bold;");let r="";return s&ar.Underline&&(r+=" underline"),s&ar.Strikethrough&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&ar.Italic),bold:!!(i&ar.Bold),underline:!!(i&ar.Underline),strikethrough:!!(i&ar.Strikethrough)}}}let wht=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Ee(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new bht(this,e,t);return this._factories.set(e,i),Ee(()=>{const s=this._factories.get(e);!s||s!==i||(this._factories.delete(e),s.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Ad.DefaultBackground?this._colorMap[Ad.DefaultBackground]:null}};class bht extends ${get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}const nc="vs/editor/common/languages";let A9=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class tMe{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class $le{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Yl;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(Yl||(Yl={}));var Ne;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(Ne||(Ne={}));var E9;(function(n){const e=new Map;e.set(Ne.Method,Ce.symbolMethod),e.set(Ne.Function,Ce.symbolFunction),e.set(Ne.Constructor,Ce.symbolConstructor),e.set(Ne.Field,Ce.symbolField),e.set(Ne.Variable,Ce.symbolVariable),e.set(Ne.Class,Ce.symbolClass),e.set(Ne.Struct,Ce.symbolStruct),e.set(Ne.Interface,Ce.symbolInterface),e.set(Ne.Module,Ce.symbolModule),e.set(Ne.Property,Ce.symbolProperty),e.set(Ne.Event,Ce.symbolEvent),e.set(Ne.Operator,Ce.symbolOperator),e.set(Ne.Unit,Ce.symbolUnit),e.set(Ne.Value,Ce.symbolValue),e.set(Ne.Enum,Ce.symbolEnum),e.set(Ne.Constant,Ce.symbolConstant),e.set(Ne.Enum,Ce.symbolEnum),e.set(Ne.EnumMember,Ce.symbolEnumMember),e.set(Ne.Keyword,Ce.symbolKeyword),e.set(Ne.Snippet,Ce.symbolSnippet),e.set(Ne.Text,Ce.symbolText),e.set(Ne.Color,Ce.symbolColor),e.set(Ne.File,Ce.symbolFile),e.set(Ne.Reference,Ce.symbolReference),e.set(Ne.Customcolor,Ce.symbolCustomColor),e.set(Ne.Folder,Ce.symbolFolder),e.set(Ne.TypeParameter,Ce.symbolTypeParameter),e.set(Ne.User,Ce.account),e.set(Ne.Issue,Ce.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=Ce.symbolProperty),r}n.toIcon=t;const i=new Map;i.set("method",Ne.Method),i.set("function",Ne.Function),i.set("constructor",Ne.Constructor),i.set("field",Ne.Field),i.set("variable",Ne.Variable),i.set("class",Ne.Class),i.set("struct",Ne.Struct),i.set("interface",Ne.Interface),i.set("module",Ne.Module),i.set("property",Ne.Property),i.set("event",Ne.Event),i.set("operator",Ne.Operator),i.set("unit",Ne.Unit),i.set("value",Ne.Value),i.set("constant",Ne.Constant),i.set("enum",Ne.Enum),i.set("enum-member",Ne.EnumMember),i.set("enumMember",Ne.EnumMember),i.set("keyword",Ne.Keyword),i.set("snippet",Ne.Snippet),i.set("text",Ne.Text),i.set("color",Ne.Color),i.set("file",Ne.File),i.set("reference",Ne.Reference),i.set("customcolor",Ne.Customcolor),i.set("folder",Ne.Folder),i.set("type-parameter",Ne.TypeParameter),i.set("typeParameter",Ne.TypeParameter),i.set("account",Ne.User),i.set("issue",Ne.Issue);function s(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=Ne.Property),a}n.fromString=s})(E9||(E9={}));var TU;(function(n){n[n.Deprecated=1]="Deprecated"})(TU||(TU={}));var cp;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(cp||(cp={}));var DI;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(DI||(DI={}));var tf;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(tf||(tf={}));var Ub;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ub||(Ub={}));class OQe{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return O.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var wu;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(wu||(wu={}));var x9;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(x9||(x9={}));var dS;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(dS||(dS={}));var D9;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(D9||(D9={}));function BQe(n){return n&&P.isUri(n.uri)&&O.isIRange(n.range)&&(O.isIRange(n.originSelectionRange)||O.isIRange(n.targetSelectionRange))}var _t;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(_t||(_t={}));const Cht={[_t.Array]:g(nc,0,"array"),[_t.Boolean]:g(nc,1,"boolean"),[_t.Class]:g(nc,2,"class"),[_t.Constant]:g(nc,3,"constant"),[_t.Constructor]:g(nc,4,"constructor"),[_t.Enum]:g(nc,5,"enumeration"),[_t.EnumMember]:g(nc,6,"enumeration member"),[_t.Event]:g(nc,7,"event"),[_t.Field]:g(nc,8,"field"),[_t.File]:g(nc,9,"file"),[_t.Function]:g(nc,10,"function"),[_t.Interface]:g(nc,11,"interface"),[_t.Key]:g(nc,12,"key"),[_t.Method]:g(nc,13,"method"),[_t.Module]:g(nc,14,"module"),[_t.Namespace]:g(nc,15,"namespace"),[_t.Null]:g(nc,16,"null"),[_t.Number]:g(nc,17,"number"),[_t.Object]:g(nc,18,"object"),[_t.Operator]:g(nc,19,"operator"),[_t.Package]:g(nc,20,"package"),[_t.Property]:g(nc,21,"property"),[_t.String]:g(nc,22,"string"),[_t.Struct]:g(nc,23,"struct"),[_t.TypeParameter]:g(nc,24,"type parameter"),[_t.Variable]:g(nc,25,"variable")};function yht(n,e){return g(nc,26,"{0} ({1})",n,Cht[e])}var k9;(function(n){n[n.Deprecated=1]="Deprecated"})(k9||(k9={}));var hZ;(function(n){const e=new Map;e.set(_t.File,Ce.symbolFile),e.set(_t.Module,Ce.symbolModule),e.set(_t.Namespace,Ce.symbolNamespace),e.set(_t.Package,Ce.symbolPackage),e.set(_t.Class,Ce.symbolClass),e.set(_t.Method,Ce.symbolMethod),e.set(_t.Property,Ce.symbolProperty),e.set(_t.Field,Ce.symbolField),e.set(_t.Constructor,Ce.symbolConstructor),e.set(_t.Enum,Ce.symbolEnum),e.set(_t.Interface,Ce.symbolInterface),e.set(_t.Function,Ce.symbolFunction),e.set(_t.Variable,Ce.symbolVariable),e.set(_t.Constant,Ce.symbolConstant),e.set(_t.String,Ce.symbolString),e.set(_t.Number,Ce.symbolNumber),e.set(_t.Boolean,Ce.symbolBoolean),e.set(_t.Array,Ce.symbolArray),e.set(_t.Object,Ce.symbolObject),e.set(_t.Key,Ce.symbolKey),e.set(_t.Null,Ce.symbolNull),e.set(_t.EnumMember,Ce.symbolEnumMember),e.set(_t.Struct,Ce.symbolStruct),e.set(_t.Event,Ce.symbolEvent),e.set(_t.Operator,Ce.symbolOperator),e.set(_t.TypeParameter,Ce.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=Ce.symbolProperty),s}n.toIcon=t})(hZ||(hZ={}));let iMe=class{static asEditOperation(e){return ds.replace(O.lift(e.range),e.text)}};var $f;let yv=($f=class{static fromValue(e){switch(e){case"comment":return $f.Comment;case"imports":return $f.Imports;case"region":return $f.Region}return new $f(e)}constructor(e){this.value=e}},$f.Comment=new $f("comment"),$f.Imports=new $f("imports"),$f.Region=new $f("region"),$f);var L_e;(function(n){n[n.AIGenerated=1]="AIGenerated"})(L_e||(L_e={}));var rF;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(rF||(rF={}));var uZ;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(uZ||(uZ={}));var zl;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(zl||(zl={}));var hg;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(hg||(hg={}));var kI;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(kI||(kI={}));var RU;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(RU||(RU={}));var gZ;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(gZ||(gZ={}));class Sht{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const dc=new wht;var t2e;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(t2e||(t2e={}));var MU;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(MU||(MU={}));var T_e;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(T_e||(T_e={}));var R_e;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(R_e||(R_e={}));var M_e;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(M_e||(M_e={}));var N_e;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(N_e||(N_e={}));var P_e;(function(n){n[n.Deprecated=1]="Deprecated"})(P_e||(P_e={}));var F_e;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(F_e||(F_e={}));var O_e;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(O_e||(O_e={}));var B_e;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(B_e||(B_e={}));var W_e;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(W_e||(W_e={}));var H_e;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(H_e||(H_e={}));var U_e;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(U_e||(U_e={}));var V_e;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.inlineEdit=63]="inlineEdit",n[n.letterSpacing=64]="letterSpacing",n[n.lightbulb=65]="lightbulb",n[n.lineDecorationsWidth=66]="lineDecorationsWidth",n[n.lineHeight=67]="lineHeight",n[n.lineNumbers=68]="lineNumbers",n[n.lineNumbersMinChars=69]="lineNumbersMinChars",n[n.linkedEditing=70]="linkedEditing",n[n.links=71]="links",n[n.matchBrackets=72]="matchBrackets",n[n.minimap=73]="minimap",n[n.mouseStyle=74]="mouseStyle",n[n.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=76]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",n[n.multiCursorModifier=78]="multiCursorModifier",n[n.multiCursorPaste=79]="multiCursorPaste",n[n.multiCursorLimit=80]="multiCursorLimit",n[n.occurrencesHighlight=81]="occurrencesHighlight",n[n.overviewRulerBorder=82]="overviewRulerBorder",n[n.overviewRulerLanes=83]="overviewRulerLanes",n[n.padding=84]="padding",n[n.pasteAs=85]="pasteAs",n[n.parameterHints=86]="parameterHints",n[n.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",n[n.quickSuggestions=89]="quickSuggestions",n[n.quickSuggestionsDelay=90]="quickSuggestionsDelay",n[n.readOnly=91]="readOnly",n[n.readOnlyMessage=92]="readOnlyMessage",n[n.renameOnType=93]="renameOnType",n[n.renderControlCharacters=94]="renderControlCharacters",n[n.renderFinalNewline=95]="renderFinalNewline",n[n.renderLineHighlight=96]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=98]="renderValidationDecorations",n[n.renderWhitespace=99]="renderWhitespace",n[n.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",n[n.roundedSelection=101]="roundedSelection",n[n.rulers=102]="rulers",n[n.scrollbar=103]="scrollbar",n[n.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=105]="scrollBeyondLastLine",n[n.scrollPredominantAxis=106]="scrollPredominantAxis",n[n.selectionClipboard=107]="selectionClipboard",n[n.selectionHighlight=108]="selectionHighlight",n[n.selectOnLineNumbers=109]="selectOnLineNumbers",n[n.showFoldingControls=110]="showFoldingControls",n[n.showUnused=111]="showUnused",n[n.snippetSuggestions=112]="snippetSuggestions",n[n.smartSelect=113]="smartSelect",n[n.smoothScrolling=114]="smoothScrolling",n[n.stickyScroll=115]="stickyScroll",n[n.stickyTabStops=116]="stickyTabStops",n[n.stopRenderingLineAfter=117]="stopRenderingLineAfter",n[n.suggest=118]="suggest",n[n.suggestFontSize=119]="suggestFontSize",n[n.suggestLineHeight=120]="suggestLineHeight",n[n.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",n[n.suggestSelection=122]="suggestSelection",n[n.tabCompletion=123]="tabCompletion",n[n.tabIndex=124]="tabIndex",n[n.unicodeHighlighting=125]="unicodeHighlighting",n[n.unusualLineTerminators=126]="unusualLineTerminators",n[n.useShadowDOM=127]="useShadowDOM",n[n.useTabStops=128]="useTabStops",n[n.wordBreak=129]="wordBreak",n[n.wordSegmenterLocales=130]="wordSegmenterLocales",n[n.wordSeparators=131]="wordSeparators",n[n.wordWrap=132]="wordWrap",n[n.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=135]="wordWrapColumn",n[n.wordWrapOverride1=136]="wordWrapOverride1",n[n.wordWrapOverride2=137]="wordWrapOverride2",n[n.wrappingIndent=138]="wrappingIndent",n[n.wrappingStrategy=139]="wrappingStrategy",n[n.showDeprecated=140]="showDeprecated",n[n.inlayHints=141]="inlayHints",n[n.editorClassName=142]="editorClassName",n[n.pixelRatio=143]="pixelRatio",n[n.tabFocusMode=144]="tabFocusMode",n[n.layoutInfo=145]="layoutInfo",n[n.wrappingInfo=146]="wrappingInfo",n[n.defaultColorDecorators=147]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(V_e||(V_e={}));var z_e;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(z_e||(z_e={}));var $_e;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})($_e||($_e={}));var G_e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(G_e||(G_e={}));var q_e;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(q_e||(q_e={}));var Q_e;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Q_e||(Q_e={}));var j_e;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(j_e||(j_e={}));var K_e;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(K_e||(K_e={}));var Y_e;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Y_e||(Y_e={}));var J_e;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(J_e||(J_e={}));var X_e;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(X_e||(X_e={}));var Z_e;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Z_e||(Z_e={}));var eve;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(eve||(eve={}));var tve;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(tve||(tve={}));var ive;(function(n){n[n.Normal=1]="Normal",n[n.Underlined=2]="Underlined"})(ive||(ive={}));var nve;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(nve||(nve={}));var sve;(function(n){n[n.AIGenerated=1]="AIGenerated"})(sve||(sve={}));var ove;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(ove||(ove={}));var rve;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(rve||(rve={}));var ave;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(ave||(ave={}));var cve;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(cve||(cve={}));var lve;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(lve||(lve={}));var dve;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(dve||(dve={}));var hve;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(hve||(hve={}));var uve;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(uve||(uve={}));var gve;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(gve||(gve={}));var fve;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(fve||(fve={}));var pve;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(pve||(pve={}));var mve;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(mve||(mve={}));var _ve;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(_ve||(_ve={}));var vve;(function(n){n[n.Deprecated=1]="Deprecated"})(vve||(vve={}));var wve;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(wve||(wve={}));var bve;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(bve||(bve={}));var Cve;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Cve||(Cve={}));var yve;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(yve||(yve={}));const P2=class P2{static chord(e,t){return Br(e,t)}};P2.CtrlCmd=V.CtrlCmd,P2.Shift=V.Shift,P2.Alt=V.Alt,P2.WinCtrl=V.WinCtrl;let Sve=P2;function WQe(){return{editor:void 0,languages:void 0,CancellationTokenSource:ai,Emitter:I,KeyCode:X_e,KeyMod:Sve,Position:oe,Range:O,Selection:mt,SelectionDirection:fve,MarkerSeverity:Z_e,MarkerTag:eve,Uri:P,Token:A9}}function Aht(n,e){const t=n;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const yi=window;function Eht(n){return n===yi?!1:typeof n?.vscodeWindowId=="number"}var i2e=[],t5=[];function Ct(n,e){if(n&&typeof document<"u"){var t,i=e.prepend===!0?"prepend":"append",s=e.singleTag===!0,o=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(s){var r=i2e.indexOf(o);r===-1&&(r=i2e.push(o)-1,t5[r]={}),t=t5[r]&&t5[r][i]?t5[r][i]:t5[r][i]=a()}else t=a();n.charCodeAt(0)===65279&&(n=n.substring(1)),t.styleSheet?t.styleSheet.cssText+=n:t.appendChild(document.createTextNode(n))}function a(){var c=document.createElement("style");if(c.setAttribute("type","text/css"),e.attributes)for(var l=Object.keys(e.attributes),d=0;d=0,dM=hz.indexOf("AppleWebKit")>=0,eQ=hz.indexOf("Chrome")>=0,TS=!eQ&&hz.indexOf("Safari")>=0,HQe=!eQ&&!TS&&dM;hz.indexOf("Electron/")>=0;const n2e=hz.indexOf("Android")>=0;let zY=!1;if(typeof yi.matchMedia=="function"){const n=yi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=yi.matchMedia("(display-mode: fullscreen)");zY=n.matches,pZ(yi,n,({matches:t})=>{zY&&e.matches||(zY=t)})}function UQe(){return zY}var c$;(function(n){n[n.Always=0]="Always",n[n.FullScreen=1]="FullScreen",n[n.None=2]="None"})(c$||(c$={}));const nMe={clipboard:{writeText:rf||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:rf||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:rf||UQe()?c$.Always:navigator.keyboard||TS?c$.FullScreen:c$.None,touch:"ontouchstart"in yi||navigator.maxTouchPoints>0,pointerEvents:yi.PointerEvent&&("ontouchstart"in yi||navigator.maxTouchPoints>0)};var mT;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl",n[n.KeyCode=255]="KeyCode"})(mT||(mT={}));function Ave(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new l$([mj(t,e),mj(i,e)]):new l$([mj(t,e)])}else{const t=[];for(let i=0;ii.toString(16).padStart(2,"0")).join("");return BigInt(`0x${t}`).toString(32).padStart(52,"0")}class yu{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=Pht.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class aF{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(eQ){const o=navigator.userAgent.match(/Chrome\/(\d+)/);s=(o?parseInt(o[1]):123)<=122}if(e){const o=e,r=e,a=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")s?this.deltaY=o.wheelDeltaY/(120*a):this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS<"u"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?pp&&!ei?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")TS&&Is?this.deltaX=-(o.wheelDeltaX/120):s?this.deltaX=o.wheelDeltaX/(120*a):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS<"u"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?pp&&!ei?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}function pD(n){return n===Q.Slash||n===Q.Backslash}function I9(n){return n.replace(/[\\/]/g,Qi.sep)}function Bht(n){return n.indexOf("/")===-1&&(n=I9(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function o2e(n,e=Qi.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(pD(i)){if(pD(n.charCodeAt(1))&&!pD(n.charCodeAt(2))){let o=3;const r=o;for(;o\|]/g,Uht=/[/]/g,Vht=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function VQe(n,e=Is){const t=e?Hht:Uht;return!(!n||n.length===0||/^\s+$/.test(n)||(t.lastIndex=0,t.test(n))||e&&Vht.test(n)||n==="."||n===".."||e&&n[n.length-1]==="."||e&&n.length!==n.trim().length||n.length>255)}function zht(n,e,t){const i=n===e;return!t||i?i:!n||!e?!1:Oa(n,e)}function mZ(n,e,t,i=dg){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!Gq(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function zQe(n){return n>=Q.A&&n<=Q.Z||n>=Q.a&&n<=Q.z}function $Qe(n,e=Is){return e?zQe(n.charCodeAt(0))&&n.charCodeAt(1)===Q.Colon:!1}function $ht(n,e=Is){return $Qe(n,e)?n[0]:void 0}function GQe(n,e,t){return e.length>n.length?-1:n===e?0:(t&&(n=n.toLowerCase(),e=e.toLowerCase()),n.indexOf(e))}function qQe(n){const e=n.split(":");let t,i,s;for(const o of e){const r=Number(o);Kc(r)?i===void 0?i=r:s===void 0&&(s=r):t=t?[t,o].join(":"):o}if(!t)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:t,line:i!==void 0?i:void 0,column:s!==void 0?s:i!==void 0?1:void 0}}var _e;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatCodeBlock="vscode-chat-code-block",n.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",n.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm",n.commentsInput="comment",n.codeSetting="code-setting"})(_e||(_e={}));function Rx(n,e){return P.isUri(n)?Oa(n.scheme,e):Gq(n,e+":")}function L9(n,...e){return e.some(t=>Rx(n,t))}const Ght="tkn";class qht{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(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=Qht(e,t)}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Qi.join(this._serverRootPath,_e.vscodeRemoteResource)}set(e,t,i){this._hosts[e]=t,this._ports[e]=i}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return bt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${Ght}=${encodeURIComponent(o)}`),P.from({scheme:Jn?this._preferredWebSchema:_e.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:r})}}const T9=new qht;function Qht(n,e){return Qi.join(e??"/",`${n.quality??"oss"}-${n.commit??"dev"}`)}const jht="vscode-app",F2=class F2{constructor(){this.staticBrowserUris=new wi,this.appResourcePathUrls=new Map,this.moduleContentProvider=new Map}registerModuleContentProvider(e,t){this.moduleContentProvider.set(e,t)}toModuleContent(e){return this.moduleContentProvider.get(e)()}registerAppResourcePathUrl(e,t){this.appResourcePathUrls.set(e,t)}toUrl(e){let t=this.appResourcePathUrls.get(e);return typeof t=="function"&&(t=t()),new URL(t??e,globalThis.location?.href??import.meta.url).toString()}asBrowserUri(e){const t=this.toUri(e,{toUrl:this.toUrl.bind(this)});return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===_e.vscodeRemote?T9.rewrite(e):e.scheme===_e.file&&(rf||Yct===`${_e.vscodeFileResource}://${F2.FALLBACK_AUTHORITY}`)?e.with({scheme:_e.vscodeFileResource,authority:e.authority||F2.FALLBACK_AUTHORITY,query:null,fragment:null}):this.staticBrowserUris.get(e)??e}asFileUri(e){const t=this.toUri(e,{toUrl:this.toUrl.bind(this)});return this.uriToFileUri(t)}uriToFileUri(e){return e.scheme===_e.vscodeFileResource?e.with({scheme:_e.file,authority:e.authority!==F2.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e,t){return P.isUri(e)?e:P.parse(t.toUrl(e))}registerStaticBrowserUri(e,t){return this.staticBrowserUris.set(e,t),Ee(()=>{this.staticBrowserUris.get(e)===t&&this.staticBrowserUris.delete(e)})}getRegisteredBrowserUris(){return this.staticBrowserUris.keys()}};F2.FALLBACK_AUTHORITY=jht;let Eve=F2;const lp=new Eve;var xve;(function(n){const e=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"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:P.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(o,r,a){if(!globalThis.crossOriginIsolated)return;const c=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,c):o[t]=c}n.addSearchParam=s})(xve||(xve={}));function fv(n){return dZ(n,!0)}class cO{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:lw(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}ignorePathCasing(e){return this._ignorePathCasing(e)}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===_e.file)return mZ(fv(e),fv(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(_Z(e.authority,t.authority))return mZ(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return P.joinPath(e,...t)}basenameOrAuthority(e){return ui(e)||e.authority}basename(e){return Qi.basename(e.path)}extname(e){return Qi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===_e.file?t=P.file(lS(fv(e))).path:(t=Qi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==Q.Slash&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===_e.file?t=P.file(d1(fv(e))).path:t=Qi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!_Z(e.authority,t.authority))return;if(e.scheme===_e.file){const o=LU(fv(e),fv(t));return Is?I9(o):o}let i=e.path||"/";const s=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,s.length);oo2e(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===Q.Slash&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=dg){return a2e(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=dg){let i=!1;if(e.scheme===_e.file){const s=fv(e);i=s!==void 0&&s.length===o2e(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===Q.Slash}return!i&&!a2e(e,t)?e.with({path:e.path+"/"}):e}}const Fn=new cO(()=>!1),QQe=new cO(n=>n.scheme===_e.file?!jr:!0),Gle=new cO(n=>!0),_n=Fn.isEqual.bind(Fn),MS=Fn.isEqualOrParent.bind(Fn);Fn.getComparisonKey.bind(Fn);const Mx=Fn.basenameOrAuthority.bind(Fn),ui=Fn.basename.bind(Fn),uz=Fn.extname.bind(Fn),ma=Fn.dirname.bind(Fn),Qt=Fn.joinPath.bind(Fn),jQe=Fn.normalizePath.bind(Fn),lO=Fn.relativePath.bind(Fn),r2e=Fn.resolvePath.bind(Fn),KQe=Fn.isAbsolutePath.bind(Fn),_Z=Fn.isEqualAuthority.bind(Fn),a2e=Fn.hasTrailingPathSeparator.bind(Fn),c2e=Fn.removeTrailingPathSeparator.bind(Fn);Fn.addTrailingPathSeparator.bind(Fn);function Kht(n,e){const t=[];for(let i=0;ir===i?!1:MS(s,e(o)))||t.push(n[i])}return t}var h1;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,c]=r.split(":");a&&c&&i.set(a,c)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(h1||(h1={}));function R9(n,e,t){if(e){let i=n.path;return i&&i[0]!==Qi.sep&&(i=Qi.sep+i),n.with({scheme:t,authority:e,path:i})}return n.with({scheme:t})}const YQe=Symbol("MicrotaskDelay");function NS(n){return!!n&&typeof n.then=="function"}function na(n){const e=new ai,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),o(new Tc)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function dw(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}function qle(n,e){return new Promise((t,i)=>{const s=e.onCancellationRequested(()=>{s.dispose(),i(new Tc)});n.then(t,i).finally(()=>s.dispose())})}function JQe(n,e,t){let i;const s=setTimeout(()=>{i?.(void 0)},e);return Promise.race([n.finally(()=>clearTimeout(s)),new Promise(o=>i=o)])}function Zu(n){return new Promise((e,t)=>{const i=n();NS(i)?i.then(e,t):e(i)})}function NU(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}class tQ{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}class Yht{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}}class Jht{constructor(){this.promiseMap=new Map}queue(e,t){const s=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===s&&this.promiseMap.delete(e)});return this.promiseMap.set(e,s),s}}const Xht=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Zht=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};let Lu=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===YQe?Zht(i):Xht(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Tc),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};class iQ{constructor(e){this.delayer=new Lu(e),this.throttler=new tQ}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}class Uh{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}function Ta(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new Tc)})}):na(t=>Ta(n,t))}function PS(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=Ee(()=>{clearTimeout(i),t?.deleteAndLeak(s)});return t?.add(s),s}function Qle(n,e=i=>!!i,t=null){let i=0;const s=n.length,o=()=>{if(i>=s)return Promise.resolve(t);const r=n[i++];return Promise.resolve(r()).then(c=>e(c)?Promise.resolve(c):o())};return o()}class Dve{constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new I}whenIdle(){return this.size>0?T.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((t,i)=>{this.outstandingPromises.push({factory:e,c:t,e:i}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.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()}}let dO=class extends Dve{constructor(){super(1)}};class sMe{constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;const e=new sd;return this.drainers.add(e),e.p}isDrained(){for(const[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=Fn){const i=t.getComparisonKey(e);return this.queues.get(i)?.size??0}queueFor(e,t,i=Fn){const s=i.getComparisonKey(e);let o=this.queues.get(s);if(!o){o=new dO;const r=this.drainListenerCount++,a=T.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(s),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(r),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Zo),this.drainListeners.set(r,a),this.queues.set(s,o)}return o.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(const e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(const[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}}class O_{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new cn("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new cn("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class nQ{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new cn("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const s=i.setInterval(()=>{e()},t);this.disposable=Ee(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class yn{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}class XQe extends yn{constructor(e,t){super(e,t),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){const e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}}let PU,AW;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?AW=(n,e)=>{HRe(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:AW=(n,e,t)=>{const i=n.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let s=!1;return{dispose(){s||(s=!0,n.cancelIdleCallback(i))}}},PU=n=>AW(globalThis,n)})();class ZQe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=AW(e,()=>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}}class kve extends ZQe{constructor(e){super(globalThis,e)}}class eje{isRunning(e){return typeof e=="number"?this._running?.taskId===e:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(e,t,i){return this._running={taskId:e,cancel:()=>i?.(),promise:t},t.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),t}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{const{promise:t,resolve:i,reject:s}=NU();this._queued={run:e,promise:t,promiseResolve:i,promiseReject:s}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var _T;(function(n){n[n.Resolved=0]="Resolved",n[n.Rejected=1]="Rejected"})(_T||(_T={}));class sd{get isRejected(){return this.outcome?.outcome===_T.Rejected}get isResolved(){return this.outcome?.outcome===_T.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===_T.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:_T.Resolved,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:_T.Rejected,value:e},t()})}cancel(){return this.error(new Tc)}}var ko;(function(n){async function e(i){let s;const o=await Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o}n.settled=e;function t(i){return new Promise(async(s,o)=>{try{await i(s,o)}catch(r){o(r)}})}n.withAsyncBody=t})(ko||(ko={}));class eut{get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(t=>(this._value=t,this._isResolved=!0,t),t=>{throw this._error=t,this._isResolved=!0,t})}requireValue(){if(!this._isResolved)throw new cn("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}class tut{constructor(e){this._compute=e,this._promise=new Ka(()=>new eut(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}}var Xw;(function(n){n[n.Initial=0]="Initial",n[n.DoneOK=1]="DoneOK",n[n.DoneError=2]="DoneError"})(Xw||(Xw={}));const Pf=class Pf{static fromArray(e){return new Pf(t=>{t.emitMany(e)})}static fromPromise(e){return new Pf(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Pf(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Pf(async t=>{await Promise.all(e.map(async i=>{for await(const s of i)t.emitOne(s)}))})}constructor(e,t){this._state=Xw.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new I,queueMicrotask(async()=>{const i={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(i)),this.resolve()}catch(s){this.reject(s)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===Xw.DoneError)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new Pf(async i=>{for await(const s of e)i.emitOne(t(s))})}map(e){return Pf.map(this,e)}static filter(e,t){return new Pf(async i=>{for await(const s of e)t(s)&&i.emitOne(s)})}filter(e){return Pf.filter(this,e)}static coalesce(e){return Pf.filter(e,t=>!!t)}coalesce(){return Pf.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return Pf.toPromise(this)}emitOne(e){this._state===Xw.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===Xw.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===Xw.Initial&&(this._state=Xw.DoneOK,this._onStateChanged.fire())}reject(e){this._state===Xw.Initial&&(this._state=Xw.DoneError,this._error=e,this._onStateChanged.fire())}};Pf.EMPTY=Pf.fromArray([]);let tg=Pf;class iut extends tg{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function nut(n){const e=new ai,t=n(e.token);return new iut(e,async i=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),i.reject(new Tc)});try{for await(const o of t){if(e.token.isCancellationRequested)return;i.emitOne(o)}s.dispose(),e.dispose()}catch(o){s.dispose(),e.dispose(),i.reject(o)}})}class M9{constructor(e){this._deferred=new sd,this._asyncIterable=new tg(s=>{if(t){s.reject(t);return}return i&&s.emitMany(i),this._errorFn=o=>s.reject(o),this._emitFn=o=>s.emitOne(o),this._deferred.p},e);let t,i;this._emitFn=s=>{i||(i=[]),i.push(s)},this._errorFn=s=>{t||(t=s)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitFn(e)}}const{entries:tje,setPrototypeOf:l2e,isFrozen:sut,getPrototypeOf:out,getOwnPropertyDescriptor:rut}=Object;let{freeze:mp,seal:Jb,create:aut}=Object,{apply:Ive,construct:Lve}=typeof Reflect<"u"&&Reflect;Ive||(Ive=function(e,t,i){return e.apply(t,i)});mp||(mp=function(e){return e});Jb||(Jb=function(e){return e});Lve||(Lve=function(e,t){return new e(...t)});const cut=hw(Array.prototype.forEach),d2e=hw(Array.prototype.pop),i5=hw(Array.prototype.push),$Y=hw(String.prototype.toLowerCase),Dge=hw(String.prototype.toString),lut=hw(String.prototype.match),Ww=hw(String.prototype.replace),dut=hw(String.prototype.indexOf),hut=hw(String.prototype.trim),Pm=hw(RegExp.prototype.test),n5=uut(TypeError);function hw(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),_ut=Jb(/\${[\w\W]*}/gm),vut=Jb(/^data-[\-\w.\u00B7-\uFFFF]/),wut=Jb(/^aria-[\-\w]+$/),ije=Jb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),but=Jb(/^(?:\w+script|data):/i),Cut=Jb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nje=Jb(/^html$/i);var p2e=Object.freeze({__proto__:null,MUSTACHE_EXPR:put,ERB_EXPR:mut,TMPLIT_EXPR:_ut,DATA_ATTR:vut,ARIA_ATTR:wut,IS_ALLOWED_URI:ije,IS_SCRIPT_OR_DATA:but,ATTR_WHITESPACE:Cut,DOCTYPE_NAME:nje});const yut=()=>typeof window>"u"?null:window,Sut=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function sje(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yut();const e=Ut=>sje(Ut);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:s}=n;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:c,NodeFilter:l,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=n,p=c.prototype,m=_j(p,"cloneNode"),v=_j(p,"nextSibling"),w=_j(p,"childNodes"),b=_j(p,"parentNode");if(typeof r=="function"){const Ut=s.createElement("template");Ut.content&&Ut.content.ownerDocument&&(s=Ut.content.ownerDocument)}let C,y="";const{implementation:S,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:F}=s,{importNode:N}=t;let z={};e.isSupported=typeof tje=="function"&&typeof b=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:J,TMPLIT_EXPR:j,DATA_ATTR:re,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Qe}=p2e;let{IS_ALLOWED_URI:Tt}=p2e,Oe=null;const wt=io({},[...h2e,...kge,...Ige,...Lge,...u2e]);let Nt=null;const Ji=io({},[...g2e,...Tge,...f2e,...vj]);let Vi=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gn=null,Ro=null,qn=!0,ec=!0,ys=!1,mr=!0,ba=!1,ki=!1,gs=!1,ir=!1,Hn=!1,vc=!1,gh=!1,Qn=!0,Yh=!1;const tl="user-content-";let Tl=!0,to=!1,Fc={},rd=null;const Jh=io({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Af=null;const il=io({},["audio","video","img","source","image","track"]);let Rl=null;const Xh=io({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ul="http://www.w3.org/1998/Math/MathML",ad="http://www.w3.org/2000/svg",wc="http://www.w3.org/1999/xhtml";let Ca=wc,Ld=!1,fh=null;const Fu=io({},[ul,ad,wc],Dge);let bc;const Zh=["application/xhtml+xml","text/html"],Cc="text/html";let nr,Rs=null;const Ml=s.createElement("form"),Se=function(G){return G instanceof RegExp||G instanceof Function},Mo=function(G){if(!(Rs&&Rs===G)){if((!G||typeof G!="object")&&(G={}),G=OO(G),bc=Zh.indexOf(G.PARSER_MEDIA_TYPE)===-1?bc=Cc:bc=G.PARSER_MEDIA_TYPE,nr=bc==="application/xhtml+xml"?Dge:$Y,Oe="ALLOWED_TAGS"in G?io({},G.ALLOWED_TAGS,nr):wt,Nt="ALLOWED_ATTR"in G?io({},G.ALLOWED_ATTR,nr):Ji,fh="ALLOWED_NAMESPACES"in G?io({},G.ALLOWED_NAMESPACES,Dge):Fu,Rl="ADD_URI_SAFE_ATTR"in G?io(OO(Xh),G.ADD_URI_SAFE_ATTR,nr):Xh,Af="ADD_DATA_URI_TAGS"in G?io(OO(il),G.ADD_DATA_URI_TAGS,nr):il,rd="FORBID_CONTENTS"in G?io({},G.FORBID_CONTENTS,nr):Jh,Gn="FORBID_TAGS"in G?io({},G.FORBID_TAGS,nr):{},Ro="FORBID_ATTR"in G?io({},G.FORBID_ATTR,nr):{},Fc="USE_PROFILES"in G?G.USE_PROFILES:!1,qn=G.ALLOW_ARIA_ATTR!==!1,ec=G.ALLOW_DATA_ATTR!==!1,ys=G.ALLOW_UNKNOWN_PROTOCOLS||!1,mr=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ba=G.SAFE_FOR_TEMPLATES||!1,ki=G.WHOLE_DOCUMENT||!1,Hn=G.RETURN_DOM||!1,vc=G.RETURN_DOM_FRAGMENT||!1,gh=G.RETURN_TRUSTED_TYPE||!1,ir=G.FORCE_BODY||!1,Qn=G.SANITIZE_DOM!==!1,Yh=G.SANITIZE_NAMED_PROPS||!1,Tl=G.KEEP_CONTENT!==!1,to=G.IN_PLACE||!1,Tt=G.ALLOWED_URI_REGEXP||ije,Ca=G.NAMESPACE||wc,Vi=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&Se(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Vi.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&Se(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Vi.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Vi.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ba&&(ec=!1),vc&&(Hn=!0),Fc&&(Oe=io({},[...u2e]),Nt=[],Fc.html===!0&&(io(Oe,h2e),io(Nt,g2e)),Fc.svg===!0&&(io(Oe,kge),io(Nt,Tge),io(Nt,vj)),Fc.svgFilters===!0&&(io(Oe,Ige),io(Nt,Tge),io(Nt,vj)),Fc.mathMl===!0&&(io(Oe,Lge),io(Nt,f2e),io(Nt,vj))),G.ADD_TAGS&&(Oe===wt&&(Oe=OO(Oe)),io(Oe,G.ADD_TAGS,nr)),G.ADD_ATTR&&(Nt===Ji&&(Nt=OO(Nt)),io(Nt,G.ADD_ATTR,nr)),G.ADD_URI_SAFE_ATTR&&io(Rl,G.ADD_URI_SAFE_ATTR,nr),G.FORBID_CONTENTS&&(rd===Jh&&(rd=OO(rd)),io(rd,G.FORBID_CONTENTS,nr)),Tl&&(Oe["#text"]=!0),ki&&io(Oe,["html","head","body"]),Oe.table&&(io(Oe,["tbody"]),delete Gn.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw n5('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw n5('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=G.TRUSTED_TYPES_POLICY,y=C.createHTML("")}else C===void 0&&(C=Sut(f,i)),C!==null&&typeof y=="string"&&(y=C.createHTML(""));mp&&mp(G),Rs=G}},cd=io({},["mi","mo","mn","ms","mtext"]),K=io({},["foreignobject","desc","title","annotation-xml"]),Le=io({},["title","style","font","a","script"]),ri=io({},kge);io(ri,Ige),io(ri,gut);const ts=io({},Lge);io(ts,fut);const Os=function(G){let de=b(G);(!de||!de.tagName)&&(de={namespaceURI:Ca,tagName:"template"});const L=$Y(G.tagName),ne=$Y(de.tagName);return fh[G.namespaceURI]?G.namespaceURI===ad?de.namespaceURI===wc?L==="svg":de.namespaceURI===ul?L==="svg"&&(ne==="annotation-xml"||cd[ne]):!!ri[L]:G.namespaceURI===ul?de.namespaceURI===wc?L==="math":de.namespaceURI===ad?L==="math"&&K[ne]:!!ts[L]:G.namespaceURI===wc?de.namespaceURI===ad&&!K[ne]||de.namespaceURI===ul&&!cd[ne]?!1:!ts[L]&&(Le[L]||!ri[L]):!!(bc==="application/xhtml+xml"&&fh[G.namespaceURI]):!1},sr=function(G){i5(e.removed,{element:G});try{G.parentNode.removeChild(G)}catch{G.remove()}},ya=function(G,de){try{i5(e.removed,{attribute:de.getAttributeNode(G),from:de})}catch{i5(e.removed,{attribute:null,from:de})}if(de.removeAttribute(G),G==="is"&&!Nt[G])if(Hn||vc)try{sr(de)}catch{}else try{de.setAttribute(G,"")}catch{}},yc=function(G){let de,L;if(ir)G=""+G;else{const H=lut(G,/^[\r\n\t ]+/);L=H&&H[0]}bc==="application/xhtml+xml"&&Ca===wc&&(G=''+G+"");const ne=C?C.createHTML(G):G;if(Ca===wc)try{de=new u().parseFromString(ne,bc)}catch{}if(!de||!de.documentElement){de=S.createDocument(Ca,"template",null);try{de.documentElement.innerHTML=Ld?y:ne}catch{}}const R=de.body||de.documentElement;return G&&L&&R.insertBefore(s.createTextNode(L),R.childNodes[0]||null),Ca===wc?F.call(de,ki?"html":"body")[0]:ki?de.documentElement:R},Ou=function(G){return M.call(G.ownerDocument||G,G,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},le=function(G){return G instanceof h&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof d)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},_r=function(G){return typeof a=="object"?G instanceof a:G&&typeof G=="object"&&typeof G.nodeType=="number"&&typeof G.nodeName=="string"},No=function(G,de,L){z[G]&&cut(z[G],ne=>{ne.call(e,de,L,Rs)})},mn=function(G){let de;if(No("beforeSanitizeElements",G,null),le(G))return sr(G),!0;const L=nr(G.nodeName);if(No("uponSanitizeElement",G,{tagName:L,allowedTags:Oe}),G.hasChildNodes()&&!_r(G.firstElementChild)&&(!_r(G.content)||!_r(G.content.firstElementChild))&&Pm(/<[/\w]/g,G.innerHTML)&&Pm(/<[/\w]/g,G.textContent))return sr(G),!0;if(!Oe[L]||Gn[L]){if(!Gn[L]&&ct(L)&&(Vi.tagNameCheck instanceof RegExp&&Pm(Vi.tagNameCheck,L)||Vi.tagNameCheck instanceof Function&&Vi.tagNameCheck(L)))return!1;if(Tl&&!rd[L]){const ne=b(G)||G.parentNode,R=w(G)||G.childNodes;if(R&&ne){const H=R.length;for(let ie=H-1;ie>=0;--ie)ne.insertBefore(m(R[ie],!0),v(G))}}return sr(G),!0}return G instanceof c&&!Os(G)||(L==="noscript"||L==="noembed"||L==="noframes")&&Pm(/<\/no(script|embed|frames)/i,G.innerHTML)?(sr(G),!0):(ba&&G.nodeType===3&&(de=G.textContent,de=Ww(de,U," "),de=Ww(de,J," "),de=Ww(de,j," "),G.textContent!==de&&(i5(e.removed,{element:G.cloneNode()}),G.textContent=de)),No("afterSanitizeElements",G,null),!1)},ve=function(G,de,L){if(Qn&&(de==="id"||de==="name")&&(L in s||L in Ml))return!1;if(!(ec&&!Ro[de]&&Pm(re,de))){if(!(qn&&Pm(me,de))){if(!Nt[de]||Ro[de]){if(!(ct(G)&&(Vi.tagNameCheck instanceof RegExp&&Pm(Vi.tagNameCheck,G)||Vi.tagNameCheck instanceof Function&&Vi.tagNameCheck(G))&&(Vi.attributeNameCheck instanceof RegExp&&Pm(Vi.attributeNameCheck,de)||Vi.attributeNameCheck instanceof Function&&Vi.attributeNameCheck(de))||de==="is"&&Vi.allowCustomizedBuiltInElements&&(Vi.tagNameCheck instanceof RegExp&&Pm(Vi.tagNameCheck,L)||Vi.tagNameCheck instanceof Function&&Vi.tagNameCheck(L))))return!1}else if(!Rl[de]){if(!Pm(Tt,Ww(L,Qe,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&G!=="script"&&dut(L,"data:")===0&&Af[G])){if(!(ys&&!Pm(De,Ww(L,Qe,"")))){if(L)return!1}}}}}}return!0},ct=function(G){return G.indexOf("-")>0},Ht=function(G){let de,L,ne,R;No("beforeSanitizeAttributes",G,null);const{attributes:H}=G;if(!H)return;const ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Nt};for(R=H.length;R--;){de=H[R];const{name:je,namespaceURI:pt}=de;if(L=je==="value"?de.value:hut(de.value),ne=nr(je),ie.attrName=ne,ie.attrValue=L,ie.keepAttr=!0,ie.forceKeepAttr=void 0,No("uponSanitizeAttribute",G,ie),L=ie.attrValue,ie.forceKeepAttr||(ya(je,G),!ie.keepAttr))continue;if(!mr&&Pm(/\/>/i,L)){ya(je,G);continue}ba&&(L=Ww(L,U," "),L=Ww(L,J," "),L=Ww(L,j," "));const is=nr(G.nodeName);if(ve(is,ne,L)){if(Yh&&(ne==="id"||ne==="name")&&(ya(je,G),L=tl+L),C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pt)switch(f.getAttributeType(is,ne)){case"TrustedHTML":{L=C.createHTML(L);break}case"TrustedScriptURL":{L=C.createScriptURL(L);break}}try{pt?G.setAttributeNS(pt,je,L):G.setAttribute(je,L),d2e(e.removed)}catch{}}}No("afterSanitizeAttributes",G,null)},Ei=function Ut(G){let de;const L=Ou(G);for(No("beforeSanitizeShadowDOM",G,null);de=L.nextNode();)No("uponSanitizeShadowNode",de,null),!mn(de)&&(de.content instanceof o&&Ut(de.content),Ht(de));No("afterSanitizeShadowDOM",G,null)};return e.sanitize=function(Ut){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de,L,ne,R;if(Ld=!Ut,Ld&&(Ut=""),typeof Ut!="string"&&!_r(Ut))if(typeof Ut.toString=="function"){if(Ut=Ut.toString(),typeof Ut!="string")throw n5("dirty is not a string, aborting")}else throw n5("toString is not a function");if(!e.isSupported)return Ut;if(gs||Mo(G),e.removed=[],typeof Ut=="string"&&(to=!1),to){if(Ut.nodeName){const je=nr(Ut.nodeName);if(!Oe[je]||Gn[je])throw n5("root node is forbidden and cannot be sanitized in-place")}}else if(Ut instanceof a)de=yc(""),L=de.ownerDocument.importNode(Ut,!0),L.nodeType===1&&L.nodeName==="BODY"||L.nodeName==="HTML"?de=L:de.appendChild(L);else{if(!Hn&&!ba&&!ki&&Ut.indexOf("<")===-1)return C&&gh?C.createHTML(Ut):Ut;if(de=yc(Ut),!de)return Hn?null:gh?y:""}de&&ir&&sr(de.firstChild);const H=Ou(to?Ut:de);for(;ne=H.nextNode();)mn(ne)||(ne.content instanceof o&&Ei(ne.content),Ht(ne));if(to)return Ut;if(Hn){if(vc)for(R=k.call(de.ownerDocument);de.firstChild;)R.appendChild(de.firstChild);else R=de;return(Nt.shadowroot||Nt.shadowrootmode)&&(R=N.call(t,R,!0)),R}let ie=ki?de.outerHTML:de.innerHTML;return ki&&Oe["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Pm(nje,de.ownerDocument.doctype.name)&&(ie=" +`+ie),ba&&(ie=Ww(ie,U," "),ie=Ww(ie,J," "),ie=Ww(ie,j," ")),C&&gh?C.createHTML(ie):ie},e.setConfig=function(Ut){Mo(Ut),gs=!0},e.clearConfig=function(){Rs=null,gs=!1},e.isValidAttribute=function(Ut,G,de){Rs||Mo({});const L=nr(Ut),ne=nr(G);return ve(L,ne,de)},e.addHook=function(Ut,G){typeof G=="function"&&(z[Ut]=z[Ut]||[],i5(z[Ut],G))},e.removeHook=function(Ut){if(z[Ut])return d2e(z[Ut])},e.removeHooks=function(Ut){z[Ut]&&(z[Ut]=[])},e.removeAllHooks=function(){z={}},e}var oMe=sje();const oje=oMe.sanitize,rje=oMe.addHook,aje=oMe.removeHook;function Ed(n){return jle(n,0)}function jle(n,e){switch(typeof n){case"object":return n===null?_E(349,e):Array.isArray(n)?Eut(n,e):xut(n,e);case"string":return rMe(n,e);case"boolean":return Aut(n,e);case"number":return _E(n,e);case"undefined":return _E(937,e);default:return _E(617,e)}}function _E(n,e){return(e<<5)-e+n|0}function Aut(n,e){return _E(n?433:863,e)}function rMe(n,e){e=_E(149417,e);for(let t=0,i=n.length;tjle(i,t),e)}function xut(n,e){return e=_E(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=rMe(i,t),jle(n[i],t)),e)}var tv;(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(tv||(tv={}));function Rge(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function m2e(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):Dut((n>>>0).toString(16),e/4)}const nae=class nae{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(tv.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let c=r;if(wl(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=tv.BLOCK_SIZE&&(this._step(),t-=tv.BLOCK_SIZE,this._totalLen+=tv.BLOCK_SIZE,e[0]=e[tv.BLOCK_SIZE+0],e[1]=e[tv.BLOCK_SIZE+1],e[2]=e[tv.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,tv.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),s5(this._h0)+s5(this._h1)+s5(this._h2)+s5(this._h3)+s5(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,m2e(this._buff,this._buffLen),this._buffLen>56&&(this._step(),m2e(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=nae._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,Rge(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=s&o|~s&r,l=1518500249):h<40?(c=s^o^r,l=1859775393):h<60?(c=s&o|s&r|o&r,l=2400959708):(c=s^o^r,l=3395469782),d=Rge(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=Rge(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};nae._bigBlock32=new DataView(new ArrayBuffer(320));let Tve=nae;const{registerWindow:Uli,getWindow:gt,getDocument:Vli,getWindows:N9,getWindowsCount:kut,getWindowId:FU,getWindowById:vZ,hasWindow:zli,onDidRegisterWindow:Vb,onWillUnregisterWindow:Iut,onDidUnregisterWindow:Lut}=function(){const n=new Map;Aht(yi,1);const e={window:yi,disposables:new Z};n.set(yi.vscodeWindowId,e);const t=new I,i=new I,s=new I;function o(r,a){return(typeof r=="number"?n.get(r):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(r){if(n.has(r.vscodeWindowId))return $.None;const a=new Z,c={window:r,disposables:a.add(new Z)};return n.set(r.vscodeWindowId,c),a.add(Ee(()=>{n.delete(r.vscodeWindowId),i.fire(r)})),a.add(pe(r,xe.BEFORE_UNLOAD,()=>{s.fire(r)})),t.fire(c),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return n.has(r)},getWindowById:o,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=r;return c?.view?c.view.window:yi},getDocument(r){return gt(r).document}}}();function Yo(n){for(;n.firstChild;)n.firstChild.remove()}class Tut{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function pe(n,e,t,i){return new Tut(n,e,t,i)}function cje(n,e){return function(t){return e(new yu(n,t))}}function Rut(n){return function(e){return n(new os(e))}}const Xo=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=cje(gt(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Rut(i)),pe(e,t,o,s)},Mut=function(e,t,i){const s=cje(gt(e),t);return Nut(e,s,i)};function Nut(n,e,t){return pe(n,I_&&nMe.pointerEvents?xe.POINTER_DOWN:xe.MOUSE_DOWN,e,t)}function UB(n,e,t){return AW(n,e,t)}class d$ extends ZQe{constructor(e,t){super(e,t)}}let wZ,xd;function Put(n,e,t,i){let s=0;const o=n.setInterval(()=>{s++,(s>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{n.clearInterval(o)});return r}class sQ extends nQ{constructor(e){super(),this.defaultTarget=e&>(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Mge{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const n=new Map,e=new Map,t=new Map,i=new Map,s=o=>{t.set(o,!1);const r=n.get(o)??[];for(e.set(o,r),n.set(o,[]),i.set(o,!0);r.length>0;)r.sort(Mge.sort),r.shift().execute();i.set(o,!1)};xd=(o,r,a=0)=>{const c=FU(o),l=new Mge(r,a);let d=n.get(c);return d||(d=[],n.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>s(c))),l},wZ=(o,r,a)=>{const c=FU(o);if(i.get(c)){const l=new Mge(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return xd(o,r,a)}})();const Fut=8,Out=function(n,e){return e};class But extends ${constructor(e,t,i,s=Out,o=Fut){super();let r=null,a=0;const c=this._register(new O_),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(pe(e,t,d=>{r=s(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function Wut(n,e,t,i,s){return new But(n,e,t,i,s)}function Kle(n){return gt(n).getComputedStyle(n,null)}function uw(n,e){const t=gt(n),i=t.document;if(n!==i.body)return new Tn(n.clientWidth,n.clientHeight);if(I_&&t?.visualViewport)return new Tn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new Tn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Tn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Tn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ha{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=Kle(e),o=s?s.getPropertyValue(t):"0";return ha.convertToPixels(e,o)}static getBorderLeftWidth(e){return ha.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ha.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ha.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ha.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ha.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ha.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ha.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ha.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ha.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ha.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ha.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ha.getDimension(e,"margin-bottom","marginBottom")}}const KT=class KT{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new KT(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof KT?e:new KT(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};KT.None=new KT(0,0);let Tn=KT;function bZ(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=hje(n)?null:Kle(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=ha.getBorderLeftWidth(n),t+=ha.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Hut(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function ia(n){const e=n.getBoundingClientRect(),t=gt(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function lje(n){let e=n,t=1;do{const i=Kle(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function du(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.offsetWidth+e}function h$(n){const e=ha.getBorderLeftWidth(n)+ha.getBorderRightWidth(n),t=ha.getPaddingLeft(n)+ha.getPaddingRight(n);return n.offsetWidth-e-t}function Uut(n){const e=ha.getMarginLeft(n)+ha.getMarginRight(n);return n.scrollWidth+e}function aMe(n){const e=ha.getBorderTopWidth(n)+ha.getBorderBottomWidth(n),t=ha.getPaddingTop(n)+ha.getPaddingBottom(n);return n.offsetHeight-e-t}function Zf(n){const e=ha.getMarginTop(n)+ha.getMarginBottom(n);return n.offsetHeight+e}function Vut(n,e){if(n===null)return 0;const t=bZ(n),i=bZ(e);return t.left-i.left}function zut(n,e){const t=e.map(s=>Math.max(Uut(s),du(s))+Vut(s,n)||0);return Math.max(...t)}function al(n,e){return!!e?.contains(n)}const dje="parentFlowToElementId";function $ut(n,e){n.dataset[dje]=e.id}function Gut(n){const e=n.dataset[dje];return typeof e=="string"?n.ownerDocument.getElementById(e):null}function qut(n,e){let t=n;for(;t;){if(t===e)return!0;if(Ra(t)){const i=Gut(t);if(i){t=i;continue}}t=t.parentNode}return!1}function Qut(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function GY(n,e,t){return!!Qut(n,e,t)}function hje(n){return n&&!!n.host&&!!n.mode}function P9(n){return!!cF(n)}function cF(n){for(;n.parentNode;){if(n===n.ownerDocument?.body)return null;n=n.parentNode}return hje(n)?n:null}function xl(){let n=Kg().activeElement;for(;n?.shadowRoot;)n=n.shadowRoot.activeElement;return n}function kw(n){return xl()===n}function cMe(n){return al(xl(),n)}function jut(n){return n.ownerDocument===Kg()}function Kg(){return kut()<=1?yi.document:Array.from(N9()).map(({window:e})=>e.document).find(e=>e.hasFocus())??yi.document}function ax(){return Kg().defaultView?.window??yi}const lMe=new Map;function uje(){return new Kut}class Kut{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=od(yi.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function od(n=yi.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),n.appendChild(i),t&&t.add(Ee(()=>n.removeChild(i))),n===yi.document.head){const s=new Set;lMe.set(i,s);for(const{window:o,disposables:r}of N9()){if(o===yi)continue;const a=r.add(Yut(i,s,o));t?.add(a)}}return i}function Yut(n,e,t){const i=new Z,s=n.cloneNode(!0);t.document.head.appendChild(s),i.add(Ee(()=>t.document.head.removeChild(s)));for(const o of fje(n))s.sheet?.insertRule(o.cssText,s.sheet?.cssRules.length);return i.add(Jut.observe(n,i,{childList:!0})(()=>{s.textContent=n.textContent})),e.add(s),i.add(Ee(()=>e.delete(s))),i}const Jut=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));const s=Ed(t);let o=i.get(s);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(n,t);const c=o={users:1,observer:a,onDidMutate:r.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(r.dispose(),a.disconnect(),i?.delete(s),i?.size===0&&this.mutationObservers.delete(n))})),i.set(s,o)}return o.onDidMutate}};let Nge=null;function gje(){return Nge||(Nge=od()),Nge}function fje(n){return n?.sheet?.rules?n.sheet.rules:n?.sheet?.cssRules?n.sheet.cssRules:[]}function Kp(n,e,t=gje()){if(!(!t||!e)){t.sheet?.insertRule(`${n} {${e}}`,0);for(const i of lMe.get(t)??[])Kp(n,e,i)}}function vE(n,e=gje()){if(!e)return;const t=fje(e),i=[];for(let s=0;s=0;s--)e.sheet?.deleteRule(i[s]);for(const s of lMe.get(e)??[])vE(n,s)}function Xut(n){return typeof n.selectorText=="string"}function Ra(n){return n instanceof HTMLElement||n instanceof gt(n).HTMLElement}function _2e(n){return n instanceof HTMLAnchorElement||n instanceof gt(n).HTMLAnchorElement}function Zut(n){return n instanceof HTMLTextAreaElement||n instanceof gt(n).HTMLTextAreaElement}function egt(n){return n instanceof HTMLInputElement||n instanceof gt(n).HTMLInputElement}function dMe(n){return n instanceof MouseEvent||n instanceof gt(n).MouseEvent}function Sv(n){return n instanceof KeyboardEvent||n instanceof gt(n).KeyboardEvent}function tgt(n){return n instanceof DragEvent||n instanceof gt(n).DragEvent}const xe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:dM?"webkitAnimationStart":"animationstart",ANIMATION_END:dM?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dM?"webkitAnimationIteration":"animationiteration"};function igt(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const un={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function ngt(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function sgt(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class CZ extends ${static hasFocusWithin(e){if(Ra(e)){const t=cF(e),i=t?t.activeElement:e.ownerDocument.activeElement;return al(i,e)}else{const t=e;return al(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event;let t=CZ.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Ra(e)?gt(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{CZ.hasFocusWithin(e)!==t&&(t?o():s())},this._register(pe(e,xe.FOCUS,s,!0)),this._register(pe(e,xe.BLUR,o,!0)),Ra(e)&&(this._register(pe(e,xe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(pe(e,xe.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Dd(n){return new CZ(n)}function pje(n,e){return n.after(e),e}function he(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Yle(n,e){return n.insertBefore(e,n.firstChild),e}function _a(n,...e){n.innerText="",he(n,...e)}const ogt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var F9;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(F9||(F9={}));function mje(n,e,t,...i){const s=ogt.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==F9.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?r[a]=c:a==="selected"?c&&r.setAttribute(a,"true"):r.setAttribute(a,c))}),r.append(...i),r}function we(n,e,...t){return mje(F9.HTML,n,e,...t)}we.SVG=function(n,e,...t){return mje(F9.SVG,n,e,...t)};function _je(n,...e){n?Oh(...e):Jl(...e)}function Oh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Jl(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function v2e(n,e){const t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function vje(n){yi.open(n,"_blank","noopener")}function rgt(n,e){const t=()=>{e(),i=xd(n,t)};let i=xd(n,t);return Ee(()=>i.dispose())}T9.setPreferredWebSchema(/^https:/.test(yi.location.href)?"https":"http");function uf(n){return n?`url('${lp.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function qY(n){return`'${n.replace(/'/g,"%27")}'`}function hS(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=hS(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function agt(n,e){let t;if(P.isUri(n))t=n.toString(!0);else{const o=new Blob([n]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=ax(),s=document.createElement("a");i.document.body.appendChild(s),s.download=e,s.href=t,s.click(),setTimeout(()=>i.document.body.removeChild(s))}function cgt(){return new Promise(n=>{const e=ax(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,T.once(T.fromDOMEventEmitter(t,"input"))(()=>{n(t.files??void 0)}),t.click(),setTimeout(()=>e.document.body.removeChild(t))})}var u$;(function(n){n[n.DOCUMENT=1]="DOCUMENT",n[n.BROWSER=2]="BROWSER"})(u$||(u$={}));function lgt(n){return n.document.fullscreenElement||n.document.webkitFullscreenElement||n.document.webkitIsFullScreen?{mode:u$.DOCUMENT,guess:!1}:n.innerHeight===n.screen.height?{mode:u$.BROWSER,guess:!1}:(ei||jr)&&n.outerHeight===n.screen.height&&n.outerWidth===n.screen.width?{mode:u$.BROWSER,guess:!0}:null}function dgt(n,e=!1){const t=document.createElement("a");return rje("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ee(()=>{aje("afterSanitizeAttributes")})}_e.http,_e.https,_e.command;const hgt=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);function ugt(n){const e=new Uint16Array(n.length);for(let s=0;sthis.registerListeners(e,t),{window:yi,disposables:this._subscriptions}))}registerListeners(e,t){t.add(pe(e,"keydown",i=>{if(i.defaultPrevented)return;const s=new os(i);if(!(s.keyCode===E.Alt&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(s.keyCode!==E.Alt)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(pe(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(pe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(pe(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(pe(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Nb.instance||(Nb.instance=new Nb),Nb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class yZ extends ${constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(pe(this.element,xe.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(pe(this.element,xe.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(pe(this.element,xe.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(pe(this.element,xe.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(pe(this.element,xe.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(pe(this.element,xe.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(pe(this.element,xe.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const ggt=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function di(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=ggt.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const l of s.groups.class.split("."))l!==""&&a.push(l);if(t.className!==void 0)for(const l of t.className.split("."))l!==""&&a.push(l);a.length>0&&(r.className=a.join(" "));const c={};if(s.groups.name&&(c[s.groups.name]=r),i)for(const l of i)Ra(l)?r.appendChild(l):typeof l=="string"?r.append(l):"root"in l&&(Object.assign(c,l),r.appendChild(l.root));for(const[l,d]of Object.entries(t))if(l!=="className")if(l==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(w2e(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(w2e(l),d.toString());return c.root=r,c}function w2e(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class fgt extends ${constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class pgt extends ${get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new fgt(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s}}class mgt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=FU(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=xU(new pgt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),xU(T.once(Lut)(({vscodeWindowId:s})=>{s===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const B9=new mgt;class wje{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Ep(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Ep(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Ep(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Ep(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Ep(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Ep(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Ep(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=Ep(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=Ep(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=Ep(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=Ep(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Ep(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Ep(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Ep(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Ep(n){return typeof n=="number"?`${n}px`:n}function ks(n){return new wje(n)}function Sd(n,e){n instanceof wje?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}var Wc;(function(n){n[n.Regular=0]="Regular",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold"})(Wc||(Wc={}));class _gt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class hMe{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Sd(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Sd(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Sd(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===Wc.Regular&&(a=t),r.type===Wc.Bold&&(a=i),r.type===Wc.Italic&&(a=s),a.appendChild(document.createElement("br"));const c=document.createElement("span");hMe._render(c,r),a.appendChild(c),o.push(c)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let s=!1;for(const o of i)o.isTrusted||(s=!0,t.remove(o));s&&this._onDidChange.fire()}serializeFontInfo(e){return this._ensureCache(e).getValues().filter(i=>i.isTrusted)}restoreFontInfo(e,t){for(const i of t){if(i.version!==bje)continue;const s=new QY(i,!1);this._writeToCache(e,s,s)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let s=this._actualReadFontInfo(e,t);(s.typicalHalfwidthCharacterWidth<=2||s.typicalFullwidthCharacterWidth<=2||s.spaceWidth<=2||s.maxDigitWidth<=2)&&(s=new QY({pixelRatio:B9.getInstance(e).value,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontSize:s.fontSize,fontFeatureSettings:s.fontFeatureSettings,fontVariationSettings:s.fontVariationSettings,lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,isMonospace:s.isMonospace,typicalHalfwidthCharacterWidth:Math.max(s.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(s.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:s.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(s.spaceWidth,5),middotWidth:Math.max(s.middotWidth,5),wsmiddotWidth:Math.max(s.wsmiddotWidth,5),maxDigitWidth:Math.max(s.maxDigitWidth,5)},!1)),this._writeToCache(e,t,s)}return i.get(t)}_createRequest(e,t,i,s){const o=new _gt(e,t);return i.push(o),s?.push(o),o}_actualReadFontInfo(e,t){const i=[],s=[],o=this._createRequest("n",Wc.Regular,i,s),r=this._createRequest("m",Wc.Regular,i,null),a=this._createRequest(" ",Wc.Regular,i,s),c=this._createRequest("0",Wc.Regular,i,s),l=this._createRequest("1",Wc.Regular,i,s),d=this._createRequest("2",Wc.Regular,i,s),h=this._createRequest("3",Wc.Regular,i,s),u=this._createRequest("4",Wc.Regular,i,s),f=this._createRequest("5",Wc.Regular,i,s),p=this._createRequest("6",Wc.Regular,i,s),m=this._createRequest("7",Wc.Regular,i,s),v=this._createRequest("8",Wc.Regular,i,s),w=this._createRequest("9",Wc.Regular,i,s),b=this._createRequest("→",Wc.Regular,i,s),C=this._createRequest("→",Wc.Regular,i,null),y=this._createRequest("·",Wc.Regular,i,s),S=this._createRequest("⸱",Wc.Regular,i,null),M="|/-_ilm%";for(let U=0,J=M.length;U.001){F=!1;break}}let z=!0;return F&&C.width!==N&&(z=!1),C.width>b.width&&(z=!1),new QY({pixelRatio:B9.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:F,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:y.width,wsmiddotWidth:S.width,maxDigitWidth:k},!0)}}class Cgt{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const Rve=new bgt;var Ov;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Ov||(Ov={}));const be=ae("instantiationService");function ygt(n,e,t){e[Ov.DI_TARGET]===e?e[Ov.DI_DEPENDENCIES].push({id:n,index:t}):(e[Ov.DI_DEPENDENCIES]=[{id:n,index:t}],e[Ov.DI_TARGET]=e)}function ae(n){if(Ov.serviceIds.has(n))return Ov.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ygt(e,t,s)};return e.toString=()=>n,Ov.serviceIds.set(n,e),e}const jt=ae("codeEditorService"),Ai=ae("modelService"),Rn=ae("textModelService");function D(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function _(n,e){return function(t,i){e(t,i,n)}}const Sgt="vs/base/common/actions";class xn extends ${constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}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,t){this._actionCallback&&await this._actionCallback(e)}}class gw extends ${constructor(){super(...arguments),this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const z8=class z8{constructor(){this.id=z8.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new z8,...i]:t=i);return t}async run(){}};z8.ID="vs.actions.separator";let Kr=z8;class u1{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}async run(){}}const sae=class sae extends xn{constructor(){super(sae.ID,g(Sgt,0,"(empty)"),void 0,!1)}};sae.ID="vs.actions.empty";let Mve=sae;function _l(n){return{id:n.id,label:n.label,tooltip:n.tooltip??n.label,class:n.class,enabled:n.enabled??!0,checked:n.checked,run:async(...e)=>n.run(...e)}}var OU;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(OU||(OU={}));function b2e(n){return{id:n}}var $e;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(Ce.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}n.asClassNameArray=t;function i(u){return t(u).join(" ")}n.asClassName=i;function s(u){return"."+t(u).join(".")}n.asCSSSelector=s;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||OU.isThemeColor(u.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}n.fromString=a;function c(u){return{id:u}}n.fromId=c;function l(u,f){let p=u.id;const m=p.lastIndexOf("~");return m!==-1&&(p=p.substring(0,m)),f&&(p=`${p}~${f}`),{id:p}}n.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}n.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}n.isEqual=h})($e||($e={}));const ji=ae("commandService"),yt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const r=[];for(const c of n.metadata.args)r.push(c.constraint);const a=n.handler;n.handler=function(c,...l){return Uct(l,r),a(c,...l)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new td,this._commands.set(t,i));const s=i.unshift(n),o=Ee(()=>{s(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return yt.registerCommand(n,(t,...i)=>t.get(ji).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return fi.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};yt.registerCommand("noop",()=>{});const Pe=ae("contextKeyService");function nm(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function oQ(n,e="Unreachable"){throw new Error(e)}function Agt(n,e="unexpected state"){if(!n)throw new cn(`Assertion Failed: ${e}`)}function C2e(n){n||bt(new cn("Soft Assertion Failed"))}function fw(n){if(!n()){debugger;n(),bt(new cn("Assertion Failed"))}}function gz(n,e){let t=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Dgt)),this._cachedMergedKeybindings.slice(0)}}const xr=new uMe,xgt={EditorModes:"platform.keybindingsRegistry"};it.add(xgt.EditorModes,xr);function Dgt(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var jY;function lR(n){return n.command!==void 0}function kgt(n){return n.submenu!==void 0}const te=class te{static for(e){return te._instances.get(e)??new te(e)}constructor(e){if(te._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);te._instances.set(e,this),this.id=e}};te._instances=new Map,te.CommandPalette=new te("CommandPalette"),te.DebugBreakpointsContext=new te("DebugBreakpointsContext"),te.DebugCallStackContext=new te("DebugCallStackContext"),te.DebugConsoleContext=new te("DebugConsoleContext"),te.DebugVariablesContext=new te("DebugVariablesContext"),te.NotebookVariablesContext=new te("NotebookVariablesContext"),te.DebugHoverContext=new te("DebugHoverContext"),te.DebugWatchContext=new te("DebugWatchContext"),te.DebugToolBar=new te("DebugToolBar"),te.DebugToolBarStop=new te("DebugToolBarStop"),te.EditorContext=new te("EditorContext"),te.SimpleEditorContext=new te("SimpleEditorContext"),te.EditorContent=new te("EditorContent"),te.EditorLineNumberContext=new te("EditorLineNumberContext"),te.EditorContextCopy=new te("EditorContextCopy"),te.EditorContextPeek=new te("EditorContextPeek"),te.EditorContextShare=new te("EditorContextShare"),te.EditorTitle=new te("EditorTitle"),te.EditorTitleRun=new te("EditorTitleRun"),te.EditorTitleContext=new te("EditorTitleContext"),te.EditorTitleContextShare=new te("EditorTitleContextShare"),te.EmptyEditorGroup=new te("EmptyEditorGroup"),te.EmptyEditorGroupContext=new te("EmptyEditorGroupContext"),te.EditorTabsBarContext=new te("EditorTabsBarContext"),te.EditorTabsBarShowTabsSubmenu=new te("EditorTabsBarShowTabsSubmenu"),te.EditorTabsBarShowTabsZenModeSubmenu=new te("EditorTabsBarShowTabsZenModeSubmenu"),te.EditorActionsPositionSubmenu=new te("EditorActionsPositionSubmenu"),te.ExplorerContext=new te("ExplorerContext"),te.ExplorerContextShare=new te("ExplorerContextShare"),te.ExtensionContext=new te("ExtensionContext"),te.GlobalActivity=new te("GlobalActivity"),te.CommandCenter=new te("CommandCenter"),te.CommandCenterCenter=new te("CommandCenterCenter"),te.LayoutControlMenuSubmenu=new te("LayoutControlMenuSubmenu"),te.LayoutControlMenu=new te("LayoutControlMenu"),te.MenubarMainMenu=new te("MenubarMainMenu"),te.MenubarAppearanceMenu=new te("MenubarAppearanceMenu"),te.MenubarDebugMenu=new te("MenubarDebugMenu"),te.MenubarEditMenu=new te("MenubarEditMenu"),te.MenubarCopy=new te("MenubarCopy"),te.MenubarFileMenu=new te("MenubarFileMenu"),te.MenubarGoMenu=new te("MenubarGoMenu"),te.MenubarHelpMenu=new te("MenubarHelpMenu"),te.MenubarLayoutMenu=new te("MenubarLayoutMenu"),te.MenubarNewBreakpointMenu=new te("MenubarNewBreakpointMenu"),te.PanelAlignmentMenu=new te("PanelAlignmentMenu"),te.PanelPositionMenu=new te("PanelPositionMenu"),te.ActivityBarPositionMenu=new te("ActivityBarPositionMenu"),te.MenubarPreferencesMenu=new te("MenubarPreferencesMenu"),te.MenubarRecentMenu=new te("MenubarRecentMenu"),te.MenubarSelectionMenu=new te("MenubarSelectionMenu"),te.MenubarShare=new te("MenubarShare"),te.MenubarSwitchEditorMenu=new te("MenubarSwitchEditorMenu"),te.MenubarSwitchGroupMenu=new te("MenubarSwitchGroupMenu"),te.MenubarTerminalMenu=new te("MenubarTerminalMenu"),te.MenubarViewMenu=new te("MenubarViewMenu"),te.MenubarHomeMenu=new te("MenubarHomeMenu"),te.OpenEditorsContext=new te("OpenEditorsContext"),te.OpenEditorsContextShare=new te("OpenEditorsContextShare"),te.ProblemsPanelContext=new te("ProblemsPanelContext"),te.SCMInputBox=new te("SCMInputBox"),te.SCMChangesSeparator=new te("SCMChangesSeparator"),te.SCMIncomingChanges=new te("SCMIncomingChanges"),te.SCMIncomingChangesContext=new te("SCMIncomingChangesContext"),te.SCMIncomingChangesSetting=new te("SCMIncomingChangesSetting"),te.SCMOutgoingChanges=new te("SCMOutgoingChanges"),te.SCMOutgoingChangesContext=new te("SCMOutgoingChangesContext"),te.SCMOutgoingChangesSetting=new te("SCMOutgoingChangesSetting"),te.SCMIncomingChangesAllChangesContext=new te("SCMIncomingChangesAllChangesContext"),te.SCMIncomingChangesHistoryItemContext=new te("SCMIncomingChangesHistoryItemContext"),te.SCMOutgoingChangesAllChangesContext=new te("SCMOutgoingChangesAllChangesContext"),te.SCMOutgoingChangesHistoryItemContext=new te("SCMOutgoingChangesHistoryItemContext"),te.SCMChangeContext=new te("SCMChangeContext"),te.SCMResourceContext=new te("SCMResourceContext"),te.SCMResourceContextShare=new te("SCMResourceContextShare"),te.SCMResourceFolderContext=new te("SCMResourceFolderContext"),te.SCMResourceGroupContext=new te("SCMResourceGroupContext"),te.SCMSourceControl=new te("SCMSourceControl"),te.SCMSourceControlInline=new te("SCMSourceControlInline"),te.SCMSourceControlTitle=new te("SCMSourceControlTitle"),te.SCMTitle=new te("SCMTitle"),te.SearchContext=new te("SearchContext"),te.SearchActionMenu=new te("SearchActionContext"),te.StatusBarWindowIndicatorMenu=new te("StatusBarWindowIndicatorMenu"),te.StatusBarRemoteIndicatorMenu=new te("StatusBarRemoteIndicatorMenu"),te.StickyScrollContext=new te("StickyScrollContext"),te.TestItem=new te("TestItem"),te.TestItemGutter=new te("TestItemGutter"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TouchBarContext=new te("TouchBarContext"),te.TitleBarContext=new te("TitleBarContext"),te.TitleBarTitleContext=new te("TitleBarTitleContext"),te.TunnelContext=new te("TunnelContext"),te.TunnelPrivacy=new te("TunnelPrivacy"),te.TunnelProtocol=new te("TunnelProtocol"),te.TunnelPortInline=new te("TunnelInline"),te.TunnelTitle=new te("TunnelTitle"),te.TunnelLocalAddressInline=new te("TunnelLocalAddressInline"),te.TunnelOriginInline=new te("TunnelOriginInline"),te.ViewItemContext=new te("ViewItemContext"),te.ViewContainerTitle=new te("ViewContainerTitle"),te.ViewContainerTitleContext=new te("ViewContainerTitleContext"),te.ViewTitle=new te("ViewTitle"),te.ViewTitleContext=new te("ViewTitleContext"),te.CommentEditorActions=new te("CommentEditorActions"),te.CommentThreadTitle=new te("CommentThreadTitle"),te.CommentThreadActions=new te("CommentThreadActions"),te.CommentThreadAdditionalActions=new te("CommentThreadAdditionalActions"),te.CommentThreadTitleContext=new te("CommentThreadTitleContext"),te.CommentThreadCommentContext=new te("CommentThreadCommentContext"),te.CommentTitle=new te("CommentTitle"),te.CommentActions=new te("CommentActions"),te.CommentsViewThreadActions=new te("CommentsViewThreadActions"),te.InteractiveToolbar=new te("InteractiveToolbar"),te.InteractiveCellTitle=new te("InteractiveCellTitle"),te.InteractiveCellDelete=new te("InteractiveCellDelete"),te.InteractiveCellExecute=new te("InteractiveCellExecute"),te.InteractiveInputExecute=new te("InteractiveInputExecute"),te.IssueReporter=new te("IssueReporter"),te.NotebookToolbar=new te("NotebookToolbar"),te.NotebookStickyScrollContext=new te("NotebookStickyScrollContext"),te.NotebookCellTitle=new te("NotebookCellTitle"),te.NotebookCellDelete=new te("NotebookCellDelete"),te.NotebookCellInsert=new te("NotebookCellInsert"),te.NotebookCellBetween=new te("NotebookCellBetween"),te.NotebookCellListTop=new te("NotebookCellTop"),te.NotebookCellExecute=new te("NotebookCellExecute"),te.NotebookCellExecuteGoTo=new te("NotebookCellExecuteGoTo"),te.NotebookCellExecutePrimary=new te("NotebookCellExecutePrimary"),te.NotebookDiffCellInputTitle=new te("NotebookDiffCellInputTitle"),te.NotebookDiffCellMetadataTitle=new te("NotebookDiffCellMetadataTitle"),te.NotebookDiffCellOutputsTitle=new te("NotebookDiffCellOutputsTitle"),te.NotebookOutputToolbar=new te("NotebookOutputToolbar"),te.NotebookOutlineFilter=new te("NotebookOutlineFilter"),te.NotebookOutlineActionMenu=new te("NotebookOutlineActionMenu"),te.NotebookEditorLayoutConfigure=new te("NotebookEditorLayoutConfigure"),te.NotebookKernelSource=new te("NotebookKernelSource"),te.BulkEditTitle=new te("BulkEditTitle"),te.BulkEditContext=new te("BulkEditContext"),te.TimelineItemContext=new te("TimelineItemContext"),te.TimelineTitle=new te("TimelineTitle"),te.TimelineTitleContext=new te("TimelineTitleContext"),te.TimelineFilterSubMenu=new te("TimelineFilterSubMenu"),te.AccountsContext=new te("AccountsContext"),te.SidebarTitle=new te("SidebarTitle"),te.PanelTitle=new te("PanelTitle"),te.AuxiliaryBarTitle=new te("AuxiliaryBarTitle"),te.AuxiliaryBarHeader=new te("AuxiliaryBarHeader"),te.TerminalInstanceContext=new te("TerminalInstanceContext"),te.TerminalEditorInstanceContext=new te("TerminalEditorInstanceContext"),te.TerminalNewDropdownContext=new te("TerminalNewDropdownContext"),te.TerminalTabContext=new te("TerminalTabContext"),te.TerminalTabEmptyAreaContext=new te("TerminalTabEmptyAreaContext"),te.TerminalStickyScrollContext=new te("TerminalStickyScrollContext"),te.WebviewContext=new te("WebviewContext"),te.InlineCompletionsActions=new te("InlineCompletionsActions"),te.InlineEditActions=new te("InlineEditActions"),te.NewFile=new te("NewFile"),te.MergeInput1Toolbar=new te("MergeToolbar1Toolbar"),te.MergeInput2Toolbar=new te("MergeToolbar2Toolbar"),te.MergeBaseToolbar=new te("MergeBaseToolbar"),te.MergeInputResultToolbar=new te("MergeToolbarResultToolbar"),te.InlineSuggestionToolbar=new te("InlineSuggestionToolbar"),te.InlineEditToolbar=new te("InlineEditToolbar"),te.ChatContext=new te("ChatContext"),te.ChatCodeBlock=new te("ChatCodeblock"),te.ChatCompareBlock=new te("ChatCompareBlock"),te.ChatMessageTitle=new te("ChatMessageTitle"),te.ChatExecute=new te("ChatExecute"),te.ChatExecuteSecondary=new te("ChatExecuteSecondary"),te.ChatInputSide=new te("ChatInputSide"),te.AccessibleView=new te("AccessibleView"),te.MultiDiffEditorFileToolbar=new te("MultiDiffEditorFileToolbar"),te.DiffEditorHunkToolbar=new te("DiffEditorHunkToolbar"),te.DiffEditorSelectionToolbar=new te("DiffEditorSelectionToolbar");let Te=te;const $8=class $8{static for(e){let t=this._all.get(e);return t||(t=new $8(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof $8&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};$8._all=new Map;let vT=$8;const Xs=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new wlt({merge:vT.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(vT.for(Te.CommandPalette)),Ee(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(vT.for(Te.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new td,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(vT.for(n)),Ee(()=>{i(),this._onDidChangeMenu.fire(vT.for(n))})}appendMenuItems(n){const e=new Z;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===Te.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)lR(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class uS extends u1{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let id=jY=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r,a){this.hideActions=s,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=jY.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&$e.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=$e.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new jY(t,void 0,i,s,void 0,r,a):void 0,this._options=i,this.class=c&&$e.asClassName(c)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};id=jY=D([_(5,Pe),_(6,ji)],id);class pi{constructor(e){this.desc=e}}function At(n){const e=[],t=new n,{f1:i,menu:s,keybinding:o,...r}=t.desc;if(yt.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(yt.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(s))for(const a of s)e.push(Xs.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else s&&e.push(Xs.appendMenuItem(s.id,{command:{...r,precondition:s.precondition===null?void 0:r.precondition},...s}));if(i&&(e.push(Xs.appendMenuItem(Te.CommandPalette,{command:r,when:r.precondition})),e.push(Xs.addCommand(r))),Array.isArray(o))for(const a of o)e.push(xr.registerKeybindingRule({...a,id:r.id,when:r.precondition?ge.and(r.precondition,a.when):a.when}));else o&&e.push(xr.registerKeybindingRule({...o,id:r.id,when:r.precondition?ge.and(r.precondition,o.when):o.when}));return{dispose(){St(e)}}}const rn=ae("telemetryService"),Igt=ae("customEndpointTelemetryService"),Ze=ae("logService"),wp=ae("loggerService"),BU="vs/editor/browser/editorExtensions";var mi;(function(n){n[n.Eager=0]="Eager",n[n.AfterFirstRender=1]="AfterFirstRender",n[n.BeforeFirstInteraction=2]="BeforeFirstInteraction",n[n.Eventually=3]="Eventually",n[n.Lazy=4]="Lazy"})(mi||(mi={}));let Jle=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=ge.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};xr.registerKeybindingRule(s)}}yt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Xs.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class Z1 extends Jle{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Pe).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return Jc.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class lt extends Jc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=Te.EditorContext),s.title||(s.title=e.label),s.when=ge.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(lt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(rn).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class yje extends lt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Pe),a=o.get(Ze);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(o,s,...t)})}}function nA(n,e){yt.registerCommand(n,function(t,...i){const s=t.get(be),[o,r]=i;Bt(P.isUri(o)),Bt(oe.isIPosition(r));const a=t.get(Ai).getModel(o);if(a){const c=oe.lift(r);return s.invokeFunction(e,a,c,...i.slice(2))}return t.get(Rn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=s.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function Ke(n){return sm.INSTANCE.registerEditorCommand(n),n}function Fe(n){const e=new n;return sm.INSTANCE.registerEditorAction(e),e}function Sje(n){return sm.INSTANCE.registerEditorAction(n),n}function Lgt(n){sm.INSTANCE.registerEditorAction(n)}function vn(n,e,t){sm.INSTANCE.registerEditorContribution(n,e,t)}function Aje(n,e){sm.INSTANCE.registerDiffEditorContribution(n,e)}var b_;(function(n){function e(r){return sm.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return sm.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return sm.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return sm.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return sm.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(b_||(b_={}));const Tgt={EditorCommonContributions:"editor.contributions"},oae=class oae{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}registerDiffEditorContribution(e,t){this.diffEditorContributions.push({id:e,ctor:t})}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};oae.INSTANCE=new oae;let sm=oae;it.add(Tgt.EditorCommonContributions,sm.INSTANCE);function rQ(n){return n.register(),n}const Eje=rQ(new Z1({id:"undo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyZ},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,0,"&&Undo"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,1,"Undo"),order:1}]}));rQ(new Cje(Eje,{id:"default:undo",precondition:void 0}));const xje=rQ(new Z1({id:"redo",precondition:void 0,kbOpts:{weight:ye.EditorCore,primary:V.CtrlCmd|E.KeyY,secondary:[V.CtrlCmd|V.Shift|E.KeyZ],mac:{primary:V.CtrlCmd|V.Shift|E.KeyZ}},menuOpts:[{menuId:Te.MenubarEditMenu,group:"1_do",title:g(BU,2,"&&Redo"),order:2},{menuId:Te.CommandPalette,group:"",title:g(BU,3,"Redo"),order:1}]}));rQ(new Cje(xje,{id:"default:redo",precondition:void 0}));const Rgt=rQ(new Z1({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:null,primary:V.CtrlCmd|E.KeyA},menuOpts:[{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(BU,4,"&&Select All"),order:1},{menuId:Te.CommandPalette,group:"",title:g(BU,5,"Select All"),order:1}]})),Mgt="$initialize";let y2e=!1;function Nve(n){Jn&&(y2e||(y2e=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}var qp;(function(n){n[n.Request=0]="Request",n[n.Reply=1]="Reply",n[n.SubscribeEvent=2]="SubscribeEvent",n[n.Event=3]="Event",n[n.UnsubscribeEvent=4]="UnsubscribeEvent"})(qp||(qp={}));class Ngt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=qp.Request}}class S2e{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=qp.Reply}}class Pgt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=qp.SubscribeEvent}}class Fgt{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=qp.Event}}class Ogt{constructor(e,t){this.vsWorker=e,this.req=t,this.type=qp.UnsubscribeEvent}}class Bgt{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new Ngt(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Pgt(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Ogt(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case qp.Reply:return this._handleReplyMessage(e);case qp.Request:return this._handleRequestMessage(e);case qp.SubscribeEvent:return this._handleSubscribeEventMessage(e);case qp.Event:return this._handleEventMessage(e);case qp.UnsubscribeEvent:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new S2e(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=EU(s.detail)),this._send(new S2e(this._workerId,t,void 0,EU(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new Fgt(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===qp.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{s?.(l)})),this._protocol=new Bgt({sendMessage:(l,d)=>{this._worker.postMessage(l,d)},handleMessage:(l,d)=>{if(typeof i[l]!="function")return Promise.reject(new Error("Missing method "+l+" on main thread host."));try{return Promise.resolve(i[l].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(l,d)=>{if(kje(l)){const h=i[l].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${l} on main thread host.`);return h}if(Dje(l)){const h=i[l];if(typeof h!="function")throw new Error(`Missing event ${l} on main thread host.`);return h}throw new Error(`Malformed event name ${l}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const r=ORe(i);this._onModuleLoaded=this._protocol.sendMessage(Mgt,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(l,d)=>this._request(l,d),c=(l,d)=>this._protocol.listen(l,d);this._lazyProxy=new Promise((l,d)=>{s=d,this._onModuleLoaded.then(h=>{l(Hgt(h,a,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function Dje(n){return n[0]==="o"&&n[1]==="n"&&fy(n.charCodeAt(2))}function kje(n){return/^onDynamic/.test(n)&&fy(n.charCodeAt(9))}function Hgt(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(kje(r)){o[r]=s(r);continue}if(Dje(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function Jx(n,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(i){bt(i);return}try{return yi.trustedTypes?.createPolicy(n,e)}catch(i){bt(i);return}}const A2e=Jx("defaultWorkerFactory",{createScriptURL:n=>n});function Ugt(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(A2e?A2e.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Vgt(n){return typeof n.then=="function"}class zgt extends ${constructor(e,t,i,s,o){super(),this.id=t,this.label=i;const r=Ugt(i);Vgt(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){s(c.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",o),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(s){bt(s),bt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:s}))}})}}const rae=class rae{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++rae.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new zgt(e,s,this._label||"anonymous"+s,t,o=>{Nve(o),this._webWorkerFailedBeforeError=o,i(o)})}};rae.LAST_WORKER_ID=0;let Pve=rae;var Ga;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ga||(Ga={}));class Fge{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew Fge(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Fge({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Fge({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `,YT.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `,YT.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` - `;let Fve=YT;function dR(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),s=n.getLanguageId(i);let o=i;for(;o+10&&n.getLanguageId(r-1)===s;)r--;return new Ggt(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class Ggt{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}var Ove;(function(n){n[n.value=3]="value"})(Ove||(Ove={}));function EC(n){return(n&Ove.value)!==0}function KY(n){const e=n;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Oge(n){const e=n;return e?KY(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function Xx(n,e){return new qgt(n,e)}class qgt{constructor(e,t){this.reducer=e,this.options=t,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(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?bt(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let i;switch(e){case"data":i=this.listeners.data;break;case"end":i=this.listeners.end;break;case"error":i=this.listeners.error;break}if(i){const s=i.indexOf(t);s>=0&&i.splice(s,1)}}flowData(){if(this.buffer.data.length>0){const e=this.reducer(this.buffer.data);this.emitData(e),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(i=>i())}}flowErrors(){if(this.listeners.error.length>0){for(const e of this.buffer.error)this.emitError(e);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 Qgt(n,e){const t=[];let i;for(;(i=n.read())!==null;)t.push(i);return e(t)}function jgt(n,e,t){const i=[];let s;for(;(s=n.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof s<"u"){const o=s;return s=void 0,o}return n.read()}}}function gMe(n,e){return new Promise((t,i)=>{const s=[];hO(n,{onData:o=>{e&&s.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(s):void 0)}})})}function hO(n,e,t){n.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),n.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),n.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function Kgt(n,e){return new Promise((t,i)=>{const s=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return s.dispose(),n.pause(),t({stream:n,buffer:o,ended:!1})},a=l=>(s.dispose(),i(l)),c=()=>(s.dispose(),t({stream:n,buffer:o,ended:!0}));s.add(Ee(()=>n.removeListener("error",a))),n.on("error",a),s.add(Ee(()=>n.removeListener("end",c))),n.on("end",c),s.add(Ee(()=>n.removeListener("data",r))),n.on("data",r)})}function Ygt(n,e){const t=Xx(e);return t.end(n),t}function Jgt(n){let e=!1;return{read:()=>e?null:(e=!0,n)}}function Xgt(n,e,t){const i=Xx(t);return hO(n,{onData:s=>i.write(e.data(s)),onError:s=>i.error(e.error?e.error(s):s),onEnd:()=>i.end()}),i}const wj=typeof Buffer<"u",Zgt=new Ka(()=>new Uint8Array(256));let Bge,Wge;class ze{static alloc(e){return wj?new ze(Buffer.allocUnsafe(e)):new ze(new Uint8Array(e))}static wrap(e){return wj&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new ze(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&wj?new ze(Buffer.from(e)):(Bge||(Bge=new TextEncoder),new ze(Bge.encode(e)))}static fromByteArray(e){const t=ze.alloc(e.length);for(let i=0,s=e.length;i"u"){t=0;for(let o=0,r=e.length;os-t)return-1;const o=Zgt.value;o.fill(e.length);for(let l=0;l>>0|n[e+1]<<8>>>0}function ift(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Bg(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function Wg(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function nft(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0|n[e+2]<<16>>>0|n[e+3]<<24>>>0}function sft(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255,e=e>>>8,n[t+2]=e&255,e=e>>>8,n[t+3]=e&255}function Bve(n,e){return n[e]}function Wve(n,e,t){n[t]=e}function oft(n){return Qgt(n,e=>ze.concat(e))}function Ije(n){return Jgt(n)}function II(n){return gMe(n,e=>ze.concat(e))}async function rft(n){return n.ended?ze.concat(n.buffer):ze.concat([...n.buffer,await II(n.stream)])}function aQ(n){return Ygt(n,e=>ze.concat(e))}function Lje(n){return Xx(e=>ze.concat(e),n)}function Tje(n){let e=0,t=0,i=0;const s=new Uint8Array(Math.floor(n.length/4*3)),o=a=>{switch(t){case 3:s[i++]=e|a,t=0;break;case 2:s[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:s[i++]=e|a>>>4,e=a<<4,t=2;break;default:e=a<<2,t=1}};for(let a=0;a=65&&c<=90)o(c-65);else if(c>=97&&c<=122)o(c-97+26);else if(c>=48&&c<=57)o(c-48+52);else if(c===43||c===45)o(62);else if(c===47||c===95)o(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${n[a]}`)}}const r=i;for(;t>0;)o(0);return ze.wrap(s).slice(0,r)}const aft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function fMe({buffer:n},e=!0,t=!1){const i=t?cft:aft;let s="";const o=n.byteLength%3;let r=0;for(;r>>2],s+=i[(a<<4|c>>>4)&63],s+=i[(c<<2|l>>>6)&63],s+=i[l&63]}if(o===1){const a=n[r+0];s+=i[a>>>2],s+=i[a<<4&63],e&&(s+="==")}else if(o===2){const a=n[r+0],c=n[r+1];s+=i[a>>>2],s+=i[(a<<4|c>>>4)&63],s+=i[c<<2&63],e&&(s+="=")}return s}let Hge;function Rje(){return Hge||(Hge=new TextDecoder("UTF-16LE")),Hge}let Uge;function lft(){return Uge||(Uge=new TextDecoder("UTF-16BE")),Uge}let Vge;function Mje(){return Vge||(Vge=URe()?Rje():lft()),Vge}function dft(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?hft(n,e,t):Rje().decode(i)}function hft(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[c,l]=r,[d,h]=a;return c===d||c===h||l===d||l===h},s=(r,a)=>{const c=Math.min(r,a),l=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:c})}return o}class gft{constructor(e,t){this._richEditBracketsBrand=void 0;const i=uft(t);this.brackets=i.map((s,o)=>new SZ(e,o,s.open,s.close,fft(s.open,s.close,i,o),pft(s.open,s.close,i,o))),this.forwardRegex=mft(this.brackets),this.reversedRegex=_ft(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Nje(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function Pje(n,e){return n.length-e.length}function Xle(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function fft(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return Mje().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class Y_{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=s+r;return new O(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,s,o){const a=pMe(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const c=s+r;return new O(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class wft{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return Lc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(EC(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Y_.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const c=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}var Pb;(function(n){n[n.INCREASE_MASK=1]="INCREASE_MASK",n[n.DECREASE_MASK=2]="DECREASE_MASK",n[n.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",n[n.UNINDENT_MASK=8]="UNINDENT_MASK"})(Pb||(Pb={}));function bj(n){return n.global&&(n.lastIndex=0),!0}class bft{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&bj(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&bj(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&bj(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&bj(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=Pb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=Pb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=Pb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=Pb.UNINDENT_MASK),t}}class VB{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=VB._createOpenBracketRegExp(t[0]),s=VB._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=ed.Advanced)for(let o=0,r=this._regExpRules.length;ol.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=ed.Brackets&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=ed.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function xft(n){return n.replace(/[\[\]]/g,"")}const eL={JSONContribution:"base.contributions.json"};function Dft(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class kft{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Dft(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}}const Ift=new kft;it.add(eL.JSONContribution,Ift);const my="vs/platform/configuration/common/configurationRegistry";var E2e;(function(n){n.Multiline="multilineText",n.Singleline="singlelineText"})(E2e||(E2e={}));const Cs={Configuration:"base.contributions.configuration"};var ut;(function(n){n[n.APPLICATION=1]="APPLICATION",n[n.MACHINE=2]="MACHINE",n[n.WINDOW=3]="WINDOW",n[n.RESOURCE=4]="RESOURCE",n[n.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",n[n.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(ut||(ut={}));const Wf={properties:{},patternProperties:{}},l3={properties:{},patternProperties:{}},zB={properties:{},patternProperties:{}},nE={properties:{},patternProperties:{}},sE={properties:{},patternProperties:{}},vb={properties:{},patternProperties:{}},ED="vscode://schemas/settings/resourceLanguage",Hje="vscode://schemas/settings/configurationDefaults",Cj=it.as(eL.JSONContribution);class Lft{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new I,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new I,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:g(my,0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){const i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){const i=[];for(const{overrides:s,source:o}of e)for(const r in s)if(t.add(r),dp.test(r)){const a=this.configurationDefaultsOverrides.get(r),c=a?.valuesSources??new Map;if(o)for(const u of Object.keys(s[r]))c.set(u,o);const l={...a?.value||{},...s[r]};this.configurationDefaultsOverrides.set(r,{source:o,value:l,valuesSources:c});const d=xft(r),h={type:"object",default:l,description:g(my,1,"Configure settings to be overridden for the {0} language.",d),$ref:ED,defaultDefaultValue:l,source:zt(o)?void 0:o,defaultValueSource:o};i.push(...H9(r)),this.configurationProperties[r]=h,this.defaultLanguageConfigurationOverridesNode.properties[r]=h}else{this.configurationDefaultsOverrides.set(r,{value:s[r],source:o});const a=this.configurationProperties[r];a&&(this.updatePropertyDefaultValue(r,a),this.updateSchema(r,a))}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){const t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(const{overrides:i,source:s}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o),a=zt(s)?s:s?.id,c=zt(r?.source)?r?.source:r?.source?.id;if(a===c)if(t.add(o),this.configurationDefaultsOverrides.delete(o),dp.test(o))delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o];else{const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}}this.updateOverridePropertyPatternKey()}deltaConfiguration(e){let t=!1;const i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}doDeregisterConfigurations(e,t){const i=s=>{if(s.properties)for(const o in s.properties){t.add(o);const r=this.configurationProperties[o];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[o],this.removeFromSchema(o,s.properties[o])}s.allOf?.forEach(o=>i(o))};for(const s of e){i(s);const o=this.configurationContributors.indexOf(s);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,s,o=ut.WINDOW,r){o=dc(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&$je(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),dp.test(l)?d.scope=void 0:(d.scope=dc(d.scope)?o:d.scope,d.restricted=dc(d.restricted)?!!s?.includes(l):d.restricted),a[l].hasOwnProperty("included")&&!a[l].included){this.excludedConfigurationProperties[l]=a[l],delete a[l];continue}else this.configurationProperties[l]=a[l],a[l].policy?.name&&this.policyConfigurations.set(a[l].policy.name,l);!a[l].deprecationMessage&&a[l].markdownDeprecationMessage&&(a[l].deprecationMessage=a[l].markdownDeprecationMessage),r.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,s,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getConfigurationDefaultsOverrides(){return this.configurationDefaultsOverrides}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Wf.properties[e]=t,t.scope){case ut.APPLICATION:l3.properties[e]=t;break;case ut.MACHINE:zB.properties[e]=t;break;case ut.MACHINE_OVERRIDABLE:nE.properties[e]=t;break;case ut.WINDOW:sE.properties[e]=t;break;case ut.RESOURCE:vb.properties[e]=t;break;case ut.LANGUAGE_OVERRIDABLE:vb.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Wf.properties[e],t.scope){case ut.APPLICATION:delete l3.properties[e];break;case ut.MACHINE:delete zB.properties[e];break;case ut.MACHINE_OVERRIDABLE:delete nE.properties[e];break;case ut.WINDOW:delete sE.properties[e];break;case ut.RESOURCE:case ut.LANGUAGE_OVERRIDABLE:delete vb.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};this.updatePropertyDefaultValue(t,i),Wf.properties[t]=i,l3.properties[t]=i,zB.properties[t]=i,nE.properties[t]=i,sE.properties[t]=i,vb.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};Wf.patternProperties[KD]=e,l3.patternProperties[KD]=e,zB.patternProperties[KD]=e,nE.patternProperties[KD]=e,sE.patternProperties[KD]=e,vb.patternProperties[KD]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i?.value,o=i?.source;ll(s)&&(s=t.defaultDefaultValue,o=void 0),ll(s)&&(s=zje(t.type)),t.default=s,t.defaultValueSource=o}}const Uje="\\[([^\\]]+)\\]",x2e=new RegExp(Uje,"g"),KD=`^(${Uje})+$`,dp=new RegExp(KD);function H9(n){const e=[];if(dp.test(n)){let t=x2e.exec(n);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=x2e.exec(n)}}return Lc(e)}function Vje(n){return n.reduce((e,t)=>`${e}[${t}]`,"")}function zje(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const g$=new Lft;it.add(Cs.Configuration,g$);function $je(n,e){return n.trim()?dp.test(n)?g(my,5,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):g$.getConfigurationProperties()[n]!==void 0?g(my,6,"Cannot register '{0}'. This property is already registered.",n):e.policy?.name&&g$.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(my,7,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,e.policy?.name,g$.getPolicyConfigurations().get(e.policy?.name)):null:g(my,4,"Cannot register an empty property")}function Tft(){const n=[],e=g$.getConfigurationProperties();for(const t of Object.keys(e))n.push([t,e[t].scope]);return n.push(["launch",ut.RESOURCE]),n.push(["task",ut.RESOURCE]),n}const Rft="vs/editor/common/languages/modesRegistry",Mft={ModesRegistry:"editor.modesRegistry"};class Nft{constructor(){this._onDidChangeLanguages=new I,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const c=new Set;return{info:new Fft(this,a,c),closing:c}}),o=new tZ(a=>{const c=new Set,l=new Set;return{info:new Oft(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?D2e(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.openingColorized.add(l.info),d.opening.add(l.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,c])=>[a,c.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,c])=>[a,c.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return cQ(t,e)}}function D2e(n){return n.filter(([e,t])=>e!==""&&t!=="")}class qje{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Fft extends qje{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Oft extends qje{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}class $ge{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const lo=ae("languageConfigurationService");let Uve=class extends ${constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Uft),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Vve));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new $ge(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new $ge(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new $ge(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Bft(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Uve=D([_(0,Re),_(1,Di)],Uve);function Bft(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new EW(n,{});s=new EW(n,{})}const o=Wft(s.languageId,t),r=jje([s.underlyingConfig,o]);return new EW(s.languageId,r)}const Vve={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Wft(n,e){const t=e.getValue(Vve.brackets,{overrideIdentifier:n}),i=e.getValue(Vve.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:k2e(t),colorizedBracketPairs:k2e(i)}}function k2e(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Qje(n,e,t){const i=n.getLineContent(e);let s=Uo(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}class Hft{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new I2e(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let s=0;se.configuration)))}}function jje(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class I2e{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class L2e{constructor(e){this.languageId=e}}class Uft extends ${constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Kc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new Hft(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new L2e(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new L2e(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class EW{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new VB(this.underlyingConfig):null,this.comments=EW._handleComments(this.underlyingConfig),this.characterPair=new Fve(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||QRe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new bft(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Pft(e,this.underlyingConfig)}getWordDefinition(){return zq(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new gft(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new wft(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new $gt(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ce(lo,Uve,Kt.Delayed);class xD{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class T2e{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new xD(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Zn.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Zn.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class wy{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=wy._getElements(e),[a,c,l]=wy._getElements(t);this._hasStrings=r&&l,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(wy._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let h;return i<=s?(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new xD(e,0,i,s-i+1)]):e<=t?(BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[new xD(e,t-e+1,i,0)]):(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,s,r,a,o),l=r[0],d=a[0];if(c!==null)return c;if(!o[0]){const h=this.ComputeDiffRecursive(e,l,i,d,o);let u=[];return o[0]?u=[new xD(l+1,t-(l+1)+1,d+1,s-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,s,o),this.ConcatenateChanges(h,u)}return[new xD(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){let C=null,y=null,S=new R2e,M=t,k=i,F=f[0]-v[0]-s,N=Zn.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const U=F+e;U===M||U=0&&(l=this.m_forwardHistory[z],e=l[0],M=1,k=l.length-1)}while(--z>=-1);if(C=S.getReverseChanges(),b[0]){let U=f[0]+1,J=v[0]+1;if(C!==null&&C.length>0){const j=C[C.length-1];U=Math.max(U,j.getOriginalEnd()),J=Math.max(J,j.getModifiedEnd())}y=[new xD(U,u-U+1,J,m-J+1)]}else{S=new R2e,M=r,k=a,F=f[0]-v[0]-c,N=Zn.MAX_SAFE_SMALL_INTEGER,z=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const U=F+o;U===M||U=d[U+1]?(h=d[U+1]-1,p=h-F-c,h>N&&S.MarkNextChange(),N=h+1,S.AddOriginalElement(h+1,p+1),F=U+1-o):(h=d[U-1],p=h-F-c,h>N&&S.MarkNextChange(),N=h,S.AddModifiedElement(h+1,p+1),F=U-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],M=1,k=d.length-1)}while(--z>=-1);y=S.getChanges()}return this.ConcatenateChanges(C,y)}ComputeRecursionPoint(e,t,i,s,o,r,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(s-i),m=p+1,v=new Int32Array(m),w=new Int32Array(m),b=s-i,C=t-e,y=e-i,S=t-s,k=(C-b)%2===0;v[b]=e,w[C]=t,a[0]=!1;for(let F=1;F<=p/2+1;F++){let N=0,z=0;d=this.ClipDiagonalBound(b-F,F,b,m),h=this.ClipDiagonalBound(b+F,F,b,m);for(let J=d;J<=h;J+=2){J===d||JN+z&&(N=c,z=l),!k&&Math.abs(J-C)<=F-1&&c>=w[J])return o[0]=c,r[0]=l,j<=w[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}const U=(N-e+(z-i)-F)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,U))return a[0]=!0,o[0]=N,r[0]=z,U>0&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):(e++,i++,[new xD(e,t-e+1,i,s-i+1)]);u=this.ClipDiagonalBound(C-F,F,C,m),f=this.ClipDiagonalBound(C+F,F,C,m);for(let J=u;J<=f;J+=2){J===u||J=w[J+1]?c=w[J+1]-1:c=w[J-1],l=c-(J-C)-S;const j=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(w[J]=c,k&&Math.abs(J-b)<=F&&c<=v[J])return o[0]=c,r[0]=l,j>=v[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}if(F<=bA.MaxDifferencesHistory){let J=new Int32Array(h-d+2);J[0]=b-d+1,WO.Copy2(v,d,J,1,h-d+1),this.m_forwardHistory.push(J),J=new Int32Array(f-u+2),J[0]=C-u+1,WO.Copy2(w,u,J,1,f-u+1),this.m_reverseHistory.push(J)}}return this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const h=e[t-1];s=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let c=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,f=i.modifiedStart-h;if(ul&&(l=m,c=h)}i.originalStart-=c,i.modifiedStart-=c;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>c&&(c=f,l=h,d=u)}return c>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return WO.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],WO.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return WO.Copy(e,0,s,0,e.length),WO.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(BO.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),BO.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new xD(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=PO(e),t=PO(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=PO(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new Kje(s,e-r)}}class $ft{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Kje(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Uq(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var f$;(function(n){n[n.False=0]="False",n[n.True=1]="True"})(f$||(f$={}));class EZ{constructor(){this._actual=new pz(f$.False)}add(e){this._actual.set(e,f$.True)}has(e){return this._actual.get(e)===f$.True}clear(){return this._actual.clear()}}var Oi;(function(n){n[n.Invalid=0]="Invalid",n[n.Start=1]="Start",n[n.H=2]="H",n[n.HT=3]="HT",n[n.HTT=4]="HTT",n[n.HTTP=5]="HTTP",n[n.F=6]="F",n[n.FI=7]="FI",n[n.FIL=8]="FIL",n[n.BeforeColon=9]="BeforeColon",n[n.AfterColon=10]="AfterColon",n[n.AlmostThere=11]="AlmostThere",n[n.End=12]="End",n[n.Accept=13]="Accept",n[n.LastKnownState=14]="LastKnownState"})(Oi||(Oi={}));class Gft{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const s=new Gft(i,t,Oi.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Oi.Invalid:this._states.get(e,t)}}let Gge=null;function qft(){return Gge===null&&(Gge=new Jje([[Oi.Start,q.h,Oi.H],[Oi.Start,q.H,Oi.H],[Oi.Start,q.f,Oi.F],[Oi.Start,q.F,Oi.F],[Oi.H,q.t,Oi.HT],[Oi.H,q.T,Oi.HT],[Oi.HT,q.t,Oi.HTT],[Oi.HT,q.T,Oi.HTT],[Oi.HTT,q.p,Oi.HTTP],[Oi.HTT,q.P,Oi.HTTP],[Oi.HTTP,q.s,Oi.BeforeColon],[Oi.HTTP,q.S,Oi.BeforeColon],[Oi.HTTP,q.Colon,Oi.AfterColon],[Oi.F,q.i,Oi.FI],[Oi.F,q.I,Oi.FI],[Oi.FI,q.l,Oi.FIL],[Oi.FI,q.L,Oi.FIL],[Oi.FIL,q.e,Oi.BeforeColon],[Oi.FIL,q.E,Oi.BeforeColon],[Oi.BeforeColon,q.Colon,Oi.AfterColon],[Oi.AfterColon,q.Slash,Oi.AlmostThere],[Oi.AlmostThere,q.Slash,Oi.End]])),Gge}var oc;(function(n){n[n.None=0]="None",n[n.ForceTermination=1]="ForceTermination",n[n.CannotEndIn=2]="CannotEndIn"})(oc||(oc={}));let r5=null;function Qft(){if(r5===null){r5=new pz(oc.None);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),c=t.charCodeAt(r);(a===q.OpenParen&&c===q.CloseParen||a===q.OpenSquareBracket&&c===q.CloseSquareBracket||a===q.OpenCurlyBrace&&c===q.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=qft()){const i=Qft(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),c=a.length;let l=0,d=0,h=0,u=Oi.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}};aae.INSTANCE=new aae;let zve=aae;var da;(function(n){n[n.Regular=0]="Regular",n[n.Whitespace=1]="Whitespace",n[n.WordSeparator=2]="WordSeparator"})(da||(da={}));class Kft extends pz{constructor(e,t){super(da.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,s=e.length;it)break;i=s}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=vQe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Jft(t,this.wordSeparators?R_(this.wordSeparators,[]):null,i?this.searchString:null)}}function Xje(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===q.n||s===q.r||s===q.W)return!0}}return!1}function wT(n,e,t){if(!t)return new z9(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class yj{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new $B(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,c=0;s?(c=s.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-c;l=a+r.length+f}else l=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(l);return new O(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,xo.LF),c=e.getEOL()===`\r + `;let Fve=YT;function dR(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),s=n.getLanguageId(i);let o=i;for(;o+10&&n.getLanguageId(r-1)===s;)r--;return new Ggt(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class Ggt{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}var Ove;(function(n){n[n.value=3]="value"})(Ove||(Ove={}));function EC(n){return(n&Ove.value)!==0}function KY(n){const e=n;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Oge(n){const e=n;return e?KY(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function Xx(n,e){return new qgt(n,e)}class qgt{constructor(e,t){this.reducer=e,this.options=t,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(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?bt(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let i;switch(e){case"data":i=this.listeners.data;break;case"end":i=this.listeners.end;break;case"error":i=this.listeners.error;break}if(i){const s=i.indexOf(t);s>=0&&i.splice(s,1)}}flowData(){if(this.buffer.data.length>0){const e=this.reducer(this.buffer.data);this.emitData(e),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(i=>i())}}flowErrors(){if(this.listeners.error.length>0){for(const e of this.buffer.error)this.emitError(e);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 Qgt(n,e){const t=[];let i;for(;(i=n.read())!==null;)t.push(i);return e(t)}function jgt(n,e,t){const i=[];let s;for(;(s=n.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof s<"u"){const o=s;return s=void 0,o}return n.read()}}}function gMe(n,e){return new Promise((t,i)=>{const s=[];hO(n,{onData:o=>{e&&s.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(s):void 0)}})})}function hO(n,e,t){n.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),n.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),n.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function Kgt(n,e){return new Promise((t,i)=>{const s=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return s.dispose(),n.pause(),t({stream:n,buffer:o,ended:!1})},a=l=>(s.dispose(),i(l)),c=()=>(s.dispose(),t({stream:n,buffer:o,ended:!0}));s.add(Ee(()=>n.removeListener("error",a))),n.on("error",a),s.add(Ee(()=>n.removeListener("end",c))),n.on("end",c),s.add(Ee(()=>n.removeListener("data",r))),n.on("data",r)})}function Ygt(n,e){const t=Xx(e);return t.end(n),t}function Jgt(n){let e=!1;return{read:()=>e?null:(e=!0,n)}}function Xgt(n,e,t){const i=Xx(t);return hO(n,{onData:s=>i.write(e.data(s)),onError:s=>i.error(e.error?e.error(s):s),onEnd:()=>i.end()}),i}const wj=typeof Buffer<"u",Zgt=new Ka(()=>new Uint8Array(256));let Bge,Wge;class ze{static alloc(e){return wj?new ze(Buffer.allocUnsafe(e)):new ze(new Uint8Array(e))}static wrap(e){return wj&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new ze(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&wj?new ze(Buffer.from(e)):(Bge||(Bge=new TextEncoder),new ze(Bge.encode(e)))}static fromByteArray(e){const t=ze.alloc(e.length);for(let i=0,s=e.length;i"u"){t=0;for(let o=0,r=e.length;os-t)return-1;const o=Zgt.value;o.fill(e.length);for(let l=0;l>>0|n[e+1]<<8>>>0}function ift(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Bg(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function Wg(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function nft(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0|n[e+2]<<16>>>0|n[e+3]<<24>>>0}function sft(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255,e=e>>>8,n[t+2]=e&255,e=e>>>8,n[t+3]=e&255}function Bve(n,e){return n[e]}function Wve(n,e,t){n[t]=e}function oft(n){return Qgt(n,e=>ze.concat(e))}function Ije(n){return Jgt(n)}function II(n){return gMe(n,e=>ze.concat(e))}async function rft(n){return n.ended?ze.concat(n.buffer):ze.concat([...n.buffer,await II(n.stream)])}function aQ(n){return Ygt(n,e=>ze.concat(e))}function Lje(n){return Xx(e=>ze.concat(e),n)}function Tje(n){let e=0,t=0,i=0;const s=new Uint8Array(Math.floor(n.length/4*3)),o=a=>{switch(t){case 3:s[i++]=e|a,t=0;break;case 2:s[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:s[i++]=e|a>>>4,e=a<<4,t=2;break;default:e=a<<2,t=1}};for(let a=0;a=65&&c<=90)o(c-65);else if(c>=97&&c<=122)o(c-97+26);else if(c>=48&&c<=57)o(c-48+52);else if(c===43||c===45)o(62);else if(c===47||c===95)o(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${n[a]}`)}}const r=i;for(;t>0;)o(0);return ze.wrap(s).slice(0,r)}const aft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function fMe({buffer:n},e=!0,t=!1){const i=t?cft:aft;let s="";const o=n.byteLength%3;let r=0;for(;r>>2],s+=i[(a<<4|c>>>4)&63],s+=i[(c<<2|l>>>6)&63],s+=i[l&63]}if(o===1){const a=n[r+0];s+=i[a>>>2],s+=i[a<<4&63],e&&(s+="==")}else if(o===2){const a=n[r+0],c=n[r+1];s+=i[a>>>2],s+=i[(a<<4|c>>>4)&63],s+=i[c<<2&63],e&&(s+="=")}return s}let Hge;function Rje(){return Hge||(Hge=new TextDecoder("UTF-16LE")),Hge}let Uge;function lft(){return Uge||(Uge=new TextDecoder("UTF-16BE")),Uge}let Vge;function Mje(){return Vge||(Vge=URe()?Rje():lft()),Vge}function dft(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?hft(n,e,t):Rje().decode(i)}function hft(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[c,l]=r,[d,h]=a;return c===d||c===h||l===d||l===h},s=(r,a)=>{const c=Math.min(r,a),l=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:c})}return o}class gft{constructor(e,t){this._richEditBracketsBrand=void 0;const i=uft(t);this.brackets=i.map((s,o)=>new SZ(e,o,s.open,s.close,fft(s.open,s.close,i,o),pft(s.open,s.close,i,o))),this.forwardRegex=mft(this.brackets),this.reversedRegex=_ft(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Nje(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function Pje(n,e){return n.length-e.length}function Xle(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function fft(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return Mje().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class Y_{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=s+r;return new O(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,s,o){const a=pMe(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const c=s+r;return new O(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class wft{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return Lc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(EC(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Y_.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const c=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}var Pb;(function(n){n[n.INCREASE_MASK=1]="INCREASE_MASK",n[n.DECREASE_MASK=2]="DECREASE_MASK",n[n.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",n[n.UNINDENT_MASK=8]="UNINDENT_MASK"})(Pb||(Pb={}));function bj(n){return n.global&&(n.lastIndex=0),!0}class bft{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&bj(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&bj(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&bj(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&bj(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=Pb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=Pb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=Pb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=Pb.UNINDENT_MASK),t}}class VB{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=VB._createOpenBracketRegExp(t[0]),s=VB._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=ed.Advanced)for(let o=0,r=this._regExpRules.length;ol.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=ed.Brackets&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=ed.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function xft(n){return n.replace(/[\[\]]/g,"")}const eL={JSONContribution:"base.contributions.json"};function Dft(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class kft{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Dft(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}}const Ift=new kft;it.add(eL.JSONContribution,Ift);const my="vs/platform/configuration/common/configurationRegistry";var E2e;(function(n){n.Multiline="multilineText",n.Singleline="singlelineText"})(E2e||(E2e={}));const Cs={Configuration:"base.contributions.configuration"};var ut;(function(n){n[n.APPLICATION=1]="APPLICATION",n[n.MACHINE=2]="MACHINE",n[n.WINDOW=3]="WINDOW",n[n.RESOURCE=4]="RESOURCE",n[n.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",n[n.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(ut||(ut={}));const Wf={properties:{},patternProperties:{}},l3={properties:{},patternProperties:{}},zB={properties:{},patternProperties:{}},nE={properties:{},patternProperties:{}},sE={properties:{},patternProperties:{}},vb={properties:{},patternProperties:{}},ED="vscode://schemas/settings/resourceLanguage",Hje="vscode://schemas/settings/configurationDefaults",Cj=it.as(eL.JSONContribution);class Lft{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new I,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new I,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:g(my,0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){const i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),Cj.registerSchema(ED,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){const i=[];for(const{overrides:s,source:o}of e)for(const r in s)if(t.add(r),dp.test(r)){const a=this.configurationDefaultsOverrides.get(r),c=a?.valuesSources??new Map;if(o)for(const u of Object.keys(s[r]))c.set(u,o);const l={...a?.value||{},...s[r]};this.configurationDefaultsOverrides.set(r,{source:o,value:l,valuesSources:c});const d=xft(r),h={type:"object",default:l,description:g(my,1,"Configure settings to be overridden for the {0} language.",d),$ref:ED,defaultDefaultValue:l,source:zt(o)?void 0:o,defaultValueSource:o};i.push(...H9(r)),this.configurationProperties[r]=h,this.defaultLanguageConfigurationOverridesNode.properties[r]=h}else{this.configurationDefaultsOverrides.set(r,{value:s[r],source:o});const a=this.configurationProperties[r];a&&(this.updatePropertyDefaultValue(r,a),this.updateSchema(r,a))}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){const t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(const{overrides:i,source:s}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o),a=zt(s)?s:s?.id,c=zt(r?.source)?r?.source:r?.source?.id;if(a===c)if(t.add(o),this.configurationDefaultsOverrides.delete(o),dp.test(o))delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o];else{const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}}this.updateOverridePropertyPatternKey()}deltaConfiguration(e){let t=!1;const i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}doDeregisterConfigurations(e,t){const i=s=>{if(s.properties)for(const o in s.properties){t.add(o);const r=this.configurationProperties[o];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[o],this.removeFromSchema(o,s.properties[o])}s.allOf?.forEach(o=>i(o))};for(const s of e){i(s);const o=this.configurationContributors.indexOf(s);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,s,o=ut.WINDOW,r){o=hc(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&$je(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),dp.test(l)?d.scope=void 0:(d.scope=hc(d.scope)?o:d.scope,d.restricted=hc(d.restricted)?!!s?.includes(l):d.restricted),a[l].hasOwnProperty("included")&&!a[l].included){this.excludedConfigurationProperties[l]=a[l],delete a[l];continue}else this.configurationProperties[l]=a[l],a[l].policy?.name&&this.policyConfigurations.set(a[l].policy.name,l);!a[l].deprecationMessage&&a[l].markdownDeprecationMessage&&(a[l].deprecationMessage=a[l].markdownDeprecationMessage),r.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,s,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getConfigurationDefaultsOverrides(){return this.configurationDefaultsOverrides}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Wf.properties[e]=t,t.scope){case ut.APPLICATION:l3.properties[e]=t;break;case ut.MACHINE:zB.properties[e]=t;break;case ut.MACHINE_OVERRIDABLE:nE.properties[e]=t;break;case ut.WINDOW:sE.properties[e]=t;break;case ut.RESOURCE:vb.properties[e]=t;break;case ut.LANGUAGE_OVERRIDABLE:vb.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Wf.properties[e],t.scope){case ut.APPLICATION:delete l3.properties[e];break;case ut.MACHINE:delete zB.properties[e];break;case ut.MACHINE_OVERRIDABLE:delete nE.properties[e];break;case ut.WINDOW:delete sE.properties[e];break;case ut.RESOURCE:case ut.LANGUAGE_OVERRIDABLE:delete vb.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};this.updatePropertyDefaultValue(t,i),Wf.properties[t]=i,l3.properties[t]=i,zB.properties[t]=i,nE.properties[t]=i,sE.properties[t]=i,vb.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(my,2,"Configure editor settings to be overridden for a language."),errorMessage:g(my,3,"This setting does not support per-language configuration."),$ref:ED};Wf.patternProperties[KD]=e,l3.patternProperties[KD]=e,zB.patternProperties[KD]=e,nE.patternProperties[KD]=e,sE.patternProperties[KD]=e,vb.patternProperties[KD]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i?.value,o=i?.source;ll(s)&&(s=t.defaultDefaultValue,o=void 0),ll(s)&&(s=zje(t.type)),t.default=s,t.defaultValueSource=o}}const Uje="\\[([^\\]]+)\\]",x2e=new RegExp(Uje,"g"),KD=`^(${Uje})+$`,dp=new RegExp(KD);function H9(n){const e=[];if(dp.test(n)){let t=x2e.exec(n);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=x2e.exec(n)}}return Lc(e)}function Vje(n){return n.reduce((e,t)=>`${e}[${t}]`,"")}function zje(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const g$=new Lft;it.add(Cs.Configuration,g$);function $je(n,e){return n.trim()?dp.test(n)?g(my,5,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):g$.getConfigurationProperties()[n]!==void 0?g(my,6,"Cannot register '{0}'. This property is already registered.",n):e.policy?.name&&g$.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(my,7,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,e.policy?.name,g$.getPolicyConfigurations().get(e.policy?.name)):null:g(my,4,"Cannot register an empty property")}function Tft(){const n=[],e=g$.getConfigurationProperties();for(const t of Object.keys(e))n.push([t,e[t].scope]);return n.push(["launch",ut.RESOURCE]),n.push(["task",ut.RESOURCE]),n}const Rft="vs/editor/common/languages/modesRegistry",Mft={ModesRegistry:"editor.modesRegistry"};class Nft{constructor(){this._onDidChangeLanguages=new I,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const c=new Set;return{info:new Fft(this,a,c),closing:c}}),o=new tZ(a=>{const c=new Set,l=new Set;return{info:new Oft(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?D2e(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=s.get(a),d=o.get(c);l.closing.add(d.info),d.openingColorized.add(l.info),d.opening.add(l.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,c])=>[a,c.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,c])=>[a,c.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return cQ(t,e)}}function D2e(n){return n.filter(([e,t])=>e!==""&&t!=="")}class qje{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Fft extends qje{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Oft extends qje{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}class $ge{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const lo=ae("languageConfigurationService");let Uve=class extends ${constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Uft),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Vve));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new $ge(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new $ge(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new $ge(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Bft(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Uve=D([_(0,Re),_(1,Di)],Uve);function Bft(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new EW(n,{});s=new EW(n,{})}const o=Wft(s.languageId,t),r=jje([s.underlyingConfig,o]);return new EW(s.languageId,r)}const Vve={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Wft(n,e){const t=e.getValue(Vve.brackets,{overrideIdentifier:n}),i=e.getValue(Vve.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:k2e(t),colorizedBracketPairs:k2e(i)}}function k2e(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Qje(n,e,t){const i=n.getLineContent(e);let s=Uo(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}class Hft{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new I2e(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let s=0;se.configuration)))}}function jje(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class I2e{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class L2e{constructor(e){this.languageId=e}}class Uft extends ${constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Yc,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new Hft(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new L2e(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new L2e(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class EW{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new VB(this.underlyingConfig):null,this.comments=EW._handleComments(this.underlyingConfig),this.characterPair=new Fve(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||QRe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new bft(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Pft(e,this.underlyingConfig)}getWordDefinition(){return zq(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new gft(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new wft(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new $gt(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ce(lo,Uve,Yt.Delayed);class xD{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class T2e{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new xD(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Zn.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Zn.MAX_SAFE_SMALL_INTEGER}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class wy{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=wy._getElements(e),[a,c,l]=wy._getElements(t);this._hasStrings=r&&l,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(wy._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let h;return i<=s?(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new xD(e,0,i,s-i+1)]):e<=t?(BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[new xD(e,t-e+1,i,0)]):(BO.Assert(e===t+1,"originalStart should only be one more than originalEnd"),BO.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,s,r,a,o),l=r[0],d=a[0];if(c!==null)return c;if(!o[0]){const h=this.ComputeDiffRecursive(e,l,i,d,o);let u=[];return o[0]?u=[new xD(l+1,t-(l+1)+1,d+1,s-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,s,o),this.ConcatenateChanges(h,u)}return[new xD(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){let C=null,y=null,S=new R2e,M=t,k=i,F=f[0]-v[0]-s,N=Zn.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const U=F+e;U===M||U=0&&(l=this.m_forwardHistory[z],e=l[0],M=1,k=l.length-1)}while(--z>=-1);if(C=S.getReverseChanges(),b[0]){let U=f[0]+1,J=v[0]+1;if(C!==null&&C.length>0){const j=C[C.length-1];U=Math.max(U,j.getOriginalEnd()),J=Math.max(J,j.getModifiedEnd())}y=[new xD(U,u-U+1,J,m-J+1)]}else{S=new R2e,M=r,k=a,F=f[0]-v[0]-c,N=Zn.MAX_SAFE_SMALL_INTEGER,z=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const U=F+o;U===M||U=d[U+1]?(h=d[U+1]-1,p=h-F-c,h>N&&S.MarkNextChange(),N=h+1,S.AddOriginalElement(h+1,p+1),F=U+1-o):(h=d[U-1],p=h-F-c,h>N&&S.MarkNextChange(),N=h,S.AddModifiedElement(h+1,p+1),F=U-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],M=1,k=d.length-1)}while(--z>=-1);y=S.getChanges()}return this.ConcatenateChanges(C,y)}ComputeRecursionPoint(e,t,i,s,o,r,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(s-i),m=p+1,v=new Int32Array(m),w=new Int32Array(m),b=s-i,C=t-e,y=e-i,S=t-s,k=(C-b)%2===0;v[b]=e,w[C]=t,a[0]=!1;for(let F=1;F<=p/2+1;F++){let N=0,z=0;d=this.ClipDiagonalBound(b-F,F,b,m),h=this.ClipDiagonalBound(b+F,F,b,m);for(let J=d;J<=h;J+=2){J===d||JN+z&&(N=c,z=l),!k&&Math.abs(J-C)<=F-1&&c>=w[J])return o[0]=c,r[0]=l,j<=w[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}const U=(N-e+(z-i)-F)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,U))return a[0]=!0,o[0]=N,r[0]=z,U>0&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):(e++,i++,[new xD(e,t-e+1,i,s-i+1)]);u=this.ClipDiagonalBound(C-F,F,C,m),f=this.ClipDiagonalBound(C+F,F,C,m);for(let J=u;J<=f;J+=2){J===u||J=w[J+1]?c=w[J+1]-1:c=w[J-1],l=c-(J-C)-S;const j=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(w[J]=c,k&&Math.abs(J-b)<=F&&c<=v[J])return o[0]=c,r[0]=l,j>=v[J]&&bA.MaxDifferencesHistory>0&&F<=bA.MaxDifferencesHistory+1?this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a):null}if(F<=bA.MaxDifferencesHistory){let J=new Int32Array(h-d+2);J[0]=b-d+1,WO.Copy2(v,d,J,1,h-d+1),this.m_forwardHistory.push(J),J=new Int32Array(f-u+2),J[0]=C-u+1,WO.Copy2(w,u,J,1,f-u+1),this.m_reverseHistory.push(J)}}return this.WALKTRACE(b,d,h,y,C,u,f,S,v,w,c,t,o,l,s,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const h=e[t-1];s=h.originalStart+h.originalLength,o=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let c=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,f=i.modifiedStart-h;if(ul&&(l=m,c=h)}i.originalStart-=c,i.modifiedStart-=c;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>c&&(c=f,l=h,d=u)}return c>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return WO.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],WO.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return WO.Copy(e,0,s,0,e.length),WO.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(BO.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),BO.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new xD(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=PO(e),t=PO(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=PO(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new Kje(s,e-r)}}class $ft{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Kje(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Uq(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}var f$;(function(n){n[n.False=0]="False",n[n.True=1]="True"})(f$||(f$={}));class EZ{constructor(){this._actual=new pz(f$.False)}add(e){this._actual.set(e,f$.True)}has(e){return this._actual.get(e)===f$.True}clear(){return this._actual.clear()}}var Oi;(function(n){n[n.Invalid=0]="Invalid",n[n.Start=1]="Start",n[n.H=2]="H",n[n.HT=3]="HT",n[n.HTT=4]="HTT",n[n.HTTP=5]="HTTP",n[n.F=6]="F",n[n.FI=7]="FI",n[n.FIL=8]="FIL",n[n.BeforeColon=9]="BeforeColon",n[n.AfterColon=10]="AfterColon",n[n.AlmostThere=11]="AlmostThere",n[n.End=12]="End",n[n.Accept=13]="Accept",n[n.LastKnownState=14]="LastKnownState"})(Oi||(Oi={}));class Gft{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const s=new Gft(i,t,Oi.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Oi.Invalid:this._states.get(e,t)}}let Gge=null;function qft(){return Gge===null&&(Gge=new Jje([[Oi.Start,Q.h,Oi.H],[Oi.Start,Q.H,Oi.H],[Oi.Start,Q.f,Oi.F],[Oi.Start,Q.F,Oi.F],[Oi.H,Q.t,Oi.HT],[Oi.H,Q.T,Oi.HT],[Oi.HT,Q.t,Oi.HTT],[Oi.HT,Q.T,Oi.HTT],[Oi.HTT,Q.p,Oi.HTTP],[Oi.HTT,Q.P,Oi.HTTP],[Oi.HTTP,Q.s,Oi.BeforeColon],[Oi.HTTP,Q.S,Oi.BeforeColon],[Oi.HTTP,Q.Colon,Oi.AfterColon],[Oi.F,Q.i,Oi.FI],[Oi.F,Q.I,Oi.FI],[Oi.FI,Q.l,Oi.FIL],[Oi.FI,Q.L,Oi.FIL],[Oi.FIL,Q.e,Oi.BeforeColon],[Oi.FIL,Q.E,Oi.BeforeColon],[Oi.BeforeColon,Q.Colon,Oi.AfterColon],[Oi.AfterColon,Q.Slash,Oi.AlmostThere],[Oi.AlmostThere,Q.Slash,Oi.End]])),Gge}var rc;(function(n){n[n.None=0]="None",n[n.ForceTermination=1]="ForceTermination",n[n.CannotEndIn=2]="CannotEndIn"})(rc||(rc={}));let r5=null;function Qft(){if(r5===null){r5=new pz(rc.None);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),c=t.charCodeAt(r);(a===Q.OpenParen&&c===Q.CloseParen||a===Q.OpenSquareBracket&&c===Q.CloseSquareBracket||a===Q.OpenCurlyBrace&&c===Q.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=qft()){const i=Qft(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),c=a.length;let l=0,d=0,h=0,u=Oi.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}};aae.INSTANCE=new aae;let zve=aae;var da;(function(n){n[n.Regular=0]="Regular",n[n.Whitespace=1]="Whitespace",n[n.WordSeparator=2]="WordSeparator"})(da||(da={}));class Kft extends pz{constructor(e,t){super(da.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,s=e.length;it)break;i=s}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=vQe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Jft(t,this.wordSeparators?R_(this.wordSeparators,[]):null,i?this.searchString:null)}}function Xje(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===Q.n||s===Q.r||s===Q.W)return!0}}return!1}function wT(n,e,t){if(!t)return new z9(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class yj{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new $B(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,c=0;s?(c=s.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-c;l=a+r.length+f}else l=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(l);return new O(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,xo.LF),c=e.getEOL()===`\r `?new N2e(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=wT(this._getMultilineMatchRange(e,r,a,c,h.index,h[0]),h,s),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,s,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let l=t.startLineNumber+1;l=c))return o;return o}const d=new $B(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[o++]=wT(new O(i,h.index+1+s,i,h.index+1+h[0].length+s),h,a),o>=c))return o;while(h);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new $B(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new oe(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new O(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),xo.LF),l=e.getEOL()===`\r -`?new N2e(c):null;i.reset(t.column-1);const d=i.next(c);return d?wT(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,s);if(c)return c;for(let l=1;l<=o;l++){const d=(r+l-1)%o,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,s);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new $B(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new O(1,1,t.lineNumber,t.column),i,s,10*Zft);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new oe(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,s);if(c)return c;for(let l=1;l<=o;l++){const d=(o+r-l-1)%o,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,s);if(u)return u}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function ept(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==da.Regular||o===q.CarriageReturn||o===q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==da.Regular)return!0}return!1}function tpt(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==da.Regular||o===q.CarriageReturn||o===q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==da.Regular)return!0}return!1}function mMe(n,e,t,i,s){return ept(n,e,t,i,s)&&tpt(n,e,t,i,s)}class $B{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){nZ(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||mMe(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class _Me{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new P2e(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${ipt(Array.from(a))}`,"g");const l=new $B(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=s,w=o;v<=w;v++){const b=e.getLineContent(v),C=b.length;l.reset(0);do if(u=l.next(b),u){let y=u.index,S=u.index+u[0].length;if(y>0){const N=b.charCodeAt(y-1);wl(N)&&y--}if(S+1=1e3){h=!0;break e}d.push(new O(v,y+1,v,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new P2e(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Hg.None:return null;case Hg.Invisible:return{kind:Wv.Invisible};case Hg.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=C9.getLocales().filter(c=>!C9.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:Wv.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Hg.NonBasicASCII:return{kind:Wv.NonBasicAscii}}}}function ipt(n,e){return`[${Iu(n.map(i=>String.fromCodePoint(i)).join(""))}]`}var Wv;(function(n){n[n.Ambiguous=0]="Ambiguous",n[n.Invisible=1]="Invisible",n[n.NonBasicAscii=2]="NonBasicAscii"})(Wv||(Wv={}));class P2e{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=C9.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of aM.codePoints)F2e(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return Hg.None;if(this.options.nonBasicASCII)return Hg.NonBasicASCII;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=qq(r);s=s||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!aM.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?Hg.None:this.options.invisibleCharacters&&!F2e(e)&&aM.isInvisibleCharacter(i)?Hg.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Hg.Ambiguous:Hg.None}}function F2e(n){return n===" "||n===` +`?new N2e(c):null;i.reset(t.column-1);const d=i.next(c);return d?wT(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,s);if(c)return c;for(let l=1;l<=o;l++){const d=(r+l-1)%o,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,s);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new $B(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new O(1,1,t.lineNumber,t.column),i,s,10*Zft);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new oe(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,s);if(c)return c;for(let l=1;l<=o;l++){const d=(o+r-l-1)%o,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,s);if(u)return u}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=wT(new O(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function ept(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==da.Regular||o===Q.CarriageReturn||o===Q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==da.Regular)return!0}return!1}function tpt(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==da.Regular||o===Q.CarriageReturn||o===Q.LineFeed)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==da.Regular)return!0}return!1}function mMe(n,e,t,i,s){return ept(n,e,t,i,s)&&tpt(n,e,t,i,s)}class $B{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){nZ(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||mMe(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class _Me{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new P2e(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${ipt(Array.from(a))}`,"g");const l=new $B(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=s,w=o;v<=w;v++){const b=e.getLineContent(v),C=b.length;l.reset(0);do if(u=l.next(b),u){let y=u.index,S=u.index+u[0].length;if(y>0){const N=b.charCodeAt(y-1);wl(N)&&y--}if(S+1=1e3){h=!0;break e}d.push(new O(v,y+1,v,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new P2e(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Hg.None:return null;case Hg.Invisible:return{kind:Wv.Invisible};case Hg.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=C9.getLocales().filter(c=>!C9.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:Wv.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Hg.NonBasicASCII:return{kind:Wv.NonBasicAscii}}}}function ipt(n,e){return`[${Iu(n.map(i=>String.fromCodePoint(i)).join(""))}]`}var Wv;(function(n){n[n.Ambiguous=0]="Ambiguous",n[n.Invisible=1]="Invisible",n[n.NonBasicAscii=2]="NonBasicAscii"})(Wv||(Wv={}));class P2e{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=C9.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of aM.codePoints)F2e(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return Hg.None;if(this.options.nonBasicASCII)return Hg.NonBasicASCII;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=qq(r);s=s||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!aM.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?Hg.None:this.options.invisibleCharacters&&!F2e(e)&&aM.isInvisibleCharacter(i)?Hg.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Hg.Ambiguous:Hg.None}}function F2e(n){return n===" "||n===` `||n===" "}var Hg;(function(n){n[n.None=0]="None",n[n.NonBasicASCII=1]="NonBasicASCII",n[n.Invisible=2]="Invisible",n[n.Ambiguous=3]="Ambiguous"})(Hg||(Hg={}));class JY{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Zle{constructor(e,t){this.lineRangeMapping=e,this.changes=t}flip(){return new Zle(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}}class hi{static addRange(e,t){let i=0;for(;it))return new hi(e,t)}static ofLength(e){return new hi(0,e)}static ofStartAndLength(e,t){return new hi(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new cn(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new hi(this.start+e,this.endExclusive+e)}deltaStart(e){return new hi(this.start+e,this.endExclusive)}deltaEnd(e){return new hi(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new cn(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new cn(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){const t=[];for(let i=this.start;ie.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}let bi=class kp{static fromRange(e){return new kp(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new kp(e.startLineNumber,e.endLineNumber+1)}static subtract(e,t){return t?e.startLineNumbert)throw new cn(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=wU(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=vU(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=vU(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new bi(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new d_(t)}subtractFrom(e){const t=bU(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=wU(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new d_([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new bi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}const zm=class zm{static lengthDiffNonNegative(e,t){return t.isLessThan(e)?zm.zero:e.lineCount===t.lineCount?new zm(0,t.columnCount-e.columnCount):new zm(t.lineCount-e.lineCount,t.columnCount)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new zm(0,t.column-e.column):new zm(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return zm.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const s of e)s===` `?(t++,i=0):i++;return new zm(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new zm(this.lineCount,this.columnCount+e.columnCount):new zm(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new O(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new O(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new O(1,1,this.lineCount+1,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new oe(e.lineNumber,e.column+this.columnCount):new oe(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};zm.zero=new zm(0,0);let gf=zm;class npt{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;to<=e),i=t+1,s=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,s)}getRange(e){return O.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return gf.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new gf(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let WU=class XY{static single(e,t){return new XY([new ug(e,t)])}constructor(e){this.edits=e,fw(()=>gz(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}normalize(){const e=[];for(const t of this.edits)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(t.range.getStartPosition())){const i=e[e.length-1];e[e.length-1]=new ug(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new XY(e)}mapPosition(e){let t=0,i=0,s=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=gf.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?s:0)),d=c.addToPosition(l);return Sj(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?s+=c.columnCount-(a.column-1):s+=c.columnCount-(a.column-r.column):s=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?s:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const s=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return Sj(s,o)}inverseMapPosition(e,t){return this.inverse(t).mapPosition(e)}inverseMapRange(e,t){return this.inverse(t).mapRange(e)}apply(e){let t="",i=new oe(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),c=r.getEndPosition(),l=Sj(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const s=Sj(i,e.endPositionExclusive);return s.isEmpty()||(t+=e.getValueOfRange(s)),t}applyToString(e){const t=new spt(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new XY(this.edits.map((i,s)=>new ug(t[s],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,s=0;for(const o of this.edits){const r=gf.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?s:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,s=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class ug{constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}function Sj(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return O.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new cn("start must be before end");return new O(n.lineNumber,n.column,e.lineNumber,e.column)}class Zje{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class spt extends Zje{constructor(e){super(),this.value=e,this._t=new npt(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let $b=class pB{static inverse(e,t,i){const s=[];let o=1,r=1;for(const c of e){const l=new pB(new bi(o,c.original.startLineNumber),new bi(r,c.modified.startLineNumber));l.modified.isEmpty||s.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new pB(new bi(o,t+1),new bi(r,i+1));return a.modified.isEmpty||s.push(a),s}static clip(e,t,i){const s=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&s.push(new pB(r,a))}return s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new pB(this.modified,this.original)}join(e){return new pB(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new fS(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new cn("not a valid diff");return new fS(new O(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new O(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new fS(new O(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new O(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}},pw=class ZY extends $b{static fromRangeMappings(e){const t=bi.join(e.map(s=>bi.fromRangeInclusive(s.originalRange))),i=bi.join(e.map(s=>bi.fromRangeInclusive(s.modifiedRange)));return new ZY(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new ZY(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new ZY(this.original,this.modified,[this.toRangeMapping()])}},fS=class eKe{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new eKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new ug(this.originalRange,t)}};const opt=3;class rpt{computeDiff(e,t,i){const o=new iKe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const c of o.changes){let l;c.originalEndLineNumber===0?l=new bi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new bi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new bi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new bi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new pw(l,d,c.charChanges?.map(u=>new fS(new O(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new O(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new pw(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return fw(()=>gz(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===q.LineFeed?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===q.LineFeed?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===q.LineFeed?1:this._columns[e]+1)}}class xW{constructor(e,t,i,s,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),c=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new xW(s,o,r,a,c,l,d,h)}}function cpt(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),p=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=tKe(f,p,o,!0).changes;a&&(m=cpt(m)),u=[];for(let v=0,w=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),w=f.charCodeAt(m-2);if(v!==w)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,p,r+1,1,m)}{let p=Gve(u,1),m=Gve(f,1);const v=u.length+1,w=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(ml.fromOffsetPairs(s?s.getEndExclusives():wE.zero,o?o.getStarts():new wE(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new ml(new hi(e.offset1,t.offset1),new hi(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new ml(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new ml(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new ml(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new ml(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new ml(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new ml(t,i)}getStarts(){return new wE(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new wE(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const JT=class JT{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new JT(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};JT.zero=new JT(0,0),JT.max=new JT(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let wE=JT;const cae=class cae{isValid(){return!0}};cae.instance=new cae;let $9=cae;class lpt{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new cn("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Qge{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function qve(n){return n===q.Space||n===q.Tab}const G8=class G8{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let s=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(b+=a.get(p-1,m-1)),b+=s?s(p,m):1):b=-1;const C=Math.max(v,w,b);if(C===b){const y=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,y+1),r.set(p,m,3)}else C===v?(a.set(p,m,0),r.set(p,m,1)):C===w&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,C)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new ml(new hi(p+1,l),new hi(m+1,d))),l=p,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),c.reverse(),new cx(c,!1)}}class nKe{compute(e,t,i=$9.instance){if(e.length===0||t.length===0)return cx.trivial(e,t);const s=e,o=t;function r(m,v){for(;ms.length||y>o.length)continue;const S=r(C,y);c.set(d,S);const M=C===w?l.get(d+1):l.get(d-1);if(l.set(d,S!==C?new W2e(M,C,y,S-C):M),c.get(d)===s.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=s.length,p=o.length;for(;;){const m=h?h.x+h.length:0,v=h?h.y+h.length:0;if((m!==f||v!==p)&&u.push(new ml(new hi(m,f),new hi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new cx(u,!1)}}class W2e{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class hpt{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class upt{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class kZ{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new hi(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=U2e(e>0?this.elements[e-1]:-1),i=U2e(ei<=e);return new oe(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return O.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!jge(this.elements[e]))return;let t=e;for(;t>0&&jge(this.elements[t-1]);)t--;let i=e;for(;is<=e.start)??0,i=xct(this.firstCharOffsetByLine,s=>e.endExclusive<=s)??this.elements.length;return new hi(t,i)}}function jge(n){return n>=q.a&&n<=q.z||n>=q.A&&n<=q.Z||n>=q.Digit0&&n<=q.Digit9}var Vc;(function(n){n[n.WordLower=0]="WordLower",n[n.WordUpper=1]="WordUpper",n[n.WordNumber=2]="WordNumber",n[n.End=3]="End",n[n.Other=4]="Other",n[n.Separator=5]="Separator",n[n.Space=6]="Space",n[n.LineBreakCR=7]="LineBreakCR",n[n.LineBreakLF=8]="LineBreakLF"})(Vc||(Vc={}));const gpt={[Vc.WordLower]:0,[Vc.WordUpper]:0,[Vc.WordNumber]:0,[Vc.End]:10,[Vc.Other]:2,[Vc.Separator]:30,[Vc.Space]:3,[Vc.LineBreakCR]:10,[Vc.LineBreakLF]:10};function H2e(n){return gpt[n]}function U2e(n){return n===q.LineFeed?Vc.LineBreakLF:n===q.CarriageReturn?Vc.LineBreakCR:qve(n)?Vc.Space:n>=q.a&&n<=q.z?Vc.WordLower:n>=q.A&&n<=q.Z?Vc.WordUpper:n>=q.Digit0&&n<=q.Digit9?Vc.WordNumber:n===-1?Vc.End:n===q.Comma||n===q.Semicolon?Vc.Separator:Vc.Other}function fpt(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=mpt(n,e,t,o);if(!o.isValid())return[];const c=n.filter(d=>!a.has(d)),l=_pt(c,i,s,e,t,o);return h_e(r,l),r=vpt(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` +`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new hi(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){const t=wU(this.lineStartOffsetByLineIdx,o=>o<=e),i=t+1,s=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,s)}getRange(e){return O.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return gf.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new gf(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let WU=class XY{static single(e,t){return new XY([new ug(e,t)])}constructor(e){this.edits=e,fw(()=>gz(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}normalize(){const e=[];for(const t of this.edits)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(t.range.getStartPosition())){const i=e[e.length-1];e[e.length-1]=new ug(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new XY(e)}mapPosition(e){let t=0,i=0,s=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=gf.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?s:0)),d=c.addToPosition(l);return Sj(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?s+=c.columnCount-(a.column-1):s+=c.columnCount-(a.column-r.column):s=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?s:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const s=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return Sj(s,o)}inverseMapPosition(e,t){return this.inverse(t).mapPosition(e)}inverseMapRange(e,t){return this.inverse(t).mapRange(e)}apply(e){let t="",i=new oe(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),c=r.getEndPosition(),l=Sj(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const s=Sj(i,e.endPositionExclusive);return s.isEmpty()||(t+=e.getValueOfRange(s)),t}applyToString(e){const t=new spt(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new XY(this.edits.map((i,s)=>new ug(t[s],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,s=0;for(const o of this.edits){const r=gf.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?s:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,s=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class ug{constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}toSingleEditOperation(){return{range:this.range,text:this.text}}}function Sj(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return O.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new cn("start must be before end");return new O(n.lineNumber,n.column,e.lineNumber,e.column)}class Zje{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class spt extends Zje{constructor(e){super(),this.value=e,this._t=new npt(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let $b=class pB{static inverse(e,t,i){const s=[];let o=1,r=1;for(const c of e){const l=new pB(new bi(o,c.original.startLineNumber),new bi(r,c.modified.startLineNumber));l.modified.isEmpty||s.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new pB(new bi(o,t+1),new bi(r,i+1));return a.modified.isEmpty||s.push(a),s}static clip(e,t,i){const s=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&s.push(new pB(r,a))}return s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new pB(this.modified,this.original)}join(e){return new pB(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new fS(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new cn("not a valid diff");return new fS(new O(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new O(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new fS(new O(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new O(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}},pw=class ZY extends $b{static fromRangeMappings(e){const t=bi.join(e.map(s=>bi.fromRangeInclusive(s.originalRange))),i=bi.join(e.map(s=>bi.fromRangeInclusive(s.modifiedRange)));return new ZY(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new ZY(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new ZY(this.original,this.modified,[this.toRangeMapping()])}},fS=class eKe{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new eKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new ug(this.originalRange,t)}};const opt=3;class rpt{computeDiff(e,t,i){const o=new iKe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const c of o.changes){let l;c.originalEndLineNumber===0?l=new bi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new bi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new bi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new bi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new pw(l,d,c.charChanges?.map(u=>new fS(new O(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new O(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new pw(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return fw(()=>gz(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===Q.LineFeed?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===Q.LineFeed?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===Q.LineFeed?1:this._columns[e]+1)}}class xW{constructor(e,t,i,s,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),c=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new xW(s,o,r,a,c,l,d,h)}}function cpt(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),p=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=tKe(f,p,o,!0).changes;a&&(m=cpt(m)),u=[];for(let v=0,w=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),w=f.charCodeAt(m-2);if(v!==w)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,p,r+1,1,m)}{let p=Gve(u,1),m=Gve(f,1);const v=u.length+1,w=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(ml.fromOffsetPairs(s?s.getEndExclusives():wE.zero,o?o.getStarts():new wE(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new ml(new hi(e.offset1,t.offset1),new hi(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new ml(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new ml(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new ml(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new ml(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new ml(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new ml(t,i)}getStarts(){return new wE(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new wE(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const JT=class JT{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new JT(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};JT.zero=new JT(0,0),JT.max=new JT(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let wE=JT;const cae=class cae{isValid(){return!0}};cae.instance=new cae;let $9=cae;class lpt{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new cn("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Qge{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function qve(n){return n===Q.Space||n===Q.Tab}const G8=class G8{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let s=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(b+=a.get(p-1,m-1)),b+=s?s(p,m):1):b=-1;const C=Math.max(v,w,b);if(C===b){const y=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,y+1),r.set(p,m,3)}else C===v?(a.set(p,m,0),r.set(p,m,1)):C===w&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,C)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new ml(new hi(p+1,l),new hi(m+1,d))),l=p,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),c.reverse(),new cx(c,!1)}}class nKe{compute(e,t,i=$9.instance){if(e.length===0||t.length===0)return cx.trivial(e,t);const s=e,o=t;function r(m,v){for(;ms.length||y>o.length)continue;const S=r(C,y);c.set(d,S);const M=C===w?l.get(d+1):l.get(d-1);if(l.set(d,S!==C?new W2e(M,C,y,S-C):M),c.get(d)===s.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=s.length,p=o.length;for(;;){const m=h?h.x+h.length:0,v=h?h.y+h.length:0;if((m!==f||v!==p)&&u.push(new ml(new hi(m,f),new hi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new cx(u,!1)}}class W2e{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class hpt{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class upt{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class kZ{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new hi(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=U2e(e>0?this.elements[e-1]:-1),i=U2e(ei<=e);return new oe(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return O.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!jge(this.elements[e]))return;let t=e;for(;t>0&&jge(this.elements[t-1]);)t--;let i=e;for(;is<=e.start)??0,i=xct(this.firstCharOffsetByLine,s=>e.endExclusive<=s)??this.elements.length;return new hi(t,i)}}function jge(n){return n>=Q.a&&n<=Q.z||n>=Q.A&&n<=Q.Z||n>=Q.Digit0&&n<=Q.Digit9}var zc;(function(n){n[n.WordLower=0]="WordLower",n[n.WordUpper=1]="WordUpper",n[n.WordNumber=2]="WordNumber",n[n.End=3]="End",n[n.Other=4]="Other",n[n.Separator=5]="Separator",n[n.Space=6]="Space",n[n.LineBreakCR=7]="LineBreakCR",n[n.LineBreakLF=8]="LineBreakLF"})(zc||(zc={}));const gpt={[zc.WordLower]:0,[zc.WordUpper]:0,[zc.WordNumber]:0,[zc.End]:10,[zc.Other]:2,[zc.Separator]:30,[zc.Space]:3,[zc.LineBreakCR]:10,[zc.LineBreakLF]:10};function H2e(n){return gpt[n]}function U2e(n){return n===Q.LineFeed?zc.LineBreakLF:n===Q.CarriageReturn?zc.LineBreakCR:qve(n)?zc.Space:n>=Q.a&&n<=Q.z?zc.WordLower:n>=Q.A&&n<=Q.Z?zc.WordUpper:n>=Q.Digit0&&n<=Q.Digit9?zc.WordNumber:n===-1?zc.End:n===Q.Comma||n===Q.Semicolon?zc.Separator:zc.Other}function fpt(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=mpt(n,e,t,o);if(!o.isValid())return[];const c=n.filter(d=>!a.has(d)),l=_pt(c,i,s,e,t,o);return h_e(r,l),r=vpt(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` `).length>=15&&ppt(h,f=>f.length>=2)>=2}),r=wpt(n,r),r}function ppt(n,e){let t=0;for(const i of n)e(i)&&t++;return t}function mpt(n,e,t,i){const s=[],o=n.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new DZ(c.original,e,c)),r=new Set(n.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new DZ(c.modified,t,c))),a=new Set;for(const c of o){let l=-1,d;for(const h of r){const u=c.computeSimilarity(h);u>l&&(l=u,d=h)}if(l>.9&&d&&(r.delete(d),s.push(new $b(c.range,d.range)),a.add(c.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function _pt(n,e,t,i,s,o){const r=[],a=new Vq;for(const u of n)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,cg));for(const u of n){let f=[];for(let p=u.modified.startLineNumber;p{for(const y of f)if(y.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){y.originalLineRange=new bi(y.originalLineRange.startLineNumber,b.endLineNumberExclusive),y.modifiedLineRange=new bi(y.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),w.push(y);return}const C={modifiedLineRange:v,originalLineRange:b};c.push(C),w.push(C)}),f=w}if(!o.isValid())return[]}c.sort(Kqe(El(u=>u.modifiedLineRange.length,cg)));const l=new d_,d=new d_;for(const u of c){const f=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,p=l.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(f),v=p.getIntersection(m);for(const w of v.ranges){if(w.length<3)continue;const b=w,C=w.delta(-f);r.push(new $b(C,b)),l.addRange(b),d.addRange(C)}}r.sort(El(u=>u.original.startLineNumber,cg));const h=new jX(n);for(let u=0;uM.original.startLineNumber<=f.original.startLineNumber),m=vU(n,M=>M.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-p.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),w=h.findLastMonotonous(M=>M.original.startLineNumberM.modified.startLineNumberi.length||k>s.length||l.contains(k)||d.contains(M)||!V2e(i[M-1],s[k-1],o))break}y>0&&(d.addRange(new bi(f.original.startLineNumber-y,f.original.startLineNumber)),l.addRange(new bi(f.modified.startLineNumber-y,f.modified.startLineNumber)));let S;for(S=0;Si.length||k>s.length||l.contains(k)||d.contains(M)||!V2e(i[M-1],s[k-1],o))break}S>0&&(d.addRange(new bi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),l.addRange(new bi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(y>0||S>0)&&(r[u]=new $b(new bi(f.original.startLineNumber-y,f.original.endLineNumberExclusive+S),new bi(f.modified.startLineNumber-y,f.modified.endLineNumberExclusive+S)))}return r}function V2e(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new nKe().compute(new kZ([n],new hi(0,1),!1),new kZ([e],new hi(0,1),!1),t);let o=0;const r=ml.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(h=>{qve(n.charCodeAt(h))||o++});function a(d){let h=0;for(let u=0;ue.length?n:e);return o/c>.6&&c>10}function vpt(n){if(n.length===0)return n;n.sort(El(t=>t.original.startLineNumber,cg));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function wpt(n,e){const t=new jX(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(l))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function bpt(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+al&&(l=p,c=d)}return n.delta(c)}function Cpt(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new ml(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function ypt(n,e,t){const i=ml.invert(t,n.length),s=[];let o=new wE(0,0);function r(c,l){if(c.offset10;){const v=i[0];if(!(v.seq1Range.intersects(u.seq1Range)||v.seq2Range.intersects(u.seq2Range)))break;const b=n.findWordContaining(v.seq1Range.start),C=e.findWordContaining(v.seq2Range.start),y=new ml(b,C),S=y.intersect(v);if(p+=S.seq1Range.length,m+=S.seq2Range.length,u=u.join(y),u.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}p+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&s.push(u),o=u.getEndExclusives()}for(;i.length>0;){const c=i.shift();c.seq1Range.isEmpty||(r(c.getStarts(),c),r(c.getEndExclusives().delta(-1),c))}return Spt(t,s)}function Spt(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function Apt(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const c=i[a],l=r[r.length-1];d(l,c)?(o=!0,r[r.length-1]=r[r.length-1].join(c)):r.push(c)}i=r}while(s++<10&&o);return i}function Ept(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let c=1;c5||m.length>500)return!1;const w=n.getText(m).trim();if(w.length>20||w.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),C=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),S=f.seq2Range.length,M=n.countLinesIn(p.seq1Range),k=p.seq1Range.length,F=e.countLinesIn(p.seq2Range),N=p.seq2Range.length,z=2*40+50;function U(J){return Math.min(J,z)}return Math.pow(Math.pow(U(b*40+C),1.5)+Math.pow(U(y*40+S),1.5),1.5)+Math.pow(Math.pow(U(M*40+k),1.5)+Math.pow(U(F*40+N),1.5),1.5)>(z**1.5)**1.5*1.3};const l=i[c],d=a[a.length-1];h(d,l)?(o=!0,a[a.length-1]=a[a.length-1].join(l)):a.push(l)}i=a}while(s++<10&&o);const r=[];return Nct(i,(a,c,l)=>{let d=c;function h(w){return w.length>0&&w.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const u=n.extendToFullLines(c.seq1Range),f=n.getText(new hi(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=n.getText(new hi(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=ml.fromOffsetPairs(a?a.getEndExclusives():wE.zero,l?l.getStarts():wE.max),v=d.intersect(m);r.length>0&&v.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(v):r.push(v)}),r}class G2e{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:q2e(this.lines[e-1]),i=e===this.lines.length?0:q2e(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function q2e(n){let e=0;for(;eS===M))return new JY([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new JY([new pw(new bi(1,e.length+1),new bi(1,t.length+1),[new fS(new O(1,1,e.length,e[e.length-1].length+1),new O(1,1,t.length,t[t.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?$9.instance:new lpt(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let M=r.get(S);return M===void 0&&(M=r.size,r.set(S,M)),M}const c=e.map(S=>a(S.trim())),l=t.map(S=>a(S.trim())),d=new G2e(c,e),h=new G2e(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,s,(S,M)=>e[S]===t[M]?t[M].length===0?.1:1+Math.log(1+t[M].length):.99):this.myersDiffingAlgorithm.compute(d,h,s);let f=u.diffs,p=u.hitTimeout;f=Qve(d,h,f),f=Apt(d,h,f);const m=[],v=S=>{if(o)for(let M=0;MS.seq1Range.start-w===S.seq2Range.start-b);const M=S.seq1Range.start-w;v(M),w=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const k=this.refineDiff(e,t,S,s,o);k.hitTimeout&&(p=!0);for(const F of k.mappings)m.push(F)}v(e.length-w);const C=Q2e(m,e,t);let y=[];return i.computeMoves&&(y=this.computeMoves(C,e,t,c,l,s,o)),fw(()=>{function S(k,F){if(k.lineNumber<1||k.lineNumber>F.length)return!1;const N=F[k.lineNumber-1];return!(k.column<1||k.column>N.length+1)}function M(k,F){return!(k.startLineNumber<1||k.startLineNumber>F.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>F.length+1)}for(const k of C){if(!k.innerChanges)return!1;for(const F of k.innerChanges)if(!(S(F.modifiedRange.getStartPosition(),t)&&S(F.modifiedRange.getEndPosition(),t)&&S(F.originalRange.getStartPosition(),e)&&S(F.originalRange.getEndPosition(),e)))return!1;if(!M(k.modified,t)||!M(k.original,e))return!1}return!0}),new JY(C,y,p)}computeMoves(e,t,i,s,o,r,a){return fpt(e,t,i,s,o,r).map(d=>{const h=this.refineDiff(t,i,new ml(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=Q2e(h.mappings,t,i,!0);return new Zle(d,u)})}refineDiff(e,t,i,s,o){const r=new kZ(e,i.seq1Range,o),a=new kZ(t,i.seq2Range,o),c=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let l=c.diffs;return l=Qve(r,a,l),l=ypt(r,a,l),l=Cpt(r,a,l),l=Ept(r,a,l),{mappings:l.map(h=>new fS(r.translateRange(h.seq1Range),a.translateRange(h.seq2Range))),hitTimeout:c.hitTimeout}}}function Q2e(n,e,t,i=!1){const s=[];for(const o of NRe(n.map(r=>xpt(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new pw(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return fw(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||t.length-s[s.length-1].modified.endLineNumberExclusive!==e.length-s[s.length-1].original.endLineNumberExclusive)?!1:gz(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new bi(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new bi(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new pw(o,r,[n])}const Kge={getLegacy:()=>new rpt,getDefault:()=>new sKe};function LI(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class gn{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Av{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.l=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let c=0,l=0;const d=(a+r)/2,h=r-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),r){case t:c=(i-s)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,c;if(i===0)r=a=c=s;else{const l=s<.5?s*(1+i):s+i-s*i,d=2*s-l;r=Av._hue2rgb(d,l,t+1/3),a=Av._hue2rgb(d,l,t),c=Av._hue2rgb(d,l,t-1/3)}return new gn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class Ky{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.v=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-s)/a%6+6)%6:o===i?l=(s-t)/a+2:l=(t-i)/a+4,new Ky(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),c=s-r;let[l,d,h]=[0,0,0];return t<60?(l=r,d=a):t<120?(l=a,d=r):t<180?(d=r,h=a):t<240?(d=a,h=r):t<300?(l=a,h=r):t<=360&&(l=r,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new gn(l,d,h,o)}}var Fo;let fe=(Fo=class{static fromHex(e){return Fo.Format.CSS.parseHex(e)||Fo.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Av.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Ky.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof gn)this.rgba=e;else if(e instanceof Av)this._hsla=e,this.rgba=Av.toRGBA(e);else if(e instanceof Ky)this._hsva=e,this.rgba=Ky.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&gn.equals(this.rgba,e.rgba)&&Av.equals(this.hsla,e.hsla)&&Ky.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Fo._relativeLuminanceForComponent(this.rgba.r),t=Fo._relativeLuminanceForComponent(this.rgba.g),i=Fo._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return LI(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}getContrastRatio(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return tFo._flatten(s,i));return Fo._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new Fo(new gn(i*t.rgba.r+e.rgba.a*e.rgba.r,i*t.rgba.g+e.rgba.a*e.rgba.g,i*t.rgba.b+e.rgba.a*e.rgba.b))}toString(){return this._toString||(this._toString=Fo.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-s)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(s-o)/s,e.darken(i)}},Fo.white=new Fo(new gn(255,255,255,1)),Fo.black=new Fo(new gn(0,0,0,1)),Fo.red=new Fo(new gn(255,0,0,1)),Fo.blue=new Fo(new gn(0,0,255,1)),Fo.green=new Fo(new gn(0,255,0,1)),Fo.cyan=new Fo(new gn(0,255,255,1)),Fo.lightgrey=new Fo(new gn(211,211,211,1)),Fo.transparent=new Fo(new gn(0,0,0,0)),Fo);(function(n){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:n.Format.CSS.formatRGBA(f)}t.formatRGB=i;function s(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=s;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(f)}t.formatHSL=o;function r(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(f){const p=f.toString(16);return p.length!==2?"0"+p:p}function c(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=c;function l(f,p=!1){return p&&f.rgba.a===1?n.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=l;function d(f){return f.isOpaque()?n.Format.CSS.formatHex(f):n.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==q.Hash)return null;if(p===7){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new n(new gn(m,v,w,1))}if(p===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),b=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new n(new gn(m,v,w,b/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3));return new n(new gn(16*m+m,16*v+v,16*w+w))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3)),b=u(f.charCodeAt(4));return new n(new gn(16*m+m,16*v+v,16*w+w,(16*b+b)/255))}return null}t.parseHex=h;function u(f){switch(f){case q.Digit0:return 0;case q.Digit1:return 1;case q.Digit2:return 2;case q.Digit3:return 3;case q.Digit4:return 4;case q.Digit5:return 5;case q.Digit6:return 6;case q.Digit7:return 7;case q.Digit8:return 8;case q.Digit9:return 9;case q.a:return 10;case q.A:return 10;case q.b:return 11;case q.B:return 11;case q.c:return 12;case q.C:return 12;case q.d:return 13;case q.D:return 13;case q.e:return 14;case q.E:return 14;case q.f:return 15;case q.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(fe||(fe={}));function oKe(n){const e=[];for(const t of n){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function wMe(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function a5(n,e){const t=e.index,i=e[0].length;if(!t)return;const s=n.positionAt(t);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+i}}function Dpt(n,e){if(!n)return;const t=fe.Format.CSS.parseHex(e);if(t)return{range:n,color:wMe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function j2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s);return{range:n,color:wMe(o[0],o[1],o[2],t?o[3]:1)}}function K2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s),r=new fe(new Av(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:wMe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function c5(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function kpt(n){const e=[],i=c5(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const s of i){const o=s.filter(l=>l!==void 0),r=o[1],a=o[2];if(!a)continue;let c;if(r==="rgb"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!1)}else if(r==="rgba"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!0)}else if(r==="hsl"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!1)}else if(r==="hsla"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!0)}else r==="#"&&(c=Dpt(a5(n,s),r+a));c&&e.push(c)}return e}function Ipt(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:kpt(n)}const Y2e=new RegExp("\\bMARK:\\s*(.*)$","d"),Lpt=/^-+|-+$/g;function Tpt(n,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=Rpt(n,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=Mpt(n);t=t.concat(i)}return t}function Rpt(n,e){const t=[],i=n.getLineCount();for(let s=1;s<=i;s++){const o=n.getLineContent(s),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:s,startColumn:r[0].length+1,endLineNumber:s,endColumn:o.length+1};if(a.endColumn>a.startColumn){const c={range:a,...rKe(o.substring(r[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function Mpt(n){const e=[],t=n.getLineCount();for(let i=1;i<=t;i++){const s=n.getLineContent(i);Npt(s,i,e)}return e}function Npt(n,e,t){Y2e.lastIndex=0;const i=Y2e.exec(n);if(i){const s=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:s,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...rKe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function rKe(n){n=n.trim();const e=n.startsWith("-");return n=n.replace(Lpt,""),{text:n,hasSeparatorLine:e}}class Ppt extends Yje{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}const dk=class dk{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new Ppt(P.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const s=this._getModel(e);return s?_Me.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Tpt(i,t):[]}async computeDiff(e,t,i,s){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:dk.computeDiff(o,r,i,s)}static computeDiff(e,t,i,s){const o=s==="advanced"?Kge.getDefault():Kge.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),c=o.computeDiff(r,a,i),l=c.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])])}return{identical:l,quitEarly:c.hitTimeout,changes:d(c.changes),moves:c.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const s=this._getModel(e),o=this._getModel(t);if(!s||!o)return null;const r=s.getLinesContent(),a=o.getLinesContent();return new iKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return O.compareRangesUsingStarts(c.range,l.range);const d=c.range?0:1,h=l.range?0:1;return d-h});let a=0;for(let c=1;cdk._diffLimit){o.push({range:c,text:l});continue}const u=Vft(h,l,i),f=s.offsetAt(O.lift(c).getStartPosition());for(const p of u){const m=s.positionAt(f+p.originalStart),v=s.positionAt(f+p.originalStart+p.originalLength),w={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};s.getValueInRange(w.range)!==w.text&&o.push(w)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return O.compareRangesUsingStarts(a.range,c.range);const l=a.range?0:1,d=c.range?0:1;return l-d});for(let{range:a,text:c,eol:l}of t){let m=function(w,b){return new oe(w.lineNumber+b.lineNumber-1,b.lineNumber===1?w.column+b.column-1:b.column)},v=function(w,b){const C=[];for(let y=b.startLineNumber;y<=b.endLineNumber;y++){const S=w[y-1];y===b.startLineNumber&&y===b.endLineNumber?C.push(S.substring(b.startColumn-1,b.endColumn-1)):y===b.startLineNumber?C.push(S.substring(b.startColumn-1)):y===b.endLineNumber?C.push(S.substring(0,b.endColumn-1)):C.push(S)}return C};if(typeof l=="number"&&(r=l),O.isEmpty(a)&&!c)continue;const d=s.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,s.eol),d===c)continue;if(Math.max(c.length,d.length)>dk._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Kge.getDefault().computeDiff(h,u,i),p=O.lift(a).getStartPosition();for(const w of f.changes)if(w.innerChanges)for(const b of w.innerChanges)o.push({range:O.fromPositions(m(p,b.originalRange.getStartPosition()),m(p,b.originalRange.getEndPosition())),text:v(u,b.modifiedRange).join(s.eol)});else throw new cn("The experimental diff algorithm always produces inner changes")}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?jft(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Ipt(t):null}async textualSuggest(e,t,i,s){const o=new ao,r=new RegExp(i,s),a=new Set;e:for(const c of e){const l=this._getModel(c);if(l){for(const d of l.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>dk._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,s){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let c=t.startLineNumber;cthis._host.fhr(a,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(ORe(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}};dk._diffLimit=1e5,dk._suggestionsLimit=1e4;let IZ=dk;typeof importScripts=="function"&&(globalThis.monaco=WQe());const dl=ae("textResourceConfigurationService"),bMe=ae("textResourcePropertiesService"),ht=ae("ILanguageFeaturesService"),J2e=60*1e3,X2e=5*60*1e3;function FC(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let jve=class extends ${constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new Opt(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>FC(this._modelService,r.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(r.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new Fpt(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return FC(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,s){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Zle(new $b(new bi(c[0],c[1]),new bi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new pw(new bi(l[0],l[1]),new bi(l[2],l[3]),l[4]?.map(d=>new fS(new O(d[0],d[1],d[2],d[3]),new O(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return FC(this._modelService,e)&&FC(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(s=>s.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const s=ao.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,Ta(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const i=ao.create(),s=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(bt(o),this.computeMoreMinimalEdits(e,t,!0)));return s.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),s}else return Promise.resolve(void 0)}canNavigateValueSet(e){return FC(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return FC(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};jve=D([_(0,Ai),_(1,dl),_(2,Ze),_(3,lo),_(4,ht)],jve);class Fpt{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const s=[];if(i.wordBasedSuggestions==="currentDocument")FC(this._modelService,e.uri)&&s.push(e.uri);else for(const h of this._modelService.getModels())FC(this._modelService,h.uri)&&(h===e?s.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&s.push(h.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new O(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):O.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(s,r?.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Ne.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class Opt extends ${constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new sQ).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(X2e/2),yi),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>X2e&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new CMe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Bpt extends ${constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new nQ;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(J2e/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)St(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>J2e&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Z;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],St(t)}}class Z2e{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Yge{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class CMe extends ${constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Pve(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Wgt(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Yge(this)))}catch(e){Nve(e),this._worker=new Z2e(new IZ(new Yge(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Nve(e),this._worker=new Z2e(new IZ(new Yge(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Bpt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(rx()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(s=>s.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeHumanReadableDiff(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const s=await this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,c=r.flags;return s.navigateValueSet(e.toString(),t,i,a,c)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function Wpt(n,e,t){return new Hpt(n,e,t)}class Hpt extends CMe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?ORe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,c)=>e.fmr(a,c),o=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var vt;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(vt||(vt={}));function Upt(n){return n&&typeof n.id=="string"}const mz={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Hc;(function(n){n.CompositionStart="compositionStart",n.CompositionEnd="compositionEnd",n.Type="type",n.ReplacePreviousChar="replacePreviousChar",n.CompositionType="compositionType",n.Paste="paste",n.Cut="cut"})(Hc||(Hc={}));const G9=new class{clone(){return this}equals(n){return this===n}};function aKe(n,e){return new tMe([new A9(0,"",n)],e)}function yMe(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<>>0,new $le(t,e===null?G9:e)}const PA=class PA{static createEmpty(e,t){const i=PA.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new PA(s,e,t)}static createFromTextAndMetadata(e,t){let i=0,s="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,s+=r;return new PA(new Uint32Array(o),s,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof PA?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Xf.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Xf.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Xf.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Xf.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Xf.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Xf.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PA.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new SMe(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(s.length,l),r=c.offset}s+=c.text,o.push(s.length,c.tokenMetadata),i++}else break}return new PA(new Uint32Array(o),s,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;let lh=PA;class SMe{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof SMe?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),s=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(s-this._endOffset))),o}forEach(e){for(let t=0;tt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ls(e.data,t.data)}static equalsArr(e,t){return Ls(e,t,q9.equals)}}class ig{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[c++]=new ig(Math.max(1,l.startColumn-s+1),Math.min(r+1,l.endColumn-s+1),l.className,l.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Rc.Regular||l.type===Rc.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:s;o[r++]=new ig(h,u,l.inlineClassName,l.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ig._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class Gpt{static normalize(e,t){if(t.length===0)return[];const i=[],s=new LZ;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);wl(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);wl(m)&&d--}const f=l-1,p=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(p,h,u)}return s.consumeLowerThan(Zn.MAX_SAFE_SMALL_INTEGER,o,i),i}}const lKe="vs/editor/common/viewLayout/viewLineRenderer";var om;(function(n){n[n.None=0]="None",n[n.Boundary=1]="Boundary",n[n.Selection=2]="Selection",n[n.Trailing=3]="Trailing",n[n.All=4]="All"})(om||(om={}));let dKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class tL{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(ig.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?om.All:v==="boundary"?om.Boundary:v==="selection"?om.Selection:v==="trailing"?om.Trailing:om.None,this.renderControlCharacters=w,this.fontLigatures=b,this.selectionsOnLine=C&&C.sort((M,k)=>M.startOffset>>OC.PART_INDEX_OFFSET}static getCharIndex(e){return(e&OC.CHAR_INDEX_MASK)>>>OC.CHAR_INDEX_OFFSET}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=mv.getPartIndex(t),s=mv.getCharIndex(t);return new hKe(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===s)return m;v>s?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===s)return o;if(c===s)return r;const l=mv.getPartIndex(a),d=mv.getCharIndex(a),h=mv.getPartIndex(c);let u;l!==h?u=t:u=mv.getCharIndex(c);const f=i-d,p=u-i;return f<=p?o:r}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,s=nf.None;for(const r of n.lineDecorations)(r.type===Rc.Before||r.type===Rc.After)&&(e.appendString(''),r.type===Rc.Before&&(s|=nf.Before,t++),r.type===Rc.After&&(s|=nf.After,i++));e.appendString("");const o=new mv(1,t+i);return o.setColumnInfo(1,t,0,0),new Kve(o,!1,s)}return e.appendString(""),new Kve(new mv(0,0),!1,nf.None)}return emt(jpt(n),e)}class qpt{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function ede(n){const e=new fz(1e4),t=lQ(n,e);return new qpt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Qpt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=c,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=u,this.spaceWidth=f,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=v}}function jpt(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,c=n.lineDecorations.length;a0&&(o[r++]=new Xl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=s){const f=e?DU(n.substring(a,s)):!1;o[r++]=new Xl(s,h,0,f);break}const u=e?DU(n.substring(a,d)):!1;o[r++]=new Xl(d,h,0,u),a=d}return o}var bT;(function(n){n[n.LongToken=50]="LongToken"})(bT||(bT={}));function Ypt(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=bT.LongToken&&(s[o++]=new Xl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(s[o++]=new Xl(l,d,h,u))}else s[o++]=c;i=l}else for(let r=0,a=e.length;rbT.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/bT.LongToken);for(let m=1;m=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Jpt(n,e){const t=[];let i=new Xl(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new Xl(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Xl(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new Xl(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Xpt(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,c=n.useMonospaceOptimizations,l=n.selectionsOnLine,d=n.renderWhitespace===om.Boundary,h=n.renderWhitespace===om.Trailing,u=n.renderSpaceWidth!==n.spaceWidth,f=[];let p=0,m=0,v=i[m].type,w=i[m].containsRTL,b=i[m].endIndex;const C=i.length;let y=!1,S=Eu(e),M;S===-1?(y=!0,S=t,M=t):M=Zv(e);let k=!1,F=0,N=l&&l[F],z=a%r;for(let J=o;J=N.endOffset&&(F++,N=l&&l[F]);let re;if(JM)re=!0;else if(j===q.Tab)re=!0;else if(j===q.Space)if(d)if(k)re=!0;else{const me=J+1J),re&&h&&(re=y||J>M),re&&w&&J>=S&&J<=M&&(re=!1),k){if(!re||!c&&z>=r){if(u){const me=p>0?f[p-1].endIndex:o;for(let De=me+1;De<=J;De++)f[p++]=new Xl(De,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(J,"mtkw",Yy.IS_WHITESPACE,!1);z=z%r}}else(J===b||re&&J>o)&&(f[p++]=new Xl(J,v,0,w),z=z%r);for(j===q.Tab?z=r:c1(j)?z+=2:z++,k=re;J===b&&(m++,m0?e.charCodeAt(t-1):q.Null,j=t>1?e.charCodeAt(t-2):q.Null;J===q.Space&&j!==q.Space&&j!==q.Tab||(U=!0)}else U=!0;if(U)if(u){const J=p>0?f[p-1].endIndex:o;for(let j=J+1;j<=t;j++)f[p++]=new Xl(j,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(t,"mtkw",Yy.IS_WHITESPACE,!1);else f[p++]=new Xl(t,v,0,w);return f}function Zpt(n,e,t,i){i.sort(ig.compare);const s=Gpt.normalize(n,i),o=s.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=b.startOffset,a[c++]=new Xl(l,m,v,w)),b.endOffset+1<=p)l=b.endOffset+1,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w),r++;else{l=p,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w);break}}p>l&&(l=p,a[c++]=new Xl(l,m,v,w))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let N=0,z=l.length;N=d&&(wt+=Yi)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*Tt)),e.appendString('px"')),e.appendASCIICharCode(q.GreaterThan);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Yi=2;Yi<=Nt;Yi++)e.appendCharCode(160)}else wt=2,Nt=1,e.appendCharCode(m),e.appendCharCode(8204);M+=wt,k+=Nt,y>=d&&(S+=Nt)}}else for(e.appendASCIICharCode(q.GreaterThan);y=d&&(S+=wt)}Qe?F++:F=0,y>=r&&!C&&U.isPseudoAfter()&&(C=!0,b.setColumnInfo(y+1,N,M,k)),e.appendString("")}return C||b.setColumnInfo(r+1,l.length-1,M,k),a&&(e.appendString(''),e.appendString(g(lKe,0,"Show more ({0})",imt(c))),e.appendString("")),e.appendString(""),new Kve(b,f,s)}function tmt(n){return n.toString(16).toUpperCase().padStart(4,"0")}function imt(n){return n<1024?g(lKe,1,"{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}var nmt=".monaco-aria-container{left:-999em;position:absolute}";Ct(nmt,{});const iWe=2e4;let CT,eJ,Yve,tJ,Jve;function smt(n){CT=document.createElement("div"),CT.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};eJ=e(),Yve=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};tJ=t(),Jve=t(),n.appendChild(CT)}function sa(n){CT&&(eJ.textContent!==n?(Yo(Yve),TZ(eJ,n)):(Yo(eJ),TZ(Yve,n)))}function Cu(n){CT&&(tJ.textContent!==n?(Yo(Jve),TZ(tJ,n)):(Yo(tJ),TZ(Jve,n)))}function TZ(n,e){Yo(n),e.length>iWe&&(e=e.substr(0,iWe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const EMe=ae("markerDecorationsService");var uH;let RZ=(uH=class{constructor(e,t){}dispose(){}},uH.ID="editor.contrib.markerDecorations",uH);RZ=D([_(1,EMe)],RZ);vn(RZ.ID,RZ,mi.Eager);var omt='::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);overflow:visible;position:relative}.monaco-editor,.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);border:1px solid var(--vscode-editor-rangeHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);border:1px solid var(--vscode-editor-symbolHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{overflow:hidden;position:relative}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .margin-view-overlays>div,.monaco-editor .view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{background:var(--vscode-editorError-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{background:var(--vscode-editorWarning-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{background:var(--vscode-editorInfo-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground,inherit)}';Ct(omt,{});class gKe extends ${constructor(e,t){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{xd(gt(this._referenceDomElement),()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}const O2=class O2{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=O2._read(e,this.key),i=o=>O2._read(e,o),s=(o,r)=>O2._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}};O2.items=[];let Q9=O2;function uC(n,e){Q9.items.push(new Q9(n,e))}function bp(n,e){uC(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function rmt(n){Q9.items.forEach(e=>e.apply(n))}bp("wordWrap",[[!0,"on"],[!1,"off"]]);bp("lineNumbers",[[!0,"on"],[!1,"off"]]);bp("cursorBlinking",[["visible","solid"]]);bp("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);bp("renderLineHighlight",[[!0,"line"],[!1,"none"]]);bp("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);bp("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);bp("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("autoIndent",[[!1,"advanced"],[!0,"full"]]);bp("matchBrackets",[[!0,"always"],[!1,"never"]]);bp("renderFinalNewline",[[!0,"on"],[!1,"off"]]);bp("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);bp("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);bp("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);uC("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});uC("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});uC("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const amt={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};uC("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(amt))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});uC("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});uC("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});uC("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});uC("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1;const s={};for(const o of Object.entries(n))typeof o[1]=="boolean"?(i=!0,s[o[0]]=o[1]?"explicit":"never"):s[o[0]]=o[1];i&&t("codeActionsOnSave",s)}});uC("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});uC("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});class cmt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new I,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const g1=new cmt,Ur=ae("accessibilityService");let Xve=class extends ${constructor(e,t,i,s,o,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new I),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new IQe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new gKe(o,s.dimension)),this._targetWindowId=gt(o).vscodeWindowId,this._rawOptions=nWe(s),this._validatedOptions=oE.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(l_.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(g1.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Rve.onDidChange(()=>this._recomputeOptions())),this._register(B9.getInstance(gt(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=oE.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Wk.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:g1.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return oE.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:dmt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:dM||pp,pixelRatio:B9.getInstance(vZ(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Kd.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Rve.readFontInfo(vZ(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=nWe(e);oE.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=oE.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=lmt(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};Xve=D([_(5,Ur)],Xve);function lmt(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function dmt(n){let e="";return!TS&&!HQe&&(e+="no-user-select "),TS&&(e+="no-minimap-shadow ",e+="enable-user-select "),ei&&(e+="mac "),n&&(e+="standalone "),e}class hmt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class umt{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class oE{static validateOptions(e){const t=new hmt;for(const i of HB){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new umt;for(const s of HB)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ls(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!oE._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of HB){const r=!oE._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new kQe(i):null}static applyUpdate(e,t){let i=!1;for(const s of HB)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function nWe(n){const e=Vs(n);return rmt(e),e}var Hk;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},s={...e};let o=0,r;(function(F){F[F.Before=0]="Before",F[F.InProgress=1]="InProgress",F[F.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){b(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}n.onKeyDown=c;function l(){a.keydown===r.InProgress&&(performance.mark("keydown/end"),a.keydown=r.Finished)}function d(){performance.mark("input/start"),a.input=r.InProgress,w()}n.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}n.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){b()}n.onKeyUp=f;function p(){b()}n.onSelectionChange=p;function m(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Before&&(performance.mark("render/start"),a.render=r.InProgress,queueMicrotask(v),w())}n.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function w(){setTimeout(b)}function b(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Finished&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),C("keydown",e),C("input",t),C("render",i),C("inputlatency",s),o++,y())}function C(F,N){const z=performance.getEntriesByName(F)[0].duration;N.total+=z,N.min=Math.min(N.min,z),N.max=Math.max(N.max,z)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),a.keydown=r.Before,a.input=r.Before,a.render=r.Before}function S(){if(o===0)return;const F={keydown:M(e),input:M(t),render:M(i),total:M(s),sampleCount:o};return k(e),k(t),k(i),k(s),o=0,F}n.getAndClearMeasurements=S;function M(F){return{average:F.total/o,max:F.max,min:F.min}}function k(F){F.total=0,F.min=Number.MAX_VALUE,F.max=0}})(Hk||(Hk={}));var hs;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(hs||(hs={}));var Yf;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(Yf||(Yf={}));var Mt;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Mt||(Mt={}));function ja(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.ICodeEditor:!1}function ew(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.IDiffEditor:!1}function HU(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function _z(n){return ja(n)?n:ew(n)?n.getModifiedEditor():HU(n)&&ja(n.activeCodeEditor)?n.activeCodeEditor:null}function gmt(n){return ja(n)||ew(n)?n:null}class vz{constructor(){this._hooks=new Z,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=gt(e)}this._hooks.add(pe(r,xe.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(pe(r,xe.POINTER_UP,a=>this.stopMonitoring(!0)))}}function tde(n){return`--vscode-${n.replace(/\./g,"-")}`}function Ye(n){return`var(${tde(n)})`}function Zve(n,e){return`var(${tde(n)}, ${e})`}var zg;(function(n){n[n.Darken=0]="Darken",n[n.Lighten=1]="Lighten",n[n.Transparent=2]="Transparent",n[n.Opaque=3]="Opaque",n[n.OneOf=4]="OneOf",n[n.LessProminent=5]="LessProminent",n[n.IfDefinedThenElse=6]="IfDefinedThenElse"})(zg||(zg={}));const xMe={ColorContribution:"base.contributions.colors"};class fmt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),s&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}deregisterColor(e){delete this.colorsById[e],delete this.colorSchema.properties[e];const t=this.colorReferenceSchema.enum.indexOf(e);t!==-1&&(this.colorReferenceSchema.enum.splice(t,1),this.colorReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChangeSchema.fire()}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return iv(s,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const ide=new fmt;it.add(xMe.ColorContribution,ide);function B(n,e,t,i,s){return ide.registerColor(n,e,t,i,s)}function pmt(n,e){switch(n.op){case zg.Darken:return iv(n.value,e)?.darken(n.factor);case zg.Lighten:return iv(n.value,e)?.lighten(n.factor);case zg.Transparent:return iv(n.value,e)?.transparent(n.factor);case zg.Opaque:{const t=iv(n.background,e);return t?iv(n.value,e)?.makeOpaque(t):iv(n.value,e)}case zg.OneOf:for(const t of n.values){const i=iv(t,e);if(i)return i}return;case zg.IfDefinedThenElse:return iv(e.defines(n.if)?n.then:n.else,e);case zg.LessProminent:{const t=iv(n.value,e);if(!t)return;const i=iv(n.background,e);return i?t.isDarkerThan(i)?fe.getLighterColor(t,i,n.factor).transparent(n.transparency):fe.getDarkerColor(t,i,n.factor).transparent(n.transparency):t.transparent(n.factor*n.transparency)}default:throw oQ()}}function Am(n,e){return{op:zg.Darken,value:n,factor:e}}function tw(n,e){return{op:zg.Lighten,value:n,factor:e}}function Ie(n,e){return{op:zg.Transparent,value:n,factor:e}}function sWe(n,e){return{op:zg.Opaque,value:n,background:e}}function j9(...n){return{op:zg.OneOf,values:n}}function mmt(n,e,t){return{op:zg.IfDefinedThenElse,if:n,then:e,else:t}}function oWe(n,e,t,i){return{op:zg.LessProminent,value:n,background:e,factor:t,transparency:i}}function iv(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?fe.fromHex(n):e.getColor(n);if(n instanceof fe)return n;if(typeof n=="object")return pmt(n,e)}}const fKe="vscode://schemas/workbench-colors",pKe=it.as(eL.JSONContribution);pKe.registerSchema(fKe,ide.getColorSchema());const rWe=new yn(()=>pKe.notifySchemaChanged(fKe),200);ide.onDidChangeSchema(()=>{rWe.isScheduled()||rWe.schedule()});const vg="vs/platform/theme/common/colors/baseColors",Ge=B("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,0,"Overall foreground color. This color is only used if not overridden by a component.")),aWe=B("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(vg,1,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),cWe=B("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(vg,2,"Overall foreground color for error messages. This color is only used if not overridden by a component."));B("descriptionForeground",{light:"#717171",dark:Ie(Ge,.7),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(vg,3,"Foreground color for description text providing additional information, for example for a label."));const Jy=B("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,4,"The default color for icons in the workbench.")),Zd=B("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(vg,5,"Overall border color for focused elements. This color is only used if not overridden by a component.")),ft=B("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(vg,6,"An extra border around elements to separate them from others for greater contrast.")),co=B("contrastActiveBorder",{light:null,dark:null,hcDark:Zd,hcLight:Zd},g(vg,7,"An extra border around active elements to separate them from others for greater contrast."));B("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},g(vg,8,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const GB=B("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,9,"Foreground color for links in text.")),_mt=B("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,10,"Foreground color for links in text when clicked on and on mouse hover."));B("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:fe.black,hcLight:"#292929"},g(vg,11,"Color for text separators."));B("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(vg,12,"Foreground color for preformatted text segments."));B("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(vg,13,"Background color for preformatted text segments."));const vmt=B("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(vg,14,"Background color for block quotes in text.")),wmt=B("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:fe.white,hcLight:"#292929"},g(vg,15,"Border color for block quotes in text."));B("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:fe.black,hcLight:"#F2F2F2"},g(vg,16,"Background color for code blocks in text."));const iL="vs/platform/theme/common/colors/miscColors";B("sash.hoverBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(iL,0,"Border color of active sashes."));const kW=B("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:fe.black,hcLight:"#0F4A85"},g(iL,1,"Badge background color. Badges are small information labels, e.g. for search results count.")),DMe=B("badge.foreground",{dark:fe.white,light:"#333",hcDark:fe.white,hcLight:fe.white},g(iL,2,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),p_=B("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(iL,3,"Scrollbar shadow to indicate that the view is scrolled.")),d3=B("scrollbarSlider.background",{dark:fe.fromHex("#797979").transparent(.4),light:fe.fromHex("#646464").transparent(.4),hcDark:Ie(ft,.6),hcLight:Ie(ft,.4)},g(iL,4,"Scrollbar slider background color.")),h3=B("scrollbarSlider.hoverBackground",{dark:fe.fromHex("#646464").transparent(.7),light:fe.fromHex("#646464").transparent(.7),hcDark:Ie(ft,.8),hcLight:Ie(ft,.8)},g(iL,5,"Scrollbar slider background color when hovering.")),u3=B("scrollbarSlider.activeBackground",{dark:fe.fromHex("#BFBFBF").transparent(.4),light:fe.fromHex("#000000").transparent(.6),hcDark:ft,hcLight:ft},g(iL,6,"Scrollbar slider background color when clicked on.")),bmt=B("progressBar.background",{dark:fe.fromHex("#0E70C0"),light:fe.fromHex("#0E70C0"),hcDark:ft,hcLight:ft},g(iL,7,"Background color of the progress bar that can show for long running operations.")),Pt="vs/platform/theme/common/colors/editorColors",us=B("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:fe.black,hcLight:fe.white},g(Pt,0,"Editor background color.")),Mc=B("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:fe.white,hcLight:Ge},g(Pt,1,"Editor default foreground color."));B("editorStickyScroll.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,2,"Background color of sticky scroll in the editor"));B("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Pt,3,"Background color of sticky scroll on hover in the editor"));B("editorStickyScroll.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,4,"Border color of sticky scroll in the editor"));B("editorStickyScroll.shadow",{dark:p_,light:p_,hcDark:p_,hcLight:p_},g(Pt,5," Shadow color of sticky scroll in the editor"));const Zs=B("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:fe.white},g(Pt,6,"Background color of editor widgets, such as find/replace.")),ng=B("editorWidget.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Pt,7,"Foreground color of editor widgets, such as find/replace.")),sg=B("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ft,hcLight:ft},g(Pt,8,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));B("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,9,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));B("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,10,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Vh=B("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(Pt,11,"Foreground color of error squigglies in the editor.")),Cmt=B("editorError.border",{dark:null,light:null,hcDark:fe.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(Pt,12,"If set, color of double underlines for errors in the editor.")),Aj=B("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,13,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Gc=B("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(Pt,14,"Foreground color of warning squigglies in the editor.")),K9=B("editorWarning.border",{dark:null,light:null,hcDark:fe.fromHex("#FFCC00").transparent(.8),hcLight:fe.fromHex("#FFCC00").transparent(.8)},g(Pt,15,"If set, color of double underlines for warnings in the editor."));B("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,16,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const qc=B("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(Pt,17,"Foreground color of info squigglies in the editor.")),Y9=B("editorInfo.border",{dark:null,light:null,hcDark:fe.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(Pt,18,"If set, color of double underlines for infos in the editor.")),ymt=B("editorHint.foreground",{dark:fe.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(Pt,19,"Foreground color of hint squigglies in the editor."));B("editorHint.border",{dark:null,light:null,hcDark:fe.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(Pt,20,"If set, color of double underlines for hints in the editor."));const Smt=B("editorLink.activeForeground",{dark:"#4E94CE",light:fe.blue,hcDark:fe.cyan,hcLight:"#292929"},g(Pt,21,"Color of active links.")),Hv=B("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(Pt,22,"Color of the editor selection.")),Amt=B("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:fe.white},g(Pt,23,"Color of the selected text for high contrast.")),mKe=B("editor.inactiveSelectionBackground",{light:Ie(Hv,.5),dark:Ie(Hv,.5),hcDark:Ie(Hv,.7),hcLight:Ie(Hv,.5)},g(Pt,24,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),kMe=B("editor.selectionHighlightBackground",{light:oWe(Hv,us,.3,.6),dark:oWe(Hv,us,.3,.6),hcDark:null,hcLight:null},g(Pt,25,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,26,"Border color for regions with the same content as the selection."));const lWe=B("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(Pt,27,"Color of the current search match.")),Emt=B("editor.findMatchForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,28,"Text color of the current search match.")),Fb=B("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(Pt,29,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),xmt=B("editor.findMatchHighlightForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,30,"Foreground color of the other search matches."),!0);B("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(Pt,31,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.findMatchBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,32,"Border color of the current search match."));const Uk=B("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,33,"Border color of the other search matches.")),Dmt=B("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ie(co,.4),hcLight:Ie(co,.4)},g(Pt,34,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Vk=B("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(Pt,35,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),MZ=B("editorHoverWidget.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,36,"Background color of the editor hover."));B("editorHoverWidget.foreground",{light:ng,dark:ng,hcDark:ng,hcLight:ng},g(Pt,37,"Foreground color of the editor hover."));const _Ke=B("editorHoverWidget.border",{light:sg,dark:sg,hcDark:sg,hcLight:sg},g(Pt,38,"Border color of the editor hover."));B("editorHoverWidget.statusBarBackground",{dark:tw(MZ,.2),light:Am(MZ,.05),hcDark:Zs,hcLight:Zs},g(Pt,39,"Background color of the editor hover status bar."));const bE=B("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:fe.white,hcLight:fe.black},g(Pt,40,"Foreground color of inline hints")),CE=B("editorInlayHint.background",{dark:Ie(kW,.1),light:Ie(kW,.1),hcDark:Ie(fe.white,.1),hcLight:Ie(kW,.1)},g(Pt,41,"Background color of inline hints")),kmt=B("editorInlayHint.typeForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,42,"Foreground color of inline hints for types")),Imt=B("editorInlayHint.typeBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,43,"Background color of inline hints for types")),Lmt=B("editorInlayHint.parameterForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,44,"Foreground color of inline hints for parameters")),Tmt=B("editorInlayHint.parameterBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,45,"Background color of inline hints for parameters")),Ej=B("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(Pt,46,"The color used for the lightbulb actions icon."));B("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(Pt,47,"The color used for the lightbulb auto fix actions icon."));B("editorLightBulbAi.foreground",{dark:Ej,light:Ej,hcDark:Ej,hcLight:Ej},g(Pt,48,"The color used for the lightbulb AI icon."));B("editor.snippetTabstopHighlightBackground",{dark:new fe(new gn(124,124,124,.3)),light:new fe(new gn(10,50,100,.2)),hcDark:new fe(new gn(124,124,124,.3)),hcLight:new fe(new gn(10,50,100,.2))},g(Pt,49,"Highlight background color of a snippet tabstop."));B("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,50,"Highlight border color of a snippet tabstop."));B("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,51,"Highlight background color of the final tabstop of a snippet."));B("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new fe(new gn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(Pt,52,"Highlight border color of the final tabstop of a snippet."));const ewe=new fe(new gn(155,185,85,.2)),twe=new fe(new gn(255,0,0,.2)),m_=B("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(Pt,53,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),yE=B("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(Pt,54,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.insertedLineBackground",{dark:ewe,light:ewe,hcDark:null,hcLight:null},g(Pt,55,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.removedLineBackground",{dark:twe,light:twe,hcDark:null,hcLight:null},g(Pt,56,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,57,"Background color for the margin where lines got inserted."));B("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,58,"Background color for the margin where lines got removed."));const Rmt=B("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,59,"Diff overview ruler foreground for inserted content.")),Mmt=B("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,60,"Diff overview ruler foreground for removed content."));B("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(Pt,61,"Outline color for the text that got inserted."));B("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(Pt,62,"Outline color for text that got removed."));B("diffEditor.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,63,"Border color between the two text editors."));B("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(Pt,64,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));B("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},g(Pt,65,"The background color of unchanged blocks in the diff editor."));B("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},g(Pt,66,"The foreground color of unchanged blocks in the diff editor."));B("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(Pt,67,"The background color of unchanged code in the diff editor."));const __=B("widget.shadow",{dark:Ie(fe.black,.36),light:Ie(fe.black,.16),hcDark:null,hcLight:null},g(Pt,68,"Shadow color of widgets such as find/replace inside the editor.")),UU=B("widget.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,69,"Border color of widgets such as find/replace inside the editor.")),NZ=B("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(Pt,70,"Toolbar background when hovering over actions using the mouse"));B("toolbar.hoverOutline",{dark:null,light:null,hcDark:co,hcLight:co},g(Pt,71,"Toolbar outline when hovering over actions using the mouse"));B("toolbar.activeBackground",{dark:tw(NZ,.1),light:Am(NZ,.1),hcDark:null,hcLight:null},g(Pt,72,"Toolbar background when holding the mouse over actions"));const Nmt=B("breadcrumb.foreground",{light:Ie(Ge,.8),dark:Ie(Ge,.8),hcDark:Ie(Ge,.8),hcLight:Ie(Ge,.8)},g(Pt,73,"Color of focused breadcrumb items.")),Pmt=B("breadcrumb.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,74,"Background color of breadcrumb items.")),dWe=B("breadcrumb.focusForeground",{light:Am(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,73,"Color of focused breadcrumb items.")),Fmt=B("breadcrumb.activeSelectionForeground",{light:Am(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,75,"Color of selected breadcrumb items."));B("breadcrumbPicker.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,76,"Background color of breadcrumb item picker."));const vKe=.5,hWe=fe.fromHex("#40C8AE").transparent(vKe),uWe=fe.fromHex("#40A6FF").transparent(vKe),gWe=fe.fromHex("#606060").transparent(.4),Uv=.4,VU=1,qB=B("merge.currentHeaderBackground",{dark:hWe,light:hWe,hcDark:null,hcLight:null},g(Pt,77,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.currentContentBackground",{dark:Ie(qB,Uv),light:Ie(qB,Uv),hcDark:Ie(qB,Uv),hcLight:Ie(qB,Uv)},g(Pt,78,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const QB=B("merge.incomingHeaderBackground",{dark:uWe,light:uWe,hcDark:null,hcLight:null},g(Pt,79,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.incomingContentBackground",{dark:Ie(QB,Uv),light:Ie(QB,Uv),hcDark:Ie(QB,Uv),hcLight:Ie(QB,Uv)},g(Pt,80,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const jB=B("merge.commonHeaderBackground",{dark:gWe,light:gWe,hcDark:null,hcLight:null},g(Pt,81,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.commonContentBackground",{dark:Ie(jB,Uv),light:Ie(jB,Uv),hcDark:Ie(jB,Uv),hcLight:Ie(jB,Uv)},g(Pt,82,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const zU=B("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(Pt,83,"Border color on headers and the splitter in inline merge-conflicts."));B("editorOverviewRuler.currentContentForeground",{dark:Ie(qB,VU),light:Ie(qB,VU),hcDark:zU,hcLight:zU},g(Pt,84,"Current overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.incomingContentForeground",{dark:Ie(QB,VU),light:Ie(QB,VU),hcDark:zU,hcLight:zU},g(Pt,85,"Incoming overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.commonContentForeground",{dark:Ie(jB,VU),light:Ie(jB,VU),hcDark:zU,hcLight:zU},g(Pt,86,"Common ancestor overview ruler foreground for inline merge-conflicts."));const m$=B("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(Pt,87,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),g3=B("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(Pt,88,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Omt=B("problemsErrorIcon.foreground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(Pt,89,"The color used for the problems error icon.")),Bmt=B("problemsWarningIcon.foreground",{dark:Gc,light:Gc,hcDark:Gc,hcLight:Gc},g(Pt,90,"The color used for the problems warning icon.")),Wmt=B("problemsInfoIcon.foreground",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(Pt,91,"The color used for the problems info icon.")),gC="vs/platform/theme/common/colors/minimapColors",KB=B("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(gC,0,"Minimap marker color for find matches."),!0),nde=B("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,1,"Minimap marker color for repeating editor selections."),!0),fWe=B("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,2,"Minimap marker color for the editor selection."),!0),Hmt=B("minimap.infoHighlight",{dark:qc,light:qc,hcDark:Y9,hcLight:Y9},g(gC,3,"Minimap marker color for infos.")),Umt=B("minimap.warningHighlight",{dark:Gc,light:Gc,hcDark:K9,hcLight:K9},g(gC,4,"Minimap marker color for warnings.")),Vmt=B("minimap.errorHighlight",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(gC,5,"Minimap marker color for errors.")),zmt=B("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},g(gC,6,"Minimap background color.")),$mt=B("minimap.foregroundOpacity",{dark:fe.fromHex("#000f"),light:fe.fromHex("#000f"),hcDark:fe.fromHex("#000f"),hcLight:fe.fromHex("#000f")},g(gC,7,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));B("minimapSlider.background",{light:Ie(d3,.5),dark:Ie(d3,.5),hcDark:Ie(d3,.5),hcLight:Ie(d3,.5)},g(gC,8,"Minimap slider background color."));B("minimapSlider.hoverBackground",{light:Ie(h3,.5),dark:Ie(h3,.5),hcDark:Ie(h3,.5),hcLight:Ie(h3,.5)},g(gC,9,"Minimap slider background color when hovering."));B("minimapSlider.activeBackground",{light:Ie(u3,.5),dark:Ie(u3,.5),hcDark:Ie(u3,.5),hcLight:Ie(u3,.5)},g(gC,10,"Minimap slider background color when clicked on."));const nL="vs/platform/theme/common/colors/chartsColors";B("charts.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(nL,0,"The foreground color used in charts."));B("charts.lines",{dark:Ie(Ge,.5),light:Ie(Ge,.5),hcDark:Ie(Ge,.5),hcLight:Ie(Ge,.5)},g(nL,1,"The color used for horizontal lines in charts."));B("charts.red",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(nL,2,"The red color used in chart visualizations."));B("charts.blue",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(nL,3,"The blue color used in chart visualizations."));B("charts.yellow",{dark:Gc,light:Gc,hcDark:Gc,hcLight:Gc},g(nL,4,"The yellow color used in chart visualizations."));B("charts.orange",{dark:KB,light:KB,hcDark:KB,hcLight:KB},g(nL,5,"The orange color used in chart visualizations."));B("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(nL,6,"The green color used in chart visualizations."));B("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(nL,7,"The purple color used in chart visualizations."));const Lo="vs/platform/theme/common/colors/inputColors",SE=B("input.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,0,"Input box background.")),wKe=B("input.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Lo,1,"Input box foreground.")),_$=B("input.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Lo,2,"Input box border.")),IMe=B("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ft,hcLight:ft},g(Lo,3,"Border color of activated options in input fields."));B("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(Lo,4,"Background color of activated options in input fields."));const hR=B("inputOption.activeBackground",{dark:Ie(Zd,.4),light:Ie(Zd,.2),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,5,"Background hover color of options in input fields.")),LMe=B("inputOption.activeForeground",{dark:fe.white,light:fe.black,hcDark:Ge,hcLight:Ge},g(Lo,6,"Foreground color of activated options in input fields.")),xj=B("input.placeholderForeground",{light:Ie(Ge,.5),dark:Ie(Ge,.5),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(Lo,7,"Input box foreground color for placeholder text.")),Gmt=B("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:fe.black,hcLight:fe.white},g(Lo,8,"Input validation background color for information severity.")),qmt=B("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,9,"Input validation foreground color for information severity.")),Qmt=B("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ft,hcLight:ft},g(Lo,10,"Input validation border color for information severity.")),jmt=B("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:fe.black,hcLight:fe.white},g(Lo,11,"Input validation background color for warning severity.")),Kmt=B("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,12,"Input validation foreground color for warning severity.")),Ymt=B("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ft,hcLight:ft},g(Lo,13,"Input validation border color for warning severity.")),bKe=B("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:fe.black,hcLight:fe.white},g(Lo,14,"Input validation background color for error severity.")),CKe=B("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,15,"Input validation foreground color for error severity.")),yKe=B("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Lo,16,"Input validation border color for error severity.")),Xy=B("dropdown.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,17,"Dropdown background.")),Jmt=B("dropdown.listBackground",{dark:null,light:null,hcDark:fe.black,hcLight:fe.white},g(Lo,18,"Dropdown list background.")),AE=B("dropdown.foreground",{dark:"#F0F0F0",light:Ge,hcDark:fe.white,hcLight:Ge},g(Lo,19,"Dropdown foreground.")),YB=B("dropdown.border",{dark:Xy,light:"#CECECE",hcDark:ft,hcLight:ft},g(Lo,20,"Dropdown border.")),Zy=B("button.foreground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:fe.white},g(Lo,21,"Button foreground color.")),f3=B("button.separator",{dark:Ie(Zy,.4),light:Ie(Zy,.4),hcDark:Ie(Zy,.4),hcLight:Ie(Zy,.4)},g(Lo,22,"Button separator color.")),eS=B("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(Lo,23,"Button background color.")),J9=B("button.hoverBackground",{dark:tw(eS,.2),light:Am(eS,.2),hcDark:eS,hcLight:eS},g(Lo,24,"Button background color when hovering.")),Xmt=B("button.border",{dark:ft,light:ft,hcDark:ft,hcLight:ft},g(Lo,25,"Button border color.")),Zmt=B("button.secondaryForeground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:Ge},g(Lo,26,"Secondary button foreground color.")),iwe=B("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:fe.white},g(Lo,27,"Secondary button background color.")),e_t=B("button.secondaryHoverBackground",{dark:tw(iwe,.2),light:Am(iwe,.2),hcDark:null,hcLight:null},g(Lo,28,"Secondary button background color when hovering.")),t_t=B("checkbox.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(Lo,29,"Background color of checkbox widget."));B("checkbox.selectBackground",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Lo,30,"Background color of checkbox widget when the element it's in is selected."));const i_t=B("checkbox.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(Lo,31,"Foreground color of checkbox widget.")),n_t=B("checkbox.border",{dark:YB,light:YB,hcDark:YB,hcLight:YB},g(Lo,32,"Border color of checkbox widget."));B("checkbox.selectBorder",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(Lo,33,"Border color of checkbox widget when the element it's in is selected."));const s_t=B("keybindingLabel.background",{dark:new fe(new gn(128,128,128,.17)),light:new fe(new gn(221,221,221,.4)),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,34,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),o_t=B("keybindingLabel.foreground",{dark:fe.fromHex("#CCCCCC"),light:fe.fromHex("#555555"),hcDark:fe.white,hcLight:Ge},g(Lo,35,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),r_t=B("keybindingLabel.border",{dark:new fe(new gn(51,51,51,.6)),light:new fe(new gn(204,204,204,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:ft},g(Lo,36,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),a_t=B("keybindingLabel.bottomBorder",{dark:new fe(new gn(68,68,68,.6)),light:new fe(new gn(187,187,187,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:Ge},g(Lo,37,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Yr="vs/platform/theme/common/colors/listColors",c_t=B("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),l_t=B("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,1,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),nwe=B("list.focusOutline",{dark:Zd,light:Zd,hcDark:co,hcLight:co},g(Yr,2,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),d_t=B("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,3,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),v_=B("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,4,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),hm=B("list.activeSelectionForeground",{dark:fe.white,light:fe.white,hcDark:null,hcLight:null},g(Yr,5,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),p3=B("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,6,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),swe=B("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,7,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),h_t=B("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,8,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),u_t=B("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,9,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),g_t=B("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,10,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),f_t=B("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,11,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),SKe=B("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:fe.white.transparent(.1),hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,12,"List/Tree background when hovering over items using the mouse.")),AKe=B("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,13,"List/Tree foreground when hovering over items using the mouse.")),p_t=B("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(Yr,14,"List/Tree drag and drop background when moving items over other items when using the mouse.")),m_t=B("list.dropBetweenBackground",{dark:Jy,light:Jy,hcDark:null,hcLight:null},g(Yr,15,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Vv=B("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Zd,hcLight:Zd},g(Yr,16,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Dj=B("list.focusHighlightForeground",{dark:Vv,light:mmt(v_,Vv,"#BBE7FF"),hcDark:Vv,hcLight:Vv},g(Yr,17,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),__t=B("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(Yr,18,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),pWe=B("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(Yr,19,"Foreground color of list items containing errors."));B("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(Yr,20,"Foreground color of list items containing warnings."));const v_t=B("listFilterWidget.background",{light:Am(Zs,0),dark:tw(Zs,0),hcDark:Zs,hcLight:Zs},g(Yr,21,"Background color of the type filter widget in lists and trees.")),w_t=B("listFilterWidget.outline",{dark:fe.transparent,light:fe.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(Yr,22,"Outline color of the type filter widget in lists and trees.")),b_t=B("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Yr,23,"Outline color of the type filter widget in lists and trees, when there are no matches.")),C_t=B("listFilterWidget.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Yr,24,"Shadow color of the type filter widget in lists and trees."));B("list.filterMatchBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Yr,25,"Background color of the filtered match."));B("list.filterMatchBorder",{dark:Uk,light:Uk,hcDark:ft,hcLight:co},g(Yr,26,"Border color of the filtered match."));const y_t=B("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(Yr,27,"List/Tree foreground color for items that are deemphasized.")),uR=B("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(Yr,28,"Tree stroke color for the indentation guides.")),S_t=B("tree.inactiveIndentGuidesStroke",{dark:Ie(uR,.4),light:Ie(uR,.4),hcDark:Ie(uR,.4),hcLight:Ie(uR,.4)},g(Yr,29,"Tree stroke color for the indentation guides that are not active.")),A_t=B("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(Yr,30,"Table border color between columns.")),E_t=B("tree.tableOddRowsBackground",{dark:Ie(Ge,.04),light:Ie(Ge,.04),hcDark:null,hcLight:null},g(Yr,31,"Background color for odd table rows.")),uO="vs/platform/theme/common/colors/menuColors",x_t=B("menu.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(uO,0,"Border color of menus.")),D_t=B("menu.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(uO,1,"Foreground color of menu items.")),k_t=B("menu.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(uO,2,"Background color of menu items.")),I_t=B("menu.selectionForeground",{dark:hm,light:hm,hcDark:hm,hcLight:hm},g(uO,3,"Foreground color of the selected menu item in menus.")),L_t=B("menu.selectionBackground",{dark:v_,light:v_,hcDark:v_,hcLight:v_},g(uO,4,"Background color of the selected menu item in menus.")),T_t=B("menu.selectionBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(uO,5,"Border color of the selected menu item in menus.")),R_t=B("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ft,hcLight:ft},g(uO,6,"Color of a separator menu item in menus.")),Zx="vs/platform/theme/common/colors/quickpickColors",mWe=B("quickInput.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Zx,0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),M_t=B("quickInput.foreground",{dark:ng,light:ng,hcDark:ng,hcLight:ng},g(Zx,1,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),N_t=B("quickInputTitle.background",{dark:new fe(new gn(255,255,255,.105)),light:new fe(new gn(0,0,0,.06)),hcDark:"#000000",hcLight:fe.white},g(Zx,2,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),EKe=B("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,3,"Quick picker color for grouping labels.")),P_t=B("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,4,"Quick picker color for grouping borders.")),_We=B("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,g(Zx,5,"Please use quickInputList.focusBackground instead")),zk=B("quickInputList.focusForeground",{dark:hm,light:hm,hcDark:hm,hcLight:hm},g(Zx,6,"Quick picker foreground color for the focused item.")),JB=B("quickInputList.focusIconForeground",{dark:p3,light:p3,hcDark:p3,hcLight:p3},g(Zx,7,"Quick picker icon foreground color for the focused item.")),$k=B("quickInputList.focusBackground",{dark:j9(_We,v_),light:j9(_We,v_),hcDark:null,hcLight:null},g(Zx,8,"Quick picker background color for the focused item.")),TMe="vs/platform/theme/common/colors/searchColors";B("search.resultsInfoForeground",{light:Ge,dark:Ie(Ge,.65),hcDark:Ge,hcLight:Ge},g(TMe,0,"Color of the text in the search viewlet's completion message."));B("searchEditor.findMatchBackground",{light:Ie(Fb,.66),dark:Ie(Fb,.66),hcDark:Fb,hcLight:Fb},g(TMe,1,"Color of the Search Editor query matches."));B("searchEditor.findMatchBorder",{light:Ie(Uk,.66),dark:Ie(Uk,.66),hcDark:Uk,hcLight:Uk},g(TMe,2,"Border color of the Search Editor query matches."));class sde{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new xKe(this.x-e.scrollX,this.y-e.scrollY)}}class xKe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new sde(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class F_t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class O_t{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function RMe(n){const e=ia(n);return new F_t(e.left,e.top,e.width,e.height)}function MMe(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new O_t(o,r)}class f1 extends yu{constructor(e,t,i){super(gt(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new sde(this.posx,this.posy),this.editorPos=RMe(i),this.relativePos=MMe(i,this.editorPos,this.pos)}}class B_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return pe(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return pe(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return pe(e,xe.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return pe(e,xe.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return pe(e,"mousemove",i=>t(this._create(i)))}}class W_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return pe(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return pe(e,xe.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return pe(e,"pointermove",i=>t(this._create(i)))}}class H_t extends ${constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new vz),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Xo(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new f1(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const lae=class lae{constructor(e){this._editor=e,this._instanceId=++lae._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new yn(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new U_t(t,`dyn-rule-${this._instanceId}-${s}`,P9(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};lae._idPool=0;let PZ=lae;class U_t{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=od(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const s in t){const o=t[s];let r;typeof o=="object"?r=Ye(o.id):r=o;const a=V_t(s);i+=` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function q2e(n){let e=0;for(;eS===M))return new JY([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new JY([new pw(new bi(1,e.length+1),new bi(1,t.length+1),[new fS(new O(1,1,e.length,e[e.length-1].length+1),new O(1,1,t.length,t[t.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?$9.instance:new lpt(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let M=r.get(S);return M===void 0&&(M=r.size,r.set(S,M)),M}const c=e.map(S=>a(S.trim())),l=t.map(S=>a(S.trim())),d=new G2e(c,e),h=new G2e(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,s,(S,M)=>e[S]===t[M]?t[M].length===0?.1:1+Math.log(1+t[M].length):.99):this.myersDiffingAlgorithm.compute(d,h,s);let f=u.diffs,p=u.hitTimeout;f=Qve(d,h,f),f=Apt(d,h,f);const m=[],v=S=>{if(o)for(let M=0;MS.seq1Range.start-w===S.seq2Range.start-b);const M=S.seq1Range.start-w;v(M),w=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const k=this.refineDiff(e,t,S,s,o);k.hitTimeout&&(p=!0);for(const F of k.mappings)m.push(F)}v(e.length-w);const C=Q2e(m,e,t);let y=[];return i.computeMoves&&(y=this.computeMoves(C,e,t,c,l,s,o)),fw(()=>{function S(k,F){if(k.lineNumber<1||k.lineNumber>F.length)return!1;const N=F[k.lineNumber-1];return!(k.column<1||k.column>N.length+1)}function M(k,F){return!(k.startLineNumber<1||k.startLineNumber>F.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>F.length+1)}for(const k of C){if(!k.innerChanges)return!1;for(const F of k.innerChanges)if(!(S(F.modifiedRange.getStartPosition(),t)&&S(F.modifiedRange.getEndPosition(),t)&&S(F.originalRange.getStartPosition(),e)&&S(F.originalRange.getEndPosition(),e)))return!1;if(!M(k.modified,t)||!M(k.original,e))return!1}return!0}),new JY(C,y,p)}computeMoves(e,t,i,s,o,r,a){return fpt(e,t,i,s,o,r).map(d=>{const h=this.refineDiff(t,i,new ml(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=Q2e(h.mappings,t,i,!0);return new Zle(d,u)})}refineDiff(e,t,i,s,o){const r=new kZ(e,i.seq1Range,o),a=new kZ(t,i.seq2Range,o),c=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let l=c.diffs;return l=Qve(r,a,l),l=ypt(r,a,l),l=Cpt(r,a,l),l=Ept(r,a,l),{mappings:l.map(h=>new fS(r.translateRange(h.seq1Range),a.translateRange(h.seq2Range))),hitTimeout:c.hitTimeout}}}function Q2e(n,e,t,i=!1){const s=[];for(const o of NRe(n.map(r=>xpt(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new pw(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return fw(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||t.length-s[s.length-1].modified.endLineNumberExclusive!==e.length-s[s.length-1].original.endLineNumberExclusive)?!1:gz(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new bi(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new bi(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new pw(o,r,[n])}const Kge={getLegacy:()=>new rpt,getDefault:()=>new sKe};function LI(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class gn{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Av{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.l=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let c=0,l=0;const d=(a+r)/2,h=r-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),r){case t:c=(i-s)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,c;if(i===0)r=a=c=s;else{const l=s<.5?s*(1+i):s+i-s*i,d=2*s-l;r=Av._hue2rgb(d,l,t+1/3),a=Av._hue2rgb(d,l,t),c=Av._hue2rgb(d,l,t-1/3)}return new gn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class Ky{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=LI(Math.max(Math.min(1,t),0),3),this.v=LI(Math.max(Math.min(1,i),0),3),this.a=LI(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-s)/a%6+6)%6:o===i?l=(s-t)/a+2:l=(t-i)/a+4,new Ky(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),c=s-r;let[l,d,h]=[0,0,0];return t<60?(l=r,d=a):t<120?(l=a,d=r):t<180?(d=r,h=a):t<240?(d=a,h=r):t<300?(l=a,h=r):t<=360&&(l=r,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new gn(l,d,h,o)}}var Fo;let fe=(Fo=class{static fromHex(e){return Fo.Format.CSS.parseHex(e)||Fo.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Av.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Ky.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof gn)this.rgba=e;else if(e instanceof Av)this._hsla=e,this.rgba=Av.toRGBA(e);else if(e instanceof Ky)this._hsva=e,this.rgba=Ky.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&gn.equals(this.rgba,e.rgba)&&Av.equals(this.hsla,e.hsla)&&Ky.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=Fo._relativeLuminanceForComponent(this.rgba.r),t=Fo._relativeLuminanceForComponent(this.rgba.g),i=Fo._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return LI(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}getContrastRatio(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return tFo._flatten(s,i));return Fo._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new Fo(new gn(i*t.rgba.r+e.rgba.a*e.rgba.r,i*t.rgba.g+e.rgba.a*e.rgba.g,i*t.rgba.b+e.rgba.a*e.rgba.b))}toString(){return this._toString||(this._toString=Fo.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-s)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(s-o)/s,e.darken(i)}},Fo.white=new Fo(new gn(255,255,255,1)),Fo.black=new Fo(new gn(0,0,0,1)),Fo.red=new Fo(new gn(255,0,0,1)),Fo.blue=new Fo(new gn(0,0,255,1)),Fo.green=new Fo(new gn(0,255,0,1)),Fo.cyan=new Fo(new gn(0,255,255,1)),Fo.lightgrey=new Fo(new gn(211,211,211,1)),Fo.transparent=new Fo(new gn(0,0,0,0)),Fo);(function(n){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:n.Format.CSS.formatRGBA(f)}t.formatRGB=i;function s(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=s;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(f)}t.formatHSL=o;function r(f){return`hsla(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%, ${f.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(f){const p=f.toString(16);return p.length!==2?"0"+p:p}function c(f){return`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}`}t.formatHex=c;function l(f,p=!1){return p&&f.rgba.a===1?n.Format.CSS.formatHex(f):`#${a(f.rgba.r)}${a(f.rgba.g)}${a(f.rgba.b)}${a(Math.round(f.rgba.a*255))}`}t.formatHexA=l;function d(f){return f.isOpaque()?n.Format.CSS.formatHex(f):n.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==Q.Hash)return null;if(p===7){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new n(new gn(m,v,w,1))}if(p===9){const m=16*u(f.charCodeAt(1))+u(f.charCodeAt(2)),v=16*u(f.charCodeAt(3))+u(f.charCodeAt(4)),w=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),b=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new n(new gn(m,v,w,b/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3));return new n(new gn(16*m+m,16*v+v,16*w+w))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),w=u(f.charCodeAt(3)),b=u(f.charCodeAt(4));return new n(new gn(16*m+m,16*v+v,16*w+w,(16*b+b)/255))}return null}t.parseHex=h;function u(f){switch(f){case Q.Digit0:return 0;case Q.Digit1:return 1;case Q.Digit2:return 2;case Q.Digit3:return 3;case Q.Digit4:return 4;case Q.Digit5:return 5;case Q.Digit6:return 6;case Q.Digit7:return 7;case Q.Digit8:return 8;case Q.Digit9:return 9;case Q.a:return 10;case Q.A:return 10;case Q.b:return 11;case Q.B:return 11;case Q.c:return 12;case Q.C:return 12;case Q.d:return 13;case Q.D:return 13;case Q.e:return 14;case Q.E:return 14;case Q.f:return 15;case Q.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(fe||(fe={}));function oKe(n){const e=[];for(const t of n){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function wMe(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function a5(n,e){const t=e.index,i=e[0].length;if(!t)return;const s=n.positionAt(t);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+i}}function Dpt(n,e){if(!n)return;const t=fe.Format.CSS.parseHex(e);if(t)return{range:n,color:wMe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function j2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s);return{range:n,color:wMe(o[0],o[1],o[2],t?o[3]:1)}}function K2e(n,e,t){if(!n||e.length!==1)return;const s=e[0].values(),o=oKe(s),r=new fe(new Av(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:wMe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function c5(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function kpt(n){const e=[],i=c5(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const s of i){const o=s.filter(l=>l!==void 0),r=o[1],a=o[2];if(!a)continue;let c;if(r==="rgb"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!1)}else if(r==="rgba"){const l=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=j2e(a5(n,s),c5(a,l),!0)}else if(r==="hsl"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!1)}else if(r==="hsla"){const l=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;c=K2e(a5(n,s),c5(a,l),!0)}else r==="#"&&(c=Dpt(a5(n,s),r+a));c&&e.push(c)}return e}function Ipt(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:kpt(n)}const Y2e=new RegExp("\\bMARK:\\s*(.*)$","d"),Lpt=/^-+|-+$/g;function Tpt(n,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=Rpt(n,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=Mpt(n);t=t.concat(i)}return t}function Rpt(n,e){const t=[],i=n.getLineCount();for(let s=1;s<=i;s++){const o=n.getLineContent(s),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:s,startColumn:r[0].length+1,endLineNumber:s,endColumn:o.length+1};if(a.endColumn>a.startColumn){const c={range:a,...rKe(o.substring(r[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function Mpt(n){const e=[],t=n.getLineCount();for(let i=1;i<=t;i++){const s=n.getLineContent(i);Npt(s,i,e)}return e}function Npt(n,e,t){Y2e.lastIndex=0;const i=Y2e.exec(n);if(i){const s=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:s,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...rKe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function rKe(n){n=n.trim();const e=n.startsWith("-");return n=n.replace(Lpt,""),{text:n,hasSeparatorLine:e}}class Ppt extends Yje{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}const dk=class dk{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new Ppt(P.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const s=this._getModel(e);return s?_Me.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Tpt(i,t):[]}async computeDiff(e,t,i,s){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:dk.computeDiff(o,r,i,s)}static computeDiff(e,t,i,s){const o=s==="advanced"?Kge.getDefault():Kge.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),c=o.computeDiff(r,a,i),l=c.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])])}return{identical:l,quitEarly:c.hitTimeout,changes:d(c.changes),moves:c.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const s=this._getModel(e),o=this._getModel(t);if(!s||!o)return null;const r=s.getLinesContent(),a=o.getLinesContent();return new iKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return O.compareRangesUsingStarts(c.range,l.range);const d=c.range?0:1,h=l.range?0:1;return d-h});let a=0;for(let c=1;cdk._diffLimit){o.push({range:c,text:l});continue}const u=Vft(h,l,i),f=s.offsetAt(O.lift(c).getStartPosition());for(const p of u){const m=s.positionAt(f+p.originalStart),v=s.positionAt(f+p.originalStart+p.originalLength),w={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};s.getValueInRange(w.range)!==w.text&&o.push(w)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return O.compareRangesUsingStarts(a.range,c.range);const l=a.range?0:1,d=c.range?0:1;return l-d});for(let{range:a,text:c,eol:l}of t){let m=function(w,b){return new oe(w.lineNumber+b.lineNumber-1,b.lineNumber===1?w.column+b.column-1:b.column)},v=function(w,b){const C=[];for(let y=b.startLineNumber;y<=b.endLineNumber;y++){const S=w[y-1];y===b.startLineNumber&&y===b.endLineNumber?C.push(S.substring(b.startColumn-1,b.endColumn-1)):y===b.startLineNumber?C.push(S.substring(b.startColumn-1)):y===b.endLineNumber?C.push(S.substring(0,b.endColumn-1)):C.push(S)}return C};if(typeof l=="number"&&(r=l),O.isEmpty(a)&&!c)continue;const d=s.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,s.eol),d===c)continue;if(Math.max(c.length,d.length)>dk._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Kge.getDefault().computeDiff(h,u,i),p=O.lift(a).getStartPosition();for(const w of f.changes)if(w.innerChanges)for(const b of w.innerChanges)o.push({range:O.fromPositions(m(p,b.originalRange.getStartPosition()),m(p,b.originalRange.getEndPosition())),text:v(u,b.modifiedRange).join(s.eol)});else throw new cn("The experimental diff algorithm always produces inner changes")}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?jft(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Ipt(t):null}async textualSuggest(e,t,i,s){const o=new ao,r=new RegExp(i,s),a=new Set;e:for(const c of e){const l=this._getModel(c);if(l){for(const d of l.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>dk._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,s){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let c=t.startLineNumber;cthis._host.fhr(a,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(ORe(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}};dk._diffLimit=1e5,dk._suggestionsLimit=1e4;let IZ=dk;typeof importScripts=="function"&&(globalThis.monaco=WQe());const dl=ae("textResourceConfigurationService"),bMe=ae("textResourcePropertiesService"),ht=ae("ILanguageFeaturesService"),J2e=60*1e3,X2e=5*60*1e3;function FC(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let jve=class extends ${constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new Opt(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>FC(this._modelService,r.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(r.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new Fpt(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return FC(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,s){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Zle(new $b(new bi(c[0],c[1]),new bi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new pw(new bi(l[0],l[1]),new bi(l[2],l[3]),l[4]?.map(d=>new fS(new O(d[0],d[1],d[2],d[3]),new O(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return FC(this._modelService,e)&&FC(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(s=>s.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const s=ao.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,Ta(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(mo(t)){if(!FC(this._modelService,e))return Promise.resolve(t);const i=ao.create(),s=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(bt(o),this.computeMoreMinimalEdits(e,t,!0)));return s.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),s}else return Promise.resolve(void 0)}canNavigateValueSet(e){return FC(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return FC(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};jve=D([_(0,Ai),_(1,dl),_(2,Ze),_(3,lo),_(4,ht)],jve);class Fpt{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const s=[];if(i.wordBasedSuggestions==="currentDocument")FC(this._modelService,e.uri)&&s.push(e.uri);else for(const h of this._modelService.getModels())FC(this._modelService,h.uri)&&(h===e?s.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&s.push(h.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new O(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):O.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(s,r?.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Ne.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class Opt extends ${constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new sQ).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(X2e/2),yi),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>X2e&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new CMe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Bpt extends ${constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new nQ;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(J2e/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)St(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>J2e&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Z;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],St(t)}}class Z2e{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Yge{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class CMe extends ${constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Pve(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Wgt(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Yge(this)))}catch(e){Nve(e),this._worker=new Z2e(new IZ(new Yge(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Nve(e),this._worker=new Z2e(new IZ(new Yge(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Bpt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(rx()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(s=>s.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeHumanReadableDiff(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const s=await this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,c=r.flags;return s.navigateValueSet(e.toString(),t,i,a,c)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function Wpt(n,e,t){return new Hpt(n,e,t)}class Hpt extends CMe{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?ORe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,c)=>e.fmr(a,c),o=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var vt;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(vt||(vt={}));function Upt(n){return n&&typeof n.id=="string"}const mz={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Uc;(function(n){n.CompositionStart="compositionStart",n.CompositionEnd="compositionEnd",n.Type="type",n.ReplacePreviousChar="replacePreviousChar",n.CompositionType="compositionType",n.Paste="paste",n.Cut="cut"})(Uc||(Uc={}));const G9=new class{clone(){return this}equals(n){return this===n}};function aKe(n,e){return new tMe([new A9(0,"",n)],e)}function yMe(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<$i.LANGUAGEID_OFFSET|Ar.Other<<$i.TOKEN_TYPE_OFFSET|ar.None<<$i.FONT_STYLE_OFFSET|Ad.DefaultForeground<<$i.FOREGROUND_OFFSET|Ad.DefaultBackground<<$i.BACKGROUND_OFFSET)>>>0,new $le(t,e===null?G9:e)}const PA=class PA{static createEmpty(e,t){const i=PA.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new PA(s,e,t)}static createFromTextAndMetadata(e,t){let i=0,s="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,s+=r;return new PA(new Uint32Array(o),s,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof PA?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Xf.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Xf.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Xf.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Xf.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Xf.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Xf.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PA.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new SMe(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(s.length,l),r=c.offset}s+=c.text,o.push(s.length,c.tokenMetadata),i++}else break}return new PA(new Uint32Array(o),s,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;let lh=PA;class SMe{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof SMe?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),s=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(s-this._endOffset))),o}forEach(e){for(let t=0;tt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ls(e.data,t.data)}static equalsArr(e,t){return Ls(e,t,q9.equals)}}class ig{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[c++]=new ig(Math.max(1,l.startColumn-s+1),Math.min(r+1,l.endColumn-s+1),l.className,l.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Rc.Regular||l.type===Rc.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:s;o[r++]=new ig(h,u,l.inlineClassName,l.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ig._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class Gpt{static normalize(e,t){if(t.length===0)return[];const i=[],s=new LZ;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);wl(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);wl(m)&&d--}const f=l-1,p=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(p,h,u)}return s.consumeLowerThan(Zn.MAX_SAFE_SMALL_INTEGER,o,i),i}}const lKe="vs/editor/common/viewLayout/viewLineRenderer";var om;(function(n){n[n.None=0]="None",n[n.Boundary=1]="Boundary",n[n.Selection=2]="Selection",n[n.Trailing=3]="Trailing",n[n.All=4]="All"})(om||(om={}));let dKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class tL{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(ig.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?om.All:v==="boundary"?om.Boundary:v==="selection"?om.Selection:v==="trailing"?om.Trailing:om.None,this.renderControlCharacters=w,this.fontLigatures=b,this.selectionsOnLine=C&&C.sort((M,k)=>M.startOffset>>OC.PART_INDEX_OFFSET}static getCharIndex(e){return(e&OC.CHAR_INDEX_MASK)>>>OC.CHAR_INDEX_OFFSET}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=mv.getPartIndex(t),s=mv.getCharIndex(t);return new hKe(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===s)return m;v>s?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===s)return o;if(c===s)return r;const l=mv.getPartIndex(a),d=mv.getCharIndex(a),h=mv.getPartIndex(c);let u;l!==h?u=t:u=mv.getCharIndex(c);const f=i-d,p=u-i;return f<=p?o:r}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,s=nf.None;for(const r of n.lineDecorations)(r.type===Rc.Before||r.type===Rc.After)&&(e.appendString(''),r.type===Rc.Before&&(s|=nf.Before,t++),r.type===Rc.After&&(s|=nf.After,i++));e.appendString("");const o=new mv(1,t+i);return o.setColumnInfo(1,t,0,0),new Kve(o,!1,s)}return e.appendString(""),new Kve(new mv(0,0),!1,nf.None)}return emt(jpt(n),e)}class qpt{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function ede(n){const e=new fz(1e4),t=lQ(n,e);return new qpt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Qpt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=c,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=u,this.spaceWidth=f,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=v}}function jpt(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,c=n.lineDecorations.length;a0&&(o[r++]=new Xl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=s){const f=e?DU(n.substring(a,s)):!1;o[r++]=new Xl(s,h,0,f);break}const u=e?DU(n.substring(a,d)):!1;o[r++]=new Xl(d,h,0,u),a=d}return o}var bT;(function(n){n[n.LongToken=50]="LongToken"})(bT||(bT={}));function Ypt(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=bT.LongToken&&(s[o++]=new Xl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(s[o++]=new Xl(l,d,h,u))}else s[o++]=c;i=l}else for(let r=0,a=e.length;rbT.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/bT.LongToken);for(let m=1;m=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Jpt(n,e){const t=[];let i=new Xl(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new Xl(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Xl(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new Xl(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Xpt(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,c=n.useMonospaceOptimizations,l=n.selectionsOnLine,d=n.renderWhitespace===om.Boundary,h=n.renderWhitespace===om.Trailing,u=n.renderSpaceWidth!==n.spaceWidth,f=[];let p=0,m=0,v=i[m].type,w=i[m].containsRTL,b=i[m].endIndex;const C=i.length;let y=!1,S=Eu(e),M;S===-1?(y=!0,S=t,M=t):M=Zv(e);let k=!1,F=0,N=l&&l[F],z=a%r;for(let J=o;J=N.endOffset&&(F++,N=l&&l[F]);let re;if(JM)re=!0;else if(j===Q.Tab)re=!0;else if(j===Q.Space)if(d)if(k)re=!0;else{const me=J+1J),re&&h&&(re=y||J>M),re&&w&&J>=S&&J<=M&&(re=!1),k){if(!re||!c&&z>=r){if(u){const me=p>0?f[p-1].endIndex:o;for(let De=me+1;De<=J;De++)f[p++]=new Xl(De,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(J,"mtkw",Yy.IS_WHITESPACE,!1);z=z%r}}else(J===b||re&&J>o)&&(f[p++]=new Xl(J,v,0,w),z=z%r);for(j===Q.Tab?z=r:c1(j)?z+=2:z++,k=re;J===b&&(m++,m0?e.charCodeAt(t-1):Q.Null,j=t>1?e.charCodeAt(t-2):Q.Null;J===Q.Space&&j!==Q.Space&&j!==Q.Tab||(U=!0)}else U=!0;if(U)if(u){const J=p>0?f[p-1].endIndex:o;for(let j=J+1;j<=t;j++)f[p++]=new Xl(j,"mtkw",Yy.IS_WHITESPACE,!1)}else f[p++]=new Xl(t,"mtkw",Yy.IS_WHITESPACE,!1);else f[p++]=new Xl(t,v,0,w);return f}function Zpt(n,e,t,i){i.sort(ig.compare);const s=Gpt.normalize(n,i),o=s.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=b.startOffset,a[c++]=new Xl(l,m,v,w)),b.endOffset+1<=p)l=b.endOffset+1,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w),r++;else{l=p,a[c++]=new Xl(l,m+" "+b.className,v|b.metadata,w);break}}p>l&&(l=p,a[c++]=new Xl(l,m,v,w))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let N=0,z=l.length;N=d&&(wt+=Ji)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*Tt)),e.appendString('px"')),e.appendASCIICharCode(Q.GreaterThan);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ji=2;Ji<=Nt;Ji++)e.appendCharCode(160)}else wt=2,Nt=1,e.appendCharCode(m),e.appendCharCode(8204);M+=wt,k+=Nt,y>=d&&(S+=Nt)}}else for(e.appendASCIICharCode(Q.GreaterThan);y=d&&(S+=wt)}Qe?F++:F=0,y>=r&&!C&&U.isPseudoAfter()&&(C=!0,b.setColumnInfo(y+1,N,M,k)),e.appendString("")}return C||b.setColumnInfo(r+1,l.length-1,M,k),a&&(e.appendString(''),e.appendString(g(lKe,0,"Show more ({0})",imt(c))),e.appendString("")),e.appendString(""),new Kve(b,f,s)}function tmt(n){return n.toString(16).toUpperCase().padStart(4,"0")}function imt(n){return n<1024?g(lKe,1,"{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}var nmt=".monaco-aria-container{left:-999em;position:absolute}";Ct(nmt,{});const iWe=2e4;let CT,eJ,Yve,tJ,Jve;function smt(n){CT=document.createElement("div"),CT.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};eJ=e(),Yve=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),CT.appendChild(i),i};tJ=t(),Jve=t(),n.appendChild(CT)}function sa(n){CT&&(eJ.textContent!==n?(Yo(Yve),TZ(eJ,n)):(Yo(eJ),TZ(Yve,n)))}function Cu(n){CT&&(tJ.textContent!==n?(Yo(Jve),TZ(tJ,n)):(Yo(tJ),TZ(Jve,n)))}function TZ(n,e){Yo(n),e.length>iWe&&(e=e.substr(0,iWe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const EMe=ae("markerDecorationsService");var uH;let RZ=(uH=class{constructor(e,t){}dispose(){}},uH.ID="editor.contrib.markerDecorations",uH);RZ=D([_(1,EMe)],RZ);vn(RZ.ID,RZ,mi.Eager);var omt='::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);overflow:visible;position:relative}.monaco-editor,.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);border:1px solid var(--vscode-editor-rangeHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);border:1px solid var(--vscode-editor-symbolHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{overflow:hidden;position:relative}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .margin-view-overlays>div,.monaco-editor .view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{background:var(--vscode-editorError-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{background:var(--vscode-editorWarning-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{background:var(--vscode-editorInfo-background);content:"";display:block;height:100%;width:100%}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground,inherit)}';Ct(omt,{});class gKe extends ${constructor(e,t){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{xd(gt(this._referenceDomElement),()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}const O2=class O2{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=O2._read(e,this.key),i=o=>O2._read(e,o),s=(o,r)=>O2._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}};O2.items=[];let Q9=O2;function uC(n,e){Q9.items.push(new Q9(n,e))}function bp(n,e){uC(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function rmt(n){Q9.items.forEach(e=>e.apply(n))}bp("wordWrap",[[!0,"on"],[!1,"off"]]);bp("lineNumbers",[[!0,"on"],[!1,"off"]]);bp("cursorBlinking",[["visible","solid"]]);bp("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);bp("renderLineHighlight",[[!0,"line"],[!1,"none"]]);bp("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);bp("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);bp("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);bp("autoIndent",[[!1,"advanced"],[!0,"full"]]);bp("matchBrackets",[[!0,"always"],[!1,"never"]]);bp("renderFinalNewline",[[!0,"on"],[!1,"off"]]);bp("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);bp("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);bp("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);uC("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});uC("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});uC("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const amt={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};uC("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(amt))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});uC("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});uC("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});uC("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});uC("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1;const s={};for(const o of Object.entries(n))typeof o[1]=="boolean"?(i=!0,s[o[0]]=o[1]?"explicit":"never"):s[o[0]]=o[1];i&&t("codeActionsOnSave",s)}});uC("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});uC("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});class cmt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new I,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const g1=new cmt,Ur=ae("accessibilityService");let Xve=class extends ${constructor(e,t,i,s,o,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new I),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new IQe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new gKe(o,s.dimension)),this._targetWindowId=gt(o).vscodeWindowId,this._rawOptions=nWe(s),this._validatedOptions=oE.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(l_.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(g1.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Rve.onDidChange(()=>this._recomputeOptions())),this._register(B9.getInstance(gt(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=oE.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Wk.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:g1.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return oE.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:dmt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:dM||pp,pixelRatio:B9.getInstance(vZ(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Kd.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Rve.readFontInfo(vZ(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=nWe(e);oE.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=oE.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=lmt(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};Xve=D([_(5,Ur)],Xve);function lmt(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function dmt(n){let e="";return!TS&&!HQe&&(e+="no-user-select "),TS&&(e+="no-minimap-shadow ",e+="enable-user-select "),ei&&(e+="mac "),n&&(e+="standalone "),e}class hmt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class umt{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class oE{static validateOptions(e){const t=new hmt;for(const i of HB){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new umt;for(const s of HB)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ls(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!oE._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of HB){const r=!oE._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new kQe(i):null}static applyUpdate(e,t){let i=!1;for(const s of HB)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function nWe(n){const e=Vs(n);return rmt(e),e}var Hk;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},s={...e};let o=0,r;(function(F){F[F.Before=0]="Before",F[F.InProgress=1]="InProgress",F[F.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){b(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}n.onKeyDown=c;function l(){a.keydown===r.InProgress&&(performance.mark("keydown/end"),a.keydown=r.Finished)}function d(){performance.mark("input/start"),a.input=r.InProgress,w()}n.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}n.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){b()}n.onKeyUp=f;function p(){b()}n.onSelectionChange=p;function m(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Before&&(performance.mark("render/start"),a.render=r.InProgress,queueMicrotask(v),w())}n.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function w(){setTimeout(b)}function b(){a.keydown===r.Finished&&a.input===r.Finished&&a.render===r.Finished&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),C("keydown",e),C("input",t),C("render",i),C("inputlatency",s),o++,y())}function C(F,N){const z=performance.getEntriesByName(F)[0].duration;N.total+=z,N.min=Math.min(N.min,z),N.max=Math.max(N.max,z)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),a.keydown=r.Before,a.input=r.Before,a.render=r.Before}function S(){if(o===0)return;const F={keydown:M(e),input:M(t),render:M(i),total:M(s),sampleCount:o};return k(e),k(t),k(i),k(s),o=0,F}n.getAndClearMeasurements=S;function M(F){return{average:F.total/o,max:F.max,min:F.min}}function k(F){F.total=0,F.min=Number.MAX_VALUE,F.max=0}})(Hk||(Hk={}));var hs;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(hs||(hs={}));var Yf;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(Yf||(Yf={}));var Mt;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Mt||(Mt={}));function ja(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.ICodeEditor:!1}function ew(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===mz.IDiffEditor:!1}function HU(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function _z(n){return ja(n)?n:ew(n)?n.getModifiedEditor():HU(n)&&ja(n.activeCodeEditor)?n.activeCodeEditor:null}function gmt(n){return ja(n)||ew(n)?n:null}class vz{constructor(){this._hooks=new Z,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=gt(e)}this._hooks.add(pe(r,xe.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(pe(r,xe.POINTER_UP,a=>this.stopMonitoring(!0)))}}function tde(n){return`--vscode-${n.replace(/\./g,"-")}`}function Ye(n){return`var(${tde(n)})`}function Zve(n,e){return`var(${tde(n)}, ${e})`}var zg;(function(n){n[n.Darken=0]="Darken",n[n.Lighten=1]="Lighten",n[n.Transparent=2]="Transparent",n[n.Opaque=3]="Opaque",n[n.OneOf=4]="OneOf",n[n.LessProminent=5]="LessProminent",n[n.IfDefinedThenElse=6]="IfDefinedThenElse"})(zg||(zg={}));const xMe={ColorContribution:"base.contributions.colors"};class fmt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),s&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}deregisterColor(e){delete this.colorsById[e],delete this.colorSchema.properties[e];const t=this.colorReferenceSchema.enum.indexOf(e);t!==-1&&(this.colorReferenceSchema.enum.splice(t,1),this.colorReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChangeSchema.fire()}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return iv(s,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const ide=new fmt;it.add(xMe.ColorContribution,ide);function B(n,e,t,i,s){return ide.registerColor(n,e,t,i,s)}function pmt(n,e){switch(n.op){case zg.Darken:return iv(n.value,e)?.darken(n.factor);case zg.Lighten:return iv(n.value,e)?.lighten(n.factor);case zg.Transparent:return iv(n.value,e)?.transparent(n.factor);case zg.Opaque:{const t=iv(n.background,e);return t?iv(n.value,e)?.makeOpaque(t):iv(n.value,e)}case zg.OneOf:for(const t of n.values){const i=iv(t,e);if(i)return i}return;case zg.IfDefinedThenElse:return iv(e.defines(n.if)?n.then:n.else,e);case zg.LessProminent:{const t=iv(n.value,e);if(!t)return;const i=iv(n.background,e);return i?t.isDarkerThan(i)?fe.getLighterColor(t,i,n.factor).transparent(n.transparency):fe.getDarkerColor(t,i,n.factor).transparent(n.transparency):t.transparent(n.factor*n.transparency)}default:throw oQ()}}function Am(n,e){return{op:zg.Darken,value:n,factor:e}}function tw(n,e){return{op:zg.Lighten,value:n,factor:e}}function Ie(n,e){return{op:zg.Transparent,value:n,factor:e}}function sWe(n,e){return{op:zg.Opaque,value:n,background:e}}function j9(...n){return{op:zg.OneOf,values:n}}function mmt(n,e,t){return{op:zg.IfDefinedThenElse,if:n,then:e,else:t}}function oWe(n,e,t,i){return{op:zg.LessProminent,value:n,background:e,factor:t,transparency:i}}function iv(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?fe.fromHex(n):e.getColor(n);if(n instanceof fe)return n;if(typeof n=="object")return pmt(n,e)}}const fKe="vscode://schemas/workbench-colors",pKe=it.as(eL.JSONContribution);pKe.registerSchema(fKe,ide.getColorSchema());const rWe=new yn(()=>pKe.notifySchemaChanged(fKe),200);ide.onDidChangeSchema(()=>{rWe.isScheduled()||rWe.schedule()});const vg="vs/platform/theme/common/colors/baseColors",Ge=B("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,0,"Overall foreground color. This color is only used if not overridden by a component.")),aWe=B("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(vg,1,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),cWe=B("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(vg,2,"Overall foreground color for error messages. This color is only used if not overridden by a component."));B("descriptionForeground",{light:"#717171",dark:Ie(Ge,.7),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(vg,3,"Foreground color for description text providing additional information, for example for a label."));const Jy=B("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(vg,4,"The default color for icons in the workbench.")),Zd=B("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(vg,5,"Overall border color for focused elements. This color is only used if not overridden by a component.")),ft=B("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(vg,6,"An extra border around elements to separate them from others for greater contrast.")),co=B("contrastActiveBorder",{light:null,dark:null,hcDark:Zd,hcLight:Zd},g(vg,7,"An extra border around active elements to separate them from others for greater contrast."));B("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},g(vg,8,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const GB=B("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,9,"Foreground color for links in text.")),_mt=B("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(vg,10,"Foreground color for links in text when clicked on and on mouse hover."));B("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:fe.black,hcLight:"#292929"},g(vg,11,"Color for text separators."));B("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(vg,12,"Foreground color for preformatted text segments."));B("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(vg,13,"Background color for preformatted text segments."));const vmt=B("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(vg,14,"Background color for block quotes in text.")),wmt=B("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:fe.white,hcLight:"#292929"},g(vg,15,"Border color for block quotes in text."));B("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:fe.black,hcLight:"#F2F2F2"},g(vg,16,"Background color for code blocks in text."));const iL="vs/platform/theme/common/colors/miscColors";B("sash.hoverBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(iL,0,"Border color of active sashes."));const kW=B("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:fe.black,hcLight:"#0F4A85"},g(iL,1,"Badge background color. Badges are small information labels, e.g. for search results count.")),DMe=B("badge.foreground",{dark:fe.white,light:"#333",hcDark:fe.white,hcLight:fe.white},g(iL,2,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),p_=B("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(iL,3,"Scrollbar shadow to indicate that the view is scrolled.")),d3=B("scrollbarSlider.background",{dark:fe.fromHex("#797979").transparent(.4),light:fe.fromHex("#646464").transparent(.4),hcDark:Ie(ft,.6),hcLight:Ie(ft,.4)},g(iL,4,"Scrollbar slider background color.")),h3=B("scrollbarSlider.hoverBackground",{dark:fe.fromHex("#646464").transparent(.7),light:fe.fromHex("#646464").transparent(.7),hcDark:Ie(ft,.8),hcLight:Ie(ft,.8)},g(iL,5,"Scrollbar slider background color when hovering.")),u3=B("scrollbarSlider.activeBackground",{dark:fe.fromHex("#BFBFBF").transparent(.4),light:fe.fromHex("#000000").transparent(.6),hcDark:ft,hcLight:ft},g(iL,6,"Scrollbar slider background color when clicked on.")),bmt=B("progressBar.background",{dark:fe.fromHex("#0E70C0"),light:fe.fromHex("#0E70C0"),hcDark:ft,hcLight:ft},g(iL,7,"Background color of the progress bar that can show for long running operations.")),Pt="vs/platform/theme/common/colors/editorColors",us=B("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:fe.black,hcLight:fe.white},g(Pt,0,"Editor background color.")),Mc=B("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:fe.white,hcLight:Ge},g(Pt,1,"Editor default foreground color."));B("editorStickyScroll.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,2,"Background color of sticky scroll in the editor"));B("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Pt,3,"Background color of sticky scroll on hover in the editor"));B("editorStickyScroll.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,4,"Border color of sticky scroll in the editor"));B("editorStickyScroll.shadow",{dark:p_,light:p_,hcDark:p_,hcLight:p_},g(Pt,5," Shadow color of sticky scroll in the editor"));const Zs=B("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:fe.white},g(Pt,6,"Background color of editor widgets, such as find/replace.")),ng=B("editorWidget.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Pt,7,"Foreground color of editor widgets, such as find/replace.")),sg=B("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ft,hcLight:ft},g(Pt,8,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));B("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,9,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));B("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,10,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Vh=B("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(Pt,11,"Foreground color of error squigglies in the editor.")),Cmt=B("editorError.border",{dark:null,light:null,hcDark:fe.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(Pt,12,"If set, color of double underlines for errors in the editor.")),Aj=B("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,13,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),qc=B("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(Pt,14,"Foreground color of warning squigglies in the editor.")),K9=B("editorWarning.border",{dark:null,light:null,hcDark:fe.fromHex("#FFCC00").transparent(.8),hcLight:fe.fromHex("#FFCC00").transparent(.8)},g(Pt,15,"If set, color of double underlines for warnings in the editor."));B("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,16,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Qc=B("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(Pt,17,"Foreground color of info squigglies in the editor.")),Y9=B("editorInfo.border",{dark:null,light:null,hcDark:fe.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(Pt,18,"If set, color of double underlines for infos in the editor.")),ymt=B("editorHint.foreground",{dark:fe.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(Pt,19,"Foreground color of hint squigglies in the editor."));B("editorHint.border",{dark:null,light:null,hcDark:fe.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(Pt,20,"If set, color of double underlines for hints in the editor."));const Smt=B("editorLink.activeForeground",{dark:"#4E94CE",light:fe.blue,hcDark:fe.cyan,hcLight:"#292929"},g(Pt,21,"Color of active links.")),Hv=B("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(Pt,22,"Color of the editor selection.")),Amt=B("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:fe.white},g(Pt,23,"Color of the selected text for high contrast.")),mKe=B("editor.inactiveSelectionBackground",{light:Ie(Hv,.5),dark:Ie(Hv,.5),hcDark:Ie(Hv,.7),hcLight:Ie(Hv,.5)},g(Pt,24,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),kMe=B("editor.selectionHighlightBackground",{light:oWe(Hv,us,.3,.6),dark:oWe(Hv,us,.3,.6),hcDark:null,hcLight:null},g(Pt,25,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,26,"Border color for regions with the same content as the selection."));const lWe=B("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(Pt,27,"Color of the current search match.")),Emt=B("editor.findMatchForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,28,"Text color of the current search match.")),Fb=B("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(Pt,29,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),xmt=B("editor.findMatchHighlightForeground",{light:null,dark:null,hcDark:null,hcLight:null},g(Pt,30,"Foreground color of the other search matches."),!0);B("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(Pt,31,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.findMatchBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,32,"Border color of the current search match."));const Uk=B("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(Pt,33,"Border color of the other search matches.")),Dmt=B("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ie(co,.4),hcLight:Ie(co,.4)},g(Pt,34,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Vk=B("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(Pt,35,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),MZ=B("editorHoverWidget.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,36,"Background color of the editor hover."));B("editorHoverWidget.foreground",{light:ng,dark:ng,hcDark:ng,hcLight:ng},g(Pt,37,"Foreground color of the editor hover."));const _Ke=B("editorHoverWidget.border",{light:sg,dark:sg,hcDark:sg,hcLight:sg},g(Pt,38,"Border color of the editor hover."));B("editorHoverWidget.statusBarBackground",{dark:tw(MZ,.2),light:Am(MZ,.05),hcDark:Zs,hcLight:Zs},g(Pt,39,"Background color of the editor hover status bar."));const bE=B("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:fe.white,hcLight:fe.black},g(Pt,40,"Foreground color of inline hints")),CE=B("editorInlayHint.background",{dark:Ie(kW,.1),light:Ie(kW,.1),hcDark:Ie(fe.white,.1),hcLight:Ie(kW,.1)},g(Pt,41,"Background color of inline hints")),kmt=B("editorInlayHint.typeForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,42,"Foreground color of inline hints for types")),Imt=B("editorInlayHint.typeBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,43,"Background color of inline hints for types")),Lmt=B("editorInlayHint.parameterForeground",{dark:bE,light:bE,hcDark:bE,hcLight:bE},g(Pt,44,"Foreground color of inline hints for parameters")),Tmt=B("editorInlayHint.parameterBackground",{dark:CE,light:CE,hcDark:CE,hcLight:CE},g(Pt,45,"Background color of inline hints for parameters")),Ej=B("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(Pt,46,"The color used for the lightbulb actions icon."));B("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(Pt,47,"The color used for the lightbulb auto fix actions icon."));B("editorLightBulbAi.foreground",{dark:Ej,light:Ej,hcDark:Ej,hcLight:Ej},g(Pt,48,"The color used for the lightbulb AI icon."));B("editor.snippetTabstopHighlightBackground",{dark:new fe(new gn(124,124,124,.3)),light:new fe(new gn(10,50,100,.2)),hcDark:new fe(new gn(124,124,124,.3)),hcLight:new fe(new gn(10,50,100,.2))},g(Pt,49,"Highlight background color of a snippet tabstop."));B("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,50,"Highlight border color of a snippet tabstop."));B("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,51,"Highlight background color of the final tabstop of a snippet."));B("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new fe(new gn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(Pt,52,"Highlight border color of the final tabstop of a snippet."));const ewe=new fe(new gn(155,185,85,.2)),twe=new fe(new gn(255,0,0,.2)),m_=B("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(Pt,53,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),yE=B("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(Pt,54,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.insertedLineBackground",{dark:ewe,light:ewe,hcDark:null,hcLight:null},g(Pt,55,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditor.removedLineBackground",{dark:twe,light:twe,hcDark:null,hcLight:null},g(Pt,56,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);B("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,57,"Background color for the margin where lines got inserted."));B("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,58,"Background color for the margin where lines got removed."));const Rmt=B("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,59,"Diff overview ruler foreground for inserted content.")),Mmt=B("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Pt,60,"Diff overview ruler foreground for removed content."));B("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(Pt,61,"Outline color for the text that got inserted."));B("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(Pt,62,"Outline color for text that got removed."));B("diffEditor.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,63,"Border color between the two text editors."));B("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(Pt,64,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));B("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},g(Pt,65,"The background color of unchanged blocks in the diff editor."));B("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},g(Pt,66,"The foreground color of unchanged blocks in the diff editor."));B("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(Pt,67,"The background color of unchanged code in the diff editor."));const __=B("widget.shadow",{dark:Ie(fe.black,.36),light:Ie(fe.black,.16),hcDark:null,hcLight:null},g(Pt,68,"Shadow color of widgets such as find/replace inside the editor.")),UU=B("widget.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Pt,69,"Border color of widgets such as find/replace inside the editor.")),NZ=B("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(Pt,70,"Toolbar background when hovering over actions using the mouse"));B("toolbar.hoverOutline",{dark:null,light:null,hcDark:co,hcLight:co},g(Pt,71,"Toolbar outline when hovering over actions using the mouse"));B("toolbar.activeBackground",{dark:tw(NZ,.1),light:Am(NZ,.1),hcDark:null,hcLight:null},g(Pt,72,"Toolbar background when holding the mouse over actions"));const Nmt=B("breadcrumb.foreground",{light:Ie(Ge,.8),dark:Ie(Ge,.8),hcDark:Ie(Ge,.8),hcLight:Ie(Ge,.8)},g(Pt,73,"Color of focused breadcrumb items.")),Pmt=B("breadcrumb.background",{light:us,dark:us,hcDark:us,hcLight:us},g(Pt,74,"Background color of breadcrumb items.")),dWe=B("breadcrumb.focusForeground",{light:Am(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,73,"Color of focused breadcrumb items.")),Fmt=B("breadcrumb.activeSelectionForeground",{light:Am(Ge,.2),dark:tw(Ge,.1),hcDark:tw(Ge,.1),hcLight:tw(Ge,.1)},g(Pt,75,"Color of selected breadcrumb items."));B("breadcrumbPicker.background",{light:Zs,dark:Zs,hcDark:Zs,hcLight:Zs},g(Pt,76,"Background color of breadcrumb item picker."));const vKe=.5,hWe=fe.fromHex("#40C8AE").transparent(vKe),uWe=fe.fromHex("#40A6FF").transparent(vKe),gWe=fe.fromHex("#606060").transparent(.4),Uv=.4,VU=1,qB=B("merge.currentHeaderBackground",{dark:hWe,light:hWe,hcDark:null,hcLight:null},g(Pt,77,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.currentContentBackground",{dark:Ie(qB,Uv),light:Ie(qB,Uv),hcDark:Ie(qB,Uv),hcLight:Ie(qB,Uv)},g(Pt,78,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const QB=B("merge.incomingHeaderBackground",{dark:uWe,light:uWe,hcDark:null,hcLight:null},g(Pt,79,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.incomingContentBackground",{dark:Ie(QB,Uv),light:Ie(QB,Uv),hcDark:Ie(QB,Uv),hcLight:Ie(QB,Uv)},g(Pt,80,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const jB=B("merge.commonHeaderBackground",{dark:gWe,light:gWe,hcDark:null,hcLight:null},g(Pt,81,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);B("merge.commonContentBackground",{dark:Ie(jB,Uv),light:Ie(jB,Uv),hcDark:Ie(jB,Uv),hcLight:Ie(jB,Uv)},g(Pt,82,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const zU=B("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(Pt,83,"Border color on headers and the splitter in inline merge-conflicts."));B("editorOverviewRuler.currentContentForeground",{dark:Ie(qB,VU),light:Ie(qB,VU),hcDark:zU,hcLight:zU},g(Pt,84,"Current overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.incomingContentForeground",{dark:Ie(QB,VU),light:Ie(QB,VU),hcDark:zU,hcLight:zU},g(Pt,85,"Incoming overview ruler foreground for inline merge-conflicts."));B("editorOverviewRuler.commonContentForeground",{dark:Ie(jB,VU),light:Ie(jB,VU),hcDark:zU,hcLight:zU},g(Pt,86,"Common ancestor overview ruler foreground for inline merge-conflicts."));const m$=B("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(Pt,87,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),g3=B("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(Pt,88,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Omt=B("problemsErrorIcon.foreground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(Pt,89,"The color used for the problems error icon.")),Bmt=B("problemsWarningIcon.foreground",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(Pt,90,"The color used for the problems warning icon.")),Wmt=B("problemsInfoIcon.foreground",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},g(Pt,91,"The color used for the problems info icon.")),gC="vs/platform/theme/common/colors/minimapColors",KB=B("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(gC,0,"Minimap marker color for find matches."),!0),nde=B("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,1,"Minimap marker color for repeating editor selections."),!0),fWe=B("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(gC,2,"Minimap marker color for the editor selection."),!0),Hmt=B("minimap.infoHighlight",{dark:Qc,light:Qc,hcDark:Y9,hcLight:Y9},g(gC,3,"Minimap marker color for infos.")),Umt=B("minimap.warningHighlight",{dark:qc,light:qc,hcDark:K9,hcLight:K9},g(gC,4,"Minimap marker color for warnings.")),Vmt=B("minimap.errorHighlight",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(gC,5,"Minimap marker color for errors.")),zmt=B("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},g(gC,6,"Minimap background color.")),$mt=B("minimap.foregroundOpacity",{dark:fe.fromHex("#000f"),light:fe.fromHex("#000f"),hcDark:fe.fromHex("#000f"),hcLight:fe.fromHex("#000f")},g(gC,7,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));B("minimapSlider.background",{light:Ie(d3,.5),dark:Ie(d3,.5),hcDark:Ie(d3,.5),hcLight:Ie(d3,.5)},g(gC,8,"Minimap slider background color."));B("minimapSlider.hoverBackground",{light:Ie(h3,.5),dark:Ie(h3,.5),hcDark:Ie(h3,.5),hcLight:Ie(h3,.5)},g(gC,9,"Minimap slider background color when hovering."));B("minimapSlider.activeBackground",{light:Ie(u3,.5),dark:Ie(u3,.5),hcDark:Ie(u3,.5),hcLight:Ie(u3,.5)},g(gC,10,"Minimap slider background color when clicked on."));const nL="vs/platform/theme/common/colors/chartsColors";B("charts.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(nL,0,"The foreground color used in charts."));B("charts.lines",{dark:Ie(Ge,.5),light:Ie(Ge,.5),hcDark:Ie(Ge,.5),hcLight:Ie(Ge,.5)},g(nL,1,"The color used for horizontal lines in charts."));B("charts.red",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(nL,2,"The red color used in chart visualizations."));B("charts.blue",{dark:Qc,light:Qc,hcDark:Qc,hcLight:Qc},g(nL,3,"The blue color used in chart visualizations."));B("charts.yellow",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(nL,4,"The yellow color used in chart visualizations."));B("charts.orange",{dark:KB,light:KB,hcDark:KB,hcLight:KB},g(nL,5,"The orange color used in chart visualizations."));B("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(nL,6,"The green color used in chart visualizations."));B("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(nL,7,"The purple color used in chart visualizations."));const Lo="vs/platform/theme/common/colors/inputColors",SE=B("input.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,0,"Input box background.")),wKe=B("input.foreground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Lo,1,"Input box foreground.")),_$=B("input.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(Lo,2,"Input box border.")),IMe=B("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ft,hcLight:ft},g(Lo,3,"Border color of activated options in input fields."));B("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(Lo,4,"Background color of activated options in input fields."));const hR=B("inputOption.activeBackground",{dark:Ie(Zd,.4),light:Ie(Zd,.2),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,5,"Background hover color of options in input fields.")),LMe=B("inputOption.activeForeground",{dark:fe.white,light:fe.black,hcDark:Ge,hcLight:Ge},g(Lo,6,"Foreground color of activated options in input fields.")),xj=B("input.placeholderForeground",{light:Ie(Ge,.5),dark:Ie(Ge,.5),hcDark:Ie(Ge,.7),hcLight:Ie(Ge,.7)},g(Lo,7,"Input box foreground color for placeholder text.")),Gmt=B("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:fe.black,hcLight:fe.white},g(Lo,8,"Input validation background color for information severity.")),qmt=B("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,9,"Input validation foreground color for information severity.")),Qmt=B("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ft,hcLight:ft},g(Lo,10,"Input validation border color for information severity.")),jmt=B("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:fe.black,hcLight:fe.white},g(Lo,11,"Input validation background color for warning severity.")),Kmt=B("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,12,"Input validation foreground color for warning severity.")),Ymt=B("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ft,hcLight:ft},g(Lo,13,"Input validation border color for warning severity.")),bKe=B("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:fe.black,hcLight:fe.white},g(Lo,14,"Input validation background color for error severity.")),CKe=B("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ge},g(Lo,15,"Input validation foreground color for error severity.")),yKe=B("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Lo,16,"Input validation border color for error severity.")),Xy=B("dropdown.background",{dark:"#3C3C3C",light:fe.white,hcDark:fe.black,hcLight:fe.white},g(Lo,17,"Dropdown background.")),Jmt=B("dropdown.listBackground",{dark:null,light:null,hcDark:fe.black,hcLight:fe.white},g(Lo,18,"Dropdown list background.")),AE=B("dropdown.foreground",{dark:"#F0F0F0",light:Ge,hcDark:fe.white,hcLight:Ge},g(Lo,19,"Dropdown foreground.")),YB=B("dropdown.border",{dark:Xy,light:"#CECECE",hcDark:ft,hcLight:ft},g(Lo,20,"Dropdown border.")),Zy=B("button.foreground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:fe.white},g(Lo,21,"Button foreground color.")),f3=B("button.separator",{dark:Ie(Zy,.4),light:Ie(Zy,.4),hcDark:Ie(Zy,.4),hcLight:Ie(Zy,.4)},g(Lo,22,"Button separator color.")),eS=B("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(Lo,23,"Button background color.")),J9=B("button.hoverBackground",{dark:tw(eS,.2),light:Am(eS,.2),hcDark:eS,hcLight:eS},g(Lo,24,"Button background color when hovering.")),Xmt=B("button.border",{dark:ft,light:ft,hcDark:ft,hcLight:ft},g(Lo,25,"Button border color.")),Zmt=B("button.secondaryForeground",{dark:fe.white,light:fe.white,hcDark:fe.white,hcLight:Ge},g(Lo,26,"Secondary button foreground color.")),iwe=B("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:fe.white},g(Lo,27,"Secondary button background color.")),e_t=B("button.secondaryHoverBackground",{dark:tw(iwe,.2),light:Am(iwe,.2),hcDark:null,hcLight:null},g(Lo,28,"Secondary button background color when hovering.")),t_t=B("checkbox.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(Lo,29,"Background color of checkbox widget."));B("checkbox.selectBackground",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Lo,30,"Background color of checkbox widget when the element it's in is selected."));const i_t=B("checkbox.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(Lo,31,"Foreground color of checkbox widget.")),n_t=B("checkbox.border",{dark:YB,light:YB,hcDark:YB,hcLight:YB},g(Lo,32,"Border color of checkbox widget."));B("checkbox.selectBorder",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(Lo,33,"Border color of checkbox widget when the element it's in is selected."));const s_t=B("keybindingLabel.background",{dark:new fe(new gn(128,128,128,.17)),light:new fe(new gn(221,221,221,.4)),hcDark:fe.transparent,hcLight:fe.transparent},g(Lo,34,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),o_t=B("keybindingLabel.foreground",{dark:fe.fromHex("#CCCCCC"),light:fe.fromHex("#555555"),hcDark:fe.white,hcLight:Ge},g(Lo,35,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),r_t=B("keybindingLabel.border",{dark:new fe(new gn(51,51,51,.6)),light:new fe(new gn(204,204,204,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:ft},g(Lo,36,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),a_t=B("keybindingLabel.bottomBorder",{dark:new fe(new gn(68,68,68,.6)),light:new fe(new gn(187,187,187,.4)),hcDark:new fe(new gn(111,195,223)),hcLight:Ge},g(Lo,37,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Yr="vs/platform/theme/common/colors/listColors",c_t=B("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),l_t=B("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,1,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),nwe=B("list.focusOutline",{dark:Zd,light:Zd,hcDark:co,hcLight:co},g(Yr,2,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),d_t=B("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,3,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),v_=B("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,4,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),hm=B("list.activeSelectionForeground",{dark:fe.white,light:fe.white,hcDark:null,hcLight:null},g(Yr,5,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),p3=B("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,6,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),swe=B("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,7,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),h_t=B("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,8,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),u_t=B("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,9,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),g_t=B("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,10,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),f_t=B("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,11,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),SKe=B("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:fe.white.transparent(.1),hcLight:fe.fromHex("#0F4A85").transparent(.1)},g(Yr,12,"List/Tree background when hovering over items using the mouse.")),AKe=B("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Yr,13,"List/Tree foreground when hovering over items using the mouse.")),p_t=B("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(Yr,14,"List/Tree drag and drop background when moving items over other items when using the mouse.")),m_t=B("list.dropBetweenBackground",{dark:Jy,light:Jy,hcDark:null,hcLight:null},g(Yr,15,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Vv=B("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Zd,hcLight:Zd},g(Yr,16,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Dj=B("list.focusHighlightForeground",{dark:Vv,light:mmt(v_,Vv,"#BBE7FF"),hcDark:Vv,hcLight:Vv},g(Yr,17,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),__t=B("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(Yr,18,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),pWe=B("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(Yr,19,"Foreground color of list items containing errors."));B("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(Yr,20,"Foreground color of list items containing warnings."));const v_t=B("listFilterWidget.background",{light:Am(Zs,0),dark:tw(Zs,0),hcDark:Zs,hcLight:Zs},g(Yr,21,"Background color of the type filter widget in lists and trees.")),w_t=B("listFilterWidget.outline",{dark:fe.transparent,light:fe.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(Yr,22,"Outline color of the type filter widget in lists and trees.")),b_t=B("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ft,hcLight:ft},g(Yr,23,"Outline color of the type filter widget in lists and trees, when there are no matches.")),C_t=B("listFilterWidget.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Yr,24,"Shadow color of the type filter widget in lists and trees."));B("list.filterMatchBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Yr,25,"Background color of the filtered match."));B("list.filterMatchBorder",{dark:Uk,light:Uk,hcDark:ft,hcLight:co},g(Yr,26,"Border color of the filtered match."));const y_t=B("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(Yr,27,"List/Tree foreground color for items that are deemphasized.")),uR=B("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(Yr,28,"Tree stroke color for the indentation guides.")),S_t=B("tree.inactiveIndentGuidesStroke",{dark:Ie(uR,.4),light:Ie(uR,.4),hcDark:Ie(uR,.4),hcLight:Ie(uR,.4)},g(Yr,29,"Tree stroke color for the indentation guides that are not active.")),A_t=B("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(Yr,30,"Table border color between columns.")),E_t=B("tree.tableOddRowsBackground",{dark:Ie(Ge,.04),light:Ie(Ge,.04),hcDark:null,hcLight:null},g(Yr,31,"Background color for odd table rows.")),uO="vs/platform/theme/common/colors/menuColors",x_t=B("menu.border",{dark:null,light:null,hcDark:ft,hcLight:ft},g(uO,0,"Border color of menus.")),D_t=B("menu.foreground",{dark:AE,light:AE,hcDark:AE,hcLight:AE},g(uO,1,"Foreground color of menu items.")),k_t=B("menu.background",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},g(uO,2,"Background color of menu items.")),I_t=B("menu.selectionForeground",{dark:hm,light:hm,hcDark:hm,hcLight:hm},g(uO,3,"Foreground color of the selected menu item in menus.")),L_t=B("menu.selectionBackground",{dark:v_,light:v_,hcDark:v_,hcLight:v_},g(uO,4,"Background color of the selected menu item in menus.")),T_t=B("menu.selectionBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(uO,5,"Border color of the selected menu item in menus.")),R_t=B("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ft,hcLight:ft},g(uO,6,"Color of a separator menu item in menus.")),Zx="vs/platform/theme/common/colors/quickpickColors",mWe=B("quickInput.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Zx,0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),M_t=B("quickInput.foreground",{dark:ng,light:ng,hcDark:ng,hcLight:ng},g(Zx,1,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),N_t=B("quickInputTitle.background",{dark:new fe(new gn(255,255,255,.105)),light:new fe(new gn(0,0,0,.06)),hcDark:"#000000",hcLight:fe.white},g(Zx,2,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),EKe=B("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,3,"Quick picker color for grouping labels.")),P_t=B("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:fe.white,hcLight:"#0F4A85"},g(Zx,4,"Quick picker color for grouping borders.")),_We=B("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,g(Zx,5,"Please use quickInputList.focusBackground instead")),zk=B("quickInputList.focusForeground",{dark:hm,light:hm,hcDark:hm,hcLight:hm},g(Zx,6,"Quick picker foreground color for the focused item.")),JB=B("quickInputList.focusIconForeground",{dark:p3,light:p3,hcDark:p3,hcLight:p3},g(Zx,7,"Quick picker icon foreground color for the focused item.")),$k=B("quickInputList.focusBackground",{dark:j9(_We,v_),light:j9(_We,v_),hcDark:null,hcLight:null},g(Zx,8,"Quick picker background color for the focused item.")),TMe="vs/platform/theme/common/colors/searchColors";B("search.resultsInfoForeground",{light:Ge,dark:Ie(Ge,.65),hcDark:Ge,hcLight:Ge},g(TMe,0,"Color of the text in the search viewlet's completion message."));B("searchEditor.findMatchBackground",{light:Ie(Fb,.66),dark:Ie(Fb,.66),hcDark:Fb,hcLight:Fb},g(TMe,1,"Color of the Search Editor query matches."));B("searchEditor.findMatchBorder",{light:Ie(Uk,.66),dark:Ie(Uk,.66),hcDark:Uk,hcLight:Uk},g(TMe,2,"Border color of the Search Editor query matches."));class sde{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new xKe(this.x-e.scrollX,this.y-e.scrollY)}}class xKe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new sde(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class F_t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class O_t{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function RMe(n){const e=ia(n);return new F_t(e.left,e.top,e.width,e.height)}function MMe(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new O_t(o,r)}class f1 extends yu{constructor(e,t,i){super(gt(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new sde(this.posx,this.posy),this.editorPos=RMe(i),this.relativePos=MMe(i,this.editorPos,this.pos)}}class B_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return pe(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return pe(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return pe(e,xe.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return pe(e,xe.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return pe(e,"mousemove",i=>t(this._create(i)))}}class W_t{constructor(e){this._editorViewDomNode=e}_create(e){return new f1(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return pe(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return pe(e,xe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return pe(e,xe.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return pe(e,"pointermove",i=>t(this._create(i)))}}class H_t extends ${constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new vz),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Xo(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new f1(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const lae=class lae{constructor(e){this._editor=e,this._instanceId=++lae._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new yn(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new U_t(t,`dyn-rule-${this._instanceId}-${s}`,P9(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};lae._idPool=0;let PZ=lae;class U_t{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=od(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const s in t){const o=t[s];let r;typeof o=="object"?r=Ye(o.id):r=o;const a=V_t(s);i+=` ${a}: ${r};`}return i+=` -}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function V_t(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var yo;(function(n){n[n.ViewCompositionStart=0]="ViewCompositionStart",n[n.ViewCompositionEnd=1]="ViewCompositionEnd",n[n.ViewConfigurationChanged=2]="ViewConfigurationChanged",n[n.ViewCursorStateChanged=3]="ViewCursorStateChanged",n[n.ViewDecorationsChanged=4]="ViewDecorationsChanged",n[n.ViewFlushed=5]="ViewFlushed",n[n.ViewFocusChanged=6]="ViewFocusChanged",n[n.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",n[n.ViewLineMappingChanged=8]="ViewLineMappingChanged",n[n.ViewLinesChanged=9]="ViewLinesChanged",n[n.ViewLinesDeleted=10]="ViewLinesDeleted",n[n.ViewLinesInserted=11]="ViewLinesInserted",n[n.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",n[n.ViewScrollChanged=13]="ViewScrollChanged",n[n.ViewThemeChanged=14]="ViewThemeChanged",n[n.ViewTokensChanged=15]="ViewTokensChanged",n[n.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",n[n.ViewZonesChanged=17]="ViewZonesChanged"})(yo||(yo={}));class z_t{constructor(){this.type=yo.ViewCompositionStart}}class $_t{constructor(){this.type=yo.ViewCompositionEnd}}class G_t{constructor(e){this.type=yo.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class q_t{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=yo.ViewCursorStateChanged}}class vL{constructor(e){this.type=yo.ViewDecorationsChanged,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class kj{constructor(){this.type=yo.ViewFlushed}}class Q_t{constructor(e){this.type=yo.ViewFocusChanged,this.isFocused=e}}class j_t{constructor(){this.type=yo.ViewLanguageConfigurationChanged}}class Ij{constructor(){this.type=yo.ViewLineMappingChanged}}class DKe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=yo.ViewLinesChanged}}class owe{constructor(e,t){this.type=yo.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class rwe{constructor(e,t){this.type=yo.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var Ns;(function(n){n[n.Simple=0]="Simple",n[n.Center=1]="Center",n[n.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",n[n.Top=3]="Top",n[n.Bottom=4]="Bottom",n[n.NearTop=5]="NearTop",n[n.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(Ns||(Ns={}));class v${constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=yo.ViewRevealRangeRequest}}class K_t{constructor(e){this.type=yo.ViewScrollChanged,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Y_t{constructor(e){this.theme=e,this.type=yo.ViewThemeChanged}}class J_t{constructor(e){this.type=yo.ViewTokensChanged,this.ranges=e}}class X_t{constructor(){this.type=yo.ViewTokensColorsChanged}}let Z_t=class{constructor(){this.type=yo.ViewZonesChanged}};class dQ extends ${constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,s){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=s}}class ode{static from(e){const t=new Array(e.length);for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),s=Math.min(c,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=Zn.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[s].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Zn.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=Zn.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(l,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}var sf;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(sf||(sf={}));function pS(n){return n===sf.HIGH_CONTRAST_DARK||n===sf.HIGH_CONTRAST_LIGHT}function rde(n){return n===sf.DARK||n===sf.HIGH_CONTRAST_DARK}const svt=function(){return rf?!0:!(jr||pp||TS)}();let IW=!0;class wWe{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(x.fontInfo);i.get(x.experimentalWhitespaceRendering)==="off"?this.renderWhitespace=i.get(x.renderWhitespace):this.renderWhitespace="none",this.renderControlCharacters=i.get(x.renderControlCharacters),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(x.lineHeight),this.stopRenderingLineAfter=i.get(x.stopRenderingLineAfter),this.fontLigatures=i.get(x.fontLigatures)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}const dae=class dae{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ks(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return pS(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=s.getViewLineRenderingData(e),a=this._options,c=ig.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(pS(a.themeType)||this._options.renderWhitespace==="selection"){const f=s.selections;for(const p of f){if(p.endLineNumbere)continue;const m=p.startLineNumber===e?p.startColumn:r.minColumn,v=p.endLineNumber===e?p.endColumn:r.maxColumn;m');const h=lQ(d,o);o.appendString("");let u=null;return IW&&svt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===nf.None&&(u=new Lj(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=IKe(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Lj:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Lj?this._renderedViewLine.monospaceAssumptionsAreValid():IW}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Lj&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new vWe(!0,[new uM(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new vWe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};dae.CLASS_NAME="view-line";let rE=dae;var CA;(function(n){n[n.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(CA||(CA={}));class Lj{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/CA.MaxMonospaceDistance);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),IW=!1)}return IW}toSlowRenderedLine(){return IKe(this.domNode,this.input,this._characterMapping,!1,nf.None)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new uM(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=CA.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const s=Math.floor((t-1)/CA.MaxMonospaceDistance)-1,o=(s+1)*CA.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(o),c=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(c-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=iJ.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return NMe(this._characterMapping,e,t)}}class kKe{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new uM(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new uM(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===nf.None||this._containsForeignElements===nf.After)return 0;if(this._containsForeignElements===nf.Before)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const c=iJ.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===nf.None)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getHorizontalOffset(i),l=Math.round(this.input.spaceWidth*c);if(Math.abs(l-a)<=1)return l}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new uM(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return NMe(this._characterMapping,e,t)}}class ovt extends kKe{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===Da.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===Da.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===Da.OverflowingOverlayWidgets}}class $U{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(x.lineHeight),this.stickyTabStops=s.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=s.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return $U.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,c=null;return i.afterLineNumber!==o&&(c=new oe(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new oe(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=r:r===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,ru._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class dvt extends lvt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Xb.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,s,o){super(e,t,i,s),this.hitTestResult=new Ka(()=>ru.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?Mt.CONTENT_VIEW_ZONE:Mt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return Bu.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=c[Math.floor(o/e.lineHeight)],t.fulfillMargin(Mt.GUTTER_GLYPH_MARGIN,s,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Mt.GUTTER_LINE_NUMBERS,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Mt.GUTTER_LINE_DECORATIONS,s,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Bu.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),bWe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const s=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(s);return t.fulfillContentEmpty(new oe(s,o),bWe)}if(Bu.isStrictChildOfViewLines(t.targetPath)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(s)===0){const r=e.getLineWidth(s),a=Jge(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(s,1),a)}const o=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>=o){const r=Jge(t.mouseContentHorizontalOffset-o),a=new oe(s,e.viewModel.getLineMaxColumn(s));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===gM.Content?ru.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Bu.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new oe(s,o))}}return null}static _hitTestScrollbar(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return ru._getMouseColumn(s,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const w=Jge(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(s,w)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(s);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const w=e.visibleRangeForPosition(r,a-1);w&&h.push({offset:w.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(aw.offset-b.offset);const f=t.pos.toClientCoordinates(gt(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let w=1;wo)){const a=Math.floor((s+o)/2);let c=t.pos.y+(a-t.mouseVerticalOffset);c<=t.editorPos.y&&(c=t.editorPos.y+1),c>=t.editorPos.y+t.editorPos.height&&(c=t.editorPos.y+t.editorPos.height-1);const l=new sde(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(gt(e.viewDomNode)));if(d.type===gM.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=cF(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=hvt(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new DD;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,r,s.startOffset):new DD(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,o,o.textContent.length):new DD(o)}return new DD}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new DD(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===rE.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return yT.createFromDOMInfo(e,c,0)}else if(a===rE.CLASS_NAME)return yT.createFromDOMInfo(e,i.offsetNode,0)}return new DD(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=X9.atomicPosition(i,e.column-1,s,TI.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new DD;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))),i.type===gM.Content){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,jo.None);(s||!o.equals(i.position))&&(i=new LKe(o,i.spanNode,s))}return i}}function hvt(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=gt(s),a=r.getComputedStyle(s,null).getPropertyValue("font-style"),c=r.getComputedStyle(s,null).getPropertyValue("font-variant"),l=r.getComputedStyle(s,null).getPropertyValue("font-weight"),d=r.getComputedStyle(s,null).getPropertyValue("font-size"),h=r.getComputedStyle(s,null).getPropertyValue("line-height"),u=r.getComputedStyle(s,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=s.innerText;let m=o.left,v=0,w;if(e>o.left+o.width)v=p.length;else{const b=awe.getInstance();for(let C=0;C{t.add(pe(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(pe(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(pe(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:yi,disposables:this._store}))}static addTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in yi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Bd.HOLD_DELAY&&Math.abs(c.initialPageX-Mf(c.rollingPageX))<30&&Math.abs(c.initialPageY-Mf(c.rollingPageY))<30){const d=this.newGestureEvent(Eo.Contextmenu,c.initialTarget);d.pageX=Mf(c.rollingPageX),d.pageY=Mf(c.rollingPageY),this.dispatchEvent(d)}else if(s===1){const d=Mf(c.rollingPageX),h=Mf(c.rollingPageY),u=Mf(c.rollingTimestamps)-c.rollingTimestamps[0],f=d-c.rollingPageX[0],p=h-c.rollingPageY[0],m=[...this.targets].filter(v=>c.initialTarget instanceof Node&&v.contains(c.initialTarget));this.inertia(e,m,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(p)/u,p>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(Eo.End,c.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Eo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Bd.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Eo.Change||e.type===Eo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let s=0,o=e.initialTarget;for(;o&&o!==i;)s++,o=o.parentElement;t.push([s,i])}t.sort((i,s)=>i[0]-s[0]);for(const[i,s]of t)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,s,o,r,a,c,l){this.handle=xd(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;s+=Bd.SCROLL_FRICTION*h,a+=Bd.SCROLL_FRICTION*h,s>0&&(p=!1,u=o*s*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(Eo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,s,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Bd.SCROLL_FRICTION=-.005,Bd.HOLD_DELAY=700,Bd.CLEAR_TAP_COUNT_TIME=400;let dh=Bd;function uvt(n,e,t){let i=0;for(let o=0;o!0,fvt=()=>!1,pvt=n=>n===" "||n===" ";class HO{static shouldRecreate(e){return e.hasChanged(x.layoutInfo)||e.hasChanged(x.wordSeparators)||e.hasChanged(x.emptySelectionClipboard)||e.hasChanged(x.multiCursorMergeOverlapping)||e.hasChanged(x.multiCursorPaste)||e.hasChanged(x.multiCursorLimit)||e.hasChanged(x.autoClosingBrackets)||e.hasChanged(x.autoClosingComments)||e.hasChanged(x.autoClosingQuotes)||e.hasChanged(x.autoClosingDelete)||e.hasChanged(x.autoClosingOvertype)||e.hasChanged(x.autoSurround)||e.hasChanged(x.useTabStops)||e.hasChanged(x.fontInfo)||e.hasChanged(x.readOnly)||e.hasChanged(x.wordSegmenterLocales)}constructor(e,t,i,s){this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(x.layoutInfo),a=o.get(x.fontInfo);this.readOnly=o.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(x.useTabStops),this.wordSeparators=o.get(x.wordSeparators),this.emptySelectionClipboard=o.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=o.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=o.get(x.multiCursorPaste),this.multiCursorLimit=o.get(x.multiCursorLimit),this.autoClosingBrackets=o.get(x.autoClosingBrackets),this.autoClosingComments=o.get(x.autoClosingComments),this.autoClosingQuotes=o.get(x.autoClosingQuotes),this.autoClosingDelete=o.get(x.autoClosingDelete),this.autoClosingOvertype=o.get(x.autoClosingOvertype),this.autoSurround=o.get(x.autoSurround),this.autoIndent=o.get(x.autoIndent),this.wordSegmenterLocales=o.get(x.wordSegmenterLocales),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=dR(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return PMe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return pvt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return gvt;case"never":return fvt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return kc.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=kc.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}let zn=class TKe{static fromModelState(e){return new mvt(e)}static fromViewState(e){return new _vt(e)}static fromModelSelection(e){const t=mt.liftSelection(e),i=new bd(O.fromPositions(t.getSelectionStart()),Qu.Simple,0,t.getPosition(),0);return TKe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,l=s>r,d=sr||ws||v0&&s--,ST.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=o;c<=r;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new oe(c,l));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-wQe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new oe(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=X9.atomicPosition(o,t.column-1,i,TI.Left);if(r!==-1&&r+1>=s)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?Ws.leftPositionAtomicSoftTabs(t,i,e.tabSize):Ws.leftPosition(t,i);return new Xge(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(Ws.clipPositionColumn(c,t),jo.Left),d=Ws.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,Ws.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-kc.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),c!==void 0){const p=new oe(i,s),m=t.normalizePosition(p,c);o=o+(s-m.column),i=m.lineNumber,s=m.column}return new Xge(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,jo.RightOfInjectedText)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=Ws.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),jo.None).lineNumber>r)break;while(c++<10&&r+c1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=s.get(f);if(!p)return!1;if(kD(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const w of p)w.open===f&&w.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let w=!1;for(let b=0,C=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Eu(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const c=i.visibleColumnFromColumn(t,s),l=kc.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,l);return new O(s.lineNumber,d,s.lineNumber,s.column)}}return O.fromPositions(lF.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zlt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new oe(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>oe.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&o?.endLineNumber!==l.lineNumber?(d=l.lineNumber-1,h=t.getLineMaxColumn(l.lineNumber-1),u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber)):(d=l.lineNumber,h=1,u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber));const p=new O(d,h,u,f);o=p,p.isEmpty()?s[r]=null:s[r]=new zd(p,"")}else s[r]=null;else s[r]=new zd(c,"")}return new Lg(Cr.Other,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Wi;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(Wi||(Wi={}));var Jr;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Separator=2]="Separator"})(Jr||(Jr={}));var Ds;(function(n){n[n.WordStart=0]="WordStart",n[n.WordStartFast=1]="WordStartFast",n[n.WordEnd=2]="WordEnd",n[n.WordAccessibility=3]="WordAccessibility"})(Ds||(Ds={}));class Es{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:Jr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=Jr.None;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,c);if(c===da.Regular){if(s===Jr.Separator)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Regular}else if(c===da.WordSeparator){if(s===Jr.Regular)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Separator}else if(c===da.Whitespace&&s!==Jr.None)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1))}return s!==Jr.None?this._createWord(e,s,da.Whitespace,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=t.findNextIntlWordAtOrAfterOffset(e,s),r=e.length;for(let a=s;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===da.Whitespace||i===Jr.Regular&&c===da.WordSeparator||i===Jr.Separator&&c===da.Regular)return r+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Es._findPreviousWordOnLine(e,t,new oe(o,r));if(s===Ds.WordStart)return new oe(o,a?a.start+1:1);if(s===Ds.WordStartFast)return a&&a.wordType===Jr.Separator&&a.end-a.start===1&&a.nextCharClass===da.Regular&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.start+1:1);if(s===Ds.WordAccessibility){for(;a&&a.wordType===Jr.Separator;)a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1));return new oe(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new oe(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a===q.Underline&&c!==q.Underline)return new oe(i,r);if(a===q.Dash&&c!==q.Dash)return new oe(i,r);if((Bk(a)||gj(a))&&fy(c))return new oe(i,r);if(fy(a)&&fy(c)&&r+1=c.start+1&&(c=Es._findNextWordOnLine(e,t,new oe(o,c.end+1))),c?r=c.start+1:r=t.getLineMaxColumn(o);return new oe(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?l=1:(c--,l=s.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=Es._findPreviousWordOnLine(i,s,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=s.getLineMaxColumn(c))),new O(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===q.Space||i===q.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new O(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new O(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(s,u-2);)u--;return a(u,f)},l=Es._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=Es._findNextWordOnLine(e,t,i);return d&&r(d)?c(d):l&&d?a(l.end+1,d.start+1):l?a(l.start+1,l.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Es._moveWordPartLeft(e,i);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=u.start+1&&(u=Es._findNextWordOnLine(i,s,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class ud{static addCursorDown(e,t,i){const s=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),zn.fromModelState(new bd(new O(r.lineNumber,1,d,h),Qu.Line,0,new oe(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),zn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return zn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return zn.fromModelState(Es.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new zn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return zn.fromViewState(new bd(new O(i,s,i,s),Qu.Simple,0,new oe(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===Qu.Word)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===Qu.Line)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return zn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case Bi.Direction.Left:return r===Bi.Unit.HalfLine?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case Bi.Direction.Right:return r===Bi.Unit.HalfLine?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case Bi.Direction.Up:return r===Bi.Unit.WrappedLine?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case Bi.Direction.Down:return r===Bi.Unit.WrappedLine?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case Bi.Direction.PrevBlankLine:return r===Bi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Bi.Direction.NextBlankLine:return r===Bi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Bi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,s);case Bi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case Bi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,s);case Bi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,s);case Bi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Bi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:ozn.fromViewState(Ws.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;ozn.fromViewState(Ws.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;o0}}function V_t(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var yo;(function(n){n[n.ViewCompositionStart=0]="ViewCompositionStart",n[n.ViewCompositionEnd=1]="ViewCompositionEnd",n[n.ViewConfigurationChanged=2]="ViewConfigurationChanged",n[n.ViewCursorStateChanged=3]="ViewCursorStateChanged",n[n.ViewDecorationsChanged=4]="ViewDecorationsChanged",n[n.ViewFlushed=5]="ViewFlushed",n[n.ViewFocusChanged=6]="ViewFocusChanged",n[n.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",n[n.ViewLineMappingChanged=8]="ViewLineMappingChanged",n[n.ViewLinesChanged=9]="ViewLinesChanged",n[n.ViewLinesDeleted=10]="ViewLinesDeleted",n[n.ViewLinesInserted=11]="ViewLinesInserted",n[n.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",n[n.ViewScrollChanged=13]="ViewScrollChanged",n[n.ViewThemeChanged=14]="ViewThemeChanged",n[n.ViewTokensChanged=15]="ViewTokensChanged",n[n.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",n[n.ViewZonesChanged=17]="ViewZonesChanged"})(yo||(yo={}));class z_t{constructor(){this.type=yo.ViewCompositionStart}}class $_t{constructor(){this.type=yo.ViewCompositionEnd}}class G_t{constructor(e){this.type=yo.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class q_t{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=yo.ViewCursorStateChanged}}class vL{constructor(e){this.type=yo.ViewDecorationsChanged,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class kj{constructor(){this.type=yo.ViewFlushed}}class Q_t{constructor(e){this.type=yo.ViewFocusChanged,this.isFocused=e}}class j_t{constructor(){this.type=yo.ViewLanguageConfigurationChanged}}class Ij{constructor(){this.type=yo.ViewLineMappingChanged}}class DKe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=yo.ViewLinesChanged}}class owe{constructor(e,t){this.type=yo.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class rwe{constructor(e,t){this.type=yo.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var Ns;(function(n){n[n.Simple=0]="Simple",n[n.Center=1]="Center",n[n.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",n[n.Top=3]="Top",n[n.Bottom=4]="Bottom",n[n.NearTop=5]="NearTop",n[n.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(Ns||(Ns={}));class v${constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=yo.ViewRevealRangeRequest}}class K_t{constructor(e){this.type=yo.ViewScrollChanged,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Y_t{constructor(e){this.theme=e,this.type=yo.ViewThemeChanged}}class J_t{constructor(e){this.type=yo.ViewTokensChanged,this.ranges=e}}class X_t{constructor(){this.type=yo.ViewTokensColorsChanged}}let Z_t=class{constructor(){this.type=yo.ViewZonesChanged}};class dQ extends ${constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,s){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=s}}class ode{static from(e){const t=new Array(e.length);for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),s=Math.min(c,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=Zn.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[s].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Zn.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=Zn.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(l,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}var sf;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(sf||(sf={}));function pS(n){return n===sf.HIGH_CONTRAST_DARK||n===sf.HIGH_CONTRAST_LIGHT}function rde(n){return n===sf.DARK||n===sf.HIGH_CONTRAST_DARK}const svt=function(){return rf?!0:!(jr||pp||TS)}();let IW=!0;class wWe{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(x.fontInfo);i.get(x.experimentalWhitespaceRendering)==="off"?this.renderWhitespace=i.get(x.renderWhitespace):this.renderWhitespace="none",this.renderControlCharacters=i.get(x.renderControlCharacters),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(x.lineHeight),this.stopRenderingLineAfter=i.get(x.stopRenderingLineAfter),this.fontLigatures=i.get(x.fontLigatures)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}const dae=class dae{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ks(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return pS(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=s.getViewLineRenderingData(e),a=this._options,c=ig.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(pS(a.themeType)||this._options.renderWhitespace==="selection"){const f=s.selections;for(const p of f){if(p.endLineNumbere)continue;const m=p.startLineNumber===e?p.startColumn:r.minColumn,v=p.endLineNumber===e?p.endColumn:r.maxColumn;m');const h=lQ(d,o);o.appendString("");let u=null;return IW&&svt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===nf.None&&(u=new Lj(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=IKe(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Lj:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Lj?this._renderedViewLine.monospaceAssumptionsAreValid():IW}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Lj&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new vWe(!0,[new uM(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new vWe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};dae.CLASS_NAME="view-line";let rE=dae;var CA;(function(n){n[n.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(CA||(CA={}));class Lj{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/CA.MaxMonospaceDistance);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),IW=!1)}return IW}toSlowRenderedLine(){return IKe(this.domNode,this.input,this._characterMapping,!1,nf.None)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new uM(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=CA.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const s=Math.floor((t-1)/CA.MaxMonospaceDistance)-1,o=(s+1)*CA.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(o),c=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(c-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=iJ.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return NMe(this._characterMapping,e,t)}}class kKe{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new uM(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new uM(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===nf.None||this._containsForeignElements===nf.After)return 0;if(this._containsForeignElements===nf.Before)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const c=iJ.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===nf.None)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getHorizontalOffset(i),l=Math.round(this.input.spaceWidth*c);if(Math.abs(l-a)<=1)return l}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new uM(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return iJ.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return NMe(this._characterMapping,e,t)}}class ovt extends kKe{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===Da.OverflowGuard&&e[3]===Da.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===Da.OverflowGuard&&e[3]===Da.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===Da.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===Da.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===Da.OverflowGuard&&e[1]===Da.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===Da.OverflowingOverlayWidgets}}class $U{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(x.lineHeight),this.stickyTabStops=s.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=s.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return $U.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,c=null;return i.afterLineNumber!==o&&(c=new oe(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new oe(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=r:r===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,ru._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class dvt extends lvt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Xb.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,s,o){super(e,t,i,s),this.hitTestResult=new Ka(()=>ru.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?Mt.CONTENT_VIEW_ZONE:Mt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return Bu.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=c[Math.floor(o/e.lineHeight)],t.fulfillMargin(Mt.GUTTER_GLYPH_MARGIN,s,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Mt.GUTTER_LINE_NUMBERS,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Mt.GUTTER_LINE_DECORATIONS,s,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Bu.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),bWe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const s=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(s);return t.fulfillContentEmpty(new oe(s,o),bWe)}if(Bu.isStrictChildOfViewLines(t.targetPath)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(s)===0){const r=e.getLineWidth(s),a=Jge(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(s,1),a)}const o=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>=o){const r=Jge(t.mouseContentHorizontalOffset-o),a=new oe(s,e.viewModel.getLineMaxColumn(s));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===gM.Content?ru.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Bu.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new oe(s,o))}}return null}static _hitTestScrollbar(e,t){if(Bu.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return ru._getMouseColumn(s,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const w=Jge(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(s,w)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(s);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const w=e.visibleRangeForPosition(r,a-1);w&&h.push({offset:w.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(aw.offset-b.offset);const f=t.pos.toClientCoordinates(gt(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let w=1;wo)){const a=Math.floor((s+o)/2);let c=t.pos.y+(a-t.mouseVerticalOffset);c<=t.editorPos.y&&(c=t.editorPos.y+1),c>=t.editorPos.y+t.editorPos.height&&(c=t.editorPos.y+t.editorPos.height-1);const l=new sde(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(gt(e.viewDomNode)));if(d.type===gM.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=cF(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=hvt(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new DD;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,r,s.startOffset):new DD(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,o,o.textContent.length):new DD(o)}return new DD}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===rE.CLASS_NAME?yT.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new DD(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===rE.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return yT.createFromDOMInfo(e,c,0)}else if(a===rE.CLASS_NAME)return yT.createFromDOMInfo(e,i.offsetNode,0)}return new DD(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=X9.atomicPosition(i,e.column-1,s,TI.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new DD;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(gt(e.viewDomNode)))),i.type===gM.Content){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,jo.None);(s||!o.equals(i.position))&&(i=new LKe(o,i.spanNode,s))}return i}}function hvt(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=gt(s),a=r.getComputedStyle(s,null).getPropertyValue("font-style"),c=r.getComputedStyle(s,null).getPropertyValue("font-variant"),l=r.getComputedStyle(s,null).getPropertyValue("font-weight"),d=r.getComputedStyle(s,null).getPropertyValue("font-size"),h=r.getComputedStyle(s,null).getPropertyValue("line-height"),u=r.getComputedStyle(s,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=s.innerText;let m=o.left,v=0,w;if(e>o.left+o.width)v=p.length;else{const b=awe.getInstance();for(let C=0;C{t.add(pe(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(pe(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(pe(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:yi,disposables:this._store}))}static addTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Bd.isTouchDevice())return $.None;Bd.INSTANCE||(Bd.INSTANCE=xU(new Bd));const t=Bd.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in yi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Bd.HOLD_DELAY&&Math.abs(c.initialPageX-Mf(c.rollingPageX))<30&&Math.abs(c.initialPageY-Mf(c.rollingPageY))<30){const d=this.newGestureEvent(Eo.Contextmenu,c.initialTarget);d.pageX=Mf(c.rollingPageX),d.pageY=Mf(c.rollingPageY),this.dispatchEvent(d)}else if(s===1){const d=Mf(c.rollingPageX),h=Mf(c.rollingPageY),u=Mf(c.rollingTimestamps)-c.rollingTimestamps[0],f=d-c.rollingPageX[0],p=h-c.rollingPageY[0],m=[...this.targets].filter(v=>c.initialTarget instanceof Node&&v.contains(c.initialTarget));this.inertia(e,m,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(p)/u,p>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(Eo.End,c.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Eo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Bd.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Eo.Change||e.type===Eo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let s=0,o=e.initialTarget;for(;o&&o!==i;)s++,o=o.parentElement;t.push([s,i])}t.sort((i,s)=>i[0]-s[0]);for(const[i,s]of t)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,s,o,r,a,c,l){this.handle=xd(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;s+=Bd.SCROLL_FRICTION*h,a+=Bd.SCROLL_FRICTION*h,s>0&&(p=!1,u=o*s*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(Eo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,s,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Bd.SCROLL_FRICTION=-.005,Bd.HOLD_DELAY=700,Bd.CLEAR_TAP_COUNT_TIME=400;let dh=Bd;function uvt(n,e,t){let i=0;for(let o=0;o!0,fvt=()=>!1,pvt=n=>n===" "||n===" ";class HO{static shouldRecreate(e){return e.hasChanged(x.layoutInfo)||e.hasChanged(x.wordSeparators)||e.hasChanged(x.emptySelectionClipboard)||e.hasChanged(x.multiCursorMergeOverlapping)||e.hasChanged(x.multiCursorPaste)||e.hasChanged(x.multiCursorLimit)||e.hasChanged(x.autoClosingBrackets)||e.hasChanged(x.autoClosingComments)||e.hasChanged(x.autoClosingQuotes)||e.hasChanged(x.autoClosingDelete)||e.hasChanged(x.autoClosingOvertype)||e.hasChanged(x.autoSurround)||e.hasChanged(x.useTabStops)||e.hasChanged(x.fontInfo)||e.hasChanged(x.readOnly)||e.hasChanged(x.wordSegmenterLocales)}constructor(e,t,i,s){this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(x.layoutInfo),a=o.get(x.fontInfo);this.readOnly=o.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(x.useTabStops),this.wordSeparators=o.get(x.wordSeparators),this.emptySelectionClipboard=o.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=o.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=o.get(x.multiCursorPaste),this.multiCursorLimit=o.get(x.multiCursorLimit),this.autoClosingBrackets=o.get(x.autoClosingBrackets),this.autoClosingComments=o.get(x.autoClosingComments),this.autoClosingQuotes=o.get(x.autoClosingQuotes),this.autoClosingDelete=o.get(x.autoClosingDelete),this.autoClosingOvertype=o.get(x.autoClosingOvertype),this.autoSurround=o.get(x.autoSurround),this.autoIndent=o.get(x.autoIndent),this.wordSegmenterLocales=o.get(x.wordSegmenterLocales),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=dR(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return PMe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return pvt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return gvt;case"never":return fvt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return kc.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=kc.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}let zn=class TKe{static fromModelState(e){return new mvt(e)}static fromViewState(e){return new _vt(e)}static fromModelSelection(e){const t=mt.liftSelection(e),i=new bd(O.fromPositions(t.getSelectionStart()),Qu.Simple,0,t.getPosition(),0);return TKe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,l=s>r,d=sr||ws||v0&&s--,ST.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=o;c<=r;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new oe(c,l));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-wQe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new oe(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=X9.atomicPosition(o,t.column-1,i,TI.Left);if(r!==-1&&r+1>=s)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?Ws.leftPositionAtomicSoftTabs(t,i,e.tabSize):Ws.leftPosition(t,i);return new Xge(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(Ws.clipPositionColumn(c,t),jo.Left),d=Ws.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,Ws.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-kc.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),c!==void 0){const p=new oe(i,s),m=t.normalizePosition(p,c);o=o+(s-m.column),i=m.lineNumber,s=m.column}return new Xge(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,jo.RightOfInjectedText)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=Ws.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),jo.None).lineNumber>r)break;while(c++<10&&r+c1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=s.get(f);if(!p)return!1;if(kD(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const w of p)w.open===f&&w.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let w=!1;for(let b=0,C=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Eu(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const c=i.visibleColumnFromColumn(t,s),l=kc.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,l);return new O(s.lineNumber,d,s.lineNumber,s.column)}}return O.fromPositions(lF.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zlt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new oe(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>oe.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&o?.endLineNumber!==l.lineNumber?(d=l.lineNumber-1,h=t.getLineMaxColumn(l.lineNumber-1),u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber)):(d=l.lineNumber,h=1,u=l.lineNumber,f=t.getLineMaxColumn(l.lineNumber));const p=new O(d,h,u,f);o=p,p.isEmpty()?s[r]=null:s[r]=new zd(p,"")}else s[r]=null;else s[r]=new zd(c,"")}return new Lg(Cr.Other,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Wi;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(Wi||(Wi={}));var Jr;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Separator=2]="Separator"})(Jr||(Jr={}));var Ds;(function(n){n[n.WordStart=0]="WordStart",n[n.WordStartFast=1]="WordStartFast",n[n.WordEnd=2]="WordEnd",n[n.WordAccessibility=3]="WordAccessibility"})(Ds||(Ds={}));class Es{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:Jr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=Jr.None;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,c);if(c===da.Regular){if(s===Jr.Separator)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Regular}else if(c===da.WordSeparator){if(s===Jr.Regular)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1));s=Jr.Separator}else if(c===da.Whitespace&&s!==Jr.None)return this._createWord(e,s,c,r+1,this._findEndOfWord(e,t,s,r+1))}return s!==Jr.None?this._createWord(e,s,da.Whitespace,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=t.findNextIntlWordAtOrAfterOffset(e,s),r=e.length;for(let a=s;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===da.Whitespace||i===Jr.Regular&&c===da.WordSeparator||i===Jr.Separator&&c===da.Regular)return r+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Es._findPreviousWordOnLine(e,t,new oe(o,r));if(s===Ds.WordStart)return new oe(o,a?a.start+1:1);if(s===Ds.WordStartFast)return a&&a.wordType===Jr.Separator&&a.end-a.start===1&&a.nextCharClass===da.Regular&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.start+1:1);if(s===Ds.WordAccessibility){for(;a&&a.wordType===Jr.Separator;)a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1));return new oe(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Es._findPreviousWordOnLine(e,t,new oe(o,a.start+1))),new oe(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new oe(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a===Q.Underline&&c!==Q.Underline)return new oe(i,r);if(a===Q.Dash&&c!==Q.Dash)return new oe(i,r);if((Bk(a)||gj(a))&&fy(c))return new oe(i,r);if(fy(a)&&fy(c)&&r+1=c.start+1&&(c=Es._findNextWordOnLine(e,t,new oe(o,c.end+1))),c?r=c.start+1:r=t.getLineMaxColumn(o);return new oe(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?l=1:(c--,l=s.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=Es._findPreviousWordOnLine(i,s,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=s.getLineMaxColumn(c))),new O(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===Q.Space||i===Q.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new O(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new O(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(s,u-2);)u--;return a(u,f)},l=Es._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=Es._findNextWordOnLine(e,t,i);return d&&r(d)?c(d):l&&d?a(l.end+1,d.start+1):l?a(l.start+1,l.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Es._moveWordPartLeft(e,i);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=u.start+1&&(u=Es._findNextWordOnLine(i,s,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class ud{static addCursorDown(e,t,i){const s=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),zn.fromModelState(new bd(new O(r.lineNumber,1,d,h),Qu.Line,0,new oe(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),zn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return zn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return zn.fromModelState(Es.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new zn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return zn.fromViewState(new bd(new O(i,s,i,s),Qu.Simple,0,new oe(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===Qu.Word)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===Qu.Line)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return zn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case Bi.Direction.Left:return r===Bi.Unit.HalfLine?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case Bi.Direction.Right:return r===Bi.Unit.HalfLine?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case Bi.Direction.Up:return r===Bi.Unit.WrappedLine?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case Bi.Direction.Down:return r===Bi.Unit.WrappedLine?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case Bi.Direction.PrevBlankLine:return r===Bi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Bi.Direction.NextBlankLine:return r===Bi.Unit.WrappedLine?t.map(a=>zn.fromViewState(Ws.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>zn.fromModelState(Ws.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case Bi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,s);case Bi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case Bi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,s);case Bi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,s);case Bi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Bi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,l)]}case Bi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:ozn.fromViewState(Ws.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;ozn.fromViewState(Ws.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;o{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return dR(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),s=dR(i,e.startColumn-1),o=lh.createEmpty("",s.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(s.firstCharOffset===0))return o;const l=t(r);if(!(s.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class RKe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=Uo(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const s=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(s).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===Ar.String||c===Ar.RegEx||c===Ar.Comment,i=e.getLanguageId(0),o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(o,""));const h=e.getMetadata(c);r.push({text:d,metadata:h})}),lh.createFromTextAndMetadata(r,e.languageIdCodec)}}function WMe(n,e){n.tokenization.forceTokenization(e.lineNumber);const t=n.tokenization.getLineTokens(e.lineNumber),i=dR(t,e.column-1),s=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!s&&!o}function LW(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const s=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(s);if(!o)return null;const a=new BMe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(n,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===Ga.Indent&&(f=" "+f):u===Ga.Indent||u===Ga.IndentOutdent?f=" ":f="";let m=Qje(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var sJ;const Zge=Object.create(null);function wL(n,e){if(e<=0)return"";Zge[n]||(Zge[n]=["",n]);const t=Zge[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let h_=sJ=class{static unshiftIndent(e,t,i,s,o){const r=kc.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=kc.prevIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=kc.prevRenderTabStop(r,i)/i;return wL(a,l)}}static shiftIndent(e,t,i,s,o){const r=kc.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=kc.nextIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=kc.nextRenderTabStop(r,i)/i;return wL(a,l)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let h=i;h<=s;h++,l=d){d=0;const u=e.getLineContent(h);let f=Eu(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!c&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&kc.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=LW(this._opts.autoIndent,e,new O(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let w=0,b=v.appendText.length;w1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(s)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function cde(n,e,t,i=!0,s){if(n0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=Cvt(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:Ga.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:null,line:a}}else{if(a===1)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(Pb.INCREASE_MASK|Pb.DECREASE_MASK))&&l&Pb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:Uo(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:Uo(e.getLineContent(d)),action:Ga.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:Uo(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Uo(e.getLineContent(d)),action:null,line:d}}return{indentation:Uo(e.getLineContent(1)),action:null,line:1}}}function w$(n,e,t,i,s,o){if(nn.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function Avt(n,e,t){return{tokenization:{getLineTokens:s=>s===e?t:n.tokenization.getLineTokens(s),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(s,o)=>n.getLanguageIdAtPosition(s,o)},getLineContent:s=>s===e?t.getLineContent():n.getLineContent(s)}}class Zr{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Zv(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=LW(e.autoIndent,t,new O(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return s&&(s===Ga.Indent&&(o=Zr.shiftIndent(e,o)),s===Ga.Outdent&&(o=Zr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),c=e.indentSize,l=c-a%c;for(let d=0;dthis._compositionType(i,d,o,r,a,c));return new Lg(Cr.TypingOther,l,{shouldPushStackElementBefore:Mj(e,Cr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-s),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new O(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new nJ(d,i,0,r)}static _typeCommand(e,t,i){return i?new Tj(e,t,!0):new zd(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===ed.None)return Zr._typeCommand(s,` + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},n.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(o){if(!o.to)return null;let r;switch(o.to){case n.RawDirection.Left:r=i.Left;break;case n.RawDirection.Right:r=i.Right;break;case n.RawDirection.Up:r=i.Up;break;case n.RawDirection.Down:r=i.Down;break;case n.RawDirection.PrevBlankLine:r=i.PrevBlankLine;break;case n.RawDirection.NextBlankLine:r=i.NextBlankLine;break;case n.RawDirection.WrappedLineStart:r=i.WrappedLineStart;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:r=i.WrappedLineFirstNonWhitespaceCharacter;break;case n.RawDirection.WrappedLineColumnCenter:r=i.WrappedLineColumnCenter;break;case n.RawDirection.WrappedLineEnd:r=i.WrappedLineEnd;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:r=i.WrappedLineLastNonWhitespaceCharacter;break;case n.RawDirection.ViewPortTop:r=i.ViewPortTop;break;case n.RawDirection.ViewPortBottom:r=i.ViewPortBottom;break;case n.RawDirection.ViewPortCenter:r=i.ViewPortCenter;break;case n.RawDirection.ViewPortIfOutside:r=i.ViewPortIfOutside;break;default:return null}let a=s.None;switch(o.by){case n.RawUnit.Line:a=s.Line;break;case n.RawUnit.WrappedLine:a=s.WrappedLine;break;case n.RawUnit.Character:a=s.Character;break;case n.RawUnit.HalfLine:a=s.HalfLine;break}return{direction:r,unit:a,select:!!o.select,value:o.value||1}}n.parse=t;let i;(function(o){o[o.Left=0]="Left",o[o.Right=1]="Right",o[o.Up=2]="Up",o[o.Down=3]="Down",o[o.PrevBlankLine=4]="PrevBlankLine",o[o.NextBlankLine=5]="NextBlankLine",o[o.WrappedLineStart=6]="WrappedLineStart",o[o.WrappedLineFirstNonWhitespaceCharacter=7]="WrappedLineFirstNonWhitespaceCharacter",o[o.WrappedLineColumnCenter=8]="WrappedLineColumnCenter",o[o.WrappedLineEnd=9]="WrappedLineEnd",o[o.WrappedLineLastNonWhitespaceCharacter=10]="WrappedLineLastNonWhitespaceCharacter",o[o.ViewPortTop=11]="ViewPortTop",o[o.ViewPortCenter=12]="ViewPortCenter",o[o.ViewPortBottom=13]="ViewPortBottom",o[o.ViewPortIfOutside=14]="ViewPortIfOutside"})(i=n.Direction||(n.Direction={}));let s;(function(o){o[o.None=0]="None",o[o.Line=1]="Line",o[o.WrappedLine=2]="WrappedLine",o[o.Character=3]="Character",o[o.HalfLine=4]="HalfLine"})(s=n.Unit||(n.Unit={}))})(Bi||(Bi={}));class OMe{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new RKe(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class BMe{constructor(e,t){this.model=e,this.indentationLineProcessor=new RKe(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),s=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:s}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=dR(t,e.startColumn-1);let s;if(WMe(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,c=a+r;s=t.sliceAndInflate(a,c,0)}else{const r=e.startColumn-1;s=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(s)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),s=dR(i,t.column-1),o=t.column-1-s.firstCharOffset,r=s.firstCharOffset+o,a=s.firstCharOffset+s.getLineLength(),c=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(c)}_getProcessedPreviousLineTokens(e){const t=f=>{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return dR(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),s=dR(i,e.startColumn-1),o=lh.createEmpty("",s.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(s.firstCharOffset===0))return o;const l=t(r);if(!(s.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class RKe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=Uo(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const s=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(s).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===Ar.String||c===Ar.RegEx||c===Ar.Comment,i=e.getLanguageId(0),o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(o,""));const h=e.getMetadata(c);r.push({text:d,metadata:h})}),lh.createFromTextAndMetadata(r,e.languageIdCodec)}}function WMe(n,e){n.tokenization.forceTokenization(e.lineNumber);const t=n.tokenization.getLineTokens(e.lineNumber),i=dR(t,e.column-1),s=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!s&&!o}function LW(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const s=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(s);if(!o)return null;const a=new BMe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(n,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===Ga.Indent&&(f=" "+f):u===Ga.Indent||u===Ga.IndentOutdent?f=" ":f="";let m=Qje(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var sJ;const Zge=Object.create(null);function wL(n,e){if(e<=0)return"";Zge[n]||(Zge[n]=["",n]);const t=Zge[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let h_=sJ=class{static unshiftIndent(e,t,i,s,o){const r=kc.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=kc.prevIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=kc.prevRenderTabStop(r,i)/i;return wL(a,l)}}static shiftIndent(e,t,i,s,o){const r=kc.visibleColumnFromColumn(e,t,i);if(o){const a=wL(" ",s),l=kc.nextIndentTabStop(r,s)/s;return wL(a,l)}else{const a=" ",l=kc.nextRenderTabStop(r,i)/i;return wL(a,l)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let h=i;h<=s;h++,l=d){d=0;const u=e.getLineContent(h);let f=Eu(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!c&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&kc.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=LW(this._opts.autoIndent,e,new O(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let w=0,b=v.appendText.length;w1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(s)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function cde(n,e,t,i=!0,s){if(n0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=Cvt(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:Ga.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:Uo(c),action:null,line:a}}else{if(a===1)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(Pb.INCREASE_MASK|Pb.DECREASE_MASK))&&l&Pb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:Uo(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Uo(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:Uo(e.getLineContent(d)),action:Ga.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:Uo(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Uo(e.getLineContent(d)),action:null,line:d}}return{indentation:Uo(e.getLineContent(1)),action:null,line:1}}}function w$(n,e,t,i,s,o){if(nn.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function Avt(n,e,t){return{tokenization:{getLineTokens:s=>s===e?t:n.tokenization.getLineTokens(s),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(s,o)=>n.getLanguageIdAtPosition(s,o)},getLineContent:s=>s===e?t.getLineContent():n.getLineContent(s)}}class Zr{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Zv(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=LW(e.autoIndent,t,new O(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return s&&(s===Ga.Indent&&(o=Zr.shiftIndent(e,o)),s===Ga.Outdent&&(o=Zr.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),c=e.indentSize,l=c-a%c;for(let d=0;dthis._compositionType(i,d,o,r,a,c));return new Lg(Cr.TypingOther,l,{shouldPushStackElementBefore:Mj(e,Cr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-s),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new O(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new nJ(d,i,0,r)}static _typeCommand(e,t,i){return i?new Tj(e,t,!0):new zd(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===ed.None)return Zr._typeCommand(s,` `,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===ed.Keep){const c=t.getLineContent(s.startLineNumber),l=Uo(c).substring(0,s.startColumn-1);return Zr._typeCommand(s,` `+e.normalizeIndentation(l),i)}const o=LW(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===Ga.None)return Zr._typeCommand(s,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Ga.Indent)return Zr._typeCommand(s,` @@ -71,23 +71,23 @@ Received: '{1}'.`,e,e5.getLexeme(t)),o=t.offset,r=e5.getLexeme(t);return this._p `+e.normalizeIndentation(c+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=Uo(r).substring(0,s.startColumn-1);if(e.autoIndent>=ed.Full){const c=yvt(e.autoIndent,t,s,{unshiftIndent:l=>Zr.unshiftIndent(e,l),shiftIndent:l=>Zr.shiftIndent(e,l),normalizeIndentation:l=>e.normalizeIndentation(l)},e.languageConfigurationService);if(c){let l=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,h=t.getLineContent(s.endLineNumber),u=Eu(h);if(u>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,u+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new Tj(s,` `+e.normalizeIndentation(c.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(l=Math.ceil(l/e.indentSize)),f=Math.min(l+1-e.normalizeIndentation(c.afterEnter).length-1,0)),new nJ(s,` `+e.normalizeIndentation(c.afterEnter),0,f,!0)}}}return Zr._typeCommand(s,` -`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndentZr.shiftIndent(e,a),unshiftIndent:a=>Zr.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(l.column-2):q.Null)===q.Backslash&&u)return!1;if(e.autoClosingOvertype==="auto"){let p=!1;for(let m=0,v=s.length;mt.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let c=!0;for(const l of i)if(t.getValueInRange(new O(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+s!==a.open){c=!1;break}c&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const p of i)if(!p.isEmpty())return null;const r=i.map(p=>{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-s.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(p=>new oe(p.lineNumber,p.beforeColumn)),s);if(!a)return null;let c,l;if(kD(s)?(c=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(c=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(c=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),c==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let f=!0;for(const p of r){const{lineNumber:m,beforeColumn:v,afterColumn:w}=p,b=t.getLineContent(m),C=b.substring(0,v-1),y=b.substring(w-1);if(y.startsWith(u)||(f=!1),y.length>0){const F=y.charAt(0);if(!Zr._isBeforeClosingBrace(e,y)&&!l(F))return null}if(a.open.length===1&&(s==="'"||s==='"')&&c!=="always"){const F=R_(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(F.get(N)===da.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const S=t.tokenization.getLineTokens(m),M=dR(S,v-1);if(!a.shouldAutoClose(M,v-M.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const F=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(F))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const c=[];for(let l=0,d=s.length;lnew zd(new O(u.positionLineNumber,u.positionColumn,u.positionLineNumber,u.positionColumn+1),"",!1));return new Lg(Cr.TypingOther,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,c,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,c,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` +`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndentZr.shiftIndent(e,a),unshiftIndent:a=>Zr.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):Zr._typeCommand(new O(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(l.column-2):Q.Null)===Q.Backslash&&u)return!1;if(e.autoClosingOvertype==="auto"){let p=!1;for(let m=0,v=s.length;mt.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let c=!0;for(const l of i)if(t.getValueInRange(new O(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+s!==a.open){c=!1;break}c&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const p of i)if(!p.isEmpty())return null;const r=i.map(p=>{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-s.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(p=>new oe(p.lineNumber,p.beforeColumn)),s);if(!a)return null;let c,l;if(kD(s)?(c=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(c=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(c=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),c==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let f=!0;for(const p of r){const{lineNumber:m,beforeColumn:v,afterColumn:w}=p,b=t.getLineContent(m),C=b.substring(0,v-1),y=b.substring(w-1);if(y.startsWith(u)||(f=!1),y.length>0){const F=y.charAt(0);if(!Zr._isBeforeClosingBrace(e,y)&&!l(F))return null}if(a.open.length===1&&(s==="'"||s==='"')&&c!=="always"){const F=R_(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(F.get(N)===da.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const S=t.tokenization.getLineTokens(m),M=dR(S,v-1);if(!a.shouldAutoClose(M,v-M.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const F=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(F))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const c=[];for(let l=0,d=s.length;lnew zd(new O(u.positionLineNumber,u.positionColumn,u.positionLineNumber,u.positionColumn+1),"",!1));return new Lg(Cr.TypingOther,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,c,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,c,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` `){const d=[];for(let h=0,u=o.length;h{const s=t.get(Qt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=xl();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(Qt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var mS;(function(n){n[n.Regular=0]="Regular",n[n.Minimal=1]="Minimal",n[n.None=2]="None"})(mS||(mS={}));var Ul;(function(n){class e extends Sa{constructor(C){super(C),this._inSelectionMode=C.inSelectionMode}runCoreEditorCommand(C,y){if(!y.position)return;C.model.pushStackElement(),C.setCursorStates(y.source,Wi.Explicit,[ud.moveTo(C,C.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==mS.None&&C.revealAllCursors(y.source,!0,!0)}}n.MoveTo=Ke(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Ke(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Sa{runCoreEditorCommand(C,y){C.model.pushStackElement();const S=this._getColumnSelectResult(C,C.getPrimaryCursorState(),C.getCursorColumnSelectData(),y);S!==null&&(C.setCursorStates(y.source,Wi.Explicit,S.viewStates.map(M=>zn.fromViewState(M))),C.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?C.revealTopMostCursor(y.source):C.revealBottomMostCursor(y.source))}}n.ColumnSelect=Ke(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,C,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const M=b.model.validatePosition(S.position),k=b.coordinatesConverter.validateViewPosition(new oe(S.viewPosition.lineNumber,S.viewPosition.column),M),F=S.doColumnSelect?y.fromViewLineNumber:k.lineNumber,N=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return ST.columnSelect(b.cursorConfig,b,F,N,k.lineNumber,S.mouseColumn-1)}}),n.CursorColumnSelectLeft=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectLeft(b.cursorConfig,b,y)}}),n.CursorColumnSelectRight=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectRight(b.cursorConfig,b,y)}});class i extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectUp(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectUp=Ke(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.UpArrow,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Ke(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageUp,linux:{primary:0}}}));class s extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectDown(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectDown=Ke(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.DownArrow,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Ke(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageDown,linux:{primary:0}}}));class o extends Sa{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Bi.metadata})}runCoreEditorCommand(C,y){const S=Bi.parse(y);S&&this._runCursorMove(C,y.source,S)}_runCursorMove(C,y,S){C.model.pushStackElement(),C.setCursorStates(y,Wi.Explicit,o._move(C,C.getCursorStates(),S)),C.revealAllCursors(y,!0)}static _move(C,y,S){const M=S.select,k=S.value;switch(S.direction){case Bi.Direction.Left:case Bi.Direction.Right:case Bi.Direction.Up:case Bi.Direction.Down:case Bi.Direction.PrevBlankLine:case Bi.Direction.NextBlankLine:case Bi.Direction.WrappedLineStart:case Bi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Bi.Direction.WrappedLineColumnCenter:case Bi.Direction.WrappedLineEnd:case Bi.Direction.WrappedLineLastNonWhitespaceCharacter:return ud.simpleMove(C,y,S.direction,M,k,S.unit);case Bi.Direction.ViewPortTop:case Bi.Direction.ViewPortBottom:case Bi.Direction.ViewPortCenter:case Bi.Direction.ViewPortIfOutside:return ud.viewportMove(C,y,S.direction,M,k);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Ke(new o);let r;(function(b){b[b.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends Sa{constructor(C){super(C),this._staticArgs=C.args}runCoreEditorCommand(C,y){let S=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||C.cursorConfig.pageSize}),C.model.pushStackElement(),C.setCursorStates(y.source,Wi.Explicit,ud.simpleMove(C,C.getCursorStates(),S.direction,S.select,S.value,S.unit)),C.revealAllCursors(y.source,!0)}}n.CursorLeft=Ke(new a({args:{direction:Bi.Direction.Left,unit:Bi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.LeftArrow,mac:{primary:E.LeftArrow,secondary:[V.WinCtrl|E.KeyB]}}})),n.CursorLeftSelect=Ke(new a({args:{direction:Bi.Direction.Left,unit:Bi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.LeftArrow}})),n.CursorRight=Ke(new a({args:{direction:Bi.Direction.Right,unit:Bi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.RightArrow,mac:{primary:E.RightArrow,secondary:[V.WinCtrl|E.KeyF]}}})),n.CursorRightSelect=Ke(new a({args:{direction:Bi.Direction.Right,unit:Bi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.RightArrow}})),n.CursorUp=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.UpArrow,mac:{primary:E.UpArrow,secondary:[V.WinCtrl|E.KeyP]}}})),n.CursorUpSelect=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow],mac:{primary:V.Shift|E.UpArrow},linux:{primary:V.Shift|E.UpArrow}}})),n.CursorPageUp=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageUp}})),n.CursorPageUpSelect=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageUp}})),n.CursorDown=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.DownArrow,mac:{primary:E.DownArrow,secondary:[V.WinCtrl|E.KeyN]}}})),n.CursorDownSelect=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow],mac:{primary:V.Shift|E.DownArrow},linux:{primary:V.Shift|E.DownArrow}}})),n.CursorPageDown=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageDown}})),n.CursorPageDownSelect=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageDown}})),n.CreateCursor=Ke(new class extends Sa{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,C){if(!C.position)return;let y;C.wholeLine?y=ud.line(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition):y=ud.moveTo(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition);const S=b.getCursorStates();if(S.length>1){const M=y.modelState?y.modelState.position:null,k=y.viewState?y.viewState.position:null;for(let F=0,N=S.length;Fk&&(M=k);const F=new O(M,1,M,b.model.getLineMaxColumn(M));let N=Ns.Simple;if(y.at)switch(y.at){case XB.RawAtArgument.Top:N=Ns.Top;break;case XB.RawAtArgument.Center:N=Ns.Center;break;case XB.RawAtArgument.Bottom:N=Ns.Bottom;break}const z=b.coordinatesConverter.convertModelRangeToViewRange(F);b.revealRange(C.source,!1,z,N,vt.Smooth)}}),n.SelectAll=new class extends cwe{constructor(){super(Rgt)}runDOMCommand(b){pp&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,C,y){const S=C._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(b,C){b.model.pushStackElement(),b.setCursorStates("keyboard",Wi.Explicit,[ud.selectAll(b,b.getPrimaryCursorState())])}},n.SetSelection=Ke(new class extends Sa{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,C){C.selection&&(b.model.pushStackElement(),b.setCursorStates(C.source,Wi.Explicit,[zn.fromModelSelection(C.selection)]))}})})(Ul||(Ul={}));const xvt=ge.and(X.textInputFocus,X.columnSelection);function wz(n,e){xr.registerKeybindingRule({id:n,primary:e,when:xvt,weight:fs+1})}wz(Ul.CursorColumnSelectLeft.id,V.Shift|E.LeftArrow);wz(Ul.CursorColumnSelectRight.id,V.Shift|E.RightArrow);wz(Ul.CursorColumnSelectUp.id,V.Shift|E.UpArrow);wz(Ul.CursorColumnSelectPageUp.id,V.Shift|E.PageUp);wz(Ul.CursorColumnSelectDown.id,V.Shift|E.DownArrow);wz(Ul.CursorColumnSelectPageDown.id,V.Shift|E.PageDown);function SWe(n){return n.register(),n}var TW;(function(n){class e extends Yc{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Ke(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:X.writable,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyO}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Ke(new class extends e{constructor(){super({id:"outdent",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:V.Shift|E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Ke(new class extends e{constructor(){super({id:"tab",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Ke(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Backspace,secondary:[V.Shift|E.Backspace],mac:{primary:E.Backspace,secondary:[V.Shift|E.Backspace,V.WinCtrl|E.KeyH,V.WinCtrl|E.Backspace]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingLeft)}}),n.DeleteRight=Ke(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Delete,mac:{primary:E.Delete,secondary:[V.WinCtrl|E.KeyD,V.WinCtrl|E.Delete]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingRight)}}),n.Undo=new class extends cwe{constructor(){super(Eje)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},n.Redo=new class extends cwe{constructor(){super(xje)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(TW||(TW={}));class AWe extends Jle{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Qt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function gO(n,e){SWe(new AWe("default:"+n,n)),SWe(new AWe(n,n,e))}gO(Hc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});gO(Hc.ReplacePreviousChar);gO(Hc.CompositionType);gO(Hc.CompositionStart);gO(Hc.CompositionEnd);gO(Hc.Paste);gO(Hc.Cut);let wg=class extends ${onclick(e,t){this._register(pe(e,xe.CLICK,i=>t(new yu(gt(e),i))))}onmousedown(e,t){this._register(pe(e,xe.MOUSE_DOWN,i=>t(new yu(gt(e),i))))}onmouseover(e,t){this._register(pe(e,xe.MOUSE_OVER,i=>t(new yu(gt(e),i))))}onmouseleave(e,t){this._register(pe(e,xe.MOUSE_LEAVE,i=>t(new yu(gt(e),i))))}onkeydown(e,t){this._register(pe(e,xe.KEY_DOWN,i=>t(new os(i))))}onkeyup(e,t){this._register(pe(e,xe.KEY_UP,i=>t(new os(i))))}oninput(e,t){this._register(pe(e,xe.INPUT,t))}onblur(e,t){this._register(pe(e,xe.BLUR,t))}onfocus(e,t){this._register(pe(e,xe.FOCUS,t))}onchange(e,t){this._register(pe(e,xe.CHANGE,t))}ignoreGesture(e){return dh.ignoreTarget(e)}};const GU=11;class Dvt extends wg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...$e.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=GU+"px",this.domNode.style.height=GU+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new vz),this._register(Xo(this.bgDomNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Xo(this.domNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new sQ),this._pointerdownScheduleRepeatTimer=this._register(new O_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,gt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class kvt extends ${constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new O_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===zo.Hidden?!1:this._visibility===zo.Visible?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Ivt=140;class PKe extends wg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new kvt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new vz),this._shouldRender=!0,this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(pe(this.domNode.domNode,xe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Dvt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ks(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(pe(this.slider.domNode,xe.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=ia(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Is&&a>Ivt){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Lvt=20;class qU{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new qU(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=s>0&&s>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(Lvt,Math.floor(i*a/s))),d=(a-l)/(s-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=qU._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new aF(null,1,0))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new aF(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===zo.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Rvt extends PKe{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new qU(t.verticalHasArrows?t.arrowSize:0,t.vertical===zo.Hidden?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-GU)/2,a=(t.verticalScrollbarSize-GU)/2;this._createArrow({className:"scra",icon:Ce.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,1))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Mvt=".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{background:transparent;opacity:1;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{display:none;position:absolute}.monaco-scrollable-element>.shadow.top{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;display:block;height:3px;left:3px;top:0;width:100%}.monaco-scrollable-element>.shadow.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;display:block;height:100%;left:0;top:3px;width:3px}.monaco-scrollable-element>.shadow.top-left-corner{display:block;height:3px;left:0;top:0;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}";Ct(Mvt,{});const Nvt=500,EWe=50;class Pvt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const hae=class hae{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,s=this._rear;do{const o=s===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(eQ){const t=gt(e.browserEvent),i=xht(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let s=null;const o=new Pvt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,s)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const s=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(s,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(s,r),h=Math.max(o,a);d%c===0&&h%l===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};hae.INSTANCE=new hae;let FZ=hae;class HMe extends wg{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new I),this.onWillScroll=this._onWillScroll.event,e.style.overflow="hidden",this._options=Fvt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Rvt(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Tvt(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ks(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ks(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ks(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new O_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=St(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ei&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new aF(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=St(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new aF(s))};this._mouseWheelToDispose.push(pe(this._listenOnDomNode,xe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=FZ.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+o===0?r=o=0:Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!ei&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(o){const d=EWe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=EWe*r,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Nvt)}}class FKe extends HMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class hQ extends HMe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class bz extends HMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function Fvt(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:zo.Auto,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:zo.Auto,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,ei&&(e.className+=" mac"),e}class UMe extends dQ{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new ru(this._context,i),this._mouseDownOperation=this._register(new Ovt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const s=new B_t(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=pe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new f1(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(pe(this.viewHelper.viewDomNode,xe.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=FZ.INSTANCE;let t=0,i=l_.getZoomLevel(),s=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new aF(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=l_.getZoomLevel(),h=l.deltaY>0?1:-1;l_.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=l_.getZoomLevel(),s=a(c),o=0),t=Date.now(),o+=l.deltaY,s&&(l_.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(pe(this.viewHelper.viewDomNode,xe.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return ei?(c.metaKey||c.ctrlKey)&&!c.shiftKey&&!c.altKey:c.ctrlKey&&!c.metaKey&&!c.shiftKey&&!c.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(x.layoutInfo)){const t=this._context.configuration.options.get(x.layoutInfo).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new xKe(e,t).toPageCoordinates(gt(this.viewHelper.viewDomNode)),o=RMe(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=MMe(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=cF(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(c){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}_onMouseWheel(e){this.viewController.emitMouseWheel(e)}}class Ovt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new H_t(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Bvt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new lwe,this._currentSelection=new mt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===Mt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,mS.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Mt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(x.readOnly)&&o.get(x.dragAndDrop)&&!o.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===Mt.CONTENT_TEXT&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);Sv(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,mS.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=s.getCurrentScrollTop()+e.relativePos.y,l=$U.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return hu.createOutsideEditor(o,h,"below",a)}const d=s.getLineNumberAtVerticalOffset(c);return hu.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return hu.createOutsideEditor(o,new oe(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===Mt.CONTENT_VIEW_ZONE||s.type===Mt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return hu.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===Mt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Bvt extends ${constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Wvt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Wvt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=xd(gt(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(x.lineHeight),t=this._context.configuration.options.get(x.layoutInfo).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(x.lineHeight),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let c;{const l=RMe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new sde(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=MMe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,mS.None),this._animationFrameDisposable=xd(gt(c.element),()=>this._execute())}}const uae=class uae{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>uae.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};uae.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let lwe=uae;class oi{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}const B2=class B2{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new B2(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new B2(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const s=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,s,-1)}if(e>=this.selectionEnd){const s=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,s,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` +`);else{a--;const c=t.getLineMaxColumn(a);s[o]=this._enter(e,t,!1,new O(a,c,a,c))}}return s}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o{const s=t.get(jt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=xl();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(jt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var mS;(function(n){n[n.Regular=0]="Regular",n[n.Minimal=1]="Minimal",n[n.None=2]="None"})(mS||(mS={}));var Ul;(function(n){class e extends Sa{constructor(C){super(C),this._inSelectionMode=C.inSelectionMode}runCoreEditorCommand(C,y){if(!y.position)return;C.model.pushStackElement(),C.setCursorStates(y.source,Wi.Explicit,[ud.moveTo(C,C.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==mS.None&&C.revealAllCursors(y.source,!0,!0)}}n.MoveTo=Ke(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Ke(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Sa{runCoreEditorCommand(C,y){C.model.pushStackElement();const S=this._getColumnSelectResult(C,C.getPrimaryCursorState(),C.getCursorColumnSelectData(),y);S!==null&&(C.setCursorStates(y.source,Wi.Explicit,S.viewStates.map(M=>zn.fromViewState(M))),C.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:S.fromLineNumber,fromViewVisualColumn:S.fromVisualColumn,toViewLineNumber:S.toLineNumber,toViewVisualColumn:S.toVisualColumn}),S.reversed?C.revealTopMostCursor(y.source):C.revealBottomMostCursor(y.source))}}n.ColumnSelect=Ke(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,C,y,S){if(typeof S.position>"u"||typeof S.viewPosition>"u"||typeof S.mouseColumn>"u")return null;const M=b.model.validatePosition(S.position),k=b.coordinatesConverter.validateViewPosition(new oe(S.viewPosition.lineNumber,S.viewPosition.column),M),F=S.doColumnSelect?y.fromViewLineNumber:k.lineNumber,N=S.doColumnSelect?y.fromViewVisualColumn:S.mouseColumn-1;return ST.columnSelect(b.cursorConfig,b,F,N,k.lineNumber,S.mouseColumn-1)}}),n.CursorColumnSelectLeft=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectLeft(b.cursorConfig,b,y)}}),n.CursorColumnSelectRight=Ke(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(b,C,y,S){return ST.columnSelectRight(b.cursorConfig,b,y)}});class i extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectUp(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectUp=Ke(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.UpArrow,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Ke(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageUp,linux:{primary:0}}}));class s extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,y,S,M){return ST.columnSelectDown(C.cursorConfig,C,S,this._isPaged)}}n.CursorColumnSelectDown=Ke(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.DownArrow,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Ke(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|V.Alt|E.PageDown,linux:{primary:0}}}));class o extends Sa{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Bi.metadata})}runCoreEditorCommand(C,y){const S=Bi.parse(y);S&&this._runCursorMove(C,y.source,S)}_runCursorMove(C,y,S){C.model.pushStackElement(),C.setCursorStates(y,Wi.Explicit,o._move(C,C.getCursorStates(),S)),C.revealAllCursors(y,!0)}static _move(C,y,S){const M=S.select,k=S.value;switch(S.direction){case Bi.Direction.Left:case Bi.Direction.Right:case Bi.Direction.Up:case Bi.Direction.Down:case Bi.Direction.PrevBlankLine:case Bi.Direction.NextBlankLine:case Bi.Direction.WrappedLineStart:case Bi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Bi.Direction.WrappedLineColumnCenter:case Bi.Direction.WrappedLineEnd:case Bi.Direction.WrappedLineLastNonWhitespaceCharacter:return ud.simpleMove(C,y,S.direction,M,k,S.unit);case Bi.Direction.ViewPortTop:case Bi.Direction.ViewPortBottom:case Bi.Direction.ViewPortCenter:case Bi.Direction.ViewPortIfOutside:return ud.viewportMove(C,y,S.direction,M,k);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Ke(new o);let r;(function(b){b[b.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends Sa{constructor(C){super(C),this._staticArgs=C.args}runCoreEditorCommand(C,y){let S=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(S={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||C.cursorConfig.pageSize}),C.model.pushStackElement(),C.setCursorStates(y.source,Wi.Explicit,ud.simpleMove(C,C.getCursorStates(),S.direction,S.select,S.value,S.unit)),C.revealAllCursors(y.source,!0)}}n.CursorLeft=Ke(new a({args:{direction:Bi.Direction.Left,unit:Bi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.LeftArrow,mac:{primary:E.LeftArrow,secondary:[V.WinCtrl|E.KeyB]}}})),n.CursorLeftSelect=Ke(new a({args:{direction:Bi.Direction.Left,unit:Bi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.LeftArrow}})),n.CursorRight=Ke(new a({args:{direction:Bi.Direction.Right,unit:Bi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.RightArrow,mac:{primary:E.RightArrow,secondary:[V.WinCtrl|E.KeyF]}}})),n.CursorRightSelect=Ke(new a({args:{direction:Bi.Direction.Right,unit:Bi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.RightArrow}})),n.CursorUp=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.UpArrow,mac:{primary:E.UpArrow,secondary:[V.WinCtrl|E.KeyP]}}})),n.CursorUpSelect=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow],mac:{primary:V.Shift|E.UpArrow},linux:{primary:V.Shift|E.UpArrow}}})),n.CursorPageUp=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageUp}})),n.CursorPageUpSelect=Ke(new a({args:{direction:Bi.Direction.Up,unit:Bi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageUp}})),n.CursorDown=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.DownArrow,mac:{primary:E.DownArrow,secondary:[V.WinCtrl|E.KeyN]}}})),n.CursorDownSelect=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow],mac:{primary:V.Shift|E.DownArrow},linux:{primary:V.Shift|E.DownArrow}}})),n.CursorPageDown=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.PageDown}})),n.CursorPageDownSelect=Ke(new a({args:{direction:Bi.Direction.Down,unit:Bi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:V.Shift|E.PageDown}})),n.CreateCursor=Ke(new class extends Sa{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,C){if(!C.position)return;let y;C.wholeLine?y=ud.line(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition):y=ud.moveTo(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition);const S=b.getCursorStates();if(S.length>1){const M=y.modelState?y.modelState.position:null,k=y.viewState?y.viewState.position:null;for(let F=0,N=S.length;Fk&&(M=k);const F=new O(M,1,M,b.model.getLineMaxColumn(M));let N=Ns.Simple;if(y.at)switch(y.at){case XB.RawAtArgument.Top:N=Ns.Top;break;case XB.RawAtArgument.Center:N=Ns.Center;break;case XB.RawAtArgument.Bottom:N=Ns.Bottom;break}const z=b.coordinatesConverter.convertModelRangeToViewRange(F);b.revealRange(C.source,!1,z,N,vt.Smooth)}}),n.SelectAll=new class extends cwe{constructor(){super(Rgt)}runDOMCommand(b){pp&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,C,y){const S=C._getViewModel();S&&this.runCoreEditorCommand(S,y)}runCoreEditorCommand(b,C){b.model.pushStackElement(),b.setCursorStates("keyboard",Wi.Explicit,[ud.selectAll(b,b.getPrimaryCursorState())])}},n.SetSelection=Ke(new class extends Sa{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,C){C.selection&&(b.model.pushStackElement(),b.setCursorStates(C.source,Wi.Explicit,[zn.fromModelSelection(C.selection)]))}})})(Ul||(Ul={}));const xvt=ge.and(X.textInputFocus,X.columnSelection);function wz(n,e){xr.registerKeybindingRule({id:n,primary:e,when:xvt,weight:fs+1})}wz(Ul.CursorColumnSelectLeft.id,V.Shift|E.LeftArrow);wz(Ul.CursorColumnSelectRight.id,V.Shift|E.RightArrow);wz(Ul.CursorColumnSelectUp.id,V.Shift|E.UpArrow);wz(Ul.CursorColumnSelectPageUp.id,V.Shift|E.PageUp);wz(Ul.CursorColumnSelectDown.id,V.Shift|E.DownArrow);wz(Ul.CursorColumnSelectPageDown.id,V.Shift|E.PageDown);function SWe(n){return n.register(),n}var TW;(function(n){class e extends Jc{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Ke(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:X.writable,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyO}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Ke(new class extends e{constructor(){super({id:"outdent",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:V.Shift|E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Ke(new class extends e{constructor(){super({id:"tab",precondition:X.writable,kbOpts:{weight:fs,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus),primary:E.Tab}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Zr.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Ke(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Backspace,secondary:[V.Shift|E.Backspace],mac:{primary:E.Backspace,secondary:[V.Shift|E.Backspace,V.WinCtrl|E.KeyH,V.WinCtrl|E.Backspace]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingLeft)}}),n.DeleteRight=Ke(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:fs,kbExpr:X.textInputFocus,primary:E.Delete,mac:{primary:E.Delete,secondary:[V.WinCtrl|E.KeyD,V.WinCtrl|E.Delete]}}})}runCoreEditingCommand(t,i,s){const[o,r]=lF.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(Cr.DeletingRight)}}),n.Undo=new class extends cwe{constructor(){super(Eje)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},n.Redo=new class extends cwe{constructor(){super(xje)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(TW||(TW={}));class AWe extends Jle{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(jt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function gO(n,e){SWe(new AWe("default:"+n,n)),SWe(new AWe(n,n,e))}gO(Uc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});gO(Uc.ReplacePreviousChar);gO(Uc.CompositionType);gO(Uc.CompositionStart);gO(Uc.CompositionEnd);gO(Uc.Paste);gO(Uc.Cut);let wg=class extends ${onclick(e,t){this._register(pe(e,xe.CLICK,i=>t(new yu(gt(e),i))))}onmousedown(e,t){this._register(pe(e,xe.MOUSE_DOWN,i=>t(new yu(gt(e),i))))}onmouseover(e,t){this._register(pe(e,xe.MOUSE_OVER,i=>t(new yu(gt(e),i))))}onmouseleave(e,t){this._register(pe(e,xe.MOUSE_LEAVE,i=>t(new yu(gt(e),i))))}onkeydown(e,t){this._register(pe(e,xe.KEY_DOWN,i=>t(new os(i))))}onkeyup(e,t){this._register(pe(e,xe.KEY_UP,i=>t(new os(i))))}oninput(e,t){this._register(pe(e,xe.INPUT,t))}onblur(e,t){this._register(pe(e,xe.BLUR,t))}onfocus(e,t){this._register(pe(e,xe.FOCUS,t))}onchange(e,t){this._register(pe(e,xe.CHANGE,t))}ignoreGesture(e){return dh.ignoreTarget(e)}};const GU=11;class Dvt extends wg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...$e.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=GU+"px",this.domNode.style.height=GU+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new vz),this._register(Xo(this.bgDomNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Xo(this.domNode,xe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new sQ),this._pointerdownScheduleRepeatTimer=this._register(new O_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,gt(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class kvt extends ${constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new O_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===zo.Hidden?!1:this._visibility===zo.Visible?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Ivt=140;class PKe extends wg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new kvt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new vz),this._shouldRender=!0,this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(pe(this.domNode.domNode,xe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Dvt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ks(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(pe(this.slider.domNode,xe.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=ia(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Is&&a>Ivt){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const Lvt=20;class qU{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new qU(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=s>0&&s>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(Lvt,Math.floor(i*a/s))),d=(a-l)/(s-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=qU._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new aF(null,1,0))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new aF(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===zo.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Rvt extends PKe{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new qU(t.verticalHasArrows?t.arrowSize:0,t.vertical===zo.Hidden?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-GU)/2,a=(t.verticalScrollbarSize-GU)/2;this._createArrow({className:"scra",icon:Ce.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,1))}),this._createArrow({className:"scra",icon:Ce.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new aF(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===zo.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Mvt=".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{background:transparent;opacity:1;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{display:none;position:absolute}.monaco-scrollable-element>.shadow.top{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;display:block;height:3px;left:3px;top:0;width:100%}.monaco-scrollable-element>.shadow.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;display:block;height:100%;left:0;top:3px;width:3px}.monaco-scrollable-element>.shadow.top-left-corner{display:block;height:3px;left:0;top:0;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}";Ct(Mvt,{});const Nvt=500,EWe=50;class Pvt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const hae=class hae{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,s=this._rear;do{const o=s===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(eQ){const t=gt(e.browserEvent),i=xht(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let s=null;const o=new Pvt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,s)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const s=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(s,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(s,r),h=Math.max(o,a);d%c===0&&h%l===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};hae.INSTANCE=new hae;let FZ=hae;class HMe extends wg{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new I),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new I),this.onWillScroll=this._onWillScroll.event,e.style.overflow="hidden",this._options=Fvt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Rvt(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Tvt(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ks(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ks(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ks(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new O_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=St(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ei&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new aF(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=St(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new aF(s))};this._mouseWheelToDispose.push(pe(this._listenOnDomNode,xe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=FZ.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+o===0?r=o=0:Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!ei&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(o){const d=EWe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=EWe*r,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Nvt)}}class FKe extends HMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class hQ extends HMe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class bz extends HMe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new nO({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function Fvt(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:zo.Auto,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:zo.Auto,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,ei&&(e.className+=" mac"),e}class UMe extends dQ{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new ru(this._context,i),this._mouseDownOperation=this._register(new Ovt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const s=new B_t(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=pe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new f1(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(pe(this.viewHelper.viewDomNode,xe.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=FZ.INSTANCE;let t=0,i=l_.getZoomLevel(),s=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new aF(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=l_.getZoomLevel(),h=l.deltaY>0?1:-1;l_.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=l_.getZoomLevel(),s=a(c),o=0),t=Date.now(),o+=l.deltaY,s&&(l_.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(pe(this.viewHelper.viewDomNode,xe.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return ei?(c.metaKey||c.ctrlKey)&&!c.shiftKey&&!c.altKey:c.ctrlKey&&!c.metaKey&&!c.shiftKey&&!c.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(x.layoutInfo)){const t=this._context.configuration.options.get(x.layoutInfo).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new xKe(e,t).toPageCoordinates(gt(this.viewHelper.viewDomNode)),o=RMe(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=MMe(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=cF(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(c){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}_onMouseWheel(e){this.viewController.emitMouseWheel(e)}}class Ovt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new H_t(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Bvt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new lwe,this._currentSelection=new mt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===Mt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,mS.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Mt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(x.readOnly)&&o.get(x.dragAndDrop)&&!o.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===Mt.CONTENT_TEXT&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);Sv(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,mS.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=s.getCurrentScrollTop()+e.relativePos.y,l=$U.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return hu.createOutsideEditor(o,h,"below",a)}const d=s.getLineNumberAtVerticalOffset(c);return hu.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return hu.createOutsideEditor(o,new oe(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===Mt.CONTENT_VIEW_ZONE||s.type===Mt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return hu.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===Mt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Bvt extends ${constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Wvt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Wvt extends ${constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=xd(gt(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(x.lineHeight),t=this._context.configuration.options.get(x.layoutInfo).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(x.lineHeight),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let c;{const l=RMe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new sde(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=MMe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=hu.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,mS.None),this._animationFrameDisposable=xd(gt(c.element),()=>this._execute())}}const uae=class uae{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>uae.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};uae.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let lwe=uae;class oi{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}const B2=class B2{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new B2(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new B2(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const s=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,s,-1)}if(e>=this.selectionEnd){const s=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,s,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` `,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(LS(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(iZ(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,c=e.selectionEnd-s,l=t.selectionStart-s,d=t.selectionEnd-s;if(l===d){const u=e.selectionStart-s;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=c-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(LS(e.value,t.value),e.selectionEnd),s=Math.min(iZ(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}};B2.EMPTY=new B2("",0,0,null,void 0);let kh=B2;class ZB{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new O(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=ZB._getPageOfLine(t.startLineNumber,i),a=ZB._getRangeForPage(r,i),c=ZB._getPageOfLine(t.endLineNumber,i),l=ZB._getRangeForPage(c,i);let d=a.intersectRanges(new O(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,xo.LF)>500){const w=e.modifyPosition(d.getEndPosition(),-500);d=O.fromPositions(w,d.getEndPosition())}const h=e.getValueInRange(d,xo.LF),u=e.getLineCount(),f=e.getLineMaxColumn(u);let p=l.intersectRanges(new O(t.endLineNumber,t.endColumn,u,f));if(s&&e.getValueLengthInRange(p,xo.LF)>500){const w=e.modifyPosition(p.getStartPosition(),500);p=O.fromPositions(p.getStartPosition(),w)}const m=e.getValueInRange(p,xo.LF);let v;if(r===c||r+1===c)v=e.getValueInRange(t,xo.LF);else{const w=a.intersectRanges(t),b=l.intersectRanges(t);v=e.getValueInRange(w,xo.LF)+"…"+e.getValueInRange(b,xo.LF)}return s&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new kh(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var OZ;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(OZ||(OZ={}));const dwe={forceCopyWithSyntaxHighlighting:!1},gae=class gae{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};gae.INSTANCE=new gae;let Z9=gae;class Hvt{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let hwe=class extends ${get textAreaState(){return this._textAreaState}constructor(e,t,i,s,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new I),this.onCut=this._onCut.event,this._onPaste=this._register(new I),this.onPaste=this._onPaste.event,this._onType=this._register(new I),this.onType=this._onType.event,this._onCompositionStart=this._register(new I),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new I),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new I),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new I),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Dn),this._asyncTriggerCut=this._register(new yn(()=>this._onCut.fire(),0)),this._textAreaState=kh.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(T.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new yn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(c=>{const l=new os(c);(l.keyCode===E.KEY_IN_COMPOSITION||this._currentComposition&&l.keyCode===E.Backspace)&&l.stopPropagation(),l.equals(E.Escape)&&l.preventDefault(),a=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(c=>{const l=new os(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new Hvt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===Pr.Macintosh&&a&&a.equals(E.KEY_IN_COMPOSITION)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===c.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){l.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:c.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:c.data});return}this._onCompositionStart.fire({data:c.data})})),this._register(this._textArea.onCompositionUpdate(c=>{const l=this._currentComposition;if(!l)return;if(this._browser.isAndroid){const h=kh.readFromTextArea(this._textArea,this._textAreaState),u=kh.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=kh.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(c)})),this._register(this._textArea.onCompositionEnd(c=>{const l=this._currentComposition;if(!l)return;if(this._currentComposition=null,this._browser.isAndroid){const h=kh.readFromTextArea(this._textArea,this._textAreaState),u=kh.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=kh.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const l=kh.readFromTextArea(this._textArea,this._textAreaState),d=kh.deduceInput(this._textAreaState,l,this._OS===Pr.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(wl(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=l,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(c=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(c),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(c=>{this._ensureClipboardGetsEditorSelection(c)})),this._register(this._textArea.onPaste(c=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),c.preventDefault(),!c.clipboardData)return;let[l,d]=uwe.getTextData(c.clipboardData);l&&(d=d||Z9.INSTANCE.get(l),this._onPaste.fire({text:l,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const c=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!c&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new yn(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_initializeFromTest(){this._hasFocus=!0,this._textAreaState=kh.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return pe(this._textArea.ownerDocument,"selectionchange",t=>{if(Hk.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),c=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===c)return;const l=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(c),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new mt(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Z9.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&uwe.setTextData(e.clipboardData,t.text,t.html,i)}};hwe=D([_(4,Ur),_(5,Ze)],hwe);const uwe={getTextData(n){const e=n.getData(Js.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Js.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class Uvt extends ${get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new oi(this._actual,"keydown")).event,this.onKeyPress=this._register(new oi(this._actual,"keypress")).event,this.onKeyUp=this._register(new oi(this._actual,"keyup")).event,this.onCompositionStart=this._register(new oi(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new oi(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new oi(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new oi(this._actual,"beforeinput")).event,this.onInput=this._register(new oi(this._actual,"input")).event,this.onCut=this._register(new oi(this._actual,"cut")).event,this.onCopy=this._register(new oi(this._actual,"copy")).event,this.onPaste=this._register(new oi(this._actual,"paste")).event,this.onFocus=this._register(new oi(this._actual,"focus")).event,this.onBlur=this._register(new oi(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Hk.onKeyDown())),this._register(this.onBeforeInput(()=>Hk.onBeforeInput())),this._register(this.onInput(()=>Hk.onInput())),this._register(this.onKeyUp(()=>Hk.onKeyUp())),this._register(pe(this._actual,OZ.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=cF(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?xl()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let o=null;const r=cF(s);r?o=r.activeElement:o=xl();const a=gt(o),c=o===s,l=s.selectionStart,d=s.selectionEnd;if(c&&l===t&&d===i){pp&&a.parent!==a&&s.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),pp&&a.parent!==a&&s.focus();return}try{const h=ngt(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),sgt(s,h)}catch{}}}class Vvt extends UMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,o=>this.onTap(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,o=>this.onChange(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,o=>this._onContextMenu(new f1(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(pe(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new W_t(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:mS.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Mt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class zvt extends UMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,s=>this.onTap(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,s=>this.onChange(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,s=>this._onContextMenu(new f1(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(OZ.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,mS.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class $vt extends ${constructor(e,t,i){super(),(I_||Zct&&sQe)&&nMe.pointerEvents?this.handler=this._register(new Vvt(e,t,i)):yi.TouchEvent?this.handler=this._register(new zvt(e,t,i)):this.handler=this._register(new UMe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Gvt=".monaco-editor .inputarea{background-color:transparent;border:none;color:transparent;margin:0;min-height:0;min-width:0;outline:none!important;overflow:hidden;padding:0;position:absolute;resize:none;z-index:-10}.monaco-editor .inputarea.ime-input{caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground);z-index:10}";Ct(Gvt,{});var qvt=".monaco-editor .margin-view-overlays .line-numbers{bottom:0;box-sizing:border-box;cursor:default;display:inline-block;font-variant-numeric:tabular-nums;position:absolute;text-align:right;vertical-align:middle}.monaco-editor .relative-current-line-number{display:inline-block;text-align:left;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}";Ct(qvt,{});class fO extends dQ{}function Nr(n){return{id:n}}function gwe(n){switch(n){case sf.DARK:return"vs-dark";case sf.HIGH_CONTRAST_DARK:return"hc-black";case sf.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const OKe={ThemingContribution:"base.contributions.theming"};class Qvt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new I}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ee(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}get onThemingParticipantAdded(){return this.onThemingParticipantAddedEmitter.event}getThemingParticipants(){return this.themingParticipants}}const BKe=new Qvt;it.add(OKe.ThemingContribution,BKe);function Im(n){return BKe.onColorThemeChange(n)}class VMe extends ${constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}getColor(e,t){let i=this.theme.getColor(e);return i&&t&&(i=t(i,this.theme)),i?i.toString():null}}const Ci="vs/editor/common/core/editorColorRegistry",WKe=B("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,0,"Background color for the highlight of line at the cursor position.")),xWe=B("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ft},g(Ci,1,"Background color for the border around the line at the cursor position."));B("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(Ci,2,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,3,"Background color of the border around highlighted ranges."));B("editor.symbolHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Ci,4,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,5,"Background color of the border around highlighted symbols."));const tS=B("editorCursor.foreground",{dark:"#AEAFAD",light:fe.black,hcDark:fe.white,hcLight:"#0F4A85"},g(Ci,6,"Color of the editor cursor.")),EE=B("editorCursor.background",null,g(Ci,7,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),HKe=B("editorMultiCursor.primary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,8,"Color of the primary editor cursor when multiple cursors are present.")),jvt=B("editorMultiCursor.primary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,9,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),UKe=B("editorMultiCursor.secondary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,10,"Color of secondary editor cursors when multiple cursors are present.")),Kvt=B("editorMultiCursor.secondary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,11,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),xE=B("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(Ci,12,"Color of whitespace characters in the editor.")),Yvt=B("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:fe.white,hcLight:"#292929"},g(Ci,13,"Color of editor line numbers.")),Nj=B("editorIndentGuide.background",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,14,"Color of the editor indentation guides."),!1,g(Ci,15,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Pj=B("editorIndentGuide.activeBackground",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,16,"Color of the active editor indentation guides."),!1,g(Ci,17,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),uQ=B("editorIndentGuide.background1",{dark:Nj,light:Nj,hcDark:Nj,hcLight:Nj},g(Ci,18,"Color of the editor indentation guides (1).")),Jvt=B("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,19,"Color of the editor indentation guides (2).")),Xvt=B("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,20,"Color of the editor indentation guides (3).")),Zvt=B("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,21,"Color of the editor indentation guides (4).")),ewt=B("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,22,"Color of the editor indentation guides (5).")),twt=B("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,23,"Color of the editor indentation guides (6).")),gQ=B("editorIndentGuide.activeBackground1",{dark:Pj,light:Pj,hcDark:Pj,hcLight:Pj},g(Ci,24,"Color of the active editor indentation guides (1).")),iwt=B("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,25,"Color of the active editor indentation guides (2).")),nwt=B("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,26,"Color of the active editor indentation guides (3).")),swt=B("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,27,"Color of the active editor indentation guides (4).")),owt=B("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,28,"Color of the active editor indentation guides (5).")),rwt=B("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,29,"Color of the active editor indentation guides (6).")),Fj=B("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:co,hcLight:co},g(Ci,30,"Color of editor active line number"),!1,g(Ci,31,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));B("editorLineNumber.activeForeground",{dark:Fj,light:Fj,hcDark:Fj,hcLight:Fj},g(Ci,30,"Color of editor active line number"));const awt=B("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,32,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));B("editorRuler.foreground",{dark:"#5A5A5A",light:fe.lightgrey,hcDark:fe.white,hcLight:"#292929"},g(Ci,33,"Color of the editor rulers."));B("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(Ci,34,"Foreground color of editor CodeLens"));B("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(Ci,35,"Background color behind matching brackets"));B("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ft,hcLight:ft},g(Ci,36,"Color for matching brackets boxes"));const cwt=B("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(Ci,37,"Color of the overview ruler border.")),lwt=B("editorOverviewRuler.background",null,g(Ci,38,"Background color of the editor overview ruler."));B("editorGutter.background",{dark:us,light:us,hcDark:us,hcLight:us},g(Ci,39,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));B("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:ft},g(Ci,40,"Border color of unnecessary (unused) source code in the editor."));const dwt=B("editorUnnecessaryCode.opacity",{dark:fe.fromHex("#000a"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,41,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));B("editorGhostText.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:fe.fromHex("#292929").transparent(.8)},g(Ci,42,"Border color of ghost text in the editor."));B("editorGhostText.foreground",{dark:fe.fromHex("#ffffff56"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,43,"Foreground color of the ghost text in the editor."));B("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,44,"Background color of the ghost text in the editor."));const Oj=new fe(new gn(0,122,204,.6)),VKe=B("editorOverviewRuler.rangeHighlightForeground",{dark:Oj,light:Oj,hcDark:Oj,hcLight:Oj},g(Ci,45,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hwt=B("editorOverviewRuler.errorForeground",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(Ci,46,"Overview ruler marker color for errors.")),uwt=B("editorOverviewRuler.warningForeground",{dark:Gc,light:Gc,hcDark:K9,hcLight:K9},g(Ci,47,"Overview ruler marker color for warnings.")),gwt=B("editorOverviewRuler.infoForeground",{dark:qc,light:qc,hcDark:Y9,hcLight:Y9},g(Ci,48,"Overview ruler marker color for infos.")),zKe=B("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(Ci,49,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),$Ke=B("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(Ci,50,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),GKe=B("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(Ci,51,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),qKe=B("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,52,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),QKe=B("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,53,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),jKe=B("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,54,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),fwt=B("editorBracketHighlight.unexpectedBracket.foreground",{dark:new fe(new gn(255,18,18,.8)),light:new fe(new gn(255,18,18,.8)),hcDark:new fe(new gn(255,50,50,1)),hcLight:""},g(Ci,55,"Foreground color of unexpected brackets.")),pwt=B("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,56,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),mwt=B("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,57,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),_wt=B("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,58,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),vwt=B("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,59,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),wwt=B("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,60,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),bwt=B("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,61,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Cwt=B("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,62,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),ywt=B("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,63,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Swt=B("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,64,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Awt=B("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,65,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Ewt=B("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,66,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),xwt=B("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,67,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));B("editorUnicodeHighlight.border",{dark:Gc,light:Gc,hcDark:Gc,hcLight:Gc},g(Ci,68,"Border color used to highlight unicode characters."));B("editorUnicodeHighlight.background",{dark:Aj,light:Aj,hcDark:Aj,hcLight:Aj},g(Ci,69,"Background color used to highlight unicode characters."));Im((n,e)=>{const t=n.getColor(us),i=n.getColor(WKe),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});const fae=class fae extends fO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new oe(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(x.lineHeight);const t=e.get(x.lineNumbers);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(x.renderFinalNewline);const i=e.get(x.layoutInfo);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===Qr.Relative||this._renderLineNumbers===Qr.Interval)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===Qr.Relative){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}if(this._renderLineNumbers===Qr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const s=this._context.viewModel.getLineCount();return i===s?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===Qr.Off){this._renderResult=null;return}const t=jr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>O.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=s;l++){const d=l-i;let h=this._getLineRenderLineNumber(l),u="";for(;r${h}`}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};fae.CLASS_NAME="line-numbers";let BZ=fae;Im((n,e)=>{const t=n.getColor(Yvt),i=n.getColor(awt);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});var Dwt=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";Ct(Dwt,{});const W2=class W2 extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(W2.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ks(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(W2.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};W2.CLASS_NAME="glyph-margin",W2.OUTER_CLASS_NAME="margin";let WZ=W2;var kwt=".monaco-mouse-cursor-text{cursor:text}";Ct(kwt,{});const lx="monaco-mouse-cursor-text";class Iwt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const b$=new Iwt,ti=ae("keybindingService"),l5="vs/editor/browser/controller/textAreaHandler";class Lwt{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new oe(this.modelLineNumber,this.distanceToModelLineStart+1),i=new oe(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:Ad.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const ife=pp;let fwe=class extends Cp{constructor(e,t,i,s,o){super(e),this._keybindingService=s,this._instantiationService=o,this._primaryCursorPosition=new oe(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(x.layoutInfo);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(x.fontInfo),this._lineHeight=r.get(x.lineHeight),this._emptySelectionClipboard=r.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new mt(1,1,1,1)],this._modelSelections=[new mt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ks(document.createElement("textarea")),Xb.write(this.textArea,Da.TextArea),this.textArea.setClassName(`inputarea ${lx}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(x.tabIndex))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",g(l5,0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ks(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,f)=>this._context.viewModel.getValueInRange(u,f),getValueLengthInRange:(u,f)=>this._context.viewModel.getValueLengthInRange(u,f),modifyPosition:(u,f)=>this._context.viewModel.modifyPosition(u,f)},d={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Is),f=this._context.viewModel.model.getEOL(),p=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(u)?u:null,v=Array.isArray(u)?u.join(f):u;let w,b=null;if(dwe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const C=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(w=C.html,b=C.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:w,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===Kd.Disabled){const u=this._selections[0];if(ei&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new kh(m,m.length,m.length,O.fromPositions(p),0)}if(ei&&!u.isEmpty()&&l.getValueLengthInRange(u,xo.TextDefined)<500){const p=l.getValueInRange(u,xo.TextDefined);return new kh(p,0,p.length,u,0)}if(TS&&!u.isEmpty()){const p="vscode-placeholder";return new kh(p,0,p.length,null,void 0)}return kh.EMPTY}if(n2e){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new kh(p,m,m,O.fromPositions(f),0)}return kh.EMPTY}return ZB.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Kd.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Uvt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(hwe,d,h,zc,{isAndroid:n2e,isChrome:eQ,isFirefox:pp,isSafari:TS})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let f=!1,p=null,m=null;u.metadata&&(f=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,p=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,m=u.metadata.mode),this._viewController.paste(u.text,f,p,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:v}=(()=>{const b=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),C=b.lastIndexOf(` +`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Js.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class Uvt extends ${get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new oi(this._actual,"keydown")).event,this.onKeyPress=this._register(new oi(this._actual,"keypress")).event,this.onKeyUp=this._register(new oi(this._actual,"keyup")).event,this.onCompositionStart=this._register(new oi(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new oi(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new oi(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new oi(this._actual,"beforeinput")).event,this.onInput=this._register(new oi(this._actual,"input")).event,this.onCut=this._register(new oi(this._actual,"cut")).event,this.onCopy=this._register(new oi(this._actual,"copy")).event,this.onPaste=this._register(new oi(this._actual,"paste")).event,this.onFocus=this._register(new oi(this._actual,"focus")).event,this.onBlur=this._register(new oi(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Hk.onKeyDown())),this._register(this.onBeforeInput(()=>Hk.onBeforeInput())),this._register(this.onInput(()=>Hk.onInput())),this._register(this.onKeyUp(()=>Hk.onKeyUp())),this._register(pe(this._actual,OZ.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=cF(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?xl()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let o=null;const r=cF(s);r?o=r.activeElement:o=xl();const a=gt(o),c=o===s,l=s.selectionStart,d=s.selectionEnd;if(c&&l===t&&d===i){pp&&a.parent!==a&&s.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),pp&&a.parent!==a&&s.focus();return}try{const h=ngt(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),sgt(s,h)}catch{}}}class Vvt extends UMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,o=>this.onTap(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,o=>this.onChange(o))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,o=>this._onContextMenu(new f1(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(pe(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new W_t(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:mS.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Mt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class zvt extends UMe{constructor(e,t,i){super(e,t,i),this._register(dh.addTarget(this.viewHelper.linesContentDomNode)),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Tap,s=>this.onTap(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Change,s=>this.onChange(s))),this._register(pe(this.viewHelper.linesContentDomNode,Eo.Contextmenu,s=>this._onContextMenu(new f1(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new f1(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(OZ.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,mS.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class $vt extends ${constructor(e,t,i){super(),(I_||Zct&&sQe)&&nMe.pointerEvents?this.handler=this._register(new Vvt(e,t,i)):yi.TouchEvent?this.handler=this._register(new zvt(e,t,i)):this.handler=this._register(new UMe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Gvt=".monaco-editor .inputarea{background-color:transparent;border:none;color:transparent;margin:0;min-height:0;min-width:0;outline:none!important;overflow:hidden;padding:0;position:absolute;resize:none;z-index:-10}.monaco-editor .inputarea.ime-input{caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground);z-index:10}";Ct(Gvt,{});var qvt=".monaco-editor .margin-view-overlays .line-numbers{bottom:0;box-sizing:border-box;cursor:default;display:inline-block;font-variant-numeric:tabular-nums;position:absolute;text-align:right;vertical-align:middle}.monaco-editor .relative-current-line-number{display:inline-block;text-align:left;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}";Ct(qvt,{});class fO extends dQ{}function Nr(n){return{id:n}}function gwe(n){switch(n){case sf.DARK:return"vs-dark";case sf.HIGH_CONTRAST_DARK:return"hc-black";case sf.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const OKe={ThemingContribution:"base.contributions.theming"};class Qvt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new I}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ee(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}get onThemingParticipantAdded(){return this.onThemingParticipantAddedEmitter.event}getThemingParticipants(){return this.themingParticipants}}const BKe=new Qvt;it.add(OKe.ThemingContribution,BKe);function Im(n){return BKe.onColorThemeChange(n)}class VMe extends ${constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}getColor(e,t){let i=this.theme.getColor(e);return i&&t&&(i=t(i,this.theme)),i?i.toString():null}}const Ci="vs/editor/common/core/editorColorRegistry",WKe=B("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,0,"Background color for the highlight of line at the cursor position.")),xWe=B("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ft},g(Ci,1,"Background color for the border around the line at the cursor position."));B("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(Ci,2,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,3,"Background color of the border around highlighted ranges."));B("editor.symbolHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(Ci,4,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Ci,5,"Background color of the border around highlighted symbols."));const tS=B("editorCursor.foreground",{dark:"#AEAFAD",light:fe.black,hcDark:fe.white,hcLight:"#0F4A85"},g(Ci,6,"Color of the editor cursor.")),EE=B("editorCursor.background",null,g(Ci,7,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),HKe=B("editorMultiCursor.primary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,8,"Color of the primary editor cursor when multiple cursors are present.")),jvt=B("editorMultiCursor.primary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,9,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),UKe=B("editorMultiCursor.secondary.foreground",{dark:tS,light:tS,hcDark:tS,hcLight:tS},g(Ci,10,"Color of secondary editor cursors when multiple cursors are present.")),Kvt=B("editorMultiCursor.secondary.background",{dark:EE,light:EE,hcDark:EE,hcLight:EE},g(Ci,11,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),xE=B("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(Ci,12,"Color of whitespace characters in the editor.")),Yvt=B("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:fe.white,hcLight:"#292929"},g(Ci,13,"Color of editor line numbers.")),Nj=B("editorIndentGuide.background",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,14,"Color of the editor indentation guides."),!1,g(Ci,15,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Pj=B("editorIndentGuide.activeBackground",{dark:xE,light:xE,hcDark:xE,hcLight:xE},g(Ci,16,"Color of the active editor indentation guides."),!1,g(Ci,17,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),uQ=B("editorIndentGuide.background1",{dark:Nj,light:Nj,hcDark:Nj,hcLight:Nj},g(Ci,18,"Color of the editor indentation guides (1).")),Jvt=B("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,19,"Color of the editor indentation guides (2).")),Xvt=B("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,20,"Color of the editor indentation guides (3).")),Zvt=B("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,21,"Color of the editor indentation guides (4).")),ewt=B("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,22,"Color of the editor indentation guides (5).")),twt=B("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,23,"Color of the editor indentation guides (6).")),gQ=B("editorIndentGuide.activeBackground1",{dark:Pj,light:Pj,hcDark:Pj,hcLight:Pj},g(Ci,24,"Color of the active editor indentation guides (1).")),iwt=B("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,25,"Color of the active editor indentation guides (2).")),nwt=B("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,26,"Color of the active editor indentation guides (3).")),swt=B("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,27,"Color of the active editor indentation guides (4).")),owt=B("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,28,"Color of the active editor indentation guides (5).")),rwt=B("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,29,"Color of the active editor indentation guides (6).")),Fj=B("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:co,hcLight:co},g(Ci,30,"Color of editor active line number"),!1,g(Ci,31,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));B("editorLineNumber.activeForeground",{dark:Fj,light:Fj,hcDark:Fj,hcLight:Fj},g(Ci,30,"Color of editor active line number"));const awt=B("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,32,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));B("editorRuler.foreground",{dark:"#5A5A5A",light:fe.lightgrey,hcDark:fe.white,hcLight:"#292929"},g(Ci,33,"Color of the editor rulers."));B("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(Ci,34,"Foreground color of editor CodeLens"));B("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(Ci,35,"Background color behind matching brackets"));B("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ft,hcLight:ft},g(Ci,36,"Color for matching brackets boxes"));const cwt=B("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(Ci,37,"Color of the overview ruler border.")),lwt=B("editorOverviewRuler.background",null,g(Ci,38,"Background color of the editor overview ruler."));B("editorGutter.background",{dark:us,light:us,hcDark:us,hcLight:us},g(Ci,39,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));B("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:ft},g(Ci,40,"Border color of unnecessary (unused) source code in the editor."));const dwt=B("editorUnnecessaryCode.opacity",{dark:fe.fromHex("#000a"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,41,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));B("editorGhostText.border",{dark:null,light:null,hcDark:fe.fromHex("#fff").transparent(.8),hcLight:fe.fromHex("#292929").transparent(.8)},g(Ci,42,"Border color of ghost text in the editor."));B("editorGhostText.foreground",{dark:fe.fromHex("#ffffff56"),light:fe.fromHex("#0007"),hcDark:null,hcLight:null},g(Ci,43,"Foreground color of the ghost text in the editor."));B("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},g(Ci,44,"Background color of the ghost text in the editor."));const Oj=new fe(new gn(0,122,204,.6)),VKe=B("editorOverviewRuler.rangeHighlightForeground",{dark:Oj,light:Oj,hcDark:Oj,hcLight:Oj},g(Ci,45,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),hwt=B("editorOverviewRuler.errorForeground",{dark:new fe(new gn(255,18,18,.7)),light:new fe(new gn(255,18,18,.7)),hcDark:new fe(new gn(255,50,50,1)),hcLight:"#B5200D"},g(Ci,46,"Overview ruler marker color for errors.")),uwt=B("editorOverviewRuler.warningForeground",{dark:qc,light:qc,hcDark:K9,hcLight:K9},g(Ci,47,"Overview ruler marker color for warnings.")),gwt=B("editorOverviewRuler.infoForeground",{dark:Qc,light:Qc,hcDark:Y9,hcLight:Y9},g(Ci,48,"Overview ruler marker color for infos.")),zKe=B("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(Ci,49,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),$Ke=B("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(Ci,50,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),GKe=B("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(Ci,51,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),qKe=B("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,52,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),QKe=B("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,53,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),jKe=B("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,54,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),fwt=B("editorBracketHighlight.unexpectedBracket.foreground",{dark:new fe(new gn(255,18,18,.8)),light:new fe(new gn(255,18,18,.8)),hcDark:new fe(new gn(255,50,50,1)),hcLight:""},g(Ci,55,"Foreground color of unexpected brackets.")),pwt=B("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,56,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),mwt=B("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,57,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),_wt=B("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,58,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),vwt=B("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,59,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),wwt=B("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,60,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),bwt=B("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,61,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Cwt=B("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,62,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),ywt=B("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,63,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Swt=B("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,64,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Awt=B("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,65,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Ewt=B("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,66,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),xwt=B("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},g(Ci,67,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));B("editorUnicodeHighlight.border",{dark:qc,light:qc,hcDark:qc,hcLight:qc},g(Ci,68,"Border color used to highlight unicode characters."));B("editorUnicodeHighlight.background",{dark:Aj,light:Aj,hcDark:Aj,hcLight:Aj},g(Ci,69,"Background color used to highlight unicode characters."));Im((n,e)=>{const t=n.getColor(us),i=n.getColor(WKe),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});const fae=class fae extends fO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new oe(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(x.lineHeight);const t=e.get(x.lineNumbers);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(x.renderFinalNewline);const i=e.get(x.layoutInfo);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===Qr.Relative||this._renderLineNumbers===Qr.Interval)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===Qr.Relative){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}if(this._renderLineNumbers===Qr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const s=this._context.viewModel.getLineCount();return i===s?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===Qr.Off){this._renderResult=null;return}const t=jr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>O.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=s;l++){const d=l-i;let h=this._getLineRenderLineNumber(l),u="";for(;r${h}`}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};fae.CLASS_NAME="line-numbers";let BZ=fae;Im((n,e)=>{const t=n.getColor(Yvt),i=n.getColor(awt);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});var Dwt=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";Ct(Dwt,{});const W2=class W2 extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(W2.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ks(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(W2.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};W2.CLASS_NAME="glyph-margin",W2.OUTER_CLASS_NAME="margin";let WZ=W2;var kwt=".monaco-mouse-cursor-text{cursor:text}";Ct(kwt,{});const lx="monaco-mouse-cursor-text";class Iwt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const b$=new Iwt,ti=ae("keybindingService"),l5="vs/editor/browser/controller/textAreaHandler";class Lwt{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new oe(this.modelLineNumber,this.distanceToModelLineStart+1),i=new oe(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:Ad.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const ife=pp;let fwe=class extends Cp{constructor(e,t,i,s,o){super(e),this._keybindingService=s,this._instantiationService=o,this._primaryCursorPosition=new oe(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(x.layoutInfo);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(x.fontInfo),this._lineHeight=r.get(x.lineHeight),this._emptySelectionClipboard=r.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new mt(1,1,1,1)],this._modelSelections=[new mt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ks(document.createElement("textarea")),Xb.write(this.textArea,Da.TextArea),this.textArea.setClassName(`inputarea ${lx}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(x.tabIndex))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",g(l5,0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ks(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,f)=>this._context.viewModel.getValueInRange(u,f),getValueLengthInRange:(u,f)=>this._context.viewModel.getValueLengthInRange(u,f),modifyPosition:(u,f)=>this._context.viewModel.modifyPosition(u,f)},d={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Is),f=this._context.viewModel.model.getEOL(),p=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(u)?u:null,v=Array.isArray(u)?u.join(f):u;let w,b=null;if(dwe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const C=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(w=C.html,b=C.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:w,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===Kd.Disabled){const u=this._selections[0];if(ei&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new kh(m,m.length,m.length,O.fromPositions(p),0)}if(ei&&!u.isEmpty()&&l.getValueLengthInRange(u,xo.TextDefined)<500){const p=l.getValueInRange(u,xo.TextDefined);return new kh(p,0,p.length,u,0)}if(TS&&!u.isEmpty()){const p="vscode-placeholder";return new kh(p,0,p.length,null,void 0)}return kh.EMPTY}if(n2e){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new kh(p,m,m,O.fromPositions(f),0)}return kh.EMPTY}return ZB.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Kd.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Uvt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(hwe,d,h,$c,{isAndroid:n2e,isChrome:eQ,isFirefox:pp,isSafari:TS})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let f=!1,p=null,m=null;u.metadata&&(f=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,p=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,m=u.metadata.mode),this._viewController.paste(u.text,f,p,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:v}=(()=>{const b=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),C=b.lastIndexOf(` `),y=b.substring(C+1),S=y.lastIndexOf(" "),M=y.length-S-1,k=p.getStartPosition(),F=Math.min(k.column-1,M),N=k.column-1-F,z=y.substring(0,y.length-F),{tabSize:U}=this._context.viewModel.model.getOptions(),J=Twt(this.textArea.domNode.ownerDocument,z,this._fontInfo,U);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:J}})(),{distanceToModelLineEnd:w}=(()=>{const b=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),C=b.indexOf(` -`),y=C===-1?b:b.substring(0,C),S=y.indexOf(" "),M=S===-1?y.length:y.length-S-1,k=p.getEndPosition(),F=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,M);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-F}})();this._context.viewModel.revealRange("keyboard",!0,O.fromPositions(this._selections[0].getStartPosition()),Ns.Simple,vt.Immediate),this._visibleTextArea=new Lwt(this._context,p.startLineNumber,m,v,w),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${lx} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${lx}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(b$.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=R_(t,[]);let o=!0,r=e.column,a=!0,c=e.column,l=0;for(;l<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==da.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);s.get(d)!==da.Regular?a=!1:c++}l++}return[i.substring(r-1,c-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=R_(this._context.configuration.options.get(x.wordSeparators),[]);let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==da.Regular||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wl(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Kd.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),s=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(l5,1,"The editor is not accessible at this time.");return i?g(l5,2,"{0} To enable screen reader optimized mode, use {1}",r,i):s?g(l5,3,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?g(l5,4,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,o):r}return e.get(x.ariaLabel)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(x.accessibilitySupport);const t=e.get(x.accessibilityPageSize);this._accessibilitySupport===Kd.Enabled&&t===_u.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(x.layoutInfo).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==Kd.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=ife?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(x.fontInfo),this._lineHeight=t.get(x.lineHeight),this._emptySelectionClipboard=t.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=t.get(x.copyWithSyntaxHighlighting),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(x.tabIndex))),(e.hasChanged(x.domReadOnly)||e.hasChanged(x.readOnly))&&this._ensureReadOnlyAttribute(),e.hasChanged(x.accessibilitySupport)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!b$.enabled||e.get(x.domReadOnly)&&e.get(x.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new oe(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,s=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&s&&s.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let l=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=s.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewModel.getViewLineData(o.lineNumber),f=u.tokens.findTokenIndexAtOffset(o.column-1),p=u.tokens.findTokenIndexAtOffset(r.column-1),m=f===p,v=this._visibleTextArea.definePresentation(m?u.tokens.getPresentation(f):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=l,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:this._lineHeight,useCover:!1,color:(lc.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(ei||this._accessibilitySupport===Kd.Enabled){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:ife?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`),y=C===-1?b:b.substring(0,C),S=y.indexOf(" "),M=S===-1?y.length:y.length-S-1,k=p.getEndPosition(),F=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,M);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-F}})();this._context.viewModel.revealRange("keyboard",!0,O.fromPositions(this._selections[0].getStartPosition()),Ns.Simple,vt.Immediate),this._visibleTextArea=new Lwt(this._context,p.startLineNumber,m,v,w),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${lx} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${lx}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(b$.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=R_(t,[]);let o=!0,r=e.column,a=!0,c=e.column,l=0;for(;l<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==da.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);s.get(d)!==da.Regular?a=!1:c++}l++}return[i.substring(r-1,c-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=R_(this._context.configuration.options.get(x.wordSeparators),[]);let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==da.Regular||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wl(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Kd.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),s=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(l5,1,"The editor is not accessible at this time.");return i?g(l5,2,"{0} To enable screen reader optimized mode, use {1}",r,i):s?g(l5,3,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?g(l5,4,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,o):r}return e.get(x.ariaLabel)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(x.accessibilitySupport);const t=e.get(x.accessibilityPageSize);this._accessibilitySupport===Kd.Enabled&&t===_u.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(x.layoutInfo).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==Kd.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=ife?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(x.fontInfo),this._lineHeight=t.get(x.lineHeight),this._emptySelectionClipboard=t.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=t.get(x.copyWithSyntaxHighlighting),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(x.tabIndex))),(e.hasChanged(x.domReadOnly)||e.hasChanged(x.readOnly))&&this._ensureReadOnlyAttribute(),e.hasChanged(x.accessibilitySupport)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!b$.enabled||e.get(x.domReadOnly)&&e.get(x.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new oe(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,s=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&s&&s.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let l=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=s.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewModel.getViewLineData(o.lineNumber),f=u.tokens.findTokenIndexAtOffset(o.column-1),p=u.tokens.findTokenIndexAtOffset(r.column-1),m=f===p,v=this._visibleTextArea.definePresentation(m?u.tokens.getPresentation(f):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=l,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:this._lineHeight,useCover:!1,color:(dc.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(ei||this._accessibilitySupport===Kd.Enabled){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:ife?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` `,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:ife?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Sd(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?fe.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(x.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+WZ.OUTER_CLASS_NAME):s.get(x.lineNumbers).renderType!==Qr.Off?i.setClassName("monaco-editor-background textAreaCover "+BZ.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};fwe=D([_(3,ti),_(4,be)],fwe);function Twt(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Sd(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}class Rwt{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Ul.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Ul.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ul.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Ul.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Ul.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ul.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ul.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ul.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ul.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ul.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ul.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ul.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ul.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ul.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class KKe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new cn("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let c=i;c<=s;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=l,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let h=0;hi)continue;const c=Math.max(t,a.fromLineNumber),l=Math.min(i,a.toLineNumber);for(let d=c;d<=l;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),s=!0}}return s}}class YKe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new KKe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ks(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(x.layoutInfo)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),c=o.linesLength-1-r+1;c>0&&(this._removeLinesAfter(o,c),o.linesLength-=c)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=r+c;a[c].layoutLine(l,s[l-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let c=t;c<=i;c++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const c=e.lines[a];s[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");FA._ttPolicy&&(t=FA._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;oe}),FA._sb=new fz(1e5);let pwe=FA;class JKe extends Cp{constructor(e){super(e),this._visibleLines=new YKe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);Sd(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class Nwt extends JKe{constructor(e){super(e);const i=this._context.configuration.options.get(x.layoutInfo);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Pwt extends JKe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Sd(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;Sd(this.domNode,t.get(x.fontInfo));const i=t.get(x.layoutInfo);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class lde{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return lde.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===Mt.GUTTER_VIEW_ZONE||i.type===Mt.CONTENT_VIEW_ZONE)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new oe(e.afterLineNumber,1)).lineNumber}}}var Fwt=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";Ct(Fwt,{});class Owt extends Cp{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(x.layoutInfo),s=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==s&&(this.contentWidth=s,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const s of i){if(!s.options.blockClassName)continue;let o=this.blocks[t];o||(o=this.blocks[t]=ks(document.createElement("div")),this.domNode.appendChild(o));let r,a;s.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!0),a=s.range.isEmpty()&&!s.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0));const[c,l,d,h]=s.options.blockPadding??[0,0,0,0];o.setClassName("blockDecorations-block "+s.options.blockClassName),o.setLeft(this.contentLeft-h),o.setWidth(this.contentWidth+h+l),o.setTop(r-e.scrollTop-c),o.setHeight(a-r+c+d),t++}for(let s=t;s0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,c=s.viewportHeight-a,l=o-i,d=r>=i,h=a,u=c>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const u=h-(c-s);h-=u,i-=u}if(h=m,b=h+i<=u.height-v;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(d,m),fitsBelow:b,belowTop:h,left:p}:{fitsAbove:w,aboveTop:o,fitsBelow:b,belowTop:r,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new h5(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=o(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,s=o(i,this._affinity,this._lineHeight);return{primary:t,secondary:s};function o(r,a,c){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const d=r.column===1&&a===jo.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop;return new DWe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(x.fontInfo);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&nfe(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&nfe(this._actual.afterRender,this._actual,this._renderData.position)}};class d5{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class h5{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class DWe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function nfe(n,e,...t){try{return n.call(e,...t)}catch{return null}}var Hwt=`.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{box-sizing:border-box;display:block;height:100%;left:0;position:absolute;top:0}.monaco-editor .margin-view-overlays - .current-line.current-line-margin.current-line-margin-both{border-right:0}`;Ct(Hwt,{});class XKe extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new mt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),Ls(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=[];for(let r=t;r<=i;r++){const a=r-t;s[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new oe(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new oe(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new oe(l,this._context.viewModel.model.getLineMaxColumn(l))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let p=u;p<=f;p++){const m=p-t;s[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;s[a]=o}this._renderData=s}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Uwt extends XKe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Vwt extends XKe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Im((n,e)=>{const t=n.getColor(WKe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(xWe)){const i=n.getColor(xWe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),pS(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});var zwt=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";Ct(zwt,{});class $wt extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let c=0,l=t.length;c{if(c.options.zIndexl.options.zIndex)return 1;const d=c.options.className,h=l.options.className;return dh?1:O.compareRangesUsingStarts(c.range,l.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let c=o;c<=r;c++){const l=c-o;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(c.range.startLineNumber,s),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-s;i[f]+=l}}}_renderNormalDecorations(e,t,i){const s=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=w}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Gwt extends Cp{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(x.scrollbar),a=o.get(x.mouseWheelScrollSensitivity),c=o.get(x.fastScrollSensitivity),l=o.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+gwe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new hQ(t.domNode,d,this._context.viewLayout.getScrollable())),Xb.write(this.scrollbar.getDomNode(),Da.ScrollableElement),this.scrollbarDomNode=ks(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(u,f,p)=>{const m={};{const v=u.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,u.scrollTop=0)}if(p){const v=u.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,u.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,vt.Immediate)};this._register(pe(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(pe(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(pe(s.domNode,"scroll",u=>h(s.domNode,!0,!1))),this._register(pe(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(x.layoutInfo);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(x.minimap).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(x.scrollbar)||e.hasChanged(x.mouseWheelScrollSensitivity)||e.hasChanged(x.fastScrollSensitivity)){const t=this._context.configuration.options,i=t.get(x.scrollbar),s=t.get(x.mouseWheelScrollSensitivity),o=t.get(x.fastScrollSensitivity),r=t.get(x.scrollPredominantAxis),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+gwe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var qwt=".monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{align-items:center;display:flex;justify-content:center;position:absolute}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}";Ct(qwt,{});class mwe{constructor(e,t,i,s,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=s,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Qwt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class jwt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class ZKe extends fO{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const c=a-e;s[c]=new jwt}if(i.length===0)return s;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNames)continue;const l=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(o.preference.lane);t.push(new Jwt(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.laneIndex===s.laneIndex?i.zIndex===s.zIndex?s.type===i.type?i.type===fM.Decoration&&s.type===fM.Decoration?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.laneIndex===s.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===fM.Decoration){const a=[];for(const c of o){if(c.zIndex!==r.zIndex||c.type!==r.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var fM;(function(n){n[n.Decoration=0]="Decoration",n[n.Widget=1]="Widget"})(fM||(fM={}));class Ywt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=s,this.type=fM.Decoration}accept(e){return new Xwt(this.lineNumber,this.laneIndex,e)}}class Jwt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=s,this.type=fM.Widget}}class Xwt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var Zwt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";Ct(Zwt,{});class eYe extends ${constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function dde(n,e){let t=0,i=0;const s=n.length;for(;is)throw new cn("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,c=-1,l=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,c=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){a=F,c=N;break}}}if(l===-2){l=-1,d=-1;for(let F=k;F=0){l=F,d=N;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){u=F,f=N;break}}}if(p!==-1&&(p===-2||p=0){p=F,m=N;break}}}};let w=0,b=!0,C=0,y=!0,S=0,M=0;for(let k=0;b||y;k++){const F=e-k,N=e+k;k>1&&(F<1||F1&&(N>s||N>i)&&(y=!1),k>5e4&&(b=!1,y=!1);let z=-1;if(b&&F>=1){const J=this._computeIndentLevel(F-1);J>=0?(l=F-1,d=J,z=Math.ceil(J/this.textModel.getOptions().indentSize)):(h(F),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let U=-1;if(y&&N<=s){const J=this._computeIndentLevel(N-1);J>=0?(u=N-1,f=J,U=Math.ceil(J/this.textModel.getOptions().indentSize)):(v(N),U=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){M=z;continue}if(k===1){if(N<=s&&U>=0&&M+1===U){b=!1,w=N,C=N,S=U;continue}if(F>=1&&z>=0&&z-1===M){y=!1,w=F,C=F,S=z;continue}if(w=e,C=e,S=M,S===0)return{startLineNumber:w,endLineNumber:C,indent:S}}b&&(z>=S?w=F:b=!1),y&&(U>=S?C=N:y=!1)}return{startLineNumber:w,endLineNumber:C,indent:S}}getLinesBracketGuides(e,t,i,s){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new O(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(O.fromPositions(i)).toArray()).filter(u=>O.strictContainsPosition(u.range,i));c=t1(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new tYe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!s.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(s.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===pM.Enabled||s.horizontalGuides===pM.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new gR(-1,h.openingBracketRange.getEndPosition().column,f,new C$(!1,m.column),-1,-1));continue}const w=this.getVisibleColumnFromPosition(m),b=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(b,w,h.minVisibleColumnIndentation+1);let y=!1;Eu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&b>C&&o[p.lineNumber-e].push(new gR(C,-1,f,new C$(!1,p.column),-1,-1)),m.lineNumber<=t&&w>C&&o[m.lineNumber-e].push(new gR(C,-1,f,new C$(!y,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return kc.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let c=-2,l=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const f=u-e,p=this._computeIndentLevel(u-1);if(p>=0){c=u-1,l=p,a[f]=Math.ceil(p/s.indentSize);continue}if(c===-2){c=-1,l=-1;for(let m=u-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){c=m,l=v;break}}}if(d!==-1&&(d===-2||d=0){d=m,h=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,l,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:ts||this._maxIndentLeft>0&&p>this._maxIndentLeft)break;const m=f.horizontalLine?f.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",v=f.horizontalLine?(e.visibleRangeForPosition(new oe(c,f.horizontalLine.endColumn))?.left??p+this._spaceWidth)-p:this._spaceWidth;h+=`
    `}a[l]=h}this._renderResult=a}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?pM.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?pM.EnabledForActive:pM.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,c=h.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const f=s?s[h-e]:[],p=new DS(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const w=(v-1)*l+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(y=>y.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function UO(n){if(!(n&&n.isTransparent()))return n}Im((n,e)=>{const t=[{bracketColor:zKe,guideColor:pwt,guideColorActive:Cwt},{bracketColor:$Ke,guideColor:mwt,guideColorActive:ywt},{bracketColor:GKe,guideColor:_wt,guideColorActive:Swt},{bracketColor:qKe,guideColor:vwt,guideColorActive:Awt},{bracketColor:QKe,guideColor:wwt,guideColorActive:Ewt},{bracketColor:jKe,guideColor:bwt,guideColorActive:xwt}],i=new tYe,s=[{indentColor:uQ,indentColorActive:gQ},{indentColor:Jvt,indentColorActive:iwt},{indentColor:Xvt,indentColorActive:nwt},{indentColor:Zvt,indentColorActive:swt},{indentColor:ewt,indentColorActive:owt},{indentColor:twt,indentColorActive:rwt}],o=t.map(a=>{const c=n.getColor(a.bracketColor),l=n.getColor(a.guideColor),d=n.getColor(a.guideColorActive),h=UO(UO(l)??c?.transparent(.3)),u=UO(UO(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(yl),r=s.map(a=>{const c=n.getColor(a.indentColor),l=n.getColor(a.indentColorActive),d=UO(c),h=UO(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(yl);if(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${c.indentColor}; --indent-color-active: ${c.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});var ibt=".mtkcontrol{background:#960000!important;color:#fff!important}.mtkoverflow{background-color:var(--vscode-button-background,var(--vscode-editor-background));border-color:var(--vscode-contrastBorder);border-radius:2px;border-style:solid;border-width:1px;color:var(--vscode-button-foreground,var(--vscode-editor-foreground));cursor:pointer;padding:4px}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:auto;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{bottom:0;position:absolute;top:0}.monaco-editor .mtkw,.monaco-editor .mtkz{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block}";Ct(ibt,{});class sfe{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class nbt{constructor(){this._currentVisibleRange=new O(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class sbt{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class obt{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new yn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new nbt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(x.stickyScroll).enabled,this._maxNumberStickyLines=s.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new rE(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(x.wrappingInfo)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(x.fontInfo),s=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(x.revealHorizontalRightPadding),this._cursorSurroundingLines=t.get(x.cursorSurroundingLines),this._cursorSurroundingLinesStyle=t.get(x.cursorSurroundingLinesStyle),this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._stickyScrollEnabled=t.get(x.stickyScroll).enabled,this._maxNumberStickyLines=t.get(x.stickyScroll).maxLineCount,Sd(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new wWe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new sbt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new obt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?vt.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new oe(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new sfe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=O.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new sfe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(s.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=s.startLineNumber;h<=s.endLineNumber;h++){if(hd)continue;const u=h===s.startLineNumber?s.startColumn:1,f=h!==s.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):s.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const s=new sfe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new nvt(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),jr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let w=o[0].startLineNumber,b=o[0].endLineNumber;for(let C=1,y=o.length;Cc){if(!d)return-1;v=h}else if(r===Ns.NearTop||r===Ns.NearTopIfOutsideViewport)if(r===Ns.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=Math.max(5*this._lineHeight,c*.2),b=h-w,C=u-c;v=Math.max(C,b)}else if(r===Ns.Center||r===Ns.CenterIfOutsideViewport)if(r===Ns.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=(h+u)/2;v=Math.max(0,w-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===Ns.Top,r===Ns.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=Zn.MAX_SAFE_SMALL_INTEGER,a=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const d of l.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const d=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(r=Math.max(0,r-pae.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}};pae.HORIZONTAL_EXTRA_PX=30;let _we=pae;var rbt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";Ct(rbt,{});class abt extends ZKe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(x.layoutInfo);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=s[d].getDecorations();let u="";for(const f of h){let p='
    ';o[a]=l}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var dbt=".monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{left:-6px;position:absolute;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{left:-1px;position:absolute;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}";Ct(dbt,{});const hk=class hk{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=hk._clamp(e),this.g=hk._clamp(t),this.b=hk._clamp(i),this.a=hk._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};hk.Empty=new hk(0,0,0,0);let dx=hk;var Bn;(function(n){n[n.START_CH_CODE=32]="START_CH_CODE",n[n.END_CH_CODE=126]="END_CH_CODE",n[n.UNKNOWN_CODE=65533]="UNKNOWN_CODE",n[n.CHAR_COUNT=96]="CHAR_COUNT",n[n.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",n[n.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",n[n.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",n[n.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",n[n.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",n[n.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Bn||(Bn={}));const hbt=(()=>{const n=[];for(let e=Bn.START_CH_CODE;e<=Bn.END_CH_CODE;e++)n.push(e);return n.push(Bn.UNKNOWN_CODE),n})(),ubt=(n,e)=>(n-=Bn.START_CH_CODE,n<0||n>Bn.CHAR_COUNT?e<=2?(n+Bn.CHAR_COUNT)%Bn.CHAR_COUNT:Bn.CHAR_COUNT-1:n),mae=class mae extends ${static getInstance(){return this._INSTANCE||(this._INSTANCE=xU(new mae)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(lc.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=lc.getColorMap();if(!e){this._colors=[dx.Empty],this._backgroundIsLight=!0;return}this._colors=[dx.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Ad.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};mae._INSTANCE=null;let HZ=mae;class e7{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=e7.soften(e,12/15),this.charDataLight=e7.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=ubt(s,l),w=e.width*Bn.RGBA_CHANNELS_CNT,b=a.r,C=a.g,y=a.b,S=o.r-b,M=o.g-C,k=o.b-y,F=Math.max(r,c),N=e.data;let z=v*u*f,U=i*w+t*Bn.RGBA_CHANNELS_CNT;for(let J=0;Je.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*Bn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,w=s.r-p,b=s.g-m,C=s.b-v,y=p+w*f,S=m+b*f,M=v+C*f,k=Math.max(o,a),F=e.data;let N=i*u+t*Bn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=kWe[n[t]]<<4|kWe[n[t+1]]&15;return e},LWe={1:cw(()=>IWe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:cw(()=>IWe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class y${static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return LWe[e]?i=new e7(LWe[e](),e):i=y$.createFromSampleData(y$.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height=`${Bn.SAMPLED_CHAR_HEIGHT}px`,t.height=Bn.SAMPLED_CHAR_HEIGHT,t.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,t.style.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Bn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let s=0;for(const o of hbt)i.fillText(String.fromCharCode(o),s,Bn.SAMPLED_CHAR_HEIGHT/2),s+=Bn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,Bn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Bn.SAMPLED_CHAR_HEIGHT*Bn.SAMPLED_CHAR_WIDTH*Bn.RGBA_CHANNELS_CNT*Bn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const s=y$._downsample(e,t);return new e7(s,t)}static _downsampleChar(e,t,i,s,o){const r=Bn.BASE_CHAR_WIDTH*o,a=Bn.BASE_CHAR_HEIGHT*o;let c=s,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dy$.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Ad.DefaultBackground),this.backgroundColor=RW._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=RW._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(zmt);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor($mt);return t?dx._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Mc);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class S${constructor(e,t,i,s,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=c,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,c,l,d,h){const u=e.pixelRatio,f=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let M=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(M+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/M)),F=Math.max(0,e.minimapHeight-k),N=F/(d-o),z=l*N,U=F>0,J=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new S$(l,d,U,N,z,k,j,1,Math.min(a,J))}let v;if(r&&i!==a){const M=i-t+1;v=Math.floor(M*f/u)}else{const M=o/m;v=Math.floor(M*f/u)}const w=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const M=o/m;b=Math.max(b,M-1)}let C;if(b>0){const M=o/m;C=(w+a+b-M-1)*f/u}else C=Math.max(0,(w+a)*f/u-v);C=Math.min(e.minimapHeight-v,C);const y=C/(d-o),S=l*y;if(p>=w+a+b){const M=C>0;return new S$(l,d,M,y,S,v,w,1,a)}else{let M;t>1?M=t+w:M=Math.max(1,l/m);let k,F=Math.max(1,Math.floor(M-S*u/f));Fl&&(F=Math.min(F,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?U=(t-F+k+z)*f/u:U=l/e.paddingTop*(k+z)*f/u,new S$(l,d,!0,y,U,v,k,F,N)}}}const _ae=class _ae{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};_ae.INVALID=new _ae(-1);let UZ=_ae;class TWe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new KKe(()=>UZ.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let w=0,b=s-1;w0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=t7.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o!s.options.minimap?.sectionHeaderStyle);if(this._samplingState){const s=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),c=this._samplingState.modelLineToMinimapLine(r.endLineNumber);s.push(new cKe(new O(a,r.startColumn,c,r.endColumn),o.options))}return s}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>!!r.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new O(s,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new O(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const s=this._sectionHeaderCache.get(i);if(s)return s;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new O(e,1,e,1),Ns.Center,vt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},vt.Immediate)}}class e2 extends ${constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(fWe),this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ks(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ks(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ks(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ks(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ks(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Xo(this._domNode.domNode,xe.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===Mb.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=ia(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new vz,this._sliderPointerDownListener=Xo(this._slider.domNode,xe.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=dh.addTarget(this._domNode.domNode),this._sliderTouchStartListener=pe(this._domNode.domNode,Eo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=pe(this._domNode.domNode,Eo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Xo(this._domNode.domNode,Eo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=ia(this._domNode.domNode),l=Math.min(Math.abs(a-s),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Is&&l>gbt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new zMe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(fWe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===Mb.None){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=S$.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(O.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,s,o);const d=new RWe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new RWe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,s),this._renderDecorationsHighlights(l,i,h,e,r,c,a,s),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const c of t){const l=s.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=s.getYForLineNumber(d,o),f=s.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(AC,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(AC,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==xu.Inline)continue;const d=s.intersectWithViewport(c.range);if(!d)continue;const[h,u]=d,f=l.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=r.get(f.toString());p||(p=f.transparent(.5).toString(),r.set(f.toString(),p)),e.fillStyle=p;for(let m=h;m<=u;m++){if(i.has(m))continue;i.set(m,!0);const v=s.getYForLineNumber(h,o);e.fillRect(AC,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=s.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,s,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=s.intersectWithViewport(l.range);if(!h)continue;const[u,f]=h,p=d.getColor(this._theme.value);if(!(!p||p.isTransparent()))for(let m=u;m<=f;m++)switch(d.position){case xu.Inline:this.renderDecorationOnLine(e,i,l.range,p,s,m,o,o,r,a,c);continue;case xu.Gutter:{const v=s.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,fbt,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,c,l,d,h){const u=o.getYForLineNumber(r,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===r?i.startColumn:1,v=p===r?i.endColumn:this._model.getLineMaxColumn(r),w=this.getXOffsetForPosition(t,r,m,l,d,h),b=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,s,w,u,b-w,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return AC;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[AC];let d=AC;for(let h=1;h=r){c[h]=r;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=e2._fitSectionHeader.bind(null,u,r-AC);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,w=v-i,b=w+2,C=this._model.getSectionHeaderText(m,p);e2._renderSectionLabel(u,C,m.options.minimap?.sectionHeaderStyle===V9.Underlined,c,d,r,w,o,v,b)}}static _fitSectionHeader(e,t,i){if(!i)return i;const s="…",o=e.measureText(i).width,r=e.measureText(s).width;if(o<=t||o<=r)return i;const a=i.length,c=o/i.length,l=Math.floor((t-r)/c)-1;let d=Math.ceil(l/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+s+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,s,o,r,a,c,l,d){t&&(e.fillStyle=s,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,AC,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const me=this._lastRenderData._get();return new TWe(e,me.imageData,me.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=e2._renderUntouchedLines(o,e.topPaddingLineCount,t,i,s,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,c),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),v=this._model.options.renderMinimap,w=this._model.options.charRenderer(),b=this._model.options.fontScale,C=this._model.options.minimapCharWidth,S=(v===Mb.Text?Bn.BASE_CHAR_HEIGHT:Bn.BASE_CHAR_HEIGHT+1)*b,M=s>S?Math.floor((s-S)/2):0,k=u.a/255,F=new dx(Math.round((u.r-h.r)*k+h.r),Math.round((u.g-h.g)*k+h.g),Math.round((u.b-h.b)*k+h.b),255);let N=e.topPaddingLineCount*s;const z=[];for(let me=0,De=i-t+1;me=0&&Ub)return;const J=v.charCodeAt(S);if(J===q.Tab){const j=u-(S+M)%u;M+=j-1,y+=j*r}else if(J===q.Space)y+=r;else{const j=c1(J)?2:1;for(let re=0;reb)return}}}}}class RWe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var mbt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";Ct(mbt,{});class _bt extends Cp{constructor(e,t){super(e),this._viewDomNode=t;const s=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=s.verticalScrollbarWidth,this._minimapWidth=s.minimap.minimapWidth,this._horizontalScrollbarHeight=s.horizontalScrollbarHeight,this._editorHeight=s.height,this._editorWidth=s.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ks(document.createElement("div")),Xb.write(this.overflowingOverlayWidgetsDomNode,Da.OverflowingOverlayWidgets),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=ks(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],s=t?t.preference:null,o=t?.stackOridinal;return i.preference===s&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=s,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,s=t.length;i0);t.sort((s,o)=>(this._widgets[s].stack||0)-(this._widgets[o].stack||0));for(let s=0,o=t.length;s=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,c=e,l=c+o,d=c+o+a;return[[0,c,l,c,d,c,l,c],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,c=a+o;return[[0,a,a,a,c,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&fe.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}var vwe;(function(n){n[n.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(vwe||(vwe={}));var VZ;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(VZ||(VZ={}));var Zw;(function(n){n[n.NotNeeded=0]="NotNeeded",n[n.Maybe=1]="Maybe",n[n.Needed=2]="Needed"})(Zw||(Zw={}));class wbt extends Cp{constructor(e){super(e),this._actualShouldRender=Zw.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=lc.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new oe(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new vbt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=Zw.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Zw.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(s=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:s})}return this._cursorPositions.sort((t,i)=>oe.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=Zw.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?fe.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(q9.compareByRenderingProps),this._actualShouldRender===Zw.Maybe&&!q9.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe&&!Ls(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=s/a,l=vwe.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):(h.clearRect(0,0,i,s),h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):h.clearRect(0,0,i,s);const u=this._settings.x,f=this._settings.w;for(const p of t){const m=p.color,v=p.data;h.fillStyle=m;let w=0,b=0,C=0;for(let y=0,S=v.length/3;ys&&(J=s-d),N=J-d,z=J+d}N>C+1||M!==w?(y!==0&&h.fillRect(u[w],b,f[w],C-b),w=M,b=N,C=z):z>C&&(C=z)}h.fillRect(u[w],b,f[w],C-b)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[VZ.Full],w=this._settings.w[VZ.Full];let b=-100,C=-100,y=null;for(let S=0,M=this._cursorPositions.length;Ss&&(N=s-m);const z=N-m,U=z+p;z>C+1||k!==y?(S!==0&&y&&h.fillRect(v,b,w,C-b),b=z,C=U):U>C&&(C=U),y=k,h.fillStyle=k}y&&h.fillRect(v,b,w,C-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,s),h.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}var wwe;(function(n){n[n.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(wwe||(wwe={}));class MWe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class nYe{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-v);const w=d.color;let b=this._color2Id[w];b||(b=++this._lastAssignedId,this._color2Id[w]=b,this._id2Color[b]=w);const C=new MWe(m-v,m+v,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(MWe.compare),a}}class Cbt extends dQ{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new bbt(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(x.lineHeight)),this._zoneManager.setPixelRatio(i.get(x.pixelRatio)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(x.lineHeight)&&(this._zoneManager.setLineHeight(t.get(x.lineHeight)),this._render()),e.hasChanged(x.pixelRatio)&&(this._zoneManager.setPixelRatio(t.get(x.pixelRatio)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==o?(e.fillRect(0,r,s,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,s,a-r),r=d,a=h)}e.fillRect(0,r,s,a-r)}}var ybt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";Ct(ybt,{});class Sbt extends Cp{constructor(e){super(e),this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=ks(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(x.layoutInfo);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.scrollbar);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var xbt=".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}";Ct(xbt,{});var Sc;(function(n){n[n.EXTERN=0]="EXTERN",n[n.INTERN=1]="INTERN",n[n.FLAT=2]="FLAT"})(Sc||(Sc={}));class Dbt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class kbt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Ibt(n){return new Dbt(n)}function Lbt(n){return new kbt(n.lineNumber,n.ranges.map(Ibt))}const Pa=class Pa extends fO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!o&&l=0;l--)i[l].lineNumber===c&&(r=i[l].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,c=t.length;a0){const p=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Bj(d-p)p&&(u.top=Sc.INTERN),Bj(h-m)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=s[0].lineNumber,a=s[s.length-1].lineNumber;for(let c=0,l=s.length;c1,l)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};Pa.SELECTION_CLASS_NAME="selected-text",Pa.SELECTION_TOP_LEFT="top-left-radius",Pa.SELECTION_BOTTOM_LEFT="bottom-left-radius",Pa.SELECTION_TOP_RIGHT="top-right-radius",Pa.SELECTION_BOTTOM_RIGHT="bottom-right-radius",Pa.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",Pa.ROUNDED_PIECE_WIDTH=10;let bwe=Pa;Im((n,e)=>{const t=n.getColor(Amt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Bj(n){return n<0?-n:n}var Tbt=".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{box-sizing:border-box;overflow:hidden;position:absolute}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:2px}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:1px}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}";Ct(Tbt,{});class NWe{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}var DE;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(DE||(DE={}));class PWe{constructor(e,t){this._context=e;const i=this._context.configuration.options,s=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(`cursor ${lx}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Sd(this._domNode,s),this._domNode.setDisplay("none"),this._position=new oe(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case DE.Single:this._pluralityClass="";break;case DE.MultiPrimary:this._pluralityClass="cursor-primary";break;case DE.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.fontInfo);return this._cursorStyle=t.get(x.cursorStyle),this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),Sd(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=bQe(i,t-1);return[new oe(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fa.Line||this._cursorStyle===fa.LineThin){const u=e.visibleRangeForPosition(s);if(!u||u.outsideRenderedLine)return null;const f=gt(this._domNode.domNode);let p;this._cursorStyle===fa.Line?(p=v2e(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(s))):p=v2e(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const w=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new NWe(w,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new O(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=o===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===fa.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===fa.Underline||this._cursorStyle===fa.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new NWe(d,c.left,0,l,h,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${lx} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}const q8=class q8 extends Cp{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new PWe(this._context,DE.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ks(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new O_,this._cursorFlatBlinkInterval=new sQ,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},q8.BLINK_INTERVAL,gt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},q8.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fa.Line:e+=" cursor-line-style";break;case fa.Block:e+=" cursor-block-style";break;case fa.Underline:e+=" cursor-underline-style";break;case fa.LineThin:e+=" cursor-line-thin-style";break;case fa.BlockOutline:e+=" cursor-block-outline-style";break;case fa.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case xh.Blink:e+=" cursor-blink";break;case xh.Smooth:e+=" cursor-smooth";break;case xh.Phase:e+=" cursor-phase";break;case xh.Expand:e+=" cursor-expand";break;case xh.Solid:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:tS,background:EE},{class:".cursor-primary",foreground:HKe,background:jvt},{class:".cursor-secondary",foreground:UKe,background:Kvt}];for(const i of t){const s=n.getColor(i.foreground);if(s){let o=n.getColor(i.background);o||(o=s.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${s}; border-color: ${s}; color: ${o}; }`),pS(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const ofe=()=>{throw new Error("Invalid change accessor")};class Rbt extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._lineHeight=t.get(x.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ks(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ks(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Mbt(e,s),s.addZone=ofe,s.removeZone=ofe,s.layoutZone=ofe}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ks(t.domNode),marginDomNode:t.marginDomNode?ks(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){bt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){bt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=u.startLineNumber===a?u.startColumn:l.minColumn,p=u.endLineNumber===a?u.endColumn:l.maxColumn;f=z.endOffset&&(N++,z=i&&i[N]),j!==q.Tab&&j!==q.Space||u&&!M&&J<=F)continue;if(h&&J>=k&&J<=F&&j===q.Space){const me=J-1>=0?a.charCodeAt(J-1):q.Null,De=J+1=0?a.charCodeAt(J-1):q.Null;if(j===q.Space&&me!==q.Space&&me!==q.Tab)continue}if(i&&(!z||z.startOffset>J||z.endOffset<=J))continue;const re=e.visibleRangeForPosition(new oe(t,J+1));re&&(r?(U=Math.max(U,re.left),j===q.Tab?S+=this._renderArrow(f,v,re.left):S+=``):j===q.Tab?S+=`
    ${y?"→":"→"}
    `:S+=`
    ${String.fromCharCode(C)}
    `)}return r?(U=Math.round(U+v),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,c={x:0,y:s/2},l={x:100/125*o,y:c.y},d={x:l.x-.2*l.x,y:l.y+.2*l.x},h={x:d.x+.1*l.x,y:d.y+.1*l.x},u={x:h.x+.35*l.x,y:h.y-.35*l.x},f={x:u.x,y:-u.y},p={x:h.x,y:-h.y},m={x:d.x,y:-d.y},v={x:l.x,y:-l.y},w={x:c.x,y:-c.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class FWe{constructor(e){const t=e.options,i=t.get(x.fontInfo),s=t.get(x.experimentalWhitespaceRendering);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!0):(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(x.lineHeight),this.stopRenderingLineAfter=t.get(x.stopRenderingLineAfter)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class Fbt{constructor(e,t,i,s){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=s,this.visibleRange=new O(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class Obt{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class Bbt{constructor(e,t,i){this.configuration=e,this.theme=new Obt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let ywe=class extends dQ{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new mt(1,1,1,1)],this._renderAnimationFrame=null;const c=new Rwt(t,s,o,e);this._context=new Bbt(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(fwe,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ks(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ks(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ks(document.createElement("div")),Xb.write(this._overflowGuardContainer,Da.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Gwt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new _we(this._context,this._linesContent),this._viewZones=new Rbt(this._context),this._viewParts.push(this._viewZones);const l=new wbt(this._context);this._viewParts.push(l);const d=new Ebt(this._context);this._viewParts.push(d);const h=new Nwt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Uwt(this._context)),h.addDynamicOverlay(new bwe(this._context)),h.addDynamicOverlay(new tbt(this._context)),h.addDynamicOverlay(new $wt(this._context)),h.addDynamicOverlay(new Pbt(this._context));const u=new Pwt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Vwt(this._context)),u.addDynamicOverlay(new lbt(this._context)),u.addDynamicOverlay(new abt(this._context)),u.addDynamicOverlay(new BZ(this._context)),this._glyphMarginWidgets=new Kwt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new WZ(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(u.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Bwt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Cwe(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _bt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new Sbt(this._context);this._viewParts.push(p);const m=new Owt(this._context);this._viewParts.push(m);const v=new pbt(this._context);if(this._viewParts.push(v),l){const w=this._scrollbar.getOverviewRulerLayoutInfo();w.parent.insertBefore(l.getDomNode(),w.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new $vt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],s=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??FS.Center;return s=Math.max(s,o.range.endLineNumber),{range:o.range,lane:r,persist:o.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return s=Math.max(s,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>O.compareRangesUsingStarts(o.range,r.range)),t.reset(s);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new cvt(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new oe(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(x.layoutInfo);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(x.editorClassName)+" "+gwe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new cn;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Swe.INSTANCE.scheduleCoordinatedRendering({window:gt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new cn;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new cn;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Gk(()=>e.prepareRenderText());const t=Gk(()=>e.renderText());if(t){const[i,s]=t;Gk(()=>e.prepareRender(i,s)),Gk(()=>e.render(i,s))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Hk.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Fbt(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new tvt(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},vt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?lde.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Cbt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}refreshFocusState(){this._textAreaHandler.refreshFocusState()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};ywe=D([_(6,be)],ywe);function Gk(n){try{return n()}catch(e){return bt(e),null}}const vae=class vae{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,s]of this._animationFrameRunners)s.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,wZ(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Gk(()=>i.prepareRenderText());const t=[];for(let i=0,s=e.length;io.renderText())}for(let i=0,s=e.length;io.prepareRender(a,c))}for(let i=0,s=e.length;io.render(a,c))}}};vae.INSTANCE=new vae;let Swe=vae;class A${constructor(e,t,i,s,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=s,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===jo.Left)if(e<=r)s=o-1;else if(e>c)i=o+1;else break;else if(e=c)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Wj(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===jo.Left){if(e>0&&t===this.getMinOutputOffset(e))return new Wj(e-1,this.getMaxOutputOffset(e-1))}else if(i===jo.Right){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===jo.None){if(e===i.offsetInInputWithInjections+i.length&&OWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(BWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(OWe(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,BWe(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===jo.Right||t===jo.RightOfInjectedText){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}oQ()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function OWe(n){return n==null?!0:n===Bv.Right||n===Bv.Both}function BWe(n){return n==null?!0:n===Bv.Left||n===Bv.Both}class Wj{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new oe(e+this.outputLineIndex,this.outputOffset+1)}}var Yp;(function(n){n[n.Flush=1]="Flush",n[n.LineChanged=2]="LineChanged",n[n.LinesDeleted=3]="LinesDeleted",n[n.LinesInserted=4]="LinesInserted",n[n.EOLChanged=5]="EOLChanged"})(Yp||(Yp={}));class Wbt{constructor(){this.changeType=Yp.Flush}}class iw{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new iw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new iw(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}withText(e){return new iw(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class WWe{constructor(e,t,i){this.changeType=Yp.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Hbt{constructor(e,t){this.changeType=Yp.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Ubt{constructor(e,t,i,s){this.changeType=Yp.LinesInserted,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Vbt{constructor(){this.changeType=Yp.EOLChanged}}class MW{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;tn});class $Me{static create(e){return new $Me(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>$bt(ws(this.targetWindow.deref()),r,e,t,i,s,o,a)}}}function $bt(n,e,t,i,s,o,r,a){function c(N){const z=a[N];if(z){const U=iw.applyInjectedText(e[N],z),J=z.map(re=>re.options),j=z.map(re=>re.column-1);return new A$(j,J,[U.length],[],0)}else return null}if(s===-1){const N=[];for(let z=0,U=e.length;zl?(U=0,J=0):j=l-De}const re=z.substr(U),me=Gbt(re,J,i,j,p,u);m[N]=U,v[N]=J,w[N]=re,b[N]=me[0],C[N]=me[1]}const y=p.build(),S=zbt?.createHTML(y)??y;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),n.document.body.appendChild(f);const M=document.createRange(),k=Array.prototype.slice.call(f.children,0),F=[];for(let N=0;NOe.options),Qe=Tt.map(Oe=>Oe.column-1)):(De=null,Qe=null),F[N]=new A$(Qe,De,U,me,j)}return n.document.body.removeChild(f),F}var fR;(function(n){n[n.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(fR||(fR={}));function Gbt(n,e,t,i,s,o){if(o!==0){const u=String(o);s.appendString('
    ');const r=n.length;let a=e,c=0;const l=[],d=[];let h=0");for(let u=0;u"),l[u]=c,d[u]=a;const f=h;h=u+1"),l[n.length]=c,d[n.length]=a,s.appendString("
    "),[l,d]}function qbt(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{Awe(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function Awe(n,e,t,i,s,o,r,a){if(i===o||(s=s||rfe(n,e,t[i],t[i+1]),r=r||rfe(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=rfe(n,e,t[c],t[c+1]);Awe(n,e,t,i,s,c,l,a),Awe(n,e,t,c,l,o,r,a)}function rfe(n,e,t,i){return n.setStart(e[t/fR.SPAN_MODULO_LIMIT|0].firstChild,t%fR.SPAN_MODULO_LIMIT),n.setEnd(e[i/fR.SPAN_MODULO_LIMIT|0].firstChild,i%fR.SPAN_MODULO_LIMIT),n.getClientRects()}class Qbt extends ${constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Zo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[mi.Eager]=!1,this._finishedInstantiation[mi.AfterFirstRender]=!1,this._finishedInstantiation[mi.BeforeFirstInteraction]=!1,this._finishedInstantiation[mi.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){bt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(mi.Eager),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.BeforeFirstInteraction)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.Eventually)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}set(e,t){this._instances.set(e,t)}onBeforeInteractionEvent(){this._instantiateSome(mi.BeforeFirstInteraction)}onAfterModelAttached(){return UB(gt(this._editor?.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==mi.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){bt(i)}}}}class oYe{constructor(e,t,i,s,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=s,this._precondition=o,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var qu;(function(n){n.EditorHintDecoration="squiggly-hint",n.EditorInfoDecoration="squiggly-info",n.EditorWarningDecoration="squiggly-warning",n.EditorErrorDecoration="squiggly-error",n.EditorUnnecessaryDecoration="squiggly-unnecessary",n.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",n.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(qu||(qu={}));var ps;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ps||(ps={}));var Do;(function(n){n[n.ColorMask=1]="ColorMask",n[n.ColorMaskInverse=254]="ColorMaskInverse",n[n.ColorOffset=0]="ColorOffset",n[n.IsVisitedMask=2]="IsVisitedMask",n[n.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",n[n.IsVisitedOffset=1]="IsVisitedOffset",n[n.IsForValidationMask=4]="IsForValidationMask",n[n.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",n[n.IsForValidationOffset=2]="IsForValidationOffset",n[n.StickinessMask=24]="StickinessMask",n[n.StickinessMaskInverse=231]="StickinessMaskInverse",n[n.StickinessOffset=3]="StickinessOffset",n[n.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",n[n.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",n[n.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",n[n.IsMarginMask=64]="IsMarginMask",n[n.IsMarginMaskInverse=191]="IsMarginMaskInverse",n[n.IsMarginOffset=6]="IsMarginOffset",n[n.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",n[n.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(Do||(Do={}));function Tg(n){return(n.metadata&Do.ColorMask)>>>Do.ColorOffset}function vr(n,e){n.metadata=n.metadata&Do.ColorMaskInverse|e<>>Do.IsVisitedOffset===1}function dr(n,e){n.metadata=n.metadata&Do.IsVisitedMaskInverse|(e?1:0)<>>Do.IsForValidationOffset===1}function HWe(n,e){n.metadata=n.metadata&Do.IsForValidationMaskInverse|(e?1:0)<>>Do.IsMarginOffset===1}function UWe(n,e){n.metadata=n.metadata&Do.IsMarginMaskInverse|(e?1:0)<>>Do.StickinessOffset}function VWe(n,e){n.metadata=n.metadata&Do.StickinessMaskInverse|e<>>Do.CollapseOnReplaceEditOffset===1}function zWe(n,e){n.metadata=n.metadata&Do.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===fb.ForceMove?!1:i===fb.ForceStay?!0:e}function Jbt(n,e,t,i,s){const o=jbt(n),r=o===gi.AlwaysGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,a=o===gi.NeverGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=n.start;let u=!1;const f=n.end;let p=!1;e<=h&&f<=t&&Kbt(n)&&(n.start=e,u=!0,n.end=e,p=!0);{const v=s?fb.ForceMove:c>0?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e,v)&&(u=!0),!p&&VO(f,a,e,v)&&(p=!0)}if(d>0&&!s){const v=c>l?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e+d,v)&&(u=!0),!p&&VO(f,a,e+d,v)&&(p=!0)}{const v=s?fb.ForceMove:fb.MarkerDefined;!u&&VO(h,r,t,v)&&(n.start=e+l,u=!0),!p&&VO(f,a,t,v)&&(n.end=e+l,p=!0)}const m=l-c;u||(n.start=Math.max(0,h+m)),p||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function Xbt(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==fn;){if(rh(i)){dr(i.left,!1),dr(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!rh(i.left)){if(o=s+i.maxEnd,ot){dr(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),dr(i,!0),i.right!==fn&&!rh(i.right)){s+=i.delta,i=i.right;continue}}return dr(n.root,!1),c}function Zbt(n,e,t,i){let s=n.root,o=0,r=0,a=0;const c=i-(t-e);for(;s!==fn;){if(rh(s)){dr(s.left,!1),dr(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),p1(s),s=s.parent;continue}if(!rh(s.left)){if(r=o+s.maxEnd,rt){s.start+=c,s.end+=c,s.delta+=c,(s.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),dr(s,!0);continue}if(dr(s,!0),s.right!==fn&&!rh(s.right)){o+=s.delta,s=s.right;continue}}dr(n.root,!1)}function eCt(n,e){let t=n.root;const i=[];let s=0;for(;t!==fn;){if(rh(t)){dr(t.left,!1),dr(t.right,!1),t=t.parent;continue}if(t.left!==fn&&!rh(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),dr(t,!0),t.right!==fn&&!rh(t.right)){t=t.right;continue}}return dr(n.root,!1),i}function tCt(n){let e=n.root;const t=[];let i=0;for(;e!==fn;){if(rh(e)){dr(e.left,!1),dr(e.right,!1),e=e.parent;continue}if(e.left!==fn&&!rh(e.left)){e=e.left;continue}if(e.right!==fn&&!rh(e.right)){e=e.right;continue}t[i++]=e,dr(e,!0)}return dr(n.root,!1),t}function $We(n,e,t,i,s){let o=n.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==fn;){if(rh(o)){dr(o.left,!1),dr(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==fn&&!rh(o.left)){o=o.left;continue}a=r+o.start,c=r+o.end,o.setCachedOffsets(a,c,i);let h=!0;if(e&&o.ownerId&&o.ownerId!==e&&(h=!1),t&&rYe(o)&&(h=!1),s&&!aYe(o)&&(h=!1),h&&(l[d++]=o),dr(o,!0),o.right!==fn&&!rh(o.right)){r+=o.delta,o=o.right;continue}}return dr(n.root,!1),l}function iCt(n,e,t,i,s,o,r){let a=n.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==fn;){if(rh(a)){dr(a.left,!1),dr(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!rh(a.left)){if(l=c+a.maxEnd,lt){dr(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,o);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),s&&rYe(a)&&(p=!1),r&&!aYe(a)&&(p=!1),p&&(u[f++]=a)}if(dr(a,!0),a.right!==fn&&!rh(a.right)){c+=a.delta,a=a.right;continue}}return dr(n.root,!1),u}function GWe(n,e){if(n.root===fn)return e.parent=fn,e.left=fn,e.right=fn,vr(e,ps.Black),n.root=e,n.root;nCt(n,e),ID(e.parent);let t=e;for(;t!==n.root&&Tg(t.parent)===ps.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,E$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),x$(n,t.parent.parent))}else{const i=t.parent.parent.left;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,x$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),E$(n,t.parent.parent))}return vr(n.root,ps.Black),e}function nCt(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(oCt(s,o,i.start+t,i.end+t)<0)if(i.left===fn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===fn){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=fn,e.right=fn,vr(e,ps.Red)}function qWe(n,e){let t,i;if(e.left===fn?(t=e.right,i=e,t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===fn?(t=e.left,i=e):(i=sCt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,vr(t,ps.Black),e.detach(),cfe(),p1(t),n.root.parent=fn;return}const s=Tg(i)===ps.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,vr(i,Tg(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==fn&&(i.left.parent=i),i.right!==fn&&(i.right.parent=i)),e.detach(),s){ID(t.parent),i!==e&&(ID(i),ID(i.parent)),cfe();return}ID(t),ID(t.parent),i!==e&&(ID(i),ID(i.parent));let o;for(;t!==n.root&&Tg(t)===ps.Black;)t===t.parent.left?(o=t.parent.right,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),E$(n,t.parent),o=t.parent.right),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.right)===ps.Black&&(vr(o.left,ps.Black),vr(o,ps.Red),x$(n,o),o=t.parent.right),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.right,ps.Black),E$(n,t.parent),t=n.root)):(o=t.parent.left,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),x$(n,t.parent),o=t.parent.left),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.left)===ps.Black&&(vr(o.right,ps.Black),vr(o,ps.Red),E$(n,o),o=t.parent.left),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.left,ps.Black),x$(n,t.parent),t=n.root));vr(t,ps.Black),cfe()}function sCt(n){for(;n.left!==fn;)n=n.left;return n}function cfe(){fn.parent=fn,fn.delta=0,fn.start=0,fn.end=0}function E$(n,e){const t=e.right;t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==fn&&(t.left.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,p1(e),p1(t)}function x$(n,e){const t=e.left;e.delta-=t.delta,(e.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==fn&&(t.right.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,p1(e),p1(t)}function lYe(n){let e=n.end;if(n.left!==fn){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==fn){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function p1(n){n.maxEnd=lYe(n)}function ID(n){for(;n!==fn;){const e=lYe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function oCt(n,e,t,i){return n===t?e-i:n-t}var kE;(function(n){n[n.Unknown=0]="Unknown",n[n.Invalid=3]="Invalid",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(kE||(kE={}));function Gb(n){let e=0,t=0,i=0,s=kE.Unknown;for(let o=0,r=n.length;o=um&&(t=t-n%um),t}function dCt(n,e){return n.reduce((t,i)=>ta(t,e(i)),og)}function dYe(n,e){return n===e}function i7(n,e){const t=n,i=e;if(i-t<=0)return og;const o=Math.floor(t/um),r=Math.floor(i/um),a=i-r*um;if(o===r){const c=t-o*um;return ac(0,a-c)}else return ac(r-o,a)}function NW(n,e){return n=e}function t2(n){return ac(n.lineNumber-1,n.column-1)}function _M(n,e){const t=n,i=Math.floor(t/um),s=t-i*um,o=e,r=Math.floor(o/um),a=o-r*um;return new O(i+1,s+1,r+1,a+1)}function hCt(n){const e=xw(n);return ac(e.length-1,e[e.length-1].length)}const Hj=[],$m=class $m{static create(e,t){if(e<=128&&t.length===0){let i=$m.cache[e];return i||(i=new $m(e,t),$m.cache[e]=i),i}return new $m(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let s=i>>5;if(s===0){const r=1<>5;return s===0?(this.items&1<i===e)?.[0]}reverseLookupSet(e){const t=[];for(const[i]of this.items)e.has(i,this)&&t.push(i);return t}keys(){return this.items.keys()}}var lr;(function(n){n[n.Text=0]="Text",n[n.Bracket=1]="Bracket",n[n.Pair=2]="Pair",n[n.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",n[n.List=4]="List"})(lr||(lr={}));class GMe{get length(){return this._length}constructor(e){this._length=e}}class FW extends GMe{static create(e,t,i){let s=e.length;return t&&(s=ta(s,t.length)),i&&(s=ta(s,i.length)),new FW(s,e,t,i,t?t.missingOpeningBracketIds:np.getEmpty())}get kind(){return lr.Pair}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,s,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=s,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return FW.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new FW(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(ta(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class mw extends GMe{static create23(e,t,i,s=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=ta(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=ta(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return s?new uCt(o,e.listHeight+1,e,t,i,r):new n7(o,e.listHeight+1,e,t,i,r)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,s=e[0].missingOpeningBracketIds;for(let o=1;o{const s=O.lift(i.range);return new IE(t2(s.getStartPosition()),t2(s.getEndPosition()),hCt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${C_(this.startOffset)}...${C_(this.endOffset)}) -> ${C_(this.newLength)}`}}class pCt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>QMe.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:i7(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ac(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ac(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=C_(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ac(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ac(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdxthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=cCt(e,t,this.lineIdx,this.lineCharOffset);return new wk(s,Jg.Text,-1,np.getEmpty(),new AT(s))}}class _Ct{constructor(e,t){this.text=e,this._offset=og,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| -`,"gi"):null,o=[];let r,a=0,c=0,l=0,d=0;const h=[];for(let p=0;p<60;p++)h.push(new wk(ac(0,p),Jg.Text,-1,np.getEmpty(),new AT(ac(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new wk(ac(1,p),Jg.Text,-1,np.getEmpty(),new AT(ac(1,p))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const p=r.index,m=r[0];if(m===` -`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const w=p-l;if(wvCt(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===Jg.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function vCt(n){let e=Iu(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class gYe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=jMe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function wCt(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?fYe(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())YWe(i,s)<=YWe(s,r)?(i=lfe(i,s),s=r):s=lfe(s,r);return lfe(i,s)}function fYe(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function YWe(n,e){return Math.abs(n.listHeight-e.listHeight)}function lfe(n,e){return n.listHeight===e.listHeight?mw.create23(n,e,null,!1):n.listHeight>e.listHeight?bCt(n,e):CCt(e,n)}function bCt(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(n,s,null,!1):n}function CCt(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(s,n,null,!1):n}class yCt{constructor(e){this.lastOffset=og,this.nextNodes=[e],this.offsets=[og],this.idxs=[]}readLongestNodeAt(e,t){if(NW(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u5(this.nextNodes);if(!i)return;const s=u5(this.offsets);if(NW(e,s))return;if(NW(s,e))if(ta(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=dfe(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=dfe(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=u5(this.offsets),t=u5(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u5(this.nextNodes),s=dfe(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(ta(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function dfe(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u5(n){return n.length>0?n[n.length-1]:void 0}function Ewe(n,e,t,i){return new SCt(n,e,t,i).parseDocument()}let SCt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new yCt(i):void 0,this.positionMapper=new pCt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(np.getEmpty(),0);return e||(e=mw.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Jg.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===lr.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?wCt(i):fYe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!zZ(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!NW(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case Jg.ClosingBracket:return new fCt(i.bracketIds,i.length);case Jg.Text:return i.astNode;case Jg.OpeningBracket:{if(t>300)return new AT(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===Jg.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),FW.create(i.astNode,o,r.astNode)):FW.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var RI;(function(n){n[n.InProgress=1]="InProgress",n[n.Completed=2]="Completed"})(RI||(RI={}));function GZ(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new DS(JWe(n)),i=JWe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return s&&h.unshift(s),h}const d=[];for(;s&&!zZ(l);){const[h,u]=s.splitAt(l);d.push(h),l=i7(h.lengthAfter,l),s=u??t.dequeue()}return zZ(l)||d.push(new qk(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&dYe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new IE(u.startOffset,d,ta(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=og;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=dCt(d,f=>f.lengthBefore),u=ta(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=ta(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class qk{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=i7(e,this.lengthAfter);return dYe(t,og)?[this,void 0]:this.modified?[new qk(this.modified,this.lengthBefore,e),new qk(this.modified,og,t)]:[new qk(this.modified,e,e),new qk(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${C_(this.lengthBefore)} -> ${C_(this.lengthAfter)}`}}function JWe(n){const e=[];let t=og;for(const i of n){const s=i7(t,i.startOffset);zZ(s)||e.push(new qk(!1,s,s));const o=i7(i.startOffset,i.endOffset);e.push(new qk(!0,o,i.newLength)),t=i.endOffset}return e}class ACt extends ${didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new I,this.denseKeyProvider=new hYe,this.brackets=new gYe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===RI.Completed?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new _Ct(this.textModel.getValue(),i);this.initialAstWithoutTokens=Ewe(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===RI.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new IE(ac(i.fromLineNumber-1,0),ac(i.toLineNumber,0),ac(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=IE.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=GZ(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=GZ(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new uYe(this.textModel,this.brackets);return Ewe(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=ac(e.startLineNumber-1,e.startColumn-1),s=ac(e.endLineNumber-1,e.endColumn-1);return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;xwe(r,og,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=t2(e.getStartPosition()),s=t2(e.getEndPosition());return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new ECt(o,t,this.textModel);Dwe(r,og,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return mYe(t,og,t.length,t2(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pYe(t,og,t.length,t2(e))}}function pYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){const s=[];for(const o of n.children)t=ta(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(NW(r,i)){const c=pYe(n.children[o],r,a,i);if(c)return c}}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function mYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){for(const s of n.children){if(t=ta(e,s.length),NW(i,t)){const o=mYe(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function xwe(n,e,t,i,s,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case lr.List:{const h=n.childrenLength;for(let u=0;u200)return!0;let c=!0;if(n.kind===lr.Pair){let l=0;if(a){let u=a.get(n.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(n.openingBracket.text,u)}const d=ta(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new aCt(_M(e,t),_M(e,d),n.closingBracket?_M(ta(d,n.child?.length||og),t):void 0,r,l,n,h)),e=d,c&&n.child){const u=n.child;if(t=ta(e,u.length),PW(e,s)&&m3(t,i)&&(c=Dwe(u,e,t,i,s,o,r+1,a),!c))return!1}a?.set(n.openingBracket.text,l)}else{let l=e;for(const d of n.children){const h=l;if(l=ta(l,d.length),PW(h,s)&&PW(i,l)&&(c=Dwe(d,h,l,i,s,o,r,a),!c))return!1}}return c}class xCt extends ${get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Dn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{(!i.languageId||this.bracketPairsTree.value?.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Z;this.bracketPairsTree.value=DCt(e.add(new ACt(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||oM.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||oM.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||oM.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(O.fromPositions(t,t)).findLast(c=>r.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const c=a.textIsBracket[r];return c?Uj(this._findMatchingBracketUp(c,s,hfe(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(O.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(El(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,O.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=hfe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=s-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=s+1;l=c)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!EC(s.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const h=Y_.findNextBracketInRange(a.forwardRegex,i,o,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof VA)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(c)).brackets;if(l&&!EC(s.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,s,l,c),u=Y_.findPrevBracketInRange(l.reversedRegex,i,o,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof VA?null:p}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof VA?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const f=Y_.findPrevBracketInRange(o,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const d=this.textModel.tokenization.getLineTokens(l),h=d.getCount(),u=this.textModel.getLineContent(l);let f=h-1,p=u.length,m=u.length;l===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const w=d.getLanguageId(f)===s&&!EC(d.getStandardTokenType(f));if(w)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}v=w}if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const p=Y_.findNextBracketInRange(o,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return p;u=p.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let p=0,m=0,v=0;d===t.lineNumber&&(p=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let w=!0;for(;p=1;r--){const a=this.textModel.tokenization.getLineTokens(r),c=a.getCount(),l=this.textModel.getLineContent(r);let d=c-1,h=l.length,u=l.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const p=a.getLanguageId(d);i!==p&&(i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(s&&o&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!s&&!EC(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&s&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&s&&f&&h!==u){const p=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(p)return this._toFoundBracket(o,p)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=t.lineNumber;a<=i;a++){const c=this.textModel.tokenization.getLineTokens(a),l=c.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=c.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const m=c.getLanguageId(h);s!==m&&(s=m,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const s=hfe(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,w=p?p.brackets.length:0;v{for(;;){if(s&&++l%100===0&&!s())return VA.INSTANCE;const b=Y_.findNextBracketInRange(f.forwardRegex,p,m,v,w);if(!b)break;const C=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),y=f.textIsBracket[C];if(y&&(y.isOpen(C)?a[y.index]++:y.isClose(C)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(b,y,!1,s);v=b.endColumn-1}return null};let h=null,u=null;for(let f=i.lineNumber;f<=o;f++){const p=this.textModel.tokenization.getLineTokens(f),m=p.getCount(),v=this.textModel.getLineContent(f);let w=0,b=0,C=0;if(f===i.lineNumber){w=p.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const S=p.getLanguageId(w);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let y=!0;for(;we?.dispose()}}function hfe(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}const wae=class wae{constructor(){this._searchCanceledBrand=void 0}};wae.INSTANCE=new wae;let VA=wae;function Uj(n){return n instanceof VA?null:n}class kCt extends ${constructor(e){super(),this.textModel=e,this.colorProvider=new _Ye,this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new O(1,1,this.textModel.getLineCount(),1),e,t):[]}}class _Ye{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Im((n,e)=>{const t=[zKe,$Ke,GKe,qKe,QKe,jKe],i=new _Ye;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(fwt)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var wd;(function(n){n[n.Resource=0]="Resource",n[n.Workspace=1]="Workspace"})(wd||(wd={}));class vYe{constructor(e,t){this.resource=e,this.elements=t}}const H2=class H2{constructor(){this.id=H2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};H2._ID=0,H2.None=new H2;let qZ=H2;const U2=class U2{constructor(){this.id=U2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};U2._ID=0,U2.None=new U2;let ET=U2;function Vj(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class $d{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Vj(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Vj(this.oldText)}")`:`(replace@${this.oldPosition} "${Vj(this.oldText)}" with "${Vj(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Wg(e,s,i),i+=4;for(let o=0;o0&&(this.changes=ICt(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Wg(e,t?t.length:0,i),i+=4,t)for(const s of t)Wg(e,s.selectionStartLineNumber,i),i+=4,Wg(e,s.selectionStartColumn,i),i+=4,Wg(e,s.positionLineNumber,i),i+=4,Wg(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Bg(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(P.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Vl}append(e,t,i,s,o){this._data instanceof Vl&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Vl&&(this._data=this._data.serialize())}open(){this._data instanceof Vl||(this._data=Vl.deserialize(this._data))}undo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Vl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class TCt{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=wd.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=zO(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}setDelegate(e){this._delegate=e}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}getMissingModels(){const e=[];for(const t of this._editStackElementsArr)P.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=zO(e);return this._editStackElementsMap.has(t)}setModel(e){const t=zO(P.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=zO(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=zO(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=zO(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ui(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function kwe(n){return n.getEOL()===` -`?bu.LF:bu.CRLF}function zA(n){return n?n instanceof wYe||n instanceof TCt:!1}class KMe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(zA(i)&&i.canAppend(this._model))return i;const s=new wYe(g(LCt,0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],kwe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=KMe._computeCursorState(i,r),c=r.map((l,d)=>({index:d,textChange:l.textChange}));return c.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,c.map(l=>l.textChange),kwe(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return bt(i),null}}}class RCt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function MCt(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||c>0&&l>0)return;const d=Math.abs(a-l),h=Math.abs(r-c);if(d===0){s.spacesDiff=h,h>0&&0<=c-1&&c-10?s++:y>1&&o++,MCt(r,a,v,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const M=h.spacesDiff;M<=l&&d[M]++,r=v,a=C}let u=t;s!==o&&(u=s{const v=d[m];v>p&&(p=v,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}class Iwe{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Ii)return YMe(this.right);let e=this;for(;e.parent!==Ii&&e.parent.left!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}prev(){if(this.left!==Ii)return bYe(this.left);let e=this;for(;e.parent!==Ii&&e.parent.right!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var ss;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ss||(ss={}));const Ii=new Iwe(null,ss.Black);Ii.parent=Ii;Ii.left=Ii;Ii.right=Ii;Ii.color=ss.Black;function YMe(n){for(;n.left!==Ii;)n=n.left;return n}function bYe(n){for(;n.right!==Ii;)n=n.right;return n}function JMe(n){return n===Ii?0:n.size_left+n.piece.length+JMe(n.right)}function XMe(n){return n===Ii?0:n.lf_left+n.piece.lineFeedCnt+XMe(n.right)}function ufe(){Ii.parent=Ii}function D$(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ii&&(t.left.parent=e),t.parent=e.parent,e.parent===Ii?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function k$(n,e){const t=e.left;e.left=t.right,t.right!==Ii&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ii?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function zj(n,e){let t,i;if(e.left===Ii?(i=e,t=i.right):e.right===Ii?(i=e,t=i.left):(i=YMe(e.right),t=i.right),i===n.root){n.root=t,t.color=ss.Black,e.detach(),ufe(),n.root.parent=Ii;return}const s=i.color===ss.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,_3(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,_3(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ii&&(i.left.parent=i),i.right!==Ii&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,_3(n,i)),e.detach(),t.parent.left===t){const r=JMe(t),a=XMe(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const c=r-t.parent.size_left,l=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,mA(n,t.parent,c,l)}}if(_3(n,t.parent),s){ufe();return}let o;for(;t!==n.root&&t.color===ss.Black;)t===t.parent.left?(o=t.parent.right,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,D$(n,t.parent),o=t.parent.right),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.right.color===ss.Black&&(o.left.color=ss.Black,o.color=ss.Red,k$(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=ss.Black,o.right.color=ss.Black,D$(n,t.parent),t=n.root)):(o=t.parent.left,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,k$(n,t.parent),o=t.parent.left),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.left.color===ss.Black&&(o.right.color=ss.Black,o.color=ss.Red,D$(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=ss.Black,o.left.color=ss.Black,k$(n,t.parent),t=n.root));t.color=ss.Black,ufe()}function ZWe(n,e){for(_3(n,e);e!==n.root&&e.parent.color===ss.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,D$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,k$(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,k$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,D$(n,e.parent.parent))}n.root.color=ss.Black}function mA(n,e,t,i){for(;e!==n.root&&e!==Ii;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function _3(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=JMe(e.left)-e.size_left,i=XMe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const cA=65535;function CYe(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class NCt{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function yA(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new NCt(CYe(n),i,s,o,r);return n.length=0,a}class Ef{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class xT{constructor(e,t){this.buffer=e,this.lineStarts=t}}class FCt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ii&&e.iterate(e.root,i=>(i!==Ii&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class OCt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class BCt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new xT("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ii,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=yA(e[o].buffer));const a=new Ef(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new OCt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=cA,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,c=>{const l=this.getNodeContent(c),d=l.length;if(r<=i||r+d0){const c=o.replace(/\r\n|\r|\n/g,e);a.push(new xT(c,yA(c)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new FCt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,s=>{if(s===Ii)return!0;const o=this.getNodeContent(s),r=o.length,a=e.nodeAt(t),c=e.nodeAt(t+r),l=e.getValueInRange2(a,c);return t+=r,o===l})}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Ii;)if(s.left!==Ii&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Ii;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new oe(i+1,a+1)}return new oe(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ii){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new oe(i+1,r+1)}else t=t.right;return new oe(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,c=this._buffers[a.piece.bufferIndex].buffer,l=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return c.substring(l+e.remainder,l+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Ii;){const a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(c,c+t.remainder);break}else r+=a.substr(c,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Ii)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const c=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=l[d]+r.start.column;if(s&&(c.charCodeAt(u)===q.LineFeed&&(u++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===q.CarriageReturn?(s=!0,i+=c.substr(u,a-1)):i+=c.substr(u,a),!0;i+=this._EOLNormalized?c.substring(u,Math.max(u,l[d+1]-this._EOLLength)):c.substring(u,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fy+p,t.reset(0)):(b=u.buffer,C=y=>y,t.reset(p));do if(v=t.next(b),v){if(C(v.index)>=m)return d;this.positionInBuffer(e,C(v.index)-f,w);const y=this.getLineFeedCnt(e.piece.bufferIndex,o,w),S=w.line===o.line?w.column-o.column+s:w.column+1,M=S+v[0].length;if(h[d++]=wT(new O(i+y,S,i+y,M),v,c),C(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new $B(t.wordSeparators,t.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(l===null)return[];let d=this.positionInBuffer(c.node,c.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(c.node===l.node)return this.findMatchesInNode(c.node,a,e.startLineNumber,e.startColumn,d,h,t,i,s,r,o),o;let u=e.startLineNumber,f=c.node;for(;f!==l.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){const w=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),C=w[d.line+m],y=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,y,d,this.positionInBuffer(f,C-b),t,i,s,r,o),r>=s)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const w=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,w,e.endLineNumber,v,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,s),r>=s)return o;u++,c=this.nodeAt2(u,1),f=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(u===e.endLineNumber){const m=u===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,m,r,o,i,s),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,c,l){const d=e.wordSeparators;if(!c&&e.simpleSearch){const u=e.simpleSearch,f=u.length,p=i.length;let m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!d||mMe(d,i,p,m,f))&&(a[r++]=new z9(new O(s,m+1+o,s,m+1+f+o),null),r>=l))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=wT(new O(s,h.index+1+o,s,h.index+1+h[0].length+o),h,c),r>=l))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ii){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,c=a.bufferIndex,l=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new Ef(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(c,a.end)-this.offsetInBuffer(c,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const m={line:h.start.line+1,column:0};h=new Ef(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=` + .current-line.current-line-margin.current-line-margin-both{border-right:0}`;Ct(Hwt,{});class XKe extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new mt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),Ls(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo);return this._renderLineHighlight=t.get(x.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(x.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=[];for(let r=t;r<=i;r++){const a=r-t;s[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new oe(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new oe(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new oe(l,this._context.viewModel.model.getLineMaxColumn(l))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let p=u;p<=f;p++){const m=p-t;s[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;s[a]=o}this._renderData=s}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Uwt extends XKe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Vwt extends XKe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Im((n,e)=>{const t=n.getColor(WKe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(xWe)){const i=n.getColor(xWe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),pS(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});var zwt=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";Ct(zwt,{});class $wt extends fO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let c=0,l=t.length;c{if(c.options.zIndexl.options.zIndex)return 1;const d=c.options.className,h=l.options.className;return dh?1:O.compareRangesUsingStarts(c.range,l.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let c=o;c<=r;c++){const l=c-o;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(c.range.startLineNumber,s),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-s;i[f]+=l}}}_renderNormalDecorations(e,t,i){const s=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=w}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Gwt extends Cp{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(x.scrollbar),a=o.get(x.mouseWheelScrollSensitivity),c=o.get(x.fastScrollSensitivity),l=o.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+gwe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new hQ(t.domNode,d,this._context.viewLayout.getScrollable())),Xb.write(this.scrollbar.getDomNode(),Da.ScrollableElement),this.scrollbarDomNode=ks(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(u,f,p)=>{const m={};{const v=u.scrollTop;v&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,u.scrollTop=0)}if(p){const v=u.scrollLeft;v&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,u.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,vt.Immediate)};this._register(pe(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(pe(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(pe(s.domNode,"scroll",u=>h(s.domNode,!0,!1))),this._register(pe(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(x.layoutInfo);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(x.minimap).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(x.scrollbar)||e.hasChanged(x.mouseWheelScrollSensitivity)||e.hasChanged(x.fastScrollSensitivity)){const t=this._context.configuration.options,i=t.get(x.scrollbar),s=t.get(x.mouseWheelScrollSensitivity),o=t.get(x.fastScrollSensitivity),r=t.get(x.scrollPredominantAxis),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+gwe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var qwt=".monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{align-items:center;display:flex;justify-content:center;position:absolute}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}";Ct(qwt,{});class mwe{constructor(e,t,i,s,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=s,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Qwt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class jwt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class ZKe extends fO{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const c=a-e;s[c]=new jwt}if(i.length===0)return s;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNames)continue;const l=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(o.preference.lane);t.push(new Jwt(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.laneIndex===s.laneIndex?i.zIndex===s.zIndex?s.type===i.type?i.type===fM.Decoration&&s.type===fM.Decoration?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.laneIndex===s.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===fM.Decoration){const a=[];for(const c of o){if(c.zIndex!==r.zIndex||c.type!==r.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var fM;(function(n){n[n.Decoration=0]="Decoration",n[n.Widget=1]="Widget"})(fM||(fM={}));class Ywt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=s,this.type=fM.Decoration}accept(e){return new Xwt(this.lineNumber,this.laneIndex,e)}}class Jwt{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=s,this.type=fM.Widget}}class Xwt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var Zwt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";Ct(Zwt,{});class eYe extends ${constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function dde(n,e){let t=0,i=0;const s=n.length;for(;is)throw new cn("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,c=-1,l=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,c=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){a=F,c=N;break}}}if(l===-2){l=-1,d=-1;for(let F=k;F=0){l=F,d=N;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let F=k-2;F>=0;F--){const N=this._computeIndentLevel(F);if(N>=0){u=F,f=N;break}}}if(p!==-1&&(p===-2||p=0){p=F,m=N;break}}}};let w=0,b=!0,C=0,y=!0,S=0,M=0;for(let k=0;b||y;k++){const F=e-k,N=e+k;k>1&&(F<1||F1&&(N>s||N>i)&&(y=!1),k>5e4&&(b=!1,y=!1);let z=-1;if(b&&F>=1){const J=this._computeIndentLevel(F-1);J>=0?(l=F-1,d=J,z=Math.ceil(J/this.textModel.getOptions().indentSize)):(h(F),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let U=-1;if(y&&N<=s){const J=this._computeIndentLevel(N-1);J>=0?(u=N-1,f=J,U=Math.ceil(J/this.textModel.getOptions().indentSize)):(v(N),U=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){M=z;continue}if(k===1){if(N<=s&&U>=0&&M+1===U){b=!1,w=N,C=N,S=U;continue}if(F>=1&&z>=0&&z-1===M){y=!1,w=F,C=F,S=z;continue}if(w=e,C=e,S=M,S===0)return{startLineNumber:w,endLineNumber:C,indent:S}}b&&(z>=S?w=F:b=!1),y&&(U>=S?C=N:y=!1)}return{startLineNumber:w,endLineNumber:C,indent:S}}getLinesBracketGuides(e,t,i,s){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new O(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(O.fromPositions(i)).toArray()).filter(u=>O.strictContainsPosition(u.range,i));c=t1(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new tYe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!s.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(s.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===pM.Enabled||s.horizontalGuides===pM.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new gR(-1,h.openingBracketRange.getEndPosition().column,f,new C$(!1,m.column),-1,-1));continue}const w=this.getVisibleColumnFromPosition(m),b=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(b,w,h.minVisibleColumnIndentation+1);let y=!1;Eu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&b>C&&o[p.lineNumber-e].push(new gR(C,-1,f,new C$(!1,p.column),-1,-1)),m.lineNumber<=t&&w>C&&o[m.lineNumber-e].push(new gR(C,-1,f,new C$(!y,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return kc.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let c=-2,l=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const f=u-e,p=this._computeIndentLevel(u-1);if(p>=0){c=u-1,l=p,a[f]=Math.ceil(p/s.indentSize);continue}if(c===-2){c=-1,l=-1;for(let m=u-2;m>=0;m--){const v=this._computeIndentLevel(m);if(v>=0){c=m,l=v;break}}}if(d!==-1&&(d===-2||d=0){d=m,h=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,l,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:ts||this._maxIndentLeft>0&&p>this._maxIndentLeft)break;const m=f.horizontalLine?f.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",v=f.horizontalLine?(e.visibleRangeForPosition(new oe(c,f.horizontalLine.endColumn))?.left??p+this._spaceWidth)-p:this._spaceWidth;h+=`
    `}a[l]=h}this._renderResult=a}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?pM.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?pM.EnabledForActive:pM.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,c=h.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const f=s?s[h-e]:[],p=new DS(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const w=(v-1)*l+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(y=>y.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function UO(n){if(!(n&&n.isTransparent()))return n}Im((n,e)=>{const t=[{bracketColor:zKe,guideColor:pwt,guideColorActive:Cwt},{bracketColor:$Ke,guideColor:mwt,guideColorActive:ywt},{bracketColor:GKe,guideColor:_wt,guideColorActive:Swt},{bracketColor:qKe,guideColor:vwt,guideColorActive:Awt},{bracketColor:QKe,guideColor:wwt,guideColorActive:Ewt},{bracketColor:jKe,guideColor:bwt,guideColorActive:xwt}],i=new tYe,s=[{indentColor:uQ,indentColorActive:gQ},{indentColor:Jvt,indentColorActive:iwt},{indentColor:Xvt,indentColorActive:nwt},{indentColor:Zvt,indentColorActive:swt},{indentColor:ewt,indentColorActive:owt},{indentColor:twt,indentColorActive:rwt}],o=t.map(a=>{const c=n.getColor(a.bracketColor),l=n.getColor(a.guideColor),d=n.getColor(a.guideColorActive),h=UO(UO(l)??c?.transparent(.3)),u=UO(UO(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(yl),r=s.map(a=>{const c=n.getColor(a.indentColor),l=n.getColor(a.indentColorActive),d=UO(c),h=UO(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(yl);if(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${c.indentColor}; --indent-color-active: ${c.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});var ibt=".mtkcontrol{background:#960000!important;color:#fff!important}.mtkoverflow{background-color:var(--vscode-button-background,var(--vscode-editor-background));border-color:var(--vscode-contrastBorder);border-radius:2px;border-style:solid;border-width:1px;color:var(--vscode-button-foreground,var(--vscode-editor-foreground));cursor:pointer;padding:4px}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:auto;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{bottom:0;position:absolute;top:0}.monaco-editor .mtkw,.monaco-editor .mtkz{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block}";Ct(ibt,{});class sfe{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class nbt{constructor(){this._currentVisibleRange=new O(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class sbt{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class obt{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new yn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new nbt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(x.stickyScroll).enabled,this._maxNumberStickyLines=s.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new rE(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(x.wrappingInfo)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(x.fontInfo),s=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(x.revealHorizontalRightPadding),this._cursorSurroundingLines=t.get(x.cursorSurroundingLines),this._cursorSurroundingLinesStyle=t.get(x.cursorSurroundingLinesStyle),this._canUseLayerHinting=!t.get(x.disableLayerHinting),this._stickyScrollEnabled=t.get(x.stickyScroll).enabled,this._maxNumberStickyLines=t.get(x.stickyScroll).maxLineCount,Sd(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new wWe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new sbt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new obt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?vt.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new oe(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new sfe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=O.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new sfe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(s.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=s.startLineNumber;h<=s.endLineNumber;h++){if(hd)continue;const u=h===s.startLineNumber?s.startColumn:1,f=h!==s.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):s.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const s=new sfe(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new nvt(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),jr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let w=o[0].startLineNumber,b=o[0].endLineNumber;for(let C=1,y=o.length;Cc){if(!d)return-1;v=h}else if(r===Ns.NearTop||r===Ns.NearTopIfOutsideViewport)if(r===Ns.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=Math.max(5*this._lineHeight,c*.2),b=h-w,C=u-c;v=Math.max(C,b)}else if(r===Ns.Center||r===Ns.CenterIfOutsideViewport)if(r===Ns.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const w=(h+u)/2;v=Math.max(0,w-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===Ns.Top,r===Ns.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=Zn.MAX_SAFE_SMALL_INTEGER,a=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const d of l.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const d=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(r=Math.max(0,r-pae.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}};pae.HORIZONTAL_EXTRA_PX=30;let _we=pae;var rbt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";Ct(rbt,{});class abt extends ZKe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(x.layoutInfo);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=s[d].getDecorations();let u="";for(const f of h){let p='
    ';o[a]=l}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var dbt=".monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{left:-6px;position:absolute;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{left:-1px;position:absolute;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}";Ct(dbt,{});const hk=class hk{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=hk._clamp(e),this.g=hk._clamp(t),this.b=hk._clamp(i),this.a=hk._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};hk.Empty=new hk(0,0,0,0);let dx=hk;var Bn;(function(n){n[n.START_CH_CODE=32]="START_CH_CODE",n[n.END_CH_CODE=126]="END_CH_CODE",n[n.UNKNOWN_CODE=65533]="UNKNOWN_CODE",n[n.CHAR_COUNT=96]="CHAR_COUNT",n[n.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",n[n.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",n[n.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",n[n.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",n[n.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",n[n.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Bn||(Bn={}));const hbt=(()=>{const n=[];for(let e=Bn.START_CH_CODE;e<=Bn.END_CH_CODE;e++)n.push(e);return n.push(Bn.UNKNOWN_CODE),n})(),ubt=(n,e)=>(n-=Bn.START_CH_CODE,n<0||n>Bn.CHAR_COUNT?e<=2?(n+Bn.CHAR_COUNT)%Bn.CHAR_COUNT:Bn.CHAR_COUNT-1:n),mae=class mae extends ${static getInstance(){return this._INSTANCE||(this._INSTANCE=xU(new mae)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(dc.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=dc.getColorMap();if(!e){this._colors=[dx.Empty],this._backgroundIsLight=!0;return}this._colors=[dx.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Ad.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};mae._INSTANCE=null;let HZ=mae;class e7{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=e7.soften(e,12/15),this.charDataLight=e7.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=ubt(s,l),w=e.width*Bn.RGBA_CHANNELS_CNT,b=a.r,C=a.g,y=a.b,S=o.r-b,M=o.g-C,k=o.b-y,F=Math.max(r,c),N=e.data;let z=v*u*f,U=i*w+t*Bn.RGBA_CHANNELS_CNT;for(let J=0;Je.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*Bn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,w=s.r-p,b=s.g-m,C=s.b-v,y=p+w*f,S=m+b*f,M=v+C*f,k=Math.max(o,a),F=e.data;let N=i*u+t*Bn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=kWe[n[t]]<<4|kWe[n[t+1]]&15;return e},LWe={1:cw(()=>IWe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:cw(()=>IWe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class y${static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return LWe[e]?i=new e7(LWe[e](),e):i=y$.createFromSampleData(y$.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height=`${Bn.SAMPLED_CHAR_HEIGHT}px`,t.height=Bn.SAMPLED_CHAR_HEIGHT,t.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,t.style.width=Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Bn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let s=0;for(const o of hbt)i.fillText(String.fromCharCode(o),s,Bn.SAMPLED_CHAR_HEIGHT/2),s+=Bn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Bn.CHAR_COUNT*Bn.SAMPLED_CHAR_WIDTH,Bn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Bn.SAMPLED_CHAR_HEIGHT*Bn.SAMPLED_CHAR_WIDTH*Bn.RGBA_CHANNELS_CNT*Bn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const s=y$._downsample(e,t);return new e7(s,t)}static _downsampleChar(e,t,i,s,o){const r=Bn.BASE_CHAR_WIDTH*o,a=Bn.BASE_CHAR_HEIGHT*o;let c=s,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dy$.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Ad.DefaultBackground),this.backgroundColor=RW._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=RW._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(zmt);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor($mt);return t?dx._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Mc);return i?new dx(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class S${constructor(e,t,i,s,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=c,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,c,l,d,h){const u=e.pixelRatio,f=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let M=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(M+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/M)),F=Math.max(0,e.minimapHeight-k),N=F/(d-o),z=l*N,U=F>0,J=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new S$(l,d,U,N,z,k,j,1,Math.min(a,J))}let v;if(r&&i!==a){const M=i-t+1;v=Math.floor(M*f/u)}else{const M=o/m;v=Math.floor(M*f/u)}const w=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const M=o/m;b=Math.max(b,M-1)}let C;if(b>0){const M=o/m;C=(w+a+b-M-1)*f/u}else C=Math.max(0,(w+a)*f/u-v);C=Math.min(e.minimapHeight-v,C);const y=C/(d-o),S=l*y;if(p>=w+a+b){const M=C>0;return new S$(l,d,M,y,S,v,w,1,a)}else{let M;t>1?M=t+w:M=Math.max(1,l/m);let k,F=Math.max(1,Math.floor(M-S*u/f));Fl&&(F=Math.min(F,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?U=(t-F+k+z)*f/u:U=l/e.paddingTop*(k+z)*f/u,new S$(l,d,!0,y,U,v,k,F,N)}}}const _ae=class _ae{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};_ae.INVALID=new _ae(-1);let UZ=_ae;class TWe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new KKe(()=>UZ.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let w=0,b=s-1;w0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=t7.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o!s.options.minimap?.sectionHeaderStyle);if(this._samplingState){const s=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),c=this._samplingState.modelLineToMinimapLine(r.endLineNumber);s.push(new cKe(new O(a,r.startColumn,c,r.endColumn),o.options))}return s}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>!!r.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new O(s,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new O(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const s=this._sectionHeaderCache.get(i);if(s)return s;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new O(e,1,e,1),Ns.Center,vt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},vt.Immediate)}}class e2 extends ${constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(fWe),this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ks(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ks(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ks(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ks(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ks(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Xo(this._domNode.domNode,xe.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===Mb.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=ia(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new vz,this._sliderPointerDownListener=Xo(this._slider.domNode,xe.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=dh.addTarget(this._domNode.domNode),this._sliderTouchStartListener=pe(this._domNode.domNode,Eo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=pe(this._domNode.domNode,Eo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Xo(this._domNode.domNode,Eo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=ia(this._domNode.domNode),l=Math.min(Math.abs(a-s),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Is&&l>gbt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new zMe(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(fWe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===Mb.None){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=S$.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(O.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,s,o);const d=new RWe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new RWe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,s),this._renderDecorationsHighlights(l,i,h,e,r,c,a,s),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const c of t){const l=s.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=s.getYForLineNumber(d,o),f=s.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(AC,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(AC,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==xu.Inline)continue;const d=s.intersectWithViewport(c.range);if(!d)continue;const[h,u]=d,f=l.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=r.get(f.toString());p||(p=f.transparent(.5).toString(),r.set(f.toString(),p)),e.fillStyle=p;for(let m=h;m<=u;m++){if(i.has(m))continue;i.set(m,!0);const v=s.getYForLineNumber(h,o);e.fillRect(AC,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=s.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,s,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=s.intersectWithViewport(l.range);if(!h)continue;const[u,f]=h,p=d.getColor(this._theme.value);if(!(!p||p.isTransparent()))for(let m=u;m<=f;m++)switch(d.position){case xu.Inline:this.renderDecorationOnLine(e,i,l.range,p,s,m,o,o,r,a,c);continue;case xu.Gutter:{const v=s.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,fbt,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,c,l,d,h){const u=o.getYForLineNumber(r,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===r?i.startColumn:1,v=p===r?i.endColumn:this._model.getLineMaxColumn(r),w=this.getXOffsetForPosition(t,r,m,l,d,h),b=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,s,w,u,b-w,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return AC;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[AC];let d=AC;for(let h=1;h=r){c[h]=r;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=e2._fitSectionHeader.bind(null,u,r-AC);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,w=v-i,b=w+2,C=this._model.getSectionHeaderText(m,p);e2._renderSectionLabel(u,C,m.options.minimap?.sectionHeaderStyle===V9.Underlined,c,d,r,w,o,v,b)}}static _fitSectionHeader(e,t,i){if(!i)return i;const s="…",o=e.measureText(i).width,r=e.measureText(s).width;if(o<=t||o<=r)return i;const a=i.length,c=o/i.length,l=Math.floor((t-r)/c)-1;let d=Math.ceil(l/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+s+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,s,o,r,a,c,l,d){t&&(e.fillStyle=s,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,AC,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const me=this._lastRenderData._get();return new TWe(e,me.imageData,me.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=e2._renderUntouchedLines(o,e.topPaddingLineCount,t,i,s,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,c),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),v=this._model.options.renderMinimap,w=this._model.options.charRenderer(),b=this._model.options.fontScale,C=this._model.options.minimapCharWidth,S=(v===Mb.Text?Bn.BASE_CHAR_HEIGHT:Bn.BASE_CHAR_HEIGHT+1)*b,M=s>S?Math.floor((s-S)/2):0,k=u.a/255,F=new dx(Math.round((u.r-h.r)*k+h.r),Math.round((u.g-h.g)*k+h.g),Math.round((u.b-h.b)*k+h.b),255);let N=e.topPaddingLineCount*s;const z=[];for(let me=0,De=i-t+1;me=0&&Ub)return;const J=v.charCodeAt(S);if(J===Q.Tab){const j=u-(S+M)%u;M+=j-1,y+=j*r}else if(J===Q.Space)y+=r;else{const j=c1(J)?2:1;for(let re=0;reb)return}}}}}class RWe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var mbt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";Ct(mbt,{});class _bt extends Cp{constructor(e,t){super(e),this._viewDomNode=t;const s=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=s.verticalScrollbarWidth,this._minimapWidth=s.minimap.minimapWidth,this._horizontalScrollbarHeight=s.horizontalScrollbarHeight,this._editorHeight=s.height,this._editorWidth=s.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ks(document.createElement("div")),Xb.write(this._domNode,Da.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ks(document.createElement("div")),Xb.write(this.overflowingOverlayWidgetsDomNode,Da.OverflowingOverlayWidgets),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.layoutInfo);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=ks(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],s=t?t.preference:null,o=t?.stackOridinal;return i.preference===s&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=s,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,s=t.length;i0);t.sort((s,o)=>(this._widgets[s].stack||0)-(this._widgets[o].stack||0));for(let s=0,o=t.length;s=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,c=e,l=c+o,d=c+o+a;return[[0,c,l,c,d,c,l,c],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,c=a+o;return[[0,a,a,a,c,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&fe.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}var vwe;(function(n){n[n.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(vwe||(vwe={}));var VZ;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(VZ||(VZ={}));var Zw;(function(n){n[n.NotNeeded=0]="NotNeeded",n[n.Maybe=1]="Maybe",n[n.Needed=2]="Needed"})(Zw||(Zw={}));class wbt extends Cp{constructor(e){super(e),this._actualShouldRender=Zw.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=dc.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new oe(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new vbt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=Zw.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Zw.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(s=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:s})}return this._cursorPositions.sort((t,i)=>oe.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=Zw.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?fe.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(q9.compareByRenderingProps),this._actualShouldRender===Zw.Maybe&&!q9.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe&&!Ls(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Zw.Needed),this._actualShouldRender===Zw.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=s/a,l=vwe.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):(h.clearRect(0,0,i,s),h.fillStyle=fe.Format.CSS.formatHexA(e),h.fillRect(0,0,i,s)):h.clearRect(0,0,i,s);const u=this._settings.x,f=this._settings.w;for(const p of t){const m=p.color,v=p.data;h.fillStyle=m;let w=0,b=0,C=0;for(let y=0,S=v.length/3;ys&&(J=s-d),N=J-d,z=J+d}N>C+1||M!==w?(y!==0&&h.fillRect(u[w],b,f[w],C-b),w=M,b=N,C=z):z>C&&(C=z)}h.fillRect(u[w],b,f[w],C-b)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[VZ.Full],w=this._settings.w[VZ.Full];let b=-100,C=-100,y=null;for(let S=0,M=this._cursorPositions.length;Ss&&(N=s-m);const z=N-m,U=z+p;z>C+1||k!==y?(S!==0&&y&&h.fillRect(v,b,w,C-b),b=z,C=U):U>C&&(C=U),y=k,h.fillStyle=k}y&&h.fillRect(v,b,w,C-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,s),h.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}var wwe;(function(n){n[n.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(wwe||(wwe={}));class MWe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class nYe{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-v);const w=d.color;let b=this._color2Id[w];b||(b=++this._lastAssignedId,this._color2Id[w]=b,this._id2Color[b]=w);const C=new MWe(m-v,m+v,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(MWe.compare),a}}class Cbt extends dQ{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ks(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new bbt(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(x.lineHeight)),this._zoneManager.setPixelRatio(i.get(x.pixelRatio)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(x.lineHeight)&&(this._zoneManager.setLineHeight(t.get(x.lineHeight)),this._render()),e.hasChanged(x.pixelRatio)&&(this._zoneManager.setPixelRatio(t.get(x.pixelRatio)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==o?(e.fillRect(0,r,s,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,s,a-r),r=d,a=h)}e.fillRect(0,r,s,a-r)}}var ybt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";Ct(ybt,{});class Sbt extends Cp{constructor(e){super(e),this.domNode=ks(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(x.rulers),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=ks(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(x.layoutInfo);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(x.scrollbar);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var xbt=".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}";Ct(xbt,{});var Ac;(function(n){n[n.EXTERN=0]="EXTERN",n[n.INTERN=1]="INTERN",n[n.FLAT=2]="FLAT"})(Ac||(Ac={}));class Dbt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class kbt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Ibt(n){return new Dbt(n)}function Lbt(n){return new kbt(n.lineNumber,n.ranges.map(Ibt))}const Pa=class Pa extends fO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(x.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(x.fontInfo).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!o&&l=0;l--)i[l].lineNumber===c&&(r=i[l].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,c=t.length;a0){const p=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Bj(d-p)p&&(u.top=Ac.INTERN),Bj(h-m)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=s[0].lineNumber,a=s[s.length-1].lineNumber;for(let c=0,l=s.length;c1,l)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};Pa.SELECTION_CLASS_NAME="selected-text",Pa.SELECTION_TOP_LEFT="top-left-radius",Pa.SELECTION_BOTTOM_LEFT="bottom-left-radius",Pa.SELECTION_TOP_RIGHT="top-right-radius",Pa.SELECTION_BOTTOM_RIGHT="bottom-right-radius",Pa.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",Pa.ROUNDED_PIECE_WIDTH=10;let bwe=Pa;Im((n,e)=>{const t=n.getColor(Amt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Bj(n){return n<0?-n:n}var Tbt=".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{box-sizing:border-box;overflow:hidden;position:absolute}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:2px}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{background:transparent!important;border-bottom-style:solid;border-bottom-width:1px}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}";Ct(Tbt,{});class NWe{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}var DE;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(DE||(DE={}));class PWe{constructor(e,t){this._context=e;const i=this._context.configuration.options,s=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ks(document.createElement("div")),this._domNode.setClassName(`cursor ${lx}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Sd(this._domNode,s),this._domNode.setDisplay("none"),this._position=new oe(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case DE.Single:this._pluralityClass="";break;case DE.MultiPrimary:this._pluralityClass="cursor-primary";break;case DE.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(x.fontInfo);return this._cursorStyle=t.get(x.cursorStyle),this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),Sd(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=bQe(i,t-1);return[new oe(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fa.Line||this._cursorStyle===fa.LineThin){const u=e.visibleRangeForPosition(s);if(!u||u.outsideRenderedLine)return null;const f=gt(this._domNode.domNode);let p;this._cursorStyle===fa.Line?(p=v2e(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(s))):p=v2e(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const w=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new NWe(w,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new O(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=o===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===fa.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===fa.Underline||this._cursorStyle===fa.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new NWe(d,c.left,0,l,h,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${lx} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}const q8=class q8 extends Cp{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new PWe(this._context,DE.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ks(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new O_,this._cursorFlatBlinkInterval=new sQ,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(x.readOnly),this._cursorBlinking=t.get(x.cursorBlinking),this._cursorStyle=t.get(x.cursorStyle),this._cursorSmoothCaretAnimation=t.get(x.cursorSmoothCaretAnimation),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},q8.BLINK_INTERVAL,gt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},q8.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fa.Line:e+=" cursor-line-style";break;case fa.Block:e+=" cursor-block-style";break;case fa.Underline:e+=" cursor-underline-style";break;case fa.LineThin:e+=" cursor-line-thin-style";break;case fa.BlockOutline:e+=" cursor-block-outline-style";break;case fa.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case xh.Blink:e+=" cursor-blink";break;case xh.Smooth:e+=" cursor-smooth";break;case xh.Phase:e+=" cursor-phase";break;case xh.Expand:e+=" cursor-expand";break;case xh.Solid:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:tS,background:EE},{class:".cursor-primary",foreground:HKe,background:jvt},{class:".cursor-secondary",foreground:UKe,background:Kvt}];for(const i of t){const s=n.getColor(i.foreground);if(s){let o=n.getColor(i.background);o||(o=s.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${s}; border-color: ${s}; color: ${o}; }`),pS(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const ofe=()=>{throw new Error("Invalid change accessor")};class Rbt extends Cp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(x.layoutInfo);this._lineHeight=t.get(x.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ks(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ks(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Mbt(e,s),s.addZone=ofe,s.removeZone=ofe,s.layoutZone=ofe}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ks(t.domNode),marginDomNode:t.marginDomNode?ks(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){bt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){bt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=u.startLineNumber===a?u.startColumn:l.minColumn,p=u.endLineNumber===a?u.endColumn:l.maxColumn;f=z.endOffset&&(N++,z=i&&i[N]),j!==Q.Tab&&j!==Q.Space||u&&!M&&J<=F)continue;if(h&&J>=k&&J<=F&&j===Q.Space){const me=J-1>=0?a.charCodeAt(J-1):Q.Null,De=J+1=0?a.charCodeAt(J-1):Q.Null;if(j===Q.Space&&me!==Q.Space&&me!==Q.Tab)continue}if(i&&(!z||z.startOffset>J||z.endOffset<=J))continue;const re=e.visibleRangeForPosition(new oe(t,J+1));re&&(r?(U=Math.max(U,re.left),j===Q.Tab?S+=this._renderArrow(f,v,re.left):S+=``):j===Q.Tab?S+=`
    ${y?"→":"→"}
    `:S+=`
    ${String.fromCharCode(C)}
    `)}return r?(U=Math.round(U+v),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,c={x:0,y:s/2},l={x:100/125*o,y:c.y},d={x:l.x-.2*l.x,y:l.y+.2*l.x},h={x:d.x+.1*l.x,y:d.y+.1*l.x},u={x:h.x+.35*l.x,y:h.y-.35*l.x},f={x:u.x,y:-u.y},p={x:h.x,y:-h.y},m={x:d.x,y:-d.y},v={x:l.x,y:-l.y},w={x:c.x,y:-c.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class FWe{constructor(e){const t=e.options,i=t.get(x.fontInfo),s=t.get(x.experimentalWhitespaceRendering);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!0):(this.renderWhitespace=t.get(x.renderWhitespace),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(x.lineHeight),this.stopRenderingLineAfter=t.get(x.stopRenderingLineAfter)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class Fbt{constructor(e,t,i,s){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=s,this.visibleRange=new O(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class Obt{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class Bbt{constructor(e,t,i){this.configuration=e,this.theme=new Obt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let ywe=class extends dQ{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new mt(1,1,1,1)],this._renderAnimationFrame=null;const c=new Rwt(t,s,o,e);this._context=new Bbt(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(fwe,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ks(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ks(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ks(document.createElement("div")),Xb.write(this._overflowGuardContainer,Da.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Gwt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new _we(this._context,this._linesContent),this._viewZones=new Rbt(this._context),this._viewParts.push(this._viewZones);const l=new wbt(this._context);this._viewParts.push(l);const d=new Ebt(this._context);this._viewParts.push(d);const h=new Nwt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Uwt(this._context)),h.addDynamicOverlay(new bwe(this._context)),h.addDynamicOverlay(new tbt(this._context)),h.addDynamicOverlay(new $wt(this._context)),h.addDynamicOverlay(new Pbt(this._context));const u=new Pwt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Vwt(this._context)),u.addDynamicOverlay(new lbt(this._context)),u.addDynamicOverlay(new abt(this._context)),u.addDynamicOverlay(new BZ(this._context)),this._glyphMarginWidgets=new Kwt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new WZ(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(u.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Bwt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Cwe(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _bt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new Sbt(this._context);this._viewParts.push(p);const m=new Owt(this._context);this._viewParts.push(m);const v=new pbt(this._context);if(this._viewParts.push(v),l){const w=this._scrollbar.getOverviewRulerLayoutInfo();w.parent.insertBefore(l.getDomNode(),w.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new $vt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],s=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??FS.Center;return s=Math.max(s,o.range.endLineNumber),{range:o.range,lane:r,persist:o.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return s=Math.max(s,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>O.compareRangesUsingStarts(o.range,r.range)),t.reset(s);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new cvt(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new oe(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(x.layoutInfo);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(x.editorClassName)+" "+gwe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new cn;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Swe.INSTANCE.scheduleCoordinatedRendering({window:gt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new cn;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new cn;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new cn;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Gk(()=>e.prepareRenderText());const t=Gk(()=>e.renderText());if(t){const[i,s]=t;Gk(()=>e.prepareRender(i,s)),Gk(()=>e.render(i,s))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Hk.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Fbt(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new tvt(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},vt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?lde.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Cbt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}refreshFocusState(){this._textAreaHandler.refreshFocusState()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};ywe=D([_(6,be)],ywe);function Gk(n){try{return n()}catch(e){return bt(e),null}}const vae=class vae{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,s]of this._animationFrameRunners)s.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,wZ(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Gk(()=>i.prepareRenderText());const t=[];for(let i=0,s=e.length;io.renderText())}for(let i=0,s=e.length;io.prepareRender(a,c))}for(let i=0,s=e.length;io.render(a,c))}}};vae.INSTANCE=new vae;let Swe=vae;class A${constructor(e,t,i,s,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=s,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===jo.Left)if(e<=r)s=o-1;else if(e>c)i=o+1;else break;else if(e=c)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Wj(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===jo.Left){if(e>0&&t===this.getMinOutputOffset(e))return new Wj(e-1,this.getMaxOutputOffset(e-1))}else if(i===jo.Right){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===jo.None){if(e===i.offsetInInputWithInjections+i.length&&OWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(BWe(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(OWe(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,BWe(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===jo.Right||t===jo.RightOfInjectedText){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}oQ()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function OWe(n){return n==null?!0:n===Bv.Right||n===Bv.Both}function BWe(n){return n==null?!0:n===Bv.Left||n===Bv.Both}class Wj{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new oe(e+this.outputLineIndex,this.outputOffset+1)}}var Yp;(function(n){n[n.Flush=1]="Flush",n[n.LineChanged=2]="LineChanged",n[n.LinesDeleted=3]="LinesDeleted",n[n.LinesInserted=4]="LinesInserted",n[n.EOLChanged=5]="EOLChanged"})(Yp||(Yp={}));class Wbt{constructor(){this.changeType=Yp.Flush}}class iw{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new iw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new iw(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}withText(e){return new iw(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class WWe{constructor(e,t,i){this.changeType=Yp.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Hbt{constructor(e,t){this.changeType=Yp.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Ubt{constructor(e,t,i,s){this.changeType=Yp.LinesInserted,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Vbt{constructor(){this.changeType=Yp.EOLChanged}}class MW{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;tn});class $Me{static create(e){return new $Me(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>$bt(ws(this.targetWindow.deref()),r,e,t,i,s,o,a)}}}function $bt(n,e,t,i,s,o,r,a){function c(N){const z=a[N];if(z){const U=iw.applyInjectedText(e[N],z),J=z.map(re=>re.options),j=z.map(re=>re.column-1);return new A$(j,J,[U.length],[],0)}else return null}if(s===-1){const N=[];for(let z=0,U=e.length;zl?(U=0,J=0):j=l-De}const re=z.substr(U),me=Gbt(re,J,i,j,p,u);m[N]=U,v[N]=J,w[N]=re,b[N]=me[0],C[N]=me[1]}const y=p.build(),S=zbt?.createHTML(y)??y;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),n.document.body.appendChild(f);const M=document.createRange(),k=Array.prototype.slice.call(f.children,0),F=[];for(let N=0;NOe.options),Qe=Tt.map(Oe=>Oe.column-1)):(De=null,Qe=null),F[N]=new A$(Qe,De,U,me,j)}return n.document.body.removeChild(f),F}var fR;(function(n){n[n.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(fR||(fR={}));function Gbt(n,e,t,i,s,o){if(o!==0){const u=String(o);s.appendString('
    ');const r=n.length;let a=e,c=0;const l=[],d=[];let h=0");for(let u=0;u"),l[u]=c,d[u]=a;const f=h;h=u+1"),l[n.length]=c,d[n.length]=a,s.appendString("
    "),[l,d]}function qbt(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{Awe(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function Awe(n,e,t,i,s,o,r,a){if(i===o||(s=s||rfe(n,e,t[i],t[i+1]),r=r||rfe(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=rfe(n,e,t[c],t[c+1]);Awe(n,e,t,i,s,c,l,a),Awe(n,e,t,c,l,o,r,a)}function rfe(n,e,t,i){return n.setStart(e[t/fR.SPAN_MODULO_LIMIT|0].firstChild,t%fR.SPAN_MODULO_LIMIT),n.setEnd(e[i/fR.SPAN_MODULO_LIMIT|0].firstChild,i%fR.SPAN_MODULO_LIMIT),n.getClientRects()}class Qbt extends ${constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Zo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[mi.Eager]=!1,this._finishedInstantiation[mi.AfterFirstRender]=!1,this._finishedInstantiation[mi.BeforeFirstInteraction]=!1,this._finishedInstantiation[mi.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){bt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(mi.Eager),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.BeforeFirstInteraction)})),this._register(UB(gt(this._editor.getDomNode()),()=>{this._instantiateSome(mi.Eventually)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}set(e,t){this._instances.set(e,t)}onBeforeInteractionEvent(){this._instantiateSome(mi.BeforeFirstInteraction)}onAfterModelAttached(){return UB(gt(this._editor?.getDomNode()),()=>{this._instantiateSome(mi.AfterFirstRender)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==mi.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){bt(i)}}}}class oYe{constructor(e,t,i,s,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=s,this._precondition=o,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var qu;(function(n){n.EditorHintDecoration="squiggly-hint",n.EditorInfoDecoration="squiggly-info",n.EditorWarningDecoration="squiggly-warning",n.EditorErrorDecoration="squiggly-error",n.EditorUnnecessaryDecoration="squiggly-unnecessary",n.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",n.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(qu||(qu={}));var ps;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ps||(ps={}));var Do;(function(n){n[n.ColorMask=1]="ColorMask",n[n.ColorMaskInverse=254]="ColorMaskInverse",n[n.ColorOffset=0]="ColorOffset",n[n.IsVisitedMask=2]="IsVisitedMask",n[n.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",n[n.IsVisitedOffset=1]="IsVisitedOffset",n[n.IsForValidationMask=4]="IsForValidationMask",n[n.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",n[n.IsForValidationOffset=2]="IsForValidationOffset",n[n.StickinessMask=24]="StickinessMask",n[n.StickinessMaskInverse=231]="StickinessMaskInverse",n[n.StickinessOffset=3]="StickinessOffset",n[n.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",n[n.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",n[n.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",n[n.IsMarginMask=64]="IsMarginMask",n[n.IsMarginMaskInverse=191]="IsMarginMaskInverse",n[n.IsMarginOffset=6]="IsMarginOffset",n[n.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",n[n.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(Do||(Do={}));function Tg(n){return(n.metadata&Do.ColorMask)>>>Do.ColorOffset}function vr(n,e){n.metadata=n.metadata&Do.ColorMaskInverse|e<>>Do.IsVisitedOffset===1}function dr(n,e){n.metadata=n.metadata&Do.IsVisitedMaskInverse|(e?1:0)<>>Do.IsForValidationOffset===1}function HWe(n,e){n.metadata=n.metadata&Do.IsForValidationMaskInverse|(e?1:0)<>>Do.IsMarginOffset===1}function UWe(n,e){n.metadata=n.metadata&Do.IsMarginMaskInverse|(e?1:0)<>>Do.StickinessOffset}function VWe(n,e){n.metadata=n.metadata&Do.StickinessMaskInverse|e<>>Do.CollapseOnReplaceEditOffset===1}function zWe(n,e){n.metadata=n.metadata&Do.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===fb.ForceMove?!1:i===fb.ForceStay?!0:e}function Jbt(n,e,t,i,s){const o=jbt(n),r=o===gi.AlwaysGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,a=o===gi.NeverGrowsWhenTypingAtEdges||o===gi.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=n.start;let u=!1;const f=n.end;let p=!1;e<=h&&f<=t&&Kbt(n)&&(n.start=e,u=!0,n.end=e,p=!0);{const v=s?fb.ForceMove:c>0?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e,v)&&(u=!0),!p&&VO(f,a,e,v)&&(p=!0)}if(d>0&&!s){const v=c>l?fb.ForceStay:fb.MarkerDefined;!u&&VO(h,r,e+d,v)&&(u=!0),!p&&VO(f,a,e+d,v)&&(p=!0)}{const v=s?fb.ForceMove:fb.MarkerDefined;!u&&VO(h,r,t,v)&&(n.start=e+l,u=!0),!p&&VO(f,a,t,v)&&(n.end=e+l,p=!0)}const m=l-c;u||(n.start=Math.max(0,h+m)),p||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function Xbt(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==fn;){if(rh(i)){dr(i.left,!1),dr(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!rh(i.left)){if(o=s+i.maxEnd,ot){dr(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),dr(i,!0),i.right!==fn&&!rh(i.right)){s+=i.delta,i=i.right;continue}}return dr(n.root,!1),c}function Zbt(n,e,t,i){let s=n.root,o=0,r=0,a=0;const c=i-(t-e);for(;s!==fn;){if(rh(s)){dr(s.left,!1),dr(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),p1(s),s=s.parent;continue}if(!rh(s.left)){if(r=o+s.maxEnd,rt){s.start+=c,s.end+=c,s.delta+=c,(s.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),dr(s,!0);continue}if(dr(s,!0),s.right!==fn&&!rh(s.right)){o+=s.delta,s=s.right;continue}}dr(n.root,!1)}function eCt(n,e){let t=n.root;const i=[];let s=0;for(;t!==fn;){if(rh(t)){dr(t.left,!1),dr(t.right,!1),t=t.parent;continue}if(t.left!==fn&&!rh(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),dr(t,!0),t.right!==fn&&!rh(t.right)){t=t.right;continue}}return dr(n.root,!1),i}function tCt(n){let e=n.root;const t=[];let i=0;for(;e!==fn;){if(rh(e)){dr(e.left,!1),dr(e.right,!1),e=e.parent;continue}if(e.left!==fn&&!rh(e.left)){e=e.left;continue}if(e.right!==fn&&!rh(e.right)){e=e.right;continue}t[i++]=e,dr(e,!0)}return dr(n.root,!1),t}function $We(n,e,t,i,s){let o=n.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==fn;){if(rh(o)){dr(o.left,!1),dr(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==fn&&!rh(o.left)){o=o.left;continue}a=r+o.start,c=r+o.end,o.setCachedOffsets(a,c,i);let h=!0;if(e&&o.ownerId&&o.ownerId!==e&&(h=!1),t&&rYe(o)&&(h=!1),s&&!aYe(o)&&(h=!1),h&&(l[d++]=o),dr(o,!0),o.right!==fn&&!rh(o.right)){r+=o.delta,o=o.right;continue}}return dr(n.root,!1),l}function iCt(n,e,t,i,s,o,r){let a=n.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==fn;){if(rh(a)){dr(a.left,!1),dr(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!rh(a.left)){if(l=c+a.maxEnd,lt){dr(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,o);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),s&&rYe(a)&&(p=!1),r&&!aYe(a)&&(p=!1),p&&(u[f++]=a)}if(dr(a,!0),a.right!==fn&&!rh(a.right)){c+=a.delta,a=a.right;continue}}return dr(n.root,!1),u}function GWe(n,e){if(n.root===fn)return e.parent=fn,e.left=fn,e.right=fn,vr(e,ps.Black),n.root=e,n.root;nCt(n,e),ID(e.parent);let t=e;for(;t!==n.root&&Tg(t.parent)===ps.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,E$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),x$(n,t.parent.parent))}else{const i=t.parent.parent.left;Tg(i)===ps.Red?(vr(t.parent,ps.Black),vr(i,ps.Black),vr(t.parent.parent,ps.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,x$(n,t)),vr(t.parent,ps.Black),vr(t.parent.parent,ps.Red),E$(n,t.parent.parent))}return vr(n.root,ps.Black),e}function nCt(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(oCt(s,o,i.start+t,i.end+t)<0)if(i.left===fn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===fn){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=fn,e.right=fn,vr(e,ps.Red)}function qWe(n,e){let t,i;if(e.left===fn?(t=e.right,i=e,t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===fn?(t=e.left,i=e):(i=sCt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,vr(t,ps.Black),e.detach(),cfe(),p1(t),n.root.parent=fn;return}const s=Tg(i)===ps.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,vr(i,Tg(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==fn&&(i.left.parent=i),i.right!==fn&&(i.right.parent=i)),e.detach(),s){ID(t.parent),i!==e&&(ID(i),ID(i.parent)),cfe();return}ID(t),ID(t.parent),i!==e&&(ID(i),ID(i.parent));let o;for(;t!==n.root&&Tg(t)===ps.Black;)t===t.parent.left?(o=t.parent.right,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),E$(n,t.parent),o=t.parent.right),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.right)===ps.Black&&(vr(o.left,ps.Black),vr(o,ps.Red),x$(n,o),o=t.parent.right),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.right,ps.Black),E$(n,t.parent),t=n.root)):(o=t.parent.left,Tg(o)===ps.Red&&(vr(o,ps.Black),vr(t.parent,ps.Red),x$(n,t.parent),o=t.parent.left),Tg(o.left)===ps.Black&&Tg(o.right)===ps.Black?(vr(o,ps.Red),t=t.parent):(Tg(o.left)===ps.Black&&(vr(o.right,ps.Black),vr(o,ps.Red),E$(n,o),o=t.parent.left),vr(o,Tg(t.parent)),vr(t.parent,ps.Black),vr(o.left,ps.Black),x$(n,t.parent),t=n.root));vr(t,ps.Black),cfe()}function sCt(n){for(;n.left!==fn;)n=n.left;return n}function cfe(){fn.parent=fn,fn.delta=0,fn.start=0,fn.end=0}function E$(n,e){const t=e.right;t.delta+=e.delta,(t.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==fn&&(t.left.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,p1(e),p1(t)}function x$(n,e){const t=e.left;e.delta-=t.delta,(e.deltaDo.MAX_SAFE_DELTA)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==fn&&(t.right.parent=e),t.parent=e.parent,e.parent===fn?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,p1(e),p1(t)}function lYe(n){let e=n.end;if(n.left!==fn){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==fn){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function p1(n){n.maxEnd=lYe(n)}function ID(n){for(;n!==fn;){const e=lYe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function oCt(n,e,t,i){return n===t?e-i:n-t}var kE;(function(n){n[n.Unknown=0]="Unknown",n[n.Invalid=3]="Invalid",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(kE||(kE={}));function Gb(n){let e=0,t=0,i=0,s=kE.Unknown;for(let o=0,r=n.length;o=um&&(t=t-n%um),t}function dCt(n,e){return n.reduce((t,i)=>ta(t,e(i)),og)}function dYe(n,e){return n===e}function i7(n,e){const t=n,i=e;if(i-t<=0)return og;const o=Math.floor(t/um),r=Math.floor(i/um),a=i-r*um;if(o===r){const c=t-o*um;return cc(0,a-c)}else return cc(r-o,a)}function NW(n,e){return n=e}function t2(n){return cc(n.lineNumber-1,n.column-1)}function _M(n,e){const t=n,i=Math.floor(t/um),s=t-i*um,o=e,r=Math.floor(o/um),a=o-r*um;return new O(i+1,s+1,r+1,a+1)}function hCt(n){const e=xw(n);return cc(e.length-1,e[e.length-1].length)}const Hj=[],$m=class $m{static create(e,t){if(e<=128&&t.length===0){let i=$m.cache[e];return i||(i=new $m(e,t),$m.cache[e]=i),i}return new $m(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let s=i>>5;if(s===0){const r=1<>5;return s===0?(this.items&1<i===e)?.[0]}reverseLookupSet(e){const t=[];for(const[i]of this.items)e.has(i,this)&&t.push(i);return t}keys(){return this.items.keys()}}var lr;(function(n){n[n.Text=0]="Text",n[n.Bracket=1]="Bracket",n[n.Pair=2]="Pair",n[n.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",n[n.List=4]="List"})(lr||(lr={}));class GMe{get length(){return this._length}constructor(e){this._length=e}}class FW extends GMe{static create(e,t,i){let s=e.length;return t&&(s=ta(s,t.length)),i&&(s=ta(s,i.length)),new FW(s,e,t,i,t?t.missingOpeningBracketIds:np.getEmpty())}get kind(){return lr.Pair}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,s,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=s,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return FW.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new FW(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(ta(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class mw extends GMe{static create23(e,t,i,s=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=ta(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=ta(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return s?new uCt(o,e.listHeight+1,e,t,i,r):new n7(o,e.listHeight+1,e,t,i,r)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,s=e[0].missingOpeningBracketIds;for(let o=1;o{const s=O.lift(i.range);return new IE(t2(s.getStartPosition()),t2(s.getEndPosition()),hCt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${C_(this.startOffset)}...${C_(this.endOffset)}) -> ${C_(this.newLength)}`}}class pCt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>QMe.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:i7(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?cc(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):cc(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=C_(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?cc(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):cc(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdxthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=cCt(e,t,this.lineIdx,this.lineCharOffset);return new wk(s,Jg.Text,-1,np.getEmpty(),new AT(s))}}class _Ct{constructor(e,t){this.text=e,this._offset=og,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| +`,"gi"):null,o=[];let r,a=0,c=0,l=0,d=0;const h=[];for(let p=0;p<60;p++)h.push(new wk(cc(0,p),Jg.Text,-1,np.getEmpty(),new AT(cc(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new wk(cc(1,p),Jg.Text,-1,np.getEmpty(),new AT(cc(1,p))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const p=r.index,m=r[0];if(m===` +`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const w=p-l;if(wvCt(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===Jg.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function vCt(n){let e=Iu(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class gYe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=jMe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function wCt(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?fYe(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())YWe(i,s)<=YWe(s,r)?(i=lfe(i,s),s=r):s=lfe(s,r);return lfe(i,s)}function fYe(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function YWe(n,e){return Math.abs(n.listHeight-e.listHeight)}function lfe(n,e){return n.listHeight===e.listHeight?mw.create23(n,e,null,!1):n.listHeight>e.listHeight?bCt(n,e):CCt(e,n)}function bCt(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(n,s,null,!1):n}function CCt(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==lr.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=mw.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?mw.create23(s,n,null,!1):n}class yCt{constructor(e){this.lastOffset=og,this.nextNodes=[e],this.offsets=[og],this.idxs=[]}readLongestNodeAt(e,t){if(NW(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u5(this.nextNodes);if(!i)return;const s=u5(this.offsets);if(NW(e,s))return;if(NW(s,e))if(ta(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=dfe(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=dfe(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=u5(this.offsets),t=u5(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u5(this.nextNodes),s=dfe(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(ta(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function dfe(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u5(n){return n.length>0?n[n.length-1]:void 0}function Ewe(n,e,t,i){return new SCt(n,e,t,i).parseDocument()}let SCt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new yCt(i):void 0,this.positionMapper=new pCt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(np.getEmpty(),0);return e||(e=mw.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Jg.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===lr.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?wCt(i):fYe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!zZ(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!NW(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case Jg.ClosingBracket:return new fCt(i.bracketIds,i.length);case Jg.Text:return i.astNode;case Jg.OpeningBracket:{if(t>300)return new AT(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===Jg.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),FW.create(i.astNode,o,r.astNode)):FW.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var RI;(function(n){n[n.InProgress=1]="InProgress",n[n.Completed=2]="Completed"})(RI||(RI={}));function GZ(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new DS(JWe(n)),i=JWe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return s&&h.unshift(s),h}const d=[];for(;s&&!zZ(l);){const[h,u]=s.splitAt(l);d.push(h),l=i7(h.lengthAfter,l),s=u??t.dequeue()}return zZ(l)||d.push(new qk(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&dYe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new IE(u.startOffset,d,ta(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=og;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=dCt(d,f=>f.lengthBefore),u=ta(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=ta(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class qk{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=i7(e,this.lengthAfter);return dYe(t,og)?[this,void 0]:this.modified?[new qk(this.modified,this.lengthBefore,e),new qk(this.modified,og,t)]:[new qk(this.modified,e,e),new qk(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${C_(this.lengthBefore)} -> ${C_(this.lengthAfter)}`}}function JWe(n){const e=[];let t=og;for(const i of n){const s=i7(t,i.startOffset);zZ(s)||e.push(new qk(!1,s,s));const o=i7(i.startOffset,i.endOffset);e.push(new qk(!0,o,i.newLength)),t=i.endOffset}return e}class ACt extends ${didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new I,this.denseKeyProvider=new hYe,this.brackets=new gYe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===RI.Completed?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new _Ct(this.textModel.getValue(),i);this.initialAstWithoutTokens=Ewe(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===RI.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new IE(cc(i.fromLineNumber-1,0),cc(i.toLineNumber,0),cc(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=IE.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=GZ(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=GZ(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new uYe(this.textModel,this.brackets);return Ewe(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=cc(e.startLineNumber-1,e.startColumn-1),s=cc(e.endLineNumber-1,e.endColumn-1);return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;xwe(r,og,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=t2(e.getStartPosition()),s=t2(e.getEndPosition());return new oM(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new ECt(o,t,this.textModel);Dwe(r,og,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return mYe(t,og,t.length,t2(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pYe(t,og,t.length,t2(e))}}function pYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){const s=[];for(const o of n.children)t=ta(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(NW(r,i)){const c=pYe(n.children[o],r,a,i);if(c)return c}}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function mYe(n,e,t,i){if(n.kind===lr.List||n.kind===lr.Pair){for(const s of n.children){if(t=ta(e,s.length),NW(i,t)){const o=mYe(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===lr.UnexpectedClosingBracket)return null;if(n.kind===lr.Bracket){const s=_M(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function xwe(n,e,t,i,s,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case lr.List:{const h=n.childrenLength;for(let u=0;u200)return!0;let c=!0;if(n.kind===lr.Pair){let l=0;if(a){let u=a.get(n.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(n.openingBracket.text,u)}const d=ta(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new aCt(_M(e,t),_M(e,d),n.closingBracket?_M(ta(d,n.child?.length||og),t):void 0,r,l,n,h)),e=d,c&&n.child){const u=n.child;if(t=ta(e,u.length),PW(e,s)&&m3(t,i)&&(c=Dwe(u,e,t,i,s,o,r+1,a),!c))return!1}a?.set(n.openingBracket.text,l)}else{let l=e;for(const d of n.children){const h=l;if(l=ta(l,d.length),PW(h,s)&&PW(i,l)&&(c=Dwe(d,h,l,i,s,o,r,a),!c))return!1}}return c}class xCt extends ${get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Dn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{(!i.languageId||this.bracketPairsTree.value?.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Z;this.bracketPairsTree.value=DCt(e.add(new ACt(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||oM.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||oM.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||oM.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(O.fromPositions(t,t)).findLast(c=>r.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const c=a.textIsBracket[r];return c?Uj(this._findMatchingBracketUp(c,s,hfe(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(O.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(El(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,O.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=hfe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=s-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=s+1;l=c)break;if(EC(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!EC(s.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const h=Y_.findNextBracketInRange(a.forwardRegex,i,o,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof VA)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(c)).brackets;if(l&&!EC(s.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,s,l,c),u=Y_.findPrevBracketInRange(l.reversedRegex,i,o,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof VA?null:p}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof VA?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const f=Y_.findPrevBracketInRange(o,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const d=this.textModel.tokenization.getLineTokens(l),h=d.getCount(),u=this.textModel.getLineContent(l);let f=h-1,p=u.length,m=u.length;l===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let v=!0;for(;f>=0;f--){const w=d.getLanguageId(f)===s&&!EC(d.getStandardTokenType(f));if(w)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}v=w}if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return VA.INSTANCE;const p=Y_.findNextBracketInRange(o,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return p;u=p.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let p=0,m=0,v=0;d===t.lineNumber&&(p=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let w=!0;for(;p=1;r--){const a=this.textModel.tokenization.getLineTokens(r),c=a.getCount(),l=this.textModel.getLineContent(r);let d=c-1,h=l.length,u=l.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const p=a.getLanguageId(d);i!==p&&(i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(s&&o&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!s&&!EC(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&s&&f&&h!==u){const v=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&s&&f&&h!==u){const p=Y_.findPrevBracketInRange(s.reversedRegex,r,l,h,u);if(p)return this._toFoundBracket(o,p)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=t.lineNumber;a<=i;a++){const c=this.textModel.tokenization.getLineTokens(a),l=c.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=c.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const m=c.getLanguageId(h);s!==m&&(s=m,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const s=hfe(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,w=p?p.brackets.length:0;v{for(;;){if(s&&++l%100===0&&!s())return VA.INSTANCE;const b=Y_.findNextBracketInRange(f.forwardRegex,p,m,v,w);if(!b)break;const C=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),y=f.textIsBracket[C];if(y&&(y.isOpen(C)?a[y.index]++:y.isClose(C)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(b,y,!1,s);v=b.endColumn-1}return null};let h=null,u=null;for(let f=i.lineNumber;f<=o;f++){const p=this.textModel.tokenization.getLineTokens(f),m=p.getCount(),v=this.textModel.getLineContent(f);let w=0,b=0,C=0;if(f===i.lineNumber){w=p.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const S=p.getLanguageId(w);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let y=!0;for(;we?.dispose()}}function hfe(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}const wae=class wae{constructor(){this._searchCanceledBrand=void 0}};wae.INSTANCE=new wae;let VA=wae;function Uj(n){return n instanceof VA?null:n}class kCt extends ${constructor(e){super(),this.textModel=e,this.colorProvider=new _Ye,this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new O(1,1,this.textModel.getLineCount(),1),e,t):[]}}class _Ye{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Im((n,e)=>{const t=[zKe,$Ke,GKe,qKe,QKe,jKe],i=new _Ye;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(fwt)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var wd;(function(n){n[n.Resource=0]="Resource",n[n.Workspace=1]="Workspace"})(wd||(wd={}));class vYe{constructor(e,t){this.resource=e,this.elements=t}}const H2=class H2{constructor(){this.id=H2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};H2._ID=0,H2.None=new H2;let qZ=H2;const U2=class U2{constructor(){this.id=U2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};U2._ID=0,U2.None=new U2;let ET=U2;function Vj(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class $d{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Vj(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Vj(this.oldText)}")`:`(replace@${this.oldPosition} "${Vj(this.oldText)}" with "${Vj(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Wg(e,s,i),i+=4;for(let o=0;o0&&(this.changes=ICt(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Wg(e,t?t.length:0,i),i+=4,t)for(const s of t)Wg(e,s.selectionStartLineNumber,i),i+=4,Wg(e,s.selectionStartColumn,i),i+=4,Wg(e,s.positionLineNumber,i),i+=4,Wg(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Bg(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(P.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Vl}append(e,t,i,s,o){this._data instanceof Vl&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Vl&&(this._data=this._data.serialize())}open(){this._data instanceof Vl||(this._data=Vl.deserialize(this._data))}undo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(P.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Vl&&(this._data=this._data.serialize());const e=Vl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Vl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class TCt{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=wd.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=zO(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}setDelegate(e){this._delegate=e}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}getMissingModels(){const e=[];for(const t of this._editStackElementsArr)P.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=zO(e);return this._editStackElementsMap.has(t)}setModel(e){const t=zO(P.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=zO(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=zO(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=zO(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ui(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function kwe(n){return n.getEOL()===` +`?bu.LF:bu.CRLF}function zA(n){return n?n instanceof wYe||n instanceof TCt:!1}class KMe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);zA(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(zA(i)&&i.canAppend(this._model))return i;const s=new wYe(g(LCt,0,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],kwe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=KMe._computeCursorState(i,r),c=r.map((l,d)=>({index:d,textChange:l.textChange}));return c.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,c.map(l=>l.textChange),kwe(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return bt(i),null}}}class RCt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function MCt(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||c>0&&l>0)return;const d=Math.abs(a-l),h=Math.abs(r-c);if(d===0){s.spacesDiff=h,h>0&&0<=c-1&&c-10?s++:y>1&&o++,MCt(r,a,v,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const M=h.spacesDiff;M<=l&&d[M]++,r=v,a=C}let u=t;s!==o&&(u=s{const v=d[m];v>p&&(p=v,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}class Iwe{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Ii)return YMe(this.right);let e=this;for(;e.parent!==Ii&&e.parent.left!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}prev(){if(this.left!==Ii)return bYe(this.left);let e=this;for(;e.parent!==Ii&&e.parent.right!==e;)e=e.parent;return e.parent===Ii?Ii:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var ss;(function(n){n[n.Black=0]="Black",n[n.Red=1]="Red"})(ss||(ss={}));const Ii=new Iwe(null,ss.Black);Ii.parent=Ii;Ii.left=Ii;Ii.right=Ii;Ii.color=ss.Black;function YMe(n){for(;n.left!==Ii;)n=n.left;return n}function bYe(n){for(;n.right!==Ii;)n=n.right;return n}function JMe(n){return n===Ii?0:n.size_left+n.piece.length+JMe(n.right)}function XMe(n){return n===Ii?0:n.lf_left+n.piece.lineFeedCnt+XMe(n.right)}function ufe(){Ii.parent=Ii}function D$(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ii&&(t.left.parent=e),t.parent=e.parent,e.parent===Ii?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function k$(n,e){const t=e.left;e.left=t.right,t.right!==Ii&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ii?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function zj(n,e){let t,i;if(e.left===Ii?(i=e,t=i.right):e.right===Ii?(i=e,t=i.left):(i=YMe(e.right),t=i.right),i===n.root){n.root=t,t.color=ss.Black,e.detach(),ufe(),n.root.parent=Ii;return}const s=i.color===ss.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,_3(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,_3(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ii&&(i.left.parent=i),i.right!==Ii&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,_3(n,i)),e.detach(),t.parent.left===t){const r=JMe(t),a=XMe(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const c=r-t.parent.size_left,l=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,mA(n,t.parent,c,l)}}if(_3(n,t.parent),s){ufe();return}let o;for(;t!==n.root&&t.color===ss.Black;)t===t.parent.left?(o=t.parent.right,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,D$(n,t.parent),o=t.parent.right),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.right.color===ss.Black&&(o.left.color=ss.Black,o.color=ss.Red,k$(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=ss.Black,o.right.color=ss.Black,D$(n,t.parent),t=n.root)):(o=t.parent.left,o.color===ss.Red&&(o.color=ss.Black,t.parent.color=ss.Red,k$(n,t.parent),o=t.parent.left),o.left.color===ss.Black&&o.right.color===ss.Black?(o.color=ss.Red,t=t.parent):(o.left.color===ss.Black&&(o.right.color=ss.Black,o.color=ss.Red,D$(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=ss.Black,o.left.color=ss.Black,k$(n,t.parent),t=n.root));t.color=ss.Black,ufe()}function ZWe(n,e){for(_3(n,e);e!==n.root&&e.parent.color===ss.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,D$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,k$(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===ss.Red?(e.parent.color=ss.Black,t.color=ss.Black,e.parent.parent.color=ss.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,k$(n,e)),e.parent.color=ss.Black,e.parent.parent.color=ss.Red,D$(n,e.parent.parent))}n.root.color=ss.Black}function mA(n,e,t,i){for(;e!==n.root&&e!==Ii;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function _3(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=JMe(e.left)-e.size_left,i=XMe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const cA=65535;function CYe(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class NCt{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function yA(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new NCt(CYe(n),i,s,o,r);return n.length=0,a}class Ef{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class xT{constructor(e,t){this.buffer=e,this.lineStarts=t}}class FCt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ii&&e.iterate(e.root,i=>(i!==Ii&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class OCt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class BCt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new xT("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ii,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=yA(e[o].buffer));const a=new Ef(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new OCt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=cA,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,c=>{const l=this.getNodeContent(c),d=l.length;if(r<=i||r+d0){const c=o.replace(/\r\n|\r|\n/g,e);a.push(new xT(c,yA(c)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new FCt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,s=>{if(s===Ii)return!0;const o=this.getNodeContent(s),r=o.length,a=e.nodeAt(t),c=e.nodeAt(t+r),l=e.getValueInRange2(a,c);return t+=r,o===l})}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Ii;)if(s.left!==Ii&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Ii;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new oe(i+1,a+1)}return new oe(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ii){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new oe(i+1,r+1)}else t=t.right;return new oe(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,c=this._buffers[a.piece.bufferIndex].buffer,l=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return c.substring(l+e.remainder,l+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Ii;){const a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(c,c+t.remainder);break}else r+=a.substr(c,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Ii)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const c=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=l[d]+r.start.column;if(s&&(c.charCodeAt(u)===Q.LineFeed&&(u++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===Q.CarriageReturn?(s=!0,i+=c.substr(u,a-1)):i+=c.substr(u,a),!0;i+=this._EOLNormalized?c.substring(u,Math.max(u,l[d+1]-this._EOLLength)):c.substring(u,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fy+p,t.reset(0)):(b=u.buffer,C=y=>y,t.reset(p));do if(v=t.next(b),v){if(C(v.index)>=m)return d;this.positionInBuffer(e,C(v.index)-f,w);const y=this.getLineFeedCnt(e.piece.bufferIndex,o,w),S=w.line===o.line?w.column-o.column+s:w.column+1,M=S+v[0].length;if(h[d++]=wT(new O(i+y,S,i+y,M),v,c),C(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new $B(t.wordSeparators,t.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(l===null)return[];let d=this.positionInBuffer(c.node,c.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(c.node===l.node)return this.findMatchesInNode(c.node,a,e.startLineNumber,e.startColumn,d,h,t,i,s,r,o),o;let u=e.startLineNumber,f=c.node;for(;f!==l.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){const w=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),C=w[d.line+m],y=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,y,d,this.positionInBuffer(f,C-b),t,i,s,r,o),r>=s)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const w=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,w,e.endLineNumber,v,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,s),r>=s)return o;u++,c=this.nodeAt2(u,1),f=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(u===e.endLineNumber){const m=u===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,m,r,o,i,s),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,c,l){const d=e.wordSeparators;if(!c&&e.simpleSearch){const u=e.simpleSearch,f=u.length,p=i.length;let m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!d||mMe(d,i,p,m,f))&&(a[r++]=new z9(new O(s,m+1+o,s,m+1+f+o),null),r>=l))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=wT(new O(s,h.index+1+o,s,h.index+1+h[0].length+o),h,c),r>=l))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ii){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,c=a.bufferIndex,l=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new Ef(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(c,a.end)-this.offsetInBuffer(c,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const m={line:h.start.line+1,column:0};h=new Ef(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const m=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,m),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,l);else this.deleteNodeTail(s,l);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(s,h);let f=s;for(let p=0;p=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=u)l=h+1;else break;return i?(i.line=h,i.column=c-f,null):{line:h,column:c-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tcA){const d=[];for(;e.length>cA;){const u=e.charCodeAt(cA-1);let f;u===q.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,cA-1),e=e.substring(cA-1)):(f=e.substring(0,cA),e=e.substring(cA));const p=yA(f);d.push(new Ef(this._buffers.length,{line:0,column:0},{line:p.length-1,column:f.length-p[p.length-1]},p.length-1,f.length)),this._buffers.push(new xT(f,p))}const h=yA(e);return d.push(new Ef(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new xT(e,h)),d}let t=this._buffers[0].buffer.length;const i=yA(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+c,h+l-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=l.substring(d+c,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Ii;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(c,c+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Ii;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),c=this.getLineFeedCnt(i.bufferIndex,i.start,r),l=c-s,d=a-o,h=i.length+d;e.piece=new Ef(i.bufferIndex,i.start,r,c,h),mA(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),c=this.offsetInBuffer(i.bufferIndex,r),l=a-s,d=o-c,h=i.length+d;e.piece=new Ef(i.bufferIndex,r,i.end,a,h),mA(this,e,d,l)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,c=s.lineFeedCnt,l=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,l),h=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Ef(s.bufferIndex,s.start,l,d,h),mA(this,e,h-a,d-c);const u=new Ef(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=u)l=h+1;else break;return i?(i.line=h,i.column=c-f,null):{line:h,column:c-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tcA){const d=[];for(;e.length>cA;){const u=e.charCodeAt(cA-1);let f;u===Q.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,cA-1),e=e.substring(cA-1)):(f=e.substring(0,cA),e=e.substring(cA));const p=yA(f);d.push(new Ef(this._buffers.length,{line:0,column:0},{line:p.length-1,column:f.length-p[p.length-1]},p.length-1,f.length)),this._buffers.push(new xT(f,p))}const h=yA(e);return d.push(new Ef(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new xT(e,h)),d}let t=this._buffers[0].buffer.length;const i=yA(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+c,h+l-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const c=this.getAccumulatedValue(i,e-i.lf_left-2),l=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=l.substring(d+c,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Ii;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(c,c+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Ii;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),c=this.getLineFeedCnt(i.bufferIndex,i.start,r),l=c-s,d=a-o,h=i.length+d;e.piece=new Ef(i.bufferIndex,i.start,r,c,h),mA(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),c=this.offsetInBuffer(i.bufferIndex,r),l=a-s,d=o-c,h=i.length+d;e.piece=new Ef(i.bufferIndex,r,i.end,a,h),mA(this,e,d,l)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,c=s.lineFeedCnt,l=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,l),h=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Ef(s.bufferIndex,s.start,l,d,h),mA(this,e,h-a,d-c);const u=new Ef(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=yA(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Ii;)if(i.left!==Ii&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Ii;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Ii||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Ii||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ef(e.piece.bufferIndex,e.piece.start,o,a,r),mA(this,e,-1,-1),e.piece.length===0&&i.push(e);const c={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,c,t.piece.end);t.piece=new Ef(t.piece.bufferIndex,c,t.piece.end,d,l),mA(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r `);this.rbInsertRight(e,h[0]);for(let u=0;u0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=PCt(this._tmpLineStarts,e);this.chunks.push(new xT(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=DU(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=yQe(e)))}finish(e=!0){return this._finish(),new WCt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=yA(e.buffer);e.lineStarts=t,this._previousChar===q.CarriageReturn&&this.cr++}}}class HCt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),o=this._store.slice(e+t),r=UCt(i,this._default);this._store=s.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s>>1;if(t===0&&s[s.length-2]===i)return SA;const r=lh.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,c=s[r<<1];if(id&&(s[l++]=p,s[l++]=s[(f<<1)+1],d=p)}if(l===s.length)return e;const u=new Uint32Array(l);return u.set(s.subarray(0,l),0),u.buffer}static append(e,t){if(t===SA)return e;if(e===SA)return t;if(e===null)return e;if(t===null)return null;const i=aE(e),s=aE(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=lh.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Ih.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Ih.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i);return}this._tokens[s]=Ih.deleteEnding(this._tokens[s],e.column-1),this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new QZ(e,[t]))}finalize(){return this._tokens}serialize(){const e=this._serializeSize(),t=new Uint8Array(e);return this._serialize(t),t}_serializeSize(){let e=0;e+=4;for(let t=0;tt)break;const o=this._textModel.getLineContent(s.lineNumber),r=g5(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return Ar.Other;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=g5(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),c=new lh(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return Ar.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(s,0),d=g5(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new lh(d.tokens,c,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const c=this._textModel.getLineFirstNonWhitespaceColumn(a);if(c!==0&&c0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}acceptChanges(e){for(const t of e){const[i]=Gb(t.text);this.acceptChange(new bi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class GCt{constructor(){this._ranges=[]}getRanges(){return this._ranges}get min(){return this._ranges.length===0?null:this._ranges[0].start}removeMin(){if(this._ranges.length===0)return null;const e=this._ranges[0];return e.start+1===e.endExclusive?this._ranges.shift():this._ranges[0]=new hi(e.start+1,e.endExclusive),e.start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new hi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new hi(i.start,e):this._ranges.splice(t,1,new hi(i.start,e),new hi(e+1,i.endExclusive))}}addRange(e){hi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function g5(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){bt(a)}return r||(r=yMe(n.encodeLanguageId(e),o)),lh.convertToEndOffset(r.tokens,i.length),r}class qCt{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,PU(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new bi(e,t))}}class r7{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let s=null;if(t1&&(o=Xf.getLanguageId(s[1])!==e),!o)return SA}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=eHe(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Ih.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Ih.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Ih.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class ZMe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){s=s||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=Uq(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=ZMe._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let c=0;const l=[];let d=0,h=0;const u=(f,p)=>{f!==h&&(h=f,l[d++]=f,l[d++]=p)};for(let f=0;f>>0,b=~w>>>0;for(;ct)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class jZ extends eYe{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new ZMe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new I),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new I),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new I),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QCt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}_hasListeners(){return this._onDidChangeLanguage.hasListeners()||this._onDidChangeLanguageConfiguration.hasListeners()||this._onDidChangeTokens.hasListeners()}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=Gb(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):q.Null)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new cn("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=jZ._findLanguageBoundaries(s,o),c=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&r===t.column-1){const[l,d]=jZ._findLanguageBoundaries(s,o-1),h=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(l,d),l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new jCt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Rwe(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=lc.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return bt(a),[null,null]}return[o,r]},[i,s]=t();if(i&&s?this._tokenizer=new zCt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===RI.Completed)return;const r=RI.Completed;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&r>=c&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new qCt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new r7(this._languageIdCodec),this._debugBackgroundStates=new Rwe(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,s]=Gb(t.text);this._tokens.acceptEdit(t.range,i,s),this._debugBackgroundTokens?.acceptEdit(t.range,i,s)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=bi.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new Lwe,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(s)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new Lwe;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(s)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return Ar.Other;const s=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class jCt extends ${get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new yn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ls(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const pO=ae("undoRedoService");var $L;function hde(n){const e=new o7;return e.acceptChunk(n),e.finish()}function eNe(n){return new Promise((e,t)=>{const i=new o7;let s=!1;hO(n,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{s||(s=!0,t(o))},onEnd:()=>{s||(s=!0,e(i.finish()))}})})}function fQ(n){const e=new o7;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function Mwe(n,e){let t;return typeof n=="string"?t=hde(n):Yft(n)?t=fQ(n):t=n,t.create(e)}let $j=0;const KCt=999,YCt=1e4;class JCt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const f5=()=>{throw new Error("Invalid change accessor")};var Um;(function(n){n[n.Relaxed=0]="Relaxed",n[n.SurrogatePairs=1]="SurrogatePairs"})(Um||(Um={}));var yb;let QU=(yb=class extends ${static resolveOptions(e,t){if(t.detectIndentation){const i=XWe(e,t.tabSize,t.insertSpaces);return new YY({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new YY(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return pa(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new nyt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new I),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new I),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new I),this._eventEmitter=this._register(new syt),this._languageSelectionListener=this._register(new Dn),this._deltaDecorationCallCnt=0,this._attachedViews=new oyt,$j++,this.id="$model"+$j,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=P.parse("inmemory://model/"+$j):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Mwe(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=$L.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new xCt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new ebt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new kCt(this)),this._tokenizationTextModelPart=new jZ(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new O(1,1,h,this._buffer.getLineLength(h)+1),xo.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>$L.LARGE_FILE_SIZE_THRESHOLD||h>$L.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>$L.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>$L._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=SQe($j),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new tHe,this._commandManager=new KMe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new pR([],"",` +`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=PCt(this._tmpLineStarts,e);this.chunks.push(new xT(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=DU(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=yQe(e)))}finish(e=!0){return this._finish(),new WCt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=yA(e.buffer);e.lineStarts=t,this._previousChar===Q.CarriageReturn&&this.cr++}}}class HCt{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),o=this._store.slice(e+t),r=UCt(i,this._default);this._store=s.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s>>1;if(t===0&&s[s.length-2]===i)return SA;const r=lh.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,c=s[r<<1];if(id&&(s[l++]=p,s[l++]=s[(f<<1)+1],d=p)}if(l===s.length)return e;const u=new Uint32Array(l);return u.set(s.subarray(0,l),0),u.buffer}static append(e,t){if(t===SA)return e;if(e===SA)return t;if(e===null)return e;if(t===null)return null;const i=aE(e),s=aE(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=lh.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Ih.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Ih.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i);return}this._tokens[s]=Ih.deleteEnding(this._tokens[s],e.column-1),this._tokens[s]=Ih.insert(this._tokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new QZ(e,[t]))}finalize(){return this._tokens}serialize(){const e=this._serializeSize(),t=new Uint8Array(e);return this._serialize(t),t}_serializeSize(){let e=0;e+=4;for(let t=0;tt)break;const o=this._textModel.getLineContent(s.lineNumber),r=g5(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return Ar.Other;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=g5(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),c=new lh(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return Ar.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(s,0),d=g5(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new lh(d.tokens,c,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const c=this._textModel.getLineFirstNonWhitespaceColumn(a);if(c!==0&&c0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}acceptChanges(e){for(const t of e){const[i]=Gb(t.text);this.acceptChange(new bi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class GCt{constructor(){this._ranges=[]}getRanges(){return this._ranges}get min(){return this._ranges.length===0?null:this._ranges[0].start}removeMin(){if(this._ranges.length===0)return null;const e=this._ranges[0];return e.start+1===e.endExclusive?this._ranges.shift():this._ranges[0]=new hi(e.start+1,e.endExclusive),e.start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new hi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new hi(i.start,e):this._ranges.splice(t,1,new hi(i.start,e),new hi(e+1,i.endExclusive))}}addRange(e){hi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function g5(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){bt(a)}return r||(r=yMe(n.encodeLanguageId(e),o)),lh.convertToEndOffset(r.tokens,i.length),r}class qCt{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,PU(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new bi(e,t))}}class r7{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let s=null;if(t1&&(o=Xf.getLanguageId(s[1])!==e),!o)return SA}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=eHe(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Ih.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Ih.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Ih.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Ih.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class ZMe{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){s=s||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=Uq(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=ZMe._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let c=0;const l=[];let d=0,h=0;const u=(f,p)=>{f!==h&&(h=f,l[d++]=f,l[d++]=p)};for(let f=0;f>>0,b=~w>>>0;for(;ct)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class jZ extends eYe{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new ZMe(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new I),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new I),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new I),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QCt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}_hasListeners(){return this._onDidChangeLanguage.hasListeners()||this._onDidChangeLanguageConfiguration.hasListeners()||this._onDidChangeTokens.hasListeners()}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=Gb(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):Q.Null)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new cn("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=jZ._findLanguageBoundaries(s,o),c=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&r===t.column-1){const[l,d]=jZ._findLanguageBoundaries(s,o-1),h=a1(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(l,d),l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new jCt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Rwe(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=dc.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return bt(a),[null,null]}return[o,r]},[i,s]=t();if(i&&s?this._tokenizer=new zCt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===RI.Completed)return;const r=RI.Completed;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&r>=c&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new qCt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new r7(this._languageIdCodec),this._debugBackgroundStates=new Rwe(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,s]=Gb(t.text);this._tokens.acceptEdit(t.range,i,s),this._debugBackgroundTokens?.acceptEdit(t.range,i,s)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=bi.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new Lwe,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(s)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new Lwe;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(s)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return Ar.Other;const s=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class jCt extends ${get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new yn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ls(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const pO=ae("undoRedoService");var $L;function hde(n){const e=new o7;return e.acceptChunk(n),e.finish()}function eNe(n){return new Promise((e,t)=>{const i=new o7;let s=!1;hO(n,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{s||(s=!0,t(o))},onEnd:()=>{s||(s=!0,e(i.finish()))}})})}function fQ(n){const e=new o7;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function Mwe(n,e){let t;return typeof n=="string"?t=hde(n):Yft(n)?t=fQ(n):t=n,t.create(e)}let $j=0;const KCt=999,YCt=1e4;class JCt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const f5=()=>{throw new Error("Invalid change accessor")};var Um;(function(n){n[n.Relaxed=0]="Relaxed",n[n.SurrogatePairs=1]="SurrogatePairs"})(Um||(Um={}));var yb;let QU=(yb=class extends ${static resolveOptions(e,t){if(t.detectIndentation){const i=XWe(e,t.tabSize,t.insertSpaces);return new YY({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new YY(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return pa(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new nyt(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new I),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new I),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new I),this._eventEmitter=this._register(new syt),this._languageSelectionListener=this._register(new Dn),this._deltaDecorationCallCnt=0,this._attachedViews=new oyt,$j++,this.id="$model"+$j,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=P.parse("inmemory://model/"+$j):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Mwe(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=$L.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new xCt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new ebt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new kCt(this)),this._tokenizationTextModelPart=new jZ(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new O(1,1,h,this._buffer.getLineLength(h)+1),xo.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>$L.LARGE_FILE_SIZE_THRESHOLD||h>$L.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>$L.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>$L._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=SQe($j),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new tHe,this._commandManager=new KMe(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new pR([],"",` `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=$.None}_hasListeners(){return this._onWillDispose.hasListeners()||this._onDidChangeDecorations.hasListeners()||this._tokenizationTextModelPart._hasListeners()||this._onDidChangeOptions.hasListeners()||this._onDidChangeAttached.hasListeners()||this._onDidChangeInjectedText.hasListeners()||this._eventEmitter.hasListeners()}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}equalsTextBuffer(e){return this._assertNotDisposed(),this._buffer.equals(e)}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new mM(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Hi();const{textBuffer:t,disposable:i}=Mwe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new tHe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new MW([new Wbt],this._versionId,!1,!1),this._createContentChanged2(new O(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===bu.CRLF?`\r `:` `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new MW([new Vbt],this._versionId,!1,!1),this._createContentChanged2(new O(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=YCt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new YY({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const c=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(c),this._decorationProvider.handleDidChangeOptions(c),this._onDidChangeOptions.fire(c)}detectIndentation(e,t){this._assertNotDisposed();const i=XWe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),PMe(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(CQe.source,!1,!0,!1,null,!1,Zn.MAX_SAFE_SMALL_INTEGER);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,Um.Relaxed);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new cn("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new JCt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=xo.TextDefined){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new cn("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new cn("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` @@ -109,15 +109,15 @@ Received: '{1}'.`,e,e5.getLexeme(t)),o=t.offset,r=e5.getLexeme(t);return this._p `)<0){const l=new UA(e,i,s,o).parseSearchRequest();if(!l)return null;const d=this.getLineCount();let h=new O(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,l,r,1);return yj.findNextMatch(this,new UA(e,i,s,o),a,r),u.length>0||(h=new O(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,r,1),u.length>0)?u[0]:null}return yj.findNextMatch(this,new UA(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return yj.findPreviousMatch(this,new UA(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?bu.LF:bu.CRLF)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof qge?e:new qge(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,c=e.length;al.endLineNumber,m=l.startLineNumber>f.endLineNumber;if(!p&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,c=this._trimAutoWhitespaceLines.length;ap.endLineNumber)&&!(l===p.startLineNumber&&p.startColumn===d&&p.isEmpty()&&m&&m.length>0&&m.charAt(0)===` `)&&!(l===p.startLineNumber&&p.startColumn===1&&p.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` -`)){h=!1;break}}if(h){const u=new O(l,1,l,d);t.push(new qge(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;N--){const z=f+N,U=C+N;F.takeFromEndWhile(j=>j.lineNumber>U);const J=F.takeFromEndWhile(j=>j.lineNumber===U);a.push(new WWe(z,this.getLineContent(U),J))}if(wQe.lineNumberQe.lineNumber===De)}a.push(new Ubt(z+1,f+v,re,j))}c+=b}this._emitContentChangedEvent(new MW(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new WWe(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new sYe(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,nHe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){bt(o)}return i.addDecoration=f5,i.changeDecoration=f5,i.changeDecorationOptions=f5,i.removeDecoration=f5,i.deltaDecorations=f5,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),bt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:iHe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(iHe[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),c=Math.min(r,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new O(a,1,c,l),h=this._getDecorationsInRange(d,i,s,o);return h_e(h,this._decorationProvider.getDecorationsInRange(d,i,s)),h}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return h_e(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return iw.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(i.options.before||t.before){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}const r=s!==o,a=ZCt(t)!==oJ(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const c=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(c);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return XCt(this.getLineContent(e))+1}},$L=yb,yb._MODEL_SYNC_LIMIT=50*1024*1024,yb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,yb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,yb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,yb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ph.tabSize,indentSize:Ph.indentSize,insertSpaces:Ph.insertSpaces,detectIndentation:!1,defaultEOL:zb.LF,trimAutoWhitespace:Ph.trimAutoWhitespace,largeFileOptimizations:Ph.largeFileOptimizations,bracketPairColorizationOptions:Ph.bracketPairColorizationOptions},yb);QU=$L=D([_(4,pO),_(5,Di),_(6,lo)],QU);function XCt(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function gfe(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function ZCt(n){return!!n.after||!!n.before}function oJ(n){return!!n.options.after||!!n.options.before}class tHe{constructor(){this._decorationsTree0=new afe,this._decorationsTree1=new afe,this._injectedTextDecorationsTree=new afe}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),c=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){oJ(e)?this._injectedTextDecorationsTree.insert(e):gfe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){oJ(e)?this._injectedTextDecorationsTree.delete(e):gfe(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){oJ(e)?this._injectedTextDecorationsTree.resolveNode(e,t):gfe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function _C(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class yYe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class eyt extends yYe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:oh.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class tyt{constructor(e){this.position=e?.position??FS.Center,this.persistLane=e?.persistLane}}class iyt extends yYe{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?fe.fromHex(e):t.getColor(e.id)}}class m1{static from(e){return e instanceof m1?e:new m1(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class jt{static register(e){return new jt(e)}static createDynamic(e){return new jt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?_C(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||gi.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?_C(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new eyt(e.overviewRuler):null,this.minimap=e.minimap?new iyt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new tyt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?_C(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?_C(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?_C(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Llt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?_C(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?_C(e.marginClassName):null,this.inlineClassName=e.inlineClassName?_C(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?_C(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?_C(e.afterContentClassName):null,this.after=e.after?m1.from(e.after):null,this.before=e.before?m1.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}jt.EMPTY=jt.register({description:"empty"});const iHe=[jt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),jt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:gi.NeverGrowsWhenTypingAtEdges}),jt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:gi.GrowsOnlyWhenTypingBefore}),jt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:gi.GrowsOnlyWhenTypingAfter})];function nHe(n){return n instanceof jt?n:jt.createDynamic(n)}class nyt extends ${constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new I),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}hasListeners(){return this._actual.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class syt extends ${constructor(){super(),this._fastEmitter=this._register(new I),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new I),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}hasListeners(){return this._fastEmitter.hasListeners()||this._slowEmitter.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class oyt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new ryt(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class ryt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new bi(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class tNe{static create(e){return new tNe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new ayt(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],c=[];return{addRequest:(l,d,h)=>{r.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=r.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?fu.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let Nwe=[],Pwe=[];function cyt(n,e,t,i,s,o,r,a){if(s===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=SYe(t,i,s,o,r),f=s-u,p=Nwe,m=Pwe;let v=0,w=0,b=0,C=s;const y=d.length;let S=0;if(S>=0){let M=Math.abs(h[S]-C);for(;S+1=M)break;M=k,S++}}for(;SM&&(M=w,k=b);let F=0,N=0,z=0,U=0;if(k<=C){let j=k,re=M===0?q.Null:t.charCodeAt(M-1),me=M===0?fu.NONE:n.get(re),De=!0;for(let Qe=M;Qew&&Fwe(re,me,Oe,wt,l)&&(F=Tt,N=j),j+=Nt,j>C){Tt>w?(z=Tt,U=j-Nt):(z=Qe+1,U=j),j-N>f&&(F=0),De=!1;break}re=Oe,me=wt}if(De){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(F===0){let j=k,re=t.charCodeAt(M),me=n.get(re),De=!1;for(let Qe=M-1;Qe>=w;Qe--){const Tt=Qe+1,Oe=t.charCodeAt(Qe);if(Oe===q.Tab){De=!0;break}let wt,Nt;if(sF(Oe)?(Qe--,wt=fu.NONE,Nt=2):(wt=n.get(Oe),Nt=c1(Oe)?o:1),j<=C){if(z===0&&(z=Tt,U=j),j<=C-f)break;if(Fwe(Oe,wt,re,me,l)){F=Tt,N=j;break}}j-=Nt,re=Oe,me=wt}if(F!==0){const Qe=f-(U-N);if(Qe<=i){const Tt=t.charCodeAt(z);let Oe;wl(Tt)?Oe=2:Oe=I$(Tt,U,i,o),Qe-Oe<0&&(F=0)}}if(De){S--;continue}}if(F===0&&(F=z,N=U),F<=w){const j=t.charCodeAt(w);wl(j)?(F=w+2,N=b+2):(F=w+1,N=b+I$(j,b,i,o))}for(w=F,p[v]=F,b=N,m[v]=N,v++,C=N+f;S<0||S=J)break;J=j,S++}}return v===0?null:(p.length=v,m.length=v,Nwe=e.breakOffsets,Pwe=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function lyt(n,e,t,i,s,o,r,a){const c=iw.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(N=>N.options),d=t.map(N=>N.column-1)):(l=null,d=null),s===-1)return l?new A$(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new A$(d,l,[c.length],[],0):null;const u=a==="keepAll",f=SYe(c,i,s,o,r),p=s-f,m=[],v=[];let w=0,b=0,C=0,y=s,S=c.charCodeAt(0),M=n.get(S),k=I$(S,0,i,o),F=1;wl(S)&&(k+=1,S=c.charCodeAt(1),M=n.get(S),F++);for(let N=F;Ny&&((b===0||k-C>p)&&(b=z,C=k-j),m[w]=b,v[w]=C,w++,y=C+p,b=0),S=U,M=J}return w===0&&(!t||t.length===0)?null:(m[w]=h,v[w]=k,new A$(d,l,m,v,f))}function I$(n,e,t,i){return n===q.Tab?t-e%t:c1(n)||n<32?i:1}function sHe(n,e){return e-n%e}function Fwe(n,e,t,i,s){return t!==q.Space&&(e===fu.BREAK_AFTER&&i!==fu.BREAK_AFTER||e!==fu.BREAK_BEFORE&&i===fu.BREAK_BEFORE||!s&&e===fu.BREAK_IDEOGRAPHIC&&i!==fu.BREAK_AFTER||!s&&i===fu.BREAK_IDEOGRAPHIC&&e!==fu.BREAK_BEFORE)}function SYe(n,e,t,i,s){let o=0;if(s!==Vg.None){const r=Eu(n);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class KZ{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0),new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,gi.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,gi.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new zn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?mt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):mt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,jo.None)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,jo.None),a=this._validatePositionWithCache(e,s,i,r),c=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(c)?t:new bd(O.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=KZ._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new bd(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bd(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bd(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new O(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bd(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class oHe{constructor(e){this.context=e,this.cursors=[new KZ(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return kct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return Dct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(zn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,O.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class rHe{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class dyt extends ${constructor(){super(),this._onEvent=this._register(new I),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class hyt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var Ha;(function(n){n[n.ContentSizeChanged=0]="ContentSizeChanged",n[n.FocusChanged=1]="FocusChanged",n[n.ScrollChanged=2]="ScrollChanged",n[n.ViewZonesChanged=3]="ViewZonesChanged",n[n.HiddenAreasChanged=4]="HiddenAreasChanged",n[n.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",n[n.CursorStateChanged=6]="CursorStateChanged",n[n.ModelDecorationsChanged=7]="ModelDecorationsChanged",n[n.ModelLanguageChanged=8]="ModelLanguageChanged",n[n.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",n[n.ModelContentChanged=10]="ModelContentChanged",n[n.ModelOptionsChanged=11]="ModelOptionsChanged",n[n.ModelTokensChanged=12]="ModelTokensChanged"})(Ha||(Ha={}));class iNe{constructor(e,t,i,s){this.kind=Ha.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new iNe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class nNe{constructor(e,t){this.kind=Ha.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new nNe(this.oldHasFocus,e.hasFocus)}}class sNe{constructor(e,t,i,s,o,r,a,c){this.kind=Ha.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new sNe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class uyt{constructor(){this.kind=Ha.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class gyt{constructor(){this.kind=Ha.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class YZ{constructor(e,t,i,s,o,r,a){this.kind=Ha.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=L$.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=O.fromPositions(a[0],a[0]),e.emitViewEvent(new v$(t,i,c,l,s,o,r))}revealPrimary(e,t,i,s,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new v$(t,i,null,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=zn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Wi.Undo:i.isRedoing?Wi.Redo:Wi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,Ns.Simple,!0,vt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Wi.RecoverFromMarkers,zn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}getPosition(){return this._cursors.getPrimaryCursor().modelState.position}setSelections(e,t,i,s){this.setStates(e,t,s,zn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=L$.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new q_t(c,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(s.cursorState[d].modelState))){const l=s?s.cursorState.map(h=>h.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new YZ(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const l=c[0].open,d=o.text.length-r[2].length-1,h=o.text.lastIndexOf(l,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],c=this._model.pushEditOperations(this.getSelections(),i,l=>{if(o)for(let h=0,u=o.length;h0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=Wi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=L$.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){bt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealAll(t,i,!1,Ns.Simple,!0,vt.Smooth)}getAutoClosedCharacters(){return aHe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new T$(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Zr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o{const l=c.getPosition();return new mt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Wi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(Zr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(Zr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,Wi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(lF.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Lg(Cr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Lg(Cr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class L${static from(e,t){return new L$(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class yyt{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,l=>{const d=[];for(let f=0;ff.identifier.minor-p.identifier.minor,u=[];for(let f=0;f0?(d[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:p=>{const m=parseInt(p,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===Cv.LTR?new mt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new mt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);const c=[];for(const l in o)o.hasOwnProperty(l)&&c.push(parseInt(l,10));c.sort((l,d)=>d-l);for(const l of c)a.splice(l,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{O.isEmpty(h)&&u===""||s.push({identifier:{major:t,minor:o++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{const f=mt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter;else{const w=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===w?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter}else p=gi.NeverGrowsWhenTypingAtEdges;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,p);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return bt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-O.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Syt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class T${static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new Syt(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=T$._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=T$._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oG9,tokenizeEncoded:(n,e,t)=>yMe(lM.Null,t)};async function Ayt(n,e,t){if(!t)return lHe(e,n.languageIdCodec,cHe);const i=await lc.getOrCreate(t);return lHe(e,n.languageIdCodec,i||cHe)}function Eyt(n,e,t,i,s,o,r){let a="
    ",c=i,l=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(p+=" ",d=!1):(p+=" ",d=!0),v--;break}case q.LessThan:p+="<",d=!1;break;case q.GreaterThan:p+=">",d=!1;break;case q.Ampersand:p+="&",d=!1;break;case q.Null:p+="�",d=!1;break;case q.UTF8_BOM:case q.LINE_SEPARATOR:case q.PARAGRAPH_SEPARATOR:case q.NEXT_LINE:p+="�",d=!1;break;case q.CarriageReturn:p+="​",d=!1;break;case q.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>s||c>=s)break}return a+="
    ",a}function lHe(n,e,t){let i='
    ';const s=xw(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
    ");const l=t.tokenizeEncoded(c,!0,o);lh.convertToEndOffset(l.tokens,c.length);const h=new lh(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${rM(c.substring(u,v))}`,u=v}o=l.endState}return i+="
    ",i}class xyt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class Dyt{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}var r0;let kyt=(r0=class{constructor(e,t,i,s){this._instanceId=SQe(++r0.INSTANCE_COUNT),this._pendingChanges=new xyt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Dyt(c,s,o,r,a)),c},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of t)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of i){const l=this._findWhitespaceIndex(c.id);l!==-1&&this._removeWhitespace(l)}return}const s=new Set;for(const c of i)s.add(c.id);const o=new Map;for(const c of t)o.set(c.id,c);const r=c=>{const l=[];for(const d of c)if(!s.has(d.id)){if(o.has(d.id)){const h=o.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}l.push(d)}return l},a=r(this._arr).concat(r(e));a.sort((c,l)=>c.afterLineNumber===l.afterLineNumber?c.ordinal-l.ordinal:c.afterLineNumber-l.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=r0.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}hasWhitespace(){return this._checkPendingChanges(),this.getWhitespacesCount()>0}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const c=this.getWhitespacesCount()|0;let l,d;a===-1?(a=c,d=r+1,l=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);let h=o,u=h;const f=5e5;let p=0;o>=f&&(p=Math.floor(o/f)*f,p=Math.floor(p/i)*i,u-=p);const m=[],v=e+(t-e)/2;let w=-1;for(let S=s;S<=r;S++){if(w===-1){const M=h,k=h+i;(M<=v&&vv)&&(w=S)}for(h+=i,m[S-s]=u,u+=i;d===S;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=S;break}}w===-1&&(w=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=s,y=r;return Ct&&y--,{bigNumbersDelta:p,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:w,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:y,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+c)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}},r0.INSTANCE_COUNT=0,r0);const Iyt=125;class v3{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Lyt extends ${constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new v3(0,0,0,0),this._scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new iNe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class Tyt extends ${constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(x.layoutInfo),r=s.get(x.padding);this._linesLayout=new kyt(t,s.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Lyt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new v3(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(x.smoothScrolling)?Iyt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(x.lineHeight)&&this._linesLayout.setLineHeight(t.get(x.lineHeight)),e.hasChanged(x.padding)){const i=t.get(x.padding);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(x.layoutInfo)){const i=t.get(x.layoutInfo),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new v3(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(x.smoothScrolling)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(x.scrollbar);return s.horizontal===zo.Hidden||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-s.get(x.lineHeight)-s.get(x.padding).bottom):s.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new v3(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),s=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new v3(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===vt.Immediate?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Ryt{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.startLineNumber,1),jo.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),jo.Right);r=new O(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,jo.Right);i=new cKe(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new O(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,aZ(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let c=0;const l=[];for(let d=o;d<=r;d++)l[d-o]=[];for(let d=0,h=s.length;dt===Ar.Comment)}function aNe(n,e){return AYe(n,e.range,t=>t===Ar.String)}function AYe(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function ffe(n,e){return n===null?e?JZ.INSTANCE:XZ.INSTANCE:new Myt(n,e)}class Myt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((l,d)=>new iw(0,0,l+1,this._projectionData.injectionOptions[d],0));r=iw.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=dHe(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const c=this._projectionData,l=c.injectionOffsets,d=c.injectionOptions;let h=null;if(l){h=[];let f=0,p=0;for(let m=0;m0?c.breakOffsets[m-1]:0,b=c.breakOffsets[m];for(;pb)break;if(w0?c.wrappedTextIndentLength:0,F=k+Math.max(y-w,0),N=k+Math.min(S-w,b-w);F!==N&&v.push(new $pt(F,N,M.inlineClassName,M.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=C,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:lh.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=dHe(s.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=pfe.length)for(let e=1;e<=n;e++)pfe[e]=Nyt(e);return pfe[n]}function Nyt(n){return new Array(n+1).join(" ")}class Pyt{constructor(e,t,i,s,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=c,this.wrappingIndent=l,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new Oyt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new DS(iw.fromDecorations(s));for(let m=0;mw.lineNumber===m+1);r.addRequest(i[m],v,t?t[m]:null)}const c=r.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(O.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,b=ffe(c[m],!w);l[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new $ft(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=Fyt(t),s=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(O.compareRangesUsingStarts);if(i.length===s.length){let u=!1;for(let f=0;f({range:u,options:jt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,c=0,l=-1,d=l+1=a&&f<=c?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),p=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),p=!0)),p){const m=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&c&&l&&d)return!1;const h=r&&a&&!c&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let u=null;if(h){u=[];for(let f=0,p=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const c=[],l=[];for(let d=0,h=s.length;dc?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+c-1,p=h+1,m=p+(o-c)-1,l=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),c=this.convertModelPositionToViewPosition(a.startLineNumber,1),l=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:l.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new hHe(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=s.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===s.modelLineNumber?s.modelLineWrappedLineIdx+1:l.getViewLineCount();for(let u=d;u{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new gR(f.visibleColumn,p,f.className,new C$(f.horizontalLine.top,m.column),-1,-1):v.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=s.lineNumber-1;let d=null;for(let p=c;p<=l;p++){const m=this.modelLineProjections[p];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,p===c?i.column:1),w=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),b=w-v+1;let C=DT.BlockNone;b>1&&m.getViewLineMinColumn(this.model,p+1,w)===1&&(C=v===0?DT.BlockSubsequent:DT.BlockAll),r.push(b),a.push(C),d===null&&(d=new oe(p+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,p)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let f=0;for(let p=0,m=o.length;pt&&(p=!0,f=t-o+1),h.getViewLinesData(this.model,l+1,u,f,o-e,i,c),o+=f,p)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],c=a.getViewLineMinColumn(this.model,o+1,r),l=a.getViewLineMaxColumn(this.model,o+1,r);tl&&(t=l);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new oe(o+1,d)).equals(i)?new oe(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new O(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new O(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=jo.None,s=!1,o=!1){const r=this.model.validatePosition(new oe(e,t)),a=r.lineNumber,c=r.column;let l=a-1,d=!1;if(o)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(l===0&&!this.modelLineProjections[l].isVisible())return new oe(s?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let u;return d?o?u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,c,i),u}convertModelRangeToViewRange(e,t=jo.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return O.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,jo.Right),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,jo.Left);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new O(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let c=[];const l=r.lineNumber-1,d=a.lineNumber-1;let h=null;for(let m=l;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new oe(m+1,m===l?r.column:1));else if(h!==null){const w=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,m,w),t,i,s)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,a.lineNumber,a.column),t,i,s)),h=null),c.sort((m,v)=>{const w=O.compareRangesUsingStarts(m.range,v.range);return w===0?m.idv.id?1:0:w});const u=[];let f=0,p=null;for(const m of c){const v=m.id;p!==v&&(p=v,u[f++]=m)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Fyt(n){if(n.length===0)return[];const e=n.slice();e.sort(O.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new O(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new O(i,1,s,1)),t}class hHe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class uHe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Oyt{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}var DT;(function(n){n[n.BlockNone=0]="BlockNone",n[n.BlockSubsequent=1]="BlockSubsequent",n[n.BlockAll=2]="BlockAll"})(DT||(DT={}));class Byt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Wyt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new owe(t,i)}onModelLinesInserted(e,t,i,s){return new rwe(t,i)}onModelLineChanged(e,t,i){return[!1,new DKe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}modelRangeIsVisible(e){const t=this._lines.model.getLineCount();return!(e.startLineNumber<1||e.startLineNumber>t||e.endLineNumber<1||e.endLineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const bL=FS.Right;class Hyt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*bL/8))}reset(e){const t=Math.ceil((e+1)*bL/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=cNe.create(this.model),this.glyphLanes=new Hyt(0),this.model.isTooLargeForTokenization())this._lines=new Byt(this.model);else{const d=this._configuration.options,h=d.get(x.fontInfo),u=d.get(x.wrappingStrategy),f=d.get(x.wrappingInfo),p=d.get(x.wrappingIndent),m=d.get(x.wordBreak);this._lines=new Pyt(this._editorId,this.model,s,o,h,this.model.getOptions().tabSize,u,f.wrappingColumn,p,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Cyt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Tyt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new K_t(d)),this._eventDispatcher.emitOutgoingEvent(new sNe(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new Ryt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const h=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(h,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(HZ.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new X_t)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Y_t(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new O(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Q_t(e)),this._eventDispatcher.emitOutgoingEvent(new nNe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new z_t)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new $_t)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new oe(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new fHe(t,this._viewportStart.startLineDelta)}return new fHe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(x.fontInfo),r=s.get(x.wrappingStrategy),a=s.get(x.wrappingInfo),c=s.get(x.wrappingIndent),l=s.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new kj),e.emitViewEvent(new Ij),e.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(x.readOnly)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),e.emitViewEvent(new G_t(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),HO.shouldRecreate(t)&&(this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof mM?e.rawContentChangedEvent.changes:e.changes,a=e instanceof mM?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Yp.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Yp.LineChanged:{let u=null;h.injectedText&&(u=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),c.addRequest(h.detail,u,null);break}}const l=c.finalize(),d=new DS(l);for(const h of r)switch(h.changeType){case Yp.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new kj),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case Yp.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),s=!0;break}case Yp.LinesInserted:{const u=d.takeCount(h.detail.length),f=this._lines.onModelLinesInserted(a,h.fromLineNumber,h.toLineNumber,u);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case Yp.LineChanged:{const u=d.dequeue(),[f,p,m,v]=this._lines.onModelLineChanged(a,h.lineNumber,u);o=f,p&&i.emitViewEvent(p),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new Ij),i.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},vt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof mM&&i.emitOutgoingEvent(new vyt(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new j_t),this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new _yt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new myt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new kj),t.emitViewEvent(new Ij),t.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new wyt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vL(e)),this._eventDispatcher.emitOutgoingEvent(new pyt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new kj),r.emitViewEvent(new Ij),r.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=s.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new gyt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(x.layoutInfo),t=this._configuration.options.get(x.lineHeight),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new O(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const c=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;dc||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Eu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zv(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Sm(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new zpt(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,aZ(this._configuration.options)),i=new Vyt;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const c=r.getColor(e.value),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(c,o.zIndex,l,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),s=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(s)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(O.compareRangesUsingStarts);let o=!1,r=!1;for(const c of e)c.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const c=e.map(d=>d.startLineNumber);let l="";for(let d=0;d0&&c[d-1]===c[d]||(l+=this.model.getLineContent(c[d])+s);return l}if(o&&t){const c=[];let l=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==l&&c.push(this.model.getLineContent(h)):c.push(this.model.getValueInRange(d,i?xo.CRLF:xo.TextDefined)),l=h}return c.length===1?c[0]:c}const a=[];for(const c of e)c.isEmpty()||a.push(this.model.getValueInRange(c,i?xo.CRLF:xo.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Kc||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new O(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(x.fontInfo),r=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Gh.fontFamily;let l;return c?l=Gh.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${Gh.fontFamily}`),{mode:i,html:`
    `+this._getHTMLToCopy(s,r)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=o;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?s-1:0,f=l===o?r-1:h.length;h===""?c+="
    ":c+=Eyt(h,d.inflate(),t,u,f,a,Is)}return c}_getColorMap(){const e=lc.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=Wi.NotSet){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new fyt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealAll(s,e,i,Ns.Simple,t,vt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,Ns.Simple,t,vt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new v$(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Z_t),this._eventDispatcher.emitOutgoingEvent(new uyt))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class cNe{static create(e){const t=e._setTrackedRange(null,new O(1,1,1,1),gi.NeverGrowsWhenTypingAtEdges);return new cNe(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,gi.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new O(i.lineNumber,i.column,i.lineNumber,i.column),gi.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class Vyt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,c=a[a.length-3],l=a[a.length-1];if(c===o&&l+1>=i){s>l&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new q9(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class zyt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&gHe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>$yt(t,i),[]);return gHe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function $yt(n,e){const t=[];let i=0,s=0;for(;i{this._onDidChangeConfiguration.fire(v);const w=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const b=w.get(x.layoutInfo);this._onDidLayoutChange.fire(b)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new Kyt(this,this._contextKeyService)),this._register(new Yyt(this,this._contextKeyService,u)),this._instantiationService=this._register(s.createChild(new Dl([Pe,this._contextKeyService]))),this._modelData=null,this._focusTracker=new Jyt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=b_.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of b_.getEditorActions()){if(this._actions.has(v.id)){bt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const w=new oYe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,b=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,this,b))),this._contextKeyService);this._actions.set(w.id,w)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new yZ(this._domElement,{onDragOver:v=>{if(!m())return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this.showDropIndicatorAt(w.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this._onDropIntoEditor.fire({position:w.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,s,o){return new Xve(e,t,i,s,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return mz.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Es.getWordAtPosition(this._modelData.model,this._configuration.options.get(x.wordSeparators),this._configuration.options.get(x.wordSegmenterLocales),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=xo.TextDefined;return e&&e.lineEnding&&e.lineEnding===` +`)){h=!1;break}}if(h){const u=new O(l,1,l,d);t.push(new qge(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new O(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;N--){const z=f+N,U=C+N;F.takeFromEndWhile(j=>j.lineNumber>U);const J=F.takeFromEndWhile(j=>j.lineNumber===U);a.push(new WWe(z,this.getLineContent(U),J))}if(wQe.lineNumberQe.lineNumber===De)}a.push(new Ubt(z+1,f+v,re,j))}c+=b}this._emitContentChangedEvent(new MW(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new WWe(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new sYe(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,nHe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){bt(o)}return i.addDecoration=f5,i.changeDecoration=f5,i.changeDecorationOptions=f5,i.removeDecoration=f5,i.deltaDecorations=f5,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),bt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:iHe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(iHe[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),c=Math.min(r,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new O(a,1,c,l),h=this._getDecorationsInRange(d,i,s,o);return h_e(h,this._decorationProvider.getDecorationsInRange(d,i,s)),h}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return h_e(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return iw.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(i.options.before||t.before){const c=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}const r=s!==o,a=ZCt(t)!==oJ(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const c=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(c);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return XCt(this.getLineContent(e))+1}},$L=yb,yb._MODEL_SYNC_LIMIT=50*1024*1024,yb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,yb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,yb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,yb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ph.tabSize,indentSize:Ph.indentSize,insertSpaces:Ph.insertSpaces,detectIndentation:!1,defaultEOL:zb.LF,trimAutoWhitespace:Ph.trimAutoWhitespace,largeFileOptimizations:Ph.largeFileOptimizations,bracketPairColorizationOptions:Ph.bracketPairColorizationOptions},yb);QU=$L=D([_(4,pO),_(5,Di),_(6,lo)],QU);function XCt(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function gfe(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function ZCt(n){return!!n.after||!!n.before}function oJ(n){return!!n.options.after||!!n.options.before}class tHe{constructor(){this._decorationsTree0=new afe,this._decorationsTree1=new afe,this._injectedTextDecorationsTree=new afe}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),c=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){oJ(e)?this._injectedTextDecorationsTree.insert(e):gfe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){oJ(e)?this._injectedTextDecorationsTree.delete(e):gfe(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){oJ(e)?this._injectedTextDecorationsTree.resolveNode(e,t):gfe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function _C(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class yYe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class eyt extends yYe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:oh.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class tyt{constructor(e){this.position=e?.position??FS.Center,this.persistLane=e?.persistLane}}class iyt extends yYe{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?fe.fromHex(e):t.getColor(e.id)}}class m1{static from(e){return e instanceof m1?e:new m1(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Kt{static register(e){return new Kt(e)}static createDynamic(e){return new Kt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?_C(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||gi.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?_C(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new eyt(e.overviewRuler):null,this.minimap=e.minimap?new iyt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new tyt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?_C(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?_C(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?_C(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Llt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?_C(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?_C(e.marginClassName):null,this.inlineClassName=e.inlineClassName?_C(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?_C(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?_C(e.afterContentClassName):null,this.after=e.after?m1.from(e.after):null,this.before=e.before?m1.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Kt.EMPTY=Kt.register({description:"empty"});const iHe=[Kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:gi.NeverGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:gi.GrowsOnlyWhenTypingBefore}),Kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:gi.GrowsOnlyWhenTypingAfter})];function nHe(n){return n instanceof Kt?n:Kt.createDynamic(n)}class nyt extends ${constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new I),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}hasListeners(){return this._actual.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class syt extends ${constructor(){super(),this._fastEmitter=this._register(new I),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new I),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}hasListeners(){return this._fastEmitter.hasListeners()||this._slowEmitter.hasListeners()}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class oyt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new ryt(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class ryt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new bi(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class tNe{static create(e){return new tNe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new ayt(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],c=[];return{addRequest:(l,d,h)=>{r.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=r.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?fu.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let Nwe=[],Pwe=[];function cyt(n,e,t,i,s,o,r,a){if(s===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=SYe(t,i,s,o,r),f=s-u,p=Nwe,m=Pwe;let v=0,w=0,b=0,C=s;const y=d.length;let S=0;if(S>=0){let M=Math.abs(h[S]-C);for(;S+1=M)break;M=k,S++}}for(;SM&&(M=w,k=b);let F=0,N=0,z=0,U=0;if(k<=C){let j=k,re=M===0?Q.Null:t.charCodeAt(M-1),me=M===0?fu.NONE:n.get(re),De=!0;for(let Qe=M;Qew&&Fwe(re,me,Oe,wt,l)&&(F=Tt,N=j),j+=Nt,j>C){Tt>w?(z=Tt,U=j-Nt):(z=Qe+1,U=j),j-N>f&&(F=0),De=!1;break}re=Oe,me=wt}if(De){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(F===0){let j=k,re=t.charCodeAt(M),me=n.get(re),De=!1;for(let Qe=M-1;Qe>=w;Qe--){const Tt=Qe+1,Oe=t.charCodeAt(Qe);if(Oe===Q.Tab){De=!0;break}let wt,Nt;if(sF(Oe)?(Qe--,wt=fu.NONE,Nt=2):(wt=n.get(Oe),Nt=c1(Oe)?o:1),j<=C){if(z===0&&(z=Tt,U=j),j<=C-f)break;if(Fwe(Oe,wt,re,me,l)){F=Tt,N=j;break}}j-=Nt,re=Oe,me=wt}if(F!==0){const Qe=f-(U-N);if(Qe<=i){const Tt=t.charCodeAt(z);let Oe;wl(Tt)?Oe=2:Oe=I$(Tt,U,i,o),Qe-Oe<0&&(F=0)}}if(De){S--;continue}}if(F===0&&(F=z,N=U),F<=w){const j=t.charCodeAt(w);wl(j)?(F=w+2,N=b+2):(F=w+1,N=b+I$(j,b,i,o))}for(w=F,p[v]=F,b=N,m[v]=N,v++,C=N+f;S<0||S=J)break;J=j,S++}}return v===0?null:(p.length=v,m.length=v,Nwe=e.breakOffsets,Pwe=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function lyt(n,e,t,i,s,o,r,a){const c=iw.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(N=>N.options),d=t.map(N=>N.column-1)):(l=null,d=null),s===-1)return l?new A$(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new A$(d,l,[c.length],[],0):null;const u=a==="keepAll",f=SYe(c,i,s,o,r),p=s-f,m=[],v=[];let w=0,b=0,C=0,y=s,S=c.charCodeAt(0),M=n.get(S),k=I$(S,0,i,o),F=1;wl(S)&&(k+=1,S=c.charCodeAt(1),M=n.get(S),F++);for(let N=F;Ny&&((b===0||k-C>p)&&(b=z,C=k-j),m[w]=b,v[w]=C,w++,y=C+p,b=0),S=U,M=J}return w===0&&(!t||t.length===0)?null:(m[w]=h,v[w]=k,new A$(d,l,m,v,f))}function I$(n,e,t,i){return n===Q.Tab?t-e%t:c1(n)||n<32?i:1}function sHe(n,e){return e-n%e}function Fwe(n,e,t,i,s){return t!==Q.Space&&(e===fu.BREAK_AFTER&&i!==fu.BREAK_AFTER||e!==fu.BREAK_BEFORE&&i===fu.BREAK_BEFORE||!s&&e===fu.BREAK_IDEOGRAPHIC&&i!==fu.BREAK_AFTER||!s&&i===fu.BREAK_IDEOGRAPHIC&&e!==fu.BREAK_BEFORE)}function SYe(n,e,t,i,s){let o=0;if(s!==Vg.None){const r=Eu(n);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class KZ{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0),new bd(new O(1,1,1,1),Qu.Simple,0,new oe(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,gi.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,gi.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new zn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?mt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):mt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,jo.None)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,jo.None),a=this._validatePositionWithCache(e,s,i,r),c=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(c)?t:new bd(O.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=KZ._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new bd(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bd(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bd(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new oe(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new O(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bd(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class oHe{constructor(e){this.context=e,this.cursors=[new KZ(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return kct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return Dct(this.cursors,El(e=>e.viewState.position,oe.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(zn.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,O.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class rHe{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class dyt extends ${constructor(){super(),this._onEvent=this._register(new I),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class hyt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var Ha;(function(n){n[n.ContentSizeChanged=0]="ContentSizeChanged",n[n.FocusChanged=1]="FocusChanged",n[n.ScrollChanged=2]="ScrollChanged",n[n.ViewZonesChanged=3]="ViewZonesChanged",n[n.HiddenAreasChanged=4]="HiddenAreasChanged",n[n.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",n[n.CursorStateChanged=6]="CursorStateChanged",n[n.ModelDecorationsChanged=7]="ModelDecorationsChanged",n[n.ModelLanguageChanged=8]="ModelLanguageChanged",n[n.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",n[n.ModelContentChanged=10]="ModelContentChanged",n[n.ModelOptionsChanged=11]="ModelOptionsChanged",n[n.ModelTokensChanged=12]="ModelTokensChanged"})(Ha||(Ha={}));class iNe{constructor(e,t,i,s){this.kind=Ha.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new iNe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class nNe{constructor(e,t){this.kind=Ha.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new nNe(this.oldHasFocus,e.hasFocus)}}class sNe{constructor(e,t,i,s,o,r,a,c){this.kind=Ha.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new sNe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class uyt{constructor(){this.kind=Ha.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class gyt{constructor(){this.kind=Ha.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class YZ{constructor(e,t,i,s,o,r,a){this.kind=Ha.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=L$.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=O.fromPositions(a[0],a[0]),e.emitViewEvent(new v$(t,i,c,l,s,o,r))}revealPrimary(e,t,i,s,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new v$(t,i,null,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=zn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Wi.Undo:i.isRedoing?Wi.Redo:Wi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,Ns.Simple,!0,vt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Wi.RecoverFromMarkers,zn.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}getPosition(){return this._cursors.getPrimaryCursor().modelState.position}setSelections(e,t,i,s){this.setStates(e,t,s,zn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=L$.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new q_t(c,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(s.cursorState[d].modelState))){const l=s?s.cursorState.map(h=>h.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new YZ(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const l=c[0].open,d=o.text.length-r[2].length-1,h=o.text.lastIndexOf(l,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],c=this._model.pushEditOperations(this.getSelections(),i,l=>{if(o)for(let h=0,u=o.length;h0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=Wi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=L$.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){bt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealAll(t,i,!1,Ns.Simple,!0,vt.Smooth)}getAutoClosedCharacters(){return aHe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new T$(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Zr.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o{const l=c.getPosition();return new mt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Wi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(Zr.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(Zr.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,Wi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(lF.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Lg(Cr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Lg(Cr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class L${static from(e,t){return new L$(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class yyt{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,l=>{const d=[];for(let f=0;ff.identifier.minor-p.identifier.minor,u=[];for(let f=0;f0?(d[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:p=>{const m=parseInt(p,10),v=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===Cv.LTR?new mt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new mt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);const c=[];for(const l in o)o.hasOwnProperty(l)&&c.push(parseInt(l,10));c.sort((l,d)=>d-l);for(const l of c)a.splice(l,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{O.isEmpty(h)&&u===""||s.push({identifier:{major:t,minor:o++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{const f=mt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter;else{const w=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===w?p=gi.GrowsOnlyWhenTypingBefore:p=gi.GrowsOnlyWhenTypingAfter}else p=gi.NeverGrowsWhenTypingAtEdges;const m=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,p);return e.trackedRanges[m]=v,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return bt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-O.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Syt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class T${static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new Syt(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=T$._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=T$._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oG9,tokenizeEncoded:(n,e,t)=>yMe(lM.Null,t)};async function Ayt(n,e,t){if(!t)return lHe(e,n.languageIdCodec,cHe);const i=await dc.getOrCreate(t);return lHe(e,n.languageIdCodec,i||cHe)}function Eyt(n,e,t,i,s,o,r){let a="
    ",c=i,l=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(p+=" ",d=!1):(p+=" ",d=!0),v--;break}case Q.LessThan:p+="<",d=!1;break;case Q.GreaterThan:p+=">",d=!1;break;case Q.Ampersand:p+="&",d=!1;break;case Q.Null:p+="�",d=!1;break;case Q.UTF8_BOM:case Q.LINE_SEPARATOR:case Q.PARAGRAPH_SEPARATOR:case Q.NEXT_LINE:p+="�",d=!1;break;case Q.CarriageReturn:p+="​",d=!1;break;case Q.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>s||c>=s)break}return a+="
    ",a}function lHe(n,e,t){let i='
    ';const s=xw(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
    ");const l=t.tokenizeEncoded(c,!0,o);lh.convertToEndOffset(l.tokens,c.length);const h=new lh(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${rM(c.substring(u,v))}`,u=v}o=l.endState}return i+="
    ",i}class xyt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class Dyt{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}var r0;let kyt=(r0=class{constructor(e,t,i,s){this._instanceId=SQe(++r0.INSTANCE_COUNT),this._pendingChanges=new xyt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Dyt(c,s,o,r,a)),c},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of t)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of i){const l=this._findWhitespaceIndex(c.id);l!==-1&&this._removeWhitespace(l)}return}const s=new Set;for(const c of i)s.add(c.id);const o=new Map;for(const c of t)o.set(c.id,c);const r=c=>{const l=[];for(const d of c)if(!s.has(d.id)){if(o.has(d.id)){const h=o.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}l.push(d)}return l},a=r(this._arr).concat(r(e));a.sort((c,l)=>c.afterLineNumber===l.afterLineNumber?c.ordinal-l.ordinal:c.afterLineNumber-l.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=r0.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}hasWhitespace(){return this._checkPendingChanges(),this.getWhitespacesCount()>0}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const c=this.getWhitespacesCount()|0;let l,d;a===-1?(a=c,d=r+1,l=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);let h=o,u=h;const f=5e5;let p=0;o>=f&&(p=Math.floor(o/f)*f,p=Math.floor(p/i)*i,u-=p);const m=[],v=e+(t-e)/2;let w=-1;for(let S=s;S<=r;S++){if(w===-1){const M=h,k=h+i;(M<=v&&vv)&&(w=S)}for(h+=i,m[S-s]=u,u+=i;d===S;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=S;break}}w===-1&&(w=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=s,y=r;return Ct&&y--,{bigNumbersDelta:p,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:w,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:y,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+c)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}},r0.INSTANCE_COUNT=0,r0);const Iyt=125;class v3{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Lyt extends ${constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new v3(0,0,0,0),this._scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new iNe(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class Tyt extends ${constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(x.layoutInfo),r=s.get(x.padding);this._linesLayout=new kyt(t,s.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Lyt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new v3(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(x.smoothScrolling)?Iyt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(x.lineHeight)&&this._linesLayout.setLineHeight(t.get(x.lineHeight)),e.hasChanged(x.padding)){const i=t.get(x.padding);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(x.layoutInfo)){const i=t.get(x.layoutInfo),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new v3(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(x.smoothScrolling)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(x.scrollbar);return s.horizontal===zo.Hidden||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-s.get(x.lineHeight)-s.get(x.padding).bottom):s.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new v3(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new eWe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),s=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new v3(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===vt.Immediate?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Ryt{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.startLineNumber,1),jo.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),jo.Right);r=new O(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,jo.Right);i=new cKe(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new O(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,aZ(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let c=0;const l=[];for(let d=o;d<=r;d++)l[d-o]=[];for(let d=0,h=s.length;dt===Ar.Comment)}function aNe(n,e){return AYe(n,e.range,t=>t===Ar.String)}function AYe(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function ffe(n,e){return n===null?e?JZ.INSTANCE:XZ.INSTANCE:new Myt(n,e)}class Myt{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((l,d)=>new iw(0,0,l+1,this._projectionData.injectionOptions[d],0));r=iw.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=dHe(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const c=this._projectionData,l=c.injectionOffsets,d=c.injectionOptions;let h=null;if(l){h=[];let f=0,p=0;for(let m=0;m0?c.breakOffsets[m-1]:0,b=c.breakOffsets[m];for(;pb)break;if(w0?c.wrappedTextIndentLength:0,F=k+Math.max(y-w,0),N=k+Math.min(S-w,b-w);F!==N&&v.push(new $pt(F,N,M.inlineClassName,M.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=C,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:lh.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=dHe(s.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=pfe.length)for(let e=1;e<=n;e++)pfe[e]=Nyt(e);return pfe[n]}function Nyt(n){return new Array(n+1).join(" ")}class Pyt{constructor(e,t,i,s,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=c,this.wrappingIndent=l,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new Oyt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new DS(iw.fromDecorations(s));for(let m=0;mw.lineNumber===m+1);r.addRequest(i[m],v,t?t[m]:null)}const c=r.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(O.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,b=ffe(c[m],!w);l[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new $ft(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=Fyt(t),s=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(O.compareRangesUsingStarts);if(i.length===s.length){let u=!1;for(let f=0;f({range:u,options:Kt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,c=0,l=-1,d=l+1=a&&f<=c?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),p=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),p=!0)),p){const m=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&c&&l&&d)return!1;const h=r&&a&&!c&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let u=null;if(h){u=[];for(let f=0,p=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const c=[],l=[];for(let d=0,h=s.length;dc?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+c-1,p=h+1,m=p+(o-c)-1,l=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),c=this.convertModelPositionToViewPosition(a.startLineNumber,1),l=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:l.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new hHe(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=s.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===s.modelLineNumber?s.modelLineWrappedLineIdx+1:l.getViewLineCount();for(let u=d;u{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new gR(f.visibleColumn,p,f.className,new C$(f.horizontalLine.top,m.column),-1,-1):v.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=s.lineNumber-1;let d=null;for(let p=c;p<=l;p++){const m=this.modelLineProjections[p];if(m.isVisible()){const v=m.getViewLineNumberOfModelPosition(0,p===c?i.column:1),w=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),b=w-v+1;let C=DT.BlockNone;b>1&&m.getViewLineMinColumn(this.model,p+1,w)===1&&(C=v===0?DT.BlockSubsequent:DT.BlockAll),r.push(b),a.push(C),d===null&&(d=new oe(p+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,p)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let f=0;for(let p=0,m=o.length;pt&&(p=!0,f=t-o+1),h.getViewLinesData(this.model,l+1,u,f,o-e,i,c),o+=f,p)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],c=a.getViewLineMinColumn(this.model,o+1,r),l=a.getViewLineMaxColumn(this.model,o+1,r);tl&&(t=l);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new oe(o+1,d)).equals(i)?new oe(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new O(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new O(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=jo.None,s=!1,o=!1){const r=this.model.validatePosition(new oe(e,t)),a=r.lineNumber,c=r.column;let l=a-1,d=!1;if(o)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(l===0&&!this.modelLineProjections[l].isVisible())return new oe(s?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let u;return d?o?u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,c,i),u}convertModelRangeToViewRange(e,t=jo.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return O.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,jo.Right),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,jo.Left);return new O(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new O(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let c=[];const l=r.lineNumber-1,d=a.lineNumber-1;let h=null;for(let m=l;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new oe(m+1,m===l?r.column:1));else if(h!==null){const w=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,m,w),t,i,s)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new O(h.lineNumber,h.column,a.lineNumber,a.column),t,i,s)),h=null),c.sort((m,v)=>{const w=O.compareRangesUsingStarts(m.range,v.range);return w===0?m.idv.id?1:0:w});const u=[];let f=0,p=null;for(const m of c){const v=m.id;p!==v&&(p=v,u[f++]=m)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Fyt(n){if(n.length===0)return[];const e=n.slice();e.sort(O.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new O(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new O(i,1,s,1)),t}class hHe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class uHe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Oyt{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}var DT;(function(n){n[n.BlockNone=0]="BlockNone",n[n.BlockSubsequent=1]="BlockSubsequent",n[n.BlockAll=2]="BlockAll"})(DT||(DT={}));class Byt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Wyt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new owe(t,i)}onModelLinesInserted(e,t,i,s){return new rwe(t,i)}onModelLineChanged(e,t,i){return[!1,new DKe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}modelRangeIsVisible(e){const t=this._lines.model.getLineCount();return!(e.startLineNumber<1||e.startLineNumber>t||e.endLineNumber<1||e.endLineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const bL=FS.Right;class Hyt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*bL/8))}reset(e){const t=Math.ceil((e+1)*bL/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=cNe.create(this.model),this.glyphLanes=new Hyt(0),this.model.isTooLargeForTokenization())this._lines=new Byt(this.model);else{const d=this._configuration.options,h=d.get(x.fontInfo),u=d.get(x.wrappingStrategy),f=d.get(x.wrappingInfo),p=d.get(x.wrappingIndent),m=d.get(x.wordBreak);this._lines=new Pyt(this._editorId,this.model,s,o,h,this.model.getOptions().tabSize,u,f.wrappingColumn,p,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Cyt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Tyt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new K_t(d)),this._eventDispatcher.emitOutgoingEvent(new sNe(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new Ryt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const h=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(h,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(HZ.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new X_t)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Y_t(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new O(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Q_t(e)),this._eventDispatcher.emitOutgoingEvent(new nNe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new z_t)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new $_t)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new oe(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new fHe(t,this._viewportStart.startLineDelta)}return new fHe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(x.fontInfo),r=s.get(x.wrappingStrategy),a=s.get(x.wrappingInfo),c=s.get(x.wrappingIndent),l=s.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new kj),e.emitViewEvent(new Ij),e.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(x.readOnly)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new vL(null))),e.emitViewEvent(new G_t(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),HO.shouldRecreate(t)&&(this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof mM?e.rawContentChangedEvent.changes:e.changes,a=e instanceof mM?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Yp.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Yp.LineChanged:{let u=null;h.injectedText&&(u=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),c.addRequest(h.detail,u,null);break}}const l=c.finalize(),d=new DS(l);for(const h of r)switch(h.changeType){case Yp.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new kj),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case Yp.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),s=!0;break}case Yp.LinesInserted:{const u=d.takeCount(h.detail.length),f=this._lines.onModelLinesInserted(a,h.fromLineNumber,h.toLineNumber,u);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case Yp.LineChanged:{const u=d.dequeue(),[f,p,m,v]=this._lines.onModelLineChanged(a,h.lineNumber,u);o=f,p&&i.emitViewEvent(p),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new Ij),i.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},vt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof mM&&i.emitOutgoingEvent(new vyt(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new j_t),this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new _yt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new myt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new kj),t.emitViewEvent(new Ij),t.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new HO(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new wyt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vL(e)),this._eventDispatcher.emitOutgoingEvent(new pyt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new kj),r.emitViewEvent(new Ij),r.emitViewEvent(new vL(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=s.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new gyt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(x.layoutInfo),t=this._configuration.options.get(x.lineHeight),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new O(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const c=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;dc||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Eu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zv(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Sm(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new zpt(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,aZ(this._configuration.options)),i=new Vyt;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const c=r.getColor(e.value),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(c,o.zIndex,l,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),s=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(s)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(O.compareRangesUsingStarts);let o=!1,r=!1;for(const c of e)c.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const c=e.map(d=>d.startLineNumber);let l="";for(let d=0;d0&&c[d-1]===c[d]||(l+=this.model.getLineContent(c[d])+s);return l}if(o&&t){const c=[];let l=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==l&&c.push(this.model.getLineContent(h)):c.push(this.model.getValueInRange(d,i?xo.CRLF:xo.TextDefined)),l=h}return c.length===1?c[0]:c}const a=[];for(const c of e)c.isEmpty()||a.push(this.model.getValueInRange(c,i?xo.CRLF:xo.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Yc||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new O(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(x.fontInfo),r=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Gh.fontFamily;let l;return c?l=Gh.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${Gh.fontFamily}`),{mode:i,html:`
    `+this._getHTMLToCopy(s,r)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=o;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?s-1:0,f=l===o?r-1:h.length;h===""?c+="
    ":c+=Eyt(h,d.inflate(),t,u,f,a,Is)}return c}_getColorMap(){const e=dc.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=Wi.NotSet){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new fyt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealAll(s,e,i,Ns.Simple,t,vt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,Ns.Simple,t,vt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new O(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new v$(e,!1,i,null,Ns.Simple,!0,vt.Smooth)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new v$(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Z_t),this._eventDispatcher.emitOutgoingEvent(new uyt))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class cNe{static create(e){const t=e._setTrackedRange(null,new O(1,1,1,1),gi.NeverGrowsWhenTypingAtEdges);return new cNe(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,gi.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new O(i.lineNumber,i.column,i.lineNumber,i.column),gi.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class Vyt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,c=a[a.length-3],l=a[a.length-1];if(c===o&&l+1>=i){s>l&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new q9(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class zyt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&gHe(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>$yt(t,i),[]);return gHe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function $yt(n,e){const t=[];let i=0,s=0;for(;i{this._onDidChangeConfiguration.fire(v);const w=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const b=w.get(x.layoutInfo);this._onDidLayoutChange.fire(b)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new Kyt(this,this._contextKeyService)),this._register(new Yyt(this,this._contextKeyService,u)),this._instantiationService=this._register(s.createChild(new Dl([Pe,this._contextKeyService]))),this._modelData=null,this._focusTracker=new Jyt(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=b_.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of b_.getEditorActions()){if(this._actions.has(v.id)){bt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const w=new oYe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,b=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,this,b))),this._contextKeyService);this._actions.set(w.id,w)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new yZ(this._domElement,{onDragOver:v=>{if(!m())return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this.showDropIndicatorAt(w.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const w=this.getTargetAtClientPoint(v.clientX,v.clientY);w?.position&&this._onDropIntoEditor.fire({position:w.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,s,o){return new Xve(e,t,i,s,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return mz.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Es.getWordAtPosition(this._modelData.model,this._configuration.options.get(x.wordSeparators),this._configuration.options.get(x.wordSegmenterLocales),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=xo.TextDefined;return e&&e.lineEnding&&e.lineEnding===` `?i=xo.LF:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=xo.CRLF),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>O.lift(i)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return kc.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getStatusbarColumn(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return kc.toStatusbarColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!O.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=vt.Smooth){this._revealLine(e,Ns.Simple,t)}revealLineInCenter(e,t=vt.Smooth){this._revealLine(e,Ns.Center,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealLine(e,Ns.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=vt.Smooth){this._revealLine(e,Ns.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,e,1),t,!1,i)}revealPosition(e,t=vt.Smooth){this._revealPosition(e,Ns.Simple,!0,t)}revealPositionInCenter(e,t=vt.Smooth){this._revealPosition(e,Ns.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealPosition(e,Ns.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=vt.Smooth){this._revealPosition(e,Ns.NearTop,!0,t)}_revealPosition(e,t,i,s){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new O(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=mt.isISelection(e),s=O.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new mt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Simple,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.NearTop,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,t,1),i,!1,s)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._revealRange(e,i?Ns.Center:Ns.Simple,s,t)}revealRangeInCenter(e,t=vt.Smooth){this._revealRange(e,Ns.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=vt.Smooth){this._revealRange(e,Ns.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=vt.Smooth){this._revealRange(e,Ns.Top,!0,t)}_revealRange(e,t,i,s){if(!O.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(O.lift(e),t,i,s)}setSelections(e,t="api",i=Wi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}onVisible(){this._modelData?.view.refreshFocusState()}onHide(){this._modelData?.view.refreshFocusState(),this._focusTracker.refreshState()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case Hc.CompositionStart:this._startComposition();return;case Hc.CompositionEnd:this._endComposition(e);return;case Hc.Type:{const o=i;this._type(e,o.text||"");return}case Hc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case Hc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case Hc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case Hc.Cut:this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,bt);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,s,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new O(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=b_.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,bt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(x.readOnly))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Xyt(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,aZ(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,aZ(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}setDecorationsByType(e,t,i){const s={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=s;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Ed(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!s[h]&&this._registerDecorationType(e,l,c.renderOptions,t),s[h]=!0}const d=this._resolveDecorationOptions(l,!!c.hoverMessage);c.hoverMessage&&(d.hoverMessage=c.hoverMessage),r.push({range:c.range,options:d})}for(const c in o)s[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,r))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const s=jt.createDynamic(this._resolveDecorationOptions(e,!1)),o=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(r,o))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(x.layoutInfo)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(x.layoutInfo),o=GL._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(x.lineHeight)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Sd(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new Uyt(this._id,this._configuration,e,$Me.create(gt(this._domElement)),tNe.create(this._configuration.options),a=>xd(gt(this._domElement),a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case Ha.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case Ha.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case Ha.ScrollChanged:this._onDidScrollChange.fire(a);break;case Ha.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case Ha.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case Ha.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case Ha.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(pHe,0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(nt.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(pHe,1,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const c=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",o,r,a,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,c)=>{this._compositionType("keyboard",o,r,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,c)=>{const l={text:o,pasteOnNewLine:r,multicursorText:a,mode:c};this._commandService.executeCommand(Hc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(Hc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(Hc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(Hc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(Hc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(Hc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(Hc.Cut,{})}};const i=new lde(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new ywe(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_registerDecorationType(e,t,i,s){this._codeEditorService.registerDecorationType(e,t,i,s,this)}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}_resolveDecorationOptions(e,t){return this._codeEditorService.resolveDecorationOptions(e,t)}getTelemetryData(){return this._telemetryData}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:GL.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,vt.Immediate)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},GL=eN,eN.dropIntoEditorDecorationOptions=jt.register({description:"workbench-dnd-target",className:"dnd-target"}),eN);_1=GL=D([_(3,be),_(4,Qt),_(5,Qi),_(6,Pe),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],_1);let Qyt=0,jyt=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){St(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var kT;(function(n){n[n.NotSet=0]="NotSet",n[n.False=1]="False",n[n.True=2]="True"})(kT||(kT={}));class mHe extends ${constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new I(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new I(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=kT.NotSet}setValue(e){const t=e?kT.True:kT.False;this._value!==t&&(this._value=t,this._value===kT.True?this._onDidChangeToTrue.fire():this._value===kT.False&&this._onDidChangeToFalse.fire())}}class eu extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Kyt extends ${constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=X.editorSimpleInput.bindTo(t),this._editorFocus=X.focus.bindTo(t),this._textInputFocus=X.textInputFocus.bindTo(t),this._editorTextFocus=X.editorTextFocus.bindTo(t),this._tabMovesFocus=X.tabMovesFocus.bindTo(t),this._editorReadonly=X.readOnly.bindTo(t),this._inDiffEditor=X.inDiffEditor.bindTo(t),this._editorColumnSelection=X.columnSelection.bindTo(t),this._hasMultipleSelections=X.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=X.hasNonEmptySelection.bindTo(t),this._canUndo=X.canUndo.bindTo(t),this._canRedo=X.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(g1.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(g1.getTabFocusMode()),this._editorReadonly.set(e.get(x.readOnly)),this._inDiffEditor.set(e.get(x.inDiffEditor)),this._editorColumnSelection.set(e.get(x.columnSelection))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Yyt extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=X.languageId.bindTo(t),this._hasCompletionItemProvider=X.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=X.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=X.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=X.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=X.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=X.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=X.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=X.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=X.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=X.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=X.hasReferenceProvider.bindTo(t),this._hasRenameProvider=X.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=X.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=X.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=X.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=X.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=X.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=X.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=X.isInEmbeddedEditor.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===_e.walkThroughSnippet||e.uri.scheme===_e.vscodeChatCodeBlock)})}}class Jyt extends ${constructor(e,t){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Dd(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Dd(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}refreshState(){this._domFocusTracker.refreshState(),this._overflowWidgetsDomNode?.refreshState?.()}}class Xyt{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const Zyt=encodeURIComponent("");function mfe(n){return Zyt+encodeURIComponent(n.toString())+eSt}const tSt=encodeURIComponent('');function nSt(n){return tSt+encodeURIComponent(n.toString())+iSt}Im((n,e)=>{const t=n.getColor(Vh);t&&e.addRule(`.monaco-editor .${qu.EditorErrorDecoration} { background: url("data:image/svg+xml,${mfe(t)}") repeat-x bottom left; }`);const i=n.getColor(Gc);i&&e.addRule(`.monaco-editor .${qu.EditorWarningDecoration} { background: url("data:image/svg+xml,${mfe(i)}") repeat-x bottom left; }`);const s=n.getColor(qc);s&&e.addRule(`.monaco-editor .${qu.EditorInfoDecoration} { background: url("data:image/svg+xml,${mfe(s)}") repeat-x bottom left; }`);const o=n.getColor(ymt);o&&e.addRule(`.monaco-editor .${qu.EditorHintDecoration} { background: url("data:image/svg+xml,${nSt(o)}") no-repeat bottom left; }`);const r=n.getColor(dwt);r&&e.addRule(`.monaco-editor.showUnused .${qu.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let ZZ=class extends ${constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new I),this.onWillCreateCodeEditor=this._onWillCreateCodeEditor.event,this._onCodeEditorAdd=this._register(new I),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new I),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new I),this.onWillCreateDiffEditor=this._onWillCreateDiffEditor.event,this._onDiffEditorAdd=this._register(new I),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new I),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._onDidChangeTransientModelProperty=this._register(new I),this.onDidChangeTransientModelProperty=this._onDidChangeTransientModelProperty.event,this._onDecorationTypeRegistered=this._register(new I),this.onDecorationTypeRegistered=this._onDecorationTypeRegistered.event,this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._codeEditorOpenHandlers=new td,this._transientWatchers={},this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=this._createGlobalStyleSheet()),this._globalStyleSheet}_createGlobalStyleSheet(){return new rSt(od())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!P9(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const s=new oSt(this,i,od(t));this._editorStyleSheets.set(i,s)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,s,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:s,options:i||Object.create(null)};s?r=new aSt(this._themeService,a,c):r=new cSt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}return r.refCount++,{dispose:()=>{this.removeDecorationType(t)}}}listDecorationTypes(){return Array.from(this._decorationOptionProviders.keys())}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}resolveDecorationCSSRules(e){const t=this._decorationOptionProviders.get(e);return t?t.resolveDecorationCSSRules():null}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}setTransientModelProperty(e,t,i){const s=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(s)?o=this._transientWatchers[s]:(o=new sSt(s,e,this),this._transientWatchers[s]=o),o.get(t)!==i&&(o.set(t,i),this._onDidChangeTransientModelProperty.fire(e))}getTransientModelProperty(e,t){const i=e.uri.toString();if(this._transientWatchers.hasOwnProperty(i))return this._transientWatchers[i].get(t)}getTransientModelProperties(e){const t=e.uri.toString();if(this._transientWatchers.hasOwnProperty(t))return this._transientWatchers[t].keys().map(i=>[i,this._transientWatchers[t].get(i)])}_removeWatcher(e){delete this._transientWatchers[e.uri]}async openCodeEditor(e,t,i){for(const s of this._codeEditorOpenHandlers){const o=await s(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};ZZ=D([_(0,pn)],ZZ);class sSt{constructor(e,t,i){this.uri=e,this._values={},t.onWillDispose(()=>i._removeWatcher(this))}set(e,t){this._values[e]=t}get(e){return this._values[e]}keys(){return Object.keys(this._values)}}class oSt{get sheet(){return this._styleSheet.sheet}constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){this._refCount--,this._refCount===0&&(this._styleSheet.parentNode?.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class rSt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class aSt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new eee(qd.BeforeContentClassName,i,e),this._afterContentRules=new eee(qd.AfterContentClassName,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}resolveDecorationCSSRules(){return this._styleSheet.sheet.cssRules}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class cSt{constructor(e,t,i,s){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new eee(h,s,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new eee(h,s,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(qd.ClassName);const a=r(qd.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(qd.BeforeContentClassName),this.afterContentClassName=o(qd.AfterContentClassName),s.options.beforeInjectedText&&s.options.beforeInjectedText.contentText){const h=r(qd.BeforeInjectedTextClassName);this.beforeInjectedText={content:s.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.beforeInjectedText.affectsLetterSpacing}}if(s.options.afterInjectedText&&s.options.afterInjectedText.contentText){const h=r(qd.AfterInjectedTextClassName);this.afterInjectedText={content:s.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(qd.GlyphMarginClassName);const c=s.options;this.isWholeLine=!!c.isWholeLine,this.stickiness=c.rangeBehavior;const l=c.light&&c.light.overviewRulerColor||c.overviewRulerColor,d=c.dark&&c.dark.overviewRulerColor||c.overviewRulerColor;(typeof l<"u"||typeof d<"u")&&(this.overviewRuler={color:l||d,darkColor:d||l,position:c.overviewRulerLane||oh.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}resolveDecorationCSSRules(){return this._styleSheet.sheet.rules}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const p5={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class eee{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let s=_fe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(s=s+" "+_fe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=s,this._unThemedSelector=_fe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,s;switch(this._ruleType){case qd.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),s=this.getCSSTextForModelDecorationClassName(e.dark);break;case qd.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),s=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case qd.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),s=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case qd.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case qd.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case qd.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case qd.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(this._unThemedSelector,t),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),r=!0),s.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,s),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push(r_(p5.contentIconPath,uf(P.revive(e.contentIconPath)))),typeof e.contentText=="string"){const s=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(r_(p5.contentText,s))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push(r_(p5.gutterIconPath,uf(P.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(r_(p5.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(r_("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const s=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(r_(p5[o],r))}return i.length!==s}resolveValue(e){if(Upt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var qd;(function(n){n[n.ClassName=0]="ClassName",n[n.InlineClassName=1]="InlineClassName",n[n.GlyphMarginClassName=2]="GlyphMarginClassName",n[n.BeforeContentClassName=3]="BeforeContentClassName",n[n.AfterContentClassName=4]="AfterContentClassName",n[n.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",n[n.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(qd||(qd={}));class _fe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let s=".monaco-editor ."+this.getClassName(e,i);return t&&(s=s+"."+this.getClassName(t,i)),i===qd.BeforeContentClassName?s+="::before":i===qd.AfterContentClassName&&(s+="::after"),s}}let tee=class extends ZZ{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,s,o)=>s?this.doOpenEditor(s,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===_e.http||o===_e.https)return vje(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,vt.Immediate);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,vt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};tee=D([_(0,Pe),_(1,pn)],tee);ce(Qt,tee,Kt.Eager);const bg=ae("layoutService");let iee=class{get mainContainer(){return k_(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??yi.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return uw(this.mainContainer)}get activeContainerDimension(){return uw(this.activeContainer)}get containers(){return Ui(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=T.None,this.onDidLayoutActiveContainer=T.None,this.onDidLayoutContainer=T.None,this.onDidChangeActiveContainer=T.None,this.onDidAddContainer=T.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};iee=D([_(0,Qt)],iee);let Wwe=class extends iee{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Wwe=D([_(1,Qt)],Wwe);ce(bg,iee,Kt.Delayed);const To=ae("dialogService"),bf=ae("fileDialogService"),Md="vs/platform/undoRedo/common/undoRedoService";function Gj(n){return n.scheme===_e.file?n.fsPath:n.path}let EYe=0;class qj{constructor(e,t,i,s,o,r,a){this.id=++EYe,this.type=wd.Resource,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}var cE;(function(n){n[n.ExternalRemoval=0]="ExternalRemoval",n[n.NoParallelUniverses=1]="NoParallelUniverses"})(cE||(cE={}));class _He{constructor(e,t){this.resourceLabel=e,this.reason=t}}class vHe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===cE.ExternalRemoval?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(g(Md,0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(Md,1,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`&&(i=xo.CRLF),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?GL._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?GL._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>O.lift(i)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return kc.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getStatusbarColumn(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return kc.toStatusbarColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!O.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=vt.Smooth){this._revealLine(e,Ns.Simple,t)}revealLineInCenter(e,t=vt.Smooth){this._revealLine(e,Ns.Center,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealLine(e,Ns.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=vt.Smooth){this._revealLine(e,Ns.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,e,1),t,!1,i)}revealPosition(e,t=vt.Smooth){this._revealPosition(e,Ns.Simple,!0,t)}revealPositionInCenter(e,t=vt.Smooth){this._revealPosition(e,Ns.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealPosition(e,Ns.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=vt.Smooth){this._revealPosition(e,Ns.NearTop,!0,t)}_revealPosition(e,t,i,s){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new O(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=mt.isISelection(e),s=O.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new mt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Simple,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._revealLines(e,t,Ns.NearTop,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new O(e,1,t,1),i,!1,s)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._revealRange(e,i?Ns.Center:Ns.Simple,s,t)}revealRangeInCenter(e,t=vt.Smooth){this._revealRange(e,Ns.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=vt.Smooth){this._revealRange(e,Ns.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._revealRange(e,Ns.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=vt.Smooth){this._revealRange(e,Ns.Top,!0,t)}_revealRange(e,t,i,s){if(!O.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(O.lift(e),t,i,s)}setSelections(e,t="api",i=Wi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}onVisible(){this._modelData?.view.refreshFocusState()}onHide(){this._modelData?.view.refreshFocusState(),this._focusTracker.refreshState()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case Uc.CompositionStart:this._startComposition();return;case Uc.CompositionEnd:this._endComposition(e);return;case Uc.Type:{const o=i;this._type(e,o.text||"");return}case Uc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case Uc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case Uc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case Uc.Cut:this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,bt);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,s,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new O(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=b_.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,bt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(x.readOnly)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(x.readOnly))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Xyt(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,aZ(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,aZ(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}setDecorationsByType(e,t,i){const s={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=s;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Ed(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!s[h]&&this._registerDecorationType(e,l,c.renderOptions,t),s[h]=!0}const d=this._resolveDecorationOptions(l,!!c.hoverMessage);c.hoverMessage&&(d.hoverMessage=c.hoverMessage),r.push({range:c.range,options:d})}for(const c in o)s[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,r))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const s=Kt.createDynamic(this._resolveDecorationOptions(e,!1)),o=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(r,o))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(x.layoutInfo)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(x.layoutInfo),o=GL._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(x.lineHeight)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Sd(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new Uyt(this._id,this._configuration,e,$Me.create(gt(this._domElement)),tNe.create(this._configuration.options),a=>xd(gt(this._domElement),a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case Ha.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case Ha.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case Ha.ScrollChanged:this._onDidScrollChange.fire(a);break;case Ha.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case Ha.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case Ha.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case Ha.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(pHe,0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(nt.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(pHe,1,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const c=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",o,r,a,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,c)=>{this._compositionType("keyboard",o,r,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,c)=>{const l={text:o,pasteOnNewLine:r,multicursorText:a,mode:c};this._commandService.executeCommand(Uc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(Uc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(Uc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(Uc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(Uc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(Uc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(Uc.Cut,{})}};const i=new lde(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new ywe(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_registerDecorationType(e,t,i,s){this._codeEditorService.registerDecorationType(e,t,i,s,this)}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}_resolveDecorationOptions(e,t){return this._codeEditorService.resolveDecorationOptions(e,t)}getTelemetryData(){return this._telemetryData}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:GL.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,vt.Immediate)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},GL=eN,eN.dropIntoEditorDecorationOptions=Kt.register({description:"workbench-dnd-target",className:"dnd-target"}),eN);_1=GL=D([_(3,be),_(4,jt),_(5,ji),_(6,Pe),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],_1);let Qyt=0,jyt=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){St(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var kT;(function(n){n[n.NotSet=0]="NotSet",n[n.False=1]="False",n[n.True=2]="True"})(kT||(kT={}));class mHe extends ${constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new I(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new I(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=kT.NotSet}setValue(e){const t=e?kT.True:kT.False;this._value!==t&&(this._value=t,this._value===kT.True?this._onDidChangeToTrue.fire():this._value===kT.False&&this._onDidChangeToFalse.fire())}}class eu extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Kyt extends ${constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=X.editorSimpleInput.bindTo(t),this._editorFocus=X.focus.bindTo(t),this._textInputFocus=X.textInputFocus.bindTo(t),this._editorTextFocus=X.editorTextFocus.bindTo(t),this._tabMovesFocus=X.tabMovesFocus.bindTo(t),this._editorReadonly=X.readOnly.bindTo(t),this._inDiffEditor=X.inDiffEditor.bindTo(t),this._editorColumnSelection=X.columnSelection.bindTo(t),this._hasMultipleSelections=X.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=X.hasNonEmptySelection.bindTo(t),this._canUndo=X.canUndo.bindTo(t),this._canRedo=X.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(g1.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(g1.getTabFocusMode()),this._editorReadonly.set(e.get(x.readOnly)),this._inDiffEditor.set(e.get(x.inDiffEditor)),this._editorColumnSelection.set(e.get(x.columnSelection))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Yyt extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=X.languageId.bindTo(t),this._hasCompletionItemProvider=X.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=X.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=X.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=X.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=X.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=X.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=X.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=X.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=X.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=X.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=X.hasReferenceProvider.bindTo(t),this._hasRenameProvider=X.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=X.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=X.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=X.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=X.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=X.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=X.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=X.isInEmbeddedEditor.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===_e.walkThroughSnippet||e.uri.scheme===_e.vscodeChatCodeBlock)})}}class Jyt extends ${constructor(e,t){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Dd(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Dd(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}refreshState(){this._domFocusTracker.refreshState(),this._overflowWidgetsDomNode?.refreshState?.()}}class Xyt{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const Zyt=encodeURIComponent("");function mfe(n){return Zyt+encodeURIComponent(n.toString())+eSt}const tSt=encodeURIComponent('');function nSt(n){return tSt+encodeURIComponent(n.toString())+iSt}Im((n,e)=>{const t=n.getColor(Vh);t&&e.addRule(`.monaco-editor .${qu.EditorErrorDecoration} { background: url("data:image/svg+xml,${mfe(t)}") repeat-x bottom left; }`);const i=n.getColor(qc);i&&e.addRule(`.monaco-editor .${qu.EditorWarningDecoration} { background: url("data:image/svg+xml,${mfe(i)}") repeat-x bottom left; }`);const s=n.getColor(Qc);s&&e.addRule(`.monaco-editor .${qu.EditorInfoDecoration} { background: url("data:image/svg+xml,${mfe(s)}") repeat-x bottom left; }`);const o=n.getColor(ymt);o&&e.addRule(`.monaco-editor .${qu.EditorHintDecoration} { background: url("data:image/svg+xml,${nSt(o)}") no-repeat bottom left; }`);const r=n.getColor(dwt);r&&e.addRule(`.monaco-editor.showUnused .${qu.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let ZZ=class extends ${constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new I),this.onWillCreateCodeEditor=this._onWillCreateCodeEditor.event,this._onCodeEditorAdd=this._register(new I),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new I),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new I),this.onWillCreateDiffEditor=this._onWillCreateDiffEditor.event,this._onDiffEditorAdd=this._register(new I),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new I),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._onDidChangeTransientModelProperty=this._register(new I),this.onDidChangeTransientModelProperty=this._onDidChangeTransientModelProperty.event,this._onDecorationTypeRegistered=this._register(new I),this.onDecorationTypeRegistered=this._onDecorationTypeRegistered.event,this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._codeEditorOpenHandlers=new td,this._transientWatchers={},this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=this._createGlobalStyleSheet()),this._globalStyleSheet}_createGlobalStyleSheet(){return new rSt(od())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!P9(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const s=new oSt(this,i,od(t));this._editorStyleSheets.set(i,s)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,s,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:s,options:i||Object.create(null)};s?r=new aSt(this._themeService,a,c):r=new cSt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}return r.refCount++,{dispose:()=>{this.removeDecorationType(t)}}}listDecorationTypes(){return Array.from(this._decorationOptionProviders.keys())}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}resolveDecorationCSSRules(e){const t=this._decorationOptionProviders.get(e);return t?t.resolveDecorationCSSRules():null}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}setTransientModelProperty(e,t,i){const s=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(s)?o=this._transientWatchers[s]:(o=new sSt(s,e,this),this._transientWatchers[s]=o),o.get(t)!==i&&(o.set(t,i),this._onDidChangeTransientModelProperty.fire(e))}getTransientModelProperty(e,t){const i=e.uri.toString();if(this._transientWatchers.hasOwnProperty(i))return this._transientWatchers[i].get(t)}getTransientModelProperties(e){const t=e.uri.toString();if(this._transientWatchers.hasOwnProperty(t))return this._transientWatchers[t].keys().map(i=>[i,this._transientWatchers[t].get(i)])}_removeWatcher(e){delete this._transientWatchers[e.uri]}async openCodeEditor(e,t,i){for(const s of this._codeEditorOpenHandlers){const o=await s(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};ZZ=D([_(0,pn)],ZZ);class sSt{constructor(e,t,i){this.uri=e,this._values={},t.onWillDispose(()=>i._removeWatcher(this))}set(e,t){this._values[e]=t}get(e){return this._values[e]}keys(){return Object.keys(this._values)}}class oSt{get sheet(){return this._styleSheet.sheet}constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){this._refCount--,this._refCount===0&&(this._styleSheet.parentNode?.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class rSt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Kp(e,t,this._styleSheet)}removeRulesContainingSelector(e){vE(e,this._styleSheet)}}class aSt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new eee(qd.BeforeContentClassName,i,e),this._afterContentRules=new eee(qd.AfterContentClassName,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}resolveDecorationCSSRules(){return this._styleSheet.sheet.cssRules}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class cSt{constructor(e,t,i,s){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new eee(h,s,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new eee(h,s,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(qd.ClassName);const a=r(qd.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(qd.BeforeContentClassName),this.afterContentClassName=o(qd.AfterContentClassName),s.options.beforeInjectedText&&s.options.beforeInjectedText.contentText){const h=r(qd.BeforeInjectedTextClassName);this.beforeInjectedText={content:s.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.beforeInjectedText.affectsLetterSpacing}}if(s.options.afterInjectedText&&s.options.afterInjectedText.contentText){const h=r(qd.AfterInjectedTextClassName);this.afterInjectedText={content:s.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||s.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(qd.GlyphMarginClassName);const c=s.options;this.isWholeLine=!!c.isWholeLine,this.stickiness=c.rangeBehavior;const l=c.light&&c.light.overviewRulerColor||c.overviewRulerColor,d=c.dark&&c.dark.overviewRulerColor||c.overviewRulerColor;(typeof l<"u"||typeof d<"u")&&(this.overviewRuler={color:l||d,darkColor:d||l,position:c.overviewRulerLane||oh.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}resolveDecorationCSSRules(){return this._styleSheet.sheet.rules}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const p5={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class eee{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let s=_fe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(s=s+" "+_fe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=s,this._unThemedSelector=_fe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,s;switch(this._ruleType){case qd.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),s=this.getCSSTextForModelDecorationClassName(e.dark);break;case qd.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),s=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case qd.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),s=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case qd.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case qd.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case qd.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case qd.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(this._unThemedSelector,t),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),r=!0),s.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,s),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push(r_(p5.contentIconPath,uf(P.revive(e.contentIconPath)))),typeof e.contentText=="string"){const s=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(r_(p5.contentText,s))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push(r_(p5.gutterIconPath,uf(P.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(r_(p5.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(r_("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const s=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(r_(p5[o],r))}return i.length!==s}resolveValue(e){if(Upt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var qd;(function(n){n[n.ClassName=0]="ClassName",n[n.InlineClassName=1]="InlineClassName",n[n.GlyphMarginClassName=2]="GlyphMarginClassName",n[n.BeforeContentClassName=3]="BeforeContentClassName",n[n.AfterContentClassName=4]="AfterContentClassName",n[n.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",n[n.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(qd||(qd={}));class _fe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let s=".monaco-editor ."+this.getClassName(e,i);return t&&(s=s+"."+this.getClassName(t,i)),i===qd.BeforeContentClassName?s+="::before":i===qd.AfterContentClassName&&(s+="::after"),s}}let tee=class extends ZZ{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,s,o)=>s?this.doOpenEditor(s,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===_e.http||o===_e.https)return vje(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,vt.Immediate);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,vt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};tee=D([_(0,Pe),_(1,pn)],tee);ce(jt,tee,Yt.Eager);const bg=ae("layoutService");let iee=class{get mainContainer(){return k_(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??yi.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return uw(this.mainContainer)}get activeContainerDimension(){return uw(this.activeContainer)}get containers(){return Ui(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=T.None,this.onDidLayoutActiveContainer=T.None,this.onDidLayoutContainer=T.None,this.onDidChangeActiveContainer=T.None,this.onDidAddContainer=T.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};iee=D([_(0,jt)],iee);let Wwe=class extends iee{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Wwe=D([_(1,jt)],Wwe);ce(bg,iee,Yt.Delayed);const To=ae("dialogService"),bf=ae("fileDialogService"),Md="vs/platform/undoRedo/common/undoRedoService";function Gj(n){return n.scheme===_e.file?n.fsPath:n.path}let EYe=0;class qj{constructor(e,t,i,s,o,r,a){this.id=++EYe,this.type=wd.Resource,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}var cE;(function(n){n[n.ExternalRemoval=0]="ExternalRemoval",n[n.NoParallelUniverses=1]="NoParallelUniverses"})(cE||(cE={}));class _He{constructor(e,t){this.resourceLabel=e,this.reason=t}}class vHe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===cE.ExternalRemoval?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(g(Md,0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(Md,1,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` `)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class lSt{constructor(e,t,i,s,o,r,a){this.id=++EYe,this.type=wd.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new vHe),this.removedResources.has(t)||this.removedResources.set(t,new _He(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new vHe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new _He(e,cE.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class xYe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===wd.Workspace&&e.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval);for(const e of this._future)e.type===wd.Workspace&&e.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}setElementsIsValid(e){for(const t of this._past)t.type===wd.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===wd.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===wd.Workspace?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===wd.Workspace&&t.removeResource(this.resourceLabel,this.strResource,cE.NoParallelUniverses);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new vYe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[s])&&(i=!1,o=0),!i&&l.type===wd.Workspace&&l.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const c=this._future[a];i&&(s>=t||c.id!==e.elements[s])&&(i=!1,r=a),!i&&c.type===wd.Workspace&&c.removeResource(this.resourceLabel,this.strResource,cE.ExternalRemoval)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class vfe{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t{for(let i=0,s=this._uriComparisonKeyComputers.length;it.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof ET){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){bt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),s.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),s.dispose(),o()),c=>(r(),s.dispose(),this._onError(c,e))):(r(),s.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return $.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?$.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==wd.Workspace||typeof e.actual.prepareUndoRedo>"u")return t($.None);const i=e.actual.prepareUndoRedo();return i?cz(i)?t(i):i.then(s=>t(s)):t($.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||DYe);return new vfe(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new Qj(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new Qj}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,g(Md,3,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,g(Md,4,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,g(Md,5,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,s){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:c}=await this._dialogService.prompt({type:nt.Info,message:g(Md,6,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(Md,7,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(Md,8,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(c===a.Cancel)return;if(c===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const l=this._checkWorkspaceUndo(e,t,i,!1);if(l)return l.returnValue;s=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=g(Md,9,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new vfe([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof ET){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&c)return this._undo(c,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===wd.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(Md,10,"Would you like to undo '{0}'?",i.label),primaryButton:g(Md,11,"&&Yes"),cancelButton:g(Md,12,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(Md,14,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,g(Md,15,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,g(Md,16,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let s;try{s=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(Md,17,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new vfe([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderjle(nee.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Dc(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new hSt(6),this._cache.set(i,s));const o=Dc(s.update(t),this._min,this._max);return Rx(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new lNe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Dc(e,this._min,this._max)}}let Uwe=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const s=i?.min??50,o=i?.max??s**2,r=i?.key??void 0,a=`${nee.of(e)},${s}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new uSt(s*1.5)):c=new gSt(this._logService,t,e,this._overallAverage()|0||s*1.5,s,o),this._data.set(a,c)),c}_overallAverage(){const e=new lNe;for(const t of this._data.values())e.update(t.default());return e.value}};Uwe=D([_(0,Ze),_(1,Il)],Uwe);ce(B_,Uwe,Kt.Delayed);const OW="vs/base/common/errorMessage";function wfe(n,e){return e&&(n.stack||n.stacktrace)?g(OW,0,"{0}: {1}",CHe(n),bHe(n.stack)||bHe(n.stacktrace)):CHe(n)}function bHe(n){return Array.isArray(n)?n.join(` -`):n}function CHe(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?g(OW,1,"A system error occurred ({0})",n.message):n.message||g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function Ma(n=null,e=!1){if(!n)return g(OW,2,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=Ui(n),i=Ma(t[0],e);return t.length>1?g(OW,3,"{0} ({1} errors in total)",i,t.length):i}if(zt(n))return n;if(n.detail){const t=n.detail;if(t.error)return wfe(t.error,e);if(t.exception)return wfe(t.exception,e)}return n.stack?wfe(n,e):n.message?n.message:g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function fSt(n){const e=n;return e instanceof Error&&Array.isArray(e.actions)}function pSt(n,e){let t;return typeof n=="string"?t=new Error(n):t=n,t.actions=e,t}function kYe(n){return jc(n)}var Pn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(Pn||(Pn={}));const dNe=Pn.Info;function see(n,e,t){switch(e){case Pn.Trace:n.trace(t);break;case Pn.Debug:n.debug(t);break;case Pn.Info:n.info(t);break;case Pn.Warning:n.warn(t);break;case Pn.Error:n.error(t);break;case Pn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function $O(n,e=!1){let t="";for(let i=0;i0?" ":"")+s}return t}class hNe extends ${constructor(){super(...arguments),this.level=dNe,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Pn.Off&&this.level<=e}}class ude extends hNe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&this.log(Pn.Trace,$O([e,...t],!0))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&this.log(Pn.Debug,$O([e,...t]))}info(e,...t){this.checkLogLevel(Pn.Info)&&this.log(Pn.Info,$O([e,...t]))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&this.log(Pn.Warning,$O([e,...t]))}error(e,...t){if(this.checkLogLevel(Pn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Pn.Error,$O(i))}else this.log(Pn.Error,$O([e,...t]))}flush(){}}let mSt=class extends hNe{constructor(e=dNe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Pn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Pn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class _St extends hNe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}flush(){for(const e of this.loggers)e.flush()}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class IYe extends ${constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new wi,this._onDidChangeLoggers=this._register(new I),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,i)for(const s of i)this._loggers.set(s.resource,{logger:void 0,info:s})}getLoggerEntry(e){return zt(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){const i=this.toResource(e),s=zt(e)?e:t?.id??Ed(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Pn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:s}));const a={logger:o,info:{resource:i,id:s,logLevel:r,name:t?.name,hidden:t?.hidden,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),o}toResource(e){return zt(e)?qt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(P.isUri(e)){const i=e,s=t,o=this._loggers.get(i);o&&s!==o.info.logLevel&&(o.info.logLevel=s===this.logLevel?void 0:s,o.logger?.setLevel(s),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,s]))}else{this.logLevel=e;for(const[i,s]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&s.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){const t=this._loggers.get(e);t&&(t.logger&&t.logger.dispose(),this._loggers.delete(e),this._onDidChangeLoggers.fire({added:[],removed:[t.info]}))}*getRegisteredLoggers(){for(const 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()}}class LYe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Pn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class vSt extends LYe{}function c7(n){switch(n){case Pn.Trace:return"trace";case Pn.Debug:return"debug";case Pn.Info:return"info";case Pn.Warning:return"warn";case Pn.Error:return"error";case Pn.Off:return"off"}}function TYe(n){switch(n){case"trace":return Pn.Trace;case"debug":return Pn.Debug;case"info":return Pn.Info;case"warn":return Pn.Warning;case"error":return Pn.Error;case"critical":return Pn.Error;case"off":return Pn.Off}}const wSt=new Y("logLevel",c7(Pn.Info));class R${static create(e,t){return new R$(e,new oee(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new O(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[s,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new R$(this._startLineNumber,s),new R$(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=Gb(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):q.Null)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class oee{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;ae||u===e&&p>=t)&&(ue||p===e&&v>=t){if(po?m-=o-i:m=i;else if(f===t&&p===i)if(f===s&&m>o)m-=o-i;else{d=!0;continue}else if(fo)f=t,p=i,m=p+(m-o);else{d=!0;continue}else if(f>s){if(c===0&&!d){l=a;break}f-=c}else if(f===s&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const w=4*l;r[w]=f,r[w+1]=p,r[w+2]=m,r[w+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=q.Digit0&&r<=q.Digit9||r>=q.A&&r<=q.Z||r>=q.a&&r<=q.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;l>0&&this._logService.getLevel()===Pn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),c.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=BW.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?ar.Italic:0)<d&&i[5*b]===0;)b--;if(b-1===d){let C=h;for(;C+1M)e.warnOverlappingSemanticTokens(S,M+1);else{const U=e.getMetadata(N,z,t);U!==BW.NO_STYLING&&(p===0&&(p=S),u[f]=S-p,u[f+1]=M,u[f+2]=F,u[f+3]=U,f+=4,m=S,v=F)}c=S,l=M,a++}f!==u.length&&(u=u.subarray(0,f));const w=R$.create(p,u);r.push(w)}return r}class bSt{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}const OA=class OA{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Vwe(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};$we=D([_(0,pn),_(1,Ze),_(2,Di)],$we);ce(gde,$we,Kt.Delayed);const mR="**",Gwe="/",rJ="[/\\\\]",aJ="[^/\\\\]",CSt=/\//g;function SHe(n,e){switch(n){case 0:return"";case 1:return`${aJ}*?`;default:return`(?:${rJ}|${aJ}+${rJ}${e?`|${rJ}${aJ}+`:""})*?`}}function qwe(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function MYe(n){if(!n)return"";let e="";const t=qwe(n,Gwe);if(t.every(i=>i===mR))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===mR){if(i)return;e+=SHe(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===Gwe?h="":h=Iu(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${qwe(a,",").map(f=>MYe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=aJ;continue;case"*":e+=SHe(1);continue;default:e+=Iu(d)}}ouNe(a,e)).filter(a=>a!==_S),n),i=t.length;if(!i)return _S;if(i===1)return t[0];const s=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function DHe(n,e,t){const i=dg===qi.sep,s=i?n:n.replace(CSt,dg),o=dg+s,r=qi.sep+n;let a;return t?a=function(c,l){return typeof c=="string"&&(c===s||c.endsWith(o)||!i&&(c===n||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===s||!i&&c===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function TSt(n){try{const e=new RegExp(`^${MYe(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return _S}}function WW(n,e,t){return!n||typeof e!="string"?!1:_w(n)(e,void 0,t)}function _w(n,e={}){if(!n)return EHe;if(typeof n=="string"||NYe(n)){const t=uNe(n,e);if(t===_S)return EHe;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return RSt(n,e)}function NYe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function RSt(n,e){const t=PYe(Object.getOwnPropertyNames(n).map(a=>MSt(a,n[a],e)).filter(a=>a!==_S)),i=t.length;if(!i)return _S;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let f=0,p=t.length;f{for(const f of u){const p=await f;if(typeof p=="string")return p}return null})():null},c=t.find(d=>!!d.allBasenames);c&&(a.allBasenames=c.allBasenames);const l=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return l.length&&(a.allPaths=l),a}const s=function(a,c,l){let d,h;for(let u=0,f=t.length;u{for(const u of h){const f=await u;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function MSt(n,e,t){if(e===!1)return _S;const i=uNe(n,t);if(i===_S)return _S;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=s.replace("$(basename)",()=>c),h=l(d);return NS(h)?h.then(u=>u?n:null):h?n:null};return o.requiresSiblings=!0,o}}return i}function PYe(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let s;if(e){s=[];for(let a=0,c=i.length;a{const l=c.patterns;return l?a.concat(l):a},[]);const o=function(a,c){if(typeof a!="string")return null;if(!c){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===q.Slash||h===q.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?s[l]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function fde(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const c=fde(a,e,t,i,s,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=n;if(!i&&!l)return 0;d&&s&&(e=s);let h=0;if(c)if(c===e.scheme)h=10;else if(c==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===o)h=10;else if(d==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:d1(a.base)},u===e.fsPath||WW(u,e.fsPath))h=10;else return 0}return h}else return 0}}function FYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(FYe):!!n.notebookType}function OYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(OYe):!!n.exclusive}class kHe{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()}}class Po{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ee(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){const t=this._notebookInfoResolver?.(e.uri),i=t?new kHe(e.uri,e.getLanguageId(),t.uri,t.type):new kHe(e.uri,e.getLanguageId(),void 0,void 0);if(!this._lastCandidate?.equals(i)){this._lastCandidate=i;for(const s of this._entries)if(s._score=fde(s.selector,i.uri,i.languageId,gS(e),i.notebookUri,i.notebookType),OYe(s.selector)&&s._score>0){for(const o of this._entries)o._score=0;s._score=1e3;break}this._entries.sort(Po._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:w3(e.selector)&&!w3(t.selector)?1:!w3(e.selector)&&w3(t.selector)?-1:e._timet._time?-1:0}}function w3(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(w3):!!n.isBuiltin}class NSt{constructor(){this.referenceProvider=new Po(this._score.bind(this)),this.renameProvider=new Po(this._score.bind(this)),this.newSymbolNamesProvider=new Po(this._score.bind(this)),this.codeActionProvider=new Po(this._score.bind(this)),this.definitionProvider=new Po(this._score.bind(this)),this.typeDefinitionProvider=new Po(this._score.bind(this)),this.declarationProvider=new Po(this._score.bind(this)),this.implementationProvider=new Po(this._score.bind(this)),this.documentSymbolProvider=new Po(this._score.bind(this)),this.inlayHintsProvider=new Po(this._score.bind(this)),this.colorProvider=new Po(this._score.bind(this)),this.codeLensProvider=new Po(this._score.bind(this)),this.documentFormattingEditProvider=new Po(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Po(this._score.bind(this)),this.onTypeFormattingEditProvider=new Po(this._score.bind(this)),this.signatureHelpProvider=new Po(this._score.bind(this)),this.hoverProvider=new Po(this._score.bind(this)),this.documentHighlightProvider=new Po(this._score.bind(this)),this.multiDocumentHighlightProvider=new Po(this._score.bind(this)),this.selectionRangeProvider=new Po(this._score.bind(this)),this.foldingRangeProvider=new Po(this._score.bind(this)),this.linkProvider=new Po(this._score.bind(this)),this.inlineCompletionsProvider=new Po(this._score.bind(this)),this.inlineEditProvider=new Po(this._score.bind(this)),this.completionProvider=new Po(this._score.bind(this)),this.linkedEditingRangeProvider=new Po(this._score.bind(this)),this.inlineValuesProvider=new Po(this._score.bind(this)),this.evaluatableExpressionProvider=new Po(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Po(this._score.bind(this)),this.documentSemanticTokensProvider=new Po(this._score.bind(this)),this.documentDropEditProvider=new Po(this._score.bind(this)),this.documentPasteEditProvider=new Po(this._score.bind(this)),this.mappedEditsProvider=new Po(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(ht,NSt,Kt.Delayed);const Zc=ae("hoverService"),W_=ae("contextViewService"),Vr=ae("contextMenuService");var PSt='.monaco-workbench .workbench-hover{background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorHoverWidget-foreground);font-size:13px;line-height:19px;max-width:700px;overflow:hidden;position:relative;z-index:40}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{pointer-events:none;position:absolute;z-index:41}.monaco-workbench .workbench-hover-pointer:after{background-color:var(--vscode-editorHoverWidget-background);border-bottom:1px solid var(--vscode-editorHoverWidget-border);border-right:1px solid var(--vscode-editorHoverWidget-border);content:"";height:5px;position:absolute;width:5px}.monaco-workbench .locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;height:4px;width:4px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;text-decoration:underline}.monaco-workbench .workbench-hover a:active,.monaco-workbench .workbench-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}';Ct(PSt,{});var FSt='.monaco-hover{animation:fadein .1s linear;box-sizing:border-box;cursor:default;line-height:1.5em;overflow:hidden;position:absolute;user-select:text;-webkit-user-select:text;white-space:var(--vscode-hover-whiteSpace,normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){word-wrap:break-word;max-width:var(--vscode-hover-maxWidth,500px)}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover .code,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6,.monaco-hover p,.monaco-hover ul{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{border-left:0;border-right:0;box-sizing:border-box;height:1px;margin:4px -8px -4px}.monaco-hover .code:first-child,.monaco-hover p:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover .code:last-child,.monaco-hover p:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ol,.monaco-hover ul{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace,pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{cursor:pointer;margin-right:16px}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link,.monaco-hover .hover-contents a.code-link:hover{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-foreground);text-decoration:underline;text-underline-position:under}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{display:inline-block;margin-bottom:4px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{cursor:default;opacity:.4;pointer-events:none}';Ct(FSt,{});const IHe="vs/base/browser/ui/hover/hoverWidget",jj=we;var Oo;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BELOW=2]="BELOW",n[n.ABOVE=3]="ABOVE"})(Oo||(Oo={}));let gNe=class extends ${constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new bz(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class fNe extends ${static render(e,t,i){return new fNe(e,t,i)}constructor(e,t,i){super(),this.actionContainer=he(e,jj("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=he(this.actionContainer,jj("a.action")),this.action.setAttribute("role","button"),t.iconClass&&he(this.action,jj(`span.icon.${t.iconClass}`));const s=he(this.action,jj("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new WYe(this.actionContainer,t.run)),this._store.add(new HYe(this.actionContainer,t.run,[E.Enter,E.Space])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function BYe(n,e){return n&&e?g(IHe,0,"Inspect this in the accessible view with {0}.",e):n?g(IHe,1,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class WYe extends ${constructor(e,t){super(),this._register(pe(e,xe.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class HYe extends ${constructor(e,t,i){super(),this._register(pe(e,xe.KEY_DOWN,s=>{const o=new os(s);i.some(r=>o.equals(r))&&(s.stopPropagation(),s.preventDefault(),t(e))}))}}var Dh;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),c=Math.min(o.end,r.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],c={start:o.start,end:Math.min(r.start,o.end)},l={start:Math.max(r.end,o.start),end:o.end};return t(c)||a.push(c),t(l)||a.push(l),a}n.relativeComplement=s})(Dh||(Dh={}));var OSt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";Ct(OSt,{});var by;(function(n){n[n.ABSOLUTE=1]="ABSOLUTE",n[n.FIXED=2]="FIXED",n[n.FIXED_SHADOW=3]="FIXED_SHADOW"})(by||(by={}));function BSt(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Ob;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(Ob||(Ob={}));var Jp;(function(n){n[n.BELOW=0]="BELOW",n[n.ABOVE=1]="ABOVE"})(Jp||(Jp={}));var aee;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(aee||(aee={}));var Hp;(function(n){n[n.Before=0]="Before",n[n.After=1]="After"})(Hp||(Hp={}));var Qk;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(Qk||(Qk={}));function i2(n,e,t){const i=t.mode===Qk.ALIGN?t.offset:t.offset+t.size,s=t.mode===Qk.ALIGN?t.offset+t.size:t.offset;return t.position===Hp.Before?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const V2=class V2 extends ${constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=$.None,this.toDisposeOnSetContainer=$.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=we(".context-view"),Jl(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,by.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==by.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===by.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=we(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=WSt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(we("slot"))}else this.container.appendChild(this.view);const s=new Z;V2.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),V2.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){this.isVisible()&&this.hide(),Yo(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Oh(this.view),this.toDisposeOnClean=e.render(this.view)||$.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(I_&&nMe.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Ra(e)){const u=ia(e),f=lje(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else BSt(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=du(this.view),s=Zf(this.view),o=this.delegate.anchorPosition||Jp.BELOW,r=this.delegate.anchorAlignment||Ob.LEFT,a=this.delegate.anchorAxisAlignment||aee.VERTICAL;let c,l;const d=ax();if(a===aee.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After},f={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After,mode:Qk.ALIGN};c=i2(d.innerHeight,s,u)+d.pageYOffset,Dh.intersects({start:c,end:c+s},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),l=i2(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After},f={offset:t.top,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After,mode:Qk.ALIGN};l=i2(d.innerWidth,i,u),Dh.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),c=i2(d.innerHeight,s,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Jp.BELOW?"bottom":"top"),this.view.classList.add(r===Ob.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=ia(this.container);this.view.style.top=`${c-(this.useFixedPosition?ia(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?ia(this.view).left:h.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Jl(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,gt(e).document.activeElement):t&&!al(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};V2.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],V2.BUBBLE_DOWN_EVENTS=["click"];let Qwe=V2;const WSt=` +`))}pushElement(e,t=qZ.None,i=ET.None){if(e.type===wd.Resource){const s=Gj(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new qj(e,s,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const s=new Set,o=[],r=[];for(const a of e.resources){const c=Gj(a),l=this.getUriComparisonKey(a);s.has(l)||(s.add(l),o.push(c),r.push(l))}o.length===1?this._pushElement(new qj(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new lSt(e,o,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof ET){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){bt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),s.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),s.dispose(),o()),c=>(r(),s.dispose(),this._onError(c,e))):(r(),s.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return $.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?$.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==wd.Workspace||typeof e.actual.prepareUndoRedo>"u")return t($.None);const i=e.actual.prepareUndoRedo();return i?cz(i)?t(i):i.then(s=>t(s)):t($.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||DYe);return new vfe(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new Qj(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new Qj}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(Md,2,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,g(Md,3,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,g(Md,4,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,g(Md,5,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,s){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:c}=await this._dialogService.prompt({type:nt.Info,message:g(Md,6,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(Md,7,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(Md,8,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(c===a.Cancel)return;if(c===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const l=this._checkWorkspaceUndo(e,t,i,!1);if(l)return l.returnValue;s=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=g(Md,9,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new vfe([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof ET){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&c)return this._undo(c,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===wd.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(Md,10,"Would you like to undo '{0}'?",i.label),primaryButton:g(Md,11,"&&Yes"),cancelButton:g(Md,12,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(Md,14,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,g(Md,15,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,g(Md,16,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let s;try{s=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(Md,17,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new vfe([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderjle(nee.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Dc(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new hSt(6),this._cache.set(i,s));const o=Dc(s.update(t),this._min,this._max);return Rx(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new lNe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Dc(e,this._min,this._max)}}let Uwe=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const s=i?.min??50,o=i?.max??s**2,r=i?.key??void 0,a=`${nee.of(e)},${s}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new uSt(s*1.5)):c=new gSt(this._logService,t,e,this._overallAverage()|0||s*1.5,s,o),this._data.set(a,c)),c}_overallAverage(){const e=new lNe;for(const t of this._data.values())e.update(t.default());return e.value}};Uwe=D([_(0,Ze),_(1,Il)],Uwe);ce(B_,Uwe,Yt.Delayed);const OW="vs/base/common/errorMessage";function wfe(n,e){return e&&(n.stack||n.stacktrace)?g(OW,0,"{0}: {1}",CHe(n),bHe(n.stack)||bHe(n.stacktrace)):CHe(n)}function bHe(n){return Array.isArray(n)?n.join(` +`):n}function CHe(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?g(OW,1,"A system error occurred ({0})",n.message):n.message||g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function Ma(n=null,e=!1){if(!n)return g(OW,2,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=Ui(n),i=Ma(t[0],e);return t.length>1?g(OW,3,"{0} ({1} errors in total)",i,t.length):i}if(zt(n))return n;if(n.detail){const t=n.detail;if(t.error)return wfe(t.error,e);if(t.exception)return wfe(t.exception,e)}return n.stack?wfe(n,e):n.message?n.message:g(OW,2,"An unknown error occurred. Please consult the log for more details.")}function fSt(n){const e=n;return e instanceof Error&&Array.isArray(e.actions)}function pSt(n,e){let t;return typeof n=="string"?t=new Error(n):t=n,t.actions=e,t}function kYe(n){return Kc(n)}var Pn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(Pn||(Pn={}));const dNe=Pn.Info;function see(n,e,t){switch(e){case Pn.Trace:n.trace(t);break;case Pn.Debug:n.debug(t);break;case Pn.Info:n.info(t);break;case Pn.Warning:n.warn(t);break;case Pn.Error:n.error(t);break;case Pn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function $O(n,e=!1){let t="";for(let i=0;i0?" ":"")+s}return t}class hNe extends ${constructor(){super(...arguments),this.level=dNe,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Pn.Off&&this.level<=e}}class ude extends hNe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&this.log(Pn.Trace,$O([e,...t],!0))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&this.log(Pn.Debug,$O([e,...t]))}info(e,...t){this.checkLogLevel(Pn.Info)&&this.log(Pn.Info,$O([e,...t]))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&this.log(Pn.Warning,$O([e,...t]))}error(e,...t){if(this.checkLogLevel(Pn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Pn.Error,$O(i))}else this.log(Pn.Error,$O([e,...t]))}flush(){}}let mSt=class extends hNe{constructor(e=dNe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Pn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Pn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Pn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Pn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Pn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class _St extends hNe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}flush(){for(const e of this.loggers)e.flush()}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class IYe extends ${constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new wi,this._onDidChangeLoggers=this._register(new I),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new I),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,i)for(const s of i)this._loggers.set(s.resource,{logger:void 0,info:s})}getLoggerEntry(e){return zt(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){const i=this.toResource(e),s=zt(e)?e:t?.id??Ed(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Pn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:s}));const a={logger:o,info:{resource:i,id:s,logLevel:r,name:t?.name,hidden:t?.hidden,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),o}toResource(e){return zt(e)?Qt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(P.isUri(e)){const i=e,s=t,o=this._loggers.get(i);o&&s!==o.info.logLevel&&(o.info.logLevel=s===this.logLevel?void 0:s,o.logger?.setLevel(s),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,s]))}else{this.logLevel=e;for(const[i,s]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&s.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){const t=this._loggers.get(e);t&&(t.logger&&t.logger.dispose(),this._loggers.delete(e),this._onDidChangeLoggers.fire({added:[],removed:[t.info]}))}*getRegisteredLoggers(){for(const 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()}}class LYe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Pn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class vSt extends LYe{}function c7(n){switch(n){case Pn.Trace:return"trace";case Pn.Debug:return"debug";case Pn.Info:return"info";case Pn.Warning:return"warn";case Pn.Error:return"error";case Pn.Off:return"off"}}function TYe(n){switch(n){case"trace":return Pn.Trace;case"debug":return Pn.Debug;case"info":return Pn.Info;case"warn":return Pn.Warning;case"error":return Pn.Error;case"critical":return Pn.Error;case"off":return Pn.Off}}const wSt=new Y("logLevel",c7(Pn.Info));class R${static create(e,t){return new R$(e,new oee(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new O(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[s,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new R$(this._startLineNumber,s),new R$(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=Gb(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):Q.Null)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class oee{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;ae||u===e&&p>=t)&&(ue||p===e&&v>=t){if(po?m-=o-i:m=i;else if(f===t&&p===i)if(f===s&&m>o)m-=o-i;else{d=!0;continue}else if(fo)f=t,p=i,m=p+(m-o);else{d=!0;continue}else if(f>s){if(c===0&&!d){l=a;break}f-=c}else if(f===s&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const w=4*l;r[w]=f,r[w+1]=p,r[w+2]=m,r[w+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=Q.Digit0&&r<=Q.Digit9||r>=Q.A&&r<=Q.Z||r>=Q.a&&r<=Q.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;l>0&&this._logService.getLevel()===Pn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),c.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=BW.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?ar.Italic:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_ITALIC}if(typeof d.bold<"u"){const h=(d.bold?ar.Bold:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_BOLD}if(typeof d.underline<"u"){const h=(d.underline?ar.Underline:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_UNDERLINE}if(typeof d.strikethrough<"u"){const h=(d.strikethrough?ar.Strikethrough:0)<<$i.FONT_STYLE_OFFSET;r|=h|$i.SEMANTIC_USE_STRIKETHROUGH}if(d.foreground){const h=d.foreground<<$i.FOREGROUND_OFFSET;r|=h|$i.SEMANTIC_USE_FOREGROUND}r===0&&(r=BW.NO_STYLING)}}else this._logService.getLevel()===Pn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=BW.NO_STYLING,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Pn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${c.join(" ")}): foreground ${Xf.getForeground(r)}, fontStyle ${Xf.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};Vwe=D([_(1,pn),_(2,Di),_(3,Ze)],Vwe);var ree;(function(n){n[n.DesiredTokensPerArea=400]="DesiredTokensPerArea",n[n.DesiredMaxAreas=1024]="DesiredMaxAreas"})(ree||(ree={}));function RYe(n,e,t){const i=n.data,s=n.data.length/5|0,o=Math.max(Math.ceil(s/ree.DesiredMaxAreas),ree.DesiredTokensPerArea),r=[];let a=0,c=1,l=0;for(;ad&&i[5*b]===0;)b--;if(b-1===d){let C=h;for(;C+1M)e.warnOverlappingSemanticTokens(S,M+1);else{const U=e.getMetadata(N,z,t);U!==BW.NO_STYLING&&(p===0&&(p=S),u[f]=S-p,u[f+1]=M,u[f+2]=F,u[f+3]=U,f+=4,m=S,v=F)}c=S,l=M,a++}f!==u.length&&(u=u.subarray(0,f));const w=R$.create(p,u);r.push(w)}return r}class bSt{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}const OA=class OA{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=OA._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Vwe(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};$we=D([_(0,pn),_(1,Ze),_(2,Di)],$we);ce(gde,$we,Yt.Delayed);const mR="**",Gwe="/",rJ="[/\\\\]",aJ="[^/\\\\]",CSt=/\//g;function SHe(n,e){switch(n){case 0:return"";case 1:return`${aJ}*?`;default:return`(?:${rJ}|${aJ}+${rJ}${e?`|${rJ}${aJ}+`:""})*?`}}function qwe(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function MYe(n){if(!n)return"";let e="";const t=qwe(n,Gwe);if(t.every(i=>i===mR))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===mR){if(i)return;e+=SHe(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===Gwe?h="":h=Iu(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${qwe(a,",").map(f=>MYe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=aJ;continue;case"*":e+=SHe(1);continue;default:e+=Iu(d)}}ouNe(a,e)).filter(a=>a!==_S),n),i=t.length;if(!i)return _S;if(i===1)return t[0];const s=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function DHe(n,e,t){const i=dg===Qi.sep,s=i?n:n.replace(CSt,dg),o=dg+s,r=Qi.sep+n;let a;return t?a=function(c,l){return typeof c=="string"&&(c===s||c.endsWith(o)||!i&&(c===n||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===s||!i&&c===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function TSt(n){try{const e=new RegExp(`^${MYe(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return _S}}function WW(n,e,t){return!n||typeof e!="string"?!1:_w(n)(e,void 0,t)}function _w(n,e={}){if(!n)return EHe;if(typeof n=="string"||NYe(n)){const t=uNe(n,e);if(t===_S)return EHe;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return RSt(n,e)}function NYe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function RSt(n,e){const t=PYe(Object.getOwnPropertyNames(n).map(a=>MSt(a,n[a],e)).filter(a=>a!==_S)),i=t.length;if(!i)return _S;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let f=0,p=t.length;f{for(const f of u){const p=await f;if(typeof p=="string")return p}return null})():null},c=t.find(d=>!!d.allBasenames);c&&(a.allBasenames=c.allBasenames);const l=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return l.length&&(a.allPaths=l),a}const s=function(a,c,l){let d,h;for(let u=0,f=t.length;u{for(const u of h){const f=await u;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function MSt(n,e,t){if(e===!1)return _S;const i=uNe(n,t);if(i===_S)return _S;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=s.replace("$(basename)",()=>c),h=l(d);return NS(h)?h.then(u=>u?n:null):h?n:null};return o.requiresSiblings=!0,o}}return i}function PYe(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let s;if(e){s=[];for(let a=0,c=i.length;a{const l=c.patterns;return l?a.concat(l):a},[]);const o=function(a,c){if(typeof a!="string")return null;if(!c){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===Q.Slash||h===Q.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?s[l]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function fde(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const c=fde(a,e,t,i,s,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=n;if(!i&&!l)return 0;d&&s&&(e=s);let h=0;if(c)if(c===e.scheme)h=10;else if(c==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===o)h=10;else if(d==="*"&&o!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:d1(a.base)},u===e.fsPath||WW(u,e.fsPath))h=10;else return 0}return h}else return 0}}function FYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(FYe):!!n.notebookType}function OYe(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(OYe):!!n.exclusive}class kHe{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()}}class Po{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ee(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){const t=this._notebookInfoResolver?.(e.uri),i=t?new kHe(e.uri,e.getLanguageId(),t.uri,t.type):new kHe(e.uri,e.getLanguageId(),void 0,void 0);if(!this._lastCandidate?.equals(i)){this._lastCandidate=i;for(const s of this._entries)if(s._score=fde(s.selector,i.uri,i.languageId,gS(e),i.notebookUri,i.notebookType),OYe(s.selector)&&s._score>0){for(const o of this._entries)o._score=0;s._score=1e3;break}this._entries.sort(Po._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:w3(e.selector)&&!w3(t.selector)?1:!w3(e.selector)&&w3(t.selector)?-1:e._timet._time?-1:0}}function w3(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(w3):!!n.isBuiltin}class NSt{constructor(){this.referenceProvider=new Po(this._score.bind(this)),this.renameProvider=new Po(this._score.bind(this)),this.newSymbolNamesProvider=new Po(this._score.bind(this)),this.codeActionProvider=new Po(this._score.bind(this)),this.definitionProvider=new Po(this._score.bind(this)),this.typeDefinitionProvider=new Po(this._score.bind(this)),this.declarationProvider=new Po(this._score.bind(this)),this.implementationProvider=new Po(this._score.bind(this)),this.documentSymbolProvider=new Po(this._score.bind(this)),this.inlayHintsProvider=new Po(this._score.bind(this)),this.colorProvider=new Po(this._score.bind(this)),this.codeLensProvider=new Po(this._score.bind(this)),this.documentFormattingEditProvider=new Po(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Po(this._score.bind(this)),this.onTypeFormattingEditProvider=new Po(this._score.bind(this)),this.signatureHelpProvider=new Po(this._score.bind(this)),this.hoverProvider=new Po(this._score.bind(this)),this.documentHighlightProvider=new Po(this._score.bind(this)),this.multiDocumentHighlightProvider=new Po(this._score.bind(this)),this.selectionRangeProvider=new Po(this._score.bind(this)),this.foldingRangeProvider=new Po(this._score.bind(this)),this.linkProvider=new Po(this._score.bind(this)),this.inlineCompletionsProvider=new Po(this._score.bind(this)),this.inlineEditProvider=new Po(this._score.bind(this)),this.completionProvider=new Po(this._score.bind(this)),this.linkedEditingRangeProvider=new Po(this._score.bind(this)),this.inlineValuesProvider=new Po(this._score.bind(this)),this.evaluatableExpressionProvider=new Po(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Po(this._score.bind(this)),this.documentSemanticTokensProvider=new Po(this._score.bind(this)),this.documentDropEditProvider=new Po(this._score.bind(this)),this.documentPasteEditProvider=new Po(this._score.bind(this)),this.mappedEditsProvider=new Po(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(ht,NSt,Yt.Delayed);const el=ae("hoverService"),W_=ae("contextViewService"),Vr=ae("contextMenuService");var PSt='.monaco-workbench .workbench-hover{background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorHoverWidget-foreground);font-size:13px;line-height:19px;max-width:700px;overflow:hidden;position:relative;z-index:40}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{pointer-events:none;position:absolute;z-index:41}.monaco-workbench .workbench-hover-pointer:after{background-color:var(--vscode-editorHoverWidget-background);border-bottom:1px solid var(--vscode-editorHoverWidget-border);border-right:1px solid var(--vscode-editorHoverWidget-border);content:"";height:5px;position:absolute;width:5px}.monaco-workbench .locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;height:4px;width:4px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;text-decoration:underline}.monaco-workbench .workbench-hover a:active,.monaco-workbench .workbench-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}';Ct(PSt,{});var FSt='.monaco-hover{animation:fadein .1s linear;box-sizing:border-box;cursor:default;line-height:1.5em;overflow:hidden;position:absolute;user-select:text;-webkit-user-select:text;white-space:var(--vscode-hover-whiteSpace,normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){word-wrap:break-word;max-width:var(--vscode-hover-maxWidth,500px)}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover .code,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6,.monaco-hover p,.monaco-hover ul{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{border-left:0;border-right:0;box-sizing:border-box;height:1px;margin:4px -8px -4px}.monaco-hover .code:first-child,.monaco-hover p:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover .code:last-child,.monaco-hover p:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ol,.monaco-hover ul{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace,pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{cursor:pointer;margin-right:16px}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link,.monaco-hover .hover-contents a.code-link:hover{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-foreground);text-decoration:underline;text-underline-position:under}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{display:inline-block;margin-bottom:4px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{cursor:default;opacity:.4;pointer-events:none}';Ct(FSt,{});const IHe="vs/base/browser/ui/hover/hoverWidget",jj=we;var Oo;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BELOW=2]="BELOW",n[n.ABOVE=3]="ABOVE"})(Oo||(Oo={}));let gNe=class extends ${constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new bz(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class fNe extends ${static render(e,t,i){return new fNe(e,t,i)}constructor(e,t,i){super(),this.actionContainer=he(e,jj("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=he(this.actionContainer,jj("a.action")),this.action.setAttribute("role","button"),t.iconClass&&he(this.action,jj(`span.icon.${t.iconClass}`));const s=he(this.action,jj("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new WYe(this.actionContainer,t.run)),this._store.add(new HYe(this.actionContainer,t.run,[E.Enter,E.Space])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function BYe(n,e){return n&&e?g(IHe,0,"Inspect this in the accessible view with {0}.",e):n?g(IHe,1,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class WYe extends ${constructor(e,t){super(),this._register(pe(e,xe.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class HYe extends ${constructor(e,t,i){super(),this._register(pe(e,xe.KEY_DOWN,s=>{const o=new os(s);i.some(r=>o.equals(r))&&(s.stopPropagation(),s.preventDefault(),t(e))}))}}var Dh;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),c=Math.min(o.end,r.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],c={start:o.start,end:Math.min(r.start,o.end)},l={start:Math.max(r.end,o.start),end:o.end};return t(c)||a.push(c),t(l)||a.push(l),a}n.relativeComplement=s})(Dh||(Dh={}));var OSt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";Ct(OSt,{});var by;(function(n){n[n.ABSOLUTE=1]="ABSOLUTE",n[n.FIXED=2]="FIXED",n[n.FIXED_SHADOW=3]="FIXED_SHADOW"})(by||(by={}));function BSt(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Ob;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(Ob||(Ob={}));var Jp;(function(n){n[n.BELOW=0]="BELOW",n[n.ABOVE=1]="ABOVE"})(Jp||(Jp={}));var aee;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(aee||(aee={}));var Hp;(function(n){n[n.Before=0]="Before",n[n.After=1]="After"})(Hp||(Hp={}));var Qk;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(Qk||(Qk={}));function i2(n,e,t){const i=t.mode===Qk.ALIGN?t.offset:t.offset+t.size,s=t.mode===Qk.ALIGN?t.offset+t.size:t.offset;return t.position===Hp.Before?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const V2=class V2 extends ${constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=$.None,this.toDisposeOnSetContainer=$.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=we(".context-view"),Jl(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,by.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==by.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===by.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=we(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=WSt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(we("slot"))}else this.container.appendChild(this.view);const s=new Z;V2.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),V2.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Xo(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){this.isVisible()&&this.hide(),Yo(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Oh(this.view),this.toDisposeOnClean=e.render(this.view)||$.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(I_&&nMe.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Ra(e)){const u=ia(e),f=lje(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else BSt(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=du(this.view),s=Zf(this.view),o=this.delegate.anchorPosition||Jp.BELOW,r=this.delegate.anchorAlignment||Ob.LEFT,a=this.delegate.anchorAxisAlignment||aee.VERTICAL;let c,l;const d=ax();if(a===aee.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After},f={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After,mode:Qk.ALIGN};c=i2(d.innerHeight,s,u)+d.pageYOffset,Dh.intersects({start:c,end:c+s},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),l=i2(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===Ob.LEFT?Hp.Before:Hp.After},f={offset:t.top,size:t.height,position:o===Jp.BELOW?Hp.Before:Hp.After,mode:Qk.ALIGN};l=i2(d.innerWidth,i,u),Dh.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Qk.AVOID),c=i2(d.innerHeight,s,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Jp.BELOW?"bottom":"top"),this.view.classList.add(r===Ob.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=ia(this.container);this.view.style.top=`${c-(this.useFixedPosition?ia(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?ia(this.view).left:h.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Jl(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,gt(e).document.activeElement):t&&!al(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};V2.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],V2.BUBBLE_DOWN_EVENTS=["click"];let Qwe=V2;const WSt=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -157,7 +157,7 @@ Received: '{1}'.`,e,e5.getLexeme(t)),o=t.offset,r=e5.getLexeme(t);return this._p :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } `,fr=ae("openerService");function HSt(n,e={}){const t=mNe(e);return t.textContent=n,t}function pNe(n,e={}){const t=mNe(e);return UYe(t,VSt(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function mNe(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class USt{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}var Va;(function(n){n[n.Invalid=0]="Invalid",n[n.Root=1]="Root",n[n.Text=2]="Text",n[n.Bold=3]="Bold",n[n.Italics=4]="Italics",n[n.Action=5]="Action",n[n.ActionClose=6]="ActionClose",n[n.Code=7]="Code",n[n.NewLine=8]="NewLine"})(Va||(Va={}));function UYe(n,e,t,i){let s;if(e.type===Va.Text)s=document.createTextNode(e.content||"");else if(e.type===Va.Bold)s=document.createElement("b");else if(e.type===Va.Italics)s=document.createElement("i");else if(e.type===Va.Code&&i)s=document.createElement("code");else if(e.type===Va.Action&&t){const o=document.createElement("a");t.disposables.add(Xo(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===Va.NewLine?s=document.createElement("br"):e.type===Va.Root&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{UYe(s,o,t,i)})}function VSt(n,e){const t={type:Va.Root,children:[]};let i=0,s=t;const o=[],r=new USt(n);for(;!r.eos();){let a=r.next();const c=a==="\\"&&jwe(r.peek(),e)!==Va.Invalid;if(c&&(a=r.next()),!c&&zSt(a,e)&&a===r.peek()){r.advance(),s.type===Va.Text&&(s=o.pop());const l=jwe(a,e);if(s.type===l||s.type===Va.Action&&l===Va.ActionClose)s=o.pop();else{const d={type:l,children:[]};l===Va.Action&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` -`)s.type===Va.Text&&(s=o.pop()),s.children.push({type:Va.NewLine});else if(s.type!==Va.Text){const l={type:Va.Text,content:a};s.children.push(l),o.push(s),s=l}else s.content+=a}return s.type===Va.Text&&(s=o.pop()),t}function zSt(n,e){return jwe(n,e)!==Va.Invalid}function jwe(n,e){switch(n){case"*":return Va.Bold;case"_":return Va.Italics;case"[":return Va.Action;case"]":return Va.ActionClose;case"`":return e?Va.Code:Va.Invalid;default:return Va.Invalid}}const $St=new RegExp(`(\\\\)?\\$\\((${$e.iconNameExpression}(?:${$e.iconModifierExpression})?)\\)`,"g");function nw(n){const e=new Array;let t,i=0,s=0;for(;(t=$St.exec(n))!==null;){s=t.index||0,i0)return new Uint32Array(e)}let Mp=0;const bk=new Uint32Array(10);function qSt(n){if(Mp=0,vC(n,Cfe,Nd.InitialConsonant),Mp>0||(vC(n,yfe,Nd.Vowel),Mp>0)||(vC(n,Sfe,Nd.FinalConsonant),Mp>0)||(vC(n,CL,Nd.CompatibilityJamo),Mp))return bk.subarray(0,Mp);if(n>=44032&&n<=55203){const e=n-44032,t=e%588,i=Math.floor(e/588),s=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return bk.subarray(0,Mp)}}function vC(n,e,t){n>=t&&n>8&&(bk[Mp++]=n>>8&255),n>>16&&(bk[Mp++]=n>>16&255))}var Nd;(function(n){n[n.InitialConsonant=4352]="InitialConsonant",n[n.Vowel=4449]="Vowel",n[n.FinalConsonant=4520]="FinalConsonant",n[n.CompatibilityJamo=12593]="CompatibilityJamo"})(Nd||(Nd={}));var $t;(function(n){n[n.NUL=0]="NUL",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z"})($t||($t={}));var So;(function(n){n[n.fa=24934]="fa",n[n.fg=26470]="fg",n[n.fq=29030]="fq",n[n.fr=29286]="fr",n[n.ft=29798]="ft",n[n.fv=30310]="fv",n[n.fx=30822]="fx",n[n.hk=27496]="hk",n[n.hl=27752]="hl",n[n.ho=28520]="ho",n[n.ml=27757]="ml",n[n.nj=27246]="nj",n[n.nl=27758]="nl",n[n.np=28782]="np",n[n.qt=29809]="qt",n[n.rt=29810]="rt",n[n.sg=26483]="sg",n[n.sw=30579]="sw"})(So||(So={}));const Cfe=new Uint8Array([$t.r,$t.R,$t.s,$t.e,$t.E,$t.f,$t.a,$t.q,$t.Q,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g]),yfe=new Uint16Array([$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,So.hk,So.ho,So.hl,$t.y,$t.n,So.nj,So.np,So.nl,$t.b,$t.m,So.ml,$t.l]),Sfe=new Uint16Array([$t.r,$t.R,So.rt,$t.s,So.sw,So.sg,$t.e,$t.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,$t.a,$t.q,So.qt,$t.t,$t.T,$t.d,$t.w,$t.c,$t.z,$t.x,$t.v,$t.g]),CL=new Uint16Array([$t.r,$t.R,So.rt,$t.s,So.sw,So.sg,$t.e,$t.E,$t.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,$t.a,$t.q,$t.Q,So.qt,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g,$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,So.hk,So.ho,So.hl,$t.y,$t.n,So.nj,So.np,So.nl,$t.b,$t.m,So.ml,$t.l]);function KU(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function pde(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function zYe(n,e){return Kwe(n.toLowerCase(),e.toLowerCase(),0,0)}function Kwe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=Kwe(n,e,t+1,i+1))?wNe({start:i,end:i+1},s):null}return Kwe(n,e,t,i+1)}function _Ne(n){return q.a<=n&&n<=q.z}function pQ(n){return q.A<=n&&n<=q.Z}function vNe(n){return q.Digit0<=n&&n<=q.Digit9}function $Ye(n){return n===q.Space||n===q.Tab||n===q.LineFeed||n===q.CarriageReturn}const GYe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>GYe.add(n.charCodeAt(0)));function cee(n){return $Ye(n)||GYe.has(n)}function LHe(n,e){return n===e||cee(n)&&cee(e)}const Afe=new Map;function THe(n){if(Afe.has(n))return Afe.get(n);let e;const t=GSt(n);return t&&(e=t),Afe.set(n,e),e}function qYe(n){return _Ne(n)||pQ(n)||vNe(n)}function wNe(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function QYe(n,e){for(let t=e;t0&&!qYe(n.charCodeAt(t-1)))return t}return n.length}function Ywe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=Ywe(n,e,t+1,i+1);!s&&(o=QYe(e,o)).6}function YSt(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function JSt(n){let e=0,t=0,i=0,s=0;for(let o=0;o60&&(e=e.substring(0,60));const t=jSt(e);if(!YSt(t)){if(!KSt(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&cee(n.charCodeAt(t-1)))return t;return n.length}const XSt=KU(dF,lee,pde),ZSt=KU(dF,lee,zYe),RHe=new L_(1e4);function dee(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=RHe.get(n);i||(i=new RegExp(Rlt(n),"i"),RHe.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?ZSt(n,e):XSt(n,e)}function KYe(n,e){const t=v1(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?Cz(t):null}function eAt(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const jk=128;function bNe(){const n=[],e=[];for(let t=0;t<=jk;t++)e[t]=0;for(let t=0;t<=jk;t++)n.push(e.slice(0));return n}function YYe(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const JYe=YYe(2*jk),Xwe=YYe(2*jk),lA=bNe(),yL=bNe(),Kj=bNe();function Yj(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case q.Underline:case q.Dash:case q.Period:case q.Space:case q.Slash:case q.Backslash:case q.SingleQuote:case q.DoubleQuote:case q.Colon:case q.DollarSign:case q.LessThan:case q.GreaterThan:case q.OpenParen:case q.CloseParen:case q.OpenSquareBracket:case q.CloseSquareBracket:case q.OpenCurlyBrace:case q.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!JRe(t)}}function MHe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case q.Space:case q.Tab:return!0;default:return!1}}function cJ(n,e,t){return e[n]!==t[n]}function XYe(n,e,t,i,s,o,r=!1){for(;ejk?jk:n.length,c=i.length>jk?jk:i.length;if(t>=a||o>=c||a-t>c-o||!XYe(e,t,a,s,o,c,!0))return;tAt(a,c,t,o,e,s);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hb,N=F?yL[l][d-1]+(lA[l][d-1]>0?-5:0):0,z=u>b+1&&lA[l][d-1]>0,U=z?yL[l][d-2]+(lA[l][d-2]>0?-5:0):0;if(z&&(!F||U>=N)&&(!M||U>=k))yL[l][d]=U,Kj[l][d]=IT.LeftLeft,lA[l][d]=0;else if(F&&(!M||N>=k))yL[l][d]=N,Kj[l][d]=IT.Left,lA[l][d]=0;else if(M)yL[l][d]=k,Kj[l][d]=IT.Diag,lA[l][d]=lA[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[yL[l][d],o];let m=0,v=0;for(;l>=1;){let b=d;do{const C=Kj[l][b];if(C===IT.LeftLeft)b=b-2;else if(C===IT.Left)b=b-1;else break}while(b>=1);m>1&&e[t+l-1]===s[o+d-1]&&!cJ(b+o-1,i,s)&&m+1>lA[l][b]&&(b=d),b===d?m++:m=1,v||(v=b),l--,d=b-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const w=v-a;return p[0]-=w,p}function tAt(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(Xwe[r]=a,r--),a--}function iAt(n,e,t,i,s,o,r,a,c,l,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=n[t]===s[r]?7:5:cJ(r,s,o)&&(r===0||!cJ(r-1,s,o))?(h=n[t]===s[r]?7:5,u=!0):Yj(o,r)&&(r===0||!Yj(o,r-1))?h=5:(Yj(o,r-1)||MHe(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=cJ(r,s,o)||Yj(o,r-1)||MHe(o,r-1)),t===i?r>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function nAt(n,e,t,i,s,o,r){return sAt(n,e,t,i,s,o,!0,r)}function sAt(n,e,t,i,s,o,r,a){let c=v1(n,e,t,i,s,o,a);if(c&&!r)return c;if(n.length>=3){const l=Math.min(7,n.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function oAt(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const rAt="$(",CNe=new RegExp(`\\$\\(${$e.iconNameExpression}(?:${$e.iconModifierExpression})?\\)`,"g"),aAt=new RegExp(`(\\\\)?${CNe.source}`,"g");function cAt(n){return n.replace(aAt,(e,t)=>t?e:`\\${e}`)}const lAt=new RegExp(`\\\\${CNe.source}`,"g");function dAt(n){return n.replace(lAt,e=>`\\${e}`)}const hAt=new RegExp(`(\\s)?(\\\\)?${CNe.source}(\\s)?`,"g");function mde(n){return n.indexOf(rAt)===-1?n:n.replace(hAt,(e,t,i,s)=>i?e:t||s||"")}function ZYe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Efe=new RegExp(`\\$\\(${$e.iconNameCharacter}+\\)`,"g");function n2(n){Efe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=Efe.lastIndex,o=Efe.exec(n),r=n.substring(s,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===hee.Break?`\\ +`)s.type===Va.Text&&(s=o.pop()),s.children.push({type:Va.NewLine});else if(s.type!==Va.Text){const l={type:Va.Text,content:a};s.children.push(l),o.push(s),s=l}else s.content+=a}return s.type===Va.Text&&(s=o.pop()),t}function zSt(n,e){return jwe(n,e)!==Va.Invalid}function jwe(n,e){switch(n){case"*":return Va.Bold;case"_":return Va.Italics;case"[":return Va.Action;case"]":return Va.ActionClose;case"`":return e?Va.Code:Va.Invalid;default:return Va.Invalid}}const $St=new RegExp(`(\\\\)?\\$\\((${$e.iconNameExpression}(?:${$e.iconModifierExpression})?)\\)`,"g");function nw(n){const e=new Array;let t,i=0,s=0;for(;(t=$St.exec(n))!==null;){s=t.index||0,i0)return new Uint32Array(e)}let Mp=0;const bk=new Uint32Array(10);function qSt(n){if(Mp=0,vC(n,Cfe,Nd.InitialConsonant),Mp>0||(vC(n,yfe,Nd.Vowel),Mp>0)||(vC(n,Sfe,Nd.FinalConsonant),Mp>0)||(vC(n,CL,Nd.CompatibilityJamo),Mp))return bk.subarray(0,Mp);if(n>=44032&&n<=55203){const e=n-44032,t=e%588,i=Math.floor(e/588),s=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return bk.subarray(0,Mp)}}function vC(n,e,t){n>=t&&n>8&&(bk[Mp++]=n>>8&255),n>>16&&(bk[Mp++]=n>>16&255))}var Nd;(function(n){n[n.InitialConsonant=4352]="InitialConsonant",n[n.Vowel=4449]="Vowel",n[n.FinalConsonant=4520]="FinalConsonant",n[n.CompatibilityJamo=12593]="CompatibilityJamo"})(Nd||(Nd={}));var $t;(function(n){n[n.NUL=0]="NUL",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z"})($t||($t={}));var So;(function(n){n[n.fa=24934]="fa",n[n.fg=26470]="fg",n[n.fq=29030]="fq",n[n.fr=29286]="fr",n[n.ft=29798]="ft",n[n.fv=30310]="fv",n[n.fx=30822]="fx",n[n.hk=27496]="hk",n[n.hl=27752]="hl",n[n.ho=28520]="ho",n[n.ml=27757]="ml",n[n.nj=27246]="nj",n[n.nl=27758]="nl",n[n.np=28782]="np",n[n.qt=29809]="qt",n[n.rt=29810]="rt",n[n.sg=26483]="sg",n[n.sw=30579]="sw"})(So||(So={}));const Cfe=new Uint8Array([$t.r,$t.R,$t.s,$t.e,$t.E,$t.f,$t.a,$t.q,$t.Q,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g]),yfe=new Uint16Array([$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,So.hk,So.ho,So.hl,$t.y,$t.n,So.nj,So.np,So.nl,$t.b,$t.m,So.ml,$t.l]),Sfe=new Uint16Array([$t.r,$t.R,So.rt,$t.s,So.sw,So.sg,$t.e,$t.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,$t.a,$t.q,So.qt,$t.t,$t.T,$t.d,$t.w,$t.c,$t.z,$t.x,$t.v,$t.g]),CL=new Uint16Array([$t.r,$t.R,So.rt,$t.s,So.sw,So.sg,$t.e,$t.E,$t.f,So.fr,So.fa,So.fq,So.ft,So.fx,So.fv,So.fg,$t.a,$t.q,$t.Q,So.qt,$t.t,$t.T,$t.d,$t.w,$t.W,$t.c,$t.z,$t.x,$t.v,$t.g,$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,So.hk,So.ho,So.hl,$t.y,$t.n,So.nj,So.np,So.nl,$t.b,$t.m,So.ml,$t.l]);function KU(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function pde(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function zYe(n,e){return Kwe(n.toLowerCase(),e.toLowerCase(),0,0)}function Kwe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=Kwe(n,e,t+1,i+1))?wNe({start:i,end:i+1},s):null}return Kwe(n,e,t,i+1)}function _Ne(n){return Q.a<=n&&n<=Q.z}function pQ(n){return Q.A<=n&&n<=Q.Z}function vNe(n){return Q.Digit0<=n&&n<=Q.Digit9}function $Ye(n){return n===Q.Space||n===Q.Tab||n===Q.LineFeed||n===Q.CarriageReturn}const GYe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>GYe.add(n.charCodeAt(0)));function cee(n){return $Ye(n)||GYe.has(n)}function LHe(n,e){return n===e||cee(n)&&cee(e)}const Afe=new Map;function THe(n){if(Afe.has(n))return Afe.get(n);let e;const t=GSt(n);return t&&(e=t),Afe.set(n,e),e}function qYe(n){return _Ne(n)||pQ(n)||vNe(n)}function wNe(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function QYe(n,e){for(let t=e;t0&&!qYe(n.charCodeAt(t-1)))return t}return n.length}function Ywe(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=Ywe(n,e,t+1,i+1);!s&&(o=QYe(e,o)).6}function YSt(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function JSt(n){let e=0,t=0,i=0,s=0;for(let o=0;o60&&(e=e.substring(0,60));const t=jSt(e);if(!YSt(t)){if(!KSt(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&cee(n.charCodeAt(t-1)))return t;return n.length}const XSt=KU(dF,lee,pde),ZSt=KU(dF,lee,zYe),RHe=new L_(1e4);function dee(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=RHe.get(n);i||(i=new RegExp(Rlt(n),"i"),RHe.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?ZSt(n,e):XSt(n,e)}function KYe(n,e){const t=v1(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?Cz(t):null}function eAt(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const jk=128;function bNe(){const n=[],e=[];for(let t=0;t<=jk;t++)e[t]=0;for(let t=0;t<=jk;t++)n.push(e.slice(0));return n}function YYe(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const JYe=YYe(2*jk),Xwe=YYe(2*jk),lA=bNe(),yL=bNe(),Kj=bNe();function Yj(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case Q.Underline:case Q.Dash:case Q.Period:case Q.Space:case Q.Slash:case Q.Backslash:case Q.SingleQuote:case Q.DoubleQuote:case Q.Colon:case Q.DollarSign:case Q.LessThan:case Q.GreaterThan:case Q.OpenParen:case Q.CloseParen:case Q.OpenSquareBracket:case Q.CloseSquareBracket:case Q.OpenCurlyBrace:case Q.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!JRe(t)}}function MHe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case Q.Space:case Q.Tab:return!0;default:return!1}}function cJ(n,e,t){return e[n]!==t[n]}function XYe(n,e,t,i,s,o,r=!1){for(;ejk?jk:n.length,c=i.length>jk?jk:i.length;if(t>=a||o>=c||a-t>c-o||!XYe(e,t,a,s,o,c,!0))return;tAt(a,c,t,o,e,s);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hb,N=F?yL[l][d-1]+(lA[l][d-1]>0?-5:0):0,z=u>b+1&&lA[l][d-1]>0,U=z?yL[l][d-2]+(lA[l][d-2]>0?-5:0):0;if(z&&(!F||U>=N)&&(!M||U>=k))yL[l][d]=U,Kj[l][d]=IT.LeftLeft,lA[l][d]=0;else if(F&&(!M||N>=k))yL[l][d]=N,Kj[l][d]=IT.Left,lA[l][d]=0;else if(M)yL[l][d]=k,Kj[l][d]=IT.Diag,lA[l][d]=lA[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[yL[l][d],o];let m=0,v=0;for(;l>=1;){let b=d;do{const C=Kj[l][b];if(C===IT.LeftLeft)b=b-2;else if(C===IT.Left)b=b-1;else break}while(b>=1);m>1&&e[t+l-1]===s[o+d-1]&&!cJ(b+o-1,i,s)&&m+1>lA[l][b]&&(b=d),b===d?m++:m=1,v||(v=b),l--,d=b-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const w=v-a;return p[0]-=w,p}function tAt(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(Xwe[r]=a,r--),a--}function iAt(n,e,t,i,s,o,r,a,c,l,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=n[t]===s[r]?7:5:cJ(r,s,o)&&(r===0||!cJ(r-1,s,o))?(h=n[t]===s[r]?7:5,u=!0):Yj(o,r)&&(r===0||!Yj(o,r-1))?h=5:(Yj(o,r-1)||MHe(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=cJ(r,s,o)||Yj(o,r-1)||MHe(o,r-1)),t===i?r>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function nAt(n,e,t,i,s,o,r){return sAt(n,e,t,i,s,o,!0,r)}function sAt(n,e,t,i,s,o,r,a){let c=v1(n,e,t,i,s,o,a);if(c&&!r)return c;if(n.length>=3){const l=Math.min(7,n.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function oAt(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const rAt="$(",CNe=new RegExp(`\\$\\(${$e.iconNameExpression}(?:${$e.iconModifierExpression})?\\)`,"g"),aAt=new RegExp(`(\\\\)?${CNe.source}`,"g");function cAt(n){return n.replace(aAt,(e,t)=>t?e:`\\${e}`)}const lAt=new RegExp(`\\\\${CNe.source}`,"g");function dAt(n){return n.replace(lAt,e=>`\\${e}`)}const hAt=new RegExp(`(\\s)?(\\\\)?${CNe.source}(\\s)?`,"g");function mde(n){return n.indexOf(rAt)===-1?n:n.replace(hAt,(e,t,i,s)=>i?e:t||s||"")}function ZYe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Efe=new RegExp(`\\$\\(${$e.iconNameCharacter}+\\)`,"g");function n2(n){Efe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=Efe.lastIndex,o=Efe.exec(n),r=n.substring(s,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===hee.Break?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` @@ -179,8 +179,8 @@ ${gAt(t,e)} `)+` `;break}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(u),s&&(o=s[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!s,checked:o,loose:!1,text:u}),m.raw+=i,e=e.slice(i.length)}m.items[m.items.length-1].raw=i.trimRight(),m.items[m.items.length-1].text=u.trimRight(),m.raw=m.raw.trimRight();const w=m.items.length;for(a=0;ab.type==="space")&&(m.loose=!0,m.items[a].loose=!0);return m}}html(e){const t=this.rules.block.html.exec(e);if(t){const i={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};return this.options.sanitize&&(i.type="paragraph",i.text=this.options.sanitizer?this.options.sanitizer(t[0]):nv(t[0]),i.tokens=[],this.lexer.inline(i.text,i.tokens)),i}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const i={type:"table",header:FHe(t[1]).map(s=>({text:s})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split(` `):[]};if(i.header.length===i.align.length){i.raw=t[0];let s=i.align.length,o,r,a,c;for(o=0;o({text:l}));for(s=i.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):nv(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=Dfe(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=OAt(t[2],"()");if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);r&&(s=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^$/.test(i)?s=s.slice(1):s=s.slice(1,-1)),OHe(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s||!s.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return OHe(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s||s[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=s[1]||s[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=s[0].length-1;let a,c,l=r,d=0;const h=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(s=h.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(c=a.length,s[3]||s[4]){l+=c;continue}else if((s[5]||s[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(l-=c,l>0)continue;if(c=Math.min(c,c+l+d),Math.min(r,c)%2){const f=e.slice(1,r+s.index+c);return{type:"em",raw:e.slice(0,r+s.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+s.index+c-1);return{type:"strong",raw:e.slice(0,r+s.index+c+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const s=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return s&&o&&(i=i.substring(1,i.length-1)),i=nv(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let s,o;return i[2]==="@"?(s=nv(this.options.mangle?t(i[1]):i[1]),o="mailto:"+s):(s=nv(i[1]),o=s),{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let s,o;if(i[2]==="@")s=nv(this.options.mangle?t(i[0]):i[0]),o="mailto:"+s;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);s=nv(i[0]),i[1]==="www."?o="http://"+s:o=s}return{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let s;return this.lexer.state.inRawBlock?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):nv(i[0]):i[0]:s=nv(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:s}}}};const{noopTest:uee,edit:Jc,merge:_O}=Sz,qs={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:uee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};qs._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;qs._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;qs.def=Jc(qs.def).replace("label",qs._label).replace("title",qs._title).getRegex();qs.bullet=/(?:[*+-]|\d{1,9}[.)])/;qs.listItemStart=Jc(/^( *)(bull) */).replace("bull",qs.bullet).getRegex();qs.list=Jc(qs.list).replace(/bull/g,qs.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+qs.def.source+")").getRegex();qs._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";qs._comment=/|$)/;qs.html=Jc(qs.html,"i").replace("comment",qs._comment).replace("tag",qs._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();qs.paragraph=Jc(qs._paragraph).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.blockquote=Jc(qs.blockquote).replace("paragraph",qs.paragraph).getRegex();qs.normal=_O({},qs);qs.gfm=_O({},qs.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});qs.gfm.table=Jc(qs.gfm.table).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.pedantic=_O({},qs.normal,{html:Jc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qs._comment).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uee,paragraph:Jc(qs.normal._paragraph).replace("hr",qs.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",qs.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const nn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:uee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:uee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";nn.punctuation=Jc(nn.punctuation).replace(/punctuation/g,nn._punctuation).getRegex();nn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;nn.escapedEmSt=/\\\*|\\_/g;nn._comment=Jc(qs._comment).replace("(?:-->|$)","-->").getRegex();nn.emStrong.lDelim=Jc(nn.emStrong.lDelim).replace(/punct/g,nn._punctuation).getRegex();nn.emStrong.rDelimAst=Jc(nn.emStrong.rDelimAst,"g").replace(/punct/g,nn._punctuation).getRegex();nn.emStrong.rDelimUnd=Jc(nn.emStrong.rDelimUnd,"g").replace(/punct/g,nn._punctuation).getRegex();nn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;nn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;nn._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])?)+(?![-_])/;nn.autolink=Jc(nn.autolink).replace("scheme",nn._scheme).replace("email",nn._email).getRegex();nn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;nn.tag=Jc(nn.tag).replace("comment",nn._comment).replace("attribute",nn._attribute).getRegex();nn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;nn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;nn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;nn.link=Jc(nn.link).replace("label",nn._label).replace("href",nn._href).replace("title",nn._title).getRegex();nn.reflink=Jc(nn.reflink).replace("label",nn._label).getRegex();nn.reflinkSearch=Jc(nn.reflinkSearch,"g").replace("reflink",nn.reflink).replace("nolink",nn.nolink).getRegex();nn.normal=_O({},nn);nn.pedantic=_O({},nn.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Jc(/^!?\[(label)\]\((.*?)\)/).replace("label",nn._label).getRegex(),reflink:Jc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",nn._label).getRegex()});nn.gfm=_O({},nn.normal,{escape:Jc(nn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}var zAt=class ebe{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||UAt,this.options.tokenizer=this.options.tokenizer||new HAt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Zj.normal,inline:m5.normal};this.options.pedantic?(t.block=Zj.pedantic,t.inline=m5.pedantic):this.options.gfm&&(t.block=Zj.gfm,this.options.breaks?t.inline=m5.breaks:t.inline=m5.gfm),this.tokenizer.rules=t}static get rules(){return{block:Zj,inline:m5}}static lex(e,t){return new ebe(t).lex(e)}static lexInline(e,t){return new ebe(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}text(e){const t=this.rules.block.text.exec(e);if(t){const i={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:nv(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):nv(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=Dfe(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=OAt(t[2],"()");if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);r&&(s=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^$/.test(i)?s=s.slice(1):s=s.slice(1,-1)),OHe(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s||!s.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return OHe(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s||s[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=s[1]||s[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=s[0].length-1;let a,c,l=r,d=0;const h=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(s=h.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(c=a.length,s[3]||s[4]){l+=c;continue}else if((s[5]||s[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(l-=c,l>0)continue;if(c=Math.min(c,c+l+d),Math.min(r,c)%2){const f=e.slice(1,r+s.index+c);return{type:"em",raw:e.slice(0,r+s.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+s.index+c-1);return{type:"strong",raw:e.slice(0,r+s.index+c+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const s=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return s&&o&&(i=i.substring(1,i.length-1)),i=nv(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let s,o;return i[2]==="@"?(s=nv(this.options.mangle?t(i[1]):i[1]),o="mailto:"+s):(s=nv(i[1]),o=s),{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let s,o;if(i[2]==="@")s=nv(this.options.mangle?t(i[0]):i[0]),o="mailto:"+s;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);s=nv(i[0]),i[1]==="www."?o="http://"+s:o=s}return{type:"link",raw:i[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let s;return this.lexer.state.inRawBlock?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):nv(i[0]):i[0]:s=nv(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:s}}}};const{noopTest:uee,edit:Xc,merge:_O}=Sz,qs={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:uee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};qs._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;qs._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;qs.def=Xc(qs.def).replace("label",qs._label).replace("title",qs._title).getRegex();qs.bullet=/(?:[*+-]|\d{1,9}[.)])/;qs.listItemStart=Xc(/^( *)(bull) */).replace("bull",qs.bullet).getRegex();qs.list=Xc(qs.list).replace(/bull/g,qs.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+qs.def.source+")").getRegex();qs._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";qs._comment=/|$)/;qs.html=Xc(qs.html,"i").replace("comment",qs._comment).replace("tag",qs._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();qs.paragraph=Xc(qs._paragraph).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.blockquote=Xc(qs.blockquote).replace("paragraph",qs.paragraph).getRegex();qs.normal=_O({},qs);qs.gfm=_O({},qs.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});qs.gfm.table=Xc(qs.gfm.table).replace("hr",qs.hr).replace("heading"," {0,3}#{1,6} ").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs._tag).getRegex();qs.pedantic=_O({},qs.normal,{html:Xc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qs._comment).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uee,paragraph:Xc(qs.normal._paragraph).replace("hr",qs.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",qs.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const sn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:uee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:uee,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";sn.punctuation=Xc(sn.punctuation).replace(/punctuation/g,sn._punctuation).getRegex();sn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;sn.escapedEmSt=/\\\*|\\_/g;sn._comment=Xc(qs._comment).replace("(?:-->|$)","-->").getRegex();sn.emStrong.lDelim=Xc(sn.emStrong.lDelim).replace(/punct/g,sn._punctuation).getRegex();sn.emStrong.rDelimAst=Xc(sn.emStrong.rDelimAst,"g").replace(/punct/g,sn._punctuation).getRegex();sn.emStrong.rDelimUnd=Xc(sn.emStrong.rDelimUnd,"g").replace(/punct/g,sn._punctuation).getRegex();sn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;sn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;sn._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])?)+(?![-_])/;sn.autolink=Xc(sn.autolink).replace("scheme",sn._scheme).replace("email",sn._email).getRegex();sn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;sn.tag=Xc(sn.tag).replace("comment",sn._comment).replace("attribute",sn._attribute).getRegex();sn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;sn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;sn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;sn.link=Xc(sn.link).replace("label",sn._label).replace("href",sn._href).replace("title",sn._title).getRegex();sn.reflink=Xc(sn.reflink).replace("label",sn._label).getRegex();sn.reflinkSearch=Xc(sn.reflinkSearch,"g").replace("reflink",sn.reflink).replace("nolink",sn.nolink).getRegex();sn.normal=_O({},sn);sn.pedantic=_O({},sn.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xc(/^!?\[(label)\]\((.*?)\)/).replace("label",sn._label).getRegex(),reflink:Xc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sn._label).getRegex()});sn.gfm=_O({},sn.normal,{escape:Xc(sn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}var zAt=class ebe{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||UAt,this.options.tokenizer=this.options.tokenizer||new HAt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Zj.normal,inline:m5.normal};this.options.pedantic?(t.block=Zj.pedantic,t.inline=m5.pedantic):this.options.gfm&&(t.block=Zj.gfm,this.options.breaks?t.inline=m5.breaks:t.inline=m5.gfm),this.tokenizer.rules=t}static get rules(){return{block:Zj,inline:m5}}static lex(e,t){return new ebe(t).lex(e)}static lexInline(e,t){return new ebe(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic&&(e=e.replace(/^ +$/gm,""));let i,s,o,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.type&&t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+i.raw,s.text+=` `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` @@ -222,10 +222,10 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An ${e}`)}function _Et(n){return sL(n,"`")}function vEt(n){return sL(n,"*")}function wEt(n){return sL(n,"_")}function bEt(n){return sL(n,")")}function CEt(n){return sL(n,'")')}function yEt(n){return sL(n,"](https://microsoft.com)")}function SEt(n){return sL(n,"**")}function AEt(n){return sL(n,"__")}function sL(n,e){const t=u7(Array.isArray(n)?n:[n]);return Xg.lexer(t+e)[0]}function EEt(n){const e=u7(n),t=e.split(` `);let i,s=!1;for(let o=0;o"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const o=s?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return Xg.lexer(a)}}function VHe(n,e){return rje(n,e),Ee(()=>aje(n))}var xEt=".monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground);padding:1px 3px;vertical-align:middle}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}";Ct(xEt,{});var nbe,tN;let vw=(tN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new I,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new Z,o=s.add(mQ(e,{...this._getRenderOptions(e,s),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,s)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Kc);const r=await Ayt(this._languageService,s,o),a=document.createElement("span");if(a.innerHTML=nbe._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Sd(a,c)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>vde(this._openerService,i,e.isTrusted),disposables:t}}}},nbe=tN,tN._ttpTokenizer=Jx("tokenizeToString",{createHTML(e){return e}}),tN);vw=nbe=D([_(1,Di),_(2,fr)],vw);async function vde(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:DEt(t)})}catch(i){return bt(i),!1}}function DEt(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const kEt="vs/editor/browser/services/hoverService/hoverWidget",wC=we;var aa;(function(n){n[n.PointerSize=3]="PointerSize",n[n.HoverBorderWidth=2]="HoverBorderWidth",n[n.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(aa||(aa={}));let sbe=class extends wg{get _targetWindow(){return gt(this._target.targetElements[0])}get _targetDocumentElement(){return gt(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===Oo.BELOW?Jp.BELOW:Jp.ABOVE}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=s,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new Z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new I),this._onRequestLayout=this._register(new I),this._linkHandler=e.linkHandler||(u=>vde(this._openerService,u,ah(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new IEt(e.target),this._hoverPointer=e.appearance?.showPointer?wC("div.workbench-hover-pointer"):void 0,this._hover=this._register(new gNe),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.appearance?.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=e.position?.hoverPosition??Oo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(E.Escape)&&this.dispose()}),this._register(pe(this._targetWindow,"blur",()=>this.dispose()));const a=wC("div.hover-row.markdown-hover"),c=wC("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Ra(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(vw,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Gh.fontFamily}),{element:p}=f.render(u,{actionHandler:{callback:m=>this._linkHandler(m),disposables:this._messageListeners},asyncRenderCallback:()=>{c.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});c.appendChild(p)}if(a.appendChild(c),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=wC("div.hover-row.status-bar"),f=wC("div.actions");e.actions.forEach(p=>{const m=this._keybindingService.lookupKeybinding(p.commandId);m&&m.getLabel()}),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=wC("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let l;if(e.actions&&e.actions.length>0?l=!1:e.persistence?.hideOnHover===void 0?l=typeof e.content=="string"||ah(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=wC("div.hover-row.status-bar"),f=wC("div.info");f.textContent=g(kEt,0,"Hold {0} key to mouse over",ei?"Option":"Alt"),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];l||d.push(this._hoverContainer);const h=this._register(new zHe(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new zHe(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Yle(this._hoverContainer,wC("div")),s=he(this._hoverContainer,wC("div"));i.tabIndex=0,s.tabIndex=0,this._register(pe(s,"focus",o=>{e.focus(),o.preventDefault()})),this._register(pe(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Cu(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=lje(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:o,left:r}=t[0],a=s-r,c=o-i,l={top:i,right:s,bottom:o,left:r,width:a,height:c,center:{x:r+a/2,y:i+c/2}};if(this.adjustHorizontalHoverPosition(l),this.adjustVerticalHoverPosition(l),this.adjustHoverMaxHeight(l),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case Oo.RIGHT:l.left+=aa.PointerSize,l.right+=aa.PointerSize,this._hoverContainer.style.paddingLeft=`${aa.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-aa.PointerSize}px`;break;case Oo.LEFT:l.left-=aa.PointerSize,l.right-=aa.PointerSize,this._hoverContainer.style.paddingRight=`${aa.PointerSize}px`,this._hoverContainer.style.marginRight=`${-aa.PointerSize}px`;break;case Oo.BELOW:l.top+=aa.PointerSize,l.bottom+=aa.PointerSize,this._hoverContainer.style.paddingTop=`${aa.PointerSize}px`,this._hoverContainer.style.marginTop=`${-aa.PointerSize}px`;break;case Oo.ABOVE:l.top-=aa.PointerSize,l.bottom-=aa.PointerSize,this._hoverContainer.style.paddingBottom=`${aa.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-aa.PointerSize}px`;break}l.center.x=l.left+a/2,l.center.y=l.top+c/2}this.computeXCordinate(l),this.computeYCordinate(l),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(l)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+aa.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===Oo.RIGHT?this._x=e.right:this._hoverPosition===Oo.LEFT?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-aa.HoverWindowEdgeMargin,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?aa.PointerSize:0;if(this._forcePosition){const i=t+aa.HoverBorderWidth;this._hoverPosition===Oo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===Oo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===Oo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.LEFT:this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.RIGHT:this._hoverPosition=Oo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=Oo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?aa.PointerSize:0;this._hoverPosition===Oo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=Oo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?aa.PointerSize:0)+aa.HoverBorderWidth;this._hoverPosition===Oo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===Oo.BELOW&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-aa.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-aa.PointerSize}px`;break}case Oo.ABOVE:case Oo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===Oo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-aa.PointerSize;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-aa.PointerSize),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}hide(){this.dispose()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};sbe=D([_(1,ti),_(2,Re),_(3,fr),_(4,be),_(5,Ur)],sbe);class zHe extends wg{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new I),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=gt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(gt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class IEt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var hp;(function(n){n[n.NoMatchingKb=0]="NoMatchingKb",n[n.MoreChordsNeeded=1]="MoreChordsNeeded",n[n.KbFound=2]="KbFound"})(hp||(hp={}));const gee={kind:hp.NoMatchingKb},LEt={kind:hp.MoreChordsNeeded};function TEt(n,e,t){return{kind:hp.KbFound,commandId:n,commandArgs:e,isBubble:t}}class M${constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const o=s.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=M$.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||t.length===0)return[];const i=[];let s=0;for(let o=t.length-1;o>=0;o--)i[s++]=t[o];return i}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),gee;let r=null;if(s.length<2)r=o;else{r=[];for(let c=0,l=o.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const s=t[i];if(M$._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function $He(n){return n?`${n.serialize()}`:"no when condition"}function GHe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}let fee=class extends ${constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Qwe(this.layoutService.mainContainer,by.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(gt(t))?s=by.ABSOLUTE:i?s=by.FIXED_SHADOW:s=by.FIXED:s=by.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};fee=D([_(0,bg)],fee);class REt extends fee{getContextViewElement(){return this.contextView.getViewElement()}}const MEt="vs/editor/browser/services/hoverService/updatableHoverWidget";class NEt{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||zt(e)||Ra(e))s=e;else if(!SU(e.markdown))s=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(MEt,0,"Loading..."),t,i),this._cancellationTokenSource=new ai;const o=this._cancellationTokenSource.token;if(s=await e.markdown(o),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s},position:{hoverPosition:Oo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}s?.dispose()}hasContent(e){return e?ah(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let obe=class extends ${constructor(e,t,i,s,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=s,this._accessibilityService=o,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new fee(this._layoutService))}showHover(e,t,i){if(qHe(this._currentHoverOptions)===qHe(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const s=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=xl();i||(s&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(sbe,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&cMe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Ra(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(gt(c))}if(this._contextViewHandler.showContextView(new PEt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(pe(gt(e.container).document,xe.MOUSE_DOWN,c=>{al(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(pe(l,xe.CLICK,()=>this.hideHover()));else r.add(pe(e.target,xe.CLICK,()=>this.hideHover()));const c=xl();if(c){const l=gt(c).document;r.add(pe(c,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(l,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(c,xe.KEY_UP,d=>this._keyUp(d,a))),r.add(pe(l,xe.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in yi){const c=new IntersectionObserver(d=>this._intersectionChange(d,a),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;c.observe(l),r.add(Ee(()=>c.disconnect()))}return this._currentHover=a,a}hideHover(){this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const s=new os(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(s,s.target).kind!==hp.NoMatchingKb||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupUpdatableHover(e,t,i,s){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(C,y)=>{const S=r!==void 0;C&&(r?.dispose(),r=void 0),y&&(o?.dispose(),o=void 0),S&&(e.onDidHideHover?.(),r=void 0)},c=(C,y,S,M)=>new O_(async()=>{(!r||r.isDisposed)&&(r=new NEt(e,S||t,C>0),await r.update(typeof i=="function"?i():i,y,{...s,trapFocus:M}))},C);let l=!1;const d=pe(t,xe.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=pe(t,xe.MOUSE_UP,()=>{l=!1},!0),u=pe(t,xe.MOUSE_LEAVE,C=>{l=!1,a(!1,C.fromElement===t)},!0),f=C=>{if(o)return;const y=new Z,S={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const M=k=>{S.x=k.x+10,Ra(k.target)&&QHe(k.target,t)!==t&&a(!0,!0)};y.add(pe(t,xe.MOUSE_MOVE,M,!0))}o=y,!(Ra(C.target)&&QHe(C.target,t)!==t)&&y.add(c(e.delay,!1,S))},p=pe(t,xe.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const C={targetElements:[t],dispose:()=>{}},y=new Z,S=()=>a(!0,!0);y.add(pe(t,xe.BLUR,S,!0)),y.add(c(e.delay,!1,C)),o=y};let v;const w=t.tagName.toLowerCase();w!=="input"&&w!=="textarea"&&(v=pe(t,xe.FOCUS,m,!0));const b={show:C=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(C,y)=>{i=C,await r?.update(i,void 0,y)},dispose:()=>{this._existingHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._existingHovers.set(t,b),b}triggerUpdatableHover(e){const t=this._existingHovers.get(e);t&&t.show(!0)}dispose(){this._existingHovers.forEach(e=>e.dispose()),super.dispose()}};obe=D([_(0,be),_(1,Vr),_(2,ti),_(3,bg),_(4,Ur)],obe);function qHe(n){if(n!==void 0)return n?.id??n}class PEt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function QHe(n,e){for(e=e??gt(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}ce(Zc,obe,Kt.Delayed);Im((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const vO=ae("IWorkspaceEditService");class _Q{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(vS.is(t))return vS.lift(t);if(up.is(t))return up.lift(t);throw new Error("Unsupported edit")})}}class vS extends _Q{static is(e){return e instanceof vS?!0:fo(e)&&P.isUri(e.resource)&&fo(e.textEdit)}static lift(e){return e instanceof vS?e:new vS(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class up extends _Q{static is(e){return e instanceof up?!0:fo(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof up?e:new up(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const _h={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},ns="vs/editor/common/config/editorConfigurationSchema",sA=Object.freeze({id:"editor",order:5,type:"object",title:g(ns,0,"Editor"),scope:ut.LANGUAGE_OVERRIDABLE}),pee={...sA,properties:{"editor.tabSize":{type:"number",default:Ph.tabSize,minimum:1,markdownDescription:g(ns,1,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:g(ns,2,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ph.insertSpaces,markdownDescription:g(ns,3,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ph.detectIndentation,markdownDescription:g(ns,4,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ph.trimAutoWhitespace,description:g(ns,5,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ph.largeFileOptimizations,description:g(ns,6,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(ns,7,"Turn off Word Based Suggestions."),g(ns,8,"Only suggest words from the active document."),g(ns,9,"Suggest words from all open documents of the same language."),g(ns,10,"Suggest words from all open documents.")],description:g(ns,11,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[g(ns,12,"Semantic highlighting enabled for all color themes."),g(ns,13,"Semantic highlighting disabled for all color themes."),g(ns,14,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(ns,15,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(ns,16,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(ns,17,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(ns,18,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(ns,19,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(ns,20,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:g(ns,21,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(ns,24,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:_h.maxComputationTime,description:g(ns,25,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:_h.maxFileSize,description:g(ns,26,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:_h.renderSideBySide,description:g(ns,27,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:_h.renderSideBySideInlineBreakpoint,description:g(ns,28,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:_h.useInlineViewWhenSpaceIsLimited,description:g(ns,29,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:_h.renderMarginRevertIcon,description:g(ns,30,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:_h.renderGutterMenu,description:g(ns,31,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:_h.ignoreTrimWhitespace,description:g(ns,32,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:_h.renderIndicators,description:g(ns,33,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:_h.diffCodeLens,description:g(ns,34,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:_h.diffWordWrap,markdownEnumDescriptions:[g(ns,35,"Lines will never wrap."),g(ns,36,"Lines will wrap at the viewport width."),g(ns,37,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:_h.diffAlgorithm,markdownEnumDescriptions:[g(ns,38,"Uses the legacy diffing algorithm."),g(ns,39,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:_h.hideUnchangedRegions.enabled,markdownDescription:g(ns,40,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:_h.hideUnchangedRegions.revealLineCount,markdownDescription:g(ns,41,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:_h.hideUnchangedRegions.minimumLineCount,markdownDescription:g(ns,42,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:_h.hideUnchangedRegions.contextLineCount,markdownDescription:g(ns,43,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:_h.experimental.showMoves,markdownDescription:g(ns,44,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:_h.experimental.showEmptyDecorations,description:g(ns,45,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function FEt(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of HB){const e=n.schema;if(typeof e<"u")if(FEt(e))pee.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(pee.properties[t]=e[t])}let tK=null;function pJe(){return tK===null&&(tK=Object.create(null),Object.keys(pee.properties).forEach(n=>{tK[n]=!0})),tK}function OEt(n){return pJe()[`editor.${n}`]||!1}function BEt(n){return pJe()[`diffEditor.${n}`]||!1}const WEt=it.as(Cs.Configuration);WEt.registerConfiguration(pee);var md;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(md||(md={}));var xt;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(xt||(xt={}));var or;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(or||(or={}));var g7;(function(n){n.DEFAULT={allowTrailingComma:!0}})(g7||(g7={}));function mJe(n,e=!1){let t=0;const i=n.length;let s="",o=0,r=xt.Unknown,a=md.None;function c(m){let v=0,w=0;for(;v=si._0&&b<=si._9)w=w*16+b-si._0;else if(b>=si.A&&b<=si.F)w=w*16+b-si.A+10;else if(b>=si.a&&b<=si.f)w=w*16+b-si.a+10;else break;t++,v++}return v=i){m+=n.substring(v,t),a=md.UnexpectedEndOfString;break}const w=n.charCodeAt(t);if(w===si.doubleQuote){m+=n.substring(v,t),t++;break}if(w===si.backslash){if(m+=n.substring(v,t),t++,t>=i){a=md.UnexpectedEndOfString;break}switch(n.charCodeAt(t++)){case si.doubleQuote:m+='"';break;case si.backslash:m+="\\";break;case si.slash:m+="/";break;case si.b:m+="\b";break;case si.f:m+="\f";break;case si.n:m+=` +|${" --- |".repeat(i)}`;return Xg.lexer(a)}}function VHe(n,e){return rje(n,e),Ee(()=>aje(n))}var xEt=".monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground);padding:1px 3px;vertical-align:middle}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}";Ct(xEt,{});var nbe,tN;let vw=(tN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new I,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new Z,o=s.add(mQ(e,{...this._getRenderOptions(e,s),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,s)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Yc);const r=await Ayt(this._languageService,s,o),a=document.createElement("span");if(a.innerHTML=nbe._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Sd(a,c)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>vde(this._openerService,i,e.isTrusted),disposables:t}}}},nbe=tN,tN._ttpTokenizer=Jx("tokenizeToString",{createHTML(e){return e}}),tN);vw=nbe=D([_(1,Di),_(2,fr)],vw);async function vde(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:DEt(t)})}catch(i){return bt(i),!1}}function DEt(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const kEt="vs/editor/browser/services/hoverService/hoverWidget",wC=we;var aa;(function(n){n[n.PointerSize=3]="PointerSize",n[n.HoverBorderWidth=2]="HoverBorderWidth",n[n.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(aa||(aa={}));let sbe=class extends wg{get _targetWindow(){return gt(this._target.targetElements[0])}get _targetDocumentElement(){return gt(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===Oo.BELOW?Jp.BELOW:Jp.ABOVE}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=s,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new Z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new I),this._onRequestLayout=this._register(new I),this._linkHandler=e.linkHandler||(u=>vde(this._openerService,u,ah(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new IEt(e.target),this._hoverPointer=e.appearance?.showPointer?wC("div.workbench-hover-pointer"):void 0,this._hover=this._register(new gNe),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.appearance?.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=e.position?.hoverPosition??Oo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(E.Escape)&&this.dispose()}),this._register(pe(this._targetWindow,"blur",()=>this.dispose()));const a=wC("div.hover-row.markdown-hover"),c=wC("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Ra(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(vw,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Gh.fontFamily}),{element:p}=f.render(u,{actionHandler:{callback:m=>this._linkHandler(m),disposables:this._messageListeners},asyncRenderCallback:()=>{c.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});c.appendChild(p)}if(a.appendChild(c),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=wC("div.hover-row.status-bar"),f=wC("div.actions");e.actions.forEach(p=>{const m=this._keybindingService.lookupKeybinding(p.commandId);m&&m.getLabel()}),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=wC("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let l;if(e.actions&&e.actions.length>0?l=!1:e.persistence?.hideOnHover===void 0?l=typeof e.content=="string"||ah(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=wC("div.hover-row.status-bar"),f=wC("div.info");f.textContent=g(kEt,0,"Hold {0} key to mouse over",ei?"Option":"Alt"),u.appendChild(f),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];l||d.push(this._hoverContainer);const h=this._register(new zHe(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new zHe(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=Yle(this._hoverContainer,wC("div")),s=he(this._hoverContainer,wC("div"));i.tabIndex=0,s.tabIndex=0,this._register(pe(s,"focus",o=>{e.focus(),o.preventDefault()})),this._register(pe(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Cu(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=lje(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:o,left:r}=t[0],a=s-r,c=o-i,l={top:i,right:s,bottom:o,left:r,width:a,height:c,center:{x:r+a/2,y:i+c/2}};if(this.adjustHorizontalHoverPosition(l),this.adjustVerticalHoverPosition(l),this.adjustHoverMaxHeight(l),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case Oo.RIGHT:l.left+=aa.PointerSize,l.right+=aa.PointerSize,this._hoverContainer.style.paddingLeft=`${aa.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-aa.PointerSize}px`;break;case Oo.LEFT:l.left-=aa.PointerSize,l.right-=aa.PointerSize,this._hoverContainer.style.paddingRight=`${aa.PointerSize}px`,this._hoverContainer.style.marginRight=`${-aa.PointerSize}px`;break;case Oo.BELOW:l.top+=aa.PointerSize,l.bottom+=aa.PointerSize,this._hoverContainer.style.paddingTop=`${aa.PointerSize}px`,this._hoverContainer.style.marginTop=`${-aa.PointerSize}px`;break;case Oo.ABOVE:l.top-=aa.PointerSize,l.bottom-=aa.PointerSize,this._hoverContainer.style.paddingBottom=`${aa.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-aa.PointerSize}px`;break}l.center.x=l.left+a/2,l.center.y=l.top+c/2}this.computeXCordinate(l),this.computeYCordinate(l),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(l)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+aa.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===Oo.RIGHT?this._x=e.right:this._hoverPosition===Oo.LEFT?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-aa.HoverWindowEdgeMargin,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?aa.PointerSize:0;if(this._forcePosition){const i=t+aa.HoverBorderWidth;this._hoverPosition===Oo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===Oo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===Oo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.LEFT:this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=Oo.RIGHT:this._hoverPosition=Oo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=Oo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?aa.PointerSize:0;this._hoverPosition===Oo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=Oo.BELOW):this._hoverPosition===Oo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=Oo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?aa.PointerSize:0)+aa.HoverBorderWidth;this._hoverPosition===Oo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===Oo.BELOW&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-aa.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-aa.PointerSize}px`;break}case Oo.ABOVE:case Oo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===Oo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-aa.PointerSize;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-aa.PointerSize),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}hide(){this.dispose()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};sbe=D([_(1,ti),_(2,Re),_(3,fr),_(4,be),_(5,Ur)],sbe);class zHe extends wg{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new I),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=gt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(gt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class IEt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var hp;(function(n){n[n.NoMatchingKb=0]="NoMatchingKb",n[n.MoreChordsNeeded=1]="MoreChordsNeeded",n[n.KbFound=2]="KbFound"})(hp||(hp={}));const gee={kind:hp.NoMatchingKb},LEt={kind:hp.MoreChordsNeeded};function TEt(n,e,t){return{kind:hp.KbFound,commandId:n,commandArgs:e,isBubble:t}}class M${constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const o=s.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=M$.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||t.length===0)return[];const i=[];let s=0;for(let o=t.length-1;o>=0;o--)i[s++]=t[o];return i}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),gee;let r=null;if(s.length<2)r=o;else{r=[];for(let c=0,l=o.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const s=t[i];if(M$._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function $He(n){return n?`${n.serialize()}`:"no when condition"}function GHe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}let fee=class extends ${constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Qwe(this.layoutService.mainContainer,by.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(gt(t))?s=by.ABSOLUTE:i?s=by.FIXED_SHADOW:s=by.FIXED:s=by.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};fee=D([_(0,bg)],fee);class REt extends fee{getContextViewElement(){return this.contextView.getViewElement()}}const MEt="vs/editor/browser/services/hoverService/updatableHoverWidget";class NEt{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||zt(e)||Ra(e))s=e;else if(!SU(e.markdown))s=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(MEt,0,"Loading..."),t,i),this._cancellationTokenSource=new ai;const o=this._cancellationTokenSource.token;if(s=await e.markdown(o),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s},position:{hoverPosition:Oo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}s?.dispose()}hasContent(e){return e?ah(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let obe=class extends ${constructor(e,t,i,s,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=s,this._accessibilityService=o,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new fee(this._layoutService))}showHover(e,t,i){if(qHe(this._currentHoverOptions)===qHe(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const s=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=xl();i||(s&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(sbe,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&cMe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Ra(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(gt(c))}if(this._contextViewHandler.showContextView(new PEt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(pe(gt(e.container).document,xe.MOUSE_DOWN,c=>{al(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(pe(l,xe.CLICK,()=>this.hideHover()));else r.add(pe(e.target,xe.CLICK,()=>this.hideHover()));const c=xl();if(c){const l=gt(c).document;r.add(pe(c,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(l,xe.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(pe(c,xe.KEY_UP,d=>this._keyUp(d,a))),r.add(pe(l,xe.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in yi){const c=new IntersectionObserver(d=>this._intersectionChange(d,a),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;c.observe(l),r.add(Ee(()=>c.disconnect()))}return this._currentHover=a,a}hideHover(){this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const s=new os(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(s,s.target).kind!==hp.NoMatchingKb||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupUpdatableHover(e,t,i,s){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(C,y)=>{const S=r!==void 0;C&&(r?.dispose(),r=void 0),y&&(o?.dispose(),o=void 0),S&&(e.onDidHideHover?.(),r=void 0)},c=(C,y,S,M)=>new O_(async()=>{(!r||r.isDisposed)&&(r=new NEt(e,S||t,C>0),await r.update(typeof i=="function"?i():i,y,{...s,trapFocus:M}))},C);let l=!1;const d=pe(t,xe.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=pe(t,xe.MOUSE_UP,()=>{l=!1},!0),u=pe(t,xe.MOUSE_LEAVE,C=>{l=!1,a(!1,C.fromElement===t)},!0),f=C=>{if(o)return;const y=new Z,S={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const M=k=>{S.x=k.x+10,Ra(k.target)&&QHe(k.target,t)!==t&&a(!0,!0)};y.add(pe(t,xe.MOUSE_MOVE,M,!0))}o=y,!(Ra(C.target)&&QHe(C.target,t)!==t)&&y.add(c(e.delay,!1,S))},p=pe(t,xe.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const C={targetElements:[t],dispose:()=>{}},y=new Z,S=()=>a(!0,!0);y.add(pe(t,xe.BLUR,S,!0)),y.add(c(e.delay,!1,C)),o=y};let v;const w=t.tagName.toLowerCase();w!=="input"&&w!=="textarea"&&(v=pe(t,xe.FOCUS,m,!0));const b={show:C=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(C,y)=>{i=C,await r?.update(i,void 0,y)},dispose:()=>{this._existingHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._existingHovers.set(t,b),b}triggerUpdatableHover(e){const t=this._existingHovers.get(e);t&&t.show(!0)}dispose(){this._existingHovers.forEach(e=>e.dispose()),super.dispose()}};obe=D([_(0,be),_(1,Vr),_(2,ti),_(3,bg),_(4,Ur)],obe);function qHe(n){if(n!==void 0)return n?.id??n}class PEt{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function QHe(n,e){for(e=e??gt(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}ce(el,obe,Yt.Delayed);Im((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const vO=ae("IWorkspaceEditService");class _Q{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(vS.is(t))return vS.lift(t);if(up.is(t))return up.lift(t);throw new Error("Unsupported edit")})}}class vS extends _Q{static is(e){return e instanceof vS?!0:fo(e)&&P.isUri(e.resource)&&fo(e.textEdit)}static lift(e){return e instanceof vS?e:new vS(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class up extends _Q{static is(e){return e instanceof up?!0:fo(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof up?e:new up(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const _h={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},ns="vs/editor/common/config/editorConfigurationSchema",sA=Object.freeze({id:"editor",order:5,type:"object",title:g(ns,0,"Editor"),scope:ut.LANGUAGE_OVERRIDABLE}),pee={...sA,properties:{"editor.tabSize":{type:"number",default:Ph.tabSize,minimum:1,markdownDescription:g(ns,1,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:g(ns,2,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ph.insertSpaces,markdownDescription:g(ns,3,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ph.detectIndentation,markdownDescription:g(ns,4,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ph.trimAutoWhitespace,description:g(ns,5,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ph.largeFileOptimizations,description:g(ns,6,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(ns,7,"Turn off Word Based Suggestions."),g(ns,8,"Only suggest words from the active document."),g(ns,9,"Suggest words from all open documents of the same language."),g(ns,10,"Suggest words from all open documents.")],description:g(ns,11,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[g(ns,12,"Semantic highlighting enabled for all color themes."),g(ns,13,"Semantic highlighting disabled for all color themes."),g(ns,14,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(ns,15,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(ns,16,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(ns,17,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(ns,18,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(ns,19,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(ns,20,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:g(ns,21,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(ns,24,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:g(ns,22,"The opening bracket character or string sequence.")},{type:"string",description:g(ns,23,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:_h.maxComputationTime,description:g(ns,25,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:_h.maxFileSize,description:g(ns,26,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:_h.renderSideBySide,description:g(ns,27,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:_h.renderSideBySideInlineBreakpoint,description:g(ns,28,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:_h.useInlineViewWhenSpaceIsLimited,description:g(ns,29,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:_h.renderMarginRevertIcon,description:g(ns,30,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:_h.renderGutterMenu,description:g(ns,31,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:_h.ignoreTrimWhitespace,description:g(ns,32,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:_h.renderIndicators,description:g(ns,33,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:_h.diffCodeLens,description:g(ns,34,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:_h.diffWordWrap,markdownEnumDescriptions:[g(ns,35,"Lines will never wrap."),g(ns,36,"Lines will wrap at the viewport width."),g(ns,37,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:_h.diffAlgorithm,markdownEnumDescriptions:[g(ns,38,"Uses the legacy diffing algorithm."),g(ns,39,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:_h.hideUnchangedRegions.enabled,markdownDescription:g(ns,40,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:_h.hideUnchangedRegions.revealLineCount,markdownDescription:g(ns,41,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:_h.hideUnchangedRegions.minimumLineCount,markdownDescription:g(ns,42,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:_h.hideUnchangedRegions.contextLineCount,markdownDescription:g(ns,43,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:_h.experimental.showMoves,markdownDescription:g(ns,44,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:_h.experimental.showEmptyDecorations,description:g(ns,45,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function FEt(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of HB){const e=n.schema;if(typeof e<"u")if(FEt(e))pee.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(pee.properties[t]=e[t])}let tK=null;function pJe(){return tK===null&&(tK=Object.create(null),Object.keys(pee.properties).forEach(n=>{tK[n]=!0})),tK}function OEt(n){return pJe()[`editor.${n}`]||!1}function BEt(n){return pJe()[`diffEditor.${n}`]||!1}const WEt=it.as(Cs.Configuration);WEt.registerConfiguration(pee);var md;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(md||(md={}));var xt;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(xt||(xt={}));var or;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(or||(or={}));var g7;(function(n){n.DEFAULT={allowTrailingComma:!0}})(g7||(g7={}));function mJe(n,e=!1){let t=0;const i=n.length;let s="",o=0,r=xt.Unknown,a=md.None;function c(m){let v=0,w=0;for(;v=si._0&&b<=si._9)w=w*16+b-si._0;else if(b>=si.A&&b<=si.F)w=w*16+b-si.A+10;else if(b>=si.a&&b<=si.f)w=w*16+b-si.a+10;else break;t++,v++}return v=i){m+=n.substring(v,t),a=md.UnexpectedEndOfString;break}const w=n.charCodeAt(t);if(w===si.doubleQuote){m+=n.substring(v,t),t++;break}if(w===si.backslash){if(m+=n.substring(v,t),t++,t>=i){a=md.UnexpectedEndOfString;break}switch(n.charCodeAt(t++)){case si.doubleQuote:m+='"';break;case si.backslash:m+="\\";break;case si.slash:m+="/";break;case si.b:m+="\b";break;case si.f:m+="\f";break;case si.n:m+=` `;break;case si.r:m+="\r";break;case si.t:m+=" ";break;case si.u:{const C=c(4);C>=0?m+=String.fromCharCode(C):a=md.InvalidUnicode;break}default:a=md.InvalidEscapeCharacter}v=t;continue}if(w>=0&&w<=31)if(iK(w)){m+=n.substring(v,t),a=md.UnexpectedEndOfString;break}else a=md.InvalidCharacter;t++}return m}function u(){if(s="",a=md.None,o=t,t>=i)return o=i,r=xt.EOF;let m=n.charCodeAt(t);if(Lfe(m)){do t++,s+=String.fromCharCode(m),m=n.charCodeAt(t);while(Lfe(m));return r=xt.Trivia}if(iK(m))return t++,s+=String.fromCharCode(m),m===si.carriageReturn&&n.charCodeAt(t)===si.lineFeed&&(t++,s+=` -`),r=xt.LineBreakTrivia;switch(m){case si.openBrace:return t++,r=xt.OpenBraceToken;case si.closeBrace:return t++,r=xt.CloseBraceToken;case si.openBracket:return t++,r=xt.OpenBracketToken;case si.closeBracket:return t++,r=xt.CloseBracketToken;case si.colon:return t++,r=xt.ColonToken;case si.comma:return t++,r=xt.CommaToken;case si.doubleQuote:return t++,s=h(),r=xt.StringLiteral;case si.slash:{const v=t-1;if(n.charCodeAt(t+1)===si.slash){for(t+=2;t=xt.LineCommentTrivia&&m<=xt.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function Lfe(n){return n===si.space||n===si.tab||n===si.verticalTab||n===si.formFeed||n===si.nonBreakingSpace||n===si.ogham||n>=si.enQuad&&n<=si.zeroWidthSpace||n===si.narrowNoBreakSpace||n===si.mathematicalSpace||n===si.ideographicSpace||n===si.byteOrderMark}function iK(n){return n===si.lineFeed||n===si.carriageReturn||n===si.lineSeparator||n===si.paragraphSeparator}function GO(n){return n>=si._0&&n<=si._9}var si;(function(n){n[n.nullCharacter=0]="nullCharacter",n[n.maxAsciiCharacter=127]="maxAsciiCharacter",n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.lineSeparator=8232]="lineSeparator",n[n.paragraphSeparator=8233]="paragraphSeparator",n[n.nextLine=133]="nextLine",n[n.space=32]="space",n[n.nonBreakingSpace=160]="nonBreakingSpace",n[n.enQuad=8192]="enQuad",n[n.emQuad=8193]="emQuad",n[n.enSpace=8194]="enSpace",n[n.emSpace=8195]="emSpace",n[n.threePerEmSpace=8196]="threePerEmSpace",n[n.fourPerEmSpace=8197]="fourPerEmSpace",n[n.sixPerEmSpace=8198]="sixPerEmSpace",n[n.figureSpace=8199]="figureSpace",n[n.punctuationSpace=8200]="punctuationSpace",n[n.thinSpace=8201]="thinSpace",n[n.hairSpace=8202]="hairSpace",n[n.zeroWidthSpace=8203]="zeroWidthSpace",n[n.narrowNoBreakSpace=8239]="narrowNoBreakSpace",n[n.ideographicSpace=12288]="ideographicSpace",n[n.mathematicalSpace=8287]="mathematicalSpace",n[n.ogham=5760]="ogham",n[n._=95]="_",n[n.$=36]="$",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.ampersand=38]="ampersand",n[n.asterisk=42]="asterisk",n[n.at=64]="at",n[n.backslash=92]="backslash",n[n.bar=124]="bar",n[n.caret=94]="caret",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.closeParen=41]="closeParen",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.equals=61]="equals",n[n.exclamation=33]="exclamation",n[n.greaterThan=62]="greaterThan",n[n.lessThan=60]="lessThan",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.openParen=40]="openParen",n[n.percent=37]="percent",n[n.plus=43]="plus",n[n.question=63]="question",n[n.semicolon=59]="semicolon",n[n.singleQuote=39]="singleQuote",n[n.slash=47]="slash",n[n.tilde=126]="tilde",n[n.backspace=8]="backspace",n[n.formFeed=12]="formFeed",n[n.byteOrderMark=65279]="byteOrderMark",n[n.tab=9]="tab",n[n.verticalTab=11]="verticalTab"})(si||(si={}));function ow(n,e=[],t=g7.DEFAULT){let i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}return yNe(n,{onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),s[0]}function _Je(n,e=[],t=g7.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}yNe(n,{onObjectBegin:c=>{i=o({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=o({type:"property",offset:l,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:c,offset:l,length:d,parent:i})},onObjectEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onArrayBegin:(c,l)=>{i=o({type:"array",offset:c,length:-1,parent:i,children:[]})},onArrayEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onLiteralValue:(c,l,d)=>{o({type:HW(c),offset:l,length:d,parent:i,value:c}),s(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&s(l))},onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t);const a=i.children[0];return a&&delete a.parent,a}function rbe(n,e){if(!n)return;let t=n;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let s=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],s=!0;break}if(!s)return}else{const s=i;if(t.type!=="array"||s<0||!Array.isArray(t.children)||s>=t.children.length)return;t=t.children[s]}return t}function yNe(n,e,t=g7.DEFAULT){const i=mJe(n,!1);function s(N){return N?()=>N(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(N){return N?z=>N(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=s(e.onObjectBegin),a=o(e.onObjectProperty),c=s(e.onObjectEnd),l=s(e.onArrayBegin),d=s(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=s(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function w(){for(;;){const N=i.scan();switch(i.getTokenError()){case md.InvalidUnicode:b(or.InvalidUnicode);break;case md.InvalidEscapeCharacter:b(or.InvalidEscapeCharacter);break;case md.UnexpectedEndOfNumber:b(or.UnexpectedEndOfNumber);break;case md.UnexpectedEndOfComment:m||b(or.UnexpectedEndOfComment);break;case md.UnexpectedEndOfString:b(or.UnexpectedEndOfString);break;case md.InvalidCharacter:b(or.InvalidCharacter);break}switch(N){case xt.LineCommentTrivia:case xt.BlockCommentTrivia:m?b(or.InvalidCommentToken):f();break;case xt.Unknown:b(or.InvalidSymbol);break;case xt.Trivia:case xt.LineBreakTrivia:break;default:return N}}}function b(N,z=[],U=[]){if(p(N),z.length+U.length>0){let J=i.getToken();for(;J!==xt.EOF;){if(z.indexOf(J)!==-1){w();break}else if(U.indexOf(J)!==-1)break;J=w()}}}function C(N){const z=i.getTokenValue();return N?h(z):a(z),w(),!0}function y(){switch(i.getToken()){case xt.NumericLiteral:{let N=0;try{N=JSON.parse(i.getTokenValue()),typeof N!="number"&&(b(or.InvalidNumberFormat),N=0)}catch{b(or.InvalidNumberFormat)}h(N);break}case xt.NullKeyword:h(null);break;case xt.TrueKeyword:h(!0);break;case xt.FalseKeyword:h(!1);break;default:return!1}return w(),!0}function S(){return i.getToken()!==xt.StringLiteral?(b(or.PropertyNameExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!1):(C(!1),i.getToken()===xt.ColonToken?(u(":"),w(),F()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken])):b(or.ColonExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!0)}function M(){r(),w();let N=!1;for(;i.getToken()!==xt.CloseBraceToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBraceToken&&v)break}else N&&b(or.CommaExpected,[],[]);S()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken]),N=!0}return c(),i.getToken()!==xt.CloseBraceToken?b(or.CloseBraceExpected,[xt.CloseBraceToken],[]):w(),!0}function k(){l(),w();let N=!1;for(;i.getToken()!==xt.CloseBracketToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBracketToken&&v)break}else N&&b(or.CommaExpected,[],[]);F()||b(or.ValueExpected,[],[xt.CloseBracketToken,xt.CommaToken]),N=!0}return d(),i.getToken()!==xt.CloseBracketToken?b(or.CloseBracketExpected,[xt.CloseBracketToken],[]):w(),!0}function F(){switch(i.getToken()){case xt.OpenBracketToken:return k();case xt.OpenBraceToken:return M();case xt.StringLiteral:return C(!0);default:return y()}}return w(),i.getToken()===xt.EOF?t.allowEmptyContent?!0:(b(or.ValueExpected,[],[]),!1):F()?(i.getToken()!==xt.EOF&&b(or.EndOfFileExpected,[],[]),!0):(b(or.ValueExpected,[],[]),!1)}function HW(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(n){if(Array.isArray(n))return"array"}else return"null";return"object"}default:return"null"}}class HEt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===q.Slash||this._splitOnBackslash&&i===q.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Su(new VEt(e,t))}static forPaths(e=!1){return new Su(new N$(void 0,!e))}static forStrings(){return new Su(new HEt)}static forConfigKeys(){return new Su(new UEt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);FBe(i);for(const s of i)this.set(s,e)}else{const i=e.slice(0);FBe(i);for(const s of i)this.set(s[0],s[1])}}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new nK,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new nK,s.left.segment=i.value()),o.push([Oc.Left,s]),s=s.left;else if(a<0)s.right||(s.right=new nK,s.right.segment=i.value()),o.push([Oc.Right,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new nK,s.mid.segment=i.value()),o.push([Oc.Mid,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=o[a][0],h=o[a+1][0];if(d===Oc.Right&&h===Oc.Right)o[a][1]=c.rotateLeft();else if(d===Oc.Left&&h===Oc.Left)o[a][1]=c.rotateRight();else if(d===Oc.Right&&h===Oc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===Oc.Left&&h===Oc.Right)c.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case Oc.Left:o[a-1][1].left=o[a][1];break;case Oc.Right:o[a-1][1].right=o[a][1];break;case Oc.Mid:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){return this._getNode(e)?.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)s.push([Oc.Left,o]),o=o.left;else if(r<0)s.push([Oc.Right,o]),o=o.right;else if(i.hasNext())i.next(),s.push([Oc.Mid,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=this._min(o.right);if(r.key){const{key:a,value:c,segment:l}=r;this._delete(r.key,!1),o.key=a,o.value=c,o.segment=l}}else{const r=o.left??o.right;if(s.length>0){const[a,c]=s[s.length-1];switch(a){case Oc.Left:c.left=r;break;case Oc.Mid:c.mid=r;break;case Oc.Right:c.right=r;break}}else this._root=r}for(let r=s.length-1;r>=0;r--){const a=s[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),s[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),s[r][1]=a.rotateRight()),r>0)switch(s[r-1][0]){case Oc.Left:s[r-1][1].left=s[r][1];break;case Oc.Right:s[r-1][1].right=s[r][1];break;case Oc.Mid:s[r-1][1].mid=s[r][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}const mB="vs/platform/files/common/files";var an;(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(an||(an={}));var vm;(function(n){n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked"})(vm||(vm={}));var JD;(function(n){n[n.UPDATED=2]="UPDATED",n[n.ADDED=4]="ADDED",n[n.DELETED=8]="DELETED"})(JD||(JD={}));var es;(function(n){n[n.None=0]="None",n[n.FileReadWrite=2]="FileReadWrite",n[n.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",n[n.FileReadStream=16]="FileReadStream",n[n.FileFolderCopy=8]="FileFolderCopy",n[n.PathCaseSensitive=1024]="PathCaseSensitive",n[n.Readonly=2048]="Readonly",n[n.Trash=4096]="Trash",n[n.FileWriteUnlock=8192]="FileWriteUnlock",n[n.FileAtomicRead=16384]="FileAtomicRead",n[n.FileAtomicWrite=32768]="FileAtomicWrite",n[n.FileAtomicDelete=65536]="FileAtomicDelete",n[n.FileClone=131072]="FileClone"})(es||(es={}));function sv(n){return!!(n.capabilities&es.FileReadWrite)}function jHe(n){return!!(n.capabilities&es.FileFolderCopy)}function zEt(n){return!!(n.capabilities&es.FileClone)}function mD(n){return!!(n.capabilities&es.FileOpenReadWriteClose)}function dJ(n){return!!(n.capabilities&es.FileReadStream)}function Tfe(n){return sv(n)?!!(n.capabilities&es.FileAtomicRead):!1}function KHe(n){return sv(n)?!!(n.capabilities&es.FileAtomicWrite):!1}function $Et(n){return!!(n.capabilities&es.FileAtomicDelete)}function GEt(n){return!!(n.capabilities&es.Readonly)}var rt;(function(n){n.FileExists="EntryExists",n.FileNotFound="EntryNotFound",n.FileNotADirectory="EntryNotADirectory",n.FileIsADirectory="EntryIsADirectory",n.FileExceedsStorageQuota="EntryExceedsStorageQuota",n.FileTooLarge="EntryTooLarge",n.FileWriteLocked="EntryWriteLocked",n.NoPermissions="NoPermissions",n.Unavailable="Unavailable",n.Unknown="Unknown"})(rt||(rt={}));class Nx extends Error{static create(e,t){const i=new Nx(e.toString(),t);return vJe(i,t),i}constructor(e,t){super(e),this.code=t}}function xs(n,e){return Nx.create(n,e)}function qL(n){return n||xs(g(mB,0,"Unknown Error"),rt.Unknown)}function vJe(n,e){return n.name=e?`${e} (FileSystemError)`:"FileSystemError",n}function w1(n){if(!n)return rt.Unknown;if(n instanceof Nx)return n.code;const e=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!e)return rt.Unknown;switch(e[1]){case rt.FileExists:return rt.FileExists;case rt.FileIsADirectory:return rt.FileIsADirectory;case rt.FileNotADirectory:return rt.FileNotADirectory;case rt.FileNotFound:return rt.FileNotFound;case rt.FileTooLarge:return rt.FileTooLarge;case rt.FileWriteLocked:return rt.FileWriteLocked;case rt.NoPermissions:return rt.NoPermissions;case rt.Unavailable:return rt.Unavailable}return rt.Unknown}function Cy(n){if(n instanceof Ah)return n.fileOperationResult;switch(w1(n)){case rt.FileNotFound:return Xi.FILE_NOT_FOUND;case rt.FileIsADirectory:return Xi.FILE_IS_DIRECTORY;case rt.FileNotADirectory:return Xi.FILE_NOT_DIRECTORY;case rt.FileWriteLocked:return Xi.FILE_WRITE_LOCKED;case rt.NoPermissions:return Xi.FILE_PERMISSION_DENIED;case rt.FileExists:return Xi.FILE_MOVE_CONFLICT;case rt.FileTooLarge:return Xi.FILE_TOO_LARGE;default:return Xi.FILE_OTHER_ERROR}}var Li;(function(n){n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.MOVE=2]="MOVE",n[n.COPY=3]="COPY",n[n.WRITE=4]="WRITE"})(Li||(Li={}));class qO{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var Ko;(function(n){n[n.UPDATED=0]="UPDATED",n[n.ADDED=1]="ADDED",n[n.DELETED=2]="DELETED"})(Ko||(Ko={}));const z2=class z2{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(s=>[s,!0])),i}),this.updated=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(s=>[s,!0])),i}),this.deleted=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(s=>[s,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case Ko.ADDED:this.rawAdded.push(i.resource);break;case Ko.UPDATED:this.rawUpdated.push(i.resource);break;case Ko.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==z2.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=z2.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=z2.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...i){if(!e)return!1;const s=i.length>0;return!!((!s||i.includes(Ko.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!s||i.includes(Ko.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!s||i.includes(Ko.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}};z2.MIXED_CORRELATION=null;let mee=z2;class Ah extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class hJ extends Ah{constructor(e,t,i,s){super(e,t,s),this.fileOperationResult=t,this.size=i}}class P$ extends Ah{constructor(e,t,i){super(e,Xi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Xi;(function(n){n[n.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",n[n.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",n[n.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",n[n.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",n[n.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",n[n.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",n[n.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",n[n.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",n[n.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",n[n.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",n[n.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Xi||(Xi={}));const $l={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Ng={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},SNe="files.associations",qEt="files.exclude",wJe="files.readonlyInclude",bJe="files.readonlyExclude",QEt="files.readonlyFromPermissions";var Ic;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Ic||(Ic={}));const zv="";function _ee(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}async function CJe(n,e){if(!e.hasProvider(P.from({scheme:n.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(s=>{s.scheme===n.scheme&&s.added&&(i.dispose(),t())})})}const Wd=class Wd{static formatSize(e){return jc(e)||(e=0),e{if(t instanceof _s)return t;const i=new Px("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?AZ(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return C3(i.rawConfiguration.getValue(e))},get override(){return t?C3(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return C3(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new _s(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&s.push({identifiers:r,value:c})}return s.length?C3(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?AZ(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Lc(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Lc(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=Vs(this.contents),i=Vs(this.overrides),s=[...this.keys],o=this.raw?.length?[...this.raw]:[this];for(const r of e)if(o.push(...r.raw?.length?r.raw:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[c]=i.filter(l=>Ls(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=Lc(c.keys)):i.push(Vs(a))}for(const a of r.keys)s.indexOf(a)===-1&&s.push(a)}return new _s(t,s,i,o.every(r=>r instanceof _s)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Lc([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Vs(o),this.mergeContents(o,r)):o=r),i[s]=o}return new _s(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&fo(e[i])&&fo(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Vs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Vs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Eft(this.contents,e),dp.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ls(i.identifiers,H9(e))),1))}updateValue(e,t,i){Bje(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),dp.test(e)&&this.overrides.push({identifiers:H9(e),keys:Object.keys(this.contents[e]),contents:W9(this.contents[e],s=>this.logService.error(s))})}}class Px{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||_s.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!dc(e)){const i=this.doParseContent(e);this.parseRaw(i,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new _s(i,s,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{yNe(e,a),t=s[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=W9(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),r=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){let o=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(dp.test(c)&&i){const l=this.filter(e[c],t,!1,s);r[c]=l.raw,o=o||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:ut.WINDOW:void 0;l?.restricted&&a.push(c),!s.exclude?.includes(c)&&(s.include?.includes(c)||(d===void 0||s.scopes===void 0||s.scopes.includes(d))&&!(s.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(dp.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:H9(s),keys:Object.keys(o),contents:W9(o,t)})}return i}}class yJe extends ${constructor(e,t,i,s,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=s,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new Px(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(T.any(T.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),T.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Li.CREATE)||r.isOperation(Li.COPY)||r.isOperation(Li.DELETE)||r.isOperation(Li.WRITE))&&i.isEqual(r.resource,e)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const e=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(e.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class KEt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return C3(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e: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)}}let f7=class SJe{constructor(e,t,i,s,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new wi,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=_s.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const c of s.overrides)for(const l of c.identifiers)s.getOverrideValue(e,l)!==void 0&&a.add(l);return new KEt(e,t,s.getValue(e),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,i?this._workspaceConfiguration:void 0,o||void 0,r)}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){const i=[];if(!t){const{added:s,updated:o,removed:r}=_D(this._defaultConfiguration,e);t=[...s,...o,...r]}for(const s of t)for(const o of H9(s)){const r=this._defaultConfiguration.getKeysForOverrideIdentifier(o),a=e.getKeysForOverrideIdentifier(o),c=[...a.filter(l=>r.indexOf(l)===-1),...r.filter(l=>a.indexOf(l)===-1),...r.filter(l=>!Io(this._defaultConfiguration.override(o).getValue(l),e.override(o).getValue(l)))];i.push([o,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:s}=_D(this._policyConfiguration,e),o=[...t,...i,...s];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.applicationConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.localUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.remoteUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.workspaceConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:s,updated:o,removed:r,overrides:a}=_D(i,t),c=[...s,...o,...r];return(c.length||!i)&&this.updateFolderConfiguration(e,t),{keys:c,overrides:a}}compareAndDeleteFolderConfiguration(e){const t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:i,updated:s,removed:o,overrides:r}=_D(t,void 0);return{keys:[...i,...s,...o],overrides:r}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.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},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(i=>e.add(i))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(i=>e.add(i))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(e).forEach(s=>t.add(s))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((l,d)=>(l.set(P.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new wi);return new SJe(i,s,o,r,_s.createEmptyModel(t),a,c,_s.createEmptyModel(t),new wi,t)}static parseConfigurationModel(e,t){return new _s(e.contents,e.keys,e.overrides,void 0,t)}};function YHe(...n){if(n.length===0)return{keys:[],overrides:[]};if(n.length===1)return n[0];const e=new Set,t=new Map;for(const s of n)s.keys.forEach(o=>e.add(o)),s.overrides.forEach(([o,r])=>{const a=XX(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((s,o)=>i.push([o,[...s.values()]])),{keys:[...e.values()],overrides:i}}class ANe{constructor(e,t,i,s,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=o,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=f7.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const o=s+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Io(a,c)}return!0}}function _D(n,e){const{added:t,removed:i,updated:s}=JHe(e?.rawConfiguration,n?.rawConfiguration),o=[],r=n?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!r.includes(l));for(const l of c)o.push([l,e.getKeysForOverrideIdentifier(l)])}if(n){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,n.getKeysForOverrideIdentifier(l)])}if(e&&n){for(const c of r)if(a.includes(c)){const l=JHe({contents:n.getOverrideValue(void 0,c)||{},keys:n.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});o.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:s,overrides:o}}function JHe(n,e){const t=n?e?n.keys.filter(o=>e.keys.indexOf(o)===-1):[...n.keys]:[],i=e?n?e.keys.filter(o=>n.keys.indexOf(o)===-1):[...e.keys]:[],s=[];if(n&&e){for(const o of e.keys)if(n.keys.indexOf(o)!==-1){const r=AZ(e.contents,o),a=AZ(n.contents,o);Io(r,a)||s.push(o)}}return{added:t,removed:i,updated:s}}const sK="vs/platform/keybinding/common/abstractKeybindingService",YEt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class JEt extends ${get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:T.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new nQ,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new O_,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}getDefaultKeybindingsContent(){return""}toggleLogging(){return this._logging=!this._logging,this._logging}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getDefaultKeybindings(){return this._getResolver().getDefaultKeybindings()}getKeybindings(){return this._getResolver().getKeybindings()}customKeybindingsCount(){return 0}lookupKeybindings(e){return Ui(this._getResolver().lookupKeybindings(e).map(t=>t.resolvedKeybinding))}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),gee;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),gee;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Nle("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(sK,0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(sK,1,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),b$.enabled&&b$.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],b$.enable()}dispatchByUserSettingsLabel(e,t){this._log(`/ Dispatching keybinding triggered via menu entry accelerator - ${e}`);const i=this.resolveUserBinding(e);i.length===0?this._log(`\\ Could not resolve - ${e}`):this._doDispatch(i[0],t,!1)}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new s2(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case hp.NoMatchingKb:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case hp.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case hp.KbFound:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${l.commandId} ]`),l.commandId===null||l.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(s=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{typeof l.commandArgs>"u"?this._commandService.executeCommand(l.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}YEt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=E.KeyA&&e.keyCode<=E.KeyZ||e.keyCode>=E.Digit0&&e.keyCode<=E.Digit9}}const yae=class yae{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};yae.EMPTY=new yae(null);let s2=yae;class vee{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?abe(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=abe(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===q.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function abe(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return AJe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:XEt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return EJe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}isWYSIWYG(){return this._chords.every(e=>this._isWYSIWYG(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Dht(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class XU extends ext{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Pr.Macintosh)switch(e){case E.LeftArrow:return"←";case E.UpArrow:return"↑";case E.RightArrow:return"→";case E.DownArrow:return"↓"}return iE.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":iE.toString(e.keyCode)}_getElectronAccelerator(e){return iE.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=iE.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return XU.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=iE.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===E.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===E.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===E.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===E.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=eMe[e];if(t!==E.DependsOnKbLayout)return t;switch(e){case ue.KeyA:return E.KeyA;case ue.KeyB:return E.KeyB;case ue.KeyC:return E.KeyC;case ue.KeyD:return E.KeyD;case ue.KeyE:return E.KeyE;case ue.KeyF:return E.KeyF;case ue.KeyG:return E.KeyG;case ue.KeyH:return E.KeyH;case ue.KeyI:return E.KeyI;case ue.KeyJ:return E.KeyJ;case ue.KeyK:return E.KeyK;case ue.KeyL:return E.KeyL;case ue.KeyM:return E.KeyM;case ue.KeyN:return E.KeyN;case ue.KeyO:return E.KeyO;case ue.KeyP:return E.KeyP;case ue.KeyQ:return E.KeyQ;case ue.KeyR:return E.KeyR;case ue.KeyS:return E.KeyS;case ue.KeyT:return E.KeyT;case ue.KeyU:return E.KeyU;case ue.KeyV:return E.KeyV;case ue.KeyW:return E.KeyW;case ue.KeyX:return E.KeyX;case ue.KeyY:return E.KeyY;case ue.KeyZ:return E.KeyZ;case ue.Digit1:return E.Digit1;case ue.Digit2:return E.Digit2;case ue.Digit3:return E.Digit3;case ue.Digit4:return E.Digit4;case ue.Digit5:return E.Digit5;case ue.Digit6:return E.Digit6;case ue.Digit7:return E.Digit7;case ue.Digit8:return E.Digit8;case ue.Digit9:return E.Digit9;case ue.Digit0:return E.Digit0;case ue.Minus:return E.Minus;case ue.Equal:return E.Equal;case ue.BracketLeft:return E.BracketLeft;case ue.BracketRight:return E.BracketRight;case ue.Backslash:return E.Backslash;case ue.IntlHash:return E.Unknown;case ue.Semicolon:return E.Semicolon;case ue.Quote:return E.Quote;case ue.Backquote:return E.Backquote;case ue.Comma:return E.Comma;case ue.Period:return E.Period;case ue.Slash:return E.Slash;case ue.IntlBackslash:return E.IntlBackslash}return E.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof RS)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===E.Unknown?null:new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=abe(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new XU(i,t)]:[]}}const eo=ae("labelService"),Cf=ae("progressService"),eD=ae("editorProgressService"),xJe="telemetry.telemetryLevel",txt="telemetry.enableCrashReporter",DJe="telemetry.enableTelemetry";var sp;(function(n){n[n.NONE=0]="NONE",n[n.CRASH=1]="CRASH",n[n.ERROR=2]="ERROR",n[n.USAGE=3]="USAGE"})(sp||(sp={}));var LT;(function(n){n.OFF="off",n.CRASH="crash",n.ERROR="error",n.ON="all"})(LT||(LT={}));const ixt="vs/platform/workspace/common/workspace";function BS(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.uri)}function nxt(n){return typeof n?.id=="string"&&!BS(n)&&!hF(n)}const ENe={id:"empty-window"};function UW(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:yr(n)}:ENe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function hF(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.configPath)}var Nn;(function(n){n[n.EMPTY=1]="EMPTY",n[n.FOLDER=2]="FOLDER",n[n.WORKSPACE=3]="WORKSPACE"})(Nn||(Nn={}));function cbe(n){const e=n;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function sxt(n){const e=n;return!!(e&&typeof e=="object"&&P.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let kJe=class{constructor(e,t,i,s,o){this._id=e,this._transient=i,this._configuration=s,this._ignorePathCasing=o,this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._ignorePathCasing=e._ignorePathCasing,this.folders=e.folders}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this._foldersMap.findSubstr(e)||null}updateFoldersMap(){this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0);for(const e of this.folders)this._foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}},Cde=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return qt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function wee(n){return new Cde({uri:n,index:0,name:Mx(n)},{uri:n.toString()})}const qb="code-workspace",IJe=`.${qb}`,oxt=[{name:g(ixt,0,"Code Workspace"),extensions:[qb]}];function p7(n,e){return QQe.isEqualOrParent(n,e.untitledWorkspacesHome)}function hx(n){let e;return P.isUri(n)?e=n:e=n.configuration,e?.scheme===_e.tmp}const LJe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function rxt(n){return n.id===LJe}function lbe(n,e){return!p7(n,e)&&!hx(n)}function yde(n){return(typeof n=="string"?T_(n):uz(n))===IJe}const Ti=ae("contextService"),Wc="vs/editor/common/standaloneStrings";var Jm;(function(n){n.accessibilityHelpTitle=g(Wc,0,"Accessibility Help"),n.openingDocs=g(Wc,1,"Opening the Accessibility documentation page."),n.readonlyDiffEditor=g(Wc,2,"You are in a read-only pane of a diff editor."),n.editableDiffEditor=g(Wc,3,"You are in a pane of a diff editor."),n.readonlyEditor=g(Wc,4,"You are in a read-only code editor."),n.editableEditor=g(Wc,5,"You are in a code editor."),n.changeConfigToOnMac=g(Wc,6,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),n.changeConfigToOnWinLinux=g(Wc,7,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),n.auto_on=g(Wc,8,"The application is configured to be optimized for usage with a Screen Reader."),n.auto_off=g(Wc,9,"The application is configured to never be optimized for usage with a Screen Reader."),n.screenReaderModeEnabled=g(Wc,10,"Screen Reader Optimized Mode enabled."),n.screenReaderModeDisabled=g(Wc,11,"Screen Reader Optimized Mode disabled."),n.tabFocusModeOnMsg=g(Wc,12,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior"),n.tabFocusModeOffMsg=g(Wc,13,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior"),n.stickScroll=g(Wc,14,"Focus Sticky Scroll to focus the currently nested scopes."),n.showAccessibilityHelpAction=g(Wc,15,"Show Accessibility Help"),n.listSignalSounds=g(Wc,16,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),n.listAlerts=g(Wc,17,"Run the command: List Signal Announcements for an overview of announcements and their current status."),n.quickChat=g(Wc,18,"Toggle quick chat to open or close a chat session."),n.startInlineChat=g(Wc,19,"Start inline chat to create an in editor chat session.")})(Jm||(Jm={}));var XHe;(function(n){n.inspectTokensAction=g(Wc,20,"Developer: Inspect Tokens")})(XHe||(XHe={}));var bee;(function(n){n.editorViewAccessibleLabel=g(Wc,27,"Editor content"),n.accessibilityHelpMessage=g(Wc,28,"Press Alt+F1 for Accessibility Options.")})(bee||(bee={}));var ZHe;(function(n){n.toggleHighContrast=g(Wc,29,"Toggle High Contrast Theme")})(ZHe||(ZHe={}));var dbe;(function(n){n.bulkEditServiceSummary=g(Wc,30,"Made {0} edits in {1} files")})(dbe||(dbe={}));const Sde=ae("workspaceTrustEnablementService"),oA=ae("workspaceTrustManagementService"),Ade=ae("workspaceTrustRequestService");let b1=[],xNe=[],DNe=[];function oK(n,e=!1){TJe(n,!1,e)}function axt(n){TJe(n,!0,!1)}function TJe(n,e,t){const i=cxt(n,e);b1.push(i),i.userConfigured?DNe.push(i):xNe.push(i),t&&!i.userConfigured&&b1.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function cxt(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?_w(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(qi.sep)>=0:!1}}function lxt(){b1=b1.filter(n=>n.userConfigured),xNe=[]}function dxt(){b1=b1.filter(n=>!n.userConfigured),DNe=[]}function hxt(n,e){return uxt(n,e).map(t=>t.id)}function uxt(n,e){let t;if(n)switch(n.scheme){case _e.file:t=n.fsPath;break;case _e.data:{t=h1.parseMetaData(n).get(h1.META_DATA_LABEL);break}case _e.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Js.unknown}];t=t.toLowerCase();const i=yr(t),s=eUe(t,i,DNe);if(s)return[s,{id:Kc,mime:Js.text}];const o=eUe(t,i,xNe);if(o)return[o,{id:Kc,mime:Js.text}];if(e){const r=gxt(e);if(r)return[r,{id:Kc,mime:Js.text}]}return[{id:"unknown",mime:Js.unknown}]}function eUe(n,e,t){let i,s,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!s||a.filepattern.length>s.filepattern.length)){const c=a.filepatternOnPath?n:e;a.filepatternLowercase?.(c)&&(s=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(s)return s;if(o)return o}function gxt(n){if(XRe(n)&&(n=n.substr(1)),n.length>0)for(let e=b1.length-1;e>=0;e--){const t=b1[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Hw=Object.prototype.hasOwnProperty,tUe="vs.editor.nullLanguage";class fxt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(tUe,lM.Null),this._register(Kc,lM.PlainText),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||lM.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||tUe}}const Q8=class Q8 extends ${constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Q8.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new fxt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(hM.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Q8.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},lxt();const e=[].concat(hM.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return hM.registerLanguage(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),it.as(Cs.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Hw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)oK({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)oK({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)oK({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const c=new RegExp(a);KRe(c)||oK({id:i,mime:s,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Hw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)Hw.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>mE(t.languageName,i.languageName)),e}getLanguageName(e){return Hw.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return Hw.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return Hw.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return Hw.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return Hw.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return Hw.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Hw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Hw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:hxt(e,t)}};Q8.instanceCount=0;let hbe=Q8;const j8=class j8 extends ${constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new I),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new I),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new I({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,j8.instanceCount++,this._registry=this._register(new hbe(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){j8.instanceCount--,super.dispose()}registerLanguage(e){return this._registry.registerLanguage(e)}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getRegisteredLanguageIds(){return this._registry.getRegisteredLanguageIds()}getSortedRegisteredLanguageNames(){return this._registry.getSortedRegisteredLanguageNames()}getLanguageName(e){return this._registry.getLanguageName(e)}getMimeType(e){return this._registry.getMimeType(e)}getIcon(e){return this._registry.getIcon(e)}getExtensions(e){return this._registry.getExtensions(e)}getFilenames(e){return this._registry.getFilenames(e)}getConfigurationFiles(e){return this._registry.getConfigurationFiles(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return k_(i,null)}createById(e){return new Rfe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Rfe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Rfe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Kc),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),lc.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};j8.instanceCount=0;let Cee=j8;class Rfe{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new I({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter?.fire(this.languageId))}}class pxt extends ${constructor(e,t){super(),this._register(pe(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(pe(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const gm={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Js.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},mxt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Ede=mxt;const _xt=new Ka(()=>Ede("mouse",!1)),vxt=new Ka(()=>Ede("element",!1));function RJe(n){Ede=n}function va(n){return n==="element"?vxt.value:_xt.value}function C1(){return Ede("element",!0)}class wxt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}function MJe(n){return(e,t,i)=>{let s=null,o=null;if(typeof i.value=="function"?(s="value",o=i.value):typeof i.get=="function"&&(s="get",o=i.get),!o)throw new Error("not supported");i[s]=n(o,t)}}function ii(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}function kNe(n,e,t){return MJe((i,s)=>{const o=`$debounce$${s}`,r=`$debounce$result$${s}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},n)}})}function bxt(n,e,t){return MJe((i,s)=>{const o=`$throttle$timer$${s}`,r=`$throttle$result$${s}`,a=`$throttle$lastRun$${s}`,c=`$throttle$pending$${s}`;return function(...l){if(this[r]||(this[r]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[r]=e(this[r],...l)),this[c])return;const d=this[a]+n;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0):(this[c]=!0,this[o]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0},d-Date.now()))}})}var Cxt=".monaco-list{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{height:100%;position:relative;width:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{min-width:100%;width:auto}.monaco-list-row{box-sizing:border-box;overflow:hidden;position:absolute;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{border-radius:10px;display:inline-block;font-size:12px;padding:1px 7px;position:absolute;z-index:1000}.monaco-list-type-filter-message{box-sizing:border-box;height:100%;left:0;opacity:.7;padding:40px 1em 1em;pointer-events:none;position:absolute;text-align:center;top:0;white-space:normal;width:100%}.monaco-list-type-filter-message:empty{display:none}";Ct(Cxt,{});var _R;(function(n){n[n.Copy=0]="Copy",n[n.Move=1]="Move"})(_R||(_R={}));var iS;(function(n){n.Over="drop-target",n.Before="drop-target-before",n.After="drop-target-after"})(iS||(iS={}));class SL extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function iUe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Axt{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=iUe({start:0,end:e},this.groups),r=iUe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:ube(c.range,s),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=Sxt(o,a,r),this._size=this._paddingTop+this.groups.reduce((c,l)=>c+l.size*(l.range.end-l.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}const AL={CurrentDragAndDropData:void 0};var AA;(function(n){n[n.TOP=0]="TOP",n[n.CENTER_TOP=1]="CENTER_TOP",n[n.CENTER_BOTTOM=2]="CENTER_BOTTOM",n[n.BOTTOM=3]="BOTTOM"})(AA||(AA={}));const bC={useShadows:!0,verticalScrollMode:zo.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class vQ{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NJe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class gbe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const Sae=class Sae{get contentHeight(){return this.rangeMap.size}get contentWidth(){return this.scrollWidth??0}get onDidScroll(){return this.scrollableElement.onScroll}get onWillScroll(){return this.scrollableElement.onWillScroll}get containerDomNode(){return this.rowsContainer}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:h$(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=bC){if(this.virtualDelegate=t,this.domId=`list_id_${++Sae.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Lu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=$.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=$.None,this.onDragLeaveTimeout=$.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=T.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=T.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new xxt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??bC.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new kxt(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??bC.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(dh.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new nO({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>xd(gt(this.domNode),r)})),this.scrollableElement=this.disposables.add(new hQ(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??bC.alwaysConsumeMouseWheel,horizontal:zo.Auto,vertical:s.verticalScrollMode??bC.verticalScrollMode,useShadows:s.useShadows??bC.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(pe(this.rowsContainer,Eo.Change,r=>this.onTouchChange(r))),this.disposables.add(pe(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(pe(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=s.setRowLineHeight??bC.setRowLineHeight,this.setRowHeight=s.setRowHeight??bC.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??bC.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(bC.dnd),this.layout(s.initialSize?.height,s.initialSize?.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}delegateScrollFromMouseWheelEvent(e){this.scrollableElement.delegateScrollFromMouseWheelEvent(e)}delegateVerticalScrollbarPointerDown(e){this.scrollableElement.delegateVerticalScrollbarPointerDown(e)}updateElementHeight(e,t,i){if(e<0||e>=this.items.length)return;const s=this.items[e].size;if(typeof t>"u"){if(!this.supportDynamicHeights){console.warn("Dynamic heights not supported");return}this.items[e].lastDynamicHeightWidth=void 0,t=s+this.probeDynamicHeight(e)}if(s===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;S--){const M=this.items[S];if(M.dragStartDisposable.dispose(),M.checkedDisposable.dispose(),M.row){let k=a.get(M.templateId);k||(k=[],a.set(M.templateId,k));const F=this.renderers.get(M.templateId);F&&F.disposeElement&&F.disposeElement(M.element,S,M.row.templateData,M.size),k.unshift(M.row)}M.row=null,M.stale=!0}const c={start:e+t,end:this.items.length},l=Dh.intersect(c,s),d=Dh.relativeComplement(c,s),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:$.None,checkedDisposable:$.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));const f=i.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=ube(l,f),v=Dh.intersect(p,m);for(let S=v.start;Sube(S,f)),y=[{start:e,end:e+i.length},...b].map(S=>Dh.intersect(p,S)).reverse();for(const S of y)for(let M=S.end-1;M>=S.start;M--){const k=this.items[M],N=a.get(k.templateId)?.pop();this.insertItemInDOM(M,N)}for(const S of a.values())for(const M of S)this.cache.release(M);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=xd(gt(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}updateWidth(e){if(!this.horizontalScrolling||typeof this.scrollWidth>"u")return;const t=this.items[e];this.measureItemWidth(t),typeof t.width<"u"&&t.width>this.scrollWidth&&(this.scrollWidth=t.width,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth+10}),this._onDidChangeContentWidth.fire(this.scrollWidth))}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}get firstMostlyVisibleIndex(){const e=this.firstVisibleIndex,t=this.rangeMap.positionAt(e),i=this.rangeMap.positionAt(e+1);return i!==-1&&(i-t)/2+tt.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:aMe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:h$(this.domNode)})}render(e,t,i,s,o,r=!1){const a=this.getRenderRange(t,i),c=Dh.relativeComplement(a,e).reverse(),l=Dh.relativeComplement(e,a);if(r){const d=Dh.intersect(e,a);for(let h=d.start;h{for(const d of l)for(let h=d.start;h=d.start;h--)this.insertItemInDOM(h)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const o=this.accessibilityProvider.isChecked(i.element);if(typeof o=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!o));else if(o){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(o.value),i.checkedDisposable=o.onDidChange(()=>c(o.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const r=this.renderers.get(i.templateId);if(!r)throw new Error(`No renderer found for template id ${i.templateId}`);r?.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=pe(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,a,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=h$(e.row.domNode);const t=gt(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}getScrollLeft(){return this.scrollableElement.getScrollPosition().scrollLeft}setScrollLeft(e){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth})),this.scrollableElement.setScrollPosition({scrollLeft:e})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return T.map(this.disposables.add(new oi(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return T.map(this.disposables.add(new oi(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return T.filter(T.map(this.disposables.add(new oi(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return T.map(this.disposables.add(new oi(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return T.map(this.disposables.add(new oi(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return T.map(this.disposables.add(new oi(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return T.map(this.disposables.add(new oi(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return T.map(this.disposables.add(new oi(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return T.any(T.map(this.disposables.add(new oi(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),T.map(this.disposables.add(new oi(this.domNode,Eo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return T.map(this.disposables.add(new oi(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return T.map(this.disposables.add(new oi(this.rowsContainer,Eo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(gm.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length));const r=we(".monaco-drag-image");r.textContent=o;const c=(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode);c.appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>c.removeChild(r),0)}this.domNode.classList.add("dragging"),this.currentDragData=new vQ(s),AL.CurrentDragAndDropData=new NJe(s),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),AL.CurrentDragAndDropData&&AL.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(AL.CurrentDragAndDropData)this.currentDragData=AL.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new gbe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===_R.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Lc(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:iS.Over;if(Dxt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!==iS.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");s===iS.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(s)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=PS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=$.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=bZ(this.domNode).top;this.dragOverAnimationDisposable=rgt(gt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=PS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return Dc(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;Ra(i)&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const c=this.getRenderRange(e,t);let l=!1;for(let d=c.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=c.start;un===e;function fbe(n=Zb){return(e,t)=>Ls(e,t,n)}function PJe(){return(n,e)=>n.equals(e)}function Ixt(n,e,t){return!n||!e?n===e:t(n,e)}function Lxt(n){return JSON.stringify(pbe(n))}let Txt=0;const nUe=new WeakMap;function pbe(n){if(Array.isArray(n))return n.map(pbe);if(n&&typeof n=="object")if(Object.getPrototypeOf(n)===Object.prototype){const e=n,t=Object.create(null);for(const i of Object.keys(e).sort())t[i]=pbe(e[i]);return t}else{let e=nUe.get(n);return e===void 0&&(e=Txt++,nUe.set(n,e)),e+"----2b76a038c20c4bcc"}return n}class ff{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return Rxt(e,this)}}const sUe=new Map,mbe=new WeakMap;function Rxt(n,e){const t=mbe.get(n);if(t)return t;const i=Mxt(n,e);if(i){let s=sUe.get(i)??0;s++,sUe.set(i,s);const o=s===1?i:`${i}#${s}`;return mbe.set(n,o),o}}function Mxt(n,e){const t=mbe.get(n);if(t)return t;const i=e.owner?Pxt(e.owner)+".":"";let s;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(s=o(),s!==void 0)return i+s}else return i+o;const r=e.referenceFn;if(r!==void 0&&(s=xde(r),s!==void 0))return i+s;if(e.owner!==void 0){const a=Nxt(e.owner,n);if(a!==void 0)return i+a}}function Nxt(n,e){for(const t in n)if(n[t]===e)return t}const oUe=new Map,rUe=new WeakMap;function Pxt(n){const e=rUe.get(n);if(e)return e;const t=Fxt(n);let i=oUe.get(t)??0;i++,oUe.set(t,i);const s=i===1?t:`${t}#${i}`;return rUe.set(n,s),s}function Fxt(n){const e=n.constructor;return e?e.name:"Object"}function xde(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}let FJe;function Oxt(n){FJe=n}let OJe;function Bxt(n){OJe=n}let BJe;function Wxt(n){BJe=n}class WJe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return BJe({owner:i,debugName:()=>{const o=xde(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},o=>s(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(FJe(this,t)),this}keepObserved(e){return e.add(OJe(this)),this}get debugValue(){return this.get()}}class wQ extends WJe{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function En(n,e){const t=new Dde(n,e);try{n(t)}finally{t.finish()}}let rK;function uJ(n){if(rK)n(rK);else{const e=new Dde(n,void 0);rK=e;try{n(e)}finally{e.finish(),rK=void 0}}}async function Hxt(n,e){const t=new Dde(n,e);try{await n(t)}finally{t.finish()}}function m7(n,e,t){n?e(n):En(e,t)}class Dde{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():xde(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t{},()=>`Setting ${this.debugName}`));try{this._setValue(e);for(const o of this.observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function _7(n,e){let t;return typeof n=="string"?t=new ff(void 0,n,void 0):t=new ff(n,void 0,void 0),new Vxt(t,e,Zb)}class Vxt extends INe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Dt(n,e){return e!==void 0?new uF(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb):new uF(new ff(void 0,void 0,n),n,void 0,void 0,void 0,Zb)}function HJe(n,e,t){return new $xt(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb,t)}function yy(n,e){return new uF(new ff(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,n.equalsFn??Zb)}Wxt(yy);function zxt(n,e){return new uF(new ff(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,n.equalityComparer??Zb)}function wO(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),Zb)}function WC(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>{s.clear();const r=t(o);return r&&s.add(r),r},void 0,void 0,()=>s.dispose(),Zb)}var wh;(function(n){n[n.initial=0]="initial",n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(wh||(wh={}));class uF extends wQ{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=s,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=wh.initial,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=this.createChangeSummary?.()}onLastObserverRemoved(){this.state=wh.initial,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),this._handleLastObserverRemoved?.()}get(){if(this.observers.size===0){const e=this._computeFn(this,this.createChangeSummary?.());return this.onLastObserverRemoved(),e}else{do{if(this.state===wh.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===wh.stale)break}this.state===wh.dependenciesMightHaveChanged&&(this.state=wh.upToDate),this._recomputeIfNeeded()}while(this.state!==wh.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===wh.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==wh.initial,i=this.value;this.state=wh.upToDate;const s=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,s)}finally{for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const r of this.observers)r.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===wh.upToDate&&(this.state=wh.dependenciesMightHaveChanged,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}fw(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===wh.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=wh.dependenciesMightHaveChanged;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===wh.upToDate;if(i&&(this.state===wh.dependenciesMightHaveChanged||s)&&(this.state=wh.stale,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class $xt extends uF{constructor(e,t,i,s,o=void 0,r,a){super(e,t,i,s,o,r),this.set=a}}function Ni(n){return new kde(new ff(void 0,void 0,n),n,void 0,void 0)}function bQ(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,void 0,void 0)}function Az(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,n.createEmptyChangeSummary,n.handleChange)}function Em(n){const e=new Z,t=bQ({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var Lp;(function(n){n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(Lp||(Lp={}));class kde{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=Lp.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),rz(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),az(this)}_runIfNeeded(){if(this.state===Lp.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=Lp.upToDate;const t=this.disposed;try{if(!t){const i=this.changeSummary;this.changeSummary=this.createChangeSummary?.(),this._runFn(this,i)}}finally{for(const i of this.dependenciesToBeRemoved)i.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===Lp.upToDate&&(this.state=Lp.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===Lp.dependenciesMightHaveChanged){this.state=Lp.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===Lp.stale)break}this._runIfNeeded()}while(this.state!==Lp.upToDate);this.updateCount--,fw(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===Lp.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=Lp.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=Lp.stale)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=kde})(Ni||(Ni={}));function Au(n){return new Gxt(n)}class Gxt extends WJe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Wn(n,e){return new vR(n,e)}class vR extends wQ{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{const s=this._getValue(i),o=this.value;(!this.hasValue||o!==s)&&(this.value=s,this.hasValue&&m7(vR.globalTransaction,a=>{for(const c of this.observers)a.updateObserver(c,this),c.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return xde(this._getValue)}get debugName(){const 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)}}(function(n){n.Observer=vR;function e(t,i){let s=!1;vR.globalTransaction===void 0&&(vR.globalTransaction=t,s=!0);try{i()}finally{s&&(vR.globalTransaction=void 0)}}n.batchEventsGlobally=e})(Wn||(Wn={}));function Bh(n,e){return new qxt(n,e)}class qxt extends wQ{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{En(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function oL(n){return typeof n=="string"?new aUe(n):new aUe(void 0,n)}class aUe extends wQ{get debugName(){return new ff(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){En(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function gJ(n){const e=new UJe(!1,void 0);return n.addObserver(e),Ee(()=>{n.removeObserver(e)})}Bxt(gJ);function Ez(n,e){const t=new UJe(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),Ee(()=>{n.removeObserver(t)})}Oxt(Ez);class UJe{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function Qxt(n,e){let t;return Dt(n,s=>(t=e(s,t),t))}function jxt(n,e){let t;const i=oL("derivedObservableWithWritableCache"),s=Dt(n,o=>(i.read(o),t=e(o,t),t));return Object.assign(s,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function yee(n,e,t,i){let s=new cUe(t,i);return yy({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{s.dispose(),s=new cUe(t)}},r=>(s.setItems(e.read(r)),s.getItems()))}class cUe{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const s of e){const o=this._keySelector?this._keySelector(s):s;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(s,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const s of i)this._cache.get(s).store.dispose(),this._cache.delete(s);this._items=t}getItems(){return this._items}}class LNe{constructor(e){this.observable=e}get onDidChange(){return T.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function VJe(n,e){return e instanceof LNe?e.observable:Wn(e.onDidChange,()=>e.value)}class Kxt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let v7=class{get name(){return this._trait}get renderer(){return new Kxt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(dUe),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=vbe(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return CU(this.sortedIndexes,e,dUe)>=0}dispose(){St(this._onChange)}};v7.__decorator=D([ii],v7.prototype,"renderer",null);class Yxt extends v7{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class Mfe{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function ux(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function CQ(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:CQ(n.parentElement,e)}function y3(n){return CQ(n,"monaco-editor")}function Jxt(n){return CQ(n,"monaco-custom-toggle")}function Xxt(n){return CQ(n,"action-item")}function F$(n){return CQ(n,"monaco-tree-sticky-row")}function w7(n){return n.classList.contains("monaco-tree-sticky-container")}function zJe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:zJe(n.parentElement)}class _be{get onKeyDown(){return T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,e=>e.filter(t=>!ux(t.target)).map(t=>new os(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Z,this.multipleSelectionDisposables=new Z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case E.Enter:return this.onEnter(s);case E.UpArrow:return this.onUpArrow(s);case E.DownArrow:return this.onDownArrow(s);case E.PageUp:return this.onPageUpArrow(s);case E.PageDown:return this.onPageDownArrow(s);case E.Escape:return this.onEscape(s);case E.KeyA:this.multipleSelectionSupport&&(ei?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Mg(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}_be.__decorator=D([ii],_be.prototype,"onKeyDown",null);var Sy;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Sy||(Sy={}));var o2;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(o2||(o2={}));const Zxt=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=E.KeyA&&n.keyCode<=E.KeyZ||n.keyCode>=E.Digit0&&n.keyCode<=E.Digit9||n.keyCode>=E.Numpad0&&n.keyCode<=E.Numpad9||n.keyCode>=E.Semicolon&&n.keyCode<=E.Quote}};class eDt{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=o2.Idle,this.mode=Sy.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Z,this.disposables=new Z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Sy.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=T.chain(this.enabledDisposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).filter(()=>this.mode===Sy.Automatic||this.triggered).map(r=>new os(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>un.stop(r,!0)).map(r=>r.browserEvent.key)),i=T.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);T.reduce(T.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?sa(t):t&&sa(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=o2.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===o2.Idle?1:0;this.state=o2.Typing;for(let o=0;o1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof c>"u"||dF(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class tDt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=T.chain(this.disposables.add(new oi(t.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).map(r=>new os(r)));T.chain(i,o=>o.filter(r=>r.keyCode===E.Tab&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!Ra(s)||s.tabIndex===-1)return;const o=gt(s).getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function $Je(n){return ei?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function GJe(n){return n.browserEvent.shiftKey}function iDt(n){return dMe(n)&&n.button===2}const lUe={isSelectionSingleChangeEvent:$Je,isSelectionRangeChangeEvent:GJe};class qJe{constructor(e){this.list=e,this.disposables=new Z,this._onPointer=new I,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(dh.addTarget(e.getHTMLElement()))),T.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){y3(e.browserEvent.target)||xl()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),iDt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),o=Math.max(i,t),r=Mg(s,o+1),a=this.list.getSelection(),c=oDt(vbe(a,[i]),i);if(c.length===0)return;const l=vbe(r,rDt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class QJe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` +`),r=xt.LineBreakTrivia;switch(m){case si.openBrace:return t++,r=xt.OpenBraceToken;case si.closeBrace:return t++,r=xt.CloseBraceToken;case si.openBracket:return t++,r=xt.OpenBracketToken;case si.closeBracket:return t++,r=xt.CloseBracketToken;case si.colon:return t++,r=xt.ColonToken;case si.comma:return t++,r=xt.CommaToken;case si.doubleQuote:return t++,s=h(),r=xt.StringLiteral;case si.slash:{const v=t-1;if(n.charCodeAt(t+1)===si.slash){for(t+=2;t=xt.LineCommentTrivia&&m<=xt.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>s,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function Lfe(n){return n===si.space||n===si.tab||n===si.verticalTab||n===si.formFeed||n===si.nonBreakingSpace||n===si.ogham||n>=si.enQuad&&n<=si.zeroWidthSpace||n===si.narrowNoBreakSpace||n===si.mathematicalSpace||n===si.ideographicSpace||n===si.byteOrderMark}function iK(n){return n===si.lineFeed||n===si.carriageReturn||n===si.lineSeparator||n===si.paragraphSeparator}function GO(n){return n>=si._0&&n<=si._9}var si;(function(n){n[n.nullCharacter=0]="nullCharacter",n[n.maxAsciiCharacter=127]="maxAsciiCharacter",n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.lineSeparator=8232]="lineSeparator",n[n.paragraphSeparator=8233]="paragraphSeparator",n[n.nextLine=133]="nextLine",n[n.space=32]="space",n[n.nonBreakingSpace=160]="nonBreakingSpace",n[n.enQuad=8192]="enQuad",n[n.emQuad=8193]="emQuad",n[n.enSpace=8194]="enSpace",n[n.emSpace=8195]="emSpace",n[n.threePerEmSpace=8196]="threePerEmSpace",n[n.fourPerEmSpace=8197]="fourPerEmSpace",n[n.sixPerEmSpace=8198]="sixPerEmSpace",n[n.figureSpace=8199]="figureSpace",n[n.punctuationSpace=8200]="punctuationSpace",n[n.thinSpace=8201]="thinSpace",n[n.hairSpace=8202]="hairSpace",n[n.zeroWidthSpace=8203]="zeroWidthSpace",n[n.narrowNoBreakSpace=8239]="narrowNoBreakSpace",n[n.ideographicSpace=12288]="ideographicSpace",n[n.mathematicalSpace=8287]="mathematicalSpace",n[n.ogham=5760]="ogham",n[n._=95]="_",n[n.$=36]="$",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.ampersand=38]="ampersand",n[n.asterisk=42]="asterisk",n[n.at=64]="at",n[n.backslash=92]="backslash",n[n.bar=124]="bar",n[n.caret=94]="caret",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.closeParen=41]="closeParen",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.equals=61]="equals",n[n.exclamation=33]="exclamation",n[n.greaterThan=62]="greaterThan",n[n.lessThan=60]="lessThan",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.openParen=40]="openParen",n[n.percent=37]="percent",n[n.plus=43]="plus",n[n.question=63]="question",n[n.semicolon=59]="semicolon",n[n.singleQuote=39]="singleQuote",n[n.slash=47]="slash",n[n.tilde=126]="tilde",n[n.backspace=8]="backspace",n[n.formFeed=12]="formFeed",n[n.byteOrderMark=65279]="byteOrderMark",n[n.tab=9]="tab",n[n.verticalTab=11]="verticalTab"})(si||(si={}));function ow(n,e=[],t=g7.DEFAULT){let i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}return yNe(n,{onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),s[0]}function _Je(n,e=[],t=g7.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}yNe(n,{onObjectBegin:c=>{i=o({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=o({type:"property",offset:l,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:c,offset:l,length:d,parent:i})},onObjectEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onArrayBegin:(c,l)=>{i=o({type:"array",offset:c,length:-1,parent:i,children:[]})},onArrayEnd:(c,l)=>{i.length=c+l-i.offset,i=i.parent,s(c+l)},onLiteralValue:(c,l,d)=>{o({type:HW(c),offset:l,length:d,parent:i,value:c}),s(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&s(l))},onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t);const a=i.children[0];return a&&delete a.parent,a}function rbe(n,e){if(!n)return;let t=n;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let s=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],s=!0;break}if(!s)return}else{const s=i;if(t.type!=="array"||s<0||!Array.isArray(t.children)||s>=t.children.length)return;t=t.children[s]}return t}function yNe(n,e,t=g7.DEFAULT){const i=mJe(n,!1);function s(N){return N?()=>N(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(N){return N?z=>N(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=s(e.onObjectBegin),a=o(e.onObjectProperty),c=s(e.onObjectEnd),l=s(e.onArrayBegin),d=s(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=s(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function w(){for(;;){const N=i.scan();switch(i.getTokenError()){case md.InvalidUnicode:b(or.InvalidUnicode);break;case md.InvalidEscapeCharacter:b(or.InvalidEscapeCharacter);break;case md.UnexpectedEndOfNumber:b(or.UnexpectedEndOfNumber);break;case md.UnexpectedEndOfComment:m||b(or.UnexpectedEndOfComment);break;case md.UnexpectedEndOfString:b(or.UnexpectedEndOfString);break;case md.InvalidCharacter:b(or.InvalidCharacter);break}switch(N){case xt.LineCommentTrivia:case xt.BlockCommentTrivia:m?b(or.InvalidCommentToken):f();break;case xt.Unknown:b(or.InvalidSymbol);break;case xt.Trivia:case xt.LineBreakTrivia:break;default:return N}}}function b(N,z=[],U=[]){if(p(N),z.length+U.length>0){let J=i.getToken();for(;J!==xt.EOF;){if(z.indexOf(J)!==-1){w();break}else if(U.indexOf(J)!==-1)break;J=w()}}}function C(N){const z=i.getTokenValue();return N?h(z):a(z),w(),!0}function y(){switch(i.getToken()){case xt.NumericLiteral:{let N=0;try{N=JSON.parse(i.getTokenValue()),typeof N!="number"&&(b(or.InvalidNumberFormat),N=0)}catch{b(or.InvalidNumberFormat)}h(N);break}case xt.NullKeyword:h(null);break;case xt.TrueKeyword:h(!0);break;case xt.FalseKeyword:h(!1);break;default:return!1}return w(),!0}function S(){return i.getToken()!==xt.StringLiteral?(b(or.PropertyNameExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!1):(C(!1),i.getToken()===xt.ColonToken?(u(":"),w(),F()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken])):b(or.ColonExpected,[],[xt.CloseBraceToken,xt.CommaToken]),!0)}function M(){r(),w();let N=!1;for(;i.getToken()!==xt.CloseBraceToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBraceToken&&v)break}else N&&b(or.CommaExpected,[],[]);S()||b(or.ValueExpected,[],[xt.CloseBraceToken,xt.CommaToken]),N=!0}return c(),i.getToken()!==xt.CloseBraceToken?b(or.CloseBraceExpected,[xt.CloseBraceToken],[]):w(),!0}function k(){l(),w();let N=!1;for(;i.getToken()!==xt.CloseBracketToken&&i.getToken()!==xt.EOF;){if(i.getToken()===xt.CommaToken){if(N||b(or.ValueExpected,[],[]),u(","),w(),i.getToken()===xt.CloseBracketToken&&v)break}else N&&b(or.CommaExpected,[],[]);F()||b(or.ValueExpected,[],[xt.CloseBracketToken,xt.CommaToken]),N=!0}return d(),i.getToken()!==xt.CloseBracketToken?b(or.CloseBracketExpected,[xt.CloseBracketToken],[]):w(),!0}function F(){switch(i.getToken()){case xt.OpenBracketToken:return k();case xt.OpenBraceToken:return M();case xt.StringLiteral:return C(!0);default:return y()}}return w(),i.getToken()===xt.EOF?t.allowEmptyContent?!0:(b(or.ValueExpected,[],[]),!1):F()?(i.getToken()!==xt.EOF&&b(or.EndOfFileExpected,[],[]),!0):(b(or.ValueExpected,[],[]),!1)}function HW(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(n){if(Array.isArray(n))return"array"}else return"null";return"object"}default:return"null"}}class HEt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===Q.Slash||this._splitOnBackslash&&i===Q.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Su(new VEt(e,t))}static forPaths(e=!1){return new Su(new N$(void 0,!e))}static forStrings(){return new Su(new HEt)}static forConfigKeys(){return new Su(new UEt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);FBe(i);for(const s of i)this.set(s,e)}else{const i=e.slice(0);FBe(i);for(const s of i)this.set(s[0],s[1])}}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new nK,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new nK,s.left.segment=i.value()),o.push([Bc.Left,s]),s=s.left;else if(a<0)s.right||(s.right=new nK,s.right.segment=i.value()),o.push([Bc.Right,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new nK,s.mid.segment=i.value()),o.push([Bc.Mid,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=o[a][0],h=o[a+1][0];if(d===Bc.Right&&h===Bc.Right)o[a][1]=c.rotateLeft();else if(d===Bc.Left&&h===Bc.Left)o[a][1]=c.rotateRight();else if(d===Bc.Right&&h===Bc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===Bc.Left&&h===Bc.Right)c.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case Bc.Left:o[a-1][1].left=o[a][1];break;case Bc.Right:o[a-1][1].right=o[a][1];break;case Bc.Mid:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){return this._getNode(e)?.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)s.push([Bc.Left,o]),o=o.left;else if(r<0)s.push([Bc.Right,o]),o=o.right;else if(i.hasNext())i.next(),s.push([Bc.Mid,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=this._min(o.right);if(r.key){const{key:a,value:c,segment:l}=r;this._delete(r.key,!1),o.key=a,o.value=c,o.segment=l}}else{const r=o.left??o.right;if(s.length>0){const[a,c]=s[s.length-1];switch(a){case Bc.Left:c.left=r;break;case Bc.Mid:c.mid=r;break;case Bc.Right:c.right=r;break}}else this._root=r}for(let r=s.length-1;r>=0;r--){const a=s[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),s[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),s[r][1]=a.rotateRight()),r>0)switch(s[r-1][0]){case Bc.Left:s[r-1][1].left=s[r][1];break;case Bc.Right:s[r-1][1].right=s[r][1];break;case Bc.Mid:s[r-1][1].mid=s[r][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}const mB="vs/platform/files/common/files";var an;(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(an||(an={}));var vm;(function(n){n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked"})(vm||(vm={}));var JD;(function(n){n[n.UPDATED=2]="UPDATED",n[n.ADDED=4]="ADDED",n[n.DELETED=8]="DELETED"})(JD||(JD={}));var es;(function(n){n[n.None=0]="None",n[n.FileReadWrite=2]="FileReadWrite",n[n.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",n[n.FileReadStream=16]="FileReadStream",n[n.FileFolderCopy=8]="FileFolderCopy",n[n.PathCaseSensitive=1024]="PathCaseSensitive",n[n.Readonly=2048]="Readonly",n[n.Trash=4096]="Trash",n[n.FileWriteUnlock=8192]="FileWriteUnlock",n[n.FileAtomicRead=16384]="FileAtomicRead",n[n.FileAtomicWrite=32768]="FileAtomicWrite",n[n.FileAtomicDelete=65536]="FileAtomicDelete",n[n.FileClone=131072]="FileClone"})(es||(es={}));function sv(n){return!!(n.capabilities&es.FileReadWrite)}function jHe(n){return!!(n.capabilities&es.FileFolderCopy)}function zEt(n){return!!(n.capabilities&es.FileClone)}function mD(n){return!!(n.capabilities&es.FileOpenReadWriteClose)}function dJ(n){return!!(n.capabilities&es.FileReadStream)}function Tfe(n){return sv(n)?!!(n.capabilities&es.FileAtomicRead):!1}function KHe(n){return sv(n)?!!(n.capabilities&es.FileAtomicWrite):!1}function $Et(n){return!!(n.capabilities&es.FileAtomicDelete)}function GEt(n){return!!(n.capabilities&es.Readonly)}var rt;(function(n){n.FileExists="EntryExists",n.FileNotFound="EntryNotFound",n.FileNotADirectory="EntryNotADirectory",n.FileIsADirectory="EntryIsADirectory",n.FileExceedsStorageQuota="EntryExceedsStorageQuota",n.FileTooLarge="EntryTooLarge",n.FileWriteLocked="EntryWriteLocked",n.NoPermissions="NoPermissions",n.Unavailable="Unavailable",n.Unknown="Unknown"})(rt||(rt={}));class Nx extends Error{static create(e,t){const i=new Nx(e.toString(),t);return vJe(i,t),i}constructor(e,t){super(e),this.code=t}}function xs(n,e){return Nx.create(n,e)}function qL(n){return n||xs(g(mB,0,"Unknown Error"),rt.Unknown)}function vJe(n,e){return n.name=e?`${e} (FileSystemError)`:"FileSystemError",n}function w1(n){if(!n)return rt.Unknown;if(n instanceof Nx)return n.code;const e=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!e)return rt.Unknown;switch(e[1]){case rt.FileExists:return rt.FileExists;case rt.FileIsADirectory:return rt.FileIsADirectory;case rt.FileNotADirectory:return rt.FileNotADirectory;case rt.FileNotFound:return rt.FileNotFound;case rt.FileTooLarge:return rt.FileTooLarge;case rt.FileWriteLocked:return rt.FileWriteLocked;case rt.NoPermissions:return rt.NoPermissions;case rt.Unavailable:return rt.Unavailable}return rt.Unknown}function Cy(n){if(n instanceof Ah)return n.fileOperationResult;switch(w1(n)){case rt.FileNotFound:return Zi.FILE_NOT_FOUND;case rt.FileIsADirectory:return Zi.FILE_IS_DIRECTORY;case rt.FileNotADirectory:return Zi.FILE_NOT_DIRECTORY;case rt.FileWriteLocked:return Zi.FILE_WRITE_LOCKED;case rt.NoPermissions:return Zi.FILE_PERMISSION_DENIED;case rt.FileExists:return Zi.FILE_MOVE_CONFLICT;case rt.FileTooLarge:return Zi.FILE_TOO_LARGE;default:return Zi.FILE_OTHER_ERROR}}var Li;(function(n){n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.MOVE=2]="MOVE",n[n.COPY=3]="COPY",n[n.WRITE=4]="WRITE"})(Li||(Li={}));class qO{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var Ko;(function(n){n[n.UPDATED=0]="UPDATED",n[n.ADDED=1]="ADDED",n[n.DELETED=2]="DELETED"})(Ko||(Ko={}));const z2=class z2{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(s=>[s,!0])),i}),this.updated=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(s=>[s,!0])),i}),this.deleted=new Ka(()=>{const i=Su.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(s=>[s,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case Ko.ADDED:this.rawAdded.push(i.resource);break;case Ko.UPDATED:this.rawUpdated.push(i.resource);break;case Ko.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==z2.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=z2.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=z2.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...i){if(!e)return!1;const s=i.length>0;return!!((!s||i.includes(Ko.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!s||i.includes(Ko.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!s||i.includes(Ko.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId=="number"}};z2.MIXED_CORRELATION=null;let mee=z2;class Ah extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class hJ extends Ah{constructor(e,t,i,s){super(e,t,s),this.fileOperationResult=t,this.size=i}}class P$ extends Ah{constructor(e,t,i){super(e,Zi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Zi;(function(n){n[n.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",n[n.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",n[n.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",n[n.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",n[n.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",n[n.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",n[n.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",n[n.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",n[n.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",n[n.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",n[n.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Zi||(Zi={}));const $l={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Ng={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},SNe="files.associations",qEt="files.exclude",wJe="files.readonlyInclude",bJe="files.readonlyExclude",QEt="files.readonlyFromPermissions";var Ic;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Ic||(Ic={}));const zv="";function _ee(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}async function CJe(n,e){if(!e.hasProvider(P.from({scheme:n.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(s=>{s.scheme===n.scheme&&s.added&&(i.dispose(),t())})})}const Wd=class Wd{static formatSize(e){return Kc(e)||(e=0),e{if(t instanceof _s)return t;const i=new Px("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?AZ(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return C3(i.rawConfiguration.getValue(e))},get override(){return t?C3(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return C3(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new _s(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&s.push({identifiers:r,value:c})}return s.length?C3(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?AZ(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Lc(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Lc(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=Vs(this.contents),i=Vs(this.overrides),s=[...this.keys],o=this.raw?.length?[...this.raw]:[this];for(const r of e)if(o.push(...r.raw?.length?r.raw:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[c]=i.filter(l=>Ls(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=Lc(c.keys)):i.push(Vs(a))}for(const a of r.keys)s.indexOf(a)===-1&&s.push(a)}return new _s(t,s,i,o.every(r=>r instanceof _s)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Lc([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Vs(o),this.mergeContents(o,r)):o=r),i[s]=o}return new _s(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&fo(e[i])&&fo(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Vs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Vs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Eft(this.contents,e),dp.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ls(i.identifiers,H9(e))),1))}updateValue(e,t,i){Bje(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),dp.test(e)&&this.overrides.push({identifiers:H9(e),keys:Object.keys(this.contents[e]),contents:W9(this.contents[e],s=>this.logService.error(s))})}}class Px{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||_s.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!hc(e)){const i=this.doParseContent(e);this.parseRaw(i,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new _s(i,s,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,s=[];const o=[];function r(c){Array.isArray(s)?s.push(c):i!==null&&(s[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(s),s=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(s),s=c,i=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{yNe(e,a),t=s[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=W9(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),r=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){let o=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(dp.test(c)&&i){const l=this.filter(e[c],t,!1,s);r[c]=l.raw,o=o||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:ut.WINDOW:void 0;l?.restricted&&a.push(c),!s.exclude?.includes(c)&&(s.include?.includes(c)||(d===void 0||s.scopes===void 0||s.scopes.includes(d))&&!(s.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(dp.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:H9(s),keys:Object.keys(o),contents:W9(o,t)})}return i}}class yJe extends ${constructor(e,t,i,s,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=s,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new Px(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(T.any(T.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),T.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Li.CREATE)||r.isOperation(Li.COPY)||r.isOperation(Li.DELETE)||r.isOperation(Li.WRITE))&&i.isEqual(r.resource,e)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const e=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(e.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class KEt{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return C3(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e: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)}}let f7=class SJe{constructor(e,t,i,s,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new wi,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=_s.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const c of s.overrides)for(const l of c.identifiers)s.getOverrideValue(e,l)!==void 0&&a.add(l);return new KEt(e,t,s.getValue(e),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,i?this._workspaceConfiguration:void 0,o||void 0,r)}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){const i=[];if(!t){const{added:s,updated:o,removed:r}=_D(this._defaultConfiguration,e);t=[...s,...o,...r]}for(const s of t)for(const o of H9(s)){const r=this._defaultConfiguration.getKeysForOverrideIdentifier(o),a=e.getKeysForOverrideIdentifier(o),c=[...a.filter(l=>r.indexOf(l)===-1),...r.filter(l=>a.indexOf(l)===-1),...r.filter(l=>!Io(this._defaultConfiguration.override(o).getValue(l),e.override(o).getValue(l)))];i.push([o,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:s}=_D(this._policyConfiguration,e),o=[...t,...i,...s];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.applicationConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.localUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.remoteUserConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:s,overrides:o}=_D(this.workspaceConfiguration,e),r=[...t,...i,...s];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:s,updated:o,removed:r,overrides:a}=_D(i,t),c=[...s,...o,...r];return(c.length||!i)&&this.updateFolderConfiguration(e,t),{keys:c,overrides:a}}compareAndDeleteFolderConfiguration(e){const t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:i,updated:s,removed:o,overrides:r}=_D(t,void 0);return{keys:[...i,...s,...o],overrides:r}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.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},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(i=>e.add(i))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(i=>e.add(i))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(e).forEach(s=>t.add(s))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((l,d)=>(l.set(P.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new wi);return new SJe(i,s,o,r,_s.createEmptyModel(t),a,c,_s.createEmptyModel(t),new wi,t)}static parseConfigurationModel(e,t){return new _s(e.contents,e.keys,e.overrides,void 0,t)}};function YHe(...n){if(n.length===0)return{keys:[],overrides:[]};if(n.length===1)return n[0];const e=new Set,t=new Map;for(const s of n)s.keys.forEach(o=>e.add(o)),s.overrides.forEach(([o,r])=>{const a=XX(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((s,o)=>i.push([o,[...s.values()]])),{keys:[...e.values()],overrides:i}}class ANe{constructor(e,t,i,s,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=o,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=f7.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const o=s+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Io(a,c)}return!0}}function _D(n,e){const{added:t,removed:i,updated:s}=JHe(e?.rawConfiguration,n?.rawConfiguration),o=[],r=n?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!r.includes(l));for(const l of c)o.push([l,e.getKeysForOverrideIdentifier(l)])}if(n){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,n.getKeysForOverrideIdentifier(l)])}if(e&&n){for(const c of r)if(a.includes(c)){const l=JHe({contents:n.getOverrideValue(void 0,c)||{},keys:n.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});o.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:s,overrides:o}}function JHe(n,e){const t=n?e?n.keys.filter(o=>e.keys.indexOf(o)===-1):[...n.keys]:[],i=e?n?e.keys.filter(o=>n.keys.indexOf(o)===-1):[...e.keys]:[],s=[];if(n&&e){for(const o of e.keys)if(n.keys.indexOf(o)!==-1){const r=AZ(e.contents,o),a=AZ(n.contents,o);Io(r,a)||s.push(o)}}return{added:t,removed:i,updated:s}}const sK="vs/platform/keybinding/common/abstractKeybindingService",YEt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class JEt extends ${get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:T.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new nQ,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new O_,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}getDefaultKeybindingsContent(){return""}toggleLogging(){return this._logging=!this._logging,this._logging}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getDefaultKeybindings(){return this._getResolver().getDefaultKeybindings()}getKeybindings(){return this._getResolver().getKeybindings()}customKeybindingsCount(){return 0}lookupKeybindings(e){return Ui(this._getResolver().lookupKeybindings(e).map(t=>t.resolvedKeybinding))}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),gee;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),gee;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Nle("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(sK,0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(sK,1,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),b$.enabled&&b$.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],b$.enable()}dispatchByUserSettingsLabel(e,t){this._log(`/ Dispatching keybinding triggered via menu entry accelerator - ${e}`);const i=this.resolveUserBinding(e);i.length===0?this._log(`\\ Could not resolve - ${e}`):this._doDispatch(i[0],t,!1)}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=s2.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new s2(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case hp.NoMatchingKb:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case hp.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case hp.KbFound:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${l.commandId} ]`),l.commandId===null||l.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(g(sK,2,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(s=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{typeof l.commandArgs>"u"?this._commandService.executeCommand(l.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}YEt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=E.KeyA&&e.keyCode<=E.KeyZ||e.keyCode>=E.Digit0&&e.keyCode<=E.Digit9}}const yae=class yae{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};yae.EMPTY=new yae(null);let s2=yae;class vee{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?abe(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=abe(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===Q.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function abe(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return AJe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:XEt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return EJe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}isWYSIWYG(){return this._chords.every(e=>this._isWYSIWYG(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Dht(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class XU extends ext{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Pr.Macintosh)switch(e){case E.LeftArrow:return"←";case E.UpArrow:return"↑";case E.RightArrow:return"→";case E.DownArrow:return"↓"}return iE.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":iE.toString(e.keyCode)}_getElectronAccelerator(e){return iE.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=iE.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return XU.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=iE.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===E.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===E.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===E.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===E.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=eMe[e];if(t!==E.DependsOnKbLayout)return t;switch(e){case ue.KeyA:return E.KeyA;case ue.KeyB:return E.KeyB;case ue.KeyC:return E.KeyC;case ue.KeyD:return E.KeyD;case ue.KeyE:return E.KeyE;case ue.KeyF:return E.KeyF;case ue.KeyG:return E.KeyG;case ue.KeyH:return E.KeyH;case ue.KeyI:return E.KeyI;case ue.KeyJ:return E.KeyJ;case ue.KeyK:return E.KeyK;case ue.KeyL:return E.KeyL;case ue.KeyM:return E.KeyM;case ue.KeyN:return E.KeyN;case ue.KeyO:return E.KeyO;case ue.KeyP:return E.KeyP;case ue.KeyQ:return E.KeyQ;case ue.KeyR:return E.KeyR;case ue.KeyS:return E.KeyS;case ue.KeyT:return E.KeyT;case ue.KeyU:return E.KeyU;case ue.KeyV:return E.KeyV;case ue.KeyW:return E.KeyW;case ue.KeyX:return E.KeyX;case ue.KeyY:return E.KeyY;case ue.KeyZ:return E.KeyZ;case ue.Digit1:return E.Digit1;case ue.Digit2:return E.Digit2;case ue.Digit3:return E.Digit3;case ue.Digit4:return E.Digit4;case ue.Digit5:return E.Digit5;case ue.Digit6:return E.Digit6;case ue.Digit7:return E.Digit7;case ue.Digit8:return E.Digit8;case ue.Digit9:return E.Digit9;case ue.Digit0:return E.Digit0;case ue.Minus:return E.Minus;case ue.Equal:return E.Equal;case ue.BracketLeft:return E.BracketLeft;case ue.BracketRight:return E.BracketRight;case ue.Backslash:return E.Backslash;case ue.IntlHash:return E.Unknown;case ue.Semicolon:return E.Semicolon;case ue.Quote:return E.Quote;case ue.Backquote:return E.Backquote;case ue.Comma:return E.Comma;case ue.Period:return E.Period;case ue.Slash:return E.Slash;case ue.IntlBackslash:return E.IntlBackslash}return E.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof RS)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===E.Unknown?null:new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=abe(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new XU(i,t)]:[]}}const eo=ae("labelService"),Cf=ae("progressService"),eD=ae("editorProgressService"),xJe="telemetry.telemetryLevel",txt="telemetry.enableCrashReporter",DJe="telemetry.enableTelemetry";var sp;(function(n){n[n.NONE=0]="NONE",n[n.CRASH=1]="CRASH",n[n.ERROR=2]="ERROR",n[n.USAGE=3]="USAGE"})(sp||(sp={}));var LT;(function(n){n.OFF="off",n.CRASH="crash",n.ERROR="error",n.ON="all"})(LT||(LT={}));const ixt="vs/platform/workspace/common/workspace";function BS(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.uri)}function nxt(n){return typeof n?.id=="string"&&!BS(n)&&!hF(n)}const ENe={id:"empty-window"};function UW(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:yr(n)}:ENe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function hF(n){const e=n;return typeof e?.id=="string"&&P.isUri(e.configPath)}var Nn;(function(n){n[n.EMPTY=1]="EMPTY",n[n.FOLDER=2]="FOLDER",n[n.WORKSPACE=3]="WORKSPACE"})(Nn||(Nn={}));function cbe(n){const e=n;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function sxt(n){const e=n;return!!(e&&typeof e=="object"&&P.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let kJe=class{constructor(e,t,i,s,o){this._id=e,this._transient=i,this._configuration=s,this._ignorePathCasing=o,this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._ignorePathCasing=e._ignorePathCasing,this.folders=e.folders}get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this._foldersMap.findSubstr(e)||null}updateFoldersMap(){this._foldersMap=Su.forUris(this._ignorePathCasing,()=>!0);for(const e of this.folders)this._foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}},Cde=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Qt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function wee(n){return new Cde({uri:n,index:0,name:Mx(n)},{uri:n.toString()})}const qb="code-workspace",IJe=`.${qb}`,oxt=[{name:g(ixt,0,"Code Workspace"),extensions:[qb]}];function p7(n,e){return QQe.isEqualOrParent(n,e.untitledWorkspacesHome)}function hx(n){let e;return P.isUri(n)?e=n:e=n.configuration,e?.scheme===_e.tmp}const LJe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function rxt(n){return n.id===LJe}function lbe(n,e){return!p7(n,e)&&!hx(n)}function yde(n){return(typeof n=="string"?T_(n):uz(n))===IJe}const Ti=ae("contextService"),Hc="vs/editor/common/standaloneStrings";var Jm;(function(n){n.accessibilityHelpTitle=g(Hc,0,"Accessibility Help"),n.openingDocs=g(Hc,1,"Opening the Accessibility documentation page."),n.readonlyDiffEditor=g(Hc,2,"You are in a read-only pane of a diff editor."),n.editableDiffEditor=g(Hc,3,"You are in a pane of a diff editor."),n.readonlyEditor=g(Hc,4,"You are in a read-only code editor."),n.editableEditor=g(Hc,5,"You are in a code editor."),n.changeConfigToOnMac=g(Hc,6,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),n.changeConfigToOnWinLinux=g(Hc,7,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),n.auto_on=g(Hc,8,"The application is configured to be optimized for usage with a Screen Reader."),n.auto_off=g(Hc,9,"The application is configured to never be optimized for usage with a Screen Reader."),n.screenReaderModeEnabled=g(Hc,10,"Screen Reader Optimized Mode enabled."),n.screenReaderModeDisabled=g(Hc,11,"Screen Reader Optimized Mode disabled."),n.tabFocusModeOnMsg=g(Hc,12,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior"),n.tabFocusModeOffMsg=g(Hc,13,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior"),n.stickScroll=g(Hc,14,"Focus Sticky Scroll to focus the currently nested scopes."),n.showAccessibilityHelpAction=g(Hc,15,"Show Accessibility Help"),n.listSignalSounds=g(Hc,16,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),n.listAlerts=g(Hc,17,"Run the command: List Signal Announcements for an overview of announcements and their current status."),n.quickChat=g(Hc,18,"Toggle quick chat to open or close a chat session."),n.startInlineChat=g(Hc,19,"Start inline chat to create an in editor chat session.")})(Jm||(Jm={}));var XHe;(function(n){n.inspectTokensAction=g(Hc,20,"Developer: Inspect Tokens")})(XHe||(XHe={}));var bee;(function(n){n.editorViewAccessibleLabel=g(Hc,27,"Editor content"),n.accessibilityHelpMessage=g(Hc,28,"Press Alt+F1 for Accessibility Options.")})(bee||(bee={}));var ZHe;(function(n){n.toggleHighContrast=g(Hc,29,"Toggle High Contrast Theme")})(ZHe||(ZHe={}));var dbe;(function(n){n.bulkEditServiceSummary=g(Hc,30,"Made {0} edits in {1} files")})(dbe||(dbe={}));const Sde=ae("workspaceTrustEnablementService"),oA=ae("workspaceTrustManagementService"),Ade=ae("workspaceTrustRequestService");let b1=[],xNe=[],DNe=[];function oK(n,e=!1){TJe(n,!1,e)}function axt(n){TJe(n,!0,!1)}function TJe(n,e,t){const i=cxt(n,e);b1.push(i),i.userConfigured?DNe.push(i):xNe.push(i),t&&!i.userConfigured&&b1.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function cxt(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?_w(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Qi.sep)>=0:!1}}function lxt(){b1=b1.filter(n=>n.userConfigured),xNe=[]}function dxt(){b1=b1.filter(n=>!n.userConfigured),DNe=[]}function hxt(n,e){return uxt(n,e).map(t=>t.id)}function uxt(n,e){let t;if(n)switch(n.scheme){case _e.file:t=n.fsPath;break;case _e.data:{t=h1.parseMetaData(n).get(h1.META_DATA_LABEL);break}case _e.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Js.unknown}];t=t.toLowerCase();const i=yr(t),s=eUe(t,i,DNe);if(s)return[s,{id:Yc,mime:Js.text}];const o=eUe(t,i,xNe);if(o)return[o,{id:Yc,mime:Js.text}];if(e){const r=gxt(e);if(r)return[r,{id:Yc,mime:Js.text}]}return[{id:"unknown",mime:Js.unknown}]}function eUe(n,e,t){let i,s,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!s||a.filepattern.length>s.filepattern.length)){const c=a.filepatternOnPath?n:e;a.filepatternLowercase?.(c)&&(s=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(s)return s;if(o)return o}function gxt(n){if(XRe(n)&&(n=n.substr(1)),n.length>0)for(let e=b1.length-1;e>=0;e--){const t=b1[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Hw=Object.prototype.hasOwnProperty,tUe="vs.editor.nullLanguage";class fxt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(tUe,lM.Null),this._register(Yc,lM.PlainText),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||lM.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||tUe}}const Q8=class Q8 extends ${constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Q8.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new fxt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(hM.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Q8.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},lxt();const e=[].concat(hM.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return hM.registerLanguage(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),it.as(Cs.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Hw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)oK({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)oK({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)oK({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const c=new RegExp(a);KRe(c)||oK({id:i,mime:s,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Hw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)Hw.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>mE(t.languageName,i.languageName)),e}getLanguageName(e){return Hw.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return Hw.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return Hw.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return Hw.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return Hw.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return Hw.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Hw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Hw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:hxt(e,t)}};Q8.instanceCount=0;let hbe=Q8;const j8=class j8 extends ${constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new I),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new I),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new I({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,j8.instanceCount++,this._registry=this._register(new hbe(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){j8.instanceCount--,super.dispose()}registerLanguage(e){return this._registry.registerLanguage(e)}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getRegisteredLanguageIds(){return this._registry.getRegisteredLanguageIds()}getSortedRegisteredLanguageNames(){return this._registry.getSortedRegisteredLanguageNames()}getLanguageName(e){return this._registry.getLanguageName(e)}getMimeType(e){return this._registry.getMimeType(e)}getIcon(e){return this._registry.getIcon(e)}getExtensions(e){return this._registry.getExtensions(e)}getFilenames(e){return this._registry.getFilenames(e)}getConfigurationFiles(e){return this._registry.getConfigurationFiles(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return k_(i,null)}createById(e){return new Rfe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Rfe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Rfe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Yc),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),dc.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};j8.instanceCount=0;let Cee=j8;class Rfe{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new I({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter?.fire(this.languageId))}}class pxt extends ${constructor(e,t){super(),this._register(pe(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(pe(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const gm={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Js.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},mxt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Ede=mxt;const _xt=new Ka(()=>Ede("mouse",!1)),vxt=new Ka(()=>Ede("element",!1));function RJe(n){Ede=n}function va(n){return n==="element"?vxt.value:_xt.value}function C1(){return Ede("element",!0)}class wxt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}function MJe(n){return(e,t,i)=>{let s=null,o=null;if(typeof i.value=="function"?(s="value",o=i.value):typeof i.get=="function"&&(s="get",o=i.get),!o)throw new Error("not supported");i[s]=n(o,t)}}function ii(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}function kNe(n,e,t){return MJe((i,s)=>{const o=`$debounce$${s}`,r=`$debounce$result$${s}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},n)}})}function bxt(n,e,t){return MJe((i,s)=>{const o=`$throttle$timer$${s}`,r=`$throttle$result$${s}`,a=`$throttle$lastRun$${s}`,c=`$throttle$pending$${s}`;return function(...l){if(this[r]||(this[r]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[r]=e(this[r],...l)),this[c])return;const d=this[a]+n;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0):(this[c]=!0,this[o]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[r]]),this[r]=t?t():void 0},d-Date.now()))}})}var Cxt=".monaco-list{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{height:100%;position:relative;width:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{min-width:100%;width:auto}.monaco-list-row{box-sizing:border-box;overflow:hidden;position:absolute;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{border-radius:10px;display:inline-block;font-size:12px;padding:1px 7px;position:absolute;z-index:1000}.monaco-list-type-filter-message{box-sizing:border-box;height:100%;left:0;opacity:.7;padding:40px 1em 1em;pointer-events:none;position:absolute;text-align:center;top:0;white-space:normal;width:100%}.monaco-list-type-filter-message:empty{display:none}";Ct(Cxt,{});var _R;(function(n){n[n.Copy=0]="Copy",n[n.Move=1]="Move"})(_R||(_R={}));var iS;(function(n){n.Over="drop-target",n.Before="drop-target-before",n.After="drop-target-after"})(iS||(iS={}));class SL extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function iUe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Axt{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=iUe({start:0,end:e},this.groups),r=iUe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:ube(c.range,s),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=Sxt(o,a,r),this._size=this._paddingTop+this.groups.reduce((c,l)=>c+l.size*(l.range.end-l.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}const AL={CurrentDragAndDropData:void 0};var AA;(function(n){n[n.TOP=0]="TOP",n[n.CENTER_TOP=1]="CENTER_TOP",n[n.CENTER_BOTTOM=2]="CENTER_BOTTOM",n[n.BOTTOM=3]="BOTTOM"})(AA||(AA={}));const bC={useShadows:!0,verticalScrollMode:zo.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class vQ{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NJe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class gbe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const Sae=class Sae{get contentHeight(){return this.rangeMap.size}get contentWidth(){return this.scrollWidth??0}get onDidScroll(){return this.scrollableElement.onScroll}get onWillScroll(){return this.scrollableElement.onWillScroll}get containerDomNode(){return this.rowsContainer}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:h$(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=bC){if(this.virtualDelegate=t,this.domId=`list_id_${++Sae.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Lu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=$.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=$.None,this.onDragLeaveTimeout=$.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=T.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=T.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new xxt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??bC.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new kxt(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??bC.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(dh.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new nO({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>xd(gt(this.domNode),r)})),this.scrollableElement=this.disposables.add(new hQ(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??bC.alwaysConsumeMouseWheel,horizontal:zo.Auto,vertical:s.verticalScrollMode??bC.verticalScrollMode,useShadows:s.useShadows??bC.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(pe(this.rowsContainer,Eo.Change,r=>this.onTouchChange(r))),this.disposables.add(pe(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(pe(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(pe(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=s.setRowLineHeight??bC.setRowLineHeight,this.setRowHeight=s.setRowHeight??bC.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??bC.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(bC.dnd),this.layout(s.initialSize?.height,s.initialSize?.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}delegateScrollFromMouseWheelEvent(e){this.scrollableElement.delegateScrollFromMouseWheelEvent(e)}delegateVerticalScrollbarPointerDown(e){this.scrollableElement.delegateVerticalScrollbarPointerDown(e)}updateElementHeight(e,t,i){if(e<0||e>=this.items.length)return;const s=this.items[e].size;if(typeof t>"u"){if(!this.supportDynamicHeights){console.warn("Dynamic heights not supported");return}this.items[e].lastDynamicHeightWidth=void 0,t=s+this.probeDynamicHeight(e)}if(s===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;S--){const M=this.items[S];if(M.dragStartDisposable.dispose(),M.checkedDisposable.dispose(),M.row){let k=a.get(M.templateId);k||(k=[],a.set(M.templateId,k));const F=this.renderers.get(M.templateId);F&&F.disposeElement&&F.disposeElement(M.element,S,M.row.templateData,M.size),k.unshift(M.row)}M.row=null,M.stale=!0}const c={start:e+t,end:this.items.length},l=Dh.intersect(c,s),d=Dh.relativeComplement(c,s),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:$.None,checkedDisposable:$.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));const f=i.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=ube(l,f),v=Dh.intersect(p,m);for(let S=v.start;Sube(S,f)),y=[{start:e,end:e+i.length},...b].map(S=>Dh.intersect(p,S)).reverse();for(const S of y)for(let M=S.end-1;M>=S.start;M--){const k=this.items[M],N=a.get(k.templateId)?.pop();this.insertItemInDOM(M,N)}for(const S of a.values())for(const M of S)this.cache.release(M);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=xd(gt(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}updateWidth(e){if(!this.horizontalScrolling||typeof this.scrollWidth>"u")return;const t=this.items[e];this.measureItemWidth(t),typeof t.width<"u"&&t.width>this.scrollWidth&&(this.scrollWidth=t.width,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth+10}),this._onDidChangeContentWidth.fire(this.scrollWidth))}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}get firstMostlyVisibleIndex(){const e=this.firstVisibleIndex,t=this.rangeMap.positionAt(e),i=this.rangeMap.positionAt(e+1);return i!==-1&&(i-t)/2+tt.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:aMe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:h$(this.domNode)})}render(e,t,i,s,o,r=!1){const a=this.getRenderRange(t,i),c=Dh.relativeComplement(a,e).reverse(),l=Dh.relativeComplement(e,a);if(r){const d=Dh.intersect(e,a);for(let h=d.start;h{for(const d of l)for(let h=d.start;h=d.start;h--)this.insertItemInDOM(h)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const o=this.accessibilityProvider.isChecked(i.element);if(typeof o=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!o));else if(o){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(o.value),i.checkedDisposable=o.onDidChange(()=>c(o.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const r=this.renderers.get(i.templateId);if(!r)throw new Error(`No renderer found for template id ${i.templateId}`);r?.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=pe(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,a,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=h$(e.row.domNode);const t=gt(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}getScrollLeft(){return this.scrollableElement.getScrollPosition().scrollLeft}setScrollLeft(e){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollWidth:this.scrollWidth})),this.scrollableElement.setScrollPosition({scrollLeft:e})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return T.map(this.disposables.add(new oi(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return T.map(this.disposables.add(new oi(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return T.filter(T.map(this.disposables.add(new oi(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return T.map(this.disposables.add(new oi(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return T.map(this.disposables.add(new oi(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return T.map(this.disposables.add(new oi(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return T.map(this.disposables.add(new oi(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return T.map(this.disposables.add(new oi(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return T.any(T.map(this.disposables.add(new oi(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),T.map(this.disposables.add(new oi(this.domNode,Eo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return T.map(this.disposables.add(new oi(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return T.map(this.disposables.add(new oi(this.rowsContainer,Eo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(gm.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length));const r=we(".monaco-drag-image");r.textContent=o;const c=(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode);c.appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>c.removeChild(r),0)}this.domNode.classList.add("dragging"),this.currentDragData=new vQ(s),AL.CurrentDragAndDropData=new NJe(s),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),AL.CurrentDragAndDropData&&AL.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(AL.CurrentDragAndDropData)this.currentDragData=AL.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new gbe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===_R.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Lc(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:iS.Over;if(Dxt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!==iS.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");s===iS.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(s)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=PS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,AL.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=$.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=bZ(this.domNode).top;this.dragOverAnimationDisposable=rgt(gt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=PS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return Dc(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;Ra(i)&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const c=this.getRenderRange(e,t);let l=!1;for(let d=c.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=c.start;un===e;function fbe(n=Zb){return(e,t)=>Ls(e,t,n)}function PJe(){return(n,e)=>n.equals(e)}function Ixt(n,e,t){return!n||!e?n===e:t(n,e)}function Lxt(n){return JSON.stringify(pbe(n))}let Txt=0;const nUe=new WeakMap;function pbe(n){if(Array.isArray(n))return n.map(pbe);if(n&&typeof n=="object")if(Object.getPrototypeOf(n)===Object.prototype){const e=n,t=Object.create(null);for(const i of Object.keys(e).sort())t[i]=pbe(e[i]);return t}else{let e=nUe.get(n);return e===void 0&&(e=Txt++,nUe.set(n,e)),e+"----2b76a038c20c4bcc"}return n}class ff{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return Rxt(e,this)}}const sUe=new Map,mbe=new WeakMap;function Rxt(n,e){const t=mbe.get(n);if(t)return t;const i=Mxt(n,e);if(i){let s=sUe.get(i)??0;s++,sUe.set(i,s);const o=s===1?i:`${i}#${s}`;return mbe.set(n,o),o}}function Mxt(n,e){const t=mbe.get(n);if(t)return t;const i=e.owner?Pxt(e.owner)+".":"";let s;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(s=o(),s!==void 0)return i+s}else return i+o;const r=e.referenceFn;if(r!==void 0&&(s=xde(r),s!==void 0))return i+s;if(e.owner!==void 0){const a=Nxt(e.owner,n);if(a!==void 0)return i+a}}function Nxt(n,e){for(const t in n)if(n[t]===e)return t}const oUe=new Map,rUe=new WeakMap;function Pxt(n){const e=rUe.get(n);if(e)return e;const t=Fxt(n);let i=oUe.get(t)??0;i++,oUe.set(t,i);const s=i===1?t:`${t}#${i}`;return rUe.set(n,s),s}function Fxt(n){const e=n.constructor;return e?e.name:"Object"}function xde(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}let FJe;function Oxt(n){FJe=n}let OJe;function Bxt(n){OJe=n}let BJe;function Wxt(n){BJe=n}class WJe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return BJe({owner:i,debugName:()=>{const o=xde(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},o=>s(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(FJe(this,t)),this}keepObserved(e){return e.add(OJe(this)),this}get debugValue(){return this.get()}}class wQ extends WJe{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function En(n,e){const t=new Dde(n,e);try{n(t)}finally{t.finish()}}let rK;function uJ(n){if(rK)n(rK);else{const e=new Dde(n,void 0);rK=e;try{n(e)}finally{e.finish(),rK=void 0}}}async function Hxt(n,e){const t=new Dde(n,e);try{await n(t)}finally{t.finish()}}function m7(n,e,t){n?e(n):En(e,t)}class Dde{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():xde(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t{},()=>`Setting ${this.debugName}`));try{this._setValue(e);for(const o of this.observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function _7(n,e){let t;return typeof n=="string"?t=new ff(void 0,n,void 0):t=new ff(n,void 0,void 0),new Vxt(t,e,Zb)}class Vxt extends INe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Dt(n,e){return e!==void 0?new uF(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb):new uF(new ff(void 0,void 0,n),n,void 0,void 0,void 0,Zb)}function HJe(n,e,t){return new $xt(new ff(n,void 0,e),e,void 0,void 0,void 0,Zb,t)}function yy(n,e){return new uF(new ff(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,n.equalsFn??Zb)}Wxt(yy);function zxt(n,e){return new uF(new ff(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,n.equalityComparer??Zb)}function wO(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),Zb)}function WC(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new Z;return new uF(new ff(i,void 0,t),o=>{s.clear();const r=t(o);return r&&s.add(r),r},void 0,void 0,()=>s.dispose(),Zb)}var wh;(function(n){n[n.initial=0]="initial",n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(wh||(wh={}));class uF extends wQ{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=s,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=wh.initial,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=this.createChangeSummary?.()}onLastObserverRemoved(){this.state=wh.initial,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),this._handleLastObserverRemoved?.()}get(){if(this.observers.size===0){const e=this._computeFn(this,this.createChangeSummary?.());return this.onLastObserverRemoved(),e}else{do{if(this.state===wh.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===wh.stale)break}this.state===wh.dependenciesMightHaveChanged&&(this.state=wh.upToDate),this._recomputeIfNeeded()}while(this.state!==wh.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===wh.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==wh.initial,i=this.value;this.state=wh.upToDate;const s=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,s)}finally{for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const r of this.observers)r.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===wh.upToDate&&(this.state=wh.dependenciesMightHaveChanged,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}fw(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===wh.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=wh.dependenciesMightHaveChanged;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===wh.upToDate;if(i&&(this.state===wh.dependenciesMightHaveChanged||s)&&(this.state=wh.stale,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class $xt extends uF{constructor(e,t,i,s,o=void 0,r,a){super(e,t,i,s,o,r),this.set=a}}function Ni(n){return new kde(new ff(void 0,void 0,n),n,void 0,void 0)}function bQ(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,void 0,void 0)}function Az(n,e){return new kde(new ff(n.owner,n.debugName,n.debugReferenceFn??e),e,n.createEmptyChangeSummary,n.handleChange)}function Em(n){const e=new Z,t=bQ({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var Lp;(function(n){n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(Lp||(Lp={}));class kde{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=Lp.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),rz(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),az(this)}_runIfNeeded(){if(this.state===Lp.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=Lp.upToDate;const t=this.disposed;try{if(!t){const i=this.changeSummary;this.changeSummary=this.createChangeSummary?.(),this._runFn(this,i)}}finally{for(const i of this.dependenciesToBeRemoved)i.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===Lp.upToDate&&(this.state=Lp.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===Lp.dependenciesMightHaveChanged){this.state=Lp.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===Lp.stale)break}this._runIfNeeded()}while(this.state!==Lp.upToDate);this.updateCount--,fw(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===Lp.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=Lp.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=Lp.stale)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=kde})(Ni||(Ni={}));function Au(n){return new Gxt(n)}class Gxt extends WJe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Wn(n,e){return new vR(n,e)}class vR extends wQ{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{const s=this._getValue(i),o=this.value;(!this.hasValue||o!==s)&&(this.value=s,this.hasValue&&m7(vR.globalTransaction,a=>{for(const c of this.observers)a.updateObserver(c,this),c.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return xde(this._getValue)}get debugName(){const 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)}}(function(n){n.Observer=vR;function e(t,i){let s=!1;vR.globalTransaction===void 0&&(vR.globalTransaction=t,s=!0);try{i()}finally{s&&(vR.globalTransaction=void 0)}}n.batchEventsGlobally=e})(Wn||(Wn={}));function Bh(n,e){return new qxt(n,e)}class qxt extends wQ{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{En(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function oL(n){return typeof n=="string"?new aUe(n):new aUe(void 0,n)}class aUe extends wQ{get debugName(){return new ff(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){En(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function gJ(n){const e=new UJe(!1,void 0);return n.addObserver(e),Ee(()=>{n.removeObserver(e)})}Bxt(gJ);function Ez(n,e){const t=new UJe(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),Ee(()=>{n.removeObserver(t)})}Oxt(Ez);class UJe{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function Qxt(n,e){let t;return Dt(n,s=>(t=e(s,t),t))}function jxt(n,e){let t;const i=oL("derivedObservableWithWritableCache"),s=Dt(n,o=>(i.read(o),t=e(o,t),t));return Object.assign(s,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function yee(n,e,t,i){let s=new cUe(t,i);return yy({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{s.dispose(),s=new cUe(t)}},r=>(s.setItems(e.read(r)),s.getItems()))}class cUe{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const s of e){const o=this._keySelector?this._keySelector(s):s;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(s,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const s of i)this._cache.get(s).store.dispose(),this._cache.delete(s);this._items=t}getItems(){return this._items}}class LNe{constructor(e){this.observable=e}get onDidChange(){return T.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function VJe(n,e){return e instanceof LNe?e.observable:Wn(e.onDidChange,()=>e.value)}class Kxt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let v7=class{get name(){return this._trait}get renderer(){return new Kxt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(dUe),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=vbe(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return CU(this.sortedIndexes,e,dUe)>=0}dispose(){St(this._onChange)}};v7.__decorator=D([ii],v7.prototype,"renderer",null);class Yxt extends v7{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class Mfe{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function ux(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function CQ(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:CQ(n.parentElement,e)}function y3(n){return CQ(n,"monaco-editor")}function Jxt(n){return CQ(n,"monaco-custom-toggle")}function Xxt(n){return CQ(n,"action-item")}function F$(n){return CQ(n,"monaco-tree-sticky-row")}function w7(n){return n.classList.contains("monaco-tree-sticky-container")}function zJe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:zJe(n.parentElement)}class _be{get onKeyDown(){return T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,e=>e.filter(t=>!ux(t.target)).map(t=>new os(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Z,this.multipleSelectionDisposables=new Z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case E.Enter:return this.onEnter(s);case E.UpArrow:return this.onUpArrow(s);case E.DownArrow:return this.onDownArrow(s);case E.PageUp:return this.onPageUpArrow(s);case E.PageDown:return this.onPageDownArrow(s);case E.Escape:return this.onEscape(s);case E.KeyA:this.multipleSelectionSupport&&(ei?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Mg(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}_be.__decorator=D([ii],_be.prototype,"onKeyDown",null);var Sy;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Sy||(Sy={}));var o2;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(o2||(o2={}));const Zxt=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=E.KeyA&&n.keyCode<=E.KeyZ||n.keyCode>=E.Digit0&&n.keyCode<=E.Digit9||n.keyCode>=E.Numpad0&&n.keyCode<=E.Numpad9||n.keyCode>=E.Semicolon&&n.keyCode<=E.Quote}};class eDt{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=o2.Idle,this.mode=Sy.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Z,this.disposables=new Z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Sy.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=T.chain(this.enabledDisposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).filter(()=>this.mode===Sy.Automatic||this.triggered).map(r=>new os(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>un.stop(r,!0)).map(r=>r.browserEvent.key)),i=T.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);T.reduce(T.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?sa(t):t&&sa(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=o2.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===o2.Idle?1:0;this.state=o2.Typing;for(let o=0;o1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof c>"u"||dF(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class tDt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=T.chain(this.disposables.add(new oi(t.domNode,"keydown")).event,o=>o.filter(r=>!ux(r.target)).map(r=>new os(r)));T.chain(i,o=>o.filter(r=>r.keyCode===E.Tab&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!Ra(s)||s.tabIndex===-1)return;const o=gt(s).getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function $Je(n){return ei?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function GJe(n){return n.browserEvent.shiftKey}function iDt(n){return dMe(n)&&n.button===2}const lUe={isSelectionSingleChangeEvent:$Je,isSelectionRangeChangeEvent:GJe};class qJe{constructor(e){this.list=e,this.disposables=new Z,this._onPointer=new I,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(dh.addTarget(e.getHTMLElement()))),T.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||lUe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){y3(e.browserEvent.target)||xl()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),iDt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(ux(e.browserEvent.target)||y3(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),o=Math.max(i,t),r=Mg(s,o+1),a=this.list.getSelection(),c=oDt(vbe(a,[i]),i);if(c.length===0)return;const l=vbe(r,rDt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class QJe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` @@ -268,9 +268,9 @@ ${e}`)}function _Et(n){return sL(n,"`")}function vEt(n){return sL(n,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const nDt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:fe.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:fe.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:fe.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},sDt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function oDt(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class aDt{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class cDt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),o=s&&typeof s!="string"?s:Au(s);i.disposables.add(Ni(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,s){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lDt{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,s,o){return this.dnd.onDragOver(e,t,i,s,o)}onDragLeave(e,t,i,s){this.dnd.onDragLeave?.(e,t,i,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,s,o){this.dnd.drop(e,t,i,s,o)}dispose(){this.dnd.dispose()}}class Pc{get onDidChangeFocus(){return T.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return T.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseUp(){return this.view.onMouseUp}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseMove(){return this.view.onMouseMove}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.map(r=>new os(r)).filter(r=>e=r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).filter(()=>!1)),i=T.chain(this.disposables.add(new oi(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new os(r)).filter(r=>r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),c=a.length?a[0]:void 0,l=typeof c<"u"?this.view.element(c):void 0,d=typeof c<"u"?this.view.domElement(c):this.view.domNode;return{index:c,element:l,anchor:d,browserEvent:r}})),s=T.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new yu(gt(this.view.domNode),c),browserEvent:c})));return T.any(t,i,s)}get onKeyDown(){return this.disposables.add(new oi(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new oi(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new oi(this.view.domNode,"keypress")).event}get onDidFocus(){return T.signal(this.disposables.add(new oi(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return T.signal(this.disposables.add(new oi(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,o=sDt){this.user=e,this._options=o,this.focus=new v7("focused"),this.anchor=new v7("anchor"),this.eventBufferer=new Ole,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new Yxt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new cDt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(l=>new aDt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new lDt(this,o.dnd)};if(this.view=this.createListView(t,i,s,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=od(this.view.domNode);this.styleController=new QJe(l,this.view.domId)}if(this.spliceable=new wxt([new Mfe(this.focus,this.view,o.identityProvider),new Mfe(this.selection,this.view,o.identityProvider),new Mfe(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new tDt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new _be(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||Zxt;this.typeNavigationController=new eDt(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Xc(e,t,i,s)}createMouseController(e){return new qJe(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new SL(this.user,`Invalid start index: ${e}`);if(t<0)throw new SL(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}updateWidth(e){this.view.updateWidth(e)}updateElementHeight(e,t){this.view.updateElementHeight(e,t,null)}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollLeft(){return this.view.getScrollLeft()}set scrollLeft(e){this.view.setScrollLeft(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get firstMostlyVisibleIndex(){return this.view.firstMostlyVisibleIndex}get lastVisibleIndex(){return this.view.lastVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}triggerTypeNavigation(){this.typeNavigationController?.trigger()}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return k_(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Ta(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const o=i(),r=this.view.getScrollTop()+o;r===0?s=this.view.indexAt(r):s=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const c=this.findNextIndex(s,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([s],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Ta(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(jc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Dc(t,0,1)+o-i)}else{const a=o+r,c=s+this.view.renderHeight;o=c||(o=c&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-s)/r)}isDOMFocused(){return kw(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Pc.__decorator=D([ii],Pc.prototype,"onDidChangeFocus",null);Pc.__decorator=D([ii],Pc.prototype,"onDidChangeSelection",null);Pc.__decorator=D([ii],Pc.prototype,"onContextMenu",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyDown",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyUp",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyPress",null);Pc.__decorator=D([ii],Pc.prototype,"onDidFocus",null);Pc.__decorator=D([ii],Pc.prototype,"onDidBlur",null);let jJe={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null,triggerUpdatableHover:()=>{}};function KJe(n){jJe=n}function H_(){return jJe}var dDt=".monaco-select-box-dropdown-padding{--dropdown-padding-top:1px;--dropdown-padding-bottom:1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top:3px;--dropdown-padding-bottom:4px}.monaco-select-box-dropdown-container{box-sizing:border-box;display:none}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{font-family:var(--monaco-monospace-font);line-height:15px}.monaco-select-box-dropdown-container.visible{border-bottom-left-radius:3px;border-bottom-right-radius:3px;display:flex;flex-direction:column;overflow:hidden;text-align:left;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{align-self:flex-start;box-sizing:border-box;flex:0 0 auto;overflow:hidden;padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;padding-top:var(--dropdown-padding-top);width:100%}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-bottom:var(--dropdown-padding-bottom);padding-top:var(--dropdown-padding-top)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{float:left;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{float:left;opacity:.7;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{float:right;overflow:hidden;padding-right:10px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{height:1px;left:-10000px;overflow:hidden;position:absolute;top:auto;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{align-self:flex-start;flex:1 1 auto;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{max-height:0;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}";Ct(dDt,{});const hDt="vs/base/browser/ui/selectBox/selectBoxCustom",wR=we,YJe="selectOption.entry.template";class uDt{get templateId(){return YJe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=he(e,wR(".option-text")),t.detail=he(e,wR(".option-detail")),t.decoratorRight=he(e,wR(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",c?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const KC=class KC extends ${constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=KC.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new I,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(H_().setupUpdatableHover(va("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return YJe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=we(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=he(this.selectDropDownContainer,wR(".select-box-details-pane"));const t=he(this.selectDropDownContainer,wR(".select-box-dropdown-container-width-control")),i=he(t,wR(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",he(i,this.widthControlElement),this._dropDownPosition=Jp.BELOW,this.styleElement=od(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(pe(this.selectDropDownContainer,xe.DRAG_START,s=>{un.stop(s,!0)}))}registerListeners(){this._register(Xo(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(pe(this.selectElement,xe.CLICK,t=>{un.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.MOUSE_DOWN,t=>{un.stop(t)}));let e;this._register(pe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(pe(this.selectElement,"touchend",t=>{un.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.KEY_DOWN,t=>{const i=new os(t);let s=!1;ei?(i.keyCode===E.DownArrow||i.keyCode===E.UpArrow||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0):(i.keyCode===E.DownArrow&&i.altKey||i.keyCode===E.UpArrow&&i.altKey||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0),s&&(this.showSelectDropDown(),un.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ls(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setEnabled(e){this.selectElement.disabled=!e}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}setAriaLabel(e){this.selectBoxOptions.ariaLabel=e,this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=hS(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=gt(this.selectElement),i=ia(this.selectElement),s=gt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-KC.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,c=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(c)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,p=Math.floor((r-o-u)/this.getHeight()),m=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Jp.ABOVE,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Jp.BELOW,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=p*this.getHeight())}else f>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,c=o.decoratorRight?o.decoratorRight.length:0,l=o.text.length+a+c;l>s&&(i=r,s=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=du(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=he(e,wR(".select-box-dropdown-list-container")),this.listRenderer=new uDt,this.selectList=new Pc("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:zo.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>g(hDt,0,"Select Box"),getRole:()=>ei?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new oi(this.selectDropDownListContainer,"keydown")),i=T.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new os(o)));this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Enter))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Tab))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Escape))(this.onEscape,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.UpArrow))(this.onUpArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.DownArrow))(this.onDownArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageDown))(this.onPageDown,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageUp))(this.onPageUp,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Home))(this.onHome,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.End))(this.onEnd,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode>=E.Digit0&&o.keyCode<=E.KeyZ||o.keyCode>=E.Semicolon&&o.keyCode<=E.NumpadDivide))(this.onCharacter,this)),this._register(pe(this.selectList.getHTMLElement(),xe.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(pe(this.selectDropDownContainer,xe.FOCUS_OUT,s=>{!this._isVisible||al(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;un.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(un.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){un.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){un.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){un.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=iE.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(pe(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Xo(this.selectElement,"click",e=>{un.stop(e,!0)})),this._register(Xo(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Xo(this.selectElement,"keydown",e=>{let t=!1;ei?(e.keyCode===E.DownArrow||e.keyCode===E.UpArrow||e.keyCode===E.Space)&&(t=!0):(e.keyCode===E.DownArrow&&e.altKey||e.keyCode===E.Space||e.keyCode===E.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ls(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new gw)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(dh.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,pp&&this._register(pe(e,xe.DRAG_START,s=>s.dataTransfer?.setData(gm.TEXT,this._action.label)))),this._register(pe(t,Eo.Tap,s=>this.onClick(s,!0))),this._register(pe(t,xe.MOUSE_DOWN,s=>{i||un.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),ei&&this._register(pe(t,xe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(pe(t,xe.CLICK,s=>{un.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(pe(t,xe.DBLCLICK,s=>{un.stop(s,!0)})),[xe.MOUSE_UP,xe.MOUSE_OUT].forEach(s=>{this._register(pe(t,s,o=>{un.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){un.stop(e,!0);const i=dc(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}isFocused(){return!!this.element?.classList.contains("focused")}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),this.options.hoverDelegate?.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const t=this.options.hoverDelegate??va("element");this.customHover=this._store.add(H_().setupUpdatableHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class WS extends a_{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),Bt(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Kr.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}isFocused(){return!!this.label&&this.label?.tabIndex===0}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=g(_Dt,0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class JJe extends a_{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new pDt(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}setOptions(e,t){this.selectBox.setOptions(e,t)}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}var vDt=".monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(vDt,{});class wDt extends gw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=he(e,we(".monaco-dropdown")),this._label=he(this._element,we(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[xe.CLICK,xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this.element,o,r=>un.stop(r,!0)));for(const o of[xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this._label,o,r=>{dMe(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(pe(this._label,xe.KEY_UP,o=>{const r=new os(o);(r.equals(E.Enter)||r.equals(E.Space))&&(un.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(dh.addTarget(this._label))}get element(){return this._element}get label(){return this._label}set tooltip(e){this._label&&(!this.hover&&e!==""?this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this._label,e)):this.hover&&this.hover.update(e))}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}isVisible(){return!!this.visible}onEvent(e,t){this.hide()}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class bDt extends wDt{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:Ob.LEFT,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class gx extends a_{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=he(o,we("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new bDt(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{this.element?.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}var CDt=".monaco-action-bar .action-item.menu-entry .action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(CDt,{});const mc=ae("menuService");function XJe(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function yDt(n){return n?n.condition!==void 0:!1}const vs=n=>{performance.mark(n)},SDt=()=>{let n=performance.timeOrigin;typeof n!="number"&&(n=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const e=[{name:"code/timeOrigin",startTime:Math.round(n)}];for(const t of performance.getEntriesByType("mark"))e.push({name:t.name,startTime:Math.round(n+t.startTime)});return e};var MI;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(MI||(MI={}));function ADt(n){const e=n;return e?.changed instanceof Map||e?.deleted instanceof Set}var eb;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(eb||(eb={}));const Aae=class Aae extends ${constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new r1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=eb.None,this.cache=new Map,this.flushDelayer=this._register(new iQ(Aae.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===eb.Closed)return;let i=!1;dc(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===eb.None&&(this.state=eb.Initialized,this.options.hint!==MI.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return dc(i)?t:i}getBoolean(e,t){const i=this.get(e);return dc(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return dc(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return dc(i)?t:JU(i)}async set(e,t,i=!1){if(this.state===eb.Closed)return;if(dc(t))return this.delete(e,i);const s=fo(t)||Array.isArray(t)?uJe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===eb.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==eb.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=eb.Closed;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;const 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===eb.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===MI.STORAGE_IN_MEMORY?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===MI.STORAGE_IN_MEMORY}};Aae.DEFAULT_FLUSH_DELAY=100;let fx=Aae;class fJ{constructor(){this.onDidChangeItemsExternal=T.None,this.items=new Map}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}async optimize(){}async close(){}}const ci=ae("fileService"),_o=ae("IUriIdentityService"),EDt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xDt(n){return EDt.test(n)}const Dr=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;sd.id===a);l&&i.set(c,l)}if(o.emptyWindows)for(const[r,a]of Object.entries(o.emptyWindows)){const c=t.find(l=>l.id===a);c&&s.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:s}}return this._profilesObject}createDefaultProfile(){const e=S3("__default__profile__",g(DDt,0,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Iu(t)}\\s(\\d+)`);let s=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;s=c>s?c:s}const o=`${t} ${s+1}`;return this.createProfile(Ed(Dr()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Ed(Dr()).toString(16),e,t,i)}async createProfile(e,t,i,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return s&&await this.setProfileForWorkspace(s,o),o}async doCreateProfile(e,t,i){if(!zt(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(t);return s||(s=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=S3(e,t,qt(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(r.location);const a=[];return this._onWillCreateProfile.fire({profile:r,join(c){a.push(c)}}),await ko.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,s)),s}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=S3(i.id,t.name??i.name,i.location,this.profilesCacheHome,{shortName:t.shortName??i.shortName,icon:t.icon===null?void 0:t.icon??i.icon,transient:t.transient??i.isTransient,useDefaultFlags:t.useDefaultFlags??i.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[i]),i}async removeProfile(e){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(s=>s.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(s){i.push(s)}});try{await Promise.allSettled(i)}catch(s){this.logService.error(s)}for(const s of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(s)?.id&&this.profilesObject.emptyWindows.delete(s);for(const s of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(s)?.id&&this.profilesObject.workspaces.delete(s);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(s){Cy(s)!==Xi.FILE_NOT_FOUND&&this.logService.error(s)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(s=>s.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);this.updateWorkspaceAssociation(e,i)}unsetWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(e,void 0,t)}async resetWorkspaces(){this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e);return P.isUri(t)?this.transientProfilesObject.workspaces.get(t)??this.profilesObject.workspaces.get(t):this.transientProfilesObject.emptyWindows.get(t)??this.profilesObject.emptyWindows.get(t)}getWorkspace(e){return BS(e)?e.uri:hF(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const s=[...this.profiles,...e],o=[];this.transientProfilesObject.profiles=[];for(let r of s)r.isDefault||t.some(a=>r.id===a.id)||(r=i.find(a=>r.id===a.id)??r,r.isTransient?this.transientProfilesObject.profiles.push(r):o.push({location:r.location,name:r.name,shortName:r.shortName,icon:r.icon,useDefaultFlags:r.useDefaultFlags}));this.saveStoredProfiles(o),this._profilesObject=void 0,this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateWorkspaceAssociation(e,t,i){i=t?.isTransient?!0:i,i||this.updateWorkspaceAssociation(e,void 0,!0);const s=this.getWorkspace(e),o=i?this.transientProfilesObject:this.profilesObject;P.isUri(s)?(o.workspaces.delete(s),t&&o.workspaces.set(s,t)):(o.emptyWindows.delete(s),t&&o.emptyWindows.set(s,t)),i||this.updateStoredProfileAssociations()}updateStoredProfileAssociations(){const e={};for(const[i,s]of this.profilesObject.workspaces.entries())e[i.toString()]=s.id;const t={};for(const[i,s]of this.profilesObject.emptyWindows.entries())t[i.toString()]=s.id;this.saveStoredProfileAssociations({workspaces:e,emptyWindows:t}),this._profilesObject=void 0}migrateStoredProfileAssociations(e){const t={},i=this.createDefaultProfile();if(e.workspaces)for(const[o,r]of Object.entries(e.workspaces)){const a=P.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const s={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=P.parse(r);s[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:s}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},iN.PROFILES_KEY="userDataProfiles",iN.PROFILE_ASSOCIATIONS_KEY="profileAssociations",iN);uUe=D([_(0,Il),_(1,ci),_(2,_o),_(3,Ze)],uUe);const pJ="__$__isNewStorageMarker",mJ="__$__targetStorageMarker";var nS;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(nS||(nS={}));var ke;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(ke||(ke={}));var ln;(function(n){n[n.USER=0]="USER",n[n.MACHINE=1]="MACHINE"})(ln||(ln={}));function kDt(n){const e=n.get(mJ);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Eae=class Eae extends ${constructor(e={flushInterval:Eae.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new r1),this._onDidChangeTarget=this._register(new r1),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new yn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new Dn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return T.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=PU(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){St([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{vs("code/willInitStorage");try{await this.doInitialize()}finally{vs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===mJ){switch(e){case ke.APPLICATION:this._applicationKeyTargets=void 0;break;case ke.PROFILE:this._profileKeyTargets=void 0;break;case ke.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,s,o=!1){if(dc(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,s),this.getStorage(i)?.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],s=this.getKeyTargets(e);for(const o of Object.keys(s))s[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,s=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(mJ,JSON.stringify(o),s)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(mJ,JSON.stringify(o),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(ke.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(ke.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(ke.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case ke.APPLICATION:return this.applicationKeyTargets;case ke.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?kDt(t):Object.create(null)}isNew(e){return this.getBoolean(pJ,e)===!0}async flush(e=nS.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(ke.APPLICATION),i=this.getStorage(ke.PROFILE),s=this.getStorage(ke.WORKSPACE);switch(e){case nS.NONE:await ko.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case nS.SHUTDOWN:await ko.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(ke.APPLICATION)?.items??new Map,t=this.getStorage(ke.PROFILE)?.items??new Map,i=this.getStorage(ke.WORKSPACE)?.items??new Map;return LDt(e,t,i,this.getLogDetails(ke.APPLICATION)??"",this.getLogDetails(ke.PROFILE)??"",this.getLogDetails(ke.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(nS.NONE),ZJe(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||bbe(t)&&bbe(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const s=new Set;for(const[o,r]of e)s.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)s.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};Eae.DEFAULT_FLUSH_INTERVAL=60*1e3;let ZU=Eae;function bbe(n){return n.isDefault||!!n.useDefaultFlags?.globalState}class IDt extends ZU{constructor(){super(),this.applicationStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.APPLICATION,e)))}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return"inMemory (application)";case ke.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function LDt(n,e,t,i,s,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;n.forEach((m,v)=>{a.set(v,m),c.set(v,r(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,r(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,r(m))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const f=[];if(a.forEach((m,v)=>{f.push({key:v,value:m})}),console.table(f),console.groupEnd(),console.log(c),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const m=[];l.forEach((v,w)=>{m.push({key:w,value:v})}),console.table(m),console.groupEnd(),console.log(d)}console.group(`Storage: Workspace (path: ${o})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const sn=ae("storageService");function TDt(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?Ye(s):void 0}return t}const RDt={keybindingLabelBackground:Ye(s_t),keybindingLabelForeground:Ye(o_t),keybindingLabelBorder:Ye(r_t),keybindingLabelBottomBorder:Ye(a_t),keybindingLabelShadow:Ye(__)},yQ={buttonForeground:Ye(Zy),buttonSeparator:Ye(f3),buttonBackground:Ye(eS),buttonHoverBackground:Ye(J9),buttonSecondaryForeground:Ye(Zmt),buttonSecondaryBackground:Ye(iwe),buttonSecondaryHoverBackground:Ye(e_t),buttonBorder:Ye(Xmt)},eXe={progressBarBackground:Ye(bmt)},See={inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe),inputActiveOptionBackground:Ye(hR)};Ye(t_t),Ye(n_t),Ye(i_t);Ye(Zs),Ye(ng),Ye(__),Ye(ft),Ye(Omt),Ye(Bmt),Ye(Wmt),Ye(GB);const eV={inputBackground:Ye(SE),inputForeground:Ye(wKe),inputBorder:Ye(_$),inputValidationInfoBorder:Ye(Qmt),inputValidationInfoBackground:Ye(Gmt),inputValidationInfoForeground:Ye(qmt),inputValidationWarningBorder:Ye(Ymt),inputValidationWarningBackground:Ye(jmt),inputValidationWarningForeground:Ye(Kmt),inputValidationErrorBorder:Ye(yKe),inputValidationErrorBackground:Ye(bKe),inputValidationErrorForeground:Ye(CKe)},MDt={listFilterWidgetBackground:Ye(v_t),listFilterWidgetOutline:Ye(w_t),listFilterWidgetNoMatchesOutline:Ye(b_t),listFilterWidgetShadow:Ye(C_t),inputBoxStyles:eV,toggleStyles:See},tXe={badgeBackground:Ye(kW),badgeForeground:Ye(DMe),badgeBorder:Ye(ft)};Ye(Pmt),Ye(Nmt),Ye(dWe),Ye(dWe),Ye(Fmt);const bO={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Ye(c_t),listFocusForeground:Ye(l_t),listFocusOutline:Ye(nwe),listActiveSelectionBackground:Ye(v_),listActiveSelectionForeground:Ye(hm),listActiveSelectionIconForeground:Ye(p3),listFocusAndSelectionOutline:Ye(d_t),listFocusAndSelectionBackground:Ye(v_),listFocusAndSelectionForeground:Ye(hm),listInactiveSelectionBackground:Ye(swe),listInactiveSelectionIconForeground:Ye(u_t),listInactiveSelectionForeground:Ye(h_t),listInactiveFocusBackground:Ye(g_t),listInactiveFocusOutline:Ye(f_t),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listDropOverBackground:Ye(p_t),listDropBetweenBackground:Ye(m_t),listSelectionOutline:Ye(co),listHoverOutline:Ye(co),treeIndentGuidesStroke:Ye(uR),treeInactiveIndentGuidesStroke:Ye(S_t),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:Ye(A_t),tableOddRowsBackgroundColor:Ye(E_t)};function CO(n){return TDt(n,bO)}const iXe={selectBackground:Ye(Xy),selectListBackground:Ye(Jmt),selectForeground:Ye(AE),decoratorRightForeground:Ye(EKe),selectBorder:Ye(YB),focusBorder:Ye(Zd),listFocusBackground:Ye($k),listInactiveSelectionIconForeground:Ye(JB),listFocusForeground:Ye(zk),listFocusOutline:Zve(co,fe.transparent.toString()),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listHoverOutline:Ye(co),selectListBorder:Ye(sg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},NDt={shadowColor:Ye(__),borderColor:Ye(x_t),foregroundColor:Ye(D_t),backgroundColor:Ye(k_t),selectionForegroundColor:Ye(I_t),selectionBackgroundColor:Ye(L_t),selectionBorderColor:Ye(T_t),separatorColor:Ye(R_t),scrollbarShadow:Ye(p_),scrollbarSliderBackground:Ye(d3),scrollbarSliderHoverBackground:Ye(h3),scrollbarSliderActiveBackground:Ye(u3)},Nfe="vs/platform/actions/browser/menuEntryActionViewItem";function nXe(n,e,t,i){const s=n.getActions(e),o=Nb.getInstance(),r=o.keyStatus.altKey||(Is||jr)&&o.keyStatus.shiftKey;sXe(s,t,r,i?a=>a===i:a=>a==="navigation")}function tD(n,e,t,i,s,o){const r=n.getActions(e);sXe(r,t,!1,typeof i=="string"?c=>c===i:i,s,o)}function sXe(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of n){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Kr)):(h=a,h.length>0&&h.push(new Kr));for(let u of d){t&&(u=u instanceof id&&u.alt?u.alt:u);const f=h.push(u);u instanceof u1&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?r:a,f=d.actions;s(d,l,u.length)&&u.splice(h,1,...f)}}let eC=class extends WS{constructor(e,t,i,s,o,r,a,c){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Dn),this._altKey=Nb.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const s=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(pe(e,"mouseleave",s=>{t=!1,i()})),this._register(pe(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?g(Nfe,0,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),c=a?g(Nfe,0,"{0} ({1})",o,a):o;s=g(Nfe,1,`{0} -[{1}] {2}`,s,bde.modifierLabels[zc].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&yDt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if($e.isThemeIcon(s)){const o=$e.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(s.dark):uf(s.light),i.classList.add("icon"),this._itemClassDispose.value=pa(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};eC=D([_(2,ti),_(3,Pi),_(4,Pe),_(5,pn),_(6,Vr),_(7,Ur)],eC);let b7=class extends gx{constructor(e,t,i,s,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??($e.isThemeIcon(e.item.icon)?$e.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,r),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Bt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!$e.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(i.dark):uf(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};b7=D([_(2,ti),_(3,Vr),_(4,pn)],b7);let Cbe=class extends a_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=c,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let l;const d=t?.persistLastActionId?c.get(this._storageKey,ke.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(eC,l,{keybinding:this._getDefaultActionKeybindingLabel(l)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??new gw};this._dropdown=new gx(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof id&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,ke.WORKSPACE,ln.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(eC,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends gw{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Yle(this._container,we(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=we(".action-container");this._defaultAction.render(he(this._container,t)),this._register(pe(t,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=we(".dropdown-action-container");this._dropdown.render(he(this._container,i)),this._register(pe(i,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};Cbe=D([_(2,ti),_(3,Pi),_(4,Vr),_(5,mc),_(6,be),_(7,sn)],Cbe);let ybe=class extends JJe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Kr.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,iXe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=Ye(YB)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};ybe=D([_(1,W_)],ybe);function yO(n,e,t){return e instanceof id?n.createInstance(eC,e,t):e instanceof uS?e.item.isSelection?n.createInstance(ybe,e):e.item.rememberDefaultAction?n.createInstance(Cbe,e,{...t,persistLastActionId:!0}):n.createInstance(b7,e,t):void 0}var Qb;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Qb||(Qb={}));class Qh extends ${constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new Zo),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new I({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??Qb.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[E.Enter,E.Space]},this._hoverDelegate=t.hoverDelegate??this._register(C1()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new gw,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(o=>this._onDidRun.fire(o))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(o=>this._onWillRun.fire(o))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case Qb.HORIZONTAL:i=[E.LeftArrow],s=[E.RightArrow];break;case Qb.VERTICAL:i=[E.UpArrow],s=[E.DownArrow],this.domNode.className+=" vertical";break}this._register(pe(this.domNode,xe.KEY_DOWN,o=>{const r=new os(o);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():s&&(r.equals(s[0])||r.equals(s[1]))?a=this.focusNext():r.equals(E.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(E.Home)?a=this.focusFirst():r.equals(E.End)?a=this.focusLast():r.equals(E.Tab)&&c instanceof a_&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(pe(this.domNode,xe.KEY_UP,o=>{const r=new os(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(E.Tab)||r.equals(V.Shift|E.Tab)||r.equals(E.UpArrow)||r.equals(E.DownArrow)||r.equals(E.LeftArrow)||r.equals(E.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Dd(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(xl()===this.domNode||!al(xl(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setAriaLabel(e){e?this.actionsList.setAttribute("aria-label",e):this.actionsList.removeAttribute("aria-label")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof a_&&i.isEnabled());t instanceof a_&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof a_&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}hasAction(e){return this.viewItems.findIndex(t=>t.action.id===e.id)!==-1}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(Ra(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new WS(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,pe(r,xe.CONTEXT_MENU,l=>{un.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof a_&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let o=!0;SU(s.focus)||(o=!1),this.options.focusOnlyEnabledItems&&SU(s.isEnabled)&&!s.isEnabled()&&(o=!1),s.action.id===Kr.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&s.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof a_){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=St(this.viewItems),this.getContainer().remove(),super.dispose()}}function gUe(n){if(!n.length)return n;let e=-1;for(let i=0;i=0&&n[i].id===Kr.ID;i--)n.splice(i,1);let t=!1;for(let i=n.length-1;i>=0;i--){const s=n[i].id===Kr.ID;s&&!t?n.splice(i,1):s?s&&(t=!1):t=!0}return n}const Sbe=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Pfe=/(&)?(&)([^\s&])/g;var Aee;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Aee||(Aee={}));var Abe;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(Abe||(Abe={}));let oXe=class _J extends Qh{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:Qb.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[E.Enter,...ei||jr?[E.Space]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(dh.addTarget(o)),this._register(pe(o,xe.KEY_DOWN,l=>{new os(l).equals(E.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){un.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ffe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(l)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),jr&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=new os(l);d.equals(E.Home)||d.equals(E.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),un.stop(l,!0)):(d.equals(E.End)||d.equals(E.PageDown))&&(this.focusedItem=0,this.focusPrevious(),un.stop(l,!0))})),this._register(pe(this.domNode,xe.MOUSE_OUT,l=>{const d=l.relatedTarget;al(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(pe(this.actionsList,xe.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(dh.addTarget(this.actionsList)),this._register(pe(this.actionsList,Eo.Tap,l=>{let d=l.initialTarget;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new bz(o,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(pe(o,Eo.Change,l=>{un.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(pe(a,xe.MOUSE_UP,l=>{l.preventDefault()}));const c=gt(e);o.style.maxHeight=`${Math.max(10,c.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((l,d)=>i.submenuIds?.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!(l instanceof Kr&&(d===t.length-1||d===0||t[d-1]instanceof Kr))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof fUe)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(P9(e)?this.styleSheet=od(e):(_J.globalStyleSheet||(_J.globalStyleSheet=od()),this.styleSheet=_J.globalStyleSheet)),this.styleSheet.textContent=FDt(t,P9(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}get scrollOffset(){return this.menuElement.scrollTop}trigger(e){if(e<=this.viewItems.length&&e>=0){const t=this.viewItems[e];if(t instanceof Ffe)super.focus(e),t.open(!0);else if(t instanceof Ebe)super.run(t._action,t._context);else return}}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(pe(this.element,xe.MOUSE_UP,o=>{if(un.stop(o,!0),pp){if(new yu(gt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(pe(this.element,xe.CONTEXT_MENU,o=>{un.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=he(this.element,we("a.action-menu-item")),this._action.id===Kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=he(this.item,we("span.menu-item-check"+$e.asCSSSelector(Ce.menuSelection))),this.check.setAttribute("role","none"),this.label=he(this.item,we("span.action-label")),this.options.label&&this.options.keybinding&&(he(this.item,we("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Yo(this.label);let e=mde(this.action.label);if(e){const t=PDt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=Sbe.exec(e);if(i){e=rM(e),Pfe.lastIndex=0;let s=Pfe.exec(e);for(;s&&s[1];)s=Pfe.exec(e);const o=r=>r.replace(/&&/g,"&");s?this.label.append(lz(o(e.substr(0,s.index))," "),we("u",{"aria-hidden":"true"},s[3]),IS(o(e.substr(s.index+s[0].length))," ")):this.label.innerText=o(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Ffe extends Ebe{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:Aee.Right,vertical:Abe.Below},this.showScheduler=new yn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new yn(()=>{this.element&&!al(xl(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=he(this.item,we("span.submenu-indicator"+$e.asCSSSelector(Ce.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(pe(this.element,xe.KEY_UP,t=>{const i=new os(t);(i.equals(E.RightArrow)||i.equals(E.Enter))&&(un.stop(t,!0),this.createSubmenu(!0))})),this._register(pe(this.element,xe.KEY_DOWN,t=>{const i=new os(t);xl()===this.item&&(i.equals(E.RightArrow)||i.equals(E.Enter))&&un.stop(t,!0)})),this._register(pe(this.element,xe.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(pe(this.element,xe.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(pe(this.element,xe.FOCUS_OUT,t=>{this.element&&!al(xl(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}open(e){this.cleanupExistingSubmenu(!1),this.createSubmenu(e)}onClick(e){un.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=i2(e.width,t.width,{position:s.horizontal===Aee.Right?Hp.Before:Hp.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new os(d).equals(E.LeftArrow)&&(un.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(pe(this.submenuContainer,xe.KEY_DOWN,d=>{new os(d).equals(E.LeftArrow)&&un.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class fUe extends WS{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function PDt(n){const e=Sbe,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function pUe(n){const e=FQe()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function FDt(n,e){let t=` +`)}}const nDt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:fe.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:fe.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:fe.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},sDt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function oDt(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class aDt{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class cDt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),o=s&&typeof s!="string"?s:Au(s);i.disposables.add(Ni(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,s){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lDt{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,s,o){return this.dnd.onDragOver(e,t,i,s,o)}onDragLeave(e,t,i,s){this.dnd.onDragLeave?.(e,t,i,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,s,o){this.dnd.drop(e,t,i,s,o)}dispose(){this.dnd.dispose()}}class Pc{get onDidChangeFocus(){return T.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return T.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseUp(){return this.view.onMouseUp}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseMove(){return this.view.onMouseMove}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=T.chain(this.disposables.add(new oi(this.view.domNode,"keydown")).event,o=>o.map(r=>new os(r)).filter(r=>e=r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).filter(()=>!1)),i=T.chain(this.disposables.add(new oi(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new os(r)).filter(r=>r.keyCode===E.ContextMenu||r.shiftKey&&r.keyCode===E.F10).map(r=>un.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),c=a.length?a[0]:void 0,l=typeof c<"u"?this.view.element(c):void 0,d=typeof c<"u"?this.view.domElement(c):this.view.domNode;return{index:c,element:l,anchor:d,browserEvent:r}})),s=T.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new yu(gt(this.view.domNode),c),browserEvent:c})));return T.any(t,i,s)}get onKeyDown(){return this.disposables.add(new oi(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new oi(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new oi(this.view.domNode,"keypress")).event}get onDidFocus(){return T.signal(this.disposables.add(new oi(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return T.signal(this.disposables.add(new oi(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,o=sDt){this.user=e,this._options=o,this.focus=new v7("focused"),this.anchor=new v7("anchor"),this.eventBufferer=new Ole,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new Yxt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new cDt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(l=>new aDt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new lDt(this,o.dnd)};if(this.view=this.createListView(t,i,s,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=od(this.view.domNode);this.styleController=new QJe(l,this.view.domId)}if(this.spliceable=new wxt([new Mfe(this.focus,this.view,o.identityProvider),new Mfe(this.selection,this.view,o.identityProvider),new Mfe(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new tDt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new _be(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||Zxt;this.typeNavigationController=new eDt(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Zc(e,t,i,s)}createMouseController(e){return new qJe(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new SL(this.user,`Invalid start index: ${e}`);if(t<0)throw new SL(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}updateWidth(e){this.view.updateWidth(e)}updateElementHeight(e,t){this.view.updateElementHeight(e,t,null)}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollLeft(){return this.view.getScrollLeft()}set scrollLeft(e){this.view.setScrollLeft(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get firstMostlyVisibleIndex(){return this.view.firstMostlyVisibleIndex}get lastVisibleIndex(){return this.view.lastVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}triggerTypeNavigation(){this.typeNavigationController?.trigger()}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return k_(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new SL(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Ta(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const o=i(),r=this.view.getScrollTop()+o;r===0?s=this.view.indexAt(r):s=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const c=this.findNextIndex(s,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([s],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Ta(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(Kc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Dc(t,0,1)+o-i)}else{const a=o+r,c=s+this.view.renderHeight;o=c||(o=c&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new SL(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-s)/r)}isDOMFocused(){return kw(this.view.domNode)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Pc.__decorator=D([ii],Pc.prototype,"onDidChangeFocus",null);Pc.__decorator=D([ii],Pc.prototype,"onDidChangeSelection",null);Pc.__decorator=D([ii],Pc.prototype,"onContextMenu",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyDown",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyUp",null);Pc.__decorator=D([ii],Pc.prototype,"onKeyPress",null);Pc.__decorator=D([ii],Pc.prototype,"onDidFocus",null);Pc.__decorator=D([ii],Pc.prototype,"onDidBlur",null);let jJe={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null,triggerUpdatableHover:()=>{}};function KJe(n){jJe=n}function H_(){return jJe}var dDt=".monaco-select-box-dropdown-padding{--dropdown-padding-top:1px;--dropdown-padding-bottom:1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top:3px;--dropdown-padding-bottom:4px}.monaco-select-box-dropdown-container{box-sizing:border-box;display:none}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{font-family:var(--monaco-monospace-font);line-height:15px}.monaco-select-box-dropdown-container.visible{border-bottom-left-radius:3px;border-bottom-right-radius:3px;display:flex;flex-direction:column;overflow:hidden;text-align:left;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{align-self:flex-start;box-sizing:border-box;flex:0 0 auto;overflow:hidden;padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;padding-top:var(--dropdown-padding-top);width:100%}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-bottom:var(--dropdown-padding-bottom);padding-top:var(--dropdown-padding-top)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{float:left;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{float:left;opacity:.7;overflow:hidden;padding-left:3.5px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{float:right;overflow:hidden;padding-right:10px;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{height:1px;left:-10000px;overflow:hidden;position:absolute;top:auto;width:1px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{align-self:flex-start;flex:1 1 auto;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{max-height:0;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}";Ct(dDt,{});const hDt="vs/base/browser/ui/selectBox/selectBoxCustom",wR=we,YJe="selectOption.entry.template";class uDt{get templateId(){return YJe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=he(e,wR(".option-text")),t.detail=he(e,wR(".option-detail")),t.decoratorRight=he(e,wR(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",c?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const KC=class KC extends ${constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=KC.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new I,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(H_().setupUpdatableHover(va("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return YJe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=we(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=he(this.selectDropDownContainer,wR(".select-box-details-pane"));const t=he(this.selectDropDownContainer,wR(".select-box-dropdown-container-width-control")),i=he(t,wR(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",he(i,this.widthControlElement),this._dropDownPosition=Jp.BELOW,this.styleElement=od(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(pe(this.selectDropDownContainer,xe.DRAG_START,s=>{un.stop(s,!0)}))}registerListeners(){this._register(Xo(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(pe(this.selectElement,xe.CLICK,t=>{un.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.MOUSE_DOWN,t=>{un.stop(t)}));let e;this._register(pe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(pe(this.selectElement,"touchend",t=>{un.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pe(this.selectElement,xe.KEY_DOWN,t=>{const i=new os(t);let s=!1;ei?(i.keyCode===E.DownArrow||i.keyCode===E.UpArrow||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0):(i.keyCode===E.DownArrow&&i.altKey||i.keyCode===E.UpArrow&&i.altKey||i.keyCode===E.Space||i.keyCode===E.Enter)&&(s=!0),s&&(this.showSelectDropDown(),un.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ls(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setEnabled(e){this.selectElement.disabled=!e}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}setAriaLabel(e){this.selectBoxOptions.ariaLabel=e,this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=hS(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=gt(this.selectElement),i=ia(this.selectElement),s=gt(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-KC.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,c=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(c)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,p=Math.floor((r-o-u)/this.getHeight()),m=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Jp.ABOVE,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Jp.BELOW,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=p*this.getHeight())}else f>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,c=o.decoratorRight?o.decoratorRight.length:0,l=o.text.length+a+c;l>s&&(i=r,s=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=du(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=he(e,wR(".select-box-dropdown-list-container")),this.listRenderer=new uDt,this.selectList=new Pc("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:zo.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>g(hDt,0,"Select Box"),getRole:()=>ei?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new oi(this.selectDropDownListContainer,"keydown")),i=T.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new os(o)));this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Enter))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Tab))(this.onEnter,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Escape))(this.onEscape,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.UpArrow))(this.onUpArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.DownArrow))(this.onDownArrow,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageDown))(this.onPageDown,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.PageUp))(this.onPageUp,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.Home))(this.onHome,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode===E.End))(this.onEnd,this)),this._register(T.chain(i,s=>s.filter(o=>o.keyCode>=E.Digit0&&o.keyCode<=E.KeyZ||o.keyCode>=E.Semicolon&&o.keyCode<=E.NumpadDivide))(this.onCharacter,this)),this._register(pe(this.selectList.getHTMLElement(),xe.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(pe(this.selectDropDownContainer,xe.FOCUS_OUT,s=>{!this._isVisible||al(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;un.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(un.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){un.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){un.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){un.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=iE.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(pe(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Xo(this.selectElement,"click",e=>{un.stop(e,!0)})),this._register(Xo(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Xo(this.selectElement,"keydown",e=>{let t=!1;ei?(e.keyCode===E.DownArrow||e.keyCode===E.UpArrow||e.keyCode===E.Space)&&(t=!0):(e.keyCode===E.DownArrow&&e.altKey||e.keyCode===E.Space||e.keyCode===E.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ls(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new gw)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(dh.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,pp&&this._register(pe(e,xe.DRAG_START,s=>s.dataTransfer?.setData(gm.TEXT,this._action.label)))),this._register(pe(t,Eo.Tap,s=>this.onClick(s,!0))),this._register(pe(t,xe.MOUSE_DOWN,s=>{i||un.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),ei&&this._register(pe(t,xe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(pe(t,xe.CLICK,s=>{un.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(pe(t,xe.DBLCLICK,s=>{un.stop(s,!0)})),[xe.MOUSE_UP,xe.MOUSE_OUT].forEach(s=>{this._register(pe(t,s,o=>{un.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){un.stop(e,!0);const i=hc(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}isFocused(){return!!this.element?.classList.contains("focused")}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),this.options.hoverDelegate?.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const t=this.options.hoverDelegate??va("element");this.customHover=this._store.add(H_().setupUpdatableHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class WS extends a_{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),Bt(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Kr.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}isFocused(){return!!this.label&&this.label?.tabIndex===0}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=g(_Dt,0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class JJe extends a_{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new pDt(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}setOptions(e,t){this.selectBox.setOptions(e,t)}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}var vDt=".monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(vDt,{});class wDt extends gw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=he(e,we(".monaco-dropdown")),this._label=he(this._element,we(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[xe.CLICK,xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this.element,o,r=>un.stop(r,!0)));for(const o of[xe.MOUSE_DOWN,Eo.Tap])this._register(pe(this._label,o,r=>{dMe(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(pe(this._label,xe.KEY_UP,o=>{const r=new os(o);(r.equals(E.Enter)||r.equals(E.Space))&&(un.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(dh.addTarget(this._label))}get element(){return this._element}get label(){return this._label}set tooltip(e){this._label&&(!this.hover&&e!==""?this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this._label,e)):this.hover&&this.hover.update(e))}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}isVisible(){return!!this.visible}onEvent(e,t){this.hide()}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class bDt extends wDt{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:Ob.LEFT,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class gx extends a_{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=he(o,we("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new bDt(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{this.element?.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}var CDt=".monaco-action-bar .action-item.menu-entry .action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default{border-radius:5px;display:flex!important;flex-direction:row}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;height:16px;width:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;line-height:16px;margin-left:-3px;padding-left:0;padding-right:0}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}";Ct(CDt,{});const _c=ae("menuService");function XJe(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function yDt(n){return n?n.condition!==void 0:!1}const vs=n=>{performance.mark(n)},SDt=()=>{let n=performance.timeOrigin;typeof n!="number"&&(n=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const e=[{name:"code/timeOrigin",startTime:Math.round(n)}];for(const t of performance.getEntriesByType("mark"))e.push({name:t.name,startTime:Math.round(n+t.startTime)});return e};var MI;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(MI||(MI={}));function ADt(n){const e=n;return e?.changed instanceof Map||e?.deleted instanceof Set}var eb;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(eb||(eb={}));const Aae=class Aae extends ${constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new r1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=eb.None,this.cache=new Map,this.flushDelayer=this._register(new iQ(Aae.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===eb.Closed)return;let i=!1;hc(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===eb.None&&(this.state=eb.Initialized,this.options.hint!==MI.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return hc(i)?t:i}getBoolean(e,t){const i=this.get(e);return hc(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return hc(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return hc(i)?t:JU(i)}async set(e,t,i=!1){if(this.state===eb.Closed)return;if(hc(t))return this.delete(e,i);const s=fo(t)||Array.isArray(t)?uJe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===eb.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==eb.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=eb.Closed;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;const 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===eb.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===MI.STORAGE_IN_MEMORY?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===MI.STORAGE_IN_MEMORY}};Aae.DEFAULT_FLUSH_DELAY=100;let fx=Aae;class fJ{constructor(){this.onDidChangeItemsExternal=T.None,this.items=new Map}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}async optimize(){}async close(){}}const ci=ae("fileService"),_o=ae("IUriIdentityService"),EDt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xDt(n){return EDt.test(n)}const Dr=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;sd.id===a);l&&i.set(c,l)}if(o.emptyWindows)for(const[r,a]of Object.entries(o.emptyWindows)){const c=t.find(l=>l.id===a);c&&s.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:s}}return this._profilesObject}createDefaultProfile(){const e=S3("__default__profile__",g(DDt,0,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Iu(t)}\\s(\\d+)`);let s=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;s=c>s?c:s}const o=`${t} ${s+1}`;return this.createProfile(Ed(Dr()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Ed(Dr()).toString(16),e,t,i)}async createProfile(e,t,i,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return s&&await this.setProfileForWorkspace(s,o),o}async doCreateProfile(e,t,i){if(!zt(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(t);return s||(s=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=S3(e,t,Qt(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(r.location);const a=[];return this._onWillCreateProfile.fire({profile:r,join(c){a.push(c)}}),await ko.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,s)),s}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=S3(i.id,t.name??i.name,i.location,this.profilesCacheHome,{shortName:t.shortName??i.shortName,icon:t.icon===null?void 0:t.icon??i.icon,transient:t.transient??i.isTransient,useDefaultFlags:t.useDefaultFlags??i.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[i]),i}async removeProfile(e){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(s=>s.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(s){i.push(s)}});try{await Promise.allSettled(i)}catch(s){this.logService.error(s)}for(const s of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(s)?.id&&this.profilesObject.emptyWindows.delete(s);for(const s of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(s)?.id&&this.profilesObject.workspaces.delete(s);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(s){Cy(s)!==Zi.FILE_NOT_FOUND&&this.logService.error(s)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(s=>s.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);this.updateWorkspaceAssociation(e,i)}unsetWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(e,void 0,t)}async resetWorkspaces(){this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e);return P.isUri(t)?this.transientProfilesObject.workspaces.get(t)??this.profilesObject.workspaces.get(t):this.transientProfilesObject.emptyWindows.get(t)??this.profilesObject.emptyWindows.get(t)}getWorkspace(e){return BS(e)?e.uri:hF(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.profilesObject.workspaces.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const s=[...this.profiles,...e],o=[];this.transientProfilesObject.profiles=[];for(let r of s)r.isDefault||t.some(a=>r.id===a.id)||(r=i.find(a=>r.id===a.id)??r,r.isTransient?this.transientProfilesObject.profiles.push(r):o.push({location:r.location,name:r.name,shortName:r.shortName,icon:r.icon,useDefaultFlags:r.useDefaultFlags}));this.saveStoredProfiles(o),this._profilesObject=void 0,this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateWorkspaceAssociation(e,t,i){i=t?.isTransient?!0:i,i||this.updateWorkspaceAssociation(e,void 0,!0);const s=this.getWorkspace(e),o=i?this.transientProfilesObject:this.profilesObject;P.isUri(s)?(o.workspaces.delete(s),t&&o.workspaces.set(s,t)):(o.emptyWindows.delete(s),t&&o.emptyWindows.set(s,t)),i||this.updateStoredProfileAssociations()}updateStoredProfileAssociations(){const e={};for(const[i,s]of this.profilesObject.workspaces.entries())e[i.toString()]=s.id;const t={};for(const[i,s]of this.profilesObject.emptyWindows.entries())t[i.toString()]=s.id;this.saveStoredProfileAssociations({workspaces:e,emptyWindows:t}),this._profilesObject=void 0}migrateStoredProfileAssociations(e){const t={},i=this.createDefaultProfile();if(e.workspaces)for(const[o,r]of Object.entries(e.workspaces)){const a=P.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const s={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=P.parse(r);s[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:s}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},iN.PROFILES_KEY="userDataProfiles",iN.PROFILE_ASSOCIATIONS_KEY="profileAssociations",iN);uUe=D([_(0,Il),_(1,ci),_(2,_o),_(3,Ze)],uUe);const pJ="__$__isNewStorageMarker",mJ="__$__targetStorageMarker";var nS;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(nS||(nS={}));var ke;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(ke||(ke={}));var ln;(function(n){n[n.USER=0]="USER",n[n.MACHINE=1]="MACHINE"})(ln||(ln={}));function kDt(n){const e=n.get(mJ);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Eae=class Eae extends ${constructor(e={flushInterval:Eae.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new r1),this._onDidChangeTarget=this._register(new r1),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new yn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new Dn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return T.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=PU(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){St([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{vs("code/willInitStorage");try{await this.doInitialize()}finally{vs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===mJ){switch(e){case ke.APPLICATION:this._applicationKeyTargets=void 0;break;case ke.PROFILE:this._profileKeyTargets=void 0;break;case ke.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,s,o=!1){if(hc(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,s),this.getStorage(i)?.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],s=this.getKeyTargets(e);for(const o of Object.keys(s))s[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,s=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(mJ,JSON.stringify(o),s)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(mJ,JSON.stringify(o),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(ke.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(ke.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(ke.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case ke.APPLICATION:return this.applicationKeyTargets;case ke.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?kDt(t):Object.create(null)}isNew(e){return this.getBoolean(pJ,e)===!0}async flush(e=nS.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(ke.APPLICATION),i=this.getStorage(ke.PROFILE),s=this.getStorage(ke.WORKSPACE);switch(e){case nS.NONE:await ko.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case nS.SHUTDOWN:await ko.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(ke.APPLICATION)?.items??new Map,t=this.getStorage(ke.PROFILE)?.items??new Map,i=this.getStorage(ke.WORKSPACE)?.items??new Map;return LDt(e,t,i,this.getLogDetails(ke.APPLICATION)??"",this.getLogDetails(ke.PROFILE)??"",this.getLogDetails(ke.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(nS.NONE),ZJe(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||bbe(t)&&bbe(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const s=new Set;for(const[o,r]of e)s.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)s.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};Eae.DEFAULT_FLUSH_INTERVAL=60*1e3;let ZU=Eae;function bbe(n){return n.isDefault||!!n.useDefaultFlags?.globalState}class IDt extends ZU{constructor(){super(),this.applicationStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fx(new fJ,{hint:MI.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(ke.APPLICATION,e)))}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return"inMemory (application)";case ke.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function LDt(n,e,t,i,s,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;n.forEach((m,v)=>{a.set(v,m),c.set(v,r(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,r(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,r(m))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const f=[];if(a.forEach((m,v)=>{f.push({key:v,value:m})}),console.table(f),console.groupEnd(),console.log(c),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const m=[];l.forEach((v,w)=>{m.push({key:w,value:v})}),console.table(m),console.groupEnd(),console.log(d)}console.group(`Storage: Workspace (path: ${o})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const on=ae("storageService");function TDt(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?Ye(s):void 0}return t}const RDt={keybindingLabelBackground:Ye(s_t),keybindingLabelForeground:Ye(o_t),keybindingLabelBorder:Ye(r_t),keybindingLabelBottomBorder:Ye(a_t),keybindingLabelShadow:Ye(__)},yQ={buttonForeground:Ye(Zy),buttonSeparator:Ye(f3),buttonBackground:Ye(eS),buttonHoverBackground:Ye(J9),buttonSecondaryForeground:Ye(Zmt),buttonSecondaryBackground:Ye(iwe),buttonSecondaryHoverBackground:Ye(e_t),buttonBorder:Ye(Xmt)},eXe={progressBarBackground:Ye(bmt)},See={inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe),inputActiveOptionBackground:Ye(hR)};Ye(t_t),Ye(n_t),Ye(i_t);Ye(Zs),Ye(ng),Ye(__),Ye(ft),Ye(Omt),Ye(Bmt),Ye(Wmt),Ye(GB);const eV={inputBackground:Ye(SE),inputForeground:Ye(wKe),inputBorder:Ye(_$),inputValidationInfoBorder:Ye(Qmt),inputValidationInfoBackground:Ye(Gmt),inputValidationInfoForeground:Ye(qmt),inputValidationWarningBorder:Ye(Ymt),inputValidationWarningBackground:Ye(jmt),inputValidationWarningForeground:Ye(Kmt),inputValidationErrorBorder:Ye(yKe),inputValidationErrorBackground:Ye(bKe),inputValidationErrorForeground:Ye(CKe)},MDt={listFilterWidgetBackground:Ye(v_t),listFilterWidgetOutline:Ye(w_t),listFilterWidgetNoMatchesOutline:Ye(b_t),listFilterWidgetShadow:Ye(C_t),inputBoxStyles:eV,toggleStyles:See},tXe={badgeBackground:Ye(kW),badgeForeground:Ye(DMe),badgeBorder:Ye(ft)};Ye(Pmt),Ye(Nmt),Ye(dWe),Ye(dWe),Ye(Fmt);const bO={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Ye(c_t),listFocusForeground:Ye(l_t),listFocusOutline:Ye(nwe),listActiveSelectionBackground:Ye(v_),listActiveSelectionForeground:Ye(hm),listActiveSelectionIconForeground:Ye(p3),listFocusAndSelectionOutline:Ye(d_t),listFocusAndSelectionBackground:Ye(v_),listFocusAndSelectionForeground:Ye(hm),listInactiveSelectionBackground:Ye(swe),listInactiveSelectionIconForeground:Ye(u_t),listInactiveSelectionForeground:Ye(h_t),listInactiveFocusBackground:Ye(g_t),listInactiveFocusOutline:Ye(f_t),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listDropOverBackground:Ye(p_t),listDropBetweenBackground:Ye(m_t),listSelectionOutline:Ye(co),listHoverOutline:Ye(co),treeIndentGuidesStroke:Ye(uR),treeInactiveIndentGuidesStroke:Ye(S_t),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:Ye(A_t),tableOddRowsBackgroundColor:Ye(E_t)};function CO(n){return TDt(n,bO)}const iXe={selectBackground:Ye(Xy),selectListBackground:Ye(Jmt),selectForeground:Ye(AE),decoratorRightForeground:Ye(EKe),selectBorder:Ye(YB),focusBorder:Ye(Zd),listFocusBackground:Ye($k),listInactiveSelectionIconForeground:Ye(JB),listFocusForeground:Ye(zk),listFocusOutline:Zve(co,fe.transparent.toString()),listHoverBackground:Ye(SKe),listHoverForeground:Ye(AKe),listHoverOutline:Ye(co),selectListBorder:Ye(sg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},NDt={shadowColor:Ye(__),borderColor:Ye(x_t),foregroundColor:Ye(D_t),backgroundColor:Ye(k_t),selectionForegroundColor:Ye(I_t),selectionBackgroundColor:Ye(L_t),selectionBorderColor:Ye(T_t),separatorColor:Ye(R_t),scrollbarShadow:Ye(p_),scrollbarSliderBackground:Ye(d3),scrollbarSliderHoverBackground:Ye(h3),scrollbarSliderActiveBackground:Ye(u3)},Nfe="vs/platform/actions/browser/menuEntryActionViewItem";function nXe(n,e,t,i){const s=n.getActions(e),o=Nb.getInstance(),r=o.keyStatus.altKey||(Is||jr)&&o.keyStatus.shiftKey;sXe(s,t,r,i?a=>a===i:a=>a==="navigation")}function tD(n,e,t,i,s,o){const r=n.getActions(e);sXe(r,t,!1,typeof i=="string"?c=>c===i:i,s,o)}function sXe(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of n){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Kr)):(h=a,h.length>0&&h.push(new Kr));for(let u of d){t&&(u=u instanceof id&&u.alt?u.alt:u);const f=h.push(u);u instanceof u1&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?r:a,f=d.actions;s(d,l,u.length)&&u.splice(h,1,...f)}}let eC=class extends WS{constructor(e,t,i,s,o,r,a,c){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Dn),this._altKey=Nb.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const s=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(pe(e,"mouseleave",s=>{t=!1,i()})),this._register(pe(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?g(Nfe,0,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),c=a?g(Nfe,0,"{0} ({1})",o,a):o;s=g(Nfe,1,`{0} +[{1}] {2}`,s,bde.modifierLabels[$c].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&yDt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if($e.isThemeIcon(s)){const o=$e.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(s.dark):uf(s.light),i.classList.add("icon"),this._itemClassDispose.value=pa(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};eC=D([_(2,ti),_(3,Pi),_(4,Pe),_(5,pn),_(6,Vr),_(7,Ur)],eC);let b7=class extends gx{constructor(e,t,i,s,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??($e.isThemeIcon(e.item.icon)?$e.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,r),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Bt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!$e.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=rde(this._themeService.getColorTheme().type)?uf(i.dark):uf(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};b7=D([_(2,ti),_(3,Vr),_(4,pn)],b7);let Cbe=class extends a_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=c,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let l;const d=t?.persistLastActionId?c.get(this._storageKey,ke.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(eC,l,{keybinding:this._getDefaultActionKeybindingLabel(l)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??new gw};this._dropdown=new gx(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof id&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,ke.WORKSPACE,ln.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(eC,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends gw{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Yle(this._container,we(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=we(".action-container");this._defaultAction.render(he(this._container,t)),this._register(pe(t,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=we(".dropdown-action-container");this._dropdown.render(he(this._container,i)),this._register(pe(i,xe.KEY_DOWN,s=>{const o=new os(s);o.equals(E.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};Cbe=D([_(2,ti),_(3,Pi),_(4,Vr),_(5,_c),_(6,be),_(7,on)],Cbe);let ybe=class extends JJe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Kr.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,iXe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=Ye(YB)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};ybe=D([_(1,W_)],ybe);function yO(n,e,t){return e instanceof id?n.createInstance(eC,e,t):e instanceof uS?e.item.isSelection?n.createInstance(ybe,e):e.item.rememberDefaultAction?n.createInstance(Cbe,e,{...t,persistLastActionId:!0}):n.createInstance(b7,e,t):void 0}var Qb;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Qb||(Qb={}));class Qh extends ${constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new Zo),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new I({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new I),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??Qb.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[E.Enter,E.Space]},this._hoverDelegate=t.hoverDelegate??this._register(C1()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new gw,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(o=>this._onDidRun.fire(o))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(o=>this._onWillRun.fire(o))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case Qb.HORIZONTAL:i=[E.LeftArrow],s=[E.RightArrow];break;case Qb.VERTICAL:i=[E.UpArrow],s=[E.DownArrow],this.domNode.className+=" vertical";break}this._register(pe(this.domNode,xe.KEY_DOWN,o=>{const r=new os(o);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():s&&(r.equals(s[0])||r.equals(s[1]))?a=this.focusNext():r.equals(E.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(E.Home)?a=this.focusFirst():r.equals(E.End)?a=this.focusLast():r.equals(E.Tab)&&c instanceof a_&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(pe(this.domNode,xe.KEY_UP,o=>{const r=new os(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(E.Tab)||r.equals(V.Shift|E.Tab)||r.equals(E.UpArrow)||r.equals(E.DownArrow)||r.equals(E.LeftArrow)||r.equals(E.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Dd(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(xl()===this.domNode||!al(xl(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setAriaLabel(e){e?this.actionsList.setAttribute("aria-label",e):this.actionsList.removeAttribute("aria-label")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof a_&&i.isEnabled());t instanceof a_&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof a_&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}hasAction(e){return this.viewItems.findIndex(t=>t.action.id===e.id)!==-1}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(Ra(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new WS(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,pe(r,xe.CONTEXT_MENU,l=>{un.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof a_&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let o=!0;SU(s.focus)||(o=!1),this.options.focusOnlyEnabledItems&&SU(s.isEnabled)&&!s.isEnabled()&&(o=!1),s.action.id===Kr.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&s.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof a_){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=St(this.viewItems),this.getContainer().remove(),super.dispose()}}function gUe(n){if(!n.length)return n;let e=-1;for(let i=0;i=0&&n[i].id===Kr.ID;i--)n.splice(i,1);let t=!1;for(let i=n.length-1;i>=0;i--){const s=n[i].id===Kr.ID;s&&!t?n.splice(i,1):s?s&&(t=!1):t=!0}return n}const Sbe=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Pfe=/(&)?(&)([^\s&])/g;var Aee;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Aee||(Aee={}));var Abe;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(Abe||(Abe={}));let oXe=class _J extends Qh{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:Qb.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[E.Enter,...ei||jr?[E.Space]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(dh.addTarget(o)),this._register(pe(o,xe.KEY_DOWN,l=>{new os(l).equals(E.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){un.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ffe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(l)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),jr&&this._register(pe(o,xe.KEY_DOWN,l=>{const d=new os(l);d.equals(E.Home)||d.equals(E.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),un.stop(l,!0)):(d.equals(E.End)||d.equals(E.PageDown))&&(this.focusedItem=0,this.focusPrevious(),un.stop(l,!0))})),this._register(pe(this.domNode,xe.MOUSE_OUT,l=>{const d=l.relatedTarget;al(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(pe(this.actionsList,xe.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(dh.addTarget(this.actionsList)),this._register(pe(this.actionsList,Eo.Tap,l=>{let d=l.initialTarget;if(!(!d||!al(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new bz(o,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(pe(o,Eo.Change,l=>{un.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(pe(a,xe.MOUSE_UP,l=>{l.preventDefault()}));const c=gt(e);o.style.maxHeight=`${Math.max(10,c.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((l,d)=>i.submenuIds?.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!(l instanceof Kr&&(d===t.length-1||d===0||t[d-1]instanceof Kr))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof fUe)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(P9(e)?this.styleSheet=od(e):(_J.globalStyleSheet||(_J.globalStyleSheet=od()),this.styleSheet=_J.globalStyleSheet)),this.styleSheet.textContent=FDt(t,P9(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}get scrollOffset(){return this.menuElement.scrollTop}trigger(e){if(e<=this.viewItems.length&&e>=0){const t=this.viewItems[e];if(t instanceof Ffe)super.focus(e),t.open(!0);else if(t instanceof Ebe)super.run(t._action,t._context);else return}}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(pe(this.element,xe.MOUSE_UP,o=>{if(un.stop(o,!0),pp){if(new yu(gt(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(pe(this.element,xe.CONTEXT_MENU,o=>{un.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=he(this.element,we("a.action-menu-item")),this._action.id===Kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=he(this.item,we("span.menu-item-check"+$e.asCSSSelector(Ce.menuSelection))),this.check.setAttribute("role","none"),this.label=he(this.item,we("span.action-label")),this.options.label&&this.options.keybinding&&(he(this.item,we("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Yo(this.label);let e=mde(this.action.label);if(e){const t=PDt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=Sbe.exec(e);if(i){e=rM(e),Pfe.lastIndex=0;let s=Pfe.exec(e);for(;s&&s[1];)s=Pfe.exec(e);const o=r=>r.replace(/&&/g,"&");s?this.label.append(lz(o(e.substr(0,s.index))," "),we("u",{"aria-hidden":"true"},s[3]),IS(o(e.substr(s.index+s[0].length))," ")):this.label.innerText=o(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Ffe extends Ebe{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:Aee.Right,vertical:Abe.Below},this.showScheduler=new yn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new yn(()=>{this.element&&!al(xl(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=he(this.item,we("span.submenu-indicator"+$e.asCSSSelector(Ce.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(pe(this.element,xe.KEY_UP,t=>{const i=new os(t);(i.equals(E.RightArrow)||i.equals(E.Enter))&&(un.stop(t,!0),this.createSubmenu(!0))})),this._register(pe(this.element,xe.KEY_DOWN,t=>{const i=new os(t);xl()===this.item&&(i.equals(E.RightArrow)||i.equals(E.Enter))&&un.stop(t,!0)})),this._register(pe(this.element,xe.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(pe(this.element,xe.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(pe(this.element,xe.FOCUS_OUT,t=>{this.element&&!al(xl(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}open(e){this.cleanupExistingSubmenu(!1),this.createSubmenu(e)}onClick(e){un.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=i2(e.width,t.width,{position:s.horizontal===Aee.Right?Hp.Before:Hp.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new os(d).equals(E.LeftArrow)&&(un.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(pe(this.submenuContainer,xe.KEY_DOWN,d=>{new os(d).equals(E.LeftArrow)&&un.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class fUe extends WS{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function PDt(n){const e=Sbe,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function pUe(n){const e=FQe()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function FDt(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; @@ -635,43 +635,43 @@ ${pUe(Ce.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class ODt{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=xl();let i;const s=Ra(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(we(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=pe(this.block,xe.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new gw;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new oXe(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},NDt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=gt(o);return a.add(pe(l,xe.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(pe(l,xe.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new yu(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),pa(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide?.(!!o),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(xl()===this.lastContainer||al(xl(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Na(e.error)&&this.notificationService.error(e.error)}}let xbe=class extends ${get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new ODt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new I),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new I),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Dbe.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Nb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};xbe=D([_(0,on),_(1,Pi),_(2,W_),_(3,ti),_(4,mc),_(5,Pe)],xbe);var Dbe;(function(n){function e(i){return i&&i.menuId instanceof Te}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=s.createMenu(r,c??o);nXe(d,a,l),d.dispose()}return i.getActions?Kr.join(i.getActions(),l):l}}}n.transform=t})(Dbe||(Dbe={}));function mUe(n){const e=n;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var y1;(function(n){n[n.ACTIVATE=1]="ACTIVATE",n[n.RESTORE=2]="RESTORE",n[n.PRESERVE=3]="PRESERVE"})(y1||(y1={}));var kbe;(function(n){n[n.PICK=0]="PICK",n[n.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(kbe||(kbe={}));var C7;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(C7||(C7={}));var px;(function(n){n[n.Center=0]="Center",n[n.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",n[n.NearTop=2]="NearTop",n[n.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(px||(px={}));var jb;(function(n){n.PROGRAMMATIC="api",n.NAVIGATION="code.navigation",n.JUMP="code.jump"})(jb||(jb={}));function TNe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}let Ibe=class{constructor(e){this._commandService=e}async open(e,t){if(!Rx(e,_e.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=P.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=JU(decodeURIComponent(e.query))}catch{try{i=JU(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Ibe=D([_(0,Qi)],Ibe);let Lbe=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=P.parse(e));const{selection:i,uri:s}=TNe(e);return e=s,e.scheme===_e.file&&(e=jQe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?C7.USER:C7.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};Lbe=D([_(0,Qt)],Lbe);let Tbe=class{constructor(e,t){this._openers=new td,this._validators=new td,this._resolvers=new td,this._resolvedUriTargets=new wi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new td,this._defaultExternalOpener={openExternal:async i=>(L9(i,_e.http,_e.https)?vje(i):yi.location.href=i,!0)},this._openers.push({open:async(i,s)=>s?.openExternal||L9(i,_e.mailto,_e.http,_e.https,_e.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new Ibe(t)),this._openers.push(new Lbe(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}async open(e,t){const i=typeof e=="string"?P.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(s,t))return!1;for(const o of this._openers)if(await o.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?P.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},qe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},qe.None)}dispose(){this._validators.clear()}};Tbe=D([_(0,Qt),_(1,Qi)],Tbe);const kd=ae("editorWorkerService"),Ofe="vs/platform/markers/common/markers";var Ev;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Ev||(Ev={}));var Ys;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Ys||(Ys={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=g(Ofe,0,"Error"),t[n.Warning]=g(Ofe,1,"Warning"),t[n.Info]=g(Ofe,2,"Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case nt.Error:return n.Error;case nt.Warning:return n.Warning;case nt.Info:return n.Info;case nt.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return nt.Error;case n.Warning:return nt.Warning;case n.Info:return nt.Info;case n.Hint:return nt.Ignore}}n.toSeverity=o})(Ys||(Ys={}));var Eee;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Ys.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(Eee||(Eee={}));const U_=ae("markerService");let Rbe=class extends ${constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new wi,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}getLiveMarkers(e){const t=this._markerDecorations.get(e);return t?t.getMarkers():[]}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new BDt(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===_e.inMemory||e.uri.scheme===_e.internal||e.uri.scheme===_e.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Rbe=D([_(0,Ai),_(1,U_)],Rbe);class BDt extends ${constructor(e){super(),this.model=e,this._map=new rlt,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Ple(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a{const s=this.model.getDecorationRange(t);s&&e.push([s,i])}),e}_createDecorationRange(e,t){let i=O.lift(t);if(t.severity===Ys.Hint&&!this._hasMarkerTag(t,Ev.Unnecessary)&&!this._hasMarkerTag(t,Ev.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const s=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(s===1||i.endColumn>=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new O(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var QL;function vD(n){return n.toString()}class WDt{constructor(e,t,i){this.model=e,this._modelEventListeners=new Z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const HDt=jr||ei?zb.LF:zb.CRLF;class UDt{constructor(e,t,i,s,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var nN;let Mbe=(nN=class extends ${constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new I),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new I),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new I),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Ph.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const u=parseInt(e.editor.tabSize,10);isNaN(u)||(i=u),i<1&&(i=1)}let s="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(s=Math.max(u,1))}let o=Ph.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=HDt;const a=e.eol;a===`\r + `)}return t}class ODt{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=xl();let i;const s=Ra(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(we(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=pe(this.block,xe.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new gw;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new oXe(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},NDt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=gt(o);return a.add(pe(l,xe.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(pe(l,xe.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new yu(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),pa(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide?.(!!o),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(xl()===this.lastContainer||al(xl(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Na(e.error)&&this.notificationService.error(e.error)}}let xbe=class extends ${get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new ODt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new I),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new I),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Dbe.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Nb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};xbe=D([_(0,rn),_(1,Pi),_(2,W_),_(3,ti),_(4,_c),_(5,Pe)],xbe);var Dbe;(function(n){function e(i){return i&&i.menuId instanceof Te}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=s.createMenu(r,c??o);nXe(d,a,l),d.dispose()}return i.getActions?Kr.join(i.getActions(),l):l}}}n.transform=t})(Dbe||(Dbe={}));function mUe(n){const e=n;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var y1;(function(n){n[n.ACTIVATE=1]="ACTIVATE",n[n.RESTORE=2]="RESTORE",n[n.PRESERVE=3]="PRESERVE"})(y1||(y1={}));var kbe;(function(n){n[n.PICK=0]="PICK",n[n.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(kbe||(kbe={}));var C7;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(C7||(C7={}));var px;(function(n){n[n.Center=0]="Center",n[n.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",n[n.NearTop=2]="NearTop",n[n.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(px||(px={}));var jb;(function(n){n.PROGRAMMATIC="api",n.NAVIGATION="code.navigation",n.JUMP="code.jump"})(jb||(jb={}));function TNe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}let Ibe=class{constructor(e){this._commandService=e}async open(e,t){if(!Rx(e,_e.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=P.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=JU(decodeURIComponent(e.query))}catch{try{i=JU(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Ibe=D([_(0,ji)],Ibe);let Lbe=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=P.parse(e));const{selection:i,uri:s}=TNe(e);return e=s,e.scheme===_e.file&&(e=jQe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?C7.USER:C7.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};Lbe=D([_(0,jt)],Lbe);let Tbe=class{constructor(e,t){this._openers=new td,this._validators=new td,this._resolvers=new td,this._resolvedUriTargets=new wi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new td,this._defaultExternalOpener={openExternal:async i=>(L9(i,_e.http,_e.https)?vje(i):yi.location.href=i,!0)},this._openers.push({open:async(i,s)=>s?.openExternal||L9(i,_e.mailto,_e.http,_e.https,_e.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new Ibe(t)),this._openers.push(new Lbe(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}async open(e,t){const i=typeof e=="string"?P.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(s,t))return!1;for(const o of this._openers)if(await o.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?P.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},qe.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},qe.None)}dispose(){this._validators.clear()}};Tbe=D([_(0,jt),_(1,ji)],Tbe);const kd=ae("editorWorkerService"),Ofe="vs/platform/markers/common/markers";var Ev;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Ev||(Ev={}));var Ys;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Ys||(Ys={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=g(Ofe,0,"Error"),t[n.Warning]=g(Ofe,1,"Warning"),t[n.Info]=g(Ofe,2,"Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case nt.Error:return n.Error;case nt.Warning:return n.Warning;case nt.Info:return n.Info;case nt.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return nt.Error;case n.Warning:return nt.Warning;case n.Info:return nt.Info;case n.Hint:return nt.Ignore}}n.toSeverity=o})(Ys||(Ys={}));var Eee;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Ys.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(Eee||(Eee={}));const U_=ae("markerService");let Rbe=class extends ${constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new wi,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}getLiveMarkers(e){const t=this._markerDecorations.get(e);return t?t.getMarkers():[]}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new BDt(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===_e.inMemory||e.uri.scheme===_e.internal||e.uri.scheme===_e.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Rbe=D([_(0,Ai),_(1,U_)],Rbe);class BDt extends ${constructor(e){super(),this.model=e,this._map=new rlt,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Ple(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a{const s=this.model.getDecorationRange(t);s&&e.push([s,i])}),e}_createDecorationRange(e,t){let i=O.lift(t);if(t.severity===Ys.Hint&&!this._hasMarkerTag(t,Ev.Unnecessary)&&!this._hasMarkerTag(t,Ev.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const s=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(s===1||i.endColumn>=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new O(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var QL;function vD(n){return n.toString()}class WDt{constructor(e,t,i){this.model=e,this._modelEventListeners=new Z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const HDt=jr||ei?zb.LF:zb.CRLF;class UDt{constructor(e,t,i,s,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var nN;let Mbe=(nN=class extends ${constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new I),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new I),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new I),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Ph.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const u=parseInt(e.editor.tabSize,10);isNaN(u)||(i=u),i<1&&(i=1)}let s="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(s=Math.max(u,1))}let o=Ph.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=HDt;const a=e.eol;a===`\r `?r=zb.CRLF:a===` -`&&(r=zb.LF);let c=Ph.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Ph.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ph.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ph.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:o,detectIndentation:l,defaultEOL:r,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:zc===Pr.Linux||zc===Pr.Macintosh?` +`&&(r=zb.LF);let c=Ph.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Ph.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ph.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ph.bracketPairColorizationOptions;return e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:o,detectIndentation:l,defaultEOL:r,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:$c===Pr.Linux||$c===Pr.Macintosh?` `:`\r `}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=QL._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=new QU(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(vD(i))){const l=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===l.sha1:!1;if(u||l.sharesUndoRedoStack){for(const f of d.past)zA(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)zA(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>zA(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(l.versionId),r._overwriteAlternativeVersionId(l.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(l.initialUndoRedoSnapshot))}else l.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(l.initialUndoRedoSnapshot)}const a=vD(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new WDt(r,l=>this._onWillDispose(l),(l,d)=>this._onDidChangeLanguage(l,d));return this._models[a]=c,c}updateModel(e,t){const i=this.getCreationOptions(e.getLanguageId(),e.uri,e.isForSimpleWidget),{textBuffer:s,disposable:o}=Mwe(t,i.defaultEOL);if(e.equalsTextBuffer(s)){o.dispose();return}e.pushStackElement(),e.pushEOL(s.getEOL()===`\r -`?bu.CRLF:bu.LF),e.pushEditOperations([],QL._computeEdits(e,s),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,s,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new O(o+1,1,i-r+1,1),c=new O(o+1,1,s-r+1,1)):o>0?(a=new O(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new O(o,1+t.getLineLength(o),s,1+t.getLineLength(s))):(a=new O(1,1,i,e.getLineMaxColumn(i)),c=new O(1,1,s,1+t.getLineLength(s))),[ds.replaceMove(a,t.getValueInRange(c,xo.TextDefined))]}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Kc,i,s),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[vD(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||l.future.length>0){for(const d of l.past)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=QL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!s&&(r>a||!c.canComputeSHA1(e))){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>zA(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new UDt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);QL._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new tV}},QL=nN,nN.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,nN);Mbe=QL=D([_(0,Re),_(1,bMe),_(2,pO),_(3,Di),_(4,lo)],Mbe);const xae=class xae{canComputeSHA1(e){return e.getValueLength()<=xae.MAX_MODEL_SIZE}computeSHA1(e){const t=new Tve,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};xae.MAX_MODEL_SIZE=10*1024*1024;let tV=xae;var VDt=".quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,87%,.4);border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73%,.4);box-shadow:inset 0 -1px 0 hsla(0,0%,73%,.4);color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #6fc3df;box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #0f4a85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50%,.17);border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6);color:#ccc}";Ct(VDt,{});var xee;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(xee||(xee={}));const xz={Quickaccess:"workbench.contributions.quickaccess"};class zDt{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ee(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Ui([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}clear(){const e=[...this.providers],t=this.defaultProvider;return this.providers=[],this.defaultProvider=void 0,()=>{this.providers=e,this.defaultProvider=t}}}it.add(xz.Quickaccess,new zDt);const $Dt={ctrlCmd:!1,alt:!1};var iV;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(iV||(iV={}));var nV;(function(n){n.QuickPick="quickPick",n.InputBox="inputBox",n.QuickWidget="quickWidget"})(nV||(nV={}));var Qp;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Qp||(Qp={}));var Wo;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Wo||(Wo={}));class GDt{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===_e.file?e.resource.fsPath:e.resource?.path}}const _Ue=new GDt,On=ae("quickInputService");let Nbe=class extends ${constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=it.as(xz.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}pick(e="",t){return this.doShowOrPick(e,!0,t)}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[s,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&o&&a===o){e!==o.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!i?.preserveValue){let p;if(r&&a&&a!==o){const m=r.value.substr(a.prefix.length);m&&(p=`${o.prefix}${m}`)}if(!p){const m=s?.defaultFilterValue;m===xee.LAST?p=this.lastAcceptedPickerValues.get(o):typeof m=="string"&&(p=`${o.prefix}${m}`)}typeof p=="string"&&(e=p)}const c=r?.picker?.valueSelection,l=r?.picker?.value,d=new Z,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=i?.placeholder??o?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??Qp.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new sd,d.add(T.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,s,o,e,i));const f=d.add(new ai);if(s&&d.add(s.provide(h,f.token,i?.providerOptions)),T.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),c&&l===e&&(h.valueSelection=c),t)return u?.p}adjustValueSelection(e,t,i){let s;i?.preserveValue?s=[e.value.length,e.value.length]:s=[t?.prefix.length??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ee(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(c=>{const[l]=this.getOrInstantiateProvider(c,o?.enabledProviderPrefixes);l!==t?this.show(c,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):a.value=c})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};Nbe=D([_(0,On),_(1,be)],Nbe);var qDt=".monaco-custom-toggle{border:1px solid transparent;border-radius:3px;box-sizing:border-box;cursor:pointer;float:left;height:20px;margin-left:2px;overflow:hidden;padding:1px;user-select:none;-webkit-user-select:none;width:20px}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{background-size:16px!important;border:1px solid transparent;border-radius:3px;height:18px;margin-left:0;margin-right:9px;opacity:1;padding:0;width:18px}.monaco-action-bar .checkbox-action-item{align-items:center;display:flex}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}";Ct(qDt,{});const rXe={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class iD extends wg{constructor(e){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...$e.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(H_().setupUpdatableHover(e.hoverDelegate??va("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===E.Space||i.keyCode===E.Enter){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...$e.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...$e.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const Dae=class Dae extends wg{constructor(e,t,i){super(),this.title=e,this.isChecked=t,this._onChange=this._register(new I),this.onChange=this._onChange.event,this.checkbox=this._register(new iD({title:this.title,isChecked:this.isChecked,icon:Ce.check,actionClassName:Dae.CLASS_NAME,...rXe})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return kw(this.domNode)}enable(){this.checkbox.enable()}disable(){this.checkbox.disable()}applyStyles(){this.domNode.style.color=this.styles.checkboxForeground||"",this.domNode.style.backgroundColor=this.styles.checkboxBackground||"",this.domNode.style.borderColor=this.styles.checkboxBorder||""}};Dae.CLASS_NAME="monaco-checkbox";let vUe=Dae;var QDt='.quick-input-widget{-webkit-app-region:no-drag;border-radius:6px;left:50%;margin-left:-300px;position:absolute;width:600px;z-index:2550}.quick-input-titlebar{align-items:center;border-radius:inherit;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-title{overflow:hidden;padding:3px 0;text-align:center;text-overflow:ellipsis}.quick-input-right-action-bar{display:flex;flex:1;margin-right:4px}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{flex:1;margin:4px 2px}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{margin-bottom:0;padding:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{display:flex;flex-grow:1;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{left:-10000px;position:absolute}.quick-input-count{align-items:center;align-self:center;display:flex;position:absolute;right:4px}.quick-input-count .monaco-count-badge{border-radius:2px;line-height:normal;min-height:auto;padding:2px 4px;vertical-align:middle}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{align-items:center;display:flex;font-size:11px;height:25px;padding:0 6px}.quick-input-message{margin-top:-1px;overflow-wrap:break-word;padding:5px}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{max-height:440px;overflow:hidden;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;display:flex;height:100%;overflow:hidden;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-style:solid;border-top-width:1px}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{display:flex;flex:1;height:100%;overflow:hidden}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{align-items:center;background-position:0;background-repeat:no-repeat;background-size:16px;display:flex;height:22px;justify-content:center;padding-right:6px;width:16px}.quick-input-list .quick-input-list-rows{display:flex;flex:1;flex-direction:column;height:100%;margin-left:5px;overflow:hidden;text-overflow:ellipsis}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{align-items:center;display:flex}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{line-height:normal;opacity:.7;overflow:hidden;text-overflow:ellipsis}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{background-color:unset;color:var(--vscode-list-highlightForeground)!important;font-weight:700}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px;margin-top:1px}.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-size:12px;padding:4px 6px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}';Ct(QDt,{});class Pbe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Pbe.__decorator=D([ii],Pbe.prototype,"toString",null);const jDt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function aXe(n){const e=[];let t=0,i;for(;i=jDt.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{igt(f)&&un.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new oi(a,xe.CLICK)).event,d=t.disposables.add(new oi(a,xe.KEY_DOWN)).event,h=T.chain(d,f=>f.filter(p=>{const m=new os(p);return m.equals(E.Space)||m.equals(E.Enter)}));t.disposables.add(dh.addTarget(a));const u=t.disposables.add(new oi(a,Eo.Tap)).event;T.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let gF=class extends ${get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},s,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=s,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const s=Ra(e.target)?[e.target]:e.target.targetElements;for(const r of s)this.hoverDisposables.add(Xo(r,"keydown",a=>{a.equals(E.Escape)&&this.hoverService.hideHover()}));const o=Ra(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=iV.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=iV.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?_a(this.ui.widget,this._widget):_a(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new O_,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(r=>r===kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this.buttons.filter(r=>r!==kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.rightActionBar.push(o,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=this.toggles?.filter(o=>o instanceof iD)??[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,_a(this.ui.message),XDt(i,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?g(S1,5,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==nt.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};kae.noPromptMessage=g(S1,4,"Press 'Enter' to confirm your input or 'Escape' to cancel");let sV=kae;const Iae=class Iae extends sV{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new I),this.onWillAcceptEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Qp.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new I),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new I),this.onDidTriggerItemButtonEmitter=this._register(new I),this.onDidTriggerSeparatorButtonEmitter=this._register(new I),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Ole,this.type=nV.QuickPick,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidCustom=this.onDidCustomEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?$Dt:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}inputHasFocus(){return this.visible?this.ui.inputBox.hasFocus():!1}focusOnInput(){this.ui.inputBox.setFocus()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}get hideCountBadge(){return!!this._hideCountBadge}set hideCountBadge(e){this._hideCountBadge=e,this.update()}get hideCheckAll(){return!!this._hideCheckAll}set hideCheckAll(e){this._hideCheckAll=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Wo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ls(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(dMe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return pe(this.ui.container,xe.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new os(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===E.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===E.Alt||a[0].ctrlKey&&i===E.Ctrl||a[0].metaKey&&i===E.Meta)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder||Iae.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Qp.NONE:this._itemActivation=Qp.FIRST;break;case Qp.SECOND:this.ui.list.focus(Wo.Second),this._itemActivation=Qp.FIRST;break;case Qp.LAST:this.ui.list.focus(Wo.Last),this._itemActivation=Qp.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Wo.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};Iae.DEFAULT_ARIA_LABEL=g(S1,6,"Type to narrow down results.");let r2=Iae,skt=class extends sV{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.type=nV.InputBox,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?g(S1,7,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):sV.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}};class okt extends sV{constructor(){super(...arguments),this.type=nV.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let Fbe=class extends gF{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Ra(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};Fbe=D([_(0,Re),_(1,Zc)],Fbe);var rkt=".monaco-text-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-radius:2px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;line-height:18px;padding:4px;text-align:center;width:100%}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{cursor:default;opacity:.4!important}.monaco-text-button .codicon{color:inherit!important;margin:0 .2em}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;height:28px;overflow:hidden;padding:0 4px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;overflow:hidden;width:0}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{align-items:center;display:flex;font-style:inherit;font-weight:400;justify-content:center;padding:4px 0}.monaco-button-dropdown{cursor:pointer;display:flex}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator,.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{cursor:default;padding:4px 0}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{align-items:center;display:flex;flex-direction:column;margin:4px 5px}.monaco-description-button .monaco-button-description{font-size:11px;font-style:italic;padding:4px 20px}.monaco-description-button .monaco-button-description,.monaco-description-button .monaco-button-label{align-items:center;display:flex;justify-content:center}.monaco-description-button .monaco-button-description>.codicon,.monaco-description-button .monaco-button-label>.codicon{color:inherit!important;margin:0 .2em}.monaco-button-dropdown.default-colors>.monaco-button,.monaco-button.default-colors{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}.monaco-button-dropdown.default-colors>.monaco-button:hover,.monaco-button.default-colors:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary,.monaco-button.default-colors.secondary{background-color:var(--vscode-button-secondaryBackground);color:var(--vscode-button-secondaryForeground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover,.monaco-button.default-colors.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-bottom:1px solid var(--vscode-button-border);border-top:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}";Ct(rkt,{});const akt="vs/base/browser/ui/button/button";fe.white.toString(),fe.white.toString();class Tu extends ${get onDidClick(){return this._onDidClick.event}get onDidEscape(){return this._onDidEscape.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new I),this._onDidEscape=this._register(new I),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(dh.addTarget(this._element)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this._element,o,r=>{if(!this.enabled){un.stop(r);return}this._onDidClick.fire(r)}))}),this._register(pe(this._element,xe.KEY_DOWN,o=>{const r=new os(o);let a=!1;this.enabled&&(r.equals(E.Enter)||r.equals(E.Space))?(this._onDidClick.fire(o),a=!0):r.equals(E.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&un.stop(r,!0)})),this._register(pe(this._element,xe.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(pe(this._element,xe.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Dd(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of nw(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||ah(this._label)&&ah(e)&&uAt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ah(e)){const s=mQ(e,{inline:!0});s.dispose();const o=s.element.querySelector("p")?.innerHTML;if(o){const r=oje(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else _a(t)}else this.options.supportIcons?_a(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=gJe(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set labelShort(e){!this.options.supportShortLabel||!this._labelShortElement||(this.options.supportIcons?_a(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...$e.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return kw(this._element)}}class ckt extends ${constructor(e,t){super(),this._onDidClick=this._register(new I),this.onDidClick=this._onDidClick.event,this.element=document.createElement("div"),this.element.classList.add("monaco-button-dropdown"),e.appendChild(this.element),this.button=this._register(new Tu(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new xn("primaryAction",gJe(this.button.label),void 0,!0,async()=>this._onDidClick.fire(void 0))),this.separatorContainer=document.createElement("div"),this.separatorContainer.classList.add("monaco-button-dropdown-separator"),this.separator=document.createElement("div"),this.separatorContainer.appendChild(this.separator),this.element.appendChild(this.separatorContainer);const i=t.buttonBorder;i&&(this.separatorContainer.style.borderTop="1px solid "+i,this.separatorContainer.style.borderBottom="1px solid "+i);const s=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=s??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new Tu(this.element,{...t,title:!1,supportIcons:!0})),this._register(H_().setupUpdatableHover(va("mouse"),this.dropdownButton.element,g(akt,0,"More Actions..."))),this.dropdownButton.element.setAttribute("aria-haspopup","true"),this.dropdownButton.element.setAttribute("aria-expanded","false"),this.dropdownButton.element.classList.add("monaco-dropdown-button"),this.dropdownButton.icon=Ce.dropDownButton,this._register(this.dropdownButton.onDidClick(o=>{const r=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...r]:[this.action,...r],actionRunner:t.actionRunner,onHide:()=>this.dropdownButton.element.setAttribute("aria-expanded","false")}),this.dropdownButton.element.setAttribute("aria-expanded","true")}))}dispose(){super.dispose(),this.element.remove()}set label(e){this.button.label=e,this.action.label=e}set icon(e){this.button.icon=e}set enabled(e){this.button.enabled=e,this.dropdownButton.enabled=e,this.element.classList.toggle("disabled",!e)}get enabled(){return this.button.enabled}focus(){this.button.focus()}hasFocus(){return this.button.hasFocus()||this.dropdownButton.hasFocus()}}class lkt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Tu(this._element,t),this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("monaco-button-description"),this._element.appendChild(this._descriptionElement),e.appendChild(this._element)}get onDidClick(){return this._button.onDidClick}get element(){return this._element}set label(e){this._button.label=e}set icon(e){this._button.icon=e}get enabled(){return this._button.enabled}set enabled(e){this._button.enabled=e}focus(){this._button.focus()}hasFocus(){return this._button.hasFocus()}dispose(){this._button.dispose()}set description(e){this.options.supportIcons?_a(this._descriptionElement,...nw(e)):this._descriptionElement.textContent=e}}class dkt{constructor(e){this.container=e,this._buttons=[],this._buttonStore=new Z}dispose(){this._buttonStore.dispose()}get buttons(){return this._buttons}clear(){this._buttonStore.clear(),this._buttons.length=0}addButton(e){const t=this._buttonStore.add(new Tu(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new lkt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new ckt(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(pe(e.element,xe.KEY_DOWN,i=>{const s=new os(i);let o=!0,r;s.equals(E.LeftArrow)?r=t>0?t-1:this._buttons.length-1:s.equals(E.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),un.stop(i,!0))}))}}var hkt=".monaco-count-badge{border-radius:11px;box-sizing:border-box;display:inline-block;font-size:11px;font-weight:400;line-height:11px;min-height:18px;min-width:18px;padding:3px 6px;text-align:center}.monaco-count-badge.long{border-radius:2px;line-height:normal;min-height:auto;padding:2px 3px}";Ct(hkt,{});class Obe{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=he(e,we(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setCountFormat(e){this.countFormat=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=r_(this.countFormat,this.count),this.element.title=r_(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const ukt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let gkt=ukt;function fkt(n,e){return gkt()}var pkt=".monaco-progress-container{height:2px;overflow:hidden;width:100%}.monaco-progress-container .progress-bit{display:none;height:2px;left:0;position:absolute;width:2%}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-duration:4s;animation-iteration-count:infinite;animation-name:progress;animation-timing-function:linear;transform:translateZ(0)}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translateX(0) scaleX(1)}50%{transform:translateX(2500%) scaleX(3)}to{transform:translateX(4900%) scaleX(1)}}";Ct(pkt,{});const Wfe="done",Hfe="active",aK="infinite",cK="infinite-long-running",Ufe="discrete",K8=class K8 extends ${constructor(e,t){super(),this.progressSignal=this._register(new Dn),this.workedVal=0,this.showDelayedScheduler=this._register(new yn(()=>Oh(this.element),0)),this.longRunningScheduler=this._register(new yn(()=>this.infiniteLongRunning(),K8.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Hfe,aK,cK,Ufe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}done(){return this.doDone(!0)}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Wfe),this.element.classList.contains(aK)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Ufe,Wfe,cK),this.element.classList.add(Hfe,aK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(cK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return jc(this.totalWork)}worked(e){return e=Math.max(1,Number(e)),this.doSetWorked(this.workedVal+e)}setWorked(e){return e=Math.max(1,Number(e)),this.doSetWorked(e)}doSetWorked(e){const t=this.totalWork||100;return this.workedVal=e,this.workedVal=Math.min(t,this.workedVal),this.element.classList.remove(aK,cK,Wfe),this.element.classList.add(Hfe,Ufe),this.element.setAttribute("aria-valuenow",e.toString()),this.bit.style.width=100*(this.workedVal/t)+"%",this}getContainer(){return this.element}show(e){this.showDelayedScheduler.cancel(),this.progressSignal.value=fkt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Oh(this.element)}hide(){Jl(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};K8.LONG_RUNNING_INFINITE_THRESHOLD=1e4,K8.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let y7=K8;const RNe="vs/base/browser/ui/findinput/findInputToggles",mkt=g(RNe,0,"Match Case"),_kt=g(RNe,1,"Match Whole Word"),vkt=g(RNe,2,"Use Regular Expression");class hXe extends iD{constructor(e){super({icon:Ce.caseSensitive,title:mkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class uXe extends iD{constructor(e){super({icon:Ce.wholeWord,title:_kt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class gXe extends iD{constructor(e){super({icon:Ce.regex,title:vkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wkt{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Bbe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isFirst(){return this._currentPosition()===0}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}clear(){this._initialize([]),this._onChange()}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new wkt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}var bkt=".monaco-inputbox{border-radius:2px;box-sizing:border-box;display:block;font-size:inherit;padding:0;position:relative}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{height:100%;position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{border:none;box-sizing:border-box;color:inherit;display:inline-block;font-family:inherit;font-size:inherit;height:100%;line-height:inherit;resize:none;width:100%}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;outline:none;scrollbar-width:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{word-wrap:break-word;box-sizing:border-box;display:inline-block;left:0;position:absolute;top:0;visibility:hidden;white-space:pre-wrap;width:100%}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-top:-1px;overflow:hidden;padding:.4em;text-align:left;width:100%}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;height:16px;width:16px}";Ct(bkt,{});const VW="vs/base/browser/ui/inputbox/inputBox",_5=we;var Yd;(function(n){n[n.INFO=1]="INFO",n[n.WARNING=2]="WARNING",n[n.ERROR=3]="ERROR"})(Yd||(Yd={}));const Ckt={inputBackground:"#3C3C3C",inputForeground:"#CCCCCC",inputValidationInfoBorder:"#55AAFF",inputValidationInfoBackground:"#063B49",inputValidationWarningBorder:"#B89500",inputValidationWarningBackground:"#352A05",inputValidationErrorBorder:"#BE1100",inputValidationErrorBackground:"#5A1D1D",inputBorder:void 0,inputValidationErrorForeground:void 0,inputValidationInfoForeground:void 0,inputValidationWarningForeground:void 0};class fXe extends wg{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new I),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=he(e,_5(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=he(this.element,_5(".ibwrapper"));if(this.input=he(o,_5(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=he(o,_5("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new FKe(this.element,{vertical:zo.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),he(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new oi(e.ownerDocument,"selectionchange")),a=T.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===o);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Qh(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this.input,e))}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get mirrorElement(){return this.mirror}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get step(){return this.input.step}set step(e){this.input.step=e}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Zf(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return kw(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}setEnabled(e){e?this.enable():this.disable()}get width(){return du(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,s=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+s}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Io(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${hS(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}isInputValid(){return!!this.validation&&!this.validation(this.value)}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case Yd.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Yd.WARNING:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case Yd.INFO:return"info";case Yd.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=du(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:Ob.RIGHT,render:s=>{if(!this.message)return null;e=he(s,_5(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?pNe(this.message.content,o):HSt(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background??"",r.style.color=a.foreground??"",r.style.border=a.border?`1px solid ${a.border}`:"",he(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Yd.ERROR?i=g(VW,0,"Error: {0}",this.message.content):this.message.type===Yd.WARNING?i=g(VW,1,"Warning: {0}",this.message.content):i=g(VW,2,"Info: {0}",this.message.content),sa(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${hS(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Zf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class MNe extends fXe{constructor(e,t,i){const s=g(VW,3," or {0} for history","⇅"),o=g(VW,4," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this.history=new Bbe(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!kw(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=c=>{if(this.placeholder.endsWith(c)){const l=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=l:this.setPlaceHolder(l),!0}else return!1};a(o)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}prependHistory(e){const t=this.getHistory();this.clearHistory(),e.forEach(i=>{this.history.add(i)}),t.forEach(i=>{this.history.add(i)})}getHistory(){return this.history.getHistory()}isAtFirstInHistory(){return this.history.isFirst()}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Cu(this.value?this.value:g(VW,5,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Cu(this.value))}clearHistory(){this.history.clear()}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var ykt=".monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.hc-light .monaco-findInput.highlight-0 .controls,.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.hc-light .monaco-findInput.highlight-1 .controls,.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}";Ct(ykt,{});const Skt="vs/base/browser/ui/findinput/findInput",Akt=g(Skt,0,"input"),bBe=class bBe extends wg{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Dn),this.additionalToggles=[],this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCaseSensitiveKeyDown=this._register(new I),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new I),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Akt,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],c=!!i.flexibleHeight,l=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new MNe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:c,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const h=this._register(C1());if(this.showCommonFindToggles){this.regex=this._register(new gXe({appendTitle:r,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new uXe({appendTitle:o,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new hXe({appendTitle:s,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(E.LeftArrow)||f.equals(E.RightArrow)||f.equals(E.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(E.RightArrow)?m=(p+1)%u.length:f.equals(E.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(E.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),un.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(pe(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(pe(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get isImeSessionInProgress(){return this.imeSessionInProgress}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}focusOnRegex(){this.regex?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}clearValidation(){this.inputBox.hideMessage()}};bBe.OPTION_CHANGE="optionChange";let S7=bBe;const Ekt=we;class xkt extends ${constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Xo(this.findInput.inputBox.inputElement,xe.KEY_DOWN,o),this.onMouseDown=o=>Xo(this.findInput.inputBox.inputElement,xe.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=he(this.parent,Ekt(".quick-input-box")),this.findInput=this._register(new S7(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}setPlaceholder(e){this.findInput.inputBox.setPlaceHolder(e)}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===nt.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Dkt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:$.None}}renderElement(e,t,i,s){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new ai,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class kkt{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Ikt(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new kkt(n,e.accessibilityProvider)}}class Lkt{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(c=>new Dkt(c,r));this.list=new Pc(e,t,i,a,Ikt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return kw(this.getHTMLElement())}domFocus(){this.list.domFocus()}get onDidFocus(){return this.list.onDidFocus}get onDidBlur(){return this.list.onDidBlur}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseClick(){return T.map(this.list.onMouseClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onMouseDblClick(){return T.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onTap(){return T.map(this.list.onTap,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return T.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeFocus(){return T.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return T.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onContextMenu(){return T.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:s})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:s}:{element:this._model.get(e),index:t,anchor:i,browserEvent:s})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Mg(e.length))}get length(){return this.list.length}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollLeft(){return this.list.scrollLeft}set scrollLeft(e){this.list.scrollLeft=e}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}setFocus(e){this.list.setFocus(e)}focusNext(e,t){this.list.focusNext(e,t)}focusPrevious(e,t){this.list.focusPrevious(e,t)}focusNextPage(){return this.list.focusNextPage()}focusPreviousPage(){return this.list.focusPreviousPage()}focusLast(){this.list.focusLast()}focusFirst(){this.list.focusFirst()}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}layout(e,t){this.list.layout(e,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}reveal(e,t){this.list.reveal(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Tkt=':root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}.monaco-sash{position:absolute;touch-action:none;z-index:35}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;height:100%;top:0;width:var(--vscode-sash-size)}.monaco-sash.horizontal{cursor:ns-resize;height:var(--vscode-sash-size);left:0;width:100%}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";cursor:all-scroll;display:block;height:calc(var(--vscode-sash-size)*2);position:absolute;width:calc(var(--vscode-sash-size)*2);z-index:100}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-.5);top:calc(var(--vscode-sash-size)*-1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{bottom:calc(var(--vscode-sash-size)*-1);left:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{right:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash:before{background:transparent;content:"";height:100%;pointer-events:none;position:absolute;width:100%}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.active:before,.monaco-sash.hover:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{left:calc(50% - var(--vscode-sash-hover-size)/2);width:var(--vscode-sash-hover-size)}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - var(--vscode-sash-hover-size)/2)}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:cyan}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}';Ct(Tkt,{});const Rkt=!1;var Iee;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(Iee||(Iee={}));var vi;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(vi||(vi={}));var Ia;(function(n){n[n.Disabled=0]="Disabled",n[n.AtMinimum=1]="AtMinimum",n[n.AtMaximum=2]="AtMaximum",n[n.Enabled=3]="Enabled"})(Ia||(Ia={}));let Mkt=4;const Nkt=new I;let Pkt=300;const Fkt=new I;class A7{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new oi(gt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new oi(gt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}A7.__decorator=D([ii],A7.prototype,"onPointerMove",null);A7.__decorator=D([ii],A7.prototype,"onPointerUp",null);class E7{get onPointerMove(){return this.disposables.add(new oi(this.el,Eo.Change)).event}get onPointerUp(){return this.disposables.add(new oi(this.el,Eo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}E7.__decorator=D([ii],E7.prototype,"onPointerMove",null);E7.__decorator=D([ii],E7.prototype,"onPointerUp",null);class oV{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}oV.__decorator=D([ii],oV.prototype,"onPointerMove",null);oV.__decorator=D([ii],oV.prototype,"onPointerUp",null);const wUe="pointer-events-disabled";class Lh extends ${get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===Ia.Disabled),this.el.classList.toggle("minimum",e===Ia.AtMinimum),this.el.classList.toggle("maximum",e===Ia.AtMaximum),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalStartDragHandle=he(this.el,we(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalEndDragHandle=he(this.el,we(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=Pkt,this.hoverDelayer=this._register(new Lu(this.hoverDelay)),this._state=Ia.Enabled,this.onDidEnablementChange=this._register(new I),this._onDidStart=this._register(new I),this._onDidChange=this._register(new I),this._onDidReset=this._register(new I),this._onDidEnd=this._register(new I),this.orthogonalStartSashDisposables=this._register(new Z),this.orthogonalStartDragHandleDisposables=this._register(new Z),this.orthogonalEndSashDisposables=this._register(new Z),this.orthogonalEndDragHandleDisposables=this._register(new Z),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=he(e,we(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),ei&&this.el.classList.add("mac");const s=this._register(new oi(this.el,"mousedown")).event;this._register(s(h=>this.onPointerStart(h,new A7(e)),this));const o=this._register(new oi(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new oi(this.el,"mouseenter")).event;this._register(r(()=>Lh.onMouseEnter(this)));const a=this._register(new oi(this.el,"mouseleave")).event;this._register(a(()=>Lh.onMouseLeave(this))),this._register(dh.addTarget(this.el));const c=this._register(new oi(this.el,Eo.Start)).event;this._register(c(h=>this.onPointerStart(h,new E7(this.el)),this));const l=this._register(new oi(this.el,Eo.Tap)).event;let d;this._register(l(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===vi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Mkt,this._register(Nkt.event(h=>{this.size=h,this.layout()}))),this._register(Fkt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||vi.VERTICAL,this.orientation===vi.HORIZONTAL?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",Rkt),this.layout()}onPointerStart(e,t){un.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new oV(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new oV(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of s)p.classList.add(wUe);const o=e.pageX,r=e.pageY,a=e.altKey,c={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=od(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===vi.HORIZONTAL?this.state===Ia.AtMinimum?p="s-resize":this.state===Ia.AtMaximum?p="n-resize":p=ei?"row-resize":"ns-resize":this.state===Ia.AtMinimum?p="e-resize":this.state===Ia.AtMaximum?p="w-resize":p=ei?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{un.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{un.stop(p,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of s)m.classList.remove(wUe)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Lh.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Lh.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Lh.onMouseLeave(this)}layout(){if(this.orientation===vi.VERTICAL){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!Ra(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var Okt='.monaco-split-view2{height:100%;position:relative;width:100%}.monaco-split-view2>.sash-container{height:100%;pointer-events:none;position:absolute;width:100%}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{height:100%;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{position:absolute;white-space:normal}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{background-color:var(--separator-border);content:" ";left:0;pointer-events:none;position:absolute;top:0;z-index:5}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}';Ct(Okt,{});const Bkt={separatorBorder:fe.transparent};var HC;(function(n){n[n.Normal=0]="Normal",n[n.Low=1]="Low",n[n.High=2]="High"})(HC||(HC={}));class pXe{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=Dc(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class Wkt extends pXe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Hkt extends pXe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Hu;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Hu||(Hu={}));var A1;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(A1||(A1={}));class x7 extends ${get contentSize(){return this._contentSize}get length(){return this.viewItems.length}get minimumSize(){return this.viewItems.reduce((e,t)=>e+t.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,t)=>e+t.maximumSize,0)}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get sashes(){return this.sashItems.map(e=>e.sash)}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Hu.Idle,this._onDidSashChange=this._register(new I),this._onDidSashReset=this._register(new I),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??vi.VERTICAL,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===vi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=he(this.el,we(".sash-container")),this.viewContainer=we(".split-view-container"),this.scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(this.el),s)})),this.scrollableElement=this._register(new hQ(this.viewContainer,{vertical:this.orientation===vi.VERTICAL?t.scrollbarVisibility??zo.Auto:zo.Hidden,horizontal:this.orientation===vi.HORIZONTAL?t.scrollbarVisibility??zo.Auto:zo.Hidden},this.scrollable));const i=this._register(new oi(this.viewContainer,"scroll")).event;this._register(i(s=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),he(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Bkt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,o)=>{const r=ll(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((s,o)=>s+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{t?.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index});const i=t?.type==="split"?this.viewItems[t.index]:void 0,s=this.viewItems.splice(e,1)[0];if(i&&(i.size+=s.size),this.viewItems.length>=1){const r=Math.max(e-1,0);this.sashItems.splice(r,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const o=s.view;return s.dispose(),o}finally{this.state=Hu.Idle}}removeAllViews(){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const e=this.viewItems.splice(0,this.viewItems.length);for(const i of e)i.dispose();const t=this.sashItems.splice(0,this.sashItems.length);for(const i of t)i.disposable.dispose();return this.relayout(),e.map(i=>i.view)}finally{this.state=Hu.Idle}}moveView(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),s=typeof i>"u"?this.getViewSize(e):A1.Invisible(i),o=this.removeView(e);this.addView(o,s,t)}swapViews(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),s=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,s,t)}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[e].setVisible(t),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;o0&&(r.size=Dc(Math.round(a*e/s),r.minimumSize,r.maximumSize))}}else{const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=pa(pe(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),pe(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,c)=>{const l=this.viewItems.map(p=>p.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(s===this.sashItems.length-1){const m=this.viewItems[s];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[s+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Mg(s,-1),m=Mg(s+1,this.viewItems.length),v=p.reduce((F,N)=>F+(this.viewItems[N].minimumSize-l[N]),0),w=p.reduce((F,N)=>F+(this.viewItems[N].viewMaximumSize-l[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].minimumSize),0),C=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].viewMaximumSize),0),y=Math.max(v,C),S=Math.min(b,w),M=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof M=="number"){const F=this.viewItems[M],N=Math.floor(F.viewMinimumSize/2);u={index:M,limitDelta:F.visible?y-N:y+N,size:F.size}}if(typeof k=="number"){const F=this.viewItems[k],N=Math.floor(F.viewMinimumSize/2);f={index:k,limitDelta:F.visible?S+N:S-N,size:F.size}}}this.sashDragState={start:a,current:a,index:s,sizes:l,minDelta:d,maxDelta:h,alt:c,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:c,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,s,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(C=>C.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,w=m.size-m.minimumSize,b=u?t-1:t+1;this.resize(b,-h,f,void 0,void 0,v,w)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Dc(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const i=Mg(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===HC.Low),e],o=i.filter(a=>this.viewItems[a].priority===HC.High),r=this.viewItems[e];t=Math.round(t),t=Dc(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o)}finally{this.state=Hu.Idle}}}isViewExpanded(e){if(e<0||e>=this.viewItems.length)return!1;for(const t of this.viewItems)if(t!==this.viewItems[e]&&t.size>t.minimumSize)return!1;return!0}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Dc(i,a.minimumSize,a.maximumSize);const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const o=we(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>this.viewContainer.removeChild(o)),c=pa(r,a);let l;typeof t=="number"?l=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?l=this.getViewSize(t.index)/2:t.type==="invisible"?l={cachedVisibleSize:t.cachedVisibleSize}:l=e.minimumSize);const d=this.orientation===vi.VERTICAL?new Wkt(o,e,l,c):new Hkt(o,e,l,c);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===vi.VERTICAL?new Lh(this.sashContainer,{getHorizontalSashTop:F=>this.getSashPosition(F),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:vi.HORIZONTAL}):new Lh(this.sashContainer,{getVerticalSashLeft:F=>this.getSashPosition(F),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:vi.VERTICAL}),p=this.orientation===vi.VERTICAL?F=>({sash:f,start:F.startY,current:F.currentY,alt:F.altKey}):F=>({sash:f,start:F.startX,current:F.currentX,alt:F.altKey}),v=T.map(f.onDidStart,p)(this.onSashStart,this),b=T.map(f.onDidChange,p)(this.onSashChange,this),y=T.map(f.onDidEnd,()=>this.sashItems.findIndex(F=>F.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const F=this.sashItems.findIndex(j=>j.sash===f),N=Mg(F,-1),z=Mg(F+1,this.viewItems.length),U=this.findFirstSnapIndex(N),J=this.findFirstSnapIndex(z);typeof U=="number"&&!this.viewItems[U].visible||typeof J=="number"&&!this.viewItems[J].visible||this._onDidSashReset.fire(F)}),M=pa(v,b,y,S,f),k={sash:f,disposable:M};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),s||this.relayout([i],h),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Hu.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Mg(e,-1),h=Mg(e+1,this.viewItems.length);if(o)for(const k of o)yge(d,k),yge(h,k);if(s)for(const k of s)hj(d,k),hj(h,k);const u=d.map(k=>this.viewItems[k]),f=d.map(k=>i[k]),p=h.map(k=>this.viewItems[k]),m=h.map(k=>i[k]),v=d.reduce((k,F)=>k+(this.viewItems[F].minimumSize-i[F]),0),w=d.reduce((k,F)=>k+(this.viewItems[F].maximumSize-i[F]),0),b=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].minimumSize),0),C=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].maximumSize),0),y=Math.max(v,C,r),S=Math.min(b,w,a);let M=!1;if(c){const k=this.viewItems[c.index],F=t>=c.limitDelta;M=F!==k.visible,k.setVisible(F,c.size)}if(!M&&l){const k=this.viewItems[l.index],F=ta+c.size,0);let i=this.size-t;const s=Mg(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);for(const a of r)yge(s,a);for(const a of o)hj(s,a);typeof e=="number"&&hj(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===vi.VERTICAL?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const i=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=s.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=Ia.AtMinimum:b&&t[c]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),St(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Ukt='.monaco-table{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;white-space:nowrap;width:100%}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{font-weight:700;height:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.monaco-table-td,.monaco-table-th{box-sizing:border-box;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{border-left:1px solid transparent;content:"";left:calc(var(--vscode-sash-size)/2);position:absolute;width:0}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}';Ct(Ukt,{});const Lae=class Lae{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Lae.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=he(e,we(".monaco-table-tr")),i=[],s=[];for(let r=0;rthis.disposables.add(new zkt(d,h))),c={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new x7(this.domNode,{orientation:vi.HORIZONTAL,scrollbarVisibility:zo.Hidden,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new Lee(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Pc(e,this.domNode,Vkt(i),[l],r)),T.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((f,p)=>f+p.weight,0),u=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=od(this.domNode),this.style(nDt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}rerender(){this.list.rerender()}row(e){return this.list.element(e)}indexOf(e){return this.list.indexOf(e)}get length(){return this.list.length}getHTMLElement(){return this.domNode}layout(e,t){e=e??aMe(this.domNode),t=t??h$(this.domNode),this.cachedWidth=t,this.cachedHeight=e,this.splitview.layout(t);const i=e-this.virtualDelegate.headerRowHeight;this.list.getHTMLElement().style.height=`${i}px`,this.list.layout(i,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`?bu.CRLF:bu.LF),e.pushEditOperations([],QL._computeEdits(e,s),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,s,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new O(o+1,1,i-r+1,1),c=new O(o+1,1,s-r+1,1)):o>0?(a=new O(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new O(o,1+t.getLineLength(o),s,1+t.getLineLength(s))):(a=new O(1,1,i,e.getLineMaxColumn(i)),c=new O(1,1,s,1+t.getLineLength(s))),[ds.replaceMove(a,t.getValueInRange(c,xo.TextDefined))]}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Yc,i,s),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[vD(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||l.future.length>0){for(const d of l.past)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)zA(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=QL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!s&&(r>a||!c.canComputeSHA1(e))){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>zA(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new UDt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);QL._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new tV}},QL=nN,nN.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,nN);Mbe=QL=D([_(0,Re),_(1,bMe),_(2,pO),_(3,Di),_(4,lo)],Mbe);const xae=class xae{canComputeSHA1(e){return e.getValueLength()<=xae.MAX_MODEL_SIZE}computeSHA1(e){const t=new Tve,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};xae.MAX_MODEL_SIZE=10*1024*1024;let tV=xae;var VDt=".quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,87%,.4);border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73%,.4);box-shadow:inset 0 -1px 0 hsla(0,0%,73%,.4);color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #6fc3df;box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:1px solid #0f4a85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50%,.17);border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6);color:#ccc}";Ct(VDt,{});var xee;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(xee||(xee={}));const xz={Quickaccess:"workbench.contributions.quickaccess"};class zDt{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ee(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Ui([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}clear(){const e=[...this.providers],t=this.defaultProvider;return this.providers=[],this.defaultProvider=void 0,()=>{this.providers=e,this.defaultProvider=t}}}it.add(xz.Quickaccess,new zDt);const $Dt={ctrlCmd:!1,alt:!1};var iV;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(iV||(iV={}));var nV;(function(n){n.QuickPick="quickPick",n.InputBox="inputBox",n.QuickWidget="quickWidget"})(nV||(nV={}));var Qp;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Qp||(Qp={}));var Wo;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Wo||(Wo={}));class GDt{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===_e.file?e.resource.fsPath:e.resource?.path}}const _Ue=new GDt,On=ae("quickInputService");let Nbe=class extends ${constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=it.as(xz.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}pick(e="",t){return this.doShowOrPick(e,!0,t)}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[s,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&o&&a===o){e!==o.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!i?.preserveValue){let p;if(r&&a&&a!==o){const m=r.value.substr(a.prefix.length);m&&(p=`${o.prefix}${m}`)}if(!p){const m=s?.defaultFilterValue;m===xee.LAST?p=this.lastAcceptedPickerValues.get(o):typeof m=="string"&&(p=`${o.prefix}${m}`)}typeof p=="string"&&(e=p)}const c=r?.picker?.valueSelection,l=r?.picker?.value,d=new Z,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=i?.placeholder??o?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??Qp.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new sd,d.add(T.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,s,o,e,i));const f=d.add(new ai);if(s&&d.add(s.provide(h,f.token,i?.providerOptions)),T.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),c&&l===e&&(h.valueSelection=c),t)return u?.p}adjustValueSelection(e,t,i){let s;i?.preserveValue?s=[e.value.length,e.value.length]:s=[t?.prefix.length??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ee(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(c=>{const[l]=this.getOrInstantiateProvider(c,o?.enabledProviderPrefixes);l!==t?this.show(c,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):a.value=c})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};Nbe=D([_(0,On),_(1,be)],Nbe);var qDt=".monaco-custom-toggle{border:1px solid transparent;border-radius:3px;box-sizing:border-box;cursor:pointer;float:left;height:20px;margin-left:2px;overflow:hidden;padding:1px;user-select:none;-webkit-user-select:none;width:20px}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{background-size:16px!important;border:1px solid transparent;border-radius:3px;height:18px;margin-left:0;margin-right:9px;opacity:1;padding:0;width:18px}.monaco-action-bar .checkbox-action-item{align-items:center;display:flex}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}";Ct(qDt,{});const rXe={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class iD extends wg{constructor(e){super(),this._onChange=this._register(new I),this.onChange=this._onChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...$e.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(H_().setupUpdatableHover(e.hoverDelegate??va("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===E.Space||i.keyCode===E.Enter){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...$e.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...$e.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}setTitle(e){this._hover.update(e),this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const Dae=class Dae extends wg{constructor(e,t,i){super(),this.title=e,this.isChecked=t,this._onChange=this._register(new I),this.onChange=this._onChange.event,this.checkbox=this._register(new iD({title:this.title,isChecked:this.isChecked,icon:Ce.check,actionClassName:Dae.CLASS_NAME,...rXe})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return kw(this.domNode)}enable(){this.checkbox.enable()}disable(){this.checkbox.disable()}applyStyles(){this.domNode.style.color=this.styles.checkboxForeground||"",this.domNode.style.backgroundColor=this.styles.checkboxBackground||"",this.domNode.style.borderColor=this.styles.checkboxBorder||""}};Dae.CLASS_NAME="monaco-checkbox";let vUe=Dae;var QDt='.quick-input-widget{-webkit-app-region:no-drag;border-radius:6px;left:50%;margin-left:-300px;position:absolute;width:600px;z-index:2550}.quick-input-titlebar{align-items:center;border-radius:inherit;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-title{overflow:hidden;padding:3px 0;text-align:center;text-overflow:ellipsis}.quick-input-right-action-bar{display:flex;flex:1;margin-right:4px}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{flex:1;margin:4px 2px}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{margin-bottom:0;padding:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{display:flex;flex-grow:1;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{left:-10000px;position:absolute}.quick-input-count{align-items:center;align-self:center;display:flex;position:absolute;right:4px}.quick-input-count .monaco-count-badge{border-radius:2px;line-height:normal;min-height:auto;padding:2px 4px;vertical-align:middle}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{align-items:center;display:flex;font-size:11px;height:25px;padding:0 6px}.quick-input-message{margin-top:-1px;overflow-wrap:break-word;padding:5px}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{max-height:440px;overflow:hidden;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;display:flex;height:100%;overflow:hidden;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-style:solid;border-top-width:1px}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{display:flex;flex:1;height:100%;overflow:hidden}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{align-items:center;background-position:0;background-repeat:no-repeat;background-size:16px;display:flex;height:22px;justify-content:center;padding-right:6px;width:16px}.quick-input-list .quick-input-list-rows{display:flex;flex:1;flex-direction:column;height:100%;margin-left:5px;overflow:hidden;text-overflow:ellipsis}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{align-items:center;display:flex}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{line-height:normal;opacity:.7;overflow:hidden;text-overflow:ellipsis}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{background-color:unset;color:var(--vscode-list-highlightForeground)!important;font-weight:700}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px;margin-top:1px}.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-size:12px;padding:4px 6px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}';Ct(QDt,{});class Pbe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Pbe.__decorator=D([ii],Pbe.prototype,"toString",null);const jDt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function aXe(n){const e=[];let t=0,i;for(;i=jDt.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{igt(f)&&un.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new oi(a,xe.CLICK)).event,d=t.disposables.add(new oi(a,xe.KEY_DOWN)).event,h=T.chain(d,f=>f.filter(p=>{const m=new os(p);return m.equals(E.Space)||m.equals(E.Enter)}));t.disposables.add(dh.addTarget(a));const u=t.disposables.add(new oi(a,Eo.Tap)).event;T.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let gF=class extends ${get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},s,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=s,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const s=Ra(e.target)?[e.target]:e.target.targetElements;for(const r of s)this.hoverDisposables.add(Xo(r,"keydown",a=>{a.equals(E.Escape)&&this.hoverService.hideHover()}));const o=Ra(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=iV.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=iV.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?_a(this.ui.widget,this._widget):_a(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new O_,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(r=>r===kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this.buttons.filter(r=>r!==kee).map((r,a)=>Dee(r,`id-${a}`,async()=>this.onDidTriggerButtonEmitter.fire(r)));this.ui.rightActionBar.push(o,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=this.toggles?.filter(o=>o instanceof iD)??[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,_a(this.ui.message),XDt(i,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?g(S1,5,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==nt.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};kae.noPromptMessage=g(S1,4,"Press 'Enter' to confirm your input or 'Escape' to cancel");let sV=kae;const Iae=class Iae extends sV{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new I),this.onWillAcceptEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Qp.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new I),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new I),this.onDidTriggerItemButtonEmitter=this._register(new I),this.onDidTriggerSeparatorButtonEmitter=this._register(new I),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Ole,this.type=nV.QuickPick,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidCustom=this.onDidCustomEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?$Dt:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}inputHasFocus(){return this.visible?this.ui.inputBox.hasFocus():!1}focusOnInput(){this.ui.inputBox.setFocus()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}get hideCountBadge(){return!!this._hideCountBadge}set hideCountBadge(e){this._hideCountBadge=e,this.update()}get hideCheckAll(){return!!this._hideCheckAll}set hideCheckAll(e){this._hideCheckAll=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Wo.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ls(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(dMe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ls(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return pe(this.ui.container,xe.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new os(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===E.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===E.Alt||a[0].ctrlKey&&i===E.Ctrl||a[0].metaKey&&i===E.Meta)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder||Iae.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Qp.NONE:this._itemActivation=Qp.FIRST;break;case Qp.SECOND:this.ui.list.focus(Wo.Second),this._itemActivation=Qp.FIRST;break;case Qp.LAST:this.ui.list.focus(Wo.Last),this._itemActivation=Qp.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Wo.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};Iae.DEFAULT_ARIA_LABEL=g(S1,6,"Type to narrow down results.");let r2=Iae,skt=class extends sV{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new I),this.onDidAcceptEmitter=this._register(new I),this.type=nV.InputBox,this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?g(S1,7,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):sV.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}};class okt extends sV{constructor(){super(...arguments),this.type=nV.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let Fbe=class extends gF{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Ra(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};Fbe=D([_(0,Re),_(1,el)],Fbe);var rkt=".monaco-text-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-radius:2px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;line-height:18px;padding:4px;text-align:center;width:100%}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled,.monaco-button.disabled:focus{cursor:default;opacity:.4!important}.monaco-text-button .codicon{color:inherit!important;margin:0 .2em}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;height:28px;overflow:hidden;padding:0 4px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;overflow:hidden;width:0}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{align-items:center;display:flex;font-style:inherit;font-weight:400;justify-content:center;padding:4px 0}.monaco-button-dropdown{cursor:pointer;display:flex}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator,.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{cursor:default;padding:4px 0}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{align-items:center;border:1px solid var(--vscode-button-border,transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{align-items:center;display:flex;flex-direction:column;margin:4px 5px}.monaco-description-button .monaco-button-description{font-size:11px;font-style:italic;padding:4px 20px}.monaco-description-button .monaco-button-description,.monaco-description-button .monaco-button-label{align-items:center;display:flex;justify-content:center}.monaco-description-button .monaco-button-description>.codicon,.monaco-description-button .monaco-button-label>.codicon{color:inherit!important;margin:0 .2em}.monaco-button-dropdown.default-colors>.monaco-button,.monaco-button.default-colors{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}.monaco-button-dropdown.default-colors>.monaco-button:hover,.monaco-button.default-colors:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary,.monaco-button.default-colors.secondary{background-color:var(--vscode-button-secondaryBackground);color:var(--vscode-button-secondaryForeground)}.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover,.monaco-button.default-colors.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-bottom:1px solid var(--vscode-button-border);border-top:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}";Ct(rkt,{});const akt="vs/base/browser/ui/button/button";fe.white.toString(),fe.white.toString();class Tu extends ${get onDidClick(){return this._onDidClick.event}get onDidEscape(){return this._onDidEscape.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new I),this._onDidEscape=this._register(new I),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(dh.addTarget(this._element)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this._element,o,r=>{if(!this.enabled){un.stop(r);return}this._onDidClick.fire(r)}))}),this._register(pe(this._element,xe.KEY_DOWN,o=>{const r=new os(o);let a=!1;this.enabled&&(r.equals(E.Enter)||r.equals(E.Space))?(this._onDidClick.fire(o),a=!0):r.equals(E.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&un.stop(r,!0)})),this._register(pe(this._element,xe.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(pe(this._element,xe.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Dd(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of nw(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||ah(this._label)&&ah(e)&&uAt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ah(e)){const s=mQ(e,{inline:!0});s.dispose();const o=s.element.querySelector("p")?.innerHTML;if(o){const r=oje(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else _a(t)}else this.options.supportIcons?_a(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=gJe(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set labelShort(e){!this.options.supportShortLabel||!this._labelShortElement||(this.options.supportIcons?_a(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...$e.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(H_().setupUpdatableHover(this.options.hoverDelegate??va("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return kw(this._element)}}class ckt extends ${constructor(e,t){super(),this._onDidClick=this._register(new I),this.onDidClick=this._onDidClick.event,this.element=document.createElement("div"),this.element.classList.add("monaco-button-dropdown"),e.appendChild(this.element),this.button=this._register(new Tu(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new xn("primaryAction",gJe(this.button.label),void 0,!0,async()=>this._onDidClick.fire(void 0))),this.separatorContainer=document.createElement("div"),this.separatorContainer.classList.add("monaco-button-dropdown-separator"),this.separator=document.createElement("div"),this.separatorContainer.appendChild(this.separator),this.element.appendChild(this.separatorContainer);const i=t.buttonBorder;i&&(this.separatorContainer.style.borderTop="1px solid "+i,this.separatorContainer.style.borderBottom="1px solid "+i);const s=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=s??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new Tu(this.element,{...t,title:!1,supportIcons:!0})),this._register(H_().setupUpdatableHover(va("mouse"),this.dropdownButton.element,g(akt,0,"More Actions..."))),this.dropdownButton.element.setAttribute("aria-haspopup","true"),this.dropdownButton.element.setAttribute("aria-expanded","false"),this.dropdownButton.element.classList.add("monaco-dropdown-button"),this.dropdownButton.icon=Ce.dropDownButton,this._register(this.dropdownButton.onDidClick(o=>{const r=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...r]:[this.action,...r],actionRunner:t.actionRunner,onHide:()=>this.dropdownButton.element.setAttribute("aria-expanded","false")}),this.dropdownButton.element.setAttribute("aria-expanded","true")}))}dispose(){super.dispose(),this.element.remove()}set label(e){this.button.label=e,this.action.label=e}set icon(e){this.button.icon=e}set enabled(e){this.button.enabled=e,this.dropdownButton.enabled=e,this.element.classList.toggle("disabled",!e)}get enabled(){return this.button.enabled}focus(){this.button.focus()}hasFocus(){return this.button.hasFocus()||this.dropdownButton.hasFocus()}}class lkt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Tu(this._element,t),this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("monaco-button-description"),this._element.appendChild(this._descriptionElement),e.appendChild(this._element)}get onDidClick(){return this._button.onDidClick}get element(){return this._element}set label(e){this._button.label=e}set icon(e){this._button.icon=e}get enabled(){return this._button.enabled}set enabled(e){this._button.enabled=e}focus(){this._button.focus()}hasFocus(){return this._button.hasFocus()}dispose(){this._button.dispose()}set description(e){this.options.supportIcons?_a(this._descriptionElement,...nw(e)):this._descriptionElement.textContent=e}}class dkt{constructor(e){this.container=e,this._buttons=[],this._buttonStore=new Z}dispose(){this._buttonStore.dispose()}get buttons(){return this._buttons}clear(){this._buttonStore.clear(),this._buttons.length=0}addButton(e){const t=this._buttonStore.add(new Tu(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new lkt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new ckt(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(pe(e.element,xe.KEY_DOWN,i=>{const s=new os(i);let o=!0,r;s.equals(E.LeftArrow)?r=t>0?t-1:this._buttons.length-1:s.equals(E.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),un.stop(i,!0))}))}}var hkt=".monaco-count-badge{border-radius:11px;box-sizing:border-box;display:inline-block;font-size:11px;font-weight:400;line-height:11px;min-height:18px;min-width:18px;padding:3px 6px;text-align:center}.monaco-count-badge.long{border-radius:2px;line-height:normal;min-height:auto;padding:2px 3px}";Ct(hkt,{});class Obe{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=he(e,we(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setCountFormat(e){this.countFormat=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=r_(this.countFormat,this.count),this.element.title=r_(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const ukt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let gkt=ukt;function fkt(n,e){return gkt()}var pkt=".monaco-progress-container{height:2px;overflow:hidden;width:100%}.monaco-progress-container .progress-bit{display:none;height:2px;left:0;position:absolute;width:2%}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-duration:4s;animation-iteration-count:infinite;animation-name:progress;animation-timing-function:linear;transform:translateZ(0)}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translateX(0) scaleX(1)}50%{transform:translateX(2500%) scaleX(3)}to{transform:translateX(4900%) scaleX(1)}}";Ct(pkt,{});const Wfe="done",Hfe="active",aK="infinite",cK="infinite-long-running",Ufe="discrete",K8=class K8 extends ${constructor(e,t){super(),this.progressSignal=this._register(new Dn),this.workedVal=0,this.showDelayedScheduler=this._register(new yn(()=>Oh(this.element),0)),this.longRunningScheduler=this._register(new yn(()=>this.infiniteLongRunning(),K8.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Hfe,aK,cK,Ufe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}done(){return this.doDone(!0)}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Wfe),this.element.classList.contains(aK)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Ufe,Wfe,cK),this.element.classList.add(Hfe,aK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(cK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return Kc(this.totalWork)}worked(e){return e=Math.max(1,Number(e)),this.doSetWorked(this.workedVal+e)}setWorked(e){return e=Math.max(1,Number(e)),this.doSetWorked(e)}doSetWorked(e){const t=this.totalWork||100;return this.workedVal=e,this.workedVal=Math.min(t,this.workedVal),this.element.classList.remove(aK,cK,Wfe),this.element.classList.add(Hfe,Ufe),this.element.setAttribute("aria-valuenow",e.toString()),this.bit.style.width=100*(this.workedVal/t)+"%",this}getContainer(){return this.element}show(e){this.showDelayedScheduler.cancel(),this.progressSignal.value=fkt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Oh(this.element)}hide(){Jl(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};K8.LONG_RUNNING_INFINITE_THRESHOLD=1e4,K8.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let y7=K8;const RNe="vs/base/browser/ui/findinput/findInputToggles",mkt=g(RNe,0,"Match Case"),_kt=g(RNe,1,"Match Whole Word"),vkt=g(RNe,2,"Use Regular Expression");class hXe extends iD{constructor(e){super({icon:Ce.caseSensitive,title:mkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class uXe extends iD{constructor(e){super({icon:Ce.wholeWord,title:_kt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class gXe extends iD{constructor(e){super({icon:Ce.regex,title:vkt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wkt{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Bbe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isFirst(){return this._currentPosition()===0}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}clear(){this._initialize([]),this._onChange()}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new wkt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}var bkt=".monaco-inputbox{border-radius:2px;box-sizing:border-box;display:block;font-size:inherit;padding:0;position:relative}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{height:100%;position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{border:none;box-sizing:border-box;color:inherit;display:inline-block;font-family:inherit;font-size:inherit;height:100%;line-height:inherit;resize:none;width:100%}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;outline:none;scrollbar-width:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{word-wrap:break-word;box-sizing:border-box;display:inline-block;left:0;position:absolute;top:0;visibility:hidden;white-space:pre-wrap;width:100%}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-top:-1px;overflow:hidden;padding:.4em;text-align:left;width:100%}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;height:16px;width:16px}";Ct(bkt,{});const VW="vs/base/browser/ui/inputbox/inputBox",_5=we;var Yd;(function(n){n[n.INFO=1]="INFO",n[n.WARNING=2]="WARNING",n[n.ERROR=3]="ERROR"})(Yd||(Yd={}));const Ckt={inputBackground:"#3C3C3C",inputForeground:"#CCCCCC",inputValidationInfoBorder:"#55AAFF",inputValidationInfoBackground:"#063B49",inputValidationWarningBorder:"#B89500",inputValidationWarningBackground:"#352A05",inputValidationErrorBorder:"#BE1100",inputValidationErrorBackground:"#5A1D1D",inputBorder:void 0,inputValidationErrorForeground:void 0,inputValidationInfoForeground:void 0,inputValidationWarningForeground:void 0};class fXe extends wg{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new I),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=he(e,_5(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=he(this.element,_5(".ibwrapper"));if(this.input=he(o,_5(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=he(o,_5("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new FKe(this.element,{vertical:zo.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),he(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new oi(e.ownerDocument,"selectionchange")),a=T.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===o);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Qh(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(H_().setupUpdatableHover(va("mouse"),this.input,e))}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get mirrorElement(){return this.mirror}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get step(){return this.input.step}set step(e){this.input.step=e}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Zf(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return kw(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}setEnabled(e){e?this.enable():this.disable()}get width(){return du(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,s=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+s}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Io(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${hS(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}isInputValid(){return!!this.validation&&!this.validation(this.value)}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case Yd.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Yd.WARNING:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case Yd.INFO:return"info";case Yd.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=du(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:Ob.RIGHT,render:s=>{if(!this.message)return null;e=he(s,_5(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?pNe(this.message.content,o):HSt(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background??"",r.style.color=a.foreground??"",r.style.border=a.border?`1px solid ${a.border}`:"",he(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Yd.ERROR?i=g(VW,0,"Error: {0}",this.message.content):this.message.type===Yd.WARNING?i=g(VW,1,"Warning: {0}",this.message.content):i=g(VW,2,"Info: {0}",this.message.content),sa(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${hS(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Zf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class MNe extends fXe{constructor(e,t,i){const s=g(VW,3," or {0} for history","⇅"),o=g(VW,4," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this.history=new Bbe(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!kw(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=c=>{if(this.placeholder.endsWith(c)){const l=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=l:this.setPlaceHolder(l),!0}else return!1};a(o)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}prependHistory(e){const t=this.getHistory();this.clearHistory(),e.forEach(i=>{this.history.add(i)}),t.forEach(i=>{this.history.add(i)})}getHistory(){return this.history.getHistory()}isAtFirstInHistory(){return this.history.isFirst()}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Cu(this.value?this.value:g(VW,5,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Cu(this.value))}clearHistory(){this.history.clear()}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}var ykt=".monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.hc-light .monaco-findInput.highlight-0 .controls,.monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.hc-light .monaco-findInput.highlight-1 .controls,.monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}";Ct(ykt,{});const Skt="vs/base/browser/ui/findinput/findInput",Akt=g(Skt,0,"input"),bBe=class bBe extends wg{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Dn),this.additionalToggles=[],this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onCaseSensitiveKeyDown=this._register(new I),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new I),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Akt,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],c=!!i.flexibleHeight,l=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new MNe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:c,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const h=this._register(C1());if(this.showCommonFindToggles){this.regex=this._register(new gXe({appendTitle:r,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new uXe({appendTitle:o,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new hXe({appendTitle:s,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(E.LeftArrow)||f.equals(E.RightArrow)||f.equals(E.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(E.RightArrow)?m=(p+1)%u.length:f.equals(E.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(E.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),un.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(pe(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(pe(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get isImeSessionInProgress(){return this.imeSessionInProgress}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}focusOnRegex(){this.regex?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}clearValidation(){this.inputBox.hideMessage()}};bBe.OPTION_CHANGE="optionChange";let S7=bBe;const Ekt=we;class xkt extends ${constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Xo(this.findInput.inputBox.inputElement,xe.KEY_DOWN,o),this.onMouseDown=o=>Xo(this.findInput.inputBox.inputElement,xe.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=he(this.parent,Ekt(".quick-input-box")),this.findInput=this._register(new S7(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}setPlaceholder(e){this.findInput.inputBox.setPlaceHolder(e)}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===nt.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===nt.Info?Yd.INFO:e===nt.Warning?Yd.WARNING:Yd.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Dkt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:$.None}}renderElement(e,t,i,s){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new ai,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class kkt{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Ikt(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new kkt(n,e.accessibilityProvider)}}class Lkt{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(c=>new Dkt(c,r));this.list=new Pc(e,t,i,a,Ikt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return kw(this.getHTMLElement())}domFocus(){this.list.domFocus()}get onDidFocus(){return this.list.onDidFocus}get onDidBlur(){return this.list.onDidBlur}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseClick(){return T.map(this.list.onMouseClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onMouseDblClick(){return T.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onTap(){return T.map(this.list.onTap,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return T.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeFocus(){return T.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return T.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get onContextMenu(){return T.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:s})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:s}:{element:this._model.get(e),index:t,anchor:i,browserEvent:s})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Mg(e.length))}get length(){return this.list.length}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollLeft(){return this.list.scrollLeft}set scrollLeft(e){this.list.scrollLeft=e}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}setFocus(e){this.list.setFocus(e)}focusNext(e,t){this.list.focusNext(e,t)}focusPrevious(e,t){this.list.focusPrevious(e,t)}focusNextPage(){return this.list.focusNextPage()}focusPreviousPage(){return this.list.focusPreviousPage()}focusLast(){this.list.focusLast()}focusFirst(){this.list.focusFirst()}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}layout(e,t){this.list.layout(e,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}reveal(e,t){this.list.reveal(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var Tkt=':root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}.monaco-sash{position:absolute;touch-action:none;z-index:35}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;height:100%;top:0;width:var(--vscode-sash-size)}.monaco-sash.horizontal{cursor:ns-resize;height:var(--vscode-sash-size);left:0;width:100%}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";cursor:all-scroll;display:block;height:calc(var(--vscode-sash-size)*2);position:absolute;width:calc(var(--vscode-sash-size)*2);z-index:100}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-.5);top:calc(var(--vscode-sash-size)*-1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{bottom:calc(var(--vscode-sash-size)*-1);left:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{right:calc(var(--vscode-sash-size)*-1);top:calc(var(--vscode-sash-size)*-.5)}.monaco-sash:before{background:transparent;content:"";height:100%;pointer-events:none;position:absolute;width:100%}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.active:before,.monaco-sash.hover:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{left:calc(50% - var(--vscode-sash-hover-size)/2);width:var(--vscode-sash-hover-size)}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - var(--vscode-sash-hover-size)/2)}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:cyan}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}';Ct(Tkt,{});const Rkt=!1;var Iee;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(Iee||(Iee={}));var vi;(function(n){n[n.VERTICAL=0]="VERTICAL",n[n.HORIZONTAL=1]="HORIZONTAL"})(vi||(vi={}));var Ia;(function(n){n[n.Disabled=0]="Disabled",n[n.AtMinimum=1]="AtMinimum",n[n.AtMaximum=2]="AtMaximum",n[n.Enabled=3]="Enabled"})(Ia||(Ia={}));let Mkt=4;const Nkt=new I;let Pkt=300;const Fkt=new I;class A7{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new oi(gt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new oi(gt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}A7.__decorator=D([ii],A7.prototype,"onPointerMove",null);A7.__decorator=D([ii],A7.prototype,"onPointerUp",null);class E7{get onPointerMove(){return this.disposables.add(new oi(this.el,Eo.Change)).event}get onPointerUp(){return this.disposables.add(new oi(this.el,Eo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}E7.__decorator=D([ii],E7.prototype,"onPointerMove",null);E7.__decorator=D([ii],E7.prototype,"onPointerUp",null);class oV{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}oV.__decorator=D([ii],oV.prototype,"onPointerMove",null);oV.__decorator=D([ii],oV.prototype,"onPointerUp",null);const wUe="pointer-events-disabled";class Lh extends ${get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===Ia.Disabled),this.el.classList.toggle("minimum",e===Ia.AtMinimum),this.el.classList.toggle("maximum",e===Ia.AtMaximum),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalStartDragHandle=he(this.el,we(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new oi(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==Ia.Disabled&&(this._orthogonalEndDragHandle=he(this.el,we(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Lh.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new oi(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Lh.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=Pkt,this.hoverDelayer=this._register(new Lu(this.hoverDelay)),this._state=Ia.Enabled,this.onDidEnablementChange=this._register(new I),this._onDidStart=this._register(new I),this._onDidChange=this._register(new I),this._onDidReset=this._register(new I),this._onDidEnd=this._register(new I),this.orthogonalStartSashDisposables=this._register(new Z),this.orthogonalStartDragHandleDisposables=this._register(new Z),this.orthogonalEndSashDisposables=this._register(new Z),this.orthogonalEndDragHandleDisposables=this._register(new Z),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=he(e,we(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),ei&&this.el.classList.add("mac");const s=this._register(new oi(this.el,"mousedown")).event;this._register(s(h=>this.onPointerStart(h,new A7(e)),this));const o=this._register(new oi(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new oi(this.el,"mouseenter")).event;this._register(r(()=>Lh.onMouseEnter(this)));const a=this._register(new oi(this.el,"mouseleave")).event;this._register(a(()=>Lh.onMouseLeave(this))),this._register(dh.addTarget(this.el));const c=this._register(new oi(this.el,Eo.Start)).event;this._register(c(h=>this.onPointerStart(h,new E7(this.el)),this));const l=this._register(new oi(this.el,Eo.Tap)).event;let d;this._register(l(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===vi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Mkt,this._register(Nkt.event(h=>{this.size=h,this.layout()}))),this._register(Fkt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||vi.VERTICAL,this.orientation===vi.HORIZONTAL?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",Rkt),this.layout()}onPointerStart(e,t){un.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new oV(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new oV(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of s)p.classList.add(wUe);const o=e.pageX,r=e.pageY,a=e.altKey,c={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=od(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===vi.HORIZONTAL?this.state===Ia.AtMinimum?p="s-resize":this.state===Ia.AtMaximum?p="n-resize":p=ei?"row-resize":"ns-resize":this.state===Ia.AtMinimum?p="e-resize":this.state===Ia.AtMaximum?p="w-resize":p=ei?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{un.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{un.stop(p,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of s)m.classList.remove(wUe)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Lh.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Lh.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Lh.onMouseLeave(this)}layout(){if(this.orientation===vi.VERTICAL){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!Ra(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var Okt='.monaco-split-view2{height:100%;position:relative;width:100%}.monaco-split-view2>.sash-container{height:100%;pointer-events:none;position:absolute;width:100%}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.monaco-scrollable-element{height:100%;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{height:100%;position:relative;white-space:nowrap;width:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{position:absolute;white-space:normal}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{background-color:var(--separator-border);content:" ";left:0;pointer-events:none;position:absolute;top:0;z-index:5}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}';Ct(Okt,{});const Bkt={separatorBorder:fe.transparent};var HC;(function(n){n[n.Normal=0]="Normal",n[n.Low=1]="Low",n[n.High=2]="High"})(HC||(HC={}));class pXe{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=Dc(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class Wkt extends pXe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Hkt extends pXe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Hu;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Hu||(Hu={}));var A1;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(A1||(A1={}));class x7 extends ${get contentSize(){return this._contentSize}get length(){return this.viewItems.length}get minimumSize(){return this.viewItems.reduce((e,t)=>e+t.minimumSize,0)}get maximumSize(){return this.length===0?Number.POSITIVE_INFINITY:this.viewItems.reduce((e,t)=>e+t.maximumSize,0)}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get sashes(){return this.sashItems.map(e=>e.sash)}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Hu.Idle,this._onDidSashChange=this._register(new I),this._onDidSashReset=this._register(new I),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??vi.VERTICAL,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===vi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=he(this.el,we(".sash-container")),this.viewContainer=we(".split-view-container"),this.scrollable=this._register(new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(this.el),s)})),this.scrollableElement=this._register(new hQ(this.viewContainer,{vertical:this.orientation===vi.VERTICAL?t.scrollbarVisibility??zo.Auto:zo.Hidden,horizontal:this.orientation===vi.HORIZONTAL?t.scrollbarVisibility??zo.Auto:zo.Hidden},this.scrollable));const i=this._register(new oi(this.viewContainer,"scroll")).event;this._register(i(s=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),he(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Bkt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,o)=>{const r=ll(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((s,o)=>s+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{t?.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index});const i=t?.type==="split"?this.viewItems[t.index]:void 0,s=this.viewItems.splice(e,1)[0];if(i&&(i.size+=s.size),this.viewItems.length>=1){const r=Math.max(e-1,0);this.sashItems.splice(r,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const o=s.view;return s.dispose(),o}finally{this.state=Hu.Idle}}removeAllViews(){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const e=this.viewItems.splice(0,this.viewItems.length);for(const i of e)i.dispose();const t=this.sashItems.splice(0,this.sashItems.length);for(const i of t)i.disposable.dispose();return this.relayout(),e.map(i=>i.view)}finally{this.state=Hu.Idle}}moveView(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),s=typeof i>"u"?this.getViewSize(e):A1.Invisible(i),o=this.removeView(e);this.addView(o,s,t)}swapViews(e,t){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),s=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,s,t)}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");this.viewItems[e].setVisible(t),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;o0&&(r.size=Dc(Math.round(a*e/s),r.minimumSize,r.maximumSize))}}else{const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=pa(pe(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),pe(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,c)=>{const l=this.viewItems.map(p=>p.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(s===this.sashItems.length-1){const m=this.viewItems[s];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[s+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Mg(s,-1),m=Mg(s+1,this.viewItems.length),v=p.reduce((F,N)=>F+(this.viewItems[N].minimumSize-l[N]),0),w=p.reduce((F,N)=>F+(this.viewItems[N].viewMaximumSize-l[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].minimumSize),0),C=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((F,N)=>F+(l[N]-this.viewItems[N].viewMaximumSize),0),y=Math.max(v,C),S=Math.min(b,w),M=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof M=="number"){const F=this.viewItems[M],N=Math.floor(F.viewMinimumSize/2);u={index:M,limitDelta:F.visible?y-N:y+N,size:F.size}}if(typeof k=="number"){const F=this.viewItems[k],N=Math.floor(F.viewMinimumSize/2);f={index:k,limitDelta:F.visible?S+N:S-N,size:F.size}}}this.sashDragState={start:a,current:a,index:s,sizes:l,minDelta:d,maxDelta:h,alt:c,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:c,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,s,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(C=>C.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,w=m.size-m.minimumSize,b=u?t-1:t+1;this.resize(b,-h,f,void 0,void 0,v,w)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Dc(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const i=Mg(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===HC.Low),e],o=i.filter(a=>this.viewItems[a].priority===HC.High),r=this.viewItems[e];t=Math.round(t),t=Dc(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o)}finally{this.state=Hu.Idle}}}isViewExpanded(e){if(e<0||e>=this.viewItems.length)return!1;for(const t of this.viewItems)if(t!==this.viewItems[e]&&t.size>t.minimumSize)return!1;return!0}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Dc(i,a.minimumSize,a.maximumSize);const s=Mg(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Hu.Idle)throw new Error("Cant modify splitview");this.state=Hu.Busy;try{const o=we(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>this.viewContainer.removeChild(o)),c=pa(r,a);let l;typeof t=="number"?l=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?l=this.getViewSize(t.index)/2:t.type==="invisible"?l={cachedVisibleSize:t.cachedVisibleSize}:l=e.minimumSize);const d=this.orientation===vi.VERTICAL?new Wkt(o,e,l,c):new Hkt(o,e,l,c);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===vi.VERTICAL?new Lh(this.sashContainer,{getHorizontalSashTop:F=>this.getSashPosition(F),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:vi.HORIZONTAL}):new Lh(this.sashContainer,{getVerticalSashLeft:F=>this.getSashPosition(F),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:vi.VERTICAL}),p=this.orientation===vi.VERTICAL?F=>({sash:f,start:F.startY,current:F.currentY,alt:F.altKey}):F=>({sash:f,start:F.startX,current:F.currentX,alt:F.altKey}),v=T.map(f.onDidStart,p)(this.onSashStart,this),b=T.map(f.onDidChange,p)(this.onSashChange,this),y=T.map(f.onDidEnd,()=>this.sashItems.findIndex(F=>F.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const F=this.sashItems.findIndex(j=>j.sash===f),N=Mg(F,-1),z=Mg(F+1,this.viewItems.length),U=this.findFirstSnapIndex(N),J=this.findFirstSnapIndex(z);typeof U=="number"&&!this.viewItems[U].visible||typeof J=="number"&&!this.viewItems[J].visible||this._onDidSashReset.fire(F)}),M=pa(v,b,y,S,f),k={sash:f,disposable:M};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),s||this.relayout([i],h),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Hu.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Mg(e,-1),h=Mg(e+1,this.viewItems.length);if(o)for(const k of o)yge(d,k),yge(h,k);if(s)for(const k of s)hj(d,k),hj(h,k);const u=d.map(k=>this.viewItems[k]),f=d.map(k=>i[k]),p=h.map(k=>this.viewItems[k]),m=h.map(k=>i[k]),v=d.reduce((k,F)=>k+(this.viewItems[F].minimumSize-i[F]),0),w=d.reduce((k,F)=>k+(this.viewItems[F].maximumSize-i[F]),0),b=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].minimumSize),0),C=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,F)=>k+(i[F]-this.viewItems[F].maximumSize),0),y=Math.max(v,C,r),S=Math.min(b,w,a);let M=!1;if(c){const k=this.viewItems[c.index],F=t>=c.limitDelta;M=F!==k.visible,k.setVisible(F,c.size)}if(!M&&l){const k=this.viewItems[l.index],F=ta+c.size,0);let i=this.size-t;const s=Mg(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===HC.Low),r=s.filter(a=>this.viewItems[a].priority===HC.High);for(const a of r)yge(s,a);for(const a of o)hj(s,a);typeof e=="number"&&hj(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===vi.VERTICAL?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const i=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=s.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=Ia.AtMinimum:b&&t[c]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),St(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Ukt='.monaco-table{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;white-space:nowrap;width:100%}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{font-weight:700;height:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.monaco-table-td,.monaco-table-th{box-sizing:border-box;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{border-left:1px solid transparent;content:"";left:calc(var(--vscode-sash-size)/2);position:absolute;width:0}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}';Ct(Ukt,{});const Lae=class Lae{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Lae.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=he(e,we(".monaco-table-tr")),i=[],s=[];for(let r=0;rthis.disposables.add(new zkt(d,h))),c={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new x7(this.domNode,{orientation:vi.HORIZONTAL,scrollbarVisibility:zo.Hidden,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new Lee(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Pc(e,this.domNode,Vkt(i),[l],r)),T.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((f,p)=>f+p.weight,0),u=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=od(this.domNode),this.style(nDt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}rerender(){this.list.rerender()}row(e){return this.list.element(e)}indexOf(e){return this.list.indexOf(e)}get length(){return this.list.length}getHTMLElement(){return this.domNode}layout(e,t){e=e??aMe(this.domNode),t=t??h$(this.domNode),this.cachedWidth=t,this.cachedHeight=e,this.splitview.layout(t);const i=e-this.virtualDelegate.headerRowHeight;this.list.getHTMLElement().style.height=`${i}px`,this.list.layout(i,t)}triggerTypeNavigation(){this.list.triggerTypeNavigation()}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}domFocus(){this.list.domFocus()}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}getSelectedElements(){return this.list.getSelectedElements()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}setFocus(e,t){this.list.setFocus(e,t)}focusNext(e=1,t=!1,i){this.list.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.list.focusPrevious(e,t,i)}focusNextPage(e){return this.list.focusNextPage(e)}focusPreviousPage(e){return this.list.focusPreviousPage(e)}focusFirst(e){this.list.focusFirst(e)}focusLast(e){this.list.focusLast(e)}getFocus(){return this.list.getFocus()}getFocusedElements(){return this.list.getFocusedElements()}getRelativeTop(e){return this.list.getRelativeTop(e)}reveal(e,t){this.list.reveal(e,t)}dispose(){this.disposables.dispose()}};Tae.InstanceCount=0;let Wbe=Tae;var so;(function(n){n[n.Hidden=0]="Hidden",n[n.Visible=1]="Visible",n[n.Recurse=2]="Recurse"})(so||(so={}));var Up;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Up||(Up={}));var bR;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(bR||(bR={}));var CR;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(CR||(CR={}));class Jd extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class NNe{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function PNe(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function D7(n){switch(n){case!0:return so.Visible;case!1:return so.Hidden;default:return n}}function Vfe(n){return typeof n.collapsible=="boolean"}class $kt{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ole,this._onDidChangeCollapseState=new I,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new I,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new I,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Lu(YQe),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.allowNonCollapsibleParents=s.allowNonCollapsibleParents??!1,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:so.Visible,visible:!0,filterData:void 0}}splice(e,t,i=fi.empty(),s={}){if(e.length===0)throw new Jd(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=fi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],l=t[t.length-1],d=new wy({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,l),...c,...a.children.slice(l+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),u=(m,v,w)=>{if(r>0)for(let b=0;bw.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,fi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=fi.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=fi.map(i,S=>this.createTreeNode(S,a,a.visible?so.Visible:so.Hidden,l,h,s)),f=e[e.length-1];let p=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let C=0;for(const S of b)S.visible&&C++;if(C!==0)for(let S=f+m.length;SM+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,w-S),this.list.splice(c,S,h)}if(b.length>0&&o){const S=M=>{o(M),M.children.forEach(S)};b.forEach(S)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let y=a;for(;y;){if(y.visibility===so.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}y=y.parent}}rerender(e){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{listIndex:i}=this.getTreeNodeWithListIndex(e);this.list.updateElementHeight(i,t)}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!Vfe(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let c=0;c-1){a=-1;break}else a=c;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=r-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(Vfe(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!Vfe(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:so.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,s&&o.push(a);const l=e.children||fi.empty(),d=s&&c!==so.Hidden&&!a.collapsed;let h=0,u=1;for(const f of l){const p=this.createTreeNode(f,a,c,d,o,r);a.children.push(p),u+=p.renderNodeCount,p.visible&&(p.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=c===so.Recurse?h>0:c===so.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,s&&o.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?so.Visible:so.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===so.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==so.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,s&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===so.Recurse?a:o===so.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):so.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?so.Visible:so.Hidden):PNe(i)?(e.filterData=i.data,D7(i.visibility)):(e.filterData=void 0,D7(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Jd(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function zfe(n){return n instanceof vQ?new qkt(n):n}class Qkt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=$.None,this.disposables=new Z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(zfe(e),t)}onDragOver(e,t,i,s,o,r=!0){const a=this.dnd.onDragOver(zfe(e),t&&t.element,i,s,o),c=this.autoExpandNode!==t;if(c&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(c&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=PS(()=>{const f=this.modelProvider(),p=f.getNodeLocation(t);f.isCollapsed(p)&&f.setCollapsed(p,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,p=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:p,feedback:[i]}}return a}if(a.bubble===CR.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),w=m&&f.getListIndex(m);return this.onDragOver(e,v,w,s,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Mg(h,h+u)}}drop(e,t,i,s,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(zfe(e),t&&t.element,i,s,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function jkt(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Qkt(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class FNe{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}class O${static lift(e){return e instanceof O$?e:new O$(e)}static empty(e=0){return new O$({focus:[],selection:[],expanded:Object.create(null),scrollTop:e})}constructor(e){if(this.focus=new Set(e.focus),this.selection=new Set(e.selection),e.expanded instanceof Array){this.expanded=Object.create(null);for(const t of e.expanded)this.expanded[t]=1}else this.expanded=e.expanded;this.expanded=e.expanded,this.scrollTop=e.scrollTop}toJSON(){return{focus:Array.from(this.focus),selection:Array.from(this.selection),expanded:this.expanded,scrollTop:this.scrollTop}}}var rV;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(rV||(rV={}));class Kkt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=T.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Y8=class Y8{constructor(e,t,i,s,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Y8.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=$.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),T.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Dc(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==rV.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new Z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=he(e,we(".monaco-tl-row")),i=he(t,we(".monaco-tl-indent")),s=he(t,we(".monaco-tl-twistie")),o=he(t,we(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:$.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Y8.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...$e.asClassNameArray(Ce.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...$e.asClassNameArray(Ce.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Yo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),c=we(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&c.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(c):t.indent.insertBefore(c,t.indent.firstElementChild),this.renderedIndentGuides.add(a,c),i.add(Ee(()=>this.renderedIndentGuides.delete(a,c))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),St(this.disposables)}};Y8.DefaultIndent=8;let Hbe=Y8;class Ykt{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Z,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=so.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?so.Visible:so.Hidden:PNe(r)?i=D7(r.visibility):i=r,i===so.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:sw.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:sw.Default,visibility:i};let c;if(this.tree.findMatchType===Bb.Contiguous){const l=a.toLowerCase().indexOf(this._lowercasePattern);if(l>-1){c=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)c.push(l+d-1)}}else c=v1(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,o.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===rm.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):so.Recurse:{data:sw.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){St(this.disposables)}}class Jkt extends iD{constructor(e){super({icon:Ce.listFilter,title:g(yR,0,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Xkt extends iD{constructor(e){super({icon:Ce.searchFuzzy,title:g(yR,1,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Zkt={inputBoxStyles:Ckt,toggleStyles:rXe,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var rm;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(rm||(rm={}));var Bb;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Bb||(Bb={}));let eIt=class extends ${set mode(e){this.modeToggle.checked=e===rm.Filter,this.findInput.inputBox.setPlaceHolder(e===rm.Filter?g(yR,2,"Type to filter"):g(yR,3,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===Bb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,s,o,r){super(),this.tree=t,this.elements=di(".monaco-tree-type-filter",[di(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),di(".monaco-tree-type-filter-input@findInput"),di(".monaco-tree-type-filter-actionbar@actionbar")]),this.width=0,this.right=0,this.top=0,this._onDidDisable=new I,this.onDidDisable=this._onDidDisable.event,e.appendChild(this.elements.root),this._register(Ee(()=>e.removeChild(this.elements.root)));const a=r?.styles??Zkt;a.listFilterWidgetBackground&&(this.elements.root.style.backgroundColor=a.listFilterWidgetBackground),a.listFilterWidgetShadow&&(this.elements.root.style.boxShadow=`0 0 8px 2px ${a.listFilterWidgetShadow}`);const c=this._register(C1());this.modeToggle=this._register(new Jkt({...a.toggleStyles,isChecked:s===rm.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new Xkt({...a.toggleStyles,isChecked:o===Bb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=T.map(this.modeToggle.onChange,()=>this.modeToggle.checked?rm.Filter:rm.Highlight,this._store),this.onDidChangeMatchType=T.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?Bb.Fuzzy:Bb.Contiguous,this._store),this.findInput=this._register(new S7(this.elements.findInput,i,{label:g(yR,3,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new Qh(this.elements.actionbar)),this.mode=s;const l=this._register(new oi(this.findInput.inputBox.inputElement,"keydown")),d=T.chain(l.event,p=>p.map(m=>new os(m)));this._register(d(p=>{if(p.equals(E.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(E.DownArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.isAtLastInHistory()||this.findInput.inputBox.isNowhereInHistory()?(this.findInput.inputBox.addToHistory(),this.tree.domFocus()):this.findInput.inputBox.showNextValue();return}if(p.equals(E.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new xn("close",g(yR,4,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new oi(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new oi(gt(p),"mousemove")),w=m.add(new oi(gt(p),"mouseup")),b=this.right,C=p.pageX,y=this.top,S=p.pageY;this.elements.grab.classList.add("grabbing");const M=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=F=>{const N=F.pageX-C;this.right=b-N;const z=F.pageY-S;this.top=y+z,this.layout()};m.add(v.event(k)),m.add(w.event(F=>{k(F),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=M,m.dispose()}))}));const f=T.chain(this._register(new oi(this.elements.grab,"keydown")).event,p=>p.map(m=>new os(m)));this._register(f(p=>{let m,v;if(p.keyCode===E.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===E.RightArrow?m=0:p.keyCode===E.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===E.UpArrow?v=0:p.keyCode===E.DownArrow&&(v=Number.POSITIVE_INFINITY),m!==void 0&&(p.preventDefault(),p.stopPropagation(),this.right=m,this.layout()),v!==void 0){p.preventDefault(),p.stopPropagation(),this.top=v;const w=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=w},0)}})),this.onDidChangeValue=this.findInput.onDidChange}getHistory(){return this.findInput.inputBox.getHistory()}focus(){this.findInput.focus()}select(){this.findInput.select(),this.findInput.inputBox.addToHistory(!0)}layout(e=this.width){this.width=e,this.right=Dc(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Dc(this.top,0,24),this.elements.root.style.top=`${this.top}px`}showMessage(e){this.findInput.showMessage(e)}clearMessage(){this.findInput.clearMessage()}async dispose(){this._onDidDisable.fire(),this.elements.root.classList.add("disabled"),await Ta(300),super.dispose()}},tIt=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.previousPattern="",this.width=0,this._onDidChangeMode=new I,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new I,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new I,this.onDidChangePattern=this._onDidChangePattern.event,this._onDidChangeOpenState=new I,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Z,this.disposables=new Z,this._mode=e.options.defaultFindMode??rm.Highlight,this._matchType=e.options.defaultFindMatchType??Bb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}open(){if(this.widget){this.widget.focus(),this.widget.select();return}this.widget=new eIt(this.view.getHTMLElement(),this.tree,this.contextViewProvider,this.mode,this.matchType,{...this.options,history:this._history}),this.enabledDisposables.add(this.widget),this.widget.onDidChangeValue(this.onDidChangeValue,this,this.enabledDisposables),this.widget.onDidChangeMode(e=>this.mode=e,void 0,this.enabledDisposables),this.widget.onDidChangeMatchType(e=>this.matchType=e,void 0,this.enabledDisposables),this.widget.onDidDisable(this.close,this,this.enabledDisposables),this.widget.layout(this.width),this.widget.focus(),this.widget.value=this.previousPattern,this.widget.select(),this._onDidChangeOpenState.fire(!0)}close(){this.widget&&(this._history=this.widget.getHistory(),this.widget=void 0,this.enabledDisposables.clear(),this.previousPattern=this.pattern,this.onDidChangeValue(""),this.tree.domFocus(),this._onDidChangeOpenState.fire(!1))}onDidChangeValue(e){this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,i=>!sw.isDefault(i.filterData));const t=this.tree.getFocus();if(t.length>0){const i=t[0];this.tree.getRelativeTop(i)===null&&this.tree.reveal(i,.5)}this.render()}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:Yd.WARNING,content:g(yR,5,"No elements found.")}):this.widget?.showMessage({type:Yd.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!sw.isDefault(e.filterData)}layout(e){this.width=e,this.widget?.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function iIt(n,e){return n.position===e.position&&mXe(n,e)}function mXe(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class nIt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ls(this.stickyNodes,e.stickyNodes,iIt)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Ls(this.stickyNodes,e.stickyNodes,mXe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class sIt{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let bUe=class extends ${constructor(e,t,i,s,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new sIt,this._widget=this._register(new oIt(i.getScrollableElement(),i,e,s,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}get count(){return this._widget.count}getNode(e){return this._widget.getNode(e)}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,o=this.getNextStickyNode(i,void 0,s);for(;o&&(t.push(o),s+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,s);const r=this.constrainStickyNodes(t);return r.length?new nIt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),o=t;return this.view.scrollTop===s-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:s,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1c&&t<=c?c-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const o=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),o=i+s-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let o=0;ot.node===e)}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${s.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:c,disposable:l}=this.createElement(a,r,e.count);o[r]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}createElement(e,t,i){const s=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${s}`),o.setAttribute("data-parity",s%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(s));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),c=this.treeRenderers.find(u=>u.templateId===a);if(!c)throw new Error(`No renderer found for template id ${a}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=c.renderTemplate(o);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{r.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return $.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:Au(o),a=Ni(l=>{const d=l.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}getFocus(){return this.stickyScrollFocus.getFocus()}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class rIt extends ${get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new I,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new I,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){this.focusedLast()&&this.view.domFocus();return}if(!Sv(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!w7(t)&&!F$(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=Dc(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=s?s.position+s.height+i.height:i.height;this.view.scrollTop=o-r}getFocus(){if(!(!this.state||this.focusedIndex===-1))return this.state.stickyNodes[this.focusedIndex].node.element}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function QO(n){let e=bR.Unknown;return GY(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=bR.Twistie:GY(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=bR.Element:GY(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=bR.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function aIt(n){const e=w7(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function vJ(n,e){e(n),n.children.forEach(t=>vJ(t,e))}class $fe{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Ls(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const c=this.createNodeSet(),l=d=>c.delete(d);t.forEach(d=>vJ(d,l)),this.set([...c.values()]);return}const i=new Set,s=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>vJ(c,s));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>vJ(c,r));const a=[];for(const c of this.nodes){const l=this.identityProvider.getId(c.element).toString();if(!i.has(l))a.push(c);else{const h=o.get(l);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const c=this.getFirstViewElementWithTrait();c&&a.push(c)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class cIt extends qJe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(zJe(e.browserEvent.target)||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=F$(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||s)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),s){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Jxt(e.browserEvent.target)||Xxt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),o=this.list.getElementTop(s),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onContextMenu(e);return}}}class lIt extends Pc{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new cIt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&s.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),s.length>0&&super.setFocus(Lc([...super.getFocus(),...s])),o.length>0&&super.setSelection(Lc([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var aV;(function(n){n[n.Tree=0]="Tree",n[n.StickyScroll=1]="StickyScroll"})(aV||(aV={}));class _Xe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseClick(){return T.map(this.view.onMouseClick,QO)}get onMouseDblClick(){return T.filter(T.map(this.view.onMouseDblClick,QO),e=>e.target!==bR.Filter)}get onMouseOver(){return T.map(this.view.onMouseOver,QO)}get onMouseOut(){return T.map(this.view.onMouseOut,QO)}get onContextMenu(){return T.any(T.filter(T.map(this.view.onContextMenu,aIt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??T.None)}get onTap(){return T.map(this.view.onTap,QO)}get onPointer(){return T.map(this.view.onPointer,QO)}get onKeyDown(){return this.view.onKeyDown}get onKeyUp(){return this.view.onKeyUp}get onKeyPress(){return this.view.onKeyPress}get onDidFocus(){return this.view.onDidFocus}get onDidBlur(){return this.view.onDidBlur}get onDidChangeModel(){return T.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??rm.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Bb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get onDidChangeFindPattern(){return this.findController?this.findController.onDidChangePattern:T.None}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){this._user=e,this._options=o,this.eventBufferer=new Ole,this.onDidChangeFindOpenState=T.None,this.onDidChangeStickyScrollFocused=T.None,this.disposables=new Z,this._onWillRefilter=new I,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new I,this.onDidUpdateOptions=this._onDidUpdateOptions.event,this.treeDelegate=new FNe(i);const r=new v_e,a=new v_e,c=this.disposables.add(new Kkt(a.event)),l=new Vq;this.renderers=s.map(p=>new Hbe(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Ykt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new $fe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new $fe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new $fe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new lIt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...jkt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=T.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const u=this.disposables.add(new I),f=this.disposables.add(new Lu(0));if(this.disposables.add(T.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);u.fire([...p.values()])})})),a.input=u.event,o.keyboardSupport!==!1){const p=T.chain(this.view.onKeyDown,m=>m.filter(v=>!ux(v.target)).map(v=>new os(v)));T.chain(p,m=>m.filter(v=>v.keyCode===E.LeftArrow))(this.onLeftArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.RightArrow))(this.onRightArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.Space))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new tIt(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=T.None,this.onDidChangeFindMatchType=T.None;o.enableStickyScroll&&(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=od(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=T.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}updateWidth(e){const t=this.model.getListIndex(e);t!==-1&&this.view.updateWidth(t)}getHTMLElement(){return this.view.getHTMLElement()}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollLeft(){return this.view.scrollLeft}set scrollLeft(e){this.view.scrollLeft=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleElement(){let e=this.view.firstVisibleIndex;return this.stickyScrollController&&(e+=this.stickyScrollController.count),e<0||e>=this.view.length?void 0:this.view.element(e).element}get lastVisibleElement(){const e=this.view.lastVisibleIndex;return this.view.element(e).element}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}get selectionSize(){return this.selection.getNodes().length}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}isDOMFocused(){return kw(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),jc(t)&&this.findController?.layout(t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=hS(e.listFocusAndSelectionOutline,hS(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` +`),this.list.style(e)}domFocus(){this.list.domFocus()}setAnchor(e){this.list.setAnchor(e)}getAnchor(){return this.list.getAnchor()}getSelectedElements(){return this.list.getSelectedElements()}setSelection(e,t){this.list.setSelection(e,t)}getSelection(){return this.list.getSelection()}setFocus(e,t){this.list.setFocus(e,t)}focusNext(e=1,t=!1,i){this.list.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.list.focusPrevious(e,t,i)}focusNextPage(e){return this.list.focusNextPage(e)}focusPreviousPage(e){return this.list.focusPreviousPage(e)}focusFirst(e){this.list.focusFirst(e)}focusLast(e){this.list.focusLast(e)}getFocus(){return this.list.getFocus()}getFocusedElements(){return this.list.getFocusedElements()}getRelativeTop(e){return this.list.getRelativeTop(e)}reveal(e,t){this.list.reveal(e,t)}dispose(){this.disposables.dispose()}};Tae.InstanceCount=0;let Wbe=Tae;var so;(function(n){n[n.Hidden=0]="Hidden",n[n.Visible=1]="Visible",n[n.Recurse=2]="Recurse"})(so||(so={}));var Up;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Up||(Up={}));var bR;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(bR||(bR={}));var CR;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(CR||(CR={}));class Jd extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class NNe{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function PNe(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function D7(n){switch(n){case!0:return so.Visible;case!1:return so.Hidden;default:return n}}function Vfe(n){return typeof n.collapsible=="boolean"}class $kt{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ole,this._onDidChangeCollapseState=new I,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new I,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new I,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Lu(YQe),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.allowNonCollapsibleParents=s.allowNonCollapsibleParents??!1,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:so.Visible,visible:!0,filterData:void 0}}splice(e,t,i=fi.empty(),s={}){if(e.length===0)throw new Jd(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=fi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],l=t[t.length-1],d=new wy({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,l),...c,...a.children.slice(l+i)].map(m=>e.getId(m.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),u=(m,v,w)=>{if(r>0)for(let b=0;bw.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,fi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=fi.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=fi.map(i,S=>this.createTreeNode(S,a,a.visible?so.Visible:so.Hidden,l,h,s)),f=e[e.length-1];let p=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let C=0;for(const S of b)S.visible&&C++;if(C!==0)for(let S=f+m.length;SM+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,w-S),this.list.splice(c,S,h)}if(b.length>0&&o){const S=M=>{o(M),M.children.forEach(S)};b.forEach(S)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let y=a;for(;y;){if(y.visibility===so.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}y=y.parent}}rerender(e){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Jd(this.user,"Invalid tree location");const{listIndex:i}=this.getTreeNodeWithListIndex(e);this.list.updateElementHeight(i,t)}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!Vfe(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let c=0;c-1){a=-1;break}else a=c;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=r-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(Vfe(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!Vfe(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:so.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,s&&o.push(a);const l=e.children||fi.empty(),d=s&&c!==so.Hidden&&!a.collapsed;let h=0,u=1;for(const f of l){const p=this.createTreeNode(f,a,c,d,o,r);a.children.push(p),u+=p.renderNodeCount,p.visible&&(p.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=c===so.Recurse?h>0:c===so.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,s&&o.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?so.Visible:so.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===so.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==so.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,s&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===so.Recurse?a:o===so.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):so.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?so.Visible:so.Hidden):PNe(i)?(e.filterData=i.data,D7(i.visibility)):(e.filterData=void 0,D7(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Jd(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Jd(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function zfe(n){return n instanceof vQ?new qkt(n):n}class Qkt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=$.None,this.disposables=new Z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(zfe(e),t)}onDragOver(e,t,i,s,o,r=!0){const a=this.dnd.onDragOver(zfe(e),t&&t.element,i,s,o),c=this.autoExpandNode!==t;if(c&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(c&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=PS(()=>{const f=this.modelProvider(),p=f.getNodeLocation(t);f.isCollapsed(p)&&f.setCollapsed(p,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,p=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:p,feedback:[i]}}return a}if(a.bubble===CR.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),w=m&&f.getListIndex(m);return this.onDragOver(e,v,w,s,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Mg(h,h+u)}}drop(e,t,i,s,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(zfe(e),t&&t.element,i,s,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function jkt(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Qkt(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class FNe{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}class O${static lift(e){return e instanceof O$?e:new O$(e)}static empty(e=0){return new O$({focus:[],selection:[],expanded:Object.create(null),scrollTop:e})}constructor(e){if(this.focus=new Set(e.focus),this.selection=new Set(e.selection),e.expanded instanceof Array){this.expanded=Object.create(null);for(const t of e.expanded)this.expanded[t]=1}else this.expanded=e.expanded;this.expanded=e.expanded,this.scrollTop=e.scrollTop}toJSON(){return{focus:Array.from(this.focus),selection:Array.from(this.selection),expanded:this.expanded,scrollTop:this.scrollTop}}}var rV;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(rV||(rV={}));class Kkt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=T.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Y8=class Y8{constructor(e,t,i,s,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Y8.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=$.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),T.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Dc(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==rV.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new Z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=he(e,we(".monaco-tl-row")),i=he(t,we(".monaco-tl-indent")),s=he(t,we(".monaco-tl-twistie")),o=he(t,we(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:$.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Y8.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...$e.asClassNameArray(Ce.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...$e.asClassNameArray(Ce.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Yo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),c=we(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&c.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(c):t.indent.insertBefore(c,t.indent.firstElementChild),this.renderedIndentGuides.add(a,c),i.add(Ee(()=>this.renderedIndentGuides.delete(a,c))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),St(this.disposables)}};Y8.DefaultIndent=8;let Hbe=Y8;class Ykt{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Z,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=so.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?so.Visible:so.Hidden:PNe(r)?i=D7(r.visibility):i=r,i===so.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:sw.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:sw.Default,visibility:i};let c;if(this.tree.findMatchType===Bb.Contiguous){const l=a.toLowerCase().indexOf(this._lowercasePattern);if(l>-1){c=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)c.push(l+d-1)}}else c=v1(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,o.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===rm.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):so.Recurse:{data:sw.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){St(this.disposables)}}class Jkt extends iD{constructor(e){super({icon:Ce.listFilter,title:g(yR,0,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Xkt extends iD{constructor(e){super({icon:Ce.searchFuzzy,title:g(yR,1,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Zkt={inputBoxStyles:Ckt,toggleStyles:rXe,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var rm;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(rm||(rm={}));var Bb;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Bb||(Bb={}));let eIt=class extends ${set mode(e){this.modeToggle.checked=e===rm.Filter,this.findInput.inputBox.setPlaceHolder(e===rm.Filter?g(yR,2,"Type to filter"):g(yR,3,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===Bb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,s,o,r){super(),this.tree=t,this.elements=di(".monaco-tree-type-filter",[di(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),di(".monaco-tree-type-filter-input@findInput"),di(".monaco-tree-type-filter-actionbar@actionbar")]),this.width=0,this.right=0,this.top=0,this._onDidDisable=new I,this.onDidDisable=this._onDidDisable.event,e.appendChild(this.elements.root),this._register(Ee(()=>e.removeChild(this.elements.root)));const a=r?.styles??Zkt;a.listFilterWidgetBackground&&(this.elements.root.style.backgroundColor=a.listFilterWidgetBackground),a.listFilterWidgetShadow&&(this.elements.root.style.boxShadow=`0 0 8px 2px ${a.listFilterWidgetShadow}`);const c=this._register(C1());this.modeToggle=this._register(new Jkt({...a.toggleStyles,isChecked:s===rm.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new Xkt({...a.toggleStyles,isChecked:o===Bb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=T.map(this.modeToggle.onChange,()=>this.modeToggle.checked?rm.Filter:rm.Highlight,this._store),this.onDidChangeMatchType=T.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?Bb.Fuzzy:Bb.Contiguous,this._store),this.findInput=this._register(new S7(this.elements.findInput,i,{label:g(yR,3,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new Qh(this.elements.actionbar)),this.mode=s;const l=this._register(new oi(this.findInput.inputBox.inputElement,"keydown")),d=T.chain(l.event,p=>p.map(m=>new os(m)));this._register(d(p=>{if(p.equals(E.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(E.DownArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.isAtLastInHistory()||this.findInput.inputBox.isNowhereInHistory()?(this.findInput.inputBox.addToHistory(),this.tree.domFocus()):this.findInput.inputBox.showNextValue();return}if(p.equals(E.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new xn("close",g(yR,4,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new oi(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new oi(gt(p),"mousemove")),w=m.add(new oi(gt(p),"mouseup")),b=this.right,C=p.pageX,y=this.top,S=p.pageY;this.elements.grab.classList.add("grabbing");const M=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=F=>{const N=F.pageX-C;this.right=b-N;const z=F.pageY-S;this.top=y+z,this.layout()};m.add(v.event(k)),m.add(w.event(F=>{k(F),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=M,m.dispose()}))}));const f=T.chain(this._register(new oi(this.elements.grab,"keydown")).event,p=>p.map(m=>new os(m)));this._register(f(p=>{let m,v;if(p.keyCode===E.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===E.RightArrow?m=0:p.keyCode===E.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===E.UpArrow?v=0:p.keyCode===E.DownArrow&&(v=Number.POSITIVE_INFINITY),m!==void 0&&(p.preventDefault(),p.stopPropagation(),this.right=m,this.layout()),v!==void 0){p.preventDefault(),p.stopPropagation(),this.top=v;const w=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=w},0)}})),this.onDidChangeValue=this.findInput.onDidChange}getHistory(){return this.findInput.inputBox.getHistory()}focus(){this.findInput.focus()}select(){this.findInput.select(),this.findInput.inputBox.addToHistory(!0)}layout(e=this.width){this.width=e,this.right=Dc(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Dc(this.top,0,24),this.elements.root.style.top=`${this.top}px`}showMessage(e){this.findInput.showMessage(e)}clearMessage(){this.findInput.clearMessage()}async dispose(){this._onDidDisable.fire(),this.elements.root.classList.add("disabled"),await Ta(300),super.dispose()}},tIt=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.previousPattern="",this.width=0,this._onDidChangeMode=new I,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new I,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new I,this.onDidChangePattern=this._onDidChangePattern.event,this._onDidChangeOpenState=new I,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Z,this.disposables=new Z,this._mode=e.options.defaultFindMode??rm.Highlight,this._matchType=e.options.defaultFindMatchType??Bb.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}open(){if(this.widget){this.widget.focus(),this.widget.select();return}this.widget=new eIt(this.view.getHTMLElement(),this.tree,this.contextViewProvider,this.mode,this.matchType,{...this.options,history:this._history}),this.enabledDisposables.add(this.widget),this.widget.onDidChangeValue(this.onDidChangeValue,this,this.enabledDisposables),this.widget.onDidChangeMode(e=>this.mode=e,void 0,this.enabledDisposables),this.widget.onDidChangeMatchType(e=>this.matchType=e,void 0,this.enabledDisposables),this.widget.onDidDisable(this.close,this,this.enabledDisposables),this.widget.layout(this.width),this.widget.focus(),this.widget.value=this.previousPattern,this.widget.select(),this._onDidChangeOpenState.fire(!0)}close(){this.widget&&(this._history=this.widget.getHistory(),this.widget=void 0,this.enabledDisposables.clear(),this.previousPattern=this.pattern,this.onDidChangeValue(""),this.tree.domFocus(),this._onDidChangeOpenState.fire(!1))}onDidChangeValue(e){this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,i=>!sw.isDefault(i.filterData));const t=this.tree.getFocus();if(t.length>0){const i=t[0];this.tree.getRelativeTop(i)===null&&this.tree.reveal(i,.5)}this.render()}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:Yd.WARNING,content:g(yR,5,"No elements found.")}):this.widget?.showMessage({type:Yd.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!sw.isDefault(e.filterData)}layout(e){this.width=e,this.widget?.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function iIt(n,e){return n.position===e.position&&mXe(n,e)}function mXe(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class nIt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ls(this.stickyNodes,e.stickyNodes,iIt)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Ls(this.stickyNodes,e.stickyNodes,mXe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class sIt{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let bUe=class extends ${constructor(e,t,i,s,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new sIt,this._widget=this._register(new oIt(i.getScrollableElement(),i,e,s,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}get count(){return this._widget.count}getNode(e){return this._widget.getNode(e)}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,o=this.getNextStickyNode(i,void 0,s);for(;o&&(t.push(o),s+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,s);const r=this.constrainStickyNodes(t);return r.length?new nIt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),o=t;return this.view.scrollTop===s-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:s,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1c&&t<=c?c-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const o=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),o=i+s-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let o=0;ot.node===e)}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${s.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:c,disposable:l}=this.createElement(a,r,e.count);o[r]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}createElement(e,t,i){const s=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${s}`),o.setAttribute("data-parity",s%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(s));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),c=this.treeRenderers.find(u=>u.templateId===a);if(!c)throw new Error(`No renderer found for template id ${a}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=c.renderTemplate(o);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{r.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return $.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:Au(o),a=Ni(l=>{const d=l.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}getFocus(){return this.stickyScrollFocus.getFocus()}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class rIt extends ${get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new I,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new I,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){this.focusedLast()&&this.view.domFocus();return}if(!Sv(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!w7(t)&&!F$(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=Dc(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=s?s.position+s.height+i.height:i.height;this.view.scrollTop=o-r}getFocus(){if(!(!this.state||this.focusedIndex===-1))return this.state.stickyNodes[this.focusedIndex].node.element}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function QO(n){let e=bR.Unknown;return GY(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=bR.Twistie:GY(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=bR.Element:GY(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=bR.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function aIt(n){const e=w7(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function vJ(n,e){e(n),n.children.forEach(t=>vJ(t,e))}class $fe{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Ls(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const c=this.createNodeSet(),l=d=>c.delete(d);t.forEach(d=>vJ(d,l)),this.set([...c.values()]);return}const i=new Set,s=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>vJ(c,s));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>vJ(c,r));const a=[];for(const c of this.nodes){const l=this.identityProvider.getId(c.element).toString();if(!i.has(l))a.push(c);else{const h=o.get(l);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const c=this.getFirstViewElementWithTrait();c&&a.push(c)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class cIt extends qJe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(zJe(e.browserEvent.target)||ux(e.browserEvent.target)||y3(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=F$(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||s)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),s){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Jxt(e.browserEvent.target)||Xxt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),o=this.list.getElementTop(s),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!w7(t)&&!F$(t)){super.onContextMenu(e);return}}}class lIt extends Pc{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new cIt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&s.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),s.length>0&&super.setFocus(Lc([...super.getFocus(),...s])),o.length>0&&super.setSelection(Lc([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var aV;(function(n){n[n.Tree=0]="Tree",n[n.StickyScroll=1]="StickyScroll"})(aV||(aV={}));class _Xe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseClick(){return T.map(this.view.onMouseClick,QO)}get onMouseDblClick(){return T.filter(T.map(this.view.onMouseDblClick,QO),e=>e.target!==bR.Filter)}get onMouseOver(){return T.map(this.view.onMouseOver,QO)}get onMouseOut(){return T.map(this.view.onMouseOut,QO)}get onContextMenu(){return T.any(T.filter(T.map(this.view.onContextMenu,aIt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??T.None)}get onTap(){return T.map(this.view.onTap,QO)}get onPointer(){return T.map(this.view.onPointer,QO)}get onKeyDown(){return this.view.onKeyDown}get onKeyUp(){return this.view.onKeyUp}get onKeyPress(){return this.view.onKeyPress}get onDidFocus(){return this.view.onDidFocus}get onDidBlur(){return this.view.onDidBlur}get onDidChangeModel(){return T.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??rm.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Bb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get onDidChangeFindPattern(){return this.findController?this.findController.onDidChangePattern:T.None}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){this._user=e,this._options=o,this.eventBufferer=new Ole,this.onDidChangeFindOpenState=T.None,this.onDidChangeStickyScrollFocused=T.None,this.disposables=new Z,this._onWillRefilter=new I,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new I,this.onDidUpdateOptions=this._onDidUpdateOptions.event,this.treeDelegate=new FNe(i);const r=new v_e,a=new v_e,c=this.disposables.add(new Kkt(a.event)),l=new Vq;this.renderers=s.map(p=>new Hbe(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Ykt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new $fe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new $fe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new $fe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new lIt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...jkt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=T.forEach(this.model.onDidSplice,p=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(p),this.selection.onDidModelSplice(p)})},this.disposables);h(()=>null,null,this.disposables);const u=this.disposables.add(new I),f=this.disposables.add(new Lu(0));if(this.disposables.add(T.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const p=new Set;for(const m of this.focus.getNodes())p.add(m);for(const m of this.selection.getNodes())p.add(m);u.fire([...p.values()])})})),a.input=u.event,o.keyboardSupport!==!1){const p=T.chain(this.view.onKeyDown,m=>m.filter(v=>!ux(v.target)).map(v=>new os(v)));T.chain(p,m=>m.filter(v=>v.keyCode===E.LeftArrow))(this.onLeftArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.RightArrow))(this.onRightArrow,this,this.disposables),T.chain(p,m=>m.filter(v=>v.keyCode===E.Space))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new tIt(this,this.model,this.view,d,o.contextViewProvider,p),this.focusNavigationFilter=m=>this.findController.shouldAllowFocus(m),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=T.None,this.onDidChangeFindMatchType=T.None;o.enableStickyScroll&&(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=od(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===rV.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new bUe(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=T.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}updateWidth(e){const t=this.model.getListIndex(e);t!==-1&&this.view.updateWidth(t)}getHTMLElement(){return this.view.getHTMLElement()}get contentHeight(){return this.view.contentHeight}get contentWidth(){return this.view.contentWidth}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.view.onDidChangeContentWidth}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollLeft(){return this.view.scrollLeft}set scrollLeft(e){this.view.scrollLeft=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleElement(){let e=this.view.firstVisibleIndex;return this.stickyScrollController&&(e+=this.stickyScrollController.count),e<0||e>=this.view.length?void 0:this.view.element(e).element}get lastVisibleElement(){const e=this.view.lastVisibleIndex;return this.view.element(e).element}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}get selectionSize(){return this.selection.getNodes().length}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}isDOMFocused(){return kw(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),Kc(t)&&this.findController?.layout(t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=hS(e.listFocusAndSelectionOutline,hS(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` `),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}expandAll(){this.model.setCollapsed(this.model.rootRef,!1,!0)}collapseAll(){this.model.setCollapsed(this.model.rootRef,!0,!0)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}expandTo(e){this.model.expandTo(e)}triggerTypeNavigation(){this.view.triggerTypeNavigation()}openFind(){this.findController?.open()}closeFind(){this.findController?.close()}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setAnchor(e){if(typeof e>"u")return this.view.setAnchor(void 0);this.eventBufferer.bufferEvents(()=>{const t=this.model.getNode(e);this.anchor.set([t]);const i=this.model.getListIndex(e);i>-1&&this.view.setAnchor(i,!0)})}getAnchor(){return k_(this.anchor.get(),void 0)}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)})}focusNext(e=1,t=!1,i,s=Sv(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}focusPrevious(e=1,t=!1,i,s=Sv(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,s)}focusNextPage(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Sv(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}getStickyScrollFocus(){const e=this.stickyScrollController?.getFocus();return e!==void 0?[e]:[]}getFocusedPart(){return this.stickyScrollController?.focusedLast()?aV.StickyScroll:aV.Tree}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const s=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,s)}}getRelativeTop(e){const t=this.model.getListIndex(e);if(t===-1)return null;const i=this.stickyScrollController?.getNode(this.getNode(e));return this.view.getRelativeTop(t,i?.position??this.stickyScrollController?.height)}getViewState(e=this.options.identityProvider){if(!e)throw new Jd(this._user,"Can't get tree view state without an identity provider");const t=r=>e.getId(r).toString(),i=O$.empty(this.scrollTop);for(const r of this.getFocus())i.focus.add(t(r));for(const r of this.getSelection())i.selection.add(t(r));const s=this.model.getNode(),o=[s];for(;o.length>0;){const r=o.shift();r!==s&&r.collapsible&&(i.expanded[t(r.element)]=r.collapsed?0:1),o.push(...r.children)}return i}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(c=>c.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}navigate(e){return new dIt(this.view,this.model,e)}dispose(){St(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class dIt{constructor(e,t,i){this.view=e,this.model=t,i?this.index=this.model.getListIndex(i):this.index=-1}current(){return this.index<0||this.index>=this.view.length?null:this.view.element(this.index).element}previous(){return this.index--,this.current()}next(){return this.index++,this.current()}first(){return this.index=0,this.current()}last(){return this.index=this.view.length-1,this.current()}}class ONe{get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new $kt(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=fi.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=fi.empty(),i){const s=new Set,o=new Set,r=c=>{if(c.element===null)return;const l=c;if(s.add(l.element),this.nodes.set(l.element,l),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.add(d),this.nodesByIdentity.set(d,l)}i.onDidCreateNode?.(l)},a=c=>{if(c.element===null)return;const l=c;if(s.has(l.element)||this.nodes.delete(l.element),this.identityProvider){const d=this.identityProvider.getId(l.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(l)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=fi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),fi.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Up.Collapsed||t.collapsed===Up.PreserveOrCollapsed?r=!0:t.collapsed===Up.Expanded||t.collapsed===Up.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Up.PreserveOrCollapsed||t.collapsed===Up.PreserveOrExpanded?o=i.collapsed:t.collapsed===Up.Collapsed?o=!0:t.collapsed===Up.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getElementLocation(e);this.model.updateElementHeight(i,t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),s=this.model.getNode(i);this._setChildren(i,this.resortChildren(s,t),{})}resortChildren(e,t,i=!0){let s=[...e.children];return(t||i)&&(s=s.sort(this.sorter.compare.bind(this.sorter))),fi.map(s,o=>({element:o.element,collapsible:o.collapsible,collapsed:o.collapsed,children:this.resortChildren(o,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e=null){const t=this.getElementLocation(e);return this.model.getLastElementAncestor(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Jd(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function wJ(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:fi.map(fi.from(n.children),wJ),collapsible:n.collapsible,collapsed:n.collapsed}}function bJ(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=fi.consume(fi.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:fi.map(fi.concat(s,i),bJ),collapsible:n.collapsible,collapsed:n.collapsed}}function Ube(n,e=0){let t;return eUbe(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function CUe(n){return Ube(n,0)}function vXe(n,e,t){return n.element===e?{...n,children:t}:{...n,children:fi.map(fi.from(n.children),i=>vXe(i,e,t))}}const hIt=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class uIt{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get size(){return this.nodes.size}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ONe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=fi.empty(),i){const s=i.diffIdentityProvider&&hIt(i.diffIdentityProvider);if(e===null){const p=fi.map(t,this.enabled?bJ:wJ);this._setChildren(null,p,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Jd(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),l=CUe(r),d=vXe(l,e,t),h=(this.enabled?bJ:wJ)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(Ls(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||fi.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=c.children.map(p=>p===r?h:p);this._setChildren(c.element,f,{diffIdentityProvider:s,diffDepth:r.depth-c.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=fi.map(i,CUe),o=fi.map(s,e?bJ:wJ);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const c of a.element.elements)s.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)s.has(c)||this.nodes.delete(c)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}getLastElementAncestor(e){const t=typeof e>"u"?void 0:this.getCompressedNode(e);return this.model.getLastElementAncestor(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}updateElementHeight(e,t){const i=this.getCompressedNode(e);i&&this.model.updateElementHeight(i,t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Jd(this.user,`Tree element not found: ${e}`);return t}}const gIt=n=>n[n.length-1];class BNe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new BNe(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function fIt(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function pIt(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}}}class mIt{get onDidSplice(){return T.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return T.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return T.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||gIt;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new NNe(o=>new BNe(s,o)),this.model=new uIt(e,fIt(this.nodeMapper,t),pIt(s,i))}setChildren(e,t=fi.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}getLastElementAncestor(e){const t=this.model.getLastElementAncestor(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class WNe extends _Xe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=fi.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}updateElementHeight(e,t){this.model.updateElementHeight(e,t)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new ONe(e,t,i)}}class Vbe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,s):this.renderer.disposeElement?.(e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}Vbe.__decorator=D([ii],Vbe.prototype,"compressedTreeNodeProvider",null);class _It{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let s=0;si||s>=t-1&&tthis,a=new _It(()=>this.model),c=s.map(l=>new Vbe(r,a,l));super(e,t,i,c,{...vIt(r,o),stickyScrollDelegate:a})}setChildren(e,t=fi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new mIt(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function Gfe(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function zbe(n,e){return e.parent?e.parent===n?!0:zbe(n,e.parent):!1}function wIt(n,e){return n===e||zbe(n,e)||zbe(e,n)}class HNe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new HNe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class bIt{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(Ce.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(Ce.treeItemLoading)),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function yUe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function lK(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}function CIt(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,anchor:n.anchor,isStickyScroll:n.isStickyScroll}}class yIt extends vQ{set context(e){this.data.context=e}get context(){return this.data.context}constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function qfe(n){return n instanceof vQ?new yIt(n):n}class SIt{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(qfe(e),t)}onDragOver(e,t,i,s,o,r=!0){return this.dnd.onDragOver(qfe(e),t&&t.element,i,s,o)}drop(e,t,i,s,o){this.dnd.drop(qfe(e),t&&t.element,i,s,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function bXe(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new SIt(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>!!n.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?so.Visible:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?so.Recurse:n.defaultFindVisibility(e.element)}}function $be(n,e){e(n),n.children.forEach(t=>$be(t,e))}class CXe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return T.map(this.tree.onDidChangeFocus,yUe)}get onDidChangeSelection(){return T.map(this.tree.onDidChangeSelection,yUe)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return T.map(this.tree.onMouseClick,lK)}get onMouseDblClick(){return T.map(this.tree.onMouseDblClick,lK)}get onContextMenu(){return T.map(this.tree.onContextMenu,CIt)}get onTap(){return T.map(this.tree.onTap,lK)}get onPointer(){return T.map(this.tree.onPointer,lK)}get onDidFocus(){return this.tree.onDidFocus}get onDidBlur(){return this.tree.onDidBlur}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidUpdateOptions(){return this.tree.onDidUpdateOptions}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get findMode(){return this.tree.findMode}set findMode(e){this.tree.findMode=e}get findMatchType(){return this.tree.findMatchType}set findMatchType(e){this.tree.findMatchType=e}get expandOnlyOnTwistieClick(){if(typeof this.tree.expandOnlyOnTwistieClick=="boolean")return this.tree.expandOnlyOnTwistieClick;const e=this.tree.expandOnlyOnTwistieClick;return t=>e(this.nodes.get(t===this.root.element?null:t)||null)}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new I,this._onDidChangeNodeSlowState=new I,this.nodeMapper=new NNe(a=>new HNe(a)),this.disposables=new Z,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?Up.PreserveOrCollapsed:Up.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=Gfe({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new FNe(i),a=s.map(l=>new bIt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=bXe(o)||{};return new WNe(e,t,r,a,c)}updateOptions(e={}){this.tree.updateOptions(e)}get options(){return this.tree.options}getHTMLElement(){return this.tree.getHTMLElement()}get contentHeight(){return this.tree.contentHeight}get contentWidth(){return this.tree.contentWidth}get onDidChangeContentHeight(){return this.tree.onDidChangeContentHeight}get onDidChangeContentWidth(){return this.tree.onDidChangeContentWidth}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollLeft(){return this.tree.scrollLeft}set scrollLeft(e){this.tree.scrollLeft=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}get lastVisibleElement(){return this.tree.lastVisibleElement.element}get ariaLabel(){return this.tree.ariaLabel}set ariaLabel(e){this.tree.ariaLabel=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async updateChildren(e=this.root.element,t=!0,i=!1,s){await this._updateChildren(e,t,i,void 0,s)}async _updateChildren(e=this.root.element,t=!0,i=!1,s,o){if(typeof this.root.element>"u")throw new Jd(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}}resort(e=this.root.element,t=!0){this.tree.resort(this.getDataNode(e),t)}hasElement(e){return this.tree.hasElement(this.getDataNode(e))}hasNode(e){return e===this.root.element||this.nodes.has(e)}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}updateElementHeight(e,t){const i=this.getDataNode(e);this.tree.updateElementHeight(i,t)}updateWidth(e){const t=this.getDataNode(e);this.tree.updateWidth(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Jd(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await T.toPromise(this._onDidRender.event)),s}toggleCollapsed(e,t=!1){return this.tree.toggleCollapsed(this.getDataNode(e),t)}expandAll(){this.tree.expandAll()}async expandTo(e){if(!this.dataSource.getParent)throw new Error("Can't expand to element without getParent method");const t=[];for(;!this.hasNode(e);)e=this.dataSource.getParent(e),e!==this.root.element&&t.push(e);for(const i of fi.reverse(t))await this.expand(i);this.tree.expandTo(this.getDataNode(e))}collapseAll(){this.tree.collapseAll()}isCollapsible(e){return this.tree.isCollapsible(this.getDataNode(e))}isCollapsed(e){return this.tree.isCollapsed(this.getDataNode(e))}triggerTypeNavigation(){this.tree.triggerTypeNavigation()}openFind(){this.tree.openFind()}closeFind(){this.tree.closeFind()}refilter(){this.tree.refilter()}setAnchor(e){this.tree.setAnchor(typeof e>"u"?void 0:this.getDataNode(e))}getAnchor(){return this.tree.getAnchor()?.element}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}focusNext(e=1,t=!1,i){this.tree.focusNext(e,t,i)}focusPrevious(e=1,t=!1,i){this.tree.focusPrevious(e,t,i)}focusNextPage(e){return this.tree.focusNextPage(e)}focusPreviousPage(e){return this.tree.focusPreviousPage(e)}focusLast(e){this.tree.focusLast(e)}focusFirst(e){this.tree.focusFirst(e)}getFocus(){return this.tree.getFocus().map(t=>t.element)}getStickyScrollFocus(){return this.tree.getStickyScrollFocus().map(t=>t.element)}getFocusedPart(){return this.tree.getFocusedPart()}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getRelativeTop(e){return this.tree.getRelativeTop(this.getDataNode(e))}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Jd(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,s){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,s)}async refreshNode(e,t,i){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&wIt(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await ko.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(fi.empty());else{const o=this.doGetChildren(e);if(BBe(o))s=Promise.resolve(o);else{const r=Ta(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=await s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Na(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return BBe(i)?this.processChildren(i):(t=na(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(bt))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const c=[],l=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=Gfe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Up.PreserveOrExpanded&&c.push(m),m}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=h,i?f.collapsed?(m.children.forEach(v=>$be(v,w=>this.nodes.delete(w.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&!f.collapsed&&c.push(m),m}const p=Gfe({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return s&&s.viewState.focus&&s.viewState.focus.indexOf(u)>-1&&s.focus.push(p),s&&s.viewState.selection&&s.viewState.selection.indexOf(u)>-1&&s.selection.push(p),(s&&s.viewState.expanded&&s.viewState.expanded.indexOf(u)>-1||h&&p.defaultCollapseState===Up.PreserveOrExpanded)&&c.push(p),p});for(const d of r.values())$be(d,h=>this.nodes.delete(h.element));for(const d of l)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&l.length===1&&c.length===0&&(l[0].forceExpanded=!0,c.push(l[0])),c}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?fi.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}getViewState(){if(!this.identityProvider)throw new Jd(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),s=[],o=this.tree.getNode(),r=[o];for(;r.length>0;){const a=r.pop();a!==o&&a.collapsible&&!a.collapsed&&s.push(e(a.element.element)),r.push(...a.children)}return{focus:t,selection:i,expanded:s,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class UNe{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new UNe(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class AIt{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(Ce.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(Ce.treeItemLoading)),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=St(this.disposables)}}function EIt(n){const e=n&&bXe(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class xIt extends CXe{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new NNe(c=>new UNe(c)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new FNe(i),a=s.map(l=>new AIt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=EIt(o)||{};return new wXe(e,t,r,a,c)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}getViewState(){if(!this.identityProvider)throw new Jd(this.user,"Can't get tree view state without an identity provider");const e=a=>this.identityProvider.getId(a).toString(),t=this.getFocus().map(e),i=this.getSelection().map(e),s=[],o=this.tree.getCompressedTreeNode(),r=[o];for(;r.length>0;){const a=r.pop();if(a!==o&&a.collapsible&&!a.collapsed)for(const c of a.element.elements)s.push(e(c.element));r.push(...a.children)}return{focus:t,selection:i,expanded:s,scrollTop:this.scrollTop}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const s=f=>this.identityProvider.getId(f).toString(),o=f=>{const p=new Set;for(const m of f){const v=this.tree.getCompressedTreeNode(m===this.root?null:m);if(v.element)for(const w of v.element.elements)p.add(s(w.element))}return p},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const c=this.getSelection();let l=!1;const d=this.getFocus();let h=!1;const u=f=>{const p=f.element;if(p)for(let m=0;m{const i=this.filter.filter(t,so.Visible),s=DIt(i);if(s===so.Recurse)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===so.Visible})),super.processChildren(e)}}function DIt(n){return typeof n=="boolean"?n?so.Visible:so.Hidden:PNe(n)?D7(n.visibility):D7(n)}class kIt extends _Xe{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.nodesByIdentity=new Map,this.identityProvider=r.identityProvider}getInput(){return this.input}setInput(e,t){if(t&&!this.identityProvider)throw new Jd(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,fi.empty());return}if(!t){this._refresh(e);return}const i=[],s=[],o=a=>{const c=this.identityProvider.getId(a).toString();return!t.expanded[c]},r=a=>{const c=this.identityProvider.getId(a.element).toString();t.focus.has(c)&&i.push(a.element),t.selection.has(c)&&s.push(a.element)};this._refresh(e,o,r),this.setFocus(i),this.setSelection(s),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}updateChildren(e=this.input){if(typeof this.input>"u")throw new Jd(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const s=this.identityProvider.getId(i).toString(),o=this.nodesByIdentity.get(s);if(o)return o.collapsed}),this._refresh(e,t)}resort(e=this.input,t=!0){this.model.resort(e===this.input?null:e,t)}refresh(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}_refresh(e,t,i){let s;if(this.identityProvider){const o=new Set,r=i;i=a=>{const c=this.identityProvider.getId(a.element).toString();o.add(c),this.nodesByIdentity.set(c,a),r?.(a)},s=a=>{const c=this.identityProvider.getId(a.element).toString();o.has(c)||this.nodesByIdentity.delete(c)}}this.model.setChildren(e===this.input?null:e,this.iterate(e,t).elements,{onDidCreateNode:i,onDidDeleteNode:s})}iterate(e,t){const i=[...this.dataSource.getChildren(e)];return{elements:fi.map(i,o=>{const{elements:r,size:a}=this.iterate(o,t),c=this.dataSource.hasChildren?this.dataSource.hasChildren(o):void 0,l=a===0?void 0:t&&t(o);return{element:o,children:r,collapsible:c,collapsed:l}}),size:i.length}}createModel(e,t,i){return new ONe(e,t,i)}}const nD="vs/platform/contextkey/common/contextkeys";new Y("isMac",ei,g(nD,0,"Whether the operating system is macOS"));new Y("isLinux",jr,g(nD,1,"Whether the operating system is Linux"));const Ide=new Y("isWindows",Is,g(nD,2,"Whether the operating system is Windows")),yXe=new Y("isWeb",Jn,g(nD,3,"Whether the platform is a web browser"));new Y("isMacNative",ei&&!Jn,g(nD,4,"Whether the operating system is macOS on a non-browser platform"));new Y("isIOS",I_,g(nD,5,"Whether the operating system is iOS"));new Y("isMobile",sQe,g(nD,6,"Whether the platform is a mobile web browser"));new Y("isDevelopment",!1,!0);new Y("productQualityType","",g(nD,7,"Quality type of VS Code"));const Lde="inputFocus",SXe=new Y(Lde,!1,g(nD,8,"Whether keyboard focus is inside an input box")),yf=ae("listService"),ic="vs/platform/list/browser/listService";class IIt{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Z,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new QJe(od(),"").style(bO)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),kw(e.getHTMLElement())&&this.setLastFocusedList(e),pa(e.onDidFocus(()=>this.setLastFocusedList(e)),Ee(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const k7=new Y("listScrollAtBoundary","none"),LIt=ge.or(k7.isEqualTo("top"),k7.isEqualTo("both")),TIt=ge.or(k7.isEqualTo("bottom"),k7.isEqualTo("both")),AXe=new Y("listFocus",!0),EXe=new Y("treestickyScrollFocused",!1),Tde=new Y("listSupportsMultiselect",!0),Rde=ge.and(AXe,ge.not(Lde),EXe.negate()),VNe=new Y("listHasSelectionOrFocus",!1),zNe=new Y("listDoubleSelection",!1),$Ne=new Y("listMultiSelection",!1),Mde=new Y("listSelectionNavigation",!1),RIt=new Y("listSupportsFind",!0),GNe=new Y("treeElementCanCollapse",!1),MIt=new Y("treeElementHasParent",!1),qNe=new Y("treeElementCanExpand",!1),NIt=new Y("treeElementHasChild",!1),PIt=new Y("treeFindOpen",!1),xXe="listTypeNavigationMode",DXe="listAutomaticKeyboardNavigation";function Nde(n,e){const t=n.createScoped(e.getHTMLElement());return AXe.bindTo(t),t}function Pde(n,e){const t=k7.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const SO="workbench.list.multiSelectModifier",CJ="workbench.list.openMode",y_="workbench.list.horizontalScrolling",QNe="workbench.list.defaultFindMode",jNe="workbench.list.typeNavigationMode",Tee="workbench.list.keyboardNavigation",tC="workbench.list.scrollByPage",KNe="workbench.list.defaultFindMatchType",I7="workbench.tree.indent",Ree="workbench.tree.renderIndentGuides",iC="workbench.list.smoothScrolling",HS="workbench.list.mouseWheelScrollSensitivity",US="workbench.list.fastScrollSensitivity",Mee="workbench.tree.expandMode",Nee="workbench.tree.enableStickyScroll",Pee="workbench.tree.stickyScrollMaxItemCount";function VS(n){return n.getValue(SO)==="alt"}class FIt extends ${constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=VS(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(SO)&&(this.useAltAsMultipleSelectionModifier=VS(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:$Je(e)}isSelectionRangeChangeEvent(e){return GJe(e)}}function Fde(n,e){const t=n.get(Re),i=n.get(ti),s=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(iC),mouseWheelScrollSensitivity:t.getValue(HS),fastScrollSensitivity:t.getValue(US),multipleSelectionController:e.multipleSelectionController??s.add(new FIt(t)),keyboardNavigationEventFilter:WIt(i),scrollByPage:!!t.getValue(tC)},s]}let Gbe=class extends Pc{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(y_),[h,u]=l.invokeFunction(Fde,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Nde(r,this),this.disposables.add(Pde(this.contextKeyService,this)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=VNe.bindTo(this.contextKeyService),this.listDoubleSelection=zNe.bindTo(this.contextKeyService),this.listMultiSelection=$Ne.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=VS(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(c));let m={};if(p.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const v=!!c.getValue(y_);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(tC)){const v=!!c.getValue(tC);m={...m,scrollByPage:v}}if(p.affectsConfiguration(iC)){const v=!!c.getValue(iC);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(HS)){const v=c.getValue(HS);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(US)){const v=c.getValue(US);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new kXe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};Gbe=D([_(5,Pe),_(6,yf),_(7,Re),_(8,be)],Gbe);let SUe=class extends Lkt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(y_),[h,u]=l.invokeFunction(Fde,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=Nde(r,this),this.disposables.add(Pde(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=VS(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(c));let m={};if(p.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const v=!!c.getValue(y_);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(tC)){const v=!!c.getValue(tC);m={...m,scrollByPage:v}}if(p.affectsConfiguration(iC)){const v=!!c.getValue(iC);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(HS)){const v=c.getValue(HS);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(US)){const v=c.getValue(US);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new kXe(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};SUe=D([_(5,Pe),_(6,yf),_(7,Re),_(8,be)],SUe);let AUe=class extends Wbe{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(y_),[u,f]=d.invokeFunction(Fde,r);super(e,t,i,s,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=Nde(a,this),this.disposables.add(Pde(this.contextKeyService,this)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=VNe.bindTo(this.contextKeyService),this.listDoubleSelection=zNe.bindTo(this.contextKeyService),this.listMultiSelection=$Ne.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=VS(l),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(l.onDidChangeConfiguration(m=>{m.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(l));let v={};if(m.affectsConfiguration(y_)&&this.horizontalScrolling===void 0){const w=!!l.getValue(y_);v={...v,horizontalScrolling:w}}if(m.affectsConfiguration(tC)){const w=!!l.getValue(tC);v={...v,scrollByPage:w}}if(m.affectsConfiguration(iC)){const w=!!l.getValue(iC);v={...v,smoothScrolling:w}}if(m.affectsConfiguration(HS)){const w=l.getValue(HS);v={...v,mouseWheelScrollSensitivity:w}}if(m.affectsConfiguration(US)){const w=l.getValue(US);v={...v,fastScrollSensitivity:w}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new OIt(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?CO(e):bO)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};AUe=D([_(6,Pe),_(7,yf),_(8,Re),_(9,be)],AUe);class YNe extends ${constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new I),this.onDidOpen=this._onDidOpen.event,this._register(T.filter(this.widget.onDidChangeSelection,i=>Sv(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(CJ)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(CJ)&&(this.openOnSingleClick=t?.configurationService.getValue(CJ)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class kXe extends YNe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class OIt extends YNe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class BIt extends YNe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function WIt(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===hp.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===hp.NoMatchingKb)}}let L7=class extends WNe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(SQ,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new fF(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};L7=D([_(5,be),_(6,Pe),_(7,yf),_(8,Re)],L7);let EUe=class extends wXe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(SQ,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new fF(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};EUe=D([_(5,be),_(6,Pe),_(7,yf),_(8,Re)],EUe);let xUe=class extends kIt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(SQ,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new fF(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};xUe=D([_(6,be),_(7,Pe),_(8,yf),_(9,Re)],xUe);let qbe=class extends CXe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(SQ,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new fF(this,r,u,r.overrideStyles,c,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};qbe=D([_(6,be),_(7,Pe),_(8,yf),_(9,Re)],qbe);let Fee=class extends xIt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(SQ,a);super(e,t,i,s,o,r,u),this.disposables.add(p),this.internals=new fF(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Fee=D([_(7,be),_(8,Pe),_(9,yf),_(10,Re)],Fee);function IXe(n){const e=n.getValue(QNe);if(e==="highlight")return rm.Highlight;if(e==="filter")return rm.Filter;const t=n.getValue(Tee);if(t==="simple"||t==="highlight")return rm.Highlight;if(t==="filter")return rm.Filter}function LXe(n){const e=n.getValue(KNe);if(e==="fuzzy")return Bb.Fuzzy;if(e==="contiguous")return Bb.Contiguous}function SQ(n,e){const t=n.get(Re),i=n.get(W_),s=n.get(Pe),o=n.get(be),r=()=>{const u=s.getContextKeyValue(xXe);if(u==="automatic")return Sy.Automatic;if(u==="trigger"||s.getContextKeyValue(DXe)===!1)return Sy.Trigger;const p=t.getValue(jNe);if(p==="automatic")return Sy.Automatic;if(p==="trigger")return Sy.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(y_),[c,l]=o.invokeFunction(Fde,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(Ree);return{getTypeNavigationMode:r,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(I7)=="number"?t.getValue(I7):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(iC),defaultFindMode:IXe(t),defaultFindMatchType:LXe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(tC),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(Mee)==="doubleClick",contextViewProvider:i,findWidgetStyles:MDt,enableStickyScroll:!!t.getValue(Nee),stickyScrollMaxItemCount:Number(t.getValue(Pee))}}}let fF=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Nde(o,e),this.disposables.push(Pde(this.contextKeyService,e)),this.listSupportsMultiSelect=Tde.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Mde.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=RIt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=VNe.bindTo(this.contextKeyService),this.hasDoubleSelection=zNe.bindTo(this.contextKeyService),this.hasMultiSelection=$Ne.bindTo(this.contextKeyService),this.treeElementCanCollapse=GNe.bindTo(this.contextKeyService),this.treeElementHasParent=MIt.bindTo(this.contextKeyService),this.treeElementCanExpand=qNe.bindTo(this.contextKeyService),this.treeElementHasChild=NIt.bindTo(this.contextKeyService),this.treeFindOpen=PIt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=EXe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=VS(a),this.updateStyleOverrides(s);const l=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(xXe),d.add(DXe),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),l()}),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(SO)&&(this._useAltAsMultipleSelectionModifier=VS(a)),h.affectsConfiguration(I7)){const f=a.getValue(I7);u={...u,indent:f}}if(h.affectsConfiguration(Ree)&&t.renderIndentGuides===void 0){const f=a.getValue(Ree);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(iC)){const f=!!a.getValue(iC);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(QNe)||h.affectsConfiguration(Tee)){const f=IXe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(jNe)||h.affectsConfiguration(Tee)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(KNe)){const f=LXe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(y_)&&t.horizontalScrolling===void 0){const f=!!a.getValue(y_);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(tC)){const f=!!a.getValue(tC);u={...u,scrollByPage:f}}if(h.affectsConfiguration(Mee)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(Mee)==="doubleClick"}),h.affectsConfiguration(Nee)){const f=a.getValue(Nee);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(Pee)){const f=Math.max(1,a.getValue(Pee));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(HS)){const f=a.getValue(HS);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(US)){const f=a.getValue(US);u={...u,fastScrollSensitivity:f}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new BIt(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?CO(e):bO)}dispose(){this.disposables=St(this.disposables)}};fF=D([_(4,Pe),_(5,yf),_(6,Re)],fF);const HIt=it.as(Cs.Configuration);HIt.registerConfiguration({id:"workbench",order:7,title:g(ic,0,"Workbench"),type:"object",properties:{[SO]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[g(ic,1,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(ic,2,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:g(ic,3,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[CJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(ic,4,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[y_]:{type:"boolean",default:!1,description:g(ic,5,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[tC]:{type:"boolean",default:!1,description:g(ic,6,"Controls whether clicks in the scrollbar scroll page by page.")},[I7]:{type:"number",default:8,minimum:4,maximum:40,description:g(ic,7,"Controls tree indentation in pixels.")},[Ree]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(ic,8,"Controls whether the tree should render indent guides.")},[iC]:{type:"boolean",default:!1,description:g(ic,9,"Controls whether lists and trees have smooth scrolling.")},[HS]:{type:"number",default:1,markdownDescription:g(ic,10,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[US]:{type:"number",default:5,markdownDescription:g(ic,11,"Scrolling speed multiplier when pressing `Alt`.")},[QNe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[g(ic,12,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),g(ic,13,"Filter elements when searching.")],default:"highlight",description:g(ic,14,"Controls the default find mode for lists and trees in the workbench.")},[Tee]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[g(ic,15,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),g(ic,16,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),g(ic,17,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:g(ic,18,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:g(ic,19,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[KNe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[g(ic,20,"Use fuzzy matching when searching."),g(ic,21,"Use contiguous matching when searching.")],default:"fuzzy",description:g(ic,22,"Controls the type of matching used when searching lists and trees in the workbench.")},[Mee]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(ic,23,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Nee]:{type:"boolean",default:!0,description:g(ic,24,"Controls whether sticky scrolling is enabled in trees.")},[Pee]:{type:"number",minimum:1,default:7,markdownDescription:g(ic,25,"Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[jNe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:g(ic,26,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var UIt=".monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:16px;display:inline-block;flex-shrink:0;height:22px;line-height:inherit!important;padding-right:6px;vertical-align:top;width:16px}.monaco-icon-label-iconpath{display:flex;height:16px;margin-top:2px;padding-left:2px;width:16px}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-size:.9em;margin-left:.5em;opacity:.7;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{opacity:.66;text-decoration:line-through}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{font-size:90%;font-weight:600;margin:auto 16px 0 5px;opacity:.75;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}";Ct(UIt,{});class NI extends ${constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=he(e,we("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=NI.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Io(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class v5{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class T7 extends ${constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new v5(he(e,we(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,we(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,we("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new $It(this.nameContainer,!!t.supportIcons)):this.nameNode=new VIt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??va("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let c;!a||!Ra(a)?(c=we(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=uf(i?.iconPath)}else a&&a.remove();if(this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof NI?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?NI.escapeNewLines(t,[]):t||"",this.setupHover(c.element,i?.descriptionTitle||""),c.empty=!t)}if(i?.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){zt(r)?o.title=mde(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const s=H_().setupUpdatableHover(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new v5(pje(this.nameContainer,we("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new v5(he(e.element,we("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new v5(he(this.labelContainer,we("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new NI(he(e.element,we("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new v5(he(e.element,we("span.label-description"))))}return this.descriptionNode}}class VIt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=he(this.container,we("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>Dh.intersect(o,a)).filter(a=>!Dh.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class $It extends ${constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new NI(he(this.container,we("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",s=zIt(e,i,t?.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}}),kz=new Ka(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),JNe=new Ka(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function RXe(n,e,t=!1){const i=n||"",s=e||"",o=DUe.value.collator.compare(i,s);return DUe.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var Qbe;const s0t="vs/platform/quickinput/browser/quickInputTree",$w=we;class PXe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Ka(()=>{const s=i.label??"",o=n2(s).text.trim(),r=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>ZYe(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class iu extends PXe{constructor(e,t,i,s,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=s,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?T.map(T.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):T.None,this._saneDetail=o.detail,this._labelHighlights=o.highlights?.label,this._descriptionHighlights=o.highlights?.description,this._detailHighlights=o.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var iy;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(iy||(iy={}));class LD extends PXe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=iy.NONE}}class o0t{getHeight(e){return e instanceof LD?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof iu?Wee.ID:Hee.ID}}class r0t{getWidgetAriaLabel(){return g(s0t,0,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof iu)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class FXe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=he(e,$w(".quick-input-list-entry"));const i=he(t.entry,$w("label.quick-input-list-label"));t.toDisposeTemplate.add(Xo(i,xe.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=he(i,$w("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const s=he(i,$w(".quick-input-list-rows")),o=he(s,$w(".quick-input-list-row")),r=he(s,$w(".quick-input-list-row"));t.label=new T7(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Yle(t.label.element,$w(".quick-input-list-icon"));const a=he(o,$w(".quick-input-list-entry-keybinding"));t.keybinding=new Dz(a,zc),t.toDisposeTemplate.add(t.keybinding);const c=he(r,$w(".quick-input-list-label-meta"));return t.detail=new T7(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=he(t.entry,$w(".quick-input-list-separator")),t.actionBar=new Qh(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var sN;let Wee=(sN=class extends FXe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return Qbe.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Xo(t.checkbox,xe.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0;const o=s.item;i.checkbox.checked=s.checked,i.toDisposeElement.add(s.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=s.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;if(o.iconPath){const u=rde(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=P.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=uf(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(o.keybinding),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";s.separator?.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireButtonTriggered({button:u,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},Qbe=sN,sN.ID="quickpickitem",sN);Wee=Qbe=D([_(1,pn)],Wee);const Rae=class Rae extends FXe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return Rae.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const o=s.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;i.icon.style.backgroundImage="",i.icon.className="";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireSeparatorButtonTriggered({button:u,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};Rae.ID="quickpickseparator";let Hee=Rae,pF=class extends ${constructor(e,t,i,s,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new I,this.onKeyDown=this._onKeyDown.event,this._onLeave=new I,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new I,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new I,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new I,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new I,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=he(this.parent,$w(".quick-input-list")),this._separatorRenderer=new Hee(t),this._itemRenderer=o.createInstance(Wee,t),this._tree=this._register(o.createInstance(L7,"QuickInput",this._container,new o0t,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new r0t,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:rV.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return T.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof iu).map(t=>t.item))}get onDidChangeSelection(){return T.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof iu).map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get matchOnMeta(){return this._matchOnMeta}set matchOnMeta(e){this._matchOnMeta=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new os(e);switch(t.keyCode){case E.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(pe(this._container,xe.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(pe(this._container,xe.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new iQ(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(_2e(t.browserEvent.target)){e.cancel();return}if(!(!_2e(t.browserEvent.relatedTarget)&&al(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof iu&&this.showHover(t.element)})}catch(i){if(!Na(i))throw i}})),this._register(this._tree.onMouseOut(t=>{al(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&iy.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=iy.ACTIVE_ITEM:i.focusInsideSeparator&=~iy.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)||(i.focusInsideSeparator|=iy.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)&&(i.focusInsideSeparator&=~iy.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof iu);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof LD&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;const t=this.parent.classList.contains("show-checkboxes");let i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,c)=>{let l;if(a.type==="separator"){if(!a.buttons)return r;i=new LD(c,d=>this.fireSeparatorButtonTriggered(d),a),l=i}else{const d=c>0?e[c-1]:void 0;let h;d&&d.type==="separator"&&!d.buttons&&(i=void 0,h=d);const u=new iu(c,t,f=>this.fireButtonTriggered(f),this._elementChecked,a,h);if(this._itemElements.push(u),i)return i.children.push(u),r;l=u}return r.push(l),r},new Array);const s=new Array;let o=0;for(const r of this._elementTree)r instanceof LD?(s.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),o+=r.children.length+1):(s.push({element:r,collapsible:!1,collapsed:!1}),o++);this._tree.setChildren(null,s),this._onChangedVisibleCount.fire(o),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const r=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),a=r?.parentNode;if(r&&a){const c=r.nextSibling;a.removeChild(r),a.insertBefore(r,c)}},0)}getElementsCount(){return this._inputElements.length}getFocusedElements(){return this._tree.getFocus().filter(e=>!!e).map(e=>e.item).filter(e=>!!e)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}getSelectedElements(){return this._tree.getSelection().filter(e=>!!e&&!!e.item).map(e=>e.item)}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._shouldFireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){if(this._itemElements.length)switch(e===Wo.Second&&this._itemElements.length<2&&(e=Wo.First),e){case Wo.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof iu);break;case Wo.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case Wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case Wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,s=>s.element instanceof iu?(this._tree.reveal(s.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case Wo.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,s=>{if(!(s.element instanceof iu))return!1;const o=this._tree.getParentElement(s.element);return o===null||o.children[0]!==s.element?this._tree.reveal(s.element):this._tree.reveal(o),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[0]&&this._onLeave.fire();break}case Wo.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof iu?(this._tree.reveal(t.element),!0):!1);break;case Wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof iu))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case Wo.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(t)return!0;if(o.element instanceof LD)t=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof iu){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const s=this._tree.getFocus()[0];i===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case Wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof LD)i?t||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element.children[0]):i=!0;else if(s.element instanceof iu&&!t){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(a=>{a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=!1;const c=a.index&&this._inputElements[a.index-1];a.item&&(a.separator=c&&c.type==="separator"&&!c.buttons?c:void 0)});else{let a;this._elementTree.forEach(c=>{let l;this.matchOnLabelMode==="fuzzy"?l=this.matchOnLabel?lJ(e,n2(c.saneLabel))??void 0:void 0:l=this.matchOnLabel?a0t(t,n2(c.saneLabel))??void 0:void 0;const d=this.matchOnDescription?lJ(e,n2(c.saneDescription||""))??void 0:void 0,h=this.matchOnDetail?lJ(e,n2(c.saneDetail||""))??void 0:void 0;if(l||d||h?(c.labelHighlights=l,c.descriptionHighlights=d,c.detailHighlights=h,c.hidden=!1):(c.labelHighlights=void 0,c.descriptionHighlights=void 0,c.detailHighlights=void 0,c.hidden=c.item?!c.item.alwaysShow:!0),c.item?c.separator=void 0:c.separator&&(c.hidden=!0),!this.sortByLabel){const u=c.index&&this._inputElements[c.index-1];a=u&&u.type==="separator"?u:a,a&&!c.hidden&&(c.separator=a,a=void 0)}})}const i=this._elementTree.filter(a=>!a.hidden);if(this.sortByLabel&&e){const a=e.toLowerCase();i.sort((c,l)=>c0t(c,l,a))}let s;const o=i.reduce((a,c,l)=>(c instanceof iu?s?s.children.push(c):a.push(c):c instanceof LD&&(c.children=[],s=c,a.push(c)),a),new Array),r=new Array;for(const a of o)a instanceof LD?r.push({element:a,collapsible:!1,collapsed:!1,children:a.children.map(c=>({element:c,collapsible:!1,collapsed:!1}))}):r.push({element:a,collapsible:!1,collapsed:!1});return this._tree.setChildren(null,r),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;const e=this._tree.getFocus().filter(i=>i instanceof iu),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof iu))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof iu&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:Oo.RIGHT}},!1))}};pF.__decorator=D([ii],pF.prototype,"onDidChangeFocus",null);pF.__decorator=D([ii],pF.prototype,"onDidChangeSelection",null);pF=D([_(4,be),_(5,Ur)],pF);function a0t(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return kUe(n,t);const s=lz(t," "),o=t.length-s.length,r=kUe(n,s);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function kUe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function c0t(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:SJ(n.saneSortLabel,e.saneSortLabel,t)}const XNe="vs/platform/quickinput/browser/quickInputActions",OXe={weight:ye.WorkbenchContrib,when:ge.and(ge.equals(lXe,nV.QuickPick),ekt),metadata:{description:g(XNe,0,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Qf(n,e={}){xr.registerCommandAndKeybindingRule({...OXe,...n,secondary:l0t(n.primary,n.secondary??[],e)})}const Uee=ei?V.WinCtrl:V.CtrlCmd;function l0t(n,e,t={}){return t.withAltMod&&e.push(V.Alt+n),t.withCtrlMod&&(e.push(Uee+n),t.withAltMod&&e.push(V.Alt+Uee+n)),t.withCmdMod&&ei&&(e.push(V.CtrlCmd+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.WinCtrl+n),t.withAltMod&&(e.push(V.CtrlCmd+V.Alt+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.Alt+V.WinCtrl+n))),e}function Vp(n,e){return t=>{const i=t.get(On).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Qf({id:"quickInput.pageNext",primary:E.PageDown,handler:Vp(Wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.pagePrevious",primary:E.PageUp,handler:Vp(Wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.first",primary:Uee+E.Home,handler:Vp(Wo.First)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.last",primary:Uee+E.End,handler:Vp(Wo.Last)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.next",primary:E.DownArrow,handler:Vp(Wo.Next)},{withCtrlMod:!0});Qf({id:"quickInput.previous",primary:E.UpArrow,handler:Vp(Wo.Previous)},{withCtrlMod:!0});const IUe=g(XNe,1,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),LUe=g(XNe,2,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");ei?(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.DownArrow],handler:Vp(Wo.NextSeparator)},{withCtrlMod:!0}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.UpArrow],handler:Vp(Wo.PreviousSeparator)},{withCtrlMod:!0})):(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator)}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator)}));Qf({id:"quickInput.acceptInBackground",when:ge.and(OXe.when,ge.or(SXe.negate(),nkt)),primary:E.RightArrow,weight:ye.WorkbenchContrib+50,handler:n=>{n.get(On).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var jbe;const EL="vs/platform/quickinput/browser/quickInputController",xf=we;var oN;let Kbe=(oN=class extends ${get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this.onDidTriggerButtonEmitter=this._register(new I),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new I),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new I),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=ZDt.bindTo(this.contextKeyService),this.quickInputTypeContext=tkt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=ikt.bindTo(this.contextKeyService),this.backButton=kee,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(T.runAndSubscribe(Vb,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:yi,disposables:this._store})),this._register(Iut(o=>{this.ui&>(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[xe.KEY_DOWN,xe.KEY_UP,xe.MOUSE_DOWN])t.add(pe(e,s,i,!0))}getUI(e){if(this.ui)return e&>(this._container)!==gt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=he(this._container,xf(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=od(t),s=he(t,xf(".quick-input-titlebar")),o=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=he(s,xf(".quick-input-title")),a=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=he(t,xf(".quick-input-header")),l=he(c,xf("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(EL,0,"Toggle all checkboxes")),this._register(Xo(l,xe.CHANGE,j=>{const re=l.checked;U.setAllVisibleChecked(re)})),this._register(pe(l,xe.CLICK,j=>{(j.x||j.y)&&f.setFocus()}));const d=he(c,xf(".quick-input-description")),h=he(c,xf(".quick-input-and-message")),u=he(h,xf(".quick-input-filter")),f=this._register(new xkt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=he(u,xf(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new Obe(p,{countFormat:g(EL,1,"{0} Results")},this.styles.countBadge),v=he(u,xf(".quick-input-count"));v.setAttribute("aria-live","polite");const w=new Obe(v,{countFormat:g(EL,2,"{0} Selected")},this.styles.countBadge),b=he(c,xf(".quick-input-action")),C=this._register(new Tu(b,this.styles.button));C.label=g(EL,3,"OK"),this._register(C.onDidClick(j=>{this.onDidAcceptEmitter.fire()}));const y=he(c,xf(".quick-input-action")),S=this._register(new Tu(y,{...this.styles.button,supportIcons:!0}));S.label=g(EL,4,"Custom"),this._register(S.onDidClick(j=>{this.onDidCustomEmitter.fire()}));const M=he(h,xf(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new y7(t,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const F=he(t,xf(".quick-input-html-widget"));F.tabIndex=-1;const N=he(t,xf(".quick-input-description")),z=this.idPrefix+"list",U=this._register(this.instantiationService.createInstance(pF,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,z));f.setAttribute("aria-controls",z),this._register(U.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",U.getActiveDescendant()??"")})),this._register(U.onChangedAllVisibleChecked(j=>{l.checked=j})),this._register(U.onChangedVisibleCount(j=>{m.setCount(j)})),this._register(U.onChangedCheckedCount(j=>{w.setCount(j)})),this._register(U.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof r2&&this.controller.canSelectMany&&U.clearFocus())},0)}));const J=Dd(t);return this._register(J),this._register(pe(t,xe.FOCUS,j=>{const re=this.getUI();if(al(j.relatedTarget,re.inputContainer)){const me=re.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==me&&this.endOfQuickInputBoxContext.set(me)}al(j.relatedTarget,re.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Ra(j.relatedTarget)?j.relatedTarget:void 0)},!0)),this._register(J.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(iV.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(j=>{const re=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==re&&this.endOfQuickInputBoxContext.set(re)})),this._register(pe(t,xe.FOCUS,j=>{f.setFocus()})),this._register(Xo(t,xe.KEY_DOWN,j=>{if(!al(j.target,F))switch(j.keyCode){case E.Enter:un.stop(j,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case E.Escape:un.stop(j,!0),this.hide(iV.Gesture);break;case E.Tab:if(!j.altKey&&!j.ctrlKey&&!j.metaKey){const re=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?re.push("input"):re.push("input[type=text]"),this.getUI().list.isDisplayed()&&re.push(".monaco-list"),this.getUI().message&&re.push(".quick-input-message a"),this.getUI().widget){if(al(j.target,this.getUI().widget))break;re.push(".quick-input-html-widget")}const me=t.querySelectorAll(re.join(", "));j.shiftKey&&j.target===me[0]?(un.stop(j,!0),U.clearFocus()):!j.shiftKey&&al(j.target,me[me.length-1])&&(un.stop(j,!0),me[0].focus())}break;case E.Space:j.ctrlKey&&(un.stop(j,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:s,title:r,description1:N,description2:d,widget:F,rightActionBar:a,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:w,okContainer:b,ok:C,message:M,customButtonContainer:y,customButton:S,list:U,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:j=>this.show(j),hide:()=>this.hide(),setVisibilities:j=>this.setVisibilities(j),setEnabled:j=>this.setEnabled(j),setContextKey:j=>this.options.setContextKey(j),linkOpenerDelegate:j=>this.options.linkOpenerDelegate(j)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,he(this._container,this.ui.container))}pick(e,t={},i=qe.None){return new Promise((s,o)=>{let r=d=>{r=s,t.onKeyMods?.(a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let c;const l=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),p=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,p&&(a.activeItems=p),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{c&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==c)&&(a.activeItems=[c])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{St(l),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{c=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),c&&(a.activeItems=[c])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&zt(t)?(e.severity=nt.Error,e.validationMessage=t):t&&!zt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=nt.Ignore,e.validationMessage=void 0)}input(e={},t=qe.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const s=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=T.debounce(s.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[s,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(s,h)})}),s.onDidAccept(()=>{const d=s.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!zt(h)&&h.severity!==nt.Error?(i(d),s.hide()):d===a&&this.setValidationOnInput(s,h)})}),t.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{St(l),i(void 0)})];s.title=e.title,s.value=e.value||"",s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.placeholder=e.placeHolder,s.password=!!e.password,s.ignoreFocusOut=!!e.ignoreFocusLost,s.show()})}createQuickPick(){const e=this.getUI(!0);return new r2(e)}createInputBox(){const e=this.getUI(!0);return new skt(e)}createQuickWidget(){const e=this.getUI(!0);return new okt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",_a(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(nt.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),_a(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();kee.tooltip=s?g(EL,5,"Back ({0})",s):g(EL,6,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,s=i&&!cMe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o?.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}focus(){if(this.isVisible()){const e=this.getUI();e.inputBox.enabled?e.inputBox.setFocus():e.list.domFocus()}}toggle(){this.isVisible()&&this.controller instanceof r2&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.isDisplayed()&&(this.getUI().list.focus(e?Wo.Next:Wo.Previous),t&&this.controller instanceof r2&&(this.controller.quickNavigate=t))}async accept(e={alt:!1,ctrlCmd:!1}){this.keyMods.alt=e.alt,this.keyMods.ctrlCmd=e.ctrlCmd,this.onDidAcceptEmitter.fire()}async back(){this.onDidTriggerButtonEmitter.fire(this.backButton)}async cancel(){this.hide()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,jbe.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},jbe=oN,oN.MAX_WIDTH=600,oN);Kbe=jbe=D([_(1,bg),_(2,be),_(3,Pe)],Kbe);let Vee=class extends VMe{get backButton(){return this.controller.backButton}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Nbe))),this._quickAccess}constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=o,this._onShow=this._register(new I),this.onShow=this._onShow.event,this._onHide=this._register(new I),this.onHide=this._onHide.event,this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(fr).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Fbe))},s=this._register(this.instantiationService.createInstance(Kbe,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{gt(e.activeContainer)===gt(s.container)&&s.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Y(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=qe.None){return this.controller.pick(e,t,i)}input(e={},t=qe.None){return this.controller.input(e,t)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}createQuickWidget(){return this.controller.createQuickWidget()}focus(){this.controller.focus()}toggle(){this.controller.toggle()}navigate(e,t){this.controller.navigate(e,t)}accept(e){return this.controller.accept(e)}back(){return this.controller.back()}cancel(){return this.controller.cancel()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Ye(mWe),quickInputForeground:Ye(M_t),quickInputTitleBackground:Ye(N_t),widgetBorder:Ye(UU),widgetShadow:Ye(__)},inputBox:eV,toggle:See,countBadge:tXe,button:yQ,progressBar:eXe,keybindingLabel:RDt,list:CO({listBackground:mWe,listFocusBackground:$k,listFocusForeground:zk,listInactiveFocusForeground:zk,listInactiveSelectionIconForeground:JB,listInactiveFocusBackground:$k,listFocusOutline:co,listInactiveFocusOutline:co}),pickerGroup:{pickerGroupBorder:Ye(P_t),pickerGroupForeground:Ye(EKe)}}}};Vee=D([_(0,be),_(1,Pe),_(2,pn),_(3,bg),_(4,Re)],Vee);let Ybe=class extends Vee{constructor(e,t,i,s,o,r){super(t,i,s,new Wwe(e.getContainerDomNode(),o),r),this.host=void 0;const a=M7.get(e);if(a){const c=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return c.getDomNode()},getContainer(){return c.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[c.getDomNode()]},get activeContainer(){return c.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return T.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return T.None},get onDidAddContainer(){return T.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Ybe=D([_(1,be),_(2,Pe),_(3,pn),_(4,Qt),_(5,Re)],Ybe);let R7=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Ybe,e);this.mapEditorToService.set(e,t),cw(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}createQuickWidget(){return this.activeService.createQuickWidget()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};R7=D([_(0,be),_(1,Qt)],R7);const Mae=class Mae{static get(e){return e.getContribution(Mae.ID)}constructor(e){this.editor=e,this.widget=new Jbe(this.editor)}dispose(){this.widget.dispose()}};Mae.ID="editor.controller.quickInput";let M7=Mae;const Nae=class Nae{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Nae.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Yf.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Nae.ID="editor.contrib.quickInputWidget";let Jbe=Nae;vn(M7.ID,M7,mi.Lazy);class d0t{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function h0t(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const u=_0t(d.token,h.token);return u!==0?u:d.index-h.index});let t=ar.None,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==ar.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new f0t;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),c=new ZNe(t,r,a),l=new ePe(c);for(let d=0,h=n.length;d"u"){const s=this._match(t),o=m0t(t);i=(s.metadata|o<>>0,this._cache.set(t,i)}return(i|e<>>0}}const p0t=/\b(comment|string|regex|regexp)\b/;function m0t(n){const e=n.match(p0t);if(!e)return Ar.Other;switch(e[1]){case"comment":return Ar.Comment;case"string":return Ar.String;case"regex":return Ar.RegEx;case"regexp":return Ar.RegEx}throw new Error("Unexpected match for standard token type!")}function _0t(n,e){return ne?1:0}class ZNe{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<>>0}clone(){return new ZNe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==ar.NotSet&&(this._fontStyle=e),t!==Ad.None&&(this._foreground=t),i!==Ad.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class v0t{constructor(e,t=new Map){if(this.mainRule=e,t instanceof Map)this.children=t;else{this.children=new Map;for(const i in t)this.children.set(i,t[i])}}}class ePe{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}toExternalThemeTrieElement(){const e=new Map;return this._children.forEach((t,i)=>{e.set(i,t.toExternalThemeTrieElement())}),new v0t(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let c=this._children.get(r);typeof c>"u"&&(c=new ePe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,s)}}function w0t(n){const e=[];for(let t=1,i=n.length;t=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class v5{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class T7 extends ${constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new v5(he(e,we(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,we(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,we("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new $It(this.nameContainer,!!t.supportIcons)):this.nameNode=new VIt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??va("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let c;!a||!Ra(a)?(c=we(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=uf(i?.iconPath)}else a&&a.remove();if(this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof NI?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?NI.escapeNewLines(t,[]):t||"",this.setupHover(c.element,i?.descriptionTitle||""),c.empty=!t)}if(i?.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){zt(r)?o.title=mde(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const s=H_().setupUpdatableHover(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new v5(pje(this.nameContainer,we("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new v5(he(e.element,we("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new v5(he(this.labelContainer,we("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new NI(he(e.element,we("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new v5(he(e.element,we("span.label-description"))))}return this.descriptionNode}}class VIt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=he(this.container,we("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>Dh.intersect(o,a)).filter(a=>!Dh.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class $It extends ${constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Io(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new NI(he(this.container,we("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",s=zIt(e,i,t?.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}}),kz=new Ka(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),JNe=new Ka(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function RXe(n,e,t=!1){const i=n||"",s=e||"",o=DUe.value.collator.compare(i,s);return DUe.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var Qbe;const s0t="vs/platform/quickinput/browser/quickInputTree",$w=we;class PXe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Ka(()=>{const s=i.label??"",o=n2(s).text.trim(),r=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>ZYe(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class iu extends PXe{constructor(e,t,i,s,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=s,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?T.map(T.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):T.None,this._saneDetail=o.detail,this._labelHighlights=o.highlights?.label,this._descriptionHighlights=o.highlights?.description,this._detailHighlights=o.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var iy;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(iy||(iy={}));class LD extends PXe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=iy.NONE}}class o0t{getHeight(e){return e instanceof LD?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof iu?Wee.ID:Hee.ID}}class r0t{getWidgetAriaLabel(){return g(s0t,0,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof iu)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class FXe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=he(e,$w(".quick-input-list-entry"));const i=he(t.entry,$w("label.quick-input-list-label"));t.toDisposeTemplate.add(Xo(i,xe.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=he(i,$w("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const s=he(i,$w(".quick-input-list-rows")),o=he(s,$w(".quick-input-list-row")),r=he(s,$w(".quick-input-list-row"));t.label=new T7(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Yle(t.label.element,$w(".quick-input-list-icon"));const a=he(o,$w(".quick-input-list-entry-keybinding"));t.keybinding=new Dz(a,$c),t.toDisposeTemplate.add(t.keybinding);const c=he(r,$w(".quick-input-list-label-meta"));return t.detail=new T7(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=he(t.entry,$w(".quick-input-list-separator")),t.actionBar=new Qh(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var sN;let Wee=(sN=class extends FXe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return Qbe.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Xo(t.checkbox,xe.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0;const o=s.item;i.checkbox.checked=s.checked,i.toDisposeElement.add(s.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=s.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;if(o.iconPath){const u=rde(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=P.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=uf(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(o.keybinding),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";s.separator?.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireButtonTriggered({button:u,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},Qbe=sN,sN.ID="quickpickitem",sN);Wee=Qbe=D([_(1,pn)],Wee);const Rae=class Rae extends FXe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return Rae.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const o=s.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=s;i.icon.style.backgroundImage="",i.icon.className="";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),s.saneDetail){let u;s.saneTooltip||(u={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>Dee(u,`id-${f}`,()=>s.fireSeparatorButtonTriggered({button:u,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};Rae.ID="quickpickseparator";let Hee=Rae,pF=class extends ${constructor(e,t,i,s,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new I,this.onKeyDown=this._onKeyDown.event,this._onLeave=new I,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new I,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new I,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new I,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new I,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=he(this.parent,$w(".quick-input-list")),this._separatorRenderer=new Hee(t),this._itemRenderer=o.createInstance(Wee,t),this._tree=this._register(o.createInstance(L7,"QuickInput",this._container,new o0t,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new r0t,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:rV.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return T.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof iu).map(t=>t.item))}get onDidChangeSelection(){return T.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof iu).map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get matchOnMeta(){return this._matchOnMeta}set matchOnMeta(e){this._matchOnMeta=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new os(e);switch(t.keyCode){case E.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(pe(this._container,xe.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(pe(this._container,xe.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new iQ(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(_2e(t.browserEvent.target)){e.cancel();return}if(!(!_2e(t.browserEvent.relatedTarget)&&al(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof iu&&this.showHover(t.element)})}catch(i){if(!Na(i))throw i}})),this._register(this._tree.onMouseOut(t=>{al(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&iy.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=iy.ACTIVE_ITEM:i.focusInsideSeparator&=~iy.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)||(i.focusInsideSeparator|=iy.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&iy.MOUSE_HOVER)&&(i.focusInsideSeparator&=~iy.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof iu);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof LD&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;const t=this.parent.classList.contains("show-checkboxes");let i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,c)=>{let l;if(a.type==="separator"){if(!a.buttons)return r;i=new LD(c,d=>this.fireSeparatorButtonTriggered(d),a),l=i}else{const d=c>0?e[c-1]:void 0;let h;d&&d.type==="separator"&&!d.buttons&&(i=void 0,h=d);const u=new iu(c,t,f=>this.fireButtonTriggered(f),this._elementChecked,a,h);if(this._itemElements.push(u),i)return i.children.push(u),r;l=u}return r.push(l),r},new Array);const s=new Array;let o=0;for(const r of this._elementTree)r instanceof LD?(s.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),o+=r.children.length+1):(s.push({element:r,collapsible:!1,collapsed:!1}),o++);this._tree.setChildren(null,s),this._onChangedVisibleCount.fire(o),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const r=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),a=r?.parentNode;if(r&&a){const c=r.nextSibling;a.removeChild(r),a.insertBefore(r,c)}},0)}getElementsCount(){return this._inputElements.length}getFocusedElements(){return this._tree.getFocus().filter(e=>!!e).map(e=>e.item).filter(e=>!!e)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}getSelectedElements(){return this._tree.getSelection().filter(e=>!!e&&!!e.item).map(e=>e.item)}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._shouldFireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){if(this._itemElements.length)switch(e===Wo.Second&&this._itemElements.length<2&&(e=Wo.First),e){case Wo.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof iu);break;case Wo.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case Wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case Wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,s=>s.element instanceof iu?(this._tree.reveal(s.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case Wo.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,s=>{if(!(s.element instanceof iu))return!1;const o=this._tree.getParentElement(s.element);return o===null||o.children[0]!==s.element?this._tree.reveal(s.element):this._tree.reveal(o),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[0]&&this._onLeave.fire();break}case Wo.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof iu?(this._tree.reveal(t.element),!0):!1);break;case Wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof iu))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case Wo.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(t)return!0;if(o.element instanceof LD)t=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof iu){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const s=this._tree.getFocus()[0];i===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case Wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof LD)i?t||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element.children[0]):i=!0;else if(s.element instanceof iu&&!t){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),t=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(a=>{a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=!1;const c=a.index&&this._inputElements[a.index-1];a.item&&(a.separator=c&&c.type==="separator"&&!c.buttons?c:void 0)});else{let a;this._elementTree.forEach(c=>{let l;this.matchOnLabelMode==="fuzzy"?l=this.matchOnLabel?lJ(e,n2(c.saneLabel))??void 0:void 0:l=this.matchOnLabel?a0t(t,n2(c.saneLabel))??void 0:void 0;const d=this.matchOnDescription?lJ(e,n2(c.saneDescription||""))??void 0:void 0,h=this.matchOnDetail?lJ(e,n2(c.saneDetail||""))??void 0:void 0;if(l||d||h?(c.labelHighlights=l,c.descriptionHighlights=d,c.detailHighlights=h,c.hidden=!1):(c.labelHighlights=void 0,c.descriptionHighlights=void 0,c.detailHighlights=void 0,c.hidden=c.item?!c.item.alwaysShow:!0),c.item?c.separator=void 0:c.separator&&(c.hidden=!0),!this.sortByLabel){const u=c.index&&this._inputElements[c.index-1];a=u&&u.type==="separator"?u:a,a&&!c.hidden&&(c.separator=a,a=void 0)}})}const i=this._elementTree.filter(a=>!a.hidden);if(this.sortByLabel&&e){const a=e.toLowerCase();i.sort((c,l)=>c0t(c,l,a))}let s;const o=i.reduce((a,c,l)=>(c instanceof iu?s?s.children.push(c):a.push(c):c instanceof LD&&(c.children=[],s=c,a.push(c)),a),new Array),r=new Array;for(const a of o)a instanceof LD?r.push({element:a,collapsible:!1,collapsed:!1,children:a.children.map(c=>({element:c,collapsible:!1,collapsed:!1}))}):r.push({element:a,collapsible:!1,collapsed:!1});return this._tree.setChildren(null,r),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;const e=this._tree.getFocus().filter(i=>i instanceof iu),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof iu))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof iu&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:Oo.RIGHT}},!1))}};pF.__decorator=D([ii],pF.prototype,"onDidChangeFocus",null);pF.__decorator=D([ii],pF.prototype,"onDidChangeSelection",null);pF=D([_(4,be),_(5,Ur)],pF);function a0t(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return kUe(n,t);const s=lz(t," "),o=t.length-s.length,r=kUe(n,s);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function kUe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function c0t(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:SJ(n.saneSortLabel,e.saneSortLabel,t)}const XNe="vs/platform/quickinput/browser/quickInputActions",OXe={weight:ye.WorkbenchContrib,when:ge.and(ge.equals(lXe,nV.QuickPick),ekt),metadata:{description:g(XNe,0,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Qf(n,e={}){xr.registerCommandAndKeybindingRule({...OXe,...n,secondary:l0t(n.primary,n.secondary??[],e)})}const Uee=ei?V.WinCtrl:V.CtrlCmd;function l0t(n,e,t={}){return t.withAltMod&&e.push(V.Alt+n),t.withCtrlMod&&(e.push(Uee+n),t.withAltMod&&e.push(V.Alt+Uee+n)),t.withCmdMod&&ei&&(e.push(V.CtrlCmd+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.WinCtrl+n),t.withAltMod&&(e.push(V.CtrlCmd+V.Alt+n),t.withCtrlMod&&e.push(V.CtrlCmd+V.Alt+V.WinCtrl+n))),e}function Vp(n,e){return t=>{const i=t.get(On).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Qf({id:"quickInput.pageNext",primary:E.PageDown,handler:Vp(Wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.pagePrevious",primary:E.PageUp,handler:Vp(Wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Qf({id:"quickInput.first",primary:Uee+E.Home,handler:Vp(Wo.First)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.last",primary:Uee+E.End,handler:Vp(Wo.Last)},{withAltMod:!0,withCmdMod:!0});Qf({id:"quickInput.next",primary:E.DownArrow,handler:Vp(Wo.Next)},{withCtrlMod:!0});Qf({id:"quickInput.previous",primary:E.UpArrow,handler:Vp(Wo.Previous)},{withCtrlMod:!0});const IUe=g(XNe,1,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),LUe=g(XNe,2,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");ei?(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.DownArrow],handler:Vp(Wo.NextSeparator)},{withCtrlMod:!0}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.CtrlCmd+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,secondary:[V.CtrlCmd+V.WinCtrl+E.UpArrow],handler:Vp(Wo.PreviousSeparator)},{withCtrlMod:!0})):(Qf({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator,Wo.Next),metadata:{description:IUe}}),Qf({id:"quickInput.nextSeparator",primary:V.CtrlCmd+V.Alt+E.DownArrow,handler:Vp(Wo.NextSeparator)}),Qf({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator,Wo.Previous),metadata:{description:LUe}}),Qf({id:"quickInput.previousSeparator",primary:V.CtrlCmd+V.Alt+E.UpArrow,handler:Vp(Wo.PreviousSeparator)}));Qf({id:"quickInput.acceptInBackground",when:ge.and(OXe.when,ge.or(SXe.negate(),nkt)),primary:E.RightArrow,weight:ye.WorkbenchContrib+50,handler:n=>{n.get(On).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var jbe;const EL="vs/platform/quickinput/browser/quickInputController",xf=we;var oN;let Kbe=(oN=class extends ${get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new I),this.onDidCustomEmitter=this._register(new I),this.onDidTriggerButtonEmitter=this._register(new I),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new I),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new I),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=ZDt.bindTo(this.contextKeyService),this.quickInputTypeContext=tkt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=ikt.bindTo(this.contextKeyService),this.backButton=kee,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(T.runAndSubscribe(Vb,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:yi,disposables:this._store})),this._register(Iut(o=>{this.ui&>(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[xe.KEY_DOWN,xe.KEY_UP,xe.MOUSE_DOWN])t.add(pe(e,s,i,!0))}getUI(e){if(this.ui)return e&>(this._container)!==gt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=he(this._container,xf(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=od(t),s=he(t,xf(".quick-input-titlebar")),o=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=he(s,xf(".quick-input-title")),a=this._register(new Qh(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=he(t,xf(".quick-input-header")),l=he(c,xf("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(EL,0,"Toggle all checkboxes")),this._register(Xo(l,xe.CHANGE,j=>{const re=l.checked;U.setAllVisibleChecked(re)})),this._register(pe(l,xe.CLICK,j=>{(j.x||j.y)&&f.setFocus()}));const d=he(c,xf(".quick-input-description")),h=he(c,xf(".quick-input-and-message")),u=he(h,xf(".quick-input-filter")),f=this._register(new xkt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=he(u,xf(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new Obe(p,{countFormat:g(EL,1,"{0} Results")},this.styles.countBadge),v=he(u,xf(".quick-input-count"));v.setAttribute("aria-live","polite");const w=new Obe(v,{countFormat:g(EL,2,"{0} Selected")},this.styles.countBadge),b=he(c,xf(".quick-input-action")),C=this._register(new Tu(b,this.styles.button));C.label=g(EL,3,"OK"),this._register(C.onDidClick(j=>{this.onDidAcceptEmitter.fire()}));const y=he(c,xf(".quick-input-action")),S=this._register(new Tu(y,{...this.styles.button,supportIcons:!0}));S.label=g(EL,4,"Custom"),this._register(S.onDidClick(j=>{this.onDidCustomEmitter.fire()}));const M=he(h,xf(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new y7(t,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const F=he(t,xf(".quick-input-html-widget"));F.tabIndex=-1;const N=he(t,xf(".quick-input-description")),z=this.idPrefix+"list",U=this._register(this.instantiationService.createInstance(pF,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,z));f.setAttribute("aria-controls",z),this._register(U.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",U.getActiveDescendant()??"")})),this._register(U.onChangedAllVisibleChecked(j=>{l.checked=j})),this._register(U.onChangedVisibleCount(j=>{m.setCount(j)})),this._register(U.onChangedCheckedCount(j=>{w.setCount(j)})),this._register(U.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof r2&&this.controller.canSelectMany&&U.clearFocus())},0)}));const J=Dd(t);return this._register(J),this._register(pe(t,xe.FOCUS,j=>{const re=this.getUI();if(al(j.relatedTarget,re.inputContainer)){const me=re.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==me&&this.endOfQuickInputBoxContext.set(me)}al(j.relatedTarget,re.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Ra(j.relatedTarget)?j.relatedTarget:void 0)},!0)),this._register(J.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(iV.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(j=>{const re=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==re&&this.endOfQuickInputBoxContext.set(re)})),this._register(pe(t,xe.FOCUS,j=>{f.setFocus()})),this._register(Xo(t,xe.KEY_DOWN,j=>{if(!al(j.target,F))switch(j.keyCode){case E.Enter:un.stop(j,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case E.Escape:un.stop(j,!0),this.hide(iV.Gesture);break;case E.Tab:if(!j.altKey&&!j.ctrlKey&&!j.metaKey){const re=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?re.push("input"):re.push("input[type=text]"),this.getUI().list.isDisplayed()&&re.push(".monaco-list"),this.getUI().message&&re.push(".quick-input-message a"),this.getUI().widget){if(al(j.target,this.getUI().widget))break;re.push(".quick-input-html-widget")}const me=t.querySelectorAll(re.join(", "));j.shiftKey&&j.target===me[0]?(un.stop(j,!0),U.clearFocus()):!j.shiftKey&&al(j.target,me[me.length-1])&&(un.stop(j,!0),me[0].focus())}break;case E.Space:j.ctrlKey&&(un.stop(j,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:s,title:r,description1:N,description2:d,widget:F,rightActionBar:a,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:w,okContainer:b,ok:C,message:M,customButtonContainer:y,customButton:S,list:U,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:j=>this.show(j),hide:()=>this.hide(),setVisibilities:j=>this.setVisibilities(j),setEnabled:j=>this.setEnabled(j),setContextKey:j=>this.options.setContextKey(j),linkOpenerDelegate:j=>this.options.linkOpenerDelegate(j)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,he(this._container,this.ui.container))}pick(e,t={},i=qe.None){return new Promise((s,o)=>{let r=d=>{r=s,t.onKeyMods?.(a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let c;const l=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),p=a.activeItems.filter(v=>v!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,p&&(a.activeItems=p),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{c&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==c)&&(a.activeItems=[c])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{St(l),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{c=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),c&&(a.activeItems=[c])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&zt(t)?(e.severity=nt.Error,e.validationMessage=t):t&&!zt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=nt.Ignore,e.validationMessage=void 0)}input(e={},t=qe.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const s=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=T.debounce(s.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[s,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(s,h)})}),s.onDidAccept(()=>{const d=s.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!zt(h)&&h.severity!==nt.Error?(i(d),s.hide()):d===a&&this.setValidationOnInput(s,h)})}),t.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{St(l),i(void 0)})];s.title=e.title,s.value=e.value||"",s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.placeholder=e.placeHolder,s.password=!!e.password,s.ignoreFocusOut=!!e.ignoreFocusLost,s.show()})}createQuickPick(){const e=this.getUI(!0);return new r2(e)}createInputBox(){const e=this.getUI(!0);return new skt(e)}createQuickWidget(){const e=this.getUI(!0);return new okt(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",_a(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(nt.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),_a(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();kee.tooltip=s?g(EL,5,"Back ({0})",s):g(EL,6,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,s=i&&!cMe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o?.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}focus(){if(this.isVisible()){const e=this.getUI();e.inputBox.enabled?e.inputBox.setFocus():e.list.domFocus()}}toggle(){this.isVisible()&&this.controller instanceof r2&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.isDisplayed()&&(this.getUI().list.focus(e?Wo.Next:Wo.Previous),t&&this.controller instanceof r2&&(this.controller.quickNavigate=t))}async accept(e={alt:!1,ctrlCmd:!1}){this.keyMods.alt=e.alt,this.keyMods.ctrlCmd=e.ctrlCmd,this.onDidAcceptEmitter.fire()}async back(){this.onDidTriggerButtonEmitter.fire(this.backButton)}async cancel(){this.hide()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,jbe.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},jbe=oN,oN.MAX_WIDTH=600,oN);Kbe=jbe=D([_(1,bg),_(2,be),_(3,Pe)],Kbe);let Vee=class extends VMe{get backButton(){return this.controller.backButton}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Nbe))),this._quickAccess}constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=o,this._onShow=this._register(new I),this.onShow=this._onShow.event,this._onHide=this._register(new I),this.onHide=this._onHide.event,this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(fr).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Fbe))},s=this._register(this.instantiationService.createInstance(Kbe,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{gt(e.activeContainer)===gt(s.container)&&s.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Y(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=qe.None){return this.controller.pick(e,t,i)}input(e={},t=qe.None){return this.controller.input(e,t)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}createQuickWidget(){return this.controller.createQuickWidget()}focus(){this.controller.focus()}toggle(){this.controller.toggle()}navigate(e,t){this.controller.navigate(e,t)}accept(e){return this.controller.accept(e)}back(){return this.controller.back()}cancel(){return this.controller.cancel()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Ye(mWe),quickInputForeground:Ye(M_t),quickInputTitleBackground:Ye(N_t),widgetBorder:Ye(UU),widgetShadow:Ye(__)},inputBox:eV,toggle:See,countBadge:tXe,button:yQ,progressBar:eXe,keybindingLabel:RDt,list:CO({listBackground:mWe,listFocusBackground:$k,listFocusForeground:zk,listInactiveFocusForeground:zk,listInactiveSelectionIconForeground:JB,listInactiveFocusBackground:$k,listFocusOutline:co,listInactiveFocusOutline:co}),pickerGroup:{pickerGroupBorder:Ye(P_t),pickerGroupForeground:Ye(EKe)}}}};Vee=D([_(0,be),_(1,Pe),_(2,pn),_(3,bg),_(4,Re)],Vee);let Ybe=class extends Vee{constructor(e,t,i,s,o,r){super(t,i,s,new Wwe(e.getContainerDomNode(),o),r),this.host=void 0;const a=M7.get(e);if(a){const c=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return c.getDomNode()},getContainer(){return c.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[c.getDomNode()]},get activeContainer(){return c.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return T.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return T.None},get onDidAddContainer(){return T.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Ybe=D([_(1,be),_(2,Pe),_(3,pn),_(4,jt),_(5,Re)],Ybe);let R7=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Ybe,e);this.mapEditorToService.set(e,t),cw(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}createQuickWidget(){return this.activeService.createQuickWidget()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};R7=D([_(0,be),_(1,jt)],R7);const Mae=class Mae{static get(e){return e.getContribution(Mae.ID)}constructor(e){this.editor=e,this.widget=new Jbe(this.editor)}dispose(){this.widget.dispose()}};Mae.ID="editor.controller.quickInput";let M7=Mae;const Nae=class Nae{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Nae.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Yf.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Nae.ID="editor.contrib.quickInputWidget";let Jbe=Nae;vn(M7.ID,M7,mi.Lazy);class d0t{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function h0t(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const u=_0t(d.token,h.token);return u!==0?u:d.index-h.index});let t=ar.None,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==ar.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new f0t;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),c=new ZNe(t,r,a),l=new ePe(c);for(let d=0,h=n.length;d"u"){const s=this._match(t),o=m0t(t);i=(s.metadata|o<<$i.TOKEN_TYPE_OFFSET)>>>0,this._cache.set(t,i)}return(i|e<<$i.LANGUAGEID_OFFSET)>>>0}}const p0t=/\b(comment|string|regex|regexp)\b/;function m0t(n){const e=n.match(p0t);if(!e)return Ar.Other;switch(e[1]){case"comment":return Ar.Comment;case"string":return Ar.String;case"regex":return Ar.RegEx;case"regexp":return Ar.RegEx}throw new Error("Unexpected match for standard token type!")}function _0t(n,e){return ne?1:0}class ZNe{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<$i.FONT_STYLE_OFFSET|this._foreground<<$i.FOREGROUND_OFFSET|this._background<<$i.BACKGROUND_OFFSET)>>>0}clone(){return new ZNe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==ar.NotSet&&(this._fontStyle=e),t!==Ad.None&&(this._foreground=t),i!==Ad.None&&(this._background=i),this.metadata=(this._fontStyle<<$i.FONT_STYLE_OFFSET|this._foreground<<$i.FOREGROUND_OFFSET|this._background<<$i.BACKGROUND_OFFSET)>>>0}}class v0t{constructor(e,t=new Map){if(this.mainRule=e,t instanceof Map)this.children=t;else{this.children=new Map;for(const i in t)this.children.set(i,t[i])}}}class ePe{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}toExternalThemeTrieElement(){const e=new Map;return this._children.forEach((t,i)=>{e.set(i,t.toExternalThemeTrieElement())}),new v0t(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let c=this._children.get(r);typeof c>"u"&&(c=new ePe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,s)}}function w0t(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>zt(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>zt(o.format)&&zt(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:P.parse(o.location)}))}}n.fromJSONObject=t})(TUe||(TUe={}));class A0t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:g(N7,0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:g(N7,1,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${$e.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];const t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enum.splice(t,1),this.iconReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,t){const i=this.iconFontsById[e];return i||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;$e.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${$e.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!$e.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const Iz=new A0t;it.add(WXe.IconContribution,Iz);function ji(n,e,t,i){return Iz.registerIcon(n,e,t,i)}function tPe(){return Iz}function E0t(){const n=FQe();for(const e in n){const t="\\"+n[e].toString(16);Iz.registerIcon(e,{fontCharacter:t})}}E0t();const HXe="vscode://schemas/icons",UXe=it.as(eL.JSONContribution);UXe.registerSchema(HXe,Iz.getIconSchema());const RUe=new yn(()=>UXe.notifySchemaChanged(HXe),200);Iz.onDidChange(()=>{RUe.isScheduled()||RUe.schedule()});const VXe=ji("widget-close",Ce.close,g(N7,2,"Icon for the close action in widgets.")),x0t=ji("goto-previous-location",Ce.arrowUp,g(N7,3,"Icon for goto previous editor location.")),D0t=ji("goto-next-location",Ce.arrowDown,g(N7,4,"Icon for goto next editor location."));$e.modify(Ce.sync,"spin");$e.modify(Ce.loading,"spin");function k0t(n){const e=new Z,t=e.add(new I),i=tPe();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new zXe,o={},r=[],a=[];for(const c of i.getIcons()){const l=s.getIcon(c);if(!l)continue;const d=l.font,h=`--vscode-icon-${c.id}-font-family`,u=`--vscode-icon-${c.id}-content`;d?(o[d.id]=d.definition,a.push(`${h}: ${qY(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${qY(d.id)}; }`)):(a.push(`${u}: '${l.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; }`))}for(const c in o){const l=o[c],d=l.weight?`font-weight: ${l.weight};`:"",h=l.style?`font-style: ${l.style};`:"",u=l.src.map(f=>`${uf(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${qY(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` +`)}}const Iz=new A0t;it.add(WXe.IconContribution,Iz);function Ki(n,e,t,i){return Iz.registerIcon(n,e,t,i)}function tPe(){return Iz}function E0t(){const n=FQe();for(const e in n){const t="\\"+n[e].toString(16);Iz.registerIcon(e,{fontCharacter:t})}}E0t();const HXe="vscode://schemas/icons",UXe=it.as(eL.JSONContribution);UXe.registerSchema(HXe,Iz.getIconSchema());const RUe=new yn(()=>UXe.notifySchemaChanged(HXe),200);Iz.onDidChange(()=>{RUe.isScheduled()||RUe.schedule()});const VXe=Ki("widget-close",Ce.close,g(N7,2,"Icon for the close action in widgets.")),x0t=Ki("goto-previous-location",Ce.arrowUp,g(N7,3,"Icon for goto previous editor location.")),D0t=Ki("goto-next-location",Ce.arrowDown,g(N7,4,"Icon for goto next editor location."));$e.modify(Ce.sync,"spin");$e.modify(Ce.loading,"spin");function k0t(n){const e=new Z,t=e.add(new I),i=tPe();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new zXe,o={},r=[],a=[];for(const c of i.getIcons()){const l=s.getIcon(c);if(!l)continue;const d=l.font,h=`--vscode-icon-${c.id}-font-family`,u=`--vscode-icon-${c.id}-content`;d?(o[d.id]=d.definition,a.push(`${h}: ${qY(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${qY(d.id)}; }`)):(a.push(`${u}: '${l.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; }`))}for(const c in o){const l=o[c],d=l.weight?`font-weight: ${l.weight};`:"",h=l.style?`font-style: ${l.style};`:"",u=l.src.map(f=>`${uf(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${qY(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` `)}}}class zXe{getIcon(e){const t=tPe();let i=e.defaults;for(;$e.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Ck="vs",B$="vs-dark",zW="hc-black",$W="hc-light",$Xe=it.as(xMe.ColorContribution),I0t=it.as(OKe.ThemingContribution);class GXe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(AJ(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get label(){return this.themeName}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,fe.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Xbe(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,fe.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=$Xe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ck:return sf.LIGHT;case zW:return sf.HIGH_CONTRAST_DARK;case $W:return sf.HIGH_CONTRAST_LIGHT;default:return sf.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Xbe(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=BXe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Xf.getForeground(o),a=Xf.getFontStyle(o);return{foreground:r,italic:!!(a&ar.Italic),bold:!!(a&ar.Bold),underline:!!(a&ar.Underline),strikethrough:!!(a&ar.Strikethrough)}}get tokenColorMap(){return[]}}function AJ(n){return n===Ck||n===B$||n===zW||n===$W}function Xbe(n){switch(n){case Ck:return b0t;case B$:return C0t;case zW:return y0t;case $W:return S0t}}function hK(n){const e=Xbe(n);return new GXe(n,e)}class L0t extends ${constructor(){super(),this._onColorThemeChange=this._register(new I),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onFileIconThemeChange=this._register(new I),this.onDidFileIconThemeChange=this._onFileIconThemeChange.event,this._onProductIconThemeChange=this._register(new I),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new zXe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ck,hK(Ck)),this._knownThemes.set(B$,hK(B$)),this._knownThemes.set(zW,hK(zW)),this._knownThemes.set($W,hK($W));const e=this._register(k0t(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ck),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),pZ(yi,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return P9(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=od(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),$.None}_registerShadowDomContainer(e){const t=od(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Ck),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=yi.matchMedia("(forced-colors: active)").matches;if(e!==pS(this._theme.type)){let t;rde(this._theme.type)?t=e?zW:B$:t=e?$W:Ck,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};I0t.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of $Xe.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${tde(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${s.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(w0t(o)),this._themeCSS=e.join(` -`),this._updateCSS(),lc.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Iw=ae("themeService");let Zbe=class extends ${constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=Kd.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._accessibilityModeEnabledContext=Xq.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=yi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(pe(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===Kd.Enabled}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}alwaysUnderlineAccessKeys(){return Promise.resolve(!1)}getAccessibilitySupport(){return this._accessibilitySupport}setAccessibilitySupport(e){this._accessibilitySupport!==e&&(this._accessibilitySupport=e,this._onDidChangeScreenReaderOptimized.fire())}alert(e){sa(e)}status(e){Cu(e)}};Zbe=D([_(0,Pe),_(1,bg),_(2,Re)],Zbe);var _B,TD;const qXe="vs/platform/actions/common/menuService";let eCe=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new tCe(i)}createMenu(e,t,i){return new nCe(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};eCe=D([_(0,Qi),_(1,ti),_(2,sn)],eCe);var rN;let tCe=(rN=class{constructor(e){this._storageService=e,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(ke.PROFILE,_B._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),s=this._data[e.id]?.includes(t)??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Rct(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(_B._key,e,ke.PROFILE,ln.USER)}finally{this._ignoreChangeEvent=!1}}},_B=rN,rN._key="menu.hiddenCommands",rN);tCe=_B=D([_(0,sn)],tCe);let iCe=TD=class{constructor(e,t,i,s,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._keybindingService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Xs.getMenuItems(this._id);let t;e.sort(TD._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(TD._fillInKbExprKeys(e.when,this._structureContextKeys),lR(e)){if(e.command.precondition&&TD._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;TD._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Xs.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=lR(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=T0t(this._id,c?a.command:a,this._hiddenStates);if(c){const d=QXe(a.command.id,a.when,this._commandService,this._keybindingService);(r??=[]).push(new id(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new TD(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Kr.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new uS(a,l,h))}}r&&r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:TD._compareTitles(lR(e)?e.command.title:e.title,lR(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};iCe=TD=D([_(3,Qi),_(4,ti),_(5,Pe)],iCe);let nCe=class{constructor(e,t,i,s,o,r){this._disposables=new Z,this._menuInfo=new iCe(e,t,i.emitEventsForSubmenuChanges,s,o,r);const a=new yn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Xs.onDidChangeMenu(h=>{h.has(e)&&a.schedule()}));const c=this._disposables.add(new Z),l=h=>{let u=!1,f=!1,p=!1;for(const m of h)if(u=u||m.isStructuralChange,f=f||m.isEnablementChange,p=p||m.isToggleChange,u&&f&&p)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p}},d=()=>{c.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),p=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||p)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p})})),c.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new Fle({onWillAddFirstListener:d,onDidRemoveLastListener:c.clear.bind(c),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};nCe=D([_(3,Qi),_(4,ti),_(5,Pe)],nCe);function T0t(n,e,t){const i=kgt(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=_l({id:`hide/${n.id}/${i}`,label:g(qXe,0,"Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=_l({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function QXe(n,e=void 0,t,i){return _l({id:`configureKeybinding/${n}`,label:g(qXe,1,"Configure Keybinding"),run(){const o=!!!i.lookupKeybinding(n)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${n}`+(o?` +when:${o}`:""))}})}var sCe,aN;let oCe=(aN=class extends ${constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(TS||HQe)&&this.installWebKitWriteTextWorkaround(),this._register(T.runAndSubscribe(Vb,({window:i,disposables:s})=>{s.add(pe(i.document,"copy",()=>this.clearResources()))},{window:yi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new sd;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ax().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(pe(t,"click",e)),i.add(pe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await ax().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Kg(),i=t.activeElement,s=t.body.appendChild(we("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),Ra(i)&&i.focus(),t.body.removeChild(s)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await ax().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Ed(e.substring(0,sCe.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},sCe=aN,aN.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,aN);oCe=sCe=D([_(0,bg),_(1,Ze)],oCe);const Mu=ae("clipboardService"),R0t="vs/platform/contextkey/browser/contextKeyService",W$="data-keybinding-context";let iPe=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}updateParent(e){this._parent=e}collectAllValues(){let e=this._parent?this._parent.collectAllValues():Object.create(null);return e={...e,...this._value},delete e._contextId,e}};const Pae=class Pae extends iPe{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};Pae.INSTANCE=new Pae;let cV=Pae;const J8=class J8 extends iPe{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Su.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===Ot.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new aCe(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...fi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new aCe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(J8._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(J8._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}collectAllValues(){const e=Object.create(null);return this._values.forEach((t,i)=>e[i]=t),{...e,...super.collectAllValues()}}};J8._keyPrefix="config.";let rCe=J8;class M0t{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class MUe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class aCe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class N0t{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function P0t(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class jXe extends ${constructor(e){super(),this._onDidChangeContext=this._register(new r1({merge:t=>new N0t(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}get contextId(){return this._myContextId}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new M0t(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new F0t(this,e)}createOverlay(e=fi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new nPe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new MUe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new MUe(e))}getContext(e){return this._isDisposed?cV.INSTANCE:this.getContextValuesContainer(O0t(e))}dispose(){super.dispose(),this._isDisposed=!0}}let cCe=class extends jXe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new rCe(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._contexts.get(e)||cV.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new iPe(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};cCe=D([_(0,Re)],cCe);class F0t extends jXe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Dn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(W$)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(W$,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;P0t(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(W$),super.dispose())}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}updateParent(e){if(this._parent===e)return;const t=this._parent.getContextValuesContainer(this._myContextId),i=t.collectAllValues();this._parent=e,this._updateParentChangeListener();const s=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(s);const o=t.collectAllValues(),r={...f9(i,o),...f9(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new aCe(a))}}class NUe{constructor(e,t){this.parent=e,this.overlay=t}getValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getValue(e)}}class nPe{get contextId(){return this.parent.contextId}get onDidChangeContext(){return this.parent.onDidChangeContext}constructor(e,t){this.parent=e,this.overlay=new Map(t)}bufferChangeEvents(e){this.parent.bufferChangeEvents(e)}createKey(){throw new Error("Not supported.")}getContext(e){return new NUe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new NUe(t,this.overlay)}contextMatchesRules(e){const t=this.getContextValuesContainer(this.contextId);return e?e.evaluate(t):!0}getContextKeyValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getContextKeyValue(e)}createScoped(){throw new Error("Not supported.")}createOverlay(e=fi.empty()){return new nPe(this,e)}updateParent(){throw new Error("Not supported.")}}function O0t(n){for(;n;){if(n.hasAttribute(W$)){const e=n.getAttribute(W$);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function B0t(n,e,t){n.get(Pe).createKey(String(e),W0t(t))}function W0t(n){return AU(n,e=>{if(typeof e=="object"&&e.$mid===Fs.Uri)return P.revive(e).toString();if(e instanceof P)return e.toString()})}yt.registerCommand("_setContext",B0t);yt.registerCommand({id:"getContextKeyInfo",handler(){return[...Y.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:g(R0t,0,"A command that returns information about context keys"),args:[]}});yt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Y.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let H0t=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class PUe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new H0t(t,e),this._nodes.set(t,i)),i}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +`),this._updateCSS(),dc.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Iw=ae("themeService");let Zbe=class extends ${constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=Kd.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._accessibilityModeEnabledContext=Xq.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=yi.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(pe(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===Kd.Enabled}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}alwaysUnderlineAccessKeys(){return Promise.resolve(!1)}getAccessibilitySupport(){return this._accessibilitySupport}setAccessibilitySupport(e){this._accessibilitySupport!==e&&(this._accessibilitySupport=e,this._onDidChangeScreenReaderOptimized.fire())}alert(e){sa(e)}status(e){Cu(e)}};Zbe=D([_(0,Pe),_(1,bg),_(2,Re)],Zbe);var _B,TD;const qXe="vs/platform/actions/common/menuService";let eCe=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new tCe(i)}createMenu(e,t,i){return new nCe(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};eCe=D([_(0,ji),_(1,ti),_(2,on)],eCe);var rN;let tCe=(rN=class{constructor(e){this._storageService=e,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(ke.PROFILE,_B._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(_B._key,ke.PROFILE,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),s=this._data[e.id]?.includes(t)??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Rct(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(_B._key,e,ke.PROFILE,ln.USER)}finally{this._ignoreChangeEvent=!1}}},_B=rN,rN._key="menu.hiddenCommands",rN);tCe=_B=D([_(0,on)],tCe);let iCe=TD=class{constructor(e,t,i,s,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._keybindingService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Xs.getMenuItems(this._id);let t;e.sort(TD._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(TD._fillInKbExprKeys(e.when,this._structureContextKeys),lR(e)){if(e.command.precondition&&TD._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;TD._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Xs.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=lR(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=T0t(this._id,c?a.command:a,this._hiddenStates);if(c){const d=QXe(a.command.id,a.when,this._commandService,this._keybindingService);(r??=[]).push(new id(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new TD(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Kr.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new uS(a,l,h))}}r&&r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:TD._compareTitles(lR(e)?e.command.title:e.title,lR(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};iCe=TD=D([_(3,ji),_(4,ti),_(5,Pe)],iCe);let nCe=class{constructor(e,t,i,s,o,r){this._disposables=new Z,this._menuInfo=new iCe(e,t,i.emitEventsForSubmenuChanges,s,o,r);const a=new yn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Xs.onDidChangeMenu(h=>{h.has(e)&&a.schedule()}));const c=this._disposables.add(new Z),l=h=>{let u=!1,f=!1,p=!1;for(const m of h)if(u=u||m.isStructuralChange,f=f||m.isEnablementChange,p=p||m.isToggleChange,u&&f&&p)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p}},d=()=>{c.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),p=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||p)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:p})})),c.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new Fle({onWillAddFirstListener:d,onDidRemoveLastListener:c.clear.bind(c),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};nCe=D([_(3,ji),_(4,ti),_(5,Pe)],nCe);function T0t(n,e,t){const i=kgt(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=_l({id:`hide/${n.id}/${i}`,label:g(qXe,0,"Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=_l({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function QXe(n,e=void 0,t,i){return _l({id:`configureKeybinding/${n}`,label:g(qXe,1,"Configure Keybinding"),run(){const o=!!!i.lookupKeybinding(n)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${n}`+(o?` +when:${o}`:""))}})}var sCe,aN;let oCe=(aN=class extends ${constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(TS||HQe)&&this.installWebKitWriteTextWorkaround(),this._register(T.runAndSubscribe(Vb,({window:i,disposables:s})=>{s.add(pe(i.document,"copy",()=>this.clearResources()))},{window:yi,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new sd;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ax().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(pe(t,"click",e)),i.add(pe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await ax().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Kg(),i=t.activeElement,s=t.body.appendChild(we("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),Ra(i)&&i.focus(),t.body.removeChild(s)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await ax().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Ed(e.substring(0,sCe.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},sCe=aN,aN.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,aN);oCe=sCe=D([_(0,bg),_(1,Ze)],oCe);const Mu=ae("clipboardService"),R0t="vs/platform/contextkey/browser/contextKeyService",W$="data-keybinding-context";let iPe=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}updateParent(e){this._parent=e}collectAllValues(){let e=this._parent?this._parent.collectAllValues():Object.create(null);return e={...e,...this._value},delete e._contextId,e}};const Pae=class Pae extends iPe{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};Pae.INSTANCE=new Pae;let cV=Pae;const J8=class J8 extends iPe{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Su.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===Ot.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new aCe(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...fi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new aCe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(J8._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(J8._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}collectAllValues(){const e=Object.create(null);return this._values.forEach((t,i)=>e[i]=t),{...e,...super.collectAllValues()}}};J8._keyPrefix="config.";let rCe=J8;class M0t{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class MUe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class aCe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class N0t{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function P0t(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class jXe extends ${constructor(e){super(),this._onDidChangeContext=this._register(new r1({merge:t=>new N0t(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}get contextId(){return this._myContextId}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new M0t(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new F0t(this,e)}createOverlay(e=fi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new nPe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new MUe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new MUe(e))}getContext(e){return this._isDisposed?cV.INSTANCE:this.getContextValuesContainer(O0t(e))}dispose(){super.dispose(),this._isDisposed=!0}}let cCe=class extends jXe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new rCe(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._contexts.get(e)||cV.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new iPe(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};cCe=D([_(0,Re)],cCe);class F0t extends jXe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Dn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(W$)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(W$,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;P0t(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(W$),super.dispose())}getContextValuesContainer(e){return this._isDisposed?cV.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}updateParent(e){if(this._parent===e)return;const t=this._parent.getContextValuesContainer(this._myContextId),i=t.collectAllValues();this._parent=e,this._updateParentChangeListener();const s=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(s);const o=t.collectAllValues(),r={...f9(i,o),...f9(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new aCe(a))}}class NUe{constructor(e,t){this.parent=e,this.overlay=t}getValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getValue(e)}}class nPe{get contextId(){return this.parent.contextId}get onDidChangeContext(){return this.parent.onDidChangeContext}constructor(e,t){this.parent=e,this.overlay=new Map(t)}bufferChangeEvents(e){this.parent.bufferChangeEvents(e)}createKey(){throw new Error("Not supported.")}getContext(e){return new NUe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new NUe(t,this.overlay)}contextMatchesRules(e){const t=this.getContextValuesContainer(this.contextId);return e?e.evaluate(t):!0}getContextKeyValue(e){return this.overlay.has(e)?this.overlay.get(e):this.parent.getContextKeyValue(e)}createScoped(){throw new Error("Not supported.")}createOverlay(e=fi.empty()){return new nPe(this,e)}updateParent(){throw new Error("Not supported.")}}function O0t(n){for(;n;){if(n.hasAttribute(W$)){const e=n.getAttribute(W$);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function B0t(n,e,t){n.get(Pe).createKey(String(e),W0t(t))}function W0t(n){return AU(n,e=>{if(typeof e=="object"&&e.$mid===Fs.Uri)return P.revive(e).toString();if(e instanceof P)return e.toString()})}yt.registerCommand("_setContext",B0t);yt.registerCommand({id:"getContextKeyInfo",handler(){return[...Y.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:g(R0t,0,"A command that returns information about context keys"),args:[]}});yt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Y.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let H0t=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class PUe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new H0t(t,e),this._nodes.set(t,i)),i}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` `)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const U0t=!1;class FUe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class P7{constructor(e=new Dl,t=!1,i,s=U0t){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(be,this),this._globalGraph=s?i?._globalGraph??new PUe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,St(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)cz(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends P7{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t?.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=H$.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw Nle("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof $i?(i=H$.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=H$.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Ov.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of s){const c=this._getOrCreateServiceInstance(a.id,i);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(c)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof $i)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof $i?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const s=new PUe(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(s.lookupOrInsertNode(a),o++>1e3)throw new FUe(s);for(const c of Ov.getServiceDependencies(a.desc.ctor)){const l=this._getServiceInstanceOrDescriptor(c.id);if(l||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(a.id),String(c.id)),l instanceof $i){const d={id:c.id,desc:l,_trace:a._trace.branch(c.id,!0)};s.lookup(d)||r.push(d),s.insertEdge(a,d)}}}for(;;){const a=s.roots();if(a.length===0){if(!s.isEmpty())throw new FUe(s);break}for(const{data:c}of a){if(this._getServiceInstanceOrDescriptor(c.id)instanceof $i){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,d)}s.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof $i)return this._createServiceInstance(e,t,i,s,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o,r){if(s){const a=new P7(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new kve(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of c){const f=d[h];if(typeof f=="function")for(const p of u)p.disposable=f.apply(d,p.listener)}return c.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!l.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let p=c.get(h);return p||(p=new td,c.set(h,p)),(v,w,b)=>{if(l.isInitialized)return l.value[h](v,w,b);{const C={listener:[v,w,b],disposable:void 0},y=p.push(C);return Ee(()=>{y(),C.disposable?.dispose()})}}}if(h in d)return d[h];const u=l.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return l.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}var TT;(function(n){n[n.None=0]="None",n[n.Creation=1]="Creation",n[n.Invocation=2]="Invocation",n[n.Branch=3]="Branch"})(TT||(TT={}));const Tp=class Tp{static traceInvocation(e,t){return e?new Tp(TT.Invocation,t.name||new Error().stack.split(` +${e.toString()}`}}class P7{constructor(e=new Dl,t=!1,i,s=U0t){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(be,this),this._globalGraph=s?i?._globalGraph??new PUe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,St(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)cz(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends P7{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t?.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=H$.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw Nle("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof Gi?(i=H$.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=H$.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Ov.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of s){const c=this._getOrCreateServiceInstance(a.id,i);c||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(c)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Gi)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Gi?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const s=new PUe(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(s.lookupOrInsertNode(a),o++>1e3)throw new FUe(s);for(const c of Ov.getServiceDependencies(a.desc.ctor)){const l=this._getServiceInstanceOrDescriptor(c.id);if(l||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(a.id),String(c.id)),l instanceof Gi){const d={id:c.id,desc:l,_trace:a._trace.branch(c.id,!0)};s.lookup(d)||r.push(d),s.insertEdge(a,d)}}}for(;;){const a=s.roots();if(a.length===0){if(!s.isEmpty())throw new FUe(s);break}for(const{data:c}of a){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Gi){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,d)}s.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof Gi)return this._createServiceInstance(e,t,i,s,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o,r){if(s){const a=new P7(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new kve(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of c){const f=d[h];if(typeof f=="function")for(const p of u)p.disposable=f.apply(d,p.listener)}return c.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!l.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let p=c.get(h);return p||(p=new td,c.set(h,p)),(v,w,b)=>{if(l.isInitialized)return l.value[h](v,w,b);{const C={listener:[v,w,b],disposable:void 0},y=p.push(C);return Ee(()=>{y(),C.disposable?.dispose()})}}}if(h in d)return d[h];const u=l.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return l.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}var TT;(function(n){n[n.None=0]="None",n[n.Creation=1]="Creation",n[n.Invocation=2]="Invocation",n[n.Branch=3]="Branch"})(TT||(TT={}));const Tp=class Tp{static traceInvocation(e,t){return e?new Tp(TT.Invocation,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):Tp._None}static traceCreation(e,t){return e?new Tp(TT.Creation,t.name):Tp._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Tp(TT.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Tp._totals+=e;let t=!1;function i(o,r){const a=[],c=new Array(o+1).join(" ");for(const[l,d,h]of r._dep)if(d&&h){t=!0,a.push(`${c}CREATES -> ${l}`);const u=i(o+1,h);u&&a.push(u)}else a.push(`${c}uses -> ${l}`);return a.join(` `)}const s=[`${this.type===TT.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Tp._totals.toFixed(2)}ms)`];(e>2||t)&&Tp.all.add(s.join(` `))}};Tp.all=new Set,Tp._None=new class extends Tp{constructor(){super(TT.None,null)}stop(){}branch(){return this}},Tp._totals=0;let H$=Tp;const V0t=new Set([_e.inMemory,_e.vscodeSourceControl,_e.walkThrough,_e.walkThroughSnippet,_e.vscodeChatCodeBlock,_e.vscodeCopilotBackingChatCodeBlock]);class z0t{constructor(){this._byResource=new wi,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new wi,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??fi.empty():P.isUri(e)?this._byResource.get(e)?.values()??fi.empty():fi.map(fi.concat(...this._byOwner.values()),t=>t[1])}}class $0t{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new wi,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(V0t.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ys.Error?t.errors+=1:i===Ys.Warning?t.warnings+=1:i===Ys.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class XD{constructor(){this._onMarkerChanged=new Fle({delay:0,merge:XD._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new z0t,this._stats=new $0t(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}getStatistics(){return this._stats}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(iO(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=XD._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}=i;if(r)return c=c>0?c:1,l=l>0?l:1,d=d>=c?d:c,h=h>0?h:l,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=fi.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(mo(t)){const o=new wi;for(const{resource:r,marker:a}of t){const c=XD._toMarker(e,r,a);if(!c)continue;const l=o.get(r);l?l.push(c):(o.set(r,[c]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const c of r)if(XD._accept(c,s)){const l=a.push(c);if(o>0&&l===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const c of a)if(XD._accept(c,s)){const l=r.push(c);if(o>0&&l===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const c of r)for(const l of c)if(XD._accept(l,s)){const d=a.push(l);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new wi;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}const sPe=ae("policy");let KXe=class extends ${get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=_s.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(it.as(Cs.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:t})=>this.onDidUpdateConfiguration(Array.from(e),t))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,t){this.updateConfigurationModel(e,it.as(Cs.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=_s.createEmptyModel(this.logService);const e=it.as(Cs.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}};class G0t{constructor(){this.onDidChangeConfiguration=T.None,this.configurationModel=_s.createEmptyModel(new vSt)}async initialize(){return this.configurationModel}}let lCe=class extends ${get configurationModel(){return this._configurationModel}constructor(e,t,i){super(),this.defaultConfiguration=e,this.policyService=t,this.logService=i,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=_s.createEmptyModel(this.logService)}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!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);const t={},i=[],s=it.as(Cs.Configuration).getConfigurationProperties();for(const o of e){const r=s[o];if(!r){i.push(o);continue}if(r.policy){if(r.type!=="string"&&r.type!=="number"){this.logService.warn(`Policy ${r.policy.name} has unsupported type ${r.type}`);continue}i.push(o),t[r.policy.name]={type:r.type}}}return n1(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const t=it.as(Cs.Configuration).getPolicyConfigurations(),i=Ui(e.map(s=>t.get(s)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);const i=it.as(Cs.Configuration).getConfigurationProperties(),s=[],o=this._configurationModel.isEmpty();for(const r of e){const a=i[r]?.policy?.name;if(a){const c=this.policyService.getPolicyValue(a);(o?c!==void 0:!Io(this._configurationModel.getValue(r),c))&&s.push([r,c])}else this._configurationModel.getValue(r)!==void 0&&s.push([r,void 0])}if(s.length){this.logService.trace("PolicyConfiguration#changed",s);const r=this._configurationModel;this._configurationModel=_s.createEmptyModel(this.logService);for(const a of r.keys)this._configurationModel.setValue(a,r.getValue(a));for(const[a,c]of s)c===void 0?this._configurationModel.removeValue(a):this._configurationModel.setValue(a,c);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};lCe=D([_(1,sPe),_(2,Ze)],lCe);const Lw=ae("accessibilitySignalService");class YXe extends ${constructor(e,t=[]){super(),this.logger=new _St([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}}class q0t{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new I}get onWillDispose(){return this._onWillDispose.event}resolve(){return Promise.resolve()}get textEditorModel(){return this.model}createSnapshot(){return this.model.createSnapshot()}isReadonly(){return!1}dispose(){this.disposed=!0,this._onWillDispose.fire()}isDisposed(){return this.disposed}isResolved(){return!0}getLanguageId(){return this.model.getLanguageId()}}let dCe=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new llt(new q0t(t))):Promise.reject(new Error("Model not found"))}registerTextModelContentProvider(e,t){return{dispose:function(){}}}canHandleResource(e){return!1}};dCe=D([_(0,Ai)],dCe);const Fae=class Fae{show(){return Fae.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};Fae.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let hCe=Fae;class Q0t{withProgress(e,t,i){return t({report:()=>{}})}}class j0t{constructor(){this.stateResource=P.from({scheme:"monaco",authority:"stateResource"}),this.userRoamingDataHome=P.from({scheme:"monaco",authority:"userRoamingDataHome"}),this.keyboardLayoutResource=P.from({scheme:"monaco",authority:"keyboardLayoutResource"}),this.argvResource=P.from({scheme:"monaco",authority:"argvResource"}),this.untitledWorkspacesHome=P.from({scheme:"monaco",authority:"untitledWorkspacesHome"}),this.workspaceStorageHome=P.from({scheme:"monaco",authority:"workspaceStorageHome"}),this.localHistoryHome=P.from({scheme:"monaco",authority:"localHistoryHome"}),this.cacheHome=P.from({scheme:"monaco",authority:"cacheHome"}),this.userDataSyncHome=P.from({scheme:"monaco",authority:"userDataSyncHome"}),this.sync=void 0,this.continueOn=void 0,this.editSessionId=void 0,this.debugExtensionHost={port:null,break:!1},this.isExtensionDevelopment=!1,this.disableExtensions=!1,this.enableExtensions=void 0,this.extensionDevelopmentLocationURI=void 0,this.extensionDevelopmentKind=void 0,this.extensionTestsLocationURI=void 0,this.logsHome=P.from({scheme:"monaco",authority:"logsHome"}),this.logLevel=void 0,this.extensionLogLevel=void 0,this.verbose=!1,this.isBuilt=!1,this.disableTelemetry=!1,this.serviceMachineIdResource=P.from({scheme:"monaco",authority:"serviceMachineIdResource"}),this.policyFile=void 0}}class K0t{constructor(){this.onWillShowDialog=T.None,this.onDidShowDialog=T.None}async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),yi.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const s=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),t=await s[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:nt.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:nt.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:nt.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const X8=class X8{constructor(){this.onDidAddNotification=T.None,this.onDidRemoveNotification=T.None,this.onDidChangeFilter=T.None}info(e){return this.notify({severity:nt.Info,message:e})}warn(e){return this.notify({severity:nt.Warning,message:e})}error(e){return this.notify({severity:nt.Error,message:e})}notify(e){switch(e.severity){case nt.Error:console.error(e.message);break;case nt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return X8.NO_OP}prompt(e,t,i,s){return X8.NO_OP}status(e,t){return $.None}setFilter(e){}getFilter(e){return Bwe.OFF}getFilters(){return[]}removeFilter(e){}};X8.NO_OP=new Gyt;let uCe=X8,gCe=class{constructor(e){this._onWillExecuteCommand=new I,this._onDidExecuteCommand=new I,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=yt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};gCe=D([_(0,be)],gCe);let x1=class extends JEt{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(pe(f,xe.KEY_DOWN,m=>{const v=new os(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(pe(f,xe.KEY_UP,m=>{const v=new os(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Y0t(f,p))},c=f=>{for(let p=0;p{f.getOption(x.inDiffEditor)||a(f.getContainerDomNode())},d=f=>{f.getOption(x.inDiffEditor)||c(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(l);const h=f=>{a(f.getContainerDomNode())},u=f=>{c(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,s){return pa(yt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:Ave(i.keybinding,zc),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ee(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return yi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new vee(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[s++]=new vee(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return XU.resolveKeybinding(e,zc)}resolveKeyboardEvent(e){const t=new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new XU([t],zc)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};x1=D([_(0,Pe),_(1,Qi),_(2,on),_(3,Pi),_(4,Ze),_(5,Qt)],x1);class Y0t extends ${constructor(e,t){super(),this.domNode=e,this._register(t)}}function OUe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof P)}let zee=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new KXe(e);this._configuration=new f7(t.reload(),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),new wi,_s.createEmptyModel(e),new wi,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=OUe(e)?e:OUe(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new ANe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=Ot.MEMORY,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}keys(){return this._configuration.keys(void 0)}reloadConfiguration(){return Promise.resolve(void 0)}getConfigurationData(){const e={contents:{},keys:[],overrides:[]};return{defaults:e,policy:e,application:e,user:e,workspace:e,folders:[]}}};zee=D([_(0,Ze)],zee);let fCe=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=oe.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}updateValue(e,t,i,s){return this.configurationService.updateValue(t,i,{resource:e},s)}};fCe=D([_(0,Re),_(1,Ai),_(2,Di)],fCe);let pCe=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:jr||ei?` +`+t),yi.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const s=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),t=await s[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:nt.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:nt.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:nt.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const X8=class X8{constructor(){this.onDidAddNotification=T.None,this.onDidRemoveNotification=T.None,this.onDidChangeFilter=T.None}info(e){return this.notify({severity:nt.Info,message:e})}warn(e){return this.notify({severity:nt.Warning,message:e})}error(e){return this.notify({severity:nt.Error,message:e})}notify(e){switch(e.severity){case nt.Error:console.error(e.message);break;case nt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return X8.NO_OP}prompt(e,t,i,s){return X8.NO_OP}status(e,t){return $.None}setFilter(e){}getFilter(e){return Bwe.OFF}getFilters(){return[]}removeFilter(e){}};X8.NO_OP=new Gyt;let uCe=X8,gCe=class{constructor(e){this._onWillExecuteCommand=new I,this._onDidExecuteCommand=new I,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=yt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};gCe=D([_(0,be)],gCe);let x1=class extends JEt{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(pe(f,xe.KEY_DOWN,m=>{const v=new os(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(pe(f,xe.KEY_UP,m=>{const v=new os(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Y0t(f,p))},c=f=>{for(let p=0;p{f.getOption(x.inDiffEditor)||a(f.getContainerDomNode())},d=f=>{f.getOption(x.inDiffEditor)||c(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(l);const h=f=>{a(f.getContainerDomNode())},u=f=>{c(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,s){return pa(yt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:Ave(i.keybinding,$c),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ee(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return yi.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new vee(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[s++]=new vee(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return XU.resolveKeybinding(e,$c)}resolveKeyboardEvent(e){const t=new RS(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new XU([t],$c)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};x1=D([_(0,Pe),_(1,ji),_(2,rn),_(3,Pi),_(4,Ze),_(5,jt)],x1);class Y0t extends ${constructor(e,t){super(),this.domNode=e,this._register(t)}}function OUe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof P)}let zee=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new KXe(e);this._configuration=new f7(t.reload(),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),_s.createEmptyModel(e),new wi,_s.createEmptyModel(e),new wi,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=OUe(e)?e:OUe(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new ANe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=Ot.MEMORY,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}keys(){return this._configuration.keys(void 0)}reloadConfiguration(){return Promise.resolve(void 0)}getConfigurationData(){const e={contents:{},keys:[],overrides:[]};return{defaults:e,policy:e,application:e,user:e,workspace:e,folders:[]}}};zee=D([_(0,Ze)],zee);let fCe=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=oe.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}updateValue(e,t,i,s){return this.configurationService.updateValue(t,i,{resource:e},s)}};fCe=D([_(0,Re),_(1,Ai),_(2,Di)],fCe);let pCe=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:jr||ei?` `:`\r -`}};pCe=D([_(0,Re)],pCe);class J0t{constructor(){this.telemetryLevel=sp.NONE,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}setEnabled(){}setExperimentProperty(){}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}}const $2=class $2{constructor(){this._onDidChangeWorkspaceName=new I,this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onWillChangeWorkspaceFolders=new I,this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=new I,this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkbenchState=new I,this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event;const e=P.from({scheme:$2.SCHEME,authority:"model",path:"/"});this.workspace={id:LJe,folders:[new Cde({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?Nn.WORKSPACE:Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===$2.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===$2.SCHEME}isCurrentWorkspace(e){return!0}};$2.SCHEME="inmemory";let mCe=$2;function $ee(n,e,t){if(!e||!(n instanceof zee))return;const i=[];Object.keys(e).forEach(s=>{OEt(s)&&i.push([`editor.${s}`,e[s]]),t&&BEt(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let _Ce=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return $.None}async apply(e,t){const i=Array.isArray(e)?e:_Q.convert(e),s=new Map;for(const a of i){if(!(a instanceof vS))throw new Error("bad edit - only text edits are supported");const c=this._modelService.getModel(a.resource);if(!c)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&c.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let l=s.get(c);l||(l=[],s.set(c,l)),l.push(ds.replaceMove(O.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of s)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:r_(dbe.bulkEditServiceSummary,o,r),isApplied:o>0}}};_Ce=D([_(0,Ai)],_Ce);class X0t{constructor(){this.onDidChangeFormatters=T.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ui(e)}getWorkspaceLabel(e,t){return""}getSeparator(e,t){return"/"}registerFormatter(e){throw new Error("Not implemented")}registerCachedFormatter(e){return this.registerFormatter(e)}getHostLabel(){return""}getHostTooltip(){}}let vCe=class extends REt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};vCe=D([_(0,bg),_(1,Qt)],vCe);class Z0t{constructor(){this._neverEmitter=new I,this.onDidChangeTrust=this._neverEmitter.event,this.onDidChangeTrustedFolders=this._neverEmitter.event,this.workspaceResolved=Promise.resolve(),this.workspaceTrustInitialized=Promise.resolve(),this.acceptsOutOfWorkspaceFiles=!0}isWorkspaceTrusted(){return!0}isWorkspaceTrustForced(){return!1}canSetParentFolderTrust(){return!1}async setParentFolderTrust(e){}canSetWorkspaceTrust(){return!1}async setWorkspaceTrust(e){}getUriTrustInfo(e){throw new Error("Method not supported.")}async setUrisTrust(e,t){}getTrustedUris(){return[]}async setTrustedUris(e){}addWorkspaceTrustTransitionParticipant(e){throw new Error("Method not supported.")}}class e1t extends Cee{constructor(){super()}}class t1t extends YXe{constructor(){super(new mSt)}}let wCe=class extends xbe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};wCe=D([_(0,on),_(1,Pi),_(2,W_),_(3,ti),_(4,mc),_(5,Pe)],wCe);class i1t{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return gQe.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return T.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ze,t1t,Kt.Eager);ce(Re,zee,Kt.Eager);ce(dl,fCe,Kt.Eager);ce(bMe,pCe,Kt.Eager);ce(Ti,mCe,Kt.Eager);ce(eo,X0t,Kt.Eager);ce(on,J0t,Kt.Eager);ce(To,K0t,Kt.Eager);ce(Il,j0t,Kt.Eager);ce(Pi,uCe,Kt.Eager);ce(U_,XD,Kt.Eager);ce(Di,e1t,Kt.Eager);ce(Iw,L0t,Kt.Eager);ce(Ai,Mbe,Kt.Eager);ce(EMe,Rbe,Kt.Eager);ce(Pe,cCe,Kt.Eager);ce(Cf,Q0t,Kt.Eager);ce(eD,hCe,Kt.Eager);ce(sn,IDt,Kt.Eager);ce(kd,jve,Kt.Eager);ce(vO,_Ce,Kt.Eager);ce(oA,Z0t,Kt.Eager);ce(Rn,dCe,Kt.Eager);ce(Ur,Zbe,Kt.Eager);ce(yf,IIt,Kt.Eager);ce(Qi,gCe,Kt.Eager);ce(ti,x1,Kt.Eager);ce(On,R7,Kt.Eager);ce(W_,vCe,Kt.Eager);ce(fr,Tbe,Kt.Eager);ce(Mu,oCe,Kt.Eager);ce(Vr,wCe,Kt.Eager);ce(mc,eCe,Kt.Eager);ce(Lw,i1t,Kt.Eager);var Lt;(function(n){const e=new Dl;for(const[c,l]of Hve())e.set(c,l);const t=new P7(e,!0);e.set(be,t);function i(c){s||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof $i?t.invokeFunction(d=>d.get(c)):l}n.get=i;let s=!1;const o=new I;function r(c){if(s)return t;s=!0;for(const[l,d]of Hve())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof $i&&e.set(d,c[l])}return o.fire(),t}n.initialize=r;function a(c){if(s)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}n.withServices=a})(Lt||(Lt={}));var n1t=".monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{font-size:13px;height:0;line-height:14px;transform:translateY(-10px)}.monaco-editor .diff-hidden-lines .bottom.dragging,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .bottom,.monaco-editor .diff-hidden-lines .top{background-clip:padding-box;background-color:transparent;border-bottom:2px solid transparent;border-top:4px solid transparent;height:4px;transition:background-color .1s ease-out}.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *{cursor:n-resize!important}.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *{cursor:s-resize!important}.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{align-items:center;background:var(--vscode-editor-background);display:flex;justify-content:center;z-index:1}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);color:var(--vscode-diffEditor-unchangedRegionForeground);display:block;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedModified,.monaco-editor .movedOriginal{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedModified.currentMove,.monaco-editor .movedOriginal.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{pointer-events:none;position:absolute}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-removedTextBackground);margin-left:-1px}.monaco-editor .char-insert.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{font-size:12px;height:12px;width:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{align-items:center;display:flex!important;font-size:11px!important;opacity:.7!important}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-editor.hc-light .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{position:absolute;z-index:10}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .char-insert,.monaco-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-diff-editor .line-insert,.monaco-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-insert,.monaco-editor .line-insert{border:1px solid var(--vscode-diffEditor-insertedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-insert,.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .char-insert,.monaco-editor.hc-light .line-insert{border-style:dashed}.monaco-editor .char-delete,.monaco-editor .line-delete{border:1px solid var(--vscode-diffEditor-removedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-delete,.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .char-delete,.monaco-editor.hc-light .line-delete{border-style:dashed}.monaco-diff-editor .gutter-insert,.monaco-editor .gutter-insert,.monaco-editor .inline-added-margin-view-zone{background-color:var(--vscode-diffEditorGutter-insertedLineBackground,var(--vscode-diffEditor-insertedLineBackground),var(--vscode-diffEditor-insertedTextBackground))}.monaco-diff-editor .char-delete,.monaco-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-diff-editor .line-delete,.monaco-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor .gutter-delete,.monaco-editor .gutter-delete,.monaco-editor .inline-deleted-margin-view-zone{background-color:var(--vscode-diffEditorGutter-removedLineBackground,var(--vscode-diffEditor-removedLineBackground),var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--vscode-diffEditor-border);box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor.side-by-side .editor.original{border-right:1px solid var(--vscode-diffEditor-border);box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;&>div{position:absolute}.gutterItem{opacity:0;transition:opacity .7s;&.showAlways{opacity:1}&.noTransition,&.showAlways{transition:none}}&:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.gutterItem{.background{border-left:2px solid var(--vscode-menu-border);height:100%;left:50%;position:absolute;width:1px}.buttons{align-items:center;display:flex;justify-content:center;position:absolute;width:100%;.monaco-toolbar{height:fit-content;.monaco-action-bar{line-height:1;.actions-container{background:var(--vscode-editorGutter-commentRangeForeground);border-radius:4px;width:fit-content;.action-item{&:hover{background:var(--vscode-toolbar-hoverBackground)}.action-label{padding:1px 2px}}}}}}}}";Ct(n1t,{});class M_{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new M_(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new M_(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,vt.Immediate)}}class Gee{static capture(e){if(e.hasPendingScrollAnimation())return new Gee(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const s=e.getVisibleRanges();return s.length>0&&(t=s.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new Gee(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getBottomForLineNumber(this._visiblePosition.lineNumber);e.setScrollTop(t-this._visiblePositionScrollDelta,vt.Immediate)}}}function oPe(){return IU&&!!IU.VSCODE_DEV}function JXe(n){if(oPe()){const e=s1t();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function s1t(){uK||(uK=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const i of uK){const s=i(t);if(s)return s}}),uK}let uK;oPe()&&JXe(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const s in i){const o=i[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=n[s];if(r){for(const a of Object.getOwnPropertyNames(o.prototype)){const c=Object.getOwnPropertyDescriptor(o.prototype,a),l=Object.getOwnPropertyDescriptor(r.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${s}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[s]=r}}}return!0}});function o1t(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(c),r++):(s.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function A3(n,e){return n.appendChild(e),Ee(()=>{n.removeChild(e)})}function r1t(n,e){return n.prepend(e),Ee(()=>{n.removeChild(e)})}class XXe extends ${get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new gKe(e,t)),this._width=xi(this,this.elementSizeObserver.getWidth()),this._height=xi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>En(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function BUe(n,e,t){let i=e.get(),s=i,o=i;const r=xi("animatedValue",i);let a=-1;const c=300;let l;t.add(Az({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(n.cancelAnimationFrame(l),l=void 0),s=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(a1t(h,s,i-s,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const Oae=class Oae{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Oae._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Oae._counter=0;let bCe=Oae;function D1(n,e){return Ni(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function _v(n,e){return c1t([n],e),n}function c1t(n,e){oPe()&&Bh("reload",i=>JXe(({oldExports:s})=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function jee(n,e,t,i){const s=new Z,o=[];return s.add(Em((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(const u of o)h.removeZone(u),i?.delete(u);o.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(Az({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}},(h,u)=>{for(const f of c)f.onChange&&(d.set(f.onChange,l.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),s}class l1t extends ai{dispose(){super.dispose(!0)}}function WUe(n,e){const t=t1(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return O.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return O.fromPositions(new oe(s,n.column))}if(!t.innerChanges)return O.fromPositions(new oe(t.modified.startLineNumber,1));const i=t1(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return O.fromPositions(new oe(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=d1t(i.originalRange.getEndPosition(),n);return O.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function d1t(n,e){return n.lineNumber===e.lineNumber?new gf(0,e.column-n.column):new gf(e.lineNumber-n.lineNumber,e.column-1)}function h1t(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}function eZe(n,e,t){return Wn(i=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(n)&&i(s)}),()=>t.getValue(n)??e)}function dA(n,e,t){const i=n.bindTo(e);return bQ({debugName:()=>`Set Context Key "${n.key}"`},s=>{i.set(t(s))})}const jn="vs/platform/accessibilitySignal/browser/accessibilitySignalService";let HUe=class extends ${constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Wn(this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new tZ(s=>eZe(s.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new tZ({getCacheKey:Lxt},s=>Dt(o=>{const r=this._signalConfigValue.get(s.signal).read(o);return!!((s.modality==="sound"||s.modality===void 0)&&UUe(r.sound,()=>this.screenReaderAttached.read(o),s.userGesture)||(s.modality==="announcement"||s.modality===void 0)&&UUe(r.announcement,()=>this.screenReaderAttached.read(o),s.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new LNe(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,s=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&s&&this.accessibilityService.status(s),(t.modality==="sound"||t.modality===void 0)&&this.isSoundEnabled(e,t.userGesture)&&(this.sendSignalTelemetry(e,t.source),await this.playSound(e.sound.getSound(),t.allowManyInParallel))}async playSignals(e){for(const o of e)this.sendSignalTelemetry("signal"in o?o.signal:o,"source"in o?o.source:void 0);const t=e.map(o=>"signal"in o?o.signal:o),i=t.filter(o=>this.isAnnouncementEnabled(o)).map(o=>o.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const s=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(s).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),s=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(s)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(s),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibilitySignals.volume");return typeof e!="number"?50:Math.max(Math.min(e,100),0)}async playSound(e,t=!1){if(!t&&this.playingSounds.has(e))return;this.playingSounds.add(e);const i=lp.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const s=this.sounds.get(i);if(s)s.volume=this.getVolumeInPercent()/100,s.currentTime=0,await s.play();else{const o=await u1t(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(s){s.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",s)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const s=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&s()},t)})};return s(),Ee(()=>i=!1)}isAnnouncementEnabled(e,t){return e.announcementMessage?this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"announcement"}).get():!1}isSoundEnabled(e,t){return this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"sound"}).get()}onSoundEnabledChanged(e){return this.getEnabledState(e,!1).onDidChange}getDelayMs(e,t,i){const s=this.configurationService.getValue("accessibility.signalOptions");if(!s||!s.debouncePositionChanges)return 0;let o;return e.name===Zl.errorAtPosition.name&&i==="positional"?o=s["experimental.delays"].errorAtPosition:e.name===Zl.warningAtPosition.name&&i==="positional"?o=s["experimental.delays"].warningAtPosition:o=s["experimental.delays"].general,t==="sound"?o.sound:o.announcement}};HUe=D([_(0,Re),_(1,Ur),_(2,on)],HUe);function UUe(n,e,t){return n==="on"||n==="always"||n==="auto"&&e()||n==="userGesture"&&t}function u1t(n,e){return new Promise((t,i)=>{const s=new Audio(n);s.volume=e,s.addEventListener("ended",()=>{t(s)}),s.addEventListener("error",o=>{i(o.error)}),s.play().catch(o=>{i(o)})})}const Yn=class Yn{static register(e){return new Yn(e.fileName)}constructor(e){this.fileName=e}};Yn.error=Yn.register({fileName:"error.mp3"}),Yn.warning=Yn.register({fileName:"warning.mp3"}),Yn.success=Yn.register({fileName:"success.mp3"}),Yn.foldedArea=Yn.register({fileName:"foldedAreas.mp3"}),Yn.break=Yn.register({fileName:"break.mp3"}),Yn.quickFixes=Yn.register({fileName:"quickFixes.mp3"}),Yn.taskCompleted=Yn.register({fileName:"taskCompleted.mp3"}),Yn.taskFailed=Yn.register({fileName:"taskFailed.mp3"}),Yn.terminalBell=Yn.register({fileName:"terminalBell.mp3"}),Yn.diffLineInserted=Yn.register({fileName:"diffLineInserted.mp3"}),Yn.diffLineDeleted=Yn.register({fileName:"diffLineDeleted.mp3"}),Yn.diffLineModified=Yn.register({fileName:"diffLineModified.mp3"}),Yn.chatRequestSent=Yn.register({fileName:"chatRequestSent.mp3"}),Yn.chatResponseReceived1=Yn.register({fileName:"chatResponseReceived1.mp3"}),Yn.chatResponseReceived2=Yn.register({fileName:"chatResponseReceived2.mp3"}),Yn.chatResponseReceived3=Yn.register({fileName:"chatResponseReceived3.mp3"}),Yn.chatResponseReceived4=Yn.register({fileName:"chatResponseReceived4.mp3"}),Yn.clear=Yn.register({fileName:"clear.mp3"}),Yn.save=Yn.register({fileName:"save.mp3"}),Yn.format=Yn.register({fileName:"format.mp3"}),Yn.voiceRecordingStarted=Yn.register({fileName:"voiceRecordingStarted.mp3"}),Yn.voiceRecordingStopped=Yn.register({fileName:"voiceRecordingStopped.mp3"}),Yn.progress=Yn.register({fileName:"progress.mp3"});let Ir=Yn;class g1t{constructor(e){this.randomOneOf=e}getSound(e=!1){if(e||this.randomOneOf.length===1)return this.randomOneOf[0];{const t=Math.floor(Math.random()*this.randomOneOf.length);return this.randomOneOf[t]}}}const Ji=class Ji{constructor(e,t,i,s,o,r,a){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.delaySettingsKey=a}static register(e){const t=new g1t("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ji(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.delaySettingsKey);return Ji._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Ji._signals=new Set,Ji.errorAtPosition=Ji.register({name:g(jn,0,"Error at Position"),sound:Ir.error,announcementMessage:g(jn,1,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Ji.warningAtPosition=Ji.register({name:g(jn,2,"Warning at Position"),sound:Ir.warning,announcementMessage:g(jn,3,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Ji.errorOnLine=Ji.register({name:g(jn,4,"Error on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(jn,5,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Ji.warningOnLine=Ji.register({name:g(jn,6,"Warning on Line"),sound:Ir.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(jn,7,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Ji.foldedArea=Ji.register({name:g(jn,8,"Folded Area on Line"),sound:Ir.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(jn,9,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Ji.break=Ji.register({name:g(jn,10,"Breakpoint on Line"),sound:Ir.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(jn,11,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Ji.inlineSuggestion=Ji.register({name:g(jn,12,"Inline Suggestion on Line"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Ji.terminalQuickFix=Ji.register({name:g(jn,13,"Terminal Quick Fix"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(jn,14,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Ji.onDebugBreak=Ji.register({name:g(jn,15,"Debugger Stopped on Breakpoint"),sound:Ir.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(jn,16,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Ji.noInlayHints=Ji.register({name:g(jn,17,"No Inlay Hints on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(jn,18,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Ji.taskCompleted=Ji.register({name:g(jn,19,"Task Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(jn,20,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Ji.taskFailed=Ji.register({name:g(jn,21,"Task Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(jn,22,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Ji.terminalCommandFailed=Ji.register({name:g(jn,23,"Terminal Command Failed"),sound:Ir.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(jn,24,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Ji.terminalCommandSucceeded=Ji.register({name:g(jn,25,"Terminal Command Succeeded"),sound:Ir.success,announcementMessage:g(jn,26,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Ji.terminalBell=Ji.register({name:g(jn,27,"Terminal Bell"),sound:Ir.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(jn,28,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Ji.notebookCellCompleted=Ji.register({name:g(jn,29,"Notebook Cell Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(jn,30,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Ji.notebookCellFailed=Ji.register({name:g(jn,31,"Notebook Cell Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(jn,32,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Ji.diffLineInserted=Ji.register({name:g(jn,33,"Diff Line Inserted"),sound:Ir.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Ji.diffLineDeleted=Ji.register({name:g(jn,34,"Diff Line Deleted"),sound:Ir.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Ji.diffLineModified=Ji.register({name:g(jn,35,"Diff Line Modified"),sound:Ir.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Ji.chatRequestSent=Ji.register({name:g(jn,36,"Chat Request Sent"),sound:Ir.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(jn,37,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Ji.chatResponseReceived=Ji.register({name:g(jn,38,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Ir.chatResponseReceived1,Ir.chatResponseReceived2,Ir.chatResponseReceived3,Ir.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Ji.progress=Ji.register({name:g(jn,39,"Progress"),sound:Ir.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(jn,40,"Progress"),settingsKey:"accessibility.signals.progress"}),Ji.clear=Ji.register({name:g(jn,41,"Clear"),sound:Ir.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(jn,42,"Clear"),settingsKey:"accessibility.signals.clear"}),Ji.save=Ji.register({name:g(jn,43,"Save"),sound:Ir.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(jn,44,"Save"),settingsKey:"accessibility.signals.save"}),Ji.format=Ji.register({name:g(jn,45,"Format"),sound:Ir.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(jn,46,"Format"),settingsKey:"accessibility.signals.format"}),Ji.voiceRecordingStarted=Ji.register({name:g(jn,47,"Voice Recording Started"),sound:Ir.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Ji.voiceRecordingStopped=Ji.register({name:g(jn,48,"Voice Recording Stopped"),sound:Ir.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let Zl=Ji;var f1t=".monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{color:var(--vscode-editorLineNumber-foreground);display:inline-block;text-align:right}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;position:absolute}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;vertical-align:middle;width:10px}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{height:16px;margin:2px 0;width:16px}.monaco-component.diff-review .revertButton{cursor:pointer}";Ct(f1t,{});const Np="vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer",p1t=ji("diff-review-insert",Ce.add,g(Np,0,"Icon for 'Insert' in accessible diff viewer.")),m1t=ji("diff-review-remove",Ce.remove,g(Np,1,"Icon for 'Remove' in accessible diff viewer.")),_1t=ji("diff-review-close",Ce.close,g(Np,2,"Icon for 'Close' in accessible diff viewer."));var gH;let Kk=(gH=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=wO(this,(d,h)=>{const u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;const f=h.add(this._instantiationService.createInstance(CCe,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(yCe,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){En(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){En(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){En(e=>{this._setVisible(!1,e)})}},gH._ttPolicy=Jx("diffReview",{createHTML:e=>e}),gH);Kk=D([_(8,be)],Kk);let CCe=class extends ${constructor(e,t,i,s,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=o,this._groups=xi(this,[]),this._currentGroupIdx=xi(this,0),this._currentElementIdx=xi(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(Ni(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=v1t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());En(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===ju.Deleted?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===ju.Added&&this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ni(r=>{const a=this.currentElement.read(r);if(a&&a.type!==ju.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(O.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||m7(t,s=>{this._currentGroupIdx.set(hi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||En(i=>{this._currentElementIdx.set(hi.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&En(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ju.Deleted?this._models.originalReveal(O.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ju.Header?O.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};CCe=D([_(4,Lw)],CCe);const w5=3;function v1t(n,e,t){const i=[];for(const s of NRe(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*w5)){const o=[];o.push(new b1t);const r=new bi(Math.max(1,s[0].original.startLineNumber-w5),Math.min(s[s.length-1].original.endLineNumberExclusive+w5,e+1)),a=new bi(Math.max(1,s[0].modified.startLineNumber-w5),Math.min(s[s.length-1].modified.endLineNumberExclusive+w5,t+1));$qe(s,(d,h)=>{const u=new bi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new bi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new S1t(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new C1t(h,p))}),h.modified.forEach(p=>{o.push(new y1t(h,p))}))});const c=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);i.push(new w1t(new $b(c,l),o))}return i}var ju;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ju||(ju={}));class w1t{constructor(e,t){this.range=e,this.lines=t}}class b1t{constructor(){this.type=ju.Header}}class C1t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ju.Deleted,this.modifiedLineNumber=void 0}}class y1t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ju.Added,this.originalLineNumber=void 0}}class S1t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ju.Unchanged}}let yCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Qh(a)),this._register(Ni(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new xn("diffreview.close",g(Np,3,"Close"),"close-diff-review "+$e.asClassName(_1t),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new bz(this._content,{})),_a(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ni(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{_a(this.domNode)})),this._register(D1(this.domNode,{width:this._width,height:this._height})),this._register(D1(this._content,{width:this._width,height:this._height})),this._register(Em((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Xo(this.domNode,"keydown",c=>{(c.equals(E.DownArrow)||c.equals(V.CtrlCmd|E.DownArrow)||c.equals(V.Alt|E.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(E.UpArrow)||c.equals(V.CtrlCmd|E.UpArrow)||c.equals(V.Alt|E.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(E.Escape)||c.equals(V.CtrlCmd|E.Escape)||c.equals(V.Alt|E.Escape)||c.equals(V.Shift|E.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(E.Space)||c.equals(E.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",g(Np,4,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Sd(s,i.get(x.fontInfo)),_a(this._content,s);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),c=r.getOptions(),l=i.get(x.lineHeight),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===ju.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),w=this._model.groups.get().length,b=M=>M===0?g(Np,5,"no lines changed"):M===1?g(Np,6,"1 line changed"):g(Np,7,"{0} lines changed",M),C=b(m.original.length),y=b(m.modified.length);p.setAttribute("aria-label",g(Np,8,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,w,m.original.startLineNumber,C,m.modified.startLineNumber,y));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${v+1}/${w}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(S),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);s.appendChild(u);const f=Dt(p=>this._model.currentElement.read(p)===h);e.add(Ni(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(pe(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,c,l){const d=s.get(x.layoutInfo),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(x.layoutInfo),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let p="diff-review-row",m="";const v="diff-review-spacer";let w=null;switch(e.type){case ju.Added:p="diff-review-row line-insert",m=" char-insert",w=p1t;break;case ju.Deleted:p="diff-review-row line-delete",m=" char-delete",w=m1t;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=p,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,b.appendChild(C);const y=document.createElement("span");y.style.width=h+"px",y.style.minWidth=h+"px",y.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText=" ",C.appendChild(y);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",C.appendChild(S);const M=document.createElement("span");if(M.className=v,w){const N=document.createElement("span");N.className=$e.asClassName(w),N.innerText="  ",M.appendChild(N)}else M.innerText="  ";C.appendChild(M);let k;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=c.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(Np,9,"blank"));let F="";switch(e.type){case ju.Unchanged:e.originalLineNumber===e.modifiedLineNumber?F=g(Np,10,"{0} unchanged line {1}",k,e.originalLineNumber):F=g(Np,11,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case ju.Added:F=g(Np,12,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case ju.Deleted:F=g(Np,13,"- {0} original line {1}",k,e.originalLineNumber);break}return b.setAttribute("aria-label",F),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(x.fontInfo),c=lh.createEmpty(r,o),l=Sm.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Sm.containsRTL(r,l,e.mightContainRTL());return ede(new tL(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,r,!1,l,d,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(x.stopRenderingLineAfter),t.get(x.renderWhitespace),t.get(x.renderControlCharacters),t.get(x.fontLigatures)!==l1.OFF,null)).html}};yCe=D([_(5,Di)],yCe);class A1t{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}const gK="vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature",Z8=class Z8 extends ${constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Bh("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=xi(this,0),this._modifiedViewZonesChangedSignal=Bh("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Bh("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=wO(this,(d,h)=>{this._element.replaceChildren();const u=this._diffModel.read(d),f=u?.diff.read(d)?.movedTexts;if(!f||f.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const p=this._originalEditorLayoutInfo.read(d),m=this._modifiedEditorLayoutInfo.read(d);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=f.map(k=>{function F(Qe,Tt){const Oe=Tt.getTopForLineNumber(Qe.startLineNumber,!0),wt=Tt.getTopForLineNumber(Qe.endLineNumberExclusive,!0);return(Oe+wt)/2}const N=F(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),U=F(k.lineRangeMapping.modified,this._editors.modified),J=this._modifiedScrollTop.read(d),j=N-z,re=U-J,me=Math.min(N,U),De=Math.max(N,U);return{range:new hi(me,De),from:j,to:re,fromWithoutScroll:N,toWithoutScroll:U,move:k}});v.sort(jqe(El(k=>k.fromWithoutScroll>k.toWithoutScroll,Oct),El(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,cg)));const w=rPe.compute(v.map(k=>k.range)),b=10,C=p.verticalScrollbarWidth,y=(w.getTrackCount()-1)*10+b*2,S=C+y+(m.contentLeft-Z8.movedCodeBlockPadding);let M=0;for(const k of v){const F=w.getTrack(M),N=C+b+F*10,z=15,U=15,J=S,j=m.glyphMarginWidth+m.lineNumbersWidth,re=18,me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("arrow-rectangle"),me.setAttribute("x",`${J-j}`),me.setAttribute("y",`${k.to-re/2}`),me.setAttribute("width",`${j}`),me.setAttribute("height",`${re}`),this._element.appendChild(me);const De=document.createElementNS("http://www.w3.org/2000/svg","g"),Qe=document.createElementNS("http://www.w3.org/2000/svg","path");Qe.setAttribute("d",`M 0 ${k.from} L ${N} ${k.from} L ${N} ${k.to} L ${J-U} ${k.to}`),Qe.setAttribute("fill","none"),De.appendChild(Qe);const Tt=document.createElementNS("http://www.w3.org/2000/svg","polygon");Tt.classList.add("arrow"),h.add(Ni(Oe=>{Qe.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe)),Tt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe))})),Tt.setAttribute("points",`${J-U},${k.to-z/2} ${J},${k.to} ${J-U},${k.to+z/2}`),De.appendChild(Tt),this._element.appendChild(De),M++}this.width.set(y,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ee(()=>this._element.remove())),this._register(Ni(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Z8.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(Ez(this._state));const r=Dt(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new Qee(Au(f.lineRangeMapping.original.startLineNumber-1),18),modified:new Qee(Au(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(jee(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(jee(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(Em((d,h)=>{const u=r.read(d);for(const f of u)h.add(new VUe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new VUe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=Bh("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=Bh("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(Az({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(l="original"),d.didChange(c)&&(l="modified"),!0)},d=>{a.read(d),c.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&l==="original"){const p=this._editors.originalCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.original.contains(p.lineNumber)))}if(u&&l==="modified"){const p=this._editors.modifiedCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber)))}f!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};Z8.movedCodeBlockPadding=4;let GW=Z8;class rPe{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=Ict(t,El(a=>a.intersectWithRangeLength(s),cg)):(o=t.length,t.push(new vMe))),t[o].addRange(s),i.push(o)}return new rPe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class VUe extends ZXe{constructor(e,t,i,s,o){const r=di("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=di("div.diff-moved-code-block",{style:{marginRight:"4px"}},[di("div.text-content@textContent"),di("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(D1(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(gK,0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,1,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(gK,2,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,3,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new Qh(this._nodes.actionBar,{highlightToggledItems:!0})),d=new xn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new xn("","Compare",$e.asClassName(Ce.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Ni(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}const AQ="vs/editor/browser/widget/diffEditor/registrations.contribution";B("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},g(AQ,0,"The border color for text that got moved in the diff editor."));B("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},g(AQ,1,"The active border color for text that got moved in the diff editor."));B("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(AQ,2,"The color of the shadow around unchanged region widgets."));const E1t=ji("diff-insert",Ce.add,g(AQ,3,"Line decoration for inserts in the diff editor.")),tZe=ji("diff-remove",Ce.remove,g(AQ,4,"Line decoration for removals in the diff editor.")),zUe=jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+$e.asClassName(E1t),marginClassName:"gutter-insert"}),$Ue=jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+$e.asClassName(tZe),marginClassName:"gutter-delete"}),GUe=jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),qUe=jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),QUe=jt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),x1t=jt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),D1t=jt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),SCe=jt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),k1t=jt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),I1t=jt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class L1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Dt(this,o=>{const r=this._diffModel.read(o)?.diff.read(o);if(!r)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),l=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!a)for(const f of r.mappings)if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?$Ue:qUe}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?zUe:GUe}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:k1t}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:x1t});else for(const p of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&l?I1t:SCe}),f.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&l?D1t:QUe});if(a)for(const f of a.changes){const p=f.original.toInclusiveRange();p&&d.push({range:p,options:c?$Ue:qUe});const m=f.modified.toInclusiveRange();m&&h.push({range:m,options:c?zUe:GUe});for(const v of f.innerChanges||[])d.push({range:v.originalRange,options:SCe}),h.push({range:v.modifiedRange,options:QUe})}const u=this._diffModel.read(o).activeMovedText.read(o);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===u?" currentMove":""),blockPadding:[GW.movedCodeBlockPadding,0,GW.movedCodeBlockPadding,GW.movedCodeBlockPadding]}}),h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===u?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(qee(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(qee(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class T1t{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=HJe(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,s)}),this._sashRatio=xi(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class iZe extends ${constructor(e,t,i,s,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Lh(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:vi.VERTICAL})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Ni(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(Ni(a=>{const c=this._enabled.read(a);this._sash.state=c?Ia.Enabled:Ia.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class R1t{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=xi(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class M1t{constructor(e){this._value=xi(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(En(i=>{this._value.set(new jUe(t,void 0),i)}),t),t=>{throw En(i=>{this._value.set(new jUe(void 0,t),i)}),t})}}class jUe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class N1t{constructor(e){this._computePromise=e,this._lazyValue=new R1t(()=>new M1t(this._computePromise())),this.cachedPromiseResult=Dt(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function U$(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,o)=>{let r=!0,a=!1;const c=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=Ni(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):s(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Tc)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Tc);return}}r=!1,a&&l.dispose()})}var jL;const nZe=ae("diffProviderFactoryService");let ACe=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(ECe,e)}};ACe=D([_(0,be)],ACe);ce(nZe,ACe,Kt.Delayed);var cN;let ECe=(cN=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new I,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new pw(new bi(1,2),new bi(1,t.getLineCount()+1),[new fS(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=jL.diffCache.get(o);if(a&&a.context===r)return a.result;const c=ao.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=c.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return jL.diffCache.size>10&&jL.diffCache.delete(jL.diffCache.keys().next().value),jL.diffCache.set(o,{result:l,context:r}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},jL=cN,cN.diffCache=new Map,cN);ECe=jL=D([_(1,kd),_(2,on)],ECe);let Kee=class extends ${setActiveMovedText(e){this._activeMovedText.set(e,void 0)}setHoveredMovedText(e){this._hoveredMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=xi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=xi(this,void 0),this.diff=this._diff,this._unchangedRegions=xi(this,void 0),this.unchangedRegions=Dt(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(En(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=xi(this,void 0),this._activeMovedText=xi(this,void 0),this._hoveredMovedText=xi(this,void 0),this.activeMovedText=Dt(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ai,this._diffProvider=Dt(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=Bh("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const s=oL("contentChangedSignal"),o=this._register(new yn(()=>s.trigger(void 0),200));this._register(Ni(a=>{const c=this._unchangedRegions.read(a);if(!c||c.regions.some(p=>p.isDragged.read(a)))return;const l=c.originalDecorationIds.map(p=>e.original.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Yk(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(yl),u=[];let f=!1;for(const p of NRe(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((w,b)=>w+b.lineCount,0),v=new Yk(p[0].originalLineNumber,p[0].modifiedLineNumber,m,p[0].visibleLineCountTop.get(),p[p.length-1].visibleLineCountBottom.get());u.push(v)}else u.push(p[0]);if(f){const p=e.original.deltaDecorations(c.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(c.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));En(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Yk.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l));let h;const u=this._unchangedRegions.get();if(u){const v=u.originalDecorationIds.map(y=>e.original.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0),w=u.modifiedDecorationIds.map(y=>e.modified.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0);let C=h1t(u.regions.map((y,S)=>{if(!v[S]||!w[S])return;const M=v[S].length;return new Yk(v[S].startLineNumber,w[S].startLineNumber,M,Math.min(y.visibleLineCountTop.get(),M),Math.min(y.visibleLineCountBottom.get(),M-y.visibleLineCountTop.get()))}).filter(yl),(y,S)=>!S||y.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&y.originalLineNumber>=S.originalLineNumber+S.lineCount).map(y=>new $b(y.getHiddenOriginalRange(l),y.getHiddenModifiedRange(l)));C=$b.clip(C,bi.ofLength(1,e.original.getLineCount()),bi.ofLength(1,e.modified.getLineCount())),h=$b.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const w=h.filter(b=>b.original.intersectsStrict(v.originalUnchangedRange)&&b.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(w,c))}else f.push(...d);const p=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:p,modifiedDecorationIds:m},c)};this._register(e.modified.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Em(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),s.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),_v(sKe,a),_v(Qve,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);d=GZ(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);h=GZ(h,p)}));let u=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=P1t(u,e.original,e.modified),u=u,u=u,En(f=>{r(u,f),this._lastDiff=u;const p=aPe.fromDiffResult(u);this._diff.set(p,f),this._isDiffUpToDate.set(!0,f);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await U$(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(s=>bi.deserialize(s.range)),i=this._unchangedRegions.get();!i||!t||En(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};Kee=D([_(2,nZe)],Kee);function P1t(n,e,t){return{changes:n.changes.map(i=>new pw(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>F1t(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function F1t(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew sZe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class sZe{constructor(e){this.lineRangeMapping=e}}class Yk{static fromDiffs(e,t,i,s,o){const r=pw.inverse(e,t,i),a=[];for(const c of r){let l=c.original.startLineNumber,d=c.modified.startLineNumber,h=c.original.length;const u=l===1&&d===1,f=l+h===t+1&&d+h===i+1;(u||f)&&h>=o+s?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Yk(l,d,h,0,0))):h>=o*2+s&&(l+=o,d+=o,h-=o*2,a.push(new Yk(l,d,h,0,0)))}return a}get originalUnchangedRange(){return bi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return bi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=xi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=xi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Dt(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=xi(this,void 0);const r=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-s),0);C2e(s===r),C2e(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new d_(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of s.ranges){const d=c===s.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Yk(o,r,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return bi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return bi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===xv.FromCloserSide&&s{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],w=s.modified.isEmpty;return v.push(new xn("diff.clipboard.copyDeletedContent",w?s.original.length>1?g(xL,0,"Copy deleted lines"):g(xL,1,"Copy deleted line"):s.original.length>1?g(xL,2,"Copy changed lines"):g(xL,3,"Copy changed line"),void 0,!0,async()=>{const C=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(C)})),s.original.length>1&&v.push(new xn("diff.clipboard.copyDeletedLineContent",w?g(xL,4,"Copy deleted line ({0})",s.original.startLineNumber+h):g(xL,5,"Copy changed line ({0})",s.original.startLineNumber+h),void 0,!0,async()=>{let C=this._originalTextModel.getLineContent(s.original.startLineNumber+h);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===bu.LF?` +`}};pCe=D([_(0,Re)],pCe);class J0t{constructor(){this.telemetryLevel=sp.NONE,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}setEnabled(){}setExperimentProperty(){}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}}const $2=class $2{constructor(){this._onDidChangeWorkspaceName=new I,this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onWillChangeWorkspaceFolders=new I,this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=new I,this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkbenchState=new I,this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event;const e=P.from({scheme:$2.SCHEME,authority:"model",path:"/"});this.workspace={id:LJe,folders:[new Cde({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?Nn.WORKSPACE:Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===$2.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===$2.SCHEME}isCurrentWorkspace(e){return!0}};$2.SCHEME="inmemory";let mCe=$2;function $ee(n,e,t){if(!e||!(n instanceof zee))return;const i=[];Object.keys(e).forEach(s=>{OEt(s)&&i.push([`editor.${s}`,e[s]]),t&&BEt(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let _Ce=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return $.None}async apply(e,t){const i=Array.isArray(e)?e:_Q.convert(e),s=new Map;for(const a of i){if(!(a instanceof vS))throw new Error("bad edit - only text edits are supported");const c=this._modelService.getModel(a.resource);if(!c)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&c.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let l=s.get(c);l||(l=[],s.set(c,l)),l.push(ds.replaceMove(O.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of s)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:r_(dbe.bulkEditServiceSummary,o,r),isApplied:o>0}}};_Ce=D([_(0,Ai)],_Ce);class X0t{constructor(){this.onDidChangeFormatters=T.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ui(e)}getWorkspaceLabel(e,t){return""}getSeparator(e,t){return"/"}registerFormatter(e){throw new Error("Not implemented")}registerCachedFormatter(e){return this.registerFormatter(e)}getHostLabel(){return""}getHostTooltip(){}}let vCe=class extends REt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};vCe=D([_(0,bg),_(1,jt)],vCe);class Z0t{constructor(){this._neverEmitter=new I,this.onDidChangeTrust=this._neverEmitter.event,this.onDidChangeTrustedFolders=this._neverEmitter.event,this.workspaceResolved=Promise.resolve(),this.workspaceTrustInitialized=Promise.resolve(),this.acceptsOutOfWorkspaceFiles=!0}isWorkspaceTrusted(){return!0}isWorkspaceTrustForced(){return!1}canSetParentFolderTrust(){return!1}async setParentFolderTrust(e){}canSetWorkspaceTrust(){return!1}async setWorkspaceTrust(e){}getUriTrustInfo(e){throw new Error("Method not supported.")}async setUrisTrust(e,t){}getTrustedUris(){return[]}async setTrustedUris(e){}addWorkspaceTrustTransitionParticipant(e){throw new Error("Method not supported.")}}class e1t extends Cee{constructor(){super()}}class t1t extends YXe{constructor(){super(new mSt)}}let wCe=class extends xbe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};wCe=D([_(0,rn),_(1,Pi),_(2,W_),_(3,ti),_(4,_c),_(5,Pe)],wCe);class i1t{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return gQe.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return T.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ze,t1t,Yt.Eager);ce(Re,zee,Yt.Eager);ce(dl,fCe,Yt.Eager);ce(bMe,pCe,Yt.Eager);ce(Ti,mCe,Yt.Eager);ce(eo,X0t,Yt.Eager);ce(rn,J0t,Yt.Eager);ce(To,K0t,Yt.Eager);ce(Il,j0t,Yt.Eager);ce(Pi,uCe,Yt.Eager);ce(U_,XD,Yt.Eager);ce(Di,e1t,Yt.Eager);ce(Iw,L0t,Yt.Eager);ce(Ai,Mbe,Yt.Eager);ce(EMe,Rbe,Yt.Eager);ce(Pe,cCe,Yt.Eager);ce(Cf,Q0t,Yt.Eager);ce(eD,hCe,Yt.Eager);ce(on,IDt,Yt.Eager);ce(kd,jve,Yt.Eager);ce(vO,_Ce,Yt.Eager);ce(oA,Z0t,Yt.Eager);ce(Rn,dCe,Yt.Eager);ce(Ur,Zbe,Yt.Eager);ce(yf,IIt,Yt.Eager);ce(ji,gCe,Yt.Eager);ce(ti,x1,Yt.Eager);ce(On,R7,Yt.Eager);ce(W_,vCe,Yt.Eager);ce(fr,Tbe,Yt.Eager);ce(Mu,oCe,Yt.Eager);ce(Vr,wCe,Yt.Eager);ce(_c,eCe,Yt.Eager);ce(Lw,i1t,Yt.Eager);var Lt;(function(n){const e=new Dl;for(const[c,l]of Hve())e.set(c,l);const t=new P7(e,!0);e.set(be,t);function i(c){s||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof Gi?t.invokeFunction(d=>d.get(c)):l}n.get=i;let s=!1;const o=new I;function r(c){if(s)return t;s=!0;for(const[l,d]of Hve())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof Gi&&e.set(d,c[l])}return o.fire(),t}n.initialize=r;function a(c){if(s)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}n.withServices=a})(Lt||(Lt={}));var n1t=".monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{font-size:13px;height:0;line-height:14px;transform:translateY(-10px)}.monaco-editor .diff-hidden-lines .bottom.dragging,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .bottom,.monaco-editor .diff-hidden-lines .top{background-clip:padding-box;background-color:transparent;border-bottom:2px solid transparent;border-top:4px solid transparent;height:4px;transition:background-color .1s ease-out}.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *{cursor:n-resize!important}.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *{cursor:s-resize!important}.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{align-items:center;background:var(--vscode-editor-background);display:flex;justify-content:center;z-index:1}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);color:var(--vscode-diffEditor-unchangedRegionForeground);display:block;height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedModified,.monaco-editor .movedOriginal{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedModified.currentMove,.monaco-editor .movedOriginal.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{pointer-events:none;position:absolute}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-removedTextBackground);margin-left:-1px}.monaco-editor .char-insert.diff-range-empty{border-left:3px solid var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{font-size:12px;height:12px;width:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{align-items:center;display:flex!important;font-size:11px!important;opacity:.7!important}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-editor.hc-light .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{position:absolute;z-index:10}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .char-insert,.monaco-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-diff-editor .line-insert,.monaco-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-insert,.monaco-editor .line-insert{border:1px solid var(--vscode-diffEditor-insertedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-insert,.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .char-insert,.monaco-editor.hc-light .line-insert{border-style:dashed}.monaco-editor .char-delete,.monaco-editor .line-delete{border:1px solid var(--vscode-diffEditor-removedTextBorder);box-sizing:border-box}.monaco-editor.hc-black .char-delete,.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .char-delete,.monaco-editor.hc-light .line-delete{border-style:dashed}.monaco-diff-editor .gutter-insert,.monaco-editor .gutter-insert,.monaco-editor .inline-added-margin-view-zone{background-color:var(--vscode-diffEditorGutter-insertedLineBackground,var(--vscode-diffEditor-insertedLineBackground),var(--vscode-diffEditor-insertedTextBackground))}.monaco-diff-editor .char-delete,.monaco-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-diff-editor .line-delete,.monaco-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor .gutter-delete,.monaco-editor .gutter-delete,.monaco-editor .inline-deleted-margin-view-zone{background-color:var(--vscode-diffEditorGutter-removedLineBackground,var(--vscode-diffEditor-removedLineBackground),var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--vscode-diffEditor-border);box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor.side-by-side .editor.original{border-right:1px solid var(--vscode-diffEditor-border);box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{flex-grow:0;flex-shrink:0;overflow:hidden;position:relative;&>div{position:absolute}.gutterItem{opacity:0;transition:opacity .7s;&.showAlways{opacity:1}&.noTransition,&.showAlways{transition:none}}&:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.gutterItem{.background{border-left:2px solid var(--vscode-menu-border);height:100%;left:50%;position:absolute;width:1px}.buttons{align-items:center;display:flex;justify-content:center;position:absolute;width:100%;.monaco-toolbar{height:fit-content;.monaco-action-bar{line-height:1;.actions-container{background:var(--vscode-editorGutter-commentRangeForeground);border-radius:4px;width:fit-content;.action-item{&:hover{background:var(--vscode-toolbar-hoverBackground)}.action-label{padding:1px 2px}}}}}}}}";Ct(n1t,{});class M_{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new M_(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new M_(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,vt.Immediate)}}class Gee{static capture(e){if(e.hasPendingScrollAnimation())return new Gee(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const s=e.getVisibleRanges();return s.length>0&&(t=s.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new Gee(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getBottomForLineNumber(this._visiblePosition.lineNumber);e.setScrollTop(t-this._visiblePositionScrollDelta,vt.Immediate)}}}function oPe(){return IU&&!!IU.VSCODE_DEV}function JXe(n){if(oPe()){const e=s1t();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function s1t(){uK||(uK=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const i of uK){const s=i(t);if(s)return s}}),uK}let uK;oPe()&&JXe(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const s in i){const o=i[s];if(console.log(`[hot-reload] Patching prototype methods of '${s}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=n[s];if(r){for(const a of Object.getOwnPropertyNames(o.prototype)){const c=Object.getOwnPropertyDescriptor(o.prototype,a),l=Object.getOwnPropertyDescriptor(r.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${s}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[s]=r}}}return!0}});function o1t(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(c),r++):(s.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function A3(n,e){return n.appendChild(e),Ee(()=>{n.removeChild(e)})}function r1t(n,e){return n.prepend(e),Ee(()=>{n.removeChild(e)})}class XXe extends ${get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new gKe(e,t)),this._width=xi(this,this.elementSizeObserver.getWidth()),this._height=xi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>En(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function BUe(n,e,t){let i=e.get(),s=i,o=i;const r=xi("animatedValue",i);let a=-1;const c=300;let l;t.add(Az({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(n.cancelAnimationFrame(l),l=void 0),s=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(a1t(h,s,i-s,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const Oae=class Oae{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Oae._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Oae._counter=0;let bCe=Oae;function D1(n,e){return Ni(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function _v(n,e){return c1t([n],e),n}function c1t(n,e){oPe()&&Bh("reload",i=>JXe(({oldExports:s})=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function jee(n,e,t,i){const s=new Z,o=[];return s.add(Em((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(const u of o)h.removeZone(u),i?.delete(u);o.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(Az({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}},(h,u)=>{for(const f of c)f.onChange&&(d.set(f.onChange,l.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),s}class l1t extends ai{dispose(){super.dispose(!0)}}function WUe(n,e){const t=t1(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return O.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return O.fromPositions(new oe(s,n.column))}if(!t.innerChanges)return O.fromPositions(new oe(t.modified.startLineNumber,1));const i=t1(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return O.fromPositions(new oe(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=d1t(i.originalRange.getEndPosition(),n);return O.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function d1t(n,e){return n.lineNumber===e.lineNumber?new gf(0,e.column-n.column):new gf(e.lineNumber-n.lineNumber,e.column-1)}function h1t(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}function eZe(n,e,t){return Wn(i=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(n)&&i(s)}),()=>t.getValue(n)??e)}function dA(n,e,t){const i=n.bindTo(e);return bQ({debugName:()=>`Set Context Key "${n.key}"`},s=>{i.set(t(s))})}const jn="vs/platform/accessibilitySignal/browser/accessibilitySignalService";let HUe=class extends ${constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Wn(this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new tZ(s=>eZe(s.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new tZ({getCacheKey:Lxt},s=>Dt(o=>{const r=this._signalConfigValue.get(s.signal).read(o);return!!((s.modality==="sound"||s.modality===void 0)&&UUe(r.sound,()=>this.screenReaderAttached.read(o),s.userGesture)||(s.modality==="announcement"||s.modality===void 0)&&UUe(r.announcement,()=>this.screenReaderAttached.read(o),s.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new LNe(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,s=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&s&&this.accessibilityService.status(s),(t.modality==="sound"||t.modality===void 0)&&this.isSoundEnabled(e,t.userGesture)&&(this.sendSignalTelemetry(e,t.source),await this.playSound(e.sound.getSound(),t.allowManyInParallel))}async playSignals(e){for(const o of e)this.sendSignalTelemetry("signal"in o?o.signal:o,"source"in o?o.source:void 0);const t=e.map(o=>"signal"in o?o.signal:o),i=t.filter(o=>this.isAnnouncementEnabled(o)).map(o=>o.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const s=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(s).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),s=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(s)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(s),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibilitySignals.volume");return typeof e!="number"?50:Math.max(Math.min(e,100),0)}async playSound(e,t=!1){if(!t&&this.playingSounds.has(e))return;this.playingSounds.add(e);const i=lp.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const s=this.sounds.get(i);if(s)s.volume=this.getVolumeInPercent()/100,s.currentTime=0,await s.play();else{const o=await u1t(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(s){s.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",s)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const s=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&s()},t)})};return s(),Ee(()=>i=!1)}isAnnouncementEnabled(e,t){return e.announcementMessage?this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"announcement"}).get():!1}isSoundEnabled(e,t){return this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"sound"}).get()}onSoundEnabledChanged(e){return this.getEnabledState(e,!1).onDidChange}getDelayMs(e,t,i){const s=this.configurationService.getValue("accessibility.signalOptions");if(!s||!s.debouncePositionChanges)return 0;let o;return e.name===Zl.errorAtPosition.name&&i==="positional"?o=s["experimental.delays"].errorAtPosition:e.name===Zl.warningAtPosition.name&&i==="positional"?o=s["experimental.delays"].warningAtPosition:o=s["experimental.delays"].general,t==="sound"?o.sound:o.announcement}};HUe=D([_(0,Re),_(1,Ur),_(2,rn)],HUe);function UUe(n,e,t){return n==="on"||n==="always"||n==="auto"&&e()||n==="userGesture"&&t}function u1t(n,e){return new Promise((t,i)=>{const s=new Audio(n);s.volume=e,s.addEventListener("ended",()=>{t(s)}),s.addEventListener("error",o=>{i(o.error)}),s.play().catch(o=>{i(o)})})}const Yn=class Yn{static register(e){return new Yn(e.fileName)}constructor(e){this.fileName=e}};Yn.error=Yn.register({fileName:"error.mp3"}),Yn.warning=Yn.register({fileName:"warning.mp3"}),Yn.success=Yn.register({fileName:"success.mp3"}),Yn.foldedArea=Yn.register({fileName:"foldedAreas.mp3"}),Yn.break=Yn.register({fileName:"break.mp3"}),Yn.quickFixes=Yn.register({fileName:"quickFixes.mp3"}),Yn.taskCompleted=Yn.register({fileName:"taskCompleted.mp3"}),Yn.taskFailed=Yn.register({fileName:"taskFailed.mp3"}),Yn.terminalBell=Yn.register({fileName:"terminalBell.mp3"}),Yn.diffLineInserted=Yn.register({fileName:"diffLineInserted.mp3"}),Yn.diffLineDeleted=Yn.register({fileName:"diffLineDeleted.mp3"}),Yn.diffLineModified=Yn.register({fileName:"diffLineModified.mp3"}),Yn.chatRequestSent=Yn.register({fileName:"chatRequestSent.mp3"}),Yn.chatResponseReceived1=Yn.register({fileName:"chatResponseReceived1.mp3"}),Yn.chatResponseReceived2=Yn.register({fileName:"chatResponseReceived2.mp3"}),Yn.chatResponseReceived3=Yn.register({fileName:"chatResponseReceived3.mp3"}),Yn.chatResponseReceived4=Yn.register({fileName:"chatResponseReceived4.mp3"}),Yn.clear=Yn.register({fileName:"clear.mp3"}),Yn.save=Yn.register({fileName:"save.mp3"}),Yn.format=Yn.register({fileName:"format.mp3"}),Yn.voiceRecordingStarted=Yn.register({fileName:"voiceRecordingStarted.mp3"}),Yn.voiceRecordingStopped=Yn.register({fileName:"voiceRecordingStopped.mp3"}),Yn.progress=Yn.register({fileName:"progress.mp3"});let Ir=Yn;class g1t{constructor(e){this.randomOneOf=e}getSound(e=!1){if(e||this.randomOneOf.length===1)return this.randomOneOf[0];{const t=Math.floor(Math.random()*this.randomOneOf.length);return this.randomOneOf[t]}}}const Xi=class Xi{constructor(e,t,i,s,o,r,a){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.delaySettingsKey=a}static register(e){const t=new g1t("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Xi(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.delaySettingsKey);return Xi._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Xi._signals=new Set,Xi.errorAtPosition=Xi.register({name:g(jn,0,"Error at Position"),sound:Ir.error,announcementMessage:g(jn,1,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Xi.warningAtPosition=Xi.register({name:g(jn,2,"Warning at Position"),sound:Ir.warning,announcementMessage:g(jn,3,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Xi.errorOnLine=Xi.register({name:g(jn,4,"Error on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(jn,5,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Xi.warningOnLine=Xi.register({name:g(jn,6,"Warning on Line"),sound:Ir.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(jn,7,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Xi.foldedArea=Xi.register({name:g(jn,8,"Folded Area on Line"),sound:Ir.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(jn,9,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Xi.break=Xi.register({name:g(jn,10,"Breakpoint on Line"),sound:Ir.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(jn,11,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Xi.inlineSuggestion=Xi.register({name:g(jn,12,"Inline Suggestion on Line"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Xi.terminalQuickFix=Xi.register({name:g(jn,13,"Terminal Quick Fix"),sound:Ir.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(jn,14,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Xi.onDebugBreak=Xi.register({name:g(jn,15,"Debugger Stopped on Breakpoint"),sound:Ir.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(jn,16,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Xi.noInlayHints=Xi.register({name:g(jn,17,"No Inlay Hints on Line"),sound:Ir.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(jn,18,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Xi.taskCompleted=Xi.register({name:g(jn,19,"Task Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(jn,20,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Xi.taskFailed=Xi.register({name:g(jn,21,"Task Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(jn,22,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Xi.terminalCommandFailed=Xi.register({name:g(jn,23,"Terminal Command Failed"),sound:Ir.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(jn,24,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Xi.terminalCommandSucceeded=Xi.register({name:g(jn,25,"Terminal Command Succeeded"),sound:Ir.success,announcementMessage:g(jn,26,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Xi.terminalBell=Xi.register({name:g(jn,27,"Terminal Bell"),sound:Ir.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(jn,28,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Xi.notebookCellCompleted=Xi.register({name:g(jn,29,"Notebook Cell Completed"),sound:Ir.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(jn,30,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Xi.notebookCellFailed=Xi.register({name:g(jn,31,"Notebook Cell Failed"),sound:Ir.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(jn,32,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Xi.diffLineInserted=Xi.register({name:g(jn,33,"Diff Line Inserted"),sound:Ir.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Xi.diffLineDeleted=Xi.register({name:g(jn,34,"Diff Line Deleted"),sound:Ir.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Xi.diffLineModified=Xi.register({name:g(jn,35,"Diff Line Modified"),sound:Ir.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Xi.chatRequestSent=Xi.register({name:g(jn,36,"Chat Request Sent"),sound:Ir.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(jn,37,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Xi.chatResponseReceived=Xi.register({name:g(jn,38,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Ir.chatResponseReceived1,Ir.chatResponseReceived2,Ir.chatResponseReceived3,Ir.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Xi.progress=Xi.register({name:g(jn,39,"Progress"),sound:Ir.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(jn,40,"Progress"),settingsKey:"accessibility.signals.progress"}),Xi.clear=Xi.register({name:g(jn,41,"Clear"),sound:Ir.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(jn,42,"Clear"),settingsKey:"accessibility.signals.clear"}),Xi.save=Xi.register({name:g(jn,43,"Save"),sound:Ir.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(jn,44,"Save"),settingsKey:"accessibility.signals.save"}),Xi.format=Xi.register({name:g(jn,45,"Format"),sound:Ir.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(jn,46,"Format"),settingsKey:"accessibility.signals.format"}),Xi.voiceRecordingStarted=Xi.register({name:g(jn,47,"Voice Recording Started"),sound:Ir.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Xi.voiceRecordingStopped=Xi.register({name:g(jn,48,"Voice Recording Stopped"),sound:Ir.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let Zl=Xi;var f1t=".monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{color:var(--vscode-editorLineNumber-foreground);display:inline-block;text-align:right}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;position:absolute}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;vertical-align:middle;width:10px}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{height:16px;margin:2px 0;width:16px}.monaco-component.diff-review .revertButton{cursor:pointer}";Ct(f1t,{});const Np="vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer",p1t=Ki("diff-review-insert",Ce.add,g(Np,0,"Icon for 'Insert' in accessible diff viewer.")),m1t=Ki("diff-review-remove",Ce.remove,g(Np,1,"Icon for 'Remove' in accessible diff viewer.")),_1t=Ki("diff-review-close",Ce.close,g(Np,2,"Icon for 'Close' in accessible diff viewer."));var gH;let Kk=(gH=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=wO(this,(d,h)=>{const u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;const f=h.add(this._instantiationService.createInstance(CCe,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(yCe,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){En(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){En(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){En(e=>{this._setVisible(!1,e)})}},gH._ttPolicy=Jx("diffReview",{createHTML:e=>e}),gH);Kk=D([_(8,be)],Kk);let CCe=class extends ${constructor(e,t,i,s,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=o,this._groups=xi(this,[]),this._currentGroupIdx=xi(this,0),this._currentElementIdx=xi(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(Ni(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=v1t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());En(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===ju.Deleted?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===ju.Added&&this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ni(r=>{const a=this.currentElement.read(r);if(a&&a.type!==ju.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(O.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||m7(t,s=>{this._currentGroupIdx.set(hi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||En(i=>{this._currentElementIdx.set(hi.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&En(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ju.Deleted?this._models.originalReveal(O.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ju.Header?O.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};CCe=D([_(4,Lw)],CCe);const w5=3;function v1t(n,e,t){const i=[];for(const s of NRe(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*w5)){const o=[];o.push(new b1t);const r=new bi(Math.max(1,s[0].original.startLineNumber-w5),Math.min(s[s.length-1].original.endLineNumberExclusive+w5,e+1)),a=new bi(Math.max(1,s[0].modified.startLineNumber-w5),Math.min(s[s.length-1].modified.endLineNumberExclusive+w5,t+1));$qe(s,(d,h)=>{const u=new bi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new bi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new S1t(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new C1t(h,p))}),h.modified.forEach(p=>{o.push(new y1t(h,p))}))});const c=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);i.push(new w1t(new $b(c,l),o))}return i}var ju;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ju||(ju={}));class w1t{constructor(e,t){this.range=e,this.lines=t}}class b1t{constructor(){this.type=ju.Header}}class C1t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ju.Deleted,this.modifiedLineNumber=void 0}}class y1t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ju.Added,this.originalLineNumber=void 0}}class S1t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ju.Unchanged}}let yCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Qh(a)),this._register(Ni(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new xn("diffreview.close",g(Np,3,"Close"),"close-diff-review "+$e.asClassName(_1t),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new bz(this._content,{})),_a(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ni(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{_a(this.domNode)})),this._register(D1(this.domNode,{width:this._width,height:this._height})),this._register(D1(this._content,{width:this._width,height:this._height})),this._register(Em((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Xo(this.domNode,"keydown",c=>{(c.equals(E.DownArrow)||c.equals(V.CtrlCmd|E.DownArrow)||c.equals(V.Alt|E.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(E.UpArrow)||c.equals(V.CtrlCmd|E.UpArrow)||c.equals(V.Alt|E.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(E.Escape)||c.equals(V.CtrlCmd|E.Escape)||c.equals(V.Alt|E.Escape)||c.equals(V.Shift|E.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(E.Space)||c.equals(E.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",g(Np,4,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Sd(s,i.get(x.fontInfo)),_a(this._content,s);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),c=r.getOptions(),l=i.get(x.lineHeight),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===ju.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),w=this._model.groups.get().length,b=M=>M===0?g(Np,5,"no lines changed"):M===1?g(Np,6,"1 line changed"):g(Np,7,"{0} lines changed",M),C=b(m.original.length),y=b(m.modified.length);p.setAttribute("aria-label",g(Np,8,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,w,m.original.startLineNumber,C,m.modified.startLineNumber,y));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${v+1}/${w}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(S),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);s.appendChild(u);const f=Dt(p=>this._model.currentElement.read(p)===h);e.add(Ni(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(pe(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,c,l){const d=s.get(x.layoutInfo),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(x.layoutInfo),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let p="diff-review-row",m="";const v="diff-review-spacer";let w=null;switch(e.type){case ju.Added:p="diff-review-row line-insert",m=" char-insert",w=p1t;break;case ju.Deleted:p="diff-review-row line-delete",m=" char-delete",w=m1t;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=p,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,b.appendChild(C);const y=document.createElement("span");y.style.width=h+"px",y.style.minWidth=h+"px",y.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText=" ",C.appendChild(y);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",C.appendChild(S);const M=document.createElement("span");if(M.className=v,w){const N=document.createElement("span");N.className=$e.asClassName(w),N.innerText="  ",M.appendChild(N)}else M.innerText="  ";C.appendChild(M);let k;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=c.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Kk._ttPolicy&&(N=Kk._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(Np,9,"blank"));let F="";switch(e.type){case ju.Unchanged:e.originalLineNumber===e.modifiedLineNumber?F=g(Np,10,"{0} unchanged line {1}",k,e.originalLineNumber):F=g(Np,11,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case ju.Added:F=g(Np,12,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case ju.Deleted:F=g(Np,13,"- {0} original line {1}",k,e.originalLineNumber);break}return b.setAttribute("aria-label",F),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(x.fontInfo),c=lh.createEmpty(r,o),l=Sm.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Sm.containsRTL(r,l,e.mightContainRTL());return ede(new tL(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,r,!1,l,d,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(x.stopRenderingLineAfter),t.get(x.renderWhitespace),t.get(x.renderControlCharacters),t.get(x.fontLigatures)!==l1.OFF,null)).html}};yCe=D([_(5,Di)],yCe);class A1t{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}const gK="vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature",Z8=class Z8 extends ${constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Bh("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=xi(this,0),this._modifiedViewZonesChangedSignal=Bh("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Bh("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=wO(this,(d,h)=>{this._element.replaceChildren();const u=this._diffModel.read(d),f=u?.diff.read(d)?.movedTexts;if(!f||f.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const p=this._originalEditorLayoutInfo.read(d),m=this._modifiedEditorLayoutInfo.read(d);if(!p||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=f.map(k=>{function F(Qe,Tt){const Oe=Tt.getTopForLineNumber(Qe.startLineNumber,!0),wt=Tt.getTopForLineNumber(Qe.endLineNumberExclusive,!0);return(Oe+wt)/2}const N=F(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),U=F(k.lineRangeMapping.modified,this._editors.modified),J=this._modifiedScrollTop.read(d),j=N-z,re=U-J,me=Math.min(N,U),De=Math.max(N,U);return{range:new hi(me,De),from:j,to:re,fromWithoutScroll:N,toWithoutScroll:U,move:k}});v.sort(jqe(El(k=>k.fromWithoutScroll>k.toWithoutScroll,Oct),El(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,cg)));const w=rPe.compute(v.map(k=>k.range)),b=10,C=p.verticalScrollbarWidth,y=(w.getTrackCount()-1)*10+b*2,S=C+y+(m.contentLeft-Z8.movedCodeBlockPadding);let M=0;for(const k of v){const F=w.getTrack(M),N=C+b+F*10,z=15,U=15,J=S,j=m.glyphMarginWidth+m.lineNumbersWidth,re=18,me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("arrow-rectangle"),me.setAttribute("x",`${J-j}`),me.setAttribute("y",`${k.to-re/2}`),me.setAttribute("width",`${j}`),me.setAttribute("height",`${re}`),this._element.appendChild(me);const De=document.createElementNS("http://www.w3.org/2000/svg","g"),Qe=document.createElementNS("http://www.w3.org/2000/svg","path");Qe.setAttribute("d",`M 0 ${k.from} L ${N} ${k.from} L ${N} ${k.to} L ${J-U} ${k.to}`),Qe.setAttribute("fill","none"),De.appendChild(Qe);const Tt=document.createElementNS("http://www.w3.org/2000/svg","polygon");Tt.classList.add("arrow"),h.add(Ni(Oe=>{Qe.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe)),Tt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Oe))})),Tt.setAttribute("points",`${J-U},${k.to-z/2} ${J},${k.to} ${J-U},${k.to+z/2}`),De.appendChild(Tt),this._element.appendChild(De),M++}this.width.set(y,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ee(()=>this._element.remove())),this._register(Ni(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Z8.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(Ez(this._state));const r=Dt(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new Qee(Au(f.lineRangeMapping.original.startLineNumber-1),18),modified:new Qee(Au(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(jee(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(jee(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(Em((d,h)=>{const u=r.read(d);for(const f of u)h.add(new VUe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new VUe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=Bh("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=Bh("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(Az({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(l="original"),d.didChange(c)&&(l="modified"),!0)},d=>{a.read(d),c.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&l==="original"){const p=this._editors.originalCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.original.contains(p.lineNumber)))}if(u&&l==="modified"){const p=this._editors.modifiedCursor.read(d);p&&(f=u.movedTexts.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber)))}f!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};Z8.movedCodeBlockPadding=4;let GW=Z8;class rPe{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=Ict(t,El(a=>a.intersectWithRangeLength(s),cg)):(o=t.length,t.push(new vMe))),t[o].addRange(s),i.push(o)}return new rPe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class VUe extends ZXe{constructor(e,t,i,s,o){const r=di("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=di("div.diff-moved-code-block",{style:{marginRight:"4px"}},[di("div.text-content@textContent"),di("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(D1(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(gK,0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,1,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(gK,2,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(gK,3,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new Qh(this._nodes.actionBar,{highlightToggledItems:!0})),d=new xn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new xn("","Compare",$e.asClassName(Ce.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Ni(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}const AQ="vs/editor/browser/widget/diffEditor/registrations.contribution";B("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},g(AQ,0,"The border color for text that got moved in the diff editor."));B("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},g(AQ,1,"The active border color for text that got moved in the diff editor."));B("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(AQ,2,"The color of the shadow around unchanged region widgets."));const E1t=Ki("diff-insert",Ce.add,g(AQ,3,"Line decoration for inserts in the diff editor.")),tZe=Ki("diff-remove",Ce.remove,g(AQ,4,"Line decoration for removals in the diff editor.")),zUe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+$e.asClassName(E1t),marginClassName:"gutter-insert"}),$Ue=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+$e.asClassName(tZe),marginClassName:"gutter-delete"}),GUe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),qUe=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),QUe=Kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),x1t=Kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),D1t=Kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),SCe=Kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),k1t=Kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),I1t=Kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class L1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Dt(this,o=>{const r=this._diffModel.read(o)?.diff.read(o);if(!r)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),l=this._options.showEmptyDecorations.read(o),d=[],h=[];if(!a)for(const f of r.mappings)if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?$Ue:qUe}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?zUe:GUe}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:k1t}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:x1t});else for(const p of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&d.push({range:p.originalRange,options:p.originalRange.isEmpty()&&l?I1t:SCe}),f.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&h.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&l?D1t:QUe});if(a)for(const f of a.changes){const p=f.original.toInclusiveRange();p&&d.push({range:p,options:c?$Ue:qUe});const m=f.modified.toInclusiveRange();m&&h.push({range:m,options:c?zUe:GUe});for(const v of f.innerChanges||[])d.push({range:v.originalRange,options:SCe}),h.push({range:v.modifiedRange,options:QUe})}const u=this._diffModel.read(o).activeMovedText.read(o);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===u?" currentMove":""),blockPadding:[GW.movedCodeBlockPadding,0,GW.movedCodeBlockPadding,GW.movedCodeBlockPadding]}}),h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===u?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:h}}),this._register(qee(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(qee(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class T1t{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=HJe(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,s)}),this._sashRatio=xi(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class iZe extends ${constructor(e,t,i,s,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Lh(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:vi.VERTICAL})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Ni(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(Ni(a=>{const c=this._enabled.read(a);this._sash.state=c?Ia.Enabled:Ia.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class R1t{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=xi(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class M1t{constructor(e){this._value=xi(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(En(i=>{this._value.set(new jUe(t,void 0),i)}),t),t=>{throw En(i=>{this._value.set(new jUe(void 0,t),i)}),t})}}class jUe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class N1t{constructor(e){this._computePromise=e,this._lazyValue=new R1t(()=>new M1t(this._computePromise())),this.cachedPromiseResult=Dt(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function U$(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,o)=>{let r=!0,a=!1;const c=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=Ni(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):s(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Tc)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Tc);return}}r=!1,a&&l.dispose()})}var jL;const nZe=ae("diffProviderFactoryService");let ACe=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(ECe,e)}};ACe=D([_(0,be)],ACe);ce(nZe,ACe,Yt.Delayed);var cN;let ECe=(cN=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new I,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new pw(new bi(1,2),new bi(1,t.getLineCount()+1),[new fS(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=jL.diffCache.get(o);if(a&&a.context===r)return a.result;const c=ao.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=c.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return jL.diffCache.size>10&&jL.diffCache.delete(jL.diffCache.keys().next().value),jL.diffCache.set(o,{result:l,context:r}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},jL=cN,cN.diffCache=new Map,cN);ECe=jL=D([_(1,kd),_(2,rn)],ECe);let Kee=class extends ${setActiveMovedText(e){this._activeMovedText.set(e,void 0)}setHoveredMovedText(e){this._hoveredMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=xi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=xi(this,void 0),this.diff=this._diff,this._unchangedRegions=xi(this,void 0),this.unchangedRegions=Dt(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(En(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=xi(this,void 0),this._activeMovedText=xi(this,void 0),this._hoveredMovedText=xi(this,void 0),this.activeMovedText=Dt(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ai,this._diffProvider=Dt(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=Bh("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const s=oL("contentChangedSignal"),o=this._register(new yn(()=>s.trigger(void 0),200));this._register(Ni(a=>{const c=this._unchangedRegions.read(a);if(!c||c.regions.some(p=>p.isDragged.read(a)))return;const l=c.originalDecorationIds.map(p=>e.original.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?bi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Yk(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(yl),u=[];let f=!1;for(const p of NRe(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((w,b)=>w+b.lineCount,0),v=new Yk(p[0].originalLineNumber,p[0].modifiedLineNumber,m,p[0].visibleLineCountTop.get(),p[p.length-1].visibleLineCountBottom.get());u.push(v)}else u.push(p[0]);if(f){const p=e.original.deltaDecorations(c.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(c.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));En(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Yk.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l));let h;const u=this._unchangedRegions.get();if(u){const v=u.originalDecorationIds.map(y=>e.original.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0),w=u.modifiedDecorationIds.map(y=>e.modified.getDecorationRange(y)).map(y=>y?bi.fromRangeInclusive(y):void 0);let C=h1t(u.regions.map((y,S)=>{if(!v[S]||!w[S])return;const M=v[S].length;return new Yk(v[S].startLineNumber,w[S].startLineNumber,M,Math.min(y.visibleLineCountTop.get(),M),Math.min(y.visibleLineCountBottom.get(),M-y.visibleLineCountTop.get()))}).filter(yl),(y,S)=>!S||y.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&y.originalLineNumber>=S.originalLineNumber+S.lineCount).map(y=>new $b(y.getHiddenOriginalRange(l),y.getHiddenModifiedRange(l)));C=$b.clip(C,bi.ofLength(1,e.original.getLineCount()),bi.ofLength(1,e.modified.getLineCount())),h=$b.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const w=h.filter(b=>b.original.intersectsStrict(v.originalUnchangedRange)&&b.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(w,c))}else f.push(...d);const p=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:p,modifiedDecorationIds:m},c)};this._register(e.modified.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&IE.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Em(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),s.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),_v(sKe,a),_v(Qve,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);d=GZ(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=IE.fromModelContentChanges(f.changes);h=GZ(h,p)}));let u=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=P1t(u,e.original,e.modified),u=u,u=u,En(f=>{r(u,f),this._lastDiff=u;const p=aPe.fromDiffResult(u);this._diff.set(p,f),this._isDiffUpToDate.set(!0,f);const m=this.movedTextToCompare.get();this.movedTextToCompare.set(m?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const s=this._unchangedRegions.get()?.regions||[];for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await U$(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(s=>bi.deserialize(s.range)),i=this._unchangedRegions.get();!i||!t||En(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};Kee=D([_(2,nZe)],Kee);function P1t(n,e,t){return{changes:n.changes.map(i=>new pw(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>F1t(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function F1t(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew sZe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class sZe{constructor(e){this.lineRangeMapping=e}}class Yk{static fromDiffs(e,t,i,s,o){const r=pw.inverse(e,t,i),a=[];for(const c of r){let l=c.original.startLineNumber,d=c.modified.startLineNumber,h=c.original.length;const u=l===1&&d===1,f=l+h===t+1&&d+h===i+1;(u||f)&&h>=o+s?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Yk(l,d,h,0,0))):h>=o*2+s&&(l+=o,d+=o,h-=o*2,a.push(new Yk(l,d,h,0,0)))}return a}get originalUnchangedRange(){return bi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return bi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=xi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=xi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Dt(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=xi(this,void 0);const r=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-s),0);C2e(s===r),C2e(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new d_(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of s.ranges){const d=c===s.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Yk(o,r,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return bi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return bi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===xv.FromCloserSide&&s{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],w=s.modified.isEmpty;return v.push(new xn("diff.clipboard.copyDeletedContent",w?s.original.length>1?g(xL,0,"Copy deleted lines"):g(xL,1,"Copy deleted line"):s.original.length>1?g(xL,2,"Copy changed lines"):g(xL,3,"Copy changed line"),void 0,!0,async()=>{const C=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(C)})),s.original.length>1&&v.push(new xn("diff.clipboard.copyDeletedLineContent",w?g(xL,4,"Copy deleted line ({0})",s.original.startLineNumber+h):g(xL,5,"Copy changed line ({0})",s.original.startLineNumber+h),void 0,!0,async()=>{let C=this._originalTextModel.getLineContent(s.original.startLineNumber+h);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===bu.LF?` `:`\r -`),await this._clipboardService.writeText(C)})),i.getOption(x.readOnly)||v.push(new xn("diff.inline.revertChange",g(xL,6,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Xo(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=ia(this._diffActions),w=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+w)})),this._register(i.onMouseMove(p=>{(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(p=>{p.event.leftButton&&(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()&&(p.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),f(p.event.posx,p.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=ia(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ln});function oZe(n,e,t,i){Sd(i,e.fontInfo);const s=t.length>0,o=new fz(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=Sm.isBasicASCII(c,s),d=Sm.containsRTL(c,l,o),h=lQ(new tL(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==l1.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let xCe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=xi(this,0),this._originalScrollOffset=xi(this,0),this._originalScrollOffsetAnimated=BUe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=xi(this,0),this._modifiedScrollOffset=xi(this,0),this._modifiedScrollOffsetAnimated=BUe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=xi("invalidateAlignmentsState",0),u=this._register(new yn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(C=>C?Wn(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===RI.Completed):void 0).map((C,y)=>C?.read(y)),p=Dt(C=>{const y=this._diffModel.read(C),S=y?.diff.read(C);if(!y||!S)return null;h.read(C);const k=this._options.renderSideBySide.read(C);return JUe(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Dt(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);if(!y)return null;h.read(C);const S=y.changes.map(M=>new sZe(M));return JUe(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const C=document.createElement("div");return C.className="diagonal-fill",C}const w=this._register(new Z);this.viewZones=wO(this,(C,y)=>{w.clear();const S=p.read(C)||[],M=[],k=[],F=this._modifiedTopPadding.read(C);F>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._originalTopPadding.read(C);N>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:N,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(C),U=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(U){const Oe=this._editors.original.getModel();for(const wt of S)if(wt.diff)for(let Nt=wt.originalRange.startLineNumber;NtOe.getLineCount())return{orig:M,mod:k};U?.addRequest(Oe.getLineContent(Nt),null,null)}}const J=U?.finalize()??[];let j=0;const re=this._editors.modified.getOption(x.lineHeight),me=this._diffModel.read(C)?.movedTextToCompare.read(C),De=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Qe=this._editors.original.getModel()?.mightContainRTL()??!1,Tt=Ode.fromEditor(this._editors.modified);for(const Oe of S)if(Oe.diff&&!z){if(!Oe.originalRange.isEmpty){f.read(C);const Nt=document.createElement("div");Nt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Yi=this._editors.original.getModel();if(Oe.originalRange.endLineNumberExclusive-1>Yi.getLineCount())return{orig:M,mod:k};const Vi=new rZe(Oe.originalRange.mapToLineArray(ys=>Yi.tokenization.getLineTokens(ys)),Oe.originalRange.mapToLineArray(ys=>J[j++]),De,Qe),Gn=[];for(const ys of Oe.diff.innerChanges||[])Gn.push(new DW(ys.originalRange.delta(-(Oe.diff.original.startLineNumber-1)),SCe.className,Rc.Regular));const Ro=oZe(Vi,Tt,Gn,Nt),qn=document.createElement("div");if(qn.className="inline-deleted-margin-view-zone",Sd(qn,Tt.fontInfo),this._options.renderIndicators.read(C))for(let ys=0;ysws(ec),qn,this._editors.modified,Oe.diff,this._diffEditorWidget,Ro.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ys=0;ys1&&M.push({afterLineNumber:Oe.originalRange.startLineNumber+ys,domNode:v(),heightInPx:(mr-1)*re,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Oe.modifiedRange.startLineNumber-1,domNode:Nt,heightInPx:Ro.heightInLines*re,minWidthInPx:Ro.minWidthInPx,marginDomNode:qn,setZoneId(ys){ec=ys},showInHiddenAreas:!0,suppressMouseDown:!0})}const wt=document.createElement("div");wt.className="gutter-delete",M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Oe.modifiedHeightInPx,marginDomNode:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;if(wt>0){if(me?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Oe.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Nt=function(){const Vi=document.createElement("div");return Vi.className="arrow-revert-change "+$e.asClassName(Ce.arrowRight),y.add(pe(Vi,"mousedown",Gn=>Gn.stopPropagation())),y.add(pe(Vi,"click",Gn=>{Gn.stopPropagation(),o.revert(Oe.diff)})),we("div",{},Vi)};if(me?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Oe.modifiedRange.endLineNumberExclusive-1))continue;let Yi;Oe.diff&&Oe.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(Yi=Nt()),k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,marginDomNode:Yi,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Oe of m.read(C)??[]){if(!me?.lineRangeMapping.original.intersect(Oe.originalRange)||!me?.lineRangeMapping.modified.intersect(Oe.modifiedRange))continue;const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;wt>0?M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:k}});let b=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(C.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(C.scrollLeft),b=!1)})),this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ni(C=>{const y=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));y!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));y!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);let S=0;if(y){const M=this._editors.original.getTopForLineNumber(y.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(y.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-M}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};xCe=D([_(8,Mu),_(9,Vr)],xCe);function JUe(n,e,t,i,s,o){const r=new DS(XUe(n,i)),a=new DS(XUe(e,s)),c=n.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),w=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),w&&w.lineNumber>=m&&(w=void 0),!v&&!w)break;const b=v?v.lineNumber-h:Number.MAX_VALUE,C=w?w.lineNumber-u:Number.MAX_VALUE;bC?(a.dequeue(),v={lineNumber:w.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:bi.ofLength(v.lineNumber,1),modifiedRange:bi.ofLength(w.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+w.heightInPx,diff:void 0})}}for(const p of t){let C=function(y,S){if(yz.lineNumberz+U.heightInPx,0)??0,N=a.takeWhile(z=>z.lineNumberz+U.heightInPx,0)??0;d.push({originalRange:M,modifiedRange:k,originalHeightInPx:M.length*c+F,modifiedHeightInPx:k.length*l+N,diff:p.lineRangeMapping}),b=y,w=S};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,w=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const y of m.innerChanges||[]){y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&C(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber);const S=n.getModel(),M=y.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(y.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;y.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of n.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new oe(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return o1t(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}class B1t extends ${constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Wn(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Wn(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Bh("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Bh("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=oL("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(di("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{En(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(Ni(r=>{s.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(Ni(r=>this.render(r)))}dispose(){super.dispose(),_a(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),o=hi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new bi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);En(l=>{for(const d of c){if(!d.range.intersect(a))continue;s.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,l);else{const m=document.createElement("div");this._domNode.appendChild(m);const v=xi("item",d),w=this.itemProvider.createView(v,m);h=new W1t(v,w,m),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,p=(d.range.isEmpty?u:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${p}px`,h.gutterItemView.layout(hi.ofStartAndLength(u,p),o)}})}for(const r of s){const a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}}class W1t{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class aZe extends gw{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class DCe extends Zje{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new gf(e-1,t)}}var H1t=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";Ct(H1t,{});const U1t="vs/base/browser/ui/toolbar/toolbar";class cZe extends ${constructor(e,t,i={orientation:Qb.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new qRe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(C1()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new F7(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Qh(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,o)=>{if(s.id===F7.ID)return this.toggleMenuActionViewItem=new gx(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:$e.asClassNameArray(i.moreIcon??Ce.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(s,o);if(r)return r}if(s instanceof u1){const r=new gx(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}focus(){this.actionBar.focus()}getItemsWidth(){let e=0;for(let t=0;t0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return(this.lookupKeybindings?this.options.getKeyBinding?.(e):void 0)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const Bae=class Bae extends xn{constructor(e,t){t=t||g(U1t,0,"More Actions..."),super(Bae.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};Bae.ID="toolbar.toggle.more";let F7=Bae;const ZUe="vs/platform/actions/browser/toolbar";var wS;(function(n){n[n.NoHide=-1]="NoHide",n[n.Ignore=0]="Ignore",n[n.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(wS||(wS={}));let lV=class extends cZe{constructor(e,t,i,s,o,r,a,c){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new Z);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>c.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();const s=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==wS.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(s[f]=void 0,c[f]=p))}}iF(s),iF(c),super.setActions(s,Kr.join(c,o)),(r.length>0||s.length>0)&&this._sessionDisposables.add(pe(this.getElement(),"contextmenu",d=>{const h=new yu(gt(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof id&&u.menuKeybinding?f.push(u.menuKeybinding):u instanceof uS||u instanceof F7||f.push(QXe(u.id,void 0,this._commandService,this._keybindingService)),r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===wS.Ignore){m=!0;for(let v=0;vthis._menuService.resetHiddenStates(i)}))),p.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>p,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};lV=D([_(2,mc),_(3,Pe),_(4,Vr),_(5,ti),_(6,Qi),_(7,on)],lV);let nC=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(s.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];tD(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",u.length===0&&f.length===0),super.setActions(u,f)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new cn("This toolbar is populated from a menu.")}};nC=D([_(3,mc),_(4,Pe),_(5,Vr),_(6,ti),_(7,Qi),_(8,on)],nC);const Qfe=[],fK=35;let kCe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(Te.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Wn(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Dt(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Dt(this,d=>this._hasActions.read(d)?fK:0),this.elements=di("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:fK+"px"}},[]),this._currentDiff=Dt(this,d=>{const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d)?.mappings,f=this._editors.modifiedCursor.read(d);if(f)return u?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=Dt(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return Qfe;const f=this._editors.modifiedSelections.read(d);if(f.every(w=>w.isEmpty()))return Qfe;const p=new d_(f.map(w=>bi.fromRangeInclusive(w))),v=u.mappings.filter(w=>w.lineRangeMapping.innerChanges&&p.intersects(w.lineRangeMapping.modified)).map(w=>({mapping:w,rangeMappings:w.lineRangeMapping.innerChanges.filter(b=>f.some(C=>O.areIntersecting(b.modifiedRange,C)))}));return v.length===0||v.every(w=>w.rangeMappings.length===0)?Qfe:v}),this._register(r1t(e,this.elements.root)),this._register(pe(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(D1(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),WC(this,d=>this._showSash.read(d)?new iZe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,HJe(this,u=>this._sashLayout.sashLeft.read(u)-fK,(u,f)=>this._sashLayout.sashLeft.set(u+fK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new B1t(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,h)=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const p=this._selectedDiffs.read(h);if(p.length>0){const v=pw.fromRangeMappings(p.flatMap(w=>w.rangeMappings));return[new eVe(v,!0,Te.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new eVe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,Te.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(ICe,d,h,this)})),this._register(pe(this.elements.gutter,xe.MOUSE_WHEEL,d=>{this._editors.modified.getOption(x.scrollbar).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new DCe(this._editors.modifiedModel.get()),s=new DCe(this._editors.original.getModel());return new WU(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};kCe=D([_(6,be),_(7,Pe),_(8,mc)],kCe);class eVe{constructor(e,t,i,s,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let ICe=class extends ${constructor(e,t,i,s){super(),this._item=e,this._elements=di("div.gutterItem",{style:{height:"20px",width:"34px"}},[di("div.background@background",{},[]),di("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=xi(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(s.createInstance(gF,"element",!0,{position:{hoverPosition:Oo.RIGHT}}));this._register(A3(t,this._elements.root)),this._register(Ni(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Em((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(s.createInstance(nC,this._elements.buttons,this._menuId.read(r),{orientation:Qb.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:wS.Ignore,actionRunner:new aZe(()=>{const l=this._item.get(),d=l.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:l.originalUri,modifiedUri:l.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(c.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,o=i;let r=e.start+s;const a=hi.tryCreate(o,t.endExclusive-o-i),c=hi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const l=this._editors.modifiedModel.read(c),d=LCe._breadcrumbsSourceFactory.read(c);return!l||!d?void 0:d(l,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===Wi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Wi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})}));const o=this._diffModel.map((c,l)=>{const d=c?.unchangedRegions.read(l)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(l)?.getLineCount()?[]:d});this.viewZones=wO(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=o.read(c);for(const m of p)if(!m.shouldHideControls(c)){{const v=Dt(this,b=>m.getHiddenOriginalRange(b).startLineNumber-1),w=new Qee(v,24);h.push(w),l.add(new tVe(this._editors.original,w,m,m.originalUnchangedRange,!f,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}{const v=Dt(this,b=>m.getHiddenModifiedRange(b).startLineNumber-1),w=new Qee(v,24);u.push(w),l.add(new tVe(this._editors.modified,w,m,m.modifiedUnchangedRange,!1,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}}return{origViewZones:h,modViewZones:u}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Xt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(vB,0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+$e.asClassName(Ce.fold),zIndex:10001};this._register(qee(this._editors.original,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:O.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(qee(this._editors.modified,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:bi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Ni(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(yl)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(yl))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}},LCe=lN,lN._breadcrumbsSourceFactory=xi("breadcrumbsSourceFactory",void 0),lN);Yee=LCe=D([_(3,be)],Yee);class tVe extends ZXe{constructor(e,t,i,s,o,r,a,c){const l=di("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=di("div.diff-hidden-lines",[di("div.top@top",{title:g(vB,1,"Click or drag to show more above")}),di("div.center@content",{style:{display:"flex"}},[di("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[we("a",{title:g(vB,2,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...nw("$(unfold)"))]),di("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),di("div.bottom@bottom",{title:g(vB,3,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const d=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?_a(this._nodes.first):this._register(D1(this._nodes.first,{width:d.map(u=>u.contentLeft)})),this._register(Ni(u=>{const f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const p=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!p),p==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):p==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const h=this._editor;this._register(pe(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const v=gt(this._nodes.top),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m+M,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),b=pe(v,"mouseup",C=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),w.dispose(),b.dispose()})})),this._register(pe(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const v=gt(this._nodes.bottom),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m-M,this._unchangedRegion.getMaxVisibleLineCountBottom())),F=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const N=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(N-F))}),b=pe(v,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const y=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const S=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(S-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),w.dispose(),b.dispose()})})),this._register(Ni(u=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(u).length,m=g(vB,4,"{0} hidden lines",p),v=we("span",{title:g(vB,5,"Double click to unfold")},m);v.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const w=this._unchangedRegion.getHiddenModifiedRange(u),b=this._modifiedOutlineSource.getBreadcrumbItems(w,u);if(b.length>0){f.push(we("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(y.startLineNumber)}}}}_a(this._nodes.others,...f)}))}}var J_,a0;let dV=(a0=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=J_.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Wn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Dt(u=>{const f=c.read(u),p=f.getColor(Rmt)||(f.getColor(m_)||ewe).transparent(2),m=f.getColor(Mmt)||(f.getColor(yE)||twe).transparent(2);return{insertColor:p,removeColor:m}}),d=ks(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=di("div.diffOverview",{style:{position:"absolute",top:"0px",width:J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(A3(h,d.domNode)),this._register(Xo(h,xe.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(pe(h,xe.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(A3(this._rootElement,h)),this._register(Em((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(A3(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(A3(h,v.getDomNode()))),!m||!v)return;const w=Bh("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=Bh("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=Bh("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),y=Bh("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(Ni(S=>{w.read(S),b.read(S),C.read(S),y.read(S);const M=l.read(S),k=p?.diff.read(S)?.mappings;function F(U,J,j){const re=j._getViewModel();return re?U.filter(me=>me.length>0).map(me=>{const De=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.startLineNumber,1)),Qe=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.endLineNumberExclusive,1)),Tt=Qe.lineNumber-De.lineNumber;return new nYe(De.lineNumber,Qe.lineNumber,Tt,J.toString())}):[]}const N=F((k||[]).map(U=>U.lineRangeMapping.original),M.removeColor,this._editors.original),z=F((k||[]).map(U=>U.lineRangeMapping.modified),M.insertColor,this._editors.modified);m?.setZones(N),v?.setZones(z)})),f.add(Ni(S=>{const M=this._rootHeight.read(S),k=this._rootWidth.read(S),F=this._modifiedEditorLayoutInfo.read(S);if(F){const N=J_.ENTIRE_DIFF_OVERVIEW_WIDTH-2*J_.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:M,right:N+J_.ONE_OVERVIEW_WIDTH,width:J_.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:M,right:0,width:J_.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(S),U=this._editors.modifiedScrollHeight.read(S),J=this._editors.modified.getOption(x.scrollbar),j=new qU(J.verticalHasArrows?J.arrowSize:0,J.verticalScrollbarSize,0,F.height,U,z);d.setTop(j.getSliderPosition()),d.setHeight(j.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=M+"px",h.style.left=k-J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(J_.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},J_=a0,a0.ONE_OVERVIEW_WIDTH=15,a0.ENTIRE_DIFF_OVERVIEW_WIDTH=J_.ONE_OVERVIEW_WIDTH*2,a0);dV=J_=D([_(6,pn)],dV);const iVe="vs/editor/browser/widget/diffEditor/features/revertButtonsFeature",jfe=[];class V1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=Dt(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return jfe;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return jfe;const l=new d_(c.map(u=>bi.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&l.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>c.some(p=>O.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?jfe:h}),this._register(Em((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),c=a?.diff.read(o);if(!a||!c||a.movedTextToCompare.read(o))return;const l=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new Jee(u[u.length-1].positionLineNumber,this._widget,d.flatMap(p=>p.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}for(const u of c.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new Jee(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}r.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Wae=class Wae extends ${getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${Wae.counter++}`,this._domNode=di("div.revertButton",{title:this._revertSelection?g(iVe,0,"Revert Selected Changes"):g(iVe,1,"Revert Change")},[OS(Ce.arrowRight)]).root,this._register(pe(this._domNode,xe.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(pe(this._domNode,xe.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(pe(this._domNode,xe.CLICK,o=>{this._diffs instanceof $b?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:FS.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Wae.counter=0;let Jee=Wae;function Kfe(n){return TCe.get(n)}const ZT=class ZT{static get(e){let t=ZT._map.get(e);if(!t){t=new ZT(e),ZT._map.set(e,t);const i=e.onDidDispose(()=>{ZT._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.value=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getValue()),this.valueIsEmpty=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getModel()?.getValueLength()===0),this.selections=Wn(this.editor.onDidChangeCursorSelection,()=>this.editor.getSelections()),this.cursorPosition=yy({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.isFocused=Wn(t=>{const i=this.editor.onDidFocusEditorWidget(t),s=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),s.dispose()}}},()=>this.editor.hasWidgetFocus())}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(bQ({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}};ZT._map=new Map;let TCe=ZT;const z1t="vs/editor/browser/widget/diffEditor/components/diffEditorEditors";let RCe=class extends ${get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new I),this.modifiedScrollTop=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=Kfe(this.modified).model,this.modifiedSelections=Wn(this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=yy({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Wn(this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Kfe(this.original).isFocused,this.isModifiedFocused=Kfe(this.modified).isFocused,this.isFocused=Dt(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(Az({createEmptyChangeSummary:()=>({}),handleChange:(c,l)=>(c.didChange(i.editorOptions)&&Object.assign(l,c.change.changedOptions),!0)},(c,l)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,l)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,l))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=_u.revealHorizontalRightPadding.defaultValue+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=g(z1t,0," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};RCe=D([_(5,be),_(6,ti)],RCe);const Hae=class Hae extends ${constructor(){super(...arguments),this._id=++Hae.idCounter,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getStatusbarColumn(e){return this._targetEditor.getStatusbarColumn(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=vt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=vt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=vt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=vt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=vt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=vt.Smooth){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=vt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=vt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=vt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=vt.Smooth){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};Hae.idCounter=0;let MCe=Hae,Xee=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=xi(this,0),this._screenReaderMode=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Dt(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Dt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=Dt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=Dt(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=Dt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=Dt(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=Dt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=Dt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=Dt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=Dt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=Dt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=Dt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=Dt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=Dt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=Dt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=Dt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=Dt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=Dt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=Dt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Dt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Dt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i={...e,...nVe(e,_h)};this._options=xi(this,i)}updateOptions(e){const t=nVe(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}};Xee=D([_(1,Ur)],Xee);function nVe(n,e){return{enableSplitViewResizing:It(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:odt(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:It(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:It(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:VL(n.maxComputationTime,e.maxComputationTime,0,Zn.MAX_SAFE_SMALL_INTEGER),maxFileSize:VL(n.maxFileSize,e.maxFileSize,0,Zn.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:It(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:It(n.renderIndicators,e.renderIndicators),originalEditable:It(n.originalEditable,e.originalEditable),diffCodeLens:It(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:It(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:La(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:La(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:It(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:It(n.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:It(n.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:It(n.hideUnchangedRegions?.enabled??n.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:VL(n.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),minimumLineCount:VL(n.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),revealLineCount:VL(n.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:It(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:It(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:VL(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Zn.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:It(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:It(n.renderGutterMenu,e.renderGutterMenu)}}var fH;let xm=(fH=class extends MCe{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,s,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=di("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[di("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),di("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),di("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=xi(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=T.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._boundarySashes=xi(this,void 0),this._accessibleDiffViewerShouldBeVisible=xi(this,!1),this._accessibleDiffViewerVisible=Dt(this,y=>this._options.onlyShowAccessibleDiffViewer.read(y)?!0:this._accessibleDiffViewerShouldBeVisible.read(y)),this._movedBlocksLinesPart=xi(this,void 0),this._layoutInfo=Dt(this,y=>{const S=this._rootSizeObserver.width.read(y),M=this._rootSizeObserver.height.read(y);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=M+"px";const k=this._sash.read(y),F=this._gutter.read(y),N=F?.width.read(y)??0,z=this._overviewRulerPart.read(y)?.width??0;let U,J,j,re,me;if(!!k){const Qe=k.sashLeft.read(y),Tt=this._movedBlocksLinesPart.read(y)?.width.read(y)??0;U=0,J=Qe-N-Tt,me=Qe-N,j=Qe,re=S-j-z}else me=0,U=N,J=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),j=N+J,re=S-j-z;return this.elements.original.style.left=U+"px",this.elements.original.style.width=J+"px",this._editors.original.layout({width:J,height:M},!0),F?.layout(me),this.elements.modified.style.left=j+"px",this.elements.modified.style.width=re+"px",this._editors.modified.layout({width:re,height:M},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((y,S)=>y?.diff.read(S)),this.onDidUpdateDiff=T.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this.elements.root.classList.toggle("standalone",i.isStandaloneEditor||!1),this._domElement.appendChild(this.elements.root),this._register(Ee(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new XXe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(Xee,t),this._register(Ni(y=>{this._options.setWidth(this._rootSizeObserver.width.read(y))})),this._contextKeyService.createKey(X.isEmbeddedDiffEditor.key,!1),this._register(dA(X.isEmbeddedDiffEditor,this._contextKeyService,y=>this._options.isInEmbeddedEditor.read(y))),this._register(dA(X.comparingMovedCode,this._contextKeyService,y=>!!this._diffModel.read(y)?.movedTextToCompare.read(y))),this._register(dA(X.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,y=>this._options.couldShowInlineViewBecauseOfSize.read(y))),this._register(dA(X.diffEditorInlineMode,this._contextKeyService,y=>!this._options.renderSideBySide.read(y))),this._register(dA(X.hasChanges,this._contextKeyService,y=>(this._diffModel.read(y)?.diff.read(y)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(RCe,this.elements.original,this.elements.modified,this._options,i,(y,S,M,k)=>this._createInnerEditor(y,S,M,k))),this._register(dA(X.diffEditorOriginalWritable,this._contextKeyService,y=>this._options.originalEditable.read(y))),this._register(dA(X.diffEditorModifiedWritable,this._contextKeyService,y=>!this._options.readOnly.read(y))),this._register(dA(X.diffEditorOriginalUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.original.uri.toString()??"")),this._register(dA(X.diffEditorModifiedUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.modified.uri.toString()??"")),this._overviewRulerPart=WC(this,y=>this._options.renderOverviewRuler.read(y)?this._instantiationService.createInstance(_v(dV,y),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,S)=>y-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new T1t(this._options,l),this._sash=WC(this,y=>{const S=this._options.renderSideBySide.read(y);return this.elements.root.classList.toggle("side-by-side",S),S?new iZe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=WC(this,y=>this._instantiationService.createInstance(_v(Yee,y),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);WC(this,y=>this._instantiationService.createInstance(_v(L1t,y),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=WC(this,y=>this._instantiationService.createInstance(_v(xCe,y),gt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Dt(this,y=>{const S=p.read(y).viewZones.read(y).orig,M=d.read(y).viewZones.read(y).origViewZones;return S.concat(M)}),v=Dt(this,y=>{const S=p.read(y).viewZones.read(y).mod,M=d.read(y).viewZones.read(y).modViewZones;return S.concat(M)});this._register(jee(this._editors.original,m,y=>{f=y},h));let w;this._register(jee(this._editors.modified,v,y=>{f=y,f?w=M_.capture(this._editors.modified):(w?.restore(this._editors.modified),w=void 0)},u)),this._accessibleDiffViewer=WC(this,y=>this._instantiationService.createInstance(_v(Kk,y),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,M)=>this._accessibleDiffViewerShouldBeVisible.set(S,M),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,M)=>S?.diff.read(M)?.mappings.map(k=>k.lineRangeMapping)),new A1t(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(y=>y?"hidden":"visible");this._register(D1(this.elements.modified,{visibility:b})),this._register(D1(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=WC(this,y=>this._options.shouldRenderGutterMenu.read(y)?this._instantiationService.createInstance(_v(kCe,y),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Ez(this._layoutInfo)),WC(this,y=>new(_v(GW,y))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,y=>{this._movedBlocksLinesPart.set(y,void 0)}),this._register(T.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!0))),this._register(T.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!1)));const C=this._diffModel.map(this,(y,S)=>{if(y)return y.diff.read(S)===void 0&&!y.isDiffUpToDate.read(S)});this._register(Em((y,S)=>{if(C.read(y)===!0){const M=this._editorProgressService.show(!0,1e3);S.add(Ee(()=>M.done()))}})),this._register(Ee(()=>{this._shouldDisposeDiffModel&&this._diffModel.get()?.dispose()})),this._register(Em((y,S)=>{S.add(new(_v(V1t,y))(this._editors,this._diffModel,this._options,this))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,s){return e.createInstance(_1,t,i,s)}_createDiffEditorContributions(){const e=b_.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){bt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return mz.IDiffEditor}onVisible(){this._editors.original.onVisible(),this._editors.modified.onVisible()}onHide(){this._editors.original.onHide(),this._editors.modified.onHide()}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(Kee,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==i?.model&&m7(t,s=>{Wn.batchEventsGlobally(s,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const o=this._diffModel.get(),r=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=i?.shouldDispose??!1,this._diffModel.set(i?.model,s),r&&o?.dispose()})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}setBoundarySashes(e){this._boundarySashes.set(e,void 0)}get ignoreTrimWhitespace(){return this._options.ignoreTrimWhitespace.get()}get maxComputationTime(){return this._options.maxComputationTimeMs.get()}get renderSideBySide(){return this._options.renderSideBySide.get()}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?$1t(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new oe(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?s=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=t1(t,o=>o.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const o=t.getSelection();if(o){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=WUe(o.getStartPosition(),r),c=WUe(o.getEndPosition(),r);s=O.plusRange(a,c)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Wi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(s=>t?s.lineRangeMapping.modified.contains(e.position.lineNumber):s.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Zl.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},fH.ENTIRE_DIFF_OVERVIEW_WIDTH=dV.ENTIRE_DIFF_OVERVIEW_WIDTH,fH);xm=D([_(3,Pe),_(4,be),_(5,Qt),_(6,Lw),_(7,eD)],xm);function $1t(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a?.map(c=>({originalStartLineNumber:c.originalRange.startLineNumber,originalStartColumn:c.originalRange.startColumn,originalEndLineNumber:c.originalRange.endLineNumber,originalEndColumn:c.originalRange.endColumn,modifiedStartLineNumber:c.modifiedRange.startLineNumber,modifiedStartColumn:c.modifiedRange.startColumn,modifiedEndLineNumber:c.modifiedRange.endLineNumber,modifiedEndColumn:c.modifiedRange.endColumn}))}})}let G1t=0,sVe=!1;function q1t(n){if(!n){if(sVe)return;sVe=!0}smt(n||yi.document.body)}let k1=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||bee.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+bee.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,s,o,r,l,d,h,u,f),c instanceof x1?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,q1t(p.ariaContainerElement),RJe((m,v)=>i.createInstance(gF,m,v,{})),KJe(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++G1t,o=ge.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None;const t=e.id,i=e.label,s=ge.and(ge.equals("editorId",this.getId()),ge.deserialize(e.precondition)),o=e.keybindings,r=ge.and(s,ge.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,l=(f,...p)=>Promise.resolve(e.run(this,...p)),d=new Z,h=this.getId()+":"+t;if(d.add(yt.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:s,group:a,order:c};d.add(Xs.appendMenuItem(Te.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new oYe(h,i,i,void 0,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Ee(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof tee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};k1=D([_(2,be),_(3,Qt),_(4,Qi),_(5,Pe),_(6,Zc),_(7,ti),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],k1);let mF=class extends k1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){const w={...t};$ee(h,w,!1);const b=l.registerEditorContainer(e);typeof w.theme=="string"&&l.setTheme(w.theme),typeof w.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!w.autoDetectHighContrast);const C=w.model;delete w.model,super(e,w,i,s,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(b);let y;if(typeof C>"u"){const S=p.getLanguageIdByMimeType(w.language)||w.language||Kc;y=lZe(f,p,w.value||"",S,void 0),this._ownsModel=!0}else y=C,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};mF=D([_(2,be),_(3,Qt),_(4,Qi),_(5,Pe),_(6,Zc),_(7,ti),_(8,Iw),_(9,Pi),_(10,Re),_(11,Ur),_(12,Ai),_(13,Di),_(14,lo),_(15,ht)],mF);let Zee=class extends xm{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={...t};$ee(c,f,!0);const p=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},s,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(k1,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};Zee=D([_(2,be),_(3,Pe),_(4,Qt),_(5,Iw),_(6,Pi),_(7,Re),_(8,Vr),_(9,eD),_(10,Mu),_(11,Lw)],Zee);function lZe(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),oVe(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return oVe(n,t,e.createById(i),s)}function oVe(n,e,t,i){return n.createModel(e,t,i)}var Q1t=".monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);height:100%;overflow-y:hidden;position:relative;width:100%;>div{height:100%;left:0;position:absolute;top:0;width:100%;&.placeholder{display:grid;place-content:center;place-items:center;visibility:hidden;&.visible{visibility:visible}}}.active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.multiDiffEntry{display:flex;flex:1;flex-direction:column;overflow:hidden;.collapse-button{cursor:pointer;margin:0 5px;a{display:block}}.header{background:var(--vscode-editor-background);z-index:1000;&:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.header-content{align-items:center;background:var(--vscode-multiDiffEditor-headerBackground);border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);display:flex;margin:8px 0 0;padding:4px 5px;&.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.file-path{display:flex;flex:1;min-width:0;.title{font-size:14px;line-height:22px;&.original{flex:1;min-width:0;text-overflow:ellipsis}}.status{font-weight:600;line-height:22px;margin:0 10px;opacity:.75}}.actions{padding:0 8px}}}.editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);display:flex;flex:1;flex-direction:column;overflow:hidden}.editorContainer{flex:1}}}";Ct(Q1t,{});class j1t{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let ete=class extends ${constructor(e,t,i,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=xi(this,void 0),this._collapsed=Dt(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=xi(this,500),this.contentHeight=Dt(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=xi(this,0),this._modifiedWidth=xi(this,0),this._originalContentWidth=xi(this,0),this._originalWidth=xi(this,0),this.maxScroll=Dt(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),c=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>c?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:c,width:this._originalWidth.read(r)}}),this._elements=di("div.multiDiffEntry",[di("div.header@header",[di("div.header-content",[di("div.collapse-button@collapseButton"),di("div.file-path",[di("div.title.modified.show-file-icons@primaryPath",[]),di("div.status.deleted@status",["R"]),di("div.title.original.show-file-icons@secondaryPath",[])]),di("div.actions@actions")])]),di("div.editorParent",[di("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(xm,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=rVe(this.editor.getModifiedEditor()),this.isOriginalFocused=rVe(this.editor.getOriginalEditor()),this.isFocused=Dt(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Z,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new Tu(this._elements.collapseButton,{});this._register(Ni(r=>{o.element.className="",o.icon=this._collapsed.read(r)?Ce.chevronRight:Ce.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ni(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{uJ(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(Ni(r=>{const a=this._viewModel.read(r)?.isActive.read(r);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(nC,this._elements.actions,Te.MultiDiffEditorFileToolbar,{actionRunner:this._register(new aZe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>yO(s,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),uJ(s=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setModel(e.viewModel.diffEditorViewModel,s),this.editor.updateOptions(t(i.options??{}))})}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(s.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,uJ(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};ete=D([_(3,be)],ete);function rVe(n){return Wn(e=>{const t=new Z;return t.add(n.onDidFocusEditorWidget(()=>e(!0))),t.add(n.onDidBlurEditorWidget(()=>e(!1))),t},()=>n.hasTextFocus())}class K1t{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}const Y1t="vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl";let NCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=di("div.scrollContent",[di("div@content",{style:{overflow:"hidden"}}),di("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new nO({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>xd(gt(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new hQ(this._scrollableElements.root,{vertical:zo.Auto,horizontal:zo.Auto,useShadows:!1},this._scrollable)),this._elements=di("div.monaco-component.multiDiffEditor",{},[di("div",{},[this._scrollableElement.getDomNode()]),di("div.placeholder@placeholder",{},[di("div",[g(Y1t,0,"No Changed Files")])])]),this._sizeObserver=this._register(new XXe(this._element,void 0)),this._objectPool=this._register(new K1t(c=>{const l=this._instantiationService.createInstance(ete,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=wO(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new cn}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new X1t(p,this._objectPool,this.scrollLeft,w=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+w})})),v=this._lastDocStates?.[m.getKey()];return v&&En(w=>{m.setViewState(v,w)}),u.set(p,m),m}),getItem:p=>u.get(p)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,l)=>c.reduce((d,h)=>d+h.contentHeight.read(l)+this._spaceBetweenPx,0)),this.activeControl=Dt(this,c=>{const l=this._viewModel.read(c)?.activeDiffItem.read(c);return l?this._viewItemsInfo.read(c).getItem(l).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(X.inMultiDiffEditor.key,!0),this._register(Em((c,l)=>{const d=this._viewModel.read(c);if(d&&d.contextKeys)for(const[h,u]of Object.entries(d.contextKeys)){const f=this._contextKeyService.createKey(h,void 0);f.set(u),l.add(Ee(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(X.multiDiffEditorAllCollapsed.key,!1);this._register(Ni(c=>{const l=this._viewModel.read(c);if(l){const d=l.items.read(c).every(h=>h.collapsed.read(c));a.set(d)}})),this._register(Ni(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(Ni(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Ni(c=>{const l=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${l}px`;const d=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${d}px`;const h=this._sizeObserver.width.read(c);let u=h;const f=this._viewItems.read(c),p=MRe(f,El(m=>m.maxScroll.read(c).maxScroll,cg));if(p){const m=p.maxScroll.read(c);u=h+m.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:l,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._elements.root),this._register(Ee(()=>{e.replaceChildren()})),this._register(this._register(Ni(c=>{uJ(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),s=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(s===-1)throw new cn("Resource not found in diff editor");const o=i[s];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,En(t=>{if(e.docStates)for(const i of this._viewItems.get()){const s=e.docStates[i.getKey()];s&&i.setViewState(s,t)}})}tryGetCodeEditor(e){const t=this._viewItems.get().find(s=>s.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||s.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString()),i=t?.template.get()?.editor;if(i)return t.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()?{diffEditor:i,editor:i.getModifiedEditor()}:{diffEditor:i,editor:i.getOriginalEditor()}}render(e){const t=this.scrollTop.read(e);let i=0,s=0,o=0;const r=this._sizeObserver.height.read(e),a=hi.ofStartAndLength(t,r),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,r),u=hi.ofStartAndLength(s,h),f=hi.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,l.hide();else if(f.isAfter(a))l.hide();else{const p=Math.max(0,Math.min(a.start-f.start,d-h));i-=p;const m=hi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}s+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};NCe=D([_(4,Pe),_(5,be)],NCe);function J1t(n,e){const t=n.getModel(),i=n.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{n.getModel()===t&&i.clear()},350)}class X1t extends ${constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(_7(this,void 0)),this.contentHeight=Dt(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Dt(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Dt(this,o=>this._templateRef.read(o)?.object),this._isHidden=xi(this,!1),this._isFocused=Dt(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Ni(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(Ni(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.entry.value.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return En(e=>{this._updateTemplateData(e)}),{collapsed:this.viewModel.collapsed.get(),selections:this.viewModel.lastTemplateData.get().selections}}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=e.selections?.map(mt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&En(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new j1t(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,s)}}class dZe extends ${async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!1,e)})}get contextKeys(){return this.model.contextKeys}constructor(e,t){super(),this.model=e,this._instantiationService=t,this._documents=VJe(this.model,this.model.documents),this.items=yee(this,this._documents,(i,s)=>s.add(this._instantiationService.createInstance(PCe,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Dt(this,i=>this.items.read(i).find(s=>s.isFocused.read(i))),this.activeDiffItem=jxt(this,(i,s)=>this.focusedDiffItem.read(i)??s)}}let PCe=class extends ${get originalUri(){return this.entry.value.original?.uri}get modifiedUri(){return this.entry.value.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}constructor(e,t,i,s){super(),this.entry=e,this._editorViewModel=t,this._instantiationService=i,this._modelService=s,this.collapsed=xi(this,!1),this.lastTemplateData=xi(this,{contentHeight:500,selections:void 0}),this.isActive=Dt(this,l=>this._editorViewModel.activeDiffItem.read(l)===this),this._isFocusedSource=xi(this,Au(!1)),this.isFocused=Dt(this,l=>this._isFocusedSource.read(l).read(l));function o(l){return{...l,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(Xee,o(this.entry.value.options||{}));this.entry.value.onOptionsDidChange&&this._register(this.entry.value.onOptionsDidChange(()=>{r.updateOptions(o(this.entry.value.options||{}))}));const a=this.entry.value.original??this._register(this._modelService.createModel("",null)),c=this.entry.value.modified??this._register(this._modelService.createModel("",null));this.diffEditorViewModel=this._register(this._instantiationService.createInstance(Kee,{original:a,modified:c},r))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};PCe=D([_(2,be),_(3,Ai)],PCe);const cPe="vs/editor/browser/widget/multiDiffEditor/colors";B("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(cPe,0,"The background color of the diff editor's header"));B("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},g(cPe,1,"The background color of the multi file diff editor"));B("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(cPe,2,"The border color of the multi file diff editor"));let FCe=class extends ${constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=xi(this,void 0),this._viewModel=xi(this,void 0),this._widgetImpl=wO(this,(s,o)=>(_v(ete,s),o.add(this._instantiationService.createInstance(_v(NCe,s),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Dt(this,s=>this._widgetImpl.read(s).activeControl.read(s)),this.onDidChangeActiveControl=T.fromObservableLight(this._activeControl),this._register(Ez(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new dZe(e,this._instantiationService)}setViewModel(e){this._viewModel.set(e,void 0)}layout(e){this._dimension.set(e,void 0)}getActiveControl(){return this._activeControl.get()}getViewState(){return this._widgetImpl.get().getViewState()}setViewState(e){this._widgetImpl.get().setViewState(e)}tryGetCodeEditor(e){return this._widgetImpl.get().tryGetCodeEditor(e)}};FCe=D([_(2,be)],FCe);const Z1t="vs/editor/contrib/editorState/browser/keybindingCancellation",lPe=ae("IEditorCancelService"),hZe=new Y("cancellableOperation",!1,g(Z1t,0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(lPe,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=hZe.bindTo(s.get(Pe)),r=new td;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},Kt.Delayed);class eLt extends ai{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(lPe).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ke(new class extends Yc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:ye.EditorContrib,primary:E.Escape},precondition:hZe})}runEditorCommand(n,e){n.get(lPe).cancel(e)}});var hr;(function(n){n[n.Value=1]="Value",n[n.Selection=2]="Selection",n[n.Position=4]="Position",n[n.Scroll=8]="Scroll"})(hr||(hr={}));let Bde=class OCe{constructor(e,t){if(this.flags=t,this.flags&hr.Value){const i=e.getModel();this.modelVersionId=i?r_("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&hr.Position?this.position=e.getPosition():this.position=null,this.flags&hr.Selection?this.selection=e.getSelection():this.selection=null,this.flags&hr.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof OCe))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new OCe(e,this.flags))}};class I1 extends eLt{constructor(e,t,i,s){super(e,s),this._listener=new Z,t&hr.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!O.containsPosition(i,o.position))&&this.cancel()})),t&hr.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!O.containsRange(i,o.selection))&&this.cancel()})),t&hr.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&hr.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class dPe extends ai{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hV{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=M_.capture(e),o=hV._handleEolEdits(e,t);o.length===1&&hV._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>ds.replace(O.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>ds.replaceMove(O.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}function uZe(n){return n.scheme===_e.vscodeRemote?n.authority:void 0}function Wde(n){if(!n)return;const e=n.indexOf("+");return e<0?n:n.substr(0,e)}const tLt="extensions.user.cache",iLt="extensions.builtin.cache",gZe="undefined_publisher",nLt=["ui","workspace","web"];function pK(n){if(typeof n=="object"&&n!==null&&n.supported!==!0)return n.description}const fZe=["Azure","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","AI","Chat","Other"];var qr;(function(n){n[n.System=0]="System",n[n.User=1]="User"})(qr||(qr={}));var Hs;(function(n){n.WIN32_X64="win32-x64",n.WIN32_ARM64="win32-arm64",n.LINUX_X64="linux-x64",n.LINUX_ARM64="linux-arm64",n.LINUX_ARMHF="linux-armhf",n.ALPINE_X64="alpine-x64",n.ALPINE_ARM64="alpine-arm64",n.DARWIN_X64="darwin-x64",n.DARWIN_ARM64="darwin-arm64",n.WEB="web",n.UNIVERSAL="universal",n.UNKNOWN="unknown",n.UNDEFINED="undefined"})(Hs||(Hs={}));class Cn{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(typeof e>"u"||e===null)return typeof t>"u"||t===null;if(typeof t>"u"||t===null)return!1;if(typeof e=="string"||typeof t=="string"){const i=typeof e=="string"?e:e.value,s=typeof t=="string"?t:t.value;return Oa(i,s)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class $v{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Cn.toKey(e))}delete(e){return this._set.delete(Cn.toKey(e))}has(e){return this._set.has(Cn.toKey(e))}}class $a{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Cn.toKey(e))}get(e){return this._map.get(Cn.toKey(e))}has(e){return this._map.has(Cn.toKey(e))}set(e,t){this._map.set(Cn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function sLt(n){return hPe(n)}function hPe(n){return n.contributes&&n.contributes.localizations?n.contributes.localizations.length>0:!1}function oLt(n,e){if(e){const t=`onResolveRemoteAuthority:${Wde(e)}`;return!!n.activationEvents?.includes(t)}return!1}function Hde(n,e,t){const i=[],s=new $v,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(c,l,d){return a.provideDocumentRangeFormattingEdits(c,c.getFullModelRange(),l,d)}})}return i}var uV;(function(n){n[n.File=1]="File",n[n.Selection=2]="Selection"})(uV||(uV={}));var S_;(function(n){n[n.Explicit=1]="Explicit",n[n.Silent=2]="Silent"})(S_||(S_={}));const e9=class e9{static setFormatterSelector(e){return{dispose:e9._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const o=fi.first(e9._selectors);if(o)return await o(e,t,i,s)}};e9._selectors=new td;let gV=e9;async function Ude(n,e,t,i,s,o,r){const a=n.get(be),{documentRangeFormattingEditProvider:c}=n.get(ht),l=ja(e)?e.getModel():e,d=c.ordered(l),h=await gV.select(d,l,i,uV.Selection);h&&(s.report(h),await a.invokeFunction(pZe,h,e,t,o,r))}async function pZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Ze),c=n.get(Lw);let l,d;ja(t)?(l=t.getModel(),d=new I1(t,hr.Value|hr.Position,void 0,s)):(l=t,d=new dPe(t,s));const h=[];let u=0;for(const w of Kb(i).sort(O.compareRangesUsingStarts))u>0&&O.areIntersectingOrTouching(h[u-1],w)?h[u-1]=O.fromPositions(h[u-1].getStartPosition(),w.getEndPosition()):u=h.push(w);const f=async w=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,w);const b=await e.provideDocumentRangeFormattingEdits(l,w,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),b},p=(w,b)=>{if(!w.length||!b.length)return!1;const C=w.reduce((y,S)=>O.plusRange(y,S.range),w[0].range);if(!b.some(y=>O.intersectRanges(C,y.range)))return!1;for(const y of w)for(const S of b)if(O.intersectRanges(y.range,S.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const w=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),v.push(w)}else{for(const w of h){if(d.token.isCancellationRequested)return!0;v.push(await f(w))}for(let w=0;w({text:C.text,range:O.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:y}of C)if(O.areIntersectingOrTouching(y,b))return[new mt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return c.playSignal(Zl.format,{userGesture:o}),!0}async function BCe(n,e,t,i,s,o){const r=n.get(be),a=n.get(ht),c=ja(e)?e.getModel():e,l=Hde(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await gV.select(l,c,t,uV.File);d&&(i.report(d),await r.invokeFunction(mZe,d,e,t,s,o))}async function mZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Lw);let c,l;ja(t)?(c=t.getModel(),l=new I1(t,hr.Value|hr.Position,void 0,s)):(c=t,l=new dPe(t,s));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await r.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(ja(t))hV.execute(t,d,i!==S_.Silent),i!==S_.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),vt.Immediate);else{const[{range:h}]=d,u=new mt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:O.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(O.areIntersectingOrTouching(p,u))return[new mt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(Zl.format,{userGesture:o}),!0}async function rLt(n,e,t,i,s,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(er);if(mo(c))return await n.computeMoreMinimalEdits(t.uri,c)}}async function aLt(n,e,t,i,s){const o=Hde(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(er);if(mo(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function _Ze(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(er).then(c=>n.computeMoreMinimalEdits(t.uri,c))}yt.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const o=n.get(Rn),r=n.get(kd),a=n.get(ht),c=await o.createModelReference(t);try{return rLt(r,a,c.object.textEditorModel,O.lift(i),s,qe.None)}finally{c.dispose()}});yt.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;Bt(P.isUri(t));const s=n.get(Rn),o=n.get(kd),r=n.get(ht),a=await s.createModelReference(t);try{return aLt(o,r,a.object.textEditorModel,i,qe.None)}finally{a.dispose()}});yt.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string");const r=n.get(Rn),a=n.get(kd),c=n.get(ht),l=await r.createModelReference(t);try{return _Ze(a,c,l.object.textEditorModel,oe.lift(i),s,o,qe.None)}finally{l.dispose()}});var _d;(function(n){n[n.provider=0]="provider",n[n.userDefined=1]="userDefined",n[n.recovered=2]="recovered"})(_d||(_d={}));const cLt={[_d.provider]:" ",[_d.userDefined]:"u",[_d.recovered]:"r"},aVe=65535,pb=16777215,cVe=4278190080;class Yfe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<aVe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Yfe(e.length),this._userDefinedStates=new Yfe(e.length),this._recoveredStates=new Yfe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;ipb||r>pb)throw new Error("startLineNumber or endLineNumber must not exceed "+pb);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&pb}getEndLineNumber(e){return this._endIndexes[e]&pb}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?_d.userDefined:this.isRecovered(e)?_d.recovered:_d.provider}setSource(e,t){t===_d.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===_d.recovered?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&cVe)>>>16);return t===aVe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?w=>ww=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===_d.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=_d.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===_d.provider&&(m.source=_d.recovered)),d=r(++c);else{let v=c,w=d;for(;;){if(!w||w.startLineNumber>l.endLineNumber){m=l;break}if(w.source===_d.userDefined&&w.endLineNumber>l.endLineNumber)break;w=r(++v)}l=o(++a)}if(m){for(;u&&u.endLineNumberm.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!u||u.endLineNumber>=m.endLineNumber)&&(p.push(m),f=m.startLineNumber,u&&h.push(u),u=m)}}return p}}class lLt{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}hidesLine(e){return this.startLineNumberi.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=c=>{for(;sr&&(r=l),s++}};for(const c of e){const l=c.regionIndex,d=this._editorDecorationIds[l];if(d&&!t[d]){t[d]=!0,a(l);const h=!this._regions.isCollapsed(l);this._regions.setCollapsed(l,h),o=Math.max(o,this._regions.getEndLineNumber(l))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??_d.provider})}const s=Xp.sanitizeAndMerge(this._regions,t,i);this.updatePost(Xp.fromFoldRanges(s))}_getLinesChecksum(e,t){return Ed(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,c=this._regions.length;a0&&!l.containedBy(r[r.length-1]);)r.pop();r.push(l),t(l,r.length)&&i.push(l)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);s.push(...r)}n.toggleCollapseState(s)}function hLt(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function uLt(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function bZe(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function uPe(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function gPe(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function gLt(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function fLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function pLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Gb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return lVe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!vLt(r,s))&&(s=lVe(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function vLt(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function lVe(n,e){const t=bU(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const wLt=5e3,bLt="indent";class fPe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=bLt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(SLt(this.editorModel,i,s,this.foldingRangesLimit))}}let CLt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>pb||t>pb)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new Xp(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let c=0;ct){s=c;break}i+=l}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let c=this._length-1,l=0;c>=0;c--){const d=this._startIndexes[c],h=e.getLineContent(d),u=dde(h,o);(u{}};function SLt(n,e,t,i=yLt){const s=n.getOptions().tabSize,o=new CLt(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=n.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=n.getLineCount();l>0;l--){const d=n.getLineContent(l),h=dde(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,u=a[p],o.insertFirst(l,u.line,h),u.line=l,u.indent=h,u.endAbove=l;continue}}else{a.push({indent:-2,endAbove:l,line:l});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const p=u.endAbove-1;p-l>=1&&o.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return o.toIndentRanges(n)}const rL="vs/editor/contrib/folding/browser/foldingDecorations",ALt=B("editor.foldBackground",{light:Ie(Hv,.3),dark:Ie(Hv,.3),hcDark:null,hcLight:null},g(rL,0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);B("editorGutter.foldingControlForeground",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(rL,1,"Color of the folding control in the editor gutter."));const tte=ji("folding-expanded",Ce.chevronDown,g(rL,2,"Icon for expanded ranges in the editor glyph margin.")),ite=ji("folding-collapsed",Ce.chevronRight,g(rL,3,"Icon for collapsed ranges in the editor glyph margin.")),dVe=ji("folding-manual-collapsed",ite,g(rL,4,"Icon for manually collapsed ranges in the editor glyph margin.")),hVe=ji("folding-manual-expanded",tte,g(rL,5,"Icon for manually expanded ranges in the editor glyph margin.")),Jfe={color:Nr(ALt),position:xu.Inline},jO=g(rL,6,"Click to expand the range."),mK=g(rL,7,"Click to collapse the range."),Ac=class Ac{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ac.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ac.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ac.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ac.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ac.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ac.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ac.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ac.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ac.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ac.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ac.MANUALLY_EXPANDED_VISUAL_DECORATION:Ac.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ac.COLLAPSED_VISUAL_DECORATION=jt.register({description:"folding-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),Ac.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=jt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),Ac.MANUALLY_COLLAPSED_VISUAL_DECORATION=jt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),Ac.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=jt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),Ac.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=jt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO}),Ac.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=jt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO}),Ac.EXPANDED_VISUAL_DECORATION=jt.register({description:"folding-expanded-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(tte),linesDecorationsTooltip:mK}),Ac.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=jt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(tte),linesDecorationsTooltip:mK}),Ac.MANUALLY_EXPANDED_VISUAL_DECORATION=jt.register({description:"folding-manually-expanded-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(hVe),linesDecorationsTooltip:mK}),Ac.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=jt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(hVe),linesDecorationsTooltip:mK}),Ac.NO_CONTROLS_EXPANDED_RANGE_DECORATION=jt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),Ac.HIDDEN_RANGE_DECORATION=jt.register({description:"folding-hidden-range-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges});let WCe=Ac;const ELt={},xLt="syntax";class pPe{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=xLt,this.disposables=new Z,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return DLt(this.providers,this.editorModel,e).then(t=>t?ILt(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function DLt(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,ELt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const c=e.getLineCount();for(const l of a)l.start>0&&l.end>l.start&&l.end<=c&&i.push({start:l.start,end:l.end,rank:r,kind:l.kind})}},er));return Promise.all(s).then(o=>i)}class kLt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>pb||t>pb)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=c}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,c=0;a{let c=r.start-a.start;return c===0&&(c=r.rank-a.rank),c}),i=new kLt(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var KL;const Nu="vs/editor/contrib/folding/browser/folding",jh=new Y("foldingEnabled",!1);var dN;let Ox=(dN=class extends ${static get(e){return e.getContribution(KL.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return KL._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return KL._foldingRangeSelector=e,{dispose:()=>{KL._foldingRangeSelector=void 0}}}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new CZe(e);const a=this.editor.getOptions();this._isEnabled=a.get(x.folding),this._useFoldingProviders=a.get(x.foldingStrategy)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(x.unfoldOnClickAfterEndOfLine),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(x.foldingImportsByDefault),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new WCe(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=jh.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(c=>{if(c.hasChanged(x.folding)&&(this._isEnabled=this.editor.getOptions().get(x.folding),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),c.hasChanged(x.foldingMaximumRegions)&&this.onModelChanged(),c.hasChanged(x.showFoldingControls)||c.hasChanged(x.foldingHighlight)){const l=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=l.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=l.get(x.foldingHighlight),this.triggerFoldingModelChanged()}c.hasChanged(x.foldingStrategy)&&(this._useFoldingProviders=this.editor.getOptions().get(x.foldingStrategy)!=="indentation",this.onFoldingStrategyChanged()),c.hasChanged(x.unfoldOnClickAfterEndOfLine)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(x.unfoldOnClickAfterEndOfLine)),c.hasChanged(x.foldingImportsByDefault)&&(this._foldingImportsByDefault=this.editor.getOptions().get(x.foldingImportsByDefault))})),this.onModelChanged()}get limitReporter(){return this._foldingLimitReporter}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new dLt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new _Lt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Lu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new yn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new fPe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=KL.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new pPe(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new ao,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=na(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(yv.Imports.value,!0);d&&(r=M_.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(o,c),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(bt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,bt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case Mt.GUTTER_LINE_DECORATIONS:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case Mt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Mt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==Mt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&l.push(u);l.length===0&&(l=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(r)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,vt.Smooth)}},KL=dN,dN.ID="editor.contrib.folding",dN);Ox=KL=D([_(1,Pe),_(2,lo),_(3,Pi),_(4,B_),_(5,ht)],Ox);class CZe{constructor(e){this.editor=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(x.foldingMaximumRegions)}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Pu extends lt{runEditorCommand(e,t,i){const s=e.get(lo),o=Ox.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const c=t.getSelection();c&&o.reveal(c.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function yZe(n){if(!ll(n)){if(!fo(n))return!1;const e=n;if(!ll(e.levels)&&!jc(e.levels)||!ll(e.direction)&&!zt(e.direction)||!ll(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(jc)))return!1}return!0}class LLt extends Pu{constructor(){super({id:"editor.unfold",label:g(Nu,0,"Unfold"),alias:"Unfold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.BracketRight,mac:{primary:V.CtrlCmd|V.Alt|E.BracketRight},weight:ye.EditorContrib},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +`),await this._clipboardService.writeText(C)})),i.getOption(x.readOnly)||v.push(new xn("diff.inline.revertChange",g(xL,6,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Xo(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=ia(this._diffActions),w=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+w)})),this._register(i.onMouseMove(p=>{(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(p=>{p.event.leftButton&&(p.target.type===Mt.CONTENT_VIEW_ZONE||p.target.type===Mt.GUTTER_VIEW_ZONE)&&p.target.detail.viewZoneId===this._getViewZoneId()&&(p.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,d),f(p.event.posx,p.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=ia(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ln});function oZe(n,e,t,i){Sd(i,e.fontInfo);const s=t.length>0,o=new fz(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=Sm.isBasicASCII(c,s),d=Sm.containsRTL(c,l,o),h=lQ(new tL(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==l1.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let xCe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=xi(this,0),this._originalScrollOffset=xi(this,0),this._originalScrollOffsetAnimated=BUe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=xi(this,0),this._modifiedScrollOffset=xi(this,0),this._modifiedScrollOffsetAnimated=BUe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=xi("invalidateAlignmentsState",0),u=this._register(new yn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(x.wrappingInfo)||C.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(C=>C?Wn(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===RI.Completed):void 0).map((C,y)=>C?.read(y)),p=Dt(C=>{const y=this._diffModel.read(C),S=y?.diff.read(C);if(!y||!S)return null;h.read(C);const k=this._options.renderSideBySide.read(C);return JUe(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Dt(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);if(!y)return null;h.read(C);const S=y.changes.map(M=>new sZe(M));return JUe(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const C=document.createElement("div");return C.className="diagonal-fill",C}const w=this._register(new Z);this.viewZones=wO(this,(C,y)=>{w.clear();const S=p.read(C)||[],M=[],k=[],F=this._modifiedTopPadding.read(C);F>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._originalTopPadding.read(C);N>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:N,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(C),U=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(U){const Oe=this._editors.original.getModel();for(const wt of S)if(wt.diff)for(let Nt=wt.originalRange.startLineNumber;NtOe.getLineCount())return{orig:M,mod:k};U?.addRequest(Oe.getLineContent(Nt),null,null)}}const J=U?.finalize()??[];let j=0;const re=this._editors.modified.getOption(x.lineHeight),me=this._diffModel.read(C)?.movedTextToCompare.read(C),De=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Qe=this._editors.original.getModel()?.mightContainRTL()??!1,Tt=Ode.fromEditor(this._editors.modified);for(const Oe of S)if(Oe.diff&&!z){if(!Oe.originalRange.isEmpty){f.read(C);const Nt=document.createElement("div");Nt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ji=this._editors.original.getModel();if(Oe.originalRange.endLineNumberExclusive-1>Ji.getLineCount())return{orig:M,mod:k};const Vi=new rZe(Oe.originalRange.mapToLineArray(ys=>Ji.tokenization.getLineTokens(ys)),Oe.originalRange.mapToLineArray(ys=>J[j++]),De,Qe),Gn=[];for(const ys of Oe.diff.innerChanges||[])Gn.push(new DW(ys.originalRange.delta(-(Oe.diff.original.startLineNumber-1)),SCe.className,Rc.Regular));const Ro=oZe(Vi,Tt,Gn,Nt),qn=document.createElement("div");if(qn.className="inline-deleted-margin-view-zone",Sd(qn,Tt.fontInfo),this._options.renderIndicators.read(C))for(let ys=0;ysws(ec),qn,this._editors.modified,Oe.diff,this._diffEditorWidget,Ro.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ys=0;ys1&&M.push({afterLineNumber:Oe.originalRange.startLineNumber+ys,domNode:v(),heightInPx:(mr-1)*re,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Oe.modifiedRange.startLineNumber-1,domNode:Nt,heightInPx:Ro.heightInLines*re,minWidthInPx:Ro.minWidthInPx,marginDomNode:qn,setZoneId(ys){ec=ys},showInHiddenAreas:!0,suppressMouseDown:!0})}const wt=document.createElement("div");wt.className="gutter-delete",M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Oe.modifiedHeightInPx,marginDomNode:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;if(wt>0){if(me?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Oe.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Nt=function(){const Vi=document.createElement("div");return Vi.className="arrow-revert-change "+$e.asClassName(Ce.arrowRight),y.add(pe(Vi,"mousedown",Gn=>Gn.stopPropagation())),y.add(pe(Vi,"click",Gn=>{Gn.stopPropagation(),o.revert(Oe.diff)})),we("div",{},Vi)};if(me?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Oe.modifiedRange.endLineNumberExclusive-1))continue;let Ji;Oe.diff&&Oe.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(Ji=Nt()),k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,marginDomNode:Ji,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Oe of m.read(C)??[]){if(!me?.lineRangeMapping.original.intersect(Oe.originalRange)||!me?.lineRangeMapping.modified.intersect(Oe.modifiedRange))continue;const wt=Oe.modifiedHeightInPx-Oe.originalHeightInPx;wt>0?M.push({afterLineNumber:Oe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:wt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Oe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-wt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:k}});let b=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(C.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(C.scrollLeft),b=!1)})),this._originalScrollTop=Wn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Wn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ni(C=>{const y=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));y!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));y!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(y,vt.Immediate)})),this._register(Ni(C=>{const y=this._diffModel.read(C)?.movedTextToCompare.read(C);let S=0;if(y){const M=this._editors.original.getTopForLineNumber(y.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(y.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-M}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};xCe=D([_(8,Mu),_(9,Vr)],xCe);function JUe(n,e,t,i,s,o){const r=new DS(XUe(n,i)),a=new DS(XUe(e,s)),c=n.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),w=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),w&&w.lineNumber>=m&&(w=void 0),!v&&!w)break;const b=v?v.lineNumber-h:Number.MAX_VALUE,C=w?w.lineNumber-u:Number.MAX_VALUE;bC?(a.dequeue(),v={lineNumber:w.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:bi.ofLength(v.lineNumber,1),modifiedRange:bi.ofLength(w.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+w.heightInPx,diff:void 0})}}for(const p of t){let C=function(y,S){if(yz.lineNumberz+U.heightInPx,0)??0,N=a.takeWhile(z=>z.lineNumberz+U.heightInPx,0)??0;d.push({originalRange:M,modifiedRange:k,originalHeightInPx:M.length*c+F,modifiedHeightInPx:k.length*l+N,diff:p.lineRangeMapping}),b=y,w=S};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,w=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const y of m.innerChanges||[]){y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&C(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber);const S=n.getModel(),M=y.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(y.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;y.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of n.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new oe(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return o1t(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}class B1t extends ${constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Wn(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Wn(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Bh("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Bh("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=oL("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(di("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{En(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(Ni(r=>{s.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(Ni(r=>this.render(r)))}dispose(){super.dispose(),_a(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),o=hi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new bi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);En(l=>{for(const d of c){if(!d.range.intersect(a))continue;s.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,l);else{const m=document.createElement("div");this._domNode.appendChild(m);const v=xi("item",d),w=this.itemProvider.createView(v,m);h=new W1t(v,w,m),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,p=(d.range.isEmpty?u:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${p}px`,h.gutterItemView.layout(hi.ofStartAndLength(u,p),o)}})}for(const r of s){const a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}}class W1t{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class aZe extends gw{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class DCe extends Zje{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new gf(e-1,t)}}var H1t=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";Ct(H1t,{});const U1t="vs/base/browser/ui/toolbar/toolbar";class cZe extends ${constructor(e,t,i={orientation:Qb.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new qRe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(C1()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new F7(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Qh(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,o)=>{if(s.id===F7.ID)return this.toggleMenuActionViewItem=new gx(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:$e.asClassNameArray(i.moreIcon??Ce.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(s,o);if(r)return r}if(s instanceof u1){const r=new gx(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}focus(){this.actionBar.focus()}getItemsWidth(){let e=0;for(let t=0;t0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return(this.lookupKeybindings?this.options.getKeyBinding?.(e):void 0)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const Bae=class Bae extends xn{constructor(e,t){t=t||g(U1t,0,"More Actions..."),super(Bae.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};Bae.ID="toolbar.toggle.more";let F7=Bae;const ZUe="vs/platform/actions/browser/toolbar";var wS;(function(n){n[n.NoHide=-1]="NoHide",n[n.Ignore=0]="Ignore",n[n.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(wS||(wS={}));let lV=class extends cZe{constructor(e,t,i,s,o,r,a,c){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new Z);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>c.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();const s=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==wS.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(s[f]=void 0,c[f]=p))}}iF(s),iF(c),super.setActions(s,Kr.join(c,o)),(r.length>0||s.length>0)&&this._sessionDisposables.add(pe(this.getElement(),"contextmenu",d=>{const h=new yu(gt(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof id&&u.menuKeybinding?f.push(u.menuKeybinding):u instanceof uS||u instanceof F7||f.push(QXe(u.id,void 0,this._commandService,this._keybindingService)),r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===wS.Ignore){m=!0;for(let v=0;vthis._menuService.resetHiddenStates(i)}))),p.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>p,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};lV=D([_(2,_c),_(3,Pe),_(4,Vr),_(5,ti),_(6,ji),_(7,rn)],lV);let nC=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(s.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];tD(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",u.length===0&&f.length===0),super.setActions(u,f)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new cn("This toolbar is populated from a menu.")}};nC=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,ji),_(8,rn)],nC);const Qfe=[],fK=35;let kCe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(Te.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Wn(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Dt(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Dt(this,d=>this._hasActions.read(d)?fK:0),this.elements=di("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:fK+"px"}},[]),this._currentDiff=Dt(this,d=>{const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d)?.mappings,f=this._editors.modifiedCursor.read(d);if(f)return u?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=Dt(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return Qfe;const f=this._editors.modifiedSelections.read(d);if(f.every(w=>w.isEmpty()))return Qfe;const p=new d_(f.map(w=>bi.fromRangeInclusive(w))),v=u.mappings.filter(w=>w.lineRangeMapping.innerChanges&&p.intersects(w.lineRangeMapping.modified)).map(w=>({mapping:w,rangeMappings:w.lineRangeMapping.innerChanges.filter(b=>f.some(C=>O.areIntersecting(b.modifiedRange,C)))}));return v.length===0||v.every(w=>w.rangeMappings.length===0)?Qfe:v}),this._register(r1t(e,this.elements.root)),this._register(pe(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(D1(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),WC(this,d=>this._showSash.read(d)?new iZe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,HJe(this,u=>this._sashLayout.sashLeft.read(u)-fK,(u,f)=>this._sashLayout.sashLeft.set(u+fK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new B1t(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,h)=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const p=this._selectedDiffs.read(h);if(p.length>0){const v=pw.fromRangeMappings(p.flatMap(w=>w.rangeMappings));return[new eVe(v,!0,Te.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new eVe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,Te.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(ICe,d,h,this)})),this._register(pe(this.elements.gutter,xe.MOUSE_WHEEL,d=>{this._editors.modified.getOption(x.scrollbar).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new DCe(this._editors.modifiedModel.get()),s=new DCe(this._editors.original.getModel());return new WU(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};kCe=D([_(6,be),_(7,Pe),_(8,_c)],kCe);class eVe{constructor(e,t,i,s,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let ICe=class extends ${constructor(e,t,i,s){super(),this._item=e,this._elements=di("div.gutterItem",{style:{height:"20px",width:"34px"}},[di("div.background@background",{},[]),di("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=xi(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(s.createInstance(gF,"element",!0,{position:{hoverPosition:Oo.RIGHT}}));this._register(A3(t,this._elements.root)),this._register(Ni(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Em((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(s.createInstance(nC,this._elements.buttons,this._menuId.read(r),{orientation:Qb.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:wS.Ignore,actionRunner:new aZe(()=>{const l=this._item.get(),d=l.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:l.originalUri,modifiedUri:l.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(c.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,o=i;let r=e.start+s;const a=hi.tryCreate(o,t.endExclusive-o-i),c=hi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const l=this._editors.modifiedModel.read(c),d=LCe._breadcrumbsSourceFactory.read(c);return!l||!d?void 0:d(l,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===Wi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Wi.ContentFlush)return;const l=this._diffModel.get();En(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,xv.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,xv.FromCloserSide,d)})}));const o=this._diffModel.map((c,l)=>{const d=c?.unchangedRegions.read(l)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(l)?.getLineCount()?[]:d});this.viewZones=wO(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=o.read(c);for(const m of p)if(!m.shouldHideControls(c)){{const v=Dt(this,b=>m.getHiddenOriginalRange(b).startLineNumber-1),w=new Qee(v,24);h.push(w),l.add(new tVe(this._editors.original,w,m,m.originalUnchangedRange,!f,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}{const v=Dt(this,b=>m.getHiddenModifiedRange(b).startLineNumber-1),w=new Qee(v,24);u.push(w),l.add(new tVe(this._editors.modified,w,m,m.modifiedUnchangedRange,!1,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,xv.FromBottom,void 0),this._options))}}return{origViewZones:h,modViewZones:u}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Xt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(vB,0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+$e.asClassName(Ce.fold),zIndex:10001};this._register(qee(this._editors.original,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:O.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(qee(this._editors.modified,Dt(this,c=>{const l=o.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of l)h.shouldHideControls(c)&&d.push({range:bi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Ni(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(yl)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(yl))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{if(!c.event.rightButton&&c.target.position&&c.target.element?.className.includes("fold-unchanged")){const l=c.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.includes(l));if(!h)return;h.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}},LCe=lN,lN._breadcrumbsSourceFactory=xi("breadcrumbsSourceFactory",void 0),lN);Yee=LCe=D([_(3,be)],Yee);class tVe extends ZXe{constructor(e,t,i,s,o,r,a,c){const l=di("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=di("div.diff-hidden-lines",[di("div.top@top",{title:g(vB,1,"Click or drag to show more above")}),di("div.center@content",{style:{display:"flex"}},[di("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[we("a",{title:g(vB,2,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...nw("$(unfold)"))]),di("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),di("div.bottom@bottom",{title:g(vB,3,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const d=Wn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?_a(this._nodes.first):this._register(D1(this._nodes.first,{width:d.map(u=>u.contentLeft)})),this._register(Ni(u=>{const f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const p=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!p),p==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):p==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const h=this._editor;this._register(pe(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const v=gt(this._nodes.top),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m+M,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),b=pe(v,"mouseup",C=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),w.dispose(),b.dispose()})})),this._register(pe(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const v=gt(this._nodes.bottom),w=pe(v,"mousemove",C=>{const S=C.clientY-f;p=p||Math.abs(S)>2;const M=Math.round(S/h.getOption(x.lineHeight)),k=Math.max(0,Math.min(m-M,this._unchangedRegion.getMaxVisibleLineCountBottom())),F=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const N=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(N-F))}),b=pe(v,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const y=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const S=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(S-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),w.dispose(),b.dispose()})})),this._register(Ni(u=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(u).length,m=g(vB,4,"{0} hidden lines",p),v=we("span",{title:g(vB,5,"Double click to unfold")},m);v.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const w=this._unchangedRegion.getHiddenModifiedRange(u),b=this._modifiedOutlineSource.getBreadcrumbItems(w,u);if(b.length>0){f.push(we("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(y.startLineNumber)}}}}_a(this._nodes.others,...f)}))}}var J_,a0;let dV=(a0=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=J_.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Wn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Dt(u=>{const f=c.read(u),p=f.getColor(Rmt)||(f.getColor(m_)||ewe).transparent(2),m=f.getColor(Mmt)||(f.getColor(yE)||twe).transparent(2);return{insertColor:p,removeColor:m}}),d=ks(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=di("div.diffOverview",{style:{position:"absolute",top:"0px",width:J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(A3(h,d.domNode)),this._register(Xo(h,xe.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(pe(h,xe.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(A3(this._rootElement,h)),this._register(Em((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(A3(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(A3(h,v.getDomNode()))),!m||!v)return;const w=Bh("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=Bh("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=Bh("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),y=Bh("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(Ni(S=>{w.read(S),b.read(S),C.read(S),y.read(S);const M=l.read(S),k=p?.diff.read(S)?.mappings;function F(U,J,j){const re=j._getViewModel();return re?U.filter(me=>me.length>0).map(me=>{const De=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.startLineNumber,1)),Qe=re.coordinatesConverter.convertModelPositionToViewPosition(new oe(me.endLineNumberExclusive,1)),Tt=Qe.lineNumber-De.lineNumber;return new nYe(De.lineNumber,Qe.lineNumber,Tt,J.toString())}):[]}const N=F((k||[]).map(U=>U.lineRangeMapping.original),M.removeColor,this._editors.original),z=F((k||[]).map(U=>U.lineRangeMapping.modified),M.insertColor,this._editors.modified);m?.setZones(N),v?.setZones(z)})),f.add(Ni(S=>{const M=this._rootHeight.read(S),k=this._rootWidth.read(S),F=this._modifiedEditorLayoutInfo.read(S);if(F){const N=J_.ENTIRE_DIFF_OVERVIEW_WIDTH-2*J_.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:M,right:N+J_.ONE_OVERVIEW_WIDTH,width:J_.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:M,right:0,width:J_.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(S),U=this._editors.modifiedScrollHeight.read(S),J=this._editors.modified.getOption(x.scrollbar),j=new qU(J.verticalHasArrows?J.arrowSize:0,J.verticalScrollbarSize,0,F.height,U,z);d.setTop(j.getSliderPosition()),d.setHeight(j.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=M+"px",h.style.left=k-J_.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(J_.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},J_=a0,a0.ONE_OVERVIEW_WIDTH=15,a0.ENTIRE_DIFF_OVERVIEW_WIDTH=J_.ONE_OVERVIEW_WIDTH*2,a0);dV=J_=D([_(6,pn)],dV);const iVe="vs/editor/browser/widget/diffEditor/features/revertButtonsFeature",jfe=[];class V1t extends ${constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=Dt(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return jfe;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return jfe;const l=new d_(c.map(u=>bi.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&l.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>c.some(p=>O.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?jfe:h}),this._register(Em((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),c=a?.diff.read(o);if(!a||!c||a.movedTextToCompare.read(o))return;const l=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new Jee(u[u.length-1].positionLineNumber,this._widget,d.flatMap(p=>p.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}for(const u of c.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new Jee(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}r.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Wae=class Wae extends ${getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${Wae.counter++}`,this._domNode=di("div.revertButton",{title:this._revertSelection?g(iVe,0,"Revert Selected Changes"):g(iVe,1,"Revert Change")},[OS(Ce.arrowRight)]).root,this._register(pe(this._domNode,xe.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(pe(this._domNode,xe.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(pe(this._domNode,xe.CLICK,o=>{this._diffs instanceof $b?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:FS.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Wae.counter=0;let Jee=Wae;function Kfe(n){return TCe.get(n)}const ZT=class ZT{static get(e){let t=ZT._map.get(e);if(!t){t=new ZT(e),ZT._map.set(e,t);const i=e.onDidDispose(()=>{ZT._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.value=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getValue()),this.valueIsEmpty=Wn(this.editor.onDidChangeModelContent,()=>this.editor.getModel()?.getValueLength()===0),this.selections=Wn(this.editor.onDidChangeCursorSelection,()=>this.editor.getSelections()),this.cursorPosition=yy({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.isFocused=Wn(t=>{const i=this.editor.onDidFocusEditorWidget(t),s=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),s.dispose()}}},()=>this.editor.hasWidgetFocus())}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(bQ({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}};ZT._map=new Map;let TCe=ZT;const z1t="vs/editor/browser/widget/diffEditor/components/diffEditorEditors";let RCe=class extends ${get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new I),this.modifiedScrollTop=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Wn(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=Kfe(this.modified).model,this.modifiedSelections=Wn(this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=yy({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Wn(this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Kfe(this.original).isFocused,this.isModifiedFocused=Kfe(this.modified).isFocused,this.isFocused=Dt(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(Az({createEmptyChangeSummary:()=>({}),handleChange:(c,l)=>(c.didChange(i.editorOptions)&&Object.assign(l,c.change.changedOptions),!0)},(c,l)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,l)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,l))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=_u.revealHorizontalRightPadding.defaultValue+dV.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=g(z1t,0," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};RCe=D([_(5,be),_(6,ti)],RCe);const Hae=class Hae extends ${constructor(){super(...arguments),this._id=++Hae.idCounter,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getStatusbarColumn(e){return this._targetEditor.getStatusbarColumn(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=vt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=vt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=vt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=vt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=vt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=vt.Smooth){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=vt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=vt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=vt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=vt.Smooth,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=vt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=vt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=vt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=vt.Smooth){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};Hae.idCounter=0;let MCe=Hae,Xee=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=xi(this,0),this._screenReaderMode=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Dt(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Dt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=Dt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=Dt(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=Dt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=Dt(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=Dt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=Dt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=Dt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=Dt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=Dt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=Dt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=Dt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=Dt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=Dt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=Dt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=Dt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=Dt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=Dt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Dt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Dt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Dt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i={...e,...nVe(e,_h)};this._options=xi(this,i)}updateOptions(e){const t=nVe(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}};Xee=D([_(1,Ur)],Xee);function nVe(n,e){return{enableSplitViewResizing:It(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:odt(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:It(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:It(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:VL(n.maxComputationTime,e.maxComputationTime,0,Zn.MAX_SAFE_SMALL_INTEGER),maxFileSize:VL(n.maxFileSize,e.maxFileSize,0,Zn.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:It(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:It(n.renderIndicators,e.renderIndicators),originalEditable:It(n.originalEditable,e.originalEditable),diffCodeLens:It(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:It(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:La(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:La(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:It(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:It(n.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:It(n.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:It(n.hideUnchangedRegions?.enabled??n.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:VL(n.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),minimumLineCount:VL(n.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER),revealLineCount:VL(n.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Zn.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:It(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:It(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:VL(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Zn.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:It(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:It(n.renderGutterMenu,e.renderGutterMenu)}}var fH;let xm=(fH=class extends MCe{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,s,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=di("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[di("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),di("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),di("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=xi(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=T.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._boundarySashes=xi(this,void 0),this._accessibleDiffViewerShouldBeVisible=xi(this,!1),this._accessibleDiffViewerVisible=Dt(this,y=>this._options.onlyShowAccessibleDiffViewer.read(y)?!0:this._accessibleDiffViewerShouldBeVisible.read(y)),this._movedBlocksLinesPart=xi(this,void 0),this._layoutInfo=Dt(this,y=>{const S=this._rootSizeObserver.width.read(y),M=this._rootSizeObserver.height.read(y);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=M+"px";const k=this._sash.read(y),F=this._gutter.read(y),N=F?.width.read(y)??0,z=this._overviewRulerPart.read(y)?.width??0;let U,J,j,re,me;if(!!k){const Qe=k.sashLeft.read(y),Tt=this._movedBlocksLinesPart.read(y)?.width.read(y)??0;U=0,J=Qe-N-Tt,me=Qe-N,j=Qe,re=S-j-z}else me=0,U=N,J=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),j=N+J,re=S-j-z;return this.elements.original.style.left=U+"px",this.elements.original.style.width=J+"px",this._editors.original.layout({width:J,height:M},!0),F?.layout(me),this.elements.modified.style.left=j+"px",this.elements.modified.style.width=re+"px",this._editors.modified.layout({width:re,height:M},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((y,S)=>y?.diff.read(S)),this.onDidUpdateDiff=T.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this.elements.root.classList.toggle("standalone",i.isStandaloneEditor||!1),this._domElement.appendChild(this.elements.root),this._register(Ee(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new XXe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(Xee,t),this._register(Ni(y=>{this._options.setWidth(this._rootSizeObserver.width.read(y))})),this._contextKeyService.createKey(X.isEmbeddedDiffEditor.key,!1),this._register(dA(X.isEmbeddedDiffEditor,this._contextKeyService,y=>this._options.isInEmbeddedEditor.read(y))),this._register(dA(X.comparingMovedCode,this._contextKeyService,y=>!!this._diffModel.read(y)?.movedTextToCompare.read(y))),this._register(dA(X.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,y=>this._options.couldShowInlineViewBecauseOfSize.read(y))),this._register(dA(X.diffEditorInlineMode,this._contextKeyService,y=>!this._options.renderSideBySide.read(y))),this._register(dA(X.hasChanges,this._contextKeyService,y=>(this._diffModel.read(y)?.diff.read(y)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(RCe,this.elements.original,this.elements.modified,this._options,i,(y,S,M,k)=>this._createInnerEditor(y,S,M,k))),this._register(dA(X.diffEditorOriginalWritable,this._contextKeyService,y=>this._options.originalEditable.read(y))),this._register(dA(X.diffEditorModifiedWritable,this._contextKeyService,y=>!this._options.readOnly.read(y))),this._register(dA(X.diffEditorOriginalUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.original.uri.toString()??"")),this._register(dA(X.diffEditorModifiedUri,this._contextKeyService,y=>this._diffModel.read(y)?.model.modified.uri.toString()??"")),this._overviewRulerPart=WC(this,y=>this._options.renderOverviewRuler.read(y)?this._instantiationService.createInstance(_v(dV,y),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,S)=>y-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new T1t(this._options,l),this._sash=WC(this,y=>{const S=this._options.renderSideBySide.read(y);return this.elements.root.classList.toggle("side-by-side",S),S?new iZe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=WC(this,y=>this._instantiationService.createInstance(_v(Yee,y),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);WC(this,y=>this._instantiationService.createInstance(_v(L1t,y),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=WC(this,y=>this._instantiationService.createInstance(_v(xCe,y),gt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Dt(this,y=>{const S=p.read(y).viewZones.read(y).orig,M=d.read(y).viewZones.read(y).origViewZones;return S.concat(M)}),v=Dt(this,y=>{const S=p.read(y).viewZones.read(y).mod,M=d.read(y).viewZones.read(y).modViewZones;return S.concat(M)});this._register(jee(this._editors.original,m,y=>{f=y},h));let w;this._register(jee(this._editors.modified,v,y=>{f=y,f?w=M_.capture(this._editors.modified):(w?.restore(this._editors.modified),w=void 0)},u)),this._accessibleDiffViewer=WC(this,y=>this._instantiationService.createInstance(_v(Kk,y),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,M)=>this._accessibleDiffViewerShouldBeVisible.set(S,M),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,M)=>S?.diff.read(M)?.mappings.map(k=>k.lineRangeMapping)),new A1t(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(y=>y?"hidden":"visible");this._register(D1(this.elements.modified,{visibility:b})),this._register(D1(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=WC(this,y=>this._options.shouldRenderGutterMenu.read(y)?this._instantiationService.createInstance(_v(kCe,y),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Ez(this._layoutInfo)),WC(this,y=>new(_v(GW,y))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,y=>{this._movedBlocksLinesPart.set(y,void 0)}),this._register(T.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!0))),this._register(T.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!1)));const C=this._diffModel.map(this,(y,S)=>{if(y)return y.diff.read(S)===void 0&&!y.isDiffUpToDate.read(S)});this._register(Em((y,S)=>{if(C.read(y)===!0){const M=this._editorProgressService.show(!0,1e3);S.add(Ee(()=>M.done()))}})),this._register(Ee(()=>{this._shouldDisposeDiffModel&&this._diffModel.get()?.dispose()})),this._register(Em((y,S)=>{S.add(new(_v(V1t,y))(this._editors,this._diffModel,this._options,this))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,s){return e.createInstance(_1,t,i,s)}_createDiffEditorContributions(){const e=b_.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){bt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return mz.IDiffEditor}onVisible(){this._editors.original.onVisible(),this._editors.modified.onVisible()}onHide(){this._editors.original.onHide(),this._editors.modified.onHide()}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(Kee,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==i?.model&&m7(t,s=>{Wn.batchEventsGlobally(s,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const o=this._diffModel.get(),r=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=i?.shouldDispose??!1,this._diffModel.set(i?.model,s),r&&o?.dispose()})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}setBoundarySashes(e){this._boundarySashes.set(e,void 0)}get ignoreTrimWhitespace(){return this._options.ignoreTrimWhitespace.get()}get maxComputationTime(){return this._options.maxComputationTimeMs.get()}get renderSideBySide(){return this._options.renderSideBySide.get()}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?$1t(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new oe(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?s=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=t1(t,o=>o.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const o=t.getSelection();if(o){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=WUe(o.getStartPosition(),r),c=WUe(o.getEndPosition(),r);s=O.plusRange(a,c)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&En(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Wi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(s=>t?s.lineRangeMapping.modified.contains(e.position.lineNumber):s.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Zl.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Zl.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},fH.ENTIRE_DIFF_OVERVIEW_WIDTH=dV.ENTIRE_DIFF_OVERVIEW_WIDTH,fH);xm=D([_(3,Pe),_(4,be),_(5,jt),_(6,Lw),_(7,eD)],xm);function $1t(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a?.map(c=>({originalStartLineNumber:c.originalRange.startLineNumber,originalStartColumn:c.originalRange.startColumn,originalEndLineNumber:c.originalRange.endLineNumber,originalEndColumn:c.originalRange.endColumn,modifiedStartLineNumber:c.modifiedRange.startLineNumber,modifiedStartColumn:c.modifiedRange.startColumn,modifiedEndLineNumber:c.modifiedRange.endLineNumber,modifiedEndColumn:c.modifiedRange.endColumn}))}})}let G1t=0,sVe=!1;function q1t(n){if(!n){if(sVe)return;sVe=!0}smt(n||yi.document.body)}let k1=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||bee.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+bee.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,s,o,r,l,d,h,u,f),c instanceof x1?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,q1t(p.ariaContainerElement),RJe((m,v)=>i.createInstance(gF,m,v,{})),KJe(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++G1t,o=ge.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None;const t=e.id,i=e.label,s=ge.and(ge.equals("editorId",this.getId()),ge.deserialize(e.precondition)),o=e.keybindings,r=ge.and(s,ge.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,l=(f,...p)=>Promise.resolve(e.run(this,...p)),d=new Z,h=this.getId()+":"+t;if(d.add(yt.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:s,group:a,order:c};d.add(Xs.appendMenuItem(Te.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new oYe(h,i,i,void 0,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Ee(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof tee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};k1=D([_(2,be),_(3,jt),_(4,ji),_(5,Pe),_(6,el),_(7,ti),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],k1);let mF=class extends k1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){const w={...t};$ee(h,w,!1);const b=l.registerEditorContainer(e);typeof w.theme=="string"&&l.setTheme(w.theme),typeof w.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!w.autoDetectHighContrast);const C=w.model;delete w.model,super(e,w,i,s,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(b);let y;if(typeof C>"u"){const S=p.getLanguageIdByMimeType(w.language)||w.language||Yc;y=lZe(f,p,w.value||"",S,void 0),this._ownsModel=!0}else y=C,this._ownsModel=!1;if(this._attachModel(y),y){const S={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};mF=D([_(2,be),_(3,jt),_(4,ji),_(5,Pe),_(6,el),_(7,ti),_(8,Iw),_(9,Pi),_(10,Re),_(11,Ur),_(12,Ai),_(13,Di),_(14,lo),_(15,ht)],mF);let Zee=class extends xm{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={...t};$ee(c,f,!0);const p=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},s,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){$ee(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(k1,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};Zee=D([_(2,be),_(3,Pe),_(4,jt),_(5,Iw),_(6,Pi),_(7,Re),_(8,Vr),_(9,eD),_(10,Mu),_(11,Lw)],Zee);function lZe(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),oVe(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return oVe(n,t,e.createById(i),s)}function oVe(n,e,t,i){return n.createModel(e,t,i)}var Q1t=".monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);height:100%;overflow-y:hidden;position:relative;width:100%;>div{height:100%;left:0;position:absolute;top:0;width:100%;&.placeholder{display:grid;place-content:center;place-items:center;visibility:hidden;&.visible{visibility:visible}}}.active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.multiDiffEntry{display:flex;flex:1;flex-direction:column;overflow:hidden;.collapse-button{cursor:pointer;margin:0 5px;a{display:block}}.header{background:var(--vscode-editor-background);z-index:1000;&:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.header-content{align-items:center;background:var(--vscode-multiDiffEditor-headerBackground);border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);display:flex;margin:8px 0 0;padding:4px 5px;&.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.file-path{display:flex;flex:1;min-width:0;.title{font-size:14px;line-height:22px;&.original{flex:1;min-width:0;text-overflow:ellipsis}}.status{font-weight:600;line-height:22px;margin:0 10px;opacity:.75}}.actions{padding:0 8px}}}.editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);display:flex;flex:1;flex-direction:column;overflow:hidden}.editorContainer{flex:1}}}";Ct(Q1t,{});class j1t{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let ete=class extends ${constructor(e,t,i,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=xi(this,void 0),this._collapsed=Dt(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=xi(this,500),this.contentHeight=Dt(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=xi(this,0),this._modifiedWidth=xi(this,0),this._originalContentWidth=xi(this,0),this._originalWidth=xi(this,0),this.maxScroll=Dt(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),c=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>c?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:c,width:this._originalWidth.read(r)}}),this._elements=di("div.multiDiffEntry",[di("div.header@header",[di("div.header-content",[di("div.collapse-button@collapseButton"),di("div.file-path",[di("div.title.modified.show-file-icons@primaryPath",[]),di("div.status.deleted@status",["R"]),di("div.title.original.show-file-icons@secondaryPath",[])]),di("div.actions@actions")])]),di("div.editorParent",[di("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(xm,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=rVe(this.editor.getModifiedEditor()),this.isOriginalFocused=rVe(this.editor.getOriginalEditor()),this.isFocused=Dt(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new Z,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new Tu(this._elements.collapseButton,{});this._register(Ni(r=>{o.element.className="",o.icon=this._collapsed.read(r)?Ce.chevronRight:Ce.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ni(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{uJ(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(Ni(r=>{const a=this._viewModel.read(r)?.isActive.read(r);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(nC,this._elements.actions,Te.MultiDiffEditorFileToolbar,{actionRunner:this._register(new aZe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>yO(s,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),uJ(s=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setModel(e.viewModel.diffEditorViewModel,s),this.editor.updateOptions(t(i.options??{}))})}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(s.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,uJ(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};ete=D([_(3,be)],ete);function rVe(n){return Wn(e=>{const t=new Z;return t.add(n.onDidFocusEditorWidget(()=>e(!0))),t.add(n.onDidBlurEditorWidget(()=>e(!1))),t},()=>n.hasTextFocus())}class K1t{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}const Y1t="vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl";let NCe=class extends ${constructor(e,t,i,s,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=di("div.scrollContent",[di("div@content",{style:{overflow:"hidden"}}),di("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new nO({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>xd(gt(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new hQ(this._scrollableElements.root,{vertical:zo.Auto,horizontal:zo.Auto,useShadows:!1},this._scrollable)),this._elements=di("div.monaco-component.multiDiffEditor",{},[di("div",{},[this._scrollableElement.getDomNode()]),di("div.placeholder@placeholder",{},[di("div",[g(Y1t,0,"No Changed Files")])])]),this._sizeObserver=this._register(new XXe(this._element,void 0)),this._objectPool=this._register(new K1t(c=>{const l=this._instantiationService.createInstance(ete,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Wn(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=wO(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new cn}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new X1t(p,this._objectPool,this.scrollLeft,w=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+w})})),v=this._lastDocStates?.[m.getKey()];return v&&En(w=>{m.setViewState(v,w)}),u.set(p,m),m}),getItem:p=>u.get(p)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,l)=>c.reduce((d,h)=>d+h.contentHeight.read(l)+this._spaceBetweenPx,0)),this.activeControl=Dt(this,c=>{const l=this._viewModel.read(c)?.activeDiffItem.read(c);return l?this._viewItemsInfo.read(c).getItem(l).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Dl([Pe,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(X.inMultiDiffEditor.key,!0),this._register(Em((c,l)=>{const d=this._viewModel.read(c);if(d&&d.contextKeys)for(const[h,u]of Object.entries(d.contextKeys)){const f=this._contextKeyService.createKey(h,void 0);f.set(u),l.add(Ee(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(X.multiDiffEditorAllCollapsed.key,!1);this._register(Ni(c=>{const l=this._viewModel.read(c);if(l){const d=l.items.read(c).every(h=>h.collapsed.read(c));a.set(d)}})),this._register(Ni(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(Ni(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Ni(c=>{const l=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${l}px`;const d=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${d}px`;const h=this._sizeObserver.width.read(c);let u=h;const f=this._viewItems.read(c),p=MRe(f,El(m=>m.maxScroll.read(c).maxScroll,cg));if(p){const m=p.maxScroll.read(c);u=h+m.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:l,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._elements.root),this._register(Ee(()=>{e.replaceChildren()})),this._register(this._register(Ni(c=>{uJ(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),s=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(s===-1)throw new cn("Resource not found in diff editor");const o=i[s];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,En(t=>{if(e.docStates)for(const i of this._viewItems.get()){const s=e.docStates[i.getKey()];s&&i.setViewState(s,t)}})}tryGetCodeEditor(e){const t=this._viewItems.get().find(s=>s.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||s.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString()),i=t?.template.get()?.editor;if(i)return t.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()?{diffEditor:i,editor:i.getModifiedEditor()}:{diffEditor:i,editor:i.getOriginalEditor()}}render(e){const t=this.scrollTop.read(e);let i=0,s=0,o=0;const r=this._sizeObserver.height.read(e),a=hi.ofStartAndLength(t,r),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,r),u=hi.ofStartAndLength(s,h),f=hi.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,l.hide();else if(f.isAfter(a))l.hide();else{const p=Math.max(0,Math.min(a.start-f.start,d-h));i-=p;const m=hi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}s+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};NCe=D([_(4,Pe),_(5,be)],NCe);function J1t(n,e){const t=n.getModel(),i=n.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{n.getModel()===t&&i.clear()},350)}class X1t extends ${constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(_7(this,void 0)),this.contentHeight=Dt(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Dt(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Dt(this,o=>this._templateRef.read(o)?.object),this._isHidden=xi(this,!1),this._isFocused=Dt(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Ni(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(Ni(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.entry.value.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return En(e=>{this._updateTemplateData(e)}),{collapsed:this.viewModel.collapsed.get(),selections:this.viewModel.lastTemplateData.get().selections}}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=e.selections?.map(mt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&En(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new j1t(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,s)}}class dZe extends ${async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){En(e=>{for(const t of this.items.get())t.collapsed.set(!1,e)})}get contextKeys(){return this.model.contextKeys}constructor(e,t){super(),this.model=e,this._instantiationService=t,this._documents=VJe(this.model,this.model.documents),this.items=yee(this,this._documents,(i,s)=>s.add(this._instantiationService.createInstance(PCe,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Dt(this,i=>this.items.read(i).find(s=>s.isFocused.read(i))),this.activeDiffItem=jxt(this,(i,s)=>this.focusedDiffItem.read(i)??s)}}let PCe=class extends ${get originalUri(){return this.entry.value.original?.uri}get modifiedUri(){return this.entry.value.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}constructor(e,t,i,s){super(),this.entry=e,this._editorViewModel=t,this._instantiationService=i,this._modelService=s,this.collapsed=xi(this,!1),this.lastTemplateData=xi(this,{contentHeight:500,selections:void 0}),this.isActive=Dt(this,l=>this._editorViewModel.activeDiffItem.read(l)===this),this._isFocusedSource=xi(this,Au(!1)),this.isFocused=Dt(this,l=>this._isFocusedSource.read(l).read(l));function o(l){return{...l,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(Xee,o(this.entry.value.options||{}));this.entry.value.onOptionsDidChange&&this._register(this.entry.value.onOptionsDidChange(()=>{r.updateOptions(o(this.entry.value.options||{}))}));const a=this.entry.value.original??this._register(this._modelService.createModel("",null)),c=this.entry.value.modified??this._register(this._modelService.createModel("",null));this.diffEditorViewModel=this._register(this._instantiationService.createInstance(Kee,{original:a,modified:c},r))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};PCe=D([_(2,be),_(3,Ai)],PCe);const cPe="vs/editor/browser/widget/multiDiffEditor/colors";B("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(cPe,0,"The background color of the diff editor's header"));B("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},g(cPe,1,"The background color of the multi file diff editor"));B("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(cPe,2,"The border color of the multi file diff editor"));let FCe=class extends ${constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=xi(this,void 0),this._viewModel=xi(this,void 0),this._widgetImpl=wO(this,(s,o)=>(_v(ete,s),o.add(this._instantiationService.createInstance(_v(NCe,s),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Dt(this,s=>this._widgetImpl.read(s).activeControl.read(s)),this.onDidChangeActiveControl=T.fromObservableLight(this._activeControl),this._register(Ez(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new dZe(e,this._instantiationService)}setViewModel(e){this._viewModel.set(e,void 0)}layout(e){this._dimension.set(e,void 0)}getActiveControl(){return this._activeControl.get()}getViewState(){return this._widgetImpl.get().getViewState()}setViewState(e){this._widgetImpl.get().setViewState(e)}tryGetCodeEditor(e){return this._widgetImpl.get().tryGetCodeEditor(e)}};FCe=D([_(2,be)],FCe);const Z1t="vs/editor/contrib/editorState/browser/keybindingCancellation",lPe=ae("IEditorCancelService"),hZe=new Y("cancellableOperation",!1,g(Z1t,0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(lPe,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=hZe.bindTo(s.get(Pe)),r=new td;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},Yt.Delayed);class eLt extends ai{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(lPe).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ke(new class extends Jc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:ye.EditorContrib,primary:E.Escape},precondition:hZe})}runEditorCommand(n,e){n.get(lPe).cancel(e)}});var hr;(function(n){n[n.Value=1]="Value",n[n.Selection=2]="Selection",n[n.Position=4]="Position",n[n.Scroll=8]="Scroll"})(hr||(hr={}));let Bde=class OCe{constructor(e,t){if(this.flags=t,this.flags&hr.Value){const i=e.getModel();this.modelVersionId=i?r_("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&hr.Position?this.position=e.getPosition():this.position=null,this.flags&hr.Selection?this.selection=e.getSelection():this.selection=null,this.flags&hr.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof OCe))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new OCe(e,this.flags))}};class I1 extends eLt{constructor(e,t,i,s){super(e,s),this._listener=new Z,t&hr.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!O.containsPosition(i,o.position))&&this.cancel()})),t&hr.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!O.containsRange(i,o.selection))&&this.cancel()})),t&hr.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&hr.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class dPe extends ai{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hV{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=M_.capture(e),o=hV._handleEolEdits(e,t);o.length===1&&hV._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>ds.replace(O.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>ds.replaceMove(O.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}function uZe(n){return n.scheme===_e.vscodeRemote?n.authority:void 0}function Wde(n){if(!n)return;const e=n.indexOf("+");return e<0?n:n.substr(0,e)}const tLt="extensions.user.cache",iLt="extensions.builtin.cache",gZe="undefined_publisher",nLt=["ui","workspace","web"];function pK(n){if(typeof n=="object"&&n!==null&&n.supported!==!0)return n.description}const fZe=["Azure","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","AI","Chat","Other"];var qr;(function(n){n[n.System=0]="System",n[n.User=1]="User"})(qr||(qr={}));var Hs;(function(n){n.WIN32_X64="win32-x64",n.WIN32_ARM64="win32-arm64",n.LINUX_X64="linux-x64",n.LINUX_ARM64="linux-arm64",n.LINUX_ARMHF="linux-armhf",n.ALPINE_X64="alpine-x64",n.ALPINE_ARM64="alpine-arm64",n.DARWIN_X64="darwin-x64",n.DARWIN_ARM64="darwin-arm64",n.WEB="web",n.UNIVERSAL="universal",n.UNKNOWN="unknown",n.UNDEFINED="undefined"})(Hs||(Hs={}));class Cn{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(typeof e>"u"||e===null)return typeof t>"u"||t===null;if(typeof t>"u"||t===null)return!1;if(typeof e=="string"||typeof t=="string"){const i=typeof e=="string"?e:e.value,s=typeof t=="string"?t:t.value;return Oa(i,s)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class $v{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Cn.toKey(e))}delete(e){return this._set.delete(Cn.toKey(e))}has(e){return this._set.has(Cn.toKey(e))}}class $a{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Cn.toKey(e))}get(e){return this._map.get(Cn.toKey(e))}has(e){return this._map.has(Cn.toKey(e))}set(e,t){this._map.set(Cn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function sLt(n){return hPe(n)}function hPe(n){return n.contributes&&n.contributes.localizations?n.contributes.localizations.length>0:!1}function oLt(n,e){if(e){const t=`onResolveRemoteAuthority:${Wde(e)}`;return!!n.activationEvents?.includes(t)}return!1}function Hde(n,e,t){const i=[],s=new $v,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(c,l,d){return a.provideDocumentRangeFormattingEdits(c,c.getFullModelRange(),l,d)}})}return i}var uV;(function(n){n[n.File=1]="File",n[n.Selection=2]="Selection"})(uV||(uV={}));var S_;(function(n){n[n.Explicit=1]="Explicit",n[n.Silent=2]="Silent"})(S_||(S_={}));const e9=class e9{static setFormatterSelector(e){return{dispose:e9._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const o=fi.first(e9._selectors);if(o)return await o(e,t,i,s)}};e9._selectors=new td;let gV=e9;async function Ude(n,e,t,i,s,o,r){const a=n.get(be),{documentRangeFormattingEditProvider:c}=n.get(ht),l=ja(e)?e.getModel():e,d=c.ordered(l),h=await gV.select(d,l,i,uV.Selection);h&&(s.report(h),await a.invokeFunction(pZe,h,e,t,o,r))}async function pZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Ze),c=n.get(Lw);let l,d;ja(t)?(l=t.getModel(),d=new I1(t,hr.Value|hr.Position,void 0,s)):(l=t,d=new dPe(t,s));const h=[];let u=0;for(const w of Kb(i).sort(O.compareRangesUsingStarts))u>0&&O.areIntersectingOrTouching(h[u-1],w)?h[u-1]=O.fromPositions(h[u-1].getStartPosition(),w.getEndPosition()):u=h.push(w);const f=async w=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,w);const b=await e.provideDocumentRangeFormattingEdits(l,w,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),b},p=(w,b)=>{if(!w.length||!b.length)return!1;const C=w.reduce((y,S)=>O.plusRange(y,S.range),w[0].range);if(!b.some(y=>O.intersectRanges(C,y.range)))return!1;for(const y of w)for(const S of b)if(O.intersectRanges(y.range,S.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const w=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),v.push(w)}else{for(const w of h){if(d.token.isCancellationRequested)return!0;v.push(await f(w))}for(let w=0;w({text:C.text,range:O.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:y}of C)if(O.areIntersectingOrTouching(y,b))return[new mt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return c.playSignal(Zl.format,{userGesture:o}),!0}async function BCe(n,e,t,i,s,o){const r=n.get(be),a=n.get(ht),c=ja(e)?e.getModel():e,l=Hde(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await gV.select(l,c,t,uV.File);d&&(i.report(d),await r.invokeFunction(mZe,d,e,t,s,o))}async function mZe(n,e,t,i,s,o){const r=n.get(kd),a=n.get(Lw);let c,l;ja(t)?(c=t.getModel(),l=new I1(t,hr.Value|hr.Position,void 0,s)):(c=t,l=new dPe(t,s));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await r.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(ja(t))hV.execute(t,d,i!==S_.Silent),i!==S_.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),vt.Immediate);else{const[{range:h}]=d,u=new mt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:O.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(O.areIntersectingOrTouching(p,u))return[new mt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(Zl.format,{userGesture:o}),!0}async function rLt(n,e,t,i,s,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(er);if(mo(c))return await n.computeMoreMinimalEdits(t.uri,c)}}async function aLt(n,e,t,i,s){const o=Hde(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(er);if(mo(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function _Ze(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(er).then(c=>n.computeMoreMinimalEdits(t.uri,c))}yt.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const o=n.get(Rn),r=n.get(kd),a=n.get(ht),c=await o.createModelReference(t);try{return rLt(r,a,c.object.textEditorModel,O.lift(i),s,qe.None)}finally{c.dispose()}});yt.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;Bt(P.isUri(t));const s=n.get(Rn),o=n.get(kd),r=n.get(ht),a=await s.createModelReference(t);try{return aLt(o,r,a.object.textEditorModel,i,qe.None)}finally{a.dispose()}});yt.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string");const r=n.get(Rn),a=n.get(kd),c=n.get(ht),l=await r.createModelReference(t);try{return _Ze(a,c,l.object.textEditorModel,oe.lift(i),s,o,qe.None)}finally{l.dispose()}});var _d;(function(n){n[n.provider=0]="provider",n[n.userDefined=1]="userDefined",n[n.recovered=2]="recovered"})(_d||(_d={}));const cLt={[_d.provider]:" ",[_d.userDefined]:"u",[_d.recovered]:"r"},aVe=65535,pb=16777215,cVe=4278190080;class Yfe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<aVe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Yfe(e.length),this._userDefinedStates=new Yfe(e.length),this._recoveredStates=new Yfe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;ipb||r>pb)throw new Error("startLineNumber or endLineNumber must not exceed "+pb);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&pb}getEndLineNumber(e){return this._endIndexes[e]&pb}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?_d.userDefined:this.isRecovered(e)?_d.recovered:_d.provider}setSource(e,t){t===_d.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===_d.recovered?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&cVe)>>>16);return t===aVe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?w=>ww=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===_d.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=_d.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===_d.provider&&(m.source=_d.recovered)),d=r(++c);else{let v=c,w=d;for(;;){if(!w||w.startLineNumber>l.endLineNumber){m=l;break}if(w.source===_d.userDefined&&w.endLineNumber>l.endLineNumber)break;w=r(++v)}l=o(++a)}if(m){for(;u&&u.endLineNumberm.startLineNumber&&m.startLineNumber>f&&m.endLineNumber<=i&&(!u||u.endLineNumber>=m.endLineNumber)&&(p.push(m),f=m.startLineNumber,u&&h.push(u),u=m)}}return p}}class lLt{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}hidesLine(e){return this.startLineNumberi.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=c=>{for(;sr&&(r=l),s++}};for(const c of e){const l=c.regionIndex,d=this._editorDecorationIds[l];if(d&&!t[d]){t[d]=!0,a(l);const h=!this._regions.isCollapsed(l);this._regions.setCollapsed(l,h),o=Math.max(o,this._regions.getEndLineNumber(l))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??_d.provider})}const s=Xp.sanitizeAndMerge(this._regions,t,i);this.updatePost(Xp.fromFoldRanges(s))}_getLinesChecksum(e,t){return Ed(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,c=this._regions.length;a0&&!l.containedBy(r[r.length-1]);)r.pop();r.push(l),t(l,r.length)&&i.push(l)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);s.push(...r)}n.toggleCollapseState(s)}function hLt(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function uLt(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function bZe(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function uPe(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function gPe(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function gLt(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function fLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function pLt(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Gb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return lVe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!vLt(r,s))&&(s=lVe(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function vLt(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function lVe(n,e){const t=bU(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const wLt=5e3,bLt="indent";class fPe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=bLt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(SLt(this.editorModel,i,s,this.foldingRangesLimit))}}let CLt=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>pb||t>pb)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new Xp(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let c=0;ct){s=c;break}i+=l}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let c=this._length-1,l=0;c>=0;c--){const d=this._startIndexes[c],h=e.getLineContent(d),u=dde(h,o);(u{}};function SLt(n,e,t,i=yLt){const s=n.getOptions().tabSize,o=new CLt(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=n.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=n.getLineCount();l>0;l--){const d=n.getLineContent(l),h=dde(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,u=a[p],o.insertFirst(l,u.line,h),u.line=l,u.indent=h,u.endAbove=l;continue}}else{a.push({indent:-2,endAbove:l,line:l});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const p=u.endAbove-1;p-l>=1&&o.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return o.toIndentRanges(n)}const rL="vs/editor/contrib/folding/browser/foldingDecorations",ALt=B("editor.foldBackground",{light:Ie(Hv,.3),dark:Ie(Hv,.3),hcDark:null,hcLight:null},g(rL,0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);B("editorGutter.foldingControlForeground",{dark:Jy,light:Jy,hcDark:Jy,hcLight:Jy},g(rL,1,"Color of the folding control in the editor gutter."));const tte=Ki("folding-expanded",Ce.chevronDown,g(rL,2,"Icon for expanded ranges in the editor glyph margin.")),ite=Ki("folding-collapsed",Ce.chevronRight,g(rL,3,"Icon for collapsed ranges in the editor glyph margin.")),dVe=Ki("folding-manual-collapsed",ite,g(rL,4,"Icon for manually collapsed ranges in the editor glyph margin.")),hVe=Ki("folding-manual-expanded",tte,g(rL,5,"Icon for manually expanded ranges in the editor glyph margin.")),Jfe={color:Nr(ALt),position:xu.Inline},jO=g(rL,6,"Click to expand the range."),mK=g(rL,7,"Click to collapse the range."),Ec=class Ec{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ec.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ec.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ec.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ec.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ec.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ec.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ec.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ec.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ec.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ec.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ec.MANUALLY_EXPANDED_VISUAL_DECORATION:Ec.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ec.COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),Ec.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(ite)}),Ec.MANUALLY_COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),Ec.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO,firstLineDecorationClassName:$e.asClassName(dVe)}),Ec.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:jO}),Ec.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Jfe,isWholeLine:!0,linesDecorationsTooltip:jO}),Ec.EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-expanded-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(tte),linesDecorationsTooltip:mK}),Ec.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(tte),linesDecorationsTooltip:mK}),Ec.MANUALLY_EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(hVe),linesDecorationsTooltip:mK}),Ec.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(hVe),linesDecorationsTooltip:mK}),Ec.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),Ec.HIDDEN_RANGE_DECORATION=Kt.register({description:"folding-hidden-range-decoration",stickiness:gi.NeverGrowsWhenTypingAtEdges});let WCe=Ec;const ELt={},xLt="syntax";class pPe{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=xLt,this.disposables=new Z,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return DLt(this.providers,this.editorModel,e).then(t=>t?ILt(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function DLt(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,ELt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const c=e.getLineCount();for(const l of a)l.start>0&&l.end>l.start&&l.end<=c&&i.push({start:l.start,end:l.end,rank:r,kind:l.kind})}},er));return Promise.all(s).then(o=>i)}class kLt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>pb||t>pb)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=c}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,c=0;a{let c=r.start-a.start;return c===0&&(c=r.rank-a.rank),c}),i=new kLt(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var KL;const Nu="vs/editor/contrib/folding/browser/folding",jh=new Y("foldingEnabled",!1);var dN;let Ox=(dN=class extends ${static get(e){return e.getContribution(KL.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return KL._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return KL._foldingRangeSelector=e,{dispose:()=>{KL._foldingRangeSelector=void 0}}}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new CZe(e);const a=this.editor.getOptions();this._isEnabled=a.get(x.folding),this._useFoldingProviders=a.get(x.foldingStrategy)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(x.unfoldOnClickAfterEndOfLine),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(x.foldingImportsByDefault),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new WCe(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=jh.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(c=>{if(c.hasChanged(x.folding)&&(this._isEnabled=this.editor.getOptions().get(x.folding),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),c.hasChanged(x.foldingMaximumRegions)&&this.onModelChanged(),c.hasChanged(x.showFoldingControls)||c.hasChanged(x.foldingHighlight)){const l=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=l.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=l.get(x.foldingHighlight),this.triggerFoldingModelChanged()}c.hasChanged(x.foldingStrategy)&&(this._useFoldingProviders=this.editor.getOptions().get(x.foldingStrategy)!=="indentation",this.onFoldingStrategyChanged()),c.hasChanged(x.unfoldOnClickAfterEndOfLine)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(x.unfoldOnClickAfterEndOfLine)),c.hasChanged(x.foldingImportsByDefault)&&(this._foldingImportsByDefault=this.editor.getOptions().get(x.foldingImportsByDefault))})),this.onModelChanged()}get limitReporter(){return this._foldingLimitReporter}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new dLt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new _Lt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Lu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new yn(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new fPe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=KL.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new pPe(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new ao,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=na(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(yv.Imports.value,!0);d&&(r=M_.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(o,c),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(bt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,bt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case Mt.GUTTER_LINE_DECORATIONS:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case Mt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Mt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==Mt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&l.push(u);l.length===0&&(l=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(r)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,vt.Smooth)}},KL=dN,dN.ID="editor.contrib.folding",dN);Ox=KL=D([_(1,Pe),_(2,lo),_(3,Pi),_(4,B_),_(5,ht)],Ox);class CZe{constructor(e){this.editor=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(x.foldingMaximumRegions)}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Pu extends lt{runEditorCommand(e,t,i){const s=e.get(lo),o=Ox.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const c=t.getSelection();c&&o.reveal(c.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function yZe(n){if(!ll(n)){if(!fo(n))return!1;const e=n;if(!ll(e.levels)&&!Kc(e.levels)||!ll(e.direction)&&!zt(e.direction)||!ll(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Kc)))return!1}return!0}class LLt extends Pu{constructor(){super({id:"editor.unfold",label:g(Nu,0,"Unfold"),alias:"Unfold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.BracketRight,mac:{primary:V.CtrlCmd|V.Alt|E.BracketRight},weight:ye.EditorContrib},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. @@ -680,42 +680,42 @@ ${e.toString()}`}}class P7{constructor(e=new Dl,t=!1,i,s=U0t){this._services=e,t * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:yZe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?hLt(t,!0,o):a==="up"?wZe(t,!0,r||1,o):Lz(t,!0,r||1,o)}}class MLt extends Pu{constructor(){super({id:"editor.toggleFold",label:g(Nu,3,"Toggle Fold"),alias:"Toggle Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyL),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);vZe(t,1,s)}}class NLt extends Pu{constructor(){super({id:"editor.foldRecursively",label:g(Nu,4,"Fold Recursively"),alias:"Fold Recursively",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.BracketLeft),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);Lz(t,!0,Number.MAX_VALUE,s)}}class PLt extends Pu{constructor(){super({id:"editor.foldAllBlockComments",label:g(Nu,5,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Slash),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())gPe(t,yv.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const c=new RegExp("^\\s*"+Iu(a.blockCommentStartToken));uPe(t,c,!0)}}}}class FLt extends Pu{constructor(){super({id:"editor.foldAllMarkerRegions",label:g(Nu,6,"Fold All Regions"),alias:"Fold All Regions",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit8),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())gPe(t,yv.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);uPe(t,c,!0)}}}}class OLt extends Pu{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g(Nu,7,"Unfold All Regions"),alias:"Unfold All Regions",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit9),weight:ye.EditorContrib}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())gPe(t,yv.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);uPe(t,c,!1)}}}}class BLt extends Pu{constructor(){super({id:"editor.foldAllExcept",label:g(Nu,8,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Minus),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);bZe(t,!0,s)}}class WLt extends Pu{constructor(){super({id:"editor.unfoldAllExcept",label:g(Nu,9,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Equal),weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);bZe(t,!1,s)}}class HLt extends Pu{constructor(){super({id:"editor.foldAll",label:g(Nu,10,"Fold All"),alias:"Fold All",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit0),weight:ye.EditorContrib}})}invoke(e,t,i){Lz(t,!0)}}class ULt extends Pu{constructor(){super({id:"editor.unfoldAll",label:g(Nu,11,"Unfold All"),alias:"Unfold All",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyJ),weight:ye.EditorContrib}})}invoke(e,t,i){Lz(t,!1)}}const G2=class G2 extends Pu{getFoldingLevel(){return parseInt(this.id.substr(G2.ID_PREFIX.length))}invoke(e,t,i){uLt(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};G2.ID_PREFIX="editor.foldLevel",G2.ID=e=>G2.ID_PREFIX+e;let nte=G2;class VLt extends Pu{constructor(){super({id:"editor.gotoParentFold",label:g(Nu,12,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=gLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class zLt extends Pu{constructor(){super({id:"editor.gotoPreviousFold",label:g(Nu,13,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=fLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class $Lt extends Pu{constructor(){super({id:"editor.gotoNextFold",label:g(Nu,14,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=pLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class GLt extends Pu{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(Nu,15,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Comma),weight:ye.EditorContrib}})}invoke(e,t,i){const s=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(s.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:_d.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=Xp.sanitizeAndMerge(t.regions,s,i.getModel()?.getLineCount());t.updatePost(Xp.fromFoldRanges(r))}}}}class qLt extends Pu{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(Nu,16,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Period),weight:ye.EditorContrib}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}vn(Ox.ID,Ox,mi.Eager);Fe(LLt);Fe(TLt);Fe(RLt);Fe(NLt);Fe(HLt);Fe(ULt);Fe(PLt);Fe(FLt);Fe(OLt);Fe(BLt);Fe(WLt);Fe(MLt);Fe(VLt);Fe(zLt);Fe($Lt);Fe(GLt);Fe(qLt);for(let n=1;n<=7;n++)Lgt(new nte({id:nte.ID(n),label:g(Nu,17,"Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit0+n),weight:ye.EditorContrib}}));yt.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof P))throw Hi();const i=n.get(ht),s=n.get(Ai).getModel(t);if(!s)throw Hi();const o=n.get(Re);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(lo),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new fPe(s,r,c);let d=l;if(a!=="indentation"){const f=Ox.getFoldingRangeProviders(i,s);f.length&&(d=new pPe(s,f,()=>{},c,l))}const h=await d.compute(qe.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};n.openEditor(e,o)}}),_l({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(ste,3,"Configure Limit"),run:()=>s.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:nt.Warning})}function z$(n){return Qa(n?.editor)}function Xfe(n){const e=n;return z$(n)&&e?.group!==void 0}function HCe(n){const e=n;return typeof e?.groupId=="number"&&Qa(e.editor)}var mx;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.REPLACE=1]="REPLACE",n[n.MOVE=2]="MOVE",n[n.UNPIN=3]="UNPIN"})(mx||(mx={}));var qo;(function(n){n[n.GROUP_ACTIVE=0]="GROUP_ACTIVE",n[n.GROUP_INDEX=1]="GROUP_INDEX",n[n.GROUP_LABEL=2]="GROUP_LABEL",n[n.GROUP_LOCKED=3]="GROUP_LOCKED",n[n.EDITORS_SELECTION=4]="EDITORS_SELECTION",n[n.EDITOR_OPEN=5]="EDITOR_OPEN",n[n.EDITOR_CLOSE=6]="EDITOR_CLOSE",n[n.EDITOR_MOVE=7]="EDITOR_MOVE",n[n.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",n[n.EDITOR_LABEL=9]="EDITOR_LABEL",n[n.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",n[n.EDITOR_PIN=11]="EDITOR_PIN",n[n.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",n[n.EDITOR_STICKY=13]="EDITOR_STICKY",n[n.EDITOR_DIRTY=14]="EDITOR_DIRTY",n[n.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(qo||(qo={}));var go;(function(n){n[n.PRIMARY=1]="PRIMARY",n[n.SECONDARY=2]="SECONDARY",n[n.BOTH=3]="BOTH",n[n.ANY=4]="ANY"})(go||(go={}));class eTt{getOriginalUri(e,t){if(!e)return;if(Wb(e))return Qc.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getOriginalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getOriginalUri(s,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=JLt(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return XLt(e)||LE(e)?{primary:e.primary,secondary:e.secondary}:EZe(e)||Gv(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Wb(e))return Qc.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getCanonicalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getCanonicalUri(s,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(i=>e.scheme===i))return e}else if(t===e.scheme)return e}}var gVe;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.KEYBOARD=1]="KEYBOARD",n[n.MOUSE=2]="MOUSE"})(gVe||(gVe={}));const Qc=new eTt;var fVe;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(fVe||(fVe={}));class tTt{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(be);for(const[i,s]of this.editorSerializerConstructors)this.createEditorSerializer(i,s,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const s=i.createInstance(t);this.editorSerializerInstances.set(e,s)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return ws(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),Ee(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}it.add(zS.EditorFactory,new tTt);async function Zfe(n,e,t){return!n||!n.length?[]:await Promise.all(n.map(async i=>{const s=P.revive(i.fileUri);if(!s){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(s)){t.info("Cannot resolve the path because it cannot be handled",i);return}let r=i.exists,a=i.type;if(typeof r!="boolean"||typeof a!="number")try{a=(await e.stat(s)).isDirectory?an.Directory:an.Unknown,r=!0}catch(l){t.error(l),r=!1}if(!r&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===an.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:s,options:c}:{resource:s,options:c,forceUntitled:!0}}))}var eg;(function(n){n[n.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",n[n.SEQUENTIAL=1]="SEQUENTIAL"})(eg||(eg={}));function mPe(n){const e=n;if(!e)return!1;const t=e;if(t.modified)return mPe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function xZe(n,e,t){const i=pSt(n,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var Gw;const Si="vs/workbench/common/contextkeys";new Y("workbenchState",void 0,{type:"string",description:g(Si,0,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")});new Y("workspaceFolderCount",0,g(Si,1,"The number of root folders in the workspace"));new Y("openFolderWorkspaceSupport",!0,!0);new Y("enterMultiRootWorkspaceSupport",!0,!0);const iTt=new Y("emptyWorkspaceSupport",!0,!0);new Y("dirtyWorkingCopies",!1,g(Si,2,"Whether there are any working copies with unsaved changes"));new Y("remoteName","",g(Si,3,"The name of the remote the window is connected to or an empty string if not connected to any remote"));new Y("virtualWorkspace","",g(Si,4,"The scheme of the current workspace is from a virtual file system or an empty string."));const nTt=new Y("temporaryWorkspace",!1,g(Si,5,"The scheme of the current workspace is from a temporary file system."));new Y("isFullscreen",!1,g(Si,6,"Whether the main window is in fullscreen mode"));new Y("isAuxiliaryWindowFocusedContext",!1,g(Si,7,"Whether an auxiliary window is focused"));new Y("hasWebFileSystemAccess",!1,!0);new Y("embedderIdentifier",void 0,g(Si,8,"The identifier of the embedder according to the product service, if one is defined"));new Y("activeEditorIsDirty",!1,g(Si,9,"Whether the active editor has unsaved changes"));new Y("activeEditorIsNotPreview",!1,g(Si,10,"Whether the active editor is not in preview mode"));new Y("activeEditorIsFirstInGroup",!1,g(Si,11,"Whether the active editor is the first one in its group"));new Y("activeEditorIsLastInGroup",!1,g(Si,12,"Whether the active editor is the last one in its group"));new Y("activeEditorIsPinned",!1,g(Si,13,"Whether the active editor is pinned"));new Y("activeEditorIsReadonly",!1,g(Si,14,"Whether the active editor is read-only"));new Y("activeCompareEditorCanSwap",!1,g(Si,15,"Whether the active compare editor can swap sides"));const sTt=new Y("activeEditorCanToggleReadonly",!0,g(Si,16,"Whether the active editor can toggle between being read-only or writeable"));new Y("activeEditorCanRevert",!1,g(Si,17,"Whether the active editor can revert"));new Y("activeEditorCanSplitInGroup",!0);const DZe=new Y("activeEditor",null,{type:"string",description:g(Si,18,"The identifier of the active editor")});new Y("activeEditorAvailableEditorIds","",g(Si,19,"The available editor identifiers that are usable for the active editor"));new Y("textCompareEditorVisible",!1,g(Si,20,"Whether a text compare editor is visible"));const Vde=new Y("textCompareEditorActive",!1,g(Si,21,"Whether a text compare editor is active"));new Y("sideBySideEditorActive",!1,g(Si,22,"Whether a side by side editor is active"));new Y("groupEditorsCount",0,g(Si,23,"The number of opened editor groups"));new Y("activeEditorGroupEmpty",!1,g(Si,24,"Whether the active editor group is empty"));new Y("activeEditorGroupIndex",0,g(Si,25,"The index of the active editor group"));new Y("activeEditorGroupLast",!1,g(Si,26,"Whether the active editor group is the last group"));new Y("activeEditorGroupLocked",!1,g(Si,27,"Whether the active editor group is locked"));new Y("multipleEditorGroups",!1,g(Si,28,"Whether there are multiple editor groups opened"));new Y("multipleEditorsSelectedInGroup",!1,g(Si,29,"Whether multiple editors have been selected in an editor group"));new Y("twoEditorsSelectedInGroup",!1,g(Si,30,"Whether exactly two editors have been selected in an editor group"));new Y("editorPartMultipleEditorGroups",!1,g(Si,31,"Whether there are multiple editor groups opened in an editor part"));new Y("editorPartMaximizedEditorGroup",!1,g(Si,32,"Editor Part has a maximized group"));new Y("isAuxiliaryEditorPart",!1,g(Si,33,"Editor Part is in an auxiliary window"));new Y("editorIsOpen",!1,g(Si,34,"Whether an editor is open"));new Y("inZenMode",!1,g(Si,35,"Whether Zen mode is enabled"));new Y("isCenteredLayout",!1,g(Si,36,"Whether centered layout is enabled for the main editor"));new Y("splitEditorsVertically",!1,g(Si,37,"Whether editors split vertically"));new Y("mainEditorAreaVisible",!0,g(Si,38,"Whether the editor area in the main window is visible"));new Y("editorTabsVisible",!0,g(Si,39,"Whether editor tabs are visible"));new Y("sideBarVisible",!1,g(Si,40,"Whether the sidebar is visible"));new Y("sideBarFocus",!1,g(Si,41,"Whether the sidebar has keyboard focus"));new Y("activeViewlet","",g(Si,42,"The identifier of the active viewlet"));new Y("statusBarFocused",!1,g(Si,43,"Whether the status bar has keyboard focus"));new Y("titleBarStyle",jr?"native":"custom",g(Si,44,"Style of the window title bar"));new Y("titleBarVisible",!1,g(Si,45,"Whether the title bar is visible"));new Y("bannerFocused",!1,g(Si,46,"Whether the banner has keyboard focus"));new Y("notificationFocus",!0,g(Si,47,"Whether a notification has keyboard focus"));new Y("notificationCenterVisible",!1,g(Si,48,"Whether the notifications center is visible"));new Y("notificationToastsVisible",!1,g(Si,49,"Whether a notification toast is visible"));new Y("activeAuxiliary","",g(Si,50,"The identifier of the active auxiliary panel"));new Y("auxiliaryBarFocus",!1,g(Si,51,"Whether the auxiliary bar has keyboard focus"));new Y("auxiliaryBarVisible",!1,g(Si,52,"Whether the auxiliary bar is visible"));new Y("activePanel","",g(Si,53,"The identifier of the active panel"));new Y("panelFocus",!1,g(Si,54,"Whether the panel has keyboard focus"));new Y("panelPosition","bottom",g(Si,55,"The position of the panel, always 'bottom'"));new Y("panelAlignment","center",g(Si,56,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'"));new Y("panelVisible",!1,g(Si,57,"Whether the panel is visible"));new Y("panelMaximized",!1,g(Si,58,"Whether the panel is maximized"));const Tz=new Y("focusedView","",g(Si,59,"The identifier of the view that has keyboard focus"));var Gf;let O7=(Gf=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new Z,this._schemeKey=Gw.Scheme.bindTo(this._contextKeyService),this._filenameKey=Gw.Filename.bindTo(this._contextKeyService),this._dirnameKey=Gw.Dirname.bindTo(this._contextKeyService),this._pathKey=Gw.Path.bindTo(this._contextKeyService),this._langIdKey=Gw.LangId.bindTo(this._contextKeyService),this._resourceKey=Gw.Resource.bindTo(this._contextKeyService),this._extensionKey=Gw.Extension.bindTo(this._contextKeyService),this._hasResource=Gw.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Gw.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(s.onModelAdded(o=>{_n(o.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(o=>{_n(o.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}_setLangId(){const e=this.get();if(!e){this._langIdKey.set(null);return}const t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!_n(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?ui(e):null),this._dirnameKey.set(e?this.uriToPath(ma(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?uz(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.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}},Gw=Gf,Gf.Scheme=new Y("resourceScheme",void 0,{type:"string",description:g(Si,60,"The scheme of the resource")}),Gf.Filename=new Y("resourceFilename",void 0,{type:"string",description:g(Si,61,"The file name of the resource")}),Gf.Dirname=new Y("resourceDirname",void 0,{type:"string",description:g(Si,62,"The folder name the resource is contained in")}),Gf.Path=new Y("resourcePath",void 0,{type:"string",description:g(Si,63,"The full path of the resource")}),Gf.LangId=new Y("resourceLangId",void 0,{type:"string",description:g(Si,64,"The language identifier of the resource")}),Gf.Resource=new Y("resource",void 0,{type:"URI",description:g(Si,65,"The full value of the resource including scheme and path")}),Gf.Extension=new Y("resourceExtname",void 0,{type:"string",description:g(Si,66,"The extension name of the resource")}),Gf.HasResource=new Y("resourceSet",void 0,{type:"boolean",description:g(Si,67,"Whether a resource is present or not")}),Gf.IsFileSystemResource=new Y("isFileSystemResource",void 0,{type:"boolean",description:g(Si,68,"Whether the resource is backed by a file system provider")}),Gf);O7=Gw=D([_(0,Pe),_(1,ci),_(2,Di),_(3,Ai)],O7);function oTt(n,e){return n.invokeFunction(t=>Ov.getServiceDependencies(e).sort((i,s)=>i.index-s.index).map(i=>t.get(i.id)))}function _Pe(n){const e=n;return class extends e{constructor(...t){super(...t.slice(1),...oTt(t[0],n))}}}class vPe{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}class pVe{constructor(e){this.identifier=e}}const zde=ae("treeViewsDndService");ce(zde,vPe,Kt.Delayed);const kZe=ae("extensionHostDebugService"),rTt="diagnosticsService";class aTt{async getPerformanceInfo(e,t){return{}}async getSystemInfo(e,t){return{processArgs:"nullProcessArgs",gpuStatus:"nullGpuStatus",screenReader:"nullScreenReader",remoteData:[],os:"nullOs",memory:"nullMemory",vmHint:"nullVmHint"}}async getDiagnostics(e,t){return""}async getWorkspaceFileExtensions(e){return{extensions:[]}}async reportWorkspaceStats(e){}}const cTt=ae(rTt),wPe=ae("downloadService"),lTt=ae("encryptionService"),aL=ae("extensionGalleryService"),Rz=ae("extensionManagementService"),IZe=ae("IGlobalExtensionEnablementService"),dTt=ae("IExtensionTipsService"),B7=ae("IExtensionStorageService"),$de=ae("IExtensionsProfileScannerService"),hTt=ae("IExtensionsScannerService"),uTt=ae("IExtensionRecommendationNotificationService"),bPe=ae("extensionResourceLoaderService"),gTt=ae("IBuiltinExtensionsScannerService"),fTt=ae("keyboardLayoutService"),LZe=ae("languagePackService");class TZe{constructor(){this.onDidChange=T.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Ja=ae("productService"),rA=ae("remoteAuthorityResolverService"),Gde=ae("IRemoteExtensionsScannerService"),CPe=ae("remoteSocketFactoryService"),EQ=ae("requestService"),RZe=ae("secretStorageService"),pTt="signService",MZe=ae(pTt);let qde=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class mTt{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const _Tt="extensionTelemetryLog";function EJ(n,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!n.enableTelemetry)}function yPe(n,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||n.enableTelemetry&&n.aiConfig?.ariaKey)}function vTt(n){const e=n.getValue(xJe),t=n.getValue(txt);if(n.getValue(DJe)===!1||t===!1)return sp.NONE;switch(e??LT.ON){case LT.ON:return sp.USAGE;case LT.ERROR:return sp.ERROR;case LT.CRASH:return sp.CRASH;case LT.OFF:return sp.NONE}}const wTt=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function bTt(n){if(!n)return"none";const e=Wde(n);return wTt.has(e)?e:"other"}function CTt(n,e){if(!n||!n.includes("/")&&!n.includes("\\"))return n;let t=n;const i=[];for(const a of e)for(;;){const c=a.exec(n);if(!c)break;i.push([c.index,a.lastIndex])}const s=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(n);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return n}function mVe(n,e){return AU(n,t=>{if(t instanceof qde||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=CTt(i,e);for(const s of e)i=i.replace(s,"");return i=yTt(i),i}})}var _Ve;(function(n){n.AutomationProfile="terminal.integrated.automationProfile.",n.DefaultProfile="terminal.integrated.defaultProfile.",n.Profiles="terminal.integrated.profiles."})(_Ve||(_Ve={}));var _y;(function(n){n.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",n.AutomationProfileLinux="terminal.integrated.automationProfile.linux",n.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",n.AutomationProfileWindows="terminal.integrated.automationProfile.windows",n.ProfilesWindows="terminal.integrated.profiles.windows",n.ProfilesMacOs="terminal.integrated.profiles.osx",n.ProfilesLinux="terminal.integrated.profiles.linux",n.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",n.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",n.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",n.UseWslProfiles="terminal.integrated.useWslProfiles",n.TabsDefaultColor="terminal.integrated.tabs.defaultColor",n.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",n.TabsEnabled="terminal.integrated.tabs.enabled",n.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",n.TabsHideCondition="terminal.integrated.tabs.hideCondition",n.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",n.TabsShowActions="terminal.integrated.tabs.showActions",n.TabsLocation="terminal.integrated.tabs.location",n.TabsFocusMode="terminal.integrated.tabs.focusMode",n.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",n.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",n.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",n.CopyOnSelection="terminal.integrated.copyOnSelection",n.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",n.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",n.FontFamily="terminal.integrated.fontFamily",n.FontSize="terminal.integrated.fontSize",n.LetterSpacing="terminal.integrated.letterSpacing",n.LineHeight="terminal.integrated.lineHeight",n.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",n.TabStopWidth="terminal.integrated.tabStopWidth",n.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",n.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",n.BellDuration="terminal.integrated.bellDuration",n.FontWeight="terminal.integrated.fontWeight",n.FontWeightBold="terminal.integrated.fontWeightBold",n.CursorBlinking="terminal.integrated.cursorBlinking",n.CursorStyle="terminal.integrated.cursorStyle",n.CursorStyleInactive="terminal.integrated.cursorStyleInactive",n.CursorWidth="terminal.integrated.cursorWidth",n.Scrollback="terminal.integrated.scrollback",n.DetectLocale="terminal.integrated.detectLocale",n.DefaultLocation="terminal.integrated.defaultLocation",n.GpuAcceleration="terminal.integrated.gpuAcceleration",n.TerminalTitleSeparator="terminal.integrated.tabs.separator",n.TerminalTitle="terminal.integrated.tabs.title",n.TerminalDescription="terminal.integrated.tabs.description",n.RightClickBehavior="terminal.integrated.rightClickBehavior",n.MiddleClickBehavior="terminal.integrated.middleClickBehavior",n.Cwd="terminal.integrated.cwd",n.ConfirmOnExit="terminal.integrated.confirmOnExit",n.ConfirmOnKill="terminal.integrated.confirmOnKill",n.EnableBell="terminal.integrated.enableBell",n.EnableVisualBell="terminal.integrated.enableVisualBell",n.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",n.AllowChords="terminal.integrated.allowChords",n.AllowMnemonics="terminal.integrated.allowMnemonics",n.TabFocusMode="terminal.integrated.tabFocusMode",n.EnvMacOs="terminal.integrated.env.osx",n.EnvLinux="terminal.integrated.env.linux",n.EnvWindows="terminal.integrated.env.windows",n.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",n.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",n.ShowExitAlert="terminal.integrated.showExitAlert",n.SplitCwd="terminal.integrated.splitCwd",n.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",n.WordSeparators="terminal.integrated.wordSeparators",n.EnableFileLinks="terminal.integrated.enableFileLinks",n.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",n.UnicodeVersion="terminal.integrated.unicodeVersion",n.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",n.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",n.HideOnStartup="terminal.integrated.hideOnStartup",n.CustomGlyphs="terminal.integrated.customGlyphs",n.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",n.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",n.InheritEnv="terminal.integrated.inheritEnv",n.ShowLinkHover="terminal.integrated.showLinkHover",n.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",n.AutoReplies="terminal.integrated.autoReplies",n.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",n.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",n.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",n.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",n.EnableImages="terminal.integrated.enableImages",n.SmoothScrolling="terminal.integrated.smoothScrolling",n.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",n.FocusAfterRun="terminal.integrated.focusAfterRun",n.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",n.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",n.DevMode="terminal.integrated.developer.devMode"})(_y||(_y={}));var vVe;(function(n){n.PowerShell="pwsh",n.Bash="bash",n.Fish="fish",n.Sh="sh",n.Csh="csh",n.Ksh="ksh",n.Zsh="zsh",n.Python="python"})(vVe||(vVe={}));var wVe;(function(n){n.CommandPrompt="cmd",n.PowerShell="pwsh",n.Wsl="wsl",n.GitBash="gitbash",n.Python="python"})(wVe||(wVe={}));var bVe;(function(n){n[n.Api=0]="Api",n[n.Process=1]="Process",n[n.Sequence=2]="Sequence",n[n.Config=3]="Config"})(bVe||(bVe={}));var jf;(function(n){n.Cwd="cwd",n.InitialCwd="initialCwd",n.FixedDimensions="fixedDimensions",n.Title="title",n.ShellType="shellType",n.HasChildProcesses="hasChildProcesses",n.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",n.OverrideDimensions="overrideDimensions",n.FailedShellIntegrationActivation="failedShellIntegrationActivation",n.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(jf||(jf={}));var fV;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(fV||(fV={}));var CVe;(function(n){n.TerminalView="view",n.Editor="editor"})(CVe||(CVe={}));var yVe;(function(n){n[n.HighWatermarkChars=1e5]="HighWatermarkChars",n[n.LowWatermarkChars=5e3]="LowWatermarkChars",n[n.CharCountAckSize=5e3]="CharCountAckSize"})(yVe||(yVe={}));var SVe;(function(n){n[n.Off=0]="Off",n[n.FinalTerm=1]="FinalTerm",n[n.VSCode=2]="VSCode"})(SVe||(SVe={}));var vM;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(vM||(vM={}));const STt={Backend:"workbench.contributions.terminal.processBackend"};function UCe(n){return n?.toLowerCase()??""}class ATt{constructor(e){this.remoteAuthority=e}affects(e){return UCe(e)===this.remoteAuthority}}class ETt{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=UCe(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new ATt(t))}getTerminalBackend(e){return this._backends.get(UCe(e))}}it.add(STt.Backend,new ETt);const xTt=ae("terminalLogService"),Qde=ae("tunnelService");var tb;(function(n){n.Uninitialized="uninitialized",n.Idle="idle",n.Disabled="disabled",n.CheckingForUpdates="checking for updates",n.AvailableForDownload="available for download",n.Downloading="downloading",n.Downloaded="downloaded",n.Updating="updating",n.Ready="ready"})(tb||(tb={}));var AVe;(function(n){n[n.Setup=0]="Setup",n[n.Archive=1]="Archive",n[n.Snap=2]="Snap"})(AVe||(AVe={}));var EVe;(function(n){n[n.NotBuilt=0]="NotBuilt",n[n.DisabledByEnvironment=1]="DisabledByEnvironment",n[n.ManuallyDisabled=2]="ManuallyDisabled",n[n.MissingConfiguration=3]="MissingConfiguration",n[n.InvalidConfiguration=4]="InvalidConfiguration",n[n.RunningAsAdmin=5]="RunningAsAdmin"})(EVe||(EVe={}));const DTt={Uninitialized:{type:tb.Uninitialized},Disabled:n=>({type:tb.Disabled,reason:n}),Idle:(n,e)=>({type:tb.Idle,updateType:n,error:e}),CheckingForUpdates:n=>({type:tb.CheckingForUpdates,explicit:n}),AvailableForDownload:n=>({type:tb.AvailableForDownload,update:n}),Downloading:{type:tb.Downloading},Downloaded:n=>({type:tb.Downloaded,update:n}),Updating:n=>({type:tb.Updating,update:n}),Ready:n=>({type:tb.Ready,update:n})},NZe=ae("updateService");var xVe;let epe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const b5=void 0;class MT{constructor(e,t=2**16){this.comparator=e,this[xVe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new epe(this._maxLevel,b5,b5)}get size(){return this._size}clear(){this._header=new epe(this._maxLevel,b5,b5),this._size=0}has(e){return!!MT._search(this,e,this.comparator)}get(e){return MT._search(this,e,this.comparator)?.value}set(e,t){return MT._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=MT._delete(this,e,this.comparator);return t&&(this._size-=1),t}forEach(e,t){let i=this._header.forward[0];for(;i;)e.call(t,i.value,i.key,this),i=i.forward[0]}[(xVe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this._header.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this._header.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this._header.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",t=this._header.forward[0];for(;t;)e+=`node(${t.key}, ${t.value}, lvl:${t.level})`,t=t.forward[0];return e}static _search(e,t,i){let s=e._header;for(let o=e._level-1;o>=0;o--)for(;s.forward[o]&&i(s.forward[o].key,t)<0;)s=s.forward[o];if(s=s.forward[0],s&&i(s.key,t)===0)return s}static _insert(e,t,i,s){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&s(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&s(r.key,t)===0)return r.value=i,!1;{const a=MT._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;r--){for(;o.forward[r]&&i(o.forward[r].key,t)<0;)o=o.forward[r];s[r]=o}if(o=o.forward[0],!o||i(o.key,t)!==0)return!1;for(let r=0;r0&&e._header.forward[e._level-1]===b5;)e._level-=1;return!0}}const t9=class t9{constructor(e){this.uri=e,this.time=t9._clock++}touch(){return this.time=t9._clock++,this}};t9._clock=0;let rte=t9,VCe=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=s=>{let o=t.get(s.scheme);return o===void 0&&(o=e.hasProvider(s)&&!this._fileService.hasCapability(s,es.PathCaseSensitive),t.set(s.scheme,o)),o};this._dispooables.add(T.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(s=>{t.delete(s.scheme)})),this.extUri=new cO(i),this._canonicalUris=new MT((s,o)=>this.extUri.compare(s,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=jQe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new rte(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].times[1].time?-1:0);rte._clock=0,this._canonicalUris.clear();const t=this._limit*.5;for(let i=0;ie.accessor.dispose()),this._entries.clear(),this._onDidChange.dispose()}setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=ZYe(o),r){const C=typeof r=="string"?r:r.value;f+=`, ${C}`}let m;switch(l?.id){case RVe:case jTt:m=l.id===RVe?"error":"warning",c=void 0,l=void 0}const v={name:s,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let w=d?W7.LEFT:W7.RIGHT;const b=this._entries.get(e);if(b&&(w=b.alignment,h=b.priority),b)return b.accessor.update(v),b.entry=v,H7.DidUpdate;{let C;typeof i=="string"?C={primary:h,secondary:Ed(i)}:C=h;const y=this._statusbarService.addEntry(v,t,w,C);return this._entries.set(e,{accessor:y,entry:v,alignment:w,priority:h,disposable:Ee(()=>{y.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:w,priority:h}]}),H7.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};zCe=D([_(0,EPe)],zCe);ce(xPe,zCe,Kt.Delayed);const eRt=ae("IEditorBreadcrumbsService"),rI=new Tn(220,70),cte=new Tn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Kde={showTabs:"multiple",highlightModifiedTabs:!1,tabActionLocation:"right",tabActionCloseVisibility:!0,tabActionUnpinVisibility:!0,alwaysShowEditorActions:!1,tabSizing:"fit",tabSizingFixedMinWidth:50,tabSizingFixedMaxWidth:160,pinnedTabSizing:"normal",pinnedTabsOnSeparateRow:!1,tabHeight:"default",preventPinnedEditorClose:"keyboardAndMouse",titleScrollbarSizing:"default",focusRecentEditorAfterClose:!0,showIcons:!0,hasIcons:!0,enablePreview:!0,openPositioning:"right",openSideBySideDirection:"right",closeEmptyGroups:!0,labelFormat:"default",splitSizing:"auto",splitOnDragAndDrop:!0,dragToOpenWindow:!0,centeredLayoutFixedWidth:!1,doubleClickTabToToggleEditorGroupSizes:"expand",editorActionsLocation:"default",wrapTabs:!1,enablePreviewFromQuickOpen:!1,scrollToSwitchTabs:!1,enablePreviewFromCodeNavigation:!1,closeOnFileDelete:!1,mouseBackForwardToNavigate:!0,restoreViewState:!0,splitInGroupLayout:"horizontal",revealIfOpen:!1,get limit(){return{enabled:!1,value:10,perEditorGroup:!1,excludeDirty:!1}},get decorations(){return{badges:!0,colors:!0}},get autoLockGroups(){return new Set}},z_=ae("viewDescriptorService"),Tw=ae("accessibleViewService"),lL=ae("chatWidgetService"),tRt=ae("quickChatService"),BZe=ae("chatAccessibilityService"),iRt=ae("chatCodeBlockContextProviderService"),yp=ae("chatAgentService"),Yde=ae("chatAgentNameService"),Rw=ae("IChatService"),DPe=ae("chatSlashCommandService"),Mz=ae("IChatVariablesService"),WZe=ae("IChatWidgetHistoryService"),HZe=ae("ILanguageModelsService"),sD=ae("commentService"),kPe=ae("customEditorService"),IPe=ae("debugService"),UZe=ae("debugVisualizerService"),nRt=ae("IEditSessionsStorageService"),sRt=ae("IEditSessionsLogService"),pr=ae("extensionsWorkbenchService"),VZe=ae("externalUriOpenerService"),Sp=ae("explorerService"),zZe=ae("IInlineChatSavingService "),LPe=ae("IInlineChatSessionService"),TPe=ae("IInteractiveDocumentService"),$Ze=ae("IInteractiveHistoryService"),oRt=ae("IDefaultLogLevelsService"),GZe=ae("multiDiffSourceResolverService"),xQ=ae("INotebookEditorWidgetService"),qZe=ae("notebookCellStatusBarService"),Jde=ae("INotebookModelResolverService"),rRt=ae("INotebookExecutionService"),QZe=ae("INotebookExecutionStateService"),jZe=ae("INotebookKernelService"),aRt=ae("INotebookKernelHistoryService"),cRt=ae("notebookKeymapService"),lRt=ae("INotebookLoggingService"),KZe=ae("INotebookRendererMessagingService"),oD=ae("notebookService"),dRt="notebookEditorWorkerService",hRt=ae(dRt),uRt=ae("outputChannelModelService"),gRt=ae("preferencesSearchService"),DQ=ae("quickDiff"),RPe=ae("scm"),YZe=ae("scmView"),fRt=ae("replaceService"),pRt=ae("searchViewModelWorkbenchService"),mRt=ae("notebookSearchService"),_Rt=ae("searchHistoryService"),JZe=ae("shareService"),$_=ae("snippetService"),Xde=ae("speechService");class vRt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const wRt=ae("workspaceTagsService"),XZe=ae("taskService"),Nz=ae("terminalService"),bRt=ae("terminalConfigurationService"),ZZe=ae("terminalEditorService"),MPe=ae("terminalGroupService"),eet=ae("terminalInstanceService"),tet=ae("environmentVariableService"),iet=ae("terminalProfileResolverService"),net=ae("terminalProfileService"),CRt=ae("terminalContributionsService"),set=ae("terminalLinkProviderService"),oet=ae("terminalQuickFixService"),yRt=ae("testCoverageService"),SRt=ae("testingFilterState"),ret=ae("testProfileService"),aet=ae("testResultService"),ARt=ae("ITestResultStorage"),cet=ae("testService"),ERt=ae("testingContinuousRunService"),xRt=ae("testingDecorationService"),DRt=ae("testingPeekOpener"),kRt="timeline",det=ae(kRt),Zde=ae("webviewService"),kQ=ae("webviewEditorService"),het=ae("webviewViewService"),IRt=ae("walkthroughsService"),LRt=ae("activityService"),uet=ae("IAiEmbeddingVectorService"),NPe=ae("IAiRelatedInformationService"),get=ae("WorkbenchAssignmentService"),ehe=ae("IAuthenticationAccessService"),fet=ae("IAuthenticationUsageService"),PPe=ae("IAuthenticationService"),pet=ae("IAuthenticationExtensionsService"),met=ae("auxiliaryWindowService"),TRt=ae("bannerService"),dL=ae("jsonEditingService"),_et=ae("configurationResolverService"),rD=ae("IFileDecorationsService"),aD=ae("ICustomEditorLabelService"),ur=ae("editorGroupsService"),vet=ae("editorPaneService"),Pz=ae("editorResolverService"),_i=ae("editorService"),Fz=ae("IExtensionBisectService"),wet=ae("IExtensionFeaturesManagementService"),RRt=Rz,Mw=ae("extensionManagementServerService"),the=RRt,Kh=ae("extensionEnablementService"),FPe=ae("IWebExtensionsScannerService"),bet=ae("extensionRecommendationsService"),ihe=ae("IExtensionIgnoredRecommendationsService"),MRt=ae("IWorkspaceExtensionsConfigService"),Cet=ae("extensionUrlHandler"),G_=ae("extensionManifestPropertiesService"),ho=ae("extensionService"),IQ=ae("elevatedFileService"),hh=ae("filesConfigurationService"),NRt=ae("historyService"),Id=ae("hostService"),PRt=ae("ITroubleshootIssueService"),FRt=ae("workbenchIssueService");class ORt{constructor(e,t){this._mapAltGrToCtrlAlt=e,this._OS=t}dumpDebugInfo(){return"FallbackKeyboardMapper dispatching on keyCode"}resolveKeyboardEvent(e){const t=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,i=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,s=new RS(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new l$([s]))[0]}resolveKeybinding(e){return XU.resolveKeybinding(e,this._OS)}}const BRt=ae("keybindingEditingService"),LQ=ae("ILanguageDetectionService"),OPe=ae("ILanguageStatusService"),mg=ae("lifecycleService");var PI;(function(n){n[n.CLOSE=1]="CLOSE",n[n.QUIT=2]="QUIT",n[n.RELOAD=3]="RELOAD",n[n.LOAD=4]="LOAD"})(PI||(PI={}));var $$;(function(n){n[n.NewWindow=1]="NewWindow",n[n.ReloadedWindow=3]="ReloadedWindow",n[n.ReopenedWindow=4]="ReopenedWindow"})($$||($$={}));var Us;(function(n){n[n.Starting=1]="Starting",n[n.Ready=2]="Ready",n[n.Restored=3]="Restored",n[n.Eventually=4]="Eventually"})(Us||(Us={}));function WRt(n){switch(n){case Us.Starting:return"Starting";case Us.Ready:return"Ready";case Us.Restored:return"Restored";case Us.Eventually:return"Eventually"}}var D3,hN;let $Ce=(hN=class extends ${get startupKind(){return this._startupKind}get phase(){return this._phase}constructor(e,t){super(),this.logService=e,this.storageService=t,this._onBeforeShutdown=this._register(new I),this.onBeforeShutdown=this._onBeforeShutdown.event,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this._onBeforeShutdownError=this._register(new I),this.onBeforeShutdownError=this._onBeforeShutdownError.event,this._onShutdownVeto=this._register(new I),this.onShutdownVeto=this._onShutdownVeto.event,this._phase=Us.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this.storageService.store(D3.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,ke.WORKSPACE,ln.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??$$.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);this.storageService.remove(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);let t;switch(e){case PI.RELOAD:t=$$.ReloadedWindow;break;case PI.LOAD:t=$$.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Cn.toKey(i.identifier)]=s)}return t}_readActivationEvents(e){if(typeof e.main>"u"&&typeof e.browser>"u")return[];const t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let i=0;ie)throw new Error(`ExtensionHostExtensions: invalid versionId ${e} (current: ${this._versionId})`);const s=[],o=[],r=[],a=[],c=VVe(this._allExtensions),l=VVe(t),d=(m,v)=>m.extensionLocation.toString()===v.extensionLocation.toString()||m.isBuiltin===v.isBuiltin||m.isUserBuiltin===v.isUserBuiltin||m.isUnderDevelopment===v.isUnderDevelopment;for(const m of this._allExtensions){const v=l.get(m.identifier);if(!v){s.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){s.push(m.identifier),c.delete(m.identifier);continue}}for(const m of t){const v=c.get(m.identifier);if(!v){o.push(m);continue}if(!d(v,m)){s.push(v.identifier),c.delete(v.identifier);continue}}const h=new $v(this._myExtensions),u=new $v(i);for(const m of this._myExtensions)u.has(m)||r.push(m);for(const m of i)h.has(m)||a.push(m);const f=QW.createActivationEventsMap(o),p={versionId:e,toRemove:s,toAdd:o,addActivationEvents:f,myToRemove:r,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:s,myToAdd:o}=e,r=new $v(t),a=new $v(s);for(let c=0;cG2.ID_PREFIX+e;let nte=G2;class VLt extends Pu{constructor(){super({id:"editor.gotoParentFold",label:g(Nu,12,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=gLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class zLt extends Pu{constructor(){super({id:"editor.gotoPreviousFold",label:g(Nu,13,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=fLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class $Lt extends Pu{constructor(){super({id:"editor.gotoNextFold",label:g(Nu,14,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=pLt(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class GLt extends Pu{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(Nu,15,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Comma),weight:ye.EditorContrib}})}invoke(e,t,i){const s=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(s.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:_d.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=Xp.sanitizeAndMerge(t.regions,s,i.getModel()?.getLineCount());t.updatePost(Xp.fromFoldRanges(r))}}}}class qLt extends Pu{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(Nu,16,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Period),weight:ye.EditorContrib}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}vn(Ox.ID,Ox,mi.Eager);Fe(LLt);Fe(TLt);Fe(RLt);Fe(NLt);Fe(HLt);Fe(ULt);Fe(PLt);Fe(FLt);Fe(OLt);Fe(BLt);Fe(WLt);Fe(MLt);Fe(VLt);Fe(zLt);Fe($Lt);Fe(GLt);Fe(qLt);for(let n=1;n<=7;n++)Lgt(new nte({id:nte.ID(n),label:g(Nu,17,"Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:jh,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.Digit0+n),weight:ye.EditorContrib}}));yt.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof P))throw Hi();const i=n.get(ht),s=n.get(Ai).getModel(t);if(!s)throw Hi();const o=n.get(Re);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(lo),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new fPe(s,r,c);let d=l;if(a!=="indentation"){const f=Ox.getFoldingRangeProviders(i,s);f.length&&(d=new pPe(s,f,()=>{},c,l))}const h=await d.compute(qe.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};n.openEditor(e,o)}}),_l({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(ste,3,"Configure Limit"),run:()=>s.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:nt.Warning})}function z$(n){return Qa(n?.editor)}function Xfe(n){const e=n;return z$(n)&&e?.group!==void 0}function HCe(n){const e=n;return typeof e?.groupId=="number"&&Qa(e.editor)}var mx;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.REPLACE=1]="REPLACE",n[n.MOVE=2]="MOVE",n[n.UNPIN=3]="UNPIN"})(mx||(mx={}));var qo;(function(n){n[n.GROUP_ACTIVE=0]="GROUP_ACTIVE",n[n.GROUP_INDEX=1]="GROUP_INDEX",n[n.GROUP_LABEL=2]="GROUP_LABEL",n[n.GROUP_LOCKED=3]="GROUP_LOCKED",n[n.EDITORS_SELECTION=4]="EDITORS_SELECTION",n[n.EDITOR_OPEN=5]="EDITOR_OPEN",n[n.EDITOR_CLOSE=6]="EDITOR_CLOSE",n[n.EDITOR_MOVE=7]="EDITOR_MOVE",n[n.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",n[n.EDITOR_LABEL=9]="EDITOR_LABEL",n[n.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",n[n.EDITOR_PIN=11]="EDITOR_PIN",n[n.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",n[n.EDITOR_STICKY=13]="EDITOR_STICKY",n[n.EDITOR_DIRTY=14]="EDITOR_DIRTY",n[n.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(qo||(qo={}));var go;(function(n){n[n.PRIMARY=1]="PRIMARY",n[n.SECONDARY=2]="SECONDARY",n[n.BOTH=3]="BOTH",n[n.ANY=4]="ANY"})(go||(go={}));class eTt{getOriginalUri(e,t){if(!e)return;if(Wb(e))return jc.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getOriginalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getOriginalUri(s,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=JLt(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return XLt(e)||LE(e)?{primary:e.primary,secondary:e.secondary}:EZe(e)||Gv(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Wb(e))return jc.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:s,secondary:o}=this.getSideEditors(e);if(s&&o){if(t?.supportSideBySide===go.BOTH)return{primary:this.getCanonicalUri(s,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===go.ANY)return this.getCanonicalUri(s,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===go.PRIMARY?s:o}}if(Gv(e)||V$(e)||LE(e)||Wb(e))return;const i=e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(i=>e.scheme===i))return e}else if(t===e.scheme)return e}}var gVe;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.KEYBOARD=1]="KEYBOARD",n[n.MOUSE=2]="MOUSE"})(gVe||(gVe={}));const jc=new eTt;var fVe;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(fVe||(fVe={}));class tTt{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(be);for(const[i,s]of this.editorSerializerConstructors)this.createEditorSerializer(i,s,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const s=i.createInstance(t);this.editorSerializerInstances.set(e,s)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return ws(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),Ee(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}it.add(zS.EditorFactory,new tTt);async function Zfe(n,e,t){return!n||!n.length?[]:await Promise.all(n.map(async i=>{const s=P.revive(i.fileUri);if(!s){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(s)){t.info("Cannot resolve the path because it cannot be handled",i);return}let r=i.exists,a=i.type;if(typeof r!="boolean"||typeof a!="number")try{a=(await e.stat(s)).isDirectory?an.Directory:an.Unknown,r=!0}catch(l){t.error(l),r=!1}if(!r&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===an.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:s,options:c}:{resource:s,options:c,forceUntitled:!0}}))}var eg;(function(n){n[n.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",n[n.SEQUENTIAL=1]="SEQUENTIAL"})(eg||(eg={}));function mPe(n){const e=n;if(!e)return!1;const t=e;if(t.modified)return mPe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function xZe(n,e,t){const i=pSt(n,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var Gw;const Si="vs/workbench/common/contextkeys";new Y("workbenchState",void 0,{type:"string",description:g(Si,0,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")});new Y("workspaceFolderCount",0,g(Si,1,"The number of root folders in the workspace"));new Y("openFolderWorkspaceSupport",!0,!0);new Y("enterMultiRootWorkspaceSupport",!0,!0);const iTt=new Y("emptyWorkspaceSupport",!0,!0);new Y("dirtyWorkingCopies",!1,g(Si,2,"Whether there are any working copies with unsaved changes"));new Y("remoteName","",g(Si,3,"The name of the remote the window is connected to or an empty string if not connected to any remote"));new Y("virtualWorkspace","",g(Si,4,"The scheme of the current workspace is from a virtual file system or an empty string."));const nTt=new Y("temporaryWorkspace",!1,g(Si,5,"The scheme of the current workspace is from a temporary file system."));new Y("isFullscreen",!1,g(Si,6,"Whether the main window is in fullscreen mode"));new Y("isAuxiliaryWindowFocusedContext",!1,g(Si,7,"Whether an auxiliary window is focused"));new Y("hasWebFileSystemAccess",!1,!0);new Y("embedderIdentifier",void 0,g(Si,8,"The identifier of the embedder according to the product service, if one is defined"));new Y("activeEditorIsDirty",!1,g(Si,9,"Whether the active editor has unsaved changes"));new Y("activeEditorIsNotPreview",!1,g(Si,10,"Whether the active editor is not in preview mode"));new Y("activeEditorIsFirstInGroup",!1,g(Si,11,"Whether the active editor is the first one in its group"));new Y("activeEditorIsLastInGroup",!1,g(Si,12,"Whether the active editor is the last one in its group"));new Y("activeEditorIsPinned",!1,g(Si,13,"Whether the active editor is pinned"));new Y("activeEditorIsReadonly",!1,g(Si,14,"Whether the active editor is read-only"));new Y("activeCompareEditorCanSwap",!1,g(Si,15,"Whether the active compare editor can swap sides"));const sTt=new Y("activeEditorCanToggleReadonly",!0,g(Si,16,"Whether the active editor can toggle between being read-only or writeable"));new Y("activeEditorCanRevert",!1,g(Si,17,"Whether the active editor can revert"));new Y("activeEditorCanSplitInGroup",!0);const DZe=new Y("activeEditor",null,{type:"string",description:g(Si,18,"The identifier of the active editor")});new Y("activeEditorAvailableEditorIds","",g(Si,19,"The available editor identifiers that are usable for the active editor"));new Y("textCompareEditorVisible",!1,g(Si,20,"Whether a text compare editor is visible"));const Vde=new Y("textCompareEditorActive",!1,g(Si,21,"Whether a text compare editor is active"));new Y("sideBySideEditorActive",!1,g(Si,22,"Whether a side by side editor is active"));new Y("groupEditorsCount",0,g(Si,23,"The number of opened editor groups"));new Y("activeEditorGroupEmpty",!1,g(Si,24,"Whether the active editor group is empty"));new Y("activeEditorGroupIndex",0,g(Si,25,"The index of the active editor group"));new Y("activeEditorGroupLast",!1,g(Si,26,"Whether the active editor group is the last group"));new Y("activeEditorGroupLocked",!1,g(Si,27,"Whether the active editor group is locked"));new Y("multipleEditorGroups",!1,g(Si,28,"Whether there are multiple editor groups opened"));new Y("multipleEditorsSelectedInGroup",!1,g(Si,29,"Whether multiple editors have been selected in an editor group"));new Y("twoEditorsSelectedInGroup",!1,g(Si,30,"Whether exactly two editors have been selected in an editor group"));new Y("editorPartMultipleEditorGroups",!1,g(Si,31,"Whether there are multiple editor groups opened in an editor part"));new Y("editorPartMaximizedEditorGroup",!1,g(Si,32,"Editor Part has a maximized group"));new Y("isAuxiliaryEditorPart",!1,g(Si,33,"Editor Part is in an auxiliary window"));new Y("editorIsOpen",!1,g(Si,34,"Whether an editor is open"));new Y("inZenMode",!1,g(Si,35,"Whether Zen mode is enabled"));new Y("isCenteredLayout",!1,g(Si,36,"Whether centered layout is enabled for the main editor"));new Y("splitEditorsVertically",!1,g(Si,37,"Whether editors split vertically"));new Y("mainEditorAreaVisible",!0,g(Si,38,"Whether the editor area in the main window is visible"));new Y("editorTabsVisible",!0,g(Si,39,"Whether editor tabs are visible"));new Y("sideBarVisible",!1,g(Si,40,"Whether the sidebar is visible"));new Y("sideBarFocus",!1,g(Si,41,"Whether the sidebar has keyboard focus"));new Y("activeViewlet","",g(Si,42,"The identifier of the active viewlet"));new Y("statusBarFocused",!1,g(Si,43,"Whether the status bar has keyboard focus"));new Y("titleBarStyle",jr?"native":"custom",g(Si,44,"Style of the window title bar"));new Y("titleBarVisible",!1,g(Si,45,"Whether the title bar is visible"));new Y("bannerFocused",!1,g(Si,46,"Whether the banner has keyboard focus"));new Y("notificationFocus",!0,g(Si,47,"Whether a notification has keyboard focus"));new Y("notificationCenterVisible",!1,g(Si,48,"Whether the notifications center is visible"));new Y("notificationToastsVisible",!1,g(Si,49,"Whether a notification toast is visible"));new Y("activeAuxiliary","",g(Si,50,"The identifier of the active auxiliary panel"));new Y("auxiliaryBarFocus",!1,g(Si,51,"Whether the auxiliary bar has keyboard focus"));new Y("auxiliaryBarVisible",!1,g(Si,52,"Whether the auxiliary bar is visible"));new Y("activePanel","",g(Si,53,"The identifier of the active panel"));new Y("panelFocus",!1,g(Si,54,"Whether the panel has keyboard focus"));new Y("panelPosition","bottom",g(Si,55,"The position of the panel, always 'bottom'"));new Y("panelAlignment","center",g(Si,56,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'"));new Y("panelVisible",!1,g(Si,57,"Whether the panel is visible"));new Y("panelMaximized",!1,g(Si,58,"Whether the panel is maximized"));const Tz=new Y("focusedView","",g(Si,59,"The identifier of the view that has keyboard focus"));var Gf;let O7=(Gf=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new Z,this._schemeKey=Gw.Scheme.bindTo(this._contextKeyService),this._filenameKey=Gw.Filename.bindTo(this._contextKeyService),this._dirnameKey=Gw.Dirname.bindTo(this._contextKeyService),this._pathKey=Gw.Path.bindTo(this._contextKeyService),this._langIdKey=Gw.LangId.bindTo(this._contextKeyService),this._resourceKey=Gw.Resource.bindTo(this._contextKeyService),this._extensionKey=Gw.Extension.bindTo(this._contextKeyService),this._hasResource=Gw.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Gw.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(s.onModelAdded(o=>{_n(o.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(o=>{_n(o.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}_setLangId(){const e=this.get();if(!e){this._langIdKey.set(null);return}const t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e=e??void 0,!_n(this._value,e)&&(this._value=e,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(e?e.toString():null),this._schemeKey.set(e?e.scheme:null),this._filenameKey.set(e?ui(e):null),this._dirnameKey.set(e?this.uriToPath(ma(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?uz(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.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}},Gw=Gf,Gf.Scheme=new Y("resourceScheme",void 0,{type:"string",description:g(Si,60,"The scheme of the resource")}),Gf.Filename=new Y("resourceFilename",void 0,{type:"string",description:g(Si,61,"The file name of the resource")}),Gf.Dirname=new Y("resourceDirname",void 0,{type:"string",description:g(Si,62,"The folder name the resource is contained in")}),Gf.Path=new Y("resourcePath",void 0,{type:"string",description:g(Si,63,"The full path of the resource")}),Gf.LangId=new Y("resourceLangId",void 0,{type:"string",description:g(Si,64,"The language identifier of the resource")}),Gf.Resource=new Y("resource",void 0,{type:"URI",description:g(Si,65,"The full value of the resource including scheme and path")}),Gf.Extension=new Y("resourceExtname",void 0,{type:"string",description:g(Si,66,"The extension name of the resource")}),Gf.HasResource=new Y("resourceSet",void 0,{type:"boolean",description:g(Si,67,"Whether a resource is present or not")}),Gf.IsFileSystemResource=new Y("isFileSystemResource",void 0,{type:"boolean",description:g(Si,68,"Whether the resource is backed by a file system provider")}),Gf);O7=Gw=D([_(0,Pe),_(1,ci),_(2,Di),_(3,Ai)],O7);function oTt(n,e){return n.invokeFunction(t=>Ov.getServiceDependencies(e).sort((i,s)=>i.index-s.index).map(i=>t.get(i.id)))}function _Pe(n){const e=n;return class extends e{constructor(...t){super(...t.slice(1),...oTt(t[0],n))}}}class vPe{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}class pVe{constructor(e){this.identifier=e}}const zde=ae("treeViewsDndService");ce(zde,vPe,Yt.Delayed);const kZe=ae("extensionHostDebugService"),rTt="diagnosticsService";class aTt{async getPerformanceInfo(e,t){return{}}async getSystemInfo(e,t){return{processArgs:"nullProcessArgs",gpuStatus:"nullGpuStatus",screenReader:"nullScreenReader",remoteData:[],os:"nullOs",memory:"nullMemory",vmHint:"nullVmHint"}}async getDiagnostics(e,t){return""}async getWorkspaceFileExtensions(e){return{extensions:[]}}async reportWorkspaceStats(e){}}const cTt=ae(rTt),wPe=ae("downloadService"),lTt=ae("encryptionService"),aL=ae("extensionGalleryService"),Rz=ae("extensionManagementService"),IZe=ae("IGlobalExtensionEnablementService"),dTt=ae("IExtensionTipsService"),B7=ae("IExtensionStorageService"),$de=ae("IExtensionsProfileScannerService"),hTt=ae("IExtensionsScannerService"),uTt=ae("IExtensionRecommendationNotificationService"),bPe=ae("extensionResourceLoaderService"),gTt=ae("IBuiltinExtensionsScannerService"),fTt=ae("keyboardLayoutService"),LZe=ae("languagePackService");class TZe{constructor(){this.onDidChange=T.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Ja=ae("productService"),rA=ae("remoteAuthorityResolverService"),Gde=ae("IRemoteExtensionsScannerService"),CPe=ae("remoteSocketFactoryService"),EQ=ae("requestService"),RZe=ae("secretStorageService"),pTt="signService",MZe=ae(pTt);let qde=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class mTt{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const _Tt="extensionTelemetryLog";function EJ(n,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!n.enableTelemetry)}function yPe(n,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||n.enableTelemetry&&n.aiConfig?.ariaKey)}function vTt(n){const e=n.getValue(xJe),t=n.getValue(txt);if(n.getValue(DJe)===!1||t===!1)return sp.NONE;switch(e??LT.ON){case LT.ON:return sp.USAGE;case LT.ERROR:return sp.ERROR;case LT.CRASH:return sp.CRASH;case LT.OFF:return sp.NONE}}const wTt=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function bTt(n){if(!n)return"none";const e=Wde(n);return wTt.has(e)?e:"other"}function CTt(n,e){if(!n||!n.includes("/")&&!n.includes("\\"))return n;let t=n;const i=[];for(const a of e)for(;;){const c=a.exec(n);if(!c)break;i.push([c.index,a.lastIndex])}const s=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(n);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return n}function mVe(n,e){return AU(n,t=>{if(t instanceof qde||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=CTt(i,e);for(const s of e)i=i.replace(s,"");return i=yTt(i),i}})}var _Ve;(function(n){n.AutomationProfile="terminal.integrated.automationProfile.",n.DefaultProfile="terminal.integrated.defaultProfile.",n.Profiles="terminal.integrated.profiles."})(_Ve||(_Ve={}));var _y;(function(n){n.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",n.AutomationProfileLinux="terminal.integrated.automationProfile.linux",n.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",n.AutomationProfileWindows="terminal.integrated.automationProfile.windows",n.ProfilesWindows="terminal.integrated.profiles.windows",n.ProfilesMacOs="terminal.integrated.profiles.osx",n.ProfilesLinux="terminal.integrated.profiles.linux",n.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",n.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",n.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",n.UseWslProfiles="terminal.integrated.useWslProfiles",n.TabsDefaultColor="terminal.integrated.tabs.defaultColor",n.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",n.TabsEnabled="terminal.integrated.tabs.enabled",n.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",n.TabsHideCondition="terminal.integrated.tabs.hideCondition",n.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",n.TabsShowActions="terminal.integrated.tabs.showActions",n.TabsLocation="terminal.integrated.tabs.location",n.TabsFocusMode="terminal.integrated.tabs.focusMode",n.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",n.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",n.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",n.CopyOnSelection="terminal.integrated.copyOnSelection",n.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",n.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",n.FontFamily="terminal.integrated.fontFamily",n.FontSize="terminal.integrated.fontSize",n.LetterSpacing="terminal.integrated.letterSpacing",n.LineHeight="terminal.integrated.lineHeight",n.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",n.TabStopWidth="terminal.integrated.tabStopWidth",n.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",n.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",n.BellDuration="terminal.integrated.bellDuration",n.FontWeight="terminal.integrated.fontWeight",n.FontWeightBold="terminal.integrated.fontWeightBold",n.CursorBlinking="terminal.integrated.cursorBlinking",n.CursorStyle="terminal.integrated.cursorStyle",n.CursorStyleInactive="terminal.integrated.cursorStyleInactive",n.CursorWidth="terminal.integrated.cursorWidth",n.Scrollback="terminal.integrated.scrollback",n.DetectLocale="terminal.integrated.detectLocale",n.DefaultLocation="terminal.integrated.defaultLocation",n.GpuAcceleration="terminal.integrated.gpuAcceleration",n.TerminalTitleSeparator="terminal.integrated.tabs.separator",n.TerminalTitle="terminal.integrated.tabs.title",n.TerminalDescription="terminal.integrated.tabs.description",n.RightClickBehavior="terminal.integrated.rightClickBehavior",n.MiddleClickBehavior="terminal.integrated.middleClickBehavior",n.Cwd="terminal.integrated.cwd",n.ConfirmOnExit="terminal.integrated.confirmOnExit",n.ConfirmOnKill="terminal.integrated.confirmOnKill",n.EnableBell="terminal.integrated.enableBell",n.EnableVisualBell="terminal.integrated.enableVisualBell",n.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",n.AllowChords="terminal.integrated.allowChords",n.AllowMnemonics="terminal.integrated.allowMnemonics",n.TabFocusMode="terminal.integrated.tabFocusMode",n.EnvMacOs="terminal.integrated.env.osx",n.EnvLinux="terminal.integrated.env.linux",n.EnvWindows="terminal.integrated.env.windows",n.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",n.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",n.ShowExitAlert="terminal.integrated.showExitAlert",n.SplitCwd="terminal.integrated.splitCwd",n.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",n.WordSeparators="terminal.integrated.wordSeparators",n.EnableFileLinks="terminal.integrated.enableFileLinks",n.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",n.UnicodeVersion="terminal.integrated.unicodeVersion",n.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",n.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",n.HideOnStartup="terminal.integrated.hideOnStartup",n.CustomGlyphs="terminal.integrated.customGlyphs",n.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",n.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",n.InheritEnv="terminal.integrated.inheritEnv",n.ShowLinkHover="terminal.integrated.showLinkHover",n.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",n.AutoReplies="terminal.integrated.autoReplies",n.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",n.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",n.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",n.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",n.EnableImages="terminal.integrated.enableImages",n.SmoothScrolling="terminal.integrated.smoothScrolling",n.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",n.FocusAfterRun="terminal.integrated.focusAfterRun",n.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",n.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",n.DevMode="terminal.integrated.developer.devMode"})(_y||(_y={}));var vVe;(function(n){n.PowerShell="pwsh",n.Bash="bash",n.Fish="fish",n.Sh="sh",n.Csh="csh",n.Ksh="ksh",n.Zsh="zsh",n.Python="python"})(vVe||(vVe={}));var wVe;(function(n){n.CommandPrompt="cmd",n.PowerShell="pwsh",n.Wsl="wsl",n.GitBash="gitbash",n.Python="python"})(wVe||(wVe={}));var bVe;(function(n){n[n.Api=0]="Api",n[n.Process=1]="Process",n[n.Sequence=2]="Sequence",n[n.Config=3]="Config"})(bVe||(bVe={}));var jf;(function(n){n.Cwd="cwd",n.InitialCwd="initialCwd",n.FixedDimensions="fixedDimensions",n.Title="title",n.ShellType="shellType",n.HasChildProcesses="hasChildProcesses",n.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",n.OverrideDimensions="overrideDimensions",n.FailedShellIntegrationActivation="failedShellIntegrationActivation",n.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(jf||(jf={}));var fV;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(fV||(fV={}));var CVe;(function(n){n.TerminalView="view",n.Editor="editor"})(CVe||(CVe={}));var yVe;(function(n){n[n.HighWatermarkChars=1e5]="HighWatermarkChars",n[n.LowWatermarkChars=5e3]="LowWatermarkChars",n[n.CharCountAckSize=5e3]="CharCountAckSize"})(yVe||(yVe={}));var SVe;(function(n){n[n.Off=0]="Off",n[n.FinalTerm=1]="FinalTerm",n[n.VSCode=2]="VSCode"})(SVe||(SVe={}));var vM;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(vM||(vM={}));const STt={Backend:"workbench.contributions.terminal.processBackend"};function UCe(n){return n?.toLowerCase()??""}class ATt{constructor(e){this.remoteAuthority=e}affects(e){return UCe(e)===this.remoteAuthority}}class ETt{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=UCe(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new ATt(t))}getTerminalBackend(e){return this._backends.get(UCe(e))}}it.add(STt.Backend,new ETt);const xTt=ae("terminalLogService"),Qde=ae("tunnelService");var tb;(function(n){n.Uninitialized="uninitialized",n.Idle="idle",n.Disabled="disabled",n.CheckingForUpdates="checking for updates",n.AvailableForDownload="available for download",n.Downloading="downloading",n.Downloaded="downloaded",n.Updating="updating",n.Ready="ready"})(tb||(tb={}));var AVe;(function(n){n[n.Setup=0]="Setup",n[n.Archive=1]="Archive",n[n.Snap=2]="Snap"})(AVe||(AVe={}));var EVe;(function(n){n[n.NotBuilt=0]="NotBuilt",n[n.DisabledByEnvironment=1]="DisabledByEnvironment",n[n.ManuallyDisabled=2]="ManuallyDisabled",n[n.MissingConfiguration=3]="MissingConfiguration",n[n.InvalidConfiguration=4]="InvalidConfiguration",n[n.RunningAsAdmin=5]="RunningAsAdmin"})(EVe||(EVe={}));const DTt={Uninitialized:{type:tb.Uninitialized},Disabled:n=>({type:tb.Disabled,reason:n}),Idle:(n,e)=>({type:tb.Idle,updateType:n,error:e}),CheckingForUpdates:n=>({type:tb.CheckingForUpdates,explicit:n}),AvailableForDownload:n=>({type:tb.AvailableForDownload,update:n}),Downloading:{type:tb.Downloading},Downloaded:n=>({type:tb.Downloaded,update:n}),Updating:n=>({type:tb.Updating,update:n}),Ready:n=>({type:tb.Ready,update:n})},NZe=ae("updateService");var xVe;let epe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const b5=void 0;class MT{constructor(e,t=2**16){this.comparator=e,this[xVe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new epe(this._maxLevel,b5,b5)}get size(){return this._size}clear(){this._header=new epe(this._maxLevel,b5,b5),this._size=0}has(e){return!!MT._search(this,e,this.comparator)}get(e){return MT._search(this,e,this.comparator)?.value}set(e,t){return MT._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=MT._delete(this,e,this.comparator);return t&&(this._size-=1),t}forEach(e,t){let i=this._header.forward[0];for(;i;)e.call(t,i.value,i.key,this),i=i.forward[0]}[(xVe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this._header.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this._header.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this._header.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",t=this._header.forward[0];for(;t;)e+=`node(${t.key}, ${t.value}, lvl:${t.level})`,t=t.forward[0];return e}static _search(e,t,i){let s=e._header;for(let o=e._level-1;o>=0;o--)for(;s.forward[o]&&i(s.forward[o].key,t)<0;)s=s.forward[o];if(s=s.forward[0],s&&i(s.key,t)===0)return s}static _insert(e,t,i,s){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&s(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&s(r.key,t)===0)return r.value=i,!1;{const a=MT._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;r--){for(;o.forward[r]&&i(o.forward[r].key,t)<0;)o=o.forward[r];s[r]=o}if(o=o.forward[0],!o||i(o.key,t)!==0)return!1;for(let r=0;r0&&e._header.forward[e._level-1]===b5;)e._level-=1;return!0}}const t9=class t9{constructor(e){this.uri=e,this.time=t9._clock++}touch(){return this.time=t9._clock++,this}};t9._clock=0;let rte=t9,VCe=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=s=>{let o=t.get(s.scheme);return o===void 0&&(o=e.hasProvider(s)&&!this._fileService.hasCapability(s,es.PathCaseSensitive),t.set(s.scheme,o)),o};this._dispooables.add(T.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(s=>{t.delete(s.scheme)})),this.extUri=new cO(i),this._canonicalUris=new MT((s,o)=>this.extUri.compare(s,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=jQe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new rte(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].times[1].time?-1:0);rte._clock=0,this._canonicalUris.clear();const t=this._limit*.5;for(let i=0;ie.accessor.dispose()),this._entries.clear(),this._onDidChange.dispose()}setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=ZYe(o),r){const C=typeof r=="string"?r:r.value;f+=`, ${C}`}let m;switch(l?.id){case RVe:case jTt:m=l.id===RVe?"error":"warning",c=void 0,l=void 0}const v={name:s,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let w=d?W7.LEFT:W7.RIGHT;const b=this._entries.get(e);if(b&&(w=b.alignment,h=b.priority),b)return b.accessor.update(v),b.entry=v,H7.DidUpdate;{let C;typeof i=="string"?C={primary:h,secondary:Ed(i)}:C=h;const y=this._statusbarService.addEntry(v,t,w,C);return this._entries.set(e,{accessor:y,entry:v,alignment:w,priority:h,disposable:Ee(()=>{y.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:w,priority:h}]}),H7.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};zCe=D([_(0,EPe)],zCe);ce(xPe,zCe,Yt.Delayed);const eRt=ae("IEditorBreadcrumbsService"),rI=new Tn(220,70),cte=new Tn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Kde={showTabs:"multiple",highlightModifiedTabs:!1,tabActionLocation:"right",tabActionCloseVisibility:!0,tabActionUnpinVisibility:!0,alwaysShowEditorActions:!1,tabSizing:"fit",tabSizingFixedMinWidth:50,tabSizingFixedMaxWidth:160,pinnedTabSizing:"normal",pinnedTabsOnSeparateRow:!1,tabHeight:"default",preventPinnedEditorClose:"keyboardAndMouse",titleScrollbarSizing:"default",focusRecentEditorAfterClose:!0,showIcons:!0,hasIcons:!0,enablePreview:!0,openPositioning:"right",openSideBySideDirection:"right",closeEmptyGroups:!0,labelFormat:"default",splitSizing:"auto",splitOnDragAndDrop:!0,dragToOpenWindow:!0,centeredLayoutFixedWidth:!1,doubleClickTabToToggleEditorGroupSizes:"expand",editorActionsLocation:"default",wrapTabs:!1,enablePreviewFromQuickOpen:!1,scrollToSwitchTabs:!1,enablePreviewFromCodeNavigation:!1,closeOnFileDelete:!1,mouseBackForwardToNavigate:!0,restoreViewState:!0,splitInGroupLayout:"horizontal",revealIfOpen:!1,get limit(){return{enabled:!1,value:10,perEditorGroup:!1,excludeDirty:!1}},get decorations(){return{badges:!0,colors:!0}},get autoLockGroups(){return new Set}},z_=ae("viewDescriptorService"),Tw=ae("accessibleViewService"),lL=ae("chatWidgetService"),tRt=ae("quickChatService"),BZe=ae("chatAccessibilityService"),iRt=ae("chatCodeBlockContextProviderService"),yp=ae("chatAgentService"),Yde=ae("chatAgentNameService"),Rw=ae("IChatService"),DPe=ae("chatSlashCommandService"),Mz=ae("IChatVariablesService"),WZe=ae("IChatWidgetHistoryService"),HZe=ae("ILanguageModelsService"),sD=ae("commentService"),kPe=ae("customEditorService"),IPe=ae("debugService"),UZe=ae("debugVisualizerService"),nRt=ae("IEditSessionsStorageService"),sRt=ae("IEditSessionsLogService"),pr=ae("extensionsWorkbenchService"),VZe=ae("externalUriOpenerService"),Sp=ae("explorerService"),zZe=ae("IInlineChatSavingService "),LPe=ae("IInlineChatSessionService"),TPe=ae("IInteractiveDocumentService"),$Ze=ae("IInteractiveHistoryService"),oRt=ae("IDefaultLogLevelsService"),GZe=ae("multiDiffSourceResolverService"),xQ=ae("INotebookEditorWidgetService"),qZe=ae("notebookCellStatusBarService"),Jde=ae("INotebookModelResolverService"),rRt=ae("INotebookExecutionService"),QZe=ae("INotebookExecutionStateService"),jZe=ae("INotebookKernelService"),aRt=ae("INotebookKernelHistoryService"),cRt=ae("notebookKeymapService"),lRt=ae("INotebookLoggingService"),KZe=ae("INotebookRendererMessagingService"),oD=ae("notebookService"),dRt="notebookEditorWorkerService",hRt=ae(dRt),uRt=ae("outputChannelModelService"),gRt=ae("preferencesSearchService"),DQ=ae("quickDiff"),RPe=ae("scm"),YZe=ae("scmView"),fRt=ae("replaceService"),pRt=ae("searchViewModelWorkbenchService"),mRt=ae("notebookSearchService"),_Rt=ae("searchHistoryService"),JZe=ae("shareService"),$_=ae("snippetService"),Xde=ae("speechService");class vRt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const wRt=ae("workspaceTagsService"),XZe=ae("taskService"),Nz=ae("terminalService"),bRt=ae("terminalConfigurationService"),ZZe=ae("terminalEditorService"),MPe=ae("terminalGroupService"),eet=ae("terminalInstanceService"),tet=ae("environmentVariableService"),iet=ae("terminalProfileResolverService"),net=ae("terminalProfileService"),CRt=ae("terminalContributionsService"),set=ae("terminalLinkProviderService"),oet=ae("terminalQuickFixService"),yRt=ae("testCoverageService"),SRt=ae("testingFilterState"),ret=ae("testProfileService"),aet=ae("testResultService"),ARt=ae("ITestResultStorage"),cet=ae("testService"),ERt=ae("testingContinuousRunService"),xRt=ae("testingDecorationService"),DRt=ae("testingPeekOpener"),kRt="timeline",det=ae(kRt),Zde=ae("webviewService"),kQ=ae("webviewEditorService"),het=ae("webviewViewService"),IRt=ae("walkthroughsService"),LRt=ae("activityService"),uet=ae("IAiEmbeddingVectorService"),NPe=ae("IAiRelatedInformationService"),get=ae("WorkbenchAssignmentService"),ehe=ae("IAuthenticationAccessService"),fet=ae("IAuthenticationUsageService"),PPe=ae("IAuthenticationService"),pet=ae("IAuthenticationExtensionsService"),met=ae("auxiliaryWindowService"),TRt=ae("bannerService"),dL=ae("jsonEditingService"),_et=ae("configurationResolverService"),rD=ae("IFileDecorationsService"),aD=ae("ICustomEditorLabelService"),ur=ae("editorGroupsService"),vet=ae("editorPaneService"),Pz=ae("editorResolverService"),_i=ae("editorService"),Fz=ae("IExtensionBisectService"),wet=ae("IExtensionFeaturesManagementService"),RRt=Rz,Mw=ae("extensionManagementServerService"),the=RRt,Kh=ae("extensionEnablementService"),FPe=ae("IWebExtensionsScannerService"),bet=ae("extensionRecommendationsService"),ihe=ae("IExtensionIgnoredRecommendationsService"),MRt=ae("IWorkspaceExtensionsConfigService"),Cet=ae("extensionUrlHandler"),G_=ae("extensionManifestPropertiesService"),ho=ae("extensionService"),IQ=ae("elevatedFileService"),hh=ae("filesConfigurationService"),NRt=ae("historyService"),Id=ae("hostService"),PRt=ae("ITroubleshootIssueService"),FRt=ae("workbenchIssueService");class ORt{constructor(e,t){this._mapAltGrToCtrlAlt=e,this._OS=t}dumpDebugInfo(){return"FallbackKeyboardMapper dispatching on keyCode"}resolveKeyboardEvent(e){const t=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,i=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,s=new RS(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new l$([s]))[0]}resolveKeybinding(e){return XU.resolveKeybinding(e,this._OS)}}const BRt=ae("keybindingEditingService"),LQ=ae("ILanguageDetectionService"),OPe=ae("ILanguageStatusService"),mg=ae("lifecycleService");var PI;(function(n){n[n.CLOSE=1]="CLOSE",n[n.QUIT=2]="QUIT",n[n.RELOAD=3]="RELOAD",n[n.LOAD=4]="LOAD"})(PI||(PI={}));var $$;(function(n){n[n.NewWindow=1]="NewWindow",n[n.ReloadedWindow=3]="ReloadedWindow",n[n.ReopenedWindow=4]="ReopenedWindow"})($$||($$={}));var Us;(function(n){n[n.Starting=1]="Starting",n[n.Ready=2]="Ready",n[n.Restored=3]="Restored",n[n.Eventually=4]="Eventually"})(Us||(Us={}));function WRt(n){switch(n){case Us.Starting:return"Starting";case Us.Ready:return"Ready";case Us.Restored:return"Restored";case Us.Eventually:return"Eventually"}}var D3,hN;let $Ce=(hN=class extends ${get startupKind(){return this._startupKind}get phase(){return this._phase}constructor(e,t){super(),this.logService=e,this.storageService=t,this._onBeforeShutdown=this._register(new I),this.onBeforeShutdown=this._onBeforeShutdown.event,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this._onBeforeShutdownError=this._register(new I),this.onBeforeShutdownError=this._onBeforeShutdownError.event,this._onShutdownVeto=this._register(new I),this.onShutdownVeto=this._onShutdownVeto.event,this._phase=Us.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this.storageService.store(D3.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,ke.WORKSPACE,ln.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??$$.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);this.storageService.remove(D3.LAST_SHUTDOWN_REASON_KEY,ke.WORKSPACE);let t;switch(e){case PI.RELOAD:t=$$.ReloadedWindow;break;case PI.LOAD:t=$$.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Cn.toKey(i.identifier)]=s)}return t}_readActivationEvents(e){if(typeof e.main>"u"&&typeof e.browser>"u")return[];const t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let i=0;ie)throw new Error(`ExtensionHostExtensions: invalid versionId ${e} (current: ${this._versionId})`);const s=[],o=[],r=[],a=[],c=VVe(this._allExtensions),l=VVe(t),d=(m,v)=>m.extensionLocation.toString()===v.extensionLocation.toString()||m.isBuiltin===v.isBuiltin||m.isUserBuiltin===v.isUserBuiltin||m.isUnderDevelopment===v.isUnderDevelopment;for(const m of this._allExtensions){const v=l.get(m.identifier);if(!v){s.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){s.push(m.identifier),c.delete(m.identifier);continue}}for(const m of t){const v=c.get(m.identifier);if(!v){o.push(m);continue}if(!d(v,m)){s.push(v.identifier),c.delete(v.identifier);continue}}const h=new $v(this._myExtensions),u=new $v(i);for(const m of this._myExtensions)u.has(m)||r.push(m);for(const m of i)h.has(m)||a.push(m);const f=QW.createActivationEventsMap(o),p={versionId:e,toRemove:s,toAdd:o,addActivationEvents:f,myToRemove:r,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:s,myToAdd:o}=e,r=new $v(t),a=new $v(s);for(let c=0;csetTimeout(e,n))}function bMt(n,e,t){let i=Promise.resolve(),s=null;return async o=>{s==null?(s=o,i=i.then(async()=>wMt(t)).then(async()=>{const r=s;s=null,await n(r)})):s=e(s,o),await i}}var AK;ce(wp,class extends IYe{constructor(){super(Pn.Info,P.file("logs.log"))}doCreateLogger(){return new LYe}},0);ce(_i,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=T.None,this.onDidActiveEditorChange=T.None,this.onDidVisibleEditorsChange=T.None,this.onDidEditorsChange=T.None,this.onDidCloseEditor=T.None,this.activeEditorPane=void 0,this.activeEditor=void 0,this.activeTextEditorLanguageId=void 0,this.visibleEditorPanes=[],this.visibleEditors=[],this.visibleTextEditorControls=[],this.editors=[],this.count=0,this.getEditors=()=>[],this.openEditor=A,this.openEditors=A,this.replaceEditors=async()=>{},this.isOpened=()=>!1,this.isVisible=()=>!1,this.closeEditor=async()=>{},this.closeEditors=async()=>{},this.findEditors=()=>[],this.save=async()=>({success:!1,editors:[]}),this.saveAll=async()=>({success:!1,editors:[]}),this.revert=async()=>!1,this.revertAll=async()=>!1}get activeTextEditorControl(){return Lt.get(Qt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Nw,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=T.None,this.onDidPaneCompositeClose=T.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=A,this.showActivity=()=>$.None}},0);ce(_o,VCe,1);ce(tr,class{constructor(){this.isDirty=A,this.save=A,this.saveAs=A,this.revert=A,this.read=A,this.readStream=A,this.write=A,this.create=A,this.getEncodedReadable=A,this.getDecodedStream=A,this.dispose=A}get files(){return A()}get untitled(){return A()}get encoding(){return A()}},0);ce(ci,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=T.None,this.onDidChangeFileSystemProviderCapabilities=T.None,this.onWillActivateFileSystemProvider=T.None,this.registerProvider=A,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=T.None,this.onDidRunOperation=T.None,this.resolve=A,this.resolveAll=A,this.stat=A,this.exists=async()=>!1,this.readFile=A,this.readFileStream=A,this.writeFile=A,this.move=A,this.canMove=A,this.copy=A,this.canCopy=A,this.cloneFile=A,this.createFile=A,this.canCreateFile=A,this.createFolder=A,this.del=A,this.canDelete=A,this.onDidWatchError=T.None,this.watch=A,this.createWatcher=A}dispose(){}},0);let CMt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=A,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=A,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=A,this.notifyIndexChanged=A,this.relayout=A,this.dispose=A,this.toJSON=A,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=A,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=A,this.openEditor=A,this.openEditors=A,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=A,this.moveEditors=A,this.copyEditor=A,this.copyEditors=A,this.closeEditor=A,this.closeEditors=A,this.closeAllEditors=A,this.replaceEditors=A,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=A,this.isLast=A}get groupsView(){return A()}notifyLabelChanged(){}get titleHeight(){return A()}get element(){return A()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}};const dte=new CMt;let yMt=class{constructor(){this.windowId=yi.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=A,this.isLayoutCentered=A,this.enforcePartOptions=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.applyLayout=A,this.getLayout=A,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=A}get contentDimension(){return A()}get sideGroup(){return A()}},SMt=class{constructor(){this.registerContextKeyProvider=A,this.saveWorkingSet=A,this.getWorkingSets=A,this.applyWorkingSet=A,this.deleteWorkingSet=A,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new yMt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=A,this.createAuxiliaryEditorPart=A,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.partOptions=Kde,this.createEditorDropTarget=A,this._serviceBrand=void 0,this.getLayout=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.applyLayout=A,this.centerLayout=A,this.isLayoutCentered=()=>!1,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=A}get contentDimension(){return A()}get sideGroup(){return A()}};ce(ur,SMt,0);ce(TRt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(zRt,class{constructor(){this.getPart=A,this.createAuxiliaryTitlebarPart=A,this.dispose=A,this.onMenubarVisibilityChange=T.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=T.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(fC,class{constructor(){this.onWillRunWorkingCopyFileOperation=T.None,this.onDidFailWorkingCopyFileOperation=T.None,this.onDidRunWorkingCopyFileOperation=T.None,this.addFileOperationParticipant=A,this.hasSaveParticipants=!1,this.addSaveParticipant=A,this.runSaveParticipants=A,this.create=A,this.createFolder=A,this.move=A,this.copy=A,this.delete=A,this.registerWorkingCopyProvider=A,this.getDirty=()=>[]}},0);ce(Lm,class{constructor(){this.defaultUriScheme="file",this.fileURI=A,this.userHome=A,this.hasValidBasename=A,this.resolvedUserHome=void 0}get path(){return A()}},1);ce(Ja,class{constructor(){this._serviceBrand=void 0,this.version="1.90.2",this.commit="5437499feb04f7a586f677b155b039bc2b3669eb",this.quality="oss",this.nameShort="Code - OSS Dev",this.nameLong="Code - OSS Dev",this.applicationName="code-oss",this.dataFolderName=".vscode-oss",this.urlProtocol="code-oss",this.reportIssueUrl="https://github.com/microsoft/vscode/issues/new",this.licenseName="MIT",this.licenseUrl="https://github.com/microsoft/vscode/blob/main/LICENSE.txt",this.serverApplicationName="code-server-oss"}},0);ce(dTt,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(OPe,class{constructor(){this.onDidChange=T.None,this.addStatus=A,this.getLanguageStatus=A}},1);ce(Id,class{constructor(){this.onDidChangeFullScreen=T.None,this.onDidChangeFocus=T.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=A,this.onDidChangeActiveWindow=T.None,this.openWindow=A,this.toggleFullScreen=A,this.moveTop=A,this.getCursorScreenPoint=A,this.restart=A,this.reload=A,this.close=A,this.withExpectedShutdown=A}},0);ce(mg,class extends $Ce{constructor(){super(...arguments),this.shutdown=A}},0);ce(LQ,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(ho,dMt,0);ce(fTt,class{constructor(){this.onDidChangeKeyboardLayout=T.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new ORt(!1,zc),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(ahe,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(xet,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=T.None}},0);let GCe=class{constructor(e){this.profileService=e,this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=A,this.createPreferencesEditorModel=A,this.resolveModel=A,this.createSettings2EditorModel=A,this.openRawDefaultSettings=A,this.openSettings=A,this.openUserSettings=A,this.openRemoteSettings=A,this.openWorkspaceSettings=A,this.openFolderSettings=A,this.openGlobalKeybindingSettings=A,this.openDefaultKeybindingsFile=A,this.getEditableSettingsURI=A,this.createSplitJsonEditorInput=A,this.openApplicationSettings=A,this.openLanguageSpecificSettings=A}};GCe=D([_(0,Tm)],GCe);ce(TQ,GCe,0);ce(VRt,class{constructor(){this.onDidEncounterLanguage=T.None,this.createGrammar=A,this.startDebugMode=A,this.createTokenizer=A}},0);let qCe=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=T.None,this.isEnabled=()=>!1,this.createNamedProfile=A,this.createTransientProfile=A,this.resetWorkspaces=A,this.cleanUp=A,this.cleanUpTransientProfiles=A,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=T.None,this.profiles=[this.profileService.currentProfile],this.createProfile=A,this.updateProfile=A,this.setProfileForWorkspace=A,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=A}get profilesHome(){return A()}};qCe=D([_(0,Tm)],qCe);ce(V_,qCe,0);ce(uMt,class{constructor(){this.onDidChange=T.None,this.readStorageData=A,this.updateStorageData=A,this.withProfileScopedStorageService=A}},0);let QCe=class extends KRt{constructor(e){super({...S3("__default__profile__","Default",e.userRoamingDataHome,qt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};QCe=D([_(0,Il)],QCe);ce(Tm,QCe,0);ce(sPe,TZe,0);ce($_,class{constructor(){this.getSnippetFiles=A,this.isEnabled=A,this.updateEnablement=A,this.updateUsageTimestamp=A,this.getSnippets=async()=>[],this.getSnippetsSync=A}},0);const AMt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:T.None,onDidChangeCallStack:T.None,onDidChangeWatchExpressions:T.None,fetchCallstack:A,getId:A,registerBreakpointModes:A,getBreakpointModes:()=>[]};class EMt{constructor(){this.setVisualizedExpression=A,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=T.None,this.getId=A,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=A,this.setSelectedExpression=A,this.updateViews=A,this.isMultiSessionView=A,this.onDidFocusSession=T.None,this.onDidFocusStackFrame=T.None,this.onDidSelectExpression=T.None,this.onDidEvaluateLazyExpression=T.None,this.onWillUpdateViews=T.None,this.onDidFocusThread=T.None,this.evaluateLazyExpression=A}}class xMt{constructor(){this.onDidRegisterDebugger=T.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=A,this.getDebuggerLabel=A,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=A,this.registerDebugAdapterFactory=()=>$.None,this.createDebugAdapter=A,this.registerDebugAdapterDescriptorFactory=A,this.unregisterDebugAdapterDescriptorFactory=A,this.substituteVariables=A,this.runInTerminal=A,this.getEnabledDebugger=A,this.guessDebugger=A,this.onDidDebuggersExtPointRead=T.None}}ce(IPe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=A,this.updateDataBreakpoint=A,this.onDidChangeState=T.None,this.onDidNewSession=T.None,this.onWillNewSession=T.None,this.onDidEndSession=T.None,this.getConfigurationManager=A,this.getAdapterManager=()=>new xMt,this.focusStackFrame=A,this.canSetBreakpointsIn=A,this.addBreakpoints=A,this.updateBreakpoints=A,this.enableOrDisableBreakpoints=A,this.setBreakpointsActivated=A,this.removeBreakpoints=A,this.addFunctionBreakpoint=A,this.updateFunctionBreakpoint=A,this.removeFunctionBreakpoints=A,this.addDataBreakpoint=A,this.removeDataBreakpoints=A,this.addInstructionBreakpoint=A,this.removeInstructionBreakpoints=A,this.setExceptionBreakpointCondition=A,this.setExceptionBreakpointsForSession=A,this.sendAllBreakpoints=A,this.addWatchExpression=A,this.renameWatchExpression=A,this.moveWatchExpression=A,this.removeWatchExpressions=A,this.startDebugging=A,this.restartSession=A,this.stopSession=A,this.sourceIsNotAvailable=A,this.getModel=()=>AMt,this.getViewModel=()=>new EMt,this.runTo=A}get state(){return A()}},0);ce(EQ,class{constructor(){this.request=A,this.resolveProxy=A,this.loadCertificates=A}},0);ce(Ade,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=T.None,this.completeOpenFilesTrustRequest=A,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=A,this.completeWorkspaceTrustRequest=A,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(LRt,class{constructor(){this.onDidChangeActivity=T.None,this.getViewContainerActivities=A,this.getActivity=A,this.showViewContainerActivity=()=>$.None,this.showViewActivity=()=>$.None,this.showAccountsActivity=()=>$.None,this.showGlobalActivity=()=>$.None}},0);ce(kZe,class{constructor(){this.reload=A,this.onReload=T.None,this.close=A,this.onClose=T.None,this.attachSession=A,this.onAttachSession=T.None,this.terminateSession=A,this.onTerminateSession=T.None,this.openExtensionDevelopmentHostWindow=A}},0);ce(q_,class{constructor(){this.getFocusedViewName=A,this.onDidChangeFocusedView=T.None,this.onDidChangeViewContainerVisibility=T.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=A,this.closeViewContainer=A,this.getVisibleViewContainer=A,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=T.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=A,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(z_,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=T.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=A,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=A,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:T.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=T.None,this.moveViewContainerToLocation=A,this.getViewContainerBadgeEnablementState=A,this.setViewContainerBadgeEnablementState=A,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=T.None,this.moveViewsToContainer=A,this.onDidChangeLocation=T.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(NRt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=A,this.goBack=A,this.goPrevious=A,this.goLast=A,this.reopenLastClosedEditor=A,this.getHistory=()=>[],this.removeFromHistory=A,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=A,this.openPreviouslyUsedEditor=A,this.clear=A,this.clearRecentlyOpened=A}},0);ce(XZe,class{constructor(){this.onDidChangeTaskConfig=T.None,this.onDidStateChange=T.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=A,this.run=A,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=A,this.terminate=A,this.tasks=A,this.taskTypes=A,this.getWorkspaceTasks=A,this.getSavedTasks=A,this.removeRecentlyUsedTask=A,this.getTask=A,this.tryResolveTask=A,this.createSorter=A,this.getTaskDescription=A,this.customize=A,this.openConfig=A,this.registerTaskProvider=A,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=T.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=A,this.isReconnected=!1,this.onDidReconnectToTasks=T.None}},0);ce(_et,class{constructor(){this.resolveWithEnvironment=A,this.resolveAsync=A,this.resolveAnyAsync=A,this.resolveAnyMap=A,this.resolveWithInteractionReplace=A,this.resolveWithInteraction=A,this.contributeVariable=A}},0);ce(Sf,class{constructor(){this.getConnection=()=>null,this.getEnvironment=async()=>null,this.getRawEnvironment=async()=>null,this.getExtensionHostExitInfo=async()=>null,this.getRoundTripTime=async()=>{},this.whenExtensionsReady=async()=>{},this.scanExtensions=async()=>[],this.scanSingleExtension=async()=>null,this.getDiagnosticInfo=async()=>{},this.updateTelemetryLevel=async()=>{},this.logTelemetry=async()=>{},this.flushTelemetry=async()=>{}}},0);ce(Igt,mTt,0);let jCe=class{constructor(e){this.modelService=e,this.aiTextSearch=A,this.textSearchSplitSyncAsync=A,this.registerSearchResultProvider=A}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};jCe=D([_(0,Ai)],jCe);ce(ohe,jCe,0);ce(APe,class{constructor(){this.registerEditSessionIdentityProvider=()=>$.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>$.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce($S,class{constructor(){this.addFolders=A,this.removeFolders=A,this.updateFolders=A,this.enterWorkspace=A,this.createAndEnterWorkspace=A,this.saveAndEnterWorkspace=A,this.copyWorkspaceSettings=A,this.pickNewWorkspacePath=A}},0);ce(Det,class{constructor(){this.getStartTime=A,this.whenReady=A,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=A,this.getDuration=A}get perfBaseline(){return A()}get startupMetrics(){return A()}},0);ce(pr,class{constructor(){this.getResourceExtensions=A,this.updateRunningExtensions=A,this.togglePreRelease=A,this.isAutoUpdateEnabledFor=A,this.updateAutoUpdateEnablementFor=A,this.isAutoUpdateEnabled=A,this.getAutoUpdateValue=A,this.updateAll=A,this.toggleApplyExtensionToAllProfiles=A,this.whenInitialized=Promise.resolve(),this.onChange=T.None,this.onReset=T.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=A,this.queryGallery=A,this.getExtensions=A,this.canInstall=A,this.install=A,this.installInServer=A,this.uninstall=A,this.installVersion=A,this.reinstall=A,this.canSetLanguage=A,this.setLanguage=A,this.setEnablement=A,this.pinExtension=A,this.open=A,this.checkForUpdates=A,this.getExtensionStatus=A,this.isExtensionIgnoredToSync=A,this.toggleExtensionIgnoredToSync=A}},0);ce(Mw,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=A,this.getExtensionInstallLocation=A}},0);ce(bet,class{constructor(){this.onDidChangeRecommendations=T.None,this.getAllRecommendationsWithReason=()=>({}),this.getImportantRecommendations=async()=>[],this.getOtherRecommendations=async()=>[],this.getFileBasedRecommendations=()=>[],this.getExeBasedRecommendations=async()=>({important:[],others:[]}),this.getConfigBasedRecommendations=async()=>({important:[],others:[]}),this.getWorkspaceRecommendations=async()=>[],this.getKeymapRecommendations=()=>[],this.getLanguageRecommendations=()=>[],this.getRemoteRecommendations=()=>[]}},0);ce(NTt,class{constructor(){this.onError=T.None,this.turnOn=A,this.turnOff=A,this.triggerSync=A}},0);ce(kTt,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=A,this.updateSynchronizedExtensions=A}},0);ce(uTt,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=A,this.promptWorkspaceRecommendations=A}},0);ce(FPe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=A,this.addExtensionFromGallery=A,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=A,this.scanExtensionManifest=async()=>null}},0);ce(hTt,class{constructor(){this.onDidChangeCache=T.None,this.getTargetPlatform=A,this.scanAllExtensions=A,this.scanSystemExtensions=A,this.scanUserExtensions=A,this.scanExtensionsUnderDevelopment=A,this.scanExistingExtension=A,this.scanOneOrMultipleExtensions=A,this.scanMultipleExtensions=A,this.scanMetadata=A,this.updateMetadata=A,this.initializeDefaultProfileExtensions=A}get systemExtensionsLocation(){return A()}get userExtensionsLocation(){return A()}},0);ce($de,class{constructor(){this.onAddExtensions=T.None,this.onDidAddExtensions=T.None,this.onRemoveExtensions=T.None,this.onDidRemoveExtensions=T.None,this.scanProfileExtensions=A,this.addExtensionsToProfile=A,this.updateMetadata=A,this.removeExtensionFromProfile=A}},0);ce(ihe,class{constructor(){this.onDidChangeIgnoredRecommendations=T.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=T.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=A}},0);ce(MRt,class{constructor(){this.onDidChangeExtensionsConfigs=T.None,this.getExtensionsConfigs=A,this.getRecommendations=A,this.getUnwantedRecommendations=A,this.toggleRecommendation=A,this.toggleUnwantedRecommendation=A}},0);ce(Kh,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=T.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=A,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=A}},0);ce(Qde,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=T.None,this.onTunnelClosed=T.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=T.None,this.canTunnel=()=>!1,this.openTunnel=A,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=A,this.closeTunnel=A,this.setTunnelProvider=A,this.setTunnelFeatures=A,this.isPortPrivileged=()=>!1}},0);ce(hh,class{constructor(){this.onDidChangeAutoSaveConfiguration=T.None,this.onDidChangeAutoSaveDisabled=T.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=A,this.onDidChangeReadonly=T.None,this.onDidChangeFilesAssociation=T.None,this.onAutoSaveConfigurationChange=T.None,this.getAutoSaveConfiguration=A,this.getAutoSaveMode=A,this.toggleAutoSave=A,this.onReadonlyChange=T.None,this.isReadonly=A,this.updateReadonly=A,this.onFilesAssociationChange=T.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=A}},0);ce(RQ,class{constructor(){this.onDidCreate=T.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=T.None,this.onDidChangeEncoding=T.None,this.onDidChangeLabel=T.None,this.onWillDispose=T.None,this.create=A,this.get=()=>{},this.getValue=()=>{},this.resolve=A}},0);ce(MQ,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Pw,class{constructor(){this.onDidRegister=T.None,this.onDidUnregister=T.None,this.onDidChangeDirty=T.None,this.onDidChangeContent=T.None,this.onDidSave=T.None,this.dirtyCount=0,this.dirtyWorkingCopies=[],this.modifiedCount=0,this.modifiedWorkingCopies=[],this.hasDirty=!1,this.isDirty=()=>!1,this.workingCopies=[],this.has=()=>!1,this.get=()=>{},this.getAll=()=>{}}registerWorkingCopy(){return $.None}},0);ce(rD,class{constructor(){this.onDidChangeDecorations=T.None,this.registerDecorationsProvider=A,this.getDecoration=()=>{}}},0);ce(IQ,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=A}},0);ce(bf,class{constructor(){this.preferredHome=A,this.defaultFilePath=A,this.defaultFolderPath=A,this.defaultWorkspacePath=A,this.pickFileFolderAndOpen=A,this.pickFileAndOpen=A,this.pickFolderAndOpen=A,this.pickWorkspaceAndOpen=A,this.pickFileToSave=A,this.showSaveDialog=A,this.showSaveConfirm=A,this.showOpenDialog=A}},0);ce(dL,class{constructor(){this.write=A}},1);ce(cL,class{constructor(){this.enterWorkspace=A,this.createUntitledWorkspace=A,this.deleteUntitledWorkspace=A,this.getWorkspaceIdentifier=A,this.onDidChangeRecentlyOpened=T.None,this.addRecentlyOpened=A,this.removeRecentlyOpened=A,this.clearRecentlyOpened=A,this.getRecentlyOpened=A,this.getDirtyWorkspaces=A}},1);ce(rhe,class{constructor(){this.createTextEditor=A,this.resolveTextEditor=A}},0);ce(Pz,class{constructor(){this.getAllUserAssociations=A,this.getAssociationsForResource=A,this.updateUserAssociations=A,this.onDidChangeEditorRegistrations=T.None,this.bufferChangeEvents=A,this.resolveEditor=A,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(nhe,class{constructor(){this.onActiveOutputChannel=T.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(uRt,class{constructor(){this.createOutputChannelModel=A}},1);ce(bPe,class{constructor(){this.readExtensionResource=A,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=A}},0);ce(gTt,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(Sp,class{constructor(){this.roots=[],this.getContext=A,this.hasViewFocus=A,this.setEditable=A,this.getEditable=A,this.getEditableData=A,this.isEditable=A,this.findClosest=A,this.findClosestRoot=A,this.refresh=A,this.setToCopy=A,this.isCut=A,this.applyBulkEdit=A,this.select=A,this.registerView=A}get sortOrderConfiguration(){return A()}},1);ce(B7,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=A,this.onDidChangeExtensionStorageToSync=T.None,this.setKeysForSync=A,this.getKeysForSync=()=>{},this.addToMigrationList=A,this.getSourceExtensionToMigrate=()=>{}}},1);ce(IZe,class{constructor(){this.onDidChangeEnablement=T.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(LZe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=_Mt(t)?.[e];return i!=null?P.parse(i):void 0}},1);ce(zde,class{constructor(){this.removeDragOperationTransfer=A,this.addDragOperationTransfer=A}},1);ce(eRt,class{constructor(){this.register=A,this.getWidget=()=>{}}},0);ce(Eet,class{constructor(){this.onDidChange=T.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=A}},0);ce(NZe,class{constructor(){this.onStateChange=T.None,this.state=DTt.Uninitialized,this.checkForUpdates=A,this.downloadUpdate=A,this.applyUpdate=A,this.quitAndInstall=A,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=A}},0);ce(EPe,class{constructor(){this.getPart=A,this.createAuxiliaryStatusbarPart=A,this.createScoped=A,this.dispose=A,this.onDidChangeEntryVisibility=T.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>$.None}},0);ce(aL,class{constructor(){this.isEnabled=()=>!1,this.query=A,this.getExtensions=A,this.isExtensionCompatible=A,this.getCompatibleExtension=A,this.getAllCompatibleVersions=A,this.download=A,this.downloadSignatureArchive=A,this.reportStatistic=A,this.getReadme=A,this.getManifest=A,this.getChangelog=A,this.getCoreTranslation=A,this.getExtensionsControlManifest=A}},0);ce(Nz,class{constructor(){this.onAnyInstanceData=T.None,this.moveIntoNewEditor=A,this.detachedInstances=[],this.onAnyInstanceDataInput=T.None,this.onAnyInstanceIconChange=T.None,this.onAnyInstanceMaximumDimensionsChange=T.None,this.onAnyInstancePrimaryStatusChange=T.None,this.onAnyInstanceProcessIdReady=T.None,this.onAnyInstanceSelectionChange=T.None,this.onAnyInstanceTitleChange=T.None,this.createDetachedTerminal=A,this.onDidChangeSelection=T.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=A,this.instances=[],this.revealActiveTerminal=A,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=fV.Panel,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidCreateInstance=T.None,this.onDidReceiveProcessId=T.None,this.onDidChangeInstanceDimensions=T.None,this.onDidMaximumDimensionsChange=T.None,this.onDidRequestStartExtensionTerminal=T.None,this.onDidChangeInstanceTitle=T.None,this.onDidChangeInstanceIcon=T.None,this.onDidChangeInstanceColor=T.None,this.onDidChangeInstancePrimaryStatus=T.None,this.onDidInputInstanceData=T.None,this.onDidRegisterProcessSupport=T.None,this.onDidChangeConnectionState=T.None,this.createTerminal=A,this.getInstanceFromId=A,this.getInstanceFromIndex=A,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=A,this.moveToEditor=A,this.moveToTerminalView=A,this.getPrimaryBackend=A,this.refreshActiveGroup=A,this.registerProcessSupport=()=>{},this.showProfileQuickPick=A,this.setContainers=A,this.requestStartExtensionTerminal=A,this.isAttachedToTerminal=A,this.getEditableData=A,this.setEditable=A,this.isEditable=A,this.safeDisposeTerminal=A,this.getDefaultInstanceHost=A,this.getInstanceHost=A,this.resolveLocation=A,this.setNativeDelegate=A,this.toggleEscapeSequenceLogging=A,this.getEditingTerminal=A,this.setEditingTerminal=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}createOnInstanceCapabilityEvent(){return{event:T.None,dispose(){}}}createOnInstanceEvent(e){return new blt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return A()}},1);ce(bRt,class{constructor(){this.onConfigChanged=T.None,this.setPanelContainer=A,this.configFontIsMonospace=A,this.getFont=A}get config(){return A()}},1);ce(ZZe,class{constructor(){this.instances=[],this.openEditor=A,this.detachActiveEditorInstance=A,this.detachInstance=A,this.splitInstance=A,this.revealActiveEditor=A,this.resolveResource=A,this.reviveInput=A,this.getInputFromResource=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(MPe,class{constructor(){this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidChangeGroups=T.None,this.onDidShow=T.None,this.onDidChangePanelOrientation=T.None,this.createGroup=A,this.getGroupForInstance=A,this.moveGroup=A,this.moveGroupToEnd=A,this.moveInstance=A,this.unsplitInstance=A,this.joinInstances=A,this.instanceIsSplit=A,this.getGroupLabels=A,this.setActiveGroupByIndex=A,this.setActiveGroupToNext=A,this.setActiveGroupToPrevious=A,this.setActiveInstanceByIndex=A,this.setContainer=A,this.showPanel=A,this.hidePanel=A,this.focusTabs=A,this.focusHover=A,this.showTabs=A,this.updateVisibility=A,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(eet,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=T.None,this.convertProfileToShellLaunchConfig=A,this.createInstance=A,this.getBackend=A,this.didRegisterBackend=A}},1);ce(net,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=A,this.refreshAvailableProfiles=A,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=T.None,this.getContributedDefaultProfile=A,this.registerContributedProfile=A,this.getContributedProfileProvider=A,this.registerTerminalProfileProvider=A}},1);ce(xTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(set,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=T.None,this.onDidRemoveLinkProvider=T.None,this.registerLinkProvider=A}},1);ce(CRt,class{constructor(){this.terminalProfiles=[]}},1);ce(iet,class{constructor(){this.resolveIcon=A,this.resolveShellLaunchConfig=A,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=A,this.getDefaultShellArgs=A,this.getDefaultIcon=A,this.getEnvironment=A,this.createProfileFromShellAndShellArgs=A}},1);ce(tet,class{constructor(){this.collections=new Map,this.onDidChangeCollections=T.None,this.set=A,this.delete=A}get mergedCollection(){return A()}},1);ce(oet,class{constructor(){this.onDidRegisterProvider=T.None,this.onDidRegisterCommandSelector=T.None,this.onDidUnregisterProvider=T.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=A,this.registerCommandSelector=A}},1);ce(Rz,class{constructor(){this.toggleAppliationScope=async e=>e,this.installGalleryExtensions=A,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installFromLocation=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=async()=>[],this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(YRt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=T.None,this.turnOn=A,this.turnoff=A,this.signIn=A,this.resetSyncedData=A,this.showSyncActivity=A,this.syncNow=A,this.synchroniseUserDataSyncStoreType=A,this.showConflicts=A,this.accept=A,this.getAllLogResources=A,this.downloadSyncActivity=A}},1);ce(PZe,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=A,this.onDidChangeResourceEnablement=T.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=A,this.getResourceSyncStateVersion=()=>{}}},1);ce(BRt,class{constructor(){this.addKeybinding=A,this.editKeybinding=A,this.removeKeybinding=A,this.resetKeybinding=A}},1);ce(gRt,class{constructor(){this.getLocalSearchProvider=A,this.getRemoteSearchProvider=A}},1);ce(oD,class{constructor(){this.canResolve=async()=>!1,this.onAddViewType=T.None,this.onWillRemoveViewType=T.None,this.onDidChangeOutputRenderers=T.None,this.onWillAddNotebookDocument=T.None,this.onDidAddNotebookDocument=T.None,this.onWillRemoveNotebookDocument=T.None,this.onDidRemoveNotebookDocument=T.None,this.registerNotebookSerializer=A,this.withNotebookDataProvider=A,this.getOutputMimeTypeInfo=A,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=A,this.updateMimePreferredRenderer=A,this.saveMimeDisplayOrder=A,this.createNotebookTextModel=A,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=A,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=A,this.getContributedNotebookType=A,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=A,this.getToCopy=A,this.clearEditorCache=A}},1);ce(fRt,class{constructor(){this.replace=A,this.openReplacePreview=A,this.updateReplacePreview=A}},1);ce(_Rt,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.load=A,this.save=A}},1);ce(xQ,class{constructor(){this.retrieveWidget=A,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=T.None,this.onDidRemoveNotebookEditor=T.None,this.addNotebookEditor=A,this.removeNotebookEditor=A,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(pRt,class{get searchModel(){return A()}},1);ce(Jde,class{constructor(){this.onDidSaveNotebook=T.None,this.onDidChangeDirty=T.None,this.onWillFailWithConflict=T.None,this.isDirty=A,this.resolve=A}},1);ce(Iet,class{constructor(){this.onDidRegisterHandler=T.None,this.registerHandler=()=>$.None,this.findEditor=()=>{}}},1);ce(BPe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=T.None,this.markActive=A}},1);ce(SPe,class{constructor(){this.registerCanonicalUriProvider=A}},1);ce(xPe,class{constructor(){this.onDidChange=T.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(get,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Rw,class{constructor(){this.adoptRequest=A,this.isEnabled=()=>!1,this.resendRequest=A,this.onDidUnregisterProvider=T.None,this.clearAllHistoryEntries=A,this.onDidSubmitAgent=T.None,this.onDidRegisterProvider=T.None,this.hasSessions=()=>!1,this.onDidDisposeSession=T.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=T.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=A,this.registerProvider=A,this.registerSlashCommandProvider=A,this.getProviderInfos=()=>[],this.startSession=A,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=A,this.removeRequest=A,this.cancelCurrentRequestForSession=A,this.getSlashCommands=A,this.clearSession=A,this.addRequest=A,this.addCompleteRequest=A,this.sendRequestToProvider=A,this.getHistory=()=>[],this.removeHistoryEntry=A,this.onDidPerformUserAction=T.None,this.notifyUserAction=A}},1);ce(Ret,class{constructor(){this.update=A}},1);ce(tRt,class{constructor(){this.focused=!1,this.onDidClose=T.None,this.enabled=!1,this.toggle=A,this.focus=A,this.open=A,this.close=A,this.openInChatView=A}},1);ce(yp,class{constructor(){this._serviceBrand=void 0,this.registerAgentCompletionProvider=A,this.getAgentCompletionItems=A,this.getAgentByFullyQualifiedId=A,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=A,this.registerDynamicAgent=A,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=A,this.getDefaultAgent=A,this.getSecondaryAgent=A,this.updateAgent=A,this.onDidChangeAgents=T.None,this.registerAgentData=A,this.registerAgentCallback=A,this.registerAgent=A,this.invokeAgent=A,this.getAgents=A,this.getAgent=A,this.hasAgent=A}},1);ce(Yde,class{getAgentNameRestriction(){return!0}},1);ce(URt,class{constructor(){this.onDidCreateTerminal=T.None,this.createTerminal=A}},1);ce(kPe,class{constructor(){this.getCustomEditor=A,this.getAllCustomEditors=A,this.getContributedCustomEditors=A,this.getUserConfiguredCustomEditors=A,this.registerCustomEditorCapabilities=()=>$.None,this.getCustomEditorCapabilities=()=>{}}get models(){return A()}},1);ce(Zde,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=T.None,this.createWebviewElement=A,this.createWebviewOverlay=A}},1);ce(het,class{constructor(){this.onNewResolverRegistered=T.None,this.register=A,this.resolve=A}},1);ce(yet,class{constructor(){this.setLocale=A}clearLocalePreference(){return Promise.resolve()}},1);ce(kQ,class{constructor(){this.onDidChangeActiveWebviewEditor=T.None,this.openWebview=A,this.openRevivedWebview=A,this.revealWebview=A,this.registerResolver=()=>$.None,this.shouldPersist=A,this.resolveWebview=A}get iconManager(){return A()}},1);ce(rA,class{constructor(){this.onDidChangeConnectionData=T.None,this.resolveAuthority=A,this.getConnectionData=A,this.getCanonicalURI=A,this._clearResolvedAuthority=A,this._setResolvedAuthority=A,this._setResolvedAuthorityError=A,this._setAuthorityConnectionToken=A,this._setCanonicalURIProvider=A}},1);ce(VZe,class{constructor(){this.registerExternalOpenerProvider=()=>$.None,this.getOpener=async()=>{}}},1);ce(Tw,class{constructor(){this.configureKeybindings=A,this.openHelpLink=A,this.navigateToCodeBlock=A,this.getCodeBlockContext=()=>{},this.showLastProvider=A,this.showAccessibleViewHelp=A,this.goToSymbol=A,this.disableHint=A,this.next=A,this.previous=A,this.getOpenAriaHint=A,this.show=A,this.registerProvider=A,this.getPosition=A,this.setPosition=A,this.getLastPosition=A}},1);ce(hMt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(the,class{constructor(){this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=T.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=A,this.toggleAppliationScope=async e=>e,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidChangeProfile=T.None,this.installVSIX=A,this.installFromLocation=A,this.updateFromGallery=A,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installGalleryExtensions=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=A,this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(G_,class{constructor(){this.prefersExecuteOnUI=A,this.prefersExecuteOnWorkspace=A,this.prefersExecuteOnWeb=A,this.canExecuteOnUI=A,this.canExecuteOnWorkspace=A,this.canExecuteOnWeb=A,this.getExtensionKind=A,this.getUserConfiguredExtensionKind=A,this.getExtensionUntrustedWorkspaceSupportType=A,this.getExtensionVirtualWorkspaceSupportType=A}},1);ce(Sde,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Gde,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(jde,class{constructor(){this.create=A,this.open=async()=>!1,this.registerHandler=A}},1);ce(CPe,class{constructor(){this.register=A,this.connect=A}},1);ce(DQ,class{constructor(){this.onDidChangeQuickDiffProviders=T.None,this.addQuickDiffProvider=A,this.getQuickDiffs=A}},1);ce(RPe,class{constructor(){this.onDidChangeInputValueProviders=T.None,this.getDefaultInputValueProvider=A,this.registerSCMInputValueProvider=A,this.onDidAddRepository=T.None,this.onDidRemoveRepository=T.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=A,this.getRepository=A}},1);ce(wPe,class{constructor(){this.download=A}},1);ce(Cet,class{constructor(){this.registerExtensionHandler=A,this.unregisterExtensionHandler=A}},1);ce(sD,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=T.None,this.setActiveEditingCommentThread=A,this.setActiveCommentAndThread=A,this.onDidSetResourceCommentInfos=T.None,this.onDidSetAllCommentThreads=T.None,this.onDidUpdateCommentThreads=T.None,this.onDidUpdateNotebookCommentThreads=T.None,this.onDidChangeActiveCommentThread=T.None,this.onDidChangeCurrentCommentThread=T.None,this.onDidUpdateCommentingRanges=T.None,this.onDidChangeActiveCommentingRange=T.None,this.onDidSetDataProvider=T.None,this.onDidDeleteDataProvider=T.None,this.onDidChangeCommentingEnabled=T.None,this.isCommentingEnabled=!1,this.setDocumentComments=A,this.setWorkspaceComments=A,this.removeWorkspaceComments=A,this.registerCommentController=A,this.unregisterCommentController=()=>{},this.getCommentController=A,this.createCommentThreadTemplate=A,this.updateCommentThreadTemplate=A,this.getCommentMenus=A,this.updateComments=A,this.updateNotebookComments=A,this.disposeCommentThread=A,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=A,this.hasReactionHandler=A,this.toggleReaction=A,this.setActiveCommentThread=A,this.setCurrentCommentThread=A,this.enableCommenting=A,this.registerContinueOnCommentProvider=A,this.removeContinueOnComment=A}get commentsModel(){return A()}},1);ce(qZe,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeItems=T.None,this.registerCellStatusBarItemProvider=A,this.getStatusBarItemsForCell=A}},1);ce(jZe,class{constructor(){this.onDidNotebookVariablesUpdate=T.None,this.notifyVariablesChange=A,this.onDidAddKernel=T.None,this.onDidRemoveKernel=T.None,this.onDidChangeSelectedNotebooks=T.None,this.onDidChangeNotebookAffinity=T.None,this.registerKernel=A,this.getMatchingKernel=A,this.getSelectedOrSuggestedKernel=A,this.selectKernelForNotebook=A,this.preselectKernelForNotebook=A,this.updateKernelNotebookAffinity=A,this.onDidChangeKernelDetectionTasks=T.None,this.registerNotebookKernelDetectionTask=A,this.getKernelDetectionTasks=A,this.onDidChangeSourceActions=T.None,this.getSourceActions=A,this.getRunningSourceActions=A,this.registerKernelSourceActionProvider=A,this.getKernelSourceActions2=A}},1);ce(KZe,class{constructor(){this.onShouldPostMessage=T.None,this.prepare=A,this.getScoped=A,this.receiveMessage=A}},1);ce($Ze,class{constructor(){this.addToHistory=A,this.getPreviousValue=A,this.getNextValue=A,this.replaceLast=A,this.clearHistory=A,this.has=A}},1);ce(TPe,class{constructor(){this.onWillAddInteractiveDocument=T.None,this.onWillRemoveInteractiveDocument=T.None,this.willCreateInteractiveDocument=A,this.willRemoveInteractiveDocument=A}},1);ce(HRt,class{async getExtensionIdProvidingCurrentLocale(){return vMt()}},0);ce($Rt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=A}},0);ce(Fz,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=A,this.next=A,this.reset=A}},0);ce(OTt,class{constructor(){this.onTokenFailed=T.None,this.account=void 0,this.onDidChangeAccount=T.None}updateAccount(){return Promise.resolve()}},0);ce(lL,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=A,this.getWidgetByInputUri=A}},1);ce(she,class{constructor(){this.onDidChangeHelpInformation=T.None,this.onDidChangeTargetType=T.None,this.targetType=[],this.onDidChangeEditable=T.None,this.setEditable=A,this.getEditableData=A,this.forward=A,this.close=A,this.setTunnelInformation=A,this.setCandidateFilter=A,this.onFoundNewCandidates=A,this.restore=A,this.enablePortsFeatures=A,this.onEnabledPortsFeatures=T.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return A()}get tunnelModel(){return A()}},1);ce(PPe,class{constructor(){this.onDidRegisterAuthenticationProvider=T.None,this.onDidUnregisterAuthenticationProvider=T.None,this.onDidChangeSessions=T.None,this.onDidChangeDeclaredProviders=T.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=A,this.unregisterDeclaredAuthenticationProvider=A,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=A,this.unregisterAuthenticationProvider=A,this.getProviderIds=()=>[],this.getProvider=A,this.getSessions=A,this.createSession=A,this.removeSession=A}},1);ce(ehe,class{constructor(){this.onDidChangeExtensionSessionAccess=T.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=A,this.removeAllowedExtensions=A}},1);ce(pet,class{constructor(){this.updateSessionPreference=A,this.getSessionPreference=()=>{},this.removeSessionPreference=A,this.selectSession=A,this.requestSessionAccess=A,this.requestNewSession=A}},1);ce(fet,class{constructor(){this.readAccountUsages=A,this.removeAccountUsage=A,this.addAccountUsage=A}},1);ce(det,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeTimeline=T.None,this.onDidChangeUri=T.None,this.registerTimelineProvider=A,this.unregisterTimelineProvider=A,this.getSources=()=>[],this.getTimeline=A,this.setUri=A}},1);ce(cet,class{constructor(){this.registerExtHost=()=>$.None,this.provideTestFollowups=A,this.onDidCancelTestRun=T.None,this.onWillProcessDiff=T.None,this.onDidProcessDiff=T.None,this.registerTestController=A,this.getTestController=()=>{},this.refreshTests=A,this.cancelRefreshTests=A,this.startContinuousRun=A,this.runTests=A,this.runResolvedTests=A,this.syncTests=A,this.cancelTestRun=A,this.publishDiff=A}get excluded(){return A()}get collection(){return A()}get showInlineOutput(){return A()}},1);ce(RZe,class{constructor(){this.onDidChangeSecret=T.None,this.type="in-memory",this.get=async()=>{},this.set=A,this.delete=A}},1);ce(JZe,class{constructor(){this.registerShareProvider=A,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(ket,class{constructor(){this.resolveProfileTemplate=A,this.exportProfile2=A,this.createFromProfile=A,this.createProfile=A,this.editProfile=A,this.registerProfileContentHandler=A,this.unregisterProfileContentHandler=A,this.exportProfile=A,this.importProfile=A,this.showProfileContents=A,this.createFromCurrentProfile=A,this.createTroubleshootProfile=A,this.setProfile=A}},1);ce(FRt,class{constructor(){this.registerIssueDataProvider=A,this.openReporter=A,this.openProcessExplorer=A,this.registerIssueUriRequestHandler=A}},1);ce(gMt,class{constructor(){this.stopTracing=A,this.openReporter=A,this.openProcessExplorer=A,this.getSystemStatus=A,this.$getSystemInfo=A,this.$getPerformanceInfo=A,this.$reloadWithExtensionsDisabled=A,this.$showConfirmCloseDialog=A,this.$showClipboardDialog=A,this.$sendReporterMenu=A,this.$closeReporter=A}},1);ce(YZe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=T.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=T.None,this.isVisible=()=>!1,this.toggleVisibility=A,this.toggleSortKey=A,this.focusedRepository=void 0,this.onDidFocusRepository=T.None,this.focus=A}get menus(){return A()}},1);ce(QZe,class{constructor(){this.onDidChangeExecution=T.None,this.onDidChangeLastRunFailState=T.None,this.forceCancelNotebookExecutions=A,this.getCellExecutionsForNotebook=A,this.getCellExecutionsByHandleForNotebook=A,this.getCellExecution=A,this.createCellExecution=A,this.getExecution=A,this.createExecution=A,this.getLastFailedCellForNotebook=A}},1);ce(ret,class{constructor(){this.onDidChange=T.None,this.addProfile=A,this.updateProfile=A,this.removeProfile=A,this.capabilitiesForTest=A,this.configure=A,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=A,this.getControllerProfiles=()=>[]}},1);ce(lTt,class{constructor(){this.setUsePlainTextEncryption=A,this.getKeyStorageProvider=A,this.encrypt=A,this.decrypt=A,this.isEncryptionAvailable=A}},1);ce(aet,class{constructor(){this.onResultsChanged=T.None,this.onTestChanged=T.None,this.results=[],this.clear=A,this.createLiveResult=A,this.push=A,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(ARt,class{constructor(){this.read=A,this.persist=A}},1);ce(xRt,class{constructor(){this.onDidChange=T.None,this.invalidateResultMessage=A,this.syncDecorations=A,this.getDecoratedTestPosition=A}},1);ce(ahe,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(cTt,aTt,1);ce(mRt,class{notebookSearch(){return{openFilesToScan:new o1,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new o1)}}},1);ce(HZe,class{constructor(){this.selectLanguageModels=A,this.computeTokenLength=A,this.onDidChangeLanguageModels=T.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=A,this.makeLanguageModelChatRequest=A}},1);ce(DPe,class{constructor(){this.onDidChangeCommands=A,this.registerSlashData=A,this.registerSlashCallback=A,this.registerSlashCommand=A,this.executeCommand=A,this.getCommands=A,this.hasCommand=A}},1);ce(Mz,class{constructor(){this.attachContext=A,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=A,this.getDynamicReferences=A,this.registerVariable=A,this.getVariables=A,this.resolveVariables=A,this.hasVariable=A}},1);ce(NPe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=A,this.registerAiRelatedInformationProvider=A}},1);ce(uet,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=A,this.registerAiEmbeddingVectorProvider=A}},1);ce(MZe,(AK=class{async createNewMessage(e){return{id:String(AK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},AK._nextId=1,AK),1);ce(ERt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=T.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=A,this.stop=A}},1);ce(SRt,class{constructor(){this.onDidRequestInputFocus=T.None,this.focusInput=A,this.setText=A,this.isFilteringFor=()=>!1,this.toggleFilteringFor=A}get text(){return A()}get reveal(){return A()}get globList(){return A()}get includeTags(){return A()}get excludeTags(){return A()}get fuzzy(){return A()}},1);ce(DRt,class{constructor(){this.tryPeekFirstError=A,this.peekUri=A,this.openCurrentInEditor=A,this.open=A,this.closeAllPeeks=A}get historyVisible(){return A()}},1);ce(met,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=T.None,this.hasWindow=()=>!1,this.open=A}},1);ce(Xde,class{constructor(){this.onDidStartTextToSpeechSession=T.None,this.onDidEndTextToSpeechSession=T.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=A,this.onDidChangeHasSpeechProvider=T.None,this.onDidStartSpeechToTextSession=T.None,this.onDidEndSpeechToTextSession=T.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=T.None,this.onDidEndKeywordRecognition=T.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=A,this.onDidRegisterSpeechProvider=T.None,this.onDidUnregisterSpeechProvider=T.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=A,this.createSpeechToTextSession=A}},1);ce(yRt,class{constructor(){this.openCoverage=A,this.closeCoverage=A}get filterToTest(){return A()}get selected(){return A()}},1);ce(BZe,class{constructor(){this.acceptRequest=A,this.acceptResponse=A}},1);ce(WZe,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.getHistory=()=>[],this.saveHistory=A}},1);ce(iRt,class{constructor(){this.providers=[],this.registerProvider=A}},1);ce(LPe,class{constructor(){this.onDidMoveSession=T.None,this.onDidMoveSessio=T.None,this.onDidStashSession=T.None,this.moveSession=A,this.getCodeEditor=A,this.stashSession=A,this.onWillStartSession=T.None,this.onDidEndSession=T.None,this.createSession=A,this.getSession=()=>{},this.releaseSession=A,this.registerSessionKeyComputer=A,this.recordings=A,this.dispose=A}},1);ce(hRt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=A,this.canPromptRecommendation=async()=>!1}},1);ce(aRt,class{constructor(){this.getKernels=A,this.addMostRecentKernel=A}},1);ce(rRt,class{constructor(){this.executeNotebookCells=A,this.cancelNotebookCells=A,this.cancelNotebookCellHandles=A,this.registerExecutionParticipant=A}},1);ce(cRt,class{},1);ce(lRt,class{constructor(){this.info=A,this.debug=A}},1);ce(IRt,class{constructor(){this.onDidAddWalkthrough=T.None,this.onDidRemoveWalkthrough=T.None,this.onDidChangeWalkthrough=T.None,this.onDidProgressStep=T.None,this.getWalkthroughs=A,this.getWalkthrough=A,this.registerWalkthrough=A,this.progressByEvent=A,this.progressStep=A,this.deprogressStep=A,this.markWalkthroughOpened=A}},1);ce(ITt,class{constructor(){this.onDidChangeUserDataSyncStore=T.None,this.userDataSyncStore=void 0,this.switch=A,this.getPreviousUserDataSyncStore=A}},1);ce(LTt,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=T.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=T.None,this.onTokenSucceed=T.None,this.setAuthToken=A,this.manifest=A,this.readResource=A,this.writeResource=A,this.deleteResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A,this.getAllCollections=A,this.createCollection=A,this.deleteCollection=A,this.getActivityData=A,this.clear=A}},1);ce(FTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(RTt,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=T.None,this.conflicts=[],this.onDidChangeConflicts=T.None,this.onDidChangeLocal=T.None,this.onSyncErrors=T.None,this.onDidChangeLastSyncTime=T.None,this.onDidResetRemote=T.None,this.onDidResetLocal=T.None,this.createSyncTask=A,this.createManualSyncTask=A,this.resolveContent=A,this.accept=A,this.reset=A,this.resetRemote=A,this.cleanUpRemoteData=A,this.resetLocal=A,this.hasLocalData=A,this.hasPreviouslySynced=A,this.replace=A,this.saveRemoteActivityData=A,this.extractActivityData=A}},1);ce(BTt,class{constructor(){this.onDidChange=T.None,this.getMachines=A,this.addCurrentMachine=A,this.removeCurrentMachine=A,this.renameMachine=A,this.setEnablements=A}},1);ce(MTt,class{constructor(){this.getRemoteSyncedProfiles=A,this.getLocalSyncedProfiles=A,this.getRemoteSyncResourceHandles=A,this.getLocalSyncResourceHandles=A,this.getAssociatedResources=A,this.getMachineId=A,this.getLocalSyncedMachines=A,this.resolveContent=A,this.resolveUserDataSyncResource=A}},1);ce(TTt,class{constructor(){this.writeResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A}},1);ce(PTt,class{constructor(){this.resolveUserBindings=A,this.resolveFormattingOptions=A,this.resolveDefaultIgnoredSettings=A}},1);ce(GRt,class{constructor(){this.createAndEnterProfile=A,this.createAndEnterTransientProfile=A,this.removeProfile=A,this.updateProfile=A,this.switchProfile=A,this.getBuiltinProfileTemplates=A}},1);ce(JRt,class{constructor(){this.onDidAddEntry=T.None,this.onDidChangeEntry=T.None,this.onDidReplaceEntry=T.None,this.onDidRemoveEntry=T.None,this.onDidMoveEntries=T.None,this.onDidRemoveEntries=T.None,this.addEntry=A,this.updateEntry=A,this.removeEntry=A,this.moveEntries=A,this.getEntries=A,this.getAll=A,this.removeAll=A}},1);ce(zZe,class{constructor(){this.markChanged=A}},1);ce(Aet,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=A,this.removeNotebookDocument=A}},1);ce(UZe,class{constructor(){this.registerTree=A,this.getVisualizedNodeFor=A,this.getVisualizedChildren=A,this.editTreeItem=A,this.getApplicableFor=A,this.register=A}},1);ce(sRt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(nRt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=T.None,this.onDidSignOut=T.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=A,this.read=A,this.write=A,this.delete=A,this.list=A,this.getMachineById=A}},1);ce(GZe,class{constructor(){this.registerResolver=()=>$.None,this.resolve=async()=>{}}},1);ce(wRt,vRt,1);ce(wet,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!0,this.setEnablement=A,this.getEnablementData=A,this.getAccess=A,this.onDidChangeAccessData=T.None,this.getAccessData=()=>{},this.setStatus=A}},1);ce(vet,class{constructor(){this.onWillInstantiateEditorPane=T.None,this.didInstantiateEditorPane=()=>!1}},1);ce(XRt,class{constructor(){this.matches=A,this.getWorkspaceStateFolders=A}},1);ce(oRt,class{constructor(){this.onDidChangeDefaultLogLevels=T.None,this.getDefaultLogLevel=async()=>Pn.Off,this.getDefaultLogLevels=A,this.setDefaultLogLevel=A,this.migrateLogLevels=A}},1);ce(aD,class{constructor(){this.onDidChange=T.None,this.getName=()=>{}}},1);ce(PRt,class{constructor(){this.isActive=()=>!1,this.start=A,this.resume=A,this.stop=A}},1);ce(fMt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(lhe,class{isValid(){return!1}},1);const mV=Object.freeze({activeComment:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts",aiRelatedInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts",aiTextSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",attributableCoverage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts",authGetSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts",authLearnMore:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts",authSession:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts",canonicalUriProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts",chatParticipantAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts",chatParticipantPrivate:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",chatProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",chatTab:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts",chatVariableResolver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts",codeActionAI:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts",codeActionRanges:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",codiconDecoration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts",commentReactor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts",commentThreadApplicability:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts",commentingRangeHint:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts",commentsDraftState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts",contribAccessibilityHelpContent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts",contribCommentEditorActionsMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts",contribCommentPeekContext:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts",contribCommentThreadAdditionalMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts",contribCommentsViewThreadMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts",contribDiffEditorGutterToolBarMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts",contribEditSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts",contribEditorContentMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts",contribIssueReporter:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts",contribLabelFormatterWorkspaceTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts",contribMenuBarHome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts",contribMergeEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts",contribMultiDiffEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts",contribNotebookStaticPreloads:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts",contribRemoteHelp:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts",contribShareMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts",contribSourceControlHistoryItemGroupMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts",contribSourceControlHistoryItemMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts",contribSourceControlInputBoxMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts",contribSourceControlTitleMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts",contribStatusBarItems:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts",contribViewsRemote:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts",contribViewsWelcome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts",createFileSystemWatcher:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts",customEditorMove:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts",debugVisualization:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts",defaultChatParticipant:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",diffCommand:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts",diffContentOptions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts",documentFiltersExclusive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts",documentPaste:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts",editSessionIdentityProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts",editorHoverVerbosityLevel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts",editorInsets:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts",embeddings:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts",extensionRuntime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts",extensionsAny:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts",externalUriOpener:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts",fileComments:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts",fileSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts",findFiles2:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",findTextInFiles:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts",fsChunks:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts",idToken:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts",inlineCompletionsAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts",inlineEdit:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts",interactive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts",interactiveWindow:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts",ipc:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts",languageModelSystem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts",languageStatusText:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts",mappedEditsProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",multiDocumentHighlightProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts",newSymbolNamesProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts",notebookCellExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts",notebookCellExecutionState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts",notebookControllerAffinityHidden:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts",notebookDeprecated:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts",notebookExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts",notebookKernelSource:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts",notebookLiveShare:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts",notebookMessaging:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts",notebookMime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts",notebookVariableProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts",portsAttributes:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts",profileContentHandlers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts",quickDiffProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts",quickPickItemTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts",quickPickSortByLabel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts",resolvers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts",scmActionButton:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts",scmHistoryProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts",scmMultiDiffEditor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts",scmSelectedProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts",scmTextDocument:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts",scmValidation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts",shareProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts",showLocal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts",speech:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts",tabInputMultiDiff:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts",tabInputTextMerge:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts",taskPresentationGroup:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts",telemetry:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts",terminalDataWriteEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts",terminalDimensions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts",terminalExecuteCommandEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts",terminalQuickFixProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts",terminalSelection:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts",terminalShellIntegration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts",testObserver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts",textSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts",timeline:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts",tokenInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts",treeViewActiveItem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts",treeViewMarkdownMessage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts",treeViewReveal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts",tunnelFactory:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts",tunnels:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts",workspaceTrust:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}),DMt="vscode://schemas/vscode-product",ni="vs/workbench/services/extensions/common/extensionsRegistry",HPe=it.as(eL.JSONContribution);class kMt{constructor(e,t,i){this._messageHandler=e,this._extension=t,this._extensionPointId=i}_msg(e,t){this._messageHandler({type:e,message:t,extensionId:this._extension.identifier,extensionPointId:this._extensionPointId})}error(e){this._msg(nt.Error,e)}warn(e){this._msg(nt.Warning,e)}info(e){this._msg(nt.Info,e)}}class q${static _toSet(e){const t=new $v;for(let i=0,s=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!s.has(a.description.identifier));return new q$(o,r)}constructor(e,t){this.added=e,this.removed=t}}class IMt{constructor(e,t){this.name=e,this.defaultExtensionKind=t,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=q$.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){bt(e)}}}const LMt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(ni,0,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(ni,1,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},Met="vscode://schemas/vscode-extensions",KCe={properties:{engines:{type:"object",description:g(ni,2,"Engine compatibility."),properties:{vscode:{type:"string",description:g(ni,3,"For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5."),default:"^1.22.0"}}},publisher:{description:g(ni,4,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(ni,5,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(ni,6,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:fZe},{type:"string",const:"Languages",deprecationMessage:g(ni,7,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(ni,8,"Banner used in the VS Code marketplace."),properties:{color:{description:g(ni,9,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(ni,10,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(ni,11,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(ni,12,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(ni,13,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(ni,14,"Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api"),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}},api:{markdownDescription:g(ni,15,"Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions"),type:"string",enum:["none"],enumDescriptions:[g(ni,16,"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.")]},activationEvents:{description:g(ni,17,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(ni,18,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(ni,19,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(ni,20,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(ni,21,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(ni,22,'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:g(ni,23,'An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).'),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:g(ni,24,"An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called)."),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:g(ni,25,"An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed."),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:g(ni,26,"An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern."),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:g(ni,27,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(ni,28,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(ni,29,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(ni,30,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(ni,31,"An activation event emitted whenever a search is started in the folder with the given scheme."),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:g(ni,32,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(ni,33,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(ni,34,"An activation event emitted whenever a external uri (such as an http or https link) is being opened.")},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:g(ni,35,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(ni,36,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(ni,37,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(ni,38,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(ni,39,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(ni,40,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(ni,41,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(ni,42,"An activation event emitted when the issue reporter is opened.")},{label:"*",description:g(ni,43,"An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case."),body:"*"}]}},badges:{type:"array",description:g(ni,44,"Array of badges to display in the sidebar of the Marketplace's extension page."),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:g(ni,45,"Badge image URL.")},href:{type:"string",description:g(ni,46,"Badge link.")},description:{type:"string",description:g(ni,47,"Badge description.")}}}},markdown:{type:"string",description:g(ni,48,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(ni,49,"Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:g(ni,50,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionPack:{description:g(ni,51,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionKind:{description:g(ni,52,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:"array",items:LMt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(ni,53,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(ni,54,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(ni,55,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(ni,56,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(ni,57,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(ni,58,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(ni,59,"Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true."),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:g(ni,60,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,61,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(ni,62,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(ni,63,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(ni,64,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:g(ni,65,"Declares how the extension should be handled in untrusted workspaces."),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:g(ni,66,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,67,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(ni,68,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(ni,69,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(ni,70,"A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:g(ni,71,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:g(ni,72,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(ni,73,"URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess"),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:g(ni,74,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(ni,75,"Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported."),type:"string"}}},icon:{type:"string",description:g(ni,76,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(ni,77,"The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.")},pricing:{type:"string",markdownDescription:g(ni,78,"The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label"),enum:["Free","Trial"],default:"Free"}}};class TMt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new IMt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&QW.register(e.extensionPoint,e.activationEventsGenerator),KCe.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,HPe.registerSchema(Met,KCe),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const Net={ExtensionsRegistry:"ExtensionsRegistry"};it.add(Net.ExtensionsRegistry,new TMt);const Ap=it.as(Net.ExtensionsRegistry);HPe.registerSchema(Met,KCe);HPe.registerSchema(DMt,{properties:{extensionEnabledApiProposals:{description:g(ni,79,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}}]}}}});var GS;(function(n){n.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(GS||(GS={}));class RMt{constructor(){this.extensionFeatures=new Map}registerExtensionFeature(e){if(this.extensionFeatures.has(e.id))throw new Error(`Extension feature with id '${e.id}' already exists`);return this.extensionFeatures.set(e.id,e),{dispose:()=>this.extensionFeatures.delete(e.id)}}getExtensionFeature(e){return this.extensionFeatures.get(e)}getExtensionFeatures(){return Array.from(this.extensionFeatures.values())}}it.add(GS.ExtensionFeaturesRegistry,new RMt);var pf;(function(n){n.Workbench="workbench.contributions.kind"})(pf||(pf={}));var Sl;(function(n){n[n.BlockStartup=1]="BlockStartup",n[n.BlockRestore=2]="BlockRestore",n[n.AfterRestored=3]="AfterRestored",n[n.Eventually=4]="Eventually"})(Sl||(Sl={}));function zVe(n){const e=n;return!!e&&typeof e.editorTypeId=="string"}function MMt(n){switch(n){case Us.Restored:return Sl.AfterRestored;case Us.Eventually:return Sl.Eventually}}function $Ve(n){switch(n){case Sl.BlockStartup:return Us.Starting;case Sl.BlockRestore:return Us.Ready;case Sl.AfterRestored:return Us.Restored;case Sl.Eventually:return Us.Eventually}}const uk=class uk extends ${constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.timingsByPhase=new Map,this.pendingRestoredContributions=new sd,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const s={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&zVe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,s,typeof i=="number"?$Ve(i):this.lifecycleService.phase):(typeof i=="number"&&XX(this.contributionsByPhase,$Ve(i),[]).push(s),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,s),zVe(i)&&XX(this.contributionsByEditor,i.editorTypeId,[]).push(s)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,MMt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,s=this.logService,o=this.environmentService;if(!t||!i||!s||!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const r=this.contributionsById.get(e);if(!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phasethis.onEditor(a.typeId,t,i,s,o)))}onEditor(e,t,i,s,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,s,o,a,i.phase)}}instantiateByPhase(e,t,i,s,o){t.phase>=o?this.doInstantiateByPhase(e,i,s,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,s,o))}async doInstantiateByPhase(e,t,i,s){const o=this.contributionsByPhase.get(s);if(o)switch(this.contributionsByPhase.delete(s),s){case Us.Starting:case Us.Ready:{vs(`code/willCreateWorkbenchContributions/${s}`);for(const r of o)this.safeCreateContribution(e,t,i,r,s);vs(`code/didCreateWorkbenchContributions/${s}`);break}case Us.Restored:case Us.Eventually:{s===Us.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,s);break}}}doInstantiateWhenIdle(e,t,i,s,o){vs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Us.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,s=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){s.error(g(Dv,3,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!zt(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every(zt))){s.error(g(Dv,4,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!zt(a)){s.error(g(Dv,5,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=qt(o,a);MS(c,o)||s.warn(g(Dv,6,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",GVe.name,c.toString(),o.path))}catch(c){s.error(g(Dv,7,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){s.error(g(Dv,8,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class PMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.jsonValidation}render(e){const t=e.contributes?.jsonValidation||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Dv,9,"File Match"),g(Dv,10,"Schema")],s=t.map(o=>[new Xt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:s},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(Dv,11,"JSON Validation"),access:{canToggle:!1},renderer:new $i(PMt)});var pH;let hte=(pH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(NMt)}},pH.ID="workbench.contrib.jsonValidationExtensionPoint",pH);hte=D([_(0,be)],hte);gp(hte.ID,hte,Sl.BlockStartup);const Kl="vs/workbench/services/themes/common/colorExtensionPoint",YCe=it.as(xMe.ColorContribution),EK=YCe.getColorReferenceSchema(),Pet="^\\w+[.\\w+]*$",FMt=Ap.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(Kl,0,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(Kl,1,"The identifier of the themable color"),pattern:Pet,patternErrorMessage:g(Kl,2,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(Kl,3,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(Kl,4,"The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},dark:{description:g(Kl,5,"The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrast:{description:g(Kl,6,"The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(Kl,7,"The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class OMt{constructor(){FMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||!Array.isArray(s)){o.error(g(Kl,8,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?fe.Format.CSS.parseHex(a):a:(o.error(g(Kl,9,"{0} must be either a color value in hex (#RRGGBB[AA] or #RGB[A]) or the identifier of a themable color which provides the default.",c)),fe.red);for(const a of s){if(typeof a.id!="string"||a.id.length===0){o.error(g(Kl,10,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(Pet)){o.error(g(Kl,11,"'configuration.colors.id' must only contain letters, digits and dots and can not start with a dot"));return}if(typeof a.description!="string"||a.id.length===0){o.error(g(Kl,12,"'configuration.colors.description' must be defined and can not be empty"));return}const c=a.defaults;if(!c||typeof c!="object"||typeof c.light!="string"||typeof c.dark!="string"){o.error(g(Kl,13,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(Kl,14,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(Kl,15,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}YCe.registerColor(a.id,{light:r(c.light,"configuration.colors.defaults.light"),dark:r(c.dark,"configuration.colors.defaults.dark"),hcDark:r(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:r(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const s=i.value;for(const o of s)YCe.deregisterColor(o.id)}})}}class BMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.colors}render(e){const t=e.contributes?.colors||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Kl,16,"ID"),g(Kl,17,"Description"),g(Kl,18,"Dark Default"),g(Kl,19,"Light Default"),g(Kl,20,"High Contrast Default")],s=r=>r[0]==="#"?fe.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Xt().appendMarkdown(`\`${r.id}\``),r.description,s(r.defaults.dark)??new Xt().appendMarkdown(`\`${r.defaults.dark}\``),s(r.defaults.light)??new Xt().appendMarkdown(`\`${r.defaults.light}\``),s(r.defaults.highContrast)??new Xt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(Kl,21,"Colors"),access:{canToggle:!1},renderer:new $i(BMt)});var mH;let ute=(mH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(OMt)}},mH.ID="workbench.contrib.colorExtensionPoint",mH);ute=D([_(0,be)],ute);gp(ute.ID,ute,Sl.BlockStartup);const s_="vs/workbench/services/themes/common/iconExtensionPoint",k3=it.as(WXe.IconContribution),WMt=k3.getIconReferenceSchema(),Fet=`^${$e.iconNameSegment}(-${$e.iconNameSegment})+$`,HMt=Ap.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(s_,0,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:Fet,description:g(s_,1,"The identifier of the themable icon"),patternErrorMessage:g(s_,2,"Identifiers can only contain letters, digits and minuses and need to consist of at least two segments in the form `component-iconname`.")},additionalProperties:{type:"object",properties:{description:{type:"string",description:g(s_,3,"The description of the themable icon")},default:{anyOf:[WMt,{type:"object",properties:{fontPath:{description:g(s_,4,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(s_,5,"The character for the icon in the icon font."),type:"string"}},required:["fontPath","fontCharacter"],defaultSnippets:[{body:{fontPath:"${1:myiconfont.woff}",fontCharacter:"${2:\\\\E001}"}}]}],description:g(s_,6,"The default of the icon. Either a reference to an extisting ThemeIcon or an icon in an icon font.")}},required:["description","default"],defaultSnippets:[{body:{description:"${1:my icon}",default:{fontPath:"${2:myiconfont.woff}",fontCharacter:"${3:\\\\E001}"}}}]},defaultSnippets:[{body:{"${1:my-icon-id}":{description:"${2:my icon}",default:{fontPath:"${3:myiconfont.woff}",fontCharacter:"${4:\\\\E001}"}}}}]}});class UMt{constructor(){HMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||typeof s!="object"){o.error(g(s_,7,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in s){if(!r.match(Fet)){o.error(g(s_,8,"'configuration.icons' keys represent the icon id and can only contain letter, digits and minuses. They need to consist of at least two segments in the form `component-iconname`."));return}const a=s[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(s_,9,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")k3.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=T_(c.fontPath).substring(1),d=VMt[l];if(!d){o.warn(g(s_,10,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=qt(h,c.fontPath);if(!MS(u,h)){o.warn(g(s_,11,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=zMt(i.description,c.fontPath),p=k3.registerIconFont(f,{src:[{location:u,format:d}]});k3.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(s_,12,"'configuration.icons.default' must be either a reference to the id of an other theme icon (string) or a icon definition (object) with properties `fontPath` and `fontCharacter`."))}}for(const i of t.removed){const s=i.value;for(const o in s)k3.deregisterIcon(o)}})}}const VMt={ttf:"truetype",woff:"woff",woff2:"woff2"};function zMt(n,e){return qi.join(n.identifier.value,e)}var _H;let gte=(_H=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(UMt)}},_H.ID="workbench.contrib.iconExtensionPoint",_H);gte=D([_(0,be)],gte);gp(gte.ID,gte,Sl.BlockStartup);const KO="vs/platform/action/common/actionCommonCategories",Xa=Object.freeze({View:Be(KO,0,"View"),Help:Be(KO,1,"Help"),Test:Be(KO,2,"Test"),File:Be(KO,3,"File"),Preferences:Be(KO,4,"Preferences"),Developer:Be(KO,5,"Developer")}),$Mt="vs/platform/actions/common/menuResetAction";class GMt extends pi{constructor(){super({id:"menu.resetHiddenStates",title:Be($Mt,0,"Reset All Menus"),category:Xa.View,f1:!0})}run(e){e.get(mc).resetHiddenStates(),e.get(Ze).info("did RESET all menu hidden states")}}At(GMt);var qMt='.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:space-between}.monaco-editor .peekview-widget .head .peekview-title{align-items:baseline;display:flex;font-size:13px;margin-left:20px;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename,.monaco-editor .peekview-widget .head .peekview-title .meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;padding-right:2px;text-align:right}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{align-self:center;margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}';Ct(qMt,{});let oC=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ym(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};oC=D([_(4,be),_(5,Qt),_(6,Qi),_(7,Pe),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],oC);var QMt=".monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-bottom-style:solid;border-bottom-width:0;border-top-style:solid;border-top-width:0;position:relative}";Ct(QMt,{});const qVe=new fe(new gn(0,122,204)),jMt={showArrow:!0,showFrame:!0,className:"",frameColor:qVe,arrowColor:qVe,keepEditorSelection:!1},KMt="vs.editor.contrib.zoneWidget";class YMt{constructor(e,t,i,s,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class JMt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const Uae=class Uae{constructor(e){this._editor=e,this._ruleName=Uae._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),vE(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){vE(this._ruleName),Kp(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:O.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:gi.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};Uae._IdGenerator=new yz(".arrow-decoration-");let JCe=Uae;class UPe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Vs(t),ym(this.options,jMt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new JCe(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}hasFocus(){return this.domNode.contains(xl())}show(e,t){const i=O.isIRange(e)?O.lift(e):O.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:jt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=O.isIRange(e)?O.getStartPosition(e):e,this._viewZone.afterLineNumber=e.lineNumber,this._viewZone.afterColumn=e.column,this._viewZone.heightInLines=t??this._viewZone.heightInLines,this.editor.changeViewZones(i=>{i.layoutZone(this._viewZone.id)}),this._positionMarkerId.set([{range:O.isIRange(e)?e:O.fromPositions(e),options:jt.EMPTY}]))}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(x.lineHeight);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(x.lineHeight);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let c=0,l=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new YMt(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new JMt(KMt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new O(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,vt.Smooth):this.editor.revealRange(e,vt.Smooth)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Lh(this.domNode,this,{orientation:vi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=Ia.Disabled);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(x.lineHeight),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}const Cg="vs/editor/contrib/peekView/browser/peekView",Oet=ae("IPeekViewService");ce(Oet,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},Kt.Delayed);var mf;(function(n){n.inPeekEditor=new Y("inReferenceSearchEditor",!0,g(Cg,0,"Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(mf||(mf={}));var vH;let fte=(vH=class{constructor(e,t){e instanceof oC&&mf.inPeekEditor.bindTo(t)}dispose(){}},vH.ID="editor.contrib.referenceController",vH);fte=D([_(1,Pe)],fte);vn(fte.ID,fte,mi.Eager);function Bet(n){const e=n.get(Qt).getFocusedCodeEditor();return e instanceof oC?e.getParentEditor():e}const XMt={headerBackgroundColor:fe.white,primaryHeadingColor:fe.fromHex("#333333"),secondaryHeadingColor:fe.fromHex("#6c6c6cb3")};let V7=class extends UPe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,ym(this.options,XMt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=we(".head"),this._bodyElement=we(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=we(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Xo(this._titleElement,"click",o=>this._onTitleClick(o))),he(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=we("span.filename"),this._secondaryHeading=we("span.dirname"),this._metaHeading=we("span.meta"),he(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=we(".peekview-actions");he(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Qh(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xn("peekview.close",g(Cg,1,"Close"),$e.asClassName(Ce.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:yO.bind(void 0,this.instantiationService),orientation:Qb.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Yo(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Oh(this._metaHeading)):Jl(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};V7=D([_(2,be)],V7);const SR=B("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,2,"Background color of the peek view title area.")),VPe=B("peekViewTitleLabel.foreground",{dark:fe.white,light:fe.black,hcDark:fe.white,hcLight:Mc},g(Cg,3,"Color of the peek view title.")),zPe=B("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(Cg,4,"Color of the peek view title info.")),$Pe=B("peekView.border",{dark:qc,light:qc,hcDark:ft,hcLight:ft},g(Cg,5,"Color of the peek view borders and arrow.")),ZMt=B("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,6,"Background color of the peek view result list."));B("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:fe.white,hcLight:Mc},g(Cg,7,"Foreground color for line nodes in the peek view result list."));B("peekViewResult.fileForeground",{dark:fe.white,light:"#1E1E1E",hcDark:fe.white,hcLight:Mc},g(Cg,8,"Foreground color for file nodes in the peek view result list."));B("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(Cg,9,"Background color of the selected entry in the peek view result list."));B("peekViewResult.selectionForeground",{dark:fe.white,light:"#6C6C6C",hcDark:fe.white,hcLight:Mc},g(Cg,10,"Foreground color of the selected entry in the peek view result list."));const aI=B("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:fe.black,hcLight:fe.white},g(Cg,11,"Background color of the peek view editor."));B("peekViewEditorGutter.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,12,"Background color of the gutter in the peek view editor."));B("peekViewEditorStickyScroll.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,13,"Background color of sticky scroll in the peek view editor."));B("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(Cg,14,"Match highlight color in the peek view result list."));B("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(Cg,15,"Match highlight color in the peek view editor."));B("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Cg,16,"Match highlight border in the peek view editor."));const cI="vs/editor/contrib/gotoSymbol/browser/referencesModel";class L1{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=Zwe.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?g(cI,1,"{0} in {1} on line {2} at column {3}",e.value,ui(this.uri),this.range.startLineNumber,this.range.startColumn):g(cI,0,"in {0} on line {1} at column {2}",ui(this.uri),this.range.startLineNumber,this.range.startColumn)}}class eNt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:s,column:o-t}),l=new O(s,c.startColumn,s,o),d=new O(r,a,r,Zn.MAX_SAFE_SMALL_INTEGER),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class z7{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new wi}dispose(){St(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g(cI,2,"1 symbol in {0}, full path {1}",ui(this.uri),this.uri.fsPath):g(cI,3,"{0} symbols in {1}, full path {2}",e,ui(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new eNt(i))}catch(i){bt(i)}return this}}class fp{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new I,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(fp._compareReferences);let s;for(const o of e)if((!s||!Fn.isEqual(s.uri,o.uri,!0))&&(s=new z7(this,o.uri),this.groups.push(s)),s.children.length===0||fp._compareReferences(o,s.children[s.children.length-1])!==0){const r=new L1(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){St(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new fp(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(cI,4,"No results found"):this.references.length===1?g(cI,5,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(cI,6,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(cI,7,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:LS(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&O.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Fn.compare(e.uri,t.uri)||O.compareRangesUsingStarts(e.range,t.range)}}var tNt=".monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-bottom-width:1px;border-top-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;padding:3em 0;text-align:center;width:100%}.monaco-editor .reference-zone-widget .ref-tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground);line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{overflow:hidden;text-overflow:ellipsis}.monaco-editor .reference-zone-widget .ref-tree .reference-file{color:var(--vscode-peekViewResult-fileForeground);display:inline-flex;height:100%;width:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-left:auto;margin-right:12px}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input,.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder,transparent);box-sizing:border-box}";Ct(tNt,{});var XCe;const ZCe="vs/editor/contrib/gotoSymbol/browser/peek/referencesTree";let eye=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof fp||e instanceof z7}getChildren(e){if(e instanceof fp)return e.groups;if(e instanceof z7)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};eye=D([_(0,Rn)],eye);class iNt{getHeight(){return 23}getTemplateId(e){return e instanceof z7?pte.id:mte.id}}let tye=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof L1){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return ui(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};tye=D([_(0,ti)],tye);class nNt{getId(e){return e instanceof L1?e.id:e.uri}}let iye=class extends ${constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new T7(i,{supportHighlights:!0})),this.badge=new Obe(he(i,we(".count")),{},tXe),e.appendChild(i)}set(e,t){const i=ma(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(g(ZCe,0,"{0} references",s)):this.badge.setTitleFormat(g(ZCe,1,"{0} reference",s))}};iye=D([_(1,eo)],iye);var uN;let pte=(uN=class{constructor(e){this._instantiationService=e,this.templateId=XCe.id}renderTemplate(e){return this._instantiationService.createInstance(iye,e)}renderElement(e,t,i){i.set(e.element,Cz(e.filterData))}disposeTemplate(e){e.dispose()}},XCe=uN,uN.id="FileReferencesRenderer",uN);pte=XCe=D([_(0,be)],pte);class sNt extends ${constructor(e){super(),this.label=this._register(new NI(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${ui(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:o}=i;t&&!sw.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,Cz(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[o]))}}}const Vae=class Vae{constructor(){this.templateId=Vae.id}renderTemplate(e){return new sNt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};Vae.id="OneReferenceRenderer";let mte=Vae;class oNt{getWidgetAriaLabel(){return g(ZCe,2,"References")}getAriaLabel(e){return e.ariaMessage}}const tpe="vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget",zae=class zae{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Z,this._callOnModelChange=new Z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(E.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(aNt,"ReferencesWidget",this._treeContainer,new iNt,[this._instantiationService.createInstance(pte),this._instantiationService.createInstance(mte)],this._instantiationService.createInstance(eye),i),this._splitView.addView({onDidChange:T.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},A1.Distribute),this._splitView.addView({onDidChange:T.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},A1.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof L1&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Jl(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g(tpe,1,"No results"),Oh(this._messageContainer),Promise.resolve(void 0)):(Jl(this._messageContainer),this._decorationsManager=new nye(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Oh(this._treeContainer),Oh(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof L1)return e;if(e instanceof z7&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==_e.inMemory?this.setTitle(Mx(e.uri),this._uriLabel.getUriLabel(ma(e.uri))):this.setTitle(g(tpe,2,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}St(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?vt.Smooth:vt.Immediate,a=O.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};sye=D([_(3,pn),_(4,Rn),_(5,be),_(6,Oet),_(7,eo),_(8,pO),_(9,ti),_(10,Di),_(11,lo)],sye);var DJ;const oye="vs/editor/contrib/gotoSymbol/browser/peek/referencesController",AO=new Y("referenceSearchVisible",!1,g(oye,0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var gN;let wF=(gN=class{static get(e){return e.getContribution(DJ.ID)}constructor(e,t,i,s,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=AO.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=rNt.fromJSON(this._storageService.get(o,ke.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(sye,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(oye,1,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),ke.PROFILE,ln.MACHINE),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{const{element:l,kind:d}=c;if(l)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":i?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const a=++this._requestIdPool;t.then(c=>{if(a!==this._requestIdPool||!this._widget){c.dispose();return}return this._model?.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(g(oye,2,"{0} ({1})",this._model.title,this._model.references.length));const l=this._editor.getModel().uri,d=new oe(e.startLineNumber,e.startColumn),h=this._model.nearestReference(l,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(x.peekWidgetDefaultFocus)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=O.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:jb.JUMP,pinned:t}},this._editor).then(s=>{if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=DJ.get(s),r=this._model.clone();this.closeWidget(),s.focus(),o?.toggleWidget(i,na(a=>Promise.resolve(r)),this._peekMode??!1)}},s=>{this._ignoreModelChangeEvent=!1,bt(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:jb.JUMP,pinned:i}},this._editor,t)}},DJ=gN,gN.ID="editor.contrib.referencesController",gN);wF=DJ=D([_(2,Pe),_(3,Qt),_(4,Pi),_(5,be),_(6,sn),_(7,Re)],wF);function EO(n,e){const t=Bet(n);if(!t)return;const i=wF.get(t);i&&e(i)}xr.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:ye.EditorContrib,primary:Br(V.CtrlCmd|E.KeyK,E.F2),when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});xr.registerCommandAndKeybindingRule({id:"goToNextReference",weight:ye.EditorContrib-10,primary:E.F4,secondary:[E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!0)})}});xr.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:ye.EditorContrib-10,primary:V.Shift|E.F4,secondary:[V.Shift|E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!1)})}});yt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");yt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");yt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");yt.registerCommand("closeReferenceSearch",n=>EO(n,e=>e.closeWidget()));xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.EditorContrib-101,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(mf.inPeekEditor,ge.not("config.editor.stablePeek"))});xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.WorkbenchContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(AO,ge.not("config.editor.stablePeek"),ge.or(X.editorTextFocus,SXe.negate()))});xr.registerCommandAndKeybindingRule({id:"revealReference",weight:ye.WorkbenchContrib,primary:E.Enter,mac:{primary:E.Enter,secondary:[V.CtrlCmd|E.DownArrow]},when:ge.and(AO,Rde,GNe.negate(),qNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.revealReference(t[0]))}});xr.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:ye.EditorContrib,primary:V.CtrlCmd|E.Enter,mac:{primary:V.WinCtrl|E.Enter},when:ge.and(AO,Rde,GNe.negate(),qNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!0,!0))}});yt.registerCommand("openReference",n=>{const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!1,!0))});let rye=class extends wF{constructor(e,t,i,s,o,r,a){super(!1,e,t,i,s,o,r,a)}};rye=D([_(1,Pe),_(2,Qt),_(3,Pi),_(4,be),_(5,sn),_(6,Re)],rye);vn(wF.ID,rye,mi.Lazy);const CBe=class CBe extends ${constructor(e){super(),this._editor=e,this._altListeningMouse=!1,this._altMouseTriggered=!1,this._register(this._editor.onMouseDown(t=>{this._altListeningMouse&&(this._altMouseTriggered=!0)})),this._register(this._editor.onKeyDown(t=>{t.equals(V.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(V.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};CBe.ID="editor.contrib.menuPreventer";let Hx=CBe;vn(Hx.ID,Hx,mi.BeforeFirstInteraction);let $7=class extends xm{constructor(e,t,i,s,o,r,a,c,l){super(e,s.getRawOptions(),i,o,r,a,c,l),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ym(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};$7=D([_(4,Pe),_(5,be),_(6,Qt),_(7,Lw),_(8,eD)],$7);const NQ=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1),e.dispose()}}}getImplementations(){return this._implementations}};class Wet extends wg{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=we(".floating-click-widget"),this._domNode.style.padding="6px 11px",this._domNode.style.borderRadius="2px",this._domNode.style.cursor="pointer",this._domNode.style.zIndex="1"}getDomNode(){return this._domNode}render(){Yo(this._domNode),this._domNode.style.backgroundColor=Zve(eS,Ye(us)),this._domNode.style.color=Zve(Zy,Ye(Mc)),this._domNode.style.border=`1px solid ${Ye(ft)}`,he(this._domNode,we("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let _te=class extends ${constructor(e,t,i){super(),this.renderEmitter=new I,this.onDidRender=this.renderEmitter.event,this.menu=this._register(t.createMenu(e,i))}render(){const e=this._register(new Z),t=()=>{if(e.clear(),!this.isVisible())return;const i=[];if(tD(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[s]=i,o=this.createWidget(s,e);e.add(o),e.add(o.onClick(()=>s.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};_te=D([_(1,mc),_(2,Pe)],_te);let QVe=class extends _te{constructor(e,t,i,s){super(e.menuId,i,s),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(Wet,e.label),s=i.getDomNode();return this.options.container.appendChild(s),t.add(Ee(()=>this.options.container.removeChild(s))),i}getActionArg(){return this.options.getActionArg()}};QVe=D([_(1,be),_(2,mc),_(3,Pe)],QVe);var kJ,c0;let jVe=(c0=class extends ${constructor(e){super(),this.editorService=e,this._onHighlightRemoved=this._register(new I),this.onHighlightRemoved=this._onHighlightRemoved.event,this.rangeHighlightDecorationId=null,this.editor=null,this.editorDisposables=this._register(new Z)}removeHighlightRange(){if(this.editor&&this.rangeHighlightDecorationId){const e=this.rangeHighlightDecorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e)}),this._onHighlightRemoved.fire()}this.rangeHighlightDecorationId=null}highlightRange(e,t){t=t??this.getEditor(e),ja(t)?this.doHighlightRange(t,e):HU(t)&&ja(t.activeCodeEditor)&&this.doHighlightRange(t.activeCodeEditor,e)}doHighlightRange(e,t){this.removeHighlightRange(),e.changeDecorations(i=>{this.rangeHighlightDecorationId=i.addDecoration(t.range,this.createRangeHighlightDecoration(t.isWholeLine))}),this.setEditor(e)}getEditor(e){const t=this.editorService.activeEditor?.resource;if(t&&_n(t,e.resource)&&ja(this.editorService.activeTextEditorControl))return this.editorService.activeTextEditorControl}setEditor(e){this.editor!==e&&(this.editorDisposables.clear(),this.editor=e,this.editorDisposables.add(this.editor.onDidChangeCursorPosition(t=>{(t.reason===Wi.NotSet||t.reason===Wi.Explicit||t.reason===Wi.Undo||t.reason===Wi.Redo)&&this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidChangeModel(()=>{this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidDispose(()=>{this.removeHighlightRange(),this.editor=null})))}createRangeHighlightDecoration(e=!0){return e?kJ._WHOLE_LINE_RANGE_HIGHLIGHT:kJ._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},kJ=c0,c0._WHOLE_LINE_RANGE_HIGHLIGHT=jt.register({description:"codeeditor-range-highlight-whole",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),c0._RANGE_HIGHLIGHT=jt.register({description:"codeeditor-range-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),c0);jVe=kJ=D([_(0,_i)],jVe);let vte=class extends Wet{constructor(e,t,i,s){super(i&&s.lookupKeybinding(i)?`${t} (${s.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};vte=D([_(3,ti)],vte);var wH;let KVe=(wH=class extends _te{constructor(e,t,i,s){super(Te.EditorContent,i,s),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(vte,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof oC)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},wH.ID="editor.contrib.floatingClickMenu",wH);KVe=D([_(1,be),_(2,mc),_(3,Pe)],KVe);const bS="vs/workbench/common/configuration";Object.freeze({id:"application",order:100,title:g(bS,0,"Application"),type:"object"});const PQ=Object.freeze({id:"workbench",order:7,title:g(bS,1,"Workbench"),type:"object"}),cNt=Object.freeze({id:"security",scope:ut.APPLICATION,title:g(bS,2,"Security"),type:"object",order:7}),lNt=Object.freeze({id:"problems",title:g(bS,3,"Problems"),type:"object",order:101}),Het=Object.freeze({id:"window",order:8,title:g(bS,4,"Window"),type:"object"}),Rm={ConfigurationMigration:"base.contributions.configuration.migration"};class dNt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const IJ=new dNt;it.add(Rm.ConfigurationMigration,IJ);var bH;let wte=(bH=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const s of i.added)await this.migrateConfigurationsForFolder(s,IJ.migrations)})),this.migrateConfigurations(IJ.migrations),this._register(IJ.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),s=this.workspaceService.getWorkbenchState()===Nn.WORKSPACE?[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE],["workspaceFolder",Ot.WORKSPACE_FOLDER]]:[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE]];for(const[o,r]of s){const a=i[o];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,o,a.value,t,void 0);for(const d of l??[])c.push([d,[]])}for(const{identifiers:l,value:d}of a.overrides??[])if(d!==void 0){const h=await this.runMigration(e,o,d,t,l);for(const u of h??[])c.push([u,l])}c.length&&await Promise.allSettled(c.map(async([[l,d],h])=>this.configurationService.updateValue(l,d.value,{resource:t,overrideIdentifiers:h},r)))}}async runMigration(e,t,i,s,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:s})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Io(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},bH.ID="workbench.contrib.configurationMigration",bH);wte=D([_(0,Re),_(1,Ti)],wte);var CH;let bte=(CH=class extends ${constructor(e){super(),this.remoteAgentService=e,this._ready=new sd,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Is&&(await this.remoteAgentService.getEnvironment())?.os!==Pr.Windows)return;it.as(Cs.Configuration).registerConfiguration({...cNt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(bS,5,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(bS,6,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(bS,7,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE}}})}},CH.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",CH);bte=D([_(0,Sf)],bte);const C5="window.newWindowProfile";var yH;let Cte=(yH=class extends ${constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==Ot.DEFAULT&&i.affectsConfiguration(C5)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=it.as(Cs.Configuration),t={...Het,properties:{[C5]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(bS,8,"Active Window")],description:g(bS,9,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the default profile if no active window exists."),scope:ut.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(C5);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(C5);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(C5,t?.name)}},yH.ID="workbench.contrib.dynamicWindowConfiguration",yH);Cte=D([_(0,V_),_(1,Re)],Cte);const Fw="vs/editor/browser/widget/diffEditor/commands";class hNt extends pi{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Be(Fw,0,"Toggle Collapse Unchanged Regions"),icon:Ce.map,toggled:ge.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ge.has("isInDiffEditor"),menu:{when:ge.has("isInDiffEditor"),id:Te.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class Uet extends pi{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Be(Fw,1,"Toggle Show Moved Code Blocks"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class Vet extends pi{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Be(Fw,2,"Toggle Use Inline View When Space Is Limited"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const FQ=Be(Fw,3,"Diff Editor");class uNt extends wf{constructor(){super({id:"diffEditor.switchSide",title:Be(Fw,4,"Switch Side"),icon:Ce.arrowSwap,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,i){const s=Oz(e);if(s instanceof xm){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class gNt extends wf{constructor(){super({id:"diffEditor.exitCompareMove",title:Be(Fw,5,"Exit Compare Move"),icon:Ce.close,precondition:X.comparingMovedCode,f1:!1,category:FQ,keybinding:{weight:1e4,primary:E.Escape}})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.exitCompareMove()}}class fNt extends wf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Be(Fw,6,"Collapse All Unchanged Regions"),icon:Ce.fold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.collapseAllUnchangedRegions()}}class pNt extends wf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Be(Fw,7,"Show All Unchanged Regions"),icon:Ce.unfold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.showAllUnchangedRegions()}}class aye extends pi{constructor(){super({id:"diffEditor.revert",title:Be(Fw,8,"Revert"),f1:!1,category:FQ})}run(e,t){const i=mNt(e,t.originalUri,t.modifiedUri);i instanceof xm&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const zet=Be(Fw,9,"Accessible Diff Viewer"),$ae=class $ae extends pi{constructor(){super({id:$ae.id,title:Be(Fw,10,"Go to Next Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerNext()}};$ae.id="editor.action.accessibleDiffViewer.next";let _V=$ae;const Gae=class Gae extends pi{constructor(){super({id:Gae.id,title:Be(Fw,11,"Go to Previous Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:V.Shift|E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerPrev()}};Gae.id="editor.action.accessibleDiffViewer.prev";let G7=Gae;function mNt(n,e,t){return n.get(Qt).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Oz(n){const t=n.get(Qt).listDiffEditors(),i=xl();if(i)for(const s of t){const o=s.getContainerDomNode();if(_Nt(o,i))return s}return null}function _Nt(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}var rC;(function(n){n.Terminal="terminal",n.TerminalChat="terminal-chat",n.TerminalHelp="terminal-help",n.DiffEditor="diffEditor",n.Chat="panelChat",n.InlineChat="inlineChat",n.InlineCompletions="inlineCompletions",n.KeybindingsEditor="keybindingsEditor",n.Notebook="notebook",n.Editor="editor",n.Hover="hover",n.Notification="notification",n.EmptyEditorHint="emptyEditorHint",n.Comments="comments"})(rC||(rC={}));var N_;(function(n){n.Help="help",n.View="view"})(N_||(N_={}));var YVe;(function(n){n.Previous="previous",n.Next="next"})(YVe||(YVe={}));const Ea="vs/workbench/contrib/speech/common/speechService",vNt=new Y("hasSpeechProvider",!1,{type:"boolean",description:g(Ea,0,"A speech provider is registered to the speech service.")}),wNt=new Y("speechToTextInProgress",!1,{type:"boolean",description:g(Ea,1,"A speech-to-text session is in progress.")});new Y("textToSpeechInProgress",!1,{type:"boolean",description:g(Ea,2,"A text-to-speech session is in progress.")});var l2;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(l2||(l2={}));var cye;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(cye||(cye={}));var JVe;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped",n[n.Canceled=3]="Canceled"})(JVe||(JVe={}));var jW;(function(n){n.SpeechTimeout="accessibility.voice.speechTimeout",n.AutoSynthesize="accessibility.voice.autoSynthesize",n.SpeechLanguage="accessibility.voice.speechLanguage"})(jW||(jW={}));jW.SpeechLanguage;const bNt={"da-DK":{name:g(Ea,3,"Danish (Denmark)")},"de-DE":{name:g(Ea,4,"German (Germany)")},"en-AU":{name:g(Ea,5,"English (Australia)")},"en-CA":{name:g(Ea,6,"English (Canada)")},"en-GB":{name:g(Ea,7,"English (United Kingdom)")},"en-IE":{name:g(Ea,8,"English (Ireland)")},"en-IN":{name:g(Ea,9,"English (India)")},"en-NZ":{name:g(Ea,10,"English (New Zealand)")},"en-US":{name:g(Ea,11,"English (United States)")},"es-ES":{name:g(Ea,12,"Spanish (Spain)")},"es-MX":{name:g(Ea,13,"Spanish (Mexico)")},"fr-CA":{name:g(Ea,14,"French (Canada)")},"fr-FR":{name:g(Ea,15,"French (France)")},"hi-IN":{name:g(Ea,16,"Hindi (India)")},"it-IT":{name:g(Ea,17,"Italian (Italy)")},"ja-JP":{name:g(Ea,18,"Japanese (Japan)")},"ko-KR":{name:g(Ea,19,"Korean (South Korea)")},"nl-NL":{name:g(Ea,20,"Dutch (Netherlands)")},"pt-PT":{name:g(Ea,21,"Portuguese (Portugal)")},"pt-BR":{name:g(Ea,22,"Portuguese (Brazil)")},"ru-RU":{name:g(Ea,23,"Russian (Russia)")},"sv-SE":{name:g(Ea,24,"Swedish (Sweden)")},"tr-TR":{name:g(Ea,25,"Turkish (Türkiye)")},"zh-CN":{name:g(Ea,26,"Chinese (Simplified, China)")},"zh-HK":{name:g(Ea,27,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(Ea,28,"Chinese (Traditional, Taiwan)")}},dt="vs/workbench/contrib/accessibility/browser/accessibilityConfiguration",T1=new Y("accessibilityHelpIsShown",!1,!0),Dm=new Y("accessibleViewIsShown",!1,!0),yte=new Y("accessibleViewSupportsNavigation",!1,!0),XVe=new Y("accessibleViewVerbosityEnabled",!1,!0),ZVe=new Y("accessibleViewGoToSymbolSupported",!1,!0);new Y("accessibleViewOnLastLine",!1,!0);const Ste=new Y("accessibleViewCurrentProviderId",void 0,void 0);new Y("accessibleViewInCodeBlock",void 0,void 0);const Ate=new Y("accessibleViewContainsCodeBlocks",void 0,void 0);var lye;(function(n){n.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",n.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",n.HideAccessibleView="accessibility.hideAccessibleView",n.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(lye||(lye={}));var e4e;(function(n){n[n.Default=.75]="Default",n[n.Minimum=.2]="Minimum",n[n.Maximum=1]="Maximum"})(e4e||(e4e={}));var ua;(function(n){n.Terminal="accessibility.verbosity.terminal",n.DiffEditor="accessibility.verbosity.diffEditor",n.Chat="accessibility.verbosity.panelChat",n.InlineChat="accessibility.verbosity.inlineChat",n.TerminalChat="accessibility.verbosity.terminalChat",n.InlineCompletions="accessibility.verbosity.inlineCompletions",n.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",n.Notebook="accessibility.verbosity.notebook",n.Editor="accessibility.verbosity.editor",n.Hover="accessibility.verbosity.hover",n.Notification="accessibility.verbosity.notification",n.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",n.Comments="accessibility.verbosity.comments",n.DiffEditorActive="accessibility.verbosity.diffEditorActive"})(ua||(ua={}));const Q_={type:"boolean",default:!0,tags:["accessibility"]},$et=Object.freeze({id:"accessibility",title:g(dt,0,"Accessibility"),type:"object"}),yc={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(dt,1,"Enable sound when a screen reader is attached."),g(dt,2,"Enable sound."),g(dt,3,"Disable sound.")],tags:["accessibility"]},ph={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},mh={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(dt,4,"Enable announcement, will only play when in screen reader optimized mode."),g(dt,5,"Disable announcement.")],tags:["accessibility"]},DL={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...$et,scope:ut.RESOURCE,properties:(ua.Terminal+"",{description:g(dt,6,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...Q_},ua.DiffEditor+"",{description:g(dt,7,"Provide information about how to navigate changes in the diff editor when it is focused."),...Q_},ua.Chat+"",{description:g(dt,8,"Provide information about how to access the chat help menu when the chat input is focused."),...Q_},ua.InlineChat+"",{description:g(dt,9,"Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused."),...Q_},ua.InlineCompletions+"",{description:g(dt,10,"Provide information about how to access the inline completions hover and Accessible View."),...Q_},ua.KeybindingsEditor+"",{description:g(dt,11,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...Q_},ua.Notebook+"",{description:g(dt,12,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...Q_},ua.Hover+"",{description:g(dt,13,"Provide information about how to open the hover in an Accessible View."),...Q_},ua.Notification+"",{description:g(dt,14,"Provide information about how to open the notification in an Accessible View."),...Q_},ua.EmptyEditorHint+"",{description:g(dt,15,"Provide information about relevant actions in an empty text editor."),...Q_},ua.Comments+"",{description:g(dt,16,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...Q_},ua.DiffEditorActive+"",{description:g(dt,17,"Indicate when a diff editor becomes the active editor."),...Q_},lye.AccessibleViewCloseOnKeyPress+"",g(dt,18,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(dt,19,"The volume of the sounds in percent (0-100)."),g(dt,20,"Whether or not position changes should be debounced"),g(dt,21,"The delay in milliseconds before an announcement is made."),g(dt,22,"The delay in milliseconds before a sound is played."),g(dt,23,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(dt,24,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(dt,25,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(dt,26,"The delay in milliseconds before a sound is played when there's an error at the position."),{...ph,description:g(dt,27,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(dt,28,"Plays a sound when the active line has a breakpoint."),...yc},{description:g(dt,29,"Announces when the active line has a breakpoint."),...mh})},{...DL,description:g(dt,30,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(dt,31,"Plays a sound when the active line has an inline suggestion."),...yc}},{...ph,description:g(dt,32,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(dt,33,"Plays a sound when the active line has an error."),...yc},{description:g(dt,34,"Announces when the active line has an error."),...mh})},{...ph,description:g(dt,35,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(dt,36,"Plays a sound when the active line has a folded area that can be unfolded."),...yc},{description:g(dt,37,"Announces when the active line has a folded area that can be unfolded."),...mh})},{...ph,description:g(dt,38,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,39,"Plays a sound when the active line has a warning."),...yc},{description:g(dt,40,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,41,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,42,"Plays a sound when the active line has a warning."),...yc},{description:g(dt,43,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,44,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,45,"Plays a sound when the active line has a warning."),...yc},{description:g(dt,46,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,47,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(dt,48,"Plays a sound when the debugger stopped on a breakpoint."),...yc},{description:g(dt,49,"Announces when the debugger stopped on a breakpoint."),...mh})},{...ph,description:g(dt,50,"Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."),properties:({description:g(dt,51,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...yc},{description:g(dt,52,"Announces when trying to read a line with inlay hints that has no inlay hints."),...mh})},{...ph,description:g(dt,53,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(dt,54,"Plays a sound when a task is completed."),...yc},{description:g(dt,55,"Announces when a task is completed."),...mh})},{...ph,description:g(dt,56,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(dt,57,"Plays a sound when a task fails (non-zero exit code)."),...yc},{description:g(dt,58,"Announces when a task fails (non-zero exit code)."),...mh})},{...ph,description:g(dt,59,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,60,"Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...yc},{description:g(dt,61,"Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,62,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,63,"Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...yc},{description:g(dt,64,"Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,65,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(dt,66,"Plays a sound when terminal Quick Fixes are available."),...yc},{description:g(dt,67,"Announces when terminal Quick Fixes are available."),...mh})},{...ph,description:g(dt,68,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(dt,69,"Plays a sound when the terminal bell is ringing."),...yc},{description:g(dt,70,"Announces when the terminal bell is ringing."),...mh})},{...DL,description:g(dt,71,"Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,72,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...yc}},{...DL,description:g(dt,73,"Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,74,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...yc}},{...DL,description:g(dt,75,"Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,76,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...yc}},{...ph,description:g(dt,77,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(dt,78,"Plays a sound when a notebook cell execution is successfully completed."),...yc},{description:g(dt,79,"Announces when a notebook cell execution is successfully completed."),...mh})},{...ph,description:g(dt,80,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(dt,81,"Plays a sound when a notebook cell execution fails."),...yc},{description:g(dt,82,"Announces when a notebook cell execution fails."),...mh})},{...ph,description:g(dt,83,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(dt,84,"Plays a sound when a chat request is made."),...yc},{description:g(dt,85,"Announces when a chat request is made."),...mh})},{...ph,description:g(dt,86,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(dt,87,"Plays a sound on loop while progress is occurring."),...yc},{description:g(dt,88,"Alerts on loop while progress is occurring."),...mh})},{...DL,description:g(dt,89,"Plays a sound / audio cue when the response has been received."),properties:{description:g(dt,90,"Plays a sound on loop while the response has been received."),...yc}},{...DL,description:g(dt,91,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(dt,92,"Plays a sound when the voice recording has started."),...yc}},{...DL,description:g(dt,93,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(dt,94,"Plays a sound when the voice recording has stopped."),...yc}},{...ph,description:g(dt,95,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."),properties:({description:g(dt,96,"Plays a sound when a feature is cleared."),...yc},{description:g(dt,97,"Announces when a feature is cleared."),...mh})},g(dt,98,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(dt,99,"Plays a sound when a file is saved."),g(dt,100,"Plays the sound when a user explicitly saves a file."),g(dt,101,"Plays the sound whenever a file is saved, including auto save."),g(dt,102,"Never plays the sound."),g(dt,103,"Announces when a file is saved."),g(dt,104,"Announces when a user explicitly saves a file."),g(dt,105,"Announces whenever a file is saved, including auto save."),g(dt,106,"Never plays the announcement."),g(dt,107,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(dt,108,"Plays a sound when a file or notebook is formatted."),g(dt,109,"Plays the sound when a user explicitly formats a file."),g(dt,110,"Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,111,"Never plays the sound."),g(dt,112,"Announces when a file or notebook is formatted."),g(dt,113,"Announces when a user explicitly formats a file."),g(dt,114,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,115,"Never announces."))});const CNt=1200;var SH;let t4e=(SH=class extends ${constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(T.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((s,o)=>e[s].name.localeCompare(e[o].name));it.as(Cs.Configuration).registerConfiguration({...$et,properties:{[jW.SpeechTimeout]:{markdownDescription:g(dt,119,"The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."),type:"number",default:CNt,minimum:0,tags:["accessibility"]},[jW.SpeechLanguage]:{markdownDescription:g(dt,120,"The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."),type:"string",enum:t,default:"auto",tags:["accessibility"],enumDescriptions:t.map(s=>e[s].name),enumItemLabels:t.map(s=>e[s].name)},[jW.AutoSynthesize]:{type:"boolean",markdownDescription:g(dt,121,"Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."),default:this.productService.quality!=="stable",tags:["accessibility"]}}})}getLanguages(){return{auto:{name:g(dt,122,"Auto (Use Display Language)")},...bNt}}},SH.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",SH);t4e=D([_(0,Xde),_(1,Ja)],t4e);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["audioCues.volume",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["audioCues.debouncePositionChanges",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(n,e)=>{const t=n.delays;return t?[["accessibility.signalOptions",{value:{...n,"experimental.delays":t,delays:void 0}}]]:[]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["accessibility.signals.sounds.volume",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}}]);function Get(n){return n("accessibility.signalOptions")?.volume||n("accessibility.signals.sounds.volume")||n("audioCues.volume")}function qet(n){return n("accessibility.signalOptions")?.debouncePositionChanges||n("accessibility.signals.debouncePositionChanges")||n("audioCues.debouncePositionChanges")}it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(n,e)=>[["accessibility.signals.progress",{value:n}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.map(n=>n.legacySoundSettingsKey?{key:n.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],s=n.legacyAnnouncementSettingsKey;let o;return s&&(o=t(s)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${n.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(yl));it.as(Rm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.filter(n=>!!n.legacyAnnouncementSettingsKey&&!!n.legacySoundSettingsKey).map(n=>({key:n.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],s=t(n.settingsKey)?.sound||t(n.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${n.settingsKey}`,{value:e!==void 0?{announcement:e,sound:s}:{sound:s}}]),i.push([`${n.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Ru;(function(n){n.OpenAccessibleView="editor.action.accessibleView",n.OpenAccessibilityHelp="editor.action.accessibilityHelp",n.DisableVerbosityHint="editor.action.accessibleViewDisableHint",n.GoToSymbol="editor.action.accessibleViewGoToSymbol",n.ShowNext="editor.action.accessibleViewNext",n.ShowPrevious="editor.action.accessibleViewPrevious",n.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",n.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",n.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",n.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",n.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Ru||(Ru={}));const Qet="editor.action.inlineSuggest.commit",jet="editor.action.inlineSuggest.showPrevious",Ket="editor.action.inlineSuggest.showNext";var yNt=".monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{cursor:pointer;display:inline-block;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{font-size:0;opacity:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border);color:var(--vscode-editorGhostText-foreground)!important}";Ct(yNt,{});class q7{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}render(e,t=!1){return new WU([...this.parts.map(i=>new ug(O.fromPositions(new oe(this.lineNumber,i.column)),t?`[${i.lines.join(` + The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${n.identifier.value}`)}class cMt{constructor(e,t,i,s){this.codeLoadingTime=e,this.activateCallTime=t,this.activateResolvedTime=i,this.activationReason=s}}class lMt{constructor(e,t){this.description=e,this.value=t}}var sC;(function(n){n[n.Normal=0]="Normal",n[n.Immediate=1]="Immediate"})(sC||(sC={}));function che(n){return{type:n.isBuiltin?qr.System:qr.User,isBuiltin:n.isBuiltin||n.isUserBuiltin,identifier:{id:ny(n.publisher,n.name),uuid:n.uuid},manifest:n,location:n.extensionLocation,targetPlatform:n.targetPlatform,validations:[],isValid:!0}}function ME(n,e){return{identifier:new Cn(_F(n.manifest.publisher,n.manifest.name)),isBuiltin:n.type===qr.System,isUserBuiltin:n.type===qr.User&&n.isBuiltin,isUnderDevelopment:!!e,extensionLocation:n.location,...n.manifest,uuid:n.identifier.uuid,targetPlatform:n.targetPlatform,publisherDisplayName:n.publisherDisplayName}}class dMt{constructor(){this.onDidRegisterExtensions=T.None,this.onDidChangeExtensionsStatus=T.None,this.onDidChangeExtensions=T.None,this.onWillActivateByEvent=T.None,this.onDidChangeResponsiveChange=T.None,this.onWillStop=T.None,this.extensions=[]}activateByEvent(e){return Promise.resolve(void 0)}activateById(e,t){return Promise.resolve(void 0)}activationEventIsDone(e){return!1}whenInstalledExtensionsRegistered(){return Promise.resolve(!0)}getExtension(){return Promise.resolve(void 0)}readExtensionPointContributions(e){return Promise.resolve(Object.create(null))}getExtensionsStatus(){return Object.create(null)}getInspectPorts(e,t){return Promise.resolve([])}stopExtensionHosts(){}async startExtensionHosts(){}async setRemoteEnvironment(e){}canAddExtension(){return!1}canRemoveExtension(){return!1}}const Ret=ae("ILanguageModelStatsService"),hMt=ae("accessibleViewInformationService"),uMt=ae("IUserDataProfileStorageService"),gMt=ae("issueService"),fMt=ae("integrityService"),lhe=ae("ITrustedDomainService"),pMt={};let mMt;function _Mt(n){return pMt[n]}function vMt(){return mMt}function A(){throw new Error("unsupported")}async function wMt(n){await new Promise(e=>setTimeout(e,n))}function bMt(n,e,t){let i=Promise.resolve(),s=null;return async o=>{s==null?(s=o,i=i.then(async()=>wMt(t)).then(async()=>{const r=s;s=null,await n(r)})):s=e(s,o),await i}}var AK;ce(wp,class extends IYe{constructor(){super(Pn.Info,P.file("logs.log"))}doCreateLogger(){return new LYe}},0);ce(_i,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=T.None,this.onDidActiveEditorChange=T.None,this.onDidVisibleEditorsChange=T.None,this.onDidEditorsChange=T.None,this.onDidCloseEditor=T.None,this.activeEditorPane=void 0,this.activeEditor=void 0,this.activeTextEditorLanguageId=void 0,this.visibleEditorPanes=[],this.visibleEditors=[],this.visibleTextEditorControls=[],this.editors=[],this.count=0,this.getEditors=()=>[],this.openEditor=A,this.openEditors=A,this.replaceEditors=async()=>{},this.isOpened=()=>!1,this.isVisible=()=>!1,this.closeEditor=async()=>{},this.closeEditors=async()=>{},this.findEditors=()=>[],this.save=async()=>({success:!1,editors:[]}),this.saveAll=async()=>({success:!1,editors:[]}),this.revert=async()=>!1,this.revertAll=async()=>!1}get activeTextEditorControl(){return Lt.get(jt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Nw,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=T.None,this.onDidPaneCompositeClose=T.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=A,this.showActivity=()=>$.None}},0);ce(_o,VCe,1);ce(tr,class{constructor(){this.isDirty=A,this.save=A,this.saveAs=A,this.revert=A,this.read=A,this.readStream=A,this.write=A,this.create=A,this.getEncodedReadable=A,this.getDecodedStream=A,this.dispose=A}get files(){return A()}get untitled(){return A()}get encoding(){return A()}},0);ce(ci,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=T.None,this.onDidChangeFileSystemProviderCapabilities=T.None,this.onWillActivateFileSystemProvider=T.None,this.registerProvider=A,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=T.None,this.onDidRunOperation=T.None,this.resolve=A,this.resolveAll=A,this.stat=A,this.exists=async()=>!1,this.readFile=A,this.readFileStream=A,this.writeFile=A,this.move=A,this.canMove=A,this.copy=A,this.canCopy=A,this.cloneFile=A,this.createFile=A,this.canCreateFile=A,this.createFolder=A,this.del=A,this.canDelete=A,this.onDidWatchError=T.None,this.watch=A,this.createWatcher=A}dispose(){}},0);let CMt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=A,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=A,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=A,this.notifyIndexChanged=A,this.relayout=A,this.dispose=A,this.toJSON=A,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=A,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=A,this.openEditor=A,this.openEditors=A,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=A,this.moveEditors=A,this.copyEditor=A,this.copyEditors=A,this.closeEditor=A,this.closeEditors=A,this.closeAllEditors=A,this.replaceEditors=A,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=A,this.isLast=A}get groupsView(){return A()}notifyLabelChanged(){}get titleHeight(){return A()}get element(){return A()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}};const dte=new CMt;let yMt=class{constructor(){this.windowId=yi.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=A,this.isLayoutCentered=A,this.enforcePartOptions=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.applyLayout=A,this.getLayout=A,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=A}get contentDimension(){return A()}get sideGroup(){return A()}},SMt=class{constructor(){this.registerContextKeyProvider=A,this.saveWorkingSet=A,this.getWorkingSets=A,this.applyWorkingSet=A,this.deleteWorkingSet=A,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new yMt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=A,this.createAuxiliaryEditorPart=A,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=A,this.toggleExpandGroup=A,this.partOptions=Kde,this.createEditorDropTarget=A,this._serviceBrand=void 0,this.getLayout=A,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dte,this.groups=[dte],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=A,this.getSize=A,this.setSize=A,this.arrangeGroups=A,this.applyLayout=A,this.centerLayout=A,this.isLayoutCentered=()=>!1,this.setGroupOrientation=A,this.findGroup=()=>{},this.addGroup=A,this.removeGroup=A,this.moveGroup=A,this.mergeGroup=A,this.mergeAllGroups=A,this.copyGroup=A,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=A}get contentDimension(){return A()}get sideGroup(){return A()}};ce(ur,SMt,0);ce(TRt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(zRt,class{constructor(){this.getPart=A,this.createAuxiliaryTitlebarPart=A,this.dispose=A,this.onMenubarVisibilityChange=T.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=T.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(fC,class{constructor(){this.onWillRunWorkingCopyFileOperation=T.None,this.onDidFailWorkingCopyFileOperation=T.None,this.onDidRunWorkingCopyFileOperation=T.None,this.addFileOperationParticipant=A,this.hasSaveParticipants=!1,this.addSaveParticipant=A,this.runSaveParticipants=A,this.create=A,this.createFolder=A,this.move=A,this.copy=A,this.delete=A,this.registerWorkingCopyProvider=A,this.getDirty=()=>[]}},0);ce(Lm,class{constructor(){this.defaultUriScheme="file",this.fileURI=A,this.userHome=A,this.hasValidBasename=A,this.resolvedUserHome=void 0}get path(){return A()}},1);ce(Ja,class{constructor(){this._serviceBrand=void 0,this.version="1.90.2",this.commit="5437499feb04f7a586f677b155b039bc2b3669eb",this.quality="oss",this.nameShort="Code - OSS Dev",this.nameLong="Code - OSS Dev",this.applicationName="code-oss",this.dataFolderName=".vscode-oss",this.urlProtocol="code-oss",this.reportIssueUrl="https://github.com/microsoft/vscode/issues/new",this.licenseName="MIT",this.licenseUrl="https://github.com/microsoft/vscode/blob/main/LICENSE.txt",this.serverApplicationName="code-server-oss"}},0);ce(dTt,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(OPe,class{constructor(){this.onDidChange=T.None,this.addStatus=A,this.getLanguageStatus=A}},1);ce(Id,class{constructor(){this.onDidChangeFullScreen=T.None,this.onDidChangeFocus=T.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=A,this.onDidChangeActiveWindow=T.None,this.openWindow=A,this.toggleFullScreen=A,this.moveTop=A,this.getCursorScreenPoint=A,this.restart=A,this.reload=A,this.close=A,this.withExpectedShutdown=A}},0);ce(mg,class extends $Ce{constructor(){super(...arguments),this.shutdown=A}},0);ce(LQ,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(ho,dMt,0);ce(fTt,class{constructor(){this.onDidChangeKeyboardLayout=T.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new ORt(!1,$c),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(ahe,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(xet,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=T.None}},0);let GCe=class{constructor(e){this.profileService=e,this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=A,this.createPreferencesEditorModel=A,this.resolveModel=A,this.createSettings2EditorModel=A,this.openRawDefaultSettings=A,this.openSettings=A,this.openUserSettings=A,this.openRemoteSettings=A,this.openWorkspaceSettings=A,this.openFolderSettings=A,this.openGlobalKeybindingSettings=A,this.openDefaultKeybindingsFile=A,this.getEditableSettingsURI=A,this.createSplitJsonEditorInput=A,this.openApplicationSettings=A,this.openLanguageSpecificSettings=A}};GCe=D([_(0,Tm)],GCe);ce(TQ,GCe,0);ce(VRt,class{constructor(){this.onDidEncounterLanguage=T.None,this.createGrammar=A,this.startDebugMode=A,this.createTokenizer=A}},0);let qCe=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=T.None,this.isEnabled=()=>!1,this.createNamedProfile=A,this.createTransientProfile=A,this.resetWorkspaces=A,this.cleanUp=A,this.cleanUpTransientProfiles=A,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=T.None,this.profiles=[this.profileService.currentProfile],this.createProfile=A,this.updateProfile=A,this.setProfileForWorkspace=A,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=A}get profilesHome(){return A()}};qCe=D([_(0,Tm)],qCe);ce(V_,qCe,0);ce(uMt,class{constructor(){this.onDidChange=T.None,this.readStorageData=A,this.updateStorageData=A,this.withProfileScopedStorageService=A}},0);let QCe=class extends KRt{constructor(e){super({...S3("__default__profile__","Default",e.userRoamingDataHome,Qt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};QCe=D([_(0,Il)],QCe);ce(Tm,QCe,0);ce(sPe,TZe,0);ce($_,class{constructor(){this.getSnippetFiles=A,this.isEnabled=A,this.updateEnablement=A,this.updateUsageTimestamp=A,this.getSnippets=async()=>[],this.getSnippetsSync=A}},0);const AMt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:T.None,onDidChangeCallStack:T.None,onDidChangeWatchExpressions:T.None,fetchCallstack:A,getId:A,registerBreakpointModes:A,getBreakpointModes:()=>[]};class EMt{constructor(){this.setVisualizedExpression=A,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=T.None,this.getId=A,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=A,this.setSelectedExpression=A,this.updateViews=A,this.isMultiSessionView=A,this.onDidFocusSession=T.None,this.onDidFocusStackFrame=T.None,this.onDidSelectExpression=T.None,this.onDidEvaluateLazyExpression=T.None,this.onWillUpdateViews=T.None,this.onDidFocusThread=T.None,this.evaluateLazyExpression=A}}class xMt{constructor(){this.onDidRegisterDebugger=T.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=A,this.getDebuggerLabel=A,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=A,this.registerDebugAdapterFactory=()=>$.None,this.createDebugAdapter=A,this.registerDebugAdapterDescriptorFactory=A,this.unregisterDebugAdapterDescriptorFactory=A,this.substituteVariables=A,this.runInTerminal=A,this.getEnabledDebugger=A,this.guessDebugger=A,this.onDidDebuggersExtPointRead=T.None}}ce(IPe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=A,this.updateDataBreakpoint=A,this.onDidChangeState=T.None,this.onDidNewSession=T.None,this.onWillNewSession=T.None,this.onDidEndSession=T.None,this.getConfigurationManager=A,this.getAdapterManager=()=>new xMt,this.focusStackFrame=A,this.canSetBreakpointsIn=A,this.addBreakpoints=A,this.updateBreakpoints=A,this.enableOrDisableBreakpoints=A,this.setBreakpointsActivated=A,this.removeBreakpoints=A,this.addFunctionBreakpoint=A,this.updateFunctionBreakpoint=A,this.removeFunctionBreakpoints=A,this.addDataBreakpoint=A,this.removeDataBreakpoints=A,this.addInstructionBreakpoint=A,this.removeInstructionBreakpoints=A,this.setExceptionBreakpointCondition=A,this.setExceptionBreakpointsForSession=A,this.sendAllBreakpoints=A,this.addWatchExpression=A,this.renameWatchExpression=A,this.moveWatchExpression=A,this.removeWatchExpressions=A,this.startDebugging=A,this.restartSession=A,this.stopSession=A,this.sourceIsNotAvailable=A,this.getModel=()=>AMt,this.getViewModel=()=>new EMt,this.runTo=A}get state(){return A()}},0);ce(EQ,class{constructor(){this.request=A,this.resolveProxy=A,this.loadCertificates=A}},0);ce(Ade,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequest=T.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=T.None,this.completeOpenFilesTrustRequest=A,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=A,this.completeWorkspaceTrustRequest=A,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(LRt,class{constructor(){this.onDidChangeActivity=T.None,this.getViewContainerActivities=A,this.getActivity=A,this.showViewContainerActivity=()=>$.None,this.showViewActivity=()=>$.None,this.showAccountsActivity=()=>$.None,this.showGlobalActivity=()=>$.None}},0);ce(kZe,class{constructor(){this.reload=A,this.onReload=T.None,this.close=A,this.onClose=T.None,this.attachSession=A,this.onAttachSession=T.None,this.terminateSession=A,this.onTerminateSession=T.None,this.openExtensionDevelopmentHostWindow=A}},0);ce(q_,class{constructor(){this.getFocusedViewName=A,this.onDidChangeFocusedView=T.None,this.onDidChangeViewContainerVisibility=T.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=A,this.closeViewContainer=A,this.getVisibleViewContainer=A,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=T.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=A,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(z_,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=T.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=A,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=A,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:T.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=T.None,this.moveViewContainerToLocation=A,this.getViewContainerBadgeEnablementState=A,this.setViewContainerBadgeEnablementState=A,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=T.None,this.moveViewsToContainer=A,this.onDidChangeLocation=T.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(NRt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=A,this.goBack=A,this.goPrevious=A,this.goLast=A,this.reopenLastClosedEditor=A,this.getHistory=()=>[],this.removeFromHistory=A,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=A,this.openPreviouslyUsedEditor=A,this.clear=A,this.clearRecentlyOpened=A}},0);ce(XZe,class{constructor(){this.onDidChangeTaskConfig=T.None,this.onDidStateChange=T.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=A,this.run=A,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=A,this.terminate=A,this.tasks=A,this.taskTypes=A,this.getWorkspaceTasks=A,this.getSavedTasks=A,this.removeRecentlyUsedTask=A,this.getTask=A,this.tryResolveTask=A,this.createSorter=A,this.getTaskDescription=A,this.customize=A,this.openConfig=A,this.registerTaskProvider=A,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=T.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=A,this.isReconnected=!1,this.onDidReconnectToTasks=T.None}},0);ce(_et,class{constructor(){this.resolveWithEnvironment=A,this.resolveAsync=A,this.resolveAnyAsync=A,this.resolveAnyMap=A,this.resolveWithInteractionReplace=A,this.resolveWithInteraction=A,this.contributeVariable=A}},0);ce(Sf,class{constructor(){this.getConnection=()=>null,this.getEnvironment=async()=>null,this.getRawEnvironment=async()=>null,this.getExtensionHostExitInfo=async()=>null,this.getRoundTripTime=async()=>{},this.whenExtensionsReady=async()=>{},this.scanExtensions=async()=>[],this.scanSingleExtension=async()=>null,this.getDiagnosticInfo=async()=>{},this.updateTelemetryLevel=async()=>{},this.logTelemetry=async()=>{},this.flushTelemetry=async()=>{}}},0);ce(Igt,mTt,0);let jCe=class{constructor(e){this.modelService=e,this.aiTextSearch=A,this.textSearchSplitSyncAsync=A,this.registerSearchResultProvider=A}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};jCe=D([_(0,Ai)],jCe);ce(ohe,jCe,0);ce(APe,class{constructor(){this.registerEditSessionIdentityProvider=()=>$.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>$.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce($S,class{constructor(){this.addFolders=A,this.removeFolders=A,this.updateFolders=A,this.enterWorkspace=A,this.createAndEnterWorkspace=A,this.saveAndEnterWorkspace=A,this.copyWorkspaceSettings=A,this.pickNewWorkspacePath=A}},0);ce(Det,class{constructor(){this.getStartTime=A,this.whenReady=A,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=A,this.getDuration=A}get perfBaseline(){return A()}get startupMetrics(){return A()}},0);ce(pr,class{constructor(){this.getResourceExtensions=A,this.updateRunningExtensions=A,this.togglePreRelease=A,this.isAutoUpdateEnabledFor=A,this.updateAutoUpdateEnablementFor=A,this.isAutoUpdateEnabled=A,this.getAutoUpdateValue=A,this.updateAll=A,this.toggleApplyExtensionToAllProfiles=A,this.whenInitialized=Promise.resolve(),this.onChange=T.None,this.onReset=T.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=A,this.queryGallery=A,this.getExtensions=A,this.canInstall=A,this.install=A,this.installInServer=A,this.uninstall=A,this.installVersion=A,this.reinstall=A,this.canSetLanguage=A,this.setLanguage=A,this.setEnablement=A,this.pinExtension=A,this.open=A,this.checkForUpdates=A,this.getExtensionStatus=A,this.isExtensionIgnoredToSync=A,this.toggleExtensionIgnoredToSync=A}},0);ce(Mw,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=A,this.getExtensionInstallLocation=A}},0);ce(bet,class{constructor(){this.onDidChangeRecommendations=T.None,this.getAllRecommendationsWithReason=()=>({}),this.getImportantRecommendations=async()=>[],this.getOtherRecommendations=async()=>[],this.getFileBasedRecommendations=()=>[],this.getExeBasedRecommendations=async()=>({important:[],others:[]}),this.getConfigBasedRecommendations=async()=>({important:[],others:[]}),this.getWorkspaceRecommendations=async()=>[],this.getKeymapRecommendations=()=>[],this.getLanguageRecommendations=()=>[],this.getRemoteRecommendations=()=>[]}},0);ce(NTt,class{constructor(){this.onError=T.None,this.turnOn=A,this.turnOff=A,this.triggerSync=A}},0);ce(kTt,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=A,this.updateSynchronizedExtensions=A}},0);ce(uTt,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=A,this.promptWorkspaceRecommendations=A}},0);ce(FPe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=A,this.addExtensionFromGallery=A,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=A,this.scanExtensionManifest=async()=>null}},0);ce(hTt,class{constructor(){this.onDidChangeCache=T.None,this.getTargetPlatform=A,this.scanAllExtensions=A,this.scanSystemExtensions=A,this.scanUserExtensions=A,this.scanExtensionsUnderDevelopment=A,this.scanExistingExtension=A,this.scanOneOrMultipleExtensions=A,this.scanMultipleExtensions=A,this.scanMetadata=A,this.updateMetadata=A,this.initializeDefaultProfileExtensions=A}get systemExtensionsLocation(){return A()}get userExtensionsLocation(){return A()}},0);ce($de,class{constructor(){this.onAddExtensions=T.None,this.onDidAddExtensions=T.None,this.onRemoveExtensions=T.None,this.onDidRemoveExtensions=T.None,this.scanProfileExtensions=A,this.addExtensionsToProfile=A,this.updateMetadata=A,this.removeExtensionFromProfile=A}},0);ce(ihe,class{constructor(){this.onDidChangeIgnoredRecommendations=T.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=T.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=A}},0);ce(MRt,class{constructor(){this.onDidChangeExtensionsConfigs=T.None,this.getExtensionsConfigs=A,this.getRecommendations=A,this.getUnwantedRecommendations=A,this.toggleRecommendation=A,this.toggleUnwantedRecommendation=A}},0);ce(Kh,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=T.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=A,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=A}},0);ce(Qde,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=T.None,this.onTunnelClosed=T.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=T.None,this.canTunnel=()=>!1,this.openTunnel=A,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=A,this.closeTunnel=A,this.setTunnelProvider=A,this.setTunnelFeatures=A,this.isPortPrivileged=()=>!1}},0);ce(hh,class{constructor(){this.onDidChangeAutoSaveConfiguration=T.None,this.onDidChangeAutoSaveDisabled=T.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=A,this.onDidChangeReadonly=T.None,this.onDidChangeFilesAssociation=T.None,this.onAutoSaveConfigurationChange=T.None,this.getAutoSaveConfiguration=A,this.getAutoSaveMode=A,this.toggleAutoSave=A,this.onReadonlyChange=T.None,this.isReadonly=A,this.updateReadonly=A,this.onFilesAssociationChange=T.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=A}},0);ce(RQ,class{constructor(){this.onDidCreate=T.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=T.None,this.onDidChangeEncoding=T.None,this.onDidChangeLabel=T.None,this.onWillDispose=T.None,this.create=A,this.get=()=>{},this.getValue=()=>{},this.resolve=A}},0);ce(MQ,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Pw,class{constructor(){this.onDidRegister=T.None,this.onDidUnregister=T.None,this.onDidChangeDirty=T.None,this.onDidChangeContent=T.None,this.onDidSave=T.None,this.dirtyCount=0,this.dirtyWorkingCopies=[],this.modifiedCount=0,this.modifiedWorkingCopies=[],this.hasDirty=!1,this.isDirty=()=>!1,this.workingCopies=[],this.has=()=>!1,this.get=()=>{},this.getAll=()=>{}}registerWorkingCopy(){return $.None}},0);ce(rD,class{constructor(){this.onDidChangeDecorations=T.None,this.registerDecorationsProvider=A,this.getDecoration=()=>{}}},0);ce(IQ,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=A}},0);ce(bf,class{constructor(){this.preferredHome=A,this.defaultFilePath=A,this.defaultFolderPath=A,this.defaultWorkspacePath=A,this.pickFileFolderAndOpen=A,this.pickFileAndOpen=A,this.pickFolderAndOpen=A,this.pickWorkspaceAndOpen=A,this.pickFileToSave=A,this.showSaveDialog=A,this.showSaveConfirm=A,this.showOpenDialog=A}},0);ce(dL,class{constructor(){this.write=A}},1);ce(cL,class{constructor(){this.enterWorkspace=A,this.createUntitledWorkspace=A,this.deleteUntitledWorkspace=A,this.getWorkspaceIdentifier=A,this.onDidChangeRecentlyOpened=T.None,this.addRecentlyOpened=A,this.removeRecentlyOpened=A,this.clearRecentlyOpened=A,this.getRecentlyOpened=A,this.getDirtyWorkspaces=A}},1);ce(rhe,class{constructor(){this.createTextEditor=A,this.resolveTextEditor=A}},0);ce(Pz,class{constructor(){this.getAllUserAssociations=A,this.getAssociationsForResource=A,this.updateUserAssociations=A,this.onDidChangeEditorRegistrations=T.None,this.bufferChangeEvents=A,this.resolveEditor=A,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(nhe,class{constructor(){this.onActiveOutputChannel=T.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(uRt,class{constructor(){this.createOutputChannelModel=A}},1);ce(bPe,class{constructor(){this.readExtensionResource=A,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=A}},0);ce(gTt,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(Sp,class{constructor(){this.roots=[],this.getContext=A,this.hasViewFocus=A,this.setEditable=A,this.getEditable=A,this.getEditableData=A,this.isEditable=A,this.findClosest=A,this.findClosestRoot=A,this.refresh=A,this.setToCopy=A,this.isCut=A,this.applyBulkEdit=A,this.select=A,this.registerView=A}get sortOrderConfiguration(){return A()}},1);ce(B7,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=A,this.onDidChangeExtensionStorageToSync=T.None,this.setKeysForSync=A,this.getKeysForSync=()=>{},this.addToMigrationList=A,this.getSourceExtensionToMigrate=()=>{}}},1);ce(IZe,class{constructor(){this.onDidChangeEnablement=T.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(LZe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=_Mt(t)?.[e];return i!=null?P.parse(i):void 0}},1);ce(zde,class{constructor(){this.removeDragOperationTransfer=A,this.addDragOperationTransfer=A}},1);ce(eRt,class{constructor(){this.register=A,this.getWidget=()=>{}}},0);ce(Eet,class{constructor(){this.onDidChange=T.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=A}},0);ce(NZe,class{constructor(){this.onStateChange=T.None,this.state=DTt.Uninitialized,this.checkForUpdates=A,this.downloadUpdate=A,this.applyUpdate=A,this.quitAndInstall=A,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=A}},0);ce(EPe,class{constructor(){this.getPart=A,this.createAuxiliaryStatusbarPart=A,this.createScoped=A,this.dispose=A,this.onDidChangeEntryVisibility=T.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>$.None}},0);ce(aL,class{constructor(){this.isEnabled=()=>!1,this.query=A,this.getExtensions=A,this.isExtensionCompatible=A,this.getCompatibleExtension=A,this.getAllCompatibleVersions=A,this.download=A,this.downloadSignatureArchive=A,this.reportStatistic=A,this.getReadme=A,this.getManifest=A,this.getChangelog=A,this.getCoreTranslation=A,this.getExtensionsControlManifest=A}},0);ce(Nz,class{constructor(){this.onAnyInstanceData=T.None,this.moveIntoNewEditor=A,this.detachedInstances=[],this.onAnyInstanceDataInput=T.None,this.onAnyInstanceIconChange=T.None,this.onAnyInstanceMaximumDimensionsChange=T.None,this.onAnyInstancePrimaryStatusChange=T.None,this.onAnyInstanceProcessIdReady=T.None,this.onAnyInstanceSelectionChange=T.None,this.onAnyInstanceTitleChange=T.None,this.createDetachedTerminal=A,this.onDidChangeSelection=T.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=A,this.instances=[],this.revealActiveTerminal=A,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=fV.Panel,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidCreateInstance=T.None,this.onDidReceiveProcessId=T.None,this.onDidChangeInstanceDimensions=T.None,this.onDidMaximumDimensionsChange=T.None,this.onDidRequestStartExtensionTerminal=T.None,this.onDidChangeInstanceTitle=T.None,this.onDidChangeInstanceIcon=T.None,this.onDidChangeInstanceColor=T.None,this.onDidChangeInstancePrimaryStatus=T.None,this.onDidInputInstanceData=T.None,this.onDidRegisterProcessSupport=T.None,this.onDidChangeConnectionState=T.None,this.createTerminal=A,this.getInstanceFromId=A,this.getInstanceFromIndex=A,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=A,this.moveToEditor=A,this.moveToTerminalView=A,this.getPrimaryBackend=A,this.refreshActiveGroup=A,this.registerProcessSupport=()=>{},this.showProfileQuickPick=A,this.setContainers=A,this.requestStartExtensionTerminal=A,this.isAttachedToTerminal=A,this.getEditableData=A,this.setEditable=A,this.isEditable=A,this.safeDisposeTerminal=A,this.getDefaultInstanceHost=A,this.getInstanceHost=A,this.resolveLocation=A,this.setNativeDelegate=A,this.toggleEscapeSequenceLogging=A,this.getEditingTerminal=A,this.setEditingTerminal=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}createOnInstanceCapabilityEvent(){return{event:T.None,dispose(){}}}createOnInstanceEvent(e){return new blt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return A()}},1);ce(bRt,class{constructor(){this.onConfigChanged=T.None,this.setPanelContainer=A,this.configFontIsMonospace=A,this.getFont=A}get config(){return A()}},1);ce(ZZe,class{constructor(){this.instances=[],this.openEditor=A,this.detachActiveEditorInstance=A,this.detachInstance=A,this.splitInstance=A,this.revealActiveEditor=A,this.resolveResource=A,this.reviveInput=A,this.getInputFromResource=A,this.activeInstance=void 0,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(MPe,class{constructor(){this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=T.None,this.onDidDisposeGroup=T.None,this.onDidChangeGroups=T.None,this.onDidShow=T.None,this.onDidChangePanelOrientation=T.None,this.createGroup=A,this.getGroupForInstance=A,this.moveGroup=A,this.moveGroupToEnd=A,this.moveInstance=A,this.unsplitInstance=A,this.joinInstances=A,this.instanceIsSplit=A,this.getGroupLabels=A,this.setActiveGroupByIndex=A,this.setActiveGroupToNext=A,this.setActiveGroupToPrevious=A,this.setActiveInstanceByIndex=A,this.setContainer=A,this.showPanel=A,this.hidePanel=A,this.focusTabs=A,this.focusHover=A,this.showTabs=A,this.updateVisibility=A,this.onDidDisposeInstance=T.None,this.onDidFocusInstance=T.None,this.onDidChangeActiveInstance=T.None,this.onDidChangeInstances=T.None,this.onDidChangeInstanceCapability=T.None,this.setActiveInstance=A,this.focusActiveInstance=A,this.getInstanceFromResource=A}},1);ce(eet,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=T.None,this.convertProfileToShellLaunchConfig=A,this.createInstance=A,this.getBackend=A,this.didRegisterBackend=A}},1);ce(net,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=A,this.refreshAvailableProfiles=A,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=T.None,this.getContributedDefaultProfile=A,this.registerContributedProfile=A,this.getContributedProfileProvider=A,this.registerTerminalProfileProvider=A}},1);ce(xTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(set,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=T.None,this.onDidRemoveLinkProvider=T.None,this.registerLinkProvider=A}},1);ce(CRt,class{constructor(){this.terminalProfiles=[]}},1);ce(iet,class{constructor(){this.resolveIcon=A,this.resolveShellLaunchConfig=A,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=A,this.getDefaultShellArgs=A,this.getDefaultIcon=A,this.getEnvironment=A,this.createProfileFromShellAndShellArgs=A}},1);ce(tet,class{constructor(){this.collections=new Map,this.onDidChangeCollections=T.None,this.set=A,this.delete=A}get mergedCollection(){return A()}},1);ce(oet,class{constructor(){this.onDidRegisterProvider=T.None,this.onDidRegisterCommandSelector=T.None,this.onDidUnregisterProvider=T.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=A,this.registerCommandSelector=A}},1);ce(Rz,class{constructor(){this.toggleAppliationScope=async e=>e,this.installGalleryExtensions=A,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installFromLocation=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=async()=>[],this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(YRt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=T.None,this.turnOn=A,this.turnoff=A,this.signIn=A,this.resetSyncedData=A,this.showSyncActivity=A,this.syncNow=A,this.synchroniseUserDataSyncStoreType=A,this.showConflicts=A,this.accept=A,this.getAllLogResources=A,this.downloadSyncActivity=A}},1);ce(PZe,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=A,this.onDidChangeResourceEnablement=T.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=A,this.getResourceSyncStateVersion=()=>{}}},1);ce(BRt,class{constructor(){this.addKeybinding=A,this.editKeybinding=A,this.removeKeybinding=A,this.resetKeybinding=A}},1);ce(gRt,class{constructor(){this.getLocalSearchProvider=A,this.getRemoteSearchProvider=A}},1);ce(oD,class{constructor(){this.canResolve=async()=>!1,this.onAddViewType=T.None,this.onWillRemoveViewType=T.None,this.onDidChangeOutputRenderers=T.None,this.onWillAddNotebookDocument=T.None,this.onDidAddNotebookDocument=T.None,this.onWillRemoveNotebookDocument=T.None,this.onDidRemoveNotebookDocument=T.None,this.registerNotebookSerializer=A,this.withNotebookDataProvider=A,this.getOutputMimeTypeInfo=A,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=A,this.updateMimePreferredRenderer=A,this.saveMimeDisplayOrder=A,this.createNotebookTextModel=A,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=A,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=A,this.getContributedNotebookType=A,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=A,this.getToCopy=A,this.clearEditorCache=A}},1);ce(fRt,class{constructor(){this.replace=A,this.openReplacePreview=A,this.updateReplacePreview=A}},1);ce(_Rt,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.load=A,this.save=A}},1);ce(xQ,class{constructor(){this.retrieveWidget=A,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=T.None,this.onDidRemoveNotebookEditor=T.None,this.addNotebookEditor=A,this.removeNotebookEditor=A,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(pRt,class{get searchModel(){return A()}},1);ce(Jde,class{constructor(){this.onDidSaveNotebook=T.None,this.onDidChangeDirty=T.None,this.onWillFailWithConflict=T.None,this.isDirty=A,this.resolve=A}},1);ce(Iet,class{constructor(){this.onDidRegisterHandler=T.None,this.registerHandler=()=>$.None,this.findEditor=()=>{}}},1);ce(BPe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=T.None,this.markActive=A}},1);ce(SPe,class{constructor(){this.registerCanonicalUriProvider=A}},1);ce(xPe,class{constructor(){this.onDidChange=T.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(get,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Rw,class{constructor(){this.adoptRequest=A,this.isEnabled=()=>!1,this.resendRequest=A,this.onDidUnregisterProvider=T.None,this.clearAllHistoryEntries=A,this.onDidSubmitAgent=T.None,this.onDidRegisterProvider=T.None,this.hasSessions=()=>!1,this.onDidDisposeSession=T.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=T.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=A,this.registerProvider=A,this.registerSlashCommandProvider=A,this.getProviderInfos=()=>[],this.startSession=A,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=A,this.removeRequest=A,this.cancelCurrentRequestForSession=A,this.getSlashCommands=A,this.clearSession=A,this.addRequest=A,this.addCompleteRequest=A,this.sendRequestToProvider=A,this.getHistory=()=>[],this.removeHistoryEntry=A,this.onDidPerformUserAction=T.None,this.notifyUserAction=A}},1);ce(Ret,class{constructor(){this.update=A}},1);ce(tRt,class{constructor(){this.focused=!1,this.onDidClose=T.None,this.enabled=!1,this.toggle=A,this.focus=A,this.open=A,this.close=A,this.openInChatView=A}},1);ce(yp,class{constructor(){this._serviceBrand=void 0,this.registerAgentCompletionProvider=A,this.getAgentCompletionItems=A,this.getAgentByFullyQualifiedId=A,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=A,this.registerDynamicAgent=A,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=A,this.getDefaultAgent=A,this.getSecondaryAgent=A,this.updateAgent=A,this.onDidChangeAgents=T.None,this.registerAgentData=A,this.registerAgentCallback=A,this.registerAgent=A,this.invokeAgent=A,this.getAgents=A,this.getAgent=A,this.hasAgent=A}},1);ce(Yde,class{getAgentNameRestriction(){return!0}},1);ce(URt,class{constructor(){this.onDidCreateTerminal=T.None,this.createTerminal=A}},1);ce(kPe,class{constructor(){this.getCustomEditor=A,this.getAllCustomEditors=A,this.getContributedCustomEditors=A,this.getUserConfiguredCustomEditors=A,this.registerCustomEditorCapabilities=()=>$.None,this.getCustomEditorCapabilities=()=>{}}get models(){return A()}},1);ce(Zde,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=T.None,this.createWebviewElement=A,this.createWebviewOverlay=A}},1);ce(het,class{constructor(){this.onNewResolverRegistered=T.None,this.register=A,this.resolve=A}},1);ce(yet,class{constructor(){this.setLocale=A}clearLocalePreference(){return Promise.resolve()}},1);ce(kQ,class{constructor(){this.onDidChangeActiveWebviewEditor=T.None,this.openWebview=A,this.openRevivedWebview=A,this.revealWebview=A,this.registerResolver=()=>$.None,this.shouldPersist=A,this.resolveWebview=A}get iconManager(){return A()}},1);ce(rA,class{constructor(){this.onDidChangeConnectionData=T.None,this.resolveAuthority=A,this.getConnectionData=A,this.getCanonicalURI=A,this._clearResolvedAuthority=A,this._setResolvedAuthority=A,this._setResolvedAuthorityError=A,this._setAuthorityConnectionToken=A,this._setCanonicalURIProvider=A}},1);ce(VZe,class{constructor(){this.registerExternalOpenerProvider=()=>$.None,this.getOpener=async()=>{}}},1);ce(Tw,class{constructor(){this.configureKeybindings=A,this.openHelpLink=A,this.navigateToCodeBlock=A,this.getCodeBlockContext=()=>{},this.showLastProvider=A,this.showAccessibleViewHelp=A,this.goToSymbol=A,this.disableHint=A,this.next=A,this.previous=A,this.getOpenAriaHint=A,this.show=A,this.registerProvider=A,this.getPosition=A,this.setPosition=A,this.getLastPosition=A}},1);ce(hMt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(the,class{constructor(){this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=T.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=A,this.toggleAppliationScope=async e=>e,this.onInstallExtension=T.None,this.onDidInstallExtensions=T.None,this.onUninstallExtension=T.None,this.onDidUninstallExtension=T.None,this.onDidChangeProfile=T.None,this.installVSIX=A,this.installFromLocation=A,this.updateFromGallery=A,this.onDidUpdateExtensionMetadata=T.None,this.zip=A,this.unzip=A,this.getManifest=A,this.install=A,this.canInstall=A,this.installFromGallery=A,this.installGalleryExtensions=A,this.installExtensionsFromProfile=A,this.uninstall=A,this.reinstallFromGallery=A,this.getInstalled=A,this.getExtensionsControlManifest=A,this.copyExtensions=A,this.updateMetadata=A,this.download=A,this.registerParticipant=A,this.getTargetPlatform=A,this.cleanUp=A}},1);ce(G_,class{constructor(){this.prefersExecuteOnUI=A,this.prefersExecuteOnWorkspace=A,this.prefersExecuteOnWeb=A,this.canExecuteOnUI=A,this.canExecuteOnWorkspace=A,this.canExecuteOnWeb=A,this.getExtensionKind=A,this.getUserConfiguredExtensionKind=A,this.getExtensionUntrustedWorkspaceSupportType=A,this.getExtensionVirtualWorkspaceSupportType=A}},1);ce(Sde,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Gde,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(jde,class{constructor(){this.create=A,this.open=async()=>!1,this.registerHandler=A}},1);ce(CPe,class{constructor(){this.register=A,this.connect=A}},1);ce(DQ,class{constructor(){this.onDidChangeQuickDiffProviders=T.None,this.addQuickDiffProvider=A,this.getQuickDiffs=A}},1);ce(RPe,class{constructor(){this.onDidChangeInputValueProviders=T.None,this.getDefaultInputValueProvider=A,this.registerSCMInputValueProvider=A,this.onDidAddRepository=T.None,this.onDidRemoveRepository=T.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=A,this.getRepository=A}},1);ce(wPe,class{constructor(){this.download=A}},1);ce(Cet,class{constructor(){this.registerExtensionHandler=A,this.unregisterExtensionHandler=A}},1);ce(sD,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=T.None,this.setActiveEditingCommentThread=A,this.setActiveCommentAndThread=A,this.onDidSetResourceCommentInfos=T.None,this.onDidSetAllCommentThreads=T.None,this.onDidUpdateCommentThreads=T.None,this.onDidUpdateNotebookCommentThreads=T.None,this.onDidChangeActiveCommentThread=T.None,this.onDidChangeCurrentCommentThread=T.None,this.onDidUpdateCommentingRanges=T.None,this.onDidChangeActiveCommentingRange=T.None,this.onDidSetDataProvider=T.None,this.onDidDeleteDataProvider=T.None,this.onDidChangeCommentingEnabled=T.None,this.isCommentingEnabled=!1,this.setDocumentComments=A,this.setWorkspaceComments=A,this.removeWorkspaceComments=A,this.registerCommentController=A,this.unregisterCommentController=()=>{},this.getCommentController=A,this.createCommentThreadTemplate=A,this.updateCommentThreadTemplate=A,this.getCommentMenus=A,this.updateComments=A,this.updateNotebookComments=A,this.disposeCommentThread=A,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=A,this.hasReactionHandler=A,this.toggleReaction=A,this.setActiveCommentThread=A,this.setCurrentCommentThread=A,this.enableCommenting=A,this.registerContinueOnCommentProvider=A,this.removeContinueOnComment=A}get commentsModel(){return A()}},1);ce(qZe,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeItems=T.None,this.registerCellStatusBarItemProvider=A,this.getStatusBarItemsForCell=A}},1);ce(jZe,class{constructor(){this.onDidNotebookVariablesUpdate=T.None,this.notifyVariablesChange=A,this.onDidAddKernel=T.None,this.onDidRemoveKernel=T.None,this.onDidChangeSelectedNotebooks=T.None,this.onDidChangeNotebookAffinity=T.None,this.registerKernel=A,this.getMatchingKernel=A,this.getSelectedOrSuggestedKernel=A,this.selectKernelForNotebook=A,this.preselectKernelForNotebook=A,this.updateKernelNotebookAffinity=A,this.onDidChangeKernelDetectionTasks=T.None,this.registerNotebookKernelDetectionTask=A,this.getKernelDetectionTasks=A,this.onDidChangeSourceActions=T.None,this.getSourceActions=A,this.getRunningSourceActions=A,this.registerKernelSourceActionProvider=A,this.getKernelSourceActions2=A}},1);ce(KZe,class{constructor(){this.onShouldPostMessage=T.None,this.prepare=A,this.getScoped=A,this.receiveMessage=A}},1);ce($Ze,class{constructor(){this.addToHistory=A,this.getPreviousValue=A,this.getNextValue=A,this.replaceLast=A,this.clearHistory=A,this.has=A}},1);ce(TPe,class{constructor(){this.onWillAddInteractiveDocument=T.None,this.onWillRemoveInteractiveDocument=T.None,this.willCreateInteractiveDocument=A,this.willRemoveInteractiveDocument=A}},1);ce(HRt,class{async getExtensionIdProvidingCurrentLocale(){return vMt()}},0);ce($Rt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=A}},0);ce(Fz,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=A,this.next=A,this.reset=A}},0);ce(OTt,class{constructor(){this.onTokenFailed=T.None,this.account=void 0,this.onDidChangeAccount=T.None}updateAccount(){return Promise.resolve()}},0);ce(lL,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=A,this.getWidgetByInputUri=A}},1);ce(she,class{constructor(){this.onDidChangeHelpInformation=T.None,this.onDidChangeTargetType=T.None,this.targetType=[],this.onDidChangeEditable=T.None,this.setEditable=A,this.getEditableData=A,this.forward=A,this.close=A,this.setTunnelInformation=A,this.setCandidateFilter=A,this.onFoundNewCandidates=A,this.restore=A,this.enablePortsFeatures=A,this.onEnabledPortsFeatures=T.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return A()}get tunnelModel(){return A()}},1);ce(PPe,class{constructor(){this.onDidRegisterAuthenticationProvider=T.None,this.onDidUnregisterAuthenticationProvider=T.None,this.onDidChangeSessions=T.None,this.onDidChangeDeclaredProviders=T.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=A,this.unregisterDeclaredAuthenticationProvider=A,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=A,this.unregisterAuthenticationProvider=A,this.getProviderIds=()=>[],this.getProvider=A,this.getSessions=A,this.createSession=A,this.removeSession=A}},1);ce(ehe,class{constructor(){this.onDidChangeExtensionSessionAccess=T.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=A,this.removeAllowedExtensions=A}},1);ce(pet,class{constructor(){this.updateSessionPreference=A,this.getSessionPreference=()=>{},this.removeSessionPreference=A,this.selectSession=A,this.requestSessionAccess=A,this.requestNewSession=A}},1);ce(fet,class{constructor(){this.readAccountUsages=A,this.removeAccountUsage=A,this.addAccountUsage=A}},1);ce(det,class{constructor(){this.onDidChangeProviders=T.None,this.onDidChangeTimeline=T.None,this.onDidChangeUri=T.None,this.registerTimelineProvider=A,this.unregisterTimelineProvider=A,this.getSources=()=>[],this.getTimeline=A,this.setUri=A}},1);ce(cet,class{constructor(){this.registerExtHost=()=>$.None,this.provideTestFollowups=A,this.onDidCancelTestRun=T.None,this.onWillProcessDiff=T.None,this.onDidProcessDiff=T.None,this.registerTestController=A,this.getTestController=()=>{},this.refreshTests=A,this.cancelRefreshTests=A,this.startContinuousRun=A,this.runTests=A,this.runResolvedTests=A,this.syncTests=A,this.cancelTestRun=A,this.publishDiff=A}get excluded(){return A()}get collection(){return A()}get showInlineOutput(){return A()}},1);ce(RZe,class{constructor(){this.onDidChangeSecret=T.None,this.type="in-memory",this.get=async()=>{},this.set=A,this.delete=A}},1);ce(JZe,class{constructor(){this.registerShareProvider=A,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(ket,class{constructor(){this.resolveProfileTemplate=A,this.exportProfile2=A,this.createFromProfile=A,this.createProfile=A,this.editProfile=A,this.registerProfileContentHandler=A,this.unregisterProfileContentHandler=A,this.exportProfile=A,this.importProfile=A,this.showProfileContents=A,this.createFromCurrentProfile=A,this.createTroubleshootProfile=A,this.setProfile=A}},1);ce(FRt,class{constructor(){this.registerIssueDataProvider=A,this.openReporter=A,this.openProcessExplorer=A,this.registerIssueUriRequestHandler=A}},1);ce(gMt,class{constructor(){this.stopTracing=A,this.openReporter=A,this.openProcessExplorer=A,this.getSystemStatus=A,this.$getSystemInfo=A,this.$getPerformanceInfo=A,this.$reloadWithExtensionsDisabled=A,this.$showConfirmCloseDialog=A,this.$showClipboardDialog=A,this.$sendReporterMenu=A,this.$closeReporter=A}},1);ce(YZe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=T.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=T.None,this.isVisible=()=>!1,this.toggleVisibility=A,this.toggleSortKey=A,this.focusedRepository=void 0,this.onDidFocusRepository=T.None,this.focus=A}get menus(){return A()}},1);ce(QZe,class{constructor(){this.onDidChangeExecution=T.None,this.onDidChangeLastRunFailState=T.None,this.forceCancelNotebookExecutions=A,this.getCellExecutionsForNotebook=A,this.getCellExecutionsByHandleForNotebook=A,this.getCellExecution=A,this.createCellExecution=A,this.getExecution=A,this.createExecution=A,this.getLastFailedCellForNotebook=A}},1);ce(ret,class{constructor(){this.onDidChange=T.None,this.addProfile=A,this.updateProfile=A,this.removeProfile=A,this.capabilitiesForTest=A,this.configure=A,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=A,this.getControllerProfiles=()=>[]}},1);ce(lTt,class{constructor(){this.setUsePlainTextEncryption=A,this.getKeyStorageProvider=A,this.encrypt=A,this.decrypt=A,this.isEncryptionAvailable=A}},1);ce(aet,class{constructor(){this.onResultsChanged=T.None,this.onTestChanged=T.None,this.results=[],this.clear=A,this.createLiveResult=A,this.push=A,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(ARt,class{constructor(){this.read=A,this.persist=A}},1);ce(xRt,class{constructor(){this.onDidChange=T.None,this.invalidateResultMessage=A,this.syncDecorations=A,this.getDecoratedTestPosition=A}},1);ce(ahe,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(cTt,aTt,1);ce(mRt,class{notebookSearch(){return{openFilesToScan:new o1,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new o1)}}},1);ce(HZe,class{constructor(){this.selectLanguageModels=A,this.computeTokenLength=A,this.onDidChangeLanguageModels=T.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=A,this.makeLanguageModelChatRequest=A}},1);ce(DPe,class{constructor(){this.onDidChangeCommands=A,this.registerSlashData=A,this.registerSlashCallback=A,this.registerSlashCommand=A,this.executeCommand=A,this.getCommands=A,this.hasCommand=A}},1);ce(Mz,class{constructor(){this.attachContext=A,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=A,this.getDynamicReferences=A,this.registerVariable=A,this.getVariables=A,this.resolveVariables=A,this.hasVariable=A}},1);ce(NPe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=A,this.registerAiRelatedInformationProvider=A}},1);ce(uet,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=A,this.registerAiEmbeddingVectorProvider=A}},1);ce(MZe,(AK=class{async createNewMessage(e){return{id:String(AK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},AK._nextId=1,AK),1);ce(ERt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=T.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=A,this.stop=A}},1);ce(SRt,class{constructor(){this.onDidRequestInputFocus=T.None,this.focusInput=A,this.setText=A,this.isFilteringFor=()=>!1,this.toggleFilteringFor=A}get text(){return A()}get reveal(){return A()}get globList(){return A()}get includeTags(){return A()}get excludeTags(){return A()}get fuzzy(){return A()}},1);ce(DRt,class{constructor(){this.tryPeekFirstError=A,this.peekUri=A,this.openCurrentInEditor=A,this.open=A,this.closeAllPeeks=A}get historyVisible(){return A()}},1);ce(met,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=T.None,this.hasWindow=()=>!1,this.open=A}},1);ce(Xde,class{constructor(){this.onDidStartTextToSpeechSession=T.None,this.onDidEndTextToSpeechSession=T.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=A,this.onDidChangeHasSpeechProvider=T.None,this.onDidStartSpeechToTextSession=T.None,this.onDidEndSpeechToTextSession=T.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=T.None,this.onDidEndKeywordRecognition=T.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=A,this.onDidRegisterSpeechProvider=T.None,this.onDidUnregisterSpeechProvider=T.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=A,this.createSpeechToTextSession=A}},1);ce(yRt,class{constructor(){this.openCoverage=A,this.closeCoverage=A}get filterToTest(){return A()}get selected(){return A()}},1);ce(BZe,class{constructor(){this.acceptRequest=A,this.acceptResponse=A}},1);ce(WZe,class{constructor(){this.onDidClearHistory=T.None,this.clearHistory=A,this.getHistory=()=>[],this.saveHistory=A}},1);ce(iRt,class{constructor(){this.providers=[],this.registerProvider=A}},1);ce(LPe,class{constructor(){this.onDidMoveSession=T.None,this.onDidMoveSessio=T.None,this.onDidStashSession=T.None,this.moveSession=A,this.getCodeEditor=A,this.stashSession=A,this.onWillStartSession=T.None,this.onDidEndSession=T.None,this.createSession=A,this.getSession=()=>{},this.releaseSession=A,this.registerSessionKeyComputer=A,this.recordings=A,this.dispose=A}},1);ce(hRt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=A,this.canPromptRecommendation=async()=>!1}},1);ce(aRt,class{constructor(){this.getKernels=A,this.addMostRecentKernel=A}},1);ce(rRt,class{constructor(){this.executeNotebookCells=A,this.cancelNotebookCells=A,this.cancelNotebookCellHandles=A,this.registerExecutionParticipant=A}},1);ce(cRt,class{},1);ce(lRt,class{constructor(){this.info=A,this.debug=A}},1);ce(IRt,class{constructor(){this.onDidAddWalkthrough=T.None,this.onDidRemoveWalkthrough=T.None,this.onDidChangeWalkthrough=T.None,this.onDidProgressStep=T.None,this.getWalkthroughs=A,this.getWalkthrough=A,this.registerWalkthrough=A,this.progressByEvent=A,this.progressStep=A,this.deprogressStep=A,this.markWalkthroughOpened=A}},1);ce(ITt,class{constructor(){this.onDidChangeUserDataSyncStore=T.None,this.userDataSyncStore=void 0,this.switch=A,this.getPreviousUserDataSyncStore=A}},1);ce(LTt,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=T.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=T.None,this.onTokenSucceed=T.None,this.setAuthToken=A,this.manifest=A,this.readResource=A,this.writeResource=A,this.deleteResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A,this.getAllCollections=A,this.createCollection=A,this.deleteCollection=A,this.getActivityData=A,this.clear=A}},1);ce(FTt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(RTt,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=T.None,this.conflicts=[],this.onDidChangeConflicts=T.None,this.onDidChangeLocal=T.None,this.onSyncErrors=T.None,this.onDidChangeLastSyncTime=T.None,this.onDidResetRemote=T.None,this.onDidResetLocal=T.None,this.createSyncTask=A,this.createManualSyncTask=A,this.resolveContent=A,this.accept=A,this.reset=A,this.resetRemote=A,this.cleanUpRemoteData=A,this.resetLocal=A,this.hasLocalData=A,this.hasPreviouslySynced=A,this.replace=A,this.saveRemoteActivityData=A,this.extractActivityData=A}},1);ce(BTt,class{constructor(){this.onDidChange=T.None,this.getMachines=A,this.addCurrentMachine=A,this.removeCurrentMachine=A,this.renameMachine=A,this.setEnablements=A}},1);ce(MTt,class{constructor(){this.getRemoteSyncedProfiles=A,this.getLocalSyncedProfiles=A,this.getRemoteSyncResourceHandles=A,this.getLocalSyncResourceHandles=A,this.getAssociatedResources=A,this.getMachineId=A,this.getLocalSyncedMachines=A,this.resolveContent=A,this.resolveUserDataSyncResource=A}},1);ce(TTt,class{constructor(){this.writeResource=A,this.getAllResourceRefs=A,this.resolveResourceContent=A}},1);ce(PTt,class{constructor(){this.resolveUserBindings=A,this.resolveFormattingOptions=A,this.resolveDefaultIgnoredSettings=A}},1);ce(GRt,class{constructor(){this.createAndEnterProfile=A,this.createAndEnterTransientProfile=A,this.removeProfile=A,this.updateProfile=A,this.switchProfile=A,this.getBuiltinProfileTemplates=A}},1);ce(JRt,class{constructor(){this.onDidAddEntry=T.None,this.onDidChangeEntry=T.None,this.onDidReplaceEntry=T.None,this.onDidRemoveEntry=T.None,this.onDidMoveEntries=T.None,this.onDidRemoveEntries=T.None,this.addEntry=A,this.updateEntry=A,this.removeEntry=A,this.moveEntries=A,this.getEntries=A,this.getAll=A,this.removeAll=A}},1);ce(zZe,class{constructor(){this.markChanged=A}},1);ce(Aet,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=A,this.removeNotebookDocument=A}},1);ce(UZe,class{constructor(){this.registerTree=A,this.getVisualizedNodeFor=A,this.getVisualizedChildren=A,this.editTreeItem=A,this.getApplicableFor=A,this.register=A}},1);ce(sRt,class{constructor(){this.onDidChangeLogLevel=T.None,this.getLevel=A,this.setLevel=A,this.trace=A,this.debug=A,this.info=A,this.warn=A,this.error=A,this.flush=A,this.dispose=A}},1);ce(nRt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=T.None,this.onDidSignOut=T.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=A,this.read=A,this.write=A,this.delete=A,this.list=A,this.getMachineById=A}},1);ce(GZe,class{constructor(){this.registerResolver=()=>$.None,this.resolve=async()=>{}}},1);ce(wRt,vRt,1);ce(wet,class{constructor(){this.onDidChangeEnablement=T.None,this.isEnabled=()=>!0,this.setEnablement=A,this.getEnablementData=A,this.getAccess=A,this.onDidChangeAccessData=T.None,this.getAccessData=()=>{},this.setStatus=A}},1);ce(vet,class{constructor(){this.onWillInstantiateEditorPane=T.None,this.didInstantiateEditorPane=()=>!1}},1);ce(XRt,class{constructor(){this.matches=A,this.getWorkspaceStateFolders=A}},1);ce(oRt,class{constructor(){this.onDidChangeDefaultLogLevels=T.None,this.getDefaultLogLevel=async()=>Pn.Off,this.getDefaultLogLevels=A,this.setDefaultLogLevel=A,this.migrateLogLevels=A}},1);ce(aD,class{constructor(){this.onDidChange=T.None,this.getName=()=>{}}},1);ce(PRt,class{constructor(){this.isActive=()=>!1,this.start=A,this.resume=A,this.stop=A}},1);ce(fMt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(lhe,class{isValid(){return!1}},1);const mV=Object.freeze({activeComment:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts",aiRelatedInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts",aiTextSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",attributableCoverage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts",authGetSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts",authLearnMore:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts",authSession:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts",canonicalUriProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts",chatParticipantAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts",chatParticipantPrivate:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",chatProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",chatTab:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts",chatVariableResolver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts",codeActionAI:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts",codeActionRanges:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",codiconDecoration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts",commentReactor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts",commentThreadApplicability:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts",commentingRangeHint:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts",commentsDraftState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts",contribAccessibilityHelpContent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts",contribCommentEditorActionsMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts",contribCommentPeekContext:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts",contribCommentThreadAdditionalMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts",contribCommentsViewThreadMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts",contribDiffEditorGutterToolBarMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts",contribEditSessions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts",contribEditorContentMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts",contribIssueReporter:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts",contribLabelFormatterWorkspaceTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts",contribMenuBarHome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts",contribMergeEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts",contribMultiDiffEditorMenus:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts",contribNotebookStaticPreloads:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts",contribRemoteHelp:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts",contribShareMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts",contribSourceControlHistoryItemGroupMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts",contribSourceControlHistoryItemMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts",contribSourceControlInputBoxMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts",contribSourceControlTitleMenu:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts",contribStatusBarItems:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts",contribViewsRemote:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts",contribViewsWelcome:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts",createFileSystemWatcher:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts",customEditorMove:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts",debugVisualization:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts",defaultChatParticipant:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",diffCommand:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts",diffContentOptions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts",documentFiltersExclusive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts",documentPaste:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts",editSessionIdentityProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts",editorHoverVerbosityLevel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts",editorInsets:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts",embeddings:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts",extensionRuntime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts",extensionsAny:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts",externalUriOpener:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts",fileComments:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts",fileSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts",findFiles2:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",findTextInFiles:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts",fsChunks:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts",idToken:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts",inlineCompletionsAdditions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts",inlineEdit:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts",interactive:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts",interactiveWindow:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts",ipc:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts",languageModelSystem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts",languageStatusText:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts",mappedEditsProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",multiDocumentHighlightProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts",newSymbolNamesProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts",notebookCellExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts",notebookCellExecutionState:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts",notebookControllerAffinityHidden:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts",notebookDeprecated:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts",notebookExecution:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts",notebookKernelSource:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts",notebookLiveShare:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts",notebookMessaging:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts",notebookMime:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts",notebookVariableProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts",portsAttributes:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts",profileContentHandlers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts",quickDiffProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts",quickPickItemTooltip:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts",quickPickSortByLabel:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts",resolvers:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts",scmActionButton:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts",scmHistoryProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts",scmMultiDiffEditor:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts",scmSelectedProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts",scmTextDocument:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts",scmValidation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts",shareProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts",showLocal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts",speech:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts",tabInputMultiDiff:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts",tabInputTextMerge:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts",taskPresentationGroup:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts",telemetry:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts",terminalDataWriteEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts",terminalDimensions:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts",terminalExecuteCommandEvent:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts",terminalQuickFixProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts",terminalSelection:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts",terminalShellIntegration:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts",testObserver:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts",textSearchProvider:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts",timeline:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts",tokenInformation:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts",treeViewActiveItem:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts",treeViewMarkdownMessage:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts",treeViewReveal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts",tunnelFactory:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts",tunnels:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts",workspaceTrust:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}),DMt="vscode://schemas/vscode-product",ni="vs/workbench/services/extensions/common/extensionsRegistry",HPe=it.as(eL.JSONContribution);class kMt{constructor(e,t,i){this._messageHandler=e,this._extension=t,this._extensionPointId=i}_msg(e,t){this._messageHandler({type:e,message:t,extensionId:this._extension.identifier,extensionPointId:this._extensionPointId})}error(e){this._msg(nt.Error,e)}warn(e){this._msg(nt.Warning,e)}info(e){this._msg(nt.Info,e)}}class q${static _toSet(e){const t=new $v;for(let i=0,s=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!s.has(a.description.identifier));return new q$(o,r)}constructor(e,t){this.added=e,this.removed=t}}class IMt{constructor(e,t){this.name=e,this.defaultExtensionKind=t,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=q$.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){bt(e)}}}const LMt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(ni,0,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(ni,1,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},Met="vscode://schemas/vscode-extensions",KCe={properties:{engines:{type:"object",description:g(ni,2,"Engine compatibility."),properties:{vscode:{type:"string",description:g(ni,3,"For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5."),default:"^1.22.0"}}},publisher:{description:g(ni,4,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(ni,5,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(ni,6,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:fZe},{type:"string",const:"Languages",deprecationMessage:g(ni,7,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(ni,8,"Banner used in the VS Code marketplace."),properties:{color:{description:g(ni,9,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(ni,10,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(ni,11,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(ni,12,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(ni,13,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(ni,14,"Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api"),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}},api:{markdownDescription:g(ni,15,"Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions"),type:"string",enum:["none"],enumDescriptions:[g(ni,16,"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.")]},activationEvents:{description:g(ni,17,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(ni,18,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(ni,19,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(ni,20,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(ni,21,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(ni,22,'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:g(ni,23,'An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).'),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:g(ni,24,"An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called)."),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:g(ni,25,"An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed."),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:g(ni,26,"An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern."),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:g(ni,27,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(ni,28,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(ni,29,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(ni,30,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(ni,31,"An activation event emitted whenever a search is started in the folder with the given scheme."),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:g(ni,32,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(ni,33,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(ni,34,"An activation event emitted whenever a external uri (such as an http or https link) is being opened.")},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:g(ni,35,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(ni,36,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(ni,37,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(ni,38,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(ni,39,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(ni,40,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(ni,41,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(ni,42,"An activation event emitted when the issue reporter is opened.")},{label:"*",description:g(ni,43,"An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case."),body:"*"}]}},badges:{type:"array",description:g(ni,44,"Array of badges to display in the sidebar of the Marketplace's extension page."),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:g(ni,45,"Badge image URL.")},href:{type:"string",description:g(ni,46,"Badge link.")},description:{type:"string",description:g(ni,47,"Badge description.")}}}},markdown:{type:"string",description:g(ni,48,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(ni,49,"Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:g(ni,50,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionPack:{description:g(ni,51,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:U7}},extensionKind:{description:g(ni,52,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:"array",items:LMt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(ni,53,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(ni,54,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(ni,55,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(ni,56,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(ni,57,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(ni,58,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(ni,59,"Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true."),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:g(ni,60,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,61,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(ni,62,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(ni,63,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(ni,64,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:g(ni,65,"Declares how the extension should be handled in untrusted workspaces."),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:g(ni,66,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(ni,67,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(ni,68,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(ni,69,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(ni,70,"A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:g(ni,71,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:g(ni,72,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(ni,73,"URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess"),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:g(ni,74,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(ni,75,"Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported."),type:"string"}}},icon:{type:"string",description:g(ni,76,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(ni,77,"The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.")},pricing:{type:"string",markdownDescription:g(ni,78,"The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label"),enum:["Free","Trial"],default:"Free"}}};class TMt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new IMt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&QW.register(e.extensionPoint,e.activationEventsGenerator),KCe.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,HPe.registerSchema(Met,KCe),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const Net={ExtensionsRegistry:"ExtensionsRegistry"};it.add(Net.ExtensionsRegistry,new TMt);const Ap=it.as(Net.ExtensionsRegistry);HPe.registerSchema(Met,KCe);HPe.registerSchema(DMt,{properties:{extensionEnabledApiProposals:{description:g(ni,79,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(mV),markdownEnumDescriptions:Object.values(mV)}}]}}}});var GS;(function(n){n.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(GS||(GS={}));class RMt{constructor(){this.extensionFeatures=new Map}registerExtensionFeature(e){if(this.extensionFeatures.has(e.id))throw new Error(`Extension feature with id '${e.id}' already exists`);return this.extensionFeatures.set(e.id,e),{dispose:()=>this.extensionFeatures.delete(e.id)}}getExtensionFeature(e){return this.extensionFeatures.get(e)}getExtensionFeatures(){return Array.from(this.extensionFeatures.values())}}it.add(GS.ExtensionFeaturesRegistry,new RMt);var pf;(function(n){n.Workbench="workbench.contributions.kind"})(pf||(pf={}));var Sl;(function(n){n[n.BlockStartup=1]="BlockStartup",n[n.BlockRestore=2]="BlockRestore",n[n.AfterRestored=3]="AfterRestored",n[n.Eventually=4]="Eventually"})(Sl||(Sl={}));function zVe(n){const e=n;return!!e&&typeof e.editorTypeId=="string"}function MMt(n){switch(n){case Us.Restored:return Sl.AfterRestored;case Us.Eventually:return Sl.Eventually}}function $Ve(n){switch(n){case Sl.BlockStartup:return Us.Starting;case Sl.BlockRestore:return Us.Ready;case Sl.AfterRestored:return Us.Restored;case Sl.Eventually:return Us.Eventually}}const uk=class uk extends ${constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.timingsByPhase=new Map,this.pendingRestoredContributions=new sd,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const s={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&zVe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,s,typeof i=="number"?$Ve(i):this.lifecycleService.phase):(typeof i=="number"&&XX(this.contributionsByPhase,$Ve(i),[]).push(s),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,s),zVe(i)&&XX(this.contributionsByEditor,i.editorTypeId,[]).push(s)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,MMt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,s=this.logService,o=this.environmentService;if(!t||!i||!s||!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const r=this.contributionsById.get(e);if(!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phasethis.onEditor(a.typeId,t,i,s,o)))}onEditor(e,t,i,s,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,s,o,a,i.phase)}}instantiateByPhase(e,t,i,s,o){t.phase>=o?this.doInstantiateByPhase(e,i,s,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,s,o))}async doInstantiateByPhase(e,t,i,s){const o=this.contributionsByPhase.get(s);if(o)switch(this.contributionsByPhase.delete(s),s){case Us.Starting:case Us.Ready:{vs(`code/willCreateWorkbenchContributions/${s}`);for(const r of o)this.safeCreateContribution(e,t,i,r,s);vs(`code/didCreateWorkbenchContributions/${s}`);break}case Us.Restored:case Us.Eventually:{s===Us.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,s);break}}}doInstantiateWhenIdle(e,t,i,s,o){vs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Us.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,s=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){s.error(g(Dv,3,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!zt(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every(zt))){s.error(g(Dv,4,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!zt(a)){s.error(g(Dv,5,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Qt(o,a);MS(c,o)||s.warn(g(Dv,6,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",GVe.name,c.toString(),o.path))}catch(c){s.error(g(Dv,7,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){s.error(g(Dv,8,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class PMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.jsonValidation}render(e){const t=e.contributes?.jsonValidation||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Dv,9,"File Match"),g(Dv,10,"Schema")],s=t.map(o=>[new Xt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:s},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(Dv,11,"JSON Validation"),access:{canToggle:!1},renderer:new Gi(PMt)});var pH;let hte=(pH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(NMt)}},pH.ID="workbench.contrib.jsonValidationExtensionPoint",pH);hte=D([_(0,be)],hte);gp(hte.ID,hte,Sl.BlockStartup);const Kl="vs/workbench/services/themes/common/colorExtensionPoint",YCe=it.as(xMe.ColorContribution),EK=YCe.getColorReferenceSchema(),Pet="^\\w+[.\\w+]*$",FMt=Ap.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(Kl,0,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(Kl,1,"The identifier of the themable color"),pattern:Pet,patternErrorMessage:g(Kl,2,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(Kl,3,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(Kl,4,"The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},dark:{description:g(Kl,5,"The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrast:{description:g(Kl,6,"The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(Kl,7,"The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes."),type:"string",anyOf:[EK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class OMt{constructor(){FMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||!Array.isArray(s)){o.error(g(Kl,8,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?fe.Format.CSS.parseHex(a):a:(o.error(g(Kl,9,"{0} must be either a color value in hex (#RRGGBB[AA] or #RGB[A]) or the identifier of a themable color which provides the default.",c)),fe.red);for(const a of s){if(typeof a.id!="string"||a.id.length===0){o.error(g(Kl,10,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(Pet)){o.error(g(Kl,11,"'configuration.colors.id' must only contain letters, digits and dots and can not start with a dot"));return}if(typeof a.description!="string"||a.id.length===0){o.error(g(Kl,12,"'configuration.colors.description' must be defined and can not be empty"));return}const c=a.defaults;if(!c||typeof c!="object"||typeof c.light!="string"||typeof c.dark!="string"){o.error(g(Kl,13,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(Kl,14,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(Kl,15,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}YCe.registerColor(a.id,{light:r(c.light,"configuration.colors.defaults.light"),dark:r(c.dark,"configuration.colors.defaults.dark"),hcDark:r(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:r(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const s=i.value;for(const o of s)YCe.deregisterColor(o.id)}})}}class BMt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.colors}render(e){const t=e.contributes?.colors||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=[g(Kl,16,"ID"),g(Kl,17,"Description"),g(Kl,18,"Dark Default"),g(Kl,19,"Light Default"),g(Kl,20,"High Contrast Default")],s=r=>r[0]==="#"?fe.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Xt().appendMarkdown(`\`${r.id}\``),r.description,s(r.defaults.dark)??new Xt().appendMarkdown(`\`${r.defaults.dark}\``),s(r.defaults.light)??new Xt().appendMarkdown(`\`${r.defaults.light}\``),s(r.defaults.highContrast)??new Xt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(Kl,21,"Colors"),access:{canToggle:!1},renderer:new Gi(BMt)});var mH;let ute=(mH=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(OMt)}},mH.ID="workbench.contrib.colorExtensionPoint",mH);ute=D([_(0,be)],ute);gp(ute.ID,ute,Sl.BlockStartup);const s_="vs/workbench/services/themes/common/iconExtensionPoint",k3=it.as(WXe.IconContribution),WMt=k3.getIconReferenceSchema(),Fet=`^${$e.iconNameSegment}(-${$e.iconNameSegment})+$`,HMt=Ap.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(s_,0,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:Fet,description:g(s_,1,"The identifier of the themable icon"),patternErrorMessage:g(s_,2,"Identifiers can only contain letters, digits and minuses and need to consist of at least two segments in the form `component-iconname`.")},additionalProperties:{type:"object",properties:{description:{type:"string",description:g(s_,3,"The description of the themable icon")},default:{anyOf:[WMt,{type:"object",properties:{fontPath:{description:g(s_,4,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(s_,5,"The character for the icon in the icon font."),type:"string"}},required:["fontPath","fontCharacter"],defaultSnippets:[{body:{fontPath:"${1:myiconfont.woff}",fontCharacter:"${2:\\\\E001}"}}]}],description:g(s_,6,"The default of the icon. Either a reference to an extisting ThemeIcon or an icon in an icon font.")}},required:["description","default"],defaultSnippets:[{body:{description:"${1:my icon}",default:{fontPath:"${2:myiconfont.woff}",fontCharacter:"${3:\\\\E001}"}}}]},defaultSnippets:[{body:{"${1:my-icon-id}":{description:"${2:my icon}",default:{fontPath:"${3:myiconfont.woff}",fontCharacter:"${4:\\\\E001}"}}}}]}});class UMt{constructor(){HMt.setHandler((e,t)=>{for(const i of t.added){const s=i.value,o=i.collector;if(!s||typeof s!="object"){o.error(g(s_,7,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in s){if(!r.match(Fet)){o.error(g(s_,8,"'configuration.icons' keys represent the icon id and can only contain letter, digits and minuses. They need to consist of at least two segments in the form `component-iconname`."));return}const a=s[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(s_,9,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")k3.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=T_(c.fontPath).substring(1),d=VMt[l];if(!d){o.warn(g(s_,10,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=Qt(h,c.fontPath);if(!MS(u,h)){o.warn(g(s_,11,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=zMt(i.description,c.fontPath),p=k3.registerIconFont(f,{src:[{location:u,format:d}]});k3.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(s_,12,"'configuration.icons.default' must be either a reference to the id of an other theme icon (string) or a icon definition (object) with properties `fontPath` and `fontCharacter`."))}}for(const i of t.removed){const s=i.value;for(const o in s)k3.deregisterIcon(o)}})}}const VMt={ttf:"truetype",woff:"woff",woff2:"woff2"};function zMt(n,e){return Qi.join(n.identifier.value,e)}var _H;let gte=(_H=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(UMt)}},_H.ID="workbench.contrib.iconExtensionPoint",_H);gte=D([_(0,be)],gte);gp(gte.ID,gte,Sl.BlockStartup);const KO="vs/platform/action/common/actionCommonCategories",Xa=Object.freeze({View:Be(KO,0,"View"),Help:Be(KO,1,"Help"),Test:Be(KO,2,"Test"),File:Be(KO,3,"File"),Preferences:Be(KO,4,"Preferences"),Developer:Be(KO,5,"Developer")}),$Mt="vs/platform/actions/common/menuResetAction";class GMt extends pi{constructor(){super({id:"menu.resetHiddenStates",title:Be($Mt,0,"Reset All Menus"),category:Xa.View,f1:!0})}run(e){e.get(_c).resetHiddenStates(),e.get(Ze).info("did RESET all menu hidden states")}}At(GMt);var qMt='.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:space-between}.monaco-editor .peekview-widget .head .peekview-title{align-items:baseline;display:flex;font-size:13px;margin-left:20px;min-width:0;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename,.monaco-editor .peekview-widget .head .peekview-title .meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;padding-right:2px;text-align:right}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{align-self:center;margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}';Ct(qMt,{});let oC=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ym(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};oC=D([_(4,be),_(5,jt),_(6,ji),_(7,Pe),_(8,pn),_(9,Pi),_(10,Ur),_(11,lo),_(12,ht)],oC);var QMt=".monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-bottom-style:solid;border-bottom-width:0;border-top-style:solid;border-top-width:0;position:relative}";Ct(QMt,{});const qVe=new fe(new gn(0,122,204)),jMt={showArrow:!0,showFrame:!0,className:"",frameColor:qVe,arrowColor:qVe,keepEditorSelection:!1},KMt="vs.editor.contrib.zoneWidget";class YMt{constructor(e,t,i,s,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class JMt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const Uae=class Uae{constructor(e){this._editor=e,this._ruleName=Uae._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),vE(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){vE(this._ruleName),Kp(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:O.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:gi.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};Uae._IdGenerator=new yz(".arrow-decoration-");let JCe=Uae;class UPe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Vs(t),ym(this.options,jMt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new JCe(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}hasFocus(){return this.domNode.contains(xl())}show(e,t){const i=O.isIRange(e)?O.lift(e):O.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Kt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=O.isIRange(e)?O.getStartPosition(e):e,this._viewZone.afterLineNumber=e.lineNumber,this._viewZone.afterColumn=e.column,this._viewZone.heightInLines=t??this._viewZone.heightInLines,this.editor.changeViewZones(i=>{i.layoutZone(this._viewZone.id)}),this._positionMarkerId.set([{range:O.isIRange(e)?e:O.fromPositions(e),options:Kt.EMPTY}]))}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(x.lineHeight);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(x.lineHeight);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let c=0,l=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new YMt(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new JMt(KMt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new O(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,vt.Smooth):this.editor.revealRange(e,vt.Smooth)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Lh(this.domNode,this,{orientation:vi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=Ia.Disabled);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(x.lineHeight),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}const Cg="vs/editor/contrib/peekView/browser/peekView",Oet=ae("IPeekViewService");ce(Oet,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},Yt.Delayed);var mf;(function(n){n.inPeekEditor=new Y("inReferenceSearchEditor",!0,g(Cg,0,"Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(mf||(mf={}));var vH;let fte=(vH=class{constructor(e,t){e instanceof oC&&mf.inPeekEditor.bindTo(t)}dispose(){}},vH.ID="editor.contrib.referenceController",vH);fte=D([_(1,Pe)],fte);vn(fte.ID,fte,mi.Eager);function Bet(n){const e=n.get(jt).getFocusedCodeEditor();return e instanceof oC?e.getParentEditor():e}const XMt={headerBackgroundColor:fe.white,primaryHeadingColor:fe.fromHex("#333333"),secondaryHeadingColor:fe.fromHex("#6c6c6cb3")};let V7=class extends UPe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,ym(this.options,XMt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=we(".head"),this._bodyElement=we(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=we(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Xo(this._titleElement,"click",o=>this._onTitleClick(o))),he(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=we("span.filename"),this._secondaryHeading=we("span.dirname"),this._metaHeading=we("span.meta"),he(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=we(".peekview-actions");he(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Qh(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xn("peekview.close",g(Cg,1,"Close"),$e.asClassName(Ce.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:yO.bind(void 0,this.instantiationService),orientation:Qb.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Yo(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Oh(this._metaHeading)):Jl(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};V7=D([_(2,be)],V7);const SR=B("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,2,"Background color of the peek view title area.")),VPe=B("peekViewTitleLabel.foreground",{dark:fe.white,light:fe.black,hcDark:fe.white,hcLight:Mc},g(Cg,3,"Color of the peek view title.")),zPe=B("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(Cg,4,"Color of the peek view title info.")),$Pe=B("peekView.border",{dark:Qc,light:Qc,hcDark:ft,hcLight:ft},g(Cg,5,"Color of the peek view borders and arrow.")),ZMt=B("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:fe.black,hcLight:fe.white},g(Cg,6,"Background color of the peek view result list."));B("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:fe.white,hcLight:Mc},g(Cg,7,"Foreground color for line nodes in the peek view result list."));B("peekViewResult.fileForeground",{dark:fe.white,light:"#1E1E1E",hcDark:fe.white,hcLight:Mc},g(Cg,8,"Foreground color for file nodes in the peek view result list."));B("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(Cg,9,"Background color of the selected entry in the peek view result list."));B("peekViewResult.selectionForeground",{dark:fe.white,light:"#6C6C6C",hcDark:fe.white,hcLight:Mc},g(Cg,10,"Foreground color of the selected entry in the peek view result list."));const aI=B("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:fe.black,hcLight:fe.white},g(Cg,11,"Background color of the peek view editor."));B("peekViewEditorGutter.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,12,"Background color of the gutter in the peek view editor."));B("peekViewEditorStickyScroll.background",{dark:aI,light:aI,hcDark:aI,hcLight:aI},g(Cg,13,"Background color of sticky scroll in the peek view editor."));B("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(Cg,14,"Match highlight color in the peek view result list."));B("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(Cg,15,"Match highlight color in the peek view editor."));B("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:co,hcLight:co},g(Cg,16,"Match highlight border in the peek view editor."));const cI="vs/editor/contrib/gotoSymbol/browser/referencesModel";class L1{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=Zwe.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?g(cI,1,"{0} in {1} on line {2} at column {3}",e.value,ui(this.uri),this.range.startLineNumber,this.range.startColumn):g(cI,0,"in {0} on line {1} at column {2}",ui(this.uri),this.range.startLineNumber,this.range.startColumn)}}class eNt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:s,column:o-t}),l=new O(s,c.startColumn,s,o),d=new O(r,a,r,Zn.MAX_SAFE_SMALL_INTEGER),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class z7{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new wi}dispose(){St(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g(cI,2,"1 symbol in {0}, full path {1}",ui(this.uri),this.uri.fsPath):g(cI,3,"{0} symbols in {1}, full path {2}",e,ui(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new eNt(i))}catch(i){bt(i)}return this}}class fp{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new I,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(fp._compareReferences);let s;for(const o of e)if((!s||!Fn.isEqual(s.uri,o.uri,!0))&&(s=new z7(this,o.uri),this.groups.push(s)),s.children.length===0||fp._compareReferences(o,s.children[s.children.length-1])!==0){const r=new L1(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){St(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new fp(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(cI,4,"No results found"):this.references.length===1?g(cI,5,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(cI,6,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(cI,7,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:LS(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&O.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Fn.compare(e.uri,t.uri)||O.compareRangesUsingStarts(e.range,t.range)}}var tNt=".monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-bottom-width:1px;border-top-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;padding:3em 0;text-align:center;width:100%}.monaco-editor .reference-zone-widget .ref-tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground);line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{overflow:hidden;text-overflow:ellipsis}.monaco-editor .reference-zone-widget .ref-tree .reference-file{color:var(--vscode-peekViewResult-fileForeground);display:inline-flex;height:100%;width:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-left:auto;margin-right:12px}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input,.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder,transparent);box-sizing:border-box}";Ct(tNt,{});var XCe;const ZCe="vs/editor/contrib/gotoSymbol/browser/peek/referencesTree";let eye=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof fp||e instanceof z7}getChildren(e){if(e instanceof fp)return e.groups;if(e instanceof z7)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};eye=D([_(0,Rn)],eye);class iNt{getHeight(){return 23}getTemplateId(e){return e instanceof z7?pte.id:mte.id}}let tye=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof L1){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return ui(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};tye=D([_(0,ti)],tye);class nNt{getId(e){return e instanceof L1?e.id:e.uri}}let iye=class extends ${constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new T7(i,{supportHighlights:!0})),this.badge=new Obe(he(i,we(".count")),{},tXe),e.appendChild(i)}set(e,t){const i=ma(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(g(ZCe,0,"{0} references",s)):this.badge.setTitleFormat(g(ZCe,1,"{0} reference",s))}};iye=D([_(1,eo)],iye);var uN;let pte=(uN=class{constructor(e){this._instantiationService=e,this.templateId=XCe.id}renderTemplate(e){return this._instantiationService.createInstance(iye,e)}renderElement(e,t,i){i.set(e.element,Cz(e.filterData))}disposeTemplate(e){e.dispose()}},XCe=uN,uN.id="FileReferencesRenderer",uN);pte=XCe=D([_(0,be)],pte);class sNt extends ${constructor(e){super(),this.label=this._register(new NI(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${ui(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:o}=i;t&&!sw.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,Cz(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[o]))}}}const Vae=class Vae{constructor(){this.templateId=Vae.id}renderTemplate(e){return new sNt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};Vae.id="OneReferenceRenderer";let mte=Vae;class oNt{getWidgetAriaLabel(){return g(ZCe,2,"References")}getAriaLabel(e){return e.ariaMessage}}const tpe="vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget",zae=class zae{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Z,this._callOnModelChange=new Z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(E.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(aNt,"ReferencesWidget",this._treeContainer,new iNt,[this._instantiationService.createInstance(pte),this._instantiationService.createInstance(mte)],this._instantiationService.createInstance(eye),i),this._splitView.addView({onDidChange:T.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},A1.Distribute),this._splitView.addView({onDidChange:T.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},A1.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof L1&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Jl(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g(tpe,1,"No results"),Oh(this._messageContainer),Promise.resolve(void 0)):(Jl(this._messageContainer),this._decorationsManager=new nye(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Oh(this._treeContainer),Oh(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof L1)return e;if(e instanceof z7&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==_e.inMemory?this.setTitle(Mx(e.uri),this._uriLabel.getUriLabel(ma(e.uri))):this.setTitle(g(tpe,2,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}St(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?vt.Smooth:vt.Immediate,a=O.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};sye=D([_(3,pn),_(4,Rn),_(5,be),_(6,Oet),_(7,eo),_(8,pO),_(9,ti),_(10,Di),_(11,lo)],sye);var DJ;const oye="vs/editor/contrib/gotoSymbol/browser/peek/referencesController",AO=new Y("referenceSearchVisible",!1,g(oye,0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var gN;let wF=(gN=class{static get(e){return e.getContribution(DJ.ID)}constructor(e,t,i,s,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=AO.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=rNt.fromJSON(this._storageService.get(o,ke.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(sye,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(oye,1,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),ke.PROFILE,ln.MACHINE),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{const{element:l,kind:d}=c;if(l)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(l,!1,!1);break;case"side":this.openReference(l,!0,!1);break;case"goto":i?this._gotoReference(l,!0):this.openReference(l,!1,!0);break}}));const a=++this._requestIdPool;t.then(c=>{if(a!==this._requestIdPool||!this._widget){c.dispose();return}return this._model?.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(g(oye,2,"{0} ({1})",this._model.title,this._model.references.length));const l=this._editor.getModel().uri,d=new oe(e.startLineNumber,e.startColumn),h=this._model.nearestReference(l,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(x.peekWidgetDefaultFocus)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=O.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:jb.JUMP,pinned:t}},this._editor).then(s=>{if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=DJ.get(s),r=this._model.clone();this.closeWidget(),s.focus(),o?.toggleWidget(i,na(a=>Promise.resolve(r)),this._peekMode??!1)}},s=>{this._ignoreModelChangeEvent=!1,bt(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:jb.JUMP,pinned:i}},this._editor,t)}},DJ=gN,gN.ID="editor.contrib.referencesController",gN);wF=DJ=D([_(2,Pe),_(3,jt),_(4,Pi),_(5,be),_(6,on),_(7,Re)],wF);function EO(n,e){const t=Bet(n);if(!t)return;const i=wF.get(t);i&&e(i)}xr.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:ye.EditorContrib,primary:Br(V.CtrlCmd|E.KeyK,E.F2),when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});xr.registerCommandAndKeybindingRule({id:"goToNextReference",weight:ye.EditorContrib-10,primary:E.F4,secondary:[E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!0)})}});xr.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:ye.EditorContrib-10,primary:V.Shift|E.F4,secondary:[V.Shift|E.F12],when:ge.or(AO,mf.inPeekEditor),handler(n){EO(n,e=>{e.goToNextOrPreviousReference(!1)})}});yt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");yt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");yt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");yt.registerCommand("closeReferenceSearch",n=>EO(n,e=>e.closeWidget()));xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.EditorContrib-101,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(mf.inPeekEditor,ge.not("config.editor.stablePeek"))});xr.registerKeybindingRule({id:"closeReferenceSearch",weight:ye.WorkbenchContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(AO,ge.not("config.editor.stablePeek"),ge.or(X.editorTextFocus,SXe.negate()))});xr.registerCommandAndKeybindingRule({id:"revealReference",weight:ye.WorkbenchContrib,primary:E.Enter,mac:{primary:E.Enter,secondary:[V.CtrlCmd|E.DownArrow]},when:ge.and(AO,Rde,GNe.negate(),qNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.revealReference(t[0]))}});xr.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:ye.EditorContrib,primary:V.CtrlCmd|E.Enter,mac:{primary:V.WinCtrl|E.Enter},when:ge.and(AO,Rde,GNe.negate(),qNe.negate()),handler(n){const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!0,!0))}});yt.registerCommand("openReference",n=>{const t=n.get(yf).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof L1&&EO(n,i=>i.openReference(t[0],!1,!0))});let rye=class extends wF{constructor(e,t,i,s,o,r,a){super(!1,e,t,i,s,o,r,a)}};rye=D([_(1,Pe),_(2,jt),_(3,Pi),_(4,be),_(5,on),_(6,Re)],rye);vn(wF.ID,rye,mi.Lazy);const CBe=class CBe extends ${constructor(e){super(),this._editor=e,this._altListeningMouse=!1,this._altMouseTriggered=!1,this._register(this._editor.onMouseDown(t=>{this._altListeningMouse&&(this._altMouseTriggered=!0)})),this._register(this._editor.onKeyDown(t=>{t.equals(V.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(V.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};CBe.ID="editor.contrib.menuPreventer";let Hx=CBe;vn(Hx.ID,Hx,mi.BeforeFirstInteraction);let $7=class extends xm{constructor(e,t,i,s,o,r,a,c,l){super(e,s.getRawOptions(),i,o,r,a,c,l),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ym(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};$7=D([_(4,Pe),_(5,be),_(6,jt),_(7,Lw),_(8,eD)],$7);const NQ=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1),e.dispose()}}}getImplementations(){return this._implementations}};class Wet extends wg{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=we(".floating-click-widget"),this._domNode.style.padding="6px 11px",this._domNode.style.borderRadius="2px",this._domNode.style.cursor="pointer",this._domNode.style.zIndex="1"}getDomNode(){return this._domNode}render(){Yo(this._domNode),this._domNode.style.backgroundColor=Zve(eS,Ye(us)),this._domNode.style.color=Zve(Zy,Ye(Mc)),this._domNode.style.border=`1px solid ${Ye(ft)}`,he(this._domNode,we("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let _te=class extends ${constructor(e,t,i){super(),this.renderEmitter=new I,this.onDidRender=this.renderEmitter.event,this.menu=this._register(t.createMenu(e,i))}render(){const e=this._register(new Z),t=()=>{if(e.clear(),!this.isVisible())return;const i=[];if(tD(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[s]=i,o=this.createWidget(s,e);e.add(o),e.add(o.onClick(()=>s.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};_te=D([_(1,_c),_(2,Pe)],_te);let QVe=class extends _te{constructor(e,t,i,s){super(e.menuId,i,s),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(Wet,e.label),s=i.getDomNode();return this.options.container.appendChild(s),t.add(Ee(()=>this.options.container.removeChild(s))),i}getActionArg(){return this.options.getActionArg()}};QVe=D([_(1,be),_(2,_c),_(3,Pe)],QVe);var kJ,c0;let jVe=(c0=class extends ${constructor(e){super(),this.editorService=e,this._onHighlightRemoved=this._register(new I),this.onHighlightRemoved=this._onHighlightRemoved.event,this.rangeHighlightDecorationId=null,this.editor=null,this.editorDisposables=this._register(new Z)}removeHighlightRange(){if(this.editor&&this.rangeHighlightDecorationId){const e=this.rangeHighlightDecorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e)}),this._onHighlightRemoved.fire()}this.rangeHighlightDecorationId=null}highlightRange(e,t){t=t??this.getEditor(e),ja(t)?this.doHighlightRange(t,e):HU(t)&&ja(t.activeCodeEditor)&&this.doHighlightRange(t.activeCodeEditor,e)}doHighlightRange(e,t){this.removeHighlightRange(),e.changeDecorations(i=>{this.rangeHighlightDecorationId=i.addDecoration(t.range,this.createRangeHighlightDecoration(t.isWholeLine))}),this.setEditor(e)}getEditor(e){const t=this.editorService.activeEditor?.resource;if(t&&_n(t,e.resource)&&ja(this.editorService.activeTextEditorControl))return this.editorService.activeTextEditorControl}setEditor(e){this.editor!==e&&(this.editorDisposables.clear(),this.editor=e,this.editorDisposables.add(this.editor.onDidChangeCursorPosition(t=>{(t.reason===Wi.NotSet||t.reason===Wi.Explicit||t.reason===Wi.Undo||t.reason===Wi.Redo)&&this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidChangeModel(()=>{this.removeHighlightRange()})),this.editorDisposables.add(this.editor.onDidDispose(()=>{this.removeHighlightRange(),this.editor=null})))}createRangeHighlightDecoration(e=!0){return e?kJ._WHOLE_LINE_RANGE_HIGHLIGHT:kJ._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},kJ=c0,c0._WHOLE_LINE_RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight-whole",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),c0._RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),c0);jVe=kJ=D([_(0,_i)],jVe);let vte=class extends Wet{constructor(e,t,i,s){super(i&&s.lookupKeybinding(i)?`${t} (${s.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};vte=D([_(3,ti)],vte);var wH;let KVe=(wH=class extends _te{constructor(e,t,i,s){super(Te.EditorContent,i,s),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(vte,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof oC)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},wH.ID="editor.contrib.floatingClickMenu",wH);KVe=D([_(1,be),_(2,_c),_(3,Pe)],KVe);const bS="vs/workbench/common/configuration";Object.freeze({id:"application",order:100,title:g(bS,0,"Application"),type:"object"});const PQ=Object.freeze({id:"workbench",order:7,title:g(bS,1,"Workbench"),type:"object"}),cNt=Object.freeze({id:"security",scope:ut.APPLICATION,title:g(bS,2,"Security"),type:"object",order:7}),lNt=Object.freeze({id:"problems",title:g(bS,3,"Problems"),type:"object",order:101}),Het=Object.freeze({id:"window",order:8,title:g(bS,4,"Window"),type:"object"}),Rm={ConfigurationMigration:"base.contributions.configuration.migration"};class dNt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const IJ=new dNt;it.add(Rm.ConfigurationMigration,IJ);var bH;let wte=(bH=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const s of i.added)await this.migrateConfigurationsForFolder(s,IJ.migrations)})),this.migrateConfigurations(IJ.migrations),this._register(IJ.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),s=this.workspaceService.getWorkbenchState()===Nn.WORKSPACE?[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE],["workspaceFolder",Ot.WORKSPACE_FOLDER]]:[["user",Ot.USER],["userLocal",Ot.USER_LOCAL],["userRemote",Ot.USER_REMOTE],["workspace",Ot.WORKSPACE]];for(const[o,r]of s){const a=i[o];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,o,a.value,t,void 0);for(const d of l??[])c.push([d,[]])}for(const{identifiers:l,value:d}of a.overrides??[])if(d!==void 0){const h=await this.runMigration(e,o,d,t,l);for(const u of h??[])c.push([u,l])}c.length&&await Promise.allSettled(c.map(async([[l,d],h])=>this.configurationService.updateValue(l,d.value,{resource:t,overrideIdentifiers:h},r)))}}async runMigration(e,t,i,s,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:s})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Io(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},bH.ID="workbench.contrib.configurationMigration",bH);wte=D([_(0,Re),_(1,Ti)],wte);var CH;let bte=(CH=class extends ${constructor(e){super(),this.remoteAgentService=e,this._ready=new sd,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Is&&(await this.remoteAgentService.getEnvironment())?.os!==Pr.Windows)return;it.as(Cs.Configuration).registerConfiguration({...cNt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(bS,5,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(bS,6,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(bS,7,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:ut.MACHINE}}})}},CH.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",CH);bte=D([_(0,Sf)],bte);const C5="window.newWindowProfile";var yH;let Cte=(yH=class extends ${constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==Ot.DEFAULT&&i.affectsConfiguration(C5)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=it.as(Cs.Configuration),t={...Het,properties:{[C5]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(bS,8,"Active Window")],description:g(bS,9,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the default profile if no active window exists."),scope:ut.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(C5);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(C5);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(C5,t?.name)}},yH.ID="workbench.contrib.dynamicWindowConfiguration",yH);Cte=D([_(0,V_),_(1,Re)],Cte);const Fw="vs/editor/browser/widget/diffEditor/commands";class hNt extends pi{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Be(Fw,0,"Toggle Collapse Unchanged Regions"),icon:Ce.map,toggled:ge.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ge.has("isInDiffEditor"),menu:{when:ge.has("isInDiffEditor"),id:Te.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class Uet extends pi{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Be(Fw,1,"Toggle Show Moved Code Blocks"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class Vet extends pi{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Be(Fw,2,"Toggle Use Inline View When Space Is Limited"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Re),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const FQ=Be(Fw,3,"Diff Editor");class uNt extends wf{constructor(){super({id:"diffEditor.switchSide",title:Be(Fw,4,"Switch Side"),icon:Ce.arrowSwap,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,i){const s=Oz(e);if(s instanceof xm){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class gNt extends wf{constructor(){super({id:"diffEditor.exitCompareMove",title:Be(Fw,5,"Exit Compare Move"),icon:Ce.close,precondition:X.comparingMovedCode,f1:!1,category:FQ,keybinding:{weight:1e4,primary:E.Escape}})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.exitCompareMove()}}class fNt extends wf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Be(Fw,6,"Collapse All Unchanged Regions"),icon:Ce.fold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.collapseAllUnchangedRegions()}}class pNt extends wf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Be(Fw,7,"Show All Unchanged Regions"),icon:Ce.unfold,precondition:ge.has("isInDiffEditor"),f1:!0,category:FQ})}runEditorCommand(e,t,...i){const s=Oz(e);s instanceof xm&&s.showAllUnchangedRegions()}}class aye extends pi{constructor(){super({id:"diffEditor.revert",title:Be(Fw,8,"Revert"),f1:!1,category:FQ})}run(e,t){const i=mNt(e,t.originalUri,t.modifiedUri);i instanceof xm&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const zet=Be(Fw,9,"Accessible Diff Viewer"),$ae=class $ae extends pi{constructor(){super({id:$ae.id,title:Be(Fw,10,"Go to Next Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerNext()}};$ae.id="editor.action.accessibleDiffViewer.next";let _V=$ae;const Gae=class Gae extends pi{constructor(){super({id:Gae.id,title:Be(Fw,11,"Go to Previous Difference"),category:zet,precondition:ge.has("isInDiffEditor"),keybinding:{primary:V.Shift|E.F7,weight:ye.EditorContrib},f1:!0})}run(e){Oz(e)?.accessibleDiffViewerPrev()}};Gae.id="editor.action.accessibleDiffViewer.prev";let G7=Gae;function mNt(n,e,t){return n.get(jt).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Oz(n){const t=n.get(jt).listDiffEditors(),i=xl();if(i)for(const s of t){const o=s.getContainerDomNode();if(_Nt(o,i))return s}return null}function _Nt(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}var rC;(function(n){n.Terminal="terminal",n.TerminalChat="terminal-chat",n.TerminalHelp="terminal-help",n.DiffEditor="diffEditor",n.Chat="panelChat",n.InlineChat="inlineChat",n.InlineCompletions="inlineCompletions",n.KeybindingsEditor="keybindingsEditor",n.Notebook="notebook",n.Editor="editor",n.Hover="hover",n.Notification="notification",n.EmptyEditorHint="emptyEditorHint",n.Comments="comments"})(rC||(rC={}));var N_;(function(n){n.Help="help",n.View="view"})(N_||(N_={}));var YVe;(function(n){n.Previous="previous",n.Next="next"})(YVe||(YVe={}));const Ea="vs/workbench/contrib/speech/common/speechService",vNt=new Y("hasSpeechProvider",!1,{type:"boolean",description:g(Ea,0,"A speech provider is registered to the speech service.")}),wNt=new Y("speechToTextInProgress",!1,{type:"boolean",description:g(Ea,1,"A speech-to-text session is in progress.")});new Y("textToSpeechInProgress",!1,{type:"boolean",description:g(Ea,2,"A text-to-speech session is in progress.")});var l2;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(l2||(l2={}));var cye;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(cye||(cye={}));var JVe;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped",n[n.Canceled=3]="Canceled"})(JVe||(JVe={}));var jW;(function(n){n.SpeechTimeout="accessibility.voice.speechTimeout",n.AutoSynthesize="accessibility.voice.autoSynthesize",n.SpeechLanguage="accessibility.voice.speechLanguage"})(jW||(jW={}));jW.SpeechLanguage;const bNt={"da-DK":{name:g(Ea,3,"Danish (Denmark)")},"de-DE":{name:g(Ea,4,"German (Germany)")},"en-AU":{name:g(Ea,5,"English (Australia)")},"en-CA":{name:g(Ea,6,"English (Canada)")},"en-GB":{name:g(Ea,7,"English (United Kingdom)")},"en-IE":{name:g(Ea,8,"English (Ireland)")},"en-IN":{name:g(Ea,9,"English (India)")},"en-NZ":{name:g(Ea,10,"English (New Zealand)")},"en-US":{name:g(Ea,11,"English (United States)")},"es-ES":{name:g(Ea,12,"Spanish (Spain)")},"es-MX":{name:g(Ea,13,"Spanish (Mexico)")},"fr-CA":{name:g(Ea,14,"French (Canada)")},"fr-FR":{name:g(Ea,15,"French (France)")},"hi-IN":{name:g(Ea,16,"Hindi (India)")},"it-IT":{name:g(Ea,17,"Italian (Italy)")},"ja-JP":{name:g(Ea,18,"Japanese (Japan)")},"ko-KR":{name:g(Ea,19,"Korean (South Korea)")},"nl-NL":{name:g(Ea,20,"Dutch (Netherlands)")},"pt-PT":{name:g(Ea,21,"Portuguese (Portugal)")},"pt-BR":{name:g(Ea,22,"Portuguese (Brazil)")},"ru-RU":{name:g(Ea,23,"Russian (Russia)")},"sv-SE":{name:g(Ea,24,"Swedish (Sweden)")},"tr-TR":{name:g(Ea,25,"Turkish (Türkiye)")},"zh-CN":{name:g(Ea,26,"Chinese (Simplified, China)")},"zh-HK":{name:g(Ea,27,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(Ea,28,"Chinese (Traditional, Taiwan)")}},dt="vs/workbench/contrib/accessibility/browser/accessibilityConfiguration",T1=new Y("accessibilityHelpIsShown",!1,!0),Dm=new Y("accessibleViewIsShown",!1,!0),yte=new Y("accessibleViewSupportsNavigation",!1,!0),XVe=new Y("accessibleViewVerbosityEnabled",!1,!0),ZVe=new Y("accessibleViewGoToSymbolSupported",!1,!0);new Y("accessibleViewOnLastLine",!1,!0);const Ste=new Y("accessibleViewCurrentProviderId",void 0,void 0);new Y("accessibleViewInCodeBlock",void 0,void 0);const Ate=new Y("accessibleViewContainsCodeBlocks",void 0,void 0);var lye;(function(n){n.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",n.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",n.HideAccessibleView="accessibility.hideAccessibleView",n.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(lye||(lye={}));var e4e;(function(n){n[n.Default=.75]="Default",n[n.Minimum=.2]="Minimum",n[n.Maximum=1]="Maximum"})(e4e||(e4e={}));var ua;(function(n){n.Terminal="accessibility.verbosity.terminal",n.DiffEditor="accessibility.verbosity.diffEditor",n.Chat="accessibility.verbosity.panelChat",n.InlineChat="accessibility.verbosity.inlineChat",n.TerminalChat="accessibility.verbosity.terminalChat",n.InlineCompletions="accessibility.verbosity.inlineCompletions",n.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",n.Notebook="accessibility.verbosity.notebook",n.Editor="accessibility.verbosity.editor",n.Hover="accessibility.verbosity.hover",n.Notification="accessibility.verbosity.notification",n.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",n.Comments="accessibility.verbosity.comments",n.DiffEditorActive="accessibility.verbosity.diffEditorActive"})(ua||(ua={}));const Q_={type:"boolean",default:!0,tags:["accessibility"]},$et=Object.freeze({id:"accessibility",title:g(dt,0,"Accessibility"),type:"object"}),Sc={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(dt,1,"Enable sound when a screen reader is attached."),g(dt,2,"Enable sound."),g(dt,3,"Disable sound.")],tags:["accessibility"]},ph={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},mh={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(dt,4,"Enable announcement, will only play when in screen reader optimized mode."),g(dt,5,"Disable announcement.")],tags:["accessibility"]},DL={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...$et,scope:ut.RESOURCE,properties:(ua.Terminal+"",{description:g(dt,6,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...Q_},ua.DiffEditor+"",{description:g(dt,7,"Provide information about how to navigate changes in the diff editor when it is focused."),...Q_},ua.Chat+"",{description:g(dt,8,"Provide information about how to access the chat help menu when the chat input is focused."),...Q_},ua.InlineChat+"",{description:g(dt,9,"Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused."),...Q_},ua.InlineCompletions+"",{description:g(dt,10,"Provide information about how to access the inline completions hover and Accessible View."),...Q_},ua.KeybindingsEditor+"",{description:g(dt,11,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...Q_},ua.Notebook+"",{description:g(dt,12,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...Q_},ua.Hover+"",{description:g(dt,13,"Provide information about how to open the hover in an Accessible View."),...Q_},ua.Notification+"",{description:g(dt,14,"Provide information about how to open the notification in an Accessible View."),...Q_},ua.EmptyEditorHint+"",{description:g(dt,15,"Provide information about relevant actions in an empty text editor."),...Q_},ua.Comments+"",{description:g(dt,16,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...Q_},ua.DiffEditorActive+"",{description:g(dt,17,"Indicate when a diff editor becomes the active editor."),...Q_},lye.AccessibleViewCloseOnKeyPress+"",g(dt,18,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(dt,19,"The volume of the sounds in percent (0-100)."),g(dt,20,"Whether or not position changes should be debounced"),g(dt,21,"The delay in milliseconds before an announcement is made."),g(dt,22,"The delay in milliseconds before a sound is played."),g(dt,23,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(dt,24,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(dt,25,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(dt,26,"The delay in milliseconds before a sound is played when there's an error at the position."),{...ph,description:g(dt,27,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(dt,28,"Plays a sound when the active line has a breakpoint."),...Sc},{description:g(dt,29,"Announces when the active line has a breakpoint."),...mh})},{...DL,description:g(dt,30,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(dt,31,"Plays a sound when the active line has an inline suggestion."),...Sc}},{...ph,description:g(dt,32,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(dt,33,"Plays a sound when the active line has an error."),...Sc},{description:g(dt,34,"Announces when the active line has an error."),...mh})},{...ph,description:g(dt,35,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(dt,36,"Plays a sound when the active line has a folded area that can be unfolded."),...Sc},{description:g(dt,37,"Announces when the active line has a folded area that can be unfolded."),...mh})},{...ph,description:g(dt,38,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,39,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,40,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,41,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,42,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,43,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,44,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(dt,45,"Plays a sound when the active line has a warning."),...Sc},{description:g(dt,46,"Announces when the active line has a warning."),...mh})},{...ph,description:g(dt,47,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(dt,48,"Plays a sound when the debugger stopped on a breakpoint."),...Sc},{description:g(dt,49,"Announces when the debugger stopped on a breakpoint."),...mh})},{...ph,description:g(dt,50,"Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."),properties:({description:g(dt,51,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...Sc},{description:g(dt,52,"Announces when trying to read a line with inlay hints that has no inlay hints."),...mh})},{...ph,description:g(dt,53,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(dt,54,"Plays a sound when a task is completed."),...Sc},{description:g(dt,55,"Announces when a task is completed."),...mh})},{...ph,description:g(dt,56,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(dt,57,"Plays a sound when a task fails (non-zero exit code)."),...Sc},{description:g(dt,58,"Announces when a task fails (non-zero exit code)."),...mh})},{...ph,description:g(dt,59,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,60,"Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Sc},{description:g(dt,61,"Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,62,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),properties:({description:g(dt,63,"Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...Sc},{description:g(dt,64,"Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),...mh})},{...ph,description:g(dt,65,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(dt,66,"Plays a sound when terminal Quick Fixes are available."),...Sc},{description:g(dt,67,"Announces when terminal Quick Fixes are available."),...mh})},{...ph,description:g(dt,68,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(dt,69,"Plays a sound when the terminal bell is ringing."),...Sc},{description:g(dt,70,"Announces when the terminal bell is ringing."),...mh})},{...DL,description:g(dt,71,"Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,72,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...DL,description:g(dt,73,"Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,74,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...DL,description:g(dt,75,"Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),properties:{description:g(dt,76,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...Sc}},{...ph,description:g(dt,77,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(dt,78,"Plays a sound when a notebook cell execution is successfully completed."),...Sc},{description:g(dt,79,"Announces when a notebook cell execution is successfully completed."),...mh})},{...ph,description:g(dt,80,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(dt,81,"Plays a sound when a notebook cell execution fails."),...Sc},{description:g(dt,82,"Announces when a notebook cell execution fails."),...mh})},{...ph,description:g(dt,83,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(dt,84,"Plays a sound when a chat request is made."),...Sc},{description:g(dt,85,"Announces when a chat request is made."),...mh})},{...ph,description:g(dt,86,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(dt,87,"Plays a sound on loop while progress is occurring."),...Sc},{description:g(dt,88,"Alerts on loop while progress is occurring."),...mh})},{...DL,description:g(dt,89,"Plays a sound / audio cue when the response has been received."),properties:{description:g(dt,90,"Plays a sound on loop while the response has been received."),...Sc}},{...DL,description:g(dt,91,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(dt,92,"Plays a sound when the voice recording has started."),...Sc}},{...DL,description:g(dt,93,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(dt,94,"Plays a sound when the voice recording has stopped."),...Sc}},{...ph,description:g(dt,95,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."),properties:({description:g(dt,96,"Plays a sound when a feature is cleared."),...Sc},{description:g(dt,97,"Announces when a feature is cleared."),...mh})},g(dt,98,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(dt,99,"Plays a sound when a file is saved."),g(dt,100,"Plays the sound when a user explicitly saves a file."),g(dt,101,"Plays the sound whenever a file is saved, including auto save."),g(dt,102,"Never plays the sound."),g(dt,103,"Announces when a file is saved."),g(dt,104,"Announces when a user explicitly saves a file."),g(dt,105,"Announces whenever a file is saved, including auto save."),g(dt,106,"Never plays the announcement."),g(dt,107,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(dt,108,"Plays a sound when a file or notebook is formatted."),g(dt,109,"Plays the sound when a user explicitly formats a file."),g(dt,110,"Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,111,"Never plays the sound."),g(dt,112,"Announces when a file or notebook is formatted."),g(dt,113,"Announces when a user explicitly formats a file."),g(dt,114,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(dt,115,"Never announces."))});const CNt=1200;var SH;let t4e=(SH=class extends ${constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(T.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((s,o)=>e[s].name.localeCompare(e[o].name));it.as(Cs.Configuration).registerConfiguration({...$et,properties:{[jW.SpeechTimeout]:{markdownDescription:g(dt,119,"The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."),type:"number",default:CNt,minimum:0,tags:["accessibility"]},[jW.SpeechLanguage]:{markdownDescription:g(dt,120,"The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."),type:"string",enum:t,default:"auto",tags:["accessibility"],enumDescriptions:t.map(s=>e[s].name),enumItemLabels:t.map(s=>e[s].name)},[jW.AutoSynthesize]:{type:"boolean",markdownDescription:g(dt,121,"Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."),default:this.productService.quality!=="stable",tags:["accessibility"]}}})}getLanguages(){return{auto:{name:g(dt,122,"Auto (Use Display Language)")},...bNt}}},SH.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",SH);t4e=D([_(0,Xde),_(1,Ja)],t4e);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["audioCues.volume",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["audioCues.debouncePositionChanges",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(n,e)=>{const t=n.delays;return t?[["accessibility.signalOptions",{value:{...n,"experimental.delays":t,delays:void 0}}]]:[]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:(n,e)=>{const t=qet(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:n,debouncePositionChanges:t}:{volume:n}}],["accessibility.signals.sounds.volume",{value:void 0}]]}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:(n,e)=>{const t=Get(e);return[["accessibility.signalOptions",{value:t!==void 0?{volume:t,debouncePositionChanges:n}:{debouncePositionChanges:n}}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}}]);function Get(n){return n("accessibility.signalOptions")?.volume||n("accessibility.signals.sounds.volume")||n("audioCues.volume")}function qet(n){return n("accessibility.signalOptions")?.debouncePositionChanges||n("accessibility.signals.debouncePositionChanges")||n("audioCues.debouncePositionChanges")}it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(n,e)=>[["accessibility.signals.progress",{value:n}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.map(n=>n.legacySoundSettingsKey?{key:n.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],s=n.legacyAnnouncementSettingsKey;let o;return s&&(o=t(s)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${n.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(yl));it.as(Rm.ConfigurationMigration).registerConfigurationMigrations(Zl.allAccessibilitySignals.filter(n=>!!n.legacyAnnouncementSettingsKey&&!!n.legacySoundSettingsKey).map(n=>({key:n.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],s=t(n.settingsKey)?.sound||t(n.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${n.settingsKey}`,{value:e!==void 0?{announcement:e,sound:s}:{sound:s}}]),i.push([`${n.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${n.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Ru;(function(n){n.OpenAccessibleView="editor.action.accessibleView",n.OpenAccessibilityHelp="editor.action.accessibilityHelp",n.DisableVerbosityHint="editor.action.accessibleViewDisableHint",n.GoToSymbol="editor.action.accessibleViewGoToSymbol",n.ShowNext="editor.action.accessibleViewNext",n.ShowPrevious="editor.action.accessibleViewPrevious",n.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",n.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",n.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",n.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",n.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Ru||(Ru={}));const Qet="editor.action.inlineSuggest.commit",jet="editor.action.inlineSuggest.showPrevious",Ket="editor.action.inlineSuggest.showNext";var yNt=".monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{cursor:pointer;display:inline-block;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{font-size:0;opacity:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border);color:var(--vscode-editorGhostText-foreground)!important}";Ct(yNt,{});class q7{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}render(e,t=!1){return new WU([...this.parts.map(i=>new ug(O.fromPositions(new oe(this.lineNumber,i.column)),t?`[${i.lines.join(` `)}]`:i.lines.join(` `)))]).applyToString(e)}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new WU([...this.parts.map(o=>new ug(O.fromPositions(new oe(1,o.column)),o.lines.join(` `)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class Ete{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=xw(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class dye{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=s,this.parts=[new Ete(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=xw(this.text)}renderForScreenReader(e){return this.newLines.join(` `)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new WU([new ug(O.fromPositions(i.getStartPosition()),"("),new ug(O.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` `)}]`)]).applyToString(e):new WU([new ug(i,this.newLines.join(` -`))]).applyToString(e)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function i4e(n,e){return Ls(n,e,Yet)}function Yet(n,e){return n===e?!0:!n||!e?!1:n instanceof q7&&e instanceof q7||n instanceof dye&&e instanceof dye?n.equals(e):!1}const SNt=[];function ANt(){return SNt}class Jet{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new cn(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new O(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Xet(n,e){const t=new Z,i=n.createDecorationsCollection();return t.add(bQ({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function ENt(n,e){return new oe(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function n4e(n,e){return new oe(n.lineNumber-e.lineNumber+1,n.lineNumber-e.lineNumber===0?n.column-e.column+1:n.column)}const s4e="ghost-text";let hye=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=xi(this,!1),this.currentTextModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;const a=r instanceof dye?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const w=l[l.length-1];v&&w.decorations.push(new ig(w.content.length+1,w.content.length+1+m[0].length,v,Rc.Regular)),w.content+=m[0],m=m.slice(1)}for(const w of m)l.push({content:w,decorations:v?[new ig(1,w.length+1,v,Rc.Regular)]:[]})}const h=o.getLineContent(r.lineNumber);let u,f=0;for(const m of r.parts){let v=m.lines;u===void 0?(c.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):d([h.substring(f,m.column-1)],void 0),v.length>0&&(d(v,s4e),u===void 0&&m.column<=h.length&&(u=m.column)),f=m.column-1}u!==void 0&&d([h.substring(f)],void 0);const p=u!==void 0?new Jet(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:O.fromPositions(new oe(o.lineNumber,a.column)),options:{description:s4e,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Bv.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new Zet(this.editor,this.languageService.languageIdCodec,Dt(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};hye=D([_(2,Di)],hye);class Zet extends ${get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Bh("editorOptionChanged",T.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(x.disableMonospaceOptimizations)||s.hasChanged(x.stopRenderingLineAfter)||s.hasChanged(x.renderWhitespace)||s.hasChanged(x.renderControlCharacters)||s.hasChanged(x.fontLigatures)||s.hasChanged(x.fontInfo)||s.hasChanged(x.lineHeight))),this._register(Ni(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");xNt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:jo.Right})}})}}function xNt(n,e,t,i,s){const o=i.get(x.disableMonospaceOptimizations),r=i.get(x.stopRenderingLineAfter),a="none",c=i.get(x.renderControlCharacters),l=i.get(x.fontLigatures),d=i.get(x.fontInfo),h=i.get(x.lineHeight),u=new fz(1e4);u.appendString('

    ');for(let m=0,v=t.length;m');const C=qq(b),y=DU(b),S=lh.createEmpty(b,s);lQ(new tL(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,b,!1,C,y,0,S,w.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==l1.OFF,null),u),u.appendString("
    ")}u.appendString(""),Sd(n,d);const f=u.build(),p=o4e?o4e.createHTML(f):f;n.innerHTML=p}const o4e=Jx("editorGhostText",{createHTML:n=>n}),xK="vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys",YC=class YC extends ${constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=YC.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=YC.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=YC.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=YC.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ni(i=>{const o=this.model.read(i)?.state.read(i),r=!!o?.inlineCompletion&&o?.primaryGhostText!==void 0&&!o?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(r),o?.primaryGhostText&&o?.inlineCompletion&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ni(i=>{const s=this.model.read(i);let o=!1,r=!0;const a=s?.primaryGhostText.read(i);if(s?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=s.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=Eu(d);f===-1&&(f=d.length-1),o=f>0;const p=s.textModel.getOptions().tabSize;r=kc.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Em((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=wO((l,d)=>{const h=d.add(this.instantiationService.createInstance(vV,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(Ni(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==Ub.Explicit&&r.triggerExplicitly()})),h}),c=Qxt(this,(l,d)=>!!this.position.read(l)||!!d);o.add(Ni(l=>{c.read(l)&&a.read(l)}))}))}};uye=D([_(2,be)],uye);const kNt=ji("inline-suggestion-hints-next",Ce.chevronRight,g(Q$,0,"Icon for show next parameter hint.")),INt=ji("inline-suggestion-hints-previous",Ce.chevronLeft,g(Q$,1,"Icon for show previous parameter hint."));var l0;let vV=(l0=class extends ${static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new xn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(Q$,2,"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${LJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.previousAction=this.createCommandAction(jet,g(Q$,3,"Previous"),$e.asClassName(INt)),this.availableSuggestionCountAction=new xn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Ket,g(Q$,4,"Next"),$e.asClassName(kNt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new yn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new yn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(gye,this.nodes.toolBar,Te.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof id)return c.createInstance(TNt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new LNt(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{LJ._dropDownVisible=u})),this._register(Ni(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(Ni(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Ni(u=>{const p=this._extraCommands.read(u).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const w of v)w instanceof id&&p.push(w);p.length>0&&p.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},LJ=l0,l0._dropDownVisible=!1,l0.id=0,l0);vV=LJ=D([_(6,Qi),_(7,be),_(8,ti),_(9,Pe),_(10,mc)],vV);class LNt extends WS{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let TNt=class extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,zc,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},gye=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};gye=D([_(3,mc),_(4,Pe),_(5,Vr),_(6,ti),_(7,Qi),_(8,on)],gye);function RNt(n,e){const t=new hYe,i=new gYe(t,l=>e.getLanguageConfiguration(l)),s=new uYe(new MNt([n]),i),o=Ewe(s,[],void 0,!0);let r="";const a=n.getLineContent();function c(l,d){if(l.kind===lr.Pair)if(c(l.openingBracket,d),d=ta(d,l.openingBracket.length),l.child&&(c(l.child,d),d=ta(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=ta(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==lr.UnexpectedClosingBracket){if(l.kind===lr.Text||l.kind===lr.Bracket)r+=a.substring(d,ta(d,l.length));else if(l.kind===lr.List)for(const h of l.children)c(h,d),d=ta(d,h.length)}}return c(o,og),r}class MNt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getValue(){return this.lines.map(e=>e.getLineContent()).join(` -`)}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var Zt;(function(n){n[n.Dollar=0]="Dollar",n[n.Colon=1]="Colon",n[n.Comma=2]="Comma",n[n.CurlyOpen=3]="CurlyOpen",n[n.CurlyClose=4]="CurlyClose",n[n.Backslash=5]="Backslash",n[n.Forwardslash=6]="Forwardslash",n[n.Pipe=7]="Pipe",n[n.Int=8]="Int",n[n.VariableName=9]="VariableName",n[n.Format=10]="Format",n[n.Plus=11]="Plus",n[n.Dash=12]="Dash",n[n.QuestionMark=13]="QuestionMark",n[n.EOF=14]="EOF"})(Zt||(Zt={}));const hv=class hv{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=q.Digit0&&e<=q.Digit9}static isVariableCharacter(e){return e===q.Underline||e>=q.a&&e<=q.z||e>=q.A&&e<=q.Z}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:Zt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=hv._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(hv.isDigitCharacter(i)){s=Zt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(hv.isVariableCharacter(i)){s=Zt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(hv.isVariableCharacter(i)||hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=Zt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hv._table[i]>"u"&&!hv.isDigitCharacter(i)&&!hv.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};hv._table={[q.DollarSign]:Zt.Dollar,[q.Colon]:Zt.Colon,[q.Comma]:Zt.Comma,[q.OpenCurlyBrace]:Zt.CurlyOpen,[q.CloseCurlyBrace]:Zt.CurlyClose,[q.Backslash]:Zt.Backslash,[q.Slash]:Zt.Forwardslash,[q.Pipe]:Zt.Pipe,[q.Plus]:Zt.Plus,[q.Dash]:Zt.Dash,[q.QuestionMark]:Zt.QuestionMark};let fye=hv;class Bz{constructor(){this._children=[]}appendChild(e){return e instanceof Fh&&this._children[this._children.length-1]instanceof Fh?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof OQ)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Fh extends Bz{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return Fh.escape(this.value)}len(){return this.value.length}clone(){return new Fh(this.value)}}class ett extends Bz{}class ep extends ett{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Wz?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new ep(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Wz extends Bz{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Fh&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,|\\/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){const e=new Wz;return this.options.forEach(e.appendChild,e),e}}class GPe extends Bz{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof mb&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof mb){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){const e=new GPe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class mb extends Bz{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new mb(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class wV extends ett{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Fh(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new wV(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function r4e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class OQ extends Bz{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ep&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return r4e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ep&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof wV&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){const e=new OQ;return this._children=this.children.map(t=>t.clone()),e}walk(e){r4e(this.children,e)}}class ww{constructor(){this._scanner=new fye,this._token={type:Zt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new ww().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new OQ;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(c=>(c instanceof ep&&(c.isFinalTabstop?s.set(0,void 0):!s.has(c.index)&&c.children.length>0?s.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=s.get(c.index);if(!d)return;const h=new ep(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof ep&&s.has(f.index)&&!l.has(f.index)&&(l.add(f.index),r(f,l),l.delete(f.index))}t.replace(c,[h])},a=new Set;for(const c of o)r(c,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new ep(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===Zt.EOF)return!1;if(this._token.type===Zt.Backslash){const s=this._scanner.next();if(s.type!==Zt.Dollar&&s.type!==Zt.CurlyClose&&s.type!==Zt.Backslash)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(Zt.Backslash,!0))?(t=this._accept(Zt.Dollar,!0)||this._accept(Zt.CurlyClose,!0)||this._accept(Zt.Backslash,!0)||t,e.appendChild(new Fh(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Zt.Dollar)&&(t=this._accept(Zt.VariableName,!0)||this._accept(Zt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new ep(Number(t)):new wV(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.Int,!0))))return this._backTo(i);const o=new ep(Number(t));if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Zt.Pipe)){const r=new Wz;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Zt.Comma))continue;if(this._accept(Zt.Pipe)&&(o.appendChild(r),this._accept(Zt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Zt.Comma||this._token.type===Zt.Pipe);){let s;if((s=this._accept(Zt.Backslash,!0))?s=this._accept(Zt.Comma,!0)||this._accept(Zt.Pipe,!0)||this._accept(Zt.Backslash,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Fh(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.VariableName,!0))))return this._backTo(i);const o=new wV(t);if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new GPe;let i="",s="";for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Zt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Backslash,!0)||this._accept(Zt.Forwardslash,!0)||o,t.appendChild(new Fh(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Zt.CurlyClose);){if(this._token.type!==Zt.EOF){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Zt.Dollar))return!1;let i=!1;this._accept(Zt.CurlyOpen)&&(i=!0);const s=this._accept(Zt.Int,!0);if(s)if(i){if(this._accept(Zt.CurlyClose))return e.appendChild(new mb(Number(s))),!0;if(!this._accept(Zt.Colon))return this._backTo(t),!1}else return e.appendChild(new mb(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(Zt.Forwardslash)){const o=this._accept(Zt.VariableName,!0);return!o||!this._accept(Zt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new mb(Number(s),o)),!0)}else if(this._accept(Zt.Plus)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,o,void 0)),!0}else if(this._accept(Zt.Dash)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}else if(this._accept(Zt.QuestionMark)){const o=this._until(Zt.Colon);if(o){const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new mb(Number(s),void 0,o,r)),!0}}else{const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Zt.EOF?(e.appendChild(new Fh(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function NNt(n,e,t,i,s=qe.None,o){const r=BNt(e,t),a=n.all(t),c=new Vq;for(const w of a)w.groupId&&c.add(w.groupId,w);function l(w){if(!w.yieldsToGroupIds)return[];const b=[];for(const C of w.yieldsToGroupIds||[]){const y=c.get(C);for(const S of y)b.push(S)}return b}const d=new Map,h=new Set;function u(w,b){if(b=[...b,w],h.has(w))return b;h.add(w);try{const C=l(w);for(const y of C){const S=u(y,b);if(S)return S}}finally{h.delete(w)}}function f(w){const b=d.get(w);if(b)return b;const C=u(w,[]);C&&er(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${C.map(S=>S.toString?S.toString():""+S).join(" -> ")}`));const y=new sd;return d.set(w,y.p),(async()=>{if(!C){const S=l(w);for(const M of S){const k=await f(M);if(k&&k.items.length>0)return}}try{return await w.provideInlineCompletions(t,e,i,s)}catch(S){er(S);return}})().then(S=>y.complete(S),S=>y.error(S)),y.p}const p=await Promise.all(a.map(async w=>({provider:w,completions:await f(w)}))),m=new Map,v=[];for(const w of p){const b=w.completions;if(!b)continue;const C=new FNt(b,w.provider);v.push(C);for(const y of b.items){const S=ONt.from(y,C,r,t,o);m.set(S.hash(),S)}}return new PNt(Array.from(m.values()),new Set(m.keys()),v)}class PNt{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}let FNt=class{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}},ONt=class pye{static from(e,t,i,s,o){let r,a,c=e.range?O.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=a4e(r,c.getStartPosition(),s,o);const l=r.length-e.insertText.length;l!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+l))}a=void 0}else if("snippet"in e.insertText){const l=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=a4e(e.insertText.snippet,c.getStartPosition(),s,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new ww().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Fh?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else oQ();return new pye(r,e.command,c,r,a,e.additionalTextEdits||ANt(),e,t)}constructor(e,t,i,s,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` +`))]).applyToString(e)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function i4e(n,e){return Ls(n,e,Yet)}function Yet(n,e){return n===e?!0:!n||!e?!1:n instanceof q7&&e instanceof q7||n instanceof dye&&e instanceof dye?n.equals(e):!1}const SNt=[];function ANt(){return SNt}class Jet{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new cn(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new O(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Xet(n,e){const t=new Z,i=n.createDecorationsCollection();return t.add(bQ({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function ENt(n,e){return new oe(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function n4e(n,e){return new oe(n.lineNumber-e.lineNumber+1,n.lineNumber-e.lineNumber===0?n.column-e.column+1:n.column)}const s4e="ghost-text";let hye=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=xi(this,!1),this.currentTextModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;const a=r instanceof dye?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const w=l[l.length-1];v&&w.decorations.push(new ig(w.content.length+1,w.content.length+1+m[0].length,v,Rc.Regular)),w.content+=m[0],m=m.slice(1)}for(const w of m)l.push({content:w,decorations:v?[new ig(1,w.length+1,v,Rc.Regular)]:[]})}const h=o.getLineContent(r.lineNumber);let u,f=0;for(const m of r.parts){let v=m.lines;u===void 0?(c.push({column:m.column,text:v[0],preview:m.preview}),v=v.slice(1)):d([h.substring(f,m.column-1)],void 0),v.length>0&&(d(v,s4e),u===void 0&&m.column<=h.length&&(u=m.column)),f=m.column-1}u!==void 0&&d([h.substring(f)],void 0);const p=u!==void 0?new Jet(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:O.fromPositions(new oe(o.lineNumber,a.column)),options:{description:s4e,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Bv.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new Zet(this.editor,this.languageService.languageIdCodec,Dt(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};hye=D([_(2,Di)],hye);class Zet extends ${get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Bh("editorOptionChanged",T.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(x.disableMonospaceOptimizations)||s.hasChanged(x.stopRenderingLineAfter)||s.hasChanged(x.renderWhitespace)||s.hasChanged(x.renderControlCharacters)||s.hasChanged(x.fontLigatures)||s.hasChanged(x.fontInfo)||s.hasChanged(x.lineHeight))),this._register(Ni(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");xNt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:jo.Right})}})}}function xNt(n,e,t,i,s){const o=i.get(x.disableMonospaceOptimizations),r=i.get(x.stopRenderingLineAfter),a="none",c=i.get(x.renderControlCharacters),l=i.get(x.fontLigatures),d=i.get(x.fontInfo),h=i.get(x.lineHeight),u=new fz(1e4);u.appendString('
    ');for(let m=0,v=t.length;m');const C=qq(b),y=DU(b),S=lh.createEmpty(b,s);lQ(new tL(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,b,!1,C,y,0,S,w.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==l1.OFF,null),u),u.appendString("
    ")}u.appendString(""),Sd(n,d);const f=u.build(),p=o4e?o4e.createHTML(f):f;n.innerHTML=p}const o4e=Jx("editorGhostText",{createHTML:n=>n}),xK="vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys",YC=class YC extends ${constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=YC.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=YC.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=YC.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=YC.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ni(i=>{const o=this.model.read(i)?.state.read(i),r=!!o?.inlineCompletion&&o?.primaryGhostText!==void 0&&!o?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(r),o?.primaryGhostText&&o?.inlineCompletion&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ni(i=>{const s=this.model.read(i);let o=!1,r=!0;const a=s?.primaryGhostText.read(i);if(s?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=s.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=Eu(d);f===-1&&(f=d.length-1),o=f>0;const p=s.textModel.getOptions().tabSize;r=kc.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Em((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=wO((l,d)=>{const h=d.add(this.instantiationService.createInstance(vV,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(Ni(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==Ub.Explicit&&r.triggerExplicitly()})),h}),c=Qxt(this,(l,d)=>!!this.position.read(l)||!!d);o.add(Ni(l=>{c.read(l)&&a.read(l)}))}))}};uye=D([_(2,be)],uye);const kNt=Ki("inline-suggestion-hints-next",Ce.chevronRight,g(Q$,0,"Icon for show next parameter hint.")),INt=Ki("inline-suggestion-hints-previous",Ce.chevronLeft,g(Q$,1,"Icon for show previous parameter hint."));var l0;let vV=(l0=class extends ${static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new xn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(Q$,2,"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${LJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.previousAction=this.createCommandAction(jet,g(Q$,3,"Previous"),$e.asClassName(INt)),this.availableSuggestionCountAction=new xn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Ket,g(Q$,4,"Next"),$e.asClassName(kNt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new yn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new yn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(gye,this.nodes.toolBar,Te.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof id)return c.createInstance(TNt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new LNt(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{LJ._dropDownVisible=u})),this._register(Ni(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(Ni(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Ni(u=>{const p=this._extraCommands.read(u).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const w of v)w instanceof id&&p.push(w);p.length>0&&p.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},LJ=l0,l0._dropDownVisible=!1,l0.id=0,l0);vV=LJ=D([_(6,ji),_(7,be),_(8,ti),_(9,Pe),_(10,_c)],vV);class LNt extends WS{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let TNt=class extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,$c,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},gye=class extends lV{constructor(e,t,i,s,o,r,a,c,l){super(e,{resetMenu:t,...i},s,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};gye=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,ji),_(8,rn)],gye);function RNt(n,e){const t=new hYe,i=new gYe(t,l=>e.getLanguageConfiguration(l)),s=new uYe(new MNt([n]),i),o=Ewe(s,[],void 0,!0);let r="";const a=n.getLineContent();function c(l,d){if(l.kind===lr.Pair)if(c(l.openingBracket,d),d=ta(d,l.openingBracket.length),l.child&&(c(l.child,d),d=ta(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=ta(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==lr.UnexpectedClosingBracket){if(l.kind===lr.Text||l.kind===lr.Bracket)r+=a.substring(d,ta(d,l.length));else if(l.kind===lr.List)for(const h of l.children)c(h,d),d=ta(d,h.length)}}return c(o,og),r}class MNt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getValue(){return this.lines.map(e=>e.getLineContent()).join(` +`)}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}var Zt;(function(n){n[n.Dollar=0]="Dollar",n[n.Colon=1]="Colon",n[n.Comma=2]="Comma",n[n.CurlyOpen=3]="CurlyOpen",n[n.CurlyClose=4]="CurlyClose",n[n.Backslash=5]="Backslash",n[n.Forwardslash=6]="Forwardslash",n[n.Pipe=7]="Pipe",n[n.Int=8]="Int",n[n.VariableName=9]="VariableName",n[n.Format=10]="Format",n[n.Plus=11]="Plus",n[n.Dash=12]="Dash",n[n.QuestionMark=13]="QuestionMark",n[n.EOF=14]="EOF"})(Zt||(Zt={}));const hv=class hv{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=Q.Digit0&&e<=Q.Digit9}static isVariableCharacter(e){return e===Q.Underline||e>=Q.a&&e<=Q.z||e>=Q.A&&e<=Q.Z}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:Zt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=hv._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(hv.isDigitCharacter(i)){s=Zt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(hv.isVariableCharacter(i)){s=Zt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(hv.isVariableCharacter(i)||hv.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=Zt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hv._table[i]>"u"&&!hv.isDigitCharacter(i)&&!hv.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};hv._table={[Q.DollarSign]:Zt.Dollar,[Q.Colon]:Zt.Colon,[Q.Comma]:Zt.Comma,[Q.OpenCurlyBrace]:Zt.CurlyOpen,[Q.CloseCurlyBrace]:Zt.CurlyClose,[Q.Backslash]:Zt.Backslash,[Q.Slash]:Zt.Forwardslash,[Q.Pipe]:Zt.Pipe,[Q.Plus]:Zt.Plus,[Q.Dash]:Zt.Dash,[Q.QuestionMark]:Zt.QuestionMark};let fye=hv;class Bz{constructor(){this._children=[]}appendChild(e){return e instanceof Fh&&this._children[this._children.length-1]instanceof Fh?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof OQ)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Fh extends Bz{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return Fh.escape(this.value)}len(){return this.value.length}clone(){return new Fh(this.value)}}class ett extends Bz{}class ep extends ett{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Wz?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new ep(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Wz extends Bz{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Fh&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,|\\/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){const e=new Wz;return this.options.forEach(e.appendChild,e),e}}class GPe extends Bz{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof mb&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof mb){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){const e=new GPe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class mb extends Bz{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new mb(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class wV extends ett{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Fh(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){const e=new wV(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function r4e(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class OQ extends Bz{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ep&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return r4e([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ep&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof wV&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){const e=new OQ;return this._children=this.children.map(t=>t.clone()),e}walk(e){r4e(this.children,e)}}class ww{constructor(){this._scanner=new fye,this._token={type:Zt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new ww().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new OQ;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(c=>(c instanceof ep&&(c.isFinalTabstop?s.set(0,void 0):!s.has(c.index)&&c.children.length>0?s.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=s.get(c.index);if(!d)return;const h=new ep(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof ep&&s.has(f.index)&&!l.has(f.index)&&(l.add(f.index),r(f,l),l.delete(f.index))}t.replace(c,[h])},a=new Set;for(const c of o)r(c,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new ep(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===Zt.EOF)return!1;if(this._token.type===Zt.Backslash){const s=this._scanner.next();if(s.type!==Zt.Dollar&&s.type!==Zt.CurlyClose&&s.type!==Zt.Backslash)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(Zt.Backslash,!0))?(t=this._accept(Zt.Dollar,!0)||this._accept(Zt.CurlyClose,!0)||this._accept(Zt.Backslash,!0)||t,e.appendChild(new Fh(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Zt.Dollar)&&(t=this._accept(Zt.VariableName,!0)||this._accept(Zt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new ep(Number(t)):new wV(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.Int,!0))))return this._backTo(i);const o=new ep(Number(t));if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Zt.Pipe)){const r=new Wz;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Zt.Comma))continue;if(this._accept(Zt.Pipe)&&(o.appendChild(r),this._accept(Zt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Zt.Comma||this._token.type===Zt.Pipe);){let s;if((s=this._accept(Zt.Backslash,!0))?s=this._accept(Zt.Comma,!0)||this._accept(Zt.Pipe,!0)||this._accept(Zt.Backslash,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Fh(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Zt.Dollar)&&this._accept(Zt.CurlyOpen)&&(t=this._accept(Zt.VariableName,!0))))return this._backTo(i);const o=new wV(t);if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Fh("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Zt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new GPe;let i="",s="";for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Zt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Zt.Forwardslash);){let o;if(o=this._accept(Zt.Backslash,!0)){o=this._accept(Zt.Backslash,!0)||this._accept(Zt.Forwardslash,!0)||o,t.appendChild(new Fh(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Zt.CurlyClose);){if(this._token.type!==Zt.EOF){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Zt.Dollar))return!1;let i=!1;this._accept(Zt.CurlyOpen)&&(i=!0);const s=this._accept(Zt.Int,!0);if(s)if(i){if(this._accept(Zt.CurlyClose))return e.appendChild(new mb(Number(s))),!0;if(!this._accept(Zt.Colon))return this._backTo(t),!1}else return e.appendChild(new mb(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(Zt.Forwardslash)){const o=this._accept(Zt.VariableName,!0);return!o||!this._accept(Zt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new mb(Number(s),o)),!0)}else if(this._accept(Zt.Plus)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,o,void 0)),!0}else if(this._accept(Zt.Dash)){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}else if(this._accept(Zt.QuestionMark)){const o=this._until(Zt.Colon);if(o){const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new mb(Number(s),void 0,o,r)),!0}}else{const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new mb(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Zt.EOF?(e.appendChild(new Fh(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function NNt(n,e,t,i,s=qe.None,o){const r=BNt(e,t),a=n.all(t),c=new Vq;for(const w of a)w.groupId&&c.add(w.groupId,w);function l(w){if(!w.yieldsToGroupIds)return[];const b=[];for(const C of w.yieldsToGroupIds||[]){const y=c.get(C);for(const S of y)b.push(S)}return b}const d=new Map,h=new Set;function u(w,b){if(b=[...b,w],h.has(w))return b;h.add(w);try{const C=l(w);for(const y of C){const S=u(y,b);if(S)return S}}finally{h.delete(w)}}function f(w){const b=d.get(w);if(b)return b;const C=u(w,[]);C&&er(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${C.map(S=>S.toString?S.toString():""+S).join(" -> ")}`));const y=new sd;return d.set(w,y.p),(async()=>{if(!C){const S=l(w);for(const M of S){const k=await f(M);if(k&&k.items.length>0)return}}try{return await w.provideInlineCompletions(t,e,i,s)}catch(S){er(S);return}})().then(S=>y.complete(S),S=>y.error(S)),y.p}const p=await Promise.all(a.map(async w=>({provider:w,completions:await f(w)}))),m=new Map,v=[];for(const w of p){const b=w.completions;if(!b)continue;const C=new FNt(b,w.provider);v.push(C);for(const y of b.items){const S=ONt.from(y,C,r,t,o);m.set(S.hash(),S)}}return new PNt(Array.from(m.values()),new Set(m.keys()),v)}class PNt{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}let FNt=class{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}},ONt=class pye{static from(e,t,i,s,o){let r,a,c=e.range?O.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=a4e(r,c.getStartPosition(),s,o);const l=r.length-e.insertText.length;l!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+l))}a=void 0}else if("snippet"in e.insertText){const l=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=a4e(e.insertText.snippet,c.getStartPosition(),s,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new O(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new ww().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Fh?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else oQ();return new pye(r,e.command,c,r,a,e.additionalTextEdits||ANt(),e,t)}constructor(e,t,i,s,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` `),s=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new pye(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new ug(this.range,this.insertText)}};function BNt(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new O(n.lineNumber,t.startColumn,n.lineNumber,i):O.fromPositions(n,n.with(void 0,i))}function a4e(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n)?.sliceAndInflate(e.column-1,o.length,0);return a?RNt(a,i):n}function wM(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=e.getValueInRange(i,xo.LF),o=LS(s,n.text),r=gf.ofText(s.substring(0,o)).addToPosition(n.range.getStartPosition()),a=n.text.substring(o),c=O.fromPositions(r,n.range.getEndPosition());return new ug(c,a)}function ttt(n,e){return n.text.startsWith(e.text)&&WNt(n.range,e.range)}function c4e(n,e,t,i,s=0){let o=wM(n,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=Uo(r).length;if(o.range.startColumn-1<=a){const p=Uo(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,w]=[o.range.getStartPosition(),o.range.getEndPosition()],b=v.column+m.length<=w.column?v.delta(0,m.length):w,C=O.fromPositions(b,w),y=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new ug(C,y)}const l=e.getValueInRange(o.range),d=HNt(l,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const p=d.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==l.length)return}const f=o.text.length-s;for(const p of d){const m=o.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,w=Math.max(p.modifiedStart,Math.min(v,f)),b=o.text.substring(p.modifiedStart,w),C=o.text.substring(w,Math.max(p.modifiedStart,v));b.length>0&&u.push(new Ete(m,b,!1)),C.length>0&&u.push(new Ete(m,C,!0))}return new q7(h,u)}function WNt(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let DK;function HNt(n,e){if(DK?.originalValue===n&&DK?.newValue===e)return DK?.changes;{let t=d4e(n,e,!0);if(t){const i=l4e(t);if(i>0){const s=d4e(n,e,!1);s&&l4e(s)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(l){if(l<0)throw new Error("unexpected");return s+l+1}function r(l){let d=0,h=0;const u=new Int32Array(l.length);for(let f=0,p=l.length;fa},{getElements:()=>c}).ComputeDiff(!1).changes}let mye=class extends ${constructor(e,t,i,s,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new Dn),this.inlineCompletions=_7("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=_7("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const s=new VNt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(s))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(s))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ai,c=(async()=>{if((r||t.triggerKind===Ub.Automatic)&&await UNt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const h=new Date,u=await NNt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new $Nt(u,s,this.textModel,this.versionId);if(i){const m=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!u.has(m)&&p.prepend(i.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),En(m=>{o.set(p,m)}),!0})(),l=new zNt(s,a,c);return this._updateOperation.value=l,c}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};mye=D([_(3,ht),_(4,lo)],mye);function UNt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class VNt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Ixt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,PJe())&&(e.context.triggerKind===Ub.Automatic||this.context.triggerKind===Ub.Explicit)&&this.versionId===e.versionId}}class zNt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class $Nt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[];const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new h4e(r,o[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new h4e(e,s,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class h4e{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=s,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=yy({owner:this,equalsFn:O.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??ipe)}toSingleTextEdit(e){return new ug(this._updatedRange.read(e)??ipe,this.inlineCompletion.insertText)}isVisible(e,t,i){const s=wM(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const r=e.getValueInRange(s.range,xo.LF),a=s.text,c=Math.max(0,t.column-s.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=r.substring(0,c),u=r.substring(c);const f=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!zYe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&gf.ofRange(i).isGreaterThanOrEqualTo(gf.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new ug(this._updatedRange.read(e)??ipe,this.inlineCompletion.filterText)}}const ipe=new O(1,1,1,1),itt="vs/base/browser/ui/findinput/replaceInput",GNt=g(itt,0,"input"),qNt=g(itt,1,"Preserve Case");class QNt extends iD{constructor(e){super({icon:Ce.preserveCase,title:qNt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const yBe=class yBe extends wg{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onPreserveCaseKeyDown=this._register(new I),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||GNt;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,c=!!s.flexibleWidth,l=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new MNe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new QNt({appendTitle:o,isChecked:!1,...s.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(E.LeftArrow)||u.equals(E.RightArrow)||u.equals(E.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(E.RightArrow)?p=(f+1)%d.length:u.equals(E.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(E.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),un.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}applyStyles(){}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox?.validate()}showMessage(e){this.inputBox?.showMessage(e)}clearMessage(){this.inputBox?.hideMessage()}clearValidation(){this.inputBox?.hideMessage()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}};yBe.OPTION_CHANGE="optionChange";let _ye=yBe;const jNt="vs/platform/history/browser/contextScopedHistoryWidget",qPe=new Y("suggestWidgetVisible",!1,g(jNt,0,"Whether suggestion are visible")),QPe="historyNavigationWidgetFocus",ntt="historyNavigationForwardsEnabled",stt="historyNavigationBackwardsEnabled";let j$;const kK=[];function dhe(n,e){if(kK.includes(e))throw new Error("Cannot register the same widget multiple times");kK.push(e);const t=new Z,i=new Y(QPe,!1).bindTo(n),s=new Y(ntt,!0).bindTo(n),o=new Y(stt,!0).bindTo(n),r=()=>{i.set(!0),j$=e},a=()=>{i.set(!1),j$===e&&(j$=void 0)};return kw(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{kK.splice(kK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let vye=class extends MNe{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.element));this._register(dhe(o,this))}};vye=D([_(3,Pe)],vye);let wye=class extends S7{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(dhe(o,this.inputBox))}};wye=D([_(3,Pe)],wye);let bye=class extends _ye{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(dhe(r,this.inputBox))}};bye=D([_(3,Pe)],bye);xr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:ye.WorkbenchContrib,when:ge.and(ge.has(QPe),ge.equals(stt,!0),ge.not("isComposing"),qPe.isEqualTo(!1)),primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],handler:n=>{j$?.showPreviousValue()}});xr.registerCommandAndKeybindingRule({id:"history.showNext",weight:ye.WorkbenchContrib,when:ge.and(ge.has(QPe),ge.equals(ntt,!0),ge.not("isComposing"),qPe.isEqualTo(!1)),primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],handler:n=>{j$?.showNextValue()}});const wD="vs/editor/contrib/suggest/browser/suggest",Gi={Visible:qPe,HasFocusedSuggestion:new Y("suggestWidgetHasFocusedSuggestion",!1,g(wD,0,"Whether any suggestion is focused")),DetailsVisible:new Y("suggestWidgetDetailsVisible",!1,g(wD,1,"Whether suggestion details are visible")),MultipleSuggestions:new Y("suggestWidgetMultipleSuggestions",!1,g(wD,2,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Y("suggestionMakesTextEdit",!0,g(wD,3,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Y("acceptSuggestionOnEnter",!0,g(wD,4,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Y("suggestionHasInsertAndReplaceRange",!1,g(wD,5,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Y("suggestionInsertMode",void 0,{type:"string",description:g(wD,6,"Whether the default behaviour is to insert or replace")}),CanResolve:new Y("suggestionCanResolve",!1,g(wD,7,"Whether the current suggestion supports to resolve further details"))},FI=new Te("suggestWidgetStatusBar");let KNt=class{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=sw.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,O.isIRange(t.range)?(this.editStart=new oe(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new oe(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new oe(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new oe(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range.insert)||O.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new ao(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{Na(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var _x;(function(n){n[n.Top=0]="Top",n[n.Inline=1]="Inline",n[n.Bottom=2]="Bottom"})(_x||(_x={}));const qae=class qae{constructor(e=_x.Bottom,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}};qae.default=new qae;let Q7=qae,yk;function YNt(){return yk}function JNt(n){const e=yk;return yk=n,e}class XNt{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function jPe(n,e,t,i=Q7.default,s={triggerKind:tf.Invoke},o=qe.None){const r=new ao;t=t.clone();const a=e.getWordAtPosition(t),c=a?new O(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):O.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,w,b)=>{let C=!1;if(!w)return C;for(const y of w.suggestions)if(!i.kindFilter.has(y.kind)){if(!i.showDeprecated&&y?.tags?.includes(TU.Deprecated))continue;y.range||(y.range=l),y.sortText||(y.sortText=typeof y.label=="string"?y.label:y.label.label),!f&&y.insertTextRules&&y.insertTextRules&cp.InsertAsSnippet&&(f=ww.guessNeedsClipboard(y.insertText)),d.push(new KNt(t,y,w,v)),C=!0}return cz(w)&&h.add(w),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:w.duration??-1,elapsedOverall:b.elapsed()}),C},m=(async()=>{if(!yk||i.kindFilter.has(Ne.Snippet))return;const v=i.providerItemsToReuse.get(yk);if(v){v.forEach(C=>d.push(C));return}if(i.providerFilter.size>0&&!i.providerFilter.has(yk))return;const w=new ao,b=await yk.provideCompletionItems(e,t,s,o);p(yk,b,w)})();for(const v of n.orderedGroups(e)){let w=!1;if(await Promise.all(v.map(async b=>{if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(y=>d.push(y)),w=w||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new ao,y=await b.provideCompletionItems(e,t,s,o);w=p(b,y,C)||w}catch(C){er(C)}})),w||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Tc)):new XNt(d.sort(tPt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function KPe(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function ZNt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return-1;if(e.completion.kind===Ne.Snippet)return 1}return KPe(n,e)}function ePt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return 1;if(e.completion.kind===Ne.Snippet)return-1}return KPe(n,e)}const hhe=new Map;hhe.set(_x.Top,ZNt);hhe.set(_x.Bottom,ePt);hhe.set(_x.Inline,KPe);function tPt(n){return hhe.get(n)}yt.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s),Bt(typeof o=="number"||!o);const{completionProvider:r}=n.get(ht),a=await n.get(Rn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await jPe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?tf.TriggerCharacter:tf.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(qe.None)),c.incomplete=c.incomplete||u.container.incomplete,c.suggestions.push(u.completion);try{return await Promise.all(l),c}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function ott(n,e){n.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class d2{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case Ar.Comment:return e.comments;case Ar.String:return e.strings;default:return e.other}}}var iPt=".monaco-editor .snippet-placeholder{background-color:var(--vscode-editor-snippetTabstopHighlightBackground,transparent);min-width:2px;outline-color:var(--vscode-editor-snippetTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}.monaco-editor .finish-snippet-placeholder{background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground,transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}";Ct(iPt,{});function nPt(n,e){const{os:t,tildify:i,relative:s}=e;if(s){const a=sPt(n,s,t);if(typeof a=="string")return a}let o=n.fsPath;if(t===Pr.Windows&&!Is?o=o.replace(/\//g,"\\"):t!==Pr.Windows&&Is&&(o=o.replace(/\\/g,"/")),t!==Pr.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;n.scheme!==i.userHome.scheme&&n.path[0]===qi.sep&&n.path[1]!==qi.sep?c=i.userHome.with({path:n.path}).fsPath:c=o,o=rtt(c,a,t)}return(t===Pr.Windows?$c:qi).normalize(Ay(o,t===Pr.Windows))}function sPt(n,e,t){const i=t===Pr.Windows?$c:qi,s=t===Pr.Linux?Fn:Gle,o=e.getWorkspace(),r=k_(o.folders);if(!r)return;n.scheme!==r.uri.scheme&&n.path[0]===qi.sep&&n.path[1]!==qi.sep&&(n=r.uri.with({path:n.path}));const a=e.getWorkspaceFolder(n);if(!a)return;let c;if(s.isEqual(a.uri,n)?c="":c=s.relativePath(a.uri,n)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:s.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Ay(n,e=Is){return $Qe(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}let npe=Object.create(null);function rtt(n,e,t=zc){if(t===Pr.Windows||!n||!e)return n;let i=npe.original===e?npe.normalized:void 0;i||(i=e,Is&&(i=I9(i)),i=`${IS(i,qi.sep)}${qi.sep}`,npe={original:e,normalized:i});let s=n;return Is&&(s=I9(s)),(t===Pr.Linux?s.startsWith(i):Gq(s,i))?`~/${s.substr(i.length)}`:n}function oPt(n,e){return n.replace(/^~($|\/|\\)/,`${e}$1`)}const u4e="…",y5="\\\\",S5="~";function rPt(n,e=dg){const t=new Array(n.length);let i=!1;for(let s=0;s=0;d--){i=!1;let h=c.slice(d,d+l).join(e);for(let u=0;!i&&u-1){const f=d+l===c.length,p=d>0&&n[u].indexOf(e)>-1?e+h:h,m=n[u].endsWith(p);i=!f||m}if(!i){let u="";(c[0].endsWith(":")||r!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=r+u),d>0&&(u=u+u4e+e),u=u+h,d+l{if(o.type===UC.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===UC.VARIABLE||l.type===UC.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function YPe(n,e){return ei||e?n.replace(/\(&&\w\)|&&/g,""):Is?n.replace(/&&|&/g,t=>t==="&"?"&&":"&"):n.replace(/&&/g,"_")}const vo="vs/editor/contrib/snippet/browser/snippetVariables",cPt=Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class g4e{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class f4e{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=Uo(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof Fh&&(a=Uo(xw(l.value).pop())),!0));const c=LS(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(l,d,h)=>`${d}${a.substr(c)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class p4e{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return yr(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=yr(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return lS(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(ma(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class m4e{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!Xv(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let xte=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};xte=D([_(2,lo)],xte);const JC=class JC{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return JC.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return JC.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return JC.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return JC.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,c=a<10?"0"+a:a;return s+r+":"+c}}};JC.dayNames=[g(vo,0,"Sunday"),g(vo,1,"Monday"),g(vo,2,"Tuesday"),g(vo,3,"Wednesday"),g(vo,4,"Thursday"),g(vo,5,"Friday"),g(vo,6,"Saturday")],JC.dayNamesShort=[g(vo,7,"Sun"),g(vo,8,"Mon"),g(vo,9,"Tue"),g(vo,10,"Wed"),g(vo,11,"Thu"),g(vo,12,"Fri"),g(vo,13,"Sat")],JC.monthNames=[g(vo,14,"January"),g(vo,15,"February"),g(vo,16,"March"),g(vo,17,"April"),g(vo,18,"May"),g(vo,19,"June"),g(vo,20,"July"),g(vo,21,"August"),g(vo,22,"September"),g(vo,23,"October"),g(vo,24,"November"),g(vo,25,"December")],JC.monthNamesShort=[g(vo,26,"Jan"),g(vo,27,"Feb"),g(vo,28,"Mar"),g(vo,29,"Apr"),g(vo,30,"May"),g(vo,31,"Jun"),g(vo,32,"Jul"),g(vo,33,"Aug"),g(vo,34,"Sep"),g(vo,35,"Oct"),g(vo,36,"Nov"),g(vo,37,"Dec")];let Dte=JC;class _4e{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=UW(this._workspaceService.getWorkspace());if(!nxt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(BS(e))return yr(e.uri.path);let t=yr(e.configPath.path);return t.endsWith(qb)&&(t=t.substr(0,t.length-qb.length-1)),t}_resoveWorkspacePath(e){if(BS(e))return Ay(e.uri.fsPath);const t=yr(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Ay(i):"/"}}class v4e{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Dr()}}var qw;const uv=class uv{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=yU(t.placeholders,ep.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=O.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive,c=t.addDecoration(r,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),c=this._editor.getModel().getValueInRange(a),l=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);r.push(new mt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof ep){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Wz,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=s.index+(r+1)/this._nestingLevel:c.index=s.index+c.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=O.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,uv._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=yU(this._snippet.placeholders,ep.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const s=t.getDecorationRange(i)??void 0;e?e=e.plusRange(s):e=s}return e}};uv._decor={active:jt.register({description:"snippet-placeholder-1",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:jt.register({description:"snippet-placeholder-2",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:jt.register({description:"snippet-placeholder-3",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:jt.register({description:"snippet-placeholder-4",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let kte=uv;const w4e={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Ite=qw=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=Uo(r,0,t.column-1);let c;return s.walk(l=>{if(!(l instanceof Fh)||l.parent instanceof Wz||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=s.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??s.toString();const f=c.charCodeAt(u-1);(f===q.LineFeed||f===q.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fy.get(Ti)),p=e.invokeWithinContext(y=>new p4e(y.get(eo),u)),m=()=>a,v=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),i,0)),w=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),0,s)),b=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((y,S)=>({selection:y,idx:S})).sort((y,S)=>O.compareRangesUsingStarts(y.selection,S.selection));for(const{selection:y,idx:S}of C){let M=qw.adjustSelection(u,y,i,0),k=qw.adjustSelection(u,y,0,s);v!==u.getValueInRange(M)&&(M=y),w!==u.getValueInRange(k)&&(k=y);const F=y.setStartPosition(M.startLineNumber,M.startColumn).setEndPosition(k.endLineNumber,k.endColumn),N=new ww().parse(t,!0,o),z=F.getStartPosition(),U=qw.adjustWhitespace(u,z,r||S>0&&b!==u.getLineFirstNonWhitespaceColumn(y.positionLineNumber),N);N.resolveVariables(new g4e([p,new m4e(m,S,C.length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(u,y,S,c),new xte(u,y,l),new Dte,new _4e(f),new v4e])),d[S]=ds.replace(F,N.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new kte(e,N,U)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new ww,h=new OQ,u=new g4e([e.invokeWithinContext(p=>new p4e(p.get(eo),l)),new m4e(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(l,e.getSelection(),0,r),new xte(l,e.getSelection(),a),new Dte,new _4e(e.invokeWithinContext(p=>p.get(Ti))),new v4e]);t=t.sort((p,m)=>O.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const S=t[p-1].range,M=O.fromPositions(S.getEndPosition(),m.getStartPosition()),k=new Fh(l.getValueInRange(M));h.appendChild(k),f+=k.value.length}const w=d.parseFragment(v,h);qw.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(w)),h.resolveVariables(u);const b=h.toString(),C=b.slice(f);f=b.length;const y=ds.replace(m,C);y.identifier={major:p,minor:0},y._isTracked=!0,c.push(y)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new kte(e,h,"")]}}constructor(e,t,i=w4e,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){St(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?qw.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):qw.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(o=>!!o.identifier);for(let o=0;omt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=w4e){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=qw.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(c=>!!c.identifier);for(let c=0;cmt.fromPositions(c.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(O.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(O.compareRangesUsingStarts);for(let o=0;o0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};Ite=qw=D([_(3,lo)],Ite);var wB;const IK="vs/editor/contrib/snippet/browser/snippetController2",LK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Ny;let pc=(Ny=class{static get(e){return e.getContribution(wB.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=wB.InSnippetMode.bindTo(s),this._hasNextTabstop=wB.HasNextTabstop.bindTo(s),this._hasPrevTabstop=wB.HasPrevTabstop.bindTo(s)}dispose(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}apply(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_edits=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}insert(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Bt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new Ite(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(l,d)=>{if(!this._session||l!==this._editor.getModel()||!oe.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=l.getValueInRange(h.range),f=!!h.choice.options.find(m=>m.value===u),p=[];for(let m=0;m{o?.dispose(),r=!1},c=()=>{r||(o=this._languageFeaturesService.completionProvider.register({language:s.getLanguageId(),pattern:s.uri.fsPath,scheme:s.uri.scheme,exclusive:!0},i),this._snippetListener.add(o),r=!0)};this._choiceCompletions={provider:i,enable:c,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{ott(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}getSessionEnclosingRange(){if(this._session)return this._session.getEnclosingRange()}},wB=Ny,Ny.ID="snippetController2",Ny.InSnippetMode=new Y("inSnippetMode",!1,g(IK,0,"Whether the editor in current in snippet mode")),Ny.HasNextTabstop=new Y("hasNextTabstop",!1,g(IK,1,"Whether there is a next tab stop when in snippet mode")),Ny.HasPrevTabstop=new Y("hasPrevTabstop",!1,g(IK,2,"Whether there is a previous tab stop when in snippet mode")),Ny);pc=wB=D([_(1,Ze),_(2,ht),_(3,Pe),_(4,lo)],pc);vn(pc.ID,pc,mi.Lazy);const uhe=Yc.bindToContribution(pc.get);Ke(new uhe({id:"jumpToNextSnippetPlaceholder",precondition:ge.and(pc.InSnippetMode,pc.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new uhe({id:"jumpToPrevSnippetPlaceholder",precondition:ge.and(pc.InSnippetMode,pc.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Ke(new uhe({id:"leaveSnippet",precondition:pc.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new uhe({id:"acceptSnippet",precondition:pc.InSnippetMode,handler:n=>n.finish()}));var Bp;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Bp||(Bp={}));let Cye=class extends ${get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=i,this._positions=s,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=c,this._enabled=l,this._instantiationService=d,this._commandService=h,this._languageConfigurationService=u,this._source=this._register(this._instantiationService.createInstance(mye,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=xi(this,!1),this._forceUpdateExplicitlySignal=oL(this),this._selectedInlineCompletionId=xi(this,void 0),this._primaryPosition=Dt(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Bp.Redo,Bp.Undo,Bp.AcceptWord]),this._fetchInlineCompletionsPromise=zxt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ub.Automatic}),handleChange:(p,m)=>(p.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(p.change)?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=Ub.Explicit),!0)},(p,m)=>{if(this._forceUpdateExplicitlySignal.read(p),!(this._enabled.read(p)&&this.selectedSuggestItem.read(p)||this._isActive.read(p))){this._source.cancelUpdate();return}this.textModelVersionId.read(p);const w=this._source.suggestWidgetInlineCompletions.get(),b=this.selectedSuggestItem.read(p);if(w&&!b){const k=this._source.inlineCompletions.get();En(F=>{(!k||w.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(w.clone(),F),this._source.clearSuggestWidgetInlineCompletions(F)})}const C=this._primaryPosition.read(p),y={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:b?.toSelectedSuggestionInfo()},S=this.selectedInlineCompletion.get(),M=m.preserveCurrentCompletion||S?.forwardStable?S:void 0;return this._source.fetch(C,y,M)}),this._filteredInlineCompletionItems=yy({owner:this,equalsFn:fbe()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Dt(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),w=this._selectedInlineCompletionId===void 0?-1:v.findIndex(b=>b.semanticId===m);return w===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):w}),this.selectedInlineCompletion=Dt(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=yy({owner:this,equalsFn:fbe()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Dt(this,p=>{if(this.lastTriggerKind.read(p)===Ub.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=yy({owner:this,equalsFn:(p,m)=>!p||!m?p===m:i4e(p.ghostTexts,m.ghostTexts)&&p.inlineCompletion===m.inlineCompletion&&p.suggestItem===m.suggestItem},p=>{const m=this.textModel,v=this.selectedSuggestItem.read(p);if(v){const w=wM(v.toSingleTextEdit(),m),b=this._computeAugmentation(w,p);if(!this._suggestPreviewEnabled.read(p)&&!b)return;const y=b?.edit??w,S=b?b.edit.text.length-w.text.length:0,M=this._suggestPreviewMode.read(p),k=this._positions.read(p),F=[y,...spe(this.textModel,k,y)],N=F.map((U,J)=>c4e(U,m,M,k[J],S)).filter(yl),z=N[0]??new q7(y.range.endLineNumber,[]);return{edits:F,primaryGhostText:z,ghostTexts:N,inlineCompletion:b?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const w=this.selectedInlineCompletion.read(p);if(!w)return;const b=w.toSingleTextEdit(p),C=this._inlineSuggestMode.read(p),y=this._positions.read(p),S=[b,...spe(this.textModel,y,b)],M=S.map((k,F)=>c4e(k,m,C,y[F],0)).filter(yl);return M[0]?{edits:S,primaryGhostText:M[0],ghostTexts:M,inlineCompletion:w,suggestItem:void 0}:void 0}}),this.ghostTexts=yy({owner:this,equalsFn:i4e},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=yy({owner:this,equalsFn:Yet},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(Ez(this._fetchInlineCompletionsPromise));let f;this._register(Ni(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const w=v.inlineCompletion,b=w.source;b.provider.handleItemDidShow?.(b.inlineCompletions,w.sourceInlineCompletion,w.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){m7(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){m7(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(yl);return Lct(o,a=>{let c=a.toSingleTextEdit(t);return c=wM(c,i,O.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),ttt(c,e)?{completion:a,edit:c}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new cn;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[ds.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),pc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const s=t.edits,o=b4e(s).map(r=>mt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...s.map(r=>ds.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}i.command&&i.source.addRef(),En(s=>{this._source.clear(s),this._isActive.set(!1,s)}),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,er),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(s),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let c=0;a&&a.index!==void 0?a.index===0?c=a[0].length:c=a.index:c=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length},DI.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new cn;const s=this.state.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const o=s.primaryGhostText,r=s.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){await this.accept(e);return}const a=o.parts[0],c=new oe(o.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&o.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];r.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=O.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new ug(p,m),w=[v,...spe(this.textModel,u,v)],b=b4e(w).map(C=>mt.fromPositions(C));e.executeEdits("inlineSuggestion.accept",w.map(C=>ds.replace(C.range,C.text))),e.setSelections(b,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),vt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=O.fromPositions(r.range.getStartPosition(),gf.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,xo.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=wM(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=i.completion.inlineCompletion;s.source.provider.handlePartialAccept?.(s.source.inlineCompletions,s.sourceInlineCompletion,t.text.length,{kind:DI.Suggest})}};Cye=D([_(9,be),_(10,Qi),_(11,lo)],Cye);function spe(n,e,t){if(e.length===1)return[];const i=e[0],s=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=n.getValueInRange(O.fromPositions(i,r)),c=n4e(i,o);if(c.lineNumber<1)return bt(new cn(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=lPt(t.text,c);return s.map(d=>{const h=ENt(n4e(d,o),r),u=n.getValueInRange(O.fromPositions(d,h)),f=LS(a,u),p=O.fromPositions(d,d.delta(0,f));return new ug(p,l)})}function lPt(n,e){let t="";const i=Nlt(n);for(let s=e.lineNumber-1;sO.compareRangesUsingStarts(o.range,r.range)),i=new WU(e.apply(n)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var I3;class JPe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;oc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&r===-1)return r=l}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:E9.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class hPt extends JPe{constructor(){super("recentlyUsedByPrefix"),this._trie=Su.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o=`${e.getLanguageId()}/${s}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:E9.fromString(i.type),this._trie.set(t,i)}}}var d0;let yye=(d0=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new yn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const s=I3._strategyCtors.get(i)||C4e;this._strategy=new s;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,a=this._storageService.get(`${I3._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${I3._storagePrefix}/${this._strategy.name}`,i,t,ln.MACHINE)}}},I3=d0,d0._strategyCtors=new Map([["recentlyUsedByPrefix",hPt],["recentlyUsed",dPt],["first",C4e]]),d0._storagePrefix="suggest/memories",d0);yye=I3=D([_(0,sn),_(1,Re)],yye);const ghe=ae("ISuggestMemories");ce(ghe,yye,Kt.Delayed);var Sye,fN;let Lte=(fN=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Sye.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(x.tabCompletion)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(x.tabCompletion)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},Sye=fN,fN.AtEnd=new Y("atEndOfWord",!1),fN);Lte=Sye=D([_(1,Pe)],Lte);var L3,pN;let bV=(pN=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=L3.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(L3._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=L3._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},L3=pN,pN.OtherSuggestions=new Y("hasOtherSuggestions",!1),pN);bV=L3=D([_(1,Pe)],bV);const Gm=class Gm{async provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Gm._bracketsRightYield(a,0,e,s,r)),await new Promise(a=>Gm._bracketsLeftYield(a,0,e,s,r,o))}return i}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Gm._maxRounds){e();break}if(!s){e();break}const c=i.bracketPairs.findNextBracket(s);if(!c){e();break}if(Date.now()-a>Gm._maxDuration){setTimeout(()=>Gm._bracketsRightYield(e,t+1,i,s,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new td,o.set(d,u)),u.push(c.range)}}s=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,c=Date.now();for(;;){if(t>=Gm._maxRounds&&o.size===0){e();break}if(!s){e();break}const l=i.bracketPairs.findPrevBracket(s);if(!l){e();break}if(Date.now()-c>Gm._maxDuration){setTimeout(()=>Gm._bracketsLeftYield(e,t+1,i,s,o,r));break}if(l.bracketInfo.isOpeningBracket){const h=l.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const p=f.shift();f.size===0&&o.delete(h);const m=O.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=O.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),Gm._addBracketLeading(i,v,r)}}}else{const h=l.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}s=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:O.fromPositions(new oe(s,o),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:O.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(r,1),t.getEndPosition())}))}}};Gm._maxDuration=30,Gm._maxRounds=2;let Tte=Gm;const XC=class XC{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return XC.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return XC.None;const[o]=await new Tte().provideSelectionRanges(i,[s]);if(o.length===0)return XC.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return XC.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends XC{distance(c,l){if(!s.equals(t.getPosition()))return 0;if(l.kind===Ne.Keyword)return 2<<20;const d=typeof l.label=="string"?l.label:l.label.label,h=r[d];if(iO(h))return 2<<20;const u=CU(h,O.fromPositions(c),O.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!O.containsRange(m.range,f))break;p-=1}return p}}}};XC.None=new class extends XC{distance(){return 0}};let Rte=XC,y4e=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var ZD;(function(n){n[n.Nothing=0]="Nothing",n[n.All=1]="All",n[n.Incr=2]="Incr"})(ZD||(ZD={}));class Sk{constructor(e,t,i,s,o,r,a=l7.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=Sk._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=ZD.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Sk._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Sk._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==ZD.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===ZD.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?v1:nAt;for(let l=0;l=f)d.score=sw.Default;else if(typeof d.completion.filterText=="string"){const m=c(s,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;mE(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=eAt(s,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(s,o,p,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=ZD.Nothing,this._stats={pLabelLen:e.length?d_e(e.length-.85,e,(l,d)=>l-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return 1;if(t.completion.kind===Ne.Snippet)return-1}return Sk._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return-1;if(t.completion.kind===Ne.Snippet)return 1}return Sk._compareCompletionItems(e,t)}}var Aye;class kL{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}var OI;(function(n){n[n.Idle=0]="Idle",n[n.Manual=1]="Manual",n[n.Auto=2]="Auto"})(OI||(OI={}));function uPt(n,e,t){if(!e.getContextKeyValue(af.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}function gPt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}let Mte=Aye=class{constructor(e,t,i,s,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new O_,this._triggerState=void 0,this._completionDisposables=new Z,this._onDidCancel=new I,this._onDidTrigger=new I,this._onDidSuggest=new I,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new mt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){St(this._triggerCharacterListener),St([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(x.readOnly)||!this._editor.hasModel()||!this._editor.getOption(x.suggestOnTriggerCharacters))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(YNt()),e.set(s,o)),o.add(i)}const t=i=>{if(!gPt(this._editor,this._contextKeyService)||kL.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let s="";sF(i.charCodeAt(i.length-1))?wl(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const r=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())o.has(a)||r.set(a,c);this.trigger({auto:!0,triggerKind:tf.TriggerCharacter,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?OI.Auto:OI.Manual:OI.Idle}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==Wi.NotSet&&e.reason!==Wi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Wi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Wi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){d2.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&pc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!kL.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(x.quickSuggestions);if(!d2.isAllOff(i)){if(!d2.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const s=e.tokenization.getLineTokens(t.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(i,o)!=="on")return}uPt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Bt(this._editor.hasModel()),Bt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new kL(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new kL(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??tf.Invoke};e.triggerCharacter&&(s={triggerKind:tf.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ai;const o=this._editor.getOption(x.snippetSuggestions);let r=_x.Inline;switch(o){case"top":r=_x.Top;break;case"bottom":r=_x.Bottom;break}const{itemKind:a,showDeprecated:c}=Aye.createSuggestFilter(this._editor),l=new Q7(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=Rte.create(this._editorWorkerService,this._editor),h=jPe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,s,this._requestToken.token);Promise.all([h,d]).then(async([u,f])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return;let p=e?.clipboardText;if(!p&&u.needsClipboard&&(p=await this._clipboardService.readText()),this._triggerState===void 0)return;const m=this._editor.getModel(),v=new kL(m,this._editor.getPosition(),e),w={...l7.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new Sk(u.items,this._context.column,{leadingLineContent:v.leadingLineContent,characterCountDelta:v.column-this._context.column},f,this._editor.getOption(x.suggest),this._editor.getOption(x.snippetSuggestions),w,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const b of u.items)b.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${b.provider._debugDisplayName}`,b.completion)}).catch(bt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(x.snippetSuggestions)==="none"&&t.add(Ne.Snippet);const s=e.getOption(x.suggest);return s.showMethods||t.add(Ne.Method),s.showFunctions||t.add(Ne.Function),s.showConstructors||t.add(Ne.Constructor),s.showFields||t.add(Ne.Field),s.showVariables||t.add(Ne.Variable),s.showClasses||t.add(Ne.Class),s.showStructs||t.add(Ne.Struct),s.showInterfaces||t.add(Ne.Interface),s.showModules||t.add(Ne.Module),s.showProperties||t.add(Ne.Property),s.showEvents||t.add(Ne.Event),s.showOperators||t.add(Ne.Operator),s.showUnits||t.add(Ne.Unit),s.showValues||t.add(Ne.Value),s.showConstants||t.add(Ne.Constant),s.showEnums||t.add(Ne.Enum),s.showEnumMembers||t.add(Ne.EnumMember),s.showKeywords||t.add(Ne.Keyword),s.showWords||t.add(Ne.Text),s.showColors||t.add(Ne.Color),s.showFiles||t.add(Ne.File),s.showReferences||t.add(Ne.Reference),s.showColors||t.add(Ne.Customcolor),s.showFolders||t.add(Ne.Folder),s.showTypeParameters||t.add(Ne.TypeParameter),s.showSnippets||t.add(Ne.Snippet),s.showUsers||t.add(Ne.User),s.showIssues||t.add(Ne.Issue),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Uo(e.leadingLineContent)!==Uo(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(kL.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:tf.TriggerForIncompleteCompletions,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=kL.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};Mte=Aye=D([_(1,kd),_(2,Mu),_(3,on),_(4,Ze),_(5,Pe),_(6,Re),_(7,ht),_(8,Il)],Mte);class fPt{constructor(e,t,i,s){this._disposables=new Z,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==OI.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&s(this._active.item)}}))}_onItem(e){if(!e||!mo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new EZ;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Qae=class Qae{constructor(e,t){this._disposables=new Z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;aQae._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&ea instanceof id?i.createInstance(wPt,a,void 0):void 0;this._leftActions=new Qh(this.element,{actionViewItemProvider:r}),this._rightActions=new Qh(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};xye=D([_(2,be),_(3,mc),_(4,Pe)],xye);var bPt=".monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-enum,.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-value{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}";Ct(bPt,{});const zr="vs/editor/contrib/symbolIcons/browser/symbolIcons";B("symbolIcon.arrayForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.booleanForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,1,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,2,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.colorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,3,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constantForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,4,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,5,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,6,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,7,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,8,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,9,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fileForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,10,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.folderForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,11,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,12,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,13,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,14,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keywordForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,15,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,16,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.moduleForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,17,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.namespaceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,18,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.nullForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,19,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.numberForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,20,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.objectForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,21,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.operatorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,22,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.packageForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,23,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.propertyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,24,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.referenceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,25,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.snippetForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,26,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.stringForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,27,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.structForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,28,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.textForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,29,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.typeParameterForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,30,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.unitForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,31,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,32,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class XPe{constructor(){this._onDidWillResize=new I,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._sashListener=new Z,this._size=new Tn(0,0),this._minSize=new Tn(0,0),this._maxSize=new Tn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Lh(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:vi.VERTICAL}),this._westSash=new Lh(this.domNode,{getVerticalSashLeft:()=>0},{orientation:vi.VERTICAL}),this._northSash=new Lh(this.domNode,{getHorizontalSashTop:()=>0},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.North}),this._southSash=new Lh(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(T.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(T.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(T.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(T.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?Ia.Enabled:Ia.Disabled,this._eastSash.state=t?Ia.Enabled:Ia.Disabled,this._southSash.state=i?Ia.Enabled:Ia.Disabled,this._westSash.state=s?Ia.Enabled:Ia.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Tn(t,e);Tn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const S4e="vs/editor/contrib/suggest/browser/suggestWidgetDetails";function ZPe(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let Dye=class{constructor(e,t){this._editor=e,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new I,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Z,this._renderDisposeable=new Z,this._borderWidth=1,this._size=new Tn(330,0),this.domNode=we(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(vw,{editor:e}),this._body=we(".body"),this._scrollbar=new bz(this._body,{alwaysConsumeMouseWheel:!0}),he(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=he(this._body,we(".header")),this._close=he(this._header,we("span"+$e.asCSSSelector(Ce.close))),this._close.title=g(S4e,0,"Close"),this._type=he(this._header,we("p.type")),this._docs=he(this._body,we("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.fontInfo)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(x.fontInfo),i=t.getMassagedFontFamily(),s=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${s}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(x.suggestLineHeight)||this._editor.getOption(x.fontInfo).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=g(S4e,1,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} +`)}withRange(e){return new pye(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new ug(this.range,this.insertText)}};function BNt(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new O(n.lineNumber,t.startColumn,n.lineNumber,i):O.fromPositions(n,n.with(void 0,i))}function a4e(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n)?.sliceAndInflate(e.column-1,o.length,0);return a?RNt(a,i):n}function wM(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=e.getValueInRange(i,xo.LF),o=LS(s,n.text),r=gf.ofText(s.substring(0,o)).addToPosition(n.range.getStartPosition()),a=n.text.substring(o),c=O.fromPositions(r,n.range.getEndPosition());return new ug(c,a)}function ttt(n,e){return n.text.startsWith(e.text)&&WNt(n.range,e.range)}function c4e(n,e,t,i,s=0){let o=wM(n,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=Uo(r).length;if(o.range.startColumn-1<=a){const p=Uo(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,w]=[o.range.getStartPosition(),o.range.getEndPosition()],b=v.column+m.length<=w.column?v.delta(0,m.length):w,C=O.fromPositions(b,w),y=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new ug(C,y)}const l=e.getValueInRange(o.range),d=HNt(l,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const p=d.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==l.length)return}const f=o.text.length-s;for(const p of d){const m=o.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,w=Math.max(p.modifiedStart,Math.min(v,f)),b=o.text.substring(p.modifiedStart,w),C=o.text.substring(w,Math.max(p.modifiedStart,v));b.length>0&&u.push(new Ete(m,b,!1)),C.length>0&&u.push(new Ete(m,C,!0))}return new q7(h,u)}function WNt(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let DK;function HNt(n,e){if(DK?.originalValue===n&&DK?.newValue===e)return DK?.changes;{let t=d4e(n,e,!0);if(t){const i=l4e(t);if(i>0){const s=d4e(n,e,!1);s&&l4e(s)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(l){if(l<0)throw new Error("unexpected");return s+l+1}function r(l){let d=0,h=0;const u=new Int32Array(l.length);for(let f=0,p=l.length;fa},{getElements:()=>c}).ComputeDiff(!1).changes}let mye=class extends ${constructor(e,t,i,s,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new Dn),this.inlineCompletions=_7("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=_7("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const s=new VNt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(s))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(s))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ai,c=(async()=>{if((r||t.triggerKind===Ub.Automatic)&&await UNt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const h=new Date,u=await NNt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new $Nt(u,s,this.textModel,this.versionId);if(i){const m=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!u.has(m)&&p.prepend(i.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),En(m=>{o.set(p,m)}),!0})(),l=new zNt(s,a,c);return this._updateOperation.value=l,c}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};mye=D([_(3,ht),_(4,lo)],mye);function UNt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class VNt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Ixt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,PJe())&&(e.context.triggerKind===Ub.Automatic||this.context.triggerKind===Ub.Explicit)&&this.versionId===e.versionId}}class zNt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class $Nt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[];const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new h4e(r,o[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new h4e(e,s,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class h4e{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=s,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=yy({owner:this,equalsFn:O.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??ipe)}toSingleTextEdit(e){return new ug(this._updatedRange.read(e)??ipe,this.inlineCompletion.insertText)}isVisible(e,t,i){const s=wM(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const r=e.getValueInRange(s.range,xo.LF),a=s.text,c=Math.max(0,t.column-s.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=r.substring(0,c),u=r.substring(c);const f=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!zYe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&gf.ofRange(i).isGreaterThanOrEqualTo(gf.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new ug(this._updatedRange.read(e)??ipe,this.inlineCompletion.filterText)}}const ipe=new O(1,1,1,1),itt="vs/base/browser/ui/findinput/replaceInput",GNt=g(itt,0,"input"),qNt=g(itt,1,"Preserve Case");class QNt extends iD{constructor(e){super({icon:Ce.preserveCase,title:qNt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??va("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const yBe=class yBe extends wg{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new I),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new I),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new I),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onKeyUp=this._register(new I),this.onKeyUp=this._onKeyUp.event,this._onPreserveCaseKeyDown=this._register(new I),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||GNt;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,c=!!s.flexibleWidth,l=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new MNe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new QNt({appendTitle:o,isChecked:!1,...s.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(E.LeftArrow)||u.equals(E.RightArrow)||u.equals(E.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(E.RightArrow)?p=(f+1)%d.length:u.equals(E.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(E.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),un.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}clear(){this.clearValidation(),this.setValue(""),this.focus()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}onSearchSubmit(){this.inputBox.addToHistory()}applyStyles(){}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox?.validate()}showMessage(e){this.inputBox?.showMessage(e)}clearMessage(){this.inputBox?.hideMessage()}clearValidation(){this.inputBox?.hideMessage()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}};yBe.OPTION_CHANGE="optionChange";let _ye=yBe;const jNt="vs/platform/history/browser/contextScopedHistoryWidget",qPe=new Y("suggestWidgetVisible",!1,g(jNt,0,"Whether suggestion are visible")),QPe="historyNavigationWidgetFocus",ntt="historyNavigationForwardsEnabled",stt="historyNavigationBackwardsEnabled";let j$;const kK=[];function dhe(n,e){if(kK.includes(e))throw new Error("Cannot register the same widget multiple times");kK.push(e);const t=new Z,i=new Y(QPe,!1).bindTo(n),s=new Y(ntt,!0).bindTo(n),o=new Y(stt,!0).bindTo(n),r=()=>{i.set(!0),j$=e},a=()=>{i.set(!1),j$===e&&(j$=void 0)};return kw(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{kK.splice(kK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let vye=class extends MNe{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.element));this._register(dhe(o,this))}};vye=D([_(3,Pe)],vye);let wye=class extends S7{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(dhe(o,this.inputBox))}};wye=D([_(3,Pe)],wye);let bye=class extends _ye{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(dhe(r,this.inputBox))}};bye=D([_(3,Pe)],bye);xr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:ye.WorkbenchContrib,when:ge.and(ge.has(QPe),ge.equals(stt,!0),ge.not("isComposing"),qPe.isEqualTo(!1)),primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],handler:n=>{j$?.showPreviousValue()}});xr.registerCommandAndKeybindingRule({id:"history.showNext",weight:ye.WorkbenchContrib,when:ge.and(ge.has(QPe),ge.equals(ntt,!0),ge.not("isComposing"),qPe.isEqualTo(!1)),primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],handler:n=>{j$?.showNextValue()}});const wD="vs/editor/contrib/suggest/browser/suggest",qi={Visible:qPe,HasFocusedSuggestion:new Y("suggestWidgetHasFocusedSuggestion",!1,g(wD,0,"Whether any suggestion is focused")),DetailsVisible:new Y("suggestWidgetDetailsVisible",!1,g(wD,1,"Whether suggestion details are visible")),MultipleSuggestions:new Y("suggestWidgetMultipleSuggestions",!1,g(wD,2,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Y("suggestionMakesTextEdit",!0,g(wD,3,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Y("acceptSuggestionOnEnter",!0,g(wD,4,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Y("suggestionHasInsertAndReplaceRange",!1,g(wD,5,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Y("suggestionInsertMode",void 0,{type:"string",description:g(wD,6,"Whether the default behaviour is to insert or replace")}),CanResolve:new Y("suggestionCanResolve",!1,g(wD,7,"Whether the current suggestion supports to resolve further details"))},FI=new Te("suggestWidgetStatusBar");let KNt=class{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=sw.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,O.isIRange(t.range)?(this.editStart=new oe(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new oe(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new oe(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new oe(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new oe(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||O.spansMultipleLines(t.range.insert)||O.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new ao(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{Na(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var _x;(function(n){n[n.Top=0]="Top",n[n.Inline=1]="Inline",n[n.Bottom=2]="Bottom"})(_x||(_x={}));const qae=class qae{constructor(e=_x.Bottom,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}};qae.default=new qae;let Q7=qae,yk;function YNt(){return yk}function JNt(n){const e=yk;return yk=n,e}class XNt{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function jPe(n,e,t,i=Q7.default,s={triggerKind:tf.Invoke},o=qe.None){const r=new ao;t=t.clone();const a=e.getWordAtPosition(t),c=a?new O(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):O.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,w,b)=>{let C=!1;if(!w)return C;for(const y of w.suggestions)if(!i.kindFilter.has(y.kind)){if(!i.showDeprecated&&y?.tags?.includes(TU.Deprecated))continue;y.range||(y.range=l),y.sortText||(y.sortText=typeof y.label=="string"?y.label:y.label.label),!f&&y.insertTextRules&&y.insertTextRules&cp.InsertAsSnippet&&(f=ww.guessNeedsClipboard(y.insertText)),d.push(new KNt(t,y,w,v)),C=!0}return cz(w)&&h.add(w),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:w.duration??-1,elapsedOverall:b.elapsed()}),C},m=(async()=>{if(!yk||i.kindFilter.has(Ne.Snippet))return;const v=i.providerItemsToReuse.get(yk);if(v){v.forEach(C=>d.push(C));return}if(i.providerFilter.size>0&&!i.providerFilter.has(yk))return;const w=new ao,b=await yk.provideCompletionItems(e,t,s,o);p(yk,b,w)})();for(const v of n.orderedGroups(e)){let w=!1;if(await Promise.all(v.map(async b=>{if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(y=>d.push(y)),w=w||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new ao,y=await b.provideCompletionItems(e,t,s,o);w=p(b,y,C)||w}catch(C){er(C)}})),w||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Tc)):new XNt(d.sort(tPt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function KPe(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function ZNt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return-1;if(e.completion.kind===Ne.Snippet)return 1}return KPe(n,e)}function ePt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===Ne.Snippet)return 1;if(e.completion.kind===Ne.Snippet)return-1}return KPe(n,e)}const hhe=new Map;hhe.set(_x.Top,ZNt);hhe.set(_x.Bottom,ePt);hhe.set(_x.Inline,KPe);function tPt(n){return hhe.get(n)}yt.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,o]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s),Bt(typeof o=="number"||!o);const{completionProvider:r}=n.get(ht),a=await n.get(Rn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await jPe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?tf.TriggerCharacter:tf.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(qe.None)),c.incomplete=c.incomplete||u.container.incomplete,c.suggestions.push(u.completion);try{return await Promise.all(l),c}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function ott(n,e){n.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class d2{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case Ar.Comment:return e.comments;case Ar.String:return e.strings;default:return e.other}}}var iPt=".monaco-editor .snippet-placeholder{background-color:var(--vscode-editor-snippetTabstopHighlightBackground,transparent);min-width:2px;outline-color:var(--vscode-editor-snippetTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}.monaco-editor .finish-snippet-placeholder{background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground,transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder,transparent);outline-style:solid;outline-width:1px}";Ct(iPt,{});function nPt(n,e){const{os:t,tildify:i,relative:s}=e;if(s){const a=sPt(n,s,t);if(typeof a=="string")return a}let o=n.fsPath;if(t===Pr.Windows&&!Is?o=o.replace(/\//g,"\\"):t!==Pr.Windows&&Is&&(o=o.replace(/\\/g,"/")),t!==Pr.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;n.scheme!==i.userHome.scheme&&n.path[0]===Qi.sep&&n.path[1]!==Qi.sep?c=i.userHome.with({path:n.path}).fsPath:c=o,o=rtt(c,a,t)}return(t===Pr.Windows?Gc:Qi).normalize(Ay(o,t===Pr.Windows))}function sPt(n,e,t){const i=t===Pr.Windows?Gc:Qi,s=t===Pr.Linux?Fn:Gle,o=e.getWorkspace(),r=k_(o.folders);if(!r)return;n.scheme!==r.uri.scheme&&n.path[0]===Qi.sep&&n.path[1]!==Qi.sep&&(n=r.uri.with({path:n.path}));const a=e.getWorkspaceFolder(n);if(!a)return;let c;if(s.isEqual(a.uri,n)?c="":c=s.relativePath(a.uri,n)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:s.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Ay(n,e=Is){return $Qe(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}let npe=Object.create(null);function rtt(n,e,t=$c){if(t===Pr.Windows||!n||!e)return n;let i=npe.original===e?npe.normalized:void 0;i||(i=e,Is&&(i=I9(i)),i=`${IS(i,Qi.sep)}${Qi.sep}`,npe={original:e,normalized:i});let s=n;return Is&&(s=I9(s)),(t===Pr.Linux?s.startsWith(i):Gq(s,i))?`~/${s.substr(i.length)}`:n}function oPt(n,e){return n.replace(/^~($|\/|\\)/,`${e}$1`)}const u4e="…",y5="\\\\",S5="~";function rPt(n,e=dg){const t=new Array(n.length);let i=!1;for(let s=0;s=0;d--){i=!1;let h=c.slice(d,d+l).join(e);for(let u=0;!i&&u-1){const f=d+l===c.length,p=d>0&&n[u].indexOf(e)>-1?e+h:h,m=n[u].endsWith(p);i=!f||m}if(!i){let u="";(c[0].endsWith(":")||r!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=r+u),d>0&&(u=u+u4e+e),u=u+h,d+l{if(o.type===UC.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===UC.VARIABLE||l.type===UC.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function YPe(n,e){return ei||e?n.replace(/\(&&\w\)|&&/g,""):Is?n.replace(/&&|&/g,t=>t==="&"?"&&":"&"):n.replace(/&&/g,"_")}const vo="vs/editor/contrib/snippet/browser/snippetVariables",cPt=Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,CURRENT_TIMEZONE_OFFSET:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,CURSOR_INDEX:!0,CURSOR_NUMBER:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class g4e{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class f4e{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=Uo(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof Fh&&(a=Uo(xw(l.value).pop())),!0));const c=LS(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(l,d,h)=>`${d}${a.substr(c)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class p4e{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return yr(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=yr(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return lS(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(ma(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class m4e{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!Xv(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let xte=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};xte=D([_(2,lo)],xte);const JC=class JC{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return JC.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return JC.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return JC.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return JC.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,c=a<10?"0"+a:a;return s+r+":"+c}}};JC.dayNames=[g(vo,0,"Sunday"),g(vo,1,"Monday"),g(vo,2,"Tuesday"),g(vo,3,"Wednesday"),g(vo,4,"Thursday"),g(vo,5,"Friday"),g(vo,6,"Saturday")],JC.dayNamesShort=[g(vo,7,"Sun"),g(vo,8,"Mon"),g(vo,9,"Tue"),g(vo,10,"Wed"),g(vo,11,"Thu"),g(vo,12,"Fri"),g(vo,13,"Sat")],JC.monthNames=[g(vo,14,"January"),g(vo,15,"February"),g(vo,16,"March"),g(vo,17,"April"),g(vo,18,"May"),g(vo,19,"June"),g(vo,20,"July"),g(vo,21,"August"),g(vo,22,"September"),g(vo,23,"October"),g(vo,24,"November"),g(vo,25,"December")],JC.monthNamesShort=[g(vo,26,"Jan"),g(vo,27,"Feb"),g(vo,28,"Mar"),g(vo,29,"Apr"),g(vo,30,"May"),g(vo,31,"Jun"),g(vo,32,"Jul"),g(vo,33,"Aug"),g(vo,34,"Sep"),g(vo,35,"Oct"),g(vo,36,"Nov"),g(vo,37,"Dec")];let Dte=JC;class _4e{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=UW(this._workspaceService.getWorkspace());if(!nxt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(BS(e))return yr(e.uri.path);let t=yr(e.configPath.path);return t.endsWith(qb)&&(t=t.substr(0,t.length-qb.length-1)),t}_resoveWorkspacePath(e){if(BS(e))return Ay(e.uri.fsPath);const t=yr(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Ay(i):"/"}}class v4e{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Dr()}}var qw;const uv=class uv{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=yU(t.placeholders,ep.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=O.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive,c=t.addDecoration(r,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),c=this._editor.getModel().getValueInRange(a),l=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);r.push(new mt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?uv._decor.activeFinal:uv._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(c,a.isFinalTabstop?uv._decor.inactiveFinal:uv._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof ep){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Wz,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=s.index+(r+1)/this._nestingLevel:c.index=s.index+c.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=O.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,uv._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=yU(this._snippet.placeholders,ep.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const s=t.getDecorationRange(i)??void 0;e?e=e.plusRange(s):e=s}return e}};uv._decor={active:Kt.register({description:"snippet-placeholder-1",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Kt.register({description:"snippet-placeholder-2",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Kt.register({description:"snippet-placeholder-3",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Kt.register({description:"snippet-placeholder-4",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let kte=uv;const w4e={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Ite=qw=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=Uo(r,0,t.column-1);let c;return s.walk(l=>{if(!(l instanceof Fh)||l.parent instanceof Wz||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=s.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??s.toString();const f=c.charCodeAt(u-1);(f===Q.LineFeed||f===Q.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fy.get(Ti)),p=e.invokeWithinContext(y=>new p4e(y.get(eo),u)),m=()=>a,v=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),i,0)),w=u.getValueInRange(qw.adjustSelection(u,e.getSelection(),0,s)),b=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((y,S)=>({selection:y,idx:S})).sort((y,S)=>O.compareRangesUsingStarts(y.selection,S.selection));for(const{selection:y,idx:S}of C){let M=qw.adjustSelection(u,y,i,0),k=qw.adjustSelection(u,y,0,s);v!==u.getValueInRange(M)&&(M=y),w!==u.getValueInRange(k)&&(k=y);const F=y.setStartPosition(M.startLineNumber,M.startColumn).setEndPosition(k.endLineNumber,k.endColumn),N=new ww().parse(t,!0,o),z=F.getStartPosition(),U=qw.adjustWhitespace(u,z,r||S>0&&b!==u.getLineFirstNonWhitespaceColumn(y.positionLineNumber),N);N.resolveVariables(new g4e([p,new m4e(m,S,C.length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(u,y,S,c),new xte(u,y,l),new Dte,new _4e(f),new v4e])),d[S]=ds.replace(F,N.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new kte(e,N,U)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new ww,h=new OQ,u=new g4e([e.invokeWithinContext(p=>new p4e(p.get(eo),l)),new m4e(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new f4e(l,e.getSelection(),0,r),new xte(l,e.getSelection(),a),new Dte,new _4e(e.invokeWithinContext(p=>p.get(Ti))),new v4e]);t=t.sort((p,m)=>O.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const S=t[p-1].range,M=O.fromPositions(S.getEndPosition(),m.getStartPosition()),k=new Fh(l.getValueInRange(M));h.appendChild(k),f+=k.value.length}const w=d.parseFragment(v,h);qw.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(w)),h.resolveVariables(u);const b=h.toString(),C=b.slice(f);f=b.length;const y=ds.replace(m,C);y.identifier={major:p,minor:0},y._isTracked=!0,c.push(y)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new kte(e,h,"")]}}constructor(e,t,i=w4e,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){St(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?qw.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):qw.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(o=>!!o.identifier);for(let o=0;omt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=w4e){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=qw.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(c=>!!c.identifier);for(let c=0;cmt.fromPositions(c.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(O.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(O.compareRangesUsingStarts);for(let o=0;o0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};Ite=qw=D([_(3,lo)],Ite);var wB;const IK="vs/editor/contrib/snippet/browser/snippetController2",LK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Ny;let mc=(Ny=class{static get(e){return e.getContribution(wB.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=wB.InSnippetMode.bindTo(s),this._hasNextTabstop=wB.HasNextTabstop.bindTo(s),this._hasPrevTabstop=wB.HasPrevTabstop.bindTo(s)}dispose(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}apply(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_edits=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}insert(e,t){try{this._doInsert(e,typeof t>"u"?LK:{...LK,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Bt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new Ite(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(l,d)=>{if(!this._session||l!==this._editor.getModel()||!oe.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=l.getValueInRange(h.range),f=!!h.choice.options.find(m=>m.value===u),p=[];for(let m=0;m{o?.dispose(),r=!1},c=()=>{r||(o=this._languageFeaturesService.completionProvider.register({language:s.getLanguageId(),pattern:s.uri.fsPath,scheme:s.uri.scheme,exclusive:!0},i),this._snippetListener.add(o),r=!0)};this._choiceCompletions={provider:i,enable:c,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{ott(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}getSessionEnclosingRange(){if(this._session)return this._session.getEnclosingRange()}},wB=Ny,Ny.ID="snippetController2",Ny.InSnippetMode=new Y("inSnippetMode",!1,g(IK,0,"Whether the editor in current in snippet mode")),Ny.HasNextTabstop=new Y("hasNextTabstop",!1,g(IK,1,"Whether there is a next tab stop when in snippet mode")),Ny.HasPrevTabstop=new Y("hasPrevTabstop",!1,g(IK,2,"Whether there is a previous tab stop when in snippet mode")),Ny);mc=wB=D([_(1,Ze),_(2,ht),_(3,Pe),_(4,lo)],mc);vn(mc.ID,mc,mi.Lazy);const uhe=Jc.bindToContribution(mc.get);Ke(new uhe({id:"jumpToNextSnippetPlaceholder",precondition:ge.and(mc.InSnippetMode,mc.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new uhe({id:"jumpToPrevSnippetPlaceholder",precondition:ge.and(mc.InSnippetMode,mc.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Ke(new uhe({id:"leaveSnippet",precondition:mc.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:ye.EditorContrib+30,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new uhe({id:"acceptSnippet",precondition:mc.InSnippetMode,handler:n=>n.finish()}));var Bp;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Bp||(Bp={}));let Cye=class extends ${get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=i,this._positions=s,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=c,this._enabled=l,this._instantiationService=d,this._commandService=h,this._languageConfigurationService=u,this._source=this._register(this._instantiationService.createInstance(mye,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=xi(this,!1),this._forceUpdateExplicitlySignal=oL(this),this._selectedInlineCompletionId=xi(this,void 0),this._primaryPosition=Dt(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Bp.Redo,Bp.Undo,Bp.AcceptWord]),this._fetchInlineCompletionsPromise=zxt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ub.Automatic}),handleChange:(p,m)=>(p.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(p.change)?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=Ub.Explicit),!0)},(p,m)=>{if(this._forceUpdateExplicitlySignal.read(p),!(this._enabled.read(p)&&this.selectedSuggestItem.read(p)||this._isActive.read(p))){this._source.cancelUpdate();return}this.textModelVersionId.read(p);const w=this._source.suggestWidgetInlineCompletions.get(),b=this.selectedSuggestItem.read(p);if(w&&!b){const k=this._source.inlineCompletions.get();En(F=>{(!k||w.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(w.clone(),F),this._source.clearSuggestWidgetInlineCompletions(F)})}const C=this._primaryPosition.read(p),y={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:b?.toSelectedSuggestionInfo()},S=this.selectedInlineCompletion.get(),M=m.preserveCurrentCompletion||S?.forwardStable?S:void 0;return this._source.fetch(C,y,M)}),this._filteredInlineCompletionItems=yy({owner:this,equalsFn:fbe()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Dt(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),w=this._selectedInlineCompletionId===void 0?-1:v.findIndex(b=>b.semanticId===m);return w===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):w}),this.selectedInlineCompletion=Dt(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=yy({owner:this,equalsFn:fbe()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Dt(this,p=>{if(this.lastTriggerKind.read(p)===Ub.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=yy({owner:this,equalsFn:(p,m)=>!p||!m?p===m:i4e(p.ghostTexts,m.ghostTexts)&&p.inlineCompletion===m.inlineCompletion&&p.suggestItem===m.suggestItem},p=>{const m=this.textModel,v=this.selectedSuggestItem.read(p);if(v){const w=wM(v.toSingleTextEdit(),m),b=this._computeAugmentation(w,p);if(!this._suggestPreviewEnabled.read(p)&&!b)return;const y=b?.edit??w,S=b?b.edit.text.length-w.text.length:0,M=this._suggestPreviewMode.read(p),k=this._positions.read(p),F=[y,...spe(this.textModel,k,y)],N=F.map((U,J)=>c4e(U,m,M,k[J],S)).filter(yl),z=N[0]??new q7(y.range.endLineNumber,[]);return{edits:F,primaryGhostText:z,ghostTexts:N,inlineCompletion:b?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const w=this.selectedInlineCompletion.read(p);if(!w)return;const b=w.toSingleTextEdit(p),C=this._inlineSuggestMode.read(p),y=this._positions.read(p),S=[b,...spe(this.textModel,y,b)],M=S.map((k,F)=>c4e(k,m,C,y[F],0)).filter(yl);return M[0]?{edits:S,primaryGhostText:M[0],ghostTexts:M,inlineCompletion:w,suggestItem:void 0}:void 0}}),this.ghostTexts=yy({owner:this,equalsFn:i4e},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=yy({owner:this,equalsFn:Yet},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(Ez(this._fetchInlineCompletionsPromise));let f;this._register(Ni(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const w=v.inlineCompletion,b=w.source;b.provider.handleItemDidShow?.(b.inlineCompletions,w.sourceInlineCompletion,w.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){m7(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){m7(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(yl);return Lct(o,a=>{let c=a.toSingleTextEdit(t);return c=wM(c,i,O.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),ttt(c,e)?{completion:a,edit:c}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new cn;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[ds.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),mc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const s=t.edits,o=b4e(s).map(r=>mt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...s.map(r=>ds.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}i.command&&i.source.addRef(),En(s=>{this._source.clear(s),this._isActive.set(!1,s)}),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,er),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(s),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let c=0;a&&a.index!==void 0?a.index===0?c=a[0].length:c=a.index:c=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length},DI.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new cn;const s=this.state.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const o=s.primaryGhostText,r=s.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){await this.accept(e);return}const a=o.parts[0],c=new oe(o.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&o.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];r.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=O.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new ug(p,m),w=[v,...spe(this.textModel,u,v)],b=b4e(w).map(C=>mt.fromPositions(C));e.executeEdits("inlineSuggestion.accept",w.map(C=>ds.replace(C.range,C.text))),e.setSelections(b,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),vt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=O.fromPositions(r.range.getStartPosition(),gf.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,xo.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=wM(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=i.completion.inlineCompletion;s.source.provider.handlePartialAccept?.(s.source.inlineCompletions,s.sourceInlineCompletion,t.text.length,{kind:DI.Suggest})}};Cye=D([_(9,be),_(10,ji),_(11,lo)],Cye);function spe(n,e,t){if(e.length===1)return[];const i=e[0],s=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=n.getValueInRange(O.fromPositions(i,r)),c=n4e(i,o);if(c.lineNumber<1)return bt(new cn(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=lPt(t.text,c);return s.map(d=>{const h=ENt(n4e(d,o),r),u=n.getValueInRange(O.fromPositions(d,h)),f=LS(a,u),p=O.fromPositions(d,d.delta(0,f));return new ug(p,l)})}function lPt(n,e){let t="";const i=Nlt(n);for(let s=e.lineNumber-1;sO.compareRangesUsingStarts(o.range,r.range)),i=new WU(e.apply(n)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var I3;class JPe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;oc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&r===-1)return r=l}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:E9.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class hPt extends JPe{constructor(){super("recentlyUsedByPrefix"),this._trie=Su.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o=`${e.getLanguageId()}/${s}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:E9.fromString(i.type),this._trie.set(t,i)}}}var d0;let yye=(d0=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new yn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===nS.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const s=I3._strategyCtors.get(i)||C4e;this._strategy=new s;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,a=this._storageService.get(`${I3._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?ke.PROFILE:ke.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${I3._storagePrefix}/${this._strategy.name}`,i,t,ln.MACHINE)}}},I3=d0,d0._strategyCtors=new Map([["recentlyUsedByPrefix",hPt],["recentlyUsed",dPt],["first",C4e]]),d0._storagePrefix="suggest/memories",d0);yye=I3=D([_(0,on),_(1,Re)],yye);const ghe=ae("ISuggestMemories");ce(ghe,yye,Yt.Delayed);var Sye,fN;let Lte=(fN=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Sye.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(x.tabCompletion)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(x.tabCompletion)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},Sye=fN,fN.AtEnd=new Y("atEndOfWord",!1),fN);Lte=Sye=D([_(1,Pe)],Lte);var L3,pN;let bV=(pN=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=L3.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(L3._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=L3._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},L3=pN,pN.OtherSuggestions=new Y("hasOtherSuggestions",!1),pN);bV=L3=D([_(1,Pe)],bV);const Gm=class Gm{async provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Gm._bracketsRightYield(a,0,e,s,r)),await new Promise(a=>Gm._bracketsLeftYield(a,0,e,s,r,o))}return i}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Gm._maxRounds){e();break}if(!s){e();break}const c=i.bracketPairs.findNextBracket(s);if(!c){e();break}if(Date.now()-a>Gm._maxDuration){setTimeout(()=>Gm._bracketsRightYield(e,t+1,i,s,o));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new td,o.set(d,u)),u.push(c.range)}}s=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,c=Date.now();for(;;){if(t>=Gm._maxRounds&&o.size===0){e();break}if(!s){e();break}const l=i.bracketPairs.findPrevBracket(s);if(!l){e();break}if(Date.now()-c>Gm._maxDuration){setTimeout(()=>Gm._bracketsLeftYield(e,t+1,i,s,o,r));break}if(l.bracketInfo.isOpeningBracket){const h=l.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const p=f.shift();f.size===0&&o.delete(h);const m=O.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=O.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),Gm._addBracketLeading(i,v,r)}}}else{const h=l.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}s=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:O.fromPositions(new oe(s,o),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:O.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:O.fromPositions(new oe(r,1),t.getEndPosition())}))}}};Gm._maxDuration=30,Gm._maxRounds=2;let Tte=Gm;const XC=class XC{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return XC.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return XC.None;const[o]=await new Tte().provideSelectionRanges(i,[s]);if(o.length===0)return XC.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return XC.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends XC{distance(c,l){if(!s.equals(t.getPosition()))return 0;if(l.kind===Ne.Keyword)return 2<<20;const d=typeof l.label=="string"?l.label:l.label.label,h=r[d];if(iO(h))return 2<<20;const u=CU(h,O.fromPositions(c),O.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!O.containsRange(m.range,f))break;p-=1}return p}}}};XC.None=new class extends XC{distance(){return 0}};let Rte=XC,y4e=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var ZD;(function(n){n[n.Nothing=0]="Nothing",n[n.All=1]="All",n[n.Incr=2]="Incr"})(ZD||(ZD={}));class Sk{constructor(e,t,i,s,o,r,a=l7.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=Sk._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=ZD.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Sk._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Sk._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==ZD.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===ZD.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?v1:nAt;for(let l=0;l=f)d.score=sw.Default;else if(typeof d.completion.filterText=="string"){const m=c(s,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;mE(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=eAt(s,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(s,o,p,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;d.score=m}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=ZD.Nothing,this._stats={pLabelLen:e.length?d_e(e.length-.85,e,(l,d)=>l-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return 1;if(t.completion.kind===Ne.Snippet)return-1}return Sk._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Ne.Snippet)return-1;if(t.completion.kind===Ne.Snippet)return 1}return Sk._compareCompletionItems(e,t)}}var Aye;class kL{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}var OI;(function(n){n[n.Idle=0]="Idle",n[n.Manual=1]="Manual",n[n.Auto=2]="Auto"})(OI||(OI={}));function uPt(n,e,t){if(!e.getContextKeyValue(af.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}function gPt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(af.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(x.inlineSuggest).suppressSuggestions}let Mte=Aye=class{constructor(e,t,i,s,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new O_,this._triggerState=void 0,this._completionDisposables=new Z,this._onDidCancel=new I,this._onDidTrigger=new I,this._onDidSuggest=new I,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new mt(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){St(this._triggerCharacterListener),St([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(x.readOnly)||!this._editor.hasModel()||!this._editor.getOption(x.suggestOnTriggerCharacters))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(YNt()),e.set(s,o)),o.add(i)}const t=i=>{if(!gPt(this._editor,this._contextKeyService)||kL.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let s="";sF(i.charCodeAt(i.length-1))?wl(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const r=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())o.has(a)||r.set(a,c);this.trigger({auto:!0,triggerKind:tf.TriggerCharacter,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?OI.Auto:OI.Manual:OI.Idle}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==Wi.NotSet&&e.reason!==Wi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Wi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Wi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){d2.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&mc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!kL.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(x.quickSuggestions);if(!d2.isAllOff(i)){if(!d2.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const s=e.tokenization.getLineTokens(t.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(i,o)!=="on")return}uPt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Bt(this._editor.hasModel()),Bt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new kL(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new kL(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??tf.Invoke};e.triggerCharacter&&(s={triggerKind:tf.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ai;const o=this._editor.getOption(x.snippetSuggestions);let r=_x.Inline;switch(o){case"top":r=_x.Top;break;case"bottom":r=_x.Bottom;break}const{itemKind:a,showDeprecated:c}=Aye.createSuggestFilter(this._editor),l=new Q7(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=Rte.create(this._editorWorkerService,this._editor),h=jPe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,s,this._requestToken.token);Promise.all([h,d]).then(async([u,f])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return;let p=e?.clipboardText;if(!p&&u.needsClipboard&&(p=await this._clipboardService.readText()),this._triggerState===void 0)return;const m=this._editor.getModel(),v=new kL(m,this._editor.getPosition(),e),w={...l7.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new Sk(u.items,this._context.column,{leadingLineContent:v.leadingLineContent,characterCountDelta:v.column-this._context.column},f,this._editor.getOption(x.suggest),this._editor.getOption(x.snippetSuggestions),w,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const b of u.items)b.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${b.provider._debugDisplayName}`,b.completion)}).catch(bt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(x.snippetSuggestions)==="none"&&t.add(Ne.Snippet);const s=e.getOption(x.suggest);return s.showMethods||t.add(Ne.Method),s.showFunctions||t.add(Ne.Function),s.showConstructors||t.add(Ne.Constructor),s.showFields||t.add(Ne.Field),s.showVariables||t.add(Ne.Variable),s.showClasses||t.add(Ne.Class),s.showStructs||t.add(Ne.Struct),s.showInterfaces||t.add(Ne.Interface),s.showModules||t.add(Ne.Module),s.showProperties||t.add(Ne.Property),s.showEvents||t.add(Ne.Event),s.showOperators||t.add(Ne.Operator),s.showUnits||t.add(Ne.Unit),s.showValues||t.add(Ne.Value),s.showConstants||t.add(Ne.Constant),s.showEnums||t.add(Ne.Enum),s.showEnumMembers||t.add(Ne.EnumMember),s.showKeywords||t.add(Ne.Keyword),s.showWords||t.add(Ne.Text),s.showColors||t.add(Ne.Color),s.showFiles||t.add(Ne.File),s.showReferences||t.add(Ne.Reference),s.showColors||t.add(Ne.Customcolor),s.showFolders||t.add(Ne.Folder),s.showTypeParameters||t.add(Ne.TypeParameter),s.showSnippets||t.add(Ne.Snippet),s.showUsers||t.add(Ne.User),s.showIssues||t.add(Ne.Issue),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Uo(e.leadingLineContent)!==Uo(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(kL.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:tf.TriggerForIncompleteCompletions,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=kL.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};Mte=Aye=D([_(1,kd),_(2,Mu),_(3,rn),_(4,Ze),_(5,Pe),_(6,Re),_(7,ht),_(8,Il)],Mte);class fPt{constructor(e,t,i,s){this._disposables=new Z,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==OI.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&s(this._active.item)}}))}_onItem(e){if(!e||!mo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new EZ;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Qae=class Qae{constructor(e,t){this._disposables=new Z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;aQae._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&ea instanceof id?i.createInstance(wPt,a,void 0):void 0;this._leftActions=new Qh(this.element,{actionViewItemProvider:r}),this._rightActions=new Qh(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};xye=D([_(2,be),_(3,_c),_(4,Pe)],xye);var bPt=".monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-enum,.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-value{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}";Ct(bPt,{});const zr="vs/editor/contrib/symbolIcons/browser/symbolIcons";B("symbolIcon.arrayForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.booleanForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,1,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,2,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.colorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,3,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constantForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,4,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,5,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,6,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,7,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(zr,8,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,9,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.fileForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,10,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.folderForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,11,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,12,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,13,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,14,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.keywordForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,15,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(zr,16,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.moduleForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,17,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.namespaceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,18,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.nullForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,19,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.numberForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,20,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.objectForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,21,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.operatorForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,22,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.packageForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,23,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.propertyForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,24,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.referenceForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,25,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.snippetForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,26,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.stringForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,27,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.structForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,28,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.textForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,29,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.typeParameterForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,30,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.unitForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(zr,31,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));B("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(zr,32,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class XPe{constructor(){this._onDidWillResize=new I,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._sashListener=new Z,this._size=new Tn(0,0),this._minSize=new Tn(0,0),this._maxSize=new Tn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Lh(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:vi.VERTICAL}),this._westSash=new Lh(this.domNode,{getVerticalSashLeft:()=>0},{orientation:vi.VERTICAL}),this._northSash=new Lh(this.domNode,{getHorizontalSashTop:()=>0},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.North}),this._southSash=new Lh(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:vi.HORIZONTAL,orthogonalEdge:Iee.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(T.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(T.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(T.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(T.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?Ia.Enabled:Ia.Disabled,this._eastSash.state=t?Ia.Enabled:Ia.Disabled,this._southSash.state=i?Ia.Enabled:Ia.Disabled,this._westSash.state=s?Ia.Enabled:Ia.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Tn(t,e);Tn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const S4e="vs/editor/contrib/suggest/browser/suggestWidgetDetails";function ZPe(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let Dye=class{constructor(e,t){this._editor=e,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new I,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Z,this._renderDisposeable=new Z,this._borderWidth=1,this._size=new Tn(330,0),this.domNode=we(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(vw,{editor:e}),this._body=we(".body"),this._scrollbar=new bz(this._body,{alwaysConsumeMouseWheel:!0}),he(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=he(this._body,we(".header")),this._close=he(this._header,we("span"+$e.asCSSSelector(Ce.close))),this._close.title=g(S4e,0,"Close"),this._type=he(this._header,we("p.type")),this._docs=he(this._body,we("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.fontInfo)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(x.fontInfo),i=t.getMassagedFontFamily(),s=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${s}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(x.suggestLineHeight)||this._editor.getOption(x.fontInfo).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=g(S4e,1,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} `,o+=`prefix: ${e.word??"(no prefix)"} `,o+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,o+=`distance: ${e.distance} (localityBonus-setting) `,o+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,o+=`commit_chars: ${e.completion.commitCharacters?.join("")} -`,s=new Xt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!ZPe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Oh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Yo(this._type),this._type.title="",Jl(this._type),this.domNode.classList.add("no-type");if(Yo(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Yo(this._docs);const o=this._markdownRenderer.render(s);this._docs.appendChild(o.element),this._renderDisposeable.add(o),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Tn(e,t);Tn.equals(i,this._size)||(this._size=i,Hut(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};Dye=D([_(1,be)],Dye);class CPt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new XPe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=s.width-a.dimension.width,c=!0),a.north&&(o=s.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=uw(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Tn(220,2*o.lineHeight),a=e.top,c=function(){const S=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),M=-o.borderWidth+e.left+e.width,k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),l=function(){const S=e.left-o.borderWidth-o.horizontalPadding,M=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),d=function(){const S=e.left,M=-o.borderWidth+e.top+e.height,k=new Tn(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:M,left:S,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(S=>S.fit>=0)??h.sort((S,M)=>M.fit-S.fit)[0],f=e.top+e.height-o.borderHeight;let p,m=t.height;const v=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);m>v&&(m=v);let w;i?m<=u.maxSizeTop.height?(p=!0,w=u.maxSizeTop):(p=!1,w=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,w=u.maxSizeBottom):(p=!0,w=u.maxSizeTop);let{top:b,left:C}=u;!p&&m>e.height&&(b=f-m);const y=this._editor.getDomNode();if(y){const S=y.getBoundingClientRect();b-=S.top,C-=S.left}this._applyTopLeft({left:C,top:b}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=w,this._resizable.layout(m,Math.min(w.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const yPt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function lI(n,e,t,i,s){if($e.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(P.isUri(s))return[];const o=i===Ic.ROOT_FOLDER?["rootfolder-icon"]:i===Ic.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===_e.data)r=h1.parseMetaData(t).get(h1.META_DATA_LABEL);else{const a=t.path.match(yPt);a?(r=TK(a[2].toLowerCase()),a[1]&&o.push(`${TK(a[1].toLowerCase())}-name-dir-icon`)):r=TK(t.authority.toLowerCase())}if(i===Ic.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===Ic.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const c=r.split(".");for(let l=1;l{const w=this._editor.getOptions(),b=w.get(x.fontInfo),C=b.getMassagedFontFamily(),y=b.fontFeatureSettings,S=w.get(x.suggestFontSize)||b.fontSize,M=w.get(x.suggestLineHeight)||b.lineHeight,k=b.fontWeight,F=b.letterSpacing,N=`${S}px`,z=`${M}px`,U=`${F}px`;i.style.fontSize=N,i.style.fontWeight=k,i.style.letterSpacing=U,a.style.fontFamily=C,a.style.fontFeatureSettings=y,a.style.lineHeight=z,s.style.height=z,s.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.root.id=ltt(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Cz(e.score)},r=[];if(s.kind===Ne.Color&&EPt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===Ne.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Ic.FILE),c=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Ic.FILE);o.extraClasses=a.length>c.length?a:c}else s.kind===Ne.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Ic.FOLDER),lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Ic.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...$e.asClassNameArray(E9.toIcon(s.kind))));s.tags&&s.tags.indexOf(TU.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=ope(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=ope(s.label.detail||""),i.detailsLabel.textContent=ope(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Oh(i.detailsLabel):Jl(i.detailsLabel),ZPe(e)?(i.right.classList.add("can-expand-details"),Oh(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Jl(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};kye=D([_(1,Ai),_(2,Di),_(3,pn)],kye);function ope(n){return n.replace(/\r\n|\r|\n/g,"")}var bB;const $g="vs/editor/contrib/suggest/browser/suggestWidget";B("editorSuggestWidget.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g($g,0,"Background color of the suggest widget."));B("editorSuggestWidget.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g($g,1,"Border color of the suggest widget."));const RK=B("editorSuggestWidget.foreground",{dark:Mc,light:Mc,hcDark:Mc,hcLight:Mc},g($g,2,"Foreground color of the suggest widget."));B("editorSuggestWidget.selectedForeground",{dark:zk,light:zk,hcDark:zk,hcLight:zk},g($g,3,"Foreground color of the selected entry in the suggest widget."));B("editorSuggestWidget.selectedIconForeground",{dark:JB,light:JB,hcDark:JB,hcLight:JB},g($g,4,"Icon foreground color of the selected entry in the suggest widget."));const xPt=B("editorSuggestWidget.selectedBackground",{dark:$k,light:$k,hcDark:$k,hcLight:$k},g($g,5,"Background color of the selected entry in the suggest widget."));B("editorSuggestWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g($g,6,"Color of the match highlights in the suggest widget."));B("editorSuggestWidget.focusHighlightForeground",{dark:Dj,light:Dj,hcDark:Dj,hcLight:Dj},g($g,7,"Color of the match highlights in the suggest widget when an item is focused."));B("editorSuggestWidgetStatus.foreground",{dark:Ie(RK,.5),light:Ie(RK,.5),hcDark:Ie(RK,.5),hcLight:Ie(RK,.5)},g($g,8,"Foreground color of the suggest widget status."));var An;(function(n){n[n.Hidden=0]="Hidden",n[n.Loading=1]="Loading",n[n.Empty=2]="Empty",n[n.Open=3]="Open",n[n.Frozen=4]="Frozen",n[n.Details=5]="Details"})(An||(An={}));class DPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof oC}`}restore(){const e=this._service.get(this._key,ke.PROFILE)??"";try{const t=JSON.parse(e);if(Tn.is(t))return Tn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),ke.PROFILE,ln.MACHINE)}reset(){this._service.remove(this._key,ke.PROFILE)}}var h0;let Iye=(h0=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=An.Hidden,this._isAuto=!1,this._pendingLayout=new Dn,this._pendingShowDetails=new Dn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new O_,this._disposables=new Z,this._onDidSelect=new r1,this._onDidFocus=new r1,this._onDidHide=new I,this._onDidShow=new I,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new I,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new XPe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new kPt(this,e),this._persistedSize=new DPt(t,e);class r{constructor(f,p,m=!1,v=!1){this.persistedSize=f,this.currentSize=p,this.persistHeight=m,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:f,defaultSize:p}=this.getLayoutInfo(),m=Math.round(f/2);let{width:v,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=m)&&(w=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new Tn(v,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=he(this.element.domNode,we(".message")),this._listElement=he(this.element.domNode,we(".tree"));const c=this._disposables.add(o.createInstance(Dye,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new CPt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(kye,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Pc("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>g($g,11,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:w,description:b}=u.completion.label;w&&b?f=g($g,12,"{0} {1}, {2}",f,w,b):w?f=g($g,13,"{0} {1}",f,w):b&&(f=g($g,14,"{0}, {1}",f,b))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=r_("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g($g,15,"{0}, docs: {1}",f,v)}}}),this._list.style(CO({listInactiveFocusBackground:xPt,listInactiveFocusOutline:co})),this._status=o.createInstance(xye,this.element.domNode,FI);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(s.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.suggest)&&(h(),l()),this._completionModel&&(u.hasChanged(x.fontInfo)||u.hasChanged(x.suggestFontSize)||u.hasChanged(x.suggestLineHeight))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Gi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Gi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Gi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Gi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Xo(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==An.Hidden&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=pS(e.type)?2:1}_onListFocus(e){if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=na(async s=>{const o=PS(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=s.onCancellationRequested(()=>o.dispose());try{return await t.resolve(s)}finally{o.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:ltt(i)}))}).catch(bt)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===An.Frozen),this.element.domNode.classList.remove("message"),e){case An.Hidden:Jl(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case An.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.LOADING_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.LOADING_MESSAGE);break;case An.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.NO_SUGGESTIONS_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.NO_SUGGESTIONS_MESSAGE);break;case An.Open:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Frozen:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Details:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===An.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=PS(()=>this._setState(An.Loading),t)))}showSuggestions(e,t,i,s,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==An.Empty&&this._state!==An.Hidden){this._setState(An.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(s?An.Hidden:An.Empty),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?An.Frozen:An.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=wZ(gt(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageDown(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollBottom(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageUp(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollTop(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==An.Hidden&&this._state!==An.Empty&&this._state!==An.Loading&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===An.Details?(this._setState(An.Open),this._details.widget.domNode.classList.remove("focused")):this._state===An.Open&&this._isDetailsVisible()&&(this._setState(An.Details),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(ZPe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===An.Open||this._state===An.Details||this._state===An.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=wZ(gt(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(An.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(o=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=ia(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,f=Math.min(t.height-u-i.verticalPadding,c),p=d.top+h.top-i.verticalPadding,m=Math.min(p,c);let v=Math.min(Math.max(m,f)+i.borderHeight,c);s===this._cappedHeight?.capped&&(s=this._cappedHeight.wanted),sv&&(s=v),s>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(hs.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(hs.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new Tn(a,i.defaultSize.height),this.element.maxSize=new Tn(r,v),this.element.minSize=new Tn(220,l),this._cappedHeight=s===c?{wanted:this._cappedHeight?.wanted??e.height,capped:s}:void 0}this._resize(o,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===hs.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Dc(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===An.Empty||this._state===An.Loading?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Tn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",ke.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,ke.PROFILE,ln.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},bB=h0,h0.LOADING_MESSAGE=g($g,9,"Loading..."),h0.NO_SUGGESTIONS_MESSAGE=g($g,10,"No suggestions."),h0);Iye=bB=D([_(1,sn),_(2,Pe),_(3,pn),_(4,be)],Iye);class kPt{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Tn(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var Lye;const CS="vs/editor/contrib/suggest/browser/suggestController";class IPt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=jt.register({description:"suggest-line-suffix",stickiness:gi.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(O.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var Pd;(function(n){n[n.None=0]="None",n[n.NoBeforeUndoStop=1]="NoBeforeUndoStop",n[n.NoAfterUndoStop=2]="NoAfterUndoStop",n[n.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",n[n.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Pd||(Pd={}));var mN;let pm=(mN=class{static get(e){return e.getContribution(Lye.ID)}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Dn,this._toDispose=new Z,this._selectors=new LPt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(Mte,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Gi.InsertMode.bindTo(s);c.set(e.getOption(x.suggest).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>c.set(e.getOption(x.suggest).insertMode))),this.widget=this._toDispose.add(new d$(gt(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(Iye,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Pd.None),this));const u=new fPt(this.editor,h,this.model,v=>this._insertSuggestion(v,Pd.NoAfterUndoStop));this._toDispose.add(u);const f=Gi.MakesTextEdit.bindTo(this._contextKeyService),p=Gi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Gi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const w=this.editor.getPosition(),b=v.editStart.column,C=w.column;let y=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===OI.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&cp.InsertAsSnippet)&&C-b===v.completion.insertText.length&&(y=this.editor.getModel().getValueInRange({startLineNumber:w.lineNumber,startColumn:b,endLineNumber:w.lineNumber,endColumn:C})!==v.completion.insertText),f.set(y),p.set(!oe.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new RS(!0,!1,!1,!1,E.KeyC))||ei&&v.toKeyCodeChord().equals(new RS(!1,!1,!1,!0,E.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new Eye(this.editor,this.model)))),this._alternatives=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new bV(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Lte,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new IPt(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const p of this._selectors.itemsOrderedByPriorityDesc)if(u=p.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===OI.Idle)return;let f=!1;if(h.triggerOptions.auto){const p=this.editor.getOption(x.suggest);p.selectionMode==="never"||p.selectionMode==="always"?f=p.selectionMode==="never":p.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==tf.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===tf.TriggerCharacter&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const l=Gi.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(x.acceptSuggestionOnEnter);l.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=pc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],c=new ai;t&Pd.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Pd.AlternativeOverwriteConfig));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=M_.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=O.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const w=this.editor.getPosition().column-r.position.column,b=w,C=O.spansMultipleLines(v)?0:w;v=new O(v.startLineNumber,v.startColumn+b,v.endLineNumber,v.endColumn+C)}return ds.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new ao;let m;const v=s.onDidChangeContent(y=>{if(y.isFlush){c.cancel(),v.dispose();return}for(const S of y.changes){const M=O.getEndPosition(S.range);(!m||oe.isBefore(M,m))&&(m=M)}}),w=t;t|=Pd.NoAfterUndoStop;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,w&Pd.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(r.resolve(c.token).then(()=>{if(!r.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(S=>oe.isBefore(m,O.getStartPosition(S.range))))return!1;b&&this.editor.pushUndoStop();const y=M_.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(S=>ds.replaceMove(O.lift(S.range),S.text))),y.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(w&Pd.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(y=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),y),u=y===!0?1:y===!1?0:-2}).finally(()=>{v.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&cp.InsertAsSnippet||(f=ww.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&cp.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Pd.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===Nte.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new ao;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?er(m):bt(m)}).finally(()=>{h=p.elapsed()}))}t&Pd.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(p,Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop|(t&Pd.AlternativeOverwriteConfig?Pd.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o){Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Ed(ui(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:uz(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,t){Bt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(mo(e.completion.additionalTextEdits)){const t=g(CS,0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);sa(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),vt.Smooth),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&cp.InsertAsSnippet||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,c=r.column;return c-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:c})!==o.completion.insertText};T.once(this.model.onDidTrigger)(o=>{const r=[];T.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{St(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(St(r),a.items.length===0){i();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),l=a.items[c];if(!s(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Pd.KeepAlternativeSuggestions|Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,vt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=Pd.KeepAlternativeSuggestions),t&&(s|=Pd.AlternativeOverwriteConfig),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}},Lye=mN,mN.ID="editor.contrib.suggestController",mN);pm=Lye=D([_(1,ghe),_(2,Qi),_(3,Pe),_(4,be),_(5,Ze),_(6,on)],pm);class LPt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const jae=class jae extends lt{constructor(){super({id:jae.id,label:g(CS,1,"Trigger Suggest"),alias:"Trigger Suggest",precondition:ge.and(X.writable,X.hasCompletionItemProvider,Gi.Visible.toNegated()),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.Alt|E.Escape,V.CtrlCmd|E.KeyI]},weight:ye.EditorContrib}})}run(e,t,i){const s=pm.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}};jae.id="editor.action.triggerSuggest";let Nte=jae;vn(pm.ID,pm,mi.BeforeFirstInteraction);Fe(Nte);const km=ye.EditorContrib+90,yg=Yc.bindToContribution(pm.get);Ke(new yg({id:"acceptSelectedSuggestion",precondition:ge.and(Gi.Visible,Gi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:E.Tab,kbExpr:ge.and(Gi.Visible,X.textInputFocus),weight:km},{primary:E.Enter,kbExpr:ge.and(Gi.Visible,X.textInputFocus,Gi.AcceptSuggestionsOnEnter,Gi.MakesTextEdit),weight:km}],menuOpts:[{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:Gi.HasInsertAndReplaceRange.toNegated()},{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:ge.and(Gi.HasInsertAndReplaceRange,Gi.InsertMode.isEqualTo("insert"))},{menuId:FI,title:g(CS,3,"Replace"),group:"left",order:1,when:ge.and(Gi.HasInsertAndReplaceRange,Gi.InsertMode.isEqualTo("replace"))}]}));Ke(new yg({id:"acceptAlternativeSelectedSuggestion",precondition:ge.and(Gi.Visible,X.textInputFocus,Gi.HasFocusedSuggestion),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.Shift|E.Enter,secondary:[V.Shift|E.Tab]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:FI,group:"left",order:2,when:ge.and(Gi.HasInsertAndReplaceRange,Gi.InsertMode.isEqualTo("insert")),title:g(CS,3,"Replace")},{menuId:FI,group:"left",order:2,when:ge.and(Gi.HasInsertAndReplaceRange,Gi.InsertMode.isEqualTo("replace")),title:g(CS,2,"Insert")}]}));yt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ke(new yg({id:"hideSuggestWidget",precondition:Gi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new yg({id:"selectNextSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}}));Ke(new yg({id:"selectNextPageSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.PageDown,secondary:[V.CtrlCmd|E.PageDown]}}));Ke(new yg({id:"selectLastSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Ke(new yg({id:"selectPrevSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new yg({id:"selectPrevPageSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.PageUp,secondary:[V.CtrlCmd|E.PageUp]}}));Ke(new yg({id:"selectFirstSuggestion",precondition:ge.and(Gi.Visible,ge.or(Gi.MultipleSuggestions,Gi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Ke(new yg({id:"focusSuggestion",precondition:ge.and(Gi.Visible,Gi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}}}));Ke(new yg({id:"focusAndAcceptSuggestion",precondition:ge.and(Gi.Visible,Gi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Ke(new yg({id:"toggleSuggestionDetails",precondition:ge.and(Gi.Visible,Gi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}},menuOpts:[{menuId:FI,group:"right",order:1,when:ge.and(Gi.DetailsVisible,Gi.CanResolve),title:g(CS,4,"show less")},{menuId:FI,group:"right",order:1,when:ge.and(Gi.DetailsVisible.toNegated(),Gi.CanResolve),title:g(CS,5,"show more")}]}));Ke(new yg({id:"toggleExplainMode",precondition:Gi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Slash}}));Ke(new yg({id:"toggleSuggestionFocus",precondition:Gi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Alt|E.Space,mac:{primary:V.WinCtrl|V.Alt|E.Space}}}));Ke(new yg({id:"insertBestCompletion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),Lte.AtEnd,Gi.Visible.toNegated(),bV.OtherSuggestions.toNegated(),pc.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(fo(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:km,primary:E.Tab}}));Ke(new yg({id:"insertNextSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,Gi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new yg({id:"insertPrevSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,Gi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Fe(class extends lt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(CS,6,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){pm.get(e)?.resetWidgetSize()}});class TPt extends ${get selectedItem(){return this._selectedItem}constructor(e,t,i,s){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=xi(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=pm.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(c,l,d)=>{En(w=>this.checkModelVersion(w));const h=this.editor.getModel();if(!h)return-1;const u=this.suggestControllerPreselector(),f=u?wM(u,h):void 0;if(!f)return-1;const p=oe.lift(l),m=d.map((w,b)=>{const C=K$.fromSuggestion(o,h,p,w,this.isShiftKeyPressed),y=wM(C.toSingleTextEdit(),h),S=ttt(f,y);return{index:b,valid:S,prefixLength:y.text.length,suggestItem:w}}).filter(w=>w&&w.valid&&w.prefixLength>0),v=MRe(m,El(w=>w.prefixLength,cg));return v?v.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(T.once(o.model.onDidTrigger)(c=>{a()})),this._register(o.onWillInsertSuggestItem(c=>{const l=this.editor.getPosition(),d=this.editor.getModel();if(!l||!d)return;const h=K$.fromSuggestion(o,d,l,c.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!RPt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,En(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=pm.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return K$.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){pm.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){pm.get(this.editor)?.forceRenderingAbove()}}class K${static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&cp.InsertAsSnippet){const l=new ww().parse(r);l.children.length<100&&Ite.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(s,o);return new K$(O.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new OQe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new ug(this.range,this.insertText)}}function RPt(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var Tye;const MPt="vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController";var _N;let _g=(_N=class extends ${static get(e){return e.getContribution(Tye.ID)}constructor(e,t,i,s,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this.model=this._register(_7("inlineCompletionModel",void 0)),this._textModelVersionId=xi(this,-1),this._positions=Uxt({owner:this,equalsFn:fbe(PJe())},[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new TPt(this.editor,()=>this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0),m=>this.updateObservables(m,Bp.Other),m=>{En(v=>{this.updateObservables(v,Bp.Other),this.model.get()?.handleSuggestAccepted(m)})})),this._enabledInConfig=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Wn(this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Dt(this,m=>this._enabledInConfig.read(m)&&(!this._isScreenReaderEnabled.read(m)||!this._editorDictationInProgress.read(m))),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._ghostTexts=Dt(this,m=>this.model.read(m)?.ghostTexts.read(m)??[]),this._stablizedGhostTexts=NPt(this._ghostTexts,this._store),this._ghostTextWidgets=yee(this,this._stablizedGhostTexts,(m,v)=>v.add(this._instantiationService.createInstance(hye,this.editor,{ghostText:m,minReservedLineCount:Au(0),targetTextModel:this.model.map(w=>w?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=oL(this),this._isReadonly=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._textModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=Dt(m=>this._isReadonly.read(m)?void 0:this._textModel.read(m)),this._register(new af(this._contextKeyService,this.model)),this._register(Ni(m=>{const v=this._textModelIfWritable.read(m);En(w=>{if(this.model.set(void 0,w),this.updateObservables(w,Bp.Other),v){const b=t.createInstance(Cye,v,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).preview),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).previewMode),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.inlineSuggest).mode),this._enabled);this.model.set(b,w)}})}));const h=this._register(uje());this._register(Ni(m=>{const v=this._fontFamily.read(m);h.setStyle(v===""||v==="default"?"":` +`,s=new Xt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!ZPe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,Oh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Yo(this._type),this._type.title="",Jl(this._type),this.domNode.classList.add("no-type");if(Yo(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Yo(this._docs);const o=this._markdownRenderer.render(s);this._docs.appendChild(o.element),this._renderDisposeable.add(o),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Tn(e,t);Tn.equals(i,this._size)||(this._size=i,Hut(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};Dye=D([_(1,be)],Dye);class CPt{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new XPe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=s.width-a.dimension.width,c=!0),a.north&&(o=s.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=uw(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Tn(220,2*o.lineHeight),a=e.top,c=function(){const S=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),M=-o.borderWidth+e.left+e.width,k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),l=function(){const S=e.left-o.borderWidth-o.horizontalPadding,M=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new Tn(S,s.height-e.top-o.borderHeight-o.verticalPadding),F=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:M,fit:S-t.width,maxSizeTop:k,maxSizeBottom:F,minSize:r.with(Math.min(S,r.width))}}(),d=function(){const S=e.left,M=-o.borderWidth+e.top+e.height,k=new Tn(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:M,left:S,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(S=>S.fit>=0)??h.sort((S,M)=>M.fit-S.fit)[0],f=e.top+e.height-o.borderHeight;let p,m=t.height;const v=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);m>v&&(m=v);let w;i?m<=u.maxSizeTop.height?(p=!0,w=u.maxSizeTop):(p=!1,w=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,w=u.maxSizeBottom):(p=!0,w=u.maxSizeTop);let{top:b,left:C}=u;!p&&m>e.height&&(b=f-m);const y=this._editor.getDomNode();if(y){const S=y.getBoundingClientRect();b-=S.top,C-=S.left}this._applyTopLeft({left:C,top:b}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=w,this._resizable.layout(m,Math.min(w.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const yPt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function lI(n,e,t,i,s){if($e.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(P.isUri(s))return[];const o=i===Ic.ROOT_FOLDER?["rootfolder-icon"]:i===Ic.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===_e.data)r=h1.parseMetaData(t).get(h1.META_DATA_LABEL);else{const a=t.path.match(yPt);a?(r=TK(a[2].toLowerCase()),a[1]&&o.push(`${TK(a[1].toLowerCase())}-name-dir-icon`)):r=TK(t.authority.toLowerCase())}if(i===Ic.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===Ic.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const c=r.split(".");for(let l=1;l{const w=this._editor.getOptions(),b=w.get(x.fontInfo),C=b.getMassagedFontFamily(),y=b.fontFeatureSettings,S=w.get(x.suggestFontSize)||b.fontSize,M=w.get(x.suggestLineHeight)||b.lineHeight,k=b.fontWeight,F=b.letterSpacing,N=`${S}px`,z=`${M}px`,U=`${F}px`;i.style.fontSize=N,i.style.fontWeight=k,i.style.letterSpacing=U,a.style.fontFamily=C,a.style.fontFeatureSettings=y,a.style.lineHeight=z,s.style.height=z,s.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.root.id=ltt(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Cz(e.score)},r=[];if(s.kind===Ne.Color&&EPt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===Ne.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Ic.FILE),c=lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Ic.FILE);o.extraClasses=a.length>c.length?a:c}else s.kind===Ne.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[lI(this._modelService,this._languageService,P.from({scheme:"fake",path:e.textLabel}),Ic.FOLDER),lI(this._modelService,this._languageService,P.from({scheme:"fake",path:s.detail}),Ic.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...$e.asClassNameArray(E9.toIcon(s.kind))));s.tags&&s.tags.indexOf(TU.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=ope(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=ope(s.label.detail||""),i.detailsLabel.textContent=ope(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Oh(i.detailsLabel):Jl(i.detailsLabel),ZPe(e)?(i.right.classList.add("can-expand-details"),Oh(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Jl(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};kye=D([_(1,Ai),_(2,Di),_(3,pn)],kye);function ope(n){return n.replace(/\r\n|\r|\n/g,"")}var bB;const $g="vs/editor/contrib/suggest/browser/suggestWidget";B("editorSuggestWidget.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g($g,0,"Background color of the suggest widget."));B("editorSuggestWidget.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g($g,1,"Border color of the suggest widget."));const RK=B("editorSuggestWidget.foreground",{dark:Mc,light:Mc,hcDark:Mc,hcLight:Mc},g($g,2,"Foreground color of the suggest widget."));B("editorSuggestWidget.selectedForeground",{dark:zk,light:zk,hcDark:zk,hcLight:zk},g($g,3,"Foreground color of the selected entry in the suggest widget."));B("editorSuggestWidget.selectedIconForeground",{dark:JB,light:JB,hcDark:JB,hcLight:JB},g($g,4,"Icon foreground color of the selected entry in the suggest widget."));const xPt=B("editorSuggestWidget.selectedBackground",{dark:$k,light:$k,hcDark:$k,hcLight:$k},g($g,5,"Background color of the selected entry in the suggest widget."));B("editorSuggestWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g($g,6,"Color of the match highlights in the suggest widget."));B("editorSuggestWidget.focusHighlightForeground",{dark:Dj,light:Dj,hcDark:Dj,hcLight:Dj},g($g,7,"Color of the match highlights in the suggest widget when an item is focused."));B("editorSuggestWidgetStatus.foreground",{dark:Ie(RK,.5),light:Ie(RK,.5),hcDark:Ie(RK,.5),hcLight:Ie(RK,.5)},g($g,8,"Foreground color of the suggest widget status."));var An;(function(n){n[n.Hidden=0]="Hidden",n[n.Loading=1]="Loading",n[n.Empty=2]="Empty",n[n.Open=3]="Open",n[n.Frozen=4]="Frozen",n[n.Details=5]="Details"})(An||(An={}));class DPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof oC}`}restore(){const e=this._service.get(this._key,ke.PROFILE)??"";try{const t=JSON.parse(e);if(Tn.is(t))return Tn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),ke.PROFILE,ln.MACHINE)}reset(){this._service.remove(this._key,ke.PROFILE)}}var h0;let Iye=(h0=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=An.Hidden,this._isAuto=!1,this._pendingLayout=new Dn,this._pendingShowDetails=new Dn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new O_,this._disposables=new Z,this._onDidSelect=new r1,this._onDidFocus=new r1,this._onDidHide=new I,this._onDidShow=new I,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new I,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new XPe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new kPt(this,e),this._persistedSize=new DPt(t,e);class r{constructor(f,p,m=!1,v=!1){this.persistedSize=f,this.currentSize=p,this.persistHeight=m,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:f,defaultSize:p}=this.getLayoutInfo(),m=Math.round(f/2);let{width:v,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=m)&&(w=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new Tn(v,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=he(this.element.domNode,we(".message")),this._listElement=he(this.element.domNode,we(".tree"));const c=this._disposables.add(o.createInstance(Dye,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new CPt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(kye,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Pc("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>g($g,11,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:w,description:b}=u.completion.label;w&&b?f=g($g,12,"{0} {1}, {2}",f,w,b):w?f=g($g,13,"{0} {1}",f,w):b&&(f=g($g,14,"{0}, {1}",f,b))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=r_("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g($g,15,"{0}, docs: {1}",f,v)}}}),this._list.style(CO({listInactiveFocusBackground:xPt,listInactiveFocusOutline:co})),this._status=o.createInstance(xye,this.element.domNode,FI);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(s.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.suggest)&&(h(),l()),this._completionModel&&(u.hasChanged(x.fontInfo)||u.hasChanged(x.suggestFontSize)||u.hasChanged(x.suggestLineHeight))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=qi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=qi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=qi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=qi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Xo(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==An.Hidden&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=pS(e.type)?2:1}_onListFocus(e){if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=na(async s=>{const o=PS(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=s.onCancellationRequested(()=>o.dispose());try{return await t.resolve(s)}finally{o.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:ltt(i)}))}).catch(bt)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===An.Frozen),this.element.domNode.classList.remove("message"),e){case An.Hidden:Jl(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case An.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.LOADING_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.LOADING_MESSAGE);break;case An.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=bB.NO_SUGGESTIONS_MESSAGE,Jl(this._listElement,this._status.element),Oh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Cu(bB.NO_SUGGESTIONS_MESSAGE);break;case An.Open:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Frozen:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._show();break;case An.Details:Jl(this._messageElement),Oh(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===An.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=PS(()=>this._setState(An.Loading),t)))}showSuggestions(e,t,i,s,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==An.Empty&&this._state!==An.Hidden){this._setState(An.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(s?An.Hidden:An.Empty),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?An.Frozen:An.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=wZ(gt(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageDown(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollBottom(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.pageUp(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case An.Hidden:return!1;case An.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case An.Hidden:return!1;case An.Details:return this._details.widget.scrollTop(),!0;case An.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==An.Hidden&&this._state!==An.Empty&&this._state!==An.Loading&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===An.Details?(this._setState(An.Open),this._details.widget.domNode.classList.remove("focused")):this._state===An.Open&&this._isDetailsVisible()&&(this._setState(An.Details),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(ZPe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===An.Open||this._state===An.Details||this._state===An.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=wZ(gt(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(An.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(o=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=ia(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,f=Math.min(t.height-u-i.verticalPadding,c),p=d.top+h.top-i.verticalPadding,m=Math.min(p,c);let v=Math.min(Math.max(m,f)+i.borderHeight,c);s===this._cappedHeight?.capped&&(s=this._cappedHeight.wanted),sv&&(s=v),s>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(hs.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(hs.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new Tn(a,i.defaultSize.height),this.element.maxSize=new Tn(r,v),this.element.minSize=new Tn(220,l),this._cappedHeight=s===c?{wanted:this._cappedHeight?.wanted??e.height,capped:s}:void 0}this._resize(o,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===hs.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Dc(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===An.Empty||this._state===An.Loading?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Tn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",ke.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,ke.PROFILE,ln.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},bB=h0,h0.LOADING_MESSAGE=g($g,9,"Loading..."),h0.NO_SUGGESTIONS_MESSAGE=g($g,10,"No suggestions."),h0);Iye=bB=D([_(1,on),_(2,Pe),_(3,pn),_(4,be)],Iye);class kPt{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Tn(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var Lye;const CS="vs/editor/contrib/suggest/browser/suggestController";class IPt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Kt.register({description:"suggest-line-suffix",stickiness:gi.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(O.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var Pd;(function(n){n[n.None=0]="None",n[n.NoBeforeUndoStop=1]="NoBeforeUndoStop",n[n.NoAfterUndoStop=2]="NoAfterUndoStop",n[n.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",n[n.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Pd||(Pd={}));var mN;let pm=(mN=class{static get(e){return e.getContribution(Lye.ID)}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Dn,this._toDispose=new Z,this._selectors=new LPt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(Mte,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=qi.InsertMode.bindTo(s);c.set(e.getOption(x.suggest).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>c.set(e.getOption(x.suggest).insertMode))),this.widget=this._toDispose.add(new d$(gt(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(Iye,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Pd.None),this));const u=new fPt(this.editor,h,this.model,v=>this._insertSuggestion(v,Pd.NoAfterUndoStop));this._toDispose.add(u);const f=qi.MakesTextEdit.bindTo(this._contextKeyService),p=qi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=qi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const w=this.editor.getPosition(),b=v.editStart.column,C=w.column;let y=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===OI.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&cp.InsertAsSnippet)&&C-b===v.completion.insertText.length&&(y=this.editor.getModel().getValueInRange({startLineNumber:w.lineNumber,startColumn:b,endLineNumber:w.lineNumber,endColumn:C})!==v.completion.insertText),f.set(y),p.set(!oe.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new RS(!0,!1,!1,!1,E.KeyC))||ei&&v.toKeyCodeChord().equals(new RS(!1,!1,!1,!0,E.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new Eye(this.editor,this.model)))),this._alternatives=this._toDispose.add(new d$(gt(e.getDomNode()),()=>this._toDispose.add(new bV(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Lte,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new IPt(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const p of this._selectors.itemsOrderedByPriorityDesc)if(u=p.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===OI.Idle)return;let f=!1;if(h.triggerOptions.auto){const p=this.editor.getOption(x.suggest);p.selectionMode==="never"||p.selectionMode==="always"?f=p.selectionMode==="never":p.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==tf.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===tf.TriggerCharacter&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const l=qi.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(x.acceptSuggestionOnEnter);l.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=mc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],c=new ai;t&Pd.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Pd.AlternativeOverwriteConfig));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=M_.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=O.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const w=this.editor.getPosition().column-r.position.column,b=w,C=O.spansMultipleLines(v)?0:w;v=new O(v.startLineNumber,v.startColumn+b,v.endLineNumber,v.endColumn+C)}return ds.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new ao;let m;const v=s.onDidChangeContent(y=>{if(y.isFlush){c.cancel(),v.dispose();return}for(const S of y.changes){const M=O.getEndPosition(S.range);(!m||oe.isBefore(M,m))&&(m=M)}}),w=t;t|=Pd.NoAfterUndoStop;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,w&Pd.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(r.resolve(c.token).then(()=>{if(!r.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(S=>oe.isBefore(m,O.getStartPosition(S.range))))return!1;b&&this.editor.pushUndoStop();const y=M_.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(S=>ds.replaceMove(O.lift(S.range),S.text))),y.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(w&Pd.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(y=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),y),u=y===!0?1:y===!1?0:-2}).finally(()=>{v.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&cp.InsertAsSnippet||(f=ww.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&cp.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Pd.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===Nte.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new ao;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?er(m):bt(m)}).finally(()=>{h=p.elapsed()}))}t&Pd.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(p,Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop|(t&Pd.AlternativeOverwriteConfig?Pd.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o){Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Ed(ui(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:uz(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,t){Bt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(mo(e.completion.additionalTextEdits)){const t=g(CS,0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);sa(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),vt.Smooth),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&cp.InsertAsSnippet||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,c=r.column;return c-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:c})!==o.completion.insertText};T.once(this.model.onDidTrigger)(o=>{const r=[];T.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{St(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(St(r),a.items.length===0){i();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),l=a.items[c];if(!s(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Pd.KeepAlternativeSuggestions|Pd.NoBeforeUndoStop|Pd.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,vt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=Pd.KeepAlternativeSuggestions),t&&(s|=Pd.AlternativeOverwriteConfig),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}},Lye=mN,mN.ID="editor.contrib.suggestController",mN);pm=Lye=D([_(1,ghe),_(2,ji),_(3,Pe),_(4,be),_(5,Ze),_(6,rn)],pm);class LPt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const jae=class jae extends lt{constructor(){super({id:jae.id,label:g(CS,1,"Trigger Suggest"),alias:"Trigger Suggest",precondition:ge.and(X.writable,X.hasCompletionItemProvider,qi.Visible.toNegated()),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.Alt|E.Escape,V.CtrlCmd|E.KeyI]},weight:ye.EditorContrib}})}run(e,t,i){const s=pm.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}};jae.id="editor.action.triggerSuggest";let Nte=jae;vn(pm.ID,pm,mi.BeforeFirstInteraction);Fe(Nte);const km=ye.EditorContrib+90,yg=Jc.bindToContribution(pm.get);Ke(new yg({id:"acceptSelectedSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:E.Tab,kbExpr:ge.and(qi.Visible,X.textInputFocus),weight:km},{primary:E.Enter,kbExpr:ge.and(qi.Visible,X.textInputFocus,qi.AcceptSuggestionsOnEnter,qi.MakesTextEdit),weight:km}],menuOpts:[{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:qi.HasInsertAndReplaceRange.toNegated()},{menuId:FI,title:g(CS,2,"Insert"),group:"left",order:1,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("insert"))},{menuId:FI,title:g(CS,3,"Replace"),group:"left",order:1,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("replace"))}]}));Ke(new yg({id:"acceptAlternativeSelectedSuggestion",precondition:ge.and(qi.Visible,X.textInputFocus,qi.HasFocusedSuggestion),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.Shift|E.Enter,secondary:[V.Shift|E.Tab]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:FI,group:"left",order:2,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("insert")),title:g(CS,3,"Replace")},{menuId:FI,group:"left",order:2,when:ge.and(qi.HasInsertAndReplaceRange,qi.InsertMode.isEqualTo("replace")),title:g(CS,2,"Insert")}]}));yt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ke(new yg({id:"hideSuggestWidget",precondition:qi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new yg({id:"selectNextSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}}));Ke(new yg({id:"selectNextPageSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.PageDown,secondary:[V.CtrlCmd|E.PageDown]}}));Ke(new yg({id:"selectLastSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Ke(new yg({id:"selectPrevSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new yg({id:"selectPrevPageSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.PageUp,secondary:[V.CtrlCmd|E.PageUp]}}));Ke(new yg({id:"selectFirstSuggestion",precondition:ge.and(qi.Visible,ge.or(qi.MultipleSuggestions,qi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Ke(new yg({id:"focusSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}}}));Ke(new yg({id:"focusAndAcceptSuggestion",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Ke(new yg({id:"toggleSuggestionDetails",precondition:ge.and(qi.Visible,qi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Space,secondary:[V.CtrlCmd|E.KeyI],mac:{primary:V.WinCtrl|E.Space,secondary:[V.CtrlCmd|E.KeyI]}},menuOpts:[{menuId:FI,group:"right",order:1,when:ge.and(qi.DetailsVisible,qi.CanResolve),title:g(CS,4,"show less")},{menuId:FI,group:"right",order:1,when:ge.and(qi.DetailsVisible.toNegated(),qi.CanResolve),title:g(CS,5,"show more")}]}));Ke(new yg({id:"toggleExplainMode",precondition:qi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Slash}}));Ke(new yg({id:"toggleSuggestionFocus",precondition:qi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Alt|E.Space,mac:{primary:V.WinCtrl|V.Alt|E.Space}}}));Ke(new yg({id:"insertBestCompletion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),Lte.AtEnd,qi.Visible.toNegated(),bV.OtherSuggestions.toNegated(),mc.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(fo(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:km,primary:E.Tab}}));Ke(new yg({id:"insertNextSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,qi.Visible.toNegated(),mc.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:E.Tab}}));Ke(new yg({id:"insertPrevSuggestion",precondition:ge.and(X.textInputFocus,ge.equals("config.editor.tabCompletion","on"),bV.OtherSuggestions,qi.Visible.toNegated(),mc.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:km,kbExpr:X.textInputFocus,primary:V.Shift|E.Tab}}));Fe(class extends lt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(CS,6,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){pm.get(e)?.resetWidgetSize()}});class TPt extends ${get selectedItem(){return this._selectedItem}constructor(e,t,i,s){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=xi(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=pm.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(c,l,d)=>{En(w=>this.checkModelVersion(w));const h=this.editor.getModel();if(!h)return-1;const u=this.suggestControllerPreselector(),f=u?wM(u,h):void 0;if(!f)return-1;const p=oe.lift(l),m=d.map((w,b)=>{const C=K$.fromSuggestion(o,h,p,w,this.isShiftKeyPressed),y=wM(C.toSingleTextEdit(),h),S=ttt(f,y);return{index:b,valid:S,prefixLength:y.text.length,suggestItem:w}}).filter(w=>w&&w.valid&&w.prefixLength>0),v=MRe(m,El(w=>w.prefixLength,cg));return v?v.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(T.once(o.model.onDidTrigger)(c=>{a()})),this._register(o.onWillInsertSuggestItem(c=>{const l=this.editor.getPosition(),d=this.editor.getModel();if(!l||!d)return;const h=K$.fromSuggestion(o,d,l,c.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!RPt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,En(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=pm.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return K$.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){pm.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){pm.get(this.editor)?.forceRenderingAbove()}}class K${static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&cp.InsertAsSnippet){const l=new ww().parse(r);l.children.length<100&&Ite.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(s,o);return new K$(O.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new OQe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new ug(this.range,this.insertText)}}function RPt(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var Tye;const MPt="vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController";var _N;let _g=(_N=class extends ${static get(e){return e.getContribution(Tye.ID)}constructor(e,t,i,s,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this.model=this._register(_7("inlineCompletionModel",void 0)),this._textModelVersionId=xi(this,-1),this._positions=Uxt({owner:this,equalsFn:fbe(PJe())},[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new TPt(this.editor,()=>this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0),m=>this.updateObservables(m,Bp.Other),m=>{En(v=>{this.updateObservables(v,Bp.Other),this.model.get()?.handleSuggestAccepted(m)})})),this._enabledInConfig=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Wn(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Wn(this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Dt(this,m=>this._enabledInConfig.read(m)&&(!this._isScreenReaderEnabled.read(m)||!this._editorDictationInProgress.read(m))),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._ghostTexts=Dt(this,m=>this.model.read(m)?.ghostTexts.read(m)??[]),this._stablizedGhostTexts=NPt(this._ghostTexts,this._store),this._ghostTextWidgets=yee(this,this._stablizedGhostTexts,(m,v)=>v.add(this._instantiationService.createInstance(hye,this.editor,{ghostText:m,minReservedLineCount:Au(0),targetTextModel:this.model.map(w=>w?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=oL(this),this._isReadonly=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._textModel=Wn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=Dt(m=>this._isReadonly.read(m)?void 0:this._textModel.read(m)),this._register(new af(this._contextKeyService,this.model)),this._register(Ni(m=>{const v=this._textModelIfWritable.read(m);En(w=>{if(this.model.set(void 0,w),this.updateObservables(w,Bp.Other),v){const b=t.createInstance(Cye,v,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).preview),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.suggest).previewMode),Wn(e.onDidChangeConfiguration,()=>e.getOption(x.inlineSuggest).mode),this._enabled);this.model.set(b,w)}})}));const h=this._register(uje());this._register(Ni(m=>{const v=this._fontFamily.read(m);h.setStyle(v===""||v==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${v}; -}`)}));const u=m=>m.isUndoing?Bp.Undo:m.isRedoing?Bp.Redo:this.model.get()?.isAcceptingPartially?Bp.AcceptWord:Bp.Other;this._register(e.onDidChangeModelContent(m=>En(v=>this.updateObservables(v,u(m))))),this._register(e.onDidChangeCursorPosition(m=>En(v=>{this.updateObservables(v,Bp.Other),(m.reason===Wi.Explicit||m.source==="api")&&this.model.get()?.stop(v)}))),this._register(e.onDidType(()=>En(m=>{this.updateObservables(m,Bp.Other),this._enabled.get()&&this.model.get()?.trigger(m)}))),this._register(this._commandService.onDidExecuteCommand(m=>{new Set([TW.Tab.id,TW.DeleteLeft.id,TW.DeleteRight.id,Qet,"acceptSelectedSuggestion"]).has(m.commandId)&&e.hasTextFocus()&&this._enabled.get()&&En(w=>{this.model.get()?.trigger(w)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||vV.dropDownVisible||En(m=>{this.model.get()?.stop(m)})})),this._register(Ni(m=>{const v=this.model.read(m)?.state.read(m);v?.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const f=this._register(new Z);let p;this._register(Az({handleChange:(m,v)=>(m.didChange(this._playAccessibilitySignal)&&(p=void 0),!0)},async(m,v)=>{this._playAccessibilitySignal.read(m);const w=this.model.read(m),b=w?.state.read(m);if(!w||!b||!b.inlineCompletion){p=void 0;return}if(b.inlineCompletion.semanticId!==p){f.clear(),p=b.inlineCompletion.semanticId;const C=w.textModel.getLineContent(b.primaryGhostText.lineNumber);await Ta(50,qBe(f)),await U$(this._suggestWidgetAdaptor.selectedItem,ll,()=>!1,qBe(f)),await this._accessibilitySignalService.playSignal(Zl.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.provideScreenReaderUpdate(b.primaryGhostText.renderForScreenReader(C))}})),this._register(new uye(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(s=g(MPt,0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),sa(s?e+", "+s:e)}updateObservables(e,t){const i=this.editor.getModel();this._textModelVersionId.set(i?.getVersionId()??-1,e,t),this._positions.set(this.editor.getSelections()?.map(s=>s.getPosition())??[new oe(1,1)],e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new oe(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){En(e=>{this.model.get()?.stop(e)})}},Tye=_N,_N.ID="editor.contrib.inlineCompletionsController",_N);_g=Tye=D([_(1,be),_(2,Pe),_(3,Re),_(4,Qi),_(5,B_),_(6,ht),_(7,Lw),_(8,ti),_(9,Ur)],_g);function NPt(n,e){const t=xi("result",[]),i=[];return e.add(Ni(s=>{const o=n.read(s);En(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const pC="vs/workbench/contrib/accessibility/browser/accessibleViewActions",BQ={id:Te.AccessibleView,group:"navigation",when:Dm},WQ={id:Te.CommandPalette,group:"",order:1};class PPt extends pi{constructor(){super({id:Ru.ShowNext,precondition:ge.and(Dm,yte),keybinding:{primary:V.Alt|E.BracketRight,weight:ye.WorkbenchContrib},menu:[WQ,{...BQ,when:ge.and(Dm,yte)}],icon:Ce.arrowDown,title:g(pC,0,"Show Next in Accessible View")})}run(e){e.get(Tw).next()}}At(PPt);class FPt extends pi{constructor(){super({id:Ru.NextCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageDown,mac:{primary:V.CtrlCmd|V.Alt|E.PageDown},weight:ye.WorkbenchContrib},icon:Ce.arrowRight,menu:{...BQ,when:ge.and(Dm,Ate)},title:g(pC,1,"Accessible View: Next Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("next")}}At(FPt);class OPt extends pi{constructor(){super({id:Ru.PreviousCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageUp,mac:{primary:V.CtrlCmd|V.Alt|E.PageUp},weight:ye.WorkbenchContrib},icon:Ce.arrowLeft,menu:{...BQ,when:ge.and(Dm,Ate)},title:g(pC,2,"Accessible View: Previous Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("previous")}}At(OPt);class BPt extends pi{constructor(){super({id:Ru.ShowPrevious,precondition:ge.and(Dm,yte),keybinding:{primary:V.Alt|E.BracketLeft,weight:ye.WorkbenchContrib},icon:Ce.arrowUp,menu:[WQ,{...BQ,when:ge.and(Dm,yte)}],title:g(pC,3,"Show Previous in Accessible View")})}run(e){e.get(Tw).previous()}}At(BPt);class WPt extends pi{constructor(){super({id:Ru.GoToSymbol,precondition:ge.and(ge.or(Dm,T1),ZVe),keybinding:{primary:V.CtrlCmd|V.Shift|E.KeyO,secondary:[V.CtrlCmd|V.Shift|E.Period],weight:ye.WorkbenchContrib+10},icon:Ce.symbolField,menu:[WQ,{...BQ,when:ge.and(ge.or(Dm,T1),ZVe)}],title:g(pC,4,"Go To Symbol in Accessible View")})}run(e){e.get(Tw).goToSymbol()}}At(WPt);function dtt(n){return n.register(),n}dtt(new Z1({id:Ru.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:V.Alt|E.F1,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F1,secondary:[V.Alt|E.F1]},kbExpr:T1.toNegated()},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,5,"Open Accessibility Help"),order:1}]}));const HPt=dtt(new Z1({id:Ru.OpenAccessibleView,precondition:void 0,kbOpts:{primary:V.Alt|E.F2,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F2,secondary:[V.Alt|E.F2]}},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,6,"Open Accessible View"),order:1}]}));class UPt extends pi{constructor(){super({id:Ru.DisableVerbosityHint,precondition:ge.and(ge.or(Dm,T1),XVe),keybinding:{primary:V.Alt|E.F6,weight:ye.WorkbenchContrib},icon:Ce.bellSlash,menu:[WQ,{id:Te.AccessibleView,group:"navigation",when:ge.and(ge.or(Dm,T1),XVe)}],title:g(pC,7,"Disable Accessible View Hint")})}run(e){e.get(Tw).disableHint()}}At(UPt);class VPt extends pi{constructor(){super({id:Ru.AccessibilityHelpConfigureKeybindings,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyK,weight:ye.WorkbenchContrib},title:g(pC,8,"Accessibility Help Configure Keybindings")})}async run(e){await e.get(Tw).configureKeybindings()}}At(VPt);class zPt extends pi{constructor(){super({id:Ru.AccessibilityHelpOpenHelpLink,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyH,weight:ye.WorkbenchContrib},title:g(pC,9,"Accessibility Help Open Help Link")})}run(e){e.get(Tw).openHelpLink()}}At(zPt);class $Pt extends pi{constructor(){super({id:Ru.AccessibleViewAcceptInlineCompletion,precondition:ge.and(Dm,ge.equals(Ste.key,rC.InlineCompletions)),keybinding:{primary:V.CtrlCmd|E.Slash,mac:{primary:V.WinCtrl|E.Slash},weight:ye.WorkbenchContrib},icon:Ce.check,menu:[WQ,{id:Te.AccessibleView,group:"navigation",order:0,when:ge.and(Dm,ge.equals(Ste.key,rC.InlineCompletions))}],title:g(pC,10,"Accept Inline Completion")})}async run(e){const t=e.get(Qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const s=_g.get(i)?.model.get(),o=s?.state.get();!s||!o||(await s.accept(i),s.stop(),i.focus())}}At($Pt);const Mm="vs/workbench/contrib/chat/common/chatContextKeys",A4e=new Y("chatSessionResponseVote","",{type:"string",description:g(Mm,0,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),GPt=new Y("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(Mm,1,"When the agent or command was automatically detected")}),qPt=new Y("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(Mm,2,"True when the current chat response supports issue reporting.")}),htt=new Y("chatSessionResponseFiltered",!1,{type:"boolean",description:g(Mm,3,"True when the chat response was filtered out by the server.")}),j7=new Y("chatSessionRequestInProgress",!1,{type:"boolean",description:g(Mm,4,"True when the current request is still in progress.")}),QPt=new Y("chatResponse",!1,{type:"boolean",description:g(Mm,5,"The chat item is a response.")}),jPt=new Y("chatRequest",!1,{type:"boolean",description:g(Mm,6,"The chat item is a request")}),KPt=new Y("chatEditApplied",!1,{type:"boolean",description:g(Mm,7,"True when the chat text edits have been applied.")}),eFe=new Y("chatInputHasText",!1,{type:"boolean",description:g(Mm,8,"True when the chat input has text.")}),YPt=new Y("chatInputHasFocus",!1,{type:"boolean",description:g(Mm,9,"True when the chat input has focus.")}),tFe=new Y("inChatInput",!1,{type:"boolean",description:g(Mm,10,"True when focus is in the chat input, false otherwise.")}),JPt=new Y("inChat",!1,{type:"boolean",description:g(Mm,11,"True when focus is in the chat widget, false otherwise.")}),utt=new Y("chatIsEnabled",!1,{type:"boolean",description:g(Mm,12,"True when chat is enabled because a default chat participant is registered.")}),XPt=new Y("chatCursorAtTop",!1),gtt=new Y("chatInputHasAgent",!1),ZPt=new Y("chatLocation",void 0),eFt=new Y("quickChatHasFocus",!1,{type:"boolean",description:g(Mm,13,"True when the quick chat UI has focus, false otherwise.")});var tFt=".monaco-editor .editor-dictation-widget{align-items:center;background-color:var(--vscode-editor-background);border-radius:8px;box-shadow:0 4px 8px var(--vscode-widget-shadow);display:flex;line-height:var(--vscode-editor-dictation-widget-height);max-width:var(--vscode-editor-dictation-widget-width);min-height:var(--vscode-editor-dictation-widget-height);padding:2px;z-index:1000}.monaco-editor .editor-dictation-widget.recording .codicon.codicon-mic-filled{animation:editor-dictation-animation 1s infinite;color:var(--vscode-activityBarBadge-background)}@keyframes editor-dictation-animation{0%{color:var(--vscode-editorCursor-background)}50%{color:var(--vscode-activityBarBadge-background)}to{color:var(--vscode-editorCursor-background)}}";Ct(tFt,{});var TJ;const K7="vs/workbench/contrib/codeEditor/browser/dictation/editorDictation",ftt=new Y("editorDictation.inProgress",!1),ptt=Be(K7,0,"Voice");class iFt extends wf{constructor(){super({id:"workbench.action.editorDictation.start",title:Be(K7,1,"Start Dictation in Editor"),category:ptt,precondition:ge.and(vNt,wNt.toNegated(),X.readOnly.toNegated()),f1:!0,keybinding:{primary:V.CtrlCmd|V.Alt|E.KeyV,weight:ye.WorkbenchContrib,secondary:Is?[V.Alt|E.Backquote]:void 0}})}runEditorCommand(e,t){const s=e.get(ti).enableKeybindingHoldMode(this.desc.id);if(s){let o=!1;const r=setTimeout(()=>{o=!0},500);s.finally(()=>{clearTimeout(r),o&&qS.get(t)?.stop()})}qS.get(t)?.start()}}const Kae=class Kae extends wf{constructor(){super({id:Kae.ID,title:Be(K7,2,"Stop Dictation in Editor"),category:ptt,precondition:ftt,f1:!0,keybinding:{primary:E.Escape,weight:ye.WorkbenchContrib+100}})}runEditorCommand(e,t){qS.get(t)?.stop()}};Kae.ID="workbench.action.editorDictation.stop";let Y7=Kae;class nFt extends ${constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new Qh(this.domNode)),s=t.lookupKeybinding(Y7.ID)?.getLabel();i.push(_l({id:Y7.ID,label:s?g(K7,3,"Stop Dictation ({0})",s):g(K7,4,"Stop Dictation"),class:$e.asClassName(Ce.micFilled),run:()=>qS.get(e)?.stop()}),{icon:!0,label:!1,keybinding:s}),this.domNode.classList.add("editor-dictation-widget"),this.domNode.appendChild(i.domNode)}getId(){return"editorDictation"}getDomNode(){return this.domNode}getPosition(){if(!this.editor.hasModel())return null;const e=this.editor.getSelection();return{position:e.getPosition(),preference:[e.getPosition().equals(e.getStartPosition())?hs.ABOVE:hs.BELOW,hs.EXACT]}}beforeRender(){const e=this.editor.getOption(x.lineHeight),t=this.editor.getLayoutInfo().contentWidth*.7;return this.domNode.style.setProperty("--vscode-editor-dictation-widget-height",`${e}px`),this.domNode.style.setProperty("--vscode-editor-dictation-widget-width",`${t}px`),null}show(){this.editor.addContentWidget(this)}layout(){this.editor.layoutContentWidget(this)}active(){this.domNode.classList.add("recording")}hide(){this.domNode.classList.remove("recording"),this.editor.removeContentWidget(this)}}var vN;let qS=(vN=class extends ${static get(e){return e.getContribution(TJ.ID)}constructor(e,t,i,s){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=s,this.widget=this._register(new nFt(this.editor,this.keybindingService)),this.editorDictationInProgress=ftt.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new Dn)}async start(){const e=new Z;this.sessionDisposables.value=e,this.widget.show(),e.add(Ee(()=>this.widget.hide())),this.editorDictationInProgress.set(!0),e.add(Ee(()=>this.editorDictationInProgress.reset()));const t=this.editor.createDecorationsCollection();e.add(Ee(()=>t.clear())),e.add(this.editor.onDidChangeCursorPosition(()=>this.widget.layout()));let i,s=0;const o=(c,l)=>{i||(i=ws(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(TJ.ID,[ds.replace(O.fromPositions(i,i.with(void 0,i.column+s)),c)],[mt.fromPositions(d)]),l?t.set([{range:O.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),s=c.length,l||(i=void 0,s=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ai;e.add(Ee(()=>r.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(r.token,"editor");e.add(a.onDidChange(c=>{if(!r.token.isCancellationRequested)switch(c.status){case l2.Started:this.widget.active();break;case l2.Stopped:e.dispose();break;case l2.Recognizing:{if(!c.text)return;o(c.text,!0);break}case l2.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},TJ=vN,vN.ID="editorDictation",vN);qS=TJ=D([_(1,Xde),_(2,Pe),_(3,ti)],qS);vn(qS.ID,qS,mi.Lazy);At(iFt);At(Y7);var Rye;const xC="vs/editor/contrib/contextmenu/browser/contextmenu";var wN;let QS=(wN=class{static get(e){return e.getContribution(Rye.ID)}constructor(e,t,i,s,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=c,this._toDispose=new Z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=l.srcElement;h.shadowRoot&&cF(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===E.ContextMenu&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(x.contextmenu)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===Mt.OVERLAY_WIDGET||e.target.type===Mt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Mt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Mt.CONTENT_TEXT&&e.target.type!==Mt.CONTENT_EMPTY&&e.target.type!==Mt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Mt.TEXTAREA&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(x.contextmenu)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const r of o){const[,a]=r;let c=0;for(const l of a)if(l instanceof uS){const d=this._getMenuActions(e,l.item.submenu);d.length>0&&(i.push(new u1(l.id,l.label,d)),c++)}else i.push(l),c++;c&&i.push(new Kr)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(x.hover);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),vt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ia(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;s={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new WS(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new WS(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||rxt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const s=l=>({id:`menu-action-${++i}`,label:l.label,tooltip:"",class:void 0,enabled:typeof l.enabled>"u"?!0:l.enabled,checked:l.checked,run:l.run}),o=(l,d)=>new u1(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return s({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(s({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(s({label:g(xC,0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Kr),a.push(s({label:g(xC,1,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(xC,2,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(xC,3,"Proportional"),value:"proportional"},{label:g(xC,4,"Fill"),value:"fill"},{label:g(xC,5,"Fit"),value:"fit"}])),a.push(r(g(xC,6,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(xC,7,"Mouse Over"),value:"mouseover"},{label:g(xC,8,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:c?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:l=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},Rye=wN,wN.ID="editor.contrib.contextmenu",wN);QS=Rye=D([_(1,Vr),_(2,W_),_(3,Pe),_(4,ti),_(5,mc),_(6,Re),_(7,Ti)],QS);class sFt extends lt{constructor(){super({id:"editor.action.showContextMenu",label:g(xC,9,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|E.F10,weight:ye.EditorContrib}})}run(e,t){QS.get(t)?.showContextMenu()}}vn(QS.ID,QS,mi.BeforeFirstInteraction);Fe(sFt);const rpe="vs/workbench/contrib/snippets/browser/snippetsFile";class oFt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new ww().parse(e,!1),i=new Map;let s=0;for(const r of t.placeholders)s=Math.max(s,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(s===0){const r=Mf(t.children);this.isTrivial=r instanceof ep&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof wV){if(r.children.length===0&&!cPt[r.name]){const a=i.has(r.name)?i.get(r.name):++s;i.set(r.name,a);const c=new ep(a).appendChild(new Fh(r.name));t.replace(r,[c]),this.isBogous=!0}switch(r.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else o.push(...r.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class iFe{constructor(e,t,i,s,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=s,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=s.toLowerCase(),this._bodyInsights=new d$(ax(),()=>new oFt(this.body))}get codeSnippet(){return this._bodyInsights.value.codeSnippet}get isBogous(){return this._bodyInsights.value.isBogous}get isTrivial(){return this._bodyInsights.value.isTrivial}get needsClipboard(){return this._bodyInsights.value.usesClipboardVariable}get usesSelection(){return this._bodyInsights.value.usesSelectionVariable}}function rFt(n){return fo(n)&&!!n.body}var Yg;(function(n){n[n.User=1]="User",n[n.Workspace=2]="Workspace",n[n.Extension=3]="Extension"})(Yg||(Yg={}));class ape{constructor(e,t,i,s,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=s,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=T_(t.path)===".code-snippets",this.isUserSnippets=!this._extension}select(e,t){this.isGlobalSnippets||!this.isUserSnippets?this._scopeSelect(e,t):this._filepathSelect(e,t)}_filepathSelect(e,t){e+".json"===yr(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const s of this.data){const o=s.scopes.length;if(o===0)t.push(s);else for(let r=0;r=0&&this._scopeSelect(e.substring(0,i),t)}async _load(){return this._extension?this._extensionResourceLoaderService.readExtensionResource(this.location):(await this._fileService.readFile(this.location)).value.toString()}load(){return this._loadPromise||(this._loadPromise=Promise.resolve(this._load()).then(e=>{const t=ow(e);if(HW(t)==="object")for(const[i,s]of Object.entries(t))if(rFt(s))this._parseSnippet(i,s,this.data);else for(const[o,r]of Object.entries(s))this._parseSnippet(o,r,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:s,prefix:o,body:r,description:a}=t;if(o||(o=""),Array.isArray(r)&&(r=r.join(` +}`)}));const u=m=>m.isUndoing?Bp.Undo:m.isRedoing?Bp.Redo:this.model.get()?.isAcceptingPartially?Bp.AcceptWord:Bp.Other;this._register(e.onDidChangeModelContent(m=>En(v=>this.updateObservables(v,u(m))))),this._register(e.onDidChangeCursorPosition(m=>En(v=>{this.updateObservables(v,Bp.Other),(m.reason===Wi.Explicit||m.source==="api")&&this.model.get()?.stop(v)}))),this._register(e.onDidType(()=>En(m=>{this.updateObservables(m,Bp.Other),this._enabled.get()&&this.model.get()?.trigger(m)}))),this._register(this._commandService.onDidExecuteCommand(m=>{new Set([TW.Tab.id,TW.DeleteLeft.id,TW.DeleteRight.id,Qet,"acceptSelectedSuggestion"]).has(m.commandId)&&e.hasTextFocus()&&this._enabled.get()&&En(w=>{this.model.get()?.trigger(w)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||vV.dropDownVisible||En(m=>{this.model.get()?.stop(m)})})),this._register(Ni(m=>{const v=this.model.read(m)?.state.read(m);v?.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const f=this._register(new Z);let p;this._register(Az({handleChange:(m,v)=>(m.didChange(this._playAccessibilitySignal)&&(p=void 0),!0)},async(m,v)=>{this._playAccessibilitySignal.read(m);const w=this.model.read(m),b=w?.state.read(m);if(!w||!b||!b.inlineCompletion){p=void 0;return}if(b.inlineCompletion.semanticId!==p){f.clear(),p=b.inlineCompletion.semanticId;const C=w.textModel.getLineContent(b.primaryGhostText.lineNumber);await Ta(50,qBe(f)),await U$(this._suggestWidgetAdaptor.selectedItem,ll,()=>!1,qBe(f)),await this._accessibilitySignalService.playSignal(Zl.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.provideScreenReaderUpdate(b.primaryGhostText.renderForScreenReader(C))}})),this._register(new uye(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(s=g(MPt,0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),sa(s?e+", "+s:e)}updateObservables(e,t){const i=this.editor.getModel();this._textModelVersionId.set(i?.getVersionId()??-1,e,t),this._positions.set(this.editor.getSelections()?.map(s=>s.getPosition())??[new oe(1,1)],e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new oe(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){En(e=>{this.model.get()?.stop(e)})}},Tye=_N,_N.ID="editor.contrib.inlineCompletionsController",_N);_g=Tye=D([_(1,be),_(2,Pe),_(3,Re),_(4,ji),_(5,B_),_(6,ht),_(7,Lw),_(8,ti),_(9,Ur)],_g);function NPt(n,e){const t=xi("result",[]),i=[];return e.add(Ni(s=>{const o=n.read(s);En(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const pC="vs/workbench/contrib/accessibility/browser/accessibleViewActions",BQ={id:Te.AccessibleView,group:"navigation",when:Dm},WQ={id:Te.CommandPalette,group:"",order:1};class PPt extends pi{constructor(){super({id:Ru.ShowNext,precondition:ge.and(Dm,yte),keybinding:{primary:V.Alt|E.BracketRight,weight:ye.WorkbenchContrib},menu:[WQ,{...BQ,when:ge.and(Dm,yte)}],icon:Ce.arrowDown,title:g(pC,0,"Show Next in Accessible View")})}run(e){e.get(Tw).next()}}At(PPt);class FPt extends pi{constructor(){super({id:Ru.NextCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageDown,mac:{primary:V.CtrlCmd|V.Alt|E.PageDown},weight:ye.WorkbenchContrib},icon:Ce.arrowRight,menu:{...BQ,when:ge.and(Dm,Ate)},title:g(pC,1,"Accessible View: Next Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("next")}}At(FPt);class OPt extends pi{constructor(){super({id:Ru.PreviousCodeBlock,precondition:ge.and(Ate,ge.equals(Ste.key,rC.Chat)),keybinding:{primary:V.CtrlCmd|V.Alt|E.PageUp,mac:{primary:V.CtrlCmd|V.Alt|E.PageUp},weight:ye.WorkbenchContrib},icon:Ce.arrowLeft,menu:{...BQ,when:ge.and(Dm,Ate)},title:g(pC,2,"Accessible View: Previous Code Block")})}run(e){e.get(Tw).navigateToCodeBlock("previous")}}At(OPt);class BPt extends pi{constructor(){super({id:Ru.ShowPrevious,precondition:ge.and(Dm,yte),keybinding:{primary:V.Alt|E.BracketLeft,weight:ye.WorkbenchContrib},icon:Ce.arrowUp,menu:[WQ,{...BQ,when:ge.and(Dm,yte)}],title:g(pC,3,"Show Previous in Accessible View")})}run(e){e.get(Tw).previous()}}At(BPt);class WPt extends pi{constructor(){super({id:Ru.GoToSymbol,precondition:ge.and(ge.or(Dm,T1),ZVe),keybinding:{primary:V.CtrlCmd|V.Shift|E.KeyO,secondary:[V.CtrlCmd|V.Shift|E.Period],weight:ye.WorkbenchContrib+10},icon:Ce.symbolField,menu:[WQ,{...BQ,when:ge.and(ge.or(Dm,T1),ZVe)}],title:g(pC,4,"Go To Symbol in Accessible View")})}run(e){e.get(Tw).goToSymbol()}}At(WPt);function dtt(n){return n.register(),n}dtt(new Z1({id:Ru.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:V.Alt|E.F1,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F1,secondary:[V.Alt|E.F1]},kbExpr:T1.toNegated()},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,5,"Open Accessibility Help"),order:1}]}));const HPt=dtt(new Z1({id:Ru.OpenAccessibleView,precondition:void 0,kbOpts:{primary:V.Alt|E.F2,weight:ye.WorkbenchContrib,linux:{primary:V.Alt|V.Shift|E.F2,secondary:[V.Alt|E.F2]}},menuOpts:[{menuId:Te.CommandPalette,group:"",title:g(pC,6,"Open Accessible View"),order:1}]}));class UPt extends pi{constructor(){super({id:Ru.DisableVerbosityHint,precondition:ge.and(ge.or(Dm,T1),XVe),keybinding:{primary:V.Alt|E.F6,weight:ye.WorkbenchContrib},icon:Ce.bellSlash,menu:[WQ,{id:Te.AccessibleView,group:"navigation",when:ge.and(ge.or(Dm,T1),XVe)}],title:g(pC,7,"Disable Accessible View Hint")})}run(e){e.get(Tw).disableHint()}}At(UPt);class VPt extends pi{constructor(){super({id:Ru.AccessibilityHelpConfigureKeybindings,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyK,weight:ye.WorkbenchContrib},title:g(pC,8,"Accessibility Help Configure Keybindings")})}async run(e){await e.get(Tw).configureKeybindings()}}At(VPt);class zPt extends pi{constructor(){super({id:Ru.AccessibilityHelpOpenHelpLink,precondition:ge.and(T1),keybinding:{primary:V.Alt|E.KeyH,weight:ye.WorkbenchContrib},title:g(pC,9,"Accessibility Help Open Help Link")})}run(e){e.get(Tw).openHelpLink()}}At(zPt);class $Pt extends pi{constructor(){super({id:Ru.AccessibleViewAcceptInlineCompletion,precondition:ge.and(Dm,ge.equals(Ste.key,rC.InlineCompletions)),keybinding:{primary:V.CtrlCmd|E.Slash,mac:{primary:V.WinCtrl|E.Slash},weight:ye.WorkbenchContrib},icon:Ce.check,menu:[WQ,{id:Te.AccessibleView,group:"navigation",order:0,when:ge.and(Dm,ge.equals(Ste.key,rC.InlineCompletions))}],title:g(pC,10,"Accept Inline Completion")})}async run(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const s=_g.get(i)?.model.get(),o=s?.state.get();!s||!o||(await s.accept(i),s.stop(),i.focus())}}At($Pt);const Mm="vs/workbench/contrib/chat/common/chatContextKeys",A4e=new Y("chatSessionResponseVote","",{type:"string",description:g(Mm,0,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),GPt=new Y("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(Mm,1,"When the agent or command was automatically detected")}),qPt=new Y("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(Mm,2,"True when the current chat response supports issue reporting.")}),htt=new Y("chatSessionResponseFiltered",!1,{type:"boolean",description:g(Mm,3,"True when the chat response was filtered out by the server.")}),j7=new Y("chatSessionRequestInProgress",!1,{type:"boolean",description:g(Mm,4,"True when the current request is still in progress.")}),QPt=new Y("chatResponse",!1,{type:"boolean",description:g(Mm,5,"The chat item is a response.")}),jPt=new Y("chatRequest",!1,{type:"boolean",description:g(Mm,6,"The chat item is a request")}),KPt=new Y("chatEditApplied",!1,{type:"boolean",description:g(Mm,7,"True when the chat text edits have been applied.")}),eFe=new Y("chatInputHasText",!1,{type:"boolean",description:g(Mm,8,"True when the chat input has text.")}),YPt=new Y("chatInputHasFocus",!1,{type:"boolean",description:g(Mm,9,"True when the chat input has focus.")}),tFe=new Y("inChatInput",!1,{type:"boolean",description:g(Mm,10,"True when focus is in the chat input, false otherwise.")}),JPt=new Y("inChat",!1,{type:"boolean",description:g(Mm,11,"True when focus is in the chat widget, false otherwise.")}),utt=new Y("chatIsEnabled",!1,{type:"boolean",description:g(Mm,12,"True when chat is enabled because a default chat participant is registered.")}),XPt=new Y("chatCursorAtTop",!1),gtt=new Y("chatInputHasAgent",!1),ZPt=new Y("chatLocation",void 0),eFt=new Y("quickChatHasFocus",!1,{type:"boolean",description:g(Mm,13,"True when the quick chat UI has focus, false otherwise.")});var tFt=".monaco-editor .editor-dictation-widget{align-items:center;background-color:var(--vscode-editor-background);border-radius:8px;box-shadow:0 4px 8px var(--vscode-widget-shadow);display:flex;line-height:var(--vscode-editor-dictation-widget-height);max-width:var(--vscode-editor-dictation-widget-width);min-height:var(--vscode-editor-dictation-widget-height);padding:2px;z-index:1000}.monaco-editor .editor-dictation-widget.recording .codicon.codicon-mic-filled{animation:editor-dictation-animation 1s infinite;color:var(--vscode-activityBarBadge-background)}@keyframes editor-dictation-animation{0%{color:var(--vscode-editorCursor-background)}50%{color:var(--vscode-activityBarBadge-background)}to{color:var(--vscode-editorCursor-background)}}";Ct(tFt,{});var TJ;const K7="vs/workbench/contrib/codeEditor/browser/dictation/editorDictation",ftt=new Y("editorDictation.inProgress",!1),ptt=Be(K7,0,"Voice");class iFt extends wf{constructor(){super({id:"workbench.action.editorDictation.start",title:Be(K7,1,"Start Dictation in Editor"),category:ptt,precondition:ge.and(vNt,wNt.toNegated(),X.readOnly.toNegated()),f1:!0,keybinding:{primary:V.CtrlCmd|V.Alt|E.KeyV,weight:ye.WorkbenchContrib,secondary:Is?[V.Alt|E.Backquote]:void 0}})}runEditorCommand(e,t){const s=e.get(ti).enableKeybindingHoldMode(this.desc.id);if(s){let o=!1;const r=setTimeout(()=>{o=!0},500);s.finally(()=>{clearTimeout(r),o&&qS.get(t)?.stop()})}qS.get(t)?.start()}}const Kae=class Kae extends wf{constructor(){super({id:Kae.ID,title:Be(K7,2,"Stop Dictation in Editor"),category:ptt,precondition:ftt,f1:!0,keybinding:{primary:E.Escape,weight:ye.WorkbenchContrib+100}})}runEditorCommand(e,t){qS.get(t)?.stop()}};Kae.ID="workbench.action.editorDictation.stop";let Y7=Kae;class nFt extends ${constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new Qh(this.domNode)),s=t.lookupKeybinding(Y7.ID)?.getLabel();i.push(_l({id:Y7.ID,label:s?g(K7,3,"Stop Dictation ({0})",s):g(K7,4,"Stop Dictation"),class:$e.asClassName(Ce.micFilled),run:()=>qS.get(e)?.stop()}),{icon:!0,label:!1,keybinding:s}),this.domNode.classList.add("editor-dictation-widget"),this.domNode.appendChild(i.domNode)}getId(){return"editorDictation"}getDomNode(){return this.domNode}getPosition(){if(!this.editor.hasModel())return null;const e=this.editor.getSelection();return{position:e.getPosition(),preference:[e.getPosition().equals(e.getStartPosition())?hs.ABOVE:hs.BELOW,hs.EXACT]}}beforeRender(){const e=this.editor.getOption(x.lineHeight),t=this.editor.getLayoutInfo().contentWidth*.7;return this.domNode.style.setProperty("--vscode-editor-dictation-widget-height",`${e}px`),this.domNode.style.setProperty("--vscode-editor-dictation-widget-width",`${t}px`),null}show(){this.editor.addContentWidget(this)}layout(){this.editor.layoutContentWidget(this)}active(){this.domNode.classList.add("recording")}hide(){this.domNode.classList.remove("recording"),this.editor.removeContentWidget(this)}}var vN;let qS=(vN=class extends ${static get(e){return e.getContribution(TJ.ID)}constructor(e,t,i,s){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=s,this.widget=this._register(new nFt(this.editor,this.keybindingService)),this.editorDictationInProgress=ftt.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new Dn)}async start(){const e=new Z;this.sessionDisposables.value=e,this.widget.show(),e.add(Ee(()=>this.widget.hide())),this.editorDictationInProgress.set(!0),e.add(Ee(()=>this.editorDictationInProgress.reset()));const t=this.editor.createDecorationsCollection();e.add(Ee(()=>t.clear())),e.add(this.editor.onDidChangeCursorPosition(()=>this.widget.layout()));let i,s=0;const o=(c,l)=>{i||(i=ws(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(TJ.ID,[ds.replace(O.fromPositions(i,i.with(void 0,i.column+s)),c)],[mt.fromPositions(d)]),l?t.set([{range:O.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),s=c.length,l||(i=void 0,s=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ai;e.add(Ee(()=>r.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(r.token,"editor");e.add(a.onDidChange(c=>{if(!r.token.isCancellationRequested)switch(c.status){case l2.Started:this.widget.active();break;case l2.Stopped:e.dispose();break;case l2.Recognizing:{if(!c.text)return;o(c.text,!0);break}case l2.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},TJ=vN,vN.ID="editorDictation",vN);qS=TJ=D([_(1,Xde),_(2,Pe),_(3,ti)],qS);vn(qS.ID,qS,mi.Lazy);At(iFt);At(Y7);var Rye;const xC="vs/editor/contrib/contextmenu/browser/contextmenu";var wN;let QS=(wN=class{static get(e){return e.getContribution(Rye.ID)}constructor(e,t,i,s,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=c,this._toDispose=new Z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(l=>this._onContextMenu(l))),this._toDispose.add(this._editor.onMouseWheel(l=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=l.srcElement;h.shadowRoot&&cF(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===E.ContextMenu&&(l.preventDefault(),l.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(x.contextmenu)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===Mt.OVERLAY_WIDGET||e.target.type===Mt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Mt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Mt.CONTENT_TEXT&&e.target.type!==Mt.CONTENT_EMPTY&&e.target.type!==Mt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Mt.TEXTAREA&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(x.contextmenu)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const r of o){const[,a]=r;let c=0;for(const l of a)if(l instanceof uS){const d=this._getMenuActions(e,l.item.submenu);d.length>0&&(i.push(new u1(l.id,l.label,d)),c++)}else i.push(l),c++;c&&i.push(new Kr)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(x.hover);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),vt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ia(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;s={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new WS(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new WS(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||rxt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const s=l=>({id:`menu-action-${++i}`,label:l.label,tooltip:"",class:void 0,enabled:typeof l.enabled>"u"?!0:l.enabled,checked:l.checked,run:l.run}),o=(l,d)=>new u1(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return s({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(s({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(s({label:g(xC,0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Kr),a.push(s({label:g(xC,1,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(xC,2,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(xC,3,"Proportional"),value:"proportional"},{label:g(xC,4,"Fill"),value:"fill"},{label:g(xC,5,"Fit"),value:"fit"}])),a.push(r(g(xC,6,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(xC,7,"Mouse Over"),value:"mouseover"},{label:g(xC,8,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!I_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:c?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:l=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},Rye=wN,wN.ID="editor.contrib.contextmenu",wN);QS=Rye=D([_(1,Vr),_(2,W_),_(3,Pe),_(4,ti),_(5,_c),_(6,Re),_(7,Ti)],QS);class sFt extends lt{constructor(){super({id:"editor.action.showContextMenu",label:g(xC,9,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|E.F10,weight:ye.EditorContrib}})}run(e,t){QS.get(t)?.showContextMenu()}}vn(QS.ID,QS,mi.BeforeFirstInteraction);Fe(sFt);const rpe="vs/workbench/contrib/snippets/browser/snippetsFile";class oFt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new ww().parse(e,!1),i=new Map;let s=0;for(const r of t.placeholders)s=Math.max(s,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(s===0){const r=Mf(t.children);this.isTrivial=r instanceof ep&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof wV){if(r.children.length===0&&!cPt[r.name]){const a=i.has(r.name)?i.get(r.name):++s;i.set(r.name,a);const c=new ep(a).appendChild(new Fh(r.name));t.replace(r,[c]),this.isBogous=!0}switch(r.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else o.push(...r.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class iFe{constructor(e,t,i,s,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=s,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=s.toLowerCase(),this._bodyInsights=new d$(ax(),()=>new oFt(this.body))}get codeSnippet(){return this._bodyInsights.value.codeSnippet}get isBogous(){return this._bodyInsights.value.isBogous}get isTrivial(){return this._bodyInsights.value.isTrivial}get needsClipboard(){return this._bodyInsights.value.usesClipboardVariable}get usesSelection(){return this._bodyInsights.value.usesSelectionVariable}}function rFt(n){return fo(n)&&!!n.body}var Yg;(function(n){n[n.User=1]="User",n[n.Workspace=2]="Workspace",n[n.Extension=3]="Extension"})(Yg||(Yg={}));class ape{constructor(e,t,i,s,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=s,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=T_(t.path)===".code-snippets",this.isUserSnippets=!this._extension}select(e,t){this.isGlobalSnippets||!this.isUserSnippets?this._scopeSelect(e,t):this._filepathSelect(e,t)}_filepathSelect(e,t){e+".json"===yr(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const s of this.data){const o=s.scopes.length;if(o===0)t.push(s);else for(let r=0;r=0&&this._scopeSelect(e.substring(0,i),t)}async _load(){return this._extension?this._extensionResourceLoaderService.readExtensionResource(this.location):(await this._fileService.readFile(this.location)).value.toString()}load(){return this._loadPromise||(this._loadPromise=Promise.resolve(this._load()).then(e=>{const t=ow(e);if(HW(t)==="object")for(const[i,s]of Object.entries(t))if(rFt(s))this._parseSnippet(i,s,this.data);else for(const[o,r]of Object.entries(s))this._parseSnippet(o,r,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:s,prefix:o,body:r,description:a}=t;if(o||(o=""),Array.isArray(r)&&(r=r.join(` `)),typeof r!="string")return;Array.isArray(a)&&(a=a.join(` -`));let c;this.defaultScopes?c=this.defaultScopes:typeof t.scope=="string"?c=t.scope.split(",").map(d=>d.trim()).filter(Boolean):c=[];let l;this._extension?l=this._extension.displayName||this._extension.name:this.source===Yg.Workspace?l=g(rpe,0,"Workspace Snippet"):this.isGlobalSnippets?l=g(rpe,1,"Global User Snippet"):l=g(rpe,2,"User Snippet");for(const d of fi.wrap(o))i.push(new iFe(!!s,c,e,d,a,r,l,this.source,this._extension?`${lO(this._extension.extensionLocation,this.location)}/${e}`:`${yr(this.location.path)}/${e}`,this._extension?.identifier))}}const Ua="vs/workbench/services/language/common/languageService",CV=Ap.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(Ua,0,"Contributes language declarations."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:languageId}",aliases:["${2:label}"],extensions:["${3:extension}"],configuration:"./language-configuration.json"}}],properties:{id:{description:g(Ua,1,"ID of the language."),type:"string"},aliases:{description:g(Ua,2,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(Ua,3,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(Ua,4,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(Ua,5,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(Ua,6,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(Ua,7,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(Ua,8,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(Ua,9,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(Ua,10,"Icon path when a light theme is used"),type:"string"},dark:{description:g(Ua,11,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(n,e)=>{for(const t of n)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class aFt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],s=[];for(const d of i)mtt(d)&&s.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=Pct(s,d=>d.id);if((t?.grammars||[]).forEach(d=>{let h=o[d.language];h?h.hasGrammar=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!0,hasSnippets:!1},o[h.id]=h,s.push(h))}),(t?.snippets||[]).forEach(d=>{let h=o[d.language];h?h.hasSnippets=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!1,hasSnippets:!0},o[h.id]=h,s.push(h))}),!s.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(Ua,12,"ID"),g(Ua,13,"Name"),g(Ua,14,"File Extensions"),g(Ua,15,"Grammar"),g(Ua,16,"Snippets")],l=s.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Xt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(Ua,17,"Programming Languages"),access:{canToggle:!1},renderer:new $i(aFt)});let E4e=class extends Cee{constructor(e,t,i,s){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=s,this._configurationService=t,this._extensionService=e,CV.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(SNe)&&this.updateMime()})),this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this.updateMime()}),this._register(this.onDidRequestRichLanguageFeatures(o=>{this._extensionService.activateByEvent(`onLanguage:${o}`),this._extensionService.activateByEvent("onLanguage")}))}updateMime(){const e=this._configurationService.getValue();dxt(),e.files?.associations&&Object.keys(e.files.associations).forEach(t=>{const i=e.files.associations[t];if(typeof i!="string"){this.logService.warn(`Ignoring configured 'files.associations' for '${t}' because its type is not a string but '${typeof i}'`);return}const s=this.getMimeType(i)||`text/x-${i}`;axt({id:i,mime:s,filepattern:t})}),this._onDidChange.fire()}};E4e=D([_(0,ho),_(1,Re),_(2,Il),_(3,Ze)],E4e);function MK(n){return typeof n>"u"?!0:Array.isArray(n)?n.every(e=>typeof e=="string"):!1}function mtt(n,e){return n?typeof n.id!="string"?(e?.error(g(Ua,20,"property `{0}` is mandatory and must be of type `string`","id")),!1):MK(n.extensions)?MK(n.filenames)?typeof n.firstLine<"u"&&typeof n.firstLine!="string"?(e?.error(g(Ua,23,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof n.configuration<"u"&&typeof n.configuration!="string"?(e?.error(g(Ua,24,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):MK(n.aliases)?MK(n.mimetypes)?typeof n.icon<"u"&&(typeof n.icon!="object"||typeof n.icon.light!="string"||typeof n.icon.dark!="string")?(e?.error(g(Ua,27,"property `{0}` can be omitted and must be of type `object` with properties `{1}` and `{2}` of type `string`","icon","light","dark")),!1):!0:(e?.error(g(Ua,26,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(Ua,25,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(Ua,22,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(Ua,21,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(Ua,19,"Empty value for `contributes.{0}`",CV.name)),!1)}const Mye="vs/workbench/contrib/snippets/browser/snippetCompletionProvider",_tt="_snippet.markAsUsed";yt.registerCommand(_tt,(n,...e)=>{const t=n.get($_),[i]=e;i instanceof iFe&&t.updateUsageTimestamp(i)});class T3{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(Mye,0,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Yg.Extension?"z":"a"}-${e.prefix}`,this.kind=Ne.Snippet,this.insertTextRules=cp.InsertAsSnippet,this.command={id:_tt,title:"",arguments:[e]}}resolve(){return this.documentation=new Xt().appendCodeblock("",ww.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return lw(e.label.label,t.label.label)}}let Nye=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const s=new ao,o=t.lineNumber,r=e.getWordAtPosition(t)??{startColumn:t.column,endColumn:t.column,word:""},a=e.getLineContent(t.lineNumber).toLowerCase(),c=a.substring(0,r.startColumn+r.word.length-1),l=this._computeSnippetPositions(e,o,r,c),d=t.column-1,h=i.triggerCharacter?.toLowerCase()??"",u=this._getLanguageIdAtPosition(e,t),f=this._languageConfigurationService.getLanguageConfiguration(u),p=new Set(await this._snippets.getSnippets(u)),m=[];for(const v of p){if(i.triggerKind===tf.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let w;for(const N of l)if(!(N.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&XYe(N.prefixLow,0,N.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){w=N;break}if(!w)continue;const b=w.startColumn-1,C=v.prefixLow.length-(d-b),y=Ble(a,v.prefixLow,d,d+C,d-b),S=t.with(void 0,b+1);let M=y===0?t.column+C:t.column;dU.open===a[S.column-1]&&v.prefix.startsWith(U.open)&&v.prefix[v.prefix.length-1]===U.close)&&M++;const k=O.fromPositions({lineNumber:o,column:w.startColumn},{lineNumber:o,column:M}),F=k.setEndPosition(o,t.column);m.push(new T3(v,{replace:k,insert:F})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const w=O.fromPositions(t),b=a.indexOf(v.prefixLow,d)===d?w.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):w;m.push(new T3(v,{replace:b,insert:w}))}return this._disambiguateSnippets(m),{suggestions:m,duration:s.elapsed()}}_disambiguateSnippets(e){e.sort(T3.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(Mye,1,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=s)}}resolveCompletionItem(e){return e instanceof T3?e.resolve():e}_computeSnippetPositions(e,t,i,s){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:s.substring(i.startColumn-1),isWord:!0}),o}_getLanguageIdAtPosition(e,t){e.tokenization.tokenizeIfCheap(t.lineNumber);let i=e.getLanguageIdAtPosition(t.lineNumber,t.column);return this._languageService.getLanguageName(i)||(i=e.getLanguageId()),i}};Nye=D([_(0,Di),_(1,$_),_(2,lo)],Nye);var RJ,MJ;const xA="vs/workbench/contrib/snippets/browser/snippetsService";var Pte;(function(n){function e(t,i,s){if(Xv(i.path))return t.collector.error(g(xA,0,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(Xv(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(xA,1,"When omitting the language, the value of `contributes.{0}.path` must be a `.code-snippets`-file. Provided value: {1}",t.description.name,String(i.path))),null;if(!Xv(i.language)&&!s.isRegisteredLanguageId(i.language))return t.collector.error(g(xA,2,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=qt(o,i.path);return MS(r,o)?{language:i.language,location:r}:(t.collector.error(g(xA,3,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",t.description.name,r.path,o.path)),null)}n.toValidSnippet=e,n.snippetsContribution={description:g(xA,4,"Contributes snippets."),type:"array",defaultSnippets:[{body:[{language:"",path:""}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",path:"./snippets/${2:id}.json."}}],properties:{language:{description:g(xA,5,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(xA,6,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},n.point=Ap.registerExtensionPoint({extensionPoint:"snippets",deps:[CV],jsonSchema:n.snippetsContribution})})(Pte||(Pte={}));function cFt(n,e,t){return pa(n.watch(e),n.onDidFilesChange(i=>{i.affects(e)&&t()}))}var bN;let Pye=(bN=class{constructor(e){this._storageService=e;const t=e.get(RJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=Yqe(i)?new Set(i):new Set}isIgnored(e){return this._ignored.has(e)}updateIgnored(e,t){let i=!1;this._ignored.has(e)&&!t?(this._ignored.delete(e),i=!0):!this._ignored.has(e)&&t&&(this._ignored.add(e),i=!0),i&&this._storageService.store(RJ._key,JSON.stringify(Array.from(this._ignored)),ke.PROFILE,ln.USER)}},RJ=bN,bN._key="snippets.ignoredSnippets",bN);Pye=RJ=D([_(0,sn)],Pye);var CN;let Fye=(CN=class{constructor(e){this._storageService=e;const t=e.get(MJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{i=[]}this._usages=Array.isArray(i)?new Map(i):new Map}getUsageTimestamp(e){return this._usages.get(e)}updateUsageTimestamp(e){this._usages.delete(e),this._usages.set(e,Date.now());const t=[...this._usages].slice(-100);this._storageService.store(MJ._key,JSON.stringify(t),ke.PROFILE,ln.USER)}},MJ=CN,CN._key="snippets.usageTimestamps",CN);Fye=MJ=D([_(0,sn)],Fye);let Oye=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=s,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new wi,this._pendingWork.push(Promise.resolve(l.when(Us.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),JNt(new Nye(this._languageService,this,h)),this._enablement=d.createInstance(Pye),this._usageTimestamps=d.createInstance(Fye)}dispose(){this._disposables.dispose()}isEnabled(e){return!this._enablement.isIgnored(e.snippetIdentifier)}updateEnablement(e,t){this._enablement.updateIgnored(e.snippetIdentifier,!t)}updateUsageTimestamp(e){this._usageTimestamps.updateUsageTimestamp(e.snippetIdentifier)}_joinSnippets(){const e=this._pendingWork.slice(0);return this._pendingWork.length=0,Promise.all(e)}async getSnippetFiles(){return await this._joinSnippets(),this._files.values()}async getSnippets(e,t){await this._joinSnippets();const i=[],s=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())s.push(o.load().then(r=>r.select(e,i)).catch(r=>this._logService.error(r,o.location.toString())))}else for(const o of this._files.values())s.push(o.load().then(r=>qqe(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(s),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const s of this._files.values())s.load().catch(o=>{}),s.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const s of e)!s.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(s)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==s.isFileTemplate||i.push(s);return i.sort((s,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(s.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(s,o)),r})}_compareSnippet(e,t){return e.snippetSourcet.snippetSource?1:e.sourcet.source||e.name>t.name?1:e.name{for(const[t,i]of this._files)i.source===Yg.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const s=Pte.toValidSnippet(t,i,this._languageService);if(!s)continue;const o=this._files.get(s.location);if(o)o.defaultScopes?o.defaultScopes.push(s.language):o.defaultScopes=[];else{const r=new ape(Yg.Extension,s.location,s.language?[s.language]:void 0,t.description,this._fileService,this._extensionResourceLoaderService);this._files.set(r.location,r),this._environmentService.isExtensionDevelopment&&r.load().then(a=>{a.data.some(c=>c.isBogous)&&t.collector.warn(g(xA,7,"One or more snippets from the extension '{0}' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)",t.description.name))},a=>{t.collector.warn(g(xA,8,'The snippet file "{0}" could not be read.',r.location.toString()))})}}})}_initWorkspaceSnippets(){const e=new Z,t=()=>{e.clear(),this._pendingWork.push(this._initWorkspaceFolderSnippets(this._contextService.getWorkspace(),e))};this._disposables.add(e),this._disposables.add(this._contextService.onDidChangeWorkspaceFolders(t)),this._disposables.add(this._contextService.onDidChangeWorkbenchState(t)),t()}async _initWorkspaceFolderSnippets(e,t){const i=e.folders.map(async s=>{const o=s.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Yg.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,Ko.ADDED)&&this._initFolderSnippets(Yg.Workspace,o,t)}))});await Promise.all(i)}async _initUserSnippets(){const e=new Z,t=async()=>{e.clear();const i=this._userDataProfileService.currentProfile.snippetsHome;await this._fileService.createFolder(i),await this._initFolderSnippets(Yg.User,i,e)};this._disposables.add(e),this._disposables.add(this._userDataProfileService.onDidChangeCurrentProfile(i=>i.join((async()=>{this._pendingWork.push(t())})()))),await t()}_initFolderSnippets(e,t,i){const s=new Z,o=async()=>{if(s.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])s.add(this._addSnippetFile(a.resource,e))}catch(r){this._logService.error(`Failed snippets from folder '${t.toString()}'`,r)}};return i.add(this._textfileService.files.onDidSave(r=>{MS(r.model.resource,t)&&o()})),i.add(cFt(this._fileService,t,o)),i.add(s),o()}_addSnippetFile(e,t){const i=uz(e);if(t===Yg.User&&i===".json"){const s=ui(e).replace(/\.json/,"");this._files.set(e,new ape(t,e,[s],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new ape(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};Oye=D([_(0,Il),_(1,Tm),_(2,Ti),_(3,Di),_(4,Ze),_(5,ci),_(6,tr),_(7,bPe),_(8,mg),_(9,be),_(10,lo)],Oye);function lFt(n,e){const i=n.getLineContent(e.lineNumber).substr(0,e.column-1),s=Math.max(0,i.length-100);for(let o=i.length-1;o>=s;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return s===0?i:""}var NJ,u0;let Ux=(u0=class{static get(e){return e.getContribution(NJ.ID)}constructor(e,t,i,s,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=s,this._activeSnippets=[],this._hasSnippets=NJ.ContextKey.bindTo(o),this._configListener=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(x.tabCompletion)&&this._update()}),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose()}_update(){const e=this._editor.getOption(x.tabCompletion)==="onlySnippets";this._enabled!==e&&(this._enabled=e,this._enabled?(this._selectionListener=this._editor.onDidChangeCursorSelection(t=>this._updateSnippets()),this._editor.getModel()&&this._updateSnippets()):this._selectionListener?.dispose())}_updateSnippets(){if(this._activeSnippets=[],this._completionProvider?.dispose(),!this._editor.hasModel())return;const e=this._editor.getSelection(),t=this._editor.getModel();t.tokenization.tokenizeIfCheap(e.positionLineNumber);const i=t.getLanguageIdAtPosition(e.positionLineNumber,e.positionColumn),s=this._snippetService.getSnippetsSync(i);if(!s){this._hasSnippets.set(!1);return}if(O.isEmpty(e)){const r=lFt(t,e.getPosition());if(r)for(const a of s)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!O.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of s)r===a.prefix&&this._activeSnippets.push(a)}const o=this._activeSnippets.length;if(o===0)this._hasSnippets.set(!1);else if(o===1)this._hasSnippets.set(!0);else{this._hasSnippets.set(!0),this._completionProvider={_debugDisplayName:"tabCompletion",dispose:()=>{r.dispose()},provideCompletionItems:(a,c)=>a!==t||!e.containsPosition(c)?void 0:{suggestions:this._activeSnippets.map(d=>{const h=O.fromPositions(c.delta(0,-d.prefix.length),c);return new T3(d,h)})}};const r=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme},this._completionProvider)}}async performSnippetCompletions(){if(this._editor.hasModel())if(this._activeSnippets.length===1){const[e]=this._activeSnippets;let t;if(e.needsClipboard){const i=new Bde(this._editor,hr.Value|hr.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}pc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&ott(this._editor,this._completionProvider)}},NJ=u0,u0.ID="editor.tabCompletionController",u0.ContextKey=new Y("hasSnippetCompletions",void 0),u0);Ux=NJ=D([_(1,$_),_(2,Mu),_(3,ht),_(4,Pe)],Ux);vn(Ux.ID,Ux,mi.Eager);const dFt=Yc.bindToContribution(Ux.get);Ke(new dFt({id:"insertSnippet",precondition:Ux.ContextKey,handler:n=>n.performSnippetCompletions(),kbOpts:{weight:ye.EditorContrib,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus,pc.InSnippetMode.toNegated()),primary:E.Tab}}));const hA="vs/workbench/contrib/comments/common/commentContextKeys";var Qv;(function(n){n.activeCursorHasCommentingRange=new Y("activeCursorHasCommentingRange",!1,{description:g(hA,0,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),n.activeEditorHasCommentingRange=new Y("activeEditorHasCommentingRange",!1,{description:g(hA,1,"Whether the active editor has a commenting range"),type:"boolean"}),n.WorkspaceHasCommenting=new Y("workspaceHasCommenting",!1,{description:g(hA,2,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),n.commentThreadIsEmpty=new Y("commentThreadIsEmpty",!1,{type:"boolean",description:g(hA,3,"Set when the comment thread has no comments")}),n.commentIsEmpty=new Y("commentIsEmpty",!1,{type:"boolean",description:g(hA,4,"Set when the comment has no input")}),n.commentContext=new Y("comment",void 0,{type:"string",description:g(hA,5,"The context value of the comment")}),n.commentThreadContext=new Y("commentThread",void 0,{type:"string",description:g(hA,6,"The context value of the comment thread")}),n.commentControllerContext=new Y("commentController",void 0,{type:"string",description:g(hA,7,"The comment controller id associated with a comment thread")}),n.commentFocused=new Y("commentFocused",!1,{type:"boolean",description:g(hA,8,"Set when the comment is focused")})})(Qv||(Qv={}));function HQ(n){return{asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function hFt(n,e,t){const i={id:Dr(),name:n,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class fhe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return fi.some(this,([i,s])=>s.asFile())&&t.push("files"),wtt(Fte(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Fte(e)}}function Fte(n){return n.toLowerCase()}function vtt(n,e){return wtt(Fte(n),e.map(Fte))}function wtt(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const R1=Object.freeze({create:n=>Lc(n.map(e=>e.toString())).join(`\r +`));let c;this.defaultScopes?c=this.defaultScopes:typeof t.scope=="string"?c=t.scope.split(",").map(d=>d.trim()).filter(Boolean):c=[];let l;this._extension?l=this._extension.displayName||this._extension.name:this.source===Yg.Workspace?l=g(rpe,0,"Workspace Snippet"):this.isGlobalSnippets?l=g(rpe,1,"Global User Snippet"):l=g(rpe,2,"User Snippet");for(const d of fi.wrap(o))i.push(new iFe(!!s,c,e,d,a,r,l,this.source,this._extension?`${lO(this._extension.extensionLocation,this.location)}/${e}`:`${yr(this.location.path)}/${e}`,this._extension?.identifier))}}const Ua="vs/workbench/services/language/common/languageService",CV=Ap.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(Ua,0,"Contributes language declarations."),type:"array",items:{type:"object",defaultSnippets:[{body:{id:"${1:languageId}",aliases:["${2:label}"],extensions:["${3:extension}"],configuration:"./language-configuration.json"}}],properties:{id:{description:g(Ua,1,"ID of the language."),type:"string"},aliases:{description:g(Ua,2,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(Ua,3,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(Ua,4,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(Ua,5,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(Ua,6,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(Ua,7,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(Ua,8,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(Ua,9,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(Ua,10,"Icon path when a light theme is used"),type:"string"},dark:{description:g(Ua,11,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(n,e)=>{for(const t of n)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class aFt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],s=[];for(const d of i)mtt(d)&&s.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=Pct(s,d=>d.id);if((t?.grammars||[]).forEach(d=>{let h=o[d.language];h?h.hasGrammar=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!0,hasSnippets:!1},o[h.id]=h,s.push(h))}),(t?.snippets||[]).forEach(d=>{let h=o[d.language];h?h.hasSnippets=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!1,hasSnippets:!0},o[h.id]=h,s.push(h))}),!s.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(Ua,12,"ID"),g(Ua,13,"Name"),g(Ua,14,"File Extensions"),g(Ua,15,"Grammar"),g(Ua,16,"Snippets")],l=s.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Xt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(Ua,17,"Programming Languages"),access:{canToggle:!1},renderer:new Gi(aFt)});let E4e=class extends Cee{constructor(e,t,i,s){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=s,this._configurationService=t,this._extensionService=e,CV.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(SNe)&&this.updateMime()})),this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this.updateMime()}),this._register(this.onDidRequestRichLanguageFeatures(o=>{this._extensionService.activateByEvent(`onLanguage:${o}`),this._extensionService.activateByEvent("onLanguage")}))}updateMime(){const e=this._configurationService.getValue();dxt(),e.files?.associations&&Object.keys(e.files.associations).forEach(t=>{const i=e.files.associations[t];if(typeof i!="string"){this.logService.warn(`Ignoring configured 'files.associations' for '${t}' because its type is not a string but '${typeof i}'`);return}const s=this.getMimeType(i)||`text/x-${i}`;axt({id:i,mime:s,filepattern:t})}),this._onDidChange.fire()}};E4e=D([_(0,ho),_(1,Re),_(2,Il),_(3,Ze)],E4e);function MK(n){return typeof n>"u"?!0:Array.isArray(n)?n.every(e=>typeof e=="string"):!1}function mtt(n,e){return n?typeof n.id!="string"?(e?.error(g(Ua,20,"property `{0}` is mandatory and must be of type `string`","id")),!1):MK(n.extensions)?MK(n.filenames)?typeof n.firstLine<"u"&&typeof n.firstLine!="string"?(e?.error(g(Ua,23,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof n.configuration<"u"&&typeof n.configuration!="string"?(e?.error(g(Ua,24,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):MK(n.aliases)?MK(n.mimetypes)?typeof n.icon<"u"&&(typeof n.icon!="object"||typeof n.icon.light!="string"||typeof n.icon.dark!="string")?(e?.error(g(Ua,27,"property `{0}` can be omitted and must be of type `object` with properties `{1}` and `{2}` of type `string`","icon","light","dark")),!1):!0:(e?.error(g(Ua,26,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(Ua,25,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(Ua,22,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(Ua,21,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(Ua,19,"Empty value for `contributes.{0}`",CV.name)),!1)}const Mye="vs/workbench/contrib/snippets/browser/snippetCompletionProvider",_tt="_snippet.markAsUsed";yt.registerCommand(_tt,(n,...e)=>{const t=n.get($_),[i]=e;i instanceof iFe&&t.updateUsageTimestamp(i)});class T3{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(Mye,0,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Yg.Extension?"z":"a"}-${e.prefix}`,this.kind=Ne.Snippet,this.insertTextRules=cp.InsertAsSnippet,this.command={id:_tt,title:"",arguments:[e]}}resolve(){return this.documentation=new Xt().appendCodeblock("",ww.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return lw(e.label.label,t.label.label)}}let Nye=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const s=new ao,o=t.lineNumber,r=e.getWordAtPosition(t)??{startColumn:t.column,endColumn:t.column,word:""},a=e.getLineContent(t.lineNumber).toLowerCase(),c=a.substring(0,r.startColumn+r.word.length-1),l=this._computeSnippetPositions(e,o,r,c),d=t.column-1,h=i.triggerCharacter?.toLowerCase()??"",u=this._getLanguageIdAtPosition(e,t),f=this._languageConfigurationService.getLanguageConfiguration(u),p=new Set(await this._snippets.getSnippets(u)),m=[];for(const v of p){if(i.triggerKind===tf.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let w;for(const N of l)if(!(N.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&XYe(N.prefixLow,0,N.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){w=N;break}if(!w)continue;const b=w.startColumn-1,C=v.prefixLow.length-(d-b),y=Ble(a,v.prefixLow,d,d+C,d-b),S=t.with(void 0,b+1);let M=y===0?t.column+C:t.column;dU.open===a[S.column-1]&&v.prefix.startsWith(U.open)&&v.prefix[v.prefix.length-1]===U.close)&&M++;const k=O.fromPositions({lineNumber:o,column:w.startColumn},{lineNumber:o,column:M}),F=k.setEndPosition(o,t.column);m.push(new T3(v,{replace:k,insert:F})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const w=O.fromPositions(t),b=a.indexOf(v.prefixLow,d)===d?w.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):w;m.push(new T3(v,{replace:b,insert:w}))}return this._disambiguateSnippets(m),{suggestions:m,duration:s.elapsed()}}_disambiguateSnippets(e){e.sort(T3.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(Mye,1,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=s)}}resolveCompletionItem(e){return e instanceof T3?e.resolve():e}_computeSnippetPositions(e,t,i,s){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:s.substring(i.startColumn-1),isWord:!0}),o}_getLanguageIdAtPosition(e,t){e.tokenization.tokenizeIfCheap(t.lineNumber);let i=e.getLanguageIdAtPosition(t.lineNumber,t.column);return this._languageService.getLanguageName(i)||(i=e.getLanguageId()),i}};Nye=D([_(0,Di),_(1,$_),_(2,lo)],Nye);var RJ,MJ;const xA="vs/workbench/contrib/snippets/browser/snippetsService";var Pte;(function(n){function e(t,i,s){if(Xv(i.path))return t.collector.error(g(xA,0,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(Xv(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(xA,1,"When omitting the language, the value of `contributes.{0}.path` must be a `.code-snippets`-file. Provided value: {1}",t.description.name,String(i.path))),null;if(!Xv(i.language)&&!s.isRegisteredLanguageId(i.language))return t.collector.error(g(xA,2,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=Qt(o,i.path);return MS(r,o)?{language:i.language,location:r}:(t.collector.error(g(xA,3,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",t.description.name,r.path,o.path)),null)}n.toValidSnippet=e,n.snippetsContribution={description:g(xA,4,"Contributes snippets."),type:"array",defaultSnippets:[{body:[{language:"",path:""}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",path:"./snippets/${2:id}.json."}}],properties:{language:{description:g(xA,5,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(xA,6,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},n.point=Ap.registerExtensionPoint({extensionPoint:"snippets",deps:[CV],jsonSchema:n.snippetsContribution})})(Pte||(Pte={}));function cFt(n,e,t){return pa(n.watch(e),n.onDidFilesChange(i=>{i.affects(e)&&t()}))}var bN;let Pye=(bN=class{constructor(e){this._storageService=e;const t=e.get(RJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=Yqe(i)?new Set(i):new Set}isIgnored(e){return this._ignored.has(e)}updateIgnored(e,t){let i=!1;this._ignored.has(e)&&!t?(this._ignored.delete(e),i=!0):!this._ignored.has(e)&&t&&(this._ignored.add(e),i=!0),i&&this._storageService.store(RJ._key,JSON.stringify(Array.from(this._ignored)),ke.PROFILE,ln.USER)}},RJ=bN,bN._key="snippets.ignoredSnippets",bN);Pye=RJ=D([_(0,on)],Pye);var CN;let Fye=(CN=class{constructor(e){this._storageService=e;const t=e.get(MJ._key,ke.PROFILE,"");let i;try{i=JSON.parse(t)}catch{i=[]}this._usages=Array.isArray(i)?new Map(i):new Map}getUsageTimestamp(e){return this._usages.get(e)}updateUsageTimestamp(e){this._usages.delete(e),this._usages.set(e,Date.now());const t=[...this._usages].slice(-100);this._storageService.store(MJ._key,JSON.stringify(t),ke.PROFILE,ln.USER)}},MJ=CN,CN._key="snippets.usageTimestamps",CN);Fye=MJ=D([_(0,on)],Fye);let Oye=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=s,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new wi,this._pendingWork.push(Promise.resolve(l.when(Us.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),JNt(new Nye(this._languageService,this,h)),this._enablement=d.createInstance(Pye),this._usageTimestamps=d.createInstance(Fye)}dispose(){this._disposables.dispose()}isEnabled(e){return!this._enablement.isIgnored(e.snippetIdentifier)}updateEnablement(e,t){this._enablement.updateIgnored(e.snippetIdentifier,!t)}updateUsageTimestamp(e){this._usageTimestamps.updateUsageTimestamp(e.snippetIdentifier)}_joinSnippets(){const e=this._pendingWork.slice(0);return this._pendingWork.length=0,Promise.all(e)}async getSnippetFiles(){return await this._joinSnippets(),this._files.values()}async getSnippets(e,t){await this._joinSnippets();const i=[],s=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())s.push(o.load().then(r=>r.select(e,i)).catch(r=>this._logService.error(r,o.location.toString())))}else for(const o of this._files.values())s.push(o.load().then(r=>qqe(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(s),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const s of this._files.values())s.load().catch(o=>{}),s.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const s of e)!s.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(s)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==s.isFileTemplate||i.push(s);return i.sort((s,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(s.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(s,o)),r})}_compareSnippet(e,t){return e.snippetSourcet.snippetSource?1:e.sourcet.source||e.name>t.name?1:e.name{for(const[t,i]of this._files)i.source===Yg.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const s=Pte.toValidSnippet(t,i,this._languageService);if(!s)continue;const o=this._files.get(s.location);if(o)o.defaultScopes?o.defaultScopes.push(s.language):o.defaultScopes=[];else{const r=new ape(Yg.Extension,s.location,s.language?[s.language]:void 0,t.description,this._fileService,this._extensionResourceLoaderService);this._files.set(r.location,r),this._environmentService.isExtensionDevelopment&&r.load().then(a=>{a.data.some(c=>c.isBogous)&&t.collector.warn(g(xA,7,"One or more snippets from the extension '{0}' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)",t.description.name))},a=>{t.collector.warn(g(xA,8,'The snippet file "{0}" could not be read.',r.location.toString()))})}}})}_initWorkspaceSnippets(){const e=new Z,t=()=>{e.clear(),this._pendingWork.push(this._initWorkspaceFolderSnippets(this._contextService.getWorkspace(),e))};this._disposables.add(e),this._disposables.add(this._contextService.onDidChangeWorkspaceFolders(t)),this._disposables.add(this._contextService.onDidChangeWorkbenchState(t)),t()}async _initWorkspaceFolderSnippets(e,t){const i=e.folders.map(async s=>{const o=s.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Yg.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,Ko.ADDED)&&this._initFolderSnippets(Yg.Workspace,o,t)}))});await Promise.all(i)}async _initUserSnippets(){const e=new Z,t=async()=>{e.clear();const i=this._userDataProfileService.currentProfile.snippetsHome;await this._fileService.createFolder(i),await this._initFolderSnippets(Yg.User,i,e)};this._disposables.add(e),this._disposables.add(this._userDataProfileService.onDidChangeCurrentProfile(i=>i.join((async()=>{this._pendingWork.push(t())})()))),await t()}_initFolderSnippets(e,t,i){const s=new Z,o=async()=>{if(s.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])s.add(this._addSnippetFile(a.resource,e))}catch(r){this._logService.error(`Failed snippets from folder '${t.toString()}'`,r)}};return i.add(this._textfileService.files.onDidSave(r=>{MS(r.model.resource,t)&&o()})),i.add(cFt(this._fileService,t,o)),i.add(s),o()}_addSnippetFile(e,t){const i=uz(e);if(t===Yg.User&&i===".json"){const s=ui(e).replace(/\.json/,"");this._files.set(e,new ape(t,e,[s],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new ape(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};Oye=D([_(0,Il),_(1,Tm),_(2,Ti),_(3,Di),_(4,Ze),_(5,ci),_(6,tr),_(7,bPe),_(8,mg),_(9,be),_(10,lo)],Oye);function lFt(n,e){const i=n.getLineContent(e.lineNumber).substr(0,e.column-1),s=Math.max(0,i.length-100);for(let o=i.length-1;o>=s;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return s===0?i:""}var NJ,u0;let Ux=(u0=class{static get(e){return e.getContribution(NJ.ID)}constructor(e,t,i,s,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=s,this._activeSnippets=[],this._hasSnippets=NJ.ContextKey.bindTo(o),this._configListener=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(x.tabCompletion)&&this._update()}),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose()}_update(){const e=this._editor.getOption(x.tabCompletion)==="onlySnippets";this._enabled!==e&&(this._enabled=e,this._enabled?(this._selectionListener=this._editor.onDidChangeCursorSelection(t=>this._updateSnippets()),this._editor.getModel()&&this._updateSnippets()):this._selectionListener?.dispose())}_updateSnippets(){if(this._activeSnippets=[],this._completionProvider?.dispose(),!this._editor.hasModel())return;const e=this._editor.getSelection(),t=this._editor.getModel();t.tokenization.tokenizeIfCheap(e.positionLineNumber);const i=t.getLanguageIdAtPosition(e.positionLineNumber,e.positionColumn),s=this._snippetService.getSnippetsSync(i);if(!s){this._hasSnippets.set(!1);return}if(O.isEmpty(e)){const r=lFt(t,e.getPosition());if(r)for(const a of s)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!O.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of s)r===a.prefix&&this._activeSnippets.push(a)}const o=this._activeSnippets.length;if(o===0)this._hasSnippets.set(!1);else if(o===1)this._hasSnippets.set(!0);else{this._hasSnippets.set(!0),this._completionProvider={_debugDisplayName:"tabCompletion",dispose:()=>{r.dispose()},provideCompletionItems:(a,c)=>a!==t||!e.containsPosition(c)?void 0:{suggestions:this._activeSnippets.map(d=>{const h=O.fromPositions(c.delta(0,-d.prefix.length),c);return new T3(d,h)})}};const r=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme},this._completionProvider)}}async performSnippetCompletions(){if(this._editor.hasModel())if(this._activeSnippets.length===1){const[e]=this._activeSnippets;let t;if(e.needsClipboard){const i=new Bde(this._editor,hr.Value|hr.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}mc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&ott(this._editor,this._completionProvider)}},NJ=u0,u0.ID="editor.tabCompletionController",u0.ContextKey=new Y("hasSnippetCompletions",void 0),u0);Ux=NJ=D([_(1,$_),_(2,Mu),_(3,ht),_(4,Pe)],Ux);vn(Ux.ID,Ux,mi.Eager);const dFt=Jc.bindToContribution(Ux.get);Ke(new dFt({id:"insertSnippet",precondition:Ux.ContextKey,handler:n=>n.performSnippetCompletions(),kbOpts:{weight:ye.EditorContrib,kbExpr:ge.and(X.editorTextFocus,X.tabDoesNotMoveFocus,mc.InSnippetMode.toNegated()),primary:E.Tab}}));const hA="vs/workbench/contrib/comments/common/commentContextKeys";var Qv;(function(n){n.activeCursorHasCommentingRange=new Y("activeCursorHasCommentingRange",!1,{description:g(hA,0,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),n.activeEditorHasCommentingRange=new Y("activeEditorHasCommentingRange",!1,{description:g(hA,1,"Whether the active editor has a commenting range"),type:"boolean"}),n.WorkspaceHasCommenting=new Y("workspaceHasCommenting",!1,{description:g(hA,2,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),n.commentThreadIsEmpty=new Y("commentThreadIsEmpty",!1,{type:"boolean",description:g(hA,3,"Set when the comment thread has no comments")}),n.commentIsEmpty=new Y("commentIsEmpty",!1,{type:"boolean",description:g(hA,4,"Set when the comment has no input")}),n.commentContext=new Y("comment",void 0,{type:"string",description:g(hA,5,"The context value of the comment")}),n.commentThreadContext=new Y("commentThread",void 0,{type:"string",description:g(hA,6,"The context value of the comment thread")}),n.commentControllerContext=new Y("commentController",void 0,{type:"string",description:g(hA,7,"The comment controller id associated with a comment thread")}),n.commentFocused=new Y("commentFocused",!1,{type:"boolean",description:g(hA,8,"Set when the comment is focused")})})(Qv||(Qv={}));function HQ(n){return{asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function hFt(n,e,t){const i={id:Dr(),name:n,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class fhe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return fi.some(this,([i,s])=>s.asFile())&&t.push("files"),wtt(Fte(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Fte(e)}}function Fte(n){return n.toLowerCase()}function vtt(n,e){return wtt(Fte(n),e.map(Fte))}function wtt(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const R1=Object.freeze({create:n=>Lc(n.map(e=>e.toString())).join(`\r `),split:n=>n.split(`\r -`),parse:n=>R1.split(n).filter(e=>!e.startsWith("#"))}),ZC=class ZC{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ZC.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ZC((this.value?[this.value,...e]:e).join(ZC.sep))}};ZC.sep=".",ZC.None=new ZC("@@none@@"),ZC.Empty=new ZC("");let bs=ZC;var Tv;(function(n){function e(o){return typeof o?.showDirectoryPicker=="function"}n.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}n.isFileSystemHandle=t;function i(o){return o.kind==="file"}n.isFileSystemFileHandle=i;function s(o){return o.kind==="directory"}n.isFileSystemDirectoryHandle=s})(Tv||(Tv={}));const x4e="vs/platform/files/browser/htmlFileSystemProvider";class uFt{get capabilities(){return this._capabilities||(this._capabilities=es.FileReadWrite|es.FileReadStream,jr&&(this._capabilities|=es.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.extUri=jr?Fn:Gle,this._files=new Map,this._directories=new Map}async stat(e){try{const t=await this.getHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, stat",rt.FileNotFound);if(Tv.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:an.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:an.Directory,mtime:0,ctime:0,size:0}}catch(t){throw this.toFileSystemProviderError(t)}}async readdir(e){try{const t=await this.getDirectoryHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readdir",rt.FileNotFound);const i=[];for await(const[s,o]of t)i.push([s,Tv.isFileSystemFileHandle(o)?an.File:an.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer,{highWaterMark:10});return(async()=>{try{const o=await this.getFileHandle(e);if(!o)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const r=await o.getFile();if(typeof t.length=="number"||typeof t.position=="number"){let a=new Uint8Array(await r.arrayBuffer());typeof t?.position=="number"&&(a=a.slice(t.position)),typeof t?.length=="number"&&(a=a.slice(0,t.length)),s.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await s.write(c.value),i.isCancellationRequested));)c=await a.read();s.end(void 0)}}catch(o){s.error(this.toFileSystemProviderError(o)),s.end()}})(),s}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const i=await t.getFile();return new Uint8Array(await i.arrayBuffer())}catch(t){throw this.toFileSystemProviderError(t)}}async writeFile(e,t,i){try{let s=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(s){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",rt.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",rt.FileNotFound)}if(!s){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",rt.FileNotFound);if(s=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!s)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",rt.Unknown)}const o=await s.createWritable();await o.write(t),await o.close()}catch(s){throw this.toFileSystemProviderError(s)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",rt.FileNotFound);await t.getDirectoryHandle(this.extUri.basename(e),{create:!0})}catch(t){throw this.toFileSystemProviderError(t)}}async delete(e,t){try{const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(!i)throw this.createFileSystemProviderError(e,"No such parent directory, delete",rt.FileNotFound);return i.removeEntry(this.extUri.basename(e),{recursive:t.recursive})}catch(i){throw this.toFileSystemProviderError(i)}}async rename(e,t,i){try{if(this.extUri.isEqual(e,t))return;const s=await this.getFileHandle(e);if(s){const o=await s.getFile(),r=new Uint8Array(await o.arrayBuffer());await this.writeFile(t,r,{create:!0,overwrite:i.overwrite,unlock:!1,atomic:!1}),await this.delete(e,{recursive:!1,useTrash:!1,atomic:!1})}else throw this.createFileSystemProviderError(e,g(x4e,0,"Rename is only supported for files."),rt.Unavailable)}catch(s){throw this.toFileSystemProviderError(s)}}watch(e,t){return $.None}registerFileHandle(e){return this.registerHandle(e,this._files)}registerDirectoryHandle(e){return this.registerHandle(e,this._directories)}get directories(){return this._directories.values()}async registerHandle(e,t){let i=`/${e.name}`;if(t.has(i)&&!await t.get(i)?.isSameEntry(e)){const s=T_(e.name),o=yr(e.name,s);let r=1;do i=`/${o}-${r++}${s}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",s=>s.put(e,i))}catch(s){this.logService.error(s)}return P.from({scheme:_e.file,path:i})}async getHandle(e){let t=await this.doGetHandle(e);if(!t){const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(i){const s=Fn.basename(e);try{t=await i.getFileHandle(s)}catch{try{t=await i.getDirectoryHandle(s)}catch{}}}}return t}async getFileHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemFileHandle)return t;const i=await this.getDirectoryHandle(this.extUri.dirname(e));try{return await i?.getFileHandle(Fn.basename(e))}catch{return}}async getDirectoryHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemDirectoryHandle)return t;const i=this.extUri.dirname(e);if(this.extUri.isEqual(i,e))return;const s=await this.getDirectoryHandle(i);try{return await s?.getDirectoryHandle(Fn.basename(e))}catch{return}}async doGetHandle(e){if(this.extUri.dirname(e).path!=="/")return;const t=e.path.replace(/\/$/,""),i=this._files.get(t)??this._directories.get(t);if(i)return i;const s=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(Tv.isFileSystemHandle(s)){let o=await s.queryPermission()==="granted";try{o||(o=await s.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return Tv.isFileSystemFileHandle(s)?this._files.set(t,s):Tv.isFileSystemDirectoryHandle(s)&&this._directories.set(t,s),s}throw this.createFileSystemProviderError(e,"No file system handle registered",rt.Unavailable)}toFileSystemProviderError(e){if(e instanceof Nx)return e;let t=rt.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(x4e,1,"Insufficient permissions. Please retry and allow the operation.")),t=rt.Unavailable),xs(e,t)}createFileSystemProviderError(e,t,i){return xs(new Error(`${t} (${d1(e.path)})`),i)}}const gFt="vs/platform/dnd/browser/dnd",bF={EDITORS:"CodeEditors",FILES:"CodeFiles"};function fFt(n){const e=[];if(n.dataTransfer&&n.dataTransfer.types.length>0){const s=n.dataTransfer.getData(bF.EDITORS);if(s)try{e.push(...JU(s))}catch{}else try{const a=n.dataTransfer.getData(gm.RESOURCES);e.push(...pFt(a))}catch{}if(n.dataTransfer?.files)for(let a=0;amFt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function pFt(n){const e=[];if(n){const t=JSON.parse(n);for(const i of t)if(i.indexOf(":")>0){const{selection:s,uri:o}=TNe(P.parse(i));e.push({resource:o,options:{selection:s}})}}return e}async function mFt(n,e){if(Tv.supported(yi)){const i=e.dataTransfer?.items;if(i)return _Ft(n,i)}const t=e.dataTransfer?.files;return t?vFt(n,t):[]}async function _Ft(n,e){const t=n.get(ci).getProvider(_e.file);if(!(t instanceof uFt))return[];const i=[];for(let s=0;s{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}Tv.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Tv.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Ui(await Promise.all(i.map(s=>s.p)))}async function vFt(n,e){const t=n.get(To),i=[];for(let s=0;s100*vl.MB){t.warn(g(gFt,0,"File is too large to open as untitled editor. Please upload it first into the file explorer and then try again."));continue}const r=new sd;i.push(r);const a=new FileReader;a.onerror=()=>r.complete(void 0),a.onabort=()=>r.complete(void 0),a.onload=async c=>{const l=o.name,d=c.target?.result??void 0;if(typeof l!="string"||typeof d>"u"){r.complete(void 0);return}r.complete({resource:P.from({scheme:_e.untitled,path:l}),contents:typeof d=="string"?ze.fromString(d):ze.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Ui(await Promise.all(i.map(s=>s.p)))}function Ctt(n,...e){if(!n.dataTransfer)return!1;const t=n.dataTransfer.types,i=[];for(let s=0;s=0)return!0;return!1}class wFt{constructor(){this._contributions=new Map}register(e){if(this._contributions.has(e.dataFormatKey))throw new Error(`A drag and drop contributiont with key '${e.dataFormatKey}' was already registered.`);this._contributions.set(e.dataFormatKey,e)}getAll(){return this._contributions.values()}}const nFe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};it.add(nFe.DragAndDropContribution,new wFt);const i9=class i9{constructor(){}static getInstance(){return i9.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}};i9.INSTANCE=new i9;let Ote=i9;function ytt(n){const e=new fhe;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,HQ(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,bFt(s))}}return e}function bFt(n){const e=n.path?P.parse(n.path):void 0;return hFt(n.name,e,async()=>new Uint8Array(await n.arrayBuffer()))}const CFt=Object.freeze([bF.EDITORS,bF.FILES,gm.RESOURCES,gm.INTERNAL_URI_LIST]);function Stt(n,e=!1){const t=ytt(n),i=t.get(gm.INTERNAL_URI_LIST);if(i)t.replace(Js.uriList,i);else if(e||!t.has(Js.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=r.path;try{a?s.push(P.file(a).toString()):s.push(P.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(Js.uriList,HQ(R1.create(s)))}for(const s of CFt)t.delete(s);return t}const dI="vs/editor/contrib/dropOrPasteInto/browser/defaultProviders";class sFe{async provideDocumentPasteEdits(e,t,i,s,o){const r=await this.getEdit(i,o);if(r)return{dispose(){},edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}]}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);return o?[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}]:void 0}}const q2=class q2 extends sFe{constructor(){super(...arguments),this.id=q2.id,this.kind=q2.kind,this.dropMimeTypes=[Js.text],this.pasteMimeTypes=[Js.text]}async getEdit(e,t){const i=e.get(Js.text);if(!i||e.has(Js.uriList))return;const s=await i.asString();return{handledMimeType:Js.text,title:g(dI,0,"Insert Plain Text"),insertText:s,kind:this.kind}}};q2.id="text",q2.kind=new bs("text.plain");let CF=q2;class Att extends sFe{constructor(){super(...arguments),this.kind=new bs("uri.absolute"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===_e.file?a.fsPath:(s++,c)).join(" ");let r;return s>0?r=i.length>1?g(dI,1,"Insert Uris"):g(dI,2,"Insert Uri"):r=i.length>1?g(dI,3,"Insert Paths"):g(dI,4,"Insert Path"),{handledMimeType:Js.uriList,insertText:o,title:r,kind:this.kind}}}let Bte=class extends sFe{constructor(e){super(),this._workspaceContextService=e,this.kind=new bs("uri.relative"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;const s=Ui(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?lO(r.uri,o):void 0}));if(s.length)return{handledMimeType:Js.uriList,insertText:s.join(" "),title:i.length>1?g(dI,5,"Insert Relative Paths"):g(dI,6,"Insert Relative Path"),kind:this.kind}}};Bte=D([_(0,Ti)],Bte);class yFt{constructor(){this.kind=new bs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Js.text}]}async provideDocumentPasteEdits(e,t,i,s,o){if(s.triggerKind!==x9.PasteAs&&!s.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:g(dI,7,"Insert HTML"),kind:this.kind}]}}}async function Ett(n){const e=n.get(Js.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of R1.parse(t))try{i.push({uri:P.parse(s),originalText:s})}catch{}return i}let Bye=class extends ${constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new CF)),this._register(e.documentDropEditProvider.register("*",new Att)),this._register(e.documentDropEditProvider.register("*",new Bte(t)))}};Bye=D([_(0,ht),_(1,Ti)],Bye);let Wye=class extends ${constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new CF)),this._register(e.documentPasteEditProvider.register("*",new Att)),this._register(e.documentPasteEditProvider.register("*",new Bte(t))),this._register(e.documentPasteEditProvider.register("*",new yFt))}};Wye=D([_(0,ht),_(1,Ti)],Wye);function xtt(n,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new vS(n,{range:i,text:typeof t.insertText=="string"?ww.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Dtt(n){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of n)for(const a of r.yieldTo??[])for(const c of n)if(c!==r&&e(a,c)){let l=t.get(r);l||(l=[],t.set(r,l)),l.push(c)}if(!t.size)return Array.from(n);const i=new Set,s=[];function o(r){if(!r.length)return[];const a=r[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let c=[];const l=t.get(a);return l&&(s.push(a),c=o(l),s.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(n))}var SFt=".inline-editor-progress-decoration{display:inline-block;height:1em;width:1em}.inline-progress-widget{align-items:center;display:flex!important;justify-content:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{animation:none;font-size:90%!important}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(SFt,{});const AFt=jt.register({description:"inline-progress-widget",stickiness:gi.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:AQe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Yae=class Yae extends ${constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=we(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=we("span.icon");this.domNode.append(t),t.classList.add(...$e.asClassNameArray(Ce.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(x.fontSize)||s.hasChanged(x.lineHeight))&&i()})),this._register(pe(this.domNode,xe.CLICK,s=>{this.delegate.cancel()}))}getId(){return Yae.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[hs.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Yae.baseId="editor.widget.inlineProgressWidget";let Hye=Yae,Wte=class extends ${constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Dn),this._currentWidget=new Dn,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=PS(()=>{const o=O.fromPositions(e);this._currentDecorations.set([{range:o,options:AFt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Hye,this.id,this._editor,o,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Wte=D([_(2,be)],Wte);var EFt=".monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);padding:2px 4px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{border:8px solid transparent;height:0!important;left:2px;position:absolute;width:0!important;z-index:1000}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage.below .anchor.below,.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}";Ct(EFt,{});var PJ;const xFt="vs/editor/contrib/message/browser/messageController";var g0;let Du=(g0=class{static get(e){return e.getContribution(PJ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Dn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=PJ.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}isVisible(){return this._visible.get()}showMessage(e,t){sa(ah(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=ah(e)?mQ(e,{actionHandler:{callback:s=>{this.closeMessage(),vde(this._openerService,s,ah(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new D4e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(T.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&al(xl(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new O(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(D4e.fadeOut(this._messageWidget.value))}},PJ=g0,g0.ID="editor.contrib.messageController",g0.MESSAGE_VISIBLE=new Y("messageVisible",!1,g(xFt,0,"Whether the editor is currently showing an inline message")),g0);Du=PJ=D([_(1,Pe),_(2,fr)],Du);const DFt=Yc.bindToContribution(Du.get);Ke(new DFt({id:"leaveEditorMessage",precondition:Du.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:ye.EditorContrib+30,primary:E.Escape}}));let D4e=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,vt.Smooth),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.Right}}afterRender(e){this._domNode.classList.toggle("below",e===hs.BELOW)}};vn(Du.ID,Du,mi.Lazy);var ch;(function(n){n[n.Explorer=1]="Explorer",n[n.Scm=3]="Scm",n[n.Extensions=5]="Extensions",n[n.Window=10]="Window",n[n.Notification=15]="Notification",n[n.Dialog=20]="Dialog"})(ch||(ch={}));const SBe=class SBe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};SBe.None=Object.freeze({report(){}});let cf=SBe,k4e=class extends ${constructor(e,t){super(),this.deferred=new sd,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(Ee(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};k4e=D([_(1,Cf)],k4e);var kFt=".post-edit-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-widget-border,transparent);border-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);overflow:hidden}.post-edit-widget .monaco-button{border:none;border-radius:0;padding:2px}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}";Ct(kFt,{});var Uye;const I4e="vs/editor/contrib/dropOrPasteInto/browser/postEditWidget";var yN;let Vye=(yN=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Ee(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ee(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(T.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=we(".post-edit-widget"),this.button=this._register(new Tu(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(pe(this.domNode,xe.CLICK,()=>this.showSelector()))}getId(){return Uye.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[hs.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=ia(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>_l({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Uye=yN,yN.baseId="editor.widget.postEditWidget",yN);Vye=Uye=D([_(7,Vr),_(8,Pe),_(9,ti)],Vye);let Hte=class extends ${constructor(e,t,i,s,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Dn),this._register(T.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const c=async v=>{const w=this._editor.getModel();w&&(await w.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,s,o))},l=(v,w)=>{Na(v)||(this._notificationService.error(w),i&&this.show(e[0],t,c))};let d;try{d=await s(a,o)}catch(v){return l(v,g(I4e,0,`Error resolving edit '{0}': +`),parse:n=>R1.split(n).filter(e=>!e.startsWith("#"))}),ZC=class ZC{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ZC.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ZC((this.value?[this.value,...e]:e).join(ZC.sep))}};ZC.sep=".",ZC.None=new ZC("@@none@@"),ZC.Empty=new ZC("");let bs=ZC;var Tv;(function(n){function e(o){return typeof o?.showDirectoryPicker=="function"}n.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}n.isFileSystemHandle=t;function i(o){return o.kind==="file"}n.isFileSystemFileHandle=i;function s(o){return o.kind==="directory"}n.isFileSystemDirectoryHandle=s})(Tv||(Tv={}));const x4e="vs/platform/files/browser/htmlFileSystemProvider";class uFt{get capabilities(){return this._capabilities||(this._capabilities=es.FileReadWrite|es.FileReadStream,jr&&(this._capabilities|=es.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.extUri=jr?Fn:Gle,this._files=new Map,this._directories=new Map}async stat(e){try{const t=await this.getHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, stat",rt.FileNotFound);if(Tv.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:an.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:an.Directory,mtime:0,ctime:0,size:0}}catch(t){throw this.toFileSystemProviderError(t)}}async readdir(e){try{const t=await this.getDirectoryHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readdir",rt.FileNotFound);const i=[];for await(const[s,o]of t)i.push([s,Tv.isFileSystemFileHandle(o)?an.File:an.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer,{highWaterMark:10});return(async()=>{try{const o=await this.getFileHandle(e);if(!o)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const r=await o.getFile();if(typeof t.length=="number"||typeof t.position=="number"){let a=new Uint8Array(await r.arrayBuffer());typeof t?.position=="number"&&(a=a.slice(t.position)),typeof t?.length=="number"&&(a=a.slice(0,t.length)),s.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await s.write(c.value),i.isCancellationRequested));)c=await a.read();s.end(void 0)}}catch(o){s.error(this.toFileSystemProviderError(o)),s.end()}})(),s}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",rt.FileNotFound);const i=await t.getFile();return new Uint8Array(await i.arrayBuffer())}catch(t){throw this.toFileSystemProviderError(t)}}async writeFile(e,t,i){try{let s=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(s){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",rt.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",rt.FileNotFound)}if(!s){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",rt.FileNotFound);if(s=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!s)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",rt.Unknown)}const o=await s.createWritable();await o.write(t),await o.close()}catch(s){throw this.toFileSystemProviderError(s)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",rt.FileNotFound);await t.getDirectoryHandle(this.extUri.basename(e),{create:!0})}catch(t){throw this.toFileSystemProviderError(t)}}async delete(e,t){try{const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(!i)throw this.createFileSystemProviderError(e,"No such parent directory, delete",rt.FileNotFound);return i.removeEntry(this.extUri.basename(e),{recursive:t.recursive})}catch(i){throw this.toFileSystemProviderError(i)}}async rename(e,t,i){try{if(this.extUri.isEqual(e,t))return;const s=await this.getFileHandle(e);if(s){const o=await s.getFile(),r=new Uint8Array(await o.arrayBuffer());await this.writeFile(t,r,{create:!0,overwrite:i.overwrite,unlock:!1,atomic:!1}),await this.delete(e,{recursive:!1,useTrash:!1,atomic:!1})}else throw this.createFileSystemProviderError(e,g(x4e,0,"Rename is only supported for files."),rt.Unavailable)}catch(s){throw this.toFileSystemProviderError(s)}}watch(e,t){return $.None}registerFileHandle(e){return this.registerHandle(e,this._files)}registerDirectoryHandle(e){return this.registerHandle(e,this._directories)}get directories(){return this._directories.values()}async registerHandle(e,t){let i=`/${e.name}`;if(t.has(i)&&!await t.get(i)?.isSameEntry(e)){const s=T_(e.name),o=yr(e.name,s);let r=1;do i=`/${o}-${r++}${s}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",s=>s.put(e,i))}catch(s){this.logService.error(s)}return P.from({scheme:_e.file,path:i})}async getHandle(e){let t=await this.doGetHandle(e);if(!t){const i=await this.getDirectoryHandle(this.extUri.dirname(e));if(i){const s=Fn.basename(e);try{t=await i.getFileHandle(s)}catch{try{t=await i.getDirectoryHandle(s)}catch{}}}}return t}async getFileHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemFileHandle)return t;const i=await this.getDirectoryHandle(this.extUri.dirname(e));try{return await i?.getFileHandle(Fn.basename(e))}catch{return}}async getDirectoryHandle(e){const t=await this.doGetHandle(e);if(t instanceof FileSystemDirectoryHandle)return t;const i=this.extUri.dirname(e);if(this.extUri.isEqual(i,e))return;const s=await this.getDirectoryHandle(i);try{return await s?.getDirectoryHandle(Fn.basename(e))}catch{return}}async doGetHandle(e){if(this.extUri.dirname(e).path!=="/")return;const t=e.path.replace(/\/$/,""),i=this._files.get(t)??this._directories.get(t);if(i)return i;const s=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(Tv.isFileSystemHandle(s)){let o=await s.queryPermission()==="granted";try{o||(o=await s.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return Tv.isFileSystemFileHandle(s)?this._files.set(t,s):Tv.isFileSystemDirectoryHandle(s)&&this._directories.set(t,s),s}throw this.createFileSystemProviderError(e,"No file system handle registered",rt.Unavailable)}toFileSystemProviderError(e){if(e instanceof Nx)return e;let t=rt.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(x4e,1,"Insufficient permissions. Please retry and allow the operation.")),t=rt.Unavailable),xs(e,t)}createFileSystemProviderError(e,t,i){return xs(new Error(`${t} (${d1(e.path)})`),i)}}const gFt="vs/platform/dnd/browser/dnd",bF={EDITORS:"CodeEditors",FILES:"CodeFiles"};function fFt(n){const e=[];if(n.dataTransfer&&n.dataTransfer.types.length>0){const s=n.dataTransfer.getData(bF.EDITORS);if(s)try{e.push(...JU(s))}catch{}else try{const a=n.dataTransfer.getData(gm.RESOURCES);e.push(...pFt(a))}catch{}if(n.dataTransfer?.files)for(let a=0;amFt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function pFt(n){const e=[];if(n){const t=JSON.parse(n);for(const i of t)if(i.indexOf(":")>0){const{selection:s,uri:o}=TNe(P.parse(i));e.push({resource:o,options:{selection:s}})}}return e}async function mFt(n,e){if(Tv.supported(yi)){const i=e.dataTransfer?.items;if(i)return _Ft(n,i)}const t=e.dataTransfer?.files;return t?vFt(n,t):[]}async function _Ft(n,e){const t=n.get(ci).getProvider(_e.file);if(!(t instanceof uFt))return[];const i=[];for(let s=0;s{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}Tv.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Tv.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Ui(await Promise.all(i.map(s=>s.p)))}async function vFt(n,e){const t=n.get(To),i=[];for(let s=0;s100*vl.MB){t.warn(g(gFt,0,"File is too large to open as untitled editor. Please upload it first into the file explorer and then try again."));continue}const r=new sd;i.push(r);const a=new FileReader;a.onerror=()=>r.complete(void 0),a.onabort=()=>r.complete(void 0),a.onload=async c=>{const l=o.name,d=c.target?.result??void 0;if(typeof l!="string"||typeof d>"u"){r.complete(void 0);return}r.complete({resource:P.from({scheme:_e.untitled,path:l}),contents:typeof d=="string"?ze.fromString(d):ze.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Ui(await Promise.all(i.map(s=>s.p)))}function Ctt(n,...e){if(!n.dataTransfer)return!1;const t=n.dataTransfer.types,i=[];for(let s=0;s=0)return!0;return!1}class wFt{constructor(){this._contributions=new Map}register(e){if(this._contributions.has(e.dataFormatKey))throw new Error(`A drag and drop contributiont with key '${e.dataFormatKey}' was already registered.`);this._contributions.set(e.dataFormatKey,e)}getAll(){return this._contributions.values()}}const nFe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};it.add(nFe.DragAndDropContribution,new wFt);const i9=class i9{constructor(){}static getInstance(){return i9.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}};i9.INSTANCE=new i9;let Ote=i9;function ytt(n){const e=new fhe;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,HQ(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,bFt(s))}}return e}function bFt(n){const e=n.path?P.parse(n.path):void 0;return hFt(n.name,e,async()=>new Uint8Array(await n.arrayBuffer()))}const CFt=Object.freeze([bF.EDITORS,bF.FILES,gm.RESOURCES,gm.INTERNAL_URI_LIST]);function Stt(n,e=!1){const t=ytt(n),i=t.get(gm.INTERNAL_URI_LIST);if(i)t.replace(Js.uriList,i);else if(e||!t.has(Js.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=r.path;try{a?s.push(P.file(a).toString()):s.push(P.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(Js.uriList,HQ(R1.create(s)))}for(const s of CFt)t.delete(s);return t}const dI="vs/editor/contrib/dropOrPasteInto/browser/defaultProviders";class sFe{async provideDocumentPasteEdits(e,t,i,s,o){const r=await this.getEdit(i,o);if(r)return{dispose(){},edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}]}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);return o?[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}]:void 0}}const q2=class q2 extends sFe{constructor(){super(...arguments),this.id=q2.id,this.kind=q2.kind,this.dropMimeTypes=[Js.text],this.pasteMimeTypes=[Js.text]}async getEdit(e,t){const i=e.get(Js.text);if(!i||e.has(Js.uriList))return;const s=await i.asString();return{handledMimeType:Js.text,title:g(dI,0,"Insert Plain Text"),insertText:s,kind:this.kind}}};q2.id="text",q2.kind=new bs("text.plain");let CF=q2;class Att extends sFe{constructor(){super(...arguments),this.kind=new bs("uri.absolute"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===_e.file?a.fsPath:(s++,c)).join(" ");let r;return s>0?r=i.length>1?g(dI,1,"Insert Uris"):g(dI,2,"Insert Uri"):r=i.length>1?g(dI,3,"Insert Paths"):g(dI,4,"Insert Path"),{handledMimeType:Js.uriList,insertText:o,title:r,kind:this.kind}}}let Bte=class extends sFe{constructor(e){super(),this._workspaceContextService=e,this.kind=new bs("uri.relative"),this.dropMimeTypes=[Js.uriList],this.pasteMimeTypes=[Js.uriList]}async getEdit(e,t){const i=await Ett(e);if(!i.length||t.isCancellationRequested)return;const s=Ui(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?lO(r.uri,o):void 0}));if(s.length)return{handledMimeType:Js.uriList,insertText:s.join(" "),title:i.length>1?g(dI,5,"Insert Relative Paths"):g(dI,6,"Insert Relative Path"),kind:this.kind}}};Bte=D([_(0,Ti)],Bte);class yFt{constructor(){this.kind=new bs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Js.text}]}async provideDocumentPasteEdits(e,t,i,s,o){if(s.triggerKind!==x9.PasteAs&&!s.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:g(dI,7,"Insert HTML"),kind:this.kind}]}}}async function Ett(n){const e=n.get(Js.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of R1.parse(t))try{i.push({uri:P.parse(s),originalText:s})}catch{}return i}let Bye=class extends ${constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new CF)),this._register(e.documentDropEditProvider.register("*",new Att)),this._register(e.documentDropEditProvider.register("*",new Bte(t)))}};Bye=D([_(0,ht),_(1,Ti)],Bye);let Wye=class extends ${constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new CF)),this._register(e.documentPasteEditProvider.register("*",new Att)),this._register(e.documentPasteEditProvider.register("*",new Bte(t))),this._register(e.documentPasteEditProvider.register("*",new yFt))}};Wye=D([_(0,ht),_(1,Ti)],Wye);function xtt(n,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new vS(n,{range:i,text:typeof t.insertText=="string"?ww.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Dtt(n){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of n)for(const a of r.yieldTo??[])for(const c of n)if(c!==r&&e(a,c)){let l=t.get(r);l||(l=[],t.set(r,l)),l.push(c)}if(!t.size)return Array.from(n);const i=new Set,s=[];function o(r){if(!r.length)return[];const a=r[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let c=[];const l=t.get(a);return l&&(s.push(a),c=o(l),s.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(n))}var SFt=".inline-editor-progress-decoration{display:inline-block;height:1em;width:1em}.inline-progress-widget{align-items:center;display:flex!important;justify-content:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{animation:none;font-size:90%!important}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(SFt,{});const AFt=Kt.register({description:"inline-progress-widget",stickiness:gi.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:AQe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Yae=class Yae extends ${constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=we(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=we("span.icon");this.domNode.append(t),t.classList.add(...$e.asClassNameArray(Ce.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(x.fontSize)||s.hasChanged(x.lineHeight))&&i()})),this._register(pe(this.domNode,xe.CLICK,s=>{this.delegate.cancel()}))}getId(){return Yae.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[hs.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Yae.baseId="editor.widget.inlineProgressWidget";let Hye=Yae,Wte=class extends ${constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Dn),this._currentWidget=new Dn,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=PS(()=>{const o=O.fromPositions(e);this._currentDecorations.set([{range:o,options:AFt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Hye,this.id,this._editor,o,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Wte=D([_(2,be)],Wte);var EFt=".monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);padding:2px 4px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{border:8px solid transparent;height:0!important;left:2px;position:absolute;width:0!important;z-index:1000}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage.below .anchor.below,.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}";Ct(EFt,{});var PJ;const xFt="vs/editor/contrib/message/browser/messageController";var g0;let Du=(g0=class{static get(e){return e.getContribution(PJ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Dn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=PJ.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}isVisible(){return this._visible.get()}showMessage(e,t){sa(ah(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=ah(e)?mQ(e,{actionHandler:{callback:s=>{this.closeMessage(),vde(this._openerService,s,ah(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new D4e(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(T.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&al(xl(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(pe(this._messageWidget.value.getDomNode(),xe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new O(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(D4e.fadeOut(this._messageWidget.value))}},PJ=g0,g0.ID="editor.contrib.messageController",g0.MESSAGE_VISIBLE=new Y("messageVisible",!1,g(xFt,0,"Whether the editor is currently showing an inline message")),g0);Du=PJ=D([_(1,Pe),_(2,fr)],Du);const DFt=Jc.bindToContribution(Du.get);Ke(new DFt({id:"leaveEditorMessage",precondition:Du.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:ye.EditorContrib+30,primary:E.Escape}}));let D4e=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,vt.Smooth),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.Right}}afterRender(e){this._domNode.classList.toggle("below",e===hs.BELOW)}};vn(Du.ID,Du,mi.Lazy);var ch;(function(n){n[n.Explorer=1]="Explorer",n[n.Scm=3]="Scm",n[n.Extensions=5]="Extensions",n[n.Window=10]="Window",n[n.Notification=15]="Notification",n[n.Dialog=20]="Dialog"})(ch||(ch={}));const SBe=class SBe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};SBe.None=Object.freeze({report(){}});let cf=SBe,k4e=class extends ${constructor(e,t){super(),this.deferred=new sd,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(Ee(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};k4e=D([_(1,Cf)],k4e);var kFt=".post-edit-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-widget-border,transparent);border-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);overflow:hidden}.post-edit-widget .monaco-button{border:none;border-radius:0;padding:2px}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}";Ct(kFt,{});var Uye;const I4e="vs/editor/contrib/dropOrPasteInto/browser/postEditWidget";var yN;let Vye=(yN=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Ee(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ee(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{o.containsPosition(h.position)||this.dispose()})),this._register(T.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=we(".post-edit-widget"),this.button=this._register(new Tu(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(pe(this.domNode,xe.CLICK,()=>this.showSelector()))}getId(){return Uye.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[hs.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=ia(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>_l({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Uye=yN,yN.baseId="editor.widget.postEditWidget",yN);Vye=Uye=D([_(7,Vr),_(8,Pe),_(9,ti)],Vye);let Hte=class extends ${constructor(e,t,i,s,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Dn),this._register(T.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const c=async v=>{const w=this._editor.getModel();w&&(await w.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,s,o))},l=(v,w)=>{Na(v)||(this._notificationService.error(w),i&&this.show(e[0],t,c))};let d;try{d=await s(a,o)}catch(v){return l(v,g(I4e,0,`Error resolving edit '{0}': {1}`,a.title,Ma(v)))}if(o.isCancellationRequested)return;const h=xtt(r.uri,e,d),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(h,{editor:this._editor,token:o}),m=r.getDecorationRange(f[0])}catch(v){return l(v,g(I4e,1,`Error applying edit '{0}': -{1}`,a.title,Ma(v)))}finally{r.deltaDecorations(f,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,c)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Vye,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Hte=D([_(4,be),_(5,vO),_(6,Pi)],Hte);var YL;const CB="vs/editor/contrib/dropOrPasteInto/browser/copyPasteController",ktt="editor.changePasteType",oFe=new Y("pasteWidgetVisible",!1,g(CB,0,"Whether the paste widget is showing")),cpe="application/vnd.code.copyMetadata";var SN;let jS=(SN=class extends ${static get(e){return e.getContribution(YL.ID)}constructor(e,t,i,s,o,r,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(pe(c,"copy",l=>this.handleCopy(l))),this._register(pe(c,"cut",l=>this.handleCopy(l))),this._register(pe(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new Wte("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Hte,"pasteIntoEditor",e,oFe,{id:ktt,label:g(CB,1,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Kg().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(x.pasteAs).enabled&&!this._editor.getOption(x.readOnly)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(!this._editor.hasTextFocus()||(Jn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const s=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!s)return;o=[new O(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,s,Is),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=ytt(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=Dr();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=na(async m=>{const v=Ui(await Promise.all(d.map(async w=>{try{return await w.prepareDocumentPaste(t,o,h,m)}catch(b){console.error(b);return}})));v.reverse();for(const w of v)for(const[b,C]of w)h.replace(b,C);return h});YL._currentCopyOperation?.dataTransferPromise.cancel(),YL._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Du.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e),o=Stt(e.clipboardData);o.delete(cpe);const r=[...e.clipboardData.types,...s?.providerCopyMimeTypes??[],Js.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const l=this._pasteAsActionContext?.preferred;return l&&c.providedPasteEditKinds&&!this.providerMatchesPreference(c,l)?!1:c.pasteMimeTypes?.some(d=>vtt(d,r))});if(!a.length){this._pasteAsActionContext?.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,s):this.doPasteInline(a,i,o,s,e)}showPasteAsNoEditMessage(e,t){Du.get(this._editor)?.showMessage(g(CB,2,"No paste edits for '{0}' found",t instanceof bs?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(i,s,d.token),d.token.isCancellationRequested)return;const h=e.filter(p=>this.isSupportedPasteProvider(p,i));if(!h.length||h.length===1&&h[0]instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);const u={triggerKind:x9.Automatic},f=await this.getPasteEdits(h,i,l,t,u,d.token);if(d.token.isCancellationRequested)return;if(f.length===1&&f[0].provider instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);if(f.length){const p=c.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:f},p,async(m,v)=>{const w=await m.provider.resolveDocumentPasteEdit?.(m,v);return w&&(m.additionalEdit=w.additionalEdit),m},d.token)}await this.applyDefaultPasteHandler(i,s,d.token,o)}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(CB,3,"Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>this.isSupportedPasteProvider(v,s,e));e&&(h=h.filter(v=>this.providerMatchesPreference(v,e)));const u={triggerKind:x9.PasteAs,only:e&&e instanceof bs?e:void 0};let f=await this.getPasteEdits(h,s,l,i,u,d.token);if(d.token.isCancellationRequested)return;if(e&&(f=f.filter(v=>e instanceof bs?e.contains(v.kind):e.providerId===v.provider.id)),!f.length){u.only&&this.showPasteAsNoEditMessage(i,u.only);return}let p;if(e?p=f.at(0):p=(await this._quickInputService.pick(f.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(CB,4,"Select Paste Action")}))?.edit,!p)return;const m=xtt(l.uri,i,p);await this._bulkEditService.apply(m,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:ch.Window,title:g(CB,5,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(cpe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(cpe);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=uwe.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&YL._currentCopyOperation?.handle===t.id){const s=await YL._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of s)e.replace(o,r)}if(!e.has(Js.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(Js.uriList,HQ(R1.create(s)))}}async getPasteEdits(e,t,i,s,o,r){const a=await dw(Promise.all(e.map(async l=>{try{return(await l.provideDocumentPasteEdits?.(i,s,t,o,r))?.edits?.map(h=>({...h,provider:l}))}catch(d){console.error(d)}})),r),c=Ui(a??[]).flat().filter(l=>!o.only||o.only.contains(l.kind));return Dtt(c)}async applyDefaultPasteHandler(e,t,i,s){const r=await(e.get(Js.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",Hc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(s=>t.matches(s))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof bs?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},YL=SN,SN.ID="editor.contrib.copyPasteActionController",SN);jS=YL=D([_(1,be),_(2,vO),_(3,Mu),_(4,ht),_(5,On),_(6,Cf)],jS);const ls=new class{constructor(){this.QuickFix=new bs("quickfix"),this.Refactor=new bs("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new bs("notebook"),this.Source=new bs("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var th;(function(n){n.IfSingle="ifSingle",n.First="first",n.Never="never"})(th||(th={}));var _f;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(_f||(_f={}));function IFt(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>Itt(e,t,n.include))||!n.includeSourceActions&&ls.Source.contains(e))}function LFt(n,e){const t=e.kind?new bs(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>Itt(t,i,n.include))||!n.includeSourceActions&&t&&ls.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function Itt(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Ey{static fromUser(e,t){return!e||typeof e!="object"?new Ey(t.kind,t.apply,!1):new Ey(Ey.getKindFromUser(e,t.kind),Ey.getApplyFromUser(e,t.apply),Ey.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return th.First;case"never":return th.Never;case"ifsingle":return th.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new bs(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class TFt{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){er(i)}t&&(this.action.edit=t.edit)}return this}}const RFt="vs/editor/contrib/codeAction/browser/codeAction",rFe="editor.action.codeAction",aFe="editor.action.quickFix",Ltt="editor.action.autoFix",cFe="editor.action.refactor",lFe="editor.action.sourceAction",zye="editor.action.organizeImports",$ye="editor.action.fixAll";class Y$ extends ${static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:mo(e.diagnostics)?mo(t.diagnostics)?Y$.codeActionsPreferredComparator(e,t):-1:mo(t.diagnostics)?1:Y$.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Y$.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ls.QuickFix.contains(new bs(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const L4e={actions:[],documentation:void 0};async function KW(n,e,t,i,s,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ls.Notebook]},c={only:r.include?.value,trigger:i.type},l=new dPe(e,o),d=i.type===wu.Auto,h=MFt(n,e,d?a:r),u=new Z,f=h.map(async m=>{try{s.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return L4e;const w=(v?.actions||[]).filter(C=>C&&LFt(r,C)),b=PFt(m,w,r.include);return{actions:w.map(C=>new TFt(C,m)),documentation:b}}catch(v){if(Na(v))throw v;return er(v),L4e}}),p=n.onDidChange(()=>{const m=n.all(e);Ls(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(b=>b.actions).flat(),w=[...Ui(m.map(b=>b.documentation)),...NFt(n,e,i,v)];return new Y$(v,w,u)}finally{p.dispose(),l.dispose()}}function MFt(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>IFt(t,new bs(s))):!0)}function*NFt(n,e,t,i){if(e&&i.length)for(const s of n.all(e))s._getAdditionalMenuItems&&(yield*s._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function PFt(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new bs(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s?.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new bs(s.kind)))return o.command}}var hI;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb"})(hI||(hI={}));async function Ttt(n,e,t,i,s=qe.None){const o=n.get(vO),r=n.get(Qi),a=n.get(on),c=n.get(Pi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(s),!s.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await o.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==hI.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=FFt(l);c.error(typeof d=="string"?d:g(RFt,0,"An unknown error occurred while applying the code action"))}}function FFt(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}yt.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof P))throw Hi();const{codeActionProvider:o}=n.get(ht),r=n.get(Ai).getModel(e);if(!r)throw Hi();const a=mt.isISelection(t)?mt.liftSelection(t):O.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Hi();const c=typeof i=="string"?new bs(i):void 0,l=await KW(o,r,a,{type:wu.Invoke,triggerAction:_f.Default,filter:{includeSourceActions:!0,include:c}},cf.None,qe.None),d=[],h=Math.min(l.validActions.length,typeof s=="number"?s:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var Gye,AN;let qye=(AN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ka(()=>this.keybindingService.getKeybindings().filter(t=>Gye.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===zye?i={kind:ls.SourceOrganizeImports.value}:t.command===$ye&&(i={kind:ls.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Ey.fromUser(i,{kind:bs.None,apply:th.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new bs(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}},Gye=AN,AN.codeActionCommands=[cFe,rFe,lFe,zye,$ye],AN);qye=Gye=D([_(0,ti)],qye);var OFt='.action-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-editorWidget-border)!important;border-radius:0;border-radius:2px;color:var(--vscode-editorWidget-foreground);display:block;font-size:13px;max-width:80vw;min-width:160px;width:100%;z-index:40}.context-view-block{z-index:-1}.context-view-block,.context-view-pointerBlock{cursor:auto;height:100%;left:0;position:fixed;top:0;width:100%}.context-view-pointerBlock{z-index:2}.action-widget .monaco-list{border:0!important;user-select:none;-webkit-user-select:none}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{cursor:pointer;padding:0 10px;touch-action:none;white-space:nowrap;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before,.action-widget .monaco-list .option-disabled:before{-webkit-touch-callout:none;background-color:transparent!important;cursor:default!important;outline:0 solid!important;-webkit-user-select:none;user-select:none}.action-widget .monaco-list-row.action{align-items:center;display:flex;gap:6px}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{content:"";display:block;width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}';Ct(OFt,{});const Ute="vs/platform/actionWidget/browser/actionList",Rtt="acceptSelectedCodeAction",Mtt="previewSelectedCodeAction";var Rv;(function(n){n.Action="action",n.Header="header"})(Rv||(Rv={}));class BFt{get templateId(){return Rv.Header}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??""}disposeTemplate(e){}}let Qye=class{get templateId(){return Rv.Action}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new Dz(e,zc);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=$e.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ye(e.group.icon.color.id))):(i.icon.className=$e.asClassName(Ce.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Ntt(e.label),i.keybinding.set(e.keybinding),_je(!!e.keybinding,i.keybinding.element);const s=this._keybindingService.lookupKeybinding(Rtt)?.getLabel(),o=this._keybindingService.lookupKeybinding(Mtt)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:s&&o?this._supportsPreview&&e.canPreview?i.container.title=g(Ute,0,"{0} to Apply, {1} to Preview",s,o):i.container.title=g(Ute,1,"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Qye=D([_(1,ti)],Qye);class WFt extends UIEvent{constructor(){super("acceptSelectedAction")}}class T4e extends UIEvent{constructor(){super("previewSelectedAction")}}function HFt(n){if(n.kind==="action")return n.label}let jye=class extends ${constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ai),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===Rv.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Pc(e,this.domNode,a,[new Qye(t,this._keybindingService),new BFt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:HFt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===Rv.Action){let l=c.label?Ntt(c?.label):"";return c.disabled&&(l=g(Ute,2,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(Ute,3,"Action Widget"),getRole:c=>c.kind===Rv.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(bO),this._register(this._list.onMouseClick(c=>this.onListClick(c))),this._register(this._list.onMouseOver(c=>this.onListHover(c))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(c=>this.onListSelection(c))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind===Rv.Action}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);let o=e;if(this._allMenuItems.length>=50)o=380;else{const c=this._allMenuItems.map((l,d)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(d));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});o=Math.max(...c,e)}const a=Math.min(s,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new T4e:new WFt;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof T4e):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind===Rv.Action){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};jye=D([_(4,W_),_(5,ti)],jye);function Ntt(n){return n.replace(/\r\n|\r|\n/g," ")}const RD="vs/editor/contrib/codeAction/browser/codeActionMenu",Ptt=Object.freeze({kind:bs.Empty,title:g(RD,0,"More Actions...")}),UFt=Object.freeze([{kind:ls.QuickFix,title:g(RD,1,"Quick Fix")},{kind:ls.RefactorExtract,title:g(RD,2,"Extract"),icon:Ce.wrench},{kind:ls.RefactorInline,title:g(RD,3,"Inline"),icon:Ce.wrench},{kind:ls.RefactorRewrite,title:g(RD,4,"Rewrite"),icon:Ce.wrench},{kind:ls.RefactorMove,title:g(RD,5,"Move"),icon:Ce.wrench},{kind:ls.SurroundWith,title:g(RD,6,"Surround With"),icon:Ce.surroundWith},{kind:ls.Source,title:g(RD,7,"Source Action"),icon:Ce.symbolFile},Ptt]);function VFt(n,e,t){if(!e)return n.map(o=>({kind:Rv.Action,item:o,group:Ptt,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=UFt.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new bs(o.action.kind):bs.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:Rv.Header,group:o.group});for(const r of o.actions){const a=o.group;s.push({kind:Rv.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:Ce.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return s}var zFt='.monaco-editor .lightBulbWidget{align-items:center;display:flex;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{background-color:var(--vscode-editor-background);content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}';Ct(zFt,{});var Kye;const NK="vs/editor/contrib/codeAction/browser/lightBulbWidget";var ib;(function(n){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=n.Type||(n.Type={})),n.Hidden={type:e.Hidden};class t{constructor(s,o,r,a){this.actions=s,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}n.Showing=t})(ib||(ib={}));var f0;let J7=(f0=class extends ${constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=ib.Hidden,this._iconClasses=[],this._domNode=we("div.lightBulbWidget"),this._domNode.role="listbox",this._register(dh.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(s=>{const o=this._editor.getModel();(this.state.type!==ib.Type.Showing||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(Mut(this._domNode,s=>{if(this.state.type!==ib.Type.Showing)return;this._editor.focus(),s.preventDefault();const{top:o,height:r}=ia(this._domNode),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(s.buttons&1)===1&&this.hide()})),this._register(T.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(Ltt)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(aFe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===ib.Type.Showing?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(x.lightbulb).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),c=o.getOptions().tabSize,l=this._editor.getOptions().get(x.fontInfo),d=o.getLineContent(r),h=dde(d,c),u=l.spaceWidth*h>22,f=b=>b>2&&this._editor.getTopForLineNumber(b)===this._editor.getTopForLineNumber(b-1);let p=r,m=1;if(!u){if(r>1&&!f(r-1))p-=1;else if(ro,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}clear(){this._list.clear()}_renderWidget(e,t,i){const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new Z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(pe(a,xe.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(pe(l,xe.POINTER_MOVE,()=>l.remove())),o.add(pe(l,xe.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);s.style.width=`${h}px`;const u=o.add(Dd(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=we(e),s=new Qh(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){this._list.value?.hide(e)}};SF=D([_(0,W_),_(1,Pe),_(2,be)],SF);ce(DO,SF,Kt.Delayed);const UQ=ye.EditorContrib+1e3;At(class extends pi{constructor(){super({id:"hideCodeActionWidget",title:Be(xO,2,"Hide action widget"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Escape,secondary:[V.Shift|E.Escape]}})}run(n){n.get(DO).hide(!0)}});At(class extends pi{constructor(){super({id:"selectPrevCodeAction",title:Be(xO,3,"Select previous action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusPrevious()}});At(class extends pi{constructor(){super({id:"selectNextCodeAction",title:Be(xO,4,"Select next action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusNext()}});At(class extends pi{constructor(){super({id:Rtt,title:Be(xO,5,"Accept selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Enter,secondary:[V.CtrlCmd|E.Period]}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected()}});At(class extends pi{constructor(){super({id:Mtt,title:Be(xO,6,"Preview selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:V.CtrlCmd|E.Enter}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected(!0)}});const Ftt=new Y("supportedCodeAction",""),R4e="_typescript.applyFixAllCodeAction";class $Ft extends ${constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new O_),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>_n(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:wu.Auto,triggerAction:_f.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===wu.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==bv.Off){{if(i===bv.On)return t;if(i===bv.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),c=o.getLineContent(r);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var ab;(function(n){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=n.Type||(n.Type={})),n.Empty={type:e.Empty};class t{constructor(s,o,r){this.trigger=s,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Na(a))return Ott;throw a})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=t})(ab||(ab={}));const Ott=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class GFt extends ${constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Dn),this._state=ab.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Ftt.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.lightbulb)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(ab.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(ab.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(x.readOnly)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new $Ft(this._editor,this._markerService,i=>{if(!i){this.setState(ab.Empty);return}const s=i.selection.getStartPosition(),o=na(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===wu.Invoke&&(i.trigger.triggerAction===_f.QuickFix||i.trigger.filter?.include?.contains(ls.QuickFix))){const l=await KW(this._registry,e,i.selection,i.trigger,cf.None,c),d=[...l.allActions];if(c.isCancellationRequested)return Ott;const h=l.validActions?.some(f=>f.action.kind?ls.QuickFix.contains(new bs(f.action.kind)):!1),u=this._markerService.read({resource:e.uri});if(h){for(const f of l.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(R4e))&&(f.action.diagnostics=[...u.filter(p=>p.relatedInformation)]);return{validActions:l.validActions,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}else if(!h&&u.length>0){const f=i.selection.getPosition();let p=f,m=Number.MAX_VALUE;const v=[...l.validActions];for(const b of u){const C=b.endColumn,y=b.endLineNumber,S=b.startLineNumber;if(y===f.lineNumber||S===f.lineNumber){p=new oe(y,C);const M={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ls.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new mt(p.lineNumber,p.column,p.lineNumber,p.column),F=await KW(this._registry,e,k,M,cf.None,c);if(F.validActions.length!==0){for(const N of F.validActions)N.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(R4e))&&(N.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...F.allActions),Math.abs(f.column-C)y.findIndex(S=>S.action.title===b.action.title)===C);return w.sort((b,C)=>b.action.isPreferred&&!C.action.isPreferred?-1:!b.action.isPreferred&&C.action.isPreferred||b.action.isAI&&!C.action.isAI?1:!b.action.isAI&&C.action.isAI?-1:0),{validActions:w,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return KW(this._registry,e,i.selection,i.trigger,cf.None,c)});i.trigger.type===wu.Invoke&&this._progressService?.showWhile(o,250);const r=new ab.Triggered(i.trigger,s,o);let a=!1;this._state.type===ab.Type.Triggered&&(a=this._state.trigger.type===wu.Invoke&&r.type===ab.Type.Triggered&&r.trigger.type===wu.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:wu.Auto,triggerAction:_f.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===ab.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var yB;const lpe="vs/editor/contrib/codeAction/browser/codeActionController",qFt="quickfix-edit-highlight";var p0;let AF=(p0=class extends ${static get(e){return e.getContribution(yB.ID)}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._telemetryService=h,this._activeCodeActions=this._register(new Dn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new GFt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ka(()=>{const u=this._editor.getContribution(J7.ID);return u&&this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u}),this._resolver=s.createInstance(qye),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(this._telemetryService.publicLog2("codeAction.showCodeActionsFromLightbulb",{codeActionListLength:e.validActions.length,codeActions:e.validActions.map(i=>i.action.title),codeActionProviders:e.validActions.map(i=>i.provider?.displayName??"")}),e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,hI.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}hideCodeActions(){this._actionWidgetService.hide()}manualTriggerAtCurrentPosition(e,t,i,s){if(!this._editor.hasModel())return;Du.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:wu.Invoke,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,s){try{await this._instantiationService.invokeFunction(Ttt,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:wu.Auto,triggerAction:_f.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide()}async update(e){if(e.type!==ab.Type.Triggered){this._lightBulbWidget.rawValue?.hide();return}let t;try{t=await e.actions}catch(i){bt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===wu.Invoke){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this._lightBulbWidget.value?.hide(),await this._applyCodeAction(s,!1,!1,hI.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Du.get(this._editor)?.showMessage(o.action.disabled,e.trigger.context.position),t.dispose();return}}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length)){Du.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===th.First&&t.validActions.length===0||e.autoApply===th.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===th.First&&t.validActions.length>0||e.autoApply===th.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=oe.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?hI.FromAILightbulb:hI.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:l=>{this._editor?.focus(),s.clear(),i.fromLightbulb&&l!==void 0&&this._telemetryService.publicLog2("codeAction.showCodeActionList.onHide",{codeActionListLength:e.validActions.length,didCancel:l,codeActions:e.validActions.map(d=>d.action.title)})},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new bs(u);h=[ls.RefactorExtract,ls.RefactorInline,ls.RefactorRewrite,ls.RefactorMove,ls.Source].some(m=>m.contains(f))}return{canPreview:h||!!l.action.edit?.edits.length}},onFocus:l=>{if(l&&l.action){const d=l.action.ranges,h=l.action.diagnostics;if(s.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:yB.DECORATION})):d.map(f=>({range:f,options:yB.DECORATION}));s.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:yB.DECORATION}));s.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Cu(g(lpe,0,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,VFt(r,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,vt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=ia(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:g(lpe,1,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(lpe,2,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},yB=p0,p0.ID="editor.contrib.codeActionController",p0.DECORATION=jt.register({description:"quickfix-highlight",className:qFt}),p0);AF=yB=D([_(1,U_),_(2,Pe),_(3,be),_(4,ht),_(5,eD),_(6,Qi),_(7,Re),_(8,DO),_(9,be),_(10,on)],AF);Im((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Fb));const i=n.getColor(Uk);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${pS(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Yye;const Jye="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController",Btt="editor.experimental.dropIntoEditor.defaultProvider",Wtt="editor.changeDropType",dFe=new Y("dropWidgetVisible",!1,g(Jye,0,"Whether the drop widget is showing"));var EN;let EF=(EN=class extends ${static get(e){return e.getContribution(Yye.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=Ote.getInstance(),this._dropProgressManager=this._register(t.createInstance(Wte,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(Hte,"dropIntoEditor",e,dFe,{id:Wtt,label:g(Jye,1,"Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;this._currentOperation?.cancel(),e.focus(),e.setPosition(t);const s=na(async o=>{const r=new I1(e,hr.Value,void 0,o);try{const a=await this.extractDataTransferData(i);if(a.size===0||r.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const l=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(u=>a.matches(u)):!0),d=await this.getDropEdits(l,c,t,a,r);if(r.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),u=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([O.fromPositions(t)],{activeEditIndex:h,allEdits:d},u,async f=>f,o)}}finally{r.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(Jye,2,"Running drop handlers. Click to cancel"),s),this._currentOperation=s}async getDropEdits(e,t,i,s,o){const r=await dw(Promise.all(e.map(async c=>{try{return(await c.provideDocumentDropEdits(t,i,s,o.token))?.map(d=>({...d,providerId:c.id}))}catch(l){console.error(l)}})),o.token),a=Ui(r??[]).flat();return Dtt(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Btt,{resource:e.uri});for(const[s,o]of Object.entries(i)){const r=new bs(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&vtt(s,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new fhe;const t=Stt(e.dataTransfer);if(this.treeItemsTransfer.hasData(pVe.prototype)){const i=this.treeItemsTransfer.getData(pVe.prototype);if(Array.isArray(i))for(const s of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Yye=EN,EN.ID="editor.contrib.dropIntoEditorController",EN);EF=Yye=D([_(1,be),_(2,Re),_(3,ht),_(4,zde)],EF);var QFt=".monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}";Ct(QFt,{});function Xye(n,e){return!!n[e]}class dpe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Xye(e.event,t.triggerModifier),this.hasSideBySideModifier=Xye(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class M4e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Xye(e,t.triggerModifier)}}class PK{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function N4e(n){return n==="altKey"?ei?new PK(E.Meta,"metaKey",E.Alt,"altKey"):new PK(E.Ctrl,"ctrlKey",E.Alt,"altKey"):ei?new PK(E.Alt,"altKey",E.Meta,"metaKey"):new PK(E.Alt,"altKey",E.Ctrl,"ctrlKey")}class phe extends ${constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new I),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new I),this.onExecute=this._onExecute.event,this._onCancel=this._register(new I),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=N4e(this._editor.getOption(x.multiCursorModifier)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(x.multiCursorModifier)){const s=N4e(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new dpe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new dpe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new dpe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new M4e(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new M4e(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}let jFt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class Vte{constructor(e){this._disposables=new Z;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new jFt(r,s));t=Vte._union(t,o),cz(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;sPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},er));return Promise.all(s).then(()=>{const o=new Vte(Ui(i));return t.isCancellationRequested?(o.dispose(),new Vte([])):o})}yt.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;Bt(t instanceof P),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)return[];const r=await Htt(s,o,qe.None);if(!r)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new phe(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(x.links)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(x.links))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=na(t=>Htt(this.providers,e,t));try{const t=new ao(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){bt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(YW.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(x.multiCursorModifier)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(qe.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===_e.file&&o.startsWith(`${_e.file}:`)){const a=P.parse(o);if(a.scheme===_e.file){const c=fv(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=qt(r,l))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(g(sy,0,"Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(g(sy,1,"Failed to open this link because its target is missing.")):bt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===Mt.CONTENT_TEXT&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Zye=xN,xN.ID="editor.linkDetector",xN);yV=Zye=D([_(1,fr),_(2,Pi),_(3,ht),_(4,B_)],yV);const P4e={general:jt.register({description:"detected-link",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:jt.register({description:"detected-link-active",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class YW{static decoration(e,t){return{range:e.range,options:YW._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?P4e.active:P4e.general};return s.hoverMessage=KFt(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!1))}}function KFt(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?g(sy,2,"Execute command"):g(sy,3,"Follow link"),s=e?ei?g(sy,4,"cmd + click"):g(sy,5,"ctrl + click"):ei?g(sy,6,"option + click"):g(sy,7,"alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(sy,8,"Execute command {0}",c)}}return new Xt("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${s})`)}else return new Xt().appendText(`${i} (${s})`)}class YFt extends lt{constructor(){super({id:"editor.action.openLink",label:g(sy,9,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yV.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}vn(yV.ID,yV,mi.AfterFirstRender);Fe(YFt);const mhe="editor.contrib.selectionClipboard",Utt="vs/editor/contrib/hover/browser/hoverActionIds",Vtt="editor.action.showHover",JFt="editor.action.showDefinitionPreviewHover",XFt="editor.action.scrollUpHover",ZFt="editor.action.scrollDownHover",eOt="editor.action.scrollLeftHover",tOt="editor.action.scrollRightHover",iOt="editor.action.pageUpHover",nOt="editor.action.pageDownHover",sOt="editor.action.goToTopHover",oOt="editor.action.goToBottomHover",VQ="editor.action.increaseHoverVerbosityLevel",rOt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",aOt=g(Utt,0,"Increase Hover Verbosity Level"),zQ="editor.action.decreaseHoverVerbosityLevel",cOt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",lOt=g(Utt,1,"Decrease Hover Verbosity Level");var Fd;(function(n){n[n.Idle=0]="Idle",n[n.FirstWait=1]="FirstWait",n[n.SecondWait=2]="SecondWait",n[n.WaitingForAsync=3]="WaitingForAsync",n[n.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Fd||(Fd={}));var KS;(function(n){n[n.Delayed=0]="Delayed",n[n.Immediate=1]="Immediate"})(KS||(KS={}));var Vx;(function(n){n[n.Mouse=0]="Mouse",n[n.Keyboard=1]="Keyboard"})(Vx||(Vx={}));let dOt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class ztt extends ${constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new yn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new yn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new yn(()=>this._triggerLoadingMessage(),0)),this._state=Fd.Idle,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(x.hover).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(Fd.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=nut(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===Fd.WaitingForAsync||this._state===Fd.WaitingForAsyncShowingLoading)&&this._setState(Fd.Idle)}catch(e){bt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Fd.Idle:Fd.WaitingForAsync)}_triggerLoadingMessage(){this._state===Fd.WaitingForAsync&&this._setState(Fd.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Fd.FirstWait||this._state===Fd.SecondWait)return;const e=this._state===Fd.Idle,t=this._state===Fd.WaitingForAsyncShowingLoading;this._onResult.fire(new dOt(this._result.slice(0),e,t))}start(e){if(e===KS.Delayed)this._state===Fd.Idle&&(this._setState(Fd.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Fd.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Fd.SecondWait:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(Fd.Idle,!1)}}const hOt=30,uOt=24;class gOt extends ${constructor(e,t=new Tn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new XPe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Tn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Tn(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?oe.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:ia(t).top+i.top-hOt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=ia(t),o=uw(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-uOt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(s,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=s?hs.ABOVE:hs.BELOW:a=r<=i?hs.BELOW:hs.ABOVE,a===hs.ABOVE?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var DC;const F4e=30,fOt=6;var m0;let zte=(m0=class extends gOt{get isColorPickerVisible(){return!!this._visibleData?.colorPicker}get isVisibleFromKeyboard(){return this._visibleData?.source===Vx.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new Tn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new gNe),this._minimumSize=c,this._hoverVisibleKey=X.hoverVisible.bindTo(t),this._hoverFocusedKey=X.hoverFocused.bindTo(t),he(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(x.fontInfo)&&this._updateFont()}));const l=this._register(Dd(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._visibleData?.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return DC.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return DC._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return DC._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){DC._applyMaxDimensions(this._hover.contentsDomNode,e,t),DC._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Tn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){DC._lastDimensions=new Tn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._visibleData?.colorPicker?.layout()}_findAvailableSpaceVertically(){const e=this._visibleData?.showAtPosition;if(e)return this._positionPreference===hs.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=fOt;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=ia(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=O4e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=O4e(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){this._visibleData?.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(x.fontInfo),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,DC._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,DC._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?jo.LeftOfInjectedText:void 0,preference:[this._positionPreference??hs.ABOVE]}:null}showAt(e,t){if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const i=Zf(this._hover.containerDomNode),s=t.showAtPosition;this._positionPreference=this._findPositionPreference(i,s)??hs.ABOVE,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker?.layout();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+r)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Tn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}setMinimumDimensions(e){this._minimumSize=new Tn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Tn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=Zf(e),i=du(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Zf(e),i=du(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._visibleData?.showAtPosition){const s=Zf(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-F4e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+F4e})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},DC=m0,m0.ID="editor.contrib.resizableContentHoverWidget",m0._lastDimensions=new Tn(0,0),m0);zte=DC=D([_(1,Pe),_(2,Re),_(3,Ur),_(4,ti)],zte);function O4e(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,c=Math.max(Math.abs(n-r)-s/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var ku;(function(n){n[n.Range=1]="Range",n[n.ForeignElement=2]="ForeignElement"})(ku||(ku={}));class hpe{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=ku.Range}equals(e){return e.type===ku.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===ku.Range&&t.lineNumber===this.range.startLineNumber}}class bM{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=ku.ForeignElement}equals(e){return e.type===ku.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===ku.ForeignElement&&this.owner===e.owner}}const hL=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pOt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function mOt(n,e,t,i,s){const o=await Promise.resolve(n.provideHover(t,i,s)).catch(er);if(!(!o||!vOt(o)))return new pOt(n,o,e)}function hFe(n,e,t,i){const o=n.ordered(e).map((r,a)=>mOt(r,a,e,t,i));return tg.fromPromises(o).coalesce()}function _Ot(n,e,t,i){return hFe(n,e,t,i).map(s=>s.hover).toPromise()}nA("_executeHoverProvider",(n,e,t)=>{const i=n.get(ht);return _Ot(i.hoverProvider,e,t,qe.None)});function vOt(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}const NE="vs/editor/contrib/hover/browser/markdownHoverParticipant",h2=we,wOt=ji("hover-increase-verbosity",Ce.add,g(NE,0,"Icon for increaseing hover verbosity.")),bOt=ji("hover-decrease-verbosity",Ce.remove,g(NE,1,"Icon for decreasing hover verbosity."));class xb{constructor(e,t,i,s,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class $tt{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Yl.Increase:return this.hover.canIncreaseVerbosity??!1;case Yl.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let X7=class{constructor(e,t,i,s,o,r,a){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new xb(this,e.range,[new Xt().appendText(g(NE,2,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const c=i.getLineLength(s),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(x.stopRenderingLineAfter),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let u=!1;d>=0&&c>d&&e.range.startColumn>=d&&(u=!0,r.push(new xb(this,e.range,[{value:g(NE,3,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&c>=h&&r.push(new xb(this,e.range,[{value:g(NE,4,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const p of t){const m=p.range.startLineNumber===s?p.range.startColumn:1,v=p.range.endLineNumber===s?p.range.endColumn:o,w=p.options.hoverMessage;if(!w||YU(w))continue;p.options.beforeContentClassName&&(f=!0);const b=new O(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new xb(this,b,Kb(w),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==ku.Range)return tg.EMPTY;const s=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(s)?this._getMarkdownHovers(o,s,e,i):tg.EMPTY}_getMarkdownHovers(e,t,i,s){const o=i.range.getStartPosition();return hFe(e,t,o,s).filter(c=>!YU(c.hover.contents)).map(c=>{const l=c.hover.range?O.lift(c.hover.range):i.range,d=new $tt(c.hover,c.provider,o);return new xb(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new COt(t,e.fragment,this._editor,this._languageService,this._openerService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}markdownHoverContentAtIndex(e){return this._renderedHoverParts?.markdownHoverContentAtIndex(e)??""}focusedMarkdownHoverIndex(){return this._renderedHoverParts?.focusedMarkdownHoverIndex()??1}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i)}};X7=D([_(1,Di),_(2,fr),_(3,Re),_(4,ht),_(5,ti),_(6,Zc)],X7);class COt extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._editor=i,this._languageService=s,this._openerService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=c,this._onFinishedRendering=l,this._focusedHoverPartIndex=-1,this._ongoingHoverOperations=new Map,this._renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._register(Ee(()=>{this._renderedHoverParts.forEach(d=>{d.disposables.dispose()})})),this._register(Ee(()=>{this._ongoingHoverOperations.forEach(d=>{d.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(El(s=>s.ordinal,cg)),e.map((s,o)=>{const r=this._renderHoverPart(o,s.contents,s.source,i);return t.appendChild(r.renderedMarkdown),r})}_renderHoverPart(e,t,i,s){const{renderedMarkdown:o,disposables:r}=this._renderMarkdownContent(t,s);if(!i)return{renderedMarkdown:o,disposables:r};const a=i.supportsVerbosityAction(Yl.Increase),c=i.supportsVerbosityAction(Yl.Decrease);if(!a&&!c)return{renderedMarkdown:o,disposables:r,hoverSource:i};const l=h2("div.verbosity-actions");return o.prepend(l),r.add(this._renderHoverExpansionAction(l,Yl.Increase,a)),r.add(this._renderHoverExpansionAction(l,Yl.Decrease,c)),this._register(pe(o,xe.FOCUS_IN,d=>{d.stopPropagation(),this._focusedHoverPartIndex=e})),this._register(pe(o,xe.FOCUS_OUT,d=>{d.stopPropagation(),this._focusedHoverPartIndex=-1})),{renderedMarkdown:o,disposables:r,hoverSource:i}}_renderMarkdownContent(e,t){const i=h2("div.hover-row");i.tabIndex=0;const s=h2("div.hover-row-contents");i.appendChild(s);const o=new Z;return o.add(Gtt(this._editor,s,e,this._languageService,this._openerService,t)),{renderedMarkdown:i,disposables:o}}_renderHoverExpansionAction(e,t,i){const s=new Z,o=t===Yl.Increase,r=he(e,h2($e.asCSSSelector(o?wOt:bOt)));r.tabIndex=0;const a=new gF("mouse",!1,{target:e,position:{hoverPosition:Oo.LEFT}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupUpdatableHover(a,r,qtt(this._keybindingService,t))),!i)return r.classList.add("disabled"),s;r.classList.add("enabled");const c=()=>this.updateMarkdownHoverPartVerbosityLevel(t);return s.add(new WYe(r,c)),s.add(new HYe(r,c,[E.Enter,E.Space])),s}async updateMarkdownHoverPartVerbosityLevel(e,t=-1,i=!0){const s=this._editor.getModel();if(!s)return;const o=t!==-1?t:this._focusedHoverPartIndex,r=this._getRenderedHoverPartAtIndex(o);if(!r||!r.hoverSource?.supportsVerbosityAction(e))return;const a=r.hoverSource,c=await this._fetchHover(a,s,e);if(!c)return;const l=new $tt(c,a.hoverProvider,a.hoverPosition),d=this._renderHoverPart(o,c.contents,l,this._onFinishedRendering);this._replaceRenderedHoverPartAtIndex(o,d),i&&this._focusOnHoverPartWithIndex(o),this._onFinishedRendering()}markdownHoverContentAtIndex(e){return this._getRenderedHoverPartAtIndex(e)?.renderedMarkdown.innerText??""}focusedMarkdownHoverIndex(){return this._focusedHoverPartIndex}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e);return!(!i||!i.hoverSource?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let s=i===Yl.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),s+=r.verbosityDelta);const a=new ai;this._ongoingHoverOperations.set(o,{verbosityDelta:s,tokenSource:a});const c={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){er(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t){if(e>=this._renderHoverParts.length||e<0)return;const i=this._renderedHoverParts[e];i.renderedMarkdown.replaceWith(t.renderedMarkdown),i.disposables.dispose(),this._renderedHoverParts[e]=t}_focusOnHoverPartWithIndex(e){this._renderedHoverParts[e].renderedMarkdown.focus()}_getRenderedHoverPartAtIndex(e){return this._renderedHoverParts[e]}}function yOt(n,e,t,i,s){e.sort(El(r=>r.ordinal,cg));const o=new Z;for(const r of e)o.add(Gtt(t,n.fragment,r.contents,i,s,n.onContentsChanged));return o}function Gtt(n,e,t,i,s,o){const r=new Z;for(const a of t){if(YU(a))continue;const c=h2("div.markdown-hover"),l=he(c,h2("div.hover-contents")),d=r.add(new vw({editor:n},i,s));r.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",o()}));const h=r.add(d.render(a));l.appendChild(h.element),e.appendChild(c)}return r}function qtt(n,e){switch(e){case Yl.Increase:{const t=n.lookupKeybinding(VQ);return t?g(NE,5,"Increase Hover Verbosity ({0})",t.getLabel()):g(NE,6,"Increase Hover Verbosity")}case Yl.Decrease:{const t=n.lookupKeybinding(zQ);return t?g(NE,7,"Decrease Hover Verbosity ({0})",t.getLabel()):g(NE,8,"Decrease Hover Verbosity")}}}class Qtt{constructor(e,t){this.range=e,this.direction=t}}class uFe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new uFe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){er(t),this._isResolved=!1}}}const Q2=class Q2{static async create(e,t,i,s){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,s);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??Q2._emptyInlayHintList,a])}catch(l){er(l)}}));if(await Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Tc;return new Q2(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const c=i.validatePosition(a.position);let l="before";const d=Q2._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=O.fromPositions(d.getStartPosition(),c),l="after"):(h=O.fromPositions(c,d.getEndPosition()),l="before"),s.push(new uFe(a,new Qtt(h,l),r))}}this.items=s.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new O(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let c=o.getStartOffset(a),l=o.getEndOffset(a);return l-c===1&&(c===r&&a>1?(c=o.getStartOffset(a-1),l=o.getEndOffset(a-1)):l===r&&a{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),c=r.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(_n(h.uri,a.uri))l=!0,d=d||O.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=pa(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:O.collapseToStart(t.range),selectionRevealType:px.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(eSe,1,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(eSe,2,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};tSe=D([_(0,Pe),_(1,Qt),_(2,Pi),_(3,ti)],tSe);ce(_he,tSe,Kt.Delayed);Ke(new class extends Yc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:gFe,kbOpts:{weight:ye.EditorContrib,primary:E.F12}})}runEditorCommand(n,e){return n.get(_he).revealNext(e)}});xr.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:ye.EditorContrib,when:gFe,primary:E.Escape,handler(n){n.get(_he).reset()}});let iSe=class{constructor(e){this._listener=new Map,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),St(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,pa(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};iSe=D([_(0,Qt)],iSe);function nSe(n,e){return e.uri.scheme===n.uri.scheme?!0:!L9(e.uri,_e.walkThroughSnippet,_e.vscodeChatCodeBlock,_e.vscodeChatCodeCompareBlock,_e.vscodeCopilotBackingChatCodeBlock)}async function $Q(n,e,t,i){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,c=>{er(c)})),r=await Promise.all(o);return Ui(r.flat()).filter(a=>nSe(n,a))}function vhe(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function Ktt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function Ytt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function Jtt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function whe(n,e,t,i,s){return $Q(e,t,n,async(o,r,a)=>{const c=(await o.provideReferences(r,a,{includeDeclaration:!0},s))?.filter(d=>nSe(r,d));if(!i||!c||c.length!==2)return c;const l=(await o.provideReferences(r,a,{includeDeclaration:!1},s))?.filter(d=>nSe(r,d));return l&&l.length===1?l:c})}async function GQ(n){const e=await n(),t=new fp(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}nA("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=vhe(i.definitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=Jtt(i.typeDefinitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(ht),s=Ktt(i.declarationProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeReferenceProvider",(n,e,t)=>{const i=n.get(ht),s=whe(i.referenceProvider,e,t,!1,qe.None);return GQ(()=>s)});nA("_executeImplementationProvider",(n,e,t)=>{const i=n.get(ht),s=Ytt(i.implementationProvider,e,t,qe.None);return GQ(()=>s)});const po="vs/editor/contrib/gotoSymbol/browser/goToCommands";Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextPeek,title:g(po,0,"Peek"),group:"navigation",order:100});class SV{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof SV||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const gv=class gv extends wf{static all(){return gv._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of fi.wrap(t.menu))(i.id===Te.EditorContext||i.id===Te.EditorContextPeek)&&(i.when=ge.and(e.precondition,i.when));return t}constructor(e,t){super(gv._patchConfig(t)),this.configuration=e,gv._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Pi),r=e.get(Qt),a=e.get(eD),c=e.get(_he),l=e.get(ht),d=e.get(be),h=t.getModel(),u=t.getPosition(),f=SV.is(i)?i:new SV(h,u),p=new I1(t,hr.Value|hr.Position),m=dw(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;sa(v.ariaMessage);let w;if(v.referenceAt(h.uri,u)){const C=this._getAlternativeCommand(t);!gv._activeAlternativeCommands.has(C)&&gv._allSymbolNavigationCommands.has(C)&&(w=gv._allSymbolNavigationCommands.get(C))}const b=v.references.length;if(b===0){if(!this.configuration.muteMessage){const C=h.getWordAtPosition(u);Du.get(t)?.showMessage(this._getNoResultFoundMessage(C),u)}}else if(b===1&&w)gv._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(C=>w.runEditorCommand(C,t,i,s).finally(()=>{gv._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,s)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,s,o){const r=this._getGoToPreference(i);if(!(i instanceof oC)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),c=s.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,s,o):s.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,s,o){let r;if(BQe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:O.collapseToStart(r),selectionRevealType:px.NearTopIfOutsideViewport,selectionSource:jb.JUMP}},e,s);if(a){if(o){const c=a.getModel(),l=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const s=wF.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),na(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};gv._allSymbolNavigationCommands=new Map,gv._activeAlternativeCommands=new Set;let zx=gv;class qQ extends zx{async _getLocationModel(e,t,i,s){return new fp(await vhe(e.definitionProvider,t,i,s),g(po,1,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,2,"No definition found for '{0}'",e.word):g(po,3,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var _0;At((_0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:_0.id,title:{...Be(po,4,"Go to Definition"),mnemonicTitle:g(po,5,"Go to &&Definition")},precondition:X.hasDefinitionProvider,keybinding:[{when:X.editorTextFocus,primary:E.F12,weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib}],menu:[{id:Te.EditorContext,group:"navigation",order:1.1},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),yt.registerCommandAlias("editor.action.goToDeclaration",_0.id)}},_0.id="editor.action.revealDefinition",_0));var v0;At((v0=class extends qQ{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:v0.id,title:Be(po,6,"Open Definition to the Side"),precondition:ge.and(X.hasDefinitionProvider,X.isInEmbeddedEditor.toNegated()),keybinding:[{when:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,E.F12),weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.F12),weight:ye.EditorContrib}]}),yt.registerCommandAlias("editor.action.openDeclarationToTheSide",v0.id)}},v0.id="editor.action.revealDefinitionAside",v0));var w0;At((w0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:w0.id,title:Be(po,7,"Peek Definition"),precondition:ge.and(X.hasDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Alt|E.F12,linux:{primary:V.CtrlCmd|V.Shift|E.F10},weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:2}}),yt.registerCommandAlias("editor.action.previewDeclaration",w0.id)}},w0.id="editor.action.peekDefinition",w0));class Xtt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ktt(e.declarationProvider,t,i,s),g(po,8,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var DN;At((DN=class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:DN.id,title:{...Be(po,11,"Go to Declaration"),mnemonicTitle:g(po,12,"Go to &&Declaration")},precondition:ge.and(X.hasDeclarationProvider,X.isInEmbeddedEditor.toNegated()),menu:[{id:Te.EditorContext,group:"navigation",order:1.3},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}},DN.id="editor.action.revealDeclaration",DN));At(class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Be(po,13,"Peek Declaration"),precondition:ge.and(X.hasDeclarationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:3}})}});class Ztt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Jtt(e.typeDefinitionProvider,t,i,s),g(po,14,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,15,"No type definition found for '{0}'",e.word):g(po,16,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var kN;At((kN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kN.ID,title:{...Be(po,17,"Go to Type Definition"),mnemonicTitle:g(po,18,"Go to &&Type Definition")},precondition:X.hasTypeDefinitionProvider,keybinding:{when:X.editorTextFocus,primary:0,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.4},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},kN.ID="editor.action.goToTypeDefinition",kN));var IN;At((IN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:IN.ID,title:Be(po,19,"Peek Type Definition"),precondition:ge.and(X.hasTypeDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:4}})}},IN.ID="editor.action.peekTypeDefinition",IN));class eit extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ytt(e.implementationProvider,t,i,s),g(po,20,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,21,"No implementation found for '{0}'",e.word):g(po,22,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var LN;At((LN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:LN.ID,title:{...Be(po,23,"Go to Implementations"),mnemonicTitle:g(po,24,"Go to &&Implementations")},precondition:X.hasImplementationProvider,keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},LN.ID="editor.action.goToImplementation",LN));var TN;At((TN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TN.ID,title:Be(po,25,"Peek Implementations"),precondition:ge.and(X.hasImplementationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F12,weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:5}})}},TN.ID="editor.action.peekImplementation",TN));class tit extends zx{_getNoResultFoundMessage(e){return e?g(po,26,"No references found for '{0}'",e.word):g(po,27,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Be(po,28,"Go to References"),mnemonicTitle:g(po,29,"Go to &&References")},precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Shift|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!0,s),g(po,30,"References"))}});At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Be(po,31,"Peek References"),precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!1,s),g(po,30,"References"))}});class SOt extends zx{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Be(po,32,"Go to Any Symbol"),precondition:ge.and(mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new fp(this._references,g(po,33,"Locations"))}_getNoResultFoundMessage(e){return e&&g(po,34,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}yt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(n,e,t,i,s,o,r)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t)),Bt(Array.isArray(i)),Bt(typeof s>"u"||typeof s=="string"),Bt(typeof r>"u"||typeof r=="boolean");const a=n.get(Qt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(ja(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,vt.Smooth),c.invokeWithinContext(l=>{const d=new class extends SOt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);l.get(be).invokeFunction(d.run.bind(d),c)})}});yt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(n,e,t,i,s)=>{n.get(Qi).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});yt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t));const i=n.get(ht),s=n.get(Qt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!ja(o)||!o.hasModel())return;const r=wF.get(o);if(!r)return;const a=na(l=>whe(i.referenceProvider,o.getModel(),oe.lift(t),!1,l).then(d=>new fp(d,g(po,30,"References")))),c=new O(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});yt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function AOt(n,e,t,i){const s=n.get(Rn),o=n.get(Vr),r=n.get(Qi),a=n.get(be),c=n.get(Pi);if(await i.item.resolve(qe.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(Xs.getMenuItems(Te.EditorContext).map(f=>lR(f)?f.command.id:Dr()));for(const f of zx.all())h.has(f.desc.id)&&d.push(new xn(f.desc.id,id.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await s.createModelReference(l.uri);try{const m=new SV(p.object.textEditorModel,O.getStartPosition(l.range)),v=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,m,v)}finally{p.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Kr),d.push(new xn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:nt.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=ia(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function iit(n,e,t,i){const o=await n.get(Rn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Pe),l=mf.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new qQ({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new SV(o.object.textEditorModel,O.getStartPosition(i.range)),O.lift(i.range))}),o.dispose()}var SB;class Gte{constructor(){this._entries=new L_(50)}get(e){const t=Gte._key(e);return this._entries.get(t)}set(e,t){const i=Gte._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const nit=ae("IInlayHintsCache");ce(nit,Gte,Kt.Delayed);class sSe{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class EOt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var DA;(function(n){n[n.Normal=0]="Normal",n[n.Invisible=1]="Invisible"})(DA||(DA={}));var KE;let AV=(KE=class{static get(e){return e.getContribution(SB.ID)??void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new PZ(this._editor),this._activeRenderMode=DA.Normal,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(c=>{c.hasChanged(x.inlayHints)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(x.inlayHints);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=DA.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=DA.Normal,c=DA.Invisible):(a=DA.Invisible,c=DA.Normal),this._activeRenderMode=a,this._sessionDisposables.add(Nb.getInstance().event(l=>{if(!this._editor.hasModel())return;const d=l.altKey&&l.ctrlKey&&!(l.shiftKey||l.metaKey)?c:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const h=this._editor.getModel(),u=this._copyInlayHintsWithCurrentAnchor(h);this._updateHintsDecorators([h.getFullModelRange()],u),r.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Ee(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set,r=new yn(async()=>{const a=Date.now();s?.dispose(!0),s=new ai;const c=t.onWillDispose(()=>s?.cancel());try{const l=s.token,d=await $te.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(r.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!o.has(h)&&(o.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){bt(l)}finally{s.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>s?.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{s?.cancel();const c=Math.max(r.delay,1250);r.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new phe(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ai;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new EOt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new O(l,1,l,a.getLineMaxColumn(l)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Ee(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(iit,s,this._editor,r.location):uZ.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(qe.None),mo(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>ds.replace(O.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Ra(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(AOt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Mt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof m1&&t?.attachedData instanceof sSe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:nt.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new Qtt(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(O.compareRangesUsingStarts)){const r=t.validateRange(new O(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!O.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=O.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){const i=[],s=(p,m,v,w,b)=>{const C={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:w,attachedData:b};i.push({item:p,classNameRef:m,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:gi.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===DA.Normal?C:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});s(p,v," ",m?Bv.Right:Bv.None)},{fontSize:r,fontFamily:a,padding:c,isUniform:l}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,a);let h={line:0,totalLen:0};for(const p of t){if(h.line!==p.anchor.range.startLineNumber&&(h={line:p.anchor.range.startLineNumber,totalLen:0}),h.totalLen>SB._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&o(p,!1);const m=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v0&&(S=S.slice(0,-k)+"…",M=!0),s(p,this._ruleFactory.createClassNameRef(y),xOt(S),C&&!p.hint.paddingRight?Bv.Right:Bv.None,new sSe(p,v)),M)break}if(p.hint.paddingRight&&o(p,!0),i.length>SB._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(w=>w.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=M_.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}getInlayHintsForLine(e){if(!this._editor.hasModel())return[];const t=new Set,i=[];for(const s of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(s.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},SB=KE,KE.ID="editor.contrib.InlayHints",KE._MAX_DECORATORS=1500,KE._MAX_LABEL_LEN=43,KE);AV=SB=D([_(1,ht),_(2,B_),_(3,nit),_(4,Qi),_(5,Pi),_(6,be)],AV);function xOt(n){return n.replace(/[ \t]/g," ")}yt.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const{inlayHintsProvider:s}=n.get(ht),o=await n.get(Rn).createModelReference(t);try{const r=await $te.create(s,o.object.textEditorModel,[O.lift(i)],qe.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});const bD="vs/editor/contrib/inlayHints/browser/inlayHintsHover";class B4e extends bM{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let qte=class extends X7{constructor(e,t,i,s,o,r,a,c){super(e,t,i,r,c,s,o),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!AV.get(this._editor)||e.target.type!==Mt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof m1&&i.attachedData instanceof sSe?new B4e(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof B4e?new tg(async s=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Xt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&s.emitOne(new xb(this,e.range,[r],!1,0)),mo(o.item.hint.textEdits)&&s.emitOne(new xb(this,e.range,[new Xt().appendText(g(bD,0,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Xt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&s.emitOne(new xb(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?ei?g(bD,1,"cmd + click"):g(bD,2,"ctrl + click"):ei?g(bD,3,"option + click"):g(bD,4,"alt + click");o.part.location&&o.part.command?l=new Xt().appendText(g(bD,5,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Xt().appendText(g(bD,6,"Go to Definition ({0})",h)):o.part.command&&(l=new Xt(`[${g(bD,7,"Execute Command")}](${jtt(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&s.emitOne(new xb(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)s.emitOne(l)}):tg.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return tg.EMPTY;const{uri:i,range:s}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?hFe(this._languageFeaturesService.hoverProvider,r,new oe(s.startLineNumber,s.startColumn),t).filter(a=>!YU(a.hover.contents)).map(a=>new xb(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):tg.EMPTY}finally{o.dispose()}}};qte=D([_(1,Di),_(2,fr),_(3,ti),_(4,Zc),_(5,Re),_(6,Rn),_(7,ht)],qte);class Qte{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=Vx.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==ku.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,c=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>c)return!1}else if(a>t.range.startColumn||t.range.endColumn>c)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return tg.EMPTY;const i=Qte._getLineDecorations(this._editor,t);return tg.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):tg.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Qte._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ui(t)}}class sit{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new DOt(this,this.anchor,t,this.isComplete)}}class DOt extends sit{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class kOt{constructor(e,t,i,s,o,r,a,c,l,d){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=i,this.showAtPosition=s,this.showAtSecondaryPosition=o,this.preferAbove=r,this.stoleFocus=a,this.source=c,this.isBeforeContent=l,this.disposables=d,this.closestMouseDistance=void 0}}const W4e=we;let jte=class extends ${get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=W4e("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=he(this.hoverElement,W4e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(fNe.render(this.actionsElement,e,i))}append(e){const t=he(this.actionsElement,e);return this._hasContent=!0,t}};jte=D([_(0,ti)],jte);var FJ,RN;let oSe=(RN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new I),this.onContentsChanged=this._onContentsChanged.event,this._widget=this._register(this._instantiationService.createInstance(zte,this._editor)),this._participants=[];for(const s of hL.getAll()){const o=this._instantiationService.createInstance(s,this._editor);o instanceof X7&&!(o instanceof qte)&&(this._markdownHoverParticipant=o),this._participants.push(o)}this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new Qte(this._editor,this._participants),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new sit(this._computer.anchor,o,s.isComplete))})),this._register(Xo(this._widget.getDomNode(),"keydown",s=>{s.equals(E.Escape)&&this.hide()})),this._register(lc.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(x.hover).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=FJ.computeHoverRanges(this._editor,e.range,t),r=new Z,a=r.add(new jte(this._keybindingService)),c=document.createDocumentFragment();let l=null;const d={fragment:c,statusBar:a,setColorPicker:u=>l=u,onContentsChanged:()=>this._doOnContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const f=t.filter(p=>p.owner===u);f.length>0&&r.add(u.renderHoverParts(d,f))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&c.appendChild(a.hoverElement),c.hasChildNodes()){if(o){const u=this._editor.createDecorationsCollection();u.set([{range:o,options:FJ._DECORATION_OPTIONS}]),r.add(Ee(()=>{u.clear()}))}this._widget.showAt(c,new kOt(e.initialMousePosX,e.initialMousePosY,l,i,s,this._editor.getOption(x.hover).above,this._computer.shouldFocus,this._computer.source,h,r))}else r.dispose()}_doOnContentsChanged(){this._onContentsChanged.fire(),this._widget.onContentsChanged()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const h=e._getViewModel(),u=h.coordinatesConverter,f=u.convertModelRangeToViewRange(t),p=new oe(f.startLineNumber,h.getLineMinColumn(f.startLineNumber));s=u.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,c=null;for(const h of i)a=O.plusRange(a,h.range),h.range.startLineNumber===o&&h.range.endLineNumber===o&&(r=Math.max(Math.min(r,h.range.startColumn),s)),h.forceShowAtRange&&(c=h.range);const l=c?c.getStartPosition():new oe(o,t.startColumn),d=c?c.getStartPosition():new oe(o,r);return{showAtPosition:l,showAtSecondaryPosition:d,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===Mt.CONTENT_TEXT&&t.push(new hpe(0,i.range,e.event.posx,e.event.posy)),i.type===Mt.CONTENT_EMPTY){const s=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],KS.Delayed,Vx.Mouse,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new hpe(0,e,void 0,void 0),t,i,s,null)}async updateMarkdownHoverVerbosityLevel(e,t,i){this._markdownHoverParticipant?.updateMarkdownHoverVerbosityLevel(e,t,i)}focusedMarkdownHoverIndex(){return this._markdownHoverParticipant?.focusedMarkdownHoverIndex()??-1}markdownHoverContentAtIndex(e){return this._markdownHoverParticipant?.markdownHoverContentAtIndex(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._markdownHoverParticipant?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}getWidgetContent(){const e=this._widget.getDomNode();if(e.textContent)return e.textContent}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}},FJ=RN,RN._DECORATION_OPTIONS=jt.register({description:"content-hover-highlight",className:"hoverHighlight"}),RN);oSe=FJ=D([_(1,be),_(2,ti)],oSe);var IOt=".monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover-content{box-sizing:border-box;padding-bottom:2px;padding-right:2px}.monaco-editor .monaco-hover{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{display:flex;flex-direction:column;min-width:0}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);display:flex;flex-direction:column;justify-content:end;padding-left:5px;padding-right:5px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}";Ct(IOt,{});class LOt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=FS.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],s=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??FS.Center;if(!s&&r!==this._laneOrLine)continue;const a=s?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||YU(a)||i.push(...Kb(a).map(e))}return i}}const H4e=we,Jae=class Jae extends ${constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new gNe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new vw({editor:this._editor},t,i)),this._computer=new LOt(this._editor),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Jae.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(KS.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Mt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Mt.GUTTER_LINE_NUMBERS?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(KS.Delayed))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=H4e("div.hover-row.markdown-hover"),r=he(o,H4e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2,c=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};Jae.ID="editor.contrib.modesGlyphHoverWidget";let Kte=Jae;var rSe;const TOt=!1;var u2;(function(n){n[n.Content=0]="Content",n[n.Glyph=1]="Glyph"})(u2||(u2={}));var MN;let Nc=(MN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new I),this.onHoverContentsChanged=this._onHoverContentsChanged.event,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Z,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new yn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(rSe.ID)}_hookListeners(){const e=this._editor.getOption(x.hover);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return!!(this._isMouseOnContentHoverWidget(e)||this._isMouseOnMarginHoverWidget(e)||this._isContentWidgetResizing())}_isMouseOnMarginHoverWidget(e){const t=e.target;return t?t.type===Mt.OVERLAY_WIDGET&&t.detail===Kte.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Mt.CONTENT_WIDGET&&t.detail===zte.ID:!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(a,c)=>{const l=this._isMouseOnMarginHoverWidget(a);return c&&l},s=(a,c)=>{const l=this._isMouseOnContentHoverWidget(a);return c&&l},o=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},r=(a,c)=>c&&this._contentWidget?.containsNode(a.event.browserEvent.view?.document.activeElement)&&!a.event.browserEvent.view?.getSelection()?.isCollapsed;return!!(i(e,t)||s(e,t)||o(e)||r(e,t))}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._contentWidget?.isFocused||this._contentWidget?.isResizing))return;const t=this._hoverSettings.sticky;if(t&&this._contentWidget?.isVisibleFromKeyboard)return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const s=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&s>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(s);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),s=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(s==="click"&&!r||s==="hover"&&!o&&!TOt||s==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,u2.Content)||this._tryShowHoverWidget(e,u2.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),s=this._getOrCreateGlyphWidget();let o,r;switch(t){case u2.Content:o=i,r=s;break;case u2.Glyph:o=s,r=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=o.showsOrWillShow(e);return a&&r.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===hp.MoreChordsNeeded||t.kind===hp.KbFound&&(t.commandId===Vtt||t.commandId===VQ||t.commandId===zQ)&&this._contentWidget?.isVisible;e.keyCode===E.Ctrl||e.keyCode===E.Alt||e.keyCode===E.Meta||e.keyCode===E.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||vV.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(oSe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(Kte,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,s,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedMarkdownHoverIndex(){return this._getOrCreateContentWidget().focusedMarkdownHoverIndex()}markdownHoverContentAtIndex(e){return this._getOrCreateContentWidget().markdownHoverContentAtIndex(e)}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)}updateMarkdownHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateMarkdownHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}getWidgetContent(){return this._contentWidget?.getWidgetContent()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose(),this._contentWidget?.dispose()}},rSe=MN,MN.ID="editor.contrib.hover",MN);Nc=rSe=D([_(1,be),_(2,ti)],Nc);const ROt=new Y("commentEditorFocused",!1),J$=5*18,MOt=25*18;let EV=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={contributions:[{id:Hx.ID,ctor:Hx,instantiation:mi.BeforeFirstInteraction},{id:QS.ID,ctor:QS,instantiation:mi.BeforeFirstInteraction},{id:pm.ID,ctor:pm,instantiation:mi.Eager},{id:pc.ID,ctor:pc,instantiation:mi.Lazy},{id:Ux.ID,ctor:Ux,instantiation:mi.Eager},{id:qS.ID,ctor:qS,instantiation:mi.Lazy},...b_.getSomeEditorContributions([jS.ID,EF.ID,yV.ID,Du.ID,Nc.ID,mhe,_g.ID,AF.ID])],contextMenuId:Te.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=ROt.bindTo(i),this._commentEditorEmpty=Qv.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=s,this._register(this.onDidFocusEditorWidget(p=>this._commentEditorFocused.set(!0))),this._register(this.onDidChangeModelContent(p=>this._commentEditorEmpty.set(!this.getModel()?.getValueLength()))),this._register(this.onDidBlurEditorWidget(p=>this._commentEditorFocused.reset()))}getParentThread(){return this._parentThread}_getActions(){return b_.getEditorActions()}static getEditorOptions(e){return{wordWrap:"on",glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,scrollbar:{vertical:"visible",verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,lineDecorationsWidth:0,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},dropIntoEditor:{enabled:!0},autoClosingBrackets:e.getValue("editor.autoClosingBrackets"),quickSuggestions:!1,accessibilitySupport:e.getValue("editor.accessibilitySupport")}}};EV=D([_(4,be),_(5,Qt),_(6,Qi),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],EV);function oit(n,e,t){const i=e.getLayoutInfo(),s=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*s;if(o>i.height||oJ$){const r=Math.ceil((o-i.height)/s),a=i.height+s*r;return Dc(a,J$,Dc(n.getLayoutInfo().height-90,J$,MOt))}return t}var $A;(function(n){n.Add="workbench.action.addComment",n.NextThread="editor.action.nextCommentThreadAction",n.PreviousThread="editor.action.previousCommentThreadAction",n.NextRange="editor.action.nextCommentingRange",n.PreviousRange="editor.action.previousCommentingRange",n.ToggleCommenting="workbench.action.toggleCommenting",n.Submit="editor.action.submitComment",n.Hide="workbench.action.hideComment",n.CollapseAll="workbench.action.collapseAllComments",n.ExpandAll="workbench.action.expandAllComments",n.ExpandUnresolved="workbench.action.expandUnresolvedComments"})($A||($A={}));const FK="vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode",Xae=class Xae extends pi{constructor(){super({id:Xae.ID,title:Be(FK,0,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:V.CtrlCmd|E.KeyM,mac:{primary:V.WinCtrl|V.Shift|E.KeyM},weight:ye.EditorContrib},metadata:{description:Be(FK,1,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!g1.getTabFocusMode();g1.setTabFocusMode(t),sa(t?g(FK,2,"Pressing Tab will now move focus to the next focusable element"):g(FK,3,"Pressing Tab will now insert the tab character"))}};Xae.ID="editor.action.toggleTabFocusMode";let Yte=Xae;At(Yte);const CC="vs/workbench/contrib/comments/browser/commentsAccessibility";var ek;(function(n){n.intro=g(CC,0,"The editor contains commentable range(s). Some useful commands include:"),n.tabFocus=g(CC,1,"This widget contains a text area, for composition of new comments, and actions, that can be tabbed to once tab moves focus mode has been enabled with the command Toggle Tab Key Moves Focus{0}",``),n.commentCommands=g(CC,2,"Some useful comment commands include:"),n.escape=g(CC,3,"- Dismiss Comment (Escape)"),n.nextRange=g(CC,4,"- Go to Next Commenting Range{0}",``),n.previousRange=g(CC,5,"- Go to Previous Commenting Range{0}",``),n.nextCommentThread=g(CC,6,"- Go to Next Comment Thread{0}",``),n.previousCommentThread=g(CC,7,"- Go to Previous Comment Thread{0}",``),n.addComment=g(CC,8,"- Add Comment on Current Selection{0}",``),n.submitComment=g(CC,9,"- Submit Comment{0}",``)})(ek||(ek={}));const Hz="vs/workbench/contrib/files/browser/fileConstants",NOt="revealInExplorer",POt="workbench.action.files.saveAs";Be(Hz,0,"Save As...");const FOt="workbench.action.files.save";Be(Hz,1,"Save");const OOt="workbench.action.files.saveWithoutFormatting";Be(Hz,2,"Save without Formatting");const BOt="saveAll";Be(Hz,3,"Save All");const rit="workbench.files.action.saveAllInGroup",WOt="workbench.action.files.saveFiles";new Y("groupFocusedInOpenEditors",!1);new Y("dirtyEditorFocusedInOpenEditors",!1);new Y("readonlyEditorFocusedInOpenEditors",!1);new Y("resourceSelectedForCompare",!1);g(Hz,4,"Remove Folder from Workspace");const HOt="workbench.action.files.newUntitledFile";Be(Hz,5,"New Untitled Text File");let U4e=class{onClose(){this._editor.focus()}constructor(e,t,i){this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=rC.Editor,this.options={type:N_.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=ua.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Jm.readonlyDiffEditor):t.push(Jm.editableDiffEditor):e.get(x.readOnly)?t.push(Jm.readonlyEditor):t.push(Jm.editableEditor),t.push(Jm.listSignalSounds),t.push(Jm.listAlerts);const i=UOt(this._keybindingService,this._contextKeyService);i&&t.push(i);const s=ait(this._keybindingService,this._contextKeyService,this._editor);return s&&t.push(s),e.get(x.stickyScroll).enabled&&t.push(Jm.stickScroll),e.get(x.tabFocusMode)?t.push(Jm.tabFocusModeOnMsg):t.push(Jm.tabFocusModeOffMsg),t.join(` +{1}`,a.title,Ma(v)))}finally{r.deltaDecorations(f,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,c)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Vye,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Hte=D([_(4,be),_(5,vO),_(6,Pi)],Hte);var YL;const CB="vs/editor/contrib/dropOrPasteInto/browser/copyPasteController",ktt="editor.changePasteType",oFe=new Y("pasteWidgetVisible",!1,g(CB,0,"Whether the paste widget is showing")),cpe="application/vnd.code.copyMetadata";var SN;let jS=(SN=class extends ${static get(e){return e.getContribution(YL.ID)}constructor(e,t,i,s,o,r,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(pe(c,"copy",l=>this.handleCopy(l))),this._register(pe(c,"cut",l=>this.handleCopy(l))),this._register(pe(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new Wte("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Hte,"pasteIntoEditor",e,oFe,{id:ktt,label:g(CB,1,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Kg().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(x.pasteAs).enabled&&!this._editor.getOption(x.readOnly)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(!this._editor.hasTextFocus()||(Jn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const s=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!s)return;o=[new O(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,s,Is),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=ytt(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=Dr();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=na(async m=>{const v=Ui(await Promise.all(d.map(async w=>{try{return await w.prepareDocumentPaste(t,o,h,m)}catch(b){console.error(b);return}})));v.reverse();for(const w of v)for(const[b,C]of w)h.replace(b,C);return h});YL._currentCopyOperation?.dataTransferPromise.cancel(),YL._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Du.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e),o=Stt(e.clipboardData);o.delete(cpe);const r=[...e.clipboardData.types,...s?.providerCopyMimeTypes??[],Js.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const l=this._pasteAsActionContext?.preferred;return l&&c.providedPasteEditKinds&&!this.providerMatchesPreference(c,l)?!1:c.pasteMimeTypes?.some(d=>vtt(d,r))});if(!a.length){this._pasteAsActionContext?.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,s):this.doPasteInline(a,i,o,s,e)}showPasteAsNoEditMessage(e,t){Du.get(this._editor)?.showMessage(g(CB,2,"No paste edits for '{0}' found",t instanceof bs?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(i,s,d.token),d.token.isCancellationRequested)return;const h=e.filter(p=>this.isSupportedPasteProvider(p,i));if(!h.length||h.length===1&&h[0]instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);const u={triggerKind:x9.Automatic},f=await this.getPasteEdits(h,i,l,t,u,d.token);if(d.token.isCancellationRequested)return;if(f.length===1&&f[0].provider instanceof CF)return this.applyDefaultPasteHandler(i,s,d.token,o);if(f.length){const p=c.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:f},p,async(m,v)=>{const w=await m.provider.resolveDocumentPasteEdit?.(m,v);return w&&(m.additionalEdit=w.additionalEdit),m},d.token)}await this.applyDefaultPasteHandler(i,s,d.token,o)}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(CB,3,"Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,i,s,o){const r=na(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new I1(c,hr.Value|hr.Selection,void 0,a);try{if(await this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>this.isSupportedPasteProvider(v,s,e));e&&(h=h.filter(v=>this.providerMatchesPreference(v,e)));const u={triggerKind:x9.PasteAs,only:e&&e instanceof bs?e:void 0};let f=await this.getPasteEdits(h,s,l,i,u,d.token);if(d.token.isCancellationRequested)return;if(e&&(f=f.filter(v=>e instanceof bs?e.contains(v.kind):e.providerId===v.provider.id)),!f.length){u.only&&this.showPasteAsNoEditMessage(i,u.only);return}let p;if(e?p=f.at(0):p=(await this._quickInputService.pick(f.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(CB,4,"Select Paste Action")}))?.edit,!p)return;const m=xtt(l.uri,i,p);await this._bulkEditService.apply(m,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:ch.Window,title:g(CB,5,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(cpe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(cpe);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=uwe.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&YL._currentCopyOperation?.handle===t.id){const s=await YL._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of s)e.replace(o,r)}if(!e.has(Js.uriList)){const s=await this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(Js.uriList,HQ(R1.create(s)))}}async getPasteEdits(e,t,i,s,o,r){const a=await dw(Promise.all(e.map(async l=>{try{return(await l.provideDocumentPasteEdits?.(i,s,t,o,r))?.edits?.map(h=>({...h,provider:l}))}catch(d){console.error(d)}})),r),c=Ui(a??[]).flat().filter(l=>!o.only||o.only.contains(l.kind));return Dtt(c)}async applyDefaultPasteHandler(e,t,i,s){const r=await(e.get(Js.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",Uc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(s=>t.matches(s))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof bs?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},YL=SN,SN.ID="editor.contrib.copyPasteActionController",SN);jS=YL=D([_(1,be),_(2,vO),_(3,Mu),_(4,ht),_(5,On),_(6,Cf)],jS);const ls=new class{constructor(){this.QuickFix=new bs("quickfix"),this.Refactor=new bs("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new bs("notebook"),this.Source=new bs("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var th;(function(n){n.IfSingle="ifSingle",n.First="first",n.Never="never"})(th||(th={}));var _f;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(_f||(_f={}));function IFt(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>Itt(e,t,n.include))||!n.includeSourceActions&&ls.Source.contains(e))}function LFt(n,e){const t=e.kind?new bs(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>Itt(t,i,n.include))||!n.includeSourceActions&&t&&ls.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function Itt(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Ey{static fromUser(e,t){return!e||typeof e!="object"?new Ey(t.kind,t.apply,!1):new Ey(Ey.getKindFromUser(e,t.kind),Ey.getApplyFromUser(e,t.apply),Ey.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return th.First;case"never":return th.Never;case"ifsingle":return th.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new bs(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class TFt{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){er(i)}t&&(this.action.edit=t.edit)}return this}}const RFt="vs/editor/contrib/codeAction/browser/codeAction",rFe="editor.action.codeAction",aFe="editor.action.quickFix",Ltt="editor.action.autoFix",cFe="editor.action.refactor",lFe="editor.action.sourceAction",zye="editor.action.organizeImports",$ye="editor.action.fixAll";class Y$ extends ${static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:mo(e.diagnostics)?mo(t.diagnostics)?Y$.codeActionsPreferredComparator(e,t):-1:mo(t.diagnostics)?1:Y$.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Y$.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ls.QuickFix.contains(new bs(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const L4e={actions:[],documentation:void 0};async function KW(n,e,t,i,s,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ls.Notebook]},c={only:r.include?.value,trigger:i.type},l=new dPe(e,o),d=i.type===wu.Auto,h=MFt(n,e,d?a:r),u=new Z,f=h.map(async m=>{try{s.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return L4e;const w=(v?.actions||[]).filter(C=>C&&LFt(r,C)),b=PFt(m,w,r.include);return{actions:w.map(C=>new TFt(C,m)),documentation:b}}catch(v){if(Na(v))throw v;return er(v),L4e}}),p=n.onDidChange(()=>{const m=n.all(e);Ls(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(b=>b.actions).flat(),w=[...Ui(m.map(b=>b.documentation)),...NFt(n,e,i,v)];return new Y$(v,w,u)}finally{p.dispose(),l.dispose()}}function MFt(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>IFt(t,new bs(s))):!0)}function*NFt(n,e,t,i){if(e&&i.length)for(const s of n.all(e))s._getAdditionalMenuItems&&(yield*s._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function PFt(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new bs(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s?.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new bs(s.kind)))return o.command}}var hI;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb"})(hI||(hI={}));async function Ttt(n,e,t,i,s=qe.None){const o=n.get(vO),r=n.get(ji),a=n.get(rn),c=n.get(Pi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(s),!s.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await o.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==hI.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=FFt(l);c.error(typeof d=="string"?d:g(RFt,0,"An unknown error occurred while applying the code action"))}}function FFt(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}yt.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof P))throw Hi();const{codeActionProvider:o}=n.get(ht),r=n.get(Ai).getModel(e);if(!r)throw Hi();const a=mt.isISelection(t)?mt.liftSelection(t):O.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Hi();const c=typeof i=="string"?new bs(i):void 0,l=await KW(o,r,a,{type:wu.Invoke,triggerAction:_f.Default,filter:{includeSourceActions:!0,include:c}},cf.None,qe.None),d=[],h=Math.min(l.validActions.length,typeof s=="number"?s:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var Gye,AN;let qye=(AN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ka(()=>this.keybindingService.getKeybindings().filter(t=>Gye.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===zye?i={kind:ls.SourceOrganizeImports.value}:t.command===$ye&&(i={kind:ls.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Ey.fromUser(i,{kind:bs.None,apply:th.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new bs(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}},Gye=AN,AN.codeActionCommands=[cFe,rFe,lFe,zye,$ye],AN);qye=Gye=D([_(0,ti)],qye);var OFt='.action-widget{background-color:var(--vscode-editorWidget-background);border:1px solid var(--vscode-editorWidget-border)!important;border-radius:0;border-radius:2px;color:var(--vscode-editorWidget-foreground);display:block;font-size:13px;max-width:80vw;min-width:160px;width:100%;z-index:40}.context-view-block{z-index:-1}.context-view-block,.context-view-pointerBlock{cursor:auto;height:100%;left:0;position:fixed;top:0;width:100%}.context-view-pointerBlock{z-index:2}.action-widget .monaco-list{border:0!important;user-select:none;-webkit-user-select:none}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{cursor:pointer;padding:0 10px;touch-action:none;white-space:nowrap;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before,.action-widget .monaco-list .option-disabled:before{-webkit-touch-callout:none;background-color:transparent!important;cursor:default!important;outline:0 solid!important;-webkit-user-select:none;user-select:none}.action-widget .monaco-list-row.action{align-items:center;display:flex;gap:6px}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);border-radius:3px;border-style:solid;border-width:1px;box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);color:var(--vscode-keybindingLabel-foreground)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{content:"";display:block;width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}';Ct(OFt,{});const Ute="vs/platform/actionWidget/browser/actionList",Rtt="acceptSelectedCodeAction",Mtt="previewSelectedCodeAction";var Rv;(function(n){n.Action="action",n.Header="header"})(Rv||(Rv={}));class BFt{get templateId(){return Rv.Header}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??""}disposeTemplate(e){}}let Qye=class{get templateId(){return Rv.Action}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new Dz(e,$c);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=$e.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ye(e.group.icon.color.id))):(i.icon.className=$e.asClassName(Ce.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Ntt(e.label),i.keybinding.set(e.keybinding),_je(!!e.keybinding,i.keybinding.element);const s=this._keybindingService.lookupKeybinding(Rtt)?.getLabel(),o=this._keybindingService.lookupKeybinding(Mtt)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:s&&o?this._supportsPreview&&e.canPreview?i.container.title=g(Ute,0,"{0} to Apply, {1} to Preview",s,o):i.container.title=g(Ute,1,"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Qye=D([_(1,ti)],Qye);class WFt extends UIEvent{constructor(){super("acceptSelectedAction")}}class T4e extends UIEvent{constructor(){super("previewSelectedAction")}}function HFt(n){if(n.kind==="action")return n.label}let jye=class extends ${constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ai),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===Rv.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Pc(e,this.domNode,a,[new Qye(t,this._keybindingService),new BFt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:HFt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===Rv.Action){let l=c.label?Ntt(c?.label):"";return c.disabled&&(l=g(Ute,2,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(Ute,3,"Action Widget"),getRole:c=>c.kind===Rv.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(bO),this._register(this._list.onMouseClick(c=>this.onListClick(c))),this._register(this._list.onMouseOver(c=>this.onListHover(c))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(c=>this.onListSelection(c))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind===Rv.Action}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);let o=e;if(this._allMenuItems.length>=50)o=380;else{const c=this._allMenuItems.map((l,d)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(d));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});o=Math.max(...c,e)}const a=Math.min(s,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new T4e:new WFt;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof T4e):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind===Rv.Action){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};jye=D([_(4,W_),_(5,ti)],jye);function Ntt(n){return n.replace(/\r\n|\r|\n/g," ")}const RD="vs/editor/contrib/codeAction/browser/codeActionMenu",Ptt=Object.freeze({kind:bs.Empty,title:g(RD,0,"More Actions...")}),UFt=Object.freeze([{kind:ls.QuickFix,title:g(RD,1,"Quick Fix")},{kind:ls.RefactorExtract,title:g(RD,2,"Extract"),icon:Ce.wrench},{kind:ls.RefactorInline,title:g(RD,3,"Inline"),icon:Ce.wrench},{kind:ls.RefactorRewrite,title:g(RD,4,"Rewrite"),icon:Ce.wrench},{kind:ls.RefactorMove,title:g(RD,5,"Move"),icon:Ce.wrench},{kind:ls.SurroundWith,title:g(RD,6,"Surround With"),icon:Ce.surroundWith},{kind:ls.Source,title:g(RD,7,"Source Action"),icon:Ce.symbolFile},Ptt]);function VFt(n,e,t){if(!e)return n.map(o=>({kind:Rv.Action,item:o,group:Ptt,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=UFt.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new bs(o.action.kind):bs.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:Rv.Header,group:o.group});for(const r of o.actions){const a=o.group;s.push({kind:Rv.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:Ce.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return s}var zFt='.monaco-editor .lightBulbWidget{align-items:center;display:flex;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{background-color:var(--vscode-editor-background);content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}';Ct(zFt,{});var Kye;const NK="vs/editor/contrib/codeAction/browser/lightBulbWidget";var ib;(function(n){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=n.Type||(n.Type={})),n.Hidden={type:e.Hidden};class t{constructor(s,o,r,a){this.actions=s,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}n.Showing=t})(ib||(ib={}));var f0;let J7=(f0=class extends ${constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=ib.Hidden,this._iconClasses=[],this._domNode=we("div.lightBulbWidget"),this._domNode.role="listbox",this._register(dh.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(s=>{const o=this._editor.getModel();(this.state.type!==ib.Type.Showing||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(Mut(this._domNode,s=>{if(this.state.type!==ib.Type.Showing)return;this._editor.focus(),s.preventDefault();const{top:o,height:r}=ia(this._domNode),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(s.buttons&1)===1&&this.hide()})),this._register(T.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(Ltt)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(aFe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===ib.Type.Showing?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(x.lightbulb).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),c=o.getOptions().tabSize,l=this._editor.getOptions().get(x.fontInfo),d=o.getLineContent(r),h=dde(d,c),u=l.spaceWidth*h>22,f=b=>b>2&&this._editor.getTopForLineNumber(b)===this._editor.getTopForLineNumber(b-1);let p=r,m=1;if(!u){if(r>1&&!f(r-1))p-=1;else if(ro,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}clear(){this._list.clear()}_renderWidget(e,t,i){const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new Z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(pe(a,xe.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(pe(l,xe.POINTER_MOVE,()=>l.remove())),o.add(pe(l,xe.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);s.style.width=`${h}px`;const u=o.add(Dd(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=we(e),s=new Qh(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){this._list.value?.hide(e)}};SF=D([_(0,W_),_(1,Pe),_(2,be)],SF);ce(DO,SF,Yt.Delayed);const UQ=ye.EditorContrib+1e3;At(class extends pi{constructor(){super({id:"hideCodeActionWidget",title:Be(xO,2,"Hide action widget"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Escape,secondary:[V.Shift|E.Escape]}})}run(n){n.get(DO).hide(!0)}});At(class extends pi{constructor(){super({id:"selectPrevCodeAction",title:Be(xO,3,"Select previous action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.CtrlCmd|E.UpArrow,V.WinCtrl|E.KeyP]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusPrevious()}});At(class extends pi{constructor(){super({id:"selectNextCodeAction",title:Be(xO,4,"Select next action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.CtrlCmd|E.DownArrow,V.WinCtrl|E.KeyN]}}})}run(n){const e=n.get(DO);e instanceof SF&&e.focusNext()}});At(class extends pi{constructor(){super({id:Rtt,title:Be(xO,5,"Accept selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:E.Enter,secondary:[V.CtrlCmd|E.Period]}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected()}});At(class extends pi{constructor(){super({id:Mtt,title:Be(xO,6,"Preview selected action"),precondition:yF.Visible,keybinding:{weight:UQ,primary:V.CtrlCmd|E.Enter}})}run(n){const e=n.get(DO);e instanceof SF&&e.acceptSelected(!0)}});const Ftt=new Y("supportedCodeAction",""),R4e="_typescript.applyFixAllCodeAction";class $Ft extends ${constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new O_),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>_n(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:wu.Auto,triggerAction:_f.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===wu.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==bv.Off){{if(i===bv.On)return t;if(i===bv.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),c=o.getLineContent(r);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var ab;(function(n){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=n.Type||(n.Type={})),n.Empty={type:e.Empty};class t{constructor(s,o,r){this.trigger=s,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Na(a))return Ott;throw a})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=t})(ab||(ab={}));const Ott=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class GFt extends ${constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Dn),this._state=ab.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Ftt.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.lightbulb)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(ab.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(ab.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(x.readOnly)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new $Ft(this._editor,this._markerService,i=>{if(!i){this.setState(ab.Empty);return}const s=i.selection.getStartPosition(),o=na(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===wu.Invoke&&(i.trigger.triggerAction===_f.QuickFix||i.trigger.filter?.include?.contains(ls.QuickFix))){const l=await KW(this._registry,e,i.selection,i.trigger,cf.None,c),d=[...l.allActions];if(c.isCancellationRequested)return Ott;const h=l.validActions?.some(f=>f.action.kind?ls.QuickFix.contains(new bs(f.action.kind)):!1),u=this._markerService.read({resource:e.uri});if(h){for(const f of l.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(R4e))&&(f.action.diagnostics=[...u.filter(p=>p.relatedInformation)]);return{validActions:l.validActions,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}else if(!h&&u.length>0){const f=i.selection.getPosition();let p=f,m=Number.MAX_VALUE;const v=[...l.validActions];for(const b of u){const C=b.endColumn,y=b.endLineNumber,S=b.startLineNumber;if(y===f.lineNumber||S===f.lineNumber){p=new oe(y,C);const M={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ls.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new mt(p.lineNumber,p.column,p.lineNumber,p.column),F=await KW(this._registry,e,k,M,cf.None,c);if(F.validActions.length!==0){for(const N of F.validActions)N.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(R4e))&&(N.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...F.allActions),Math.abs(f.column-C)y.findIndex(S=>S.action.title===b.action.title)===C);return w.sort((b,C)=>b.action.isPreferred&&!C.action.isPreferred?-1:!b.action.isPreferred&&C.action.isPreferred||b.action.isAI&&!C.action.isAI?1:!b.action.isAI&&C.action.isAI?-1:0),{validActions:w,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return KW(this._registry,e,i.selection,i.trigger,cf.None,c)});i.trigger.type===wu.Invoke&&this._progressService?.showWhile(o,250);const r=new ab.Triggered(i.trigger,s,o);let a=!1;this._state.type===ab.Type.Triggered&&(a=this._state.trigger.type===wu.Invoke&&r.type===ab.Type.Triggered&&r.trigger.type===wu.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:wu.Auto,triggerAction:_f.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===ab.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var yB;const lpe="vs/editor/contrib/codeAction/browser/codeActionController",qFt="quickfix-edit-highlight";var p0;let AF=(p0=class extends ${static get(e){return e.getContribution(yB.ID)}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._telemetryService=h,this._activeCodeActions=this._register(new Dn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new GFt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ka(()=>{const u=this._editor.getContribution(J7.ID);return u&&this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u}),this._resolver=s.createInstance(qye),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(this._telemetryService.publicLog2("codeAction.showCodeActionsFromLightbulb",{codeActionListLength:e.validActions.length,codeActions:e.validActions.map(i=>i.action.title),codeActionProviders:e.validActions.map(i=>i.provider?.displayName??"")}),e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,hI.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}hideCodeActions(){this._actionWidgetService.hide()}manualTriggerAtCurrentPosition(e,t,i,s){if(!this._editor.hasModel())return;Du.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:wu.Invoke,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,s){try{await this._instantiationService.invokeFunction(Ttt,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:wu.Auto,triggerAction:_f.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide()}async update(e){if(e.type!==ab.Type.Triggered){this._lightBulbWidget.rawValue?.hide();return}let t;try{t=await e.actions}catch(i){bt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===wu.Invoke){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this._lightBulbWidget.value?.hide(),await this._applyCodeAction(s,!1,!1,hI.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Du.get(this._editor)?.showMessage(o.action.disabled,e.trigger.context.position),t.dispose();return}}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length)){Du.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===th.First&&t.validActions.length===0||e.autoApply===th.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===th.First&&t.validActions.length>0||e.autoApply===th.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=oe.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?hI.FromAILightbulb:hI.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:l=>{this._editor?.focus(),s.clear(),i.fromLightbulb&&l!==void 0&&this._telemetryService.publicLog2("codeAction.showCodeActionList.onHide",{codeActionListLength:e.validActions.length,didCancel:l,codeActions:e.validActions.map(d=>d.action.title)})},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new bs(u);h=[ls.RefactorExtract,ls.RefactorInline,ls.RefactorRewrite,ls.RefactorMove,ls.Source].some(m=>m.contains(f))}return{canPreview:h||!!l.action.edit?.edits.length}},onFocus:l=>{if(l&&l.action){const d=l.action.ranges,h=l.action.diagnostics;if(s.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:yB.DECORATION})):d.map(f=>({range:f,options:yB.DECORATION}));s.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:yB.DECORATION}));s.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Cu(g(lpe,0,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,VFt(r,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,vt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=ia(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:g(lpe,1,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(lpe,2,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},yB=p0,p0.ID="editor.contrib.codeActionController",p0.DECORATION=Kt.register({description:"quickfix-highlight",className:qFt}),p0);AF=yB=D([_(1,U_),_(2,Pe),_(3,be),_(4,ht),_(5,eD),_(6,ji),_(7,Re),_(8,DO),_(9,be),_(10,rn)],AF);Im((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Fb));const i=n.getColor(Uk);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${pS(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Yye;const Jye="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController",Btt="editor.experimental.dropIntoEditor.defaultProvider",Wtt="editor.changeDropType",dFe=new Y("dropWidgetVisible",!1,g(Jye,0,"Whether the drop widget is showing"));var EN;let EF=(EN=class extends ${static get(e){return e.getContribution(Yye.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=Ote.getInstance(),this._dropProgressManager=this._register(t.createInstance(Wte,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(Hte,"dropIntoEditor",e,dFe,{id:Wtt,label:g(Jye,1,"Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;this._currentOperation?.cancel(),e.focus(),e.setPosition(t);const s=na(async o=>{const r=new I1(e,hr.Value,void 0,o);try{const a=await this.extractDataTransferData(i);if(a.size===0||r.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const l=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(u=>a.matches(u)):!0),d=await this.getDropEdits(l,c,t,a,r);if(r.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),u=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([O.fromPositions(t)],{activeEditIndex:h,allEdits:d},u,async f=>f,o)}}finally{r.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(Jye,2,"Running drop handlers. Click to cancel"),s),this._currentOperation=s}async getDropEdits(e,t,i,s,o){const r=await dw(Promise.all(e.map(async c=>{try{return(await c.provideDocumentDropEdits(t,i,s,o.token))?.map(d=>({...d,providerId:c.id}))}catch(l){console.error(l)}})),o.token),a=Ui(r??[]).flat();return Dtt(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Btt,{resource:e.uri});for(const[s,o]of Object.entries(i)){const r=new bs(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&vtt(s,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new fhe;const t=Stt(e.dataTransfer);if(this.treeItemsTransfer.hasData(pVe.prototype)){const i=this.treeItemsTransfer.getData(pVe.prototype);if(Array.isArray(i))for(const s of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Yye=EN,EN.ID="editor.contrib.dropIntoEditorController",EN);EF=Yye=D([_(1,be),_(2,Re),_(3,ht),_(4,zde)],EF);var QFt=".monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer}";Ct(QFt,{});function Xye(n,e){return!!n[e]}class dpe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Xye(e.event,t.triggerModifier),this.hasSideBySideModifier=Xye(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class M4e{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Xye(e,t.triggerModifier)}}class PK{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function N4e(n){return n==="altKey"?ei?new PK(E.Meta,"metaKey",E.Alt,"altKey"):new PK(E.Ctrl,"ctrlKey",E.Alt,"altKey"):ei?new PK(E.Alt,"altKey",E.Meta,"metaKey"):new PK(E.Alt,"altKey",E.Ctrl,"ctrlKey")}class phe extends ${constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new I),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new I),this.onExecute=this._onExecute.event,this._onCancel=this._register(new I),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=N4e(this._editor.getOption(x.multiCursorModifier)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(x.multiCursorModifier)){const s=N4e(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new dpe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new dpe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new dpe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new M4e(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new M4e(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}let jFt=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class Vte{constructor(e){this._disposables=new Z;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new jFt(r,s));t=Vte._union(t,o),cz(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;sPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},er));return Promise.all(s).then(()=>{const o=new Vte(Ui(i));return t.isCancellationRequested?(o.dispose(),new Vte([])):o})}yt.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;Bt(t instanceof P),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)return[];const r=await Htt(s,o,qe.None);if(!r)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new phe(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(x.links)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(x.links))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=na(t=>Htt(this.providers,e,t));try{const t=new ao(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){bt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(YW.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(x.multiCursorModifier)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(qe.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===_e.file&&o.startsWith(`${_e.file}:`)){const a=P.parse(o);if(a.scheme===_e.file){const c=fv(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=Qt(r,l))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(g(sy,0,"Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(g(sy,1,"Failed to open this link because its target is missing.")):bt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===Mt.CONTENT_TEXT&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Zye=xN,xN.ID="editor.linkDetector",xN);yV=Zye=D([_(1,fr),_(2,Pi),_(3,ht),_(4,B_)],yV);const P4e={general:Kt.register({description:"detected-link",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Kt.register({description:"detected-link-active",stickiness:gi.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class YW{static decoration(e,t){return{range:e.range,options:YW._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?P4e.active:P4e.general};return s.hoverMessage=KFt(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,YW._getOptions(this.link,t,!1))}}function KFt(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?g(sy,2,"Execute command"):g(sy,3,"Follow link"),s=e?ei?g(sy,4,"cmd + click"):g(sy,5,"ctrl + click"):ei?g(sy,6,"option + click"):g(sy,7,"alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(sy,8,"Execute command {0}",c)}}return new Xt("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${s})`)}else return new Xt().appendText(`${i} (${s})`)}class YFt extends lt{constructor(){super({id:"editor.action.openLink",label:g(sy,9,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yV.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}vn(yV.ID,yV,mi.AfterFirstRender);Fe(YFt);const mhe="editor.contrib.selectionClipboard",Utt="vs/editor/contrib/hover/browser/hoverActionIds",Vtt="editor.action.showHover",JFt="editor.action.showDefinitionPreviewHover",XFt="editor.action.scrollUpHover",ZFt="editor.action.scrollDownHover",eOt="editor.action.scrollLeftHover",tOt="editor.action.scrollRightHover",iOt="editor.action.pageUpHover",nOt="editor.action.pageDownHover",sOt="editor.action.goToTopHover",oOt="editor.action.goToBottomHover",VQ="editor.action.increaseHoverVerbosityLevel",rOt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",aOt=g(Utt,0,"Increase Hover Verbosity Level"),zQ="editor.action.decreaseHoverVerbosityLevel",cOt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",lOt=g(Utt,1,"Decrease Hover Verbosity Level");var Fd;(function(n){n[n.Idle=0]="Idle",n[n.FirstWait=1]="FirstWait",n[n.SecondWait=2]="SecondWait",n[n.WaitingForAsync=3]="WaitingForAsync",n[n.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Fd||(Fd={}));var KS;(function(n){n[n.Delayed=0]="Delayed",n[n.Immediate=1]="Immediate"})(KS||(KS={}));var Vx;(function(n){n[n.Mouse=0]="Mouse",n[n.Keyboard=1]="Keyboard"})(Vx||(Vx={}));let dOt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class ztt extends ${constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new yn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new yn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new yn(()=>this._triggerLoadingMessage(),0)),this._state=Fd.Idle,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(x.hover).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(Fd.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=nut(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===Fd.WaitingForAsync||this._state===Fd.WaitingForAsyncShowingLoading)&&this._setState(Fd.Idle)}catch(e){bt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Fd.Idle:Fd.WaitingForAsync)}_triggerLoadingMessage(){this._state===Fd.WaitingForAsync&&this._setState(Fd.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Fd.FirstWait||this._state===Fd.SecondWait)return;const e=this._state===Fd.Idle,t=this._state===Fd.WaitingForAsyncShowingLoading;this._onResult.fire(new dOt(this._result.slice(0),e,t))}start(e){if(e===KS.Delayed)this._state===Fd.Idle&&(this._setState(Fd.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Fd.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Fd.SecondWait:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(Fd.Idle,!1)}}const hOt=30,uOt=24;class gOt extends ${constructor(e,t=new Tn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new XPe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Tn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Tn(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?oe.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:ia(t).top+i.top-hOt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=ia(t),o=uw(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-uOt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(s,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=s?hs.ABOVE:hs.BELOW:a=r<=i?hs.BELOW:hs.ABOVE,a===hs.ABOVE?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var DC;const F4e=30,fOt=6;var m0;let zte=(m0=class extends gOt{get isColorPickerVisible(){return!!this._visibleData?.colorPicker}get isVisibleFromKeyboard(){return this._visibleData?.source===Vx.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new Tn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new gNe),this._minimumSize=c,this._hoverVisibleKey=X.hoverVisible.bindTo(t),this._hoverFocusedKey=X.hoverFocused.bindTo(t),he(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(x.fontInfo)&&this._updateFont()}));const l=this._register(Dd(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._visibleData?.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return DC.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return DC._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return DC._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){DC._applyMaxDimensions(this._hover.contentsDomNode,e,t),DC._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Tn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){DC._lastDimensions=new Tn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._visibleData?.colorPicker?.layout()}_findAvailableSpaceVertically(){const e=this._visibleData?.showAtPosition;if(e)return this._positionPreference===hs.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=fOt;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=ia(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=O4e(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=O4e(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){this._visibleData?.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(x.fontInfo),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,DC._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,DC._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?jo.LeftOfInjectedText:void 0,preference:[this._positionPreference??hs.ABOVE]}:null}showAt(e,t){if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const i=Zf(this._hover.containerDomNode),s=t.showAtPosition;this._positionPreference=this._findPositionPreference(i,s)??hs.ABOVE,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker?.layout();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&BYe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+r)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Tn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}setMinimumDimensions(e){this._minimumSize=new Tn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Tn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=Zf(e),i=du(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Zf(e),i=du(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._visibleData?.showAtPosition){const s=Zf(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(x.fontInfo);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-F4e})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+F4e})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},DC=m0,m0.ID="editor.contrib.resizableContentHoverWidget",m0._lastDimensions=new Tn(0,0),m0);zte=DC=D([_(1,Pe),_(2,Re),_(3,Ur),_(4,ti)],zte);function O4e(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,c=Math.max(Math.abs(n-r)-s/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var ku;(function(n){n[n.Range=1]="Range",n[n.ForeignElement=2]="ForeignElement"})(ku||(ku={}));class hpe{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=ku.Range}equals(e){return e.type===ku.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===ku.Range&&t.lineNumber===this.range.startLineNumber}}class bM{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=ku.ForeignElement}equals(e){return e.type===ku.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===ku.ForeignElement&&this.owner===e.owner}}const hL=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pOt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function mOt(n,e,t,i,s){const o=await Promise.resolve(n.provideHover(t,i,s)).catch(er);if(!(!o||!vOt(o)))return new pOt(n,o,e)}function hFe(n,e,t,i){const o=n.ordered(e).map((r,a)=>mOt(r,a,e,t,i));return tg.fromPromises(o).coalesce()}function _Ot(n,e,t,i){return hFe(n,e,t,i).map(s=>s.hover).toPromise()}nA("_executeHoverProvider",(n,e,t)=>{const i=n.get(ht);return _Ot(i.hoverProvider,e,t,qe.None)});function vOt(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}const NE="vs/editor/contrib/hover/browser/markdownHoverParticipant",h2=we,wOt=Ki("hover-increase-verbosity",Ce.add,g(NE,0,"Icon for increaseing hover verbosity.")),bOt=Ki("hover-decrease-verbosity",Ce.remove,g(NE,1,"Icon for decreasing hover verbosity."));class xb{constructor(e,t,i,s,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class $tt{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Yl.Increase:return this.hover.canIncreaseVerbosity??!1;case Yl.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let X7=class{constructor(e,t,i,s,o,r,a){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new xb(this,e.range,[new Xt().appendText(g(NE,2,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const c=i.getLineLength(s),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(x.stopRenderingLineAfter),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let u=!1;d>=0&&c>d&&e.range.startColumn>=d&&(u=!0,r.push(new xb(this,e.range,[{value:g(NE,3,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&c>=h&&r.push(new xb(this,e.range,[{value:g(NE,4,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const p of t){const m=p.range.startLineNumber===s?p.range.startColumn:1,v=p.range.endLineNumber===s?p.range.endColumn:o,w=p.options.hoverMessage;if(!w||YU(w))continue;p.options.beforeContentClassName&&(f=!0);const b=new O(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new xb(this,b,Kb(w),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==ku.Range)return tg.EMPTY;const s=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(s)?this._getMarkdownHovers(o,s,e,i):tg.EMPTY}_getMarkdownHovers(e,t,i,s){const o=i.range.getStartPosition();return hFe(e,t,o,s).filter(c=>!YU(c.hover.contents)).map(c=>{const l=c.hover.range?O.lift(c.hover.range):i.range,d=new $tt(c.hover,c.provider,o);return new xb(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new COt(t,e.fragment,this._editor,this._languageService,this._openerService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}markdownHoverContentAtIndex(e){return this._renderedHoverParts?.markdownHoverContentAtIndex(e)??""}focusedMarkdownHoverIndex(){return this._renderedHoverParts?.focusedMarkdownHoverIndex()??1}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i)}};X7=D([_(1,Di),_(2,fr),_(3,Re),_(4,ht),_(5,ti),_(6,el)],X7);class COt extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._editor=i,this._languageService=s,this._openerService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=c,this._onFinishedRendering=l,this._focusedHoverPartIndex=-1,this._ongoingHoverOperations=new Map,this._renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._register(Ee(()=>{this._renderedHoverParts.forEach(d=>{d.disposables.dispose()})})),this._register(Ee(()=>{this._ongoingHoverOperations.forEach(d=>{d.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(El(s=>s.ordinal,cg)),e.map((s,o)=>{const r=this._renderHoverPart(o,s.contents,s.source,i);return t.appendChild(r.renderedMarkdown),r})}_renderHoverPart(e,t,i,s){const{renderedMarkdown:o,disposables:r}=this._renderMarkdownContent(t,s);if(!i)return{renderedMarkdown:o,disposables:r};const a=i.supportsVerbosityAction(Yl.Increase),c=i.supportsVerbosityAction(Yl.Decrease);if(!a&&!c)return{renderedMarkdown:o,disposables:r,hoverSource:i};const l=h2("div.verbosity-actions");return o.prepend(l),r.add(this._renderHoverExpansionAction(l,Yl.Increase,a)),r.add(this._renderHoverExpansionAction(l,Yl.Decrease,c)),this._register(pe(o,xe.FOCUS_IN,d=>{d.stopPropagation(),this._focusedHoverPartIndex=e})),this._register(pe(o,xe.FOCUS_OUT,d=>{d.stopPropagation(),this._focusedHoverPartIndex=-1})),{renderedMarkdown:o,disposables:r,hoverSource:i}}_renderMarkdownContent(e,t){const i=h2("div.hover-row");i.tabIndex=0;const s=h2("div.hover-row-contents");i.appendChild(s);const o=new Z;return o.add(Gtt(this._editor,s,e,this._languageService,this._openerService,t)),{renderedMarkdown:i,disposables:o}}_renderHoverExpansionAction(e,t,i){const s=new Z,o=t===Yl.Increase,r=he(e,h2($e.asCSSSelector(o?wOt:bOt)));r.tabIndex=0;const a=new gF("mouse",!1,{target:e,position:{hoverPosition:Oo.LEFT}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupUpdatableHover(a,r,qtt(this._keybindingService,t))),!i)return r.classList.add("disabled"),s;r.classList.add("enabled");const c=()=>this.updateMarkdownHoverPartVerbosityLevel(t);return s.add(new WYe(r,c)),s.add(new HYe(r,c,[E.Enter,E.Space])),s}async updateMarkdownHoverPartVerbosityLevel(e,t=-1,i=!0){const s=this._editor.getModel();if(!s)return;const o=t!==-1?t:this._focusedHoverPartIndex,r=this._getRenderedHoverPartAtIndex(o);if(!r||!r.hoverSource?.supportsVerbosityAction(e))return;const a=r.hoverSource,c=await this._fetchHover(a,s,e);if(!c)return;const l=new $tt(c,a.hoverProvider,a.hoverPosition),d=this._renderHoverPart(o,c.contents,l,this._onFinishedRendering);this._replaceRenderedHoverPartAtIndex(o,d),i&&this._focusOnHoverPartWithIndex(o),this._onFinishedRendering()}markdownHoverContentAtIndex(e){return this._getRenderedHoverPartAtIndex(e)?.renderedMarkdown.innerText??""}focusedMarkdownHoverIndex(){return this._focusedHoverPartIndex}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e);return!(!i||!i.hoverSource?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let s=i===Yl.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),s+=r.verbosityDelta);const a=new ai;this._ongoingHoverOperations.set(o,{verbosityDelta:s,tokenSource:a});const c={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){er(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t){if(e>=this._renderHoverParts.length||e<0)return;const i=this._renderedHoverParts[e];i.renderedMarkdown.replaceWith(t.renderedMarkdown),i.disposables.dispose(),this._renderedHoverParts[e]=t}_focusOnHoverPartWithIndex(e){this._renderedHoverParts[e].renderedMarkdown.focus()}_getRenderedHoverPartAtIndex(e){return this._renderedHoverParts[e]}}function yOt(n,e,t,i,s){e.sort(El(r=>r.ordinal,cg));const o=new Z;for(const r of e)o.add(Gtt(t,n.fragment,r.contents,i,s,n.onContentsChanged));return o}function Gtt(n,e,t,i,s,o){const r=new Z;for(const a of t){if(YU(a))continue;const c=h2("div.markdown-hover"),l=he(c,h2("div.hover-contents")),d=r.add(new vw({editor:n},i,s));r.add(d.onDidRenderAsync(()=>{l.className="hover-contents code-hover-contents",o()}));const h=r.add(d.render(a));l.appendChild(h.element),e.appendChild(c)}return r}function qtt(n,e){switch(e){case Yl.Increase:{const t=n.lookupKeybinding(VQ);return t?g(NE,5,"Increase Hover Verbosity ({0})",t.getLabel()):g(NE,6,"Increase Hover Verbosity")}case Yl.Decrease:{const t=n.lookupKeybinding(zQ);return t?g(NE,7,"Decrease Hover Verbosity ({0})",t.getLabel()):g(NE,8,"Decrease Hover Verbosity")}}}class Qtt{constructor(e,t){this.range=e,this.direction=t}}class uFe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new uFe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){er(t),this._isResolved=!1}}}const Q2=class Q2{static async create(e,t,i,s){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,s);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??Q2._emptyInlayHintList,a])}catch(l){er(l)}}));if(await Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Tc;return new Q2(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const c=i.validatePosition(a.position);let l="before";const d=Q2._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=O.fromPositions(d.getStartPosition(),c),l="after"):(h=O.fromPositions(c,d.getEndPosition()),l="before"),s.push(new uFe(a,new Qtt(h,l),r))}}this.items=s.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new O(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let c=o.getStartOffset(a),l=o.getEndOffset(a);return l-c===1&&(c===r&&a>1?(c=o.getStartOffset(a-1),l=o.getEndOffset(a-1)):l===r&&a{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),c=r.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(_n(h.uri,a.uri))l=!0,d=d||O.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=pa(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:O.collapseToStart(t.range),selectionRevealType:px.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(eSe,1,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(eSe,2,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};tSe=D([_(0,Pe),_(1,jt),_(2,Pi),_(3,ti)],tSe);ce(_he,tSe,Yt.Delayed);Ke(new class extends Jc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:gFe,kbOpts:{weight:ye.EditorContrib,primary:E.F12}})}runEditorCommand(n,e){return n.get(_he).revealNext(e)}});xr.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:ye.EditorContrib,when:gFe,primary:E.Escape,handler(n){n.get(_he).reset()}});let iSe=class{constructor(e){this._listener=new Map,this._disposables=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),St(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,pa(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};iSe=D([_(0,jt)],iSe);function nSe(n,e){return e.uri.scheme===n.uri.scheme?!0:!L9(e.uri,_e.walkThroughSnippet,_e.vscodeChatCodeBlock,_e.vscodeChatCodeCompareBlock,_e.vscodeCopilotBackingChatCodeBlock)}async function $Q(n,e,t,i){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,c=>{er(c)})),r=await Promise.all(o);return Ui(r.flat()).filter(a=>nSe(n,a))}function vhe(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function Ktt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function Ytt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function Jtt(n,e,t,i){return $Q(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function whe(n,e,t,i,s){return $Q(e,t,n,async(o,r,a)=>{const c=(await o.provideReferences(r,a,{includeDeclaration:!0},s))?.filter(d=>nSe(r,d));if(!i||!c||c.length!==2)return c;const l=(await o.provideReferences(r,a,{includeDeclaration:!1},s))?.filter(d=>nSe(r,d));return l&&l.length===1?l:c})}async function GQ(n){const e=await n(),t=new fp(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}nA("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=vhe(i.definitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(ht),s=Jtt(i.typeDefinitionProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(ht),s=Ktt(i.declarationProvider,e,t,qe.None);return GQ(()=>s)});nA("_executeReferenceProvider",(n,e,t)=>{const i=n.get(ht),s=whe(i.referenceProvider,e,t,!1,qe.None);return GQ(()=>s)});nA("_executeImplementationProvider",(n,e,t)=>{const i=n.get(ht),s=Ytt(i.implementationProvider,e,t,qe.None);return GQ(()=>s)});const po="vs/editor/contrib/gotoSymbol/browser/goToCommands";Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextPeek,title:g(po,0,"Peek"),group:"navigation",order:100});class SV{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof SV||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const gv=class gv extends wf{static all(){return gv._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of fi.wrap(t.menu))(i.id===Te.EditorContext||i.id===Te.EditorContextPeek)&&(i.when=ge.and(e.precondition,i.when));return t}constructor(e,t){super(gv._patchConfig(t)),this.configuration=e,gv._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Pi),r=e.get(jt),a=e.get(eD),c=e.get(_he),l=e.get(ht),d=e.get(be),h=t.getModel(),u=t.getPosition(),f=SV.is(i)?i:new SV(h,u),p=new I1(t,hr.Value|hr.Position),m=dw(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;sa(v.ariaMessage);let w;if(v.referenceAt(h.uri,u)){const C=this._getAlternativeCommand(t);!gv._activeAlternativeCommands.has(C)&&gv._allSymbolNavigationCommands.has(C)&&(w=gv._allSymbolNavigationCommands.get(C))}const b=v.references.length;if(b===0){if(!this.configuration.muteMessage){const C=h.getWordAtPosition(u);Du.get(t)?.showMessage(this._getNoResultFoundMessage(C),u)}}else if(b===1&&w)gv._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(C=>w.runEditorCommand(C,t,i,s).finally(()=>{gv._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,s)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,s,o){const r=this._getGoToPreference(i);if(!(i instanceof oC)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),c=s.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,s,o):s.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,s,o){let r;if(BQe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:O.collapseToStart(r),selectionRevealType:px.NearTopIfOutsideViewport,selectionSource:jb.JUMP}},e,s);if(a){if(o){const c=a.getModel(),l=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const s=wF.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),na(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};gv._allSymbolNavigationCommands=new Map,gv._activeAlternativeCommands=new Set;let zx=gv;class qQ extends zx{async _getLocationModel(e,t,i,s){return new fp(await vhe(e.definitionProvider,t,i,s),g(po,1,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,2,"No definition found for '{0}'",e.word):g(po,3,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var _0;At((_0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:_0.id,title:{...Be(po,4,"Go to Definition"),mnemonicTitle:g(po,5,"Go to &&Definition")},precondition:X.hasDefinitionProvider,keybinding:[{when:X.editorTextFocus,primary:E.F12,weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib}],menu:[{id:Te.EditorContext,group:"navigation",order:1.1},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),yt.registerCommandAlias("editor.action.goToDeclaration",_0.id)}},_0.id="editor.action.revealDefinition",_0));var v0;At((v0=class extends qQ{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:v0.id,title:Be(po,6,"Open Definition to the Side"),precondition:ge.and(X.hasDefinitionProvider,X.isInEmbeddedEditor.toNegated()),keybinding:[{when:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,E.F12),weight:ye.EditorContrib},{when:ge.and(X.editorTextFocus,yXe),primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.F12),weight:ye.EditorContrib}]}),yt.registerCommandAlias("editor.action.openDeclarationToTheSide",v0.id)}},v0.id="editor.action.revealDefinitionAside",v0));var w0;At((w0=class extends qQ{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:w0.id,title:Be(po,7,"Peek Definition"),precondition:ge.and(X.hasDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Alt|E.F12,linux:{primary:V.CtrlCmd|V.Shift|E.F10},weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:2}}),yt.registerCommandAlias("editor.action.previewDeclaration",w0.id)}},w0.id="editor.action.peekDefinition",w0));class Xtt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ktt(e.declarationProvider,t,i,s),g(po,8,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var DN;At((DN=class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:DN.id,title:{...Be(po,11,"Go to Declaration"),mnemonicTitle:g(po,12,"Go to &&Declaration")},precondition:ge.and(X.hasDeclarationProvider,X.isInEmbeddedEditor.toNegated()),menu:[{id:Te.EditorContext,group:"navigation",order:1.3},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(po,9,"No declaration found for '{0}'",e.word):g(po,10,"No declaration found")}},DN.id="editor.action.revealDeclaration",DN));At(class extends Xtt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Be(po,13,"Peek Declaration"),precondition:ge.and(X.hasDeclarationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:3}})}});class Ztt extends zx{async _getLocationModel(e,t,i,s){return new fp(await Jtt(e.typeDefinitionProvider,t,i,s),g(po,14,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,15,"No type definition found for '{0}'",e.word):g(po,16,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var kN;At((kN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kN.ID,title:{...Be(po,17,"Go to Type Definition"),mnemonicTitle:g(po,18,"Go to &&Type Definition")},precondition:X.hasTypeDefinitionProvider,keybinding:{when:X.editorTextFocus,primary:0,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.4},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},kN.ID="editor.action.goToTypeDefinition",kN));var IN;At((IN=class extends Ztt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:IN.ID,title:Be(po,19,"Peek Type Definition"),precondition:ge.and(X.hasTypeDefinitionProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:4}})}},IN.ID="editor.action.peekTypeDefinition",IN));class eit extends zx{async _getLocationModel(e,t,i,s){return new fp(await Ytt(e.implementationProvider,t,i,s),g(po,20,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(po,21,"No implementation found for '{0}'",e.word):g(po,22,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var LN;At((LN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:LN.ID,title:{...Be(po,23,"Go to Implementations"),mnemonicTitle:g(po,24,"Go to &&Implementations")},precondition:X.hasImplementationProvider,keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},LN.ID="editor.action.goToImplementation",LN));var TN;At((TN=class extends eit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TN.ID,title:Be(po,25,"Peek Implementations"),precondition:ge.and(X.hasImplementationProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F12,weight:ye.EditorContrib},menu:{id:Te.EditorContextPeek,group:"peek",order:5}})}},TN.ID="editor.action.peekImplementation",TN));class tit extends zx{_getNoResultFoundMessage(e){return e?g(po,26,"No references found for '{0}'",e.word):g(po,27,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Be(po,28,"Go to References"),mnemonicTitle:g(po,29,"Go to &&References")},precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),keybinding:{when:X.editorTextFocus,primary:V.Shift|E.F12,weight:ye.EditorContrib},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!0,s),g(po,30,"References"))}});At(class extends tit{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Be(po,31,"Peek References"),precondition:ge.and(X.hasReferenceProvider,mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new fp(await whe(e.referenceProvider,t,i,!1,s),g(po,30,"References"))}});class SOt extends zx{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Be(po,32,"Go to Any Symbol"),precondition:ge.and(mf.notInPeekEditor,X.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new fp(this._references,g(po,33,"Locations"))}_getNoResultFoundMessage(e){return e&&g(po,34,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}yt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(n,e,t,i,s,o,r)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t)),Bt(Array.isArray(i)),Bt(typeof s>"u"||typeof s=="string"),Bt(typeof r>"u"||typeof r=="boolean");const a=n.get(jt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(ja(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,vt.Smooth),c.invokeWithinContext(l=>{const d=new class extends SOt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);l.get(be).invokeFunction(d.run.bind(d),c)})}});yt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:P},{name:"position",description:"The position at which to start",constraint:oe.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(n,e,t,i,s)=>{n.get(ji).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});yt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Bt(P.isUri(e)),Bt(oe.isIPosition(t));const i=n.get(ht),s=n.get(jt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!ja(o)||!o.hasModel())return;const r=wF.get(o);if(!r)return;const a=na(l=>whe(i.referenceProvider,o.getModel(),oe.lift(t),!1,l).then(d=>new fp(d,g(po,30,"References")))),c=new O(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});yt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function AOt(n,e,t,i){const s=n.get(Rn),o=n.get(Vr),r=n.get(ji),a=n.get(be),c=n.get(Pi);if(await i.item.resolve(qe.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(Xs.getMenuItems(Te.EditorContext).map(f=>lR(f)?f.command.id:Dr()));for(const f of zx.all())h.has(f.desc.id)&&d.push(new xn(f.desc.id,id.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await s.createModelReference(l.uri);try{const m=new SV(p.object.textEditorModel,O.getStartPosition(l.range)),v=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,m,v)}finally{p.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Kr),d.push(new xn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:nt.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=ia(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function iit(n,e,t,i){const o=await n.get(Rn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Pe),l=mf.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new qQ({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new SV(o.object.textEditorModel,O.getStartPosition(i.range)),O.lift(i.range))}),o.dispose()}var SB;class Gte{constructor(){this._entries=new L_(50)}get(e){const t=Gte._key(e);return this._entries.get(t)}set(e,t){const i=Gte._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const nit=ae("IInlayHintsCache");ce(nit,Gte,Yt.Delayed);class sSe{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class EOt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var DA;(function(n){n[n.Normal=0]="Normal",n[n.Invisible=1]="Invisible"})(DA||(DA={}));var KE;let AV=(KE=class{static get(e){return e.getContribution(SB.ID)??void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new PZ(this._editor),this._activeRenderMode=DA.Normal,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(c=>{c.hasChanged(x.inlayHints)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(x.inlayHints);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=DA.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=DA.Normal,c=DA.Invisible):(a=DA.Invisible,c=DA.Normal),this._activeRenderMode=a,this._sessionDisposables.add(Nb.getInstance().event(l=>{if(!this._editor.hasModel())return;const d=l.altKey&&l.ctrlKey&&!(l.shiftKey||l.metaKey)?c:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const h=this._editor.getModel(),u=this._copyInlayHintsWithCurrentAnchor(h);this._updateHintsDecorators([h.getFullModelRange()],u),r.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Ee(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set,r=new yn(async()=>{const a=Date.now();s?.dispose(!0),s=new ai;const c=t.onWillDispose(()=>s?.cancel());try{const l=s.token,d=await $te.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(r.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!o.has(h)&&(o.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){bt(l)}finally{s.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>s?.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{s?.cancel();const c=Math.max(r.delay,1250);r.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new phe(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ai;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new EOt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new O(l,1,l,a.getLineMaxColumn(l)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Ee(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(iit,s,this._editor,r.location):uZ.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(qe.None),mo(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>ds.replace(O.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Ra(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(AOt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Mt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof m1&&t?.attachedData instanceof sSe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:nt.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new Qtt(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(O.compareRangesUsingStarts)){const r=t.validateRange(new O(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!O.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=O.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){const i=[],s=(p,m,v,w,b)=>{const C={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:w,attachedData:b};i.push({item:p,classNameRef:m,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:gi.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===DA.Normal?C:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});s(p,v," ",m?Bv.Right:Bv.None)},{fontSize:r,fontFamily:a,padding:c,isUniform:l}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,a);let h={line:0,totalLen:0};for(const p of t){if(h.line!==p.anchor.range.startLineNumber&&(h={line:p.anchor.range.startLineNumber,totalLen:0}),h.totalLen>SB._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&o(p,!1);const m=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v0&&(S=S.slice(0,-k)+"…",M=!0),s(p,this._ruleFactory.createClassNameRef(y),xOt(S),C&&!p.hint.paddingRight?Bv.Right:Bv.None,new sSe(p,v)),M)break}if(p.hint.paddingRight&&o(p,!0),i.length>SB._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(w=>w.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=M_.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}getInlayHintsForLine(e){if(!this._editor.hasModel())return[];const t=new Set,i=[];for(const s of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(s.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},SB=KE,KE.ID="editor.contrib.InlayHints",KE._MAX_DECORATORS=1500,KE._MAX_LABEL_LEN=43,KE);AV=SB=D([_(1,ht),_(2,B_),_(3,nit),_(4,ji),_(5,Pi),_(6,be)],AV);function xOt(n){return n.replace(/[ \t]/g," ")}yt.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(O.isIRange(i));const{inlayHintsProvider:s}=n.get(ht),o=await n.get(Rn).createModelReference(t);try{const r=await $te.create(s,o.object.textEditorModel,[O.lift(i)],qe.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});const bD="vs/editor/contrib/inlayHints/browser/inlayHintsHover";class B4e extends bM{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let qte=class extends X7{constructor(e,t,i,s,o,r,a,c){super(e,t,i,r,c,s,o),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!AV.get(this._editor)||e.target.type!==Mt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof m1&&i.attachedData instanceof sSe?new B4e(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof B4e?new tg(async s=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Xt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&s.emitOne(new xb(this,e.range,[r],!1,0)),mo(o.item.hint.textEdits)&&s.emitOne(new xb(this,e.range,[new Xt().appendText(g(bD,0,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Xt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&s.emitOne(new xb(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?ei?g(bD,1,"cmd + click"):g(bD,2,"ctrl + click"):ei?g(bD,3,"option + click"):g(bD,4,"alt + click");o.part.location&&o.part.command?l=new Xt().appendText(g(bD,5,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Xt().appendText(g(bD,6,"Go to Definition ({0})",h)):o.part.command&&(l=new Xt(`[${g(bD,7,"Execute Command")}](${jtt(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&s.emitOne(new xb(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)s.emitOne(l)}):tg.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return tg.EMPTY;const{uri:i,range:s}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?hFe(this._languageFeaturesService.hoverProvider,r,new oe(s.startLineNumber,s.startColumn),t).filter(a=>!YU(a.hover.contents)).map(a=>new xb(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):tg.EMPTY}finally{o.dispose()}}};qte=D([_(1,Di),_(2,fr),_(3,ti),_(4,el),_(5,Re),_(6,Rn),_(7,ht)],qte);class Qte{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=Vx.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==ku.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,c=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>c)return!1}else if(a>t.range.startColumn||t.range.endColumn>c)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return tg.EMPTY;const i=Qte._getLineDecorations(this._editor,t);return tg.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):tg.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Qte._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Ui(t)}}class sit{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new DOt(this,this.anchor,t,this.isComplete)}}class DOt extends sit{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class kOt{constructor(e,t,i,s,o,r,a,c,l,d){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=i,this.showAtPosition=s,this.showAtSecondaryPosition=o,this.preferAbove=r,this.stoleFocus=a,this.source=c,this.isBeforeContent=l,this.disposables=d,this.closestMouseDistance=void 0}}const W4e=we;let jte=class extends ${get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=W4e("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=he(this.hoverElement,W4e("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(fNe.render(this.actionsElement,e,i))}append(e){const t=he(this.actionsElement,e);return this._hasContent=!0,t}};jte=D([_(0,ti)],jte);var FJ,RN;let oSe=(RN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new I),this.onContentsChanged=this._onContentsChanged.event,this._widget=this._register(this._instantiationService.createInstance(zte,this._editor)),this._participants=[];for(const s of hL.getAll()){const o=this._instantiationService.createInstance(s,this._editor);o instanceof X7&&!(o instanceof qte)&&(this._markdownHoverParticipant=o),this._participants.push(o)}this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new Qte(this._editor,this._participants),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new sit(this._computer.anchor,o,s.isComplete))})),this._register(Xo(this._widget.getDomNode(),"keydown",s=>{s.equals(E.Escape)&&this.hide()})),this._register(dc.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(x.hover).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=FJ.computeHoverRanges(this._editor,e.range,t),r=new Z,a=r.add(new jte(this._keybindingService)),c=document.createDocumentFragment();let l=null;const d={fragment:c,statusBar:a,setColorPicker:u=>l=u,onContentsChanged:()=>this._doOnContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const f=t.filter(p=>p.owner===u);f.length>0&&r.add(u.renderHoverParts(d,f))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&c.appendChild(a.hoverElement),c.hasChildNodes()){if(o){const u=this._editor.createDecorationsCollection();u.set([{range:o,options:FJ._DECORATION_OPTIONS}]),r.add(Ee(()=>{u.clear()}))}this._widget.showAt(c,new kOt(e.initialMousePosX,e.initialMousePosY,l,i,s,this._editor.getOption(x.hover).above,this._computer.shouldFocus,this._computer.source,h,r))}else r.dispose()}_doOnContentsChanged(){this._onContentsChanged.fire(),this._widget.onContentsChanged()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const h=e._getViewModel(),u=h.coordinatesConverter,f=u.convertModelRangeToViewRange(t),p=new oe(f.startLineNumber,h.getLineMinColumn(f.startLineNumber));s=u.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,c=null;for(const h of i)a=O.plusRange(a,h.range),h.range.startLineNumber===o&&h.range.endLineNumber===o&&(r=Math.max(Math.min(r,h.range.startColumn),s)),h.forceShowAtRange&&(c=h.range);const l=c?c.getStartPosition():new oe(o,t.startColumn),d=c?c.getStartPosition():new oe(o,r);return{showAtPosition:l,showAtSecondaryPosition:d,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===Mt.CONTENT_TEXT&&t.push(new hpe(0,i.range,e.event.posx,e.event.posy)),i.type===Mt.CONTENT_EMPTY){const s=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],KS.Delayed,Vx.Mouse,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new hpe(0,e,void 0,void 0),t,i,s,null)}async updateMarkdownHoverVerbosityLevel(e,t,i){this._markdownHoverParticipant?.updateMarkdownHoverVerbosityLevel(e,t,i)}focusedMarkdownHoverIndex(){return this._markdownHoverParticipant?.focusedMarkdownHoverIndex()??-1}markdownHoverContentAtIndex(e){return this._markdownHoverParticipant?.markdownHoverContentAtIndex(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._markdownHoverParticipant?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}getWidgetContent(){const e=this._widget.getDomNode();if(e.textContent)return e.textContent}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}},FJ=RN,RN._DECORATION_OPTIONS=Kt.register({description:"content-hover-highlight",className:"hoverHighlight"}),RN);oSe=FJ=D([_(1,be),_(2,ti)],oSe);var IOt=".monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover-content{box-sizing:border-box;padding-bottom:2px;padding-right:2px}.monaco-editor .monaco-hover{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{display:flex;flex-direction:column;min-width:0}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);display:flex;flex-direction:column;justify-content:end;padding-left:5px;padding-right:5px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}";Ct(IOt,{});class LOt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=FS.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],s=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??FS.Center;if(!s&&r!==this._laneOrLine)continue;const a=s?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||YU(a)||i.push(...Kb(a).map(e))}return i}}const H4e=we,Jae=class Jae extends ${constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new gNe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new vw({editor:this._editor},t,i)),this._computer=new LOt(this._editor),this._hoverOperation=this._register(new ztt(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Jae.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(KS.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Mt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Mt.GUTTER_LINE_NUMBERS?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(KS.Delayed))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=H4e("div.hover-row.markdown-hover"),r=he(o,H4e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2,c=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};Jae.ID="editor.contrib.modesGlyphHoverWidget";let Kte=Jae;var rSe;const TOt=!1;var u2;(function(n){n[n.Content=0]="Content",n[n.Glyph=1]="Glyph"})(u2||(u2={}));var MN;let Nc=(MN=class extends ${constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new I),this.onHoverContentsChanged=this._onHoverContentsChanged.event,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Z,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new yn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(rSe.ID)}_hookListeners(){const e=this._editor.getOption(x.hover);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return!!(this._isMouseOnContentHoverWidget(e)||this._isMouseOnMarginHoverWidget(e)||this._isContentWidgetResizing())}_isMouseOnMarginHoverWidget(e){const t=e.target;return t?t.type===Mt.OVERLAY_WIDGET&&t.detail===Kte.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Mt.CONTENT_WIDGET&&t.detail===zte.ID:!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(a,c)=>{const l=this._isMouseOnMarginHoverWidget(a);return c&&l},s=(a,c)=>{const l=this._isMouseOnContentHoverWidget(a);return c&&l},o=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},r=(a,c)=>c&&this._contentWidget?.containsNode(a.event.browserEvent.view?.document.activeElement)&&!a.event.browserEvent.view?.getSelection()?.isCollapsed;return!!(i(e,t)||s(e,t)||o(e)||r(e,t))}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._contentWidget?.isFocused||this._contentWidget?.isResizing))return;const t=this._hoverSettings.sticky;if(t&&this._contentWidget?.isVisibleFromKeyboard)return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const s=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&s>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(s);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),s=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(s==="click"&&!r||s==="hover"&&!o&&!TOt||s==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,u2.Content)||this._tryShowHoverWidget(e,u2.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),s=this._getOrCreateGlyphWidget();let o,r;switch(t){case u2.Content:o=i,r=s;break;case u2.Glyph:o=s,r=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=o.showsOrWillShow(e);return a&&r.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===hp.MoreChordsNeeded||t.kind===hp.KbFound&&(t.commandId===Vtt||t.commandId===VQ||t.commandId===zQ)&&this._contentWidget?.isVisible;e.keyCode===E.Ctrl||e.keyCode===E.Alt||e.keyCode===E.Meta||e.keyCode===E.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||vV.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(oSe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(Kte,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,s,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedMarkdownHoverIndex(){return this._getOrCreateContentWidget().focusedMarkdownHoverIndex()}markdownHoverContentAtIndex(e){return this._getOrCreateContentWidget().markdownHoverContentAtIndex(e)}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)}updateMarkdownHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateMarkdownHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}getWidgetContent(){return this._contentWidget?.getWidgetContent()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose(),this._contentWidget?.dispose()}},rSe=MN,MN.ID="editor.contrib.hover",MN);Nc=rSe=D([_(1,be),_(2,ti)],Nc);const ROt=new Y("commentEditorFocused",!1),J$=5*18,MOt=25*18;let EV=class extends _1{constructor(e,t,i,s,o,r,a,c,l,d,h,u){const f={contributions:[{id:Hx.ID,ctor:Hx,instantiation:mi.BeforeFirstInteraction},{id:QS.ID,ctor:QS,instantiation:mi.BeforeFirstInteraction},{id:pm.ID,ctor:pm,instantiation:mi.Eager},{id:mc.ID,ctor:mc,instantiation:mi.Lazy},{id:Ux.ID,ctor:Ux,instantiation:mi.Eager},{id:qS.ID,ctor:qS,instantiation:mi.Lazy},...b_.getSomeEditorContributions([jS.ID,EF.ID,yV.ID,Du.ID,Nc.ID,mhe,_g.ID,AF.ID])],contextMenuId:Te.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=ROt.bindTo(i),this._commentEditorEmpty=Qv.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=s,this._register(this.onDidFocusEditorWidget(p=>this._commentEditorFocused.set(!0))),this._register(this.onDidChangeModelContent(p=>this._commentEditorEmpty.set(!this.getModel()?.getValueLength()))),this._register(this.onDidBlurEditorWidget(p=>this._commentEditorFocused.reset()))}getParentThread(){return this._parentThread}_getActions(){return b_.getEditorActions()}static getEditorOptions(e){return{wordWrap:"on",glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,scrollbar:{vertical:"visible",verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,lineDecorationsWidth:0,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},dropIntoEditor:{enabled:!0},autoClosingBrackets:e.getValue("editor.autoClosingBrackets"),quickSuggestions:!1,accessibilitySupport:e.getValue("editor.accessibilitySupport")}}};EV=D([_(4,be),_(5,jt),_(6,ji),_(7,pn),_(8,Pi),_(9,Ur),_(10,lo),_(11,ht)],EV);function oit(n,e,t){const i=e.getLayoutInfo(),s=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*s;if(o>i.height||oJ$){const r=Math.ceil((o-i.height)/s),a=i.height+s*r;return Dc(a,J$,Dc(n.getLayoutInfo().height-90,J$,MOt))}return t}var $A;(function(n){n.Add="workbench.action.addComment",n.NextThread="editor.action.nextCommentThreadAction",n.PreviousThread="editor.action.previousCommentThreadAction",n.NextRange="editor.action.nextCommentingRange",n.PreviousRange="editor.action.previousCommentingRange",n.ToggleCommenting="workbench.action.toggleCommenting",n.Submit="editor.action.submitComment",n.Hide="workbench.action.hideComment",n.CollapseAll="workbench.action.collapseAllComments",n.ExpandAll="workbench.action.expandAllComments",n.ExpandUnresolved="workbench.action.expandUnresolvedComments"})($A||($A={}));const FK="vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode",Xae=class Xae extends pi{constructor(){super({id:Xae.ID,title:Be(FK,0,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:V.CtrlCmd|E.KeyM,mac:{primary:V.WinCtrl|V.Shift|E.KeyM},weight:ye.EditorContrib},metadata:{description:Be(FK,1,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!g1.getTabFocusMode();g1.setTabFocusMode(t),sa(t?g(FK,2,"Pressing Tab will now move focus to the next focusable element"):g(FK,3,"Pressing Tab will now insert the tab character"))}};Xae.ID="editor.action.toggleTabFocusMode";let Yte=Xae;At(Yte);const CC="vs/workbench/contrib/comments/browser/commentsAccessibility";var ek;(function(n){n.intro=g(CC,0,"The editor contains commentable range(s). Some useful commands include:"),n.tabFocus=g(CC,1,"This widget contains a text area, for composition of new comments, and actions, that can be tabbed to once tab moves focus mode has been enabled with the command Toggle Tab Key Moves Focus{0}",``),n.commentCommands=g(CC,2,"Some useful comment commands include:"),n.escape=g(CC,3,"- Dismiss Comment (Escape)"),n.nextRange=g(CC,4,"- Go to Next Commenting Range{0}",``),n.previousRange=g(CC,5,"- Go to Previous Commenting Range{0}",``),n.nextCommentThread=g(CC,6,"- Go to Next Comment Thread{0}",``),n.previousCommentThread=g(CC,7,"- Go to Previous Comment Thread{0}",``),n.addComment=g(CC,8,"- Add Comment on Current Selection{0}",``),n.submitComment=g(CC,9,"- Submit Comment{0}",``)})(ek||(ek={}));const Hz="vs/workbench/contrib/files/browser/fileConstants",NOt="revealInExplorer",POt="workbench.action.files.saveAs";Be(Hz,0,"Save As...");const FOt="workbench.action.files.save";Be(Hz,1,"Save");const OOt="workbench.action.files.saveWithoutFormatting";Be(Hz,2,"Save without Formatting");const BOt="saveAll";Be(Hz,3,"Save All");const rit="workbench.files.action.saveAllInGroup",WOt="workbench.action.files.saveFiles";new Y("groupFocusedInOpenEditors",!1);new Y("dirtyEditorFocusedInOpenEditors",!1);new Y("readonlyEditorFocusedInOpenEditors",!1);new Y("resourceSelectedForCompare",!1);g(Hz,4,"Remove Folder from Workspace");const HOt="workbench.action.files.newUntitledFile";Be(Hz,5,"New Untitled Text File");let U4e=class{onClose(){this._editor.focus()}constructor(e,t,i){this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=rC.Editor,this.options={type:N_.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=ua.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Jm.readonlyDiffEditor):t.push(Jm.editableDiffEditor):e.get(x.readOnly)?t.push(Jm.readonlyEditor):t.push(Jm.editableEditor),t.push(Jm.listSignalSounds),t.push(Jm.listAlerts);const i=UOt(this._keybindingService,this._contextKeyService);i&&t.push(i);const s=ait(this._keybindingService,this._contextKeyService,this._editor);return s&&t.push(s),e.get(x.stickyScroll).enabled&&t.push(Jm.stickScroll),e.get(x.tabFocusMode)?t.push(Jm.tabFocusModeOnMsg):t.push(Jm.tabFocusModeOffMsg),t.join(` `)}};U4e=D([_(1,ti),_(2,Pe)],U4e);function ait(n,e,t){if(e.getContext(t.getDomNode()).getValue(Qv.activeEditorHasCommentingRange.key))return[ek.intro,ek.addComment,ek.nextCommentThread,ek.previousCommentThread,ek.nextRange,ek.previousRange].join(` `)}function UOt(n,e){if(utt.getValue(e))return[Jm.quickChat,Jm.startInlineChat].join(` -`)}const A5="vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp";class VOt{constructor(){this.priority=105,this.name="diff-editor",this.when=oO.create("isInDiffEditor",!0),this.type=N_.Help}getProvider(e){const t=e.get(_i),i=e.get(Qt),s=e.get(ti),o=e.get(Pe);if(!(t.activeTextEditorControl instanceof xm))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(A5,0,"Run the command Diff Editor: Switch Side to toggle between the original and modified editors."),c=g(A5,1,"The setting, accessibility.verbosity.diffEditorActive, controls if a diff editor announcement is made when it becomes the active editor."),l=["accessibility.signals.diffLineDeleted","accessibility.signals.diffLineInserted","accessibility.signals.diffLineModified"],d=[g(A5,2,"You are in a diff editor."),g(A5,3,"View the next or previous diff in diff review mode, which is optimized for screen readers.",_V.id,G7.id),a,c,g(A5,4,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=ait(s,o,r);return h&&d.push(h),{id:rC.DiffEditor,verbositySettingKey:ua.DiffEditor,provideContent:()=>d.join(` +`)}const A5="vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp";class VOt{constructor(){this.priority=105,this.name="diff-editor",this.when=oO.create("isInDiffEditor",!0),this.type=N_.Help}getProvider(e){const t=e.get(_i),i=e.get(jt),s=e.get(ti),o=e.get(Pe);if(!(t.activeTextEditorControl instanceof xm))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(A5,0,"Run the command Diff Editor: Switch Side to toggle between the original and modified editors."),c=g(A5,1,"The setting, accessibility.verbosity.diffEditorActive, controls if a diff editor announcement is made when it becomes the active editor."),l=["accessibility.signals.diffLineDeleted","accessibility.signals.diffLineInserted","accessibility.signals.diffLineModified"],d=[g(A5,2,"You are in a diff editor."),g(A5,3,"View the next or previous diff in diff review mode, which is optimized for screen readers.",_V.id,G7.id),a,c,g(A5,4,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=ait(s,o,r);return h&&d.push(h),{id:rC.DiffEditor,verbositySettingKey:ua.DiffEditor,provideContent:()=>d.join(` -`),onClose:()=>{r.focus()},options:{type:N_.Help}}}dispose(){}}const upe="vs/workbench/contrib/codeEditor/browser/diffEditorHelper";var AH;let Jte=(AH=class extends ${constructor(e,t,i,s){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=s,!(this._diffEditor instanceof $7)){const a=Wn(c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(Em((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(vte,this._diffEditor.getModifiedEditor(),g(upe,0,"Show Whitespace Differences"),null));l.add(d.onClick(()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.ignoreTrimWhitespace",!1)})),d.render()}})),this._register(this._diffEditor.onDidUpdateDiff(()=>{const c=this._diffEditor.getDiffComputationResult();c&&c.quitEarly&&this._notificationService.prompt(nt.Warning,g(upe,1,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(upe,2,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},AH.ID="editor.contrib.diffEditorHelper",AH);Jte=D([_(1,be),_(2,dl),_(3,Pi)],Jte);Aje(Jte.ID,Jte);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(n,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:n}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);NQ.register(new VOt);const gpe="vs/workbench/contrib/codeEditor/browser/largeFileOptimizations";var EH;let Xte=(EH=class extends ${constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(s=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(gpe,0,"{0}: tokenization, wrapping, folding, codelens, word highlighting and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",yr(e.uri.path));this._notificationService.prompt(nt.Info,t,[{label:g(gpe,1,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(gpe,2,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},EH.ID="editor.contrib.largeFileOptimizationsWarner",EH);Xte=D([_(1,Pi),_(2,Re)],Xte);vn(Xte.ID,Xte,mi.AfterFirstRender);class zOt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=cit(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,o=i.length;sa.lineNumber===c.lineNumber?a.column-c.column:a.lineNumber-c.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,o=0;const r=e.length;for(let a=1,c=n.getLineCount();a<=c;a++){const l=n.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof n=="string"?ze.fromString(n):{read:()=>{const e=n.read();return typeof e=="string"?ze.fromString(e):null}}}const lit="vs/workbench/contrib/scm/browser/dirtyDiffSwitcher";let aSe=class extends JJe{constructor(e,t,i,s,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...iXe},l=o.getColorTheme(),d=l.getColor(us),u=l.getColor(SR)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,s,c,{ariaLabel:g(lit,0,"Switch quick diff base")}),this.optionsItems=r}setSelection(e){const t=this.optionsItems.findIndex(i=>i.provider===e);this.select(t)}getActionContext(e,t){return this.optionsItems[t]}render(e){super.render(e),this.setFocusable(!0)}};aSe=D([_(3,W_),_(4,pn)],aSe);const j2=class j2 extends xn{constructor(e){super(j2.ID,j2.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};j2.ID="quickDiff.base.switch",j2.LABEL=g(lit,1,"Switch Quick Diff Base");let cSe=j2;var lSe,JL;const bl="vs/workbench/contrib/scm/browser/dirtydiffDecorator";class KOt extends gw{runAction(e,t){return e instanceof id?e.run(...t):super.runAction(e,t)}}const dit=new Y("dirtyDiffVisible",!1);function YOt(n){const e=n.modifiedEndLineNumber-n.modifiedStartLineNumber+1,t=n.originalEndLineNumber-n.originalStartLineNumber+1;return n.originalEndLineNumber===0?e:n.modifiedEndLineNumber===0?t:e+t}function dSe(n){return n.modifiedEndLineNumber===0?n.modifiedStartLineNumber===0?1:n.modifiedStartLineNumber:n.modifiedEndLineNumber}function JOt(n,e){return n===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:n>=e.modifiedStartLineNumber&&n<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let X$=class extends xn{constructor(e,t,i,s,o){const r=s.lookupKeybinding(t.id),a=t.label+(r?` (${r.getLabel()})`:"");super(t.id,a,i),this.instantiationService=o,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};X$=D([_(3,ti),_(4,be)],X$);var wm;(function(n){n[n.Modify=0]="Modify",n[n.Add=1]="Add",n[n.Delete=2]="Delete"})(wm||(wm={}));function fFe(n){return n.originalEndLineNumber===0?wm.Add:n.modifiedEndLineNumber===0?wm.Delete:wm.Modify}function XOt(n,e){switch(e){case wm.Modify:return n.getColor(PE);case wm.Add:return n.getColor(FE);case wm.Delete:return n.getColor(OE)}}function QQ(n){const e=n.get(Qt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof $7)return t.getParentEditor();return Bet(n)}let hSe=class extends V7{constructor(e,t,i,s,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},s),this.model=t,this.themeService=i,this.menuService=o,this.contextKeyService=r,this._index=0,this._provider="",this.height=void 0,this._disposables.add(i.onDidColorThemeChange(this._applyTheme,this)),this._applyTheme(i.getColorTheme()),this.model.original.length>0&&(r=r.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=ui(e.getModel().uri):this.title="",this.setTitle(this.title)}get provider(){return this._provider}get index(){return this._index}get visibleRange(){const e=this.diffEditor.getModifiedEditor().getVisibleRanges();return e.length>=0?e[0]:void 0}showChange(e,t=!0){const i=this.model.changes[e],s=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=s,!this.model.original)return;T.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(s),0));const a=this.model.getDiffEditorModel(i.uri.toString());if(!a)return;this.diffEditor.setModel(a),this.dropdown?.setSelection(i.label);const c=new oe(dSe(s),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(YOt(s)+8,Math.floor(h/3));this.renderTitle(i.label);const f=fFe(s),p=XOt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const w of this.model.changes)w.label===this.model.changes[this._index].label&&(m.push(w.change),i===w&&(v=m.length-1));this._actionbarWidget.context=[a.modified.uri,m,v],t&&(this.show(c,u),this.editor.setPosition(c),this.editor.focus())}renderTitle(e){const t=this.model.mapChanges.get(e),i=t.indexOf(this._index);let s;this.shouldUseDropdown()?(s=this.model.changes.length>1?g(bl,2,"{0} of {1} changes",i+1,t.length):g(bl,3,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(s=this.model.changes.length>1?g(bl,0,"{0} - {1} of {2} changes",e,i+1,t.length):g(bl,1,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,s)}switchQuickDiff(e){const t=e?.provider;if(t===this.model.changes[this._index].label)return;let i=this._index0?this._index-1:this.model.changes.length-1;for(let r=s;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){s=r;break}const o=Math.abs(this.model.changes[i].change.modifiedEndLineNumber-this.model.changes[this._index].change.modifiedEndLineNumber)1){const t=Array.from(this.model.mapChanges.keys());for(let i=0;i0&&e++}return e>=2}updateActions(){if(!this._actionbarWidget)return;const e=this.instantiationService.createInstance(X$,this.editor,new hit(this.editor),$e.asClassName(x0t)),t=this.instantiationService.createInstance(X$,this.editor,new uit(this.editor),$e.asClassName(D0t));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(Te.SCMChangeContext,this.contextKeyService),tD(this.menu,{shouldForwardArgs:!0},i),this._actionbarWidget.clear(),this._actionbarWidget.push(i.reverse(),{label:!1,icon:!0}),this._actionbarWidget.push([t,e],{label:!1,icon:!0}),this._actionbarWidget.push(new xn("peekview.close",g(bl,4,"Close"),$e.asClassName(Ce.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Yle(this._titleElement,we(".dropdown")),this.dropdown=this.instantiationService.createInstance(aSe,new cSe(t=>this.switchQuickDiff(t)),this.model.quickDiffs.map(t=>t.label),this.model.changes[this._index].label),this.dropdown.render(this.dropdownContainer),this.updateActions()}_getActionBarOptions(){const e=new KOt;return e.onDidRun(t=>{!(t.action instanceof X$)&&!t.error&&this.dispose()}),{...super._getActionBarOptions(),actionRunner:e}}_fillBody(e){const t={scrollBeyondLastLine:!0,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1},renderSideBySide:!1,readOnly:!1,renderIndicators:!1,diffAlgorithm:"advanced",ignoreTrimWhitespace:!1,stickyScroll:{enabled:!1}};this.diffEditor=this.instantiationService.createInstance($7,e,t,{},this.editor),this._disposables.add(this.diffEditor)}_onWidth(e){typeof this.height>"u"||this.diffEditor.layout({height:this.height,width:e})}_doLayoutBody(e,t){super._doLayoutBody(e,t),this.diffEditor.layout({height:e,width:t}),typeof this.height>"u"&&this.change&&this.revealChange(this.change),this.height=e}revealChange(e){let t,i;e.modifiedEndLineNumber===0?(t=e.modifiedStartLineNumber,i=e.modifiedStartLineNumber+1):e.originalEndLineNumber>0?(t=e.modifiedStartLineNumber-1,i=e.modifiedEndLineNumber+1):(t=e.modifiedStartLineNumber,i=e.modifiedEndLineNumber),this.diffEditor.revealLinesInCenter(t,i,vt.Immediate)}_applyTheme(e){const t=e.getColor($Pe)||fe.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(SR)||fe.transparent,primaryHeadingColor:e.getColor(VPe),secondaryHeadingColor:e.getColor(zPe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,vt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};hSe=D([_(2,pn),_(3,be),_(4,mc),_(5,Pe)],hSe);class hit extends lt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(bl,5,"Show Previous Change"),alias:"Show Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.previous()}}Fe(hit);class uit extends lt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(bl,6,"Show Next Change"),alias:"Show Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.next()}}Fe(uit);Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(bl,7,"Next &&Change")},order:1});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(bl,8,"Previous &&Change")},order:2});class ZOt extends lt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(bl,9,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=QQ(e),i=e.get(Lw),s=e.get(Ur),o=e.get(Qt);if(!t||!t.hasModel())return;const r=YS.get(t);if(!r||!r.modelRegistry)return;const a=t.getPosition().lineNumber,c=r.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await fit(d.change,i),git(d.change,t,s,o)}}Fe(ZOt);class eBt extends lt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(bl,10,"Go to Next Change"),alias:"Go to Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=e.get(Lw),i=QQ(e),s=e.get(Ur),o=e.get(Qt);if(!i||!i.hasModel())return;const r=YS.get(i);if(!r||!r.modelRegistry)return;const a=i.getPosition().lineNumber,c=r.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await fit(d,t),git(d,i,s,o)}}function git(n,e,t,i){const s=new oe(n.modifiedStartLineNumber,1);e.setPosition(s),e.revealPositionInCenter(s),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:n.modifiedStartLineNumber,startColumn:0,endLineNumber:n.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function fit(n,e){switch(fFe(n)){case wm.Add:e.playSignal(Zl.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case wm.Delete:e.playSignal(Zl.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case wm.Modify:e.playSignal(Zl.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Fe(eBt);xr.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:ye.EditorContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(dit),handler:n=>{const e=QQ(n);if(!e)return;const t=YS.get(e);t&&t.close()}});var NN;let YS=(NN=class extends ${static get(e){return e.getContribution(lSe.ID)}constructor(e,t,i,s){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=s,this.modelRegistry=null,this.model=null,this.widget=null,this.session=$.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=od(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=dit.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=T.filter(i.onDidChangeConfiguration,r=>r.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(o(this.onDidChangeGutterAction,this)),this.onDidChangeGutterAction()}}onDidChangeGutterAction(){const e=this.configurationService.getValue("scm.diffDecorationsGutterAction");this.gutterActionDisposables.clear(),e==="diff"?(this.gutterActionDisposables.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.gutterActionDisposables.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.stylesheet.textContent=` +`),onClose:()=>{r.focus()},options:{type:N_.Help}}}dispose(){}}const upe="vs/workbench/contrib/codeEditor/browser/diffEditorHelper";var AH;let Jte=(AH=class extends ${constructor(e,t,i,s){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=s,!(this._diffEditor instanceof $7)){const a=Wn(c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(Em((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(vte,this._diffEditor.getModifiedEditor(),g(upe,0,"Show Whitespace Differences"),null));l.add(d.onClick(()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.ignoreTrimWhitespace",!1)})),d.render()}})),this._register(this._diffEditor.onDidUpdateDiff(()=>{const c=this._diffEditor.getDiffComputationResult();c&&c.quitEarly&&this._notificationService.prompt(nt.Warning,g(upe,1,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(upe,2,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},AH.ID="editor.contrib.diffEditorHelper",AH);Jte=D([_(1,be),_(2,dl),_(3,Pi)],Jte);Aje(Jte.ID,Jte);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(n,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:n}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);NQ.register(new VOt);const gpe="vs/workbench/contrib/codeEditor/browser/largeFileOptimizations";var EH;let Xte=(EH=class extends ${constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(s=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(gpe,0,"{0}: tokenization, wrapping, folding, codelens, word highlighting and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.",yr(e.uri.path));this._notificationService.prompt(nt.Info,t,[{label:g(gpe,1,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(gpe,2,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},EH.ID="editor.contrib.largeFileOptimizationsWarner",EH);Xte=D([_(1,Pi),_(2,Re)],Xte);vn(Xte.ID,Xte,mi.AfterFirstRender);class zOt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=cit(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,o=i.length;sa.lineNumber===c.lineNumber?a.column-c.column:a.lineNumber-c.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,o=0;const r=e.length;for(let a=1,c=n.getLineCount();a<=c;a++){const l=n.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof n=="string"?ze.fromString(n):{read:()=>{const e=n.read();return typeof e=="string"?ze.fromString(e):null}}}const lit="vs/workbench/contrib/scm/browser/dirtyDiffSwitcher";let aSe=class extends JJe{constructor(e,t,i,s,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...iXe},l=o.getColorTheme(),d=l.getColor(us),u=l.getColor(SR)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,s,c,{ariaLabel:g(lit,0,"Switch quick diff base")}),this.optionsItems=r}setSelection(e){const t=this.optionsItems.findIndex(i=>i.provider===e);this.select(t)}getActionContext(e,t){return this.optionsItems[t]}render(e){super.render(e),this.setFocusable(!0)}};aSe=D([_(3,W_),_(4,pn)],aSe);const j2=class j2 extends xn{constructor(e){super(j2.ID,j2.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};j2.ID="quickDiff.base.switch",j2.LABEL=g(lit,1,"Switch Quick Diff Base");let cSe=j2;var lSe,JL;const bl="vs/workbench/contrib/scm/browser/dirtydiffDecorator";class KOt extends gw{runAction(e,t){return e instanceof id?e.run(...t):super.runAction(e,t)}}const dit=new Y("dirtyDiffVisible",!1);function YOt(n){const e=n.modifiedEndLineNumber-n.modifiedStartLineNumber+1,t=n.originalEndLineNumber-n.originalStartLineNumber+1;return n.originalEndLineNumber===0?e:n.modifiedEndLineNumber===0?t:e+t}function dSe(n){return n.modifiedEndLineNumber===0?n.modifiedStartLineNumber===0?1:n.modifiedStartLineNumber:n.modifiedEndLineNumber}function JOt(n,e){return n===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:n>=e.modifiedStartLineNumber&&n<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let X$=class extends xn{constructor(e,t,i,s,o){const r=s.lookupKeybinding(t.id),a=t.label+(r?` (${r.getLabel()})`:"");super(t.id,a,i),this.instantiationService=o,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};X$=D([_(3,ti),_(4,be)],X$);var wm;(function(n){n[n.Modify=0]="Modify",n[n.Add=1]="Add",n[n.Delete=2]="Delete"})(wm||(wm={}));function fFe(n){return n.originalEndLineNumber===0?wm.Add:n.modifiedEndLineNumber===0?wm.Delete:wm.Modify}function XOt(n,e){switch(e){case wm.Modify:return n.getColor(PE);case wm.Add:return n.getColor(FE);case wm.Delete:return n.getColor(OE)}}function QQ(n){const e=n.get(jt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof $7)return t.getParentEditor();return Bet(n)}let hSe=class extends V7{constructor(e,t,i,s,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},s),this.model=t,this.themeService=i,this.menuService=o,this.contextKeyService=r,this._index=0,this._provider="",this.height=void 0,this._disposables.add(i.onDidColorThemeChange(this._applyTheme,this)),this._applyTheme(i.getColorTheme()),this.model.original.length>0&&(r=r.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=ui(e.getModel().uri):this.title="",this.setTitle(this.title)}get provider(){return this._provider}get index(){return this._index}get visibleRange(){const e=this.diffEditor.getModifiedEditor().getVisibleRanges();return e.length>=0?e[0]:void 0}showChange(e,t=!0){const i=this.model.changes[e],s=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=s,!this.model.original)return;T.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(s),0));const a=this.model.getDiffEditorModel(i.uri.toString());if(!a)return;this.diffEditor.setModel(a),this.dropdown?.setSelection(i.label);const c=new oe(dSe(s),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(YOt(s)+8,Math.floor(h/3));this.renderTitle(i.label);const f=fFe(s),p=XOt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const w of this.model.changes)w.label===this.model.changes[this._index].label&&(m.push(w.change),i===w&&(v=m.length-1));this._actionbarWidget.context=[a.modified.uri,m,v],t&&(this.show(c,u),this.editor.setPosition(c),this.editor.focus())}renderTitle(e){const t=this.model.mapChanges.get(e),i=t.indexOf(this._index);let s;this.shouldUseDropdown()?(s=this.model.changes.length>1?g(bl,2,"{0} of {1} changes",i+1,t.length):g(bl,3,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(s=this.model.changes.length>1?g(bl,0,"{0} - {1} of {2} changes",e,i+1,t.length):g(bl,1,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,s)}switchQuickDiff(e){const t=e?.provider;if(t===this.model.changes[this._index].label)return;let i=this._index0?this._index-1:this.model.changes.length-1;for(let r=s;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){s=r;break}const o=Math.abs(this.model.changes[i].change.modifiedEndLineNumber-this.model.changes[this._index].change.modifiedEndLineNumber)1){const t=Array.from(this.model.mapChanges.keys());for(let i=0;i0&&e++}return e>=2}updateActions(){if(!this._actionbarWidget)return;const e=this.instantiationService.createInstance(X$,this.editor,new hit(this.editor),$e.asClassName(x0t)),t=this.instantiationService.createInstance(X$,this.editor,new uit(this.editor),$e.asClassName(D0t));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(Te.SCMChangeContext,this.contextKeyService),tD(this.menu,{shouldForwardArgs:!0},i),this._actionbarWidget.clear(),this._actionbarWidget.push(i.reverse(),{label:!1,icon:!0}),this._actionbarWidget.push([t,e],{label:!1,icon:!0}),this._actionbarWidget.push(new xn("peekview.close",g(bl,4,"Close"),$e.asClassName(Ce.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Yle(this._titleElement,we(".dropdown")),this.dropdown=this.instantiationService.createInstance(aSe,new cSe(t=>this.switchQuickDiff(t)),this.model.quickDiffs.map(t=>t.label),this.model.changes[this._index].label),this.dropdown.render(this.dropdownContainer),this.updateActions()}_getActionBarOptions(){const e=new KOt;return e.onDidRun(t=>{!(t.action instanceof X$)&&!t.error&&this.dispose()}),{...super._getActionBarOptions(),actionRunner:e}}_fillBody(e){const t={scrollBeyondLastLine:!0,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1},renderSideBySide:!1,readOnly:!1,renderIndicators:!1,diffAlgorithm:"advanced",ignoreTrimWhitespace:!1,stickyScroll:{enabled:!1}};this.diffEditor=this.instantiationService.createInstance($7,e,t,{},this.editor),this._disposables.add(this.diffEditor)}_onWidth(e){typeof this.height>"u"||this.diffEditor.layout({height:this.height,width:e})}_doLayoutBody(e,t){super._doLayoutBody(e,t),this.diffEditor.layout({height:e,width:t}),typeof this.height>"u"&&this.change&&this.revealChange(this.change),this.height=e}revealChange(e){let t,i;e.modifiedEndLineNumber===0?(t=e.modifiedStartLineNumber,i=e.modifiedStartLineNumber+1):e.originalEndLineNumber>0?(t=e.modifiedStartLineNumber-1,i=e.modifiedEndLineNumber+1):(t=e.modifiedStartLineNumber,i=e.modifiedEndLineNumber),this.diffEditor.revealLinesInCenter(t,i,vt.Immediate)}_applyTheme(e){const t=e.getColor($Pe)||fe.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(SR)||fe.transparent,primaryHeadingColor:e.getColor(VPe),secondaryHeadingColor:e.getColor(zPe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,vt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};hSe=D([_(2,pn),_(3,be),_(4,_c),_(5,Pe)],hSe);class hit extends lt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(bl,5,"Show Previous Change"),alias:"Show Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.previous()}}Fe(hit);class uit extends lt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(bl,6,"Show Next Change"),alias:"Show Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F3,weight:ye.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??QQ(e);if(!t)return;const i=YS.get(t);i&&i.canNavigate()&&i.next()}}Fe(uit);Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(bl,7,"Next &&Change")},order:1});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(bl,8,"Previous &&Change")},order:2});class ZOt extends lt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(bl,9,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=QQ(e),i=e.get(Lw),s=e.get(Ur),o=e.get(jt);if(!t||!t.hasModel())return;const r=YS.get(t);if(!r||!r.modelRegistry)return;const a=t.getPosition().lineNumber,c=r.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await fit(d.change,i),git(d.change,t,s,o)}}Fe(ZOt);class eBt extends lt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(bl,10,"Go to Next Change"),alias:"Go to Next Change",precondition:Vde.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Alt|E.F5,weight:ye.EditorContrib}})}async run(e){const t=e.get(Lw),i=QQ(e),s=e.get(Ur),o=e.get(jt);if(!i||!i.hasModel())return;const r=YS.get(i);if(!r||!r.modelRegistry)return;const a=i.getPosition().lineNumber,c=r.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await fit(d,t),git(d,i,s,o)}}function git(n,e,t,i){const s=new oe(n.modifiedStartLineNumber,1);e.setPosition(s),e.revealPositionInCenter(s),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:n.modifiedStartLineNumber,startColumn:0,endLineNumber:n.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function fit(n,e){switch(fFe(n)){case wm.Add:e.playSignal(Zl.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case wm.Delete:e.playSignal(Zl.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case wm.Modify:e.playSignal(Zl.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Fe(eBt);xr.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:ye.EditorContrib+50,primary:E.Escape,secondary:[V.Shift|E.Escape],when:ge.and(dit),handler:n=>{const e=QQ(n);if(!e)return;const t=YS.get(e);t&&t.close()}});var NN;let YS=(NN=class extends ${static get(e){return e.getContribution(lSe.ID)}constructor(e,t,i,s){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=s,this.modelRegistry=null,this.model=null,this.widget=null,this.session=$.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=od(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=dit.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=T.filter(i.onDidChangeConfiguration,r=>r.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(o(this.onDidChangeGutterAction,this)),this.onDidChangeGutterAction()}}onDidChangeGutterAction(){const e=this.configurationService.getValue("scm.diffDecorationsGutterAction");this.gutterActionDisposables.clear(),e==="diff"?(this.gutterActionDisposables.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.gutterActionDisposables.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.stylesheet.textContent=` .monaco-editor .dirty-diff-glyph { cursor: pointer; } @@ -731,7 +731,7 @@ Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals? border-top-width: 0; border-bottom-width: 0; } - `):this.stylesheet.textContent=""}canNavigate(){return!this.widget||this.widget?.index===-1||!!this.model&&this.model.changes.length>1}refresh(){this.widget?.showChange(this.widget.index,!1)}next(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&(typeof e=="number"||!this.widget.provider))t=this.model.findNextClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s+1,i.length)]}this.widget.showChange(t)}previous(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&typeof e=="number")t=this.model.findPreviousClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=$.None}assertWidget(){if(!this.enabled)return!1;if(this.widget)return!this.model||this.model.changes.length===0?(this.close(),!1):!0;if(!this.modelRegistry)return!1;const e=this.editor.getModel();if(!e)return!1;const t=this.modelRegistry.getModel(e,this.editor);if(!t||t.changes.length===0)return!1;this.model=t,this.widget=this.instantiationService.createInstance(hSe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(T.once(this.widget.onDidClose)(this.close,this)),T.chain(t.onDidChange,o=>o.filter(r=>r.diff.length>0).map(r=>r.diff))(this.onDidModelChange,this,i),i.add(this.widget),i.add(Ee(()=>{this.model=null,this.widget=null,this.isDirtyDiffVisible.set(!1),this.editor.focus()})),this.session=i,!0}onDidModelChange(e){if(!(!this.model||!this.widget||this.widget.hasFocus())){for(const t of e)if(t.start<=this.widget.index){this.next();return}this.refresh()}}onEditorMouseDown(e){this.mouseDownInfo=null;const t=e.target.range;if(!t||!e.event.leftButton||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,s=e.target.element.offsetLeft,o=i.offsetX-s;o<-3||o>3||(this.mouseDownInfo={lineNumber:t.startLineNumber})}onEditorMouseUp(e){if(!this.mouseDownInfo)return;const{lineNumber:t}=this.mouseDownInfo;this.mouseDownInfo=null;const i=e.target.range;if(!i||i.startLineNumber!==t||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const s=this.editor.getModel();if(!s)return;const o=this.modelRegistry.getModel(s,this.editor);if(!o)return;const r=o.changes.findIndex(a=>JOt(t,a.change));r<0||(r===this.widget?.index?this.close():this.next(t))}getChanges(){if(!this.modelRegistry)return[];if(!this.editor.hasModel())return[];const e=this.modelRegistry.getModel(this.editor.getModel(),this.editor);return e?e.changes.map(t=>t.change):[]}dispose(){this.gutterActionDisposables.dispose(),super.dispose()}},lSe=NN,NN.ID="editor.contrib.dirtydiff",NN);YS=lSe=D([_(1,Pe),_(2,Re),_(3,be)],YS);const PE=B("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(bl,11,"Editor gutter background color for lines that are modified.")),FE=B("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(bl,12,"Editor gutter background color for lines that are added.")),OE=B("editorGutter.deletedBackground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(bl,13,"Editor gutter background color for lines that are deleted.")),V4e=B("minimapGutter.modifiedBackground",{dark:PE,light:PE,hcDark:PE,hcLight:PE},g(bl,14,"Minimap gutter background color for lines that are modified.")),z4e=B("minimapGutter.addedBackground",{dark:FE,light:FE,hcDark:FE,hcLight:FE},g(bl,15,"Minimap gutter background color for lines that are added.")),tBt=B("minimapGutter.deletedBackground",{dark:OE,light:OE,hcDark:OE,hcLight:OE},g(bl,16,"Minimap gutter background color for lines that are deleted.")),$4e=B("editorOverviewRuler.modifiedForeground",{dark:Ie(PE,.6),light:Ie(PE,.6),hcDark:Ie(PE,.6),hcLight:Ie(PE,.6)},g(bl,17,"Overview ruler marker color for modified content.")),G4e=B("editorOverviewRuler.addedForeground",{dark:Ie(FE,.6),light:Ie(FE,.6),hcDark:Ie(FE,.6),hcLight:Ie(FE,.6)},g(bl,18,"Overview ruler marker color for added content.")),iBt=B("editorOverviewRuler.deletedForeground",{dark:Ie(OE,.6),light:Ie(OE,.6),hcDark:Ie(OE,.6),hcLight:Ie(OE,.6)},g(bl,19,"Overview ruler marker color for deleted content."));let uSe=JL=class extends ${static createDecoration(e,t,i){const s={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(s.linesDecorationsClassName=`dirty-diff-glyph ${e}`,s.linesDecorationsTooltip=t),i.overview.active&&(s.overviewRuler={color:Nr(i.overview.color),position:oh.Left}),i.minimap.active&&(s.minimap={color:Nr(i.minimap.color),position:xu.Gutter}),jt.createDynamic(s)}constructor(e,t,i,s){super(),this.codeEditor=t,this.model=i,this.configurationService=s,this.editorModel=e;const o=s.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(bl,20,"Added lines");this.addedOptions=JL.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0}),this.addedPatternOptions=JL.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0});const d=g(bl,21,"Changed lines");this.modifiedOptions=JL.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.modifiedPatternOptions=JL.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.deletedOptions=JL.createDecoration("dirty-diff-deleted",g(bl,22,"Removed lines"),{gutter:r,overview:{active:a,color:iBt},minimap:{active:c,color:tBt},isWholeLine:!1}),this._register(s.onDidChangeConfiguration(h=>{h.affectsConfiguration("scm.diffDecorationsGutterPattern")&&this.onDidChange()})),this._register(i.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const e=this.configurationService.getValue("scm.diffDecorationsGutterPattern"),t=this.model.changes.map(i=>{const s=i.change,o=fFe(s),r=s.modifiedStartLineNumber,a=s.modifiedEndLineNumber||r;switch(o){case wm.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case wm.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case wm.Modify:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.modified?this.modifiedPatternOptions:this.modifiedOptions}}});this.decorationsCollection?this.decorationsCollection.set(t):this.decorationsCollection=this.codeEditor.createDecorationsCollection(t)}dispose(){super.dispose(),this.decorationsCollection&&this.decorationsCollection?.clear(),this.editorModel=null,this.decorationsCollection=void 0}};uSe=JL=D([_(3,Re)],uSe);function q4e(n,e){let t=n.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=n.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=n.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:n.originalEndLineNumber-e.originalEndLineNumber}async function nBt(n,e,t,i){const s=await n.getQuickDiffs(e,t,i);return s.length>0?s[0].originalResource:null}let gSe=class extends ${get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,s,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=s,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new iQ(200),this.repositoryDisposables=new Set,this.originalModelDisposables=this._register(new Z),this._disposed=!1,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._changes=[],this._mapChanges=new Map,this._model=e,this._register(e.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),this._register(T.filter(o.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsIgnoreTrimWhitespace")||c.affectsConfiguration("diffEditor.ignoreTrimWhitespace"))(this.triggerDiff,this)),this._register(t.onDidAddRepository(this.onDidAddRepository,this));for(const c of t.repositories)this.onDidAddRepository(c);this._register(this._model.onDidChangeEncoding(()=>{this.diffDelayer.cancel(),this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],this._quickDiffsPromise=void 0,this.setChanges([],new Map),this.triggerDiff()})),this._register(this.quickDiffService.onDidChangeQuickDiffProviders(()=>this.triggerDiff())),this.triggerDiff()}get quickDiffs(){return this._quickDiffs}getDiffEditorModel(e){if(!this._originalModels.has(e))return;const t=this._originalModels.get(e);return{modified:this._model.textEditorModel,original:t.textEditorModel}}onDidAddRepository(e){const t=new Z;this.repositoryDisposables.add(t),t.add(Ee(()=>this.repositoryDisposables.delete(t)));const i=T.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const s=T.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(s(()=>St(t),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(e=>{const t=Array.from(this._originalModels.values());!e||this._disposed||this._model.isDisposed()||t.some(i=>i.isDisposed())||(t.every(i=>i.textEditorModel.getValueLength()===0)&&(e.changes=[]),e.changes||(e.changes=[]),this.setChanges(e.changes,e.mapChanges))},e=>bt(e)):Promise.resolve(null)}setChanges(e,t){const i=PRe(this._changes,e,(s,o)=>q4e(s.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:ch.Scm,delay:250},async()=>{const e=await this.getQuickDiffsPromise();if(this._disposed||this._model.isDisposed()||e.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const t=e.filter(c=>this.editorWorkerService.canComputeDirtyDiff(c.originalResource,this._model.resource));if(t.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const i=this.configurationService.getValue("scm.diffDecorationsIgnoreTrimWhitespace"),s=i==="inherit"?this.configurationService.getValue("diffEditor.ignoreTrimWhitespace"):i!=="false",o=[];for(const c of t){const l=await this.editorWorkerService.computeDirtyDiff(c.originalResource,this._model.resource,s);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>q4e(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):Ls(this._quickDiffs,e,(t,i)=>t.originalResource.toString()===i.originalResource.toString()&&t.label===i.label)?e:(this.originalModelDisposables.clear(),this._originalModels.clear(),this._originalTextModels=[],this._quickDiffs=e,(await Promise.all(e.map(async t=>{try{const i=await this.textModelResolverService.createModelReference(t.originalResource);if(this._disposed)return i.dispose(),[];if(this._originalModels.set(t.originalResource.toString(),i.object),this._originalTextModels.push(i.object.textEditorModel),qOt(i.object)){const s=this._model.getEncoding();s&&i.object.setEncoding(s,Z7.Decode)}return this.originalModelDisposables.add(i),this.originalModelDisposables.add(i.object.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),t}catch{return[]}}))).flat())),this._quickDiffsPromise.finally(()=>{this._quickDiffsPromise=void 0}))}async getOriginalResource(){if(this._disposed)return Promise.resolve([]);const e=this._model.resource;return this.quickDiffService.getQuickDiffs(e,this._model.getLanguageId(),this._model.textEditorModel?gS(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let s;!i&&t&&(s=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(s&&a.label!==s)o.push(r);else return r}else if(a.change.modifiedStartLineNumber>e)return r;if(o.length>0&&o.length===c)return o[0]}return o.length>0?o[0]:0}findPreviousClosestChange(e,t=!0,i){for(let s=this.changes.length-1;s>=0;s--){if(i&&this.changes[s].label!==i)continue;const o=this.changes[s].change;if(t){if(o.modifiedStartLineNumber<=e)return s}else if(dSe(o)St(e)),this.repositoryDisposables.clear()}};gSe=D([_(1,RPe),_(2,DQ),_(3,kd),_(4,Re),_(5,Rn),_(6,Cf)],gSe);class sBt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let Q4e=class extends ${constructor(e,t,i,s){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=s,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new wi,this.transientDisposables=this._register(new Z),this.stylesheet=od(void 0,void 0,this._store);const o=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterVisibility"));this._register(a(this.onDidChangeDiffVisibilityConfiguration,this)),this.onDidChangeDiffVisibilityConfiguration()}onDidChangeConfiguration(){this.configurationService.getValue("scm.diffDecorations")!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let e=this.configurationService.getValue("scm.diffDecorationsGutterWidth");(isNaN(e)||e<=0||e>5)&&(e=3),this.setViewState({...this.viewState,width:e})}onDidChangeDiffVisibilityConfiguration(){const e=this.configurationService.getValue("scm.diffDecorationsGutterVisibility");this.setViewState({...this.viewState,visibility:e})}setViewState(e){this.viewState=e,this.stylesheet.textContent=` + `):this.stylesheet.textContent=""}canNavigate(){return!this.widget||this.widget?.index===-1||!!this.model&&this.model.changes.length>1}refresh(){this.widget?.showChange(this.widget.index,!1)}next(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&(typeof e=="number"||!this.widget.provider))t=this.model.findNextClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s+1,i.length)]}this.widget.showChange(t)}previous(e){if(!this.assertWidget()||!this.widget||!this.model)return;let t;if(this.editor.hasModel()&&typeof e=="number")t=this.model.findPreviousClosestChange(typeof e=="number"?e:this.editor.getPosition().lineNumber,!0,this.widget.provider);else{const i=this.model.mapChanges.get(this.widget.provider)??this.model.mapChanges.values().next().value,s=i.findIndex(o=>o===this.widget.index);t=i[wHe(s-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=$.None}assertWidget(){if(!this.enabled)return!1;if(this.widget)return!this.model||this.model.changes.length===0?(this.close(),!1):!0;if(!this.modelRegistry)return!1;const e=this.editor.getModel();if(!e)return!1;const t=this.modelRegistry.getModel(e,this.editor);if(!t||t.changes.length===0)return!1;this.model=t,this.widget=this.instantiationService.createInstance(hSe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(T.once(this.widget.onDidClose)(this.close,this)),T.chain(t.onDidChange,o=>o.filter(r=>r.diff.length>0).map(r=>r.diff))(this.onDidModelChange,this,i),i.add(this.widget),i.add(Ee(()=>{this.model=null,this.widget=null,this.isDirtyDiffVisible.set(!1),this.editor.focus()})),this.session=i,!0}onDidModelChange(e){if(!(!this.model||!this.widget||this.widget.hasFocus())){for(const t of e)if(t.start<=this.widget.index){this.next();return}this.refresh()}}onEditorMouseDown(e){this.mouseDownInfo=null;const t=e.target.range;if(!t||!e.event.leftButton||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,s=e.target.element.offsetLeft,o=i.offsetX-s;o<-3||o>3||(this.mouseDownInfo={lineNumber:t.startLineNumber})}onEditorMouseUp(e){if(!this.mouseDownInfo)return;const{lineNumber:t}=this.mouseDownInfo;this.mouseDownInfo=null;const i=e.target.range;if(!i||i.startLineNumber!==t||e.target.type!==Mt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const s=this.editor.getModel();if(!s)return;const o=this.modelRegistry.getModel(s,this.editor);if(!o)return;const r=o.changes.findIndex(a=>JOt(t,a.change));r<0||(r===this.widget?.index?this.close():this.next(t))}getChanges(){if(!this.modelRegistry)return[];if(!this.editor.hasModel())return[];const e=this.modelRegistry.getModel(this.editor.getModel(),this.editor);return e?e.changes.map(t=>t.change):[]}dispose(){this.gutterActionDisposables.dispose(),super.dispose()}},lSe=NN,NN.ID="editor.contrib.dirtydiff",NN);YS=lSe=D([_(1,Pe),_(2,Re),_(3,be)],YS);const PE=B("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(bl,11,"Editor gutter background color for lines that are modified.")),FE=B("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(bl,12,"Editor gutter background color for lines that are added.")),OE=B("editorGutter.deletedBackground",{dark:Vh,light:Vh,hcDark:Vh,hcLight:Vh},g(bl,13,"Editor gutter background color for lines that are deleted.")),V4e=B("minimapGutter.modifiedBackground",{dark:PE,light:PE,hcDark:PE,hcLight:PE},g(bl,14,"Minimap gutter background color for lines that are modified.")),z4e=B("minimapGutter.addedBackground",{dark:FE,light:FE,hcDark:FE,hcLight:FE},g(bl,15,"Minimap gutter background color for lines that are added.")),tBt=B("minimapGutter.deletedBackground",{dark:OE,light:OE,hcDark:OE,hcLight:OE},g(bl,16,"Minimap gutter background color for lines that are deleted.")),$4e=B("editorOverviewRuler.modifiedForeground",{dark:Ie(PE,.6),light:Ie(PE,.6),hcDark:Ie(PE,.6),hcLight:Ie(PE,.6)},g(bl,17,"Overview ruler marker color for modified content.")),G4e=B("editorOverviewRuler.addedForeground",{dark:Ie(FE,.6),light:Ie(FE,.6),hcDark:Ie(FE,.6),hcLight:Ie(FE,.6)},g(bl,18,"Overview ruler marker color for added content.")),iBt=B("editorOverviewRuler.deletedForeground",{dark:Ie(OE,.6),light:Ie(OE,.6),hcDark:Ie(OE,.6),hcLight:Ie(OE,.6)},g(bl,19,"Overview ruler marker color for deleted content."));let uSe=JL=class extends ${static createDecoration(e,t,i){const s={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(s.linesDecorationsClassName=`dirty-diff-glyph ${e}`,s.linesDecorationsTooltip=t),i.overview.active&&(s.overviewRuler={color:Nr(i.overview.color),position:oh.Left}),i.minimap.active&&(s.minimap={color:Nr(i.minimap.color),position:xu.Gutter}),Kt.createDynamic(s)}constructor(e,t,i,s){super(),this.codeEditor=t,this.model=i,this.configurationService=s,this.editorModel=e;const o=s.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(bl,20,"Added lines");this.addedOptions=JL.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0}),this.addedPatternOptions=JL.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:G4e},minimap:{active:c,color:z4e},isWholeLine:!0});const d=g(bl,21,"Changed lines");this.modifiedOptions=JL.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.modifiedPatternOptions=JL.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:$4e},minimap:{active:c,color:V4e},isWholeLine:!0}),this.deletedOptions=JL.createDecoration("dirty-diff-deleted",g(bl,22,"Removed lines"),{gutter:r,overview:{active:a,color:iBt},minimap:{active:c,color:tBt},isWholeLine:!1}),this._register(s.onDidChangeConfiguration(h=>{h.affectsConfiguration("scm.diffDecorationsGutterPattern")&&this.onDidChange()})),this._register(i.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const e=this.configurationService.getValue("scm.diffDecorationsGutterPattern"),t=this.model.changes.map(i=>{const s=i.change,o=fFe(s),r=s.modifiedStartLineNumber,a=s.modifiedEndLineNumber||r;switch(o){case wm.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case wm.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case wm.Modify:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.modified?this.modifiedPatternOptions:this.modifiedOptions}}});this.decorationsCollection?this.decorationsCollection.set(t):this.decorationsCollection=this.codeEditor.createDecorationsCollection(t)}dispose(){super.dispose(),this.decorationsCollection&&this.decorationsCollection?.clear(),this.editorModel=null,this.decorationsCollection=void 0}};uSe=JL=D([_(3,Re)],uSe);function q4e(n,e){let t=n.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=n.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=n.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:n.originalEndLineNumber-e.originalEndLineNumber}async function nBt(n,e,t,i){const s=await n.getQuickDiffs(e,t,i);return s.length>0?s[0].originalResource:null}let gSe=class extends ${get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,s,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=s,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new iQ(200),this.repositoryDisposables=new Set,this.originalModelDisposables=this._register(new Z),this._disposed=!1,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._changes=[],this._mapChanges=new Map,this._model=e,this._register(e.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),this._register(T.filter(o.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsIgnoreTrimWhitespace")||c.affectsConfiguration("diffEditor.ignoreTrimWhitespace"))(this.triggerDiff,this)),this._register(t.onDidAddRepository(this.onDidAddRepository,this));for(const c of t.repositories)this.onDidAddRepository(c);this._register(this._model.onDidChangeEncoding(()=>{this.diffDelayer.cancel(),this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],this._quickDiffsPromise=void 0,this.setChanges([],new Map),this.triggerDiff()})),this._register(this.quickDiffService.onDidChangeQuickDiffProviders(()=>this.triggerDiff())),this.triggerDiff()}get quickDiffs(){return this._quickDiffs}getDiffEditorModel(e){if(!this._originalModels.has(e))return;const t=this._originalModels.get(e);return{modified:this._model.textEditorModel,original:t.textEditorModel}}onDidAddRepository(e){const t=new Z;this.repositoryDisposables.add(t),t.add(Ee(()=>this.repositoryDisposables.delete(t)));const i=T.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const s=T.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(s(()=>St(t),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(e=>{const t=Array.from(this._originalModels.values());!e||this._disposed||this._model.isDisposed()||t.some(i=>i.isDisposed())||(t.every(i=>i.textEditorModel.getValueLength()===0)&&(e.changes=[]),e.changes||(e.changes=[]),this.setChanges(e.changes,e.mapChanges))},e=>bt(e)):Promise.resolve(null)}setChanges(e,t){const i=PRe(this._changes,e,(s,o)=>q4e(s.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:ch.Scm,delay:250},async()=>{const e=await this.getQuickDiffsPromise();if(this._disposed||this._model.isDisposed()||e.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const t=e.filter(c=>this.editorWorkerService.canComputeDirtyDiff(c.originalResource,this._model.resource));if(t.length===0)return Promise.resolve({changes:[],mapChanges:new Map});const i=this.configurationService.getValue("scm.diffDecorationsIgnoreTrimWhitespace"),s=i==="inherit"?this.configurationService.getValue("diffEditor.ignoreTrimWhitespace"):i!=="false",o=[];for(const c of t){const l=await this.editorWorkerService.computeDirtyDiff(c.originalResource,this._model.resource,s);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>q4e(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):Ls(this._quickDiffs,e,(t,i)=>t.originalResource.toString()===i.originalResource.toString()&&t.label===i.label)?e:(this.originalModelDisposables.clear(),this._originalModels.clear(),this._originalTextModels=[],this._quickDiffs=e,(await Promise.all(e.map(async t=>{try{const i=await this.textModelResolverService.createModelReference(t.originalResource);if(this._disposed)return i.dispose(),[];if(this._originalModels.set(t.originalResource.toString(),i.object),this._originalTextModels.push(i.object.textEditorModel),qOt(i.object)){const s=this._model.getEncoding();s&&i.object.setEncoding(s,Z7.Decode)}return this.originalModelDisposables.add(i),this.originalModelDisposables.add(i.object.textEditorModel.onDidChangeContent(()=>this.triggerDiff())),t}catch{return[]}}))).flat())),this._quickDiffsPromise.finally(()=>{this._quickDiffsPromise=void 0}))}async getOriginalResource(){if(this._disposed)return Promise.resolve([]);const e=this._model.resource;return this.quickDiffService.getQuickDiffs(e,this._model.getLanguageId(),this._model.textEditorModel?gS(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let s;!i&&t&&(s=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(s&&a.label!==s)o.push(r);else return r}else if(a.change.modifiedStartLineNumber>e)return r;if(o.length>0&&o.length===c)return o[0]}return o.length>0?o[0]:0}findPreviousClosestChange(e,t=!0,i){for(let s=this.changes.length-1;s>=0;s--){if(i&&this.changes[s].label!==i)continue;const o=this.changes[s].change;if(t){if(o.modifiedStartLineNumber<=e)return s}else if(dSe(o)St(e)),this.repositoryDisposables.clear()}};gSe=D([_(1,RPe),_(2,DQ),_(3,kd),_(4,Re),_(5,Rn),_(6,Cf)],gSe);class sBt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let Q4e=class extends ${constructor(e,t,i,s){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=s,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new wi,this.transientDisposables=this._register(new Z),this.stylesheet=od(void 0,void 0,this._store);const o=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=T.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterVisibility"));this._register(a(this.onDidChangeDiffVisibilityConfiguration,this)),this.onDidChangeDiffVisibilityConfiguration()}onDidChangeConfiguration(){this.configurationService.getValue("scm.diffDecorations")!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let e=this.configurationService.getValue("scm.diffDecorationsGutterWidth");(isNaN(e)||e<=0||e>5)&&(e=3),this.setViewState({...this.viewState,width:e})}onDidChangeDiffVisibilityConfiguration(){const e=this.configurationService.getValue("scm.diffDecorationsGutterVisibility");this.setViewState({...this.viewState,visibility:e})}setViewState(e){this.viewState=e,this.stylesheet.textContent=` .monaco-editor .dirty-diff-added, .monaco-editor .dirty-diff-modified { border-left-width:${e.width}px; @@ -749,18 +749,18 @@ Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals? .monaco-editor .dirty-diff-deleted { opacity: ${e.visibility==="always"?1:0}; } - `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(T.any(this.editorService.onDidCloseEditor,this.editorService.onDidVisibleEditorsChange)(()=>this.onEditorsChanged())),this.onEditorsChanged(),this.enabled=!0}disable(){if(this.enabled){this.transientDisposables.clear();for(const[,e]of this.items)St(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(ja(e)){const t=e.getModel(),i=YS.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const s=this.textFileService.files.get(t.uri);if(s?.isResolved()){const o=this.instantiationService.createInstance(gSe,s),r=new uSe(s.textEditorModel,e,o,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new sBt(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(s=>ja(s)&&s.getModel()?.uri.toString()===e.toString()&&s.getId()===i)||t.has(i)&&(t.get(i)?.dispose(),t.delete(i),t.size===0&&this.items.delete(e))}getModel(e,t){return this.items.get(e.uri)?.get(t.getId())?.model}dispose(){this.disable(),super.dispose()}};Q4e=D([_(0,_i),_(1,be),_(2,Re),_(3,tr)],Q4e);vn(YS.ID,YS,mi.AfterFirstRender);const oBt="vs/workbench/contrib/format/browser/formatModified";Fe(class extends lt{constructor(){super({id:"editor.action.formatChanges",label:g(oBt,0,"Format Modified Lines"),alias:"Format Modified Lines",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(be);if(!t.hasModel())return;const s=await i.invokeFunction(pit,t.getModel());if(mo(s))return i.invokeFunction(Ude,t,s,S_.Explicit,cf.None,qe.None,!0)}});async function pit(n,e){const t=n.get(DQ),i=n.get(kd),s=n.get(Rn),o=await nBt(t,e.uri,e.getLanguageId(),gS(e));if(!o)return null;const r=[],a=await s.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!mo(c))return;for(const l of c)r.push(e.validateRange(new O(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}const OJ="vs/workbench/contrib/codeEditor/browser/saveParticipants";let fSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){if(!e.textEditorModel)return;const i=this.configurationService.getValue("files.trimTrailingWhitespace",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource}),s=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Ln.AUTO,s)}doTrimTrailingWhitespace(e,t,i){let s=[],o=[];const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t)){o=s.map(l=>l.getPosition());const c=pc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=cit(e,o,i);a.length&&e.pushEditOperations(s,a,c=>s)}};fSe=D([_(0,Re),_(1,Qt)],fSe);function bhe(n,e){let t=null;if(n.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===n){if(i.hasTextFocus())return i;t=i}}return t}let pSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.insertFinalNewline",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doInsertFinalNewLine(e.textEditorModel)}doInsertFinalNewLine(e){const t=e.getLineCount(),i=e.getLineContent(t),s=Zv(i)===-1;if(!t||s)return;const o=[ds.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=bhe(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};pSe=D([_(0,Re),_(1,Qt)],pSe);let mSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.trimFinalNewlines",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doTrimFinalNewLines(e.textEditorModel,t.reason===Ln.AUTO)}findLastNonEmptyLine(e){for(let t=e.getLineCount();t>=1;t--)if(e.getLineLength(t)>0)return t;return 0}doTrimFinalNewLines(e,t){const i=e.getLineCount();if(i===1)return;let s=[],o=0;const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t))for(let d=0,h=s.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new O(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(s,[ds.delete(l)],d=>s),r?.setSelections(s))}};mSe=D([_(0,Re),_(1,Qt)],mSe);let _Se=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,s){if(!e.textEditorModel||t.reason===Ln.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new cf(h=>{i.report({message:g(OJ,0,"Running '{0}' Formatter ([configure]({1})).",h.displayName||h.extensionId&&h.extensionId.value||"???","command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D")})});if(!this.configurationService.getValue("editor.formatOnSave",r))return;const l=bhe(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(BCe,l,S_.Silent,a,s);else{const h=await this.instantiationService.invokeFunction(pit,ja(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(BCe,l,S_.Silent,a,s):h&&await this.instantiationService.invokeFunction(Ude,l,h,S_.Silent,a,s,!1)}}};_Se=D([_(0,Re),_(1,Qt),_(2,be)],_Se);let vSe=class{constructor(e,t,i){this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i}async participate(e,t,i,s){if(!e.textEditorModel)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",r);if(!a||t.reason===Ln.AUTO||t.reason!==Ln.EXPLICIT&&Array.isArray(a))return;const c=Array.isArray(a)?a:Object.keys(a).filter(u=>a[u]&&a[u]!=="never"),l=this.createCodeActionsOnSave(c);if(Array.isArray(a)||l.sort((u,f)=>ls.SourceFixAll.contains(u)?ls.SourceFixAll.contains(f)?0:-1:ls.SourceFixAll.contains(f)?1:0),!l.length)return;const d=Array.isArray(a)?[]:Object.keys(a).filter(u=>a[u]==="never"||!1).map(u=>new bs(u));i.report({message:g(OJ,1,"Quick Fixes")});const h=Array.isArray(a)?l:l.filter(u=>a[u.value]==="always"||(a[u.value]==="explicit"||a[u.value]===!0)&&t.reason===Ln.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,s)}createCodeActionsOnSave(e){const t=e.map(i=>new bs(i));return t.filter(i=>t.every(s=>s.equals(i)||!s.contains(i)))}async applyOnSaveActions(e,t,i,s,o){const r=new class{constructor(){this._names=new Set}_report(){s.report({message:g(OJ,2,"Getting code actions from '{0}' ([configure]({1})).",[...this._names].map(a=>`'${a}'`).join(", "),"command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D")})}report(a){a.displayName&&!this._names.has(a.displayName)&&(this._names.add(a.displayName),this._report())}};for(const a of t){const c=await this.getActionsToRun(e,a,i,r,o);if(o.isCancellationRequested){c.dispose();return}try{for(const l of c.validActions)if(s.report({message:g(OJ,3,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(Ttt,l,hI.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,s,o){return KW(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:wu.Auto,triggerAction:_f.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},s,o)}};vSe=D([_(0,Re),_(1,be),_(2,ht)],vSe);let wSe=class extends ${constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(fSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(vSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(_Se))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(pSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(mSe)))}};wSe=D([_(0,be),_(1,tr)],wSe);const rBt=it.as(pf.Workbench);rBt.registerWorkbenchContribution(wSe,Us.Restored);const j4e="vs/workbench/contrib/codeEditor/browser/toggleMinimap",Zae=class Zae extends pi{constructor(){super({id:Zae.ID,title:{...Be(j4e,0,"Toggle Minimap"),mnemonicTitle:g(j4e,1,"&&Minimap")},category:Xa.View,f1:!0,toggled:ge.equals("config.editor.minimap.enabled",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Re),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Zae.ID="editor.action.toggleMinimap";let bSe=Zae;At(bSe);const eie="vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier",K2=class K2 extends pi{constructor(){super({id:K2.ID,title:Be(eie,0,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Re),s=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(K2.multiCursorModifierConfigurationKey,s)}};K2.ID="workbench.action.toggleMultiCursorModifier",K2.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let e6=K2;const pFe=new Y("multiCursorModifier","altKey");let CSe=class{constructor(e,t){this.configurationService=e,this._multiCursorModifier=pFe.bindTo(t),this._update(),e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()})}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};CSe=D([_(0,Re),_(1,Pe)],CSe);it.as(pf.Workbench).registerWorkbenchContribution(CSe,Us.Restored);At(e6);Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:g(eie,1,"Switch to Alt+Click for Multi-Cursor")},when:pFe.isEqualTo("ctrlCmd"),order:1});Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:ei?g(eie,2,"Switch to Cmd+Click for Multi-Cursor"):g(eie,3,"Switch to Ctrl+Click for Multi-Cursor")},when:pFe.isEqualTo("altKey"),order:1});const K4e="vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter",ece=class ece extends pi{constructor(){super({id:ece.ID,title:{...Be(K4e,0,"Toggle Control Characters"),mnemonicTitle:g(K4e,1,"Render &&Control Characters")},category:Xa.View,f1:!0,toggled:ge.equals("config.editor.renderControlCharacters",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Re),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};ece.ID="editor.action.toggleRenderControlCharacter";let ySe=ece;At(ySe);const jQ="vs/workbench/contrib/codeEditor/browser/toggleWordWrap",mit="transientWordWrapState",mFe="isWordWrapMinified",_Fe="isDominatedByLongLines",_it=new Y("canToggleWordWrap",!1,!0),vit=new Y("editorWordWrap",!1,g(jQ,0,"Whether the editor is currently using word wrapping."));function tie(n,e,t){t.setTransientModelProperty(n,mit,e)}function iie(n,e){return e.getTransientModelProperty(n,mit)}const Che="editor.action.toggleWordWrap";class aBt extends lt{constructor(){super({id:Che,label:g(jQ,1,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:V.Alt|E.KeyZ,weight:ye.EditorContrib}})}run(e,t){const i=e.get(Qt);if(!DV(i,t))return;const s=t.getModel(),o=iie(s,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},tie(s,r,i);const a=cBt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;DV(i,d)&&(tie(d.getModel(),r,i),a.updateOptions({}))}}}function cBt(n,e){if(!n.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),s=t.getModifiedEditor();if(i===n||s===n)return t}return null}var xH;let nie=(xH=class extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const o=this._editor.getOptions().get(x.wrappingInfo),r=this._contextKeyService.createKey(mFe,o.isWordWrapMinified),a=this._contextKeyService.createKey(_Fe,o.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);r.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!DV(this._codeEditorService,this._editor))return;const d=iie(this._editor.getModel(),this._codeEditorService);try{c=!0,this._applyWordWrapState(d)}finally{c=!1}}}_applyWordWrapState(e){const t=e?e.wordWrapOverride:"inherit";this._editor.updateOptions({wordWrapOverride2:t})}},xH.ID="editor.contrib.toggleWordWrapController",xH);nie=D([_(1,Pe),_(2,Qt)],nie);var DH;let sie=(DH=class extends ${constructor(e,t){super(),this._diffEditor=e,this._codeEditorService=t,this._register(this._diffEditor.onDidChangeModel(()=>{this._ensureSyncedWordWrapToggle()}))}_ensureSyncedWordWrapToggle(){const e=this._diffEditor.getOriginalEditor(),t=this._diffEditor.getModifiedEditor();if(!e.hasModel()||!t.hasModel())return;const i=iie(e.getModel(),this._codeEditorService),s=iie(t.getModel(),this._codeEditorService);i&&!s&&DV(this._codeEditorService,e)&&(tie(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&s&&DV(this._codeEditorService,t)&&(tie(e.getModel(),s,this._codeEditorService),this._diffEditor.updateOptions({}))}},DH.ID="diffeditor.contrib.toggleWordWrapController",DH);sie=D([_(1,Qt)],sie);function DV(n,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of n.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var kH;let oie=(kH=class extends ${constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(T.runAndSubscribe(Vb,({window:s,disposables:o})=>{o.add(pe(s,"focus",()=>this._update(),!0)),o.add(pe(s,"blur",()=>this._update(),!0))},{window:yi,disposables:this._store})),this._editorService.onDidActiveEditorChange(()=>this._update()),this._canToggleWordWrap=_it.bindTo(this._contextService),this._editorWordWrap=vit.bindTo(this._contextService),this._activeEditor=null,this._activeEditorListener=new Z,this._update()}_update(){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();this._activeEditor!==e&&(this._activeEditorListener.clear(),this._activeEditor=e,e&&(this._activeEditorListener.add(e.onDidChangeModel(()=>this._updateFromCodeEditor())),this._activeEditorListener.add(e.onDidChangeConfiguration(t=>{t.hasChanged(x.wrappingInfo)&&this._updateFromCodeEditor()})),this._updateFromCodeEditor()))}_updateFromCodeEditor(){if(DV(this._codeEditorService,this._activeEditor)){const e=this._activeEditor.getOption(x.wrappingInfo);this._setValues(!0,e.wrappingColumn!==-1)}else return this._setValues(!1,!1)}_setValues(e,t){this._canToggleWordWrap.set(e),this._editorWordWrap.set(t)}},kH.ID="workbench.contrib.editorWordWrapContextKeyTracker",kH);oie=D([_(0,_i),_(1,Qt),_(2,Pe)],oie);gp(oie.ID,oie,Sl.AfterRestored);vn(nie.ID,nie,mi.Eager);Aje(sie.ID,sie);Fe(aBt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,2,"Disable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(ge.has(_Fe),ge.has(mFe))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,3,"Enable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(X.inDiffEditor.negate(),ge.has(_Fe),ge.not(mFe))});Xs.appendMenuItem(Te.MenubarViewMenu,{command:{id:Che,title:g(jQ,4,"&&Word Wrap"),toggled:vit,precondition:_it},order:1,group:"5_editor"});const Y4e="vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace",tce=class tce extends pi{constructor(){super({id:tce.ID,title:{...Be(Y4e,0,"Toggle Render Whitespace"),mnemonicTitle:g(Y4e,1,"&&Render Whitespace")},category:Xa.View,f1:!0,toggled:ge.notEquals("config.editor.renderWhitespace","none"),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Re),i=t.getValue("editor.renderWhitespace");let s;return i==="none"?s="all":s="none",t.updateValue("editor.renderWhitespace",s)}};tce.ID="editor.action.toggleRenderWhitespace";let SSe=tce;At(SSe);class lBt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}it.add("gutterActionsRegistry",new lBt);const dBt=it.as("gutterActionsRegistry");var IH;let rie=(IH=class extends ${constructor(e,t,i,s,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=s,this.instantiationService=o,this._register(this.editor.onMouseDown(r=>this.doShow(r,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(ei&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Mt.GUTTER_LINE_NUMBERS&&e.target.type!==Mt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const s=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",s]]),r=this.menuService.createMenu(Te.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of dBt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:s,editor:this.editor,accessor:c},{push:(u,f="navigation")=>{const p=h.get(f)??[];p.push(u),h.set(f,p)}});for(const[u,f]of h.entries())a.push([u,f])}a.sort((d,h)=>d[0].localeCompare(h[0]));const l=r.getActions({arg:{lineNumber:s,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Mt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:s,endLineNumber:s,startColumn:1,endColumn:i.getLineLength(s)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,jb.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Kr.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},IH.ID="workbench.contrib.editorLineNumberContextMenu",IH);rie=D([_(1,Vr),_(2,mc),_(3,Pe),_(4,be)],rie);vn(rie.ID,rie,mi.AfterFirstRender);var Dg;const Hd="vs/workbench/contrib/format/browser/formatActionsMultiple";var Py;let oS=(Py=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=s,this._dialogService=o,this._quickInputService=r,this._languageService=a,this._languageFeaturesService=c,this._languageStatusService=l,this._editorService=d,this._languageStatusStore=this._store.add(new Z),this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(gV.setFormatterSelector((h,u,f,p)=>this._selectFormatter(h,u,f,p))),this._store.add(d.onDidActiveEditorChange(this._updateStatus,this)),this._store.add(c.documentFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(c.documentRangeFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(i.onDidChangeConfiguration(h=>h.affectsConfiguration(Dg.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const s=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return s&&!o?-1:!s&&o?1:t.name.localeCompare(i.name)}),Dg.extensionIds.length=0,Dg.extensionItemLabels.length=0,Dg.extensionDescriptions.length=0,Dg.extensionIds.push(null),Dg.extensionItemLabels.push(g(Hd,0,"None")),Dg.extensionDescriptions.push(g(Hd,1,"None"));for(const t of e)(t.main||t.browser)&&(Dg.extensionIds.push(t.identifier.value),Dg.extensionItemLabels.push(t.displayName??""),Dg.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const s=this._configService.getValue(Dg.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(s){const a=t.find(l=>Cn.equals(l.extensionId,s));if(a)return a;const c=await this._extensionService.getExtension(s);if(c&&this._extensionEnablementService.isEnabled(che(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===uV.File?g(Hd,2,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(Hd,3,"Extension '{0}' is configured as formatter but it can only format '{1}'-files as a whole, not selections or parts of it.",c.displayName||c.name,l)}}else if(t.length===1)return t[0];const o=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return s?g(Hd,5,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",s):g(Hd,4,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",Dg._maybeQuotes(o))}async _selectFormatter(e,t,i,s){const o=await this._analyzeFormatter(s,e,t);if(typeof o!="string")return o;if(i!==S_.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(Hd,6,"Configure Default Formatter"),detail:o,primaryButton:g(Hd,7,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(nt.Info,o,[{label:g(Hd,8,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:jU.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((r,a)=>({index:a,label:r.displayName||(r.extensionId?r.extensionId.value:"?"),description:r.extensionId&&r.extensionId.value})),s=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",Dg._maybeQuotes(s))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(Dg.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=_z(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Hde(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const s=new ai;this._languageStatusStore.add(Ee(()=>s.dispose(!0))),this._analyzeFormatter(uV.File,i,t).then(o=>{if(s.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${Dr()}`,title:g(Hd,10,"Configure...")};this._languageStatusStore.add(yt.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(Hd,11,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:nt.Error,label:g(Hd,12,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},Dg=Py,Py.configName="editor.defaultFormatter",Py.extensionIds=[],Py.extensionItemLabels=[],Py.extensionDescriptions=[],Py);oS=Dg=D([_(0,ho),_(1,Kh),_(2,Re),_(3,Pi),_(4,To),_(5,On),_(6,Di),_(7,ht),_(8,OPe),_(9,_i)],oS);it.as(pf.Workbench).registerWorkbenchContribution(oS,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[oS.configName]:{description:g(Hd,13,"Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter."),type:["string","null"],default:null,enum:oS.extensionIds,enumItemLabels:oS.extensionItemLabels,markdownEnumDescriptions:oS.extensionDescriptions}}});function wit(n,e,t,i){function s(o){return o.extensionId?Cn.toKey(o.extensionId):"unknown"}n.publicLog2("formatterpick",{mode:e,extensions:t.map(s),pick:i?s(i):"none"})}async function bit(n,e,t){const i=n.get(On),s=n.get(Re),o=n.get(Di),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=s.getValue(oS.configName,r);let c;const l=t.map((u,f)=>{const p=Cn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(Hd,14,"(default)"):void 0};return p&&(c=m),m}),d={label:g(Hd,15,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(Hd,16,"Select a formatter"),activeItem:c});if(h)if(h===d){const u=o.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",oS._maybeQuotes(u))});f&&t[f.index].extensionId&&s.updateValue(oS.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(Hd,17,"Format Document With..."),alias:"Format Document...",precondition:ge.and(X.writable,X.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const s=e.get(be),o=e.get(on),r=e.get(ht),a=t.getModel(),c=Hde(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await s.invokeFunction(bit,a,c);typeof l=="number"&&await s.invokeFunction(mZe,c[l],t,S_.Explicit,qe.None),wit(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Fe(class extends lt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(Hd,18,"Format Selection With..."),alias:"Format Code...",precondition:ge.and(ge.and(X.writable),X.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:ge.and(X.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get(ht),o=e.get(on),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new O(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=s.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(bit,r,c);typeof l=="number"&&await i.invokeFunction(pZe,c[l],t,a,qe.None,!0),wit(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const Uz="workbench.view.extensions";var Fr;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(Fr||(Fr={}));var ov;(function(n){n.ReloadWindow="reloadWindow",n.RestartExtensions="restartExtensions",n.DownloadUpdate="downloadUpdate",n.ApplyUpdate="applyUpdate",n.QuitAndInstall="quitAndInstall"})(ov||(ov={}));var ASe;(function(n){n.Readme="readme",n.Features="features",n.Changelog="changelog",n.Dependencies="dependencies",n.ExtensionPack="extensionPack"})(ASe||(ASe={}));const hBt="extensions.autoUpdate";let J4e=class extends ${constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?uc(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};J4e=D([_(1,pr)],J4e);const uBt="workbench.extensions.action.toggleIgnoreExtension",gBt="workbench.extensions.action.installVSIX";new Y("hasOutdatedExtensions",!1);new Y("hasGallery",!1);const fBt="_theme_",pBt="0_install",mBt="0_update";new Te("extensionsSearchActionsMenu");const yhe="vs/workbench/common/views";g(yhe,0,"Views");const _Bt=ji("default-view-icon",Ce.window,g(yhe,1,"Default view icon."));var M1;(function(n){n.ViewContainersRegistry="workbench.registry.view.containers",n.ViewsRegistry="workbench.registry.view"})(M1||(M1={}));var Sr;(function(n){n[n.Sidebar=0]="Sidebar",n[n.Panel=1]="Panel",n[n.AuxiliaryBar=2]="AuxiliaryBar"})(Sr||(Sr={}));Sr.Sidebar,Sr.Panel,Sr.AuxiliaryBar;function aie(n){switch(n){case Sr.Sidebar:return"sidebar";case Sr.Panel:return"panel";case Sr.AuxiliaryBar:return"auxiliarybar"}}class vBt extends ${constructor(){super(...arguments),this._onDidRegister=this._register(new I),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new I),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const s=this.get(e.id);if(s)return s;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},XX(this.viewContainers,t,[]).push(o),i?.isDefault&&this.defaultViewContainers.push(o),this._onDidRegister.fire({viewContainer:o,viewContainerLocation:t}),o}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),s=i?.indexOf(e);if(s!==-1){i?.splice(s,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}it.add(M1.ViewContainersRegistry,new vBt);var cie;(function(n){n.Open="2_open",n.Debug="4_debug",n.SCM="5_scm",n.More="9_more"})(cie||(cie={}));function wBt(n,e){const t=n.group??cie.More,i=e.group??cie.More;return t!==i?t.localeCompare(i):(n.order??5)-(e.order??5)}class bBt extends ${constructor(){super(...arguments),this._onViewsRegistered=this._register(new I),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new I),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new I),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new I),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new Vq}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const s=this.removeViews(e,i);s.length&&(this.addViews(s,t),this._onDidChangeContainer.fire({views:s,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(s=>s.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(s=>s.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),Ee(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[s,o]of t)this._viewWelcomeContents.add(e,o),i.set(s,Ee(()=>{this._viewWelcomeContents.delete(e,o),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(wBt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const s of e){if(this.getView(s.id)!==null)throw new Error(g(yhe,2,"A view with id '{0}' is already registered",s.id));i.push(s)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const s=[],o=[];for(const r of i)e.includes(r)?s.push(r):o.push(r);return s.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),s}}it.add(M1.ViewsRegistry,new bBt);var ESe;(function(n){n[n.Default=0]="Default",n[n.Expand=1]="Expand"})(ESe||(ESe={}));var X4e;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(X4e||(X4e={}));class fpe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,ym(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const s=await t(i);s&&(this.tooltip=this.tooltip??s.tooltip,this.command=this.command??s.command)}i.isCancellationRequested||(this.resolved=!0)}}get hasResolve(){return this._hasResolve}resetResolve(){this.resolved=!1}asTreeItem(){return{handle:this.handle,parentHandle:this.parentHandle,collapsibleState:this.collapsibleState,label:this.label,description:this.description,icon:this.icon,iconDark:this.iconDark,themeIcon:this.themeIcon,resourceUri:this.resourceUri,tooltip:this.tooltip,contextValue:this.contextValue,command:this.command,children:this.children,accessibilityInformation:this.accessibilityInformation}}}class kC extends Error{constructor(e){super(g(yhe,3,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}const OK="vs/workbench/contrib/format/browser/formatActionsNone";async function CBt(n,e){const t=await n.openPaneComposite(Uz,Sr.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.none",label:g(OK,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.writable,X.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(Qi),s=e.get(Nw),o=e.get(Pi),r=e.get(To),a=e.get(ht),c=t.getModel(),l=a.documentFormattingEditProvider.all(c).length;if(l>1)return i.executeCommand("editor.action.formatDocument.multiple");if(l===1)return i.executeCommand("editor.action.formatDocument");if(c.isTooLargeForSyncing())o.warn(g(OK,1,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(OK,2,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(OK,3,"&&Install Formatter...")});u&&CBt(s,`category:formatters ${d}`)}}});var Tf;const xSe="vs/workbench/contrib/folding/browser/folding.contribution";var Fy;let AR=(Fy=class extends ${constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(Ox.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),Tf.extensionIds.length=0,Tf.extensionItemLabels.length=0,Tf.extensionDescriptions.length=0,Tf.extensionIds.push(null),Tf.extensionItemLabels.push(g(xSe,0,"All")),Tf.extensionDescriptions.push(g(xSe,1,"All active folding range providers"));const e=[],t=[];for(const s of this._extensionService.extensions)(s.main||s.browser)&&(s.categories?.find(o=>o==="Programming Languages")?e.push(s):t.push(s));const i=(s,o)=>s.name.localeCompare(o.name);for(const s of e.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"");for(const s of t.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(Tf.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(s=>s.id===i)}},Tf=Fy,Fy.configName="editor.defaultFoldingRangeProvider",Fy.extensionIds=[],Fy.extensionItemLabels=[],Fy.extensionDescriptions=[],Fy);AR=Tf=D([_(0,ho),_(1,Re)],AR);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[AR.configName]:{description:g(xSe,2,"Defines a default folding range provider that takes precedence over all other folding range providers. Must be the identifier of an extension contributing a folding range provider."),type:["string","null"],default:null,enum:AR.extensionIds,enumItemLabels:AR.extensionItemLabels,markdownEnumDescriptions:AR.extensionDescriptions}}});it.as(pf.Workbench).registerWorkbenchContribution(AR,Us.Restored);var yBt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";Ct(yBt,{});let t6=class extends ${get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}set link(e){typeof e.label=="string"?this.el.textContent=e.label:(Yo(this.el),this.el.appendChild(e.label)),this.el.href=e.href,typeof e.tabIndex<"u"&&(this.el.tabIndex=e.tabIndex),this.setTooltip(e.title),this._link=e}constructor(e,t,i={},s,o){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=he(e,we("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??va("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new oi(this.el,"click")),a=this._register(new oi(this.el,"keypress")),c=T.chain(a.event,h=>h.map(u=>new os(u)).filter(u=>u.keyCode===E.Enter)),l=this._register(new oi(this.el,Eo.Tap)).event;this._register(dh.addTarget(this.el));const d=T.any(r.event,c,l);this._register(d(h=>{this.enabled&&(un.stop(h,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupUpdatableHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};t6=D([_(3,Zc),_(4,fr)],t6);var BJ;const lie="vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty";var b0;let xF=(b0=class{static get(e){return e.getContribution(BJ.ID)??void 0}constructor(e,t,i,s){this._editor=e,this._accessibilitySignalService=i,this._instaService=s,this._sessionDispoosables=new Z,this._ariaElement=document.createElement("span"),this._ariaElement.style.position="fixed",this._ariaElement.className="inlayhint-accessibility-element",this._ariaElement.tabIndex=0,this._ariaElement.setAttribute("aria-description",g(lie,1,"Code with Inlay Hint Information")),this._ctxIsReading=BJ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Yo(this._ariaElement),this._sessionDispoosables.clear(),this._ctxIsReading.reset()}async _read(e,t){if(this._sessionDispoosables.clear(),this._ariaElement.isConnected||this._editor.getDomNode()?.appendChild(this._ariaElement),!this._editor.hasModel()||!this._ariaElement.isConnected){this._ctxIsReading.set(!1);return}const i=new ai;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const s=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(o.push(l),r=c.hint.position.column-1),r>750){o.push("…"),a=!0;break}const d=document.createElement("em"),{label:h}=c.hint;if(typeof h=="string")d.innerText=h;else for(const u of h)if(u.command){const f=this._instaService.createInstance(t6,d,{href:jtt(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;o.push(d)}a||o.push(s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),_a(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(pe(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=AV.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(Zl.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},BJ=b0,b0.IsReading=new Y("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(lie,0,"Whether the current line and its inlay hints are currently focused")}),b0.ID="editor.contrib.InlayHintsAccessibility",b0);xF=BJ=D([_(1,Pe),_(2,Lw),_(3,be)],xF);At(class extends wf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Be(lie,2,"Read Line With Inline Hints"),precondition:X.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){xF.get(t)?.startInlayHintsReading()}});At(class extends wf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Be(lie,3,"Stop Inlay Hints Reading"),precondition:xF.IsReading,f1:!0,keybinding:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(e,t){xF.get(t)?.stopInlayHintsReading()}});vn(xF.ID,xF,mi.Lazy);const xy="vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint";var nb;(function(n){n.languages="languages",n.actions="actions",n.kind="kind",n.title="title",n.description="description"})(nb||(nb={}));const SBt=Object.freeze({type:"array",markdownDescription:g(xy,0,"Configure which editor to use for a resource."),items:{type:"object",required:[nb.languages,nb.actions],properties:{[nb.languages]:{type:"array",description:g(xy,1,"Language modes that the code actions are enabled for."),items:{type:"string"}},[nb.actions]:{type:"object",required:[nb.kind,nb.title],properties:{[nb.kind]:{type:"string",markdownDescription:g(xy,2,"`CodeActionKind` of the contributed code action.")},[nb.title]:{type:"string",description:g(xy,3,"Label for the code action used in the UI.")},[nb.description]:{type:"string",description:g(xy,4,"Description of what the code action does.")}}}}}}),ABt={extensionPoint:"codeActions",deps:[CV],jsonSchema:SBt};class EBt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.codeActions}render(e){const t=e.contributes?.codeActions||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=t.map(r=>r.actions.map(a=>({...a,languages:r.languages}))).flat(),s=[g(xy,5,"Title"),g(xy,6,"Kind"),g(xy,7,"Description"),g(xy,8,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Xt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Xt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:s,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(xy,9,"Code Actions"),access:{canToggle:!1},renderer:new $i(EBt)});const YO="vs/workbench/contrib/codeActions/common/documentationExtensionPoint";var tk;(function(n){n.when="when",n.title="title",n.command="command"})(tk||(tk={}));const xBt=Object.freeze({type:"object",description:g(YO,0,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(YO,1,"Contributed documentation for refactorings."),items:{type:"object",description:g(YO,2,"Contributed documentation for refactoring."),required:[tk.title,tk.when,tk.command],properties:{[tk.title]:{type:"string",description:g(YO,3,"Label for the documentation used in the UI.")},[tk.when]:{type:"string",description:g(YO,4,"When clause.")},[tk.command]:{type:"string",description:g(YO,5,"Command executed.")}}}}}}),DBt={extensionPoint:"documentation",deps:[CV],jsonSchema:xBt},Ak="vs/workbench/contrib/codeActions/browser/codeActionsContribution",Cit=n=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(Ak,0,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(Ak,1,"Triggers Code Actions only when explicitly saved"),g(Ak,2,"Never triggers Code Actions on save"),g(Ak,3,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(Ak,4,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:n}),DSe=Object.freeze({"source.fixAll":Cit(g(Ak,5,"Controls whether auto fix action should be run on file save."))}),yit={oneOf:[{type:"object",properties:DSe,additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(Ak,6,'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'),type:["object","array"],additionalProperties:{type:"string",enum:["always","explicit","never",!0,!1]},default:{},scope:ut.LANGUAGE_OVERRIDABLE},Sit=Object.freeze({...sA,properties:{"editor.codeActionsOnSave":yit}});let kSe=class extends ${constructor(e,t){super(),this._contributedCodeActions=[],this._onDidChangeContributions=this._register(new I),e.setHandler(i=>{this._contributedCodeActions=i.flatMap(s=>s.value).filter(s=>Array.isArray(s.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateConfigurationSchema(e){const t={...DSe};for(const[i,s]of this.getSourceActions(e))t[i]=Cit(g(Ak,7,"Controls whether '{0}' actions should be run on file save.",s.title));yit.properties=t,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(Sit)}getSourceActions(e){const t=Object.keys(DSe).map(s=>new bs(s)),i=new Map;for(const s of e)for(const o of s.actions){const r=new bs(o.kind);ls.Source.contains(r)&&!t.some(a=>a.contains(r))&&i.set(r.value,o)}return i}getSchemaAdditions(){const e=(i,s)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:s.map(o=>o.kind),enumDescriptions:s.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const s=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of s)!o.has(r.kind)&&i.contains(new bs(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(rFe,t(bs.Empty)),e(cFe,t(ls.Refactor)),e(lFe,t(ls.Source))]}};kSe=D([_(1,ti)],kSe);let ISe=class extends ${constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(s=>{this.contributions=[];for(const o of s)if(o.value.refactoring)for(const r of o.value.refactoring){const a=ge.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,s){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ls.Refactor.value&&!t.some(i=>i.kind&&ls.Refactor.contains(new bs(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};ISe=D([_(1,Pe),_(2,ht)],ISe);const kBt=Ap.registerExtensionPoint(ABt),IBt=Ap.registerExtensionPoint(DBt);it.as(Cs.Configuration).registerConfiguration(Sit);let LSe=class{constructor(e){e.createInstance(kSe,kBt),e.createInstance(ISe,IBt)}};LSe=D([_(0,be)],LSe);it.as(pf.Workbench).registerWorkbenchContribution(LSe,Us.Eventually);var LH;let die=(LH=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},LH.ID="workbench.contrib.listContext",LH);die=D([_(0,Pe)],die);gp(die.ID,die,Sl.BlockStartup);const Ait=[];function KQ(n){Ait.push(n)}function LBt(){return Ait.slice(0)}var TH;let hie=(TH=class extends ${constructor(e,t){super(),this._instantiationService=t,this._instantiated=!1,this._register(e.onWillCreateCodeEditor(()=>this._instantiate())),this._register(e.onWillCreateDiffEditor(()=>this._instantiate())),(e.listCodeEditors().length>0||e.listDiffEditors().length>0)&&this._instantiate()}_instantiate(){if(this._instantiated)return;this._instantiated=!0;const e=LBt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){bt(i)}}},TH.ID="workbench.contrib.editorFeaturesInstantiator",TH);hie=D([_(0,Qt),_(1,be)],hie);gp(hie.ID,hie,Sl.BlockRestore);let TSe=class{constructor(e,t){this.disposables=new Z;const i=s=>e.activeContainer.classList.toggle("context-menu-visible",s);t.onDidShowContextMenu(()=>i(!0),null,this.disposables),t.onDidHideContextMenu(()=>i(!1),null,this.disposables)}};TSe=D([_(0,bg),_(1,Vr)],TSe);it.as(pf.Workbench).registerWorkbenchContribution(TSe,Us.Eventually);yt.registerCommand("_executeMappedEditsProvider",async(n,e,t,i)=>{const s=n.get(Rn),o=n.get(ht),r=await s.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ai;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const kO=bg,JO="vs/workbench/browser/actions/textInputActions";var RH;let uie=(RH=class extends ${constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new Ka(()=>this.createActions()),this.registerListeners()}createActions(){return[new xn("undo",g(JO,0,"Undo"),void 0,!0,async()=>Kg().execCommand("undo")),new xn("redo",g(JO,1,"Redo"),void 0,!0,async()=>Kg().execCommand("redo")),new Kr,new xn("editor.action.clipboardCutAction",g(JO,2,"Cut"),void 0,!0,async()=>Kg().execCommand("cut")),new xn("editor.action.clipboardCopyAction",g(JO,3,"Copy"),void 0,!0,async()=>Kg().execCommand("copy")),new xn("editor.action.clipboardPasteAction",g(JO,4,"Paste"),void 0,!0,async e=>{if(rf)Kg().execCommand("paste");else{const t=await this.clipboardService.readText();if(Zut(e)||egt(e)){const i=e.selectionStart||0,s=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(s,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Kr,new xn("editor.action.selectAll",g(JO,5,"Select All"),void 0,!0,async()=>Kg().execCommand("selectAll"))]}registerListeners(){this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(pe(e,"contextmenu",i=>this.onContextMenu(gt(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Ra(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;un.stop(t,!0);const s=new yu(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>s,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},RH.ID="workbench.contrib.textInputActionsProvider",RH);uie=D([_(0,kO),_(1,Vr),_(2,Mu)],uie);gp(uie.ID,uie,Sl.BlockRestore);var TBt='.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-workbench .screencast-mouse{border-radius:50%;border-style:solid;border-width:2px;content:" ";display:none;pointer-events:none;position:absolute;z-index:100000}.monaco-workbench .screencast-keyboard{background-color:rgba(0,0,0,.5);color:#eee;left:0;line-height:1.75em;overflow:hidden;pointer-events:none;position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:100000}.monaco-workbench:not(.reduce-motion) .screencast-keyboard{transition:opacity .3s ease-out}.monaco-workbench .screencast-keyboard:empty{opacity:0}.monaco-workbench .screencast-keyboard>.key{background-color:hsla(0,0%,100%,.05);border:1px solid hsla(0,0%,80%,.4);border-radius:5px;box-shadow:inset 0 -3px 0 hsla(0,0%,73%,.4);margin-right:6px;padding:0 8px}.monaco-workbench .screencast-keyboard>.title{font-weight:600}';Ct(TBt,{});const RBt="rendererLog",MBt="workbench.action.showWindowLog";let Ip;const ppe=globalThis.vscode;if(typeof ppe<"u"&&typeof ppe.context<"u"){const n=ppe.context.configuration();if(n)Ip=n.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Ip=globalThis._VSCODE_PRODUCT_JSON,IU.VSCODE_DEV&&Object.assign(Ip,{nameShort:`${Ip.nameShort} Dev`,nameLong:`${Ip.nameLong} Dev`,dataFolderName:`${Ip.dataFolderName}-dev`,serverDataFolderName:Ip.serverDataFolderName?`${Ip.serverDataFolderName}-dev`:void 0}),!Ip.version){const n=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ip,{version:n.version})}}else Ip={},Object.keys(Ip).length===0&&Object.assign(Ip,{version:"1.90.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"});var NBt=Ip;const br="vs/workbench/browser/actions/developerActions";class PBt extends pi{constructor(){super({id:"workbench.action.inspectContextKeys",title:Be(br,0,"Inspect Context Keys"),category:Xa.Developer,f1:!0})}run(e){const t=e.get(Pe),i=new Z,s=od(void 0,void 0,i);Kp("*","cursor: crosshair !important;",s);const o=document.createElement("div"),r=Kg();r.body.appendChild(o),i.add(Ee(()=>r.body.removeChild(o))),o.style.position="absolute",o.style.pointerEvents="none",o.style.backgroundColor="rgba(255, 0, 0, 0.5)",o.style.zIndex="1000";const a=i.add(new oi(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=ia(h);o.style.top=`${u.top}px`,o.style.left=`${u.left}px`,o.style.width=`${u.width}px`,o.style.height=`${u.height}px`}));const c=i.add(new oi(r,"mousedown",!0));T.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new oi(r,"mouseup",!0));T.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),St(i)},null,i)}}class g2 extends pi{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Be(br,1,"Toggle Screencast Mode"),category:Xa.Developer,f1:!0})}run(e){if(g2.disposable){g2.disposable.dispose(),g2.disposable=void 0;return}const t=e.get(bg),i=e.get(Re),s=e.get(ti),o=new Z,r=t.activeContainer,a=he(r,we(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=he(r,we(".screencast-keyboard"));o.add(Ee(()=>c.remove()));const l=o.add(new I),d=o.add(new I),h=o.add(new I);function u(j,re){re.add(re.add(new oi(j,"mousedown",!0)).event(me=>l.fire(me))),re.add(re.add(new oi(j,"mouseup",!0)).event(me=>d.fire(me))),re.add(re.add(new oi(j,"mousemove",!0)).event(me=>h.fire(me)))}for(const{window:j,disposables:re}of N9())u(t.getContainer(j),re);o.add(Vb(({window:j,disposables:re})=>u(t.getContainer(j),re))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=fe.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=Dc(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),o.add(l.event(j=>{a.style.top=`${j.clientY-p/2}px`,a.style.left=`${j.clientX-p/2}px`,a.style.display="block",a.style.transform="scale(1)",a.style.transition="transform 0.1s";const re=h.event(me=>{a.style.top=`${me.clientY-p/2}px`,a.style.left=`${me.clientX-p/2}px`,a.style.transform=`scale(${.8})`});T.once(d.event)(()=>{a.style.display="none",re.dispose()})}));const v=()=>{c.style.fontSize=`${Dc(i.getValue("screencastMode.fontSize")||56,20,100)}px`},w=()=>{c.style.bottom=`${Dc(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let b;const C=()=>{b=Dc(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),w(),C(),o.add(i.onDidChangeConfiguration(j=>{j.affectsConfiguration("screencastMode.verticalOffset")&&w(),j.affectsConfiguration("screencastMode.fontSize")&&v(),j.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&C(),j.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),j.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const y=o.add(new I),S=o.add(new I),M=o.add(new I),k=o.add(new I);function F(j,re){re.add(re.add(new oi(j,"keydown",!0)).event(me=>y.fire(me))),re.add(re.add(new oi(j,"compositionstart",!0)).event(me=>S.fire(me))),re.add(re.add(new oi(j,"compositionupdate",!0)).event(me=>M.fire(me))),re.add(re.add(new oi(j,"compositionend",!0)).event(me=>k.fire(me)))}for(const{window:j,disposables:re}of N9())F(j,re);o.add(Vb(({window:j,disposables:re})=>F(j,re)));let N=0,z,U=!1;const J=new yn(()=>{c.textContent="",z=void 0,N=0},b);o.add(S.event(j=>{U=!0})),o.add(M.event(j=>{j.data&&U?(N>20&&(c.innerText="",N=0),z=z??he(c,we("span.key")),z.textContent=j.data):U&&(c.innerText="",he(c,we("span.key",{},"Backspace"))),J.schedule()})),o.add(k.event(j=>{z=void 0,N++})),o.add(y.event(j=>{if(j.key==="Process"||/[\uac00-\ud787\u3131-\u314e\u314f-\u3163\u3041-\u3094\u30a1-\u30f4\u30fc\u3005\u3006\u3024\u4e00-\u9fa5]/u.test(j.key)){j.code==="Backspace"||j.code.includes("Key")?U=!0:(z=void 0,U=!1),J.schedule();return}if(j.isComposing)return;const re=i.getValue("screencastMode.keyboardOptions"),me=new os(j),De=s.softDispatch(me,me.target);if(De.kind===hp.KbFound&&De.commandId&&!(re.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(De.commandId))return;(me.ctrlKey||me.altKey||me.metaKey||me.shiftKey||N>20||me.keyCode===E.Backspace||me.keyCode===E.Escape||me.keyCode===E.UpArrow||me.keyCode===E.DownArrow||me.keyCode===E.LeftArrow||me.keyCode===E.RightArrow)&&(c.innerText="",N=0);const Qe=s.resolveKeyboardEvent(me),Tt=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Oe=Tt?.title,wt=Qe.getLabel();if(Tt&&((re.showCommandGroups??!1)&&Tt.category&&(Oe=`${Tt.category}: ${Oe} `),this._isKbFound(De)&&De.commandId)){const Nt=s.lookupKeybindings(De.commandId).filter(Yi=>Yi.getLabel()?.endsWith(wt??""));Nt.length>0&&(wt=Nt[Nt.length-1].getLabel())}(re.showCommands??!0)&&Oe&&he(c,we("span.title",{},`${Oe} `)),((re.showKeys??!0)||(re.showKeybindings??!0)&&this._isKbFound(De))&&(wt=wt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),he(c,we("span.key",{},wt??""))),N++,J.schedule()})),g2.disposable=o}_isKbFound(e){return e.kind===hp.KbFound}getCommandDetails(e){const t=Xs.getCommand(e);if(t)return{title:typeof t.title=="string"?t.title:t.title.value,category:t.category?typeof t.category=="string"?t.category:t.category.value:void 0};const i=yt.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class FBt extends pi{constructor(){super({id:"workbench.action.logStorage",title:Be(br,2,"Log Storage Database Contents"),category:Xa.Developer,f1:!0})}run(e){const t=e.get(sn),i=e.get(To);t.log(),i.info(g(br,3,"The storage database contents have been logged to the developer tools."),g(br,4,"Open developer tools from the menu and select the Console tab."))}}class OBt extends pi{constructor(){super({id:"workbench.action.logWorkingCopies",title:Be(br,5,"Log Working Copies"),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(Pw),i=e.get(MQ),s=e.get(Ze),o=e.get(nhe),r=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...r.length>0?r.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];s.info(a.join(` -`)),o.showChannel(RBt,!0)}}const ice=class ice extends pi{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Be(br,6,"Remove Large Storage Database Entries..."),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(sn),i=e.get(On),s=e.get(Tm),o=e.get(To),r=e.get(Il),a=[];for(const h of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE])if(!(h===ke.PROFILE&&s.currentProfile.isDefault))for(const u of[ln.MACHINE,ln.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>ice.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:vl.formatSize(p.length),detail:g(br,7,"Scope: {0}, Target: {1}",h===ke.APPLICATION?g(br,8,"Global"):h===ke.PROFILE?g(br,9,"Profile"):g(br,10,"Workspace"),u===ln.MACHINE?g(br,11,"Machine"):g(br,12,"User"))})}a.sort((h,u)=>u.size-h.size);const c=await new Promise(h=>{const u=new Z,f=u.add(i.createQuickPick());f.items=a,f.canSelectMany=!0,f.ok=!1,f.customButton=!0,f.hideCheckAll=!0,f.customLabel=g(br,13,"Remove"),f.placeholder=g(br,14,"Select large entries to remove from storage"),a.length===0&&(f.description=g(br,15,"There are no large storage entries to remove.")),f.show(),u.add(f.onDidCustom(()=>{h(f.selectedItems),f.hide()})),u.add(f.onDidHide(()=>u.dispose()))});if(c.length===0)return;const{confirmed:l}=await o.confirm({type:"warning",message:g(br,16,"Do you want to remove the selected storage entries from the database?"),detail:g(br,17,`{0} + `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(T.any(this.editorService.onDidCloseEditor,this.editorService.onDidVisibleEditorsChange)(()=>this.onEditorsChanged())),this.onEditorsChanged(),this.enabled=!0}disable(){if(this.enabled){this.transientDisposables.clear();for(const[,e]of this.items)St(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(ja(e)){const t=e.getModel(),i=YS.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const s=this.textFileService.files.get(t.uri);if(s?.isResolved()){const o=this.instantiationService.createInstance(gSe,s),r=new uSe(s.textEditorModel,e,o,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new sBt(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(s=>ja(s)&&s.getModel()?.uri.toString()===e.toString()&&s.getId()===i)||t.has(i)&&(t.get(i)?.dispose(),t.delete(i),t.size===0&&this.items.delete(e))}getModel(e,t){return this.items.get(e.uri)?.get(t.getId())?.model}dispose(){this.disable(),super.dispose()}};Q4e=D([_(0,_i),_(1,be),_(2,Re),_(3,tr)],Q4e);vn(YS.ID,YS,mi.AfterFirstRender);const oBt="vs/workbench/contrib/format/browser/formatModified";Fe(class extends lt{constructor(){super({id:"editor.action.formatChanges",label:g(oBt,0,"Format Modified Lines"),alias:"Format Modified Lines",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(be);if(!t.hasModel())return;const s=await i.invokeFunction(pit,t.getModel());if(mo(s))return i.invokeFunction(Ude,t,s,S_.Explicit,cf.None,qe.None,!0)}});async function pit(n,e){const t=n.get(DQ),i=n.get(kd),s=n.get(Rn),o=await nBt(t,e.uri,e.getLanguageId(),gS(e));if(!o)return null;const r=[],a=await s.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!mo(c))return;for(const l of c)r.push(e.validateRange(new O(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}const OJ="vs/workbench/contrib/codeEditor/browser/saveParticipants";let fSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){if(!e.textEditorModel)return;const i=this.configurationService.getValue("files.trimTrailingWhitespace",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource}),s=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Ln.AUTO,s)}doTrimTrailingWhitespace(e,t,i){let s=[],o=[];const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t)){o=s.map(l=>l.getPosition());const c=mc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=cit(e,o,i);a.length&&e.pushEditOperations(s,a,c=>s)}};fSe=D([_(0,Re),_(1,jt)],fSe);function bhe(n,e){let t=null;if(n.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===n){if(i.hasTextFocus())return i;t=i}}return t}let pSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.insertFinalNewline",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doInsertFinalNewLine(e.textEditorModel)}doInsertFinalNewLine(e){const t=e.getLineCount(),i=e.getLineContent(t),s=Zv(i)===-1;if(!t||s)return;const o=[ds.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=bhe(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};pSe=D([_(0,Re),_(1,jt)],pSe);let mSe=class{constructor(e,t){this.configurationService=e,this.codeEditorService=t}async participate(e,t){e.textEditorModel&&this.configurationService.getValue("files.trimFinalNewlines",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource})&&this.doTrimFinalNewLines(e.textEditorModel,t.reason===Ln.AUTO)}findLastNonEmptyLine(e){for(let t=e.getLineCount();t>=1;t--)if(e.getLineLength(t)>0)return t;return 0}doTrimFinalNewLines(e,t){const i=e.getLineCount();if(i===1)return;let s=[],o=0;const r=bhe(e,this.codeEditorService);if(r&&(s=r.getSelections(),t))for(let d=0,h=s.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new O(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(s,[ds.delete(l)],d=>s),r?.setSelections(s))}};mSe=D([_(0,Re),_(1,jt)],mSe);let _Se=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,s){if(!e.textEditorModel||t.reason===Ln.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new cf(h=>{i.report({message:g(OJ,0,"Running '{0}' Formatter ([configure]({1})).",h.displayName||h.extensionId&&h.extensionId.value||"???","command:workbench.action.openSettings?%5B%22editor.formatOnSave%22%5D")})});if(!this.configurationService.getValue("editor.formatOnSave",r))return;const l=bhe(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(BCe,l,S_.Silent,a,s);else{const h=await this.instantiationService.invokeFunction(pit,ja(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(BCe,l,S_.Silent,a,s):h&&await this.instantiationService.invokeFunction(Ude,l,h,S_.Silent,a,s,!1)}}};_Se=D([_(0,Re),_(1,jt),_(2,be)],_Se);let vSe=class{constructor(e,t,i){this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i}async participate(e,t,i,s){if(!e.textEditorModel)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",r);if(!a||t.reason===Ln.AUTO||t.reason!==Ln.EXPLICIT&&Array.isArray(a))return;const c=Array.isArray(a)?a:Object.keys(a).filter(u=>a[u]&&a[u]!=="never"),l=this.createCodeActionsOnSave(c);if(Array.isArray(a)||l.sort((u,f)=>ls.SourceFixAll.contains(u)?ls.SourceFixAll.contains(f)?0:-1:ls.SourceFixAll.contains(f)?1:0),!l.length)return;const d=Array.isArray(a)?[]:Object.keys(a).filter(u=>a[u]==="never"||!1).map(u=>new bs(u));i.report({message:g(OJ,1,"Quick Fixes")});const h=Array.isArray(a)?l:l.filter(u=>a[u.value]==="always"||(a[u.value]==="explicit"||a[u.value]===!0)&&t.reason===Ln.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,s)}createCodeActionsOnSave(e){const t=e.map(i=>new bs(i));return t.filter(i=>t.every(s=>s.equals(i)||!s.contains(i)))}async applyOnSaveActions(e,t,i,s,o){const r=new class{constructor(){this._names=new Set}_report(){s.report({message:g(OJ,2,"Getting code actions from '{0}' ([configure]({1})).",[...this._names].map(a=>`'${a}'`).join(", "),"command:workbench.action.openSettings?%5B%22editor.codeActionsOnSave%22%5D")})}report(a){a.displayName&&!this._names.has(a.displayName)&&(this._names.add(a.displayName),this._report())}};for(const a of t){const c=await this.getActionsToRun(e,a,i,r,o);if(o.isCancellationRequested){c.dispose();return}try{for(const l of c.validActions)if(s.report({message:g(OJ,3,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(Ttt,l,hI.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,s,o){return KW(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:wu.Auto,triggerAction:_f.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},s,o)}};vSe=D([_(0,Re),_(1,be),_(2,ht)],vSe);let wSe=class extends ${constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(fSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(vSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(_Se))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(pSe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(mSe)))}};wSe=D([_(0,be),_(1,tr)],wSe);const rBt=it.as(pf.Workbench);rBt.registerWorkbenchContribution(wSe,Us.Restored);const j4e="vs/workbench/contrib/codeEditor/browser/toggleMinimap",Zae=class Zae extends pi{constructor(){super({id:Zae.ID,title:{...Be(j4e,0,"Toggle Minimap"),mnemonicTitle:g(j4e,1,"&&Minimap")},category:Xa.View,f1:!0,toggled:ge.equals("config.editor.minimap.enabled",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Re),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Zae.ID="editor.action.toggleMinimap";let bSe=Zae;At(bSe);const eie="vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier",K2=class K2 extends pi{constructor(){super({id:K2.ID,title:Be(eie,0,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Re),s=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(K2.multiCursorModifierConfigurationKey,s)}};K2.ID="workbench.action.toggleMultiCursorModifier",K2.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let e6=K2;const pFe=new Y("multiCursorModifier","altKey");let CSe=class{constructor(e,t){this.configurationService=e,this._multiCursorModifier=pFe.bindTo(t),this._update(),e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()})}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};CSe=D([_(0,Re),_(1,Pe)],CSe);it.as(pf.Workbench).registerWorkbenchContribution(CSe,Us.Restored);At(e6);Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:g(eie,1,"Switch to Alt+Click for Multi-Cursor")},when:pFe.isEqualTo("ctrlCmd"),order:1});Xs.appendMenuItem(Te.MenubarSelectionMenu,{group:"4_config",command:{id:e6.ID,title:ei?g(eie,2,"Switch to Cmd+Click for Multi-Cursor"):g(eie,3,"Switch to Ctrl+Click for Multi-Cursor")},when:pFe.isEqualTo("altKey"),order:1});const K4e="vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter",ece=class ece extends pi{constructor(){super({id:ece.ID,title:{...Be(K4e,0,"Toggle Control Characters"),mnemonicTitle:g(K4e,1,"Render &&Control Characters")},category:Xa.View,f1:!0,toggled:ge.equals("config.editor.renderControlCharacters",!0),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Re),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};ece.ID="editor.action.toggleRenderControlCharacter";let ySe=ece;At(ySe);const jQ="vs/workbench/contrib/codeEditor/browser/toggleWordWrap",mit="transientWordWrapState",mFe="isWordWrapMinified",_Fe="isDominatedByLongLines",_it=new Y("canToggleWordWrap",!1,!0),vit=new Y("editorWordWrap",!1,g(jQ,0,"Whether the editor is currently using word wrapping."));function tie(n,e,t){t.setTransientModelProperty(n,mit,e)}function iie(n,e){return e.getTransientModelProperty(n,mit)}const Che="editor.action.toggleWordWrap";class aBt extends lt{constructor(){super({id:Che,label:g(jQ,1,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:V.Alt|E.KeyZ,weight:ye.EditorContrib}})}run(e,t){const i=e.get(jt);if(!DV(i,t))return;const s=t.getModel(),o=iie(s,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},tie(s,r,i);const a=cBt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;DV(i,d)&&(tie(d.getModel(),r,i),a.updateOptions({}))}}}function cBt(n,e){if(!n.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),s=t.getModifiedEditor();if(i===n||s===n)return t}return null}var xH;let nie=(xH=class extends ${constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const o=this._editor.getOptions().get(x.wrappingInfo),r=this._contextKeyService.createKey(mFe,o.isWordWrapMinified),a=this._contextKeyService.createKey(_Fe,o.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);r.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!DV(this._codeEditorService,this._editor))return;const d=iie(this._editor.getModel(),this._codeEditorService);try{c=!0,this._applyWordWrapState(d)}finally{c=!1}}}_applyWordWrapState(e){const t=e?e.wordWrapOverride:"inherit";this._editor.updateOptions({wordWrapOverride2:t})}},xH.ID="editor.contrib.toggleWordWrapController",xH);nie=D([_(1,Pe),_(2,jt)],nie);var DH;let sie=(DH=class extends ${constructor(e,t){super(),this._diffEditor=e,this._codeEditorService=t,this._register(this._diffEditor.onDidChangeModel(()=>{this._ensureSyncedWordWrapToggle()}))}_ensureSyncedWordWrapToggle(){const e=this._diffEditor.getOriginalEditor(),t=this._diffEditor.getModifiedEditor();if(!e.hasModel()||!t.hasModel())return;const i=iie(e.getModel(),this._codeEditorService),s=iie(t.getModel(),this._codeEditorService);i&&!s&&DV(this._codeEditorService,e)&&(tie(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&s&&DV(this._codeEditorService,t)&&(tie(e.getModel(),s,this._codeEditorService),this._diffEditor.updateOptions({}))}},DH.ID="diffeditor.contrib.toggleWordWrapController",DH);sie=D([_(1,jt)],sie);function DV(n,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of n.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var kH;let oie=(kH=class extends ${constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(T.runAndSubscribe(Vb,({window:s,disposables:o})=>{o.add(pe(s,"focus",()=>this._update(),!0)),o.add(pe(s,"blur",()=>this._update(),!0))},{window:yi,disposables:this._store})),this._editorService.onDidActiveEditorChange(()=>this._update()),this._canToggleWordWrap=_it.bindTo(this._contextService),this._editorWordWrap=vit.bindTo(this._contextService),this._activeEditor=null,this._activeEditorListener=new Z,this._update()}_update(){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();this._activeEditor!==e&&(this._activeEditorListener.clear(),this._activeEditor=e,e&&(this._activeEditorListener.add(e.onDidChangeModel(()=>this._updateFromCodeEditor())),this._activeEditorListener.add(e.onDidChangeConfiguration(t=>{t.hasChanged(x.wrappingInfo)&&this._updateFromCodeEditor()})),this._updateFromCodeEditor()))}_updateFromCodeEditor(){if(DV(this._codeEditorService,this._activeEditor)){const e=this._activeEditor.getOption(x.wrappingInfo);this._setValues(!0,e.wrappingColumn!==-1)}else return this._setValues(!1,!1)}_setValues(e,t){this._canToggleWordWrap.set(e),this._editorWordWrap.set(t)}},kH.ID="workbench.contrib.editorWordWrapContextKeyTracker",kH);oie=D([_(0,_i),_(1,jt),_(2,Pe)],oie);gp(oie.ID,oie,Sl.AfterRestored);vn(nie.ID,nie,mi.Eager);Aje(sie.ID,sie);Fe(aBt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,2,"Disable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(ge.has(_Fe),ge.has(mFe))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:Che,title:g(jQ,3,"Enable wrapping for this file"),icon:Ce.wordWrap},group:"navigation",order:1,when:ge.and(X.inDiffEditor.negate(),ge.has(_Fe),ge.not(mFe))});Xs.appendMenuItem(Te.MenubarViewMenu,{command:{id:Che,title:g(jQ,4,"&&Word Wrap"),toggled:vit,precondition:_it},order:1,group:"5_editor"});const Y4e="vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace",tce=class tce extends pi{constructor(){super({id:tce.ID,title:{...Be(Y4e,0,"Toggle Render Whitespace"),mnemonicTitle:g(Y4e,1,"&&Render Whitespace")},category:Xa.View,f1:!0,toggled:ge.notEquals("config.editor.renderWhitespace","none"),menu:{id:Te.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Re),i=t.getValue("editor.renderWhitespace");let s;return i==="none"?s="all":s="none",t.updateValue("editor.renderWhitespace",s)}};tce.ID="editor.action.toggleRenderWhitespace";let SSe=tce;At(SSe);class lBt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}it.add("gutterActionsRegistry",new lBt);const dBt=it.as("gutterActionsRegistry");var IH;let rie=(IH=class extends ${constructor(e,t,i,s,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=s,this.instantiationService=o,this._register(this.editor.onMouseDown(r=>this.doShow(r,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(ei&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Mt.GUTTER_LINE_NUMBERS&&e.target.type!==Mt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const s=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",s]]),r=this.menuService.createMenu(Te.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of dBt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:s,editor:this.editor,accessor:c},{push:(u,f="navigation")=>{const p=h.get(f)??[];p.push(u),h.set(f,p)}});for(const[u,f]of h.entries())a.push([u,f])}a.sort((d,h)=>d[0].localeCompare(h[0]));const l=r.getActions({arg:{lineNumber:s,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Mt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:s,endLineNumber:s,startColumn:1,endColumn:i.getLineLength(s)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,jb.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Kr.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},IH.ID="workbench.contrib.editorLineNumberContextMenu",IH);rie=D([_(1,Vr),_(2,_c),_(3,Pe),_(4,be)],rie);vn(rie.ID,rie,mi.AfterFirstRender);var Dg;const Hd="vs/workbench/contrib/format/browser/formatActionsMultiple";var Py;let oS=(Py=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=s,this._dialogService=o,this._quickInputService=r,this._languageService=a,this._languageFeaturesService=c,this._languageStatusService=l,this._editorService=d,this._languageStatusStore=this._store.add(new Z),this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(gV.setFormatterSelector((h,u,f,p)=>this._selectFormatter(h,u,f,p))),this._store.add(d.onDidActiveEditorChange(this._updateStatus,this)),this._store.add(c.documentFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(c.documentRangeFormattingEditProvider.onDidChange(this._updateStatus,this)),this._store.add(i.onDidChangeConfiguration(h=>h.affectsConfiguration(Dg.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const s=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return s&&!o?-1:!s&&o?1:t.name.localeCompare(i.name)}),Dg.extensionIds.length=0,Dg.extensionItemLabels.length=0,Dg.extensionDescriptions.length=0,Dg.extensionIds.push(null),Dg.extensionItemLabels.push(g(Hd,0,"None")),Dg.extensionDescriptions.push(g(Hd,1,"None"));for(const t of e)(t.main||t.browser)&&(Dg.extensionIds.push(t.identifier.value),Dg.extensionItemLabels.push(t.displayName??""),Dg.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const s=this._configService.getValue(Dg.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(s){const a=t.find(l=>Cn.equals(l.extensionId,s));if(a)return a;const c=await this._extensionService.getExtension(s);if(c&&this._extensionEnablementService.isEnabled(che(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===uV.File?g(Hd,2,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(Hd,3,"Extension '{0}' is configured as formatter but it can only format '{1}'-files as a whole, not selections or parts of it.",c.displayName||c.name,l)}}else if(t.length===1)return t[0];const o=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return s?g(Hd,5,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",s):g(Hd,4,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",Dg._maybeQuotes(o))}async _selectFormatter(e,t,i,s){const o=await this._analyzeFormatter(s,e,t);if(typeof o!="string")return o;if(i!==S_.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(Hd,6,"Configure Default Formatter"),detail:o,primaryButton:g(Hd,7,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(nt.Info,o,[{label:g(Hd,8,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:jU.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((r,a)=>({index:a,label:r.displayName||(r.extensionId?r.extensionId.value:"?"),description:r.extensionId&&r.extensionId.value})),s=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",Dg._maybeQuotes(s))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(Dg.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=_z(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Hde(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const s=new ai;this._languageStatusStore.add(Ee(()=>s.dispose(!0))),this._analyzeFormatter(uV.File,i,t).then(o=>{if(s.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${Dr()}`,title:g(Hd,10,"Configure...")};this._languageStatusStore.add(yt.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(Hd,11,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:nt.Error,label:g(Hd,12,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},Dg=Py,Py.configName="editor.defaultFormatter",Py.extensionIds=[],Py.extensionItemLabels=[],Py.extensionDescriptions=[],Py);oS=Dg=D([_(0,ho),_(1,Kh),_(2,Re),_(3,Pi),_(4,To),_(5,On),_(6,Di),_(7,ht),_(8,OPe),_(9,_i)],oS);it.as(pf.Workbench).registerWorkbenchContribution(oS,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[oS.configName]:{description:g(Hd,13,"Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter."),type:["string","null"],default:null,enum:oS.extensionIds,enumItemLabels:oS.extensionItemLabels,markdownEnumDescriptions:oS.extensionDescriptions}}});function wit(n,e,t,i){function s(o){return o.extensionId?Cn.toKey(o.extensionId):"unknown"}n.publicLog2("formatterpick",{mode:e,extensions:t.map(s),pick:i?s(i):"none"})}async function bit(n,e,t){const i=n.get(On),s=n.get(Re),o=n.get(Di),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=s.getValue(oS.configName,r);let c;const l=t.map((u,f)=>{const p=Cn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(Hd,14,"(default)"):void 0};return p&&(c=m),m}),d={label:g(Hd,15,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(Hd,16,"Select a formatter"),activeItem:c});if(h)if(h===d){const u=o.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(Hd,9,"Select a default formatter for '{0}' files",oS._maybeQuotes(u))});f&&t[f.index].extensionId&&s.updateValue(oS.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(Hd,17,"Format Document With..."),alias:"Format Document...",precondition:ge.and(X.writable,X.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const s=e.get(be),o=e.get(rn),r=e.get(ht),a=t.getModel(),c=Hde(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await s.invokeFunction(bit,a,c);typeof l=="number"&&await s.invokeFunction(mZe,c[l],t,S_.Explicit,qe.None),wit(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Fe(class extends lt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(Hd,18,"Format Selection With..."),alias:"Format Code...",precondition:ge.and(ge.and(X.writable),X.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:ge.and(X.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get(ht),o=e.get(rn),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new O(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=s.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(bit,r,c);typeof l=="number"&&await i.invokeFunction(pZe,c[l],t,a,qe.None,!0),wit(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const Uz="workbench.view.extensions";var Fr;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(Fr||(Fr={}));var ov;(function(n){n.ReloadWindow="reloadWindow",n.RestartExtensions="restartExtensions",n.DownloadUpdate="downloadUpdate",n.ApplyUpdate="applyUpdate",n.QuitAndInstall="quitAndInstall"})(ov||(ov={}));var ASe;(function(n){n.Readme="readme",n.Features="features",n.Changelog="changelog",n.Dependencies="dependencies",n.ExtensionPack="extensionPack"})(ASe||(ASe={}));const hBt="extensions.autoUpdate";let J4e=class extends ${constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?gc(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};J4e=D([_(1,pr)],J4e);const uBt="workbench.extensions.action.toggleIgnoreExtension",gBt="workbench.extensions.action.installVSIX";new Y("hasOutdatedExtensions",!1);new Y("hasGallery",!1);const fBt="_theme_",pBt="0_install",mBt="0_update";new Te("extensionsSearchActionsMenu");const yhe="vs/workbench/common/views";g(yhe,0,"Views");const _Bt=Ki("default-view-icon",Ce.window,g(yhe,1,"Default view icon."));var M1;(function(n){n.ViewContainersRegistry="workbench.registry.view.containers",n.ViewsRegistry="workbench.registry.view"})(M1||(M1={}));var Sr;(function(n){n[n.Sidebar=0]="Sidebar",n[n.Panel=1]="Panel",n[n.AuxiliaryBar=2]="AuxiliaryBar"})(Sr||(Sr={}));Sr.Sidebar,Sr.Panel,Sr.AuxiliaryBar;function aie(n){switch(n){case Sr.Sidebar:return"sidebar";case Sr.Panel:return"panel";case Sr.AuxiliaryBar:return"auxiliarybar"}}class vBt extends ${constructor(){super(...arguments),this._onDidRegister=this._register(new I),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new I),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const s=this.get(e.id);if(s)return s;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},XX(this.viewContainers,t,[]).push(o),i?.isDefault&&this.defaultViewContainers.push(o),this._onDidRegister.fire({viewContainer:o,viewContainerLocation:t}),o}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),s=i?.indexOf(e);if(s!==-1){i?.splice(s,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}it.add(M1.ViewContainersRegistry,new vBt);var cie;(function(n){n.Open="2_open",n.Debug="4_debug",n.SCM="5_scm",n.More="9_more"})(cie||(cie={}));function wBt(n,e){const t=n.group??cie.More,i=e.group??cie.More;return t!==i?t.localeCompare(i):(n.order??5)-(e.order??5)}class bBt extends ${constructor(){super(...arguments),this._onViewsRegistered=this._register(new I),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new I),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new I),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new I),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new Vq}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const s=this.removeViews(e,i);s.length&&(this.addViews(s,t),this._onDidChangeContainer.fire({views:s,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(s=>s.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(s=>s.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),Ee(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[s,o]of t)this._viewWelcomeContents.add(e,o),i.set(s,Ee(()=>{this._viewWelcomeContents.delete(e,o),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(wBt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const s of e){if(this.getView(s.id)!==null)throw new Error(g(yhe,2,"A view with id '{0}' is already registered",s.id));i.push(s)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const s=[],o=[];for(const r of i)e.includes(r)?s.push(r):o.push(r);return s.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),s}}it.add(M1.ViewsRegistry,new bBt);var ESe;(function(n){n[n.Default=0]="Default",n[n.Expand=1]="Expand"})(ESe||(ESe={}));var X4e;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(X4e||(X4e={}));class fpe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,ym(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const s=await t(i);s&&(this.tooltip=this.tooltip??s.tooltip,this.command=this.command??s.command)}i.isCancellationRequested||(this.resolved=!0)}}get hasResolve(){return this._hasResolve}resetResolve(){this.resolved=!1}asTreeItem(){return{handle:this.handle,parentHandle:this.parentHandle,collapsibleState:this.collapsibleState,label:this.label,description:this.description,icon:this.icon,iconDark:this.iconDark,themeIcon:this.themeIcon,resourceUri:this.resourceUri,tooltip:this.tooltip,contextValue:this.contextValue,command:this.command,children:this.children,accessibilityInformation:this.accessibilityInformation}}}class kC extends Error{constructor(e){super(g(yhe,3,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}const OK="vs/workbench/contrib/format/browser/formatActionsNone";async function CBt(n,e){const t=await n.openPaneComposite(Uz,Sr.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Fe(class extends lt{constructor(){super({id:"editor.action.formatDocument.none",label:g(OK,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.writable,X.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(ji),s=e.get(Nw),o=e.get(Pi),r=e.get(To),a=e.get(ht),c=t.getModel(),l=a.documentFormattingEditProvider.all(c).length;if(l>1)return i.executeCommand("editor.action.formatDocument.multiple");if(l===1)return i.executeCommand("editor.action.formatDocument");if(c.isTooLargeForSyncing())o.warn(g(OK,1,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(OK,2,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(OK,3,"&&Install Formatter...")});u&&CBt(s,`category:formatters ${d}`)}}});var Tf;const xSe="vs/workbench/contrib/folding/browser/folding.contribution";var Fy;let AR=(Fy=class extends ${constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(Ox.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),Tf.extensionIds.length=0,Tf.extensionItemLabels.length=0,Tf.extensionDescriptions.length=0,Tf.extensionIds.push(null),Tf.extensionItemLabels.push(g(xSe,0,"All")),Tf.extensionDescriptions.push(g(xSe,1,"All active folding range providers"));const e=[],t=[];for(const s of this._extensionService.extensions)(s.main||s.browser)&&(s.categories?.find(o=>o==="Programming Languages")?e.push(s):t.push(s));const i=(s,o)=>s.name.localeCompare(o.name);for(const s of e.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"");for(const s of t.sort(i))Tf.extensionIds.push(s.identifier.value),Tf.extensionItemLabels.push(s.displayName??""),Tf.extensionDescriptions.push(s.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(Tf.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(s=>s.id===i)}},Tf=Fy,Fy.configName="editor.defaultFoldingRangeProvider",Fy.extensionIds=[],Fy.extensionItemLabels=[],Fy.extensionDescriptions=[],Fy);AR=Tf=D([_(0,ho),_(1,Re)],AR);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[AR.configName]:{description:g(xSe,2,"Defines a default folding range provider that takes precedence over all other folding range providers. Must be the identifier of an extension contributing a folding range provider."),type:["string","null"],default:null,enum:AR.extensionIds,enumItemLabels:AR.extensionItemLabels,markdownEnumDescriptions:AR.extensionDescriptions}}});it.as(pf.Workbench).registerWorkbenchContribution(AR,Us.Restored);var yBt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";Ct(yBt,{});let t6=class extends ${get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}set link(e){typeof e.label=="string"?this.el.textContent=e.label:(Yo(this.el),this.el.appendChild(e.label)),this.el.href=e.href,typeof e.tabIndex<"u"&&(this.el.tabIndex=e.tabIndex),this.setTooltip(e.title),this._link=e}constructor(e,t,i={},s,o){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=he(e,we("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??va("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new oi(this.el,"click")),a=this._register(new oi(this.el,"keypress")),c=T.chain(a.event,h=>h.map(u=>new os(u)).filter(u=>u.keyCode===E.Enter)),l=this._register(new oi(this.el,Eo.Tap)).event;this._register(dh.addTarget(this.el));const d=T.any(r.event,c,l);this._register(d(h=>{this.enabled&&(un.stop(h,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupUpdatableHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};t6=D([_(3,el),_(4,fr)],t6);var BJ;const lie="vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty";var b0;let xF=(b0=class{static get(e){return e.getContribution(BJ.ID)??void 0}constructor(e,t,i,s){this._editor=e,this._accessibilitySignalService=i,this._instaService=s,this._sessionDispoosables=new Z,this._ariaElement=document.createElement("span"),this._ariaElement.style.position="fixed",this._ariaElement.className="inlayhint-accessibility-element",this._ariaElement.tabIndex=0,this._ariaElement.setAttribute("aria-description",g(lie,1,"Code with Inlay Hint Information")),this._ctxIsReading=BJ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Yo(this._ariaElement),this._sessionDispoosables.clear(),this._ctxIsReading.reset()}async _read(e,t){if(this._sessionDispoosables.clear(),this._ariaElement.isConnected||this._editor.getDomNode()?.appendChild(this._ariaElement),!this._editor.hasModel()||!this._ariaElement.isConnected){this._ctxIsReading.set(!1);return}const i=new ai;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const s=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(o.push(l),r=c.hint.position.column-1),r>750){o.push("…"),a=!0;break}const d=document.createElement("em"),{label:h}=c.hint;if(typeof h=="string")d.innerText=h;else for(const u of h)if(u.command){const f=this._instaService.createInstance(t6,d,{href:jtt(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;o.push(d)}a||o.push(s.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),_a(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(pe(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=AV.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(Zl.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},BJ=b0,b0.IsReading=new Y("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(lie,0,"Whether the current line and its inlay hints are currently focused")}),b0.ID="editor.contrib.InlayHintsAccessibility",b0);xF=BJ=D([_(1,Pe),_(2,Lw),_(3,be)],xF);At(class extends wf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Be(lie,2,"Read Line With Inline Hints"),precondition:X.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){xF.get(t)?.startInlayHintsReading()}});At(class extends wf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Be(lie,3,"Stop Inlay Hints Reading"),precondition:xF.IsReading,f1:!0,keybinding:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(e,t){xF.get(t)?.stopInlayHintsReading()}});vn(xF.ID,xF,mi.Lazy);const xy="vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint";var nb;(function(n){n.languages="languages",n.actions="actions",n.kind="kind",n.title="title",n.description="description"})(nb||(nb={}));const SBt=Object.freeze({type:"array",markdownDescription:g(xy,0,"Configure which editor to use for a resource."),items:{type:"object",required:[nb.languages,nb.actions],properties:{[nb.languages]:{type:"array",description:g(xy,1,"Language modes that the code actions are enabled for."),items:{type:"string"}},[nb.actions]:{type:"object",required:[nb.kind,nb.title],properties:{[nb.kind]:{type:"string",markdownDescription:g(xy,2,"`CodeActionKind` of the contributed code action.")},[nb.title]:{type:"string",description:g(xy,3,"Label for the code action used in the UI.")},[nb.description]:{type:"string",description:g(xy,4,"Description of what the code action does.")}}}}}}),ABt={extensionPoint:"codeActions",deps:[CV],jsonSchema:SBt};class EBt extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.codeActions}render(e){const t=e.contributes?.codeActions||[];if(!t.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const i=t.map(r=>r.actions.map(a=>({...a,languages:r.languages}))).flat(),s=[g(xy,5,"Title"),g(xy,6,"Kind"),g(xy,7,"Description"),g(xy,8,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Xt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Xt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:s,rows:o},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(xy,9,"Code Actions"),access:{canToggle:!1},renderer:new Gi(EBt)});const YO="vs/workbench/contrib/codeActions/common/documentationExtensionPoint";var tk;(function(n){n.when="when",n.title="title",n.command="command"})(tk||(tk={}));const xBt=Object.freeze({type:"object",description:g(YO,0,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(YO,1,"Contributed documentation for refactorings."),items:{type:"object",description:g(YO,2,"Contributed documentation for refactoring."),required:[tk.title,tk.when,tk.command],properties:{[tk.title]:{type:"string",description:g(YO,3,"Label for the documentation used in the UI.")},[tk.when]:{type:"string",description:g(YO,4,"When clause.")},[tk.command]:{type:"string",description:g(YO,5,"Command executed.")}}}}}}),DBt={extensionPoint:"documentation",deps:[CV],jsonSchema:xBt},Ak="vs/workbench/contrib/codeActions/browser/codeActionsContribution",Cit=n=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(Ak,0,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(Ak,1,"Triggers Code Actions only when explicitly saved"),g(Ak,2,"Never triggers Code Actions on save"),g(Ak,3,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(Ak,4,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:n}),DSe=Object.freeze({"source.fixAll":Cit(g(Ak,5,"Controls whether auto fix action should be run on file save."))}),yit={oneOf:[{type:"object",properties:DSe,additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(Ak,6,'Run Code Actions for the editor on save. Code Actions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'),type:["object","array"],additionalProperties:{type:"string",enum:["always","explicit","never",!0,!1]},default:{},scope:ut.LANGUAGE_OVERRIDABLE},Sit=Object.freeze({...sA,properties:{"editor.codeActionsOnSave":yit}});let kSe=class extends ${constructor(e,t){super(),this._contributedCodeActions=[],this._onDidChangeContributions=this._register(new I),e.setHandler(i=>{this._contributedCodeActions=i.flatMap(s=>s.value).filter(s=>Array.isArray(s.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateConfigurationSchema(e){const t={...DSe};for(const[i,s]of this.getSourceActions(e))t[i]=Cit(g(Ak,7,"Controls whether '{0}' actions should be run on file save.",s.title));yit.properties=t,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(Sit)}getSourceActions(e){const t=Object.keys(DSe).map(s=>new bs(s)),i=new Map;for(const s of e)for(const o of s.actions){const r=new bs(o.kind);ls.Source.contains(r)&&!t.some(a=>a.contains(r))&&i.set(r.value,o)}return i}getSchemaAdditions(){const e=(i,s)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:s.map(o=>o.kind),enumDescriptions:s.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const s=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of s)!o.has(r.kind)&&i.contains(new bs(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(rFe,t(bs.Empty)),e(cFe,t(ls.Refactor)),e(lFe,t(ls.Source))]}};kSe=D([_(1,ti)],kSe);let ISe=class extends ${constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(s=>{this.contributions=[];for(const o of s)if(o.value.refactoring)for(const r of o.value.refactoring){const a=ge.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,s){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ls.Refactor.value&&!t.some(i=>i.kind&&ls.Refactor.contains(new bs(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};ISe=D([_(1,Pe),_(2,ht)],ISe);const kBt=Ap.registerExtensionPoint(ABt),IBt=Ap.registerExtensionPoint(DBt);it.as(Cs.Configuration).registerConfiguration(Sit);let LSe=class{constructor(e){e.createInstance(kSe,kBt),e.createInstance(ISe,IBt)}};LSe=D([_(0,be)],LSe);it.as(pf.Workbench).registerWorkbenchContribution(LSe,Us.Eventually);var LH;let die=(LH=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},LH.ID="workbench.contrib.listContext",LH);die=D([_(0,Pe)],die);gp(die.ID,die,Sl.BlockStartup);const Ait=[];function KQ(n){Ait.push(n)}function LBt(){return Ait.slice(0)}var TH;let hie=(TH=class extends ${constructor(e,t){super(),this._instantiationService=t,this._instantiated=!1,this._register(e.onWillCreateCodeEditor(()=>this._instantiate())),this._register(e.onWillCreateDiffEditor(()=>this._instantiate())),(e.listCodeEditors().length>0||e.listDiffEditors().length>0)&&this._instantiate()}_instantiate(){if(this._instantiated)return;this._instantiated=!0;const e=LBt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){bt(i)}}},TH.ID="workbench.contrib.editorFeaturesInstantiator",TH);hie=D([_(0,jt),_(1,be)],hie);gp(hie.ID,hie,Sl.BlockRestore);let TSe=class{constructor(e,t){this.disposables=new Z;const i=s=>e.activeContainer.classList.toggle("context-menu-visible",s);t.onDidShowContextMenu(()=>i(!0),null,this.disposables),t.onDidHideContextMenu(()=>i(!1),null,this.disposables)}};TSe=D([_(0,bg),_(1,Vr)],TSe);it.as(pf.Workbench).registerWorkbenchContribution(TSe,Us.Eventually);yt.registerCommand("_executeMappedEditsProvider",async(n,e,t,i)=>{const s=n.get(Rn),o=n.get(ht),r=await s.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ai;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const kO=bg,JO="vs/workbench/browser/actions/textInputActions";var RH;let uie=(RH=class extends ${constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new Ka(()=>this.createActions()),this.registerListeners()}createActions(){return[new xn("undo",g(JO,0,"Undo"),void 0,!0,async()=>Kg().execCommand("undo")),new xn("redo",g(JO,1,"Redo"),void 0,!0,async()=>Kg().execCommand("redo")),new Kr,new xn("editor.action.clipboardCutAction",g(JO,2,"Cut"),void 0,!0,async()=>Kg().execCommand("cut")),new xn("editor.action.clipboardCopyAction",g(JO,3,"Copy"),void 0,!0,async()=>Kg().execCommand("copy")),new xn("editor.action.clipboardPasteAction",g(JO,4,"Paste"),void 0,!0,async e=>{if(rf)Kg().execCommand("paste");else{const t=await this.clipboardService.readText();if(Zut(e)||egt(e)){const i=e.selectionStart||0,s=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(s,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Kr,new xn("editor.action.selectAll",g(JO,5,"Select All"),void 0,!0,async()=>Kg().execCommand("selectAll"))]}registerListeners(){this._register(T.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(pe(e,"contextmenu",i=>this.onContextMenu(gt(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Ra(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;un.stop(t,!0);const s=new yu(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>s,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},RH.ID="workbench.contrib.textInputActionsProvider",RH);uie=D([_(0,kO),_(1,Vr),_(2,Mu)],uie);gp(uie.ID,uie,Sl.BlockRestore);var TBt='.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-workbench .screencast-mouse{border-radius:50%;border-style:solid;border-width:2px;content:" ";display:none;pointer-events:none;position:absolute;z-index:100000}.monaco-workbench .screencast-keyboard{background-color:rgba(0,0,0,.5);color:#eee;left:0;line-height:1.75em;overflow:hidden;pointer-events:none;position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:100000}.monaco-workbench:not(.reduce-motion) .screencast-keyboard{transition:opacity .3s ease-out}.monaco-workbench .screencast-keyboard:empty{opacity:0}.monaco-workbench .screencast-keyboard>.key{background-color:hsla(0,0%,100%,.05);border:1px solid hsla(0,0%,80%,.4);border-radius:5px;box-shadow:inset 0 -3px 0 hsla(0,0%,73%,.4);margin-right:6px;padding:0 8px}.monaco-workbench .screencast-keyboard>.title{font-weight:600}';Ct(TBt,{});const RBt="rendererLog",MBt="workbench.action.showWindowLog";let Ip;const ppe=globalThis.vscode;if(typeof ppe<"u"&&typeof ppe.context<"u"){const n=ppe.context.configuration();if(n)Ip=n.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Ip=globalThis._VSCODE_PRODUCT_JSON,IU.VSCODE_DEV&&Object.assign(Ip,{nameShort:`${Ip.nameShort} Dev`,nameLong:`${Ip.nameLong} Dev`,dataFolderName:`${Ip.dataFolderName}-dev`,serverDataFolderName:Ip.serverDataFolderName?`${Ip.serverDataFolderName}-dev`:void 0}),!Ip.version){const n=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ip,{version:n.version})}}else Ip={},Object.keys(Ip).length===0&&Object.assign(Ip,{version:"1.90.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"});var NBt=Ip;const br="vs/workbench/browser/actions/developerActions";class PBt extends pi{constructor(){super({id:"workbench.action.inspectContextKeys",title:Be(br,0,"Inspect Context Keys"),category:Xa.Developer,f1:!0})}run(e){const t=e.get(Pe),i=new Z,s=od(void 0,void 0,i);Kp("*","cursor: crosshair !important;",s);const o=document.createElement("div"),r=Kg();r.body.appendChild(o),i.add(Ee(()=>r.body.removeChild(o))),o.style.position="absolute",o.style.pointerEvents="none",o.style.backgroundColor="rgba(255, 0, 0, 0.5)",o.style.zIndex="1000";const a=i.add(new oi(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=ia(h);o.style.top=`${u.top}px`,o.style.left=`${u.left}px`,o.style.width=`${u.width}px`,o.style.height=`${u.height}px`}));const c=i.add(new oi(r,"mousedown",!0));T.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new oi(r,"mouseup",!0));T.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),St(i)},null,i)}}class g2 extends pi{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Be(br,1,"Toggle Screencast Mode"),category:Xa.Developer,f1:!0})}run(e){if(g2.disposable){g2.disposable.dispose(),g2.disposable=void 0;return}const t=e.get(bg),i=e.get(Re),s=e.get(ti),o=new Z,r=t.activeContainer,a=he(r,we(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=he(r,we(".screencast-keyboard"));o.add(Ee(()=>c.remove()));const l=o.add(new I),d=o.add(new I),h=o.add(new I);function u(j,re){re.add(re.add(new oi(j,"mousedown",!0)).event(me=>l.fire(me))),re.add(re.add(new oi(j,"mouseup",!0)).event(me=>d.fire(me))),re.add(re.add(new oi(j,"mousemove",!0)).event(me=>h.fire(me)))}for(const{window:j,disposables:re}of N9())u(t.getContainer(j),re);o.add(Vb(({window:j,disposables:re})=>u(t.getContainer(j),re))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=fe.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=Dc(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),o.add(l.event(j=>{a.style.top=`${j.clientY-p/2}px`,a.style.left=`${j.clientX-p/2}px`,a.style.display="block",a.style.transform="scale(1)",a.style.transition="transform 0.1s";const re=h.event(me=>{a.style.top=`${me.clientY-p/2}px`,a.style.left=`${me.clientX-p/2}px`,a.style.transform=`scale(${.8})`});T.once(d.event)(()=>{a.style.display="none",re.dispose()})}));const v=()=>{c.style.fontSize=`${Dc(i.getValue("screencastMode.fontSize")||56,20,100)}px`},w=()=>{c.style.bottom=`${Dc(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let b;const C=()=>{b=Dc(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),w(),C(),o.add(i.onDidChangeConfiguration(j=>{j.affectsConfiguration("screencastMode.verticalOffset")&&w(),j.affectsConfiguration("screencastMode.fontSize")&&v(),j.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&C(),j.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),j.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const y=o.add(new I),S=o.add(new I),M=o.add(new I),k=o.add(new I);function F(j,re){re.add(re.add(new oi(j,"keydown",!0)).event(me=>y.fire(me))),re.add(re.add(new oi(j,"compositionstart",!0)).event(me=>S.fire(me))),re.add(re.add(new oi(j,"compositionupdate",!0)).event(me=>M.fire(me))),re.add(re.add(new oi(j,"compositionend",!0)).event(me=>k.fire(me)))}for(const{window:j,disposables:re}of N9())F(j,re);o.add(Vb(({window:j,disposables:re})=>F(j,re)));let N=0,z,U=!1;const J=new yn(()=>{c.textContent="",z=void 0,N=0},b);o.add(S.event(j=>{U=!0})),o.add(M.event(j=>{j.data&&U?(N>20&&(c.innerText="",N=0),z=z??he(c,we("span.key")),z.textContent=j.data):U&&(c.innerText="",he(c,we("span.key",{},"Backspace"))),J.schedule()})),o.add(k.event(j=>{z=void 0,N++})),o.add(y.event(j=>{if(j.key==="Process"||/[\uac00-\ud787\u3131-\u314e\u314f-\u3163\u3041-\u3094\u30a1-\u30f4\u30fc\u3005\u3006\u3024\u4e00-\u9fa5]/u.test(j.key)){j.code==="Backspace"||j.code.includes("Key")?U=!0:(z=void 0,U=!1),J.schedule();return}if(j.isComposing)return;const re=i.getValue("screencastMode.keyboardOptions"),me=new os(j),De=s.softDispatch(me,me.target);if(De.kind===hp.KbFound&&De.commandId&&!(re.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(De.commandId))return;(me.ctrlKey||me.altKey||me.metaKey||me.shiftKey||N>20||me.keyCode===E.Backspace||me.keyCode===E.Escape||me.keyCode===E.UpArrow||me.keyCode===E.DownArrow||me.keyCode===E.LeftArrow||me.keyCode===E.RightArrow)&&(c.innerText="",N=0);const Qe=s.resolveKeyboardEvent(me),Tt=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Oe=Tt?.title,wt=Qe.getLabel();if(Tt&&((re.showCommandGroups??!1)&&Tt.category&&(Oe=`${Tt.category}: ${Oe} `),this._isKbFound(De)&&De.commandId)){const Nt=s.lookupKeybindings(De.commandId).filter(Ji=>Ji.getLabel()?.endsWith(wt??""));Nt.length>0&&(wt=Nt[Nt.length-1].getLabel())}(re.showCommands??!0)&&Oe&&he(c,we("span.title",{},`${Oe} `)),((re.showKeys??!0)||(re.showKeybindings??!0)&&this._isKbFound(De))&&(wt=wt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),he(c,we("span.key",{},wt??""))),N++,J.schedule()})),g2.disposable=o}_isKbFound(e){return e.kind===hp.KbFound}getCommandDetails(e){const t=Xs.getCommand(e);if(t)return{title:typeof t.title=="string"?t.title:t.title.value,category:t.category?typeof t.category=="string"?t.category:t.category.value:void 0};const i=yt.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class FBt extends pi{constructor(){super({id:"workbench.action.logStorage",title:Be(br,2,"Log Storage Database Contents"),category:Xa.Developer,f1:!0})}run(e){const t=e.get(on),i=e.get(To);t.log(),i.info(g(br,3,"The storage database contents have been logged to the developer tools."),g(br,4,"Open developer tools from the menu and select the Console tab."))}}class OBt extends pi{constructor(){super({id:"workbench.action.logWorkingCopies",title:Be(br,5,"Log Working Copies"),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(Pw),i=e.get(MQ),s=e.get(Ze),o=e.get(nhe),r=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...r.length>0?r.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];s.info(a.join(` +`)),o.showChannel(RBt,!0)}}const ice=class ice extends pi{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Be(br,6,"Remove Large Storage Database Entries..."),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(on),i=e.get(On),s=e.get(Tm),o=e.get(To),r=e.get(Il),a=[];for(const h of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE])if(!(h===ke.PROFILE&&s.currentProfile.isDefault))for(const u of[ln.MACHINE,ln.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>ice.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:vl.formatSize(p.length),detail:g(br,7,"Scope: {0}, Target: {1}",h===ke.APPLICATION?g(br,8,"Global"):h===ke.PROFILE?g(br,9,"Profile"):g(br,10,"Workspace"),u===ln.MACHINE?g(br,11,"Machine"):g(br,12,"User"))})}a.sort((h,u)=>u.size-h.size);const c=await new Promise(h=>{const u=new Z,f=u.add(i.createQuickPick());f.items=a,f.canSelectMany=!0,f.ok=!1,f.customButton=!0,f.hideCheckAll=!0,f.customLabel=g(br,13,"Remove"),f.placeholder=g(br,14,"Select large entries to remove from storage"),a.length===0&&(f.description=g(br,15,"There are no large storage entries to remove.")),f.show(),u.add(f.onDidCustom(()=>{h(f.selectedItems),f.hide()})),u.add(f.onDidHide(()=>u.dispose()))});if(c.length===0)return;const{confirmed:l}=await o.confirm({type:"warning",message:g(br,16,"Do you want to remove the selected storage entries from the database?"),detail:g(br,17,`{0} This action is irreversible and may result in data loss!`,c.map(h=>h.label).join(` -`)),primaryButton:g(br,18,"&&Remove")});if(!l)return;const d=new Set;for(const h of c)t.remove(h.key,h.scope),d.add(h.scope);for(const h of d)await t.optimize(h)}};ice.SIZE_THRESHOLD=1024*16;let RSe=ice,ER,gie=new Set;const CM=new Y("dirtyWorkingCopies","stopped");class BBt extends pi{constructor(){super({id:"workbench.action.startTrackDisposables",title:Be(br,19,"Start Tracking Disposables"),category:Xa.Developer,f1:!0,precondition:ge.and(CM.isEqualTo("pending").negate(),CM.isEqualTo("started").negate())})}run(e){CM.bindTo(e.get(Pe)).set("started"),gie.clear(),ER=new m_e,hQe(ER)}}class WBt extends pi{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Be(br,20,"Snapshot Tracked Disposables"),category:Xa.Developer,f1:!0,precondition:CM.isEqualTo("started")})}run(e){CM.bindTo(e.get(Pe)).set("pending"),gie=new Set(ER?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class HBt extends pi{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Be(br,21,"Stop Tracking Disposables"),category:Xa.Developer,f1:!0,precondition:CM.isEqualTo("pending")})}run(e){const t=e.get(_i);if(CM.bindTo(e.get(Pe)).set("stopped"),ER){const s=new Set;for(const r of new Set(ER.computeLeakingDisposables(1e3)?.leaks)??[])gie.has(r.value)&&s.add(r);const o=ER.computeLeakingDisposables(1e3,Array.from(s));o&&t.openEditor({resource:void 0,contents:o.details})}hQe(null),ER=void 0,gie.clear()}}At(PBt);At(g2);At(FBt);At(OBt);At(RSe);NBt.commit||(At(BBt),At(WBt),At(HBt));const UBt=it.as(Cs.Configuration);UBt.registerConfiguration({id:"screencastMode",order:9,title:g(br,22,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(br,23,"Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")},"screencastMode.fontSize":{type:"number",default:56,minimum:20,maximum:100,description:g(br,24,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(br,25,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(br,26,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(br,27,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(br,28,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(br,29,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(br,30,"Show single editor cursor move commands.")}},default:{showKeys:!0,showKeybindings:!0,showCommands:!0,showCommandGroups:!1,showSingleEditorCursorMoves:!0},additionalProperties:!1},"screencastMode.keyboardOverlayTimeout":{type:"number",default:800,minimum:500,maximum:5e3,description:g(br,31,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(br,32,"Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")},"screencastMode.mouseIndicatorSize":{type:"number",default:20,minimum:20,maximum:100,description:g(br,33,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});const i6="vs/editor/browser/widget/diffEditor/diffEditor.contribution";At(hNt);At(Uet);At(Vet);Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Vet().desc.id,title:g(i6,0,"Use Inline View When Space Is Limited"),toggled:ge.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ge.has("isInDiffEditor")},order:11,group:"1_diff",when:ge.and(X.diffEditorRenderSideBySideInlineBreakpointReached,ge.has("isInDiffEditor"))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Uet().desc.id,title:g(i6,1,"Show Moved Code Blocks"),icon:Ce.move,toggled:oO.create("config.diffEditor.experimental.showMoves",!0),precondition:ge.has("isInDiffEditor")},order:10,group:"1_diff",when:ge.has("isInDiffEditor")});At(aye);for(const n of[{icon:Ce.arrowRight,key:X.diffEditorInlineMode.toNegated()},{icon:Ce.discard,key:X.diffEditorInlineMode}])Xs.appendMenuItem(Te.DiffEditorHunkToolbar,{command:{id:new aye().desc.id,title:g(i6,2,"Revert Block"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Xs.appendMenuItem(Te.DiffEditorSelectionToolbar,{command:{id:new aye().desc.id,title:g(i6,3,"Revert Selection"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"});At(uNt);At(gNt);At(fNt);At(pNt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:_V.id,title:g(i6,4,"Open Accessible Diff Viewer"),precondition:ge.has("isInDiffEditor")},order:10,group:"2_diff",when:ge.and(X.accessibleDiffViewerVisible.negate(),ge.has("isInDiffEditor"))});yt.registerCommandAlias("editor.action.diffReview.next",_V.id);At(_V);yt.registerCommandAlias("editor.action.diffReview.prev",G7.id);At(G7);var VBt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";Ct(VBt,{});var MSe;const kV="vs/editor/contrib/anchorSelect/browser/anchorSelect",She=new Y("selectionAnchorSet",!1);var PN;let N1=(PN=class{static get(e){return e.getContribution(MSe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=She.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(mt.fromPositions(e,e),{description:"selection-anchor",stickiness:gi.NeverGrowsWhenTypingAtEdges,hoverMessage:new Xt().appendText(g(kV,0,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),sa(g(kV,1,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(mt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},MSe=PN,PN.ID="editor.contrib.selectionAnchorController",PN);N1=MSe=D([_(1,Pe)],N1);class zBt extends lt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(kV,2,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyB),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.setSelectionAnchor()}}class $Bt extends lt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(kV,3,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:She})}async run(e,t){N1.get(t)?.goToSelectionAnchor()}}class GBt extends lt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(kV,4,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyK),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.selectFromAnchorToCursor()}}class qBt extends lt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(kV,5,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:E.Escape,weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.cancelSelectionAnchor()}}vn(N1.ID,N1,mi.Lazy);Fe(zBt);Fe($Bt);Fe(GBt);Fe(qBt);var QBt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";Ct(QBt,{});const IV="vs/editor/contrib/bracketMatching/browser/bracketMatching",jBt=B("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g(IV,0,"Overview ruler marker color for matching brackets."));class KBt extends lt{constructor(){super({id:"editor.action.jumpToBracket",label:g(IV,1,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Backslash,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.jumpToBracket()}}class YBt extends lt{constructor(){super({id:"editor.action.selectToBracket",label:g(IV,2,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Be(IV,3,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let s=!0;i&&i.selectBrackets===!1&&(s=!1),$x.get(t)?.selectToBracket(s)}}class JBt extends lt{constructor(){super({id:"editor.action.removeBrackets",label:g(IV,4,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.Backspace,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.removeBrackets(this.id)}}class XBt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const gk=class gk extends ${static get(e){return e.getContribution(gk.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new yn(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(x.matchBrackets),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(x.matchBrackets)&&(this._matchBrackets=this._editor.getOption(x.matchBrackets),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(r=c.range.getStartPosition())}}return r?new mt(r.lineNumber,r.column,r.lineNumber,r.column):new mt(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const l=t.bracketPairs.findNextBracket(o);l&&l.range&&(r=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(O.compareRangesUsingStarts);const[l,d]=r;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=c,c=h}}a&&c&&i.push(new mt(a.lineNumber,a.column,c.lineNumber,c.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(oe.compare);const a=[];let c=0,l=0;const d=s.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}Fe(n2t);const ag="vs/editor/contrib/clipboard/browser/clipboard",DF="9_cutcopypaste",s2t=rf||document.queryCommandSupported("cut"),Dit=rf||document.queryCommandSupported("copy"),o2t=typeof navigator.clipboard>"u"||pp?document.queryCommandSupported("paste"):!0;function vFe(n){return n.register(),n}const r2t=s2t?vFe(new Z1({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyX,win:{primary:V.CtrlCmd|E.KeyX,secondary:[V.Shift|E.Delete]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,0,"Cu&&t"),order:1},{menuId:Te.EditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1},{menuId:Te.CommandPalette,group:"",title:g(ag,1,"Cut"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1}]})):void 0,a2t=Dit?vFe(new Z1({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyC,win:{primary:V.CtrlCmd|E.KeyC,secondary:[V.CtrlCmd|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,2,"&&Copy"),order:2},{menuId:Te.EditorContext,group:DF,title:g(ag,3,"Copy"),order:2},{menuId:Te.CommandPalette,group:"",title:g(ag,3,"Copy"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,3,"Copy"),order:2}]})):void 0;Xs.appendMenuItem(Te.MenubarEditMenu,{submenu:Te.MenubarCopy,title:Be(ag,4,"Copy As"),group:"2_ccp",order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextCopy,title:Be(ag,4,"Copy As"),group:DF,order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1,when:ge.and(ge.notEquals("resourceScheme","output"),X.editorTextFocus)});Xs.appendMenuItem(Te.ExplorerContext,{submenu:Te.ExplorerContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1});const mpe=o2t?vFe(new Z1({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyV,win:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},linux:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,6,"&&Paste"),order:4},{menuId:Te.EditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4},{menuId:Te.CommandPalette,group:"",title:g(ag,7,"Paste"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4}]})):void 0;class c2t extends lt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(ag,8,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,weight:ye.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(dwe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),dwe.forceCopyWithSyntaxHighlighting=!1)}}function kit(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(Qt).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(x.emptySelectionClipboard),r=s.getSelection();return r&&r.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(Kg().execCommand(e),!0)))}kit(r2t,"cut");kit(a2t,"copy");mpe&&(mpe.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(Qt),i=n.get(Mu),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?jS.get(s)?.finishedPaste()??Promise.resolve():Jn?(async()=>{const r=await i.readText();if(r!==""){const a=Z9.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=s.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard",Hc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),mpe.addImplementation(0,"generic-dom",(n,e)=>(Kg().execCommand("paste"),!0)));Dit&&Fe(c2t);const qa="vs/editor/contrib/codeAction/browser/codeActionCommands";function YQ(n){return ge.regex(Ftt.keys()[0],new RegExp("(\\s|^)"+Iu(n.value)+"\\b"))}const wFe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(qa,0,"Kind of the code action to run.")},apply:{type:"string",description:g(qa,1,"Controls when the returned actions are applied."),default:th.IfSingle,enum:[th.First,th.IfSingle,th.Never],enumDescriptions:[g(qa,2,"Always apply the first returned code action."),g(qa,3,"Apply the first returned code action if it is the only one."),g(qa,4,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(qa,5,"Controls if only preferred code actions should be returned.")}}};function IO(n,e,t,i,s=_f.Default){n.hasModel()&&AF.get(n)?.manualTriggerAtCurrentPosition(e,s,t,i)}class l2t extends lt{constructor(){super({id:aFe,label:g(qa,6,"Quick Fix..."),alias:"Quick Fix...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Period,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,7,"No code actions available"),void 0,void 0,_f.QuickFix)}}class d2t extends Yc{constructor(){super({id:rFe,precondition:ge.and(X.writable,X.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:wFe}]}})}runEditorCommand(e,t,i){const s=Ey.fromUser(i,{kind:bs.Empty,apply:th.IfSingle});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,8,"No preferred code actions for '{0}' available",i.kind):g(qa,9,"No code actions for '{0}' available",i.kind):s.preferred?g(qa,10,"No preferred code actions available"):g(qa,11,"No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class h2t extends lt{constructor(){super({id:cFe,label:g(qa,12,"Refactor..."),alias:"Refactor...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyR,mac:{primary:V.WinCtrl|V.Shift|E.KeyR},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:ge.and(X.writable,YQ(ls.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:wFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Refactor,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,13,"No preferred refactorings for '{0}' available",i.kind):g(qa,14,"No refactorings for '{0}' available",i.kind):s.preferred?g(qa,15,"No preferred refactorings available"):g(qa,16,"No refactorings available"),{include:ls.Refactor.contains(s.kind)?s.kind:bs.None,onlyIncludePreferredActions:s.preferred},s.apply,_f.Refactor)}}class u2t extends lt{constructor(){super({id:lFe,label:g(qa,17,"Source Action..."),alias:"Source Action...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ge.and(X.writable,YQ(ls.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:wFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Source,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,18,"No preferred source actions for '{0}' available",i.kind):g(qa,19,"No source actions for '{0}' available",i.kind):s.preferred?g(qa,20,"No preferred source actions available"):g(qa,21,"No source actions available"),{include:ls.Source.contains(s.kind)?s.kind:bs.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,_f.SourceAction)}}class g2t extends lt{constructor(){super({id:zye,label:g(qa,22,"Organize Imports"),alias:"Organize Imports",precondition:ge.and(X.writable,YQ(ls.SourceOrganizeImports)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|V.Alt|E.KeyO,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,23,"No organize imports action available"),{include:ls.SourceOrganizeImports,includeSourceActions:!0},th.IfSingle,_f.OrganizeImports)}}class f2t extends lt{constructor(){super({id:$ye,label:g(qa,24,"Fix All"),alias:"Fix All",precondition:ge.and(X.writable,YQ(ls.SourceFixAll))})}run(e,t){return IO(t,g(qa,25,"No fix all action available"),{include:ls.SourceFixAll,includeSourceActions:!0},th.IfSingle,_f.FixAll)}}class p2t extends lt{constructor(){super({id:Ltt,label:g(qa,26,"Auto Fix..."),alias:"Auto Fix...",precondition:ge.and(X.writable,YQ(ls.QuickFix)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Alt|V.Shift|E.Period,mac:{primary:V.CtrlCmd|V.Alt|E.Period},weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,27,"No auto fixes available"),{include:ls.QuickFix,onlyIncludePreferredActions:!0},th.IfSingle,_f.AutoFix)}}const Iit="vs/editor/contrib/codeAction/browser/codeActionContributions";vn(AF.ID,AF,mi.Eventually);vn(J7.ID,J7,mi.Lazy);Fe(l2t);Fe(h2t);Fe(u2t);Fe(g2t);Fe(p2t);Fe(f2t);Ke(new d2t);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,1,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class NSe{constructor(){this.lenses=[],this._disposables=new Z}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function Lit(n,e,t){const i=n.ordered(e),s=new Map,o=new NSe,r=i.map(async(a,c)=>{s.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){er(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:s.get(a.provider)s.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}yt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Bt(P.isUri(t)),Bt(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)throw Hi();const r=[],a=new Z;return Lit(s,o,qe.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,qe.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const Tit=ae("ICodeLensCache");class Z4e{constructor(e,t){this.lineCount=e,this.data=t}}let PSe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new L_(20,.75);const t="codelens/cache";UB(yi,()=>e.remove(t,ke.WORKSPACE));const i="codelens/cache2",s=e.get(i,ke.WORKSPACE,"{}");this._deserialize(s),T.once(e.onWillSaveState)(o=>{o.reason===nS.SHUTDOWN&&e.store(i,this._serialize(),ke.WORKSPACE,ln.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),s=new NSe;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Z4e(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new O(a,1,a,11)});const r=new NSe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Z4e(s.lineCount,r))}}catch{}}};PSe=D([_(0,sn)],PSe);ce(Tit,PSe,Kt.Delayed);var m2t=".monaco-editor .codelens-decoration{font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);color:var(--vscode-editorCodeLens-foreground);display:inline-block;font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);overflow:hidden;padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);text-overflow:ellipsis;white-space:nowrap}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{user-select:none;-webkit-user-select:none;vertical-align:sub;white-space:nowrap}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer}.monaco-editor .codelens-decoration>a:hover,.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);vertical-align:middle}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}";Ct(m2t,{});class _2t{constructor(e,t,i){this.afterColumn=Zn.MAX_SAFE_SMALL_INTEGER,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const n9=class n9{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${n9._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:eze},h=>this._decorationIds[d]=h),a?a=O.plusRange(a,l.symbol.range):a=O.lift(l.symbol.range)}),this._viewZone=new _2t(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new FSe(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&O.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:eze},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;tthis._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(x.fontInfo)||a.hasChanged(x.codeLensFontSize)||a.hasChanged(x.codeLensFontFamily))&&this._updateLensStyle(),a.hasChanged(x.codeLens)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(x.lineHeight)/this._editor.getOption(x.fontSize));let t=this._editor.getOption(x.codeLensFontSize);return(!t||t<5)&&(t=this._editor.getOption(x.fontSize)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(x.codeLensFontFamily),s=this._editor.getOption(x.fontInfo),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Gh.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(x.codeLens)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&PS(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new yn(()=>{const s=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=na(o=>Lit(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const r=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},bt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{const r=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?r.push(l):(l.update(o),a=l.getLineNumber())});const c=new _pe;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const s=M_.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==Mt.CONTENT_WIDGET)return;let o=s.target.element;if(o?.tagName==="SPAN"&&(o=o.parentElement),o?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new _pe;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(s&&s[s.length-1].symbol.range.startLineNumber===c?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=M_.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new _pe;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0)return;const s=Date.now(),o=na(r=>{const a=t.map((c,l)=>{const d=new Array(c.length),h=c.map((u,f)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(p=>{d[f]=p},er):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{bt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},MH.ID="css.editor.codeLens",MH);n6=D([_(1,ht),_(2,B_),_(3,Qi),_(4,Pi),_(5,Tit)],n6);vn(n6.ID,n6,mi.AfterFirstRender);Fe(class extends lt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:X.hasCodeLensProvider,label:g(ize,0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(On),s=e.get(Qi),o=e.get(Pi),r=t.getSelection().positionLineNumber,a=t.getContribution(n6.ID);if(!a)return;const c=await a.getModel();if(!c)return;const l=[];for(const u of c.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(l.length===0)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:g(ize,1,"Select a command")});if(!d)return;let h=d.command;if(c.isDisposed){const f=(await a.getModel())?.lenses.find(p=>p.symbol.range.startLineNumber===r&&p.symbol.command?.title===h.title);if(!f||!f.symbol.command)return;h=f.symbol.command}try{await s.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});class bFe{constructor(e,t){this._editorWorkerClient=new CMe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new fe(new gn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?fe.Format.CSS.formatRGB(a):fe.Format.CSS.formatRGBA(a),l=r?fe.Format.CSS.formatHSL(a):fe.Format.CSS.formatHSLA(a),d=r?fe.Format.CSS.formatHex(a):fe.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:l,textEdit:{range:s,text:l}}),h.push({label:d,textEdit:{range:s,text:d}}),h}}let OSe=class extends ${constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new bFe(e,t)))}};OSe=D([_(0,Ai),_(1,lo),_(2,ht)],OSe);KQ(OSe);async function Rit(n,e,t,i=!0){return CFe(new v2t,n,e,t,i)}function Mit(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class v2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)}}class w2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class b2t{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const o=await e.provideColorPresentations(t,this.colorInfo,qe.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)}}async function CFe(n,e,t,i,s){let o=!1,r;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof bFe)r=d;else try{await n.compute(d,t,i,a)&&(o=!0)}catch(h){er(h)}}return o?a:r&&s?(await n.compute(r,t,i,a),a):[]}function Nit(n,e){const{colorProvider:t}=n.get(ht),i=n.get(Ai).getModel(e);if(!i)throw Hi();const s=n.get(Re).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}yt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof P))throw Hi();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=Nit(n,t);return CFe(new w2t,s,i,qe.None,o)});yt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof P)||!Array.isArray(t)||t.length!==4||!O.isIRange(o))throw Hi();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=Nit(n,s),[l,d,h,u]=t;return CFe(new b2t({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,qe.None,c)});var BSe;const Pit=Object.create({});var C0;let LV=(C0=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Z),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new PZ(this._editor),this._decoratorLimitReporter=new C2t,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:BSe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(x.colorDecoratorsLimit),c=o.hasChanged(x.defaultColorDecorators);(a||c)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(x.colorDecorators)}get limitReporter(){return this._decoratorLimitReporter}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new O_,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=na(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ao(!1),s=await Rit(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){bt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:jt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},BSe=C0,C0.ID="editor.contrib.colorDetector",C0.RECOMPUTE_TIME=1e3,C0);LV=BSe=D([_(1,Re),_(2,ht),_(3,B_)],LV);class C2t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}vn(LV.ID,LV,mi.AfterFirstRender);class y2t{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new I,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new I,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=r.getColor(MZ)||fe.white})),this._register(pe(this._pickedColorNode,xe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(pe(this._originalColorNode,xe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new E2t(this._domNode)))}get domNode(){return this._domNode}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class E2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),he(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),he(this._button,t),he(t,am(".button"+$e.asCSSSelector(ji("color-picker-close",Ce.close,g(Fit,1,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}}class x2t extends ${constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=am(".colorpicker-body"),he(e,this._domNode),this._saturationBox=new D2t(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new k2t(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new I2t(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new L2t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new fe(new Ky(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new fe(new Ky(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new fe(new Ky(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get opacityStrip(){return this._opacityStrip}get hueStrip(){return this._hueStrip}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class D2t extends ${constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._domNode=am(".saturation-wrap"),he(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",he(this._domNode,this._canvas),this.selection=am(".saturation-selection"),he(this._domNode,this.selection),this.layout(),this._register(pe(this._domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}get canvas(){return this._canvas}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new vz);const t=ia(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new fe(new Ky(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=fe.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Oit extends ${constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=he(e,am(".standalone-strip")),this.overlay=he(this.domNode,am(".standalone-overlay"))):(this.domNode=he(e,am(".strip")),this.overlay=he(this.domNode,am(".overlay"))),this.slider=he(this.domNode,am(".slider")),this.slider.style.top="0px",this._register(pe(this.domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new vz),i=ia(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class k2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new fe(new gn(t,i,s,1)),r=new fe(new gn(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class I2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class L2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=he(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const nce=class nce extends wg{constructor(e,t,i,s,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(B9.getInstance(gt(e)).onDidChange(()=>this.layout()));const r=am(".colorpicker-widget");e.appendChild(r),this.header=this._register(new A2t(r,this.model,s,o)),this.body=this._register(new x2t(r,this.model,this.pixelRatio,o))}getId(){return nce.ID}layout(){this.body.layout()}};nce.ID="editor.contrib.colorPickerWidget";let WSe=nce;class T2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let fie=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return tg.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const s=LV.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[await Bit(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}};fie=D([_(1,pn)],fie);class R2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let s6=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!LV.get(this._editor))return null;const o=await Rit(i,this._editor.getModel(),qe.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;O.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await Bit(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new O(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await WJ(this._editor.getModel(),t,this._color,i,e),i=Hit(this._editor,i,t))}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};s6=D([_(1,pn)],s6);async function Bit(n,e,t,i){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new gn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new fe(l),h=await Mit(e,t,i,qe.None),u=new y2t(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,s),n instanceof fie?new T2t(n,O.lift(t.range),u,i):new R2t(n,O.lift(t.range),u,i)}function Wit(n,e,t,i,s){if(i.length===0||!e.hasModel())return $.None;if(s.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;s.setMinimumDimensions(new Tn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new WSe(s.fragment,c,e.getOption(x.pixelRatio),t,n instanceof s6));s.setColorPicker(l);let d=!1,h=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(n instanceof s6){const u=i[0].model.color;n.color=u,WJ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{n.color=f}))}else o.add(c.onColorFlushed(async u=>{await WJ(a,c,u,h,r),d=!0,h=Hit(e,h,c)}));return o.add(c.onDidChangeColor(u=>{WJ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(s.hide(),e.focus())})),o}function Hit(n,e,t){const i=[],s=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(s),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=O.lift(s.range),r=n.getModel()._setTrackedRange(null,o,gi.GrowsOnlyWhenTypingAfter);return n.executeEdits("colorpicker",i),n.pushUndoStop(),n.getModel()._getTrackedRange(r)??o}async function WJ(n,e,t,i,s){const o=await Mit(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,qe.None);e.colorPresentations=o||[]}const sce=class sce extends ${constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(x.colorDecoratorsActivatedOn);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==Mt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==Pit||!i.range)return;const s=this._editor.getContribution(Nc.ID);if(s&&!s.isColorPickerVisible){const o=new O(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(o,KS.Immediate,Vx.Mouse,!1,!0)}}};sce.ID="editor.contrib.colorContribution",sce.RECOMPUTE_TIME=1e3;let pie=sce;vn(pie.ID,pie,mi.BeforeFirstInteraction);hL.register(fie);var HSe,USe,FN;let kF=(FN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=X.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=X.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new VSe(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(HSe.ID)}},HSe=FN,FN.ID="editor.contrib.standaloneColorPickerController",FN);kF=HSe=D([_(1,Pe),_(2,Ai),_(3,ti),_(4,be),_(5,ht),_(6,lo)],kF);vn(kF.ID,kF,mi.AfterFirstRender);const nze=8,M2t=22;var ON;let VSe=(ON=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=c,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(s6,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Dd(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const f=u.target.element?.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return USe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(x.hover).above;return{position:this._position,secondaryPosition:this._position,preference:e?[hs.ABOVE,hs.BELOW]:[hs.BELOW,hs.ABOVE],positionAffinity:jo.None}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new N2t(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new bFe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new jte(this._keybindingService));let o;const r={fragment:i,statusBar:s,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,c=a.saturationBox.domNode.clientWidth,l=a.domNode.clientWidth-c-M2t-nze,d=o.body.enterButton;d?.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,u=h.pickedColorNode;u.style.width=c+nze+"px";const f=h.originalColorNode;f.style.width=l+"px",o.header.closeButton?.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},USe=ON,ON.ID="editor.contrib.standaloneColorPickerWidget",ON);VSe=USe=D([_(3,be),_(4,Ai),_(5,ti),_(6,ht),_(7,lo)],VSe);class N2t{constructor(e,t){this.value=e,this.foundInEditor=t}}const yM="vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions";class P2t extends wf{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Be(yM,0,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(yM,1,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Te.CommandPalette}],metadata:{description:Be(yM,2,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){kF.get(t)?.showOrFocus()}}class F2t extends lt{constructor(){super({id:"editor.action.hideColorPicker",label:g(yM,3,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:X.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:E.Escape,weight:ye.EditorContrib},metadata:{description:Be(yM,4,"Hide the standalone color picker.")}})}run(e,t){kF.get(t)?.hide()}}class O2t extends lt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(yM,5,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:X.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:E.Enter,weight:ye.EditorContrib},metadata:{description:Be(yM,6,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){kF.get(t)?.insertColor()}}Fe(F2t);Fe(O2t);At(P2t);class uI{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=q.A&&a<=q.Z&&a+32===c)&&!(c>=q.A&&c<=q.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(l);let f=h.lastIndexOf(t,c-1+t.length),p=u.indexOf(i,d-1-i.length);if(f!==-1&&p!==-1)if(a===l)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),w=u.substring(0,p);(v.indexOf(i)>=0||w.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(s&&f+t.length0&&u.charCodeAt(p-1)===q.Space&&(i=" "+i,p-=1),m=uI._createRemoveBlockCommentOperations(new O(a,f+t.length+1,l,p+1),t,i)):(m=uI._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return O.isEmpty(e)?s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ds.delete(new O(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return O.isEmpty(e)?o.push(ds.replace(new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ds.insert(new oe(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ds.insert(new oe(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new mt(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new mt(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}var Dy;(function(n){n[n.Toggle=0]="Toggle",n[n.ForceAdd=1]="ForceAdd",n[n.ForceRemove=2]="ForceRemove"})(Dy||(Dy={}));class kA{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lo?t[c].commentStrOffset=r-1:t[c].commentStrOffset=r}}}const TV="vs/editor/contrib/comment/browser/comment";class yFe extends lt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(lo);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>O.compareRangesUsingStarts(d.selection,h.selection));let l=c[0];for(let d=1;d{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new vpe(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new wpe(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new wpe(new vpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new wpe(new vpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};oce.ID="editor.contrib.cursorUndoRedoController";let RV=oce;class V2t extends lt{constructor(){super({id:"cursorUndo",label:g(Uit,0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyU,weight:ye.EditorContrib}})}run(e,t,i){RV.get(t)?.cursorUndo()}}class z2t extends lt{constructor(){super({id:"cursorRedo",label:g(Uit,1,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){RV.get(t)?.cursorRedo()}}vn(RV.ID,RV,mi.Eager);Fe(V2t);Fe(z2t);var $2t=".monaco-editor.hc-light .dnd-target,.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}";Ct($2t,{});class G2t{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new O(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new mt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new mt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!0),this._mouseDown&&XO(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===BA.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}XO(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new oe(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new mt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new mt(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",Wi.Explicit)}else(!this._dragSelection.containsPosition(t)||(XO(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(BA.ID,new G2t(this._dragSelection,t,XO(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:BA._DECORATION_OPTIONS}]),this._editor.revealPosition(e,vt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Mt.CONTENT_TEXT||e.type===Mt.CONTENT_EMPTY}_hitMargin(e){return e.type===Mt.GUTTER_GLYPH_MARGIN||e.type===Mt.GUTTER_LINE_NUMBERS||e.type===Mt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};BA.ID="editor.contrib.dragAndDrop",BA.TRIGGER_KEY_VALUE=ei?E.Alt:E.Ctrl,BA._DECORATION_OPTIONS=jt.register({description:"dnd-target",className:"dnd-target"});let mie=BA;vn(mie.ID,mie,mi.BeforeFirstInteraction);const zSe="vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution";vn(jS.ID,jS,mi.Eager);KQ(Wye);Ke(new class extends Yc{constructor(){super({id:ktt,precondition:oFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e){return jS.get(e)?.changePasteType()}});Ke(new class extends Yc{constructor(){super({id:"editor.hidePasteWidget",precondition:oFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e){jS.get(e)?.clearWidgets()}});var BN;Fe((BN=class extends lt{constructor(){super({id:"editor.action.pasteAs",label:g(zSe,1,"Paste As..."),alias:"Paste As...",precondition:X.writable,metadata:{description:"Paste as",args:[{name:"args",schema:BN.argsSchema}]}})}run(e,t,i){let s=typeof i?.kind=="string"?i.kind:void 0;return!s&&i&&(s=typeof i.id=="string"?i.id:void 0),jS.get(t)?.pasteAs(s?new bs(s):void 0)}},BN.argsSchema={type:"object",properties:{kind:{type:"string",description:g(zSe,0,"The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},BN));Fe(class extends lt{constructor(){super({id:"editor.action.pasteAsText",label:g(zSe,2,"Paste as Text"),alias:"Paste as Text",precondition:X.writable})}run(n,e){return jS.get(e)?.pasteAs({providerId:CF.id})}});const q2t="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution";vn(EF.ID,EF,mi.BeforeFirstInteraction);KQ(Bye);Ke(new class extends Yc{constructor(){super({id:Wtt,precondition:dFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e,t){EF.get(e)?.changeDropType()}});Ke(new class extends Yc{constructor(){super({id:"editor.hideDropWidget",precondition:dFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e,t){EF.get(e)?.clearWidgets()}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[Btt]:{type:"object",scope:ut.LANGUAGE_OVERRIDABLE,description:g(q2t,0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const su=class su{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,su._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,su._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new O(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,su._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=su._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=su._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),l=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/l));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,p=e.length;f=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,c=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,su._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rO.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function sze(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function oze(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=Vit([s[a]],r)+t}),o.slice(0,-1)}var MV;(function(n){n[n.StaticValue=0]="StaticValue",n[n.DynamicPieces=1]="DynamicPieces"})(MV||(MV={}));class rze{constructor(e){this.staticValue=e,this.kind=MV.StaticValue}}class j2t{constructor(e){this.pieces=e,this.kind=MV.DynamicPieces}}class NV{static fromStaticValue(e){return new NV([BI.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===MV.DynamicPieces}constructor(e){!e||e.length===0?this._state=new rze(""):e.length===1&&e[0].staticValue!==null?this._state=new rze(e[0].staticValue):this._state=new j2t(e)}buildReplaceString(e,t){if(this._state.kind===MV.StaticValue)return t?Vit(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const c=[],l=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(r.caseOps[d]){case"U":c.push(a[h].toUpperCase());break;case"u":c.push(a[h].toUpperCase()),d++;break;case"L":c.push(a[h].toLowerCase());break;case"l":c.push(a[h].toLowerCase()),d++;break;default:c.push(a[h])}}a=c.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case q.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case q.n:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case q.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case q.u:case q.U:case q.l:case q.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===q.DollarSign){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===q.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===q.Digit0||r===q.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(q.Digit1<=r&&r<=q.Digit9){let a=r-q.Digit0;if(i+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Wi.Explicit||i.reason===Wi.Undo||i.reason===Wi.Redo)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,St(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},J2t)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let c=a.endLineNumber;return a.endColumn===1&&(c=c-1),new O(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const s=this._findMatches(i,!1,gI);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=bU(s.map(c=>c.range),c=>O.compareRangesUsingStarts(c,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(x.find).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new oe(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new oe(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()Z$._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=gI?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new UA(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const s=this._editor.getModel(),o=s.getValue(xo.LF),r=s.getFullModelRange(),a=this._getReplacePattern();let c;const l=this._state.preserveCase;a.hasReplacementPatterns||l?c=o.replace(i,function(){return a.buildReplaceString(arguments,l)}):c=o.replace(i,a.buildReplaceString(null,l));const d=new FMe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Zn.MAX_SAFE_SMALL_INTEGER),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Zn.MAX_SAFE_SMALL_INTEGER).map(o=>new mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe),inputActiveOptionBackground:Ye(hR)},o=this._register(C1());this.caseSensitive=this._register(new hXe({appendTitle:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new uXe({appendTitle:this._keybindingLabelFor(cr.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new gXe({appendTitle:this._keybindingLabelFor(cr.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(pe(this._domNode,xe.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(pe(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return rce.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.TOP_RIGHT_CORNER}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};rce.ID="editor.contrib.findOptionsWidget";let GSe=rce;var pu;(function(n){n[n.NotSet=0]="NotSet",n[n.True=1]="True",n[n.False=2]="False"})(pu||(pu={}));function zK(n,e){return n===pu.True?!0:n===pu.False?!1:e}class Z2t extends ${get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return zK(this._isRegexOverride,this._isRegex)}get wholeWord(){return zK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return zK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return zK(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}get isSearching(){return this._isSearching}get filters(){return this._filters}constructor(){super(),this._onFindReplaceStateChange=this._register(new I),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=pu.NotSet,this._wholeWord=!1,this._wholeWordOverride=pu.NotSet,this._matchCase=!1,this._matchCaseOverride=pu.NotSet,this._preserveCase=!1,this._preserveCaseOverride=pu.NotSet,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(O.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,c=this.matchCase,l=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!O.equalsRange(h,d)))||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:pu.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:pu.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:pu.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:pu.NotSet,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),c!==this.matchCase&&(o=!0,s.matchCase=!0),l!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=gI}}var eWt=".monaco-editor .find-widget{background-color:var(--vscode-editorWidget-background);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);box-sizing:border-box;color:var(--vscode-editorWidget-foreground);height:33px;line-height:19px;overflow:hidden;padding:0 4px;position:absolute;transform:translateY(calc(-100% - 10px));transition:transform .2s linear;z-index:35}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-color:var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{display:flex;font-size:12px;margin:3px 25px 0 17px}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-bottom:2px;padding-top:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{align-items:center;display:flex;height:25px}.monaco-editor .find-widget .monaco-findInput{display:flex;flex:1;vertical-align:middle}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{box-sizing:border-box;display:flex;flex:initial;height:25px;line-height:23px;margin:0 0 0 3px;padding:2px 0 0 2px;text-align:center;vertical-align:middle}.monaco-editor .find-widget .button{align-items:center;background-position:50%;background-repeat:no-repeat;border-radius:5px;cursor:pointer;display:flex;flex:initial;height:16px;justify-content:center;margin-left:3px;padding:3px;width:16px}.monaco-editor .find-widget .codicon-find-selection{border-radius:5px;height:22px;padding:3px;width:22px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{padding:1px 6px;top:-1px;width:auto}.monaco-editor .find-widget .button.toggle{border-radius:0;box-sizing:border-box;height:100%;left:3px;position:absolute;top:0;width:18px}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{display:flex;flex:auto;flex-grow:0;flex-shrink:0;position:relative;vertical-align:middle}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);box-sizing:border-box;padding:1px}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}.monaco-editor.hc-black .find-widget .button:before{left:2px;position:relative;top:1px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;right:4px;top:5px}";Ct(eWt,{});function qSe(n){return n.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&n.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const gc="vs/editor/contrib/find/browser/findWidget",aze=ji("find-collapsed",Ce.chevronRight,g(gc,0,"Icon to indicate that the editor find widget is collapsed.")),cze=ji("find-expanded",Ce.chevronDown,g(gc,1,"Icon to indicate that the editor find widget is expanded.")),tWt=ji("find-selection",Ce.selection,g(gc,2,"Icon for 'Find in Selection' in the editor find widget.")),iWt=ji("find-replace",Ce.replace,g(gc,3,"Icon for 'Replace' in the editor find widget.")),nWt=ji("find-replace-all",Ce.replaceAll,g(gc,4,"Icon for 'Replace All' in the editor find widget.")),sWt=ji("find-previous-match",Ce.arrowUp,g(gc,5,"Icon for 'Find Previous' in the editor find widget.")),oWt=ji("find-next-match",Ce.arrowDown,g(gc,6,"Icon for 'Find Next' in the editor find widget.")),rWt=g(gc,7,"Find / Replace"),aWt=g(gc,8,"Find"),cWt=g(gc,9,"Find"),lWt=g(gc,10,"Previous Match"),dWt=g(gc,11,"Next Match"),hWt=g(gc,12,"Find in Selection"),uWt=g(gc,13,"Close"),gWt=g(gc,14,"Replace"),fWt=g(gc,15,"Replace"),pWt=g(gc,16,"Replace"),mWt=g(gc,17,"Replace All"),_Wt=g(gc,18,"Toggle Replace"),vWt=g(gc,19,"Only the first {0} results are highlighted, but all find operations work on the entire text.",gI),wWt=g(gc,20,"{0} of {1}"),lze=g(gc,21,"No results"),yC=419,bWt=275,CWt=bWt-54;let E5=69;const yWt=33,dze="ctrlEnterReplaceAll.windows.donotask",hze=ei?V.WinCtrl:V.CtrlCmd;class bpe{constructor(e){this.afterLineNumber=e,this.heightInPx=yWt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function uze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function gze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(x.readOnly)&&(this._codeEditor.getOption(x.readOnly)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(x.layoutInfo)&&this._tryUpdateWidgetWidth(),h.hasChanged(x.accessibilitySupport)&&this.updateAccessibilitySupport(),h.hasChanged(x.find)){const u=this._codeEditor.getOption(x.find).loop;this._state.change({loop:u},!1);const f=this._codeEditor.getOption(x.find).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new bpe(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const h=await this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}})),this._findInputFocused=Ahe.bindTo(r),this._findFocusTracker=this._register(Dd(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=SFe.bindTo(r),this._replaceFocusTracker=this._register(Dd(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(x.find).addExtraSpaceOnTop&&(this._viewZone=new bpe(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return ace.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Yf.TOP_RIGHT_CORNER}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(x.readOnly)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=du(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,bt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=E5+"px",this._state.matchesCount>=gI?this._matchesCount.title=vWt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=gI&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=r_(wWt,i,t)}else e=lze;this._matchesCount.appendChild(document.createTextNode(e)),sa(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),E5=Math.max(E5,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===lze)return i===""?g(gc,22,"{0} found",e):g(gc,23,"{0} found for '{1}'",e,i);if(t){const s=g(gc,24,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return g(gc,25,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(x.readOnly);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(x.find).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(x.find).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=ia(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=bZ(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(l?l.left:0)>c&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(x.find).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(x.find).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new bpe(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(x.padding).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&du(this._domNode)>yC){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=du(this._findInput.domNode);return}if(yC+28+s>=i&&(r=!0),yC+28+s-E5>=i&&(a=!0),yC+28+s-E5>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!O.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(E.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Is&&rf&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(gc,26,"Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(dze,!0,ke.PROFILE,ln.USER)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(E.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.Shift|E.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new wye(null,this._contextViewProvider,{width:CWt,label:aWt,placeholder:cWt,appendCaseSensitiveLabel:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(cr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(cr.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>qSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(V.Shift|E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),jr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(C1());this._prevBtn=this._register(new ZO({label:lWt+this._keybindingLabelFor(cr.PreviousMatchFindAction),icon:sWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.PreviousMatchFindAction)).run().then(void 0,bt)}},this._hoverService)),this._nextBtn=this._register(new ZO({label:dWt+this._keybindingLabelFor(cr.NextMatchFindAction),icon:oWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.NextMatchFindAction)).run().then(void 0,bt)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",s.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new iD({icon:tWt,title:hWt+this._keybindingLabelFor(cr.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:Ye(hR),inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new ZO({label:uWt+this._keybindingLabelFor(cr.CloseFindWidgetCommand),icon:VXe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new bye(null,void 0,{label:gWt,placeholder:fWt,appendPreserveCaseLabel:this._keybindingLabelFor(cr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>qSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(d=>this._onReplaceInputKeyDown(d))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(d=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(d=>{d.equals(E.Tab)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),d.preventDefault())}));const r=this._register(C1());this._replaceBtn=this._register(new ZO({label:pWt+this._keybindingLabelFor(cr.ReplaceOneAction),icon:iWt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(V.Shift|E.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new ZO({label:mWt+this._keybindingLabelFor(cr.ReplaceAllAction),icon:nWt,hoverDelegate:r,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",a.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new ZO({label:_Wt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=rWt,this._domNode.role="dialog",this._domNode.style.width=`${yC}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Lh(this._domNode,this,{orientation:vi.VERTICAL,size:2})),this._resized=!1;let l=yC;this._register(this._resizeSash.onDidStart(()=>{l=du(this._domNode)})),this._register(this._resizeSash.onDidChange(d=>{this._resized=!0;const h=l+d.startX-d.currentX;if(hu||(this._domNode.style.width=`${h}px`,this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=du(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};ace.ID="editor.contrib.findWidget";let QSe=ace;class ZO extends wg{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+$e.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupUpdatableHover(e.hoverDelegate??va("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,s=>{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{if(s.equals(E.Space)||s.equals(E.Enter)){this._opts.onTrigger(),s.preventDefault();return}this._opts.onKeyDown?.(s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...$e.asClassNameArray(aze)),this._domNode.classList.add(...$e.asClassNameArray(cze))):(this._domNode.classList.remove(...$e.asClassNameArray(cze)),this._domNode.classList.add(...$e.asClassNameArray(aze)))}}Im((n,e)=>{const t=n.getColor(Uk);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${pS(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(Dmt);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${pS(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(ft);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const o=n.getColor(Emt);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=n.getColor(xmt);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var jSe;const Zg="vs/editor/contrib/find/browser/findController",SWt=524288;function KSe(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(x.find).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,ke.WORKSPACE,ln.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,ke.WORKSPACE,ln.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,ke.WORKSPACE,ln.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,ke.WORKSPACE,ln.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Ahe.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Iu(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=KSe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Iu(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=KSe(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new Z$(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(g(Zg,0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},jSe=WN,WN.ID="editor.contrib.findController",WN);vf=jSe=D([_(1,Pe),_(2,sn),_(3,Mu),_(4,Pi),_(5,Zc)],vf);let YSe=class extends vf{constructor(e,t,i,s,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===bw.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===bw.FocusFindInput&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new QSe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new GSe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};YSe=D([_(1,W_),_(2,Pe),_(3,ti),_(4,pn),_(5,Pi),_(6,sn),_(7,Mu),_(8,Zc)],YSe);const AWt=Sje(new yje({id:cr.StartFindAction,label:g(Zg,1,"Find"),alias:"Find",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyF,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,2,"&&Find"),order:1}}));AWt.addImplementation(0,(n,e,t)=>{const i=vf.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).globalFindClipboard,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const EWt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class xWt extends lt{constructor(){super({id:cr.StartFindWithArgs,label:g(Zg,3,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:ye.EditorContrib},metadata:EWt})}async run(e,t,i){const s=vf.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}}}class DWt extends lt{constructor(){super({id:cr.StartFindWithSelection,label:g(Zg,4,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:V.CtrlCmd|E.KeyE},weight:ye.EditorContrib}})}async run(e,t){const i=vf.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class zit extends lt{async run(e,t){const i=vf.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class kWt extends zit{constructor(){super({id:cr.NextMatchFindAction,label:g(Zg,5,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:E.F3,mac:{primary:V.CtrlCmd|E.KeyG,secondary:[E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class IWt extends zit{constructor(){super({id:cr.PreviousMatchFindAction,label:g(Zg,6,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:V.Shift|E.F3,mac:{primary:V.CtrlCmd|V.Shift|E.KeyG,secondary:[V.Shift|E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:V.Shift|E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class LWt extends lt{constructor(){super({id:cr.GoToMatchFindAction,label:g(Zg,7,"Go to Match..."),alias:"Go to Match...",precondition:cD}),this._highlightDecorations=[]}run(e,t,i){const s=vf.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Pi).notify({severity:nt.Warning,message:g(Zg,8,"No matches. Try searching for something else.")});return}const a=e.get(On).createInputBox();a.placeholder=g(Zg,9,"Type a number to go to a specific match (between 1 and {0})",o);const c=d=>{const h=parseInt(d);if(isNaN(h))return;const u=s.getState().matchesCount;if(h>0&&h<=u)return h-1;if(h<0&&h>=-u)return u+h},l=d=>{const h=c(d);if(typeof h=="number"){a.validationMessage=void 0,s.goToMatch(h);const u=s.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}])})}}class $it extends lt{async run(e,t){const i=vf.get(t);if(!i)return;const s=KSe(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class TWt extends $it{constructor(){super({id:cr.NextSelectionMatchFindAction,label:g(Zg,11,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class RWt extends $it{constructor(){super({id:cr.PreviousSelectionMatchFindAction,label:g(Zg,12,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const MWt=Sje(new yje({id:cr.StartFindReplaceAction,label:g(Zg,13,"Replace"),alias:"Replace",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyH,mac:{primary:V.CtrlCmd|V.Alt|E.KeyF},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,14,"&&Replace"),order:2}}));MWt.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=vf.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?bw.FocusReplaceInput:bw.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop})});vn(vf.ID,YSe,mi.Eager);Fe(xWt);Fe(DWt);Fe(kWt);Fe(IWt);Fe(LWt);Fe(TWt);Fe(RWt);const mC=Yc.bindToContribution(vf.get);Ke(new mC({id:cr.CloseFindWidgetCommand,precondition:cD,handler:n=>n.closeFindWidget(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new mC({id:cr.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:BK.primary,mac:BK.mac,win:BK.win,linux:BK.linux}}));Ke(new mC({id:cr.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:WK.primary,mac:WK.mac,win:WK.win,linux:WK.linux}}));Ke(new mC({id:cr.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:HK.primary,mac:HK.mac,win:HK.win,linux:HK.linux}}));Ke(new mC({id:cr.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:UK.primary,mac:UK.mac,win:UK.win,linux:UK.linux}}));Ke(new mC({id:cr.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:VK.primary,mac:VK.mac,win:VK.win,linux:VK.linux}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.Digit1}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,SFe),primary:E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Alt|E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,SFe),primary:void 0,mac:{primary:V.CtrlCmd|E.Enter}}}));Ke(new mC({id:cr.SelectAllMatchesAction,precondition:cD,handler:n=>n.selectAllMatches(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.Alt|E.Enter}}));const AFe="vs/editor/contrib/fontZoom/browser/fontZoom";class NWt extends lt{constructor(){super({id:"editor.action.fontZoomIn",label:g(AFe,0,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(l_.getZoomLevel()+1)}}class PWt extends lt{constructor(){super({id:"editor.action.fontZoomOut",label:g(AFe,1,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(l_.getZoomLevel()-1)}}class FWt extends lt{constructor(){super({id:"editor.action.fontZoomReset",label:g(AFe,2,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(0)}}Fe(NWt);Fe(PWt);Fe(FWt);const Git="vs/editor/contrib/format/browser/formatActions";var NH;let _ie=(NH=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new Z,this._sessionDisposables=new Z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(x.formatOnType)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(x.formatOnType)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new EZ;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new ai,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{s.token.isCancellationRequested||mo(r)&&(this._accessibilitySignalService.playSignal(Zl.format,{userGesture:!1}),hV.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},NH.ID="editor.contrib.autoFormat",NH);_ie=D([_(1,ht),_(2,kd),_(3,Lw)],_ie);var PH;let vie=(PH=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Z,this._callOnModel=new Z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(x.formatOnPaste)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Ude,this.editor,e,S_.Silent,cf.None,qe.None,!1).catch(bt))}},PH.ID="editor.contrib.formatOnPaste",PH);vie=D([_(1,ht),_(2,be)],vie);class OWt extends lt{constructor(){super({id:"editor.action.formatDocument",label:g(Git,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.notInCompositeEditor,X.writable,X.hasDocumentFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(be);await e.get(eD).showWhile(i.invokeFunction(BCe,t,S_.Explicit,cf.None,qe.None,!0),250)}}}class BWt extends lt{constructor(){super({id:"editor.action.formatSelection",label:g(Git,1,"Format Selection"),alias:"Format Selection",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyF),weight:ye.EditorContrib},contextMenuOpts:{when:X.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new O(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(eD).showWhile(i.invokeFunction(Ude,t,o,S_.Explicit,cf.None,qe.None,!0),250)}}vn(_ie.ID,_ie,mi.BeforeFirstInteraction);vn(vie.ID,vie,mi.BeforeFirstInteraction);Fe(OWt);Fe(BWt);yt.registerCommand("editor.action.format",async n=>{const e=n.get(Qt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(Qi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class ky{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static getElementById(e,t){if(!e)return;const i=LS(e,t.id);if(i===e.length)return t;if(!(i0&&O.areIntersecting(e[s-1],t.symbol.range)&&(s-=1)):s=i;const o=[];let r;for(;sr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),iF(e)}}class oy extends ky{static create(e,t,i){const s=new ai(i),o=new oy(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=ky.findId(`provider_${d}`,o),u=new XSe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,s.token)).then(f=>{for(const p of f||[])oy._makeOutlineElement(p,u);return u},f=>(er(f),u)).then(f=>{ky.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);Ls(l,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?oy.create(e,t,i):o._compact()).finally(()=>{s.dispose(),c.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=ky.findId(e,t),s=new JSe(i,t,e);if(e.children)for(const o of e.children)oy._makeOutlineElement(o,s);t.children.set(s.id,s)}static get(e){for(;e;){if(e instanceof oy)return e;e=e.parent}}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=fi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}merge(e){return this.uri.toString()!==e.uri.toString()||this._groups.size!==e._groups.size?!1:(this._groups=e._groups,this.children=e.children,!0)}getItemEnclosingPosition(e,t){let i;if(t){let o=t.parent;for(;o&&!i;)o instanceof XSe&&(i=o),o=o.parent}let s;for(const[,o]of this._groups)if(s=o.getItemEnclosingPosition(e),s&&(!i||i===o))break;return s}getItemById(e){return ky.getElementById(e,this)}updateMarker(e){e.sort(O.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof JSe?e.push(t.symbol):e.push(...fi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>O.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return oy._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>oe.compare(O.getStartPosition(i.range),O.getStartPosition(s.range))||oe.compare(O.getEndPosition(s.range),O.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&oy._flattenDocumentSymbols(e,s.children,s.name)}}const JQ=ae("IOutlineModelService");let ZSe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new L_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ls(o.provider,s)){const a=new ai;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:oy.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const c=Date.now();o.promise.then(l=>{o.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};ZSe=D([_(0,ht),_(1,B_),_(2,Ai)],ZSe);ce(JQ,ZSe,Kt.Delayed);yt.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;Bt(P.isUri(t));const i=n.get(JQ),o=await n.get(Rn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,qe.None)).getTopLevelSymbols()}finally{o.dispose()}});const aC="vs/editor/contrib/inlineCompletions/browser/commands",cce=class cce extends lt{constructor(){super({id:cce.ID,label:g(aC,0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketRight}})}async run(e,t){_g.get(t)?.model.get()?.next()}};cce.ID=Ket;let eAe=cce;const lce=class lce extends lt{constructor(){super({id:lce.ID,label:g(aC,1,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketLeft}})}async run(e,t){_g.get(t)?.model.get()?.previous()}};lce.ID=jet;let tAe=lce;class WWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(aC,2,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:X.writable})}async run(e,t){const i=_g.get(t);await Hxt(async s=>{await i?.model.get()?.triggerExplicitly(s),i?.playAccessibilitySignal(s)})}}class HWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(aC,3,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|E.RightArrow,kbExpr:ge.and(X.writable,af.inlineSuggestionVisible)},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,4,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class UWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(aC,5,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,6,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class VWt extends lt{constructor(){super({id:Qet,label:g(aC,7,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:af.inlineSuggestionVisible,menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,8,"Accept"),group:"primary",order:1}],kbOpts:{primary:E.Tab,weight:200,kbExpr:ge.and(af.inlineSuggestionVisible,X.tabMovesFocus.toNegated(),af.inlineSuggestionHasIndentationLessThanTabSize,Gi.Visible.toNegated(),X.hoverFocused.toNegated())}})}async run(e,t){const i=_g.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const dce=class dce extends lt{constructor(){super({id:dce.ID,label:g(aC,9,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:af.inlineSuggestionVisible,kbOpts:{weight:100,primary:E.Escape}})}async run(e,t){const i=_g.get(t);En(s=>{i?.model.get()?.stop(s)})}};dce.ID="editor.action.inlineSuggest.hide";let iAe=dce;const hce=class hce extends pi{constructor(){super({id:hce.ID,title:g(aC,10,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Te.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ge.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Re),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};hce.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let nAe=hce;const zWt="vs/editor/contrib/inlineCompletions/browser/hoverParticipant";class $Wt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let sAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=_g.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new bM(1e3,this,O.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineSuggest).showToolbar!=="onHover")return[];const i=_g.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new $Wt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.renderScreenReaderText(e,s,i);const o=s.controller.model.get(),r=this._instantiationService.createInstance(vV,this._editor,!1,Au(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands);return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const s=we,o=s("div.hover-row.markdown-hover"),r=he(o,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new vw({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(zWt,0,"Suggestion:"),h=i.add(a.render(new Xt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};i.add(Ni(l=>{const d=t.controller.model.read(l)?.primaryGhostText.read(l);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);c(d.renderForScreenReader(h))}else _a(r)})),e.fragment.appendChild(o)}};sAe=D([_(1,Di),_(2,fr),_(3,Ur),_(4,be),_(5,on)],sAe);class GWt extends ${getProvider(e){const t=e.get(Qt);function i(){const s=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!s)return;const o=_g.get(s)?.model.get(),r=o?.state.get();if(!o||!r)return;const a=o.textModel.getLineContent(r.primaryGhostText.lineNumber),c=r.primaryGhostText.renderForScreenReader(a);if(!c)return;const l=s.getModel()?.getLanguageId()??void 0;return{id:rC.InlineCompletions,verbositySettingKey:"accessibility.verbosity.inlineCompletions",provideContent(){return a+c},onClose(){o.stop(),s.focus()},next(){o.next(),setTimeout(()=>i(),50)},previous(){o.previous(),setTimeout(()=>i(),50)},options:{language:l,type:N_.View}}}return i()}constructor(){super(),this.type=N_.View,this.priority=95,this.name="inline-completions",this.when=ge.and(af.inlineSuggestionVisible)}}vn(_g.ID,_g,mi.Eventually);Fe(WWt);Fe(eAe);Fe(tAe);Fe(HWt);Fe(UWt);Fe(VWt);Fe(iAe);At(nAe);hL.register(sAe);NQ.register(new GWt);var qWt=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";Ct(qWt,{});var R3;const QWt="vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition";var y0;let IF=(y0=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new Z,this.toUnhookForKeyboard=new Z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new phe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{bt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(R3.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===Mt.CONTENT_WIDGET&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new Bde(this.editor,hr.Position|hr.Value|hr.Selection|hr.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=na(r=>this.findDefinition(e,r));let s;try{s=await this.previousPromise}catch(r){bt(r);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=s[0].originSelectionRange?O.lift(s[0].originSelectionRange):new O(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let r=o;for(const{originSelectionRange:a}of s)a&&(r=O.plusRange(r,a));this.addDecoration(r,new Xt().appendText(g(QWt,0,"Click to show {0} definitions.",s.length)))}else{const r=s[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=r.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,d?new Xt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=R3.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new qQ({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Pe);return mf.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},R3=y0,y0.ID="editor.contrib.gotodefinitionatposition",y0.MAX_SOURCE_PREVIEW_LINES=8,y0);IF=R3=D([_(1,Rn),_(2,Di),_(3,ht)],IF);vn(IF.ID,IF,mi.BeforeFirstInteraction);class fze{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let oAe=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._dispoables=new Z,this._markers=[],this._nextIdx=-1,P.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=lw(a.resource.toString(),c.resource.toString());return l===0&&(s==="position"?l=O.compareRangesUsingStarts(a,c)||Ys.compare(a.severity,c.severity):l=Ys.compare(a.severity,c.severity)||O.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:P.isUri(e)?e:void 0,severities:Ys.Error|Ys.Warning|Ys.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new fze(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=CU(this._markers,{resource:e.uri},(r,a)=>lw(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;it())}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new oAe(e,this._markerService,this._configService)}};rAe=D([_(0,U_),_(1,Re)],rAe);ce(qit,rAe,Kt.Delayed);var jWt='.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;margin-right:4px;vertical-align:text-top}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{font-style:italic;opacity:.6}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{padding:8px 12px 0 20px;position:absolute;user-select:text;-webkit-user-select:text;white-space:pre}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{color:inherit;opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-activeForeground);text-decoration:underline;text-underline-position:under}.monaco-editor .marker-widget .descriptioncontainer .filename{color:var(--vscode-textLink-activeForeground);cursor:pointer}';Ct(jWt,{});var KWt=".extension-editor .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.markers-panel .marker-icon .codicon.codicon-error,.markers-panel .marker-icon.error,.monaco-editor .zone-widget .codicon.codicon-error,.preferences-editor .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.extension-editor .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.markers-panel .marker-icon .codicon.codicon-warning,.markers-panel .marker-icon.warning,.monaco-editor .zone-widget .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.extension-editor .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.markers-panel .marker-icon .codicon.codicon-info,.markers-panel .marker-icon.info,.monaco-editor .zone-widget .codicon.codicon-info,.preferences-editor .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}";Ct(KWt,{});var aAe;(function(n){function e(t){switch(t){case nt.Ignore:return"severity-ignore "+$e.asClassName(Ce.info);case nt.Info:return $e.asClassName(Ce.info);case nt.Warning:return $e.asClassName(Ce.warning);case nt.Error:return $e.asClassName(Ce.error);default:return""}}n.className=e})(aAe||(aAe={}));var cAe;const cm="vs/editor/contrib/gotoError/browser/gotoErrorWidget";class YWt{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Xo(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new FKe(r,{horizontal:zo.Auto,vertical:zo.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){St(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=xw(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Yo(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const u of a)c=document.createElement("div"),c.innerText=u,u===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),c.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=we("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(o.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=he(this._codeLink,we("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Yo(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),mo(s)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(x.lineHeight)*.66)}px`,this._lines+=1;for(const f of s){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const l=this._editor.getOption(x.fontInfo),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Ys.Error:t=g(cm,0,"Error");break;case Ys.Warning:t=g(cm,1,"Warning");break;case Ys.Info:t=g(cm,2,"Info");break;case Ys.Hint:t=g(cm,3,"Hint");break}let i=g(cm,4,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var HN;let o6=(HN=class extends V7{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ys.Warning,this._backgroundColor=fe.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(eHt);let t=lAe,i=JWt;this._severity===Ys.Warning?(t=HJ,i=XWt):this._severity===Ys.Info&&(t=dAe,i=ZWt);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(VPe),secondaryHeadingColor:e.getColor(zPe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}focus(){this._parentContainer.focus()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(cAe.TitleMenu,this._contextKeyService);tD(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=he(e,we(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new YWt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=O.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(cm,5,"{0} of {1} problems",t,i):g(cm,6,"{0} of {1} problem",t,i);this.setTitle(ui(a.uri),c)}this._icon.className=`codicon ${aAe.className(Ys.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,vt.Smooth),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},cAe=HN,HN.TitleMenu=new Te("gotoErrorTitleMenu"),HN);o6=cAe=D([_(1,pn),_(2,fr),_(3,mc),_(4,be),_(5,Pe),_(6,eo)],o6);const pze=j9(Vh,Cmt),mze=j9(Gc,K9),_ze=j9(qc,Y9),lAe=B("editorMarkerNavigationError.background",{dark:pze,light:pze,hcDark:ft,hcLight:ft},g(cm,7,"Editor marker navigation widget error color.")),JWt=B("editorMarkerNavigationError.headerBackground",{dark:Ie(lAe,.1),light:Ie(lAe,.1),hcDark:null,hcLight:null},g(cm,8,"Editor marker navigation widget error heading background.")),HJ=B("editorMarkerNavigationWarning.background",{dark:mze,light:mze,hcDark:ft,hcLight:ft},g(cm,9,"Editor marker navigation widget warning color.")),XWt=B("editorMarkerNavigationWarning.headerBackground",{dark:Ie(HJ,.1),light:Ie(HJ,.1),hcDark:"#0C141F",hcLight:Ie(HJ,.2)},g(cm,10,"Editor marker navigation widget warning heading background.")),dAe=B("editorMarkerNavigationInfo.background",{dark:_ze,light:_ze,hcDark:ft,hcLight:ft},g(cm,11,"Editor marker navigation widget info color.")),ZWt=B("editorMarkerNavigationInfo.headerBackground",{dark:Ie(dAe,.1),light:Ie(dAe,.1),hcDark:null,hcLight:null},g(cm,12,"Editor marker navigation widget info heading background.")),eHt=B("editorMarkerNavigation.background",{dark:us,light:us,hcDark:us,hcLight:us},g(cm,13,"Editor marker navigation widget background."));var M3;const P1="vs/editor/contrib/gotoError/browser/gotoError";var UN;let LF=(UN=class{static get(e){return e.getContribution(M3.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Qit.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(o6,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!O.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:O.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new oe(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:px.NearTop,selection:i.selected.marker}},this._editor);s&&(M3.get(s)?.close(),M3.get(s)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},M3=UN,UN.ID="editor.contrib.markerController",UN);LF=M3=D([_(1,qit),_(2,Pe),_(3,Qt),_(4,be)],LF);class Ehe extends lt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&LF.get(t)?.nagivate(this._next,this._multiFile)}}const eR=class eR extends Ehe{constructor(){super(!0,!1,{id:eR.ID,label:eR.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:eR.LABEL,icon:ji("marker-navigation-next",Ce.arrowDown,g(P1,1,"Icon for goto next marker.")),group:"navigation",order:1}})}};eR.ID="editor.action.marker.next",eR.LABEL=g(P1,0,"Go to Next Problem (Error, Warning, Info)");let wie=eR;const tR=class tR extends Ehe{constructor(){super(!1,!1,{id:tR.ID,label:tR.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:tR.LABEL,icon:ji("marker-navigation-previous",Ce.arrowUp,g(P1,3,"Icon for goto previous marker.")),group:"navigation",order:2}})}};tR.ID="editor.action.marker.prev",tR.LABEL=g(P1,2,"Go to Previous Problem (Error, Warning, Info)");let hAe=tR;class tHt extends Ehe{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(P1,4,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,5,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class iHt extends Ehe{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(P1,6,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,7,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}vn(LF.ID,LF,mi.Lazy);Fe(wie);Fe(hAe);Fe(tHt);Fe(iHt);const Qit=new Y("markersNavigationVisible",!1),nHt=Yc.bindToContribution(LF.get);Ke(new nHt({id:"closeMarkersNavigation",precondition:Qit,handler:n=>n.close(),kbOpts:{weight:ye.EditorContrib+50,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));const Cl="vs/editor/contrib/hover/browser/hoverActions";var sb;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(sb||(sb={}));class sHt extends lt{constructor(){super({id:Vtt,label:g(Cl,0,"Show or Focus Hover"),metadata:{description:Be(Cl,1,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[sb.NoAutoFocus,sb.FocusIfVisible,sb.AutoFocusImmediately],enumDescriptions:[g(Cl,2,"The hover will not automatically take focus."),g(Cl,3,"The hover will take focus only if it is already visible."),g(Cl,4,"The hover will automatically take focus when it appears.")],default:sb.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyI),weight:ye.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const s=Nc.get(t);if(!s)return;const o=i?.focus;let r=sb.FocusIfVisible;Object.values(sb).includes(o)?r=o:typeof o=="boolean"&&o&&(r=sb.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new O(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(h,KS.Immediate,Vx.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Kd.Enabled;s.isHoverVisible?r!==sb.NoAutoFocus?s.focus():a(c):a(c||r===sb.AutoFocusImmediately)}}class oHt extends lt{constructor(){super({id:JFt,label:g(Cl,5,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Be(Cl,6,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Nc.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new O(s.lineNumber,s.column,s.lineNumber,s.column),r=IF.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,KS.Immediate,Vx.Keyboard,!0)})}}class rHt extends lt{constructor(){super({id:XFt,label:g(Cl,7,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.UpArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,8,"Scroll up the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollUp()}}class aHt extends lt{constructor(){super({id:ZFt,label:g(Cl,9,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.DownArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,10,"Scroll down the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollDown()}}class cHt extends lt{constructor(){super({id:eOt,label:g(Cl,11,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.LeftArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,12,"Scroll left the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollLeft()}}class lHt extends lt{constructor(){super({id:tOt,label:g(Cl,13,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.RightArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,14,"Scroll right the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollRight()}}class dHt extends lt{constructor(){super({id:iOt,label:g(Cl,15,"Page Up Hover"),alias:"Page Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageUp,secondary:[V.Alt|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,16,"Page up the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.pageUp()}}class hHt extends lt{constructor(){super({id:nOt,label:g(Cl,17,"Page Down Hover"),alias:"Page Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageDown,secondary:[V.Alt|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,18,"Page down the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.pageDown()}}class uHt extends lt{constructor(){super({id:sOt,label:g(Cl,19,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.Home,secondary:[V.CtrlCmd|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,20,"Go to the top of the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.goToTop()}}class gHt extends lt{constructor(){super({id:oOt,label:g(Cl,21,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.End,secondary:[V.CtrlCmd|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,22,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.goToBottom()}}class fHt extends lt{constructor(){super({id:VQ,label:aOt,alias:"Increase Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Nc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Increase,i?.index,i?.focus)}}class pHt extends lt{constructor(){super({id:zQ,label:lOt,alias:"Decrease Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Nc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Decrease,i?.index,i?.focus)}}const x5="vs/editor/contrib/hover/browser/markerHoverParticipant",j_=we;class mHt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const vze={type:wu.Invoke,filter:{include:ls.QuickFix},triggerAction:_f.QuickFixHover};let uAe=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const c=a.range.startLineNumber===s?a.range.startColumn:1,l=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new O(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new mHt(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return $.None;const i=new Z;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>Ys.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=j_("div.hover-row");i.tabIndex=0;const s=he(i,j_("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(s);const l=he(s,j_("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const d=j_("span");if(o){const p=he(d,j_("span"));p.innerText=o}const h=he(d,j_("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(pe(h,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const u=he(h,j_("span"));u.innerText=a.value;const f=he(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=he(s,j_("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(mo(c))for(const{message:d,resource:h,startLineNumber:u,startColumn:f}of c){const p=he(s,j_("div"));p.style.marginTop="8px";const m=he(p,j_("a"));m.innerText=`${ui(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add(pe(m,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(bt)}));const v=he(p,j_("span"));v.innerText=d,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ys.Error||t.marker.severity===Ys.Warning||t.marker.severity===Ys.Info){const s=LF.get(this._editor);s&&e.statusBar.addAction({label:g(x5,0,"View Problem"),commandId:wie.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const s=e.statusBar.append(j_("div"));this.recentMarkerCodeActionsInfo&&(Eee.makeKey(this.recentMarkerCodeActionsInfo.marker)===Eee.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=g(x5,1,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?$.None:PS(()=>s.textContent=g(x5,2,"Checking for quick fixes..."),200,i);s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ee(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=g(x5,1,"No quick fixes available");return}s.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(x5,3,"Quick Fix..."),commandId:aFe,run:l=>{c=!0;const d=AF.get(this._editor),h=ia(l);e.hide(),d?.showCodeActions(vze,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},bt)}}getCodeActions(e){return na(t=>KW(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),vze,cf.None,t))}};uAe=D([_(1,EMe),_(2,fr),_(3,ht)],uAe);const $K="vs/editor/contrib/hover/browser/hoverAccessibleViews";var xR;(function(n){n.intro=g($K,0,"Focus on the hover widget to cycle through the hover parts with the Tab key."),n.increaseVerbosity=g($K,1,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",VQ),n.decreaseVerbosity=g($K,2,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",zQ),n.hoverContent=g($K,3,"The last focused hover content is the following.")})(xR||(xR={}));class _Ht{constructor(){this.type=N_.View,this.priority=95,this.name="hover",this.when=X.hoverFocused}getProvider(e){const t=e.get(Qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Nc.get(i);if(!s)return;const o=e.get(ti);return this._provider=e.get(be).createInstance(wHt,o,i,s),this._provider}dispose(){this._provider?.dispose()}}class vHt{constructor(){this.priority=100,this.name="hover",this.type=N_.Help,this.when=X.hoverVisible}getProvider(e){const t=e.get(Qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Nc.get(i);if(s)return e.get(be).createInstance(Kit,s)}dispose(){this._provider?.dispose()}}class jit extends ${constructor(e){super(),this._hoverController=e,this.id=rC.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._markdownHoverFocusedIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._markdownHoverFocusedIndex=this._hoverController.focusedMarkdownHoverIndex(),this._onHoverContentsChanged=this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._markdownHoverFocusedIndex=-1,this._hoverController.focus(),this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._onHoverContentsChanged?.dispose())}}class Kit extends jit{constructor(e){super(e),this.options={type:N_.Help}}provideContent(){return this.provideContentAtIndex(this._markdownHoverFocusedIndex)}provideContentAtIndex(e){const t=[];return t.push(xR.intro),t.push(...this._descriptionsOfVerbosityActionsForIndex(e)),t.push(...this._descriptionOfFocusedMarkdownHoverAtIndex(e)),t.join(` +`)),primaryButton:g(br,18,"&&Remove")});if(!l)return;const d=new Set;for(const h of c)t.remove(h.key,h.scope),d.add(h.scope);for(const h of d)await t.optimize(h)}};ice.SIZE_THRESHOLD=1024*16;let RSe=ice,ER,gie=new Set;const CM=new Y("dirtyWorkingCopies","stopped");class BBt extends pi{constructor(){super({id:"workbench.action.startTrackDisposables",title:Be(br,19,"Start Tracking Disposables"),category:Xa.Developer,f1:!0,precondition:ge.and(CM.isEqualTo("pending").negate(),CM.isEqualTo("started").negate())})}run(e){CM.bindTo(e.get(Pe)).set("started"),gie.clear(),ER=new m_e,hQe(ER)}}class WBt extends pi{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Be(br,20,"Snapshot Tracked Disposables"),category:Xa.Developer,f1:!0,precondition:CM.isEqualTo("started")})}run(e){CM.bindTo(e.get(Pe)).set("pending"),gie=new Set(ER?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class HBt extends pi{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Be(br,21,"Stop Tracking Disposables"),category:Xa.Developer,f1:!0,precondition:CM.isEqualTo("pending")})}run(e){const t=e.get(_i);if(CM.bindTo(e.get(Pe)).set("stopped"),ER){const s=new Set;for(const r of new Set(ER.computeLeakingDisposables(1e3)?.leaks)??[])gie.has(r.value)&&s.add(r);const o=ER.computeLeakingDisposables(1e3,Array.from(s));o&&t.openEditor({resource:void 0,contents:o.details})}hQe(null),ER=void 0,gie.clear()}}At(PBt);At(g2);At(FBt);At(OBt);At(RSe);NBt.commit||(At(BBt),At(WBt),At(HBt));const UBt=it.as(Cs.Configuration);UBt.registerConfiguration({id:"screencastMode",order:9,title:g(br,22,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(br,23,"Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")},"screencastMode.fontSize":{type:"number",default:56,minimum:20,maximum:100,description:g(br,24,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(br,25,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(br,26,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(br,27,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(br,28,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(br,29,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(br,30,"Show single editor cursor move commands.")}},default:{showKeys:!0,showKeybindings:!0,showCommands:!0,showCommandGroups:!1,showSingleEditorCursorMoves:!0},additionalProperties:!1},"screencastMode.keyboardOverlayTimeout":{type:"number",default:800,minimum:500,maximum:5e3,description:g(br,31,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(br,32,"Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")},"screencastMode.mouseIndicatorSize":{type:"number",default:20,minimum:20,maximum:100,description:g(br,33,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});const i6="vs/editor/browser/widget/diffEditor/diffEditor.contribution";At(hNt);At(Uet);At(Vet);Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Vet().desc.id,title:g(i6,0,"Use Inline View When Space Is Limited"),toggled:ge.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ge.has("isInDiffEditor")},order:11,group:"1_diff",when:ge.and(X.diffEditorRenderSideBySideInlineBreakpointReached,ge.has("isInDiffEditor"))});Xs.appendMenuItem(Te.EditorTitle,{command:{id:new Uet().desc.id,title:g(i6,1,"Show Moved Code Blocks"),icon:Ce.move,toggled:oO.create("config.diffEditor.experimental.showMoves",!0),precondition:ge.has("isInDiffEditor")},order:10,group:"1_diff",when:ge.has("isInDiffEditor")});At(aye);for(const n of[{icon:Ce.arrowRight,key:X.diffEditorInlineMode.toNegated()},{icon:Ce.discard,key:X.diffEditorInlineMode}])Xs.appendMenuItem(Te.DiffEditorHunkToolbar,{command:{id:new aye().desc.id,title:g(i6,2,"Revert Block"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Xs.appendMenuItem(Te.DiffEditorSelectionToolbar,{command:{id:new aye().desc.id,title:g(i6,3,"Revert Selection"),icon:n.icon},when:ge.and(X.diffEditorModifiedWritable,n.key),order:5,group:"primary"});At(uNt);At(gNt);At(fNt);At(pNt);Xs.appendMenuItem(Te.EditorTitle,{command:{id:_V.id,title:g(i6,4,"Open Accessible Diff Viewer"),precondition:ge.has("isInDiffEditor")},order:10,group:"2_diff",when:ge.and(X.accessibleDiffViewerVisible.negate(),ge.has("isInDiffEditor"))});yt.registerCommandAlias("editor.action.diffReview.next",_V.id);At(_V);yt.registerCommandAlias("editor.action.diffReview.prev",G7.id);At(G7);var VBt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";Ct(VBt,{});var MSe;const kV="vs/editor/contrib/anchorSelect/browser/anchorSelect",She=new Y("selectionAnchorSet",!1);var PN;let N1=(PN=class{static get(e){return e.getContribution(MSe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=She.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(mt.fromPositions(e,e),{description:"selection-anchor",stickiness:gi.NeverGrowsWhenTypingAtEdges,hoverMessage:new Xt().appendText(g(kV,0,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),sa(g(kV,1,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(mt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},MSe=PN,PN.ID="editor.contrib.selectionAnchorController",PN);N1=MSe=D([_(1,Pe)],N1);class zBt extends lt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(kV,2,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyB),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.setSelectionAnchor()}}class $Bt extends lt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(kV,3,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:She})}async run(e,t){N1.get(t)?.goToSelectionAnchor()}}class GBt extends lt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(kV,4,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyK),weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.selectFromAnchorToCursor()}}class qBt extends lt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(kV,5,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:She,kbOpts:{kbExpr:X.editorTextFocus,primary:E.Escape,weight:ye.EditorContrib}})}async run(e,t){N1.get(t)?.cancelSelectionAnchor()}}vn(N1.ID,N1,mi.Lazy);Fe(zBt);Fe($Bt);Fe(GBt);Fe(qBt);var QBt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";Ct(QBt,{});const IV="vs/editor/contrib/bracketMatching/browser/bracketMatching",jBt=B("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g(IV,0,"Overview ruler marker color for matching brackets."));class KBt extends lt{constructor(){super({id:"editor.action.jumpToBracket",label:g(IV,1,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Backslash,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.jumpToBracket()}}class YBt extends lt{constructor(){super({id:"editor.action.selectToBracket",label:g(IV,2,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Be(IV,3,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let s=!0;i&&i.selectBrackets===!1&&(s=!1),$x.get(t)?.selectToBracket(s)}}class JBt extends lt{constructor(){super({id:"editor.action.removeBrackets",label:g(IV,4,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.Backspace,weight:ye.EditorContrib}})}run(e,t){$x.get(t)?.removeBrackets(this.id)}}class XBt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const gk=class gk extends ${static get(e){return e.getContribution(gk.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new yn(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(x.matchBrackets),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(x.matchBrackets)&&(this._matchBrackets=this._editor.getOption(x.matchBrackets),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(s);c&&c.range&&(r=c.range.getStartPosition())}}return r?new mt(r.lineNumber,r.column,r.lineNumber,r.column):new mt(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const l=t.bracketPairs.findNextBracket(o);l&&l.range&&(r=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(O.compareRangesUsingStarts);const[l,d]=r;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=c,c=h}}a&&c&&i.push(new mt(a.lineNumber,a.column,c.lineNumber,c.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(oe.compare);const a=[];let c=0,l=0;const d=s.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}Fe(n2t);const ag="vs/editor/contrib/clipboard/browser/clipboard",DF="9_cutcopypaste",s2t=rf||document.queryCommandSupported("cut"),Dit=rf||document.queryCommandSupported("copy"),o2t=typeof navigator.clipboard>"u"||pp?document.queryCommandSupported("paste"):!0;function vFe(n){return n.register(),n}const r2t=s2t?vFe(new Z1({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyX,win:{primary:V.CtrlCmd|E.KeyX,secondary:[V.Shift|E.Delete]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,0,"Cu&&t"),order:1},{menuId:Te.EditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1},{menuId:Te.CommandPalette,group:"",title:g(ag,1,"Cut"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,1,"Cut"),when:X.writable,order:1}]})):void 0,a2t=Dit?vFe(new Z1({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyC,win:{primary:V.CtrlCmd|E.KeyC,secondary:[V.CtrlCmd|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,2,"&&Copy"),order:2},{menuId:Te.EditorContext,group:DF,title:g(ag,3,"Copy"),order:2},{menuId:Te.CommandPalette,group:"",title:g(ag,3,"Copy"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,3,"Copy"),order:2}]})):void 0;Xs.appendMenuItem(Te.MenubarEditMenu,{submenu:Te.MenubarCopy,title:Be(ag,4,"Copy As"),group:"2_ccp",order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextCopy,title:Be(ag,4,"Copy As"),group:DF,order:3});Xs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1,when:ge.and(ge.notEquals("resourceScheme","output"),X.editorTextFocus)});Xs.appendMenuItem(Te.ExplorerContext,{submenu:Te.ExplorerContextShare,title:Be(ag,5,"Share"),group:"11_share",order:-1});const mpe=o2t?vFe(new Z1({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:rf?{primary:V.CtrlCmd|E.KeyV,win:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},linux:{primary:V.CtrlCmd|E.KeyV,secondary:[V.Shift|E.Insert]},weight:ye.EditorContrib}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:g(ag,6,"&&Paste"),order:4},{menuId:Te.EditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4},{menuId:Te.CommandPalette,group:"",title:g(ag,7,"Paste"),order:1},{menuId:Te.SimpleEditorContext,group:DF,title:g(ag,7,"Paste"),when:X.writable,order:4}]})):void 0;class c2t extends lt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(ag,8,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,weight:ye.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(dwe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),dwe.forceCopyWithSyntaxHighlighting=!1)}}function kit(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(jt).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(x.emptySelectionClipboard),r=s.getSelection();return r&&r.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(Kg().execCommand(e),!0)))}kit(r2t,"cut");kit(a2t,"copy");mpe&&(mpe.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(jt),i=n.get(Mu),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?jS.get(s)?.finishedPaste()??Promise.resolve():Jn?(async()=>{const r=await i.readText();if(r!==""){const a=Z9.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=s.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard",Uc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),mpe.addImplementation(0,"generic-dom",(n,e)=>(Kg().execCommand("paste"),!0)));Dit&&Fe(c2t);const qa="vs/editor/contrib/codeAction/browser/codeActionCommands";function YQ(n){return ge.regex(Ftt.keys()[0],new RegExp("(\\s|^)"+Iu(n.value)+"\\b"))}const wFe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(qa,0,"Kind of the code action to run.")},apply:{type:"string",description:g(qa,1,"Controls when the returned actions are applied."),default:th.IfSingle,enum:[th.First,th.IfSingle,th.Never],enumDescriptions:[g(qa,2,"Always apply the first returned code action."),g(qa,3,"Apply the first returned code action if it is the only one."),g(qa,4,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(qa,5,"Controls if only preferred code actions should be returned.")}}};function IO(n,e,t,i,s=_f.Default){n.hasModel()&&AF.get(n)?.manualTriggerAtCurrentPosition(e,s,t,i)}class l2t extends lt{constructor(){super({id:aFe,label:g(qa,6,"Quick Fix..."),alias:"Quick Fix...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Period,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,7,"No code actions available"),void 0,void 0,_f.QuickFix)}}class d2t extends Jc{constructor(){super({id:rFe,precondition:ge.and(X.writable,X.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:wFe}]}})}runEditorCommand(e,t,i){const s=Ey.fromUser(i,{kind:bs.Empty,apply:th.IfSingle});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,8,"No preferred code actions for '{0}' available",i.kind):g(qa,9,"No code actions for '{0}' available",i.kind):s.preferred?g(qa,10,"No preferred code actions available"):g(qa,11,"No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class h2t extends lt{constructor(){super({id:cFe,label:g(qa,12,"Refactor..."),alias:"Refactor...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyR,mac:{primary:V.WinCtrl|V.Shift|E.KeyR},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:ge.and(X.writable,YQ(ls.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:wFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Refactor,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,13,"No preferred refactorings for '{0}' available",i.kind):g(qa,14,"No refactorings for '{0}' available",i.kind):s.preferred?g(qa,15,"No preferred refactorings available"):g(qa,16,"No refactorings available"),{include:ls.Refactor.contains(s.kind)?s.kind:bs.None,onlyIncludePreferredActions:s.preferred},s.apply,_f.Refactor)}}class u2t extends lt{constructor(){super({id:lFe,label:g(qa,17,"Source Action..."),alias:"Source Action...",precondition:ge.and(X.writable,X.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ge.and(X.writable,YQ(ls.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:wFe}]}})}run(e,t,i){const s=Ey.fromUser(i,{kind:ls.Source,apply:th.Never});return IO(t,typeof i?.kind=="string"?s.preferred?g(qa,18,"No preferred source actions for '{0}' available",i.kind):g(qa,19,"No source actions for '{0}' available",i.kind):s.preferred?g(qa,20,"No preferred source actions available"):g(qa,21,"No source actions available"),{include:ls.Source.contains(s.kind)?s.kind:bs.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,_f.SourceAction)}}class g2t extends lt{constructor(){super({id:zye,label:g(qa,22,"Organize Imports"),alias:"Organize Imports",precondition:ge.and(X.writable,YQ(ls.SourceOrganizeImports)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Shift|V.Alt|E.KeyO,weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,23,"No organize imports action available"),{include:ls.SourceOrganizeImports,includeSourceActions:!0},th.IfSingle,_f.OrganizeImports)}}class f2t extends lt{constructor(){super({id:$ye,label:g(qa,24,"Fix All"),alias:"Fix All",precondition:ge.and(X.writable,YQ(ls.SourceFixAll))})}run(e,t){return IO(t,g(qa,25,"No fix all action available"),{include:ls.SourceFixAll,includeSourceActions:!0},th.IfSingle,_f.FixAll)}}class p2t extends lt{constructor(){super({id:Ltt,label:g(qa,26,"Auto Fix..."),alias:"Auto Fix...",precondition:ge.and(X.writable,YQ(ls.QuickFix)),kbOpts:{kbExpr:X.textInputFocus,primary:V.Alt|V.Shift|E.Period,mac:{primary:V.CtrlCmd|V.Alt|E.Period},weight:ye.EditorContrib}})}run(e,t){return IO(t,g(qa,27,"No auto fixes available"),{include:ls.QuickFix,onlyIncludePreferredActions:!0},th.IfSingle,_f.AutoFix)}}const Iit="vs/editor/contrib/codeAction/browser/codeActionContributions";vn(AF.ID,AF,mi.Eventually);vn(J7.ID,J7,mi.Lazy);Fe(l2t);Fe(h2t);Fe(u2t);Fe(g2t);Fe(p2t);Fe(f2t);Ke(new d2t);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:ut.LANGUAGE_OVERRIDABLE,description:g(Iit,1,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class NSe{constructor(){this.lenses=[],this._disposables=new Z}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function Lit(n,e,t){const i=n.ordered(e),s=new Map,o=new NSe,r=i.map(async(a,c)=>{s.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){er(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:s.get(a.provider)s.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}yt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Bt(P.isUri(t)),Bt(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(ht),o=n.get(Ai).getModel(t);if(!o)throw Hi();const r=[],a=new Z;return Lit(s,o,qe.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,qe.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const Tit=ae("ICodeLensCache");class Z4e{constructor(e,t){this.lineCount=e,this.data=t}}let PSe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new L_(20,.75);const t="codelens/cache";UB(yi,()=>e.remove(t,ke.WORKSPACE));const i="codelens/cache2",s=e.get(i,ke.WORKSPACE,"{}");this._deserialize(s),T.once(e.onWillSaveState)(o=>{o.reason===nS.SHUTDOWN&&e.store(i,this._serialize(),ke.WORKSPACE,ln.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),s=new NSe;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Z4e(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new O(a,1,a,11)});const r=new NSe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Z4e(s.lineCount,r))}}catch{}}};PSe=D([_(0,on)],PSe);ce(Tit,PSe,Yt.Delayed);var m2t=".monaco-editor .codelens-decoration{font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);color:var(--vscode-editorCodeLens-foreground);display:inline-block;font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);overflow:hidden;padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);text-overflow:ellipsis;white-space:nowrap}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{user-select:none;-webkit-user-select:none;vertical-align:sub;white-space:nowrap}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer}.monaco-editor .codelens-decoration>a:hover,.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);font-size:var(--vscode-editorCodeLens-fontSize);line-height:var(--vscode-editorCodeLens-lineHeight);vertical-align:middle}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}";Ct(m2t,{});class _2t{constructor(e,t,i){this.afterColumn=Zn.MAX_SAFE_SMALL_INTEGER,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const n9=class n9{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${n9._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:eze},h=>this._decorationIds[d]=h),a?a=O.plusRange(a,l.symbol.range):a=O.lift(l.symbol.range)}),this._viewZone=new _2t(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new FSe(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&O.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:eze},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;tthis._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(x.fontInfo)||a.hasChanged(x.codeLensFontSize)||a.hasChanged(x.codeLensFontFamily))&&this._updateLensStyle(),a.hasChanged(x.codeLens)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(x.lineHeight)/this._editor.getOption(x.fontSize));let t=this._editor.getOption(x.codeLensFontSize);return(!t||t<5)&&(t=this._editor.getOption(x.fontSize)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(x.codeLensFontFamily),s=this._editor.getOption(x.fontInfo),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Gh.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(x.codeLens)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&PS(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new yn(()=>{const s=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=na(o=>Lit(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const r=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},bt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{const r=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?r.push(l):(l.update(o),a=l.getLineNumber())});const c=new _pe;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const s=M_.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==Mt.CONTENT_WIDGET)return;let o=s.target.element;if(o?.tagName==="SPAN"&&(o=o.parentElement),o?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new _pe;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(s&&s[s.length-1].symbol.range.startLineNumber===c?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=M_.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new _pe;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0)return;const s=Date.now(),o=na(r=>{const a=t.map((c,l)=>{const d=new Array(c.length),h=c.map((u,f)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(p=>{d[f]=p},er):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{bt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},MH.ID="css.editor.codeLens",MH);n6=D([_(1,ht),_(2,B_),_(3,ji),_(4,Pi),_(5,Tit)],n6);vn(n6.ID,n6,mi.AfterFirstRender);Fe(class extends lt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:X.hasCodeLensProvider,label:g(ize,0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(On),s=e.get(ji),o=e.get(Pi),r=t.getSelection().positionLineNumber,a=t.getContribution(n6.ID);if(!a)return;const c=await a.getModel();if(!c)return;const l=[];for(const u of c.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(l.length===0)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:g(ize,1,"Select a command")});if(!d)return;let h=d.command;if(c.isDisposed){const f=(await a.getModel())?.lenses.find(p=>p.symbol.range.startLineNumber===r&&p.symbol.command?.title===h.title);if(!f||!f.symbol.command)return;h=f.symbol.command}try{await s.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});class bFe{constructor(e,t){this._editorWorkerClient=new CMe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new fe(new gn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?fe.Format.CSS.formatRGB(a):fe.Format.CSS.formatRGBA(a),l=r?fe.Format.CSS.formatHSL(a):fe.Format.CSS.formatHSLA(a),d=r?fe.Format.CSS.formatHex(a):fe.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:l,textEdit:{range:s,text:l}}),h.push({label:d,textEdit:{range:s,text:d}}),h}}let OSe=class extends ${constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new bFe(e,t)))}};OSe=D([_(0,Ai),_(1,lo),_(2,ht)],OSe);KQ(OSe);async function Rit(n,e,t,i=!0){return CFe(new v2t,n,e,t,i)}function Mit(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class v2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)}}class w2t{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class b2t{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const o=await e.provideColorPresentations(t,this.colorInfo,qe.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)}}async function CFe(n,e,t,i,s){let o=!1,r;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof bFe)r=d;else try{await n.compute(d,t,i,a)&&(o=!0)}catch(h){er(h)}}return o?a:r&&s?(await n.compute(r,t,i,a),a):[]}function Nit(n,e){const{colorProvider:t}=n.get(ht),i=n.get(Ai).getModel(e);if(!i)throw Hi();const s=n.get(Re).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}yt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof P))throw Hi();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=Nit(n,t);return CFe(new w2t,s,i,qe.None,o)});yt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof P)||!Array.isArray(t)||t.length!==4||!O.isIRange(o))throw Hi();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=Nit(n,s),[l,d,h,u]=t;return CFe(new b2t({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,qe.None,c)});var BSe;const Pit=Object.create({});var C0;let LV=(C0=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Z),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new PZ(this._editor),this._decoratorLimitReporter=new C2t,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:BSe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(x.colorDecoratorsLimit),c=o.hasChanged(x.defaultColorDecorators);(a||c)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(x.colorDecorators)}get limitReporter(){return this._decoratorLimitReporter}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new O_,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=na(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new ao(!1),s=await Rit(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){bt(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Kt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},BSe=C0,C0.ID="editor.contrib.colorDetector",C0.RECOMPUTE_TIME=1e3,C0);LV=BSe=D([_(1,Re),_(2,ht),_(3,B_)],LV);class C2t{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._computed=0,this._limited=!1}get computed(){return this._computed}get limited(){return this._limited}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}vn(LV.ID,LV,mi.AfterFirstRender);class y2t{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new I,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new I,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=r.getColor(MZ)||fe.white})),this._register(pe(this._pickedColorNode,xe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(pe(this._originalColorNode,xe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new E2t(this._domNode)))}get domNode(){return this._domNode}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=fe.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class E2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),he(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),he(this._button,t),he(t,am(".button"+$e.asCSSSelector(Ki("color-picker-close",Ce.close,g(Fit,1,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}}class x2t extends ${constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=am(".colorpicker-body"),he(e,this._domNode),this._saturationBox=new D2t(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new k2t(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new I2t(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new L2t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new fe(new Ky(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new fe(new Ky(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new fe(new Ky(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get opacityStrip(){return this._opacityStrip}get hueStrip(){return this._hueStrip}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class D2t extends ${constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,this._domNode=am(".saturation-wrap"),he(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",he(this._domNode,this._canvas),this.selection=am(".saturation-selection"),he(this._domNode,this.selection),this.layout(),this._register(pe(this._domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}get canvas(){return this._canvas}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new vz);const t=ia(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new fe(new Ky(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=fe.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Oit extends ${constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new I,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=he(e,am(".standalone-strip")),this.overlay=he(this.domNode,am(".standalone-overlay"))):(this.domNode=he(e,am(".strip")),this.overlay=he(this.domNode,am(".overlay"))),this.slider=he(this.domNode,am(".slider")),this.slider.style.top="0px",this._register(pe(this.domNode,xe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new vz),i=ia(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=pe(e.target.ownerDocument,xe.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class k2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new fe(new gn(t,i,s,1)),r=new fe(new gn(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class I2t extends Oit{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class L2t extends ${constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=he(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(pe(this._button,xe.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const nce=class nce extends wg{constructor(e,t,i,s,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(B9.getInstance(gt(e)).onDidChange(()=>this.layout()));const r=am(".colorpicker-widget");e.appendChild(r),this.header=this._register(new A2t(r,this.model,s,o)),this.body=this._register(new x2t(r,this.model,this.pixelRatio,o))}getId(){return nce.ID}layout(){this.body.layout()}};nce.ID="editor.contrib.colorPickerWidget";let WSe=nce;class T2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let fie=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return tg.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const s=LV.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[await Bit(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}};fie=D([_(1,pn)],fie);class R2t{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let s6=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!LV.get(this._editor))return null;const o=await Rit(i,this._editor.getModel(),qe.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;O.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await Bit(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new O(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await WJ(this._editor.getModel(),t,this._color,i,e),i=Hit(this._editor,i,t))}renderHoverParts(e,t){return Wit(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};s6=D([_(1,pn)],s6);async function Bit(n,e,t,i){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new gn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new fe(l),h=await Mit(e,t,i,qe.None),u=new y2t(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,s),n instanceof fie?new T2t(n,O.lift(t.range),u,i):new R2t(n,O.lift(t.range),u,i)}function Wit(n,e,t,i,s){if(i.length===0||!e.hasModel())return $.None;if(s.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;s.setMinimumDimensions(new Tn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new WSe(s.fragment,c,e.getOption(x.pixelRatio),t,n instanceof s6));s.setColorPicker(l);let d=!1,h=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(n instanceof s6){const u=i[0].model.color;n.color=u,WJ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{n.color=f}))}else o.add(c.onColorFlushed(async u=>{await WJ(a,c,u,h,r),d=!0,h=Hit(e,h,c)}));return o.add(c.onDidChangeColor(u=>{WJ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(s.hide(),e.focus())})),o}function Hit(n,e,t){const i=[],s=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(s),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=O.lift(s.range),r=n.getModel()._setTrackedRange(null,o,gi.GrowsOnlyWhenTypingAfter);return n.executeEdits("colorpicker",i),n.pushUndoStop(),n.getModel()._getTrackedRange(r)??o}async function WJ(n,e,t,i,s){const o=await Mit(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,qe.None);e.colorPresentations=o||[]}const sce=class sce extends ${constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(x.colorDecoratorsActivatedOn);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==Mt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==Pit||!i.range)return;const s=this._editor.getContribution(Nc.ID);if(s&&!s.isColorPickerVisible){const o=new O(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(o,KS.Immediate,Vx.Mouse,!1,!0)}}};sce.ID="editor.contrib.colorContribution",sce.RECOMPUTE_TIME=1e3;let pie=sce;vn(pie.ID,pie,mi.BeforeFirstInteraction);hL.register(fie);var HSe,USe,FN;let kF=(FN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=X.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=X.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new VSe(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(HSe.ID)}},HSe=FN,FN.ID="editor.contrib.standaloneColorPickerController",FN);kF=HSe=D([_(1,Pe),_(2,Ai),_(3,ti),_(4,be),_(5,ht),_(6,lo)],kF);vn(kF.ID,kF,mi.AfterFirstRender);const nze=8,M2t=22;var ON;let VSe=(ON=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=c,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new I),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(s6,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Dd(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const f=u.target.element?.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return USe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(x.hover).above;return{position:this._position,secondaryPosition:this._position,preference:e?[hs.ABOVE,hs.BELOW]:[hs.BELOW,hs.ABOVE],positionAffinity:jo.None}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new N2t(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new bFe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new jte(this._keybindingService));let o;const r={fragment:i,statusBar:s,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,c=a.saturationBox.domNode.clientWidth,l=a.domNode.clientWidth-c-M2t-nze,d=o.body.enterButton;d?.onClicked(()=>{this.updateEditor(),this.hide()});const h=o.header,u=h.pickedColorNode;u.style.width=c+nze+"px";const f=h.originalColorNode;f.style.width=l+"px",o.header.closeButton?.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},USe=ON,ON.ID="editor.contrib.standaloneColorPickerWidget",ON);VSe=USe=D([_(3,be),_(4,Ai),_(5,ti),_(6,ht),_(7,lo)],VSe);class N2t{constructor(e,t){this.value=e,this.foundInEditor=t}}const yM="vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions";class P2t extends wf{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Be(yM,0,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(yM,1,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Te.CommandPalette}],metadata:{description:Be(yM,2,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){kF.get(t)?.showOrFocus()}}class F2t extends lt{constructor(){super({id:"editor.action.hideColorPicker",label:g(yM,3,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:X.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:E.Escape,weight:ye.EditorContrib},metadata:{description:Be(yM,4,"Hide the standalone color picker.")}})}run(e,t){kF.get(t)?.hide()}}class O2t extends lt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(yM,5,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:X.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:E.Enter,weight:ye.EditorContrib},metadata:{description:Be(yM,6,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){kF.get(t)?.insertColor()}}Fe(F2t);Fe(O2t);At(P2t);class uI{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=Q.A&&a<=Q.Z&&a+32===c)&&!(c>=Q.A&&c<=Q.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(l);let f=h.lastIndexOf(t,c-1+t.length),p=u.indexOf(i,d-1-i.length);if(f!==-1&&p!==-1)if(a===l)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),w=u.substring(0,p);(v.indexOf(i)>=0||w.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(s&&f+t.length0&&u.charCodeAt(p-1)===Q.Space&&(i=" "+i,p-=1),m=uI._createRemoveBlockCommentOperations(new O(a,f+t.length+1,l,p+1),t,i)):(m=uI._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return O.isEmpty(e)?s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ds.delete(new O(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ds.delete(new O(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return O.isEmpty(e)?o.push(ds.replace(new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ds.insert(new oe(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ds.insert(new oe(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new mt(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new mt(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}var Dy;(function(n){n[n.Toggle=0]="Toggle",n[n.ForceAdd=1]="ForceAdd",n[n.ForceRemove=2]="ForceRemove"})(Dy||(Dy={}));class kA{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lo?t[c].commentStrOffset=r-1:t[c].commentStrOffset=r}}}const TV="vs/editor/contrib/comment/browser/comment";class yFe extends lt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(lo);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>O.compareRangesUsingStarts(d.selection,h.selection));let l=c[0];for(let d=1;d{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new vpe(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new wpe(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new wpe(new vpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new wpe(new vpe(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};oce.ID="editor.contrib.cursorUndoRedoController";let RV=oce;class V2t extends lt{constructor(){super({id:"cursorUndo",label:g(Uit,0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyU,weight:ye.EditorContrib}})}run(e,t,i){RV.get(t)?.cursorUndo()}}class z2t extends lt{constructor(){super({id:"cursorRedo",label:g(Uit,1,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){RV.get(t)?.cursorRedo()}}vn(RV.ID,RV,mi.Eager);Fe(V2t);Fe(z2t);var $2t=".monaco-editor.hc-light .dnd-target,.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}";Ct($2t,{});class G2t{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new O(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new mt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new mt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!0),this._mouseDown&&XO(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(XO(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===BA.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}XO(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new oe(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new mt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new mt(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",Wi.Explicit)}else(!this._dragSelection.containsPosition(t)||(XO(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(BA.ID,new G2t(this._dragSelection,t,XO(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new O(e.lineNumber,e.column,e.lineNumber,e.column),options:BA._DECORATION_OPTIONS}]),this._editor.revealPosition(e,vt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Mt.CONTENT_TEXT||e.type===Mt.CONTENT_EMPTY}_hitMargin(e){return e.type===Mt.GUTTER_GLYPH_MARGIN||e.type===Mt.GUTTER_LINE_NUMBERS||e.type===Mt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};BA.ID="editor.contrib.dragAndDrop",BA.TRIGGER_KEY_VALUE=ei?E.Alt:E.Ctrl,BA._DECORATION_OPTIONS=Kt.register({description:"dnd-target",className:"dnd-target"});let mie=BA;vn(mie.ID,mie,mi.BeforeFirstInteraction);const zSe="vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution";vn(jS.ID,jS,mi.Eager);KQ(Wye);Ke(new class extends Jc{constructor(){super({id:ktt,precondition:oFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e){return jS.get(e)?.changePasteType()}});Ke(new class extends Jc{constructor(){super({id:"editor.hidePasteWidget",precondition:oFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e){jS.get(e)?.clearWidgets()}});var BN;Fe((BN=class extends lt{constructor(){super({id:"editor.action.pasteAs",label:g(zSe,1,"Paste As..."),alias:"Paste As...",precondition:X.writable,metadata:{description:"Paste as",args:[{name:"args",schema:BN.argsSchema}]}})}run(e,t,i){let s=typeof i?.kind=="string"?i.kind:void 0;return!s&&i&&(s=typeof i.id=="string"?i.id:void 0),jS.get(t)?.pasteAs(s?new bs(s):void 0)}},BN.argsSchema={type:"object",properties:{kind:{type:"string",description:g(zSe,0,"The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},BN));Fe(class extends lt{constructor(){super({id:"editor.action.pasteAsText",label:g(zSe,2,"Paste as Text"),alias:"Paste as Text",precondition:X.writable})}run(n,e){return jS.get(e)?.pasteAs({providerId:CF.id})}});const q2t="vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution";vn(EF.ID,EF,mi.BeforeFirstInteraction);KQ(Bye);Ke(new class extends Jc{constructor(){super({id:Wtt,precondition:dFe,kbOpts:{weight:ye.EditorContrib,primary:V.CtrlCmd|E.Period}})}runEditorCommand(n,e,t){EF.get(e)?.changeDropType()}});Ke(new class extends Jc{constructor(){super({id:"editor.hideDropWidget",precondition:dFe,kbOpts:{weight:ye.EditorContrib,primary:E.Escape}})}runEditorCommand(n,e,t){EF.get(e)?.clearWidgets()}});it.as(Cs.Configuration).registerConfiguration({...sA,properties:{[Btt]:{type:"object",scope:ut.LANGUAGE_OVERRIDABLE,description:g(q2t,0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const su=class su{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,su._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,su._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new O(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,su._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=su._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=su._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),l=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/l));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,p=e.length;f=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new O(h,1,u,1),options:su._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,c=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,su._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rO.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function sze(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function oze(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=Vit([s[a]],r)+t}),o.slice(0,-1)}var MV;(function(n){n[n.StaticValue=0]="StaticValue",n[n.DynamicPieces=1]="DynamicPieces"})(MV||(MV={}));class rze{constructor(e){this.staticValue=e,this.kind=MV.StaticValue}}class j2t{constructor(e){this.pieces=e,this.kind=MV.DynamicPieces}}class NV{static fromStaticValue(e){return new NV([BI.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===MV.DynamicPieces}constructor(e){!e||e.length===0?this._state=new rze(""):e.length===1&&e[0].staticValue!==null?this._state=new rze(e[0].staticValue):this._state=new j2t(e)}buildReplaceString(e,t){if(this._state.kind===MV.StaticValue)return t?Vit(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const c=[],l=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(r.caseOps[d]){case"U":c.push(a[h].toUpperCase());break;case"u":c.push(a[h].toUpperCase()),d++;break;case"L":c.push(a[h].toLowerCase());break;case"l":c.push(a[h].toLowerCase()),d++;break;default:c.push(a[h])}}a=c.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case Q.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case Q.n:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case Q.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case Q.u:case Q.U:case Q.l:case Q.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===Q.DollarSign){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===Q.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===Q.Digit0||r===Q.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(Q.Digit1<=r&&r<=Q.Digit9){let a=r-Q.Digit0;if(i+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Wi.Explicit||i.reason===Wi.Undo||i.reason===Wi.Redo)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,St(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},J2t)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let c=a.endLineNumber;return a.endColumn===1&&(c=c-1),new O(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const s=this._findMatches(i,!1,gI);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=bU(s.map(c=>c.range),c=>O.compareRangesUsingStarts(c,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(x.find).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,vt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new oe(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new oe(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()Z$._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=gI?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new UA(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(x.wordSeparators):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const s=this._editor.getModel(),o=s.getValue(xo.LF),r=s.getFullModelRange(),a=this._getReplacePattern();let c;const l=this._state.preserveCase;a.hasReplacementPatterns||l?c=o.replace(i,function(){return a.buildReplaceString(arguments,l)}):c=o.replace(i,a.buildReplaceString(null,l));const d=new FMe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Zn.MAX_SAFE_SMALL_INTEGER),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Zn.MAX_SAFE_SMALL_INTEGER).map(o=>new mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe),inputActiveOptionBackground:Ye(hR)},o=this._register(C1());this.caseSensitive=this._register(new hXe({appendTitle:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new uXe({appendTitle:this._keybindingLabelFor(cr.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new gXe({appendTitle:this._keybindingLabelFor(cr.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(pe(this._domNode,xe.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(pe(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return rce.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.TOP_RIGHT_CORNER}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};rce.ID="editor.contrib.findOptionsWidget";let GSe=rce;var pu;(function(n){n[n.NotSet=0]="NotSet",n[n.True=1]="True",n[n.False=2]="False"})(pu||(pu={}));function zK(n,e){return n===pu.True?!0:n===pu.False?!1:e}class Z2t extends ${get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return zK(this._isRegexOverride,this._isRegex)}get wholeWord(){return zK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return zK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return zK(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}get isSearching(){return this._isSearching}get filters(){return this._filters}constructor(){super(),this._onFindReplaceStateChange=this._register(new I),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=pu.NotSet,this._wholeWord=!1,this._wholeWordOverride=pu.NotSet,this._matchCase=!1,this._matchCaseOverride=pu.NotSet,this._preserveCase=!1,this._preserveCaseOverride=pu.NotSet,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(O.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,c=this.matchCase,l=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!O.equalsRange(h,d)))||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:pu.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:pu.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:pu.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:pu.NotSet,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),c!==this.matchCase&&(o=!0,s.matchCase=!0),l!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=gI}}var eWt=".monaco-editor .find-widget{background-color:var(--vscode-editorWidget-background);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);box-sizing:border-box;color:var(--vscode-editorWidget-foreground);height:33px;line-height:19px;overflow:hidden;padding:0 4px;position:absolute;transform:translateY(calc(-100% - 10px));transition:transform .2s linear;z-index:35}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-color:var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{display:flex;font-size:12px;margin:3px 25px 0 17px}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-bottom:2px;padding-top:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{align-items:center;display:flex;height:25px}.monaco-editor .find-widget .monaco-findInput{display:flex;flex:1;vertical-align:middle}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{box-sizing:border-box;display:flex;flex:initial;height:25px;line-height:23px;margin:0 0 0 3px;padding:2px 0 0 2px;text-align:center;vertical-align:middle}.monaco-editor .find-widget .button{align-items:center;background-position:50%;background-repeat:no-repeat;border-radius:5px;cursor:pointer;display:flex;flex:initial;height:16px;justify-content:center;margin-left:3px;padding:3px;width:16px}.monaco-editor .find-widget .codicon-find-selection{border-radius:5px;height:22px;padding:3px;width:22px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{padding:1px 6px;top:-1px;width:auto}.monaco-editor .find-widget .button.toggle{border-radius:0;box-sizing:border-box;height:100%;left:3px;position:absolute;top:0;width:18px}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{display:flex;flex:auto;flex-grow:0;flex-shrink:0;position:relative;vertical-align:middle}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;right:2px;top:3px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);box-sizing:border-box;padding:1px}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}.monaco-editor.hc-black .find-widget .button:before{left:2px;position:relative;top:1px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;right:4px;top:5px}";Ct(eWt,{});function qSe(n){return n.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&n.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const fc="vs/editor/contrib/find/browser/findWidget",aze=Ki("find-collapsed",Ce.chevronRight,g(fc,0,"Icon to indicate that the editor find widget is collapsed.")),cze=Ki("find-expanded",Ce.chevronDown,g(fc,1,"Icon to indicate that the editor find widget is expanded.")),tWt=Ki("find-selection",Ce.selection,g(fc,2,"Icon for 'Find in Selection' in the editor find widget.")),iWt=Ki("find-replace",Ce.replace,g(fc,3,"Icon for 'Replace' in the editor find widget.")),nWt=Ki("find-replace-all",Ce.replaceAll,g(fc,4,"Icon for 'Replace All' in the editor find widget.")),sWt=Ki("find-previous-match",Ce.arrowUp,g(fc,5,"Icon for 'Find Previous' in the editor find widget.")),oWt=Ki("find-next-match",Ce.arrowDown,g(fc,6,"Icon for 'Find Next' in the editor find widget.")),rWt=g(fc,7,"Find / Replace"),aWt=g(fc,8,"Find"),cWt=g(fc,9,"Find"),lWt=g(fc,10,"Previous Match"),dWt=g(fc,11,"Next Match"),hWt=g(fc,12,"Find in Selection"),uWt=g(fc,13,"Close"),gWt=g(fc,14,"Replace"),fWt=g(fc,15,"Replace"),pWt=g(fc,16,"Replace"),mWt=g(fc,17,"Replace All"),_Wt=g(fc,18,"Toggle Replace"),vWt=g(fc,19,"Only the first {0} results are highlighted, but all find operations work on the entire text.",gI),wWt=g(fc,20,"{0} of {1}"),lze=g(fc,21,"No results"),yC=419,bWt=275,CWt=bWt-54;let E5=69;const yWt=33,dze="ctrlEnterReplaceAll.windows.donotask",hze=ei?V.WinCtrl:V.CtrlCmd;class bpe{constructor(e){this.afterLineNumber=e,this.heightInPx=yWt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function uze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function gze(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(x.readOnly)&&(this._codeEditor.getOption(x.readOnly)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(x.layoutInfo)&&this._tryUpdateWidgetWidth(),h.hasChanged(x.accessibilitySupport)&&this.updateAccessibilitySupport(),h.hasChanged(x.find)){const u=this._codeEditor.getOption(x.find).loop;this._state.change({loop:u},!1);const f=this._codeEditor.getOption(x.find).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new bpe(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const h=await this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}})),this._findInputFocused=Ahe.bindTo(r),this._findFocusTracker=this._register(Dd(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=SFe.bindTo(r),this._replaceFocusTracker=this._register(Dd(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(x.find).addExtraSpaceOnTop&&(this._viewZone=new bpe(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return ace.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Yf.TOP_RIGHT_CORNER}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(x.readOnly)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=du(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,bt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=E5+"px",this._state.matchesCount>=gI?this._matchesCount.title=vWt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=gI&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=r_(wWt,i,t)}else e=lze;this._matchesCount.appendChild(document.createTextNode(e)),sa(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),E5=Math.max(E5,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===lze)return i===""?g(fc,22,"{0} found",e):g(fc,23,"{0} found for '{1}'",e,i);if(t){const s=g(fc,24,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return g(fc,25,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(x.readOnly);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(x.find).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(x.find).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=ia(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=bZ(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(l?l.left:0)>c&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(x.find).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(x.find).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new bpe(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(x.padding).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&du(this._domNode)>yC){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=du(this._findInput.domNode);return}if(yC+28+s>=i&&(r=!0),yC+28+s-E5>=i&&(a=!0),yC+28+s-E5>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!O.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(E.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(hze|E.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Is&&rf&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(fc,26,"Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(dze,!0,ke.PROFILE,ln.USER)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(E.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(V.Shift|E.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(V.CtrlCmd|E.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(E.UpArrow))return uze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(E.DownArrow))return gze(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new wye(null,this._contextViewProvider,{width:CWt,label:aWt,placeholder:cWt,appendCaseSensitiveLabel:this._keybindingLabelFor(cr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(cr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(cr.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>qSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(V.Shift|E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),jr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(C1());this._prevBtn=this._register(new ZO({label:lWt+this._keybindingLabelFor(cr.PreviousMatchFindAction),icon:sWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.PreviousMatchFindAction)).run().then(void 0,bt)}},this._hoverService)),this._nextBtn=this._register(new ZO({label:dWt+this._keybindingLabelFor(cr.NextMatchFindAction),icon:oWt,hoverDelegate:i,onTrigger:()=>{ws(this._codeEditor.getAction(cr.NextMatchFindAction)).run().then(void 0,bt)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",s.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new iD({icon:tWt,title:hWt+this._keybindingLabelFor(cr.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:Ye(hR),inputActiveOptionBorder:Ye(IMe),inputActiveOptionForeground:Ye(LMe)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new ZO({label:uWt+this._keybindingLabelFor(cr.CloseFindWidgetCommand),icon:VXe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(E.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new bye(null,void 0,{label:gWt,placeholder:fWt,appendPreserveCaseLabel:this._keybindingLabelFor(cr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>qSe(this._keybindingService),inputBoxStyles:eV,toggleStyles:See},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(d=>this._onReplaceInputKeyDown(d))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(d=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(d=>{d.equals(E.Tab)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),d.preventDefault())}));const r=this._register(C1());this._replaceBtn=this._register(new ZO({label:pWt+this._keybindingLabelFor(cr.ReplaceOneAction),icon:iWt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(V.Shift|E.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new ZO({label:mWt+this._keybindingLabelFor(cr.ReplaceAllAction),icon:nWt,hoverDelegate:r,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",a.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new ZO({label:_Wt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=rWt,this._domNode.role="dialog",this._domNode.style.width=`${yC}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Lh(this._domNode,this,{orientation:vi.VERTICAL,size:2})),this._resized=!1;let l=yC;this._register(this._resizeSash.onDidStart(()=>{l=du(this._domNode)})),this._register(this._resizeSash.onDidChange(d=>{this._resized=!0;const h=l+d.startX-d.currentX;if(hu||(this._domNode.style.width=`${h}px`,this._isReplaceVisible&&(this._replaceInput.width=du(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=du(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};ace.ID="editor.contrib.findWidget";let QSe=ace;class ZO extends wg{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+$e.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupUpdatableHover(e.hoverDelegate??va("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,s=>{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{if(s.equals(E.Space)||s.equals(E.Enter)){this._opts.onTrigger(),s.preventDefault();return}this._opts.onKeyDown?.(s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...$e.asClassNameArray(aze)),this._domNode.classList.add(...$e.asClassNameArray(cze))):(this._domNode.classList.remove(...$e.asClassNameArray(cze)),this._domNode.classList.add(...$e.asClassNameArray(aze)))}}Im((n,e)=>{const t=n.getColor(Uk);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${pS(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(Dmt);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${pS(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(ft);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const o=n.getColor(Emt);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=n.getColor(xmt);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var jSe;const Zg="vs/editor/contrib/find/browser/findController",SWt=524288;function KSe(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(x.find).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,ke.WORKSPACE,ln.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,ke.WORKSPACE,ln.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,ke.WORKSPACE,ln.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,ke.WORKSPACE,ln.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",ke.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",ke.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",ke.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",ke.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Ahe.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Iu(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=KSe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Iu(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=KSe(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new Z$(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(g(Zg,0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(x.find).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},jSe=WN,WN.ID="editor.contrib.findController",WN);vf=jSe=D([_(1,Pe),_(2,on),_(3,Mu),_(4,Pi),_(5,el)],vf);let YSe=class extends vf{constructor(e,t,i,s,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===bw.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===bw.FocusFindInput&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new QSe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new GSe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};YSe=D([_(1,W_),_(2,Pe),_(3,ti),_(4,pn),_(5,Pi),_(6,on),_(7,Mu),_(8,el)],YSe);const AWt=Sje(new yje({id:cr.StartFindAction,label:g(Zg,1,"Find"),alias:"Find",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyF,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,2,"&&Find"),order:1}}));AWt.addImplementation(0,(n,e,t)=>{const i=vf.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).globalFindClipboard,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const EWt={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class xWt extends lt{constructor(){super({id:cr.StartFindWithArgs,label:g(Zg,3,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:ye.EditorContrib},metadata:EWt})}async run(e,t,i){const s=vf.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}}}class DWt extends lt{constructor(){super({id:cr.StartFindWithSelection,label:g(Zg,4,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:V.CtrlCmd|E.KeyE},weight:ye.EditorContrib}})}async run(e,t){const i=vf.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class zit extends lt{async run(e,t){const i=vf.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class kWt extends zit{constructor(){super({id:cr.NextMatchFindAction,label:g(Zg,5,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:E.F3,mac:{primary:V.CtrlCmd|E.KeyG,secondary:[E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class IWt extends zit{constructor(){super({id:cr.PreviousMatchFindAction,label:g(Zg,6,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:X.focus,primary:V.Shift|E.F3,mac:{primary:V.CtrlCmd|V.Shift|E.KeyG,secondary:[V.Shift|E.F3]},weight:ye.EditorContrib},{kbExpr:ge.and(X.focus,Ahe),primary:V.Shift|E.Enter,weight:ye.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class LWt extends lt{constructor(){super({id:cr.GoToMatchFindAction,label:g(Zg,7,"Go to Match..."),alias:"Go to Match...",precondition:cD}),this._highlightDecorations=[]}run(e,t,i){const s=vf.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Pi).notify({severity:nt.Warning,message:g(Zg,8,"No matches. Try searching for something else.")});return}const a=e.get(On).createInputBox();a.placeholder=g(Zg,9,"Type a number to go to a specific match (between 1 and {0})",o);const c=d=>{const h=parseInt(d);if(isNaN(h))return;const u=s.getState().matchesCount;if(h>0&&h<=u)return h-1;if(h<0&&h>=-u)return u+h},l=d=>{const h=c(d);if(typeof h=="number"){a.validationMessage=void 0,s.goToMatch(h);const u=s.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=g(Zg,10,"Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}])})}}class $it extends lt{async run(e,t){const i=vf.get(t);if(!i)return;const s=KSe(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:bw.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class TWt extends $it{constructor(){super({id:cr.NextSelectionMatchFindAction,label:g(Zg,11,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class RWt extends $it{constructor(){super({id:cr.PreviousSelectionMatchFindAction,label:g(Zg,12,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.F3,weight:ye.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const MWt=Sje(new yje({id:cr.StartFindReplaceAction,label:g(Zg,13,"Replace"),alias:"Replace",precondition:ge.or(X.focus,ge.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:V.CtrlCmd|E.KeyH,mac:{primary:V.CtrlCmd|V.Alt|E.KeyF},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:g(Zg,14,"&&Replace"),order:2}}));MWt.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=vf.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?bw.FocusReplaceInput:bw.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(x.find).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop})});vn(vf.ID,YSe,mi.Eager);Fe(xWt);Fe(DWt);Fe(kWt);Fe(IWt);Fe(LWt);Fe(TWt);Fe(RWt);const mC=Jc.bindToContribution(vf.get);Ke(new mC({id:cr.CloseFindWidgetCommand,precondition:cD,handler:n=>n.closeFindWidget(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new mC({id:cr.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:BK.primary,mac:BK.mac,win:BK.win,linux:BK.linux}}));Ke(new mC({id:cr.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:WK.primary,mac:WK.mac,win:WK.win,linux:WK.linux}}));Ke(new mC({id:cr.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:HK.primary,mac:HK.mac,win:HK.win,linux:HK.linux}}));Ke(new mC({id:cr.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:UK.primary,mac:UK.mac,win:UK.win,linux:UK.linux}}));Ke(new mC({id:cr.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:VK.primary,mac:VK.mac,win:VK.win,linux:VK.linux}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.Digit1}}));Ke(new mC({id:cr.ReplaceOneAction,precondition:cD,handler:n=>n.replace(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,SFe),primary:E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.CtrlCmd|V.Alt|E.Enter}}));Ke(new mC({id:cr.ReplaceAllAction,precondition:cD,handler:n=>n.replaceAll(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:ge.and(X.focus,SFe),primary:void 0,mac:{primary:V.CtrlCmd|E.Enter}}}));Ke(new mC({id:cr.SelectAllMatchesAction,precondition:cD,handler:n=>n.selectAllMatches(),kbOpts:{weight:ye.EditorContrib+5,kbExpr:X.focus,primary:V.Alt|E.Enter}}));const AFe="vs/editor/contrib/fontZoom/browser/fontZoom";class NWt extends lt{constructor(){super({id:"editor.action.fontZoomIn",label:g(AFe,0,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(l_.getZoomLevel()+1)}}class PWt extends lt{constructor(){super({id:"editor.action.fontZoomOut",label:g(AFe,1,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(l_.getZoomLevel()-1)}}class FWt extends lt{constructor(){super({id:"editor.action.fontZoomReset",label:g(AFe,2,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){l_.setZoomLevel(0)}}Fe(NWt);Fe(PWt);Fe(FWt);const Git="vs/editor/contrib/format/browser/formatActions";var NH;let _ie=(NH=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new Z,this._sessionDisposables=new Z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(x.formatOnType)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(x.formatOnType)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new EZ;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new ai,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{s.token.isCancellationRequested||mo(r)&&(this._accessibilitySignalService.playSignal(Zl.format,{userGesture:!1}),hV.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},NH.ID="editor.contrib.autoFormat",NH);_ie=D([_(1,ht),_(2,kd),_(3,Lw)],_ie);var PH;let vie=(PH=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Z,this._callOnModel=new Z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(x.formatOnPaste)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Ude,this.editor,e,S_.Silent,cf.None,qe.None,!1).catch(bt))}},PH.ID="editor.contrib.formatOnPaste",PH);vie=D([_(1,ht),_(2,be)],vie);class OWt extends lt{constructor(){super({id:"editor.action.formatDocument",label:g(Git,0,"Format Document"),alias:"Format Document",precondition:ge.and(X.notInCompositeEditor,X.writable,X.hasDocumentFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyF,linux:{primary:V.CtrlCmd|V.Shift|E.KeyI},weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(be);await e.get(eD).showWhile(i.invokeFunction(BCe,t,S_.Explicit,cf.None,qe.None,!0),250)}}}class BWt extends lt{constructor(){super({id:"editor.action.formatSelection",label:g(Git,1,"Format Selection"),alias:"Format Selection",precondition:ge.and(X.writable,X.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyF),weight:ye.EditorContrib},contextMenuOpts:{when:X.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(be),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new O(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(eD).showWhile(i.invokeFunction(Ude,t,o,S_.Explicit,cf.None,qe.None,!0),250)}}vn(_ie.ID,_ie,mi.BeforeFirstInteraction);vn(vie.ID,vie,mi.BeforeFirstInteraction);Fe(OWt);Fe(BWt);yt.registerCommand("editor.action.format",async n=>{const e=n.get(jt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(ji);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class ky{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static getElementById(e,t){if(!e)return;const i=LS(e,t.id);if(i===e.length)return t;if(!(i0&&O.areIntersecting(e[s-1],t.symbol.range)&&(s-=1)):s=i;const o=[];let r;for(;sr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),iF(e)}}class oy extends ky{static create(e,t,i){const s=new ai(i),o=new oy(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=ky.findId(`provider_${d}`,o),u=new XSe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,s.token)).then(f=>{for(const p of f||[])oy._makeOutlineElement(p,u);return u},f=>(er(f),u)).then(f=>{ky.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);Ls(l,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?oy.create(e,t,i):o._compact()).finally(()=>{s.dispose(),c.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=ky.findId(e,t),s=new JSe(i,t,e);if(e.children)for(const o of e.children)oy._makeOutlineElement(o,s);t.children.set(s.id,s)}static get(e){for(;e;){if(e instanceof oy)return e;e=e.parent}}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=fi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}merge(e){return this.uri.toString()!==e.uri.toString()||this._groups.size!==e._groups.size?!1:(this._groups=e._groups,this.children=e.children,!0)}getItemEnclosingPosition(e,t){let i;if(t){let o=t.parent;for(;o&&!i;)o instanceof XSe&&(i=o),o=o.parent}let s;for(const[,o]of this._groups)if(s=o.getItemEnclosingPosition(e),s&&(!i||i===o))break;return s}getItemById(e){return ky.getElementById(e,this)}updateMarker(e){e.sort(O.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof JSe?e.push(t.symbol):e.push(...fi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>O.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return oy._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>oe.compare(O.getStartPosition(i.range),O.getStartPosition(s.range))||oe.compare(O.getEndPosition(s.range),O.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&oy._flattenDocumentSymbols(e,s.children,s.name)}}const JQ=ae("IOutlineModelService");let ZSe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new L_(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ls(o.provider,s)){const a=new ai;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:oy.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const c=Date.now();o.promise.then(l=>{o.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};ZSe=D([_(0,ht),_(1,B_),_(2,Ai)],ZSe);ce(JQ,ZSe,Yt.Delayed);yt.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;Bt(P.isUri(t));const i=n.get(JQ),o=await n.get(Rn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,qe.None)).getTopLevelSymbols()}finally{o.dispose()}});const aC="vs/editor/contrib/inlineCompletions/browser/commands",cce=class cce extends lt{constructor(){super({id:cce.ID,label:g(aC,0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketRight}})}async run(e,t){_g.get(t)?.model.get()?.next()}};cce.ID=Ket;let eAe=cce;const lce=class lce extends lt{constructor(){super({id:lce.ID,label:g(aC,1,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:100,primary:V.Alt|E.BracketLeft}})}async run(e,t){_g.get(t)?.model.get()?.previous()}};lce.ID=jet;let tAe=lce;class WWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(aC,2,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:X.writable})}async run(e,t){const i=_g.get(t);await Hxt(async s=>{await i?.model.get()?.triggerExplicitly(s),i?.playAccessibilitySignal(s)})}}class HWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(aC,3,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|E.RightArrow,kbExpr:ge.and(X.writable,af.inlineSuggestionVisible)},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,4,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class UWt extends lt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(aC,5,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ge.and(X.writable,af.inlineSuggestionVisible),kbOpts:{weight:ye.EditorContrib+1},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,6,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=_g.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class VWt extends lt{constructor(){super({id:Qet,label:g(aC,7,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:af.inlineSuggestionVisible,menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:g(aC,8,"Accept"),group:"primary",order:1}],kbOpts:{primary:E.Tab,weight:200,kbExpr:ge.and(af.inlineSuggestionVisible,X.tabMovesFocus.toNegated(),af.inlineSuggestionHasIndentationLessThanTabSize,qi.Visible.toNegated(),X.hoverFocused.toNegated())}})}async run(e,t){const i=_g.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const dce=class dce extends lt{constructor(){super({id:dce.ID,label:g(aC,9,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:af.inlineSuggestionVisible,kbOpts:{weight:100,primary:E.Escape}})}async run(e,t){const i=_g.get(t);En(s=>{i?.model.get()?.stop(s)})}};dce.ID="editor.action.inlineSuggest.hide";let iAe=dce;const hce=class hce extends pi{constructor(){super({id:hce.ID,title:g(aC,10,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Te.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ge.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Re),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};hce.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let nAe=hce;const zWt="vs/editor/contrib/inlineCompletions/browser/hoverParticipant";class $Wt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let sAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=_g.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new bM(1e3,this,O.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineSuggest).showToolbar!=="onHover")return[];const i=_g.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new $Wt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this.renderScreenReaderText(e,s,i);const o=s.controller.model.get(),r=this._instantiationService.createInstance(vV,this._editor,!1,Au(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands);return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const s=we,o=s("div.hover-row.markdown-hover"),r=he(o,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new vw({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(zWt,0,"Suggestion:"),h=i.add(a.render(new Xt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};i.add(Ni(l=>{const d=t.controller.model.read(l)?.primaryGhostText.read(l);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);c(d.renderForScreenReader(h))}else _a(r)})),e.fragment.appendChild(o)}};sAe=D([_(1,Di),_(2,fr),_(3,Ur),_(4,be),_(5,rn)],sAe);class GWt extends ${getProvider(e){const t=e.get(jt);function i(){const s=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!s)return;const o=_g.get(s)?.model.get(),r=o?.state.get();if(!o||!r)return;const a=o.textModel.getLineContent(r.primaryGhostText.lineNumber),c=r.primaryGhostText.renderForScreenReader(a);if(!c)return;const l=s.getModel()?.getLanguageId()??void 0;return{id:rC.InlineCompletions,verbositySettingKey:"accessibility.verbosity.inlineCompletions",provideContent(){return a+c},onClose(){o.stop(),s.focus()},next(){o.next(),setTimeout(()=>i(),50)},previous(){o.previous(),setTimeout(()=>i(),50)},options:{language:l,type:N_.View}}}return i()}constructor(){super(),this.type=N_.View,this.priority=95,this.name="inline-completions",this.when=ge.and(af.inlineSuggestionVisible)}}vn(_g.ID,_g,mi.Eventually);Fe(WWt);Fe(eAe);Fe(tAe);Fe(HWt);Fe(UWt);Fe(VWt);Fe(iAe);At(nAe);hL.register(sAe);NQ.register(new GWt);var qWt=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";Ct(qWt,{});var R3;const QWt="vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition";var y0;let IF=(y0=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new Z,this.toUnhookForKeyboard=new Z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new phe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{bt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(R3.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===Mt.CONTENT_WIDGET&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new Bde(this.editor,hr.Position|hr.Value|hr.Selection|hr.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=na(r=>this.findDefinition(e,r));let s;try{s=await this.previousPromise}catch(r){bt(r);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=s[0].originSelectionRange?O.lift(s[0].originSelectionRange):new O(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let r=o;for(const{originSelectionRange:a}of s)a&&(r=O.plusRange(r,a));this.addDecoration(r,new Xt().appendText(g(QWt,0,"Click to show {0} definitions.",s.length)))}else{const r=s[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=r.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,d?new Xt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=R3.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new qQ({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Pe);return mf.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},R3=y0,y0.ID="editor.contrib.gotodefinitionatposition",y0.MAX_SOURCE_PREVIEW_LINES=8,y0);IF=R3=D([_(1,Rn),_(2,Di),_(3,ht)],IF);vn(IF.ID,IF,mi.BeforeFirstInteraction);class fze{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let oAe=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._dispoables=new Z,this._markers=[],this._nextIdx=-1,P.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=lw(a.resource.toString(),c.resource.toString());return l===0&&(s==="position"?l=O.compareRangesUsingStarts(a,c)||Ys.compare(a.severity,c.severity):l=Ys.compare(a.severity,c.severity)||O.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:P.isUri(e)?e:void 0,severities:Ys.Error|Ys.Warning|Ys.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new fze(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=CU(this._markers,{resource:e.uri},(r,a)=>lw(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;it())}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new oAe(e,this._markerService,this._configService)}};rAe=D([_(0,U_),_(1,Re)],rAe);ce(qit,rAe,Yt.Delayed);var jWt='.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;margin-right:4px;vertical-align:text-top}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{font-style:italic;opacity:.6}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{padding:8px 12px 0 20px;position:absolute;user-select:text;-webkit-user-select:text;white-space:pre}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{color:inherit;opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{border-bottom:1px solid transparent;color:var(--vscode-textLink-activeForeground);text-decoration:underline;text-underline-position:under}.monaco-editor .marker-widget .descriptioncontainer .filename{color:var(--vscode-textLink-activeForeground);cursor:pointer}';Ct(jWt,{});var KWt=".extension-editor .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.markers-panel .marker-icon .codicon.codicon-error,.markers-panel .marker-icon.error,.monaco-editor .zone-widget .codicon.codicon-error,.preferences-editor .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.extension-editor .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.markers-panel .marker-icon .codicon.codicon-warning,.markers-panel .marker-icon.warning,.monaco-editor .zone-widget .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.extension-editor .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.markers-panel .marker-icon .codicon.codicon-info,.markers-panel .marker-icon.info,.monaco-editor .zone-widget .codicon.codicon-info,.preferences-editor .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}";Ct(KWt,{});var aAe;(function(n){function e(t){switch(t){case nt.Ignore:return"severity-ignore "+$e.asClassName(Ce.info);case nt.Info:return $e.asClassName(Ce.info);case nt.Warning:return $e.asClassName(Ce.warning);case nt.Error:return $e.asClassName(Ce.error);default:return""}}n.className=e})(aAe||(aAe={}));var cAe;const cm="vs/editor/contrib/gotoError/browser/gotoErrorWidget";class YWt{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Xo(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new FKe(r,{horizontal:zo.Auto,vertical:zo.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){St(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=xw(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Yo(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const u of a)c=document.createElement("div"),c.innerText=u,u===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),c.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=we("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(o.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=he(this._codeLink,we("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Yo(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),mo(s)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(x.lineHeight)*.66)}px`,this._lines+=1;for(const f of s){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const l=this._editor.getOption(x.fontInfo),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Ys.Error:t=g(cm,0,"Error");break;case Ys.Warning:t=g(cm,1,"Warning");break;case Ys.Info:t=g(cm,2,"Info");break;case Ys.Hint:t=g(cm,3,"Hint");break}let i=g(cm,4,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var HN;let o6=(HN=class extends V7{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ys.Warning,this._backgroundColor=fe.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(eHt);let t=lAe,i=JWt;this._severity===Ys.Warning?(t=HJ,i=XWt):this._severity===Ys.Info&&(t=dAe,i=ZWt);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(VPe),secondaryHeadingColor:e.getColor(zPe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}focus(){this._parentContainer.focus()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(cAe.TitleMenu,this._contextKeyService);tD(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=he(e,we(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new YWt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=O.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(cm,5,"{0} of {1} problems",t,i):g(cm,6,"{0} of {1} problem",t,i);this.setTitle(ui(a.uri),c)}this._icon.className=`codicon ${aAe.className(Ys.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,vt.Smooth),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},cAe=HN,HN.TitleMenu=new Te("gotoErrorTitleMenu"),HN);o6=cAe=D([_(1,pn),_(2,fr),_(3,_c),_(4,be),_(5,Pe),_(6,eo)],o6);const pze=j9(Vh,Cmt),mze=j9(qc,K9),_ze=j9(Qc,Y9),lAe=B("editorMarkerNavigationError.background",{dark:pze,light:pze,hcDark:ft,hcLight:ft},g(cm,7,"Editor marker navigation widget error color.")),JWt=B("editorMarkerNavigationError.headerBackground",{dark:Ie(lAe,.1),light:Ie(lAe,.1),hcDark:null,hcLight:null},g(cm,8,"Editor marker navigation widget error heading background.")),HJ=B("editorMarkerNavigationWarning.background",{dark:mze,light:mze,hcDark:ft,hcLight:ft},g(cm,9,"Editor marker navigation widget warning color.")),XWt=B("editorMarkerNavigationWarning.headerBackground",{dark:Ie(HJ,.1),light:Ie(HJ,.1),hcDark:"#0C141F",hcLight:Ie(HJ,.2)},g(cm,10,"Editor marker navigation widget warning heading background.")),dAe=B("editorMarkerNavigationInfo.background",{dark:_ze,light:_ze,hcDark:ft,hcLight:ft},g(cm,11,"Editor marker navigation widget info color.")),ZWt=B("editorMarkerNavigationInfo.headerBackground",{dark:Ie(dAe,.1),light:Ie(dAe,.1),hcDark:null,hcLight:null},g(cm,12,"Editor marker navigation widget info heading background.")),eHt=B("editorMarkerNavigation.background",{dark:us,light:us,hcDark:us,hcLight:us},g(cm,13,"Editor marker navigation widget background."));var M3;const P1="vs/editor/contrib/gotoError/browser/gotoError";var UN;let LF=(UN=class{static get(e){return e.getContribution(M3.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Qit.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(o6,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!O.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:O.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new oe(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:px.NearTop,selection:i.selected.marker}},this._editor);s&&(M3.get(s)?.close(),M3.get(s)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},M3=UN,UN.ID="editor.contrib.markerController",UN);LF=M3=D([_(1,qit),_(2,Pe),_(3,jt),_(4,be)],LF);class Ehe extends lt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&LF.get(t)?.nagivate(this._next,this._multiFile)}}const eR=class eR extends Ehe{constructor(){super(!0,!1,{id:eR.ID,label:eR.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:eR.LABEL,icon:Ki("marker-navigation-next",Ce.arrowDown,g(P1,1,"Icon for goto next marker.")),group:"navigation",order:1}})}};eR.ID="editor.action.marker.next",eR.LABEL=g(P1,0,"Go to Next Problem (Error, Warning, Info)");let wie=eR;const tR=class tR extends Ehe{constructor(){super(!1,!1,{id:tR.ID,label:tR.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|V.Alt|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:o6.TitleMenu,title:tR.LABEL,icon:Ki("marker-navigation-previous",Ce.arrowUp,g(P1,3,"Icon for goto previous marker.")),group:"navigation",order:2}})}};tR.ID="editor.action.marker.prev",tR.LABEL=g(P1,2,"Go to Previous Problem (Error, Warning, Info)");let hAe=tR;class tHt extends Ehe{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(P1,4,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,5,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class iHt extends Ehe{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(P1,6,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.Shift|E.F8,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarGoMenu,title:g(P1,7,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}vn(LF.ID,LF,mi.Lazy);Fe(wie);Fe(hAe);Fe(tHt);Fe(iHt);const Qit=new Y("markersNavigationVisible",!1),nHt=Jc.bindToContribution(LF.get);Ke(new nHt({id:"closeMarkersNavigation",precondition:Qit,handler:n=>n.close(),kbOpts:{weight:ye.EditorContrib+50,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));const Cl="vs/editor/contrib/hover/browser/hoverActions";var sb;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(sb||(sb={}));class sHt extends lt{constructor(){super({id:Vtt,label:g(Cl,0,"Show or Focus Hover"),metadata:{description:Be(Cl,1,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[sb.NoAutoFocus,sb.FocusIfVisible,sb.AutoFocusImmediately],enumDescriptions:[g(Cl,2,"The hover will not automatically take focus."),g(Cl,3,"The hover will take focus only if it is already visible."),g(Cl,4,"The hover will automatically take focus when it appears.")],default:sb.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyI),weight:ye.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const s=Nc.get(t);if(!s)return;const o=i?.focus;let r=sb.FocusIfVisible;Object.values(sb).includes(o)?r=o:typeof o=="boolean"&&o&&(r=sb.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new O(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(h,KS.Immediate,Vx.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Kd.Enabled;s.isHoverVisible?r!==sb.NoAutoFocus?s.focus():a(c):a(c||r===sb.AutoFocusImmediately)}}class oHt extends lt{constructor(){super({id:JFt,label:g(Cl,5,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Be(Cl,6,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Nc.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new O(s.lineNumber,s.column,s.lineNumber,s.column),r=IF.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,KS.Immediate,Vx.Keyboard,!0)})}}class rHt extends lt{constructor(){super({id:XFt,label:g(Cl,7,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.UpArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,8,"Scroll up the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollUp()}}class aHt extends lt{constructor(){super({id:ZFt,label:g(Cl,9,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.DownArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,10,"Scroll down the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollDown()}}class cHt extends lt{constructor(){super({id:eOt,label:g(Cl,11,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.LeftArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,12,"Scroll left the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollLeft()}}class lHt extends lt{constructor(){super({id:tOt,label:g(Cl,13,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.RightArrow,weight:ye.EditorContrib},metadata:{description:Be(Cl,14,"Scroll right the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.scrollRight()}}class dHt extends lt{constructor(){super({id:iOt,label:g(Cl,15,"Page Up Hover"),alias:"Page Up Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageUp,secondary:[V.Alt|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,16,"Page up the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.pageUp()}}class hHt extends lt{constructor(){super({id:nOt,label:g(Cl,17,"Page Down Hover"),alias:"Page Down Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.PageDown,secondary:[V.Alt|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,18,"Page down the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.pageDown()}}class uHt extends lt{constructor(){super({id:sOt,label:g(Cl,19,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.Home,secondary:[V.CtrlCmd|E.UpArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,20,"Go to the top of the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.goToTop()}}class gHt extends lt{constructor(){super({id:oOt,label:g(Cl,21,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:X.hoverFocused,kbOpts:{kbExpr:X.hoverFocused,primary:E.End,secondary:[V.CtrlCmd|E.DownArrow],weight:ye.EditorContrib},metadata:{description:Be(Cl,22,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Nc.get(t);i&&i.goToBottom()}}class fHt extends lt{constructor(){super({id:VQ,label:aOt,alias:"Increase Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Nc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Increase,i?.index,i?.focus)}}class pHt extends lt{constructor(){super({id:zQ,label:lOt,alias:"Decrease Hover Verbosity Level",precondition:X.hoverVisible})}run(e,t,i){Nc.get(t)?.updateMarkdownHoverVerbosityLevel(Yl.Decrease,i?.index,i?.focus)}}const x5="vs/editor/contrib/hover/browser/markerHoverParticipant",j_=we;class mHt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const vze={type:wu.Invoke,filter:{include:ls.QuickFix},triggerAction:_f.QuickFixHover};let uAe=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const c=a.range.startLineNumber===s?a.range.startColumn:1,l=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new O(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new mHt(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return $.None;const i=new Z;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>Ys.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=j_("div.hover-row");i.tabIndex=0;const s=he(i,j_("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(s);const l=he(s,j_("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const d=j_("span");if(o){const p=he(d,j_("span"));p.innerText=o}const h=he(d,j_("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(pe(h,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const u=he(h,j_("span"));u.innerText=a.value;const f=he(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=he(s,j_("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(mo(c))for(const{message:d,resource:h,startLineNumber:u,startColumn:f}of c){const p=he(s,j_("div"));p.style.marginTop="8px";const m=he(p,j_("a"));m.innerText=`${ui(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add(pe(m,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(bt)}));const v=he(p,j_("span"));v.innerText=d,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ys.Error||t.marker.severity===Ys.Warning||t.marker.severity===Ys.Info){const s=LF.get(this._editor);s&&e.statusBar.addAction({label:g(x5,0,"View Problem"),commandId:wie.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const s=e.statusBar.append(j_("div"));this.recentMarkerCodeActionsInfo&&(Eee.makeKey(this.recentMarkerCodeActionsInfo.marker)===Eee.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=g(x5,1,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?$.None:PS(()=>s.textContent=g(x5,2,"Checking for quick fixes..."),200,i);s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ee(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=g(x5,1,"No quick fixes available");return}s.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(x5,3,"Quick Fix..."),commandId:aFe,run:l=>{c=!0;const d=AF.get(this._editor),h=ia(l);e.hide(),d?.showCodeActions(vze,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},bt)}}getCodeActions(e){return na(t=>KW(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new O(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),vze,cf.None,t))}};uAe=D([_(1,EMe),_(2,fr),_(3,ht)],uAe);const $K="vs/editor/contrib/hover/browser/hoverAccessibleViews";var xR;(function(n){n.intro=g($K,0,"Focus on the hover widget to cycle through the hover parts with the Tab key."),n.increaseVerbosity=g($K,1,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",VQ),n.decreaseVerbosity=g($K,2,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",zQ),n.hoverContent=g($K,3,"The last focused hover content is the following.")})(xR||(xR={}));class _Ht{constructor(){this.type=N_.View,this.priority=95,this.name="hover",this.when=X.hoverFocused}getProvider(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Nc.get(i);if(!s)return;const o=e.get(ti);return this._provider=e.get(be).createInstance(wHt,o,i,s),this._provider}dispose(){this._provider?.dispose()}}class vHt{constructor(){this.priority=100,this.name="hover",this.type=N_.Help,this.when=X.hoverVisible}getProvider(e){const t=e.get(jt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const s=Nc.get(i);if(s)return e.get(be).createInstance(Kit,s)}dispose(){this._provider?.dispose()}}class jit extends ${constructor(e){super(),this._hoverController=e,this.id=rC.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._markdownHoverFocusedIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._markdownHoverFocusedIndex=this._hoverController.focusedMarkdownHoverIndex(),this._onHoverContentsChanged=this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._markdownHoverFocusedIndex=-1,this._hoverController.focus(),this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._onHoverContentsChanged?.dispose())}}class Kit extends jit{constructor(e){super(e),this.options={type:N_.Help}}provideContent(){return this.provideContentAtIndex(this._markdownHoverFocusedIndex)}provideContentAtIndex(e){const t=[];return t.push(xR.intro),t.push(...this._descriptionsOfVerbosityActionsForIndex(e)),t.push(...this._descriptionOfFocusedMarkdownHoverAtIndex(e)),t.join(` `)}_descriptionsOfVerbosityActionsForIndex(e){const t=[],i=this._descriptionOfVerbosityActionForIndex(Yl.Increase,e);i!==void 0&&t.push(i);const s=this._descriptionOfVerbosityActionForIndex(Yl.Decrease,e);return s!==void 0&&t.push(s),t}_descriptionOfVerbosityActionForIndex(e,t){if(this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(t,e))switch(e){case Yl.Increase:return xR.increaseVerbosity;case Yl.Decrease:return xR.decreaseVerbosity}}_descriptionOfFocusedMarkdownHoverAtIndex(e){const t=[],i=this._hoverController.markdownHoverContentAtIndex(e);return i&&(t.push(` `+xR.hoverContent),t.push(` -`+i)),t}}class wHt extends jit{constructor(e,t,i){super(i),this._keybindingService=e,this._editor=t,this.options={type:N_.View},this._initializeOptions(this._editor,i)}provideContent(){const e=this._hoverController.markdownHoverContentAtIndex(this._markdownHoverFocusedIndex);return e.length>0?e:this._hoverController.getWidgetContent()||xR.intro}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Yl.Increase)),e.push(this._getActionFor(this._editor,Yl.Decrease)),e}_getActionFor(e,t){let i,s,o;switch(t){case Yl.Increase:i=VQ,s=rOt,o=Ce.add;break;case Yl.Decrease:i=zQ,s=cOt,o=Ce.remove;break}const r=qtt(this._keybindingService,t),a=this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(this._markdownHoverFocusedIndex,t);return new xn(s,r,$e.asClassName(o),a,()=>{e.getAction(i)?.run({index:this._markdownHoverFocusedIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new Kit(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._markdownHoverFocusedIndex)}}class bHt{constructor(){this.type=N_.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(W_).getContextViewElement(),s=i?.textContent??void 0,o=e.get(Zc);if(!(i.classList.contains("accessible-view-container")||!s))return{id:rC.Hover,verbositySettingKey:"accessibility.verbosity.hover",provideContent(){return s},onClose(){o.showAndFocusLastHover()},options:{language:"typescript",type:N_.View}}}dispose(){}}vn(Nc.ID,Nc,mi.BeforeFirstInteraction);Fe(sHt);Fe(oHt);Fe(rHt);Fe(aHt);Fe(cHt);Fe(lHt);Fe(dHt);Fe(hHt);Fe(uHt);Fe(gHt);Fe(fHt);Fe(pHt);hL.register(X7);hL.register(uAe);Im((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});NQ.register(new _Ht);NQ.register(new vHt);NQ.register(new bHt);function Uf(n,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=n.getOptions(),l=(m,v)=>(v=v||1,h_.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,h_.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=n.getLineContent(t);let f=Uo(u),p=f;o.shouldIncrease(t)?(p=l(p),f=l(f)):o.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(CHt(n,m))continue;const v=n.getLineContent(m),w=Uo(v),b=p;o.shouldDecrease(m,b)&&(p=d(p),f=d(f)),w!==p&&h.push(ds.replaceMove(new mt(m,1,m,w.length+1),PMe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,b)?(f=l(f),p=f):o.shouldIndentNextLine(m,b)?p=l(p):p=f)}return h}function CHt(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===Ar.String:!1}const ih="vs/editor/contrib/indentation/browser/indentation",uce=class uce extends lt{constructor(){super({id:uce.ID,label:g(ih,0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:X.writable,metadata:{description:Be(ih,1,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new xHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};uce.ID="editor.action.indentationToSpaces";let gAe=uce;const gce=class gce extends lt{constructor(){super({id:gce.ID,label:g(ih,2,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:X.writable,metadata:{description:Be(ih,3,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new DHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};gce.ID="editor.action.indentationToTabs";let fAe=gce;class EFe extends lt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(On),s=e.get(Ai),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?g(ih,4,"Configured Tab Size"):d===r.tabSize?g(ih,5,"Default Tab Size"):d===a.tabSize?g(ih,6,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(ih,7,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const fce=class fce extends EFe{constructor(){super(!1,!1,{id:fce.ID,label:g(ih,8,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Be(ih,9,"Use indentation with tabs.")}})}};fce.ID="editor.action.indentUsingTabs";let pAe=fce;const pce=class pce extends EFe{constructor(){super(!0,!1,{id:pce.ID,label:g(ih,10,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Be(ih,11,"Use indentation with spaces.")}})}};pce.ID="editor.action.indentUsingSpaces";let mAe=pce;const mce=class mce extends EFe{constructor(){super(!0,!0,{id:mce.ID,label:g(ih,12,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Be(ih,13,"Change the space size equivalent of the tab.")}})}};mce.ID="editor.action.changeTabDisplaySize";let _Ae=mce;const _ce=class _ce extends lt{constructor(){super({id:_ce.ID,label:g(ih,14,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Be(ih,15,"Detect the indentation from content.")}})}run(e,t){const i=e.get(Ai),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}};_ce.ID="editor.action.detectIndentation";let vAe=_ce;class yHt extends lt{constructor(){super({id:"editor.action.reindentlines",label:g(ih,16,"Reindent Lines"),alias:"Reindent Lines",precondition:X.writable,metadata:{description:Be(ih,17,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=Yit(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class SHt extends lt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(ih,18,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:X.writable,metadata:{description:Be(ih,19,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=Yit(s,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class AHt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(O.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var FH;let bie=(FH=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Z,this.callOnModel=new Z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(x.autoIndent){this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||EHt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(x.autoIndent),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),c=[],l={shiftIndent:f=>h_.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>h_.unshiftIndent(f,f.length+1,o,r,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let h=i.getLineContent(d);if(!/\S/.test(h.substring(0,e.startColumn-1))){const f=w$(s,i,i.getLanguageId(),d,l,this._languageConfigurationService);if(f!==null){const p=Uo(h),m=Uf(f,o),v=Uf(p,o);if(m!==v){const w=e8(m,o,a);c.push({range:new O(d,1,d,p.length+1),text:w}),h=w+h.substr(p.length)}else{const w=MKe(i,d,this._languageConfigurationService);if(w===0||w===Pb.UNINDENT_MASK)return}}}const u=d;for(;di.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,v)=>i.getLanguageIdAtPosition(m,v)},getLineContent:m=>m===u?h:i.getLineContent(m)},i.getLanguageId(),d+1,l,this._languageConfigurationService);if(p!==null){const m=Uf(p,o),v=Uf(Uo(i.getLineContent(d+1)),o);if(m!==v){const w=m-v;for(let b=d+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),y=Uo(C),M=Uf(y,o)+w,k=e8(M,o,a);k!==y&&c.push({range:new O(b,1,b,y.length+1),text:k})}}}}if(c.length>0){this.editor.pushUndoStop();const f=new AHt(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===Ar.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},FH.ID="editor.contrib.autoIndentOnPaste",FH);bie=D([_(1,lo)],bie);function EHt(n,e){const t=i=>Vpt(n,i)===Ar.String;return t(e.getStartPosition())||t(e.getEndPosition())}function Jit(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;rthis.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!r.validate(this.editor))return;const l=O.lift(c.range);let d=c.range;const h=c.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(o=new mt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new kHt(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:UJ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Ta(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(bt)}).catch(bt)):Promise.resolve(void 0)}},UJ=S0,S0.ID="editor.contrib.inPlaceReplaceController",S0.DECORATION=jt.register({description:"in-place-replace",className:"valueSetReplacement"}),S0);PV=UJ=D([_(1,kd)],PV);class LHt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(Xit,0,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Comma,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class THt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(Xit,1,"Replace with Next Value"),alias:"Replace with Next Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Period,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}vn(PV.ID,PV,mi.Lazy);Fe(LHt);Fe(THt);const RHt="vs/editor/contrib/lineSelection/browser/lineSelection";class MHt extends lt{constructor(){super({id:"expandLineSelection",label:g(RHt,0,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,Wi.Explicit,ud.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}Fe(MHt);class Zit{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=Cv.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber0?e:this._hoverController.getWidgetContent()||xR.intro}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Yl.Increase)),e.push(this._getActionFor(this._editor,Yl.Decrease)),e}_getActionFor(e,t){let i,s,o;switch(t){case Yl.Increase:i=VQ,s=rOt,o=Ce.add;break;case Yl.Decrease:i=zQ,s=cOt,o=Ce.remove;break}const r=qtt(this._keybindingService,t),a=this._hoverController.doesMarkdownHoverAtIndexSupportVerbosityAction(this._markdownHoverFocusedIndex,t);return new xn(s,r,$e.asClassName(o),a,()=>{e.getAction(i)?.run({index:this._markdownHoverFocusedIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new Kit(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._markdownHoverFocusedIndex)}}class bHt{constructor(){this.type=N_.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(W_).getContextViewElement(),s=i?.textContent??void 0,o=e.get(el);if(!(i.classList.contains("accessible-view-container")||!s))return{id:rC.Hover,verbositySettingKey:"accessibility.verbosity.hover",provideContent(){return s},onClose(){o.showAndFocusLastHover()},options:{language:"typescript",type:N_.View}}}dispose(){}}vn(Nc.ID,Nc,mi.BeforeFirstInteraction);Fe(sHt);Fe(oHt);Fe(rHt);Fe(aHt);Fe(cHt);Fe(lHt);Fe(dHt);Fe(hHt);Fe(uHt);Fe(gHt);Fe(fHt);Fe(pHt);hL.register(X7);hL.register(uAe);Im((n,e)=>{const t=n.getColor(_Ke);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});NQ.register(new _Ht);NQ.register(new vHt);NQ.register(new bHt);function Uf(n,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=n.getOptions(),l=(m,v)=>(v=v||1,h_.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,h_.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=n.getLineContent(t);let f=Uo(u),p=f;o.shouldIncrease(t)?(p=l(p),f=l(f)):o.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(CHt(n,m))continue;const v=n.getLineContent(m),w=Uo(v),b=p;o.shouldDecrease(m,b)&&(p=d(p),f=d(f)),w!==p&&h.push(ds.replaceMove(new mt(m,1,m,w.length+1),PMe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,b)?(f=l(f),p=f):o.shouldIndentNextLine(m,b)?p=l(p):p=f)}return h}function CHt(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===Ar.String:!1}const ih="vs/editor/contrib/indentation/browser/indentation",uce=class uce extends lt{constructor(){super({id:uce.ID,label:g(ih,0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:X.writable,metadata:{description:Be(ih,1,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new xHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};uce.ID="editor.action.indentationToSpaces";let gAe=uce;const gce=class gce extends lt{constructor(){super({id:gce.ID,label:g(ih,2,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:X.writable,metadata:{description:Be(ih,3,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new DHt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};gce.ID="editor.action.indentationToTabs";let fAe=gce;class EFe extends lt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(On),s=e.get(Ai),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?g(ih,4,"Configured Tab Size"):d===r.tabSize?g(ih,5,"Default Tab Size"):d===a.tabSize?g(ih,6,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(ih,7,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const fce=class fce extends EFe{constructor(){super(!1,!1,{id:fce.ID,label:g(ih,8,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Be(ih,9,"Use indentation with tabs.")}})}};fce.ID="editor.action.indentUsingTabs";let pAe=fce;const pce=class pce extends EFe{constructor(){super(!0,!1,{id:pce.ID,label:g(ih,10,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Be(ih,11,"Use indentation with spaces.")}})}};pce.ID="editor.action.indentUsingSpaces";let mAe=pce;const mce=class mce extends EFe{constructor(){super(!0,!0,{id:mce.ID,label:g(ih,12,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Be(ih,13,"Change the space size equivalent of the tab.")}})}};mce.ID="editor.action.changeTabDisplaySize";let _Ae=mce;const _ce=class _ce extends lt{constructor(){super({id:_ce.ID,label:g(ih,14,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Be(ih,15,"Detect the indentation from content.")}})}run(e,t){const i=e.get(Ai),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}};_ce.ID="editor.action.detectIndentation";let vAe=_ce;class yHt extends lt{constructor(){super({id:"editor.action.reindentlines",label:g(ih,16,"Reindent Lines"),alias:"Reindent Lines",precondition:X.writable,metadata:{description:Be(ih,17,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=Yit(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class SHt extends lt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(ih,18,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:X.writable,metadata:{description:Be(ih,19,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(lo),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=Yit(s,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class AHt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(O.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var FH;let bie=(FH=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Z,this.callOnModel=new Z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(x.autoIndent){this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||EHt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(x.autoIndent),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),c=[],l={shiftIndent:f=>h_.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>h_.unshiftIndent(f,f.length+1,o,r,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let h=i.getLineContent(d);if(!/\S/.test(h.substring(0,e.startColumn-1))){const f=w$(s,i,i.getLanguageId(),d,l,this._languageConfigurationService);if(f!==null){const p=Uo(h),m=Uf(f,o),v=Uf(p,o);if(m!==v){const w=e8(m,o,a);c.push({range:new O(d,1,d,p.length+1),text:w}),h=w+h.substr(p.length)}else{const w=MKe(i,d,this._languageConfigurationService);if(w===0||w===Pb.UNINDENT_MASK)return}}}const u=d;for(;di.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,v)=>i.getLanguageIdAtPosition(m,v)},getLineContent:m=>m===u?h:i.getLineContent(m)},i.getLanguageId(),d+1,l,this._languageConfigurationService);if(p!==null){const m=Uf(p,o),v=Uf(Uo(i.getLineContent(d+1)),o);if(m!==v){const w=m-v;for(let b=d+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),y=Uo(C),M=Uf(y,o)+w,k=e8(M,o,a);k!==y&&c.push({range:new O(b,1,b,y.length+1),text:k})}}}}if(c.length>0){this.editor.pushUndoStop();const f=new AHt(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===Ar.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},FH.ID="editor.contrib.autoIndentOnPaste",FH);bie=D([_(1,lo)],bie);function EHt(n,e){const t=i=>Vpt(n,i)===Ar.String;return t(e.getStartPosition())||t(e.getEndPosition())}function Jit(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;rthis.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!r.validate(this.editor))return;const l=O.lift(c.range);let d=c.range;const h=c.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(o=new mt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new kHt(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:UJ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Ta(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(bt)}).catch(bt)):Promise.resolve(void 0)}},UJ=S0,S0.ID="editor.contrib.inPlaceReplaceController",S0.DECORATION=Kt.register({description:"in-place-replace",className:"valueSetReplacement"}),S0);PV=UJ=D([_(1,kd)],PV);class LHt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(Xit,0,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Comma,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class THt extends lt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(Xit,1,"Replace with Next Value"),alias:"Replace with Next Value",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Period,weight:ye.EditorContrib}})}run(e,t){const i=PV.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}vn(PV.ID,PV,mi.Lazy);Fe(LHt);Fe(THt);const RHt="vs/editor/contrib/lineSelection/browser/lineSelection";class MHt extends lt{constructor(){super({id:"expandLineSelection",label:g(RHt,0,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:ye.EditorCore,kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,Wi.Explicit,ud.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}Fe(MHt);class Zit{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=Cv.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumberh.label).join `)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new O(h,1,h+1,1),null),t.addEditOperation(new O(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` `+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:m=>m===h?e.getLineContent(r.startLineNumber):e.getLineContent(m)},p=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,p);else{const m=w$(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=Uo(e.getLineContent(r.startLineNumber)),w=Uf(m,a),b=Uf(v,a);if(w!==b){const C=w-b;this.getIndentEditsOfMovingBlock(e,t,r,a,l,C)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:s=>h_.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>h_.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===Ga.None||o.indentAction===Ga.Indent?r=o.indentation+o.appendText:o.indentAction===Ga.IndentOutdent?r=o.indentation:o.indentAction===Ga.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const c=Uo(e.getLineContent(s));let l=Uo(r);const d=MKe(e,s,this._languageConfigurationService);d!==null&&d&Pb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Uf(l,i),u=Uf(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(Zv(r)>=0){const a=e.getLineMaxColumn(o),c=LW(this._autoIndent,e,new O(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(Zv(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LW(this._autoIndent,e,new O(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),Zv(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LW(this._autoIndent,e,new O(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(r6.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function NHt(n,e,t){const i=ent(n,e,t);return i?ds.replace(new O(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` `)):null}const wa="vs/editor/contrib/linesOperations/browser/linesOperations";class tnt extends lt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>O.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;rnew oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Re),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new zOt(o,s,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};vce.ID="editor.action.trimTrailingWhitespace";let bAe=vce;class zHt extends lt{constructor(){super({id:"editor.action.deleteLines",label:g(wa,14,"Delete Line"),alias:"Delete Line",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyK,weight:ye.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=s.getLineMaxColumn(h)),r.push(ds.replace(new mt(h,f,u,p),"")),a.push(new mt(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class $Ht extends lt{constructor(){super({id:"editor.action.indentLines",label:g(wa,15,"Indent Line"),alias:"Indent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketRight,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class GHt extends lt{constructor(){super({id:"editor.action.outdentLines",label:g(wa,16,"Outdent Line"),alias:"Outdent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketLeft,weight:ye.EditorContrib}})}run(e,t){TW.Outdent.runEditorCommand(e,t,null)}}class qHt extends lt{constructor(){super({id:"editor.action.insertLineBefore",label:g(wa,17,"Insert Line Above"),alias:"Insert Line Above",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class QHt extends lt{constructor(){super({id:"editor.action.insertLineAfter",label:g(wa,18,"Insert Line Below"),alias:"Insert Line Below",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class snt extends lt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let c=0,l=s.length-1;cds.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class jHt extends snt{constructor(){super({id:"deleteAllLeft",label:g(wa,19,"Delete All Left"),alias:"Delete All Left",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.CtrlCmd|E.Backspace},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new mt(c,r.startColumn,c,r.startColumn)}else a=new mt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(O.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new O(r,a,o.startLineNumber,1)}else return new O(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new O(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class KHt extends snt{constructor(){super({id:"deleteAllRight",label:g(wa,20,"Delete All Right"),alias:"Delete All Right",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyK,secondary:[V.CtrlCmd|E.Delete]},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new O(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new O(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(O.compareRangesUsingStarts),s}}class YHt extends lt{constructor(){super({id:"editor.action.joinLines",label:g(wa,21,"Join Lines"),alias:"Join Lines",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyJ},weight:ye.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(O.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(s.equalsSelection(u)&&(s=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=s,h=0;for(let u=0,f=o.length;u=1){let z=!0;S===""&&(z=!1),z&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(z=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const U=F.substr(N-1);S+=(z?" ":"")+U,z?w=U.length+1:w=U.length}else w=0}const M=new O(m,v,b,C);if(!M.isEmpty()){let k;p.isEmpty()?(c.push(ds.replace(M,S)),k=new mt(M.startLineNumber-h,S.length-w+1,m-h,S.length-w+1)):p.startLineNumber===p.endLineNumber?(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,S.length-y)),O.intersectRanges(M,s)!==null?d=k:l.push(k)}h+=M.endLineNumber-M.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class JHt extends lt{constructor(){super({id:"editor.action.transpose",label:g(wa,22,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:X.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===s.getLineCount())continue;const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new zd(new mt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new FMe(h,u,new mt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class LO extends lt{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(x.wordSeparators),r=[];for(const a of i)if(a.isEmpty()){const c=a.getStartPosition(),l=t.getConfiguredWordAtPosition(c);if(!l)continue;const d=new O(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=s.getValueInRange(d);r.push(ds.replace(d,this._modifyText(h,o)))}else{const c=s.getValueInRange(a);r.push(ds.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class XHt extends LO{constructor(){super({id:"editor.action.transformToUppercase",label:g(wa,23,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class ZHt extends LO{constructor(){super({id:"editor.action.transformToLowercase",label:g(wa,24,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class vx{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const wce=class wce extends LO{constructor(){super({id:"editor.action.transformToTitlecase",label:g(wa,25,"Transform to Title Case"),alias:"Transform to Title Case",precondition:X.writable})}_modifyText(e,t){const i=wce.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};wce.titleBoundary=new vx("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let Cie=wce;const J2=class J2 extends LO{constructor(){super({id:"editor.action.transformToSnakecase",label:g(wa,26,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:X.writable})}_modifyText(e,t){const i=J2.caseBoundary.get(),s=J2.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};J2.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),J2.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let t8=J2;const bce=class bce extends LO{constructor(){super({id:"editor.action.transformToCamelcase",label:g(wa,27,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:X.writable})}_modifyText(e,t){const i=bce.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};bce.wordBoundary=new vx("[_\\s-]","gm");let yie=bce;const X2=class X2 extends LO{constructor(){super({id:"editor.action.transformToPascalcase",label:g(wa,28,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:X.writable})}_modifyText(e,t){const i=X2.wordBoundary.get(),s=X2.wordBoundaryToMaintain.get();return!i||!s?e:e.split(s).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};X2.wordBoundary=new vx("[_\\s-]","gm"),X2.wordBoundaryToMaintain=new vx("(?<=\\.)","gm");let Sie=X2;const fk=class fk extends LO{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(wa,29,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:X.writable})}_modifyText(e,t){const i=fk.caseBoundary.get(),s=fk.singleLetters.get(),o=fk.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};fk.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),fk.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),fk.underscoreBoundary=new vx("(\\S)(_)(\\S)","gm");let Aie=fk;Fe(PHt);Fe(FHt);Fe(OHt);Fe(BHt);Fe(WHt);Fe(HHt);Fe(UHt);Fe(VHt);Fe(bAe);Fe(zHt);Fe($Ht);Fe(GHt);Fe(qHt);Fe(QHt);Fe(jHt);Fe(KHt);Fe(YHt);Fe(JHt);Fe(XHt);Fe(ZHt);t8.caseBoundary.isSupported()&&t8.singleLetters.isSupported()&&Fe(t8);yie.wordBoundary.isSupported()&&Fe(yie);Sie.wordBoundary.isSupported()&&Fe(Sie);Cie.titleBoundary.isSupported()&&Fe(Cie);Aie.isSupported()&&Fe(Aie);var eUt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";Ct(eUt,{});var VJ;const ont="vs/editor/contrib/linkedEditing/browser/linkedEditing",rnt=new Y("LinkedEditingInputVisible",!1),tUt="linked-editing-decoration";var A0;let FV=(A0=class extends ${static get(e){return e.getContribution(VJ.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=rnt.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(x.linkedEditing)||r.hasChanged(x.renameOnType))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(x.linkedEditing)||this._editor.getOption(x.renameOnType))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(T.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new Lu(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Lu(0),a=c=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const l=this._currentDecorations.getRange(0);if(l&&c.changes.every(d=>l.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=this._currentRequestCts=new ai;try{const r=new ao(!1),a=await ant(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let c=[];a?.ranges&&(c=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let l=!1;for(let h=0,u=c.length;h({range:h,options:VJ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Na(r)||bt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},VJ=A0,A0.ID="editor.contrib.linkedEditing",A0.DECORATION=jt.register({description:"linked-editing",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:tUt}),A0);FV=VJ=D([_(1,Pe),_(2,ht),_(3,lo),_(4,B_)],FV);class iUt extends lt{constructor(){super({id:"editor.action.linkedEditing",label:g(ont,0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F2,weight:ye.EditorContrib}})}runCommand(e,t){const i=e.get(Qt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=FV.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const nUt=Yc.bindToContribution(FV.get);Ke(new nUt({id:"cancelLinkedEditingInput",precondition:rnt,handler:n=>n.clearRanges(),kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib+99,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));function ant(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){er(r);return}}),o=>!!o&&mo(o?.ranges))}B("editor.linkedEditingBackground",{dark:fe.fromHex("#f00").transparent(.3),light:fe.fromHex("#f00").transparent(.3),hcDark:fe.fromHex("#f00").transparent(.3),hcLight:fe.white},g(ont,1,"Background color when the editor auto renames on type."));nA("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(ht);return ant(i,e,t,qe.None)});vn(FV.ID,FV,mi.AfterFirstRender);Fe(iUt);const Cce=class Cce extends ${static get(e){return e.getContribution(Cce.ID)}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(x.stopRenderingLineAfter);i>=0&&t.target.type===Mt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};Cce.ID="editor.contrib.longLinesHelper";let Eie=Cce;vn(Eie.ID,Eie,mi.BeforeFirstInteraction);var sUt=".monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);border:1px solid var(--vscode-editor-selectionHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);border:1px solid var(--vscode-editor-wordHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);border:1px solid var(--vscode-editor-wordHighlightStrongBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);border:1px solid var(--vscode-editor-wordHighlightTextBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}";Ct(sUt,{});const lD="vs/editor/contrib/wordHighlighter/browser/highlightDecorations",GK=B("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(lD,0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(lD,1,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightTextBackground",{light:GK,dark:GK,hcDark:GK,hcLight:GK},g(lD,2,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const qK=B("editor.wordHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,3,"Border color of a symbol during read-access, like reading a variable."));B("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,4,"Border color of a symbol during write-access, like writing to a variable."));B("editor.wordHighlightTextBorder",{light:qK,dark:qK,hcDark:qK,hcLight:qK},g(lD,5,"Border color of a textual occurrence for a symbol."));const oUt=B("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(lD,6,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),rUt=B("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},g(lD,7,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aUt=B("editorOverviewRuler.wordHighlightTextForeground",{dark:g3,light:g3,hcDark:g3,hcLight:g3},g(lD,8,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),cUt=jt.register({description:"word-highlight-strong",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:Nr(rUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),lUt=jt.register({description:"word-highlight-text",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:Nr(aUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),dUt=jt.register({description:"selection-highlight-overview",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:Nr(g3),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),hUt=jt.register({description:"selection-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),uUt=jt.register({description:"word-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:Nr(oUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}});function gUt(n){return n===D9.Write?cUt:n===D9.Text?lUt:uUt}function fUt(n){return n?hUt:dUt}Im((n,e)=>{const t=n.getColor(kMe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var CAe;const kl="vs/editor/contrib/multicursor/browser/multicursor";function uL(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?g(kl,0,"Cursor added: {0}",i):g(kl,1,"Cursors added: {0}",i);Cu(s)}}class pUt extends lt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(kl,2,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.UpArrow,linux:{primary:V.Shift|V.Alt|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,3,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Wi.Explicit,ud.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),uL(r,o.getCursorStates())}}class mUt extends lt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(kl,4,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.DownArrow,linux:{primary:V.Shift|V.Alt|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,5,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Wi.Explicit,ud.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),uL(r,o.getCursorStates())}}class _Ut extends lt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(kl,6,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyI,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,7,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new mt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),uL(r,o.getCursorStates())}}class vUt extends lt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(kl,8,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=s;c++)o.push(new mt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),uL(a,r.getCursorStates())}}class wUt extends lt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(kl,9,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new mt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),uL(r,o.getCursorStates())}}class QK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class a6{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new a6(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const c=e.getSelection();let l,d=null;if(c.isEmpty()){const h=e.getConfiguredWordAtPosition(c.getStartPosition());if(!h)return null;l=h.word,d=new mt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` -`);return new a6(e,t,s,l,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}}const yce=class yce extends ${static get(e){return e.getContribution(yce.ID)}constructor(e){super(),this._sessionDispose=this._register(new Z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=a6.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=pu.True,i.matchCaseOverride=pu.True,i.isRegexOverride=pu.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:pu.NotSet,matchCaseOverride:pu.NotSet,isRegexOverride:pu.NotSet};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new mt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!cnt(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};yce.ID="editor.contrib.multiCursorController";let OV=yce;class Vz extends lt{run(e,t){const i=OV.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=vf.get(t);if(r)this._run(i,r);else{const a=e.get(be).createInstance(vf,t);this._run(i,a),a.dispose()}uL(o,s.getCursorStates())}}}class bUt extends Vz{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(kl,10,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.KeyD,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,11,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class CUt extends Vz{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(kl,12,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,13,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class yUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(kl,14,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyD),weight:ye.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class SUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(kl,15,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class AUt extends Vz{constructor(){super({id:"editor.action.selectHighlights",label:g(kl,16,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.KeyL,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,17,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class EUt extends Vz{constructor(){super({id:"editor.action.changeAll",label:g(kl,18,"Change All Occurrences"),alias:"Change All Occurrences",precondition:ge.and(X.writable,X.editorTextFocus),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class xUt{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(O.compareRangesUsingStarts)),this._cachedFindMatches}}var VN;let xie=(VN=class extends ${constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(x.selectionHighlight),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new yn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===Wi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=vf.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(CAe._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=OV.get(i);if(!o)return null;const r=vf.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const u=r.getState().matchCase;if(!cnt(i.getModel(),d,u))return null}a=a6.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=r.getState(),l=c.matchCase;if(c.isRevealed){let d=c.searchString;l||(d=d.toLowerCase());let h=a.searchText;if(l||(h=h.toLowerCase()),d===h&&a.matchCase===c.matchCase&&a.wholeWord===c.wholeWord&&!c.isRegex)return null}return new xUt(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(x.wordSeparators):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(O.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=s.length;l=u)o.push(f),l++;else{const p=O.compareRangesUsingStarts(f,s[d]);p<0?((s[d].isEmpty()||!O.areIntersecting(f,s[d]))&&o.push(f),l++):(p>0||l++,d++)}}const r=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,c=o.map(l=>({range:l,options:fUt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},CAe=VN,VN.ID="editor.contrib.selectionHighlighter",VN);xie=CAe=D([_(1,ht)],xie);function cnt(n,e,t){const i=wze(n,e[0],!t);for(let s=1,o=e.length;sthis.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;let a=this.model.range?.read(s);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const c=(a?a.startLineNumber===a.endLineNumber:!0)&&r.parts.length===1&&r.parts[0].lines.length===1,l=r.parts.length===1&&r.parts[0].lines.every(b=>b.length===0),d=[],h=[];function u(b,C){if(h.length>0){const y=h[h.length-1];C&&y.decorations.push(new ig(y.content.length+1,y.content.length+1+b[0].length,C,Rc.Regular)),y.content+=b[0],b=b.slice(1)}for(const y of b)h.push({content:y,decorations:C?[new ig(1,y.length+1,C,Rc.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l){for(const b of r.parts){let C=b.lines;a&&!c&&(u(C,Cpe),C=[]),p===void 0?(d.push({column:b.column,text:C[0],preview:b.preview}),C=C.slice(1)):u([f.substring(m,b.column-1)],void 0),C.length>0&&(u(C,Cpe),p===void 0&&b.column<=f.length&&(p=b.column)),m=b.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new Jet(p,f.length+1):void 0,w=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:w,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l,backgroundColoring:this.model.backgroundColoring.read(s)}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];if(o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const l=o.range.endLineNumber-o.range.startLineNumber;for(let d=0;d{const o=this.uiState.read(s);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};yAe=D([_(2,Di)],yAe);var NUt=".monaco-editor .inlineEditHints.withBorder{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);z-index:39}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}";Ct(NUt,{});var zJ;let SAe=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.widget.model.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Em((s,o)=>{if(!this.model.read(s)||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(Die,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};SAe=D([_(2,be)],SAe);var E0;let Die=(E0=class extends ${static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,s,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${zJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(s.createInstance(AAe,this.nodes.toolBar,this.editor,Te.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof id)return s.createInstance(PUt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{zJ._dropDownVisible=a})),this._register(Ni(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(Ni(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof id&&c.push(h);c.length>0&&c.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},zJ=E0,E0._dropDownVisible=!1,E0.id=0,E0);Die=zJ=D([_(3,be),_(4,Pe),_(5,mc)],Die);class PUt extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,zc,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let AAe=class extends lV{constructor(e,t,i,s,o,r,a,c,l,d){super(e,{resetMenu:i,...s},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=s,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};AAe=D([_(4,mc),_(5,Pe),_(6,Vr),_(7,ti),_(8,Qi),_(9,on)],AAe);var XL;class FUt{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}var Ab;let zh=(Ab=class extends ${static get(e){return e.getContribution(XL.ID)}constructor(e,t,i,s,o,r){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=s,this._commandService=o,this._configurationService=r,this._isVisibleContext=XL.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=XL.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(_7(this,void 0)),this._isAccepting=xi(this,!1),this._enabled=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily),this._backgroundColoring=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).backgroundColoring);const a=Bh("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Ni(u=>{this._enabled.read(u)&&(a.read(u),!this._isAccepting.read(u)&&this.getInlineEdit(e,!0))}));const c=Wn(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Ni(u=>{if(!this._enabled.read(u))return;const f=c.read(u);f&&this.checkCursorPosition(f)})),this._register(Ni(u=>{const f=this._currentEdit.read(u);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const p=e.getPosition();p&&this.checkCursorPosition(p)}));const l=Bh("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Ni(async u=>{this._enabled.read(u)&&(l.read(u),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const d=Bh("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Ni(u=>{this._enabled.read(u)&&(d.read(u),this.getInlineEdit(e,!0))}));const h=this._register(uje());this._register(Ni(u=>{const f=this._fontFamily.read(u);h.setStyle(f===""||f==="default"?"":` +`))),o.push(p),r+=l.endLineNumber-l.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,s,a?o:void 0),t.pushUndoStop()}}const vce=class vce extends lt{constructor(){super({id:vce.ID,label:g(wa,13,"Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyX),weight:ye.EditorContrib}})}run(e,t,i){let s=[];i.reason==="auto-save"&&(s=(t.getSelections()||[]).map(d=>new oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Re),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new zOt(o,s,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};vce.ID="editor.action.trimTrailingWhitespace";let bAe=vce;class zHt extends lt{constructor(){super({id:"editor.action.deleteLines",label:g(wa,14,"Delete Line"),alias:"Delete Line",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|V.Shift|E.KeyK,weight:ye.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=s.getLineMaxColumn(h)),r.push(ds.replace(new mt(h,f,u,p),"")),a.push(new mt(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class $Ht extends lt{constructor(){super({id:"editor.action.indentLines",label:g(wa,15,"Indent Line"),alias:"Indent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketRight,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class GHt extends lt{constructor(){super({id:"editor.action.outdentLines",label:g(wa,16,"Outdent Line"),alias:"Outdent Line",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.BracketLeft,weight:ye.EditorContrib}})}run(e,t){TW.Outdent.runEditorCommand(e,t,null)}}class qHt extends lt{constructor(){super({id:"editor.action.insertLineBefore",label:g(wa,17,"Insert Line Above"),alias:"Insert Line Above",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class QHt extends lt{constructor(){super({id:"editor.action.insertLineAfter",label:g(wa,18,"Insert Line Below"),alias:"Insert Line Below",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zr.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class snt extends lt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let c=0,l=s.length-1;cds.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class jHt extends snt{constructor(){super({id:"deleteAllLeft",label:g(wa,19,"Delete All Left"),alias:"Delete All Left",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.CtrlCmd|E.Backspace},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new mt(c,r.startColumn,c,r.startColumn)}else a=new mt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(O.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new O(r,a,o.startLineNumber,1)}else return new O(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new O(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class KHt extends snt{constructor(){super({id:"deleteAllRight",label:g(wa,20,"Delete All Right"),alias:"Delete All Right",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyK,secondary:[V.CtrlCmd|E.Delete]},weight:ye.EditorContrib}})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new O(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new O(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(O.compareRangesUsingStarts),s}}class YHt extends lt{constructor(){super({id:"editor.action.joinLines",label:g(wa,21,"Join Lines"),alias:"Join Lines",precondition:X.writable,kbOpts:{kbExpr:X.editorTextFocus,primary:0,mac:{primary:V.WinCtrl|E.KeyJ},weight:ye.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(O.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(s.equalsSelection(u)&&(s=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new mt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=s,h=0;for(let u=0,f=o.length;u=1){let z=!0;S===""&&(z=!1),z&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(z=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const U=F.substr(N-1);S+=(z?" ":"")+U,z?w=U.length+1:w=U.length}else w=0}const M=new O(m,v,b,C);if(!M.isEmpty()){let k;p.isEmpty()?(c.push(ds.replace(M,S)),k=new mt(M.startLineNumber-h,S.length-w+1,m-h,S.length-w+1)):p.startLineNumber===p.endLineNumber?(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(ds.replace(M,S)),k=new mt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,S.length-y)),O.intersectRanges(M,s)!==null?d=k:l.push(k)}h+=M.endLineNumber-M.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class JHt extends lt{constructor(){super({id:"editor.action.transpose",label:g(wa,22,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:X.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===s.getLineCount())continue;const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new zd(new mt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new O(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new FMe(h,u,new mt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class LO extends lt{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(x.wordSeparators),r=[];for(const a of i)if(a.isEmpty()){const c=a.getStartPosition(),l=t.getConfiguredWordAtPosition(c);if(!l)continue;const d=new O(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=s.getValueInRange(d);r.push(ds.replace(d,this._modifyText(h,o)))}else{const c=s.getValueInRange(a);r.push(ds.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class XHt extends LO{constructor(){super({id:"editor.action.transformToUppercase",label:g(wa,23,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class ZHt extends LO{constructor(){super({id:"editor.action.transformToLowercase",label:g(wa,24,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:X.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class vx{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const wce=class wce extends LO{constructor(){super({id:"editor.action.transformToTitlecase",label:g(wa,25,"Transform to Title Case"),alias:"Transform to Title Case",precondition:X.writable})}_modifyText(e,t){const i=wce.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};wce.titleBoundary=new vx("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let Cie=wce;const J2=class J2 extends LO{constructor(){super({id:"editor.action.transformToSnakecase",label:g(wa,26,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:X.writable})}_modifyText(e,t){const i=J2.caseBoundary.get(),s=J2.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};J2.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),J2.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let t8=J2;const bce=class bce extends LO{constructor(){super({id:"editor.action.transformToCamelcase",label:g(wa,27,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:X.writable})}_modifyText(e,t){const i=bce.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};bce.wordBoundary=new vx("[_\\s-]","gm");let yie=bce;const X2=class X2 extends LO{constructor(){super({id:"editor.action.transformToPascalcase",label:g(wa,28,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:X.writable})}_modifyText(e,t){const i=X2.wordBoundary.get(),s=X2.wordBoundaryToMaintain.get();return!i||!s?e:e.split(s).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};X2.wordBoundary=new vx("[_\\s-]","gm"),X2.wordBoundaryToMaintain=new vx("(?<=\\.)","gm");let Sie=X2;const fk=class fk extends LO{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(wa,29,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:X.writable})}_modifyText(e,t){const i=fk.caseBoundary.get(),s=fk.singleLetters.get(),o=fk.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};fk.caseBoundary=new vx("(\\p{Ll})(\\p{Lu})","gmu"),fk.singleLetters=new vx("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),fk.underscoreBoundary=new vx("(\\S)(_)(\\S)","gm");let Aie=fk;Fe(PHt);Fe(FHt);Fe(OHt);Fe(BHt);Fe(WHt);Fe(HHt);Fe(UHt);Fe(VHt);Fe(bAe);Fe(zHt);Fe($Ht);Fe(GHt);Fe(qHt);Fe(QHt);Fe(jHt);Fe(KHt);Fe(YHt);Fe(JHt);Fe(XHt);Fe(ZHt);t8.caseBoundary.isSupported()&&t8.singleLetters.isSupported()&&Fe(t8);yie.wordBoundary.isSupported()&&Fe(yie);Sie.wordBoundary.isSupported()&&Fe(Sie);Cie.titleBoundary.isSupported()&&Fe(Cie);Aie.isSupported()&&Fe(Aie);var eUt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";Ct(eUt,{});var VJ;const ont="vs/editor/contrib/linkedEditing/browser/linkedEditing",rnt=new Y("LinkedEditingInputVisible",!1),tUt="linked-editing-decoration";var A0;let FV=(A0=class extends ${static get(e){return e.getContribution(VJ.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=rnt.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(x.linkedEditing)||r.hasChanged(x.renameOnType))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(x.linkedEditing)||this._editor.getOption(x.renameOnType))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(T.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new Lu(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Lu(0),a=c=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const l=this._currentDecorations.getRange(0);if(l&&c.changes.every(d=>l.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=this._currentRequestCts=new ai;try{const r=new ao(!1),a=await ant(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let c=[];a?.ranges&&(c=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let l=!1;for(let h=0,u=c.length;h({range:h,options:VJ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Na(r)||bt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},VJ=A0,A0.ID="editor.contrib.linkedEditing",A0.DECORATION=Kt.register({description:"linked-editing",stickiness:gi.AlwaysGrowsWhenTypingAtEdges,className:tUt}),A0);FV=VJ=D([_(1,Pe),_(2,ht),_(3,lo),_(4,B_)],FV);class iUt extends lt{constructor(){super({id:"editor.action.linkedEditing",label:g(ont,0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.F2,weight:ye.EditorContrib}})}runCommand(e,t){const i=e.get(jt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=FV.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const nUt=Jc.bindToContribution(FV.get);Ke(new nUt({id:"cancelLinkedEditingInput",precondition:rnt,handler:n=>n.clearRanges(),kbOpts:{kbExpr:X.editorTextFocus,weight:ye.EditorContrib+99,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));function ant(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){er(r);return}}),o=>!!o&&mo(o?.ranges))}B("editor.linkedEditingBackground",{dark:fe.fromHex("#f00").transparent(.3),light:fe.fromHex("#f00").transparent(.3),hcDark:fe.fromHex("#f00").transparent(.3),hcLight:fe.white},g(ont,1,"Background color when the editor auto renames on type."));nA("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(ht);return ant(i,e,t,qe.None)});vn(FV.ID,FV,mi.AfterFirstRender);Fe(iUt);const Cce=class Cce extends ${static get(e){return e.getContribution(Cce.ID)}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(x.stopRenderingLineAfter);i>=0&&t.target.type===Mt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};Cce.ID="editor.contrib.longLinesHelper";let Eie=Cce;vn(Eie.ID,Eie,mi.BeforeFirstInteraction);var sUt=".monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);border:1px solid var(--vscode-editor-selectionHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);border:1px solid var(--vscode-editor-wordHighlightBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);border:1px solid var(--vscode-editor-wordHighlightStrongBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);border:1px solid var(--vscode-editor-wordHighlightTextBorder);box-sizing:border-box}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}";Ct(sUt,{});const lD="vs/editor/contrib/wordHighlighter/browser/highlightDecorations",GK=B("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(lD,0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(lD,1,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);B("editor.wordHighlightTextBackground",{light:GK,dark:GK,hcDark:GK,hcLight:GK},g(lD,2,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const qK=B("editor.wordHighlightBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,3,"Border color of a symbol during read-access, like reading a variable."));B("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:co,hcLight:co},g(lD,4,"Border color of a symbol during write-access, like writing to a variable."));B("editor.wordHighlightTextBorder",{light:qK,dark:qK,hcDark:qK,hcLight:qK},g(lD,5,"Border color of a textual occurrence for a symbol."));const oUt=B("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(lD,6,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),rUt=B("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},g(lD,7,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aUt=B("editorOverviewRuler.wordHighlightTextForeground",{dark:g3,light:g3,hcDark:g3,hcLight:g3},g(lD,8,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),cUt=Kt.register({description:"word-highlight-strong",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:Nr(rUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),lUt=Kt.register({description:"word-highlight-text",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:Nr(aUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),dUt=Kt.register({description:"selection-highlight-overview",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:Nr(g3),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}}),hUt=Kt.register({description:"selection-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),uUt=Kt.register({description:"word-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:Nr(oUt),position:oh.Center},minimap:{color:Nr(nde),position:xu.Inline}});function gUt(n){return n===D9.Write?cUt:n===D9.Text?lUt:uUt}function fUt(n){return n?hUt:dUt}Im((n,e)=>{const t=n.getColor(kMe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var CAe;const kl="vs/editor/contrib/multicursor/browser/multicursor";function uL(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?g(kl,0,"Cursor added: {0}",i):g(kl,1,"Cursors added: {0}",i);Cu(s)}}class pUt extends lt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(kl,2,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.UpArrow,linux:{primary:V.Shift|V.Alt|E.UpArrow,secondary:[V.CtrlCmd|V.Shift|E.UpArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,3,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Wi.Explicit,ud.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),uL(r,o.getCursorStates())}}class mUt extends lt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(kl,4,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Alt|E.DownArrow,linux:{primary:V.Shift|V.Alt|E.DownArrow,secondary:[V.CtrlCmd|V.Shift|E.DownArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,5,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Wi.Explicit,ud.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),uL(r,o.getCursorStates())}}class _Ut extends lt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(kl,6,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.KeyI,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,7,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new mt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),uL(r,o.getCursorStates())}}class vUt extends lt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(kl,8,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=s;c++)o.push(new mt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),uL(a,r.getCursorStates())}}class wUt extends lt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(kl,9,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new mt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),uL(r,o.getCursorStates())}}class QK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class a6{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new a6(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const c=e.getSelection();let l,d=null;if(c.isEmpty()){const h=e.getConfiguredWordAtPosition(c.getStartPosition());if(!h)return null;l=h.word,d=new mt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` +`);return new a6(e,t,s,l,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.concat(e),e,vt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new QK(t.slice(0,t.length-1).concat(e),e,vt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1);return i?new mt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}}const yce=class yce extends ${static get(e){return e.getContribution(yce.ID)}constructor(e){super(),this._sessionDispose=this._register(new Z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=a6.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=pu.True,i.matchCaseOverride=pu.True,i.isRegexOverride=pu.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:pu.NotSet,matchCaseOverride:pu.NotSet,isRegexOverride:pu.NotSet};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new mt(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!cnt(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Zn.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew mt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};yce.ID="editor.contrib.multiCursorController";let OV=yce;class Vz extends lt{run(e,t){const i=OV.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=vf.get(t);if(r)this._run(i,r);else{const a=e.get(be).createInstance(vf,t);this._run(i,a),a.dispose()}uL(o,s.getCursorStates())}}}class bUt extends Vz{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(kl,10,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|E.KeyD,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,11,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class CUt extends Vz{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(kl,12,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,13,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class yUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(kl,14,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|E.KeyD),weight:ye.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class SUt extends Vz{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(kl,15,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class AUt extends Vz{constructor(){super({id:"editor.action.selectHighlights",label:g(kl,16,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:X.focus,primary:V.CtrlCmd|V.Shift|E.KeyL,weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:g(kl,17,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class EUt extends Vz{constructor(){super({id:"editor.action.changeAll",label:g(kl,18,"Change All Occurrences"),alias:"Change All Occurrences",precondition:ge.and(X.writable,X.editorTextFocus),kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class xUt{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(O.compareRangesUsingStarts)),this._cachedFindMatches}}var VN;let xie=(VN=class extends ${constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(x.selectionHighlight),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new yn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===Wi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=vf.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(CAe._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=OV.get(i);if(!o)return null;const r=vf.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const u=r.getState().matchCase;if(!cnt(i.getModel(),d,u))return null}a=a6.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=r.getState(),l=c.matchCase;if(c.isRevealed){let d=c.searchString;l||(d=d.toLowerCase());let h=a.searchText;if(l||(h=h.toLowerCase()),d===h&&a.matchCase===c.matchCase&&a.wholeWord===c.wholeWord&&!c.isRegex)return null}return new xUt(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(x.wordSeparators):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(O.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=s.length;l=u)o.push(f),l++;else{const p=O.compareRangesUsingStarts(f,s[d]);p<0?((s[d].isEmpty()||!O.areIntersecting(f,s[d]))&&o.push(f),l++):(p>0||l++,d++)}}const r=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,c=o.map(l=>({range:l,options:fUt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},CAe=VN,VN.ID="editor.contrib.selectionHighlighter",VN);xie=CAe=D([_(1,ht)],xie);function cnt(n,e,t){const i=wze(n,e[0],!t);for(let s=1,o=e.length;sthis.editor.getModel()),this.uiState=Dt(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;let a=this.model.range?.read(s);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const c=(a?a.startLineNumber===a.endLineNumber:!0)&&r.parts.length===1&&r.parts[0].lines.length===1,l=r.parts.length===1&&r.parts[0].lines.every(b=>b.length===0),d=[],h=[];function u(b,C){if(h.length>0){const y=h[h.length-1];C&&y.decorations.push(new ig(y.content.length+1,y.content.length+1+b[0].length,C,Rc.Regular)),y.content+=b[0],b=b.slice(1)}for(const y of b)h.push({content:y,decorations:C?[new ig(1,y.length+1,C,Rc.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l){for(const b of r.parts){let C=b.lines;a&&!c&&(u(C,Cpe),C=[]),p===void 0?(d.push({column:b.column,text:C[0],preview:b.preview}),C=C.slice(1)):u([f.substring(m,b.column-1)],void 0),C.length>0&&(u(C,Cpe),p===void 0&&b.column<=f.length&&(p=b.column)),m=b.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new Jet(p,f.length+1):void 0,w=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:w,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l,backgroundColoring:this.model.backgroundColoring.read(s)}}),this.decorations=Dt(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];if(o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const l=o.range.endLineNumber-o.range.startLineNumber;for(let d=0;d{const o=this.uiState.read(s);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(Xet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};yAe=D([_(2,Di)],yAe);var NUt=".monaco-editor .inlineEditHints.withBorder{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);z-index:39}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}";Ct(NUt,{});var zJ;let SAe=class extends ${constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Dt(this,s=>{const o=this.model.read(s)?.widget.model.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new oe(o.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Em((s,o)=>{if(!this.model.read(s)||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(Die,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};SAe=D([_(2,be)],SAe);var E0;let Die=(E0=class extends ${static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,s,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${zJ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=di("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[di("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(s.createInstance(AAe,this.nodes.toolBar,this.editor,Te.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof id)return s.createInstance(PUt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{zJ._dropDownVisible=a})),this._register(Ni(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(Ni(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof id&&c.push(h);c.length>0&&c.unshift(new Kr),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[hs.ABOVE,hs.BELOW],positionAffinity:jo.LeftOfInjectedText}}},zJ=E0,E0._dropDownVisible=!1,E0.id=0,E0);Die=zJ=D([_(3,be),_(4,Pe),_(5,_c)],Die);class PUt extends eC{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=di("div.keybinding").root;this._register(new Dz(t,$c,{disableTitle:!0,...TXe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let AAe=class extends lV{constructor(e,t,i,s,o,r,a,c,l,d){super(e,{resetMenu:i,...s},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=s,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];tD(this.menu,this.options2?.menuOptions,{primary:e,secondary:t},this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Ls(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ls(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};AAe=D([_(4,_c),_(5,Pe),_(6,Vr),_(7,ti),_(8,ji),_(9,rn)],AAe);var XL;class FUt{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}var Ab;let zh=(Ab=class extends ${static get(e){return e.getContribution(XL.ID)}constructor(e,t,i,s,o,r){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=s,this._commandService=o,this._configurationService=r,this._isVisibleContext=XL.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=XL.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(_7(this,void 0)),this._isAccepting=xi(this,!1),this._enabled=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily),this._backgroundColoring=Wn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).backgroundColoring);const a=Bh("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Ni(u=>{this._enabled.read(u)&&(a.read(u),!this._isAccepting.read(u)&&this.getInlineEdit(e,!0))}));const c=Wn(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Ni(u=>{if(!this._enabled.read(u))return;const f=c.read(u);f&&this.checkCursorPosition(f)})),this._register(Ni(u=>{const f=this._currentEdit.read(u);if(this._isCursorAtInlineEditContext.set(!1),!f){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const p=e.getPosition();p&&this.checkCursorPosition(p)}));const l=Bh("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Ni(async u=>{this._enabled.read(u)&&(l.read(u),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const d=Bh("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Ni(u=>{this._enabled.read(u)&&(d.read(u),this.getInlineEdit(e,!0))}));const h=this._register(uje());this._register(Ni(u=>{const f=this._fontFamily.read(u);h.setStyle(f===""||f==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { @@ -778,40 +778,40 @@ This action is irreversible and may result in data loss!`,c.map(h=>h.label).join }`)})),this._register(new SAe(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get()?.edit;if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(O.containsPosition(t.range,e))}validateInlineEdit(e,t){if(t.text.includes(` `)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const s=t.range.endLineNumber,o=t.range.endColumn,r=e.getModel()?.getLineLength(s)??0;if(o!==r+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const s=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new ai;const a=this._currentRequestCts.token,c=t?MU.Automatic:MU.Invoke;if(t&&await OUt(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)return;const d=await r.provideInlineEdit(i,{triggerKind:c},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);if(!i)return;const s=i.range.endLineNumber,o=i.range.endColumn,r=i.text.endsWith(` `)&&!(i.range.startLineNumber===i.range.endLineNumber&&i.range.startColumn===i.range.endColumn)?i.text.slice(0,-1):i.text,a=new q7(s,[new Ete(o,r,!1)]),c=this.instantiationService.createInstance(yAe,this.editor,{ghostText:Au(a),minReservedLineCount:Au(0),targetTextModel:Au(this.editor.getModel()??void 0),range:Au(i.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new FUt(c,i),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get()?.edit;if(!e)return;let t=e.text;e.text.startsWith(` -`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ds.replace(O.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,er),this.freeEdit(e),En(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get()?.edit;if(!e)return;const t=oe.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get()?.edit;t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,er),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const i=t.edit,s=t.widget.model;if(O.containsPosition(i.range,e.getStartPosition())||O.containsPosition(i.range,e.getEndPosition()))return!0;const r=s.ghostText.get();return r?r.parts.some(a=>e.containsPosition(new oe(r.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){return this._currentEdit.get()?.widget.ownsViewZone(e)??!1}},XL=Ab,Ab.ID="editor.contrib.inlineEditController",Ab.inlineEditVisibleKey="inlineEditVisible",Ab.inlineEditVisibleContext=new Y(XL.inlineEditVisibleKey,!1),Ab.cursorAtInlineEditKey="cursorAtInlineEdit",Ab.cursorAtInlineEditContext=new Y(XL.cursorAtInlineEditKey,!1),Ab);zh=XL=D([_(1,be),_(2,Pe),_(3,ht),_(4,Qi),_(5,Re)],zh);function OUt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class BUt extends lt{constructor(){super({id:IUt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:ge.and(X.writable,zh.inlineEditVisibleContext),kbOpts:[{weight:ye.EditorContrib+1,primary:E.Tab,kbExpr:ge.and(X.writable,zh.inlineEditVisibleContext,zh.cursorAtInlineEditContext)}],menuOpts:[{menuId:Te.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await zh.get(t)?.accept()}}class WUt extends lt{constructor(){const e=ge.and(X.writable,ge.not(zh.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e}})}async run(e,t){zh.get(t)?.trigger()}}class HUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext,ge.not(zh.cursorAtInlineEditKey));super({id:TUt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpToCurrent()}}class UUt extends lt{constructor(){const e=ge.and(X.writable,zh.cursorAtInlineEditContext);super({id:RUt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+10,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpBack()}}class VUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext);super({id:LUt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib,primary:E.Escape,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await zh.get(t)?.clear()}}class zUt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let EAe=class{constructor(e,t,i){this._editor=e,this._instantiationService=t,this._telemetryService=i,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=zh.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId)){const o=i.range;return new bM(1e3,this,o,e.event.posx,e.event.posy,!1)}}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineEdit).showToolbar!=="onHover")return[];const i=zh.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new zUt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z;this._telemetryService.publicLog2("inlineEditHover.shown");const s=this._instantiationService.createInstance(Die,this._editor,!1,Au(null));return e.fragment.appendChild(s.getDomNode()),i.add(s),i}};EAe=D([_(1,be),_(2,on)],EAe);Fe(BUt);Fe(VUt);Fe(HUt);Fe(UUt);Fe(WUt);vn(zh.ID,zh,mi.Eventually);hL.register(EAe);const TF={Visible:new Y("parameterHintsVisible",!1),MultipleSignatures:new Y("parameterHintsMultipleSignatures",!1)};async function lnt(n,e,t,i,s){const o=n.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,s,i);if(a)return a}catch(a){er(a)}}yt.registerCommand("_executeSignatureHelpProvider",async(n,...e)=>{const[t,i,s]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s);const o=n.get(ht),r=await n.get(Rn).createModelReference(t);try{const a=await lnt(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:dS.Invoke,isRetrigger:!1,triggerCharacter:s},qe.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var nu;(function(n){let e;(function(s){s[s.Default=0]="Default",s[s.Active=1]="Active",s[s.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}n.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}n.Active=i})(nu||(nu={}));const Sce=class Sce extends ${constructor(e,t,i=Sce.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=nu.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Dn),this.triggerChars=new EZ,this.retriggerChars=new EZ,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Lu(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===nu.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=nu.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(bt)}next(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===nu.Type.Active&&(this.state=new nu.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce($Ut);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new nu.Pending(na(c=>lnt(this.providers,r,a,o,c)),i);try{const c=await this.state.request;return e!==this.triggerId?(c?.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new nu.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=nu.Default),bt(c),!1}}getLastActiveHints(){switch(this.state.type){case nu.Type.Active:return this.state.hints;case nu.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:dS.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Sce.DEFAULT_DELAY=120;let xAe=Sce;function $Ut(n,e){switch(e.triggerKind){case dS.Invoke:return e;case dS.ContentChange:return n;case dS.TriggerCharacter:default:return e}}var GUt='.monaco-editor .parameter-hints-widget{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);cursor:default;display:flex;flex-direction:column;line-height:1.5em;z-index:39}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{display:flex;flex-direction:row;max-width:440px}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{border-left:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;height:100%;opacity:.5;position:absolute}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{border-bottom:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;left:0;opacity:.5;padding-top:4px;position:absolute;width:100%}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs code{background-color:var(--vscode-textCodeBlock-background);border-radius:3px;font-family:var(--monaco-monospace-font);padding:0 .4em}.monaco-editor .parameter-hints-widget .docs .code,.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{align-items:center;display:none;flex-direction:column;justify-content:flex-end;min-width:22px}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{background-repeat:no-repeat;cursor:pointer;height:16px;width:16px}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{font-family:var(--monaco-monospace-font);height:12px;line-height:12px;text-align:center}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}';Ct(GUt,{});var DAe;const xhe="vs/editor/contrib/parameterHints/browser/parameterHintsWidget",xp=we,qUt=ji("parameter-hints-next",Ce.chevronDown,g(xhe,0,"Icon for show next parameter hint.")),QUt=ji("parameter-hints-previous",Ce.chevronUp,g(xhe,1,"Icon for show previous parameter hint."));var zN;let kAe=(zN=class extends ${constructor(e,t,i,s,o,r){super(),this.editor=e,this.model=t,this.telemetryService=r,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new vw({editor:e},o,s)),this.keyVisible=TF.Visible.bindTo(i),this.keyMultipleSignatures=TF.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xp(".editor-widget.parameter-hints-widget"),t=he(e,xp(".phwrapper"));t.tabIndex=-1;const i=he(t,xp(".controls")),s=he(i,xp(".button"+$e.asCSSSelector(QUt))),o=he(i,xp(".overloads")),r=he(i,xp(".button"+$e.asCSSSelector(qUt)));this._register(pe(s,"click",u=>{un.stop(u),this.previous()})),this._register(pe(r,"click",u=>{un.stop(u),this.next()}));const a=xp(".body"),c=new bz(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=he(a,xp(".signature")),d=he(a,xp(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(x.fontInfo);this.domNodes.element.style.fontSize=`${u.fontSize}px`,this.domNodes.element.style.lineHeight=`${u.lineHeight/u.fontSize}`};h(),this._register(T.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(x.fontInfo)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[hs.ABOVE,hs.BELOW]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=he(this.domNodes.signature,xp(".code")),o=this.editor.getOption(x.fontInfo);s.style.fontSize=`${o.fontSize}px`,s.style.fontFamily=o.fontFamily;const r=i.parameters.length>0,a=i.activeParameter??e.activeParameter;if(r)this.renderParameters(s,i,a);else{const d=he(s,xp("span"));d.textContent=i.label}const c=i.parameters[a];if(c?.documentation){const d=xp("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}he(this.domNodes.docs,xp("p",{},d))}if(i.documentation!==void 0)if(typeof i.documentation=="string")he(this.domNodes.docs,xp("p",{},i.documentation));else{const d=this.renderMarkdownDocs(i.documentation);he(this.domNodes.docs,d.element)}const l=this.hasDocs(i,c);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=i.parameters[a];Array.isArray(h.label)?d=i.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),i.documentation&&(d+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==d&&(sa(g(xhe,2,"{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new ao,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const s=t.elapsed();return s>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:s}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&ws(t.documentation).length>0||t&&typeof t.documentation=="object"&&ws(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&ws(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&ws(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),he(e,r,a,c)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${Iu(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return DAe.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},DAe=zN,zN.ID="editor.widget.parameterHintsWidget",zN);kAe=DAe=D([_(2,Pe),_(3,fr),_(4,Di),_(5,on)],kAe);B("editorHoverWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g(xhe,3,"Foreground color of the active item in the parameter hint."));var IAe;const jUt="vs/editor/contrib/parameterHints/browser/parameterHints";var $N;let BV=($N=class extends ${static get(e){return e.getContribution(IAe.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new xAe(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{s?(this.widget.value.show(),this.widget.value.render(s)):this.widget.rawValue?.hide()})),this.widget=new Ka(()=>this._register(t.createInstance(kAe,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}},IAe=$N,$N.ID="editor.controller.parameterHints",$N);BV=IAe=D([_(1,be),_(2,ht)],BV);class KUt extends lt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(jUt,0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:X.hasSignatureHelpProvider,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Space,weight:ye.EditorContrib}})}run(e,t){BV.get(t)?.trigger({triggerKind:dS.Invoke})}}vn(BV.ID,BV,mi.BeforeFirstInteraction);Fe(KUt);const xFe=ye.EditorContrib+75,DFe=Yc.bindToContribution(BV.get);Ke(new DFe({id:"closeParameterHints",precondition:TF.Visible,handler:n=>n.cancel(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new DFe({id:"showPrevParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.Alt|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new DFe({id:"showNextParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.Alt|E.DownArrow,V.WinCtrl|E.KeyN]}}}));var YUt=".monaco-editor .rename-box{border-radius:4px;color:inherit;z-index:100}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{border-radius:2px;padding:3px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{padding:0;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{align-items:center;background-color:transparent;border:none;border-radius:5px;cursor:pointer;display:flex;padding:3px}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}";Ct(YUt,{});const JW="vs/editor/contrib/rename/browser/renameWidget",zz=new Y("renameInputVisible",!1,g(JW,0,"Whether the rename input widget is visible"));let LAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=zz.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new ao,this._inputWithButton=new JUt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.fontInfo)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new kFe(this._domNode,{fontInfo:this._editor.getOption(x.fontInfo),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(__),i=e.getColor(UU);this._domNode.style.backgroundColor=String(e.getColor(Zs)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(wKe)??"");const s=e.getColor(_$);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=s?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Bt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(x.fontInfo);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=uw(this.getDomNode().ownerDocument.body),t=ia(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(x.lineHeight),{totalHeight:o}=c6.getLayoutInfo({lineHeight:s}),r=this._nPxAvailableBelow>o*6?[hs.BELOW,hs.ABOVE]:[hs.ABOVE,hs.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(JW,2,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Bt(this._renameCandidateListView),Bt(this._nPxAvailableAbove!==void 0),Bt(this._nPxAvailableBelow!==void 0);const t=Zf(this._inputWithButton.domNode),i=Zf(this._label);let s;e===hs.BELOW?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:du(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),c.add(pe(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(pe(this._inputWithButton.button,xe.KEY_DOWN,d=>{const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new oe(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),c.add(Ee(()=>{this._renameCts=void 0,o.dispose(!0)})),c.add(Ee(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),c.add(Ee(()=>this._candidates.clear()));const l=new sd;return l.p.finally(()=>{c.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Bt(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const p=this._renameCandidateListView.focusedCandidate;if(p!==void 0?(this._trace("using new name from renameSuggestion"),u=p,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},c.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),c.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),l.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Bt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ai;const i=t?rF.Invoke:rF.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){Bt(this._editor.hasModel());const i=this._editor.getSelection();let s=0,o=t.length;return!O.isEmpty(i)&&!O.spansMultipleLines(i)&&O.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,vt.Smooth),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...l)=>this._trace("_updateRenameCandidates",...l);s("start");const o=await dw(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&yl(l.value)?l.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=Lc(r,l=>l.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const c=a.filter(({newSymbolName:l})=>l.trim().length>0&&l!==this._inputWithButton.input.value&&l!==t&&!this._candidates.has(l));if(s(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(c),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};LAe=D([_(2,pn),_(3,ti),_(4,Pe),_(5,Ze)],LAe);class kFe{constructor(e,t){this._disposables=new Z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=kFe._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(CO({listInactiveFocusForeground:zk,listInactiveFocusBackground:$k}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Cu(g(JW,3,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=c6.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new c6(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Pc("NewSymbolNameCandidates",e,s,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class JUt{constructor(){this._onDidInputChange=new I,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",g(JW,4,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=g(JW,5,"Generate new name suggestions"),this._buttonCancelHoverText=g(JW,6,"Cancel"),this._buttonHover=H_().setupUpdatableHover(va("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(pe(this.input,xe.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.KEY_DOWN,e=>{const t=new os(e);(t.keyCode===E.LeftArrow||t.keyCode===E.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(pe(this.input,xe.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(pe(this.input,xe.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Bt(this._inputNode),this._inputNode}get button(){return Bt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=OS(Ce.sparkle),Yo(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHover?.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=OS(Ce.primitiveSquare),Yo(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHover?.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const s9=class s9{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${s9._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=OS(Ce.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Sd(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(L_e.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+s9._PADDING*2}}dispose(){}};s9._PADDING=2;let c6=s9;var TAe;const bb="vs/editor/contrib/rename/browser/rename";class IFe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ds.replace(O.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,er),this.freeEdit(e),En(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get()?.edit;if(!e)return;const t=oe.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get()?.edit;t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,er),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const i=t.edit,s=t.widget.model;if(O.containsPosition(i.range,e.getStartPosition())||O.containsPosition(i.range,e.getEndPosition()))return!0;const r=s.ghostText.get();return r?r.parts.some(a=>e.containsPosition(new oe(r.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){return this._currentEdit.get()?.widget.ownsViewZone(e)??!1}},XL=Ab,Ab.ID="editor.contrib.inlineEditController",Ab.inlineEditVisibleKey="inlineEditVisible",Ab.inlineEditVisibleContext=new Y(XL.inlineEditVisibleKey,!1),Ab.cursorAtInlineEditKey="cursorAtInlineEdit",Ab.cursorAtInlineEditContext=new Y(XL.cursorAtInlineEditKey,!1),Ab);zh=XL=D([_(1,be),_(2,Pe),_(3,ht),_(4,ji),_(5,Re)],zh);function OUt(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class BUt extends lt{constructor(){super({id:IUt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:ge.and(X.writable,zh.inlineEditVisibleContext),kbOpts:[{weight:ye.EditorContrib+1,primary:E.Tab,kbExpr:ge.and(X.writable,zh.inlineEditVisibleContext,zh.cursorAtInlineEditContext)}],menuOpts:[{menuId:Te.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await zh.get(t)?.accept()}}class WUt extends lt{constructor(){const e=ge.and(X.writable,ge.not(zh.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e}})}async run(e,t){zh.get(t)?.trigger()}}class HUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext,ge.not(zh.cursorAtInlineEditKey));super({id:TUt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+1,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpToCurrent()}}class UUt extends lt{constructor(){const e=ge.and(X.writable,zh.cursorAtInlineEditContext);super({id:RUt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib+10,primary:V.CtrlCmd|V.Alt|E.Equal,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){zh.get(t)?.jumpBack()}}class VUt extends lt{constructor(){const e=ge.and(X.writable,zh.inlineEditVisibleContext);super({id:LUt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:ye.EditorContrib,primary:E.Escape,kbExpr:e},menuOpts:[{menuId:Te.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await zh.get(t)?.clear()}}class zUt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===ku.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let EAe=class{constructor(e,t,i){this._editor=e,this._instantiationService=t,this._telemetryService=i,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=zh.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId)){const o=i.range;return new bM(1e3,this,o,e.event.posx,e.event.posy,!1)}}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new bM(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(x.inlineEdit).showToolbar!=="onHover")return[];const i=zh.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new zUt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z;this._telemetryService.publicLog2("inlineEditHover.shown");const s=this._instantiationService.createInstance(Die,this._editor,!1,Au(null));return e.fragment.appendChild(s.getDomNode()),i.add(s),i}};EAe=D([_(1,be),_(2,rn)],EAe);Fe(BUt);Fe(VUt);Fe(HUt);Fe(UUt);Fe(WUt);vn(zh.ID,zh,mi.Eventually);hL.register(EAe);const TF={Visible:new Y("parameterHintsVisible",!1),MultipleSignatures:new Y("parameterHintsMultipleSignatures",!1)};async function lnt(n,e,t,i,s){const o=n.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,s,i);if(a)return a}catch(a){er(a)}}yt.registerCommand("_executeSignatureHelpProvider",async(n,...e)=>{const[t,i,s]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i)),Bt(typeof s=="string"||!s);const o=n.get(ht),r=await n.get(Rn).createModelReference(t);try{const a=await lnt(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:dS.Invoke,isRetrigger:!1,triggerCharacter:s},qe.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var nu;(function(n){let e;(function(s){s[s.Default=0]="Default",s[s.Active=1]="Active",s[s.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}n.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}n.Active=i})(nu||(nu={}));const Sce=class Sce extends ${constructor(e,t,i=Sce.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=nu.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Dn),this.triggerChars=new EZ,this.retriggerChars=new EZ,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Lu(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===nu.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=nu.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(bt)}next(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==nu.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===nu.Type.Active&&(this.state=new nu.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce($Ut);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new nu.Pending(na(c=>lnt(this.providers,r,a,o,c)),i);try{const c=await this.state.request;return e!==this.triggerId?(c?.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new nu.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=nu.Default),bt(c),!1}}getLastActiveHints(){switch(this.state.type){case nu.Type.Active:return this.state.hints;case nu.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===nu.Type.Active||this.state.type===nu.Type.Pending||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:dS.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:dS.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Sce.DEFAULT_DELAY=120;let xAe=Sce;function $Ut(n,e){switch(e.triggerKind){case dS.Invoke:return e;case dS.ContentChange:return n;case dS.TriggerCharacter:default:return e}}var GUt='.monaco-editor .parameter-hints-widget{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);cursor:default;display:flex;flex-direction:column;line-height:1.5em;z-index:39}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{display:flex;flex-direction:row;max-width:440px}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{border-left:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;height:100%;opacity:.5;position:absolute}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{border-bottom:1px solid var(--vscode-editorHoverWidget-border);content:"";display:block;left:0;opacity:.5;padding-top:4px;position:absolute;width:100%}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs code{background-color:var(--vscode-textCodeBlock-background);border-radius:3px;font-family:var(--monaco-monospace-font);padding:0 .4em}.monaco-editor .parameter-hints-widget .docs .code,.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{align-items:center;display:none;flex-direction:column;justify-content:flex-end;min-width:22px}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{background-repeat:no-repeat;cursor:pointer;height:16px;width:16px}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{font-family:var(--monaco-monospace-font);height:12px;line-height:12px;text-align:center}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}';Ct(GUt,{});var DAe;const xhe="vs/editor/contrib/parameterHints/browser/parameterHintsWidget",xp=we,qUt=Ki("parameter-hints-next",Ce.chevronDown,g(xhe,0,"Icon for show next parameter hint.")),QUt=Ki("parameter-hints-previous",Ce.chevronUp,g(xhe,1,"Icon for show previous parameter hint."));var zN;let kAe=(zN=class extends ${constructor(e,t,i,s,o,r){super(),this.editor=e,this.model=t,this.telemetryService=r,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new vw({editor:e},o,s)),this.keyVisible=TF.Visible.bindTo(i),this.keyMultipleSignatures=TF.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xp(".editor-widget.parameter-hints-widget"),t=he(e,xp(".phwrapper"));t.tabIndex=-1;const i=he(t,xp(".controls")),s=he(i,xp(".button"+$e.asCSSSelector(QUt))),o=he(i,xp(".overloads")),r=he(i,xp(".button"+$e.asCSSSelector(qUt)));this._register(pe(s,"click",u=>{un.stop(u),this.previous()})),this._register(pe(r,"click",u=>{un.stop(u),this.next()}));const a=xp(".body"),c=new bz(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=he(a,xp(".signature")),d=he(a,xp(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(x.fontInfo);this.domNodes.element.style.fontSize=`${u.fontSize}px`,this.domNodes.element.style.lineHeight=`${u.lineHeight/u.fontSize}`};h(),this._register(T.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(x.fontInfo)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[hs.ABOVE,hs.BELOW]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=he(this.domNodes.signature,xp(".code")),o=this.editor.getOption(x.fontInfo);s.style.fontSize=`${o.fontSize}px`,s.style.fontFamily=o.fontFamily;const r=i.parameters.length>0,a=i.activeParameter??e.activeParameter;if(r)this.renderParameters(s,i,a);else{const d=he(s,xp("span"));d.textContent=i.label}const c=i.parameters[a];if(c?.documentation){const d=xp("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}he(this.domNodes.docs,xp("p",{},d))}if(i.documentation!==void 0)if(typeof i.documentation=="string")he(this.domNodes.docs,xp("p",{},i.documentation));else{const d=this.renderMarkdownDocs(i.documentation);he(this.domNodes.docs,d.element)}const l=this.hasDocs(i,c);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=i.parameters[a];Array.isArray(h.label)?d=i.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),i.documentation&&(d+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==d&&(sa(g(xhe,2,"{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new ao,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const s=t.elapsed();return s>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:s}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&ws(t.documentation).length>0||t&&typeof t.documentation=="object"&&ws(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&ws(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&ws(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),he(e,r,a,c)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${Iu(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return DAe.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},DAe=zN,zN.ID="editor.widget.parameterHintsWidget",zN);kAe=DAe=D([_(2,Pe),_(3,fr),_(4,Di),_(5,rn)],kAe);B("editorHoverWidget.highlightForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},g(xhe,3,"Foreground color of the active item in the parameter hint."));var IAe;const jUt="vs/editor/contrib/parameterHints/browser/parameterHints";var $N;let BV=($N=class extends ${static get(e){return e.getContribution(IAe.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new xAe(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{s?(this.widget.value.show(),this.widget.value.render(s)):this.widget.rawValue?.hide()})),this.widget=new Ka(()=>this._register(t.createInstance(kAe,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}},IAe=$N,$N.ID="editor.controller.parameterHints",$N);BV=IAe=D([_(1,be),_(2,ht)],BV);class KUt extends lt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(jUt,0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:X.hasSignatureHelpProvider,kbOpts:{kbExpr:X.editorTextFocus,primary:V.CtrlCmd|V.Shift|E.Space,weight:ye.EditorContrib}})}run(e,t){BV.get(t)?.trigger({triggerKind:dS.Invoke})}}vn(BV.ID,BV,mi.BeforeFirstInteraction);Fe(KUt);const xFe=ye.EditorContrib+75,DFe=Jc.bindToContribution(BV.get);Ke(new DFe({id:"closeParameterHints",precondition:TF.Visible,handler:n=>n.cancel(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));Ke(new DFe({id:"showPrevParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.UpArrow,secondary:[V.Alt|E.UpArrow],mac:{primary:E.UpArrow,secondary:[V.Alt|E.UpArrow,V.WinCtrl|E.KeyP]}}}));Ke(new DFe({id:"showNextParameterHint",precondition:ge.and(TF.Visible,TF.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:xFe,kbExpr:X.focus,primary:E.DownArrow,secondary:[V.Alt|E.DownArrow],mac:{primary:E.DownArrow,secondary:[V.Alt|E.DownArrow,V.WinCtrl|E.KeyN]}}}));var YUt=".monaco-editor .rename-box{border-radius:4px;color:inherit;z-index:100}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{border-radius:2px;padding:3px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{padding:0;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{align-items:center;background-color:transparent;border:none;border-radius:5px;cursor:pointer;display:flex;padding:3px}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}";Ct(YUt,{});const JW="vs/editor/contrib/rename/browser/renameWidget",zz=new Y("renameInputVisible",!1,g(JW,0,"Whether the rename input widget is visible"));let LAe=class{constructor(e,t,i,s,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=zz.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new ao,this._inputWithButton=new JUt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(x.fontInfo)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new kFe(this._domNode,{fontInfo:this._editor.getOption(x.fontInfo),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(__),i=e.getColor(UU);this._domNode.style.backgroundColor=String(e.getColor(Zs)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(wKe)??"");const s=e.getColor(_$);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(SE)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=s?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Bt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(x.fontInfo);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=uw(this.getDomNode().ownerDocument.body),t=ia(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(x.lineHeight),{totalHeight:o}=c6.getLayoutInfo({lineHeight:s}),r=this._nPxAvailableBelow>o*6?[hs.BELOW,hs.ABOVE]:[hs.ABOVE,hs.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(JW,2,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Bt(this._renameCandidateListView),Bt(this._nPxAvailableAbove!==void 0),Bt(this._nPxAvailableBelow!==void 0);const t=Zf(this._inputWithButton.domNode),i=Zf(this._label);let s;e===hs.BELOW?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:du(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),c.add(pe(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(pe(this._inputWithButton.button,xe.KEY_DOWN,d=>{const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new oe(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),c.add(Ee(()=>{this._renameCts=void 0,o.dispose(!0)})),c.add(Ee(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),c.add(Ee(()=>this._candidates.clear()));const l=new sd;return l.p.finally(()=>{c.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Bt(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const p=this._renameCandidateListView.focusedCandidate;if(p!==void 0?(this._trace("using new name from renameSuggestion"),u=p,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},c.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),c.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),l.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Bt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ai;const i=t?rF.Invoke:rF.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){Bt(this._editor.hasModel());const i=this._editor.getSelection();let s=0,o=t.length;return!O.isEmpty(i)&&!O.spansMultipleLines(i)&&O.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,vt.Smooth),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...l)=>this._trace("_updateRenameCandidates",...l);s("start");const o=await dw(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&yl(l.value)?l.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=Lc(r,l=>l.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const c=a.filter(({newSymbolName:l})=>l.trim().length>0&&l!==this._inputWithButton.input.value&&l!==t&&!this._candidates.has(l));if(s(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(c),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};LAe=D([_(2,pn),_(3,ti),_(4,Pe),_(5,Ze)],LAe);class kFe{constructor(e,t){this._disposables=new Z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=kFe._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(CO({listInactiveFocusForeground:zk,listInactiveFocusBackground:$k}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Cu(g(JW,3,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=c6.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new c6(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Pc("NewSymbolNameCandidates",e,s,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class JUt{constructor(){this._onDidInputChange=new I,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",g(JW,4,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=g(JW,5,"Generate new name suggestions"),this._buttonCancelHoverText=g(JW,6,"Cancel"),this._buttonHover=H_().setupUpdatableHover(va("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(pe(this.input,xe.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.KEY_DOWN,e=>{const t=new os(e);(t.keyCode===E.LeftArrow||t.keyCode===E.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(pe(this.input,xe.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(pe(this.input,xe.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(pe(this.input,xe.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Bt(this._inputNode),this._inputNode}get button(){return Bt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=OS(Ce.sparkle),Yo(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHover?.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=OS(Ce.primitiveSquare),Yo(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHover?.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const s9=class s9{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${s9._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=OS(Ce.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Sd(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(L_e.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+s9._PADDING*2}}dispose(){}};s9._PADDING=2;let c6=s9;var TAe;const bb="vs/editor/contrib/rename/browser/rename";class IFe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:O.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,s){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` -`)};const r=await o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(g(bb,0,"No result.")),s);return r}}async function XUt(n,e,t,i){const s=new IFe(e,t,n),o=await s.resolveRenameLocation(qe.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,qe.None)}var GN;let F1=(GN=class{static get(e){return e.getContribution(TAe.ID)}constructor(e,t,i,s,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ai,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(LAe,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ai,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new IFe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new I1(this.editor,hr.Position|hr.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(s.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Tc?e("resolve rename location cancelled",JSON.stringify(p,null," ")):(e("resolve rename location failed",p instanceof Error?p:JSON.stringify(p,null," ")),(typeof p=="string"||ah(p))&&Du.get(this.editor)?.showMessage(p||g(bb,1,"An unknown error occurred while resolving rename location"),t));return}finally{s.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Du.get(this.editor)?.showMessage(o.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new I1(this.editor,hr.Position|hr.Value,o.range,this._cts.token),a=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(a),l=await Promise.all(c.map(async p=>[p,await p.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(p,m)=>{let v=l.slice();return p===rF.Automatic&&(v=v.filter(([w,b])=>b)),v.map(([w])=>w.provideNewSymbolNames(a,o.range,p,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,c.length>0?d:void 0,r);if(e("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=dw(i.provideRenameEdits(u.newName,r.token),r.token).then(async p=>{if(!p){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(p.rejectReason){e(`returning early - rejected with reason: ${p.rejectReason}`),this._notificationService.info(p.rejectReason);return}this.editor.setSelection(O.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(bb,2,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(bb,3,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&sa(g(bb,4,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applying edits ${JSON.stringify(m,null," ")}`),this._notificationService.error(g(bb,5,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(bb,6,"Rename failed to compute edits")),this._logService.error(p)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const s=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",s)}},TAe=GN,GN.ID="editor.contrib.renameController",GN);F1=TAe=D([_(1,be),_(2,Pi),_(3,vO),_(4,eD),_(5,Ze),_(6,dl),_(7,ht),_(8,on)],F1);class ZUt extends lt{constructor(){super({id:"editor.action.rename",label:g(bb,7,"Rename Symbol"),alias:"Rename Symbol",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Qt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=e.get(Ze),s=F1.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}vn(F1.ID,F1,mi.Lazy);Fe(ZUt);const LFe=Yc.bindToContribution(F1.get);Ke(new LFe({id:"acceptRenameInput",precondition:zz,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Enter}}));Ke(new LFe({id:"acceptRenameInputWithPreview",precondition:ge.and(zz,ge.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:V.CtrlCmd+E.Enter}}));Ke(new LFe({id:"cancelRenameInput",precondition:zz,handler:n=>n.cancelRenameInput(),kbOpts:{weight:ye.EditorContrib+99,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));At(class extends pi{constructor(){super({id:"focusNextRenameSuggestion",title:{...Be(bb,8,"Focus Next Rename Suggestion")},precondition:zz,keybinding:[{primary:E.DownArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(Qt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends pi{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Be(bb,9,"Focus Previous Rename Suggestion")},precondition:zz,keybinding:[{primary:E.UpArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(Qt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusPreviousRenameSuggestion()}});nA("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;Bt(typeof s=="string");const{renameProvider:o}=n.get(ht);return XUt(o,e,t,s)});nA("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(ht),o=await new IFe(e,t,i).resolveRenameLocation(qe.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:ut.LANGUAGE_OVERRIDABLE,description:g(bb,10,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var OH;let kie=(OH=class extends ${constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(x.minimap)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{const o=this.editor.getModel()?.getLanguageId();o&&s.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new yn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!s?.markers))return{foldingRules:s,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),c=a.findTokenIndexAtOffset(r.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===Ar.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),s=e.map(o=>eVt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,c=r.length;a0&&(h=e.subarray(t,t+d),t+=d),r[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:r}}function Dhe(n){return n&&!!n.data}function hnt(n){return n&&Array.isArray(n.edits)}class sVt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function unt(n,e){return n.has(e)}function oVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function gnt(n,e,t,i,s){const o=oVt(n,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){l=d,c=null}return(!c||!Dhe(c)&&!hnt(c))&&(c=null),new sVt(a,c,l)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function rVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class aVt{constructor(e,t){this.provider=e,this.tokens=t}}function cVt(n,e){return n.has(e)}function fnt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function TFe(n,e,t,i){const s=fnt(n,e),o=await Promise.all(s.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){er(c),a=null}return(!a||!Dhe(a))&&(a=null),new aVt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}yt.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht),o=rVt(s,i);return o?o[0].getLegend():n.get(Qi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});yt.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht);if(!unt(s,i))return n.get(Qi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await gnt(s,i,null,null,qe.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!Dhe(a))return;const c=d6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});yt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P);const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=fnt(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!O.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await TFe(o,s,O.lift(i),qe.None);if(a)return a.provider.getLegend()});yt.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P),Bt(O.isIRange(i));const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=await TFe(o,s,O.lift(i),qe.None);if(!(!r||!r.tokens))return d6({id:0,type:"full",data:r.tokens.data})});const RFe="editor.semanticHighlighting";function $J(n,e,t){const i=t.getValue(RFe,{overrideIdentifier:n.getLanguageId(),resource:n.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var MD;let RAe=class extends ${constructor(e,t,i,s,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new MAe(d,e,i,o,r)},c=(d,h)=>{h.dispose(),delete this._watchers[d.uri.toString()]},l=()=>{for(const d of t.getModels()){const h=this._watchers[d.uri.toString()];$J(d,i,s)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{$J(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{$J(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(RFe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};RAe=D([_(0,gde),_(1,Ai),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],RAe);var x0;let MAe=(x0=class extends ${constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:MD.REQUEST_MIN_DELAY,max:MD.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new yn(()=>this._fetchDocumentSemanticTokensNow(),MD.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!unt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ai,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=gnt(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(c=>{o.push(c)}),a=new ao(!1);s.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,o)}},c=>{c&&(Na(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||bt(c),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(hnt(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=o.data,l=new Uint32Array(c.length+a);let d=c.length,h=l.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>c.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(MD._copy(c,d-p,l,h-p,p),h-=p),f.data&&(MD._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&MD._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(Dhe(t)){this._currentDocumentResponse=new lVt(e,t.resultId,t.data);const a=RYe(t,i,this._model.getLanguageId());if(s.length>0)for(const c of s)for(const l of a)for(const d of c.changes)l.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},MD=x0,x0.REQUEST_MIN_DELAY=300,x0.REQUEST_MAX_DELAY=2e3,x0);MAe=MD=D([_(1,gde),_(2,pn),_(3,B_),_(4,ht)],MAe);class lVt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}KQ(RAe);var NAe,qN;let WV=(qN=class extends ${static get(e){return e.getContribution(NAe.ID)}constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new yn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(RFe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=na(r=>Promise.resolve(TFe(this._provider,e,t,r))),o=new ao(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=r,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,RYe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},NAe=qN,qN.ID="editor.contrib.viewportSemanticTokens",qN);WV=NAe=D([_(1,gde),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],WV);vn(WV.ID,WV,mi.AfterFirstRender);class dVt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===q.Underline||h===q.Dash))break;if(Bk(h)&&fy(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new O(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var PAe;const Lie="vs/editor/contrib/smartSelect/browser/smartSelect";class MFe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new MFe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var QN;let RF=(QN=class{static get(e){return e.getContribution(PAe.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await mnt(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),qe.None).then(o=>{if(!(!mo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ls(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),o[r].unshift(t[r]);this._state=o.map(r=>new MFe(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>mt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},PAe=QN,QN.ID="editor.contrib.smartSelectController",QN);RF=PAe=D([_(1,ht)],RF);class pnt extends lt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=RF.get(t);i&&await i.run(this._forward)}}class hVt extends pnt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(Lie,0,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.RightArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.RightArrow,secondary:[V.WinCtrl|V.Shift|E.RightArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,1,"&&Expand Selection"),order:2}})}}yt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class uVt extends pnt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(Lie,2,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.LeftArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.LeftArrow,secondary:[V.WinCtrl|V.Shift|E.LeftArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,3,"&&Shrink Selection"),order:3}})}}vn(RF.ID,RF,mi.Lazy);Fe(hVt);Fe(uVt);async function mnt(n,e,t,i,s){const o=n.all(e).concat(new dVt(i.selectSubwords));o.length===1&&o.unshift(new Tte);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,s)).then(l=>{if(mo(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>oe.isBefore(u.getStartPosition(),f.getStartPosition())?1:oe.isBefore(f.getStartPosition(),u.getStartPosition())||oe.isBefore(u.getEndPosition(),f.getEndPosition())?-1:oe.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const l=[];let d;for(const u of c)(!d||O.containsRange(u,d)&&!O.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;un}),ype="data-sticky-line-index",yze="data-sticky-is-line",fVt="data-sticky-is-line-number",Sze="data-sticky-is-folding-icon";class pVt extends ${constructor(e){super(),this._editor=e,this._foldingIconStore=new Z,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(x.lineHeight),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof oC),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(x.stickyScroll).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.stickyScroll)&&t(),i.hasChanged(x.lineHeight)&&(this._lineHeight=this._editor.getOption(x.lineHeight))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const s=this._isWidgetHeightZero(e),o=s?void 0:e,r=s?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(o,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,s=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+s.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new oe(t,1)).lineNumber,a=o.getViewLineRenderingData(r),c=this._editor.getOption(x.lineNumbers);let l;try{l=ig.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new tL(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,l,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),h=new fz(2e3),u=lQ(d,h);let f;Cze?f=Cze.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(ype,String(e)),p.setAttribute(yze,""),p.setAttribute("role","listitem"),p.tabIndex=0,p.className="sticky-line-content",p.classList.add(`stickyLine${t}`),p.style.lineHeight=`${this._lineHeight}px`,p.innerHTML=f;const m=document.createElement("span");m.setAttribute(ype,String(e)),m.setAttribute(fVt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=s.contentLeft;m.style.width=`${v}px`;const w=document.createElement("span");c.renderType===Qr.On||c.renderType===Qr.Interval&&t%10===0?w.innerText=t.toString():c.renderType===Qr.Relative&&(w.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),w.className="sticky-line-number-inner",w.style.lineHeight=`${this._lineHeight}px`,w.style.width=`${s.lineNumbersWidth}px`,w.style.paddingLeft=`${s.lineNumbersLeft}px`,m.appendChild(w);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(w),m.style.lineHeight=`${this._lineHeight}px`,p.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`;const C=new mVt(e,t,p,m,b,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,s=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,s.style.zIndex=o?r:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=o?c:l,s.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const c=s.isCollapsed(o),l=new _Vt(c,r,s.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute(Sze,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Yf.TOP_CENTER,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=NMe(t.characterMapping,e,0);return new oe(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,ype);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,yze)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Sze)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class mVt{constructor(e,t,i,s,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class _Vt{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width=`${s}px`,this.domNode.style.height=`${s}px`,this.domNode.className=$e.asClassName(e?ite:tte)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class i8{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Tie{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class _nt{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var n8;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(n8||(n8={}));var fI;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(fI||(fI={}));let FAe=class extends ${constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Lu(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case n8.OUTLINE_MODEL:this._modelProviders.push(new OAe(this._editor,s));case n8.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new WAe(this._editor,t,s));case n8.INDENTATION_MODEL:this._modelProviders.push(new BAe(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const o=await i;if(this._modelPromise!==s)return null;switch(o){case fI.CANCELED:return this._updateOperation.clear(),null;case fI.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};FAe=D([_(2,be),_(3,ht)],FAe);class vnt extends ${constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,fI.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=na(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?fI.CANCELED:(this._stickyModel=this.createStickyModel(e,i),fI.VALID):this._invalid()).then(void 0,i=>(bt(i),fI.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let OAe=class extends vnt{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return oy.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new _nt(o.uri,o.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(fi.first(e.children.values())instanceof XSe){const a=fi.find(e.children.values(),c=>c.id===t);if(a)i=a.children;else{let c="",l=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>l&&(d=u,l=f,c=u.id)}t=c,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,c)=>{const l=new i8(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new i8(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Tie(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new i8(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Tie(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof JSe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};OAe=D([_(1,ht)],OAe);class wnt extends vnt{constructor(e){super(e),this._foldingLimitReporter=new CZe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new _nt(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new Tie(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new pPe(e.getModel(),s,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};WAe=D([_(2,ht)],WAe);class vVt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var BH;let HAe=(BH=class extends ${constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new I),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Z),this._updateSoon=this._register(new yn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.stickyScroll)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(x.stickyScroll).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Ee(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new FAe(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ai,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(CU(a,e.startLineNumber+s,(d,h)=>d-h));for(let d=c;d<=l;d++){const h=t.children[d];if(!h)return;if(h.range){const u=h.range.startLineNumber,f=h.range.endLineNumber;e.startLineNumber<=f+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new vVt(u,f-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s,o)}}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=this._editor._getViewModel()?.getHiddenAreas();if(i)for(const s of i)t=t.filter(o=>!(o.startLineNumber>=s.startLineNumber&&o.endLineNumber<=s.endLineNumber+1));return t}},BH.ID="store.contrib.stickyScrollController",BH);HAe=D([_(1,ht),_(2,lo)],HAe);var UAe,jN;let Gx=(jN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new Z,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new pVt(this._editor),this._stickyLineCandidateProvider=new HAe(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bze([],[],0),this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(pe(c,xe.CONTEXT_MENU,async d=>{this._onContextMenu(gt(c),d)})),this._stickyScrollFocusedContextKey=X.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=X.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Dd(c));this._register(l.onDidBlur(d=>{this._positionRevealed===!1&&c.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(l.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(pe(c,xe.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(UAe.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,vt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(O.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new phe(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new O(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(Xo(s,xe.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(l===null)return;const d=new oe(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(l===null)return;c=new oe(l,1)}this._revealPosition(c)})),this._register(Xo(s,xe.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(pe(s,xe.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:c,textElement:l}=a;if(!c.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=c,e.clear();else if(l.style.textDecoration==="underline")return;const d=new ai;e.add(Ee(()=>d.dispose(!0)));let h;vhe(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=l;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(iit,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new yu(e,t);this._contextMenuService.showContextMenu({menuId:Te.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;vZe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(x.stickyScroll);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===Qr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(x.stickyScroll)||e.hasChanged(x.minimap)||e.hasChanged(x.lineHeight)||e.hasChanged(x.showFoldingControls)||e.hasChanged(x.lineNumbers))&&this._readConfiguration(),e.hasChanged(x.lineNumbers)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(x.lineHeight);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const i=this._stickyLineCandidateProvider.getVersionId();if(i===void 0||i===t.getVersionId())if(this._foldingModel=await Ox.get(this._editor)?.getFoldingModel()??null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let s=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new i8(a[0].startLineNumber,a[a.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(c);for(const d of l){const h=d.startLineNumber,u=d.endLineNumber,f=d.nestingDepth;if(u-h>0){const p=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(h)-i,w=this._editor.getTopForLineNumber(u)-i,b=this._editor.getBottomForLineNumber(u)-i;if(p>w&&p<=b){o.push(h),r.push(u+1),s=b-m;break}else m>v&&m<=b&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new bze(o,r,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},UAe=jN,jN.ID="store.contrib.stickyScrollController",jN);Gx=UAe=D([_(1,Vr),_(2,ht),_(3,be),_(4,lo),_(5,B_),_(6,Pe)],Gx);const Db="vs/editor/contrib/stickyScroll/browser/stickyScrollActions";class wVt extends pi{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Be(Db,0,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(Db,1,"&&Toggle Editor Sticky Scroll")},metadata:{description:Be(Db,2,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Xa.View,toggled:{condition:ge.equals("config.editor.stickyScroll.enabled",!0),title:g(Db,3,"Sticky Scroll"),mnemonicTitle:g(Db,4,"&&Sticky Scroll")},menu:[{id:Te.CommandPalette},{id:Te.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Te.StickyScrollContext}]})}async run(e){const t=e.get(Re),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const khe=ye.EditorContrib;class bVt extends wf{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Be(Db,5,"Focus on the editor sticky scroll"),mnemonicTitle:g(Db,6,"&&Focus Sticky Scroll")},precondition:ge.and(ge.has("config.editor.stickyScroll.enabled"),X.stickyScrollVisible),menu:[{id:Te.CommandPalette}]})}runEditorCommand(e,t){Gx.get(t)?.focus()}}class CVt extends wf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Be(Db,7,"Select the next editor sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.DownArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusNext()}}class yVt extends wf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Be(Db,8,"Select the previous sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.UpArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusPrevious()}}class SVt extends wf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Be(Db,9,"Go to the focused sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Enter}})}runEditorCommand(e,t){Gx.get(t)?.goToFocused()}}class AVt extends wf{constructor(){super({id:"editor.action.selectEditor",title:Be(Db,10,"Select Editor"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Escape}})}runEditorCommand(e,t){Gx.get(t)?.selectEditor()}}vn(Gx.ID,Gx,mi.AfterFirstRender);At(wVt);At(bVt);At(yVt);At(CVt);At(SVt);At(AVt);class EVt{constructor(e,t,i,s,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.completion=r}}let VAe=class extends $Re{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(qe.None)}return e}};VAe=D([_(5,ghe)],VAe);let zAe=class extends ${constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){if(i.selectedSuggestionInfo)return;let o;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){o=f;break}if(!o)return;const r=o.getOption(x.quickSuggestions);if(d2.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),c=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(r,c)!=="inline")return;let l=e.getWordAtPosition(t),d;if(l?.word||(d=this._getTriggerCharacterInfo(e,t)),!l?.word&&!d||(l||(l=e.getWordUntilPosition(t)),l.endColumn!==t.column))return;let h;const u=e.getValueInRange(new O(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new y4e(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await jPe(this._languageFeatureService.completionProvider,e,t,new Q7(void 0,Mte.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:tf.TriggerCharacter,triggerCharacter:d.ch},s);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new Sk(f.items,t.column,new y4e(u,0),Rte.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new VAe(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(qe.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(O.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&s.add(o);if(s.size!==0)return{providers:s,ch:i}}};zAe=D([_(0,ht),_(1,Mu),_(2,ghe),_(3,Qt)],zAe);KQ(zAe);const xVt="vs/editor/contrib/tokenization/browser/tokenization";class DVt extends lt{constructor(){super({id:"editor.action.forceRetokenize",label:g(xVt,0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new ao;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}Fe(DVt);var kVt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";Ct(kVt,{});var IVt=".editor-banner{background:var(--vscode-banner-background);box-sizing:border-box;cursor:default;display:flex;font-size:12px;height:26px;overflow:visible;width:100%}.editor-banner .icon-container{align-items:center;display:flex;flex-shrink:0;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-position:50%;background-repeat:no-repeat;background-size:16px;margin:0 6px 0 10px;padding:0;width:16px}.editor-banner .message-container{align-items:center;display:flex;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-banner .message-container p{margin-block-end:0;margin-block-start:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{margin:2px 8px;padding:0 12px;width:inherit}.editor-banner .message-actions-container a{margin-left:12px;padding:3px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}";Ct(IVt,{});const LVt=26;let $Ae=class extends ${constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(GAe))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,LVt)}};$Ae=D([_(1,be)],$Ae);let GAe=class extends ${constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(vw,{}),this.element=we("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=we("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Yo(this.element)}show(e){Yo(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=he(this.element,we("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(we(`div${$e.asCSSSelector(e.icon)}`));const s=he(this.element,we("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=he(this.element,we("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(t6,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=he(this.element,we("div.action-container"));this.actionBar=this._register(new Qh(o)),this.actionBar.push(this._register(new xn("banner.close","Close Banner",$e.asClassName(VXe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};GAe=D([_(0,be)],GAe);const cl="vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter",TVt=ji("extensions-warning-message",Ce.warning,g(cl,0,"Icon shown with a warning message in the extensions editor."));var WH;let h6=(WH=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:g(cl,1,"This document contains many non-basic ASCII unicode characters"),command:new g6};else if(o.ambiguousCharacterCount>=r)a={message:g(cl,2,"This document contains many ambiguous unicode characters"),command:new MF};else if(o.invisibleCharacterCount>=r)a={message:g(cl,3,"This document contains many invisible unicode characters"),command:new u6};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:TVt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance($Ae,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(x.unicodeHighlighting)&&(this._options=e.getOption(x.unicodeHighlighting),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=RVt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Gd:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new qAe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new MVt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},WH.ID="editor.contrib.unicodeHighlighter",WH);h6=D([_(1,kd),_(2,oA),_(3,be)],h6);function RVt(n,e){return{nonBasicASCII:e.nonBasicASCII===Rp?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Rp?!n:e.includeComments,includeStrings:e.includeStrings===Rp?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let qAe=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!oNe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Cnt(i,this._options),inComment:rNe(t,e),inString:aNe(t,e)}}};qAe=D([_(3,kd)],qAe);class MVt extends ${constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=_Me.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return oNe(t,e)?{reason:Cnt(i,this._options),inComment:rNe(t,e),inString:aNe(t,e)}:null}}const bnt=g(cl,4,"Configure Unicode Highlight Options");let QAe=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=this._editor.getContribution(h6.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=s.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=Spe(h);let f;switch(l.reason.kind){case Wv.Ambiguous:{qq(l.reason.confusableWith)?f=g(cl,5,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,Spe(l.reason.confusableWith.codePointAt(0))):f=g(cl,6,"The character {0} could be confused with the character {1}, which is more common in source code.",u,Spe(l.reason.confusableWith.codePointAt(0)));break}case Wv.Invisible:f=g(cl,7,"The character {0} is invisible.",u);break;case Wv.NonBasicAscii:f=g(cl,8,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(cl,9,"Adjust settings"),v=`command:${Mie.ID}?${encodeURIComponent(JSON.stringify(p))}`,w=new Xt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,bnt);o.push(new xb(this,c.range,[w],!1,a++))}return o}renderHoverParts(e,t){return yOt(e,t,this._editor,this._languageService,this._openerService)}};QAe=D([_(1,Di),_(2,fr)],QAe);function jAe(n){return`U+${n.toString(16).padStart(4,"0")}`}function Spe(n){let e=`\`${jAe(n)}\``;return aM.isInvisibleCharacter(n)||(e+=` "${`${NVt(n)}`}"`),e}function NVt(n){return n===q.BackTick?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function Cnt(n,e){return _Me.computeUnicodeHighlightReason(n,e)}const Ace=class Ace{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=jt.createDynamic({description:"unicode-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};Ace.instance=new Ace;let Rie=Ace;const ABe=class ABe extends lt{constructor(){super({id:MF.ID,label:g(cl,10,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(cl,11,"Disable Highlight In Comments")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeComments,!1,Ot.USER)}};ABe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let KAe=ABe;const EBe=class EBe extends lt{constructor(){super({id:MF.ID,label:g(cl,12,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(cl,13,"Disable Highlight In Strings")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeStrings,!1,Ot.USER)}};EBe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let YAe=EBe;const Ece=class Ece extends lt{constructor(){super({id:Ece.ID,label:g(cl,14,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(cl,15,"Disable Ambiguous Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.ambiguousCharacters,!1,Ot.USER)}};Ece.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let MF=Ece;const xce=class xce extends lt{constructor(){super({id:xce.ID,label:g(cl,16,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(cl,17,"Disable Invisible Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.invisibleCharacters,!1,Ot.USER)}};xce.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let u6=xce;const Dce=class Dce extends lt{constructor(){super({id:Dce.ID,label:g(cl,18,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(cl,19,"Disable Non ASCII Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.nonBasicASCII,!1,Ot.USER)}};Dce.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let g6=Dce;const kce=class kce extends lt{constructor(){super({id:kce.ID,label:g(cl,20,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:s,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(s),l=e.get(On),d=e.get(Re);function h(p){return aM.isInvisibleCharacter(p)?g(cl,21,"Exclude {0} (invisible character) from being highlighted",jAe(p)):g(cl,22,"Exclude {0} from being highlighted",`${jAe(p)} "${c}"`)}const u=[];if(o.kind===Wv.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(cl,23,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{FVt(d,[p])}});if(u.push({label:h(s),run:()=>PVt(d,[s])}),a){const p=new KAe;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new YAe;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===Wv.Ambiguous){const p=new MF;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.Invisible){const p=new u6;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.NonBasicAscii){const p=new g6;u.push({label:p.label,run:async()=>p.runAction(d)})}else OVt(o);const f=await l.pick(u,{title:bnt});f&&await f.run()}};kce.ID="editor.action.unicodeHighlight.showExcludeOptions";let Mie=kce;async function PVt(n,e){const t=n.getValue(Ug.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(Ug.allowedCharacters,i,Ot.USER)}async function FVt(n,e){const t=n.inspect(Ug.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await n.updateValue(Ug.allowedLocales,i,Ot.USER)}function OVt(n){throw new Error(`Unexpected value: ${n}`)}Fe(MF);Fe(u6);Fe(g6);Fe(Mie);vn(h6.ID,h6,mi.AfterFirstRender);hL.register(QAe);const D5="vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators",ynt="ignoreUnusualLineTerminators";function BVt(n,e,t){n.setModelProperty(e.uri,ynt,t)}function WVt(n,e){return n.getModelProperty(e.uri,ynt)}var HH;let Nie=(HH=class extends ${constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(x.unusualLineTerminators),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||WVt(this._codeEditorService,e)===!0||this._editor.getOption(x.readOnly))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:g(D5,0,"Unusual Line Terminators"),message:g(D5,1,"Detected unusual line terminators"),detail:g(D5,2,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",ui(e.uri)),primaryButton:g(D5,3,"&&Remove Unusual Line Terminators"),cancelButton:g(D5,4,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){BVt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},HH.ID="editor.contrib.unusualLineTerminatorsDetector",HH);Nie=D([_(1,To),_(2,Qt)],Nie);vn(Nie.ID,Nie,mi.AfterFirstRender);var il,JAe;const NFe="vs/editor/contrib/wordHighlighter/browser/wordHighlighter",Ihe=new Y("hasWordHighlights",!1);function Snt(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,er)),mo).then(o=>{if(o){const r=new wi;return r.set(e.uri,o),r}return new wi})}function HVt(n,e,t,i,s,o){const r=n.ordered(e);return Qle(r.map(a=>()=>{const c=o.filter(l=>gS(l)).filter(l=>fde(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,s)).then(void 0,er)}),a=>a instanceof wi&&a.size>0)}class PFe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=na(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new O(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=r&&(c=!0)}return c}cancel(){this.result.cancel()}}class UVt extends PFe{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return Snt(this._providers,e,t.getPosition(),s).then(o=>o||new wi)}}class VVt extends PFe{constructor(e,t,i,s,o){super(e,t,i),this._providers=s,this._otherModels=o}_compute(e,t,i,s){return HVt(this._providers,e,t.getPosition(),i,s,this._otherModels).then(o=>o||new wi)}}class Ant extends PFe{constructor(e,t,i,s,o){super(e,t,s),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,s){return Ta(250,s).then(()=>{const o=new wi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new wi;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:D9.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function zVt(n,e,t,i,s){return n.has(e)?new UVt(e,t,s,n):new Ant(e,t,i,s,[])}function $Vt(n,e,t,i,s,o){return n.has(e)?new VVt(e,t,s,n,o):new Ant(e,t,i,s,o)}nA("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(ht);return(await Snt(i.documentHighlightProvider,e,t,qe.None))?.get(e.uri)});var D0;let XAe=(D0=class{constructor(e,t,i,s,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=Ihe.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():il.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(x.occurrencesHighlight);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,il.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}stop(){this.occurrencesHighlight!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(O.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=il.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),il.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const i of e){if(!i.hasModel())continue;const s=il.storedDecorations.get(i.getModel().uri);if(!s)continue;i.removeDecorations(s),t.push(i.getModel().uri);const o=bm.get(i);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)il.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell&&il.query?.modelInfo?.model.uri.scheme!==_e.vscodeNotebookCell?(il.query=null,this._run()):il.query?.modelInfo&&(il.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==Wi.Explicit&&this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===_e.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===_e.vscodeNotebookCell&&o.push(c)}return o}const i=[],s=this.codeEditorService.listCodeEditors();for(const o of s){if(!ew(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const o of s){const r=o.getModel();r&&r!==e&&i.push(r)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){il.query=null,this._stopAll();return}const s=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>s||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,i,s){return s.length?$Vt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),s):zVt(this.providers,e,t,i,this.editor.getOption(x.wordSeparators))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=bm.get(t);if(!i)continue;const s=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=il.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&s.push({range:l.range,options:gUt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],s)}),il.storedDecorations=il.storedDecorations.set(o,c),s.length>0&&(i.wordHighlighter?.decorations.set(s),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},il=D0,D0.storedDecorations=new wi,D0.query=null,D0);XAe=il=D([_(4,Qt)],XAe);var KN;let bm=(KN=class extends ${static get(e){return e.getContribution(JAe.ID)}constructor(e,t,i,s){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new XAe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}stopHighlighting(){this._wordHighlighter?.stop()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},JAe=KN,KN.ID="editor.contrib.wordHighlighter",KN);bm=JAe=D([_(1,Pe),_(2,ht),_(3,Qt)],bm);class Ent extends lt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=bm.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class GVt extends Ent{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(NFe,0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:E.F7,weight:ye.EditorContrib}})}}class qVt extends Ent{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(NFe,1,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|E.F7,weight:ye.EditorContrib}})}}class QVt extends lt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(NFe,2,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Ihe.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:0,weight:ye.EditorContrib}})}run(e,t,i){const s=bm.get(t);s&&s.restoreViewState(!0)}}vn(bm.ID,bm,mi.Eager);Fe(GVt);Fe(qVt);Fe(QVt);const jVt="vs/editor/contrib/wordOperations/browser/wordOperations";class Lhe extends Yc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=new oe(c.positionLineNumber,c.positionColumn),d=this._move(s,o,l,this._wordNavigationType);return this._moveTo(c,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Wi.Explicit,a.map(c=>zn.fromModelSelection(c))),a.length===1){const c=new oe(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(c,vt.Smooth)}}_moveTo(e,t,i){return i?new mt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new mt(t.lineNumber,t.column,t.lineNumber,t.column)}}class gL extends Lhe{_move(e,t,i,s){return Es.moveWordLeft(e,t,i,s)}}class fL extends Lhe{_move(e,t,i,s){return Es.moveWordRight(e,t,i,s)}}class KVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class YVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class JVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.LeftArrow,mac:{primary:V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}class XVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class ZVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class e4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.LeftArrow,mac:{primary:V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}class t4t extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class i4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class n4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class s4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.RightArrow,mac:{primary:V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class o4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordRight",precondition:void 0})}}class r4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class a4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.RightArrow,mac:{primary:V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}class c4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class l4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class d4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class The extends Yc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(lo);if(!t.hasModel())return;const o=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new zd(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class FFe extends The{_delete(e,t){const i=Es.deleteWordLeft(e,t);return i||new O(1,1,1,1)}}class OFe extends The{_delete(e,t){const i=Es.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class h4t extends FFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartLeft",precondition:X.writable})}}class u4t extends FFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndLeft",precondition:X.writable})}}class g4t extends FFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Backspace,mac:{primary:V.Alt|E.Backspace},weight:ye.EditorContrib}})}}class f4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartRight",precondition:X.writable})}}class p4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndRight",precondition:X.writable})}}class m4t extends OFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Delete,mac:{primary:V.Alt|E.Delete},weight:ye.EditorContrib}})}}class _4t extends lt{constructor(){super({id:"deleteInsideWord",precondition:X.writable,label:g(jVt,0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=Es.deleteInsideWord(s,o,c);return new zd(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ke(new KVt);Ke(new YVt);Ke(new JVt);Ke(new XVt);Ke(new ZVt);Ke(new e4t);Ke(new n4t);Ke(new s4t);Ke(new o4t);Ke(new r4t);Ke(new a4t);Ke(new c4t);Ke(new t4t);Ke(new i4t);Ke(new l4t);Ke(new d4t);Ke(new h4t);Ke(new u4t);Ke(new g4t);Ke(new f4t);Ke(new p4t);Ke(new m4t);Fe(_4t);class v4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordPartLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Backspace},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartLeft(e);return i||new O(1,1,1,1)}}class w4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordPartRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Delete},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class xnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartLeft(e,t,i)}}class b4t extends xnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class C4t extends xnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Dnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartRight(e,t,i)}}class y4t extends Dnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class S4t extends Dnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}Ke(new v4t);Ke(new w4t);Ke(new b4t);Ke(new C4t);Ke(new y4t);Ke(new S4t);const Aze="vs/editor/contrib/readOnlyMessage/browser/contribution",xBe=class xBe extends ${constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Du.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Xt(g(Aze,0,"Cannot edit in read-only input")):t=new Xt(g(Aze,1,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};xBe.ID="editor.contrib.readOnlyMessageController";let Pie=xBe;vn(Pie.ID,Pie,mi.BeforeFirstInteraction);let ZAe=class extends ${constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=xi(this,void 0);const s=Bh("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Bh("_textModel.onDidChangeContent",T.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Em(async(r,a)=>{s.read(r),o.read(r);const c=a.add(new l1t),l=await this._outlineModelService.getOrCreate(this._textModel,c.token);a.isDisposed||this._currentModel.set(l,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(Kqe(El(o=>o.range.endLineNumber-o.range.startLineNumber,cg))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};ZAe=D([_(1,ht),_(2,JQ)],ZAe);Yee.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(ZAe,n));var A4t='.monaco-editor .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiM0MjQyNDIiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px;height:36px;margin:0;min-height:0;min-width:0;overflow:hidden;padding:0;position:absolute;resize:none;width:58px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiNDNUM1QzUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #252526}';Ct(A4t,{});const DBe=class DBe extends ${constructor(e){super(),this.editor=e,this.widget=null,I_&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new eEe(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};DBe.ID="editor.contrib.iPadShowKeyboard";let Fie=DBe;const Ice=class Ice extends ${constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(pe(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(pe(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Ice.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}};Ice.ID="editor.contrib.ShowKeyboardWidget";let eEe=Ice;vn(Fie.ID,Fie,mi.Eventually);function tEe(n){return!!n.workspaceUri}function GJ(n){return!!n.folderUri}function E4t(n){return!!n.fileUri}function x4t(n){const e=D4t(n),t=n.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||ei&&rf?"classic":t}var Eze;(function(n){n.TITLE_BAR_STYLE="window.titleBarStyle",n.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(Eze||(Eze={}));var ry;(function(n){n.NATIVE="native",n.CUSTOM="custom"})(ry||(ry={}));var xze;(function(n){n.AUTO="auto",n.WINDOWED="windowed",n.NEVER="never"})(xze||(xze={}));function D4t(n,e){return e||(e=knt(n)),e===ry.NATIVE}function knt(n){if(Jn)return ry.CUSTOM;const e=n.getValue("window");if(e){if(ei&&e.nativeTabs===!0||ei&&e.nativeFullScreen===!1)return ry.NATIVE;const s=e.titleBarStyle;if(s===ry.NATIVE||s===ry.CUSTOM)return s}return jr?ry.NATIVE:ry.CUSTOM}function BFe(n){return{id:Int(n),configPath:n}}function k4t(n){return{id:Int(n),uri:n}}function Int(n){return Ed(n.toString()).toString(16)}const Sn="vs/base/common/date",iEe=60,nEe=iEe*60,f6=nEe*24,Dze=f6*7,kze=f6*30,Ize=f6*365;function WFe(n,e,t,i){typeof n!="number"&&(n=n.getTime());const s=Math.round((new Date().getTime()-n)/1e3);if(s<-30)return g(Sn,0,"in {0}",WFe(new Date().getTime()+s*1e3,!1));if(s<30)return g(Sn,1,"now");let o;return s{await Promise.all(Wnt.map(t=>t(e)))}),await n.invokeFunction(async e=>{RJe((t,i)=>n.createInstance(gF,t,i,{})),KJe(e.get(Zc))}),await n.invokeFunction(async e=>{const t=e.get(mg);await Promise.all(Hnt.map(i=>i(e))),t.phase=2}),await n.invokeFunction(async e=>{await Promise.all(Unt.map(t=>t(e)))}),UFe.open(),Bnt.fire(),n.invokeFunction(async e=>{const t=e.get(mg);it.as(pf.Workbench).start(e),it.as(zS.EditorFactory).start(e),Fnt.fire(e),Ont.fire(e),await Promise.race([e.get(kO).whenRestored,Ta(2e3)]),t.phase=3,new yn(()=>{AW(window,()=>{t.phase=4},2500)},2500).schedule()})}let Vnt=!1;Lt.withServices(()=>(Vnt=!0,$.None));async function znt(){await UFe.wait()}function B4t(){if(Vnt)throw new Error("Services are already initialized")}const W4t="vs/workbench/browser/quickaccess",$nt="inQuickOpen",H4t=new Y($nt,!1,g(W4t,0,"Whether keyboard focus is inside the quick open control")),aA=ge.has($nt),U4t="inFilesPicker",Gnt=ge.and(aA,ge.has(U4t));function Rhe(n,e){return t=>{const i=t.get(ti),s=t.get(On),r={keybindings:i.lookupKeybindings(n)};s.navigate(!!e,r)}}let Lze=class extends ${constructor(e,t){super(),this.editorService=e,this.editorGroupsService=t,this._editorViewState=void 0,this.openedTransientEditors=new Set}set(){if(this._editorViewState)return;const e=this.editorService.activeEditorPane;e&&(this._editorViewState={group:e.group,editor:e.input,state:gmt(e.getControl())?.saveViewState()??void 0})}async openTransientEditor(e,t){e.options={...e.options,transient:!0};const i=await this.editorService.openEditor(e,t);return i?.input&&i.input!==this._editorViewState?.editor&&i.group.isTransient(i.input)&&this.openedTransientEditors.add(i.input),i}async restore(){if(this._editorViewState){for(const e of this.openedTransientEditors)if(!e.isDirty())for(const t of this.editorGroupsService.groups)t.isTransient(e)&&await t.closeEditor(e,{preserveFocus:!0});await this._editorViewState.group.openEditor(this._editorViewState.editor,{viewState:this._editorViewState.state,preserveFocus:!0}),this.reset()}}reset(){this._editorViewState=void 0,this.openedTransientEditors.clear()}dispose(){super.dispose(),this.reset()}};Lze=D([_(0,_i),_(1,ur)],Lze);let sEe=class extends Vee{constructor(e,t,i,s,o,r){super(t,s,o,r,e),this.keybindingService=i,this.inQuickInputContext=H4t.bindTo(this.contextKeyService),this.registerListeners()}registerListeners(){this._register(this.onShow(()=>this.inQuickInputContext.set(!0))),this._register(this.onHide(()=>this.inQuickInputContext.set(!1)))}createController(){return super.createController(this.layoutService,{ignoreFocusOut:()=>!this.configurationService.getValue("workbench.quickOpen.closeOnFocusLost"),backKeybindingLabel:()=>this.keybindingService.lookupKeybinding("workbench.action.quickInputBack")?.getLabel()||void 0})}};sEe=D([_(0,Re),_(1,be),_(2,ti),_(3,Pe),_(4,pn),_(5,bg)],sEe);function V4t(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class s8{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,s);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return V4t(s8.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const o=s8.termFrequencies(s);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:s,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let c=i.get(o);typeof c!="number"&&(c=this.computeIdf(o),i.set(o,c));const l=a*c;s+=l*r}return s}computeEmbedding(e){const t=s8.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function z4t(n){const e=n.slice(0);e.sort((i,s)=>s.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var BE;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(BE||(BE={}));function Ape(n){const e=n;return Array.isArray(e.items)}function Tze(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class zFe extends ${constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new Dn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ai(t);const d=o.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,l,d,i),f=(m,v)=>{let w,b;if(Ape(m)?(w=m.items,b=m.active):w=m,w.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(SU(this.options.noResultsPick)?w=[this.options.noResultsPick(h)]:w=[this.options.noResultsPick])}return e.items=w,b&&(e.activeItems=[b]),!0},p=async m=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Ta(m.mergeDelay),d.isCancellationRequested)||w||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const b=await m.additionalPicks;if(d.isCancellationRequested)return;let C,y;Ape(m.picks)?(C=m.picks.items,y=m.picks.active):C=m.picks;let S,M;if(Ape(b)?(S=b.items,M=b.active):S=b,S.length>0||!v){let k;if(!y&&!M){const F=e.activeItems[0];F&&C.indexOf(F)!==-1&&(k=F)}f({items:[...C,...S],active:y||M||k})}}finally{d.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(u!==null)if(Tze(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;Tze(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(l=>{if(i?.handleAccept){l.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0]);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))}));const c=async(l,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(l)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),f=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(f){case BE.NO_ACTION:break;case BE.CLOSE_PICKER:e.hide();break;case BE.REFRESH_PICKER:a();break;case BE.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),w=e.activeItems.filter(C=>C!==v[0]),b=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,w&&(e.activeItems=w),e.keepScrollPosition=b}break}}}};return s.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),s.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),s}}var ZL,Aa;const IL="vs/platform/quickinput/browser/commandsQuickAccess";var Oy;let oEe=(Oy=class extends zFe{constructor(e,t,i,s,o,r){super(ZL.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(p6)),this.options=e}async _getPicks(e,t,i,s){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=cw(()=>{const f=new s8;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return z4t(p).filter(m=>m.score>ZL.TFIDF_THRESHOLD).slice(0,ZL.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=ZL.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?ZL.WORD_FILTER(e,f.commandAlias)??void 0:void 0;if(p||m)f.highlights={label:p,detail:this.options.showAlias?m:void 0},a.push(f);else if(e===f.commandId)a.push(f);else if(e.length>=3){const v=r();if(i.isCancellationRequested)return[];const w=v.find(b=>b.key===f.commandId);w&&(f.tfIdfScore=w.score,a.push(f))}}const c=new Map;for(const f of a){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}a.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const m=this.commandsHistory.peek(f.commandId),v=this.commandsHistory.peek(p.commandId);if(m&&v)return m>v?-1:1;if(m)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(f.commandId),b=this.options.suggestedCommandIds.has(p.commandId);if(w&&b)return 0;if(w)return-1;if(b)return 1}return f.label.localeCompare(p.label)});const l=[];let d=!1,h=!0,u=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(o,a,e,i);if(i.isCancellationRequested)return[];const p=f.map(m=>this.toCommandPick(m,s));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(IL,1,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?g(IL,4,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Na(o)||this.dialogService.error(g(IL,5,"Command '{0}' resulted in an error",e.label),Ma(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}},ZL=Oy,Oy.PREFIX=">",Oy.TFIDF_THRESHOLD=.5,Oy.TFIDF_MAX_RESULTS=5,Oy.WORD_FILTER=KU(dF,YD,pde),Oy);oEe=ZL=D([_(1,be),_(2,ti),_(3,Qi),_(4,on),_(5,To)],oEe);var Eb;let p6=(Eb=class extends ${constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===nS.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Aa.getConfiguredCommandHistoryLength(this.configurationService),Aa.cache&&Aa.cache.limit!==this.configuredCommandsHistoryLength&&(Aa.cache.limit=this.configuredCommandsHistoryLength,Aa.hasChanges=!0))}load(){const e=this.storageService.get(Aa.PREF_KEY_CACHE,ke.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=Aa.cache=new L_(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Aa.counter=this.storageService.getNumber(Aa.PREF_KEY_COUNTER,ke.PROFILE,Aa.counter)}push(e){Aa.cache&&(Aa.cache.set(e,Aa.counter++),Aa.hasChanges=!0)}peek(e){return Aa.cache?.peek(e)}saveState(){if(!Aa.cache||!Aa.hasChanges)return;const e={usesLRU:!0,entries:[]};Aa.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Aa.PREF_KEY_CACHE,JSON.stringify(e),ke.PROFILE,ln.USER),this.storageService.store(Aa.PREF_KEY_COUNTER,Aa.counter,ke.PROFILE,ln.USER),Aa.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:Aa.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=Aa.getConfiguredCommandHistoryLength(e);Aa.cache=new L_(i),Aa.counter=1,Aa.hasChanges=!0}},Aa=Eb,Eb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Eb.PREF_KEY_CACHE="commandPalette.mru.cache",Eb.PREF_KEY_COUNTER="commandPalette.mru.counter",Eb.counter=1,Eb.hasChanges=!1,Eb);p6=Aa=D([_(0,sn),_(1,Re),_(2,Ze)],p6);class $4t extends oEe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let s;i.metadata?.description&&(XJe(i.metadata.description)?s=i.metadata.description:s={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:s,label:mde(i.label)||i.id})}return t}}var G4t=".monaco-pane-view .split-view-view:first-of-type>.pane>.pane-header{border-top:none!important}.monaco-pane-view .split-view-view:first-of-type>.pane{border-left:none!important}.monaco-pane-view .pane>.pane-header{position:relative}.monaco-pane-view .pane>.pane-header.not-collapsible .twisty-container{display:none}.monaco-pane-view .pane>.pane-header.not-collapsible .title{margin-left:8px}.monaco-pane-view .pane.expanded>.pane-header>.actions.show-expanded,.monaco-pane-view .pane>.pane-header>.actions.show-always{display:initial}.monaco-pane-view .pane>.pane-header>.icon{display:none;height:16px;width:16px}.monaco-pane-view .pane.pane.horizontal:not(.expanded)>.pane-header>.icon{display:inline;margin-top:4px}.monaco-pane-view .pane>.pane-header h3.title{-webkit-margin-before:0;-webkit-margin-after:0;font-size:11px;min-width:3ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description{display:block;flex-shrink:100000;font-weight:400;margin-left:10px;opacity:.6;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description .codicon{font-size:9px;margin-left:2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header .description,.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header h3.title,.monaco-pane-view .pane>.pane-header:not(.expanded) .description{display:none}.monaco-pane-view .pane .monaco-progress-container{left:0;position:absolute;top:-2px;z-index:5}.monaco-pane-view .pane:not(.merged-header) .monaco-progress-container{top:20px}";Ct(G4t,{});var q4t=".monaco-pane-view{height:100%;width:100%}.monaco-pane-view .pane{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.monaco-pane-view .pane.horizontal:not(.expanded){flex-direction:row}.monaco-pane-view .pane>.pane-header{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:11px;font-weight:700;height:22px;overflow:hidden}.monaco-pane-view .pane>.pane-header.not-collapsible{cursor:default}.monaco-pane-view .pane>.pane-header>.title{text-transform:uppercase}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header{flex-direction:column;height:100%;width:22px}.monaco-pane-view .pane>.pane-header>.codicon:first-of-type{margin:0 2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header>.codicon:first-of-type{margin:2px}.monaco-pane-view .pane>.pane-header>.actions{display:none;margin-left:auto}.monaco-pane-view .pane>.pane-header>.actions .action-item{margin-right:4px}.monaco-pane-view .pane>.pane-header>.actions .action-label{padding:2px}.monaco-pane-view .pane:focus-within>.pane-header.expanded>.actions,.monaco-pane-view .pane:hover>.pane-header.expanded>.actions,.monaco-pane-view .pane>.pane-header.actions-always-visible.expanded>.actions,.monaco-pane-view .pane>.pane-header.focused.expanded>.actions{display:initial}.monaco-pane-view .pane>.pane-header .monaco-action-bar .action-item.select-container{cursor:default}.monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{cursor:pointer;min-height:18px;min-width:110px;padding:2px 23px 2px 8px}.linux .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box,.windows .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{padding:0 23px 0 8px}.monaco-pane-view:lang(ja) .pane>.pane-header,.monaco-pane-view:lang(ko) .pane>.pane-header,.monaco-pane-view:lang(zh-Hans) .pane>.pane-header,.monaco-pane-view:lang(zh-Hant) .pane>.pane-header{font-weight:400}.monaco-pane-view .pane>.pane-header.hidden{display:none}.monaco-pane-view .pane>.pane-body{flex:1;overflow:hidden}.monaco-pane-view.animated .split-view-view{transition-duration:.15s;transition-timing-function:ease-out}.reduce-motion .monaco-pane-view .split-view-view{transition-duration:0s!important}.monaco-pane-view.animated.vertical .split-view-view{transition-property:height}.monaco-pane-view.animated.horizontal .split-view-view{transition-property:width}#monaco-pane-drop-overlay{box-sizing:border-box;height:100%;left:0;position:absolute;width:100%;z-index:10000}#monaco-pane-drop-overlay>.pane-overlay-indicator{height:100%;min-height:22px;min-width:19px;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:100%}#monaco-pane-drop-overlay>.pane-overlay-indicator.overlay-move-transition{transition:top 70ms ease-out,left 70ms ease-out,width 70ms ease-out,height 70ms ease-out,opacity .15s ease-out}";Ct(q4t,{});const Q4t="vs/base/browser/ui/splitview/paneview",o9=class o9 extends ${get ariaHeaderLabel(){return this._ariaHeaderLabel}set ariaHeaderLabel(e){this._ariaHeaderLabel=e,this.header.setAttribute("aria-label",this.ariaHeaderLabel)}get draggableElement(){return this.header}get dropTargetElement(){return this.element}get dropBackground(){return this.styles.dropBackground}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize=e,this._onDidChange.fire(void 0)}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize=e,this._onDidChange.fire(void 0)}get headerSize(){return this.headerVisible?o9.HEADER_SIZE:0}get minimumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.minimumBodySize:0;return e+i}get maximumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.maximumBodySize:0;return e+i}constructor(e){super(),this.expandedSize=void 0,this._headerVisible=!0,this._collapsible=!0,this._bodyRendered=!1,this.styles={dropBackground:void 0,headerBackground:void 0,headerBorder:void 0,headerForeground:void 0,leftBorder:void 0},this.animationTimer=void 0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeExpansionState=this._register(new I),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this.orthogonalSize=0,this._expanded=typeof e.expanded>"u"?!0:!!e.expanded,this._orientation=typeof e.orientation>"u"?vi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(Q4t,0,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===vi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=we(".pane")}isExpanded(){return this._expanded}setExpanded(e){return!e&&!this.collapsible||this._expanded===!!e?!1:(this.element?.classList.toggle("expanded",e),this._expanded=!!e,this.updateHeader(),e?(this._bodyRendered||(this.renderBody(this.body),this._bodyRendered=!0),typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),he(this.element,this.body)):this.animationTimer=gt(this.element).setTimeout(()=>{this.body.remove()},200),this._onDidChangeExpansionState.fire(e),this._onDidChange.fire(e?this.expandedSize:void 0),!0)}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible!==!!e&&(this._headerVisible=!!e,this.updateHeader(),this._onDidChange.fire(void 0))}get collapsible(){return this._collapsible}set collapsible(e){this._collapsible!==!!e&&(this._collapsible=!!e,this.updateHeader())}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.element&&(this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL),this.header=we(".pane-header"),he(this.element,this.header),this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button"),this.header.setAttribute("aria-label",this.ariaHeaderLabel),this.renderHeader(this.header);const e=Dd(this.header);this._register(e),this._register(e.onDidFocus(()=>this.header.classList.add("focused"),null)),this._register(e.onDidBlur(()=>this.header.classList.remove("focused"),null)),this.updateHeader();const t=this._register(new Z),i=this._register(new oi(this.header,"keydown")),s=T.map(i.event,o=>new os(o),t);this._register(T.filter(s,o=>o.keyCode===E.Enter||o.keyCode===E.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(T.filter(s,o=>o.keyCode===E.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(T.filter(s,o=>o.keyCode===E.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(dh.addTarget(this.header)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=he(this.element,we(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?o9.HEADER_SIZE:0,i=this._orientation===vi.VERTICAL?this.orthogonalSize:e,s=this._orientation===vi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(s,i),this.expandedSize=e)}style(e){this.styles=e,this.header&&this.updateHeader()}updateHeader(){const e=!this.headerVisible||this.isExpanded();this.collapsible?(this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button")):(this.header.removeAttribute("tabindex"),this.header.removeAttribute("role")),this.header.style.lineHeight=`${this.headerSize}px`,this.header.classList.toggle("hidden",!this.headerVisible),this.header.classList.toggle("expanded",e),this.header.classList.toggle("not-collapsible",!this.collapsible),this.header.setAttribute("aria-expanded",String(e)),this.header.style.color=this.collapsible?this.styles.headerForeground??"":"",this.header.style.backgroundColor=(this.collapsible?this.styles.headerBackground:"transparent")??"",this.header.style.borderTop=this.styles.headerBorder&&this.orientation===vi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===vi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};o9.HEADER_SIZE=22;let rEe=o9;const Lce=class Lce extends ${constructor(e,t,i){super(),this.pane=e,this.dnd=t,this.context=i,this.dragOverCounter=0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,e.draggableElement.draggable=!0,this._register(pe(e.draggableElement,"dragstart",s=>this.onDragStart(s))),this._register(pe(e.dropTargetElement,"dragenter",s=>this.onDragEnter(s))),this._register(pe(e.dropTargetElement,"dragleave",s=>this.onDragLeave(s))),this._register(pe(e.dropTargetElement,"dragend",s=>this.onDragEnd(s))),this._register(pe(e.dropTargetElement,"drop",s=>this.onDrop(s)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",pp&&e.dataTransfer?.setData(gm.TEXT,this.pane.draggableElement.textContent||"");const t=he(this.pane.element.ownerDocument.body,we(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>this.pane.element.ownerDocument.body.removeChild(t),0),this.context.draggable=this}onDragEnter(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter++,this.render())}onDragLeave(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter--,this.dragOverCounter===0&&this.render())}onDragEnd(e){this.context.draggable&&(this.dragOverCounter=0,this.render(),this.context.draggable=null)}onDrop(e){this.context.draggable&&(un.stop(e),this.dragOverCounter=0,this.render(),this.dnd.canDrop(this.context.draggable.pane,this.pane)&&this.context.draggable!==this&&this._onDidDrop.fire({from:this.context.draggable.pane,to:this.pane}),this.context.draggable=null)}render(){let e=null;this.dragOverCounter>0&&(e=this.pane.dropBackground??Lce.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Lce.DefaultDragOverBackgroundColor=new fe(new gn(128,128,128,.5));let aEe=Lce;class j4t extends ${constructor(e,t={}){super(),this.dndContext={draggable:null},this.paneItems=[],this.orthogonalSize=0,this.size=0,this.animationTimer=void 0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,this.dnd=t.dnd,this.orientation=t.orientation??vi.VERTICAL,this.element=he(e,we(".monaco-pane-view")),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.onDidSashReset=this.splitview.onDidSashReset,this.onDidSashChange=this.splitview.onDidSashChange,this.onDidScroll=this.splitview.onDidScroll;const i=this._register(new Z),s=this._register(new oi(this.element,"keydown")),o=T.map(T.filter(s.event,r=>Ra(r.target)&&r.target.classList.contains("pane-header"),i),r=>new os(r),i);this._register(T.filter(o,r=>r.keyCode===E.UpArrow,i)(()=>this.focusPrevious())),this._register(T.filter(o,r=>r.keyCode===E.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const s=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,s);const o={pane:e,disposable:s};if(this.paneItems.splice(i,0,o),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const r=new aEe(e,this.dnd,this.dndContext);s.add(r),s.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?A1.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),s=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||s===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,o),this.splitview.moveView(i,s)}resizePane(e,t){const i=this.paneItems.findIndex(s=>s.pane===e);i!==-1&&this.splitview.resizeView(i,t)}getPaneSize(e){const t=this.paneItems.findIndex(i=>i.pane===e);return t===-1?-1:this.splitview.getViewSize(t)}layout(e,t){this.orthogonalSize=this.orientation===vi.VERTICAL?t:e,this.size=this.orientation===vi.HORIZONTAL?t:e;for(const i of this.paneItems)i.pane.orthogonalSize=this.orthogonalSize;this.splitview.layout(this.size)}setBoundarySashes(e){this.boundarySashes=e,this.updateSplitviewOrthogonalSashes(e)}updateSplitviewOrthogonalSashes(e){this.orientation===vi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===vi.VERTICAL?vi.HORIZONTAL:vi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Yo(this.element),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const s=this.orientation===vi.VERTICAL?t:e,o=this.orientation===vi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=s,r.pane.orientation=this.orientation;const c=this.size===0?0:o*i[a]/this.size;this.splitview.addView(r.pane,c,a)}),this.size=o,this.orthogonalSize=s,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=gt(this.element).setTimeout(()=>{this.animationTimer=void 0,this.element.classList.remove("animated")},200)}getPaneHeaderElements(){return[...this.element.querySelectorAll(".pane-header")]}focusPrevious(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.max(t-1,0)].focus()}focusNext(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.min(t+1,e.length-1)].focus()}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose())}}var Nl;(function(n){let e;(function(s){s[s.None=0]="None",s[s.Done=1]="Done",s[s.Infinite=2]="Infinite",s[s.While=3]="While",s[s.Work=4]="Work"})(e=n.Type||(n.Type={})),n.None={type:e.None},n.Done={type:e.Done},n.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}n.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}n.Work=i})(Nl||(Nl={}));class K4t extends ${constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=Nl.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==Nl.Done.type)if(this.progressState.type===Nl.Type.While){let e;if(this.progressState.whileDelay>0){const t=this.progressState.whileDelay-(Date.now()-this.progressState.whileStart);t>0&&(e=t)}this.doShowWhile(e)}else this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===Nl.Type.Work&&(this.progressState.total&&this.progressBar.total(this.progressState.total).show(),this.progressState.worked&&this.progressBar.worked(this.progressState.worked).show())}onDidScopeDeactivate(){this.progressBar.stop().hide()}show(e,t){return typeof e=="boolean"?this.progressState=Nl.Infinite:this.progressState=new Nl.Work(e,void 0),this.scope.isActive&&(this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===Nl.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new Nl.Work(i,this.progressState.type===Nl.Type.Work?this.progressState.worked:void 0),this.scope.isActive&&this.progressBar.total(i)},worked:i=>{!this.scope.isActive||this.progressBar.hasTotal()?(this.progressState=new Nl.Work(this.progressState.type===Nl.Type.Work?this.progressState.total:void 0,this.progressState.type===Nl.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=Nl.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=Nl.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===Nl.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new Nl.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==Nl.Type.While||this.progressState.whilePromise===e)&&(this.progressState=Nl.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class Y4t extends ${get isActive(){return this._isActive}constructor(e,t){super(),this.scopeId=e,this._isActive=t,this._onDidChangeActive=this._register(new I),this.onDidChangeActive=this._onDidChangeActive.event}onScopeOpened(e){e===this.scopeId&&(this._isActive||(this._isActive=!0,this._onDidChangeActive.fire()))}onScopeClosed(e){e===this.scopeId&&this._isActive&&(this._isActive=!1,this._onDidChangeActive.fire())}}class J4t extends ${get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,s){super(),this.options=t,this.menuService=i,this.contextKeyService=s,this._primaryActions=[],this._secondaryActions=[],this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.disposables=this._register(new Z),this.menu=this._register(i.createMenu(e,s)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],tD(this.menu,this.options,{primary:this._primaryActions,secondary:this._secondaryActions}),this.disposables.add(this.updateSubmenus([...this._primaryActions,...this._secondaryActions],{})),this._onDidChange.fire()}updateSubmenus(e,t){const i=new Z;for(const s of e)if(s instanceof uS&&!t[s.item.submenu.id]){const o=t[s.item.submenu.id]=i.add(this.menuService.createMenu(s.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(s.actions,t))}return i}}let Oie=class extends ${constructor(e,t,i,s,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=s,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new J4t(e,this.options,o,s)),this._register(this.menuActions.onDidChange(()=>this._onDidChange.fire()))}getPrimaryActions(){return this.menuActions.primaryActions}getSecondaryActions(){return this.menuActions.secondaryActions}getContextMenuActions(){const e=[];if(this.contextMenuId){const t=this.menuService.createMenu(this.contextMenuId,this.contextKeyService);tD(t,this.options,{primary:[],secondary:e}),t.dispose()}return e}};Oie=D([_(3,Pe),_(4,mc)],Oie);const X4t="vs/workbench/browser/parts/views/viewFilter",qnt=new Te("menu.view.filter"),Mhe=new Te("submenu.view.filter");Xs.appendMenuItem(qnt,{submenu:Mhe,title:g(X4t,0,"More Filters..."),group:"navigation",icon:Ce.filter});class Z4t extends b7{constructor(){super(...arguments),this._checked=!1}set checked(e){this._checked!==e&&(this._checked=e,this.updateChecked())}updateChecked(){this.element&&this.element.classList.toggle("checked",this._checked)}render(e){super.render(e),this.updateChecked()}}let cEe=class extends wg{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,s,o){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=o,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Lu(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Y(e.focusContextKey,!1).bindTo(s)),this.element=we(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=he(this.element,we(".viewpane-filter-controls"));this.filterBadge=this.createBadge(r),this.toolbar=this._register(this.createToolBar(r)),this.adjustInputBox()}hasFocus(){return this.filterInputBox.hasFocus()}focus(){this.filterInputBox.focus()}blur(){this.filterInputBox.blur()}updateBadge(e){this.filterBadge.classList.toggle("hidden",!e),this.filterBadge.textContent=e||"",this.adjustInputBox()}setFilterText(e){this.filterInputBox.value=e}getFilterText(){return this.filterInputBox.value}getHistory(){return this.filterInputBox.getHistory()}layout(e){this.element.parentElement?.classList.toggle("grow",e>700),this.element.classList.toggle("small",e<400),this.adjustInputBox(),this.lastWidth=e}relayout(){this.lastWidth&&this.layout(this.lastWidth)}checkMoreFilters(e){this.isMoreFiltersChecked=e,this.moreFiltersActionViewItem&&(this.moreFiltersActionViewItem.checked=e)}createInput(e){const t=this._register(this.instantiationService.createInstance(vye,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>qSe(this.keybindingService),inputBoxStyles:eV}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(s=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Xo(t.inputElement,xe.KEY_DOWN,s=>this.onInputKeyDown(s,t))),this._register(Xo(e,xe.KEY_DOWN,this.handleKeyboardEvent)),this._register(Xo(e,xe.KEY_UP,this.handleKeyboardEvent)),this._register(Xo(t.inputElement,xe.CLICK,s=>{s.stopPropagation(),s.preventDefault()}));const i=this._register(Dd(t.inputElement));return this.focusContextKey&&(this._register(i.onDidFocus(()=>this.focusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.focusContextKey.set(!1))),this._register(Ee(()=>this.focusContextKey.reset()))),[t,i]}createBadge(e){const t=he(e,we(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=Ye(kW),t.style.color=Ye(DMe),t.style.border=`1px solid ${Ye(ft)}`,t}createToolBar(e){return this.instantiationService.createInstance(nC,e,qnt,{hiddenItemStrategy:wS.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof uS&&t.item.submenu.id===Mhe.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(Z4t,t,i),this.moreFiltersActionViewItem.checked=this.isMoreFiltersChecked,this.moreFiltersActionViewItem}})}onDidInputChange(e){e.addToHistory(),this._onDidChangeFilterText.fire(e.value)}adjustInputBox(){this.filterInputBox.inputElement.style.paddingRight=this.element.classList.contains("small")||this.filterBadge.classList.contains("hidden")?"25px":"150px"}handleKeyboardEvent(e){(e.equals(E.Space)||e.equals(E.LeftArrow)||e.equals(E.RightArrow))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(E.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};cEe=D([_(1,be),_(2,W_),_(3,Pe),_(4,ti)],cEe);var lEe;const Bie="vs/workbench/browser/parts/views/viewPane";var o8;(function(n){n[n.Default=0]="Default",n[n.WhenExpanded=1]="WhenExpanded",n[n.Always=2]="Always"})(o8||(o8={}));const Rze=new xn("viewpane.action.filter"),ezt=ji("view-pane-container-expanded",Ce.chevronDown,g(Bie,0,"Icon for an expanded view pane container.")),tzt=ji("view-pane-container-collapsed",Ce.chevronRight,g(Bie,1,"Icon for a collapsed view pane container.")),Mze=it.as(M1.ViewsRegistry);let dEe=class{get enabled(){return this._enabled}constructor(e,t,i,s,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=s,this.telemetryService=o,this.contextKeyService=r,this.items=[],this._enabled=!1,this.disposables=new Z,this.enabledDisposables=this.disposables.add(new Z),this.renderDisposables=this.disposables.add(new Z),this.disposables.add(T.runAndSubscribe(this.delegate.onDidChangeViewWelcomeState,()=>this.onDidChangeViewWelcomeState())),this.disposables.add(a.onWillShutdown(()=>this.dispose()))}layout(e,t){this._enabled&&(this.element.style.height=`${e}px`,this.element.style.width=`${t}px`,this.element.classList.toggle("wide",t>640),this.scrollableElement.scanDomNode())}focus(){this._enabled&&this.element.focus()}onDidChangeViewWelcomeState(){const e=this.delegate.shouldShowWelcome();if(this._enabled===e)return;if(this._enabled=e,!e){this.enabledDisposables.clear();return}this.container.classList.add("welcome");const t=he(this.container,we(".welcome-view"));this.element=we(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new bz(this.element,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible}),he(t,this.scrollableElement.getDomNode()),this.enabledDisposables.add(Ee(()=>{this.container.classList.remove("welcome"),this.scrollableElement.dispose(),t.remove(),this.scrollableElement=void 0,this.element=void 0})),this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.enabledDisposables),T.chain(Mze.onDidChangeViewWelcomeContent,i=>i.filter(s=>s===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=Mze.getViewWelcomeContent(this.delegate.id);this.items=[];for(const t of e)if(t.when==="default")this.defaultItem={descriptor:t,visible:!0};else{const i=t.when?this.contextKeyService.contextMatchesRules(t.when):!0;this.items.push({descriptor:t,visible:i})}this.render()}onDidChangeContext(){let e=!1;for(const t of this.items){if(!t.descriptor.when||t.descriptor.when==="default")continue;const i=this.contextKeyService.contextMatchesRules(t.descriptor.when);t.visible!==i&&(t.visible=i,e=!0)}e&&this.render()}render(){this.renderDisposables.clear(),this.element.innerText="";const e=this.getContentDescriptors();if(e.length===0){this.container.classList.remove("welcome"),this.scrollableElement.scanDomNode();return}for(const{content:t,precondition:i}of e){const s=t.split(` -`);for(let o of s){if(o=o.trim(),!o)continue;const r=aXe(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=he(this.element,we(".button-container")),l=new Tu(c,{title:a.title,supportIcons:!0,...yQ});if(l.label=a.label,l.onDidClick(d=>{this.telemetryService.publicLog2("views.welcomeAction",{viewId:this.delegate.id,uri:a.href}),this.openerService.open(a.href,{allowCommands:!0})},null,this.renderDisposables),this.renderDisposables.add(l),i){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=he(this.element,we("p"));for(const c of r.nodes)if(typeof c=="string")he(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(t6,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}}}}this.container.classList.add("welcome"),this.scrollableElement.scanDomNode()}getContentDescriptors(){const e=this.items.filter(t=>t.visible);return e.length===0&&this.defaultItem?[this.defaultItem.descriptor]:e.map(t=>t.descriptor)}dispose(){this.disposables.dispose()}};dEe=D([_(2,be),_(3,fr),_(4,on),_(5,Pe),_(6,mg)],dEe);var YN;let Wie=(YN=class extends rEe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===Sr.Panel?vi.HORIZONTAL:vi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=s,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewService=u,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidChangeBodyVisibility=this._register(new I),this.onDidChangeBodyVisibility=this._onDidChangeBodyVisibility.event,this._onDidChangeTitleArea=this._register(new I),this.onDidChangeTitleArea=this._onDidChangeTitleArea.event,this._onDidChangeViewWelcomeState=this._register(new I),this.onDidChangeViewWelcomeState=this._onDidChangeViewWelcomeState.event,this._isVisible=!1,this.id=e.id,this._title=e.title,this._titleDescription=e.titleDescription,this._singleViewPaneContainerTitle=e.singleViewPaneContainerTitle,this.showActions=e.showActions??o8.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",aie(r.getViewLocationById(this.id)));this._register(T.filter(r.onDidChangeLocation,p=>p.views.some(m=>m.id===this.id))(()=>f.set(aie(r.getViewLocationById(this.id))))),this.menuActions=this._register(this.instantiationService.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(Oie,e.titleMenuId??Te.ViewTitle,Te.ViewTitleContext,{shouldForwardArgs:!e.donotForwardArgs,renderShortTitle:!0})),this._register(this.menuActions.onDidChange(()=>this.updateActions()))}get headerVisible(){return super.headerVisible}set headerVisible(e){super.headerVisible=e,this.element.classList.toggle("merged-header",!e)}setVisible(e){this._isVisible!==e&&(this._isVisible=e,this.isExpanded()&&this._onDidChangeBodyVisibility.fire(e))}isVisible(){return this._isVisible}isBodyVisible(){return this._isVisible&&this.isExpanded()}setExpanded(e){const t=super.setExpanded(e);return t&&this._onDidChangeBodyVisibility.fire(e),this.updateTwistyIcon(),t}render(){super.render();const e=Dd(this.element);this._register(e),this._register(e.onDidFocus(()=>this._onDidFocus.fire())),this._register(e.onDidBlur(()=>this._onDidBlur.fire()))}renderHeader(e){this.headerContainer=e,this.twistiesContainer=he(e,we(`.twisty-container${$e.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=he(e,we(".actions"));t.classList.toggle("show-always",this.showActions===o8.Always),t.classList.toggle("show-expanded",this.showActions===o8.WhenExpanded),this.toolbar=this.instantiationService.createInstance(lV,t,{orientation:Qb.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(Bie,2,"{0} actions",this.title),getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id),renderDropdownAsChildElement:!0,actionRunner:this.getActionRunner(),resetMenu:this.menuActions.menuId}),this._register(this.toolbar),this.setActions(),this._register(pe(t,xe.CLICK,o=>o.preventDefault()));const i=this.viewDescriptorService.getViewContainerByViewId(this.id);i?this._register(this.viewDescriptorService.getViewContainerModel(i).onDidChangeContainerInfo(({title:o})=>this.updateTitle(this.title))):console.error(`View container model not found for view ${this.id}`);const s=T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(lEe.AlwaysShowActionsConfig));this._register(s(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...$e.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...$e.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?ezt:tzt}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=hS(e.headerForeground,Ye(Ge));P.isUri(t)?(this.iconContainer.style.backgroundColor=i,this.iconContainer.style.color=""):(this.iconContainer.style.color=i,this.iconContainer.style.backgroundColor="")}}getIcon(){return this.viewDescriptorService.getViewDescriptorById(this.id)?.containerIcon||_Bt}renderHeaderTitle(e,t){this.iconContainer=he(e,we(".icon",void 0));const i=this.getIcon();let s;if(P.isUri(i)){s=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${s}`;Kp(r,` +`)};const r=await o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(g(bb,0,"No result.")),s);return r}}async function XUt(n,e,t,i){const s=new IFe(e,t,n),o=await s.resolveRenameLocation(qe.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,qe.None)}var GN;let F1=(GN=class{static get(e){return e.getContribution(TAe.ID)}constructor(e,t,i,s,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ai,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(LAe,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ai,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new IFe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new I1(this.editor,hr.Position|hr.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(s.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Tc?e("resolve rename location cancelled",JSON.stringify(p,null," ")):(e("resolve rename location failed",p instanceof Error?p:JSON.stringify(p,null," ")),(typeof p=="string"||ah(p))&&Du.get(this.editor)?.showMessage(p||g(bb,1,"An unknown error occurred while resolving rename location"),t));return}finally{s.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Du.get(this.editor)?.showMessage(o.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new I1(this.editor,hr.Position|hr.Value,o.range,this._cts.token),a=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(a),l=await Promise.all(c.map(async p=>[p,await p.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(p,m)=>{let v=l.slice();return p===rF.Automatic&&(v=v.filter(([w,b])=>b)),v.map(([w])=>w.provideNewSymbolNames(a,o.range,p,m))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,c.length>0?d:void 0,r);if(e("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=dw(i.provideRenameEdits(u.newName,r.token),r.token).then(async p=>{if(!p){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(p.rejectReason){e(`returning early - rejected with reason: ${p.rejectReason}`),this._notificationService.info(p.rejectReason);return}this.editor.setSelection(O.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(bb,2,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(bb,3,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&sa(g(bb,4,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,m.ariaSummary))}).catch(m=>{e(`error when applying edits ${JSON.stringify(m,null," ")}`),this._notificationService.error(g(bb,5,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(bb,6,"Rename failed to compute edits")),this._logService.error(p)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const s=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",s)}},TAe=GN,GN.ID="editor.contrib.renameController",GN);F1=TAe=D([_(1,be),_(2,Pi),_(3,vO),_(4,eD),_(5,Ze),_(6,dl),_(7,ht),_(8,rn)],F1);class ZUt extends lt{constructor(){super({id:"editor.action.rename",label:g(bb,7,"Rename Symbol"),alias:"Rename Symbol",precondition:ge.and(X.writable,X.hasRenameProvider),kbOpts:{kbExpr:X.editorTextFocus,primary:E.F2,weight:ye.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(jt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return P.isUri(s)&&oe.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},bt):super.runCommand(e,t)}run(e,t){const i=e.get(Ze),s=F1.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}vn(F1.ID,F1,mi.Lazy);Fe(ZUt);const LFe=Jc.bindToContribution(F1.get);Ke(new LFe({id:"acceptRenameInput",precondition:zz,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:E.Enter}}));Ke(new LFe({id:"acceptRenameInputWithPreview",precondition:ge.and(zz,ge.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:ye.EditorContrib+99,kbExpr:ge.and(X.focus,ge.not("isComposing")),primary:V.CtrlCmd+E.Enter}}));Ke(new LFe({id:"cancelRenameInput",precondition:zz,handler:n=>n.cancelRenameInput(),kbOpts:{weight:ye.EditorContrib+99,kbExpr:X.focus,primary:E.Escape,secondary:[V.Shift|E.Escape]}}));At(class extends pi{constructor(){super({id:"focusNextRenameSuggestion",title:{...Be(bb,8,"Focus Next Rename Suggestion")},precondition:zz,keybinding:[{primary:E.DownArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(jt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends pi{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Be(bb,9,"Focus Previous Rename Suggestion")},precondition:zz,keybinding:[{primary:E.UpArrow,weight:ye.EditorContrib+99}]})}run(e){const t=e.get(jt).getFocusedCodeEditor();if(!t)return;const i=F1.get(t);i&&i.focusPreviousRenameSuggestion()}});nA("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;Bt(typeof s=="string");const{renameProvider:o}=n.get(ht);return XUt(o,e,t,s)});nA("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(ht),o=await new IFe(e,t,i).resolveRenameLocation(qe.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:ut.LANGUAGE_OVERRIDABLE,description:g(bb,10,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var OH;let kie=(OH=class extends ${constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(x.minimap)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{const o=this.editor.getModel()?.getLanguageId();o&&s.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new yn(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!s?.markers))return{foldingRules:s,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),c=a.findTokenIndexAtOffset(r.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===Ar.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),s=e.map(o=>eVt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,c=r.length;a0&&(h=e.subarray(t,t+d),t+=d),r[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:r}}function Dhe(n){return n&&!!n.data}function hnt(n){return n&&Array.isArray(n.edits)}class sVt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function unt(n,e){return n.has(e)}function oVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function gnt(n,e,t,i,s){const o=oVt(n,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){l=d,c=null}return(!c||!Dhe(c)&&!hnt(c))&&(c=null),new sVt(a,c,l)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function rVt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class aVt{constructor(e,t){this.provider=e,this.tokens=t}}function cVt(n,e){return n.has(e)}function fnt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function TFe(n,e,t,i){const s=fnt(n,e),o=await Promise.all(s.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){er(c),a=null}return(!a||!Dhe(a))&&(a=null),new aVt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}yt.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht),o=rVt(s,i);return o?o[0].getLegend():n.get(ji).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});yt.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;Bt(t instanceof P);const i=n.get(Ai).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ht);if(!unt(s,i))return n.get(ji).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await gnt(s,i,null,null,qe.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!Dhe(a))return;const c=d6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});yt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P);const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=fnt(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!O.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await TFe(o,s,O.lift(i),qe.None);if(a)return a.provider.getLegend()});yt.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;Bt(t instanceof P),Bt(O.isIRange(i));const s=n.get(Ai).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(ht),r=await TFe(o,s,O.lift(i),qe.None);if(!(!r||!r.tokens))return d6({id:0,type:"full",data:r.tokens.data})});const RFe="editor.semanticHighlighting";function $J(n,e,t){const i=t.getValue(RFe,{overrideIdentifier:n.getLanguageId(),resource:n.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var MD;let RAe=class extends ${constructor(e,t,i,s,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new MAe(d,e,i,o,r)},c=(d,h)=>{h.dispose(),delete this._watchers[d.uri.toString()]},l=()=>{for(const d of t.getModels()){const h=this._watchers[d.uri.toString()];$J(d,i,s)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{$J(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{$J(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(RFe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};RAe=D([_(0,gde),_(1,Ai),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],RAe);var x0;let MAe=(x0=class extends ${constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:MD.REQUEST_MIN_DELAY,max:MD.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new yn(()=>this._fetchDocumentSemanticTokensNow(),MD.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),St(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!unt(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ai,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=gnt(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(c=>{o.push(c)}),a=new ao(!1);s.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,o)}},c=>{c&&(Na(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||bt(c),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(hnt(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=o.data,l=new Uint32Array(c.length+a);let d=c.length,h=l.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>c.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(MD._copy(c,d-p,l,h-p,p),h-=p),f.data&&(MD._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&MD._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(Dhe(t)){this._currentDocumentResponse=new lVt(e,t.resultId,t.data);const a=RYe(t,i,this._model.getLanguageId());if(s.length>0)for(const c of s)for(const l of a)for(const d of c.changes)l.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},MD=x0,x0.REQUEST_MIN_DELAY=300,x0.REQUEST_MAX_DELAY=2e3,x0);MAe=MD=D([_(1,gde),_(2,pn),_(3,B_),_(4,ht)],MAe);class lVt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}KQ(RAe);var NAe,qN;let WV=(qN=class extends ${static get(e){return e.getContribution(NAe.ID)}constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new yn(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(RFe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=na(r=>Promise.resolve(TFe(this._provider,e,t,r))),o=new ao(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=r,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,RYe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},NAe=qN,qN.ID="editor.contrib.viewportSemanticTokens",qN);WV=NAe=D([_(1,gde),_(2,pn),_(3,Re),_(4,B_),_(5,ht)],WV);vn(WV.ID,WV,mi.AfterFirstRender);class dVt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===Q.Underline||h===Q.Dash))break;if(Bk(h)&&fy(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new O(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var PAe;const Lie="vs/editor/contrib/smartSelect/browser/smartSelect";class MFe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new MFe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var QN;let RF=(QN=class{static get(e){return e.getContribution(PAe.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await mnt(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),qe.None).then(o=>{if(!(!mo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ls(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),o[r].unshift(t[r]);this._state=o.map(r=>new MFe(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>mt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},PAe=QN,QN.ID="editor.contrib.smartSelectController",QN);RF=PAe=D([_(1,ht)],RF);class pnt extends lt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=RF.get(t);i&&await i.run(this._forward)}}class hVt extends pnt{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(Lie,0,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.RightArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.RightArrow,secondary:[V.WinCtrl|V.Shift|E.RightArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,1,"&&Expand Selection"),order:2}})}}yt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class uVt extends pnt{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(Lie,2,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|V.Alt|E.LeftArrow,mac:{primary:V.CtrlCmd|V.WinCtrl|V.Shift|E.LeftArrow,secondary:[V.WinCtrl|V.Shift|E.LeftArrow]},weight:ye.EditorContrib},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:g(Lie,3,"&&Shrink Selection"),order:3}})}}vn(RF.ID,RF,mi.Lazy);Fe(hVt);Fe(uVt);async function mnt(n,e,t,i,s){const o=n.all(e).concat(new dVt(i.selectSubwords));o.length===1&&o.unshift(new Tte);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,s)).then(l=>{if(mo(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>oe.isBefore(u.getStartPosition(),f.getStartPosition())?1:oe.isBefore(f.getStartPosition(),u.getStartPosition())||oe.isBefore(u.getEndPosition(),f.getEndPosition())?-1:oe.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const l=[];let d;for(const u of c)(!d||O.containsRange(u,d)&&!O.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;un}),ype="data-sticky-line-index",yze="data-sticky-is-line",fVt="data-sticky-is-line-number",Sze="data-sticky-is-folding-icon";class pVt extends ${constructor(e){super(),this._editor=e,this._foldingIconStore=new Z,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(x.lineHeight),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof oC),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(x.stickyScroll).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(x.stickyScroll)&&t(),i.hasChanged(x.lineHeight)&&(this._lineHeight=this._editor.getOption(x.lineHeight))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const s=this._isWidgetHeightZero(e),o=s?void 0:e,r=s?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(o,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,s=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+s.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(pe(this._lineNumbersDomNode,xe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new oe(t,1)).lineNumber,a=o.getViewLineRenderingData(r),c=this._editor.getOption(x.lineNumbers);let l;try{l=ig.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new tL(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,l,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),h=new fz(2e3),u=lQ(d,h);let f;Cze?f=Cze.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(ype,String(e)),p.setAttribute(yze,""),p.setAttribute("role","listitem"),p.tabIndex=0,p.className="sticky-line-content",p.classList.add(`stickyLine${t}`),p.style.lineHeight=`${this._lineHeight}px`,p.innerHTML=f;const m=document.createElement("span");m.setAttribute(ype,String(e)),m.setAttribute(fVt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=s.contentLeft;m.style.width=`${v}px`;const w=document.createElement("span");c.renderType===Qr.On||c.renderType===Qr.Interval&&t%10===0?w.innerText=t.toString():c.renderType===Qr.Relative&&(w.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),w.className="sticky-line-number-inner",w.style.lineHeight=`${this._lineHeight}px`,w.style.width=`${s.lineNumbersWidth}px`,w.style.paddingLeft=`${s.lineNumbersLeft}px`,m.appendChild(w);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(w),m.style.lineHeight=`${this._lineHeight}px`,p.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`;const C=new mVt(e,t,p,m,b,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,s=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,s.style.zIndex=o?r:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=o?c:l,s.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const c=s.isCollapsed(o),l=new _Vt(c,r,s.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute(Sze,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Yf.TOP_CENTER,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=NMe(t.characterMapping,e,0);return new oe(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,ype);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,yze)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Sze)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class mVt{constructor(e,t,i,s,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class _Vt{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width=`${s}px`,this.domNode.style.height=`${s}px`,this.domNode.className=$e.asClassName(e?ite:tte)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class i8{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class Tie{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class _nt{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var n8;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(n8||(n8={}));var fI;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(fI||(fI={}));let FAe=class extends ${constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Lu(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case n8.OUTLINE_MODEL:this._modelProviders.push(new OAe(this._editor,s));case n8.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new WAe(this._editor,t,s));case n8.INDENTATION_MODEL:this._modelProviders.push(new BAe(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const o=await i;if(this._modelPromise!==s)return null;switch(o){case fI.CANCELED:return this._updateOperation.clear(),null;case fI.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};FAe=D([_(2,be),_(3,ht)],FAe);class vnt extends ${constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,fI.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=na(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?fI.CANCELED:(this._stickyModel=this.createStickyModel(e,i),fI.VALID):this._invalid()).then(void 0,i=>(bt(i),fI.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let OAe=class extends vnt{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return oy.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new _nt(o.uri,o.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(fi.first(e.children.values())instanceof XSe){const a=fi.find(e.children.values(),c=>c.id===t);if(a)i=a.children;else{let c="",l=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>l&&(d=u,l=f,c=u.id)}t=c,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,c)=>{const l=new i8(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new i8(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Tie(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new i8(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new Tie(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof JSe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};OAe=D([_(1,ht)],OAe);class wnt extends vnt{constructor(e){super(e),this._foldingLimitReporter=new CZe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new _nt(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new Tie(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new pPe(e.getModel(),s,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};WAe=D([_(2,ht)],WAe);class vVt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var BH;let HAe=(BH=class extends ${constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new I),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Z),this._updateSoon=this._register(new yn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.stickyScroll)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(x.stickyScroll).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Ee(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new FAe(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ai,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(CU(a,e.startLineNumber+s,(d,h)=>d-h));for(let d=c;d<=l;d++){const h=t.children[d];if(!h)return;if(h.range){const u=h.range.startLineNumber,f=h.range.endLineNumber;e.startLineNumber<=f+1&&u-1<=e.endLineNumber&&u!==r&&(r=u,i.push(new vVt(u,f-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,s,o)}}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=this._editor._getViewModel()?.getHiddenAreas();if(i)for(const s of i)t=t.filter(o=>!(o.startLineNumber>=s.startLineNumber&&o.endLineNumber<=s.endLineNumber+1));return t}},BH.ID="store.contrib.stickyScrollController",BH);HAe=D([_(1,ht),_(2,lo)],HAe);var UAe,jN;let Gx=(jN=class extends ${constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new Z,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new pVt(this._editor),this._stickyLineCandidateProvider=new HAe(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bze([],[],0),this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(pe(c,xe.CONTEXT_MENU,async d=>{this._onContextMenu(gt(c),d)})),this._stickyScrollFocusedContextKey=X.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=X.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Dd(c));this._register(l.onDidBlur(d=>{this._positionRevealed===!1&&c.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(l.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(pe(c,xe.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(UAe.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,vt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(O.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new phe(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new O(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(Xo(s,xe.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(l===null)return;const d=new oe(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(l===null)return;c=new oe(l,1)}this._revealPosition(c)})),this._register(Xo(s,xe.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(pe(s,xe.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:c,textElement:l}=a;if(!c.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=c,e.clear();else if(l.style.textDecoration==="underline")return;const d=new ai;e.add(Ee(()=>d.dispose(!0)));let h;vhe(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=l;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Ee(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==Mt.OVERLAY_WIDGET||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(iit,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new yu(e,t);this._contextMenuService.showContextMenu({menuId:Te.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;vZe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(x.stickyScroll);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===Qr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(x.stickyScroll)||e.hasChanged(x.minimap)||e.hasChanged(x.lineHeight)||e.hasChanged(x.showFoldingControls)||e.hasChanged(x.lineNumbers))&&this._readConfiguration(),e.hasChanged(x.lineNumbers)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(x.lineHeight);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const i=this._stickyLineCandidateProvider.getVersionId();if(i===void 0||i===t.getVersionId())if(this._foldingModel=await Ox.get(this._editor)?.getFoldingModel()??null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let s=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new i8(a[0].startLineNumber,a[a.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(c);for(const d of l){const h=d.startLineNumber,u=d.endLineNumber,f=d.nestingDepth;if(u-h>0){const p=(f-1)*e,m=f*e,v=this._editor.getBottomForLineNumber(h)-i,w=this._editor.getTopForLineNumber(u)-i,b=this._editor.getBottomForLineNumber(u)-i;if(p>w&&p<=b){o.push(h),r.push(u+1),s=b-m;break}else m>v&&m<=b&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new bze(o,r,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},UAe=jN,jN.ID="store.contrib.stickyScrollController",jN);Gx=UAe=D([_(1,Vr),_(2,ht),_(3,be),_(4,lo),_(5,B_),_(6,Pe)],Gx);const Db="vs/editor/contrib/stickyScroll/browser/stickyScrollActions";class wVt extends pi{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Be(Db,0,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(Db,1,"&&Toggle Editor Sticky Scroll")},metadata:{description:Be(Db,2,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Xa.View,toggled:{condition:ge.equals("config.editor.stickyScroll.enabled",!0),title:g(Db,3,"Sticky Scroll"),mnemonicTitle:g(Db,4,"&&Sticky Scroll")},menu:[{id:Te.CommandPalette},{id:Te.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Te.StickyScrollContext}]})}async run(e){const t=e.get(Re),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const khe=ye.EditorContrib;class bVt extends wf{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Be(Db,5,"Focus on the editor sticky scroll"),mnemonicTitle:g(Db,6,"&&Focus Sticky Scroll")},precondition:ge.and(ge.has("config.editor.stickyScroll.enabled"),X.stickyScrollVisible),menu:[{id:Te.CommandPalette}]})}runEditorCommand(e,t){Gx.get(t)?.focus()}}class CVt extends wf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Be(Db,7,"Select the next editor sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.DownArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusNext()}}class yVt extends wf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Be(Db,8,"Select the previous sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.UpArrow}})}runEditorCommand(e,t){Gx.get(t)?.focusPrevious()}}class SVt extends wf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Be(Db,9,"Go to the focused sticky scroll line"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Enter}})}runEditorCommand(e,t){Gx.get(t)?.goToFocused()}}class AVt extends wf{constructor(){super({id:"editor.action.selectEditor",title:Be(Db,10,"Select Editor"),precondition:X.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:khe,primary:E.Escape}})}runEditorCommand(e,t){Gx.get(t)?.selectEditor()}}vn(Gx.ID,Gx,mi.AfterFirstRender);At(wVt);At(bVt);At(yVt);At(CVt);At(SVt);At(AVt);class EVt{constructor(e,t,i,s,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.completion=r}}let VAe=class extends $Re{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(qe.None)}return e}};VAe=D([_(5,ghe)],VAe);let zAe=class extends ${constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){if(i.selectedSuggestionInfo)return;let o;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){o=f;break}if(!o)return;const r=o.getOption(x.quickSuggestions);if(d2.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),c=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(d2.valueFor(r,c)!=="inline")return;let l=e.getWordAtPosition(t),d;if(l?.word||(d=this._getTriggerCharacterInfo(e,t)),!l?.word&&!d||(l||(l=e.getWordUntilPosition(t)),l.endColumn!==t.column))return;let h;const u=e.getValueInRange(new O(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new y4e(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await jPe(this._languageFeatureService.completionProvider,e,t,new Q7(void 0,Mte.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:tf.TriggerCharacter,triggerCharacter:d.ch},s);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new Sk(f.items,t.column,new y4e(u,0),Rte.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new VAe(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(qe.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(O.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&s.add(o);if(s.size!==0)return{providers:s,ch:i}}};zAe=D([_(0,ht),_(1,Mu),_(2,ghe),_(3,jt)],zAe);KQ(zAe);const xVt="vs/editor/contrib/tokenization/browser/tokenization";class DVt extends lt{constructor(){super({id:"editor.action.forceRetokenize",label:g(xVt,0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new ao;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}Fe(DVt);var kVt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";Ct(kVt,{});var IVt=".editor-banner{background:var(--vscode-banner-background);box-sizing:border-box;cursor:default;display:flex;font-size:12px;height:26px;overflow:visible;width:100%}.editor-banner .icon-container{align-items:center;display:flex;flex-shrink:0;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-position:50%;background-repeat:no-repeat;background-size:16px;margin:0 6px 0 10px;padding:0;width:16px}.editor-banner .message-container{align-items:center;display:flex;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-banner .message-container p{margin-block-end:0;margin-block-start:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{margin:2px 8px;padding:0 12px;width:inherit}.editor-banner .message-actions-container a{margin-left:12px;padding:3px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}";Ct(IVt,{});const LVt=26;let $Ae=class extends ${constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(GAe))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,LVt)}};$Ae=D([_(1,be)],$Ae);let GAe=class extends ${constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(vw,{}),this.element=we("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=we("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Yo(this.element)}show(e){Yo(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=he(this.element,we("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(we(`div${$e.asCSSSelector(e.icon)}`));const s=he(this.element,we("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=he(this.element,we("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(t6,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=he(this.element,we("div.action-container"));this.actionBar=this._register(new Qh(o)),this.actionBar.push(this._register(new xn("banner.close","Close Banner",$e.asClassName(VXe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};GAe=D([_(0,be)],GAe);const cl="vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter",TVt=Ki("extensions-warning-message",Ce.warning,g(cl,0,"Icon shown with a warning message in the extensions editor."));var WH;let h6=(WH=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:g(cl,1,"This document contains many non-basic ASCII unicode characters"),command:new g6};else if(o.ambiguousCharacterCount>=r)a={message:g(cl,2,"This document contains many ambiguous unicode characters"),command:new MF};else if(o.invisibleCharacterCount>=r)a={message:g(cl,3,"This document contains many invisible unicode characters"),command:new u6};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:TVt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance($Ae,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(x.unicodeHighlighting)&&(this._options=e.getOption(x.unicodeHighlighting),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=RVt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Gd:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new qAe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new MVt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},WH.ID="editor.contrib.unicodeHighlighter",WH);h6=D([_(1,kd),_(2,oA),_(3,be)],h6);function RVt(n,e){return{nonBasicASCII:e.nonBasicASCII===Rp?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Rp?!n:e.includeComments,includeStrings:e.includeStrings===Rp?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let qAe=class extends ${constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!oNe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Cnt(i,this._options),inComment:rNe(t,e),inString:aNe(t,e)}}};qAe=D([_(3,kd)],qAe);class MVt extends ${constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new yn(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=_Me.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:Rie.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return oNe(t,e)?{reason:Cnt(i,this._options),inComment:rNe(t,e),inString:aNe(t,e)}:null}}const bnt=g(cl,4,"Configure Unicode Highlight Options");let QAe=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==ku.Range)return[];const i=this._editor.getModel(),s=this._editor.getContribution(h6.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=s.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=Spe(h);let f;switch(l.reason.kind){case Wv.Ambiguous:{qq(l.reason.confusableWith)?f=g(cl,5,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,Spe(l.reason.confusableWith.codePointAt(0))):f=g(cl,6,"The character {0} could be confused with the character {1}, which is more common in source code.",u,Spe(l.reason.confusableWith.codePointAt(0)));break}case Wv.Invisible:f=g(cl,7,"The character {0} is invisible.",u);break;case Wv.NonBasicAscii:f=g(cl,8,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(cl,9,"Adjust settings"),v=`command:${Mie.ID}?${encodeURIComponent(JSON.stringify(p))}`,w=new Xt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,bnt);o.push(new xb(this,c.range,[w],!1,a++))}return o}renderHoverParts(e,t){return yOt(e,t,this._editor,this._languageService,this._openerService)}};QAe=D([_(1,Di),_(2,fr)],QAe);function jAe(n){return`U+${n.toString(16).padStart(4,"0")}`}function Spe(n){let e=`\`${jAe(n)}\``;return aM.isInvisibleCharacter(n)||(e+=` "${`${NVt(n)}`}"`),e}function NVt(n){return n===Q.BackTick?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function Cnt(n,e){return _Me.computeUnicodeHighlightReason(n,e)}const Ace=class Ace{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=Kt.createDynamic({description:"unicode-highlight",stickiness:gi.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};Ace.instance=new Ace;let Rie=Ace;const ABe=class ABe extends lt{constructor(){super({id:MF.ID,label:g(cl,10,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(cl,11,"Disable Highlight In Comments")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeComments,!1,Ot.USER)}};ABe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let KAe=ABe;const EBe=class EBe extends lt{constructor(){super({id:MF.ID,label:g(cl,12,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(cl,13,"Disable Highlight In Strings")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.includeStrings,!1,Ot.USER)}};EBe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let YAe=EBe;const Ece=class Ece extends lt{constructor(){super({id:Ece.ID,label:g(cl,14,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(cl,15,"Disable Ambiguous Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.ambiguousCharacters,!1,Ot.USER)}};Ece.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let MF=Ece;const xce=class xce extends lt{constructor(){super({id:xce.ID,label:g(cl,16,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(cl,17,"Disable Invisible Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.invisibleCharacters,!1,Ot.USER)}};xce.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let u6=xce;const Dce=class Dce extends lt{constructor(){super({id:Dce.ID,label:g(cl,18,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(cl,19,"Disable Non ASCII Highlight")}async run(e,t,i){const s=e?.get(Re);s&&this.runAction(s)}async runAction(e){await e.updateValue(Ug.nonBasicASCII,!1,Ot.USER)}};Dce.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let g6=Dce;const kce=class kce extends lt{constructor(){super({id:kce.ID,label:g(cl,20,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:s,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(s),l=e.get(On),d=e.get(Re);function h(p){return aM.isInvisibleCharacter(p)?g(cl,21,"Exclude {0} (invisible character) from being highlighted",jAe(p)):g(cl,22,"Exclude {0} from being highlighted",`${jAe(p)} "${c}"`)}const u=[];if(o.kind===Wv.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(cl,23,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{FVt(d,[p])}});if(u.push({label:h(s),run:()=>PVt(d,[s])}),a){const p=new KAe;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new YAe;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===Wv.Ambiguous){const p=new MF;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.Invisible){const p=new u6;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===Wv.NonBasicAscii){const p=new g6;u.push({label:p.label,run:async()=>p.runAction(d)})}else OVt(o);const f=await l.pick(u,{title:bnt});f&&await f.run()}};kce.ID="editor.action.unicodeHighlight.showExcludeOptions";let Mie=kce;async function PVt(n,e){const t=n.getValue(Ug.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(Ug.allowedCharacters,i,Ot.USER)}async function FVt(n,e){const t=n.inspect(Ug.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await n.updateValue(Ug.allowedLocales,i,Ot.USER)}function OVt(n){throw new Error(`Unexpected value: ${n}`)}Fe(MF);Fe(u6);Fe(g6);Fe(Mie);vn(h6.ID,h6,mi.AfterFirstRender);hL.register(QAe);const D5="vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators",ynt="ignoreUnusualLineTerminators";function BVt(n,e,t){n.setModelProperty(e.uri,ynt,t)}function WVt(n,e){return n.getModelProperty(e.uri,ynt)}var HH;let Nie=(HH=class extends ${constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(x.unusualLineTerminators),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||WVt(this._codeEditorService,e)===!0||this._editor.getOption(x.readOnly))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:g(D5,0,"Unusual Line Terminators"),message:g(D5,1,"Detected unusual line terminators"),detail:g(D5,2,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",ui(e.uri)),primaryButton:g(D5,3,"&&Remove Unusual Line Terminators"),cancelButton:g(D5,4,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){BVt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},HH.ID="editor.contrib.unusualLineTerminatorsDetector",HH);Nie=D([_(1,To),_(2,jt)],Nie);vn(Nie.ID,Nie,mi.AfterFirstRender);var nl,JAe;const NFe="vs/editor/contrib/wordHighlighter/browser/wordHighlighter",Ihe=new Y("hasWordHighlights",!1);function Snt(n,e,t,i){const s=n.ordered(e);return Qle(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,er)),mo).then(o=>{if(o){const r=new wi;return r.set(e.uri,o),r}return new wi})}function HVt(n,e,t,i,s,o){const r=n.ordered(e);return Qle(r.map(a=>()=>{const c=o.filter(l=>gS(l)).filter(l=>fde(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,s)).then(void 0,er)}),a=>a instanceof wi&&a.size>0)}class PFe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=na(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new O(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=r&&(c=!0)}return c}cancel(){this.result.cancel()}}class UVt extends PFe{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return Snt(this._providers,e,t.getPosition(),s).then(o=>o||new wi)}}class VVt extends PFe{constructor(e,t,i,s,o){super(e,t,i),this._providers=s,this._otherModels=o}_compute(e,t,i,s){return HVt(this._providers,e,t.getPosition(),i,s,this._otherModels).then(o=>o||new wi)}}class Ant extends PFe{constructor(e,t,i,s,o){super(e,t,s),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,s){return Ta(250,s).then(()=>{const o=new wi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new wi;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(r.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:D9.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function zVt(n,e,t,i,s){return n.has(e)?new UVt(e,t,s,n):new Ant(e,t,i,s,[])}function $Vt(n,e,t,i,s,o){return n.has(e)?new VVt(e,t,s,n,o):new Ant(e,t,i,s,o)}nA("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(ht);return(await Snt(i.documentHighlightProvider,e,t,qe.None))?.get(e.uri)});var D0;let XAe=(D0=class{constructor(e,t,i,s,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=Ihe.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():nl.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(x.occurrencesHighlight);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,nl.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}stop(){this.occurrencesHighlight!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(O.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);sa(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=nl.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),nl.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const i of e){if(!i.hasModel())continue;const s=nl.storedDecorations.get(i.getModel().uri);if(!s)continue;i.removeDecorations(s),t.push(i.getModel().uri);const o=bm.get(i);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)nl.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell&&nl.query?.modelInfo?.model.uri.scheme!==_e.vscodeNotebookCell?(nl.query=null,this._run()):nl.query?.modelInfo&&(nl.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==Wi.Explicit&&this.editor.getModel()?.uri.scheme!==_e.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===_e.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===_e.vscodeNotebookCell&&o.push(c)}return o}const i=[],s=this.codeEditorService.listCodeEditors();for(const o of s){if(!ew(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const o of s){const r=o.getModel();r&&r!==e&&i.push(r)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){nl.query=null,this._stopAll();return}const s=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>s||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,i,s){return s.length?$Vt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),s):zVt(this.providers,e,t,i,this.editor.getOption(x.wordSeparators))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=bm.get(t);if(!i)continue;const s=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=nl.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&s.push({range:l.range,options:gUt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],s)}),nl.storedDecorations=nl.storedDecorations.set(o,c),s.length>0&&(i.wordHighlighter?.decorations.set(s),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},nl=D0,D0.storedDecorations=new wi,D0.query=null,D0);XAe=nl=D([_(4,jt)],XAe);var KN;let bm=(KN=class extends ${static get(e){return e.getContribution(JAe.ID)}constructor(e,t,i,s){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new XAe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}stopHighlighting(){this._wordHighlighter?.stop()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},JAe=KN,KN.ID="editor.contrib.wordHighlighter",KN);bm=JAe=D([_(1,Pe),_(2,ht),_(3,jt)],bm);class Ent extends lt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=bm.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class GVt extends Ent{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(NFe,0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:E.F7,weight:ye.EditorContrib}})}}class qVt extends Ent{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(NFe,1,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Ihe,kbOpts:{kbExpr:X.editorTextFocus,primary:V.Shift|E.F7,weight:ye.EditorContrib}})}}class QVt extends lt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(NFe,2,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Ihe.toNegated(),kbOpts:{kbExpr:X.editorTextFocus,primary:0,weight:ye.EditorContrib}})}run(e,t,i){const s=bm.get(t);s&&s.restoreViewState(!0)}}vn(bm.ID,bm,mi.Eager);Fe(GVt);Fe(qVt);Fe(QVt);const jVt="vs/editor/contrib/wordOperations/browser/wordOperations";class Lhe extends Jc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=new oe(c.positionLineNumber,c.positionColumn),d=this._move(s,o,l,this._wordNavigationType);return this._moveTo(c,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Wi.Explicit,a.map(c=>zn.fromModelSelection(c))),a.length===1){const c=new oe(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(c,vt.Smooth)}}_moveTo(e,t,i){return i?new mt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new mt(t.lineNumber,t.column,t.lineNumber,t.column)}}class gL extends Lhe{_move(e,t,i,s){return Es.moveWordLeft(e,t,i,s)}}class fL extends Lhe{_move(e,t,i,s){return Es.moveWordRight(e,t,i,s)}}class KVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class YVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class JVt extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.LeftArrow,mac:{primary:V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}class XVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class ZVt extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class e4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.LeftArrow,mac:{primary:V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}class t4t extends gL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class i4t extends gL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class n4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class s4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|E.RightArrow,mac:{primary:V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class o4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordRight",precondition:void 0})}}class r4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class a4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ge.and(X.textInputFocus,ge.and(Xq,Ide)?.negate()),primary:V.CtrlCmd|V.Shift|E.RightArrow,mac:{primary:V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}class c4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class l4t extends fL{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class d4t extends fL{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(R_(_u.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s)}}class The extends Jc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(lo);if(!t.hasModel())return;const o=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new zd(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class FFe extends The{_delete(e,t){const i=Es.deleteWordLeft(e,t);return i||new O(1,1,1,1)}}class OFe extends The{_delete(e,t){const i=Es.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class h4t extends FFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartLeft",precondition:X.writable})}}class u4t extends FFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndLeft",precondition:X.writable})}}class g4t extends FFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Backspace,mac:{primary:V.Alt|E.Backspace},weight:ye.EditorContrib}})}}class f4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordStart,id:"deleteWordStartRight",precondition:X.writable})}}class p4t extends OFe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:Ds.WordEnd,id:"deleteWordEndRight",precondition:X.writable})}}class m4t extends OFe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:V.CtrlCmd|E.Delete,mac:{primary:V.Alt|E.Delete},weight:ye.EditorContrib}})}}class _4t extends lt{constructor(){super({id:"deleteInsideWord",precondition:X.writable,label:g(jVt,0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=R_(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=Es.deleteInsideWord(s,o,c);return new zd(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ke(new KVt);Ke(new YVt);Ke(new JVt);Ke(new XVt);Ke(new ZVt);Ke(new e4t);Ke(new n4t);Ke(new s4t);Ke(new o4t);Ke(new r4t);Ke(new a4t);Ke(new c4t);Ke(new t4t);Ke(new i4t);Ke(new l4t);Ke(new d4t);Ke(new h4t);Ke(new u4t);Ke(new g4t);Ke(new f4t);Ke(new p4t);Ke(new m4t);Fe(_4t);class v4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordStart,id:"deleteWordPartLeft",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Backspace},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartLeft(e);return i||new O(1,1,1,1)}}class w4t extends The{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:Ds.WordEnd,id:"deleteWordPartRight",precondition:X.writable,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.Delete},weight:ye.EditorContrib}})}_delete(e,t){const i=ade.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new O(s,o,s,o)}}class xnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartLeft(e,t,i)}}class b4t extends xnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class C4t extends xnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.LeftArrow},weight:ye.EditorContrib}})}}yt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Dnt extends Lhe{_move(e,t,i,s){return ade.moveWordPartRight(e,t,i)}}class y4t extends Dnt{constructor(){super({inSelectionMode:!1,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|E.RightArrow},weight:ye.EditorContrib}})}}class S4t extends Dnt{constructor(){super({inSelectionMode:!0,wordNavigationType:Ds.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:X.textInputFocus,primary:0,mac:{primary:V.WinCtrl|V.Alt|V.Shift|E.RightArrow},weight:ye.EditorContrib}})}}Ke(new v4t);Ke(new w4t);Ke(new b4t);Ke(new C4t);Ke(new y4t);Ke(new S4t);const Aze="vs/editor/contrib/readOnlyMessage/browser/contribution",xBe=class xBe extends ${constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Du.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Xt(g(Aze,0,"Cannot edit in read-only input")):t=new Xt(g(Aze,1,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};xBe.ID="editor.contrib.readOnlyMessageController";let Pie=xBe;vn(Pie.ID,Pie,mi.BeforeFirstInteraction);let ZAe=class extends ${constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=xi(this,void 0);const s=Bh("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Bh("_textModel.onDidChangeContent",T.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Em(async(r,a)=>{s.read(r),o.read(r);const c=a.add(new l1t),l=await this._outlineModelService.getOrCreate(this._textModel,c.token);a.isDisposed||this._currentModel.set(l,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(Kqe(El(o=>o.range.endLineNumber-o.range.startLineNumber,cg))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};ZAe=D([_(1,ht),_(2,JQ)],ZAe);Yee.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(ZAe,n));var A4t='.monaco-editor .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiM0MjQyNDIiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px;height:36px;margin:0;min-height:0;min-width:0;overflow:hidden;padding:0;position:absolute;resize:none;width:58px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4LjAzNiA0LjAxSDQuMDA4VjMyLjAzaDQ0LjAyOFY0LjAxWk00LjAwOC4wMDhBNC4wMDMgNC4wMDMgMCAwIDAgLjAwNSA0LjAxVjMyLjAzYTQuMDAzIDQuMDAzIDAgMCAwIDQuMDAzIDQuMDAyaDQ0LjAyOGE0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMy00LjAwMlY0LjAxQTQuMDAzIDQuMDAzIDAgMCAwIDQ4LjAzNi4wMDhINC4wMDhaTTguMDEgOC4wMTNoNC4wMDN2NC4wMDNIOC4wMVY4LjAxM1ptMTIuMDA4IDBoLTQuMDAydjQuMDAzaDQuMDAyVjguMDEzWm00LjAwMyAwaDQuMDAydjQuMDAzaC00LjAwMlY4LjAxM1ptMTIuMDA4IDBoLTQuMDAzdjQuMDAzaDQuMDAzVjguMDEzWm00LjAwMiAwaDQuMDAzdjQuMDAzSDQwLjAzVjguMDEzWm0tMjQuMDE1IDguMDA1SDguMDF2NC4wMDNoOC4wMDZ2LTQuMDAzWm00LjAwMiAwaDQuMDAzdjQuMDAzaC00LjAwM3YtNC4wMDNabTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM3YtNC4wMDNabTEyLjAwOCAwdjQuMDAzaC04LjAwNXYtNC4wMDNoOC4wMDVabS0zMi4wMjEgOC4wMDVIOC4wMXY0LjAwM2g0LjAwM3YtNC4wMDNabTQuMDAzIDBoMjAuMDEzdjQuMDAzSDE2LjAxNnYtNC4wMDNabTI4LjAxOCAwSDQwLjAzdjQuMDAzaDQuMDAzdi00LjAwM1oiIGZpbGw9IiNDNUM1QzUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDUzdjM2SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+") 50% no-repeat;border:4px solid #252526}';Ct(A4t,{});const DBe=class DBe extends ${constructor(e){super(),this.editor=e,this.widget=null,I_&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new eEe(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};DBe.ID="editor.contrib.iPadShowKeyboard";let Fie=DBe;const Ice=class Ice extends ${constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(pe(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(pe(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Ice.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Yf.BOTTOM_RIGHT_CORNER}}};Ice.ID="editor.contrib.ShowKeyboardWidget";let eEe=Ice;vn(Fie.ID,Fie,mi.Eventually);function tEe(n){return!!n.workspaceUri}function GJ(n){return!!n.folderUri}function E4t(n){return!!n.fileUri}function x4t(n){const e=D4t(n),t=n.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||ei&&rf?"classic":t}var Eze;(function(n){n.TITLE_BAR_STYLE="window.titleBarStyle",n.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(Eze||(Eze={}));var ry;(function(n){n.NATIVE="native",n.CUSTOM="custom"})(ry||(ry={}));var xze;(function(n){n.AUTO="auto",n.WINDOWED="windowed",n.NEVER="never"})(xze||(xze={}));function D4t(n,e){return e||(e=knt(n)),e===ry.NATIVE}function knt(n){if(Jn)return ry.CUSTOM;const e=n.getValue("window");if(e){if(ei&&e.nativeTabs===!0||ei&&e.nativeFullScreen===!1)return ry.NATIVE;const s=e.titleBarStyle;if(s===ry.NATIVE||s===ry.CUSTOM)return s}return jr?ry.NATIVE:ry.CUSTOM}function BFe(n){return{id:Int(n),configPath:n}}function k4t(n){return{id:Int(n),uri:n}}function Int(n){return Ed(n.toString()).toString(16)}const Sn="vs/base/common/date",iEe=60,nEe=iEe*60,f6=nEe*24,Dze=f6*7,kze=f6*30,Ize=f6*365;function WFe(n,e,t,i){typeof n!="number"&&(n=n.getTime());const s=Math.round((new Date().getTime()-n)/1e3);if(s<-30)return g(Sn,0,"in {0}",WFe(new Date().getTime()+s*1e3,!1));if(s<30)return g(Sn,1,"now");let o;return s{await Promise.all(Wnt.map(t=>t(e)))}),await n.invokeFunction(async e=>{RJe((t,i)=>n.createInstance(gF,t,i,{})),KJe(e.get(el))}),await n.invokeFunction(async e=>{const t=e.get(mg);await Promise.all(Hnt.map(i=>i(e))),t.phase=2}),await n.invokeFunction(async e=>{await Promise.all(Unt.map(t=>t(e)))}),UFe.open(),Bnt.fire(),n.invokeFunction(async e=>{const t=e.get(mg);it.as(pf.Workbench).start(e),it.as(zS.EditorFactory).start(e),Fnt.fire(e),Ont.fire(e),await Promise.race([e.get(kO).whenRestored,Ta(2e3)]),t.phase=3,new yn(()=>{AW(window,()=>{t.phase=4},2500)},2500).schedule()})}let Vnt=!1;Lt.withServices(()=>(Vnt=!0,$.None));async function znt(){await UFe.wait()}function B4t(){if(Vnt)throw new Error("Services are already initialized")}const W4t="vs/workbench/browser/quickaccess",$nt="inQuickOpen",H4t=new Y($nt,!1,g(W4t,0,"Whether keyboard focus is inside the quick open control")),aA=ge.has($nt),U4t="inFilesPicker",Gnt=ge.and(aA,ge.has(U4t));function Rhe(n,e){return t=>{const i=t.get(ti),s=t.get(On),r={keybindings:i.lookupKeybindings(n)};s.navigate(!!e,r)}}let Lze=class extends ${constructor(e,t){super(),this.editorService=e,this.editorGroupsService=t,this._editorViewState=void 0,this.openedTransientEditors=new Set}set(){if(this._editorViewState)return;const e=this.editorService.activeEditorPane;e&&(this._editorViewState={group:e.group,editor:e.input,state:gmt(e.getControl())?.saveViewState()??void 0})}async openTransientEditor(e,t){e.options={...e.options,transient:!0};const i=await this.editorService.openEditor(e,t);return i?.input&&i.input!==this._editorViewState?.editor&&i.group.isTransient(i.input)&&this.openedTransientEditors.add(i.input),i}async restore(){if(this._editorViewState){for(const e of this.openedTransientEditors)if(!e.isDirty())for(const t of this.editorGroupsService.groups)t.isTransient(e)&&await t.closeEditor(e,{preserveFocus:!0});await this._editorViewState.group.openEditor(this._editorViewState.editor,{viewState:this._editorViewState.state,preserveFocus:!0}),this.reset()}}reset(){this._editorViewState=void 0,this.openedTransientEditors.clear()}dispose(){super.dispose(),this.reset()}};Lze=D([_(0,_i),_(1,ur)],Lze);let sEe=class extends Vee{constructor(e,t,i,s,o,r){super(t,s,o,r,e),this.keybindingService=i,this.inQuickInputContext=H4t.bindTo(this.contextKeyService),this.registerListeners()}registerListeners(){this._register(this.onShow(()=>this.inQuickInputContext.set(!0))),this._register(this.onHide(()=>this.inQuickInputContext.set(!1)))}createController(){return super.createController(this.layoutService,{ignoreFocusOut:()=>!this.configurationService.getValue("workbench.quickOpen.closeOnFocusLost"),backKeybindingLabel:()=>this.keybindingService.lookupKeybinding("workbench.action.quickInputBack")?.getLabel()||void 0})}};sEe=D([_(0,Re),_(1,be),_(2,ti),_(3,Pe),_(4,pn),_(5,bg)],sEe);function V4t(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class s8{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,s);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return V4t(s8.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const o=s8.termFrequencies(s);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:s,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let c=i.get(o);typeof c!="number"&&(c=this.computeIdf(o),i.set(o,c));const l=a*c;s+=l*r}return s}computeEmbedding(e){const t=s8.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function z4t(n){const e=n.slice(0);e.sort((i,s)=>s.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var BE;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(BE||(BE={}));function Ape(n){const e=n;return Array.isArray(e.items)}function Tze(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class zFe extends ${constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new Dn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ai(t);const d=o.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,l,d,i),f=(m,v)=>{let w,b;if(Ape(m)?(w=m.items,b=m.active):w=m,w.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(SU(this.options.noResultsPick)?w=[this.options.noResultsPick(h)]:w=[this.options.noResultsPick])}return e.items=w,b&&(e.activeItems=[b]),!0},p=async m=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Ta(m.mergeDelay),d.isCancellationRequested)||w||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const b=await m.additionalPicks;if(d.isCancellationRequested)return;let C,y;Ape(m.picks)?(C=m.picks.items,y=m.picks.active):C=m.picks;let S,M;if(Ape(b)?(S=b.items,M=b.active):S=b,S.length>0||!v){let k;if(!y&&!M){const F=e.activeItems[0];F&&C.indexOf(F)!==-1&&(k=F)}f({items:[...C,...S],active:y||M||k})}}finally{d.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(u!==null)if(Tze(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;Tze(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(l=>{if(i?.handleAccept){l.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0]);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))}));const c=async(l,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(l)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),f=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(f){case BE.NO_ACTION:break;case BE.CLOSE_PICKER:e.hide();break;case BE.REFRESH_PICKER:a();break;case BE.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),w=e.activeItems.filter(C=>C!==v[0]),b=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,w&&(e.activeItems=w),e.keepScrollPosition=b}break}}}};return s.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),s.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),s}}var ZL,Aa;const IL="vs/platform/quickinput/browser/commandsQuickAccess";var Oy;let oEe=(Oy=class extends zFe{constructor(e,t,i,s,o,r){super(ZL.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(p6)),this.options=e}async _getPicks(e,t,i,s){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=cw(()=>{const f=new s8;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return z4t(p).filter(m=>m.score>ZL.TFIDF_THRESHOLD).slice(0,ZL.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=ZL.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?ZL.WORD_FILTER(e,f.commandAlias)??void 0:void 0;if(p||m)f.highlights={label:p,detail:this.options.showAlias?m:void 0},a.push(f);else if(e===f.commandId)a.push(f);else if(e.length>=3){const v=r();if(i.isCancellationRequested)return[];const w=v.find(b=>b.key===f.commandId);w&&(f.tfIdfScore=w.score,a.push(f))}}const c=new Map;for(const f of a){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}a.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const m=this.commandsHistory.peek(f.commandId),v=this.commandsHistory.peek(p.commandId);if(m&&v)return m>v?-1:1;if(m)return-1;if(v)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(f.commandId),b=this.options.suggestedCommandIds.has(p.commandId);if(w&&b)return 0;if(w)return-1;if(b)return 1}return f.label.localeCompare(p.label)});const l=[];let d=!1,h=!0,u=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(o,a,e,i);if(i.isCancellationRequested)return[];const p=f.map(m=>this.toCommandPick(m,s));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(IL,1,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?g(IL,4,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){Na(o)||this.dialogService.error(g(IL,5,"Command '{0}' resulted in an error",e.label),Ma(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}},ZL=Oy,Oy.PREFIX=">",Oy.TFIDF_THRESHOLD=.5,Oy.TFIDF_MAX_RESULTS=5,Oy.WORD_FILTER=KU(dF,YD,pde),Oy);oEe=ZL=D([_(1,be),_(2,ti),_(3,ji),_(4,rn),_(5,To)],oEe);var Eb;let p6=(Eb=class extends ${constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===nS.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Aa.getConfiguredCommandHistoryLength(this.configurationService),Aa.cache&&Aa.cache.limit!==this.configuredCommandsHistoryLength&&(Aa.cache.limit=this.configuredCommandsHistoryLength,Aa.hasChanges=!0))}load(){const e=this.storageService.get(Aa.PREF_KEY_CACHE,ke.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=Aa.cache=new L_(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Aa.counter=this.storageService.getNumber(Aa.PREF_KEY_COUNTER,ke.PROFILE,Aa.counter)}push(e){Aa.cache&&(Aa.cache.set(e,Aa.counter++),Aa.hasChanges=!0)}peek(e){return Aa.cache?.peek(e)}saveState(){if(!Aa.cache||!Aa.hasChanges)return;const e={usesLRU:!0,entries:[]};Aa.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Aa.PREF_KEY_CACHE,JSON.stringify(e),ke.PROFILE,ln.USER),this.storageService.store(Aa.PREF_KEY_COUNTER,Aa.counter,ke.PROFILE,ln.USER),Aa.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:Aa.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=Aa.getConfiguredCommandHistoryLength(e);Aa.cache=new L_(i),Aa.counter=1,Aa.hasChanges=!0}},Aa=Eb,Eb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Eb.PREF_KEY_CACHE="commandPalette.mru.cache",Eb.PREF_KEY_COUNTER="commandPalette.mru.counter",Eb.counter=1,Eb.hasChanges=!1,Eb);p6=Aa=D([_(0,on),_(1,Re),_(2,Ze)],p6);class $4t extends oEe{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let s;i.metadata?.description&&(XJe(i.metadata.description)?s=i.metadata.description:s={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:s,label:mde(i.label)||i.id})}return t}}var G4t=".monaco-pane-view .split-view-view:first-of-type>.pane>.pane-header{border-top:none!important}.monaco-pane-view .split-view-view:first-of-type>.pane{border-left:none!important}.monaco-pane-view .pane>.pane-header{position:relative}.monaco-pane-view .pane>.pane-header.not-collapsible .twisty-container{display:none}.monaco-pane-view .pane>.pane-header.not-collapsible .title{margin-left:8px}.monaco-pane-view .pane.expanded>.pane-header>.actions.show-expanded,.monaco-pane-view .pane>.pane-header>.actions.show-always{display:initial}.monaco-pane-view .pane>.pane-header>.icon{display:none;height:16px;width:16px}.monaco-pane-view .pane.pane.horizontal:not(.expanded)>.pane-header>.icon{display:inline;margin-top:4px}.monaco-pane-view .pane>.pane-header h3.title{-webkit-margin-before:0;-webkit-margin-after:0;font-size:11px;min-width:3ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description{display:block;flex-shrink:100000;font-weight:400;margin-left:10px;opacity:.6;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}.monaco-pane-view .pane>.pane-header .description .codicon{font-size:9px;margin-left:2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header .description,.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header h3.title,.monaco-pane-view .pane>.pane-header:not(.expanded) .description{display:none}.monaco-pane-view .pane .monaco-progress-container{left:0;position:absolute;top:-2px;z-index:5}.monaco-pane-view .pane:not(.merged-header) .monaco-progress-container{top:20px}";Ct(G4t,{});var q4t=".monaco-pane-view{height:100%;width:100%}.monaco-pane-view .pane{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.monaco-pane-view .pane.horizontal:not(.expanded){flex-direction:row}.monaco-pane-view .pane>.pane-header{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:11px;font-weight:700;height:22px;overflow:hidden}.monaco-pane-view .pane>.pane-header.not-collapsible{cursor:default}.monaco-pane-view .pane>.pane-header>.title{text-transform:uppercase}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header{flex-direction:column;height:100%;width:22px}.monaco-pane-view .pane>.pane-header>.codicon:first-of-type{margin:0 2px}.monaco-pane-view .pane.horizontal:not(.expanded)>.pane-header>.codicon:first-of-type{margin:2px}.monaco-pane-view .pane>.pane-header>.actions{display:none;margin-left:auto}.monaco-pane-view .pane>.pane-header>.actions .action-item{margin-right:4px}.monaco-pane-view .pane>.pane-header>.actions .action-label{padding:2px}.monaco-pane-view .pane:focus-within>.pane-header.expanded>.actions,.monaco-pane-view .pane:hover>.pane-header.expanded>.actions,.monaco-pane-view .pane>.pane-header.actions-always-visible.expanded>.actions,.monaco-pane-view .pane>.pane-header.focused.expanded>.actions{display:initial}.monaco-pane-view .pane>.pane-header .monaco-action-bar .action-item.select-container{cursor:default}.monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{cursor:pointer;min-height:18px;min-width:110px;padding:2px 23px 2px 8px}.linux .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box,.windows .monaco-pane-view .pane>.pane-header .action-item .monaco-select-box{padding:0 23px 0 8px}.monaco-pane-view:lang(ja) .pane>.pane-header,.monaco-pane-view:lang(ko) .pane>.pane-header,.monaco-pane-view:lang(zh-Hans) .pane>.pane-header,.monaco-pane-view:lang(zh-Hant) .pane>.pane-header{font-weight:400}.monaco-pane-view .pane>.pane-header.hidden{display:none}.monaco-pane-view .pane>.pane-body{flex:1;overflow:hidden}.monaco-pane-view.animated .split-view-view{transition-duration:.15s;transition-timing-function:ease-out}.reduce-motion .monaco-pane-view .split-view-view{transition-duration:0s!important}.monaco-pane-view.animated.vertical .split-view-view{transition-property:height}.monaco-pane-view.animated.horizontal .split-view-view{transition-property:width}#monaco-pane-drop-overlay{box-sizing:border-box;height:100%;left:0;position:absolute;width:100%;z-index:10000}#monaco-pane-drop-overlay>.pane-overlay-indicator{height:100%;min-height:22px;min-width:19px;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:100%}#monaco-pane-drop-overlay>.pane-overlay-indicator.overlay-move-transition{transition:top 70ms ease-out,left 70ms ease-out,width 70ms ease-out,height 70ms ease-out,opacity .15s ease-out}";Ct(q4t,{});const Q4t="vs/base/browser/ui/splitview/paneview",o9=class o9 extends ${get ariaHeaderLabel(){return this._ariaHeaderLabel}set ariaHeaderLabel(e){this._ariaHeaderLabel=e,this.header.setAttribute("aria-label",this.ariaHeaderLabel)}get draggableElement(){return this.header}get dropTargetElement(){return this.element}get dropBackground(){return this.styles.dropBackground}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize=e,this._onDidChange.fire(void 0)}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize=e,this._onDidChange.fire(void 0)}get headerSize(){return this.headerVisible?o9.HEADER_SIZE:0}get minimumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.minimumBodySize:0;return e+i}get maximumSize(){const e=this.headerSize,i=!this.headerVisible||this.isExpanded()?this.maximumBodySize:0;return e+i}constructor(e){super(),this.expandedSize=void 0,this._headerVisible=!0,this._collapsible=!0,this._bodyRendered=!1,this.styles={dropBackground:void 0,headerBackground:void 0,headerBorder:void 0,headerForeground:void 0,leftBorder:void 0},this.animationTimer=void 0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onDidChangeExpansionState=this._register(new I),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this.orthogonalSize=0,this._expanded=typeof e.expanded>"u"?!0:!!e.expanded,this._orientation=typeof e.orientation>"u"?vi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(Q4t,0,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===vi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=we(".pane")}isExpanded(){return this._expanded}setExpanded(e){return!e&&!this.collapsible||this._expanded===!!e?!1:(this.element?.classList.toggle("expanded",e),this._expanded=!!e,this.updateHeader(),e?(this._bodyRendered||(this.renderBody(this.body),this._bodyRendered=!0),typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),he(this.element,this.body)):this.animationTimer=gt(this.element).setTimeout(()=>{this.body.remove()},200),this._onDidChangeExpansionState.fire(e),this._onDidChange.fire(e?this.expandedSize:void 0),!0)}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible!==!!e&&(this._headerVisible=!!e,this.updateHeader(),this._onDidChange.fire(void 0))}get collapsible(){return this._collapsible}set collapsible(e){this._collapsible!==!!e&&(this._collapsible=!!e,this.updateHeader())}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.element&&(this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===vi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===vi.VERTICAL),this.header=we(".pane-header"),he(this.element,this.header),this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button"),this.header.setAttribute("aria-label",this.ariaHeaderLabel),this.renderHeader(this.header);const e=Dd(this.header);this._register(e),this._register(e.onDidFocus(()=>this.header.classList.add("focused"),null)),this._register(e.onDidBlur(()=>this.header.classList.remove("focused"),null)),this.updateHeader();const t=this._register(new Z),i=this._register(new oi(this.header,"keydown")),s=T.map(i.event,o=>new os(o),t);this._register(T.filter(s,o=>o.keyCode===E.Enter||o.keyCode===E.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(T.filter(s,o=>o.keyCode===E.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(T.filter(s,o=>o.keyCode===E.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(dh.addTarget(this.header)),[xe.CLICK,Eo.Tap].forEach(o=>{this._register(pe(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=he(this.element,we(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?o9.HEADER_SIZE:0,i=this._orientation===vi.VERTICAL?this.orthogonalSize:e,s=this._orientation===vi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(s,i),this.expandedSize=e)}style(e){this.styles=e,this.header&&this.updateHeader()}updateHeader(){const e=!this.headerVisible||this.isExpanded();this.collapsible?(this.header.setAttribute("tabindex","0"),this.header.setAttribute("role","button")):(this.header.removeAttribute("tabindex"),this.header.removeAttribute("role")),this.header.style.lineHeight=`${this.headerSize}px`,this.header.classList.toggle("hidden",!this.headerVisible),this.header.classList.toggle("expanded",e),this.header.classList.toggle("not-collapsible",!this.collapsible),this.header.setAttribute("aria-expanded",String(e)),this.header.style.color=this.collapsible?this.styles.headerForeground??"":"",this.header.style.backgroundColor=(this.collapsible?this.styles.headerBackground:"transparent")??"",this.header.style.borderTop=this.styles.headerBorder&&this.orientation===vi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===vi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};o9.HEADER_SIZE=22;let rEe=o9;const Lce=class Lce extends ${constructor(e,t,i){super(),this.pane=e,this.dnd=t,this.context=i,this.dragOverCounter=0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,e.draggableElement.draggable=!0,this._register(pe(e.draggableElement,"dragstart",s=>this.onDragStart(s))),this._register(pe(e.dropTargetElement,"dragenter",s=>this.onDragEnter(s))),this._register(pe(e.dropTargetElement,"dragleave",s=>this.onDragLeave(s))),this._register(pe(e.dropTargetElement,"dragend",s=>this.onDragEnd(s))),this._register(pe(e.dropTargetElement,"drop",s=>this.onDrop(s)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",pp&&e.dataTransfer?.setData(gm.TEXT,this.pane.draggableElement.textContent||"");const t=he(this.pane.element.ownerDocument.body,we(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>this.pane.element.ownerDocument.body.removeChild(t),0),this.context.draggable=this}onDragEnter(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter++,this.render())}onDragLeave(e){!this.context.draggable||this.context.draggable===this||this.dnd.canDrop(this.context.draggable.pane,this.pane)&&(this.dragOverCounter--,this.dragOverCounter===0&&this.render())}onDragEnd(e){this.context.draggable&&(this.dragOverCounter=0,this.render(),this.context.draggable=null)}onDrop(e){this.context.draggable&&(un.stop(e),this.dragOverCounter=0,this.render(),this.dnd.canDrop(this.context.draggable.pane,this.pane)&&this.context.draggable!==this&&this._onDidDrop.fire({from:this.context.draggable.pane,to:this.pane}),this.context.draggable=null)}render(){let e=null;this.dragOverCounter>0&&(e=this.pane.dropBackground??Lce.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Lce.DefaultDragOverBackgroundColor=new fe(new gn(128,128,128,.5));let aEe=Lce;class j4t extends ${constructor(e,t={}){super(),this.dndContext={draggable:null},this.paneItems=[],this.orthogonalSize=0,this.size=0,this.animationTimer=void 0,this._onDidDrop=this._register(new I),this.onDidDrop=this._onDidDrop.event,this.dnd=t.dnd,this.orientation=t.orientation??vi.VERTICAL,this.element=he(e,we(".monaco-pane-view")),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.onDidSashReset=this.splitview.onDidSashReset,this.onDidSashChange=this.splitview.onDidSashChange,this.onDidScroll=this.splitview.onDidScroll;const i=this._register(new Z),s=this._register(new oi(this.element,"keydown")),o=T.map(T.filter(s.event,r=>Ra(r.target)&&r.target.classList.contains("pane-header"),i),r=>new os(r),i);this._register(T.filter(o,r=>r.keyCode===E.UpArrow,i)(()=>this.focusPrevious())),this._register(T.filter(o,r=>r.keyCode===E.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const s=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,s);const o={pane:e,disposable:s};if(this.paneItems.splice(i,0,o),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const r=new aEe(e,this.dnd,this.dndContext);s.add(r),s.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?A1.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),s=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||s===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,o),this.splitview.moveView(i,s)}resizePane(e,t){const i=this.paneItems.findIndex(s=>s.pane===e);i!==-1&&this.splitview.resizeView(i,t)}getPaneSize(e){const t=this.paneItems.findIndex(i=>i.pane===e);return t===-1?-1:this.splitview.getViewSize(t)}layout(e,t){this.orthogonalSize=this.orientation===vi.VERTICAL?t:e,this.size=this.orientation===vi.HORIZONTAL?t:e;for(const i of this.paneItems)i.pane.orthogonalSize=this.orthogonalSize;this.splitview.layout(this.size)}setBoundarySashes(e){this.boundarySashes=e,this.updateSplitviewOrthogonalSashes(e)}updateSplitviewOrthogonalSashes(e){this.orientation===vi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===vi.VERTICAL?vi.HORIZONTAL:vi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Yo(this.element),this.splitview=this._register(new x7(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const s=this.orientation===vi.VERTICAL?t:e,o=this.orientation===vi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=s,r.pane.orientation=this.orientation;const c=this.size===0?0:o*i[a]/this.size;this.splitview.addView(r.pane,c,a)}),this.size=o,this.orthogonalSize=s,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&>(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=gt(this.element).setTimeout(()=>{this.animationTimer=void 0,this.element.classList.remove("animated")},200)}getPaneHeaderElements(){return[...this.element.querySelectorAll(".pane-header")]}focusPrevious(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.max(t-1,0)].focus()}focusNext(){const e=this.getPaneHeaderElements(),t=e.indexOf(this.element.ownerDocument.activeElement);t!==-1&&e[Math.min(t+1,e.length-1)].focus()}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose())}}var Nl;(function(n){let e;(function(s){s[s.None=0]="None",s[s.Done=1]="Done",s[s.Infinite=2]="Infinite",s[s.While=3]="While",s[s.Work=4]="Work"})(e=n.Type||(n.Type={})),n.None={type:e.None},n.Done={type:e.Done},n.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}n.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}n.Work=i})(Nl||(Nl={}));class K4t extends ${constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=Nl.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==Nl.Done.type)if(this.progressState.type===Nl.Type.While){let e;if(this.progressState.whileDelay>0){const t=this.progressState.whileDelay-(Date.now()-this.progressState.whileStart);t>0&&(e=t)}this.doShowWhile(e)}else this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===Nl.Type.Work&&(this.progressState.total&&this.progressBar.total(this.progressState.total).show(),this.progressState.worked&&this.progressBar.worked(this.progressState.worked).show())}onDidScopeDeactivate(){this.progressBar.stop().hide()}show(e,t){return typeof e=="boolean"?this.progressState=Nl.Infinite:this.progressState=new Nl.Work(e,void 0),this.scope.isActive&&(this.progressState.type===Nl.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===Nl.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new Nl.Work(i,this.progressState.type===Nl.Type.Work?this.progressState.worked:void 0),this.scope.isActive&&this.progressBar.total(i)},worked:i=>{!this.scope.isActive||this.progressBar.hasTotal()?(this.progressState=new Nl.Work(this.progressState.type===Nl.Type.Work?this.progressState.total:void 0,this.progressState.type===Nl.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=Nl.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=Nl.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===Nl.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new Nl.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==Nl.Type.While||this.progressState.whilePromise===e)&&(this.progressState=Nl.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class Y4t extends ${get isActive(){return this._isActive}constructor(e,t){super(),this.scopeId=e,this._isActive=t,this._onDidChangeActive=this._register(new I),this.onDidChangeActive=this._onDidChangeActive.event}onScopeOpened(e){e===this.scopeId&&(this._isActive||(this._isActive=!0,this._onDidChangeActive.fire()))}onScopeClosed(e){e===this.scopeId&&this._isActive&&(this._isActive=!1,this._onDidChangeActive.fire())}}class J4t extends ${get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,s){super(),this.options=t,this.menuService=i,this.contextKeyService=s,this._primaryActions=[],this._secondaryActions=[],this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.disposables=this._register(new Z),this.menu=this._register(i.createMenu(e,s)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],tD(this.menu,this.options,{primary:this._primaryActions,secondary:this._secondaryActions}),this.disposables.add(this.updateSubmenus([...this._primaryActions,...this._secondaryActions],{})),this._onDidChange.fire()}updateSubmenus(e,t){const i=new Z;for(const s of e)if(s instanceof uS&&!t[s.item.submenu.id]){const o=t[s.item.submenu.id]=i.add(this.menuService.createMenu(s.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(s.actions,t))}return i}}let Oie=class extends ${constructor(e,t,i,s,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=s,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new J4t(e,this.options,o,s)),this._register(this.menuActions.onDidChange(()=>this._onDidChange.fire()))}getPrimaryActions(){return this.menuActions.primaryActions}getSecondaryActions(){return this.menuActions.secondaryActions}getContextMenuActions(){const e=[];if(this.contextMenuId){const t=this.menuService.createMenu(this.contextMenuId,this.contextKeyService);tD(t,this.options,{primary:[],secondary:e}),t.dispose()}return e}};Oie=D([_(3,Pe),_(4,_c)],Oie);const X4t="vs/workbench/browser/parts/views/viewFilter",qnt=new Te("menu.view.filter"),Mhe=new Te("submenu.view.filter");Xs.appendMenuItem(qnt,{submenu:Mhe,title:g(X4t,0,"More Filters..."),group:"navigation",icon:Ce.filter});class Z4t extends b7{constructor(){super(...arguments),this._checked=!1}set checked(e){this._checked!==e&&(this._checked=e,this.updateChecked())}updateChecked(){this.element&&this.element.classList.toggle("checked",this._checked)}render(e){super.render(e),this.updateChecked()}}let cEe=class extends wg{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,s,o){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=o,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Lu(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Y(e.focusContextKey,!1).bindTo(s)),this.element=we(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=he(this.element,we(".viewpane-filter-controls"));this.filterBadge=this.createBadge(r),this.toolbar=this._register(this.createToolBar(r)),this.adjustInputBox()}hasFocus(){return this.filterInputBox.hasFocus()}focus(){this.filterInputBox.focus()}blur(){this.filterInputBox.blur()}updateBadge(e){this.filterBadge.classList.toggle("hidden",!e),this.filterBadge.textContent=e||"",this.adjustInputBox()}setFilterText(e){this.filterInputBox.value=e}getFilterText(){return this.filterInputBox.value}getHistory(){return this.filterInputBox.getHistory()}layout(e){this.element.parentElement?.classList.toggle("grow",e>700),this.element.classList.toggle("small",e<400),this.adjustInputBox(),this.lastWidth=e}relayout(){this.lastWidth&&this.layout(this.lastWidth)}checkMoreFilters(e){this.isMoreFiltersChecked=e,this.moreFiltersActionViewItem&&(this.moreFiltersActionViewItem.checked=e)}createInput(e){const t=this._register(this.instantiationService.createInstance(vye,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>qSe(this.keybindingService),inputBoxStyles:eV}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(s=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Xo(t.inputElement,xe.KEY_DOWN,s=>this.onInputKeyDown(s,t))),this._register(Xo(e,xe.KEY_DOWN,this.handleKeyboardEvent)),this._register(Xo(e,xe.KEY_UP,this.handleKeyboardEvent)),this._register(Xo(t.inputElement,xe.CLICK,s=>{s.stopPropagation(),s.preventDefault()}));const i=this._register(Dd(t.inputElement));return this.focusContextKey&&(this._register(i.onDidFocus(()=>this.focusContextKey.set(!0))),this._register(i.onDidBlur(()=>this.focusContextKey.set(!1))),this._register(Ee(()=>this.focusContextKey.reset()))),[t,i]}createBadge(e){const t=he(e,we(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=Ye(kW),t.style.color=Ye(DMe),t.style.border=`1px solid ${Ye(ft)}`,t}createToolBar(e){return this.instantiationService.createInstance(nC,e,qnt,{hiddenItemStrategy:wS.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof uS&&t.item.submenu.id===Mhe.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(Z4t,t,i),this.moreFiltersActionViewItem.checked=this.isMoreFiltersChecked,this.moreFiltersActionViewItem}})}onDidInputChange(e){e.addToHistory(),this._onDidChangeFilterText.fire(e.value)}adjustInputBox(){this.filterInputBox.inputElement.style.paddingRight=this.element.classList.contains("small")||this.filterBadge.classList.contains("hidden")?"25px":"150px"}handleKeyboardEvent(e){(e.equals(E.Space)||e.equals(E.LeftArrow)||e.equals(E.RightArrow))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(E.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};cEe=D([_(1,be),_(2,W_),_(3,Pe),_(4,ti)],cEe);var lEe;const Bie="vs/workbench/browser/parts/views/viewPane";var o8;(function(n){n[n.Default=0]="Default",n[n.WhenExpanded=1]="WhenExpanded",n[n.Always=2]="Always"})(o8||(o8={}));const Rze=new xn("viewpane.action.filter"),ezt=Ki("view-pane-container-expanded",Ce.chevronDown,g(Bie,0,"Icon for an expanded view pane container.")),tzt=Ki("view-pane-container-collapsed",Ce.chevronRight,g(Bie,1,"Icon for a collapsed view pane container.")),Mze=it.as(M1.ViewsRegistry);let dEe=class{get enabled(){return this._enabled}constructor(e,t,i,s,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=s,this.telemetryService=o,this.contextKeyService=r,this.items=[],this._enabled=!1,this.disposables=new Z,this.enabledDisposables=this.disposables.add(new Z),this.renderDisposables=this.disposables.add(new Z),this.disposables.add(T.runAndSubscribe(this.delegate.onDidChangeViewWelcomeState,()=>this.onDidChangeViewWelcomeState())),this.disposables.add(a.onWillShutdown(()=>this.dispose()))}layout(e,t){this._enabled&&(this.element.style.height=`${e}px`,this.element.style.width=`${t}px`,this.element.classList.toggle("wide",t>640),this.scrollableElement.scanDomNode())}focus(){this._enabled&&this.element.focus()}onDidChangeViewWelcomeState(){const e=this.delegate.shouldShowWelcome();if(this._enabled===e)return;if(this._enabled=e,!e){this.enabledDisposables.clear();return}this.container.classList.add("welcome");const t=he(this.container,we(".welcome-view"));this.element=we(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new bz(this.element,{alwaysConsumeMouseWheel:!0,horizontal:zo.Hidden,vertical:zo.Visible}),he(t,this.scrollableElement.getDomNode()),this.enabledDisposables.add(Ee(()=>{this.container.classList.remove("welcome"),this.scrollableElement.dispose(),t.remove(),this.scrollableElement=void 0,this.element=void 0})),this.contextKeyService.onDidChangeContext(this.onDidChangeContext,this,this.enabledDisposables),T.chain(Mze.onDidChangeViewWelcomeContent,i=>i.filter(s=>s===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=Mze.getViewWelcomeContent(this.delegate.id);this.items=[];for(const t of e)if(t.when==="default")this.defaultItem={descriptor:t,visible:!0};else{const i=t.when?this.contextKeyService.contextMatchesRules(t.when):!0;this.items.push({descriptor:t,visible:i})}this.render()}onDidChangeContext(){let e=!1;for(const t of this.items){if(!t.descriptor.when||t.descriptor.when==="default")continue;const i=this.contextKeyService.contextMatchesRules(t.descriptor.when);t.visible!==i&&(t.visible=i,e=!0)}e&&this.render()}render(){this.renderDisposables.clear(),this.element.innerText="";const e=this.getContentDescriptors();if(e.length===0){this.container.classList.remove("welcome"),this.scrollableElement.scanDomNode();return}for(const{content:t,precondition:i}of e){const s=t.split(` +`);for(let o of s){if(o=o.trim(),!o)continue;const r=aXe(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=he(this.element,we(".button-container")),l=new Tu(c,{title:a.title,supportIcons:!0,...yQ});if(l.label=a.label,l.onDidClick(d=>{this.telemetryService.publicLog2("views.welcomeAction",{viewId:this.delegate.id,uri:a.href}),this.openerService.open(a.href,{allowCommands:!0})},null,this.renderDisposables),this.renderDisposables.add(l),i){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=he(this.element,we("p"));for(const c of r.nodes)if(typeof c=="string")he(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(t6,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());T.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}}}}this.container.classList.add("welcome"),this.scrollableElement.scanDomNode()}getContentDescriptors(){const e=this.items.filter(t=>t.visible);return e.length===0&&this.defaultItem?[this.defaultItem.descriptor]:e.map(t=>t.descriptor)}dispose(){this.disposables.dispose()}};dEe=D([_(2,be),_(3,fr),_(4,rn),_(5,Pe),_(6,mg)],dEe);var YN;let Wie=(YN=class extends rEe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===Sr.Panel?vi.HORIZONTAL:vi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=s,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewService=u,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidChangeBodyVisibility=this._register(new I),this.onDidChangeBodyVisibility=this._onDidChangeBodyVisibility.event,this._onDidChangeTitleArea=this._register(new I),this.onDidChangeTitleArea=this._onDidChangeTitleArea.event,this._onDidChangeViewWelcomeState=this._register(new I),this.onDidChangeViewWelcomeState=this._onDidChangeViewWelcomeState.event,this._isVisible=!1,this.id=e.id,this._title=e.title,this._titleDescription=e.titleDescription,this._singleViewPaneContainerTitle=e.singleViewPaneContainerTitle,this.showActions=e.showActions??o8.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",aie(r.getViewLocationById(this.id)));this._register(T.filter(r.onDidChangeLocation,p=>p.views.some(m=>m.id===this.id))(()=>f.set(aie(r.getViewLocationById(this.id))))),this.menuActions=this._register(this.instantiationService.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(Oie,e.titleMenuId??Te.ViewTitle,Te.ViewTitleContext,{shouldForwardArgs:!e.donotForwardArgs,renderShortTitle:!0})),this._register(this.menuActions.onDidChange(()=>this.updateActions()))}get headerVisible(){return super.headerVisible}set headerVisible(e){super.headerVisible=e,this.element.classList.toggle("merged-header",!e)}setVisible(e){this._isVisible!==e&&(this._isVisible=e,this.isExpanded()&&this._onDidChangeBodyVisibility.fire(e))}isVisible(){return this._isVisible}isBodyVisible(){return this._isVisible&&this.isExpanded()}setExpanded(e){const t=super.setExpanded(e);return t&&this._onDidChangeBodyVisibility.fire(e),this.updateTwistyIcon(),t}render(){super.render();const e=Dd(this.element);this._register(e),this._register(e.onDidFocus(()=>this._onDidFocus.fire())),this._register(e.onDidBlur(()=>this._onDidBlur.fire()))}renderHeader(e){this.headerContainer=e,this.twistiesContainer=he(e,we(`.twisty-container${$e.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=he(e,we(".actions"));t.classList.toggle("show-always",this.showActions===o8.Always),t.classList.toggle("show-expanded",this.showActions===o8.WhenExpanded),this.toolbar=this.instantiationService.createInstance(lV,t,{orientation:Qb.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(Bie,2,"{0} actions",this.title),getKeyBinding:o=>this.keybindingService.lookupKeybinding(o.id),renderDropdownAsChildElement:!0,actionRunner:this.getActionRunner(),resetMenu:this.menuActions.menuId}),this._register(this.toolbar),this.setActions(),this._register(pe(t,xe.CLICK,o=>o.preventDefault()));const i=this.viewDescriptorService.getViewContainerByViewId(this.id);i?this._register(this.viewDescriptorService.getViewContainerModel(i).onDidChangeContainerInfo(({title:o})=>this.updateTitle(this.title))):console.error(`View container model not found for view ${this.id}`);const s=T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(lEe.AlwaysShowActionsConfig));this._register(s(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...$e.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...$e.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?ezt:tzt}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=hS(e.headerForeground,Ye(Ge));P.isUri(t)?(this.iconContainer.style.backgroundColor=i,this.iconContainer.style.color=""):(this.iconContainer.style.color=i,this.iconContainer.style.backgroundColor="")}}getIcon(){return this.viewDescriptorService.getViewDescriptorById(this.id)?.containerIcon||_Bt}renderHeaderTitle(e,t){this.iconContainer=he(e,we(".icon",void 0));const i=this.getIcon();let s;if(P.isUri(i)){s=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${s}`;Kp(r,` mask: ${uf(i)} no-repeat 50% 50%; mask-size: 24px; -webkit-mask: ${uf(i)} no-repeat 50% 50%; -webkit-mask-size: 16px; - `)}else $e.isThemeIcon(i)&&(s=$e.asClassName(i));s&&this.iconContainer.classList.add(...s.split(" "));const o=this.calculateTitle(t);this.titleContainer=he(e,we("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewService?.hasShownAccessibleView(this.id);return!t||i?e:g(Bie,3,"Use Alt+F1 for accessibility help {0}",e)}updateTitle(e){const t=this.calculateTitle(e);this.titleContainer&&(this.titleContainer.textContent=t,this.titleContainerHover?.update(t)),this.iconContainer&&(this.iconContainerHover?.update(t),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(t))),this._title=e,this._onDidChangeTitleArea.fire()}setTitleDescription(e){this.titleDescriptionContainer?(this.titleDescriptionContainer.textContent=e??"",this.titleDescriptionContainerHover?.update(e??"")):e&&this.titleContainer&&(this.titleDescriptionContainer=pje(this.titleContainer,we("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleDescriptionContainer,e)))}updateTitleDescription(e){this.setTitleDescription(e),this._titleDescription=e,this._onDidChangeTitleArea.fire()}calculateTitle(e){const t=this.viewDescriptorService.getViewContainerByViewId(this.id),i=this.viewDescriptorService.getViewContainerModel(t),s=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&s?.containerTitle&&i.title!==s.containerTitle?`${s.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(dEe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new y7(this.element,eXe)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new K4t(ws(this.progressBar),new class extends Y4t{constructor(){super(e.id,e.isBodyVisible()),this._register(e.onDidChangeBodyVisibility(t=>t?this.onScopeOpened(e.id):this.onScopeClosed(e.id)))}}))}return this.progressIndicator}getProgressLocation(){return this.viewDescriptorService.getViewContainerByViewId(this.id).id}getLocationBasedColors(){return izt(this.viewDescriptorService.getViewLocationById(this.id))}focus(){this.viewWelcomeController.enabled?this.viewWelcomeController.focus():this.element&&(this.element.focus(),this._onDidFocus.fire())}setActions(){if(this.toolbar){const e=[...this.menuActions.getPrimaryActions()];this.shouldShowFilterInHeader()&&e.unshift(Rze),this.toolbar.setActions(gUe(e),gUe(this.menuActions.getSecondaryActions())),this.toolbar.context=this.getActionsContext()}}updateActionsVisibility(){if(!this.headerContainer)return;const e=this.configurationService.getValue("workbench.view.alwaysShowHeaderActions");this.headerContainer.classList.toggle("actions-always-visible",e)}updateActions(){this.setActions(),this._onDidChangeTitleArea.fire()}getActionViewItem(e,t){if(e.id===Rze.id){const i=this;return new class extends a_{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(s){s.classList.add("viewpane-filter-container");const o=i.getFilterWidget();he(s,o.element),o.relayout()}}}return yO(this.instantiationService,e,{...t,menuAsChild:e instanceof uS})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},lEe=YN,YN.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",YN);Wie=lEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,on),_(10,Zc)],Wie);let hEe=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,t,i,s,o,r,a,c,l,d,h,u),this.filterWidget=this._register(a.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(cEe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=he(e,we(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new Tn(t,e);const i=!this.filterContainer?.hasChildNodes(),s=this.shouldShowFilterInHeader();i!==s&&(s&&_a(this.filterContainer),this.updateActions(),s||he(this.filterContainer,this.filterWidget.element)),s||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};hEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,on),_(10,Zc)],hEe);function izt(n){let e,t,i,s;switch(n){case Sr.Panel:e=E3,t=GTt,i=qTt,s=QTt;break;case Sr.Sidebar:case Sr.AuxiliaryBar:default:e=RE,t=JTt,i=XTt,s=ZTt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:s}}}class XQ extends pi{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(q_).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}const nzt="copilot",szt="vs/workbench/contrib/chat/browser/chat";async function ozt(n){return(await n.openView(azt))?.widget}const rzt=g(szt,0,"Generating"),azt=`workbench.panel.chat.view.${nzt}`;class cC extends AZe{constructor(){super(...arguments),this._onDidChangeDirty=this._register(new I),this._onDidChangeLabel=this._register(new I),this._onDidChangeCapabilities=this._register(new I),this._onWillDispose=this._register(new I),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 Mi.Readonly}hasCapability(e){return e===Mi.None?this.capabilities===Mi.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Mi.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Gs.SHORT)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,t){return this}async saveAs(e,t){return this}async revert(e,t){}async rename(e,t){}copy(){return this}canMove(e,t){return!0}matches(e){if(Qa(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:_n(this.resource,Qc.getCanonicalUri(e))}prefersEditorPane(e){return k_(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}const Hm="vs/platform/request/common/request";class czt{constructor(e){this.original=e}toJSON(){if(!this.headers){const e=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?e[t]="*****":e[t]=this.original[t];this.headers=e}return this.headers}}class lzt extends ${constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(Hm,0,"Network Requests"),when:wSt.isEqualTo(c7(Pn.Trace)).serialize()})}async logAndRequest(e,t,i){const s=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${s} - begin`,t.type,new czt(t.headers??{}));try{const o=await i();return this.logger.trace(`${s} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${s} - error`,t.type,lg(o)),o}}}function Qnt(n){return n.res.statusCode&&n.res.statusCode>=200&&n.res.statusCode<300||n.res.statusCode===1223}function jnt(n){return n.res.statusCode===204}async function dzt(n){return jnt(n)?null:(await II(n.stream)).toString()}async function hzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);return dzt(n)}async function uzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);if(jnt(n))return null;const t=(await II(n.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: -`+t,i}}let Epe;function gzt(n){const e=it.as(Cs.Configuration),t=Epe;Epe={id:"http",order:15,title:g(Hm,1,"HTTP"),type:"object",scope:n,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(Hm,2,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables."),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:g(Hm,3,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(Hm,4,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(Hm,5,"The value to send as the `Proxy-Authorization` header for every network request."),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[g(Hm,6,"Disable proxy support for extensions."),g(Hm,7,"Enable proxy support for extensions."),g(Hm,8,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(Hm,9,"Enable proxy support for extensions, override request options.")],default:"override",description:g(Hm,10,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(Hm,11,"Controls whether CA certificates should be loaded from the OS. (On Windows and macOS, a reload of the window is required after turning this off.)"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,description:g(Hm,12,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implemenation."),restricted:!0}}},e.updateConfigurations({add:[Epe],remove:t?[t]:[]})}gzt(ut.APPLICATION);var N3,cc;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(cc||(cc={}));(function(n){function e(t){switch(t){case"panel":return n.Panel;case"terminal":return n.Terminal;case"notebook":return n.Notebook;case"editor":return n.Editor}return n.Panel}n.fromRaw=e})(cc||(cc={}));var UH;let Nze=(UH=class{constructor(e){this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new I,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentCompletionProviders=new Map,this._hasDefaultAgent=utt.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const s=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||s.contextKeyService.contextMatchesRules(ge.deserialize(a.when)))}};const r={data:t};return this._agents.set(e,r),Ee(()=>{this._agents.delete(e),this._onDidChangeAgents.fire(void 0)})}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new jK(i.data,t)),Ee(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(!1)})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new jK(e,t)),Ee(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new jK(i.data,i.impl))}getDefaultAgent(e){return t1(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return fi.find(this._agents.values(),e=>!!e.data.metadata.isSecondary)?.data}getAgent(e){if(this._agentIsEnabled(e))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=this._agents.get(e);return!t?.data.when||this.contextKeyService.contextMatchesRules(ge.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=fi.find(this._agents.values(),i=>Nhe(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new jK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}async invokeAgent(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return await r.impl.invoke(t,i,s,o)}async getFollowups(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return r.impl?.provideFollowups?r.impl.provideFollowups(t,i,s,o):[]}},UH.AGENT_LEADER="@",UH);Nze=D([_(0,Pe)],Nze);class jK{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get defaultImplicitVariables(){return this.data.defaultImplicitVariables}get locations(){return this.data.locations}async invoke(e,t,i,s){return this.impl.invoke(e,t,i,s)}async provideFollowups(e,t,i,s){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,s):[]}provideWelcomeMessage(e,t){if(this.impl.provideWelcomeMessage)return this.impl.provideWelcomeMessage(e,t)}provideSampleQuestions(e,t){if(this.impl.provideSampleQuestions)return this.impl.provideSampleQuestions(e,t)}}var JN;let Pze=(JN=class{constructor(e,t,i,s){if(this.requestService=t,this.logService=i,this.storageService=s,this.registry=xi(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=s.get(N3.StorageKey,ke.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{s.remove(N3.StorageKey,ke.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Ta(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},qe.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await uzt(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(N3.StorageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE)}getAgentNameRestriction(e){const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(s=>s[e.toLowerCase()]).map(s=>s?s.some(o=>Oa(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},N3=JN,JN.StorageKey="chat.participantNameRegistry",JN);Pze=N3=D([_(0,Ja),_(1,EQ),_(2,Ze),_(3,sn)],Pze);function Nhe(n){return`${n.extensionId.value}.${n.id}`}function Knt(n){const e="name"in n?n:{...n,name:n.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Cn("")),Or(e)}var _A;const Ynt="vs/workbench/contrib/chat/browser/chatEditorInput",fzt=ji("chat-editor-label-icon",Ce.commentDiscussion,g(Ynt,0,"Icon of the chat editor label."));var YE;let uEe=(YE=class extends cC{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return Hie.generate(e)}static getNextCount(){let e=0;for(;_A.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof Hie.parse(e)?.handle!="number")throw new Error("Invalid chat URI");this.sessionId=t.target&&"sessionId"in t.target?t.target.sessionId:void 0,this.inputCount=_A.getNextCount(),_A.countsInUse.add(this.inputCount),this._register(Ee(()=>_A.countsInUse.delete(this.inputCount)))}get editorId(){return _A.EditorID}get capabilities(){return super.capabilities|Mi.Singleton}matches(e){return e instanceof _A&&e.resource.toString()===this.resource.toString()}get typeId(){return _A.TypeID}getName(){return this.model?.title||g(Ynt,1,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return fzt}async resolve(){return typeof this.sessionId=="string"?this.model=this.chatService.getOrRestoreSession(this.sessionId):this.options.target?"data"in this.options.target&&(this.model=this.chatService.loadSessionFromContent(this.options.target.data)):this.model=this.chatService.startSession(cc.Panel,qe.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new pzt(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},_A=YE,YE.countsInUse=new Set,YE.TypeID="workbench.input.chatSession",YE.EditorID="workbench.editor.chatSession",YE);uEe=_A=D([_(2,Rw)],uEe);class pzt extends ${constructor(e){super(),this.model=e,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._isDisposed=!1,this._isResolved=!1}async resolve(){this._isResolved=!0}isResolved(){return this._isResolved}isDisposed(){return this._isDisposed}dispose(){super.dispose(),this._isDisposed=!0}}var Hie;(function(n){n.scheme=_e.vscodeChatSesssion;function e(i){return P.from({scheme:n.scheme,path:`chat-${i}`})}n.generate=e;function t(i){if(i.scheme!==n.scheme)return;const o=i.path.match(/chat-(\d+)/)?.[1];if(typeof o!="string")return;const r=parseInt(o);if(!isNaN(r))return{handle:r}}n.parse=t})(Hie||(Hie={}));const Tce=class Tce{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=Tce.Kind}get promptText(){return this.text}};Tce.Kind="text";let kb=Tce;const $Fe="#",$z="@",O1="/",Rce=class Rce{constructor(e,t,i,s,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=s,this.variableId=o,this.kind=Rce.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${$Fe}${this.variableName}${e}`}get promptText(){return this.text}};Rce.Kind="var";let m6=Rce;const Mce=class Mce{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=Mce.Kind}get text(){return`${$z}${this.agent.name}`}get promptText(){return""}};Mce.Kind="agent";let tp=Mce;const Nce=class Nce{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=Nce.Kind}get text(){return`${O1}${this.command.name}`}get promptText(){return""}};Nce.Kind="subcommand";let HV=Nce;const Pce=class Pce{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=Pce.Kind}get text(){return`${O1}${this.slashCommand.command}`}get promptText(){return`${O1}${this.slashCommand.command}`}};Pce.Kind="slash";let UV=Pce;const Fce=class Fce{constructor(e,t,i,s,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=s,this.modelDescription=o,this.data=r,this.kind=Fce.Kind}get referenceText(){return this.text.replace($Fe,"")}get promptText(){return this.text}};Fce.Kind="dynamic";let VV=Fce;function mzt(n){return{text:n.text,parts:n.parts.map(e=>{if(e.kind===kb.Kind)return new kb(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===m6.Kind)return new m6(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===tp.Kind){let t=e.agent;return t=Knt(t),new tp(new hi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===HV.Kind)return new HV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===UV.Kind)return new UV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===VV.Kind)return new VV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Or(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function _zt(n){const e=n.parts.find(i=>i instanceof tp),t=n.parts.find(i=>i instanceof HV);return{agentPart:e,commandPart:t}}function vzt(n){return!!n&&typeof n=="object"&&"uri"in n&&n.uri instanceof P&&"version"in n&&typeof n.version=="number"&&"ranges"in n&&Array.isArray(n.ranges)&&n.ranges.every(O.isIRange)}function wzt(n){return!!n&&typeof n=="object"&&"documents"in n&&Array.isArray(n.documents)&&n.documents.every(vzt)}var zV;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(zV||(zV={}));var Fze;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Fze||(Fze={}));var gEe,fEe;const bzt="vs/workbench/contrib/chat/common/chatModel",Oce=class Oce{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}constructor(e,t,i,s=0){this._session=e,this.message=t,this._variableData=i,this._attempt=s,this.id="request_"+Oce.nextId++}adoptTo(e){this._session=e}};Oce.nextId=0;let Uie=Oce,Czt=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseParts=Kb(e).map(t=>ah(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}asString(){return this._responseRepr}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,s=this._responseParts[i];!s||s.kind!=="markdownContent"||!Jnt(s.content,e.content)?this._responseParts.push(e):s.content=qJ(s.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let s=0;!i&&s{this._updateRepr(!1)});e.task?.().then(o=>{s.dispose(),typeof o=="string"&&(this._responseParts[i]={...e,content:new Xt(o)}),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?ui("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(bzt,0,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} + `)}else $e.isThemeIcon(i)&&(s=$e.asClassName(i));s&&this.iconContainer.classList.add(...s.split(" "));const o=this.calculateTitle(t);this.titleContainer=he(e,we("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewService?.hasShownAccessibleView(this.id);return!t||i?e:g(Bie,3,"Use Alt+F1 for accessibility help {0}",e)}updateTitle(e){const t=this.calculateTitle(e);this.titleContainer&&(this.titleContainer.textContent=t,this.titleContainerHover?.update(t)),this.iconContainer&&(this.iconContainerHover?.update(t),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(t))),this._title=e,this._onDidChangeTitleArea.fire()}setTitleDescription(e){this.titleDescriptionContainer?(this.titleDescriptionContainer.textContent=e??"",this.titleDescriptionContainerHover?.update(e??"")):e&&this.titleContainer&&(this.titleDescriptionContainer=pje(this.titleContainer,we("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupUpdatableHover(va("mouse"),this.titleDescriptionContainer,e)))}updateTitleDescription(e){this.setTitleDescription(e),this._titleDescription=e,this._onDidChangeTitleArea.fire()}calculateTitle(e){const t=this.viewDescriptorService.getViewContainerByViewId(this.id),i=this.viewDescriptorService.getViewContainerModel(t),s=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&s?.containerTitle&&i.title!==s.containerTitle?`${s.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(dEe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new y7(this.element,eXe)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new K4t(ws(this.progressBar),new class extends Y4t{constructor(){super(e.id,e.isBodyVisible()),this._register(e.onDidChangeBodyVisibility(t=>t?this.onScopeOpened(e.id):this.onScopeClosed(e.id)))}}))}return this.progressIndicator}getProgressLocation(){return this.viewDescriptorService.getViewContainerByViewId(this.id).id}getLocationBasedColors(){return izt(this.viewDescriptorService.getViewLocationById(this.id))}focus(){this.viewWelcomeController.enabled?this.viewWelcomeController.focus():this.element&&(this.element.focus(),this._onDidFocus.fire())}setActions(){if(this.toolbar){const e=[...this.menuActions.getPrimaryActions()];this.shouldShowFilterInHeader()&&e.unshift(Rze),this.toolbar.setActions(gUe(e),gUe(this.menuActions.getSecondaryActions())),this.toolbar.context=this.getActionsContext()}}updateActionsVisibility(){if(!this.headerContainer)return;const e=this.configurationService.getValue("workbench.view.alwaysShowHeaderActions");this.headerContainer.classList.toggle("actions-always-visible",e)}updateActions(){this.setActions(),this._onDidChangeTitleArea.fire()}getActionViewItem(e,t){if(e.id===Rze.id){const i=this;return new class extends a_{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(s){s.classList.add("viewpane-filter-container");const o=i.getFilterWidget();he(s,o.element),o.relayout()}}}return yO(this.instantiationService,e,{...t,menuAsChild:e instanceof uS})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},lEe=YN,YN.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",YN);Wie=lEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,rn),_(10,el)],Wie);let hEe=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,t,i,s,o,r,a,c,l,d,h,u),this.filterWidget=this._register(a.createChild(new Dl([Pe,this.scopedContextKeyService])).createInstance(cEe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=he(e,we(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new Tn(t,e);const i=!this.filterContainer?.hasChildNodes(),s=this.shouldShowFilterInHeader();i!==s&&(s&&_a(this.filterContainer),this.updateActions(),s||he(this.filterContainer,this.filterWidget.element)),s||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};hEe=D([_(1,ti),_(2,Vr),_(3,Re),_(4,Pe),_(5,z_),_(6,be),_(7,fr),_(8,pn),_(9,rn),_(10,el)],hEe);function izt(n){let e,t,i,s;switch(n){case Sr.Panel:e=E3,t=GTt,i=qTt,s=QTt;break;case Sr.Sidebar:case Sr.AuxiliaryBar:default:e=RE,t=JTt,i=XTt,s=ZTt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:s}}}class XQ extends pi{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(q_).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}const nzt="copilot",szt="vs/workbench/contrib/chat/browser/chat";async function ozt(n){return(await n.openView(azt))?.widget}const rzt=g(szt,0,"Generating"),azt=`workbench.panel.chat.view.${nzt}`;class cC extends AZe{constructor(){super(...arguments),this._onDidChangeDirty=this._register(new I),this._onDidChangeLabel=this._register(new I),this._onDidChangeCapabilities=this._register(new I),this._onWillDispose=this._register(new I),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 Mi.Readonly}hasCapability(e){return e===Mi.None?this.capabilities===Mi.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Mi.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Gs.SHORT)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,t){return this}async saveAs(e,t){return this}async revert(e,t){}async rename(e,t){}copy(){return this}canMove(e,t){return!0}matches(e){if(Qa(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:_n(this.resource,jc.getCanonicalUri(e))}prefersEditorPane(e){return k_(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}const Hm="vs/platform/request/common/request";class czt{constructor(e){this.original=e}toJSON(){if(!this.headers){const e=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?e[t]="*****":e[t]=this.original[t];this.headers=e}return this.headers}}class lzt extends ${constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(Hm,0,"Network Requests"),when:wSt.isEqualTo(c7(Pn.Trace)).serialize()})}async logAndRequest(e,t,i){const s=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${s} - begin`,t.type,new czt(t.headers??{}));try{const o=await i();return this.logger.trace(`${s} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${s} - error`,t.type,lg(o)),o}}}function Qnt(n){return n.res.statusCode&&n.res.statusCode>=200&&n.res.statusCode<300||n.res.statusCode===1223}function jnt(n){return n.res.statusCode===204}async function dzt(n){return jnt(n)?null:(await II(n.stream)).toString()}async function hzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);return dzt(n)}async function uzt(n){if(!Qnt(n))throw new Error("Server returned "+n.res.statusCode);if(jnt(n))return null;const t=(await II(n.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: +`+t,i}}let Epe;function gzt(n){const e=it.as(Cs.Configuration),t=Epe;Epe={id:"http",order:15,title:g(Hm,1,"HTTP"),type:"object",scope:n,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(Hm,2,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables."),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:g(Hm,3,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(Hm,4,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(Hm,5,"The value to send as the `Proxy-Authorization` header for every network request."),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[g(Hm,6,"Disable proxy support for extensions."),g(Hm,7,"Enable proxy support for extensions."),g(Hm,8,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(Hm,9,"Enable proxy support for extensions, override request options.")],default:"override",description:g(Hm,10,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(Hm,11,"Controls whether CA certificates should be loaded from the OS. (On Windows and macOS, a reload of the window is required after turning this off.)"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,description:g(Hm,12,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implemenation."),restricted:!0}}},e.updateConfigurations({add:[Epe],remove:t?[t]:[]})}gzt(ut.APPLICATION);var N3,lc;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(lc||(lc={}));(function(n){function e(t){switch(t){case"panel":return n.Panel;case"terminal":return n.Terminal;case"notebook":return n.Notebook;case"editor":return n.Editor}return n.Panel}n.fromRaw=e})(lc||(lc={}));var UH;let Nze=(UH=class{constructor(e){this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new I,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentCompletionProviders=new Map,this._hasDefaultAgent=utt.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const s=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||s.contextKeyService.contextMatchesRules(ge.deserialize(a.when)))}};const r={data:t};return this._agents.set(e,r),Ee(()=>{this._agents.delete(e),this._onDidChangeAgents.fire(void 0)})}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new jK(i.data,t)),Ee(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(!1)})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new jK(e,t)),Ee(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new jK(i.data,i.impl))}getDefaultAgent(e){return t1(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return fi.find(this._agents.values(),e=>!!e.data.metadata.isSecondary)?.data}getAgent(e){if(this._agentIsEnabled(e))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=this._agents.get(e);return!t?.data.when||this.contextKeyService.contextMatchesRules(ge.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=fi.find(this._agents.values(),i=>Nhe(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new jK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}async invokeAgent(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return await r.impl.invoke(t,i,s,o)}async getFollowups(e,t,i,s,o){const r=this._agents.get(e);if(!r?.impl)throw new Error(`No activated agent with id "${e}"`);return r.impl?.provideFollowups?r.impl.provideFollowups(t,i,s,o):[]}},UH.AGENT_LEADER="@",UH);Nze=D([_(0,Pe)],Nze);class jK{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get defaultImplicitVariables(){return this.data.defaultImplicitVariables}get locations(){return this.data.locations}async invoke(e,t,i,s){return this.impl.invoke(e,t,i,s)}async provideFollowups(e,t,i,s){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,s):[]}provideWelcomeMessage(e,t){if(this.impl.provideWelcomeMessage)return this.impl.provideWelcomeMessage(e,t)}provideSampleQuestions(e,t){if(this.impl.provideSampleQuestions)return this.impl.provideSampleQuestions(e,t)}}var JN;let Pze=(JN=class{constructor(e,t,i,s){if(this.requestService=t,this.logService=i,this.storageService=s,this.registry=xi(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=s.get(N3.StorageKey,ke.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{s.remove(N3.StorageKey,ke.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Ta(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},qe.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await uzt(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(N3.StorageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE)}getAgentNameRestriction(e){const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(s=>s[e.toLowerCase()]).map(s=>s?s.some(o=>Oa(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},N3=JN,JN.StorageKey="chat.participantNameRegistry",JN);Pze=N3=D([_(0,Ja),_(1,EQ),_(2,Ze),_(3,on)],Pze);function Nhe(n){return`${n.extensionId.value}.${n.id}`}function Knt(n){const e="name"in n?n:{...n,name:n.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Cn("")),Or(e)}var _A;const Ynt="vs/workbench/contrib/chat/browser/chatEditorInput",fzt=Ki("chat-editor-label-icon",Ce.commentDiscussion,g(Ynt,0,"Icon of the chat editor label."));var YE;let uEe=(YE=class extends cC{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return Hie.generate(e)}static getNextCount(){let e=0;for(;_A.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof Hie.parse(e)?.handle!="number")throw new Error("Invalid chat URI");this.sessionId=t.target&&"sessionId"in t.target?t.target.sessionId:void 0,this.inputCount=_A.getNextCount(),_A.countsInUse.add(this.inputCount),this._register(Ee(()=>_A.countsInUse.delete(this.inputCount)))}get editorId(){return _A.EditorID}get capabilities(){return super.capabilities|Mi.Singleton}matches(e){return e instanceof _A&&e.resource.toString()===this.resource.toString()}get typeId(){return _A.TypeID}getName(){return this.model?.title||g(Ynt,1,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return fzt}async resolve(){return typeof this.sessionId=="string"?this.model=this.chatService.getOrRestoreSession(this.sessionId):this.options.target?"data"in this.options.target&&(this.model=this.chatService.loadSessionFromContent(this.options.target.data)):this.model=this.chatService.startSession(lc.Panel,qe.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new pzt(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},_A=YE,YE.countsInUse=new Set,YE.TypeID="workbench.input.chatSession",YE.EditorID="workbench.editor.chatSession",YE);uEe=_A=D([_(2,Rw)],uEe);class pzt extends ${constructor(e){super(),this.model=e,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._isDisposed=!1,this._isResolved=!1}async resolve(){this._isResolved=!0}isResolved(){return this._isResolved}isDisposed(){return this._isDisposed}dispose(){super.dispose(),this._isDisposed=!0}}var Hie;(function(n){n.scheme=_e.vscodeChatSesssion;function e(i){return P.from({scheme:n.scheme,path:`chat-${i}`})}n.generate=e;function t(i){if(i.scheme!==n.scheme)return;const o=i.path.match(/chat-(\d+)/)?.[1];if(typeof o!="string")return;const r=parseInt(o);if(!isNaN(r))return{handle:r}}n.parse=t})(Hie||(Hie={}));const Tce=class Tce{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=Tce.Kind}get promptText(){return this.text}};Tce.Kind="text";let kb=Tce;const $Fe="#",$z="@",O1="/",Rce=class Rce{constructor(e,t,i,s,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=s,this.variableId=o,this.kind=Rce.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${$Fe}${this.variableName}${e}`}get promptText(){return this.text}};Rce.Kind="var";let m6=Rce;const Mce=class Mce{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=Mce.Kind}get text(){return`${$z}${this.agent.name}`}get promptText(){return""}};Mce.Kind="agent";let tp=Mce;const Nce=class Nce{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=Nce.Kind}get text(){return`${O1}${this.command.name}`}get promptText(){return""}};Nce.Kind="subcommand";let HV=Nce;const Pce=class Pce{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=Pce.Kind}get text(){return`${O1}${this.slashCommand.command}`}get promptText(){return`${O1}${this.slashCommand.command}`}};Pce.Kind="slash";let UV=Pce;const Fce=class Fce{constructor(e,t,i,s,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=s,this.modelDescription=o,this.data=r,this.kind=Fce.Kind}get referenceText(){return this.text.replace($Fe,"")}get promptText(){return this.text}};Fce.Kind="dynamic";let VV=Fce;function mzt(n){return{text:n.text,parts:n.parts.map(e=>{if(e.kind===kb.Kind)return new kb(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===m6.Kind)return new m6(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===tp.Kind){let t=e.agent;return t=Knt(t),new tp(new hi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===HV.Kind)return new HV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===UV.Kind)return new UV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===VV.Kind)return new VV(new hi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Or(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function _zt(n){const e=n.parts.find(i=>i instanceof tp),t=n.parts.find(i=>i instanceof HV);return{agentPart:e,commandPart:t}}function vzt(n){return!!n&&typeof n=="object"&&"uri"in n&&n.uri instanceof P&&"version"in n&&typeof n.version=="number"&&"ranges"in n&&Array.isArray(n.ranges)&&n.ranges.every(O.isIRange)}function wzt(n){return!!n&&typeof n=="object"&&"documents"in n&&Array.isArray(n.documents)&&n.documents.every(vzt)}var zV;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(zV||(zV={}));var Fze;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Fze||(Fze={}));var gEe,fEe;const bzt="vs/workbench/contrib/chat/common/chatModel",Oce=class Oce{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}constructor(e,t,i,s=0){this._session=e,this.message=t,this._variableData=i,this._attempt=s,this.id="request_"+Oce.nextId++}adoptTo(e){this._session=e}};Oce.nextId=0;let Uie=Oce,Czt=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseParts=Kb(e).map(t=>ah(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}asString(){return this._responseRepr}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,s=this._responseParts[i];!s||s.kind!=="markdownContent"||!Jnt(s.content,e.content)?this._responseParts.push(e):s.content=qJ(s.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let s=0;!i&&s{this._updateRepr(!1)});e.task?.().then(o=>{s.dispose(),typeof o=="string"&&(this._responseParts[i]={...e,content:new Xt(o)}),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?ui("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(bzt,0,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} ${t.message}`:t.content.value).filter(t=>t.length>0).join(` `),e||this._onDidChangeValue.fire()}};const Bce=class Bce extends ${get session(){return this._session}get isComplete(){return this._isComplete}get isCanceled(){return this._isCanceled}get vote(){return this._vote}get followups(){return this._followups}get response(){return this._response}get result(){return this._result}get username(){return this.session.responderUsername}get avatarIcon(){return this.session.responderAvatarIcon}get agent(){return this._agent}get slashCommand(){return this._slashCommand}get agentOrSlashCommandDetected(){return this._agentOrSlashCommandDetected??!1}get usedContext(){return this._usedContext}get contentReferences(){return this._contentReferences}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}constructor(e,t,i,s,o,r=!1,a=!1,c,l,d){super(),this._session=t,this._agent=i,this._slashCommand=s,this.requestId=o,this._isComplete=r,this._isCanceled=a,this._vote=c,this._result=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._contentReferences=[],this._progressMessages=[],this._isStale=!1,this._isStale=Array.isArray(e)&&(e.length!==0||ah(e)&&e.value.length!==0),this._followups=d?[...d]:void 0,this._response=new Czt(e),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire())),this.id="response_"+Bce.nextId++}updateContent(e,t){this._response.updateContent(e,t)}applyReference(e){e.kind==="usedContext"?this._usedContext=e:e.kind==="reference"&&(this._contentReferences.push(e),this._onDidChange.fire())}setAgent(e,t){this._agent=e,this._slashCommand=t,this._agentOrSlashCommandDetected=!0,this._onDidChange.fire()}setResult(e){this._result=e,this._onDidChange.fire()}complete(){this._result?.errorDetails?.responseIsRedacted&&this._response.clear(),this._isComplete=!0,this._onDidChange.fire()}cancel(){this._isComplete=!0,this._isCanceled=!0,this._onDidChange.fire()}setFollowups(e){this._followups=e,this._onDidChange.fire()}setVote(e){this._vote=e,this._onDidChange.fire()}setEditApplied(e,t){return!this.response.value.includes(e)||!e.state?!1:(e.state.applied=t,this._onDidChange.fire(),!0)}adoptTo(e){this._session=e,this._onDidChange.fire()}};Bce.nextId=0;let f2=Bce;function yzt(n){const e=n;return typeof e=="object"&&typeof e.requesterUsername=="string"}function xpe(n){const e=n;return yzt(n)&&typeof e.creationDate=="number"&&typeof e.sessionId=="string"&&n.requests.every(t=>!t.usedContext||wzt(t.usedContext))}var _6;(function(n){n[n.Removal=0]="Removal",n[n.Resend=1]="Resend",n[n.Adoption=2]="Adoption"})(_6||(_6={}));var Vf;(function(n){n[n.Created=0]="Created",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Vf||(Vf={}));let Vie=gEe=class extends ${static getDefaultTitle(e){const t=k_(e)?.message??"";return(typeof t=="string"?t:t.text).split(` -`)[0].substring(0,50)}get welcomeMessage(){return this._welcomeMessage}get sessionId(){return this._sessionId}get requestInProgress(){const e=this._requests[this._requests.length-1];return!!e&&!!e.response&&!e.response.isComplete}get hasRequests(){return this._requests.length>0}get creationDate(){return this._creationDate}get _defaultAgent(){return this.chatAgentService.getDefaultAgent(cc.Panel)}get requesterUsername(){return(this._defaultAgent?this._defaultAgent.metadata.requester?.name:this.initialData?.requesterUsername)??""}get responderUsername(){return(this._defaultAgent?this._defaultAgent.fullName:this.initialData?.responderUsername)??""}get requesterAvatarIconUri(){return this._defaultAgent?this._defaultAgent.metadata.requester?.icon:this._initialRequesterAvatarIconUri}get responderAvatarIcon(){return this._defaultAgent?this._defaultAgent?.metadata.themeIcon:this._initialResponderAvatarIconUri}get initState(){return this._initState}get isImported(){return this._isImported}get title(){return gEe.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,s,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._initState=Vf.Created,this._isInitializedDeferred=new sd,this._isImported=!1,this._isImported=!!e&&!xpe(e)||(e?.isImported??!1),this._sessionId=xpe(e)&&e.sessionId||Dr(),this._requests=e?this._deserialize(e):[],this._creationDate=xpe(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&P.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=lZ(e?.responderAvatarIconUri)?P.revive(e.responderAvatarIconUri):e?.responderAvatarIconUri}_deserialize(e){const t=e.requests;if(!Array.isArray(t))return this.logService.error(`Ignoring malformed session data: ${JSON.stringify(e)}`),[];if(e.welcomeMessage){const i=e.welcomeMessage.map(s=>typeof s=="string"?new Xt(s):s);this._welcomeMessage=this.instantiationService.createInstance(pEe,i,[])}try{return t.map(i=>{const s=typeof i.message=="string"?this.getParsedRequestFromString(i.message):mzt(i.message),o=this.reviveVariableData(i.variableData),r=new Uie(this,s,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?Knt(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new f2(i.response??[new Xt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Or(i.usedContext)),i.contentReferences&&i.contentReferences.forEach(l=>r.response.applyReference(Or(l)))}return r})}catch(i){return this.logService.error("Failed to parse chat data",i),[]}}reviveVariableData(e){const t=e&&Array.isArray(e.variables)?e:{variables:[]};return t.variables=t.variables.map(i=>"values"in i&&Array.isArray(i.values)?{id:i.id??"",name:i.name,value:i.values[0]?.value,range:i.range,modelDescription:i.modelDescription,references:i.references}:i),t}getParsedRequestFromString(e){const t=[new kb(new hi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==Vf.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${Vf[this.initState]}`);this._initState=Vf.Initializing}deinitialize(){this._initState=Vf.Created,this._isInitializedDeferred=new sd}initialize(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${Vf[this.initState]}`);this._initState=Vf.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${Vf[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,s,o){const r=new Uie(this,e,t,i);return r.response=new f2([],this,s,o,r.id),this._requests.push(r),this._onDidChange.fire({kind:"addRequest",request:r}),r}adoptRequest(e){const t=e.session,i=t._requests.findIndex(s=>s.id===e.id);i!==-1&&(t._requests.splice(i,1),e.adoptTo(this),e.response?.adoptTo(this),this._requests.push(e),t._onDidChange.fire({kind:"removeRequest",requestId:e.id,responseId:e.response?.id,reason:_6.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");if(t.kind==="markdownContent"||t.kind==="treeData"||t.kind==="inlineReference"||t.kind==="markdownVuln"||t.kind==="progressMessage"||t.kind==="command"||t.kind==="textEdit"||t.kind==="warning"||t.kind==="progressTask"||t.kind==="confirmation")e.response.updateContent(t,i);else if(t.kind==="usedContext"||t.kind==="reference")e.response.applyReference(t);else if(t.kind==="agentDetection"){const s=this.chatAgentService.getAgent(t.agentId);s&&e.response.setAgent(s,t.command)}else this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=_6.Removal){const i=this._requests.findIndex(o=>o.id===e),s=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:s.id,responseId:s.response?.id,reason:t}),this._requests.splice(i,1),s.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.setResult(t)}completeResponse(e){if(!e.response)throw new Error("Call setResponse before completeResponse");e.response.complete()}setFollowups(e,t){e.response&&e.response.setFollowups(t)}setResponseModel(e,t){e.response=t,this._onDidChange.fire({kind:"addResponse",response:t})}toExport(){return{requesterUsername:this.requesterUsername,requesterAvatarIconUri:this.requesterAvatarIconUri,responderUsername:this.responderUsername,responderAvatarIconUri:this.responderAvatarIcon,initialLocation:this.initialLocation,welcomeMessage:this._welcomeMessage?.content.map(e=>Array.isArray(e)?e:e.value),requests:this._requests.map(e=>({message:{...e.message,parts:e.message.parts.map(i=>i&&"toJSON"in i?i.toJSON():i)},variableData:e.variableData,response:e.response?e.response.response.value.map(i=>i.kind==="treeData"?i.treeData:i.kind==="markdownContent"?i.content:i):void 0,result:e.response?.result,followups:e.response?.followups,isCanceled:e.response?.isCanceled,vote:e.response?.vote,agent:e.response?.agent?{...e.response.agent}:void 0,slashCommand:e.response?.slashCommand,usedContext:e.response?.usedContext,contentReferences:e.response?.contentReferences}))}}toJSON(){return{...this.toExport(),sessionId:this.sessionId,creationDate:this._creationDate,isImported:this._isImported}}dispose(){this._requests.forEach(e=>e.response?.dispose()),this._onDidDispose.fire(),super.dispose()}};Vie=gEe=D([_(2,Ze),_(3,yp),_(4,be)],Vie);var XN;let pEe=(XN=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+fEe.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(cc.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(cc.Panel)?.metadata.themeIcon}},fEe=XN,XN.nextId=0,XN);pEe=fEe=D([_(2,yp)],pEe);function Jnt(n,e){if(n.baseUri&&e.baseUri){if(!(n.baseUri.scheme===e.baseUri.scheme&&n.baseUri.authority===e.baseUri.authority&&n.baseUri.path===e.baseUri.path&&n.baseUri.query===e.baseUri.query&&n.baseUri.fragment===e.baseUri.fragment))return!1}else if(n.baseUri||e.baseUri)return!1;return Io(n.isTrusted,e.isTrusted)&&n.supportHtml===e.supportHtml&&n.supportThemeIcons===e.supportThemeIcons}function qJ(n,e){const t=typeof e=="string"?e:e.value;return{value:n.value+t,isTrusted:n.isTrusted,supportThemeIcons:n.supportThemeIcons,supportHtml:n.supportHtml,baseUri:n.baseUri}}const Xnt="http://_vscodecontentref_";function Oze(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="inlineReference"){const s="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=P.parse(Xnt).with({fragment:JSON.stringify(s)}),r=`[${t.name||ui(s.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=qJ(i.content,new Xt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Xt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&Jnt(i.content,t.content)){const s=qJ(i.content,t.content);e[e.length-1]={content:s,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=qJ(i.content,new Xt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Xt(o),kind:"markdownContent"})}else e.push(t)}return e}function Szt(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+t.content.value,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push(t);else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Xt(o),kind:"markdownContent"})}}return e}function Azt(n){const e=[];let t=n,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[s,o,r]=i,a=i.index,c=t.substring(0,a),l=c.split(` +`)[0].substring(0,50)}get welcomeMessage(){return this._welcomeMessage}get sessionId(){return this._sessionId}get requestInProgress(){const e=this._requests[this._requests.length-1];return!!e&&!!e.response&&!e.response.isComplete}get hasRequests(){return this._requests.length>0}get creationDate(){return this._creationDate}get _defaultAgent(){return this.chatAgentService.getDefaultAgent(lc.Panel)}get requesterUsername(){return(this._defaultAgent?this._defaultAgent.metadata.requester?.name:this.initialData?.requesterUsername)??""}get responderUsername(){return(this._defaultAgent?this._defaultAgent.fullName:this.initialData?.responderUsername)??""}get requesterAvatarIconUri(){return this._defaultAgent?this._defaultAgent.metadata.requester?.icon:this._initialRequesterAvatarIconUri}get responderAvatarIcon(){return this._defaultAgent?this._defaultAgent?.metadata.themeIcon:this._initialResponderAvatarIconUri}get initState(){return this._initState}get isImported(){return this._isImported}get title(){return gEe.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,s,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this._onDidDispose=this._register(new I),this.onDidDispose=this._onDidDispose.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._initState=Vf.Created,this._isInitializedDeferred=new sd,this._isImported=!1,this._isImported=!!e&&!xpe(e)||(e?.isImported??!1),this._sessionId=xpe(e)&&e.sessionId||Dr(),this._requests=e?this._deserialize(e):[],this._creationDate=xpe(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&P.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=lZ(e?.responderAvatarIconUri)?P.revive(e.responderAvatarIconUri):e?.responderAvatarIconUri}_deserialize(e){const t=e.requests;if(!Array.isArray(t))return this.logService.error(`Ignoring malformed session data: ${JSON.stringify(e)}`),[];if(e.welcomeMessage){const i=e.welcomeMessage.map(s=>typeof s=="string"?new Xt(s):s);this._welcomeMessage=this.instantiationService.createInstance(pEe,i,[])}try{return t.map(i=>{const s=typeof i.message=="string"?this.getParsedRequestFromString(i.message):mzt(i.message),o=this.reviveVariableData(i.variableData),r=new Uie(this,s,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?Knt(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new f2(i.response??[new Xt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Or(i.usedContext)),i.contentReferences&&i.contentReferences.forEach(l=>r.response.applyReference(Or(l)))}return r})}catch(i){return this.logService.error("Failed to parse chat data",i),[]}}reviveVariableData(e){const t=e&&Array.isArray(e.variables)?e:{variables:[]};return t.variables=t.variables.map(i=>"values"in i&&Array.isArray(i.values)?{id:i.id??"",name:i.name,value:i.values[0]?.value,range:i.range,modelDescription:i.modelDescription,references:i.references}:i),t}getParsedRequestFromString(e){const t=[new kb(new hi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==Vf.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${Vf[this.initState]}`);this._initState=Vf.Initializing}deinitialize(){this._initState=Vf.Created,this._isInitializedDeferred=new sd}initialize(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${Vf[this.initState]}`);this._initState=Vf.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==Vf.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${Vf[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,s,o){const r=new Uie(this,e,t,i);return r.response=new f2([],this,s,o,r.id),this._requests.push(r),this._onDidChange.fire({kind:"addRequest",request:r}),r}adoptRequest(e){const t=e.session,i=t._requests.findIndex(s=>s.id===e.id);i!==-1&&(t._requests.splice(i,1),e.adoptTo(this),e.response?.adoptTo(this),this._requests.push(e),t._onDidChange.fire({kind:"removeRequest",requestId:e.id,responseId:e.response?.id,reason:_6.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");if(t.kind==="markdownContent"||t.kind==="treeData"||t.kind==="inlineReference"||t.kind==="markdownVuln"||t.kind==="progressMessage"||t.kind==="command"||t.kind==="textEdit"||t.kind==="warning"||t.kind==="progressTask"||t.kind==="confirmation")e.response.updateContent(t,i);else if(t.kind==="usedContext"||t.kind==="reference")e.response.applyReference(t);else if(t.kind==="agentDetection"){const s=this.chatAgentService.getAgent(t.agentId);s&&e.response.setAgent(s,t.command)}else this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=_6.Removal){const i=this._requests.findIndex(o=>o.id===e),s=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:s.id,responseId:s.response?.id,reason:t}),this._requests.splice(i,1),s.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new f2([],this,void 0,void 0,e.id)),e.response.setResult(t)}completeResponse(e){if(!e.response)throw new Error("Call setResponse before completeResponse");e.response.complete()}setFollowups(e,t){e.response&&e.response.setFollowups(t)}setResponseModel(e,t){e.response=t,this._onDidChange.fire({kind:"addResponse",response:t})}toExport(){return{requesterUsername:this.requesterUsername,requesterAvatarIconUri:this.requesterAvatarIconUri,responderUsername:this.responderUsername,responderAvatarIconUri:this.responderAvatarIcon,initialLocation:this.initialLocation,welcomeMessage:this._welcomeMessage?.content.map(e=>Array.isArray(e)?e:e.value),requests:this._requests.map(e=>({message:{...e.message,parts:e.message.parts.map(i=>i&&"toJSON"in i?i.toJSON():i)},variableData:e.variableData,response:e.response?e.response.response.value.map(i=>i.kind==="treeData"?i.treeData:i.kind==="markdownContent"?i.content:i):void 0,result:e.response?.result,followups:e.response?.followups,isCanceled:e.response?.isCanceled,vote:e.response?.vote,agent:e.response?.agent?{...e.response.agent}:void 0,slashCommand:e.response?.slashCommand,usedContext:e.response?.usedContext,contentReferences:e.response?.contentReferences}))}}toJSON(){return{...this.toExport(),sessionId:this.sessionId,creationDate:this._creationDate,isImported:this._isImported}}dispose(){this._requests.forEach(e=>e.response?.dispose()),this._onDidDispose.fire(),super.dispose()}};Vie=gEe=D([_(2,Ze),_(3,yp),_(4,be)],Vie);var XN;let pEe=(XN=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+fEe.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(lc.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(lc.Panel)?.metadata.themeIcon}},fEe=XN,XN.nextId=0,XN);pEe=fEe=D([_(2,yp)],pEe);function Jnt(n,e){if(n.baseUri&&e.baseUri){if(!(n.baseUri.scheme===e.baseUri.scheme&&n.baseUri.authority===e.baseUri.authority&&n.baseUri.path===e.baseUri.path&&n.baseUri.query===e.baseUri.query&&n.baseUri.fragment===e.baseUri.fragment))return!1}else if(n.baseUri||e.baseUri)return!1;return Io(n.isTrusted,e.isTrusted)&&n.supportHtml===e.supportHtml&&n.supportThemeIcons===e.supportThemeIcons}function qJ(n,e){const t=typeof e=="string"?e:e.value;return{value:n.value+t,isTrusted:n.isTrusted,supportThemeIcons:n.supportThemeIcons,supportHtml:n.supportHtml,baseUri:n.baseUri}}const Xnt="http://_vscodecontentref_";function Oze(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="inlineReference"){const s="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=P.parse(Xnt).with({fragment:JSON.stringify(s)}),r=`[${t.name||ui(s.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=qJ(i.content,new Xt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Xt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&Jnt(i.content,t.content)){const s=qJ(i.content,t.content);e[e.length-1]={content:s,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=qJ(i.content,new Xt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Xt(o),kind:"markdownContent"})}else e.push(t)}return e}function Szt(n){const e=[];for(const t of n){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+t.content.value,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push(t);else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;i?.kind==="markdownContent"?e[e.length-1]={content:new Xt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Xt(o),kind:"markdownContent"})}}return e}function Azt(n){const e=[];let t=n,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[s,o,r]=i,a=i.index,c=t.substring(0,a),l=c.split(` `).length-1,d=r.split(` `).length-1,h=c.lastIndexOf(` `),u=a-(h+1)+1,f=(c+r).lastIndexOf(` `),p=a+r.length-(f+1)+1;try{JSON.parse(decodeURIComponent(o)).forEach(({title:v,description:w})=>e.push({title:v,description:w,range:{startLineNumber:l+1,startColumn:u,endLineNumber:l+d+1,endColumn:p}}))}catch{}t=t.substring(0,a)+r+t.substring(a+s.length)}return{newText:t,vulnerabilities:e}}function GFe(n,e){const t=Array.from(n.matchAll(/\[([^\]]+)\]\(([^)]+)\)|[^\s\|\-]+/g)),i=t.slice(0,e),s=e>t.length?n.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,o=n.substring(0,s);return{value:o,actualWordCount:i.length===0?o.length?1:0:i.length,isFullString:s>=n.length}}function Znt(n){return GFe(n,Number.MAX_SAFE_INTEGER).actualWordCount}function ip(n){return!!n&&typeof n=="object"&&"message"in n}function As(n){return!!n&&typeof n.setVote<"u"}function XW(n){return!!n&&typeof n=="object"&&"content"in n}let mEe=class extends ${get inputPlaceholder(){return this._inputPlaceholder}get model(){return this._model}setInputPlaceholder(e){this._inputPlaceholder=e,this._onDidChange.fire({kind:"changePlaceholder"})}resetInputPlaceholder(){this._inputPlaceholder=void 0,this._onDidChange.fire({kind:"changePlaceholder"})}get sessionId(){return this._model.sessionId}get requestInProgress(){return this._model.requestInProgress}get initState(){return this._model.initState}constructor(e,t,i){super(),this._model=e,this.codeBlockModelCollection=t,this.instantiationService=i,this._onDidDisposeModel=this._register(new I),this.onDidDisposeModel=this._onDidDisposeModel.event,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._items=[],this._inputPlaceholder=void 0,e.getRequests().forEach((s,o)=>{const r=this.instantiationService.createInstance(Bze,s);this._items.push(r),this.updateCodeBlockTextModels(r),s.response&&this.onAddResponse(s.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(s=>{if(s.kind==="addRequest"){const r=this.instantiationService.createInstance(Bze,s.request);this._items.push(r),this.updateCodeBlockTextModels(r),s.request.response&&this.onAddResponse(s.request.response)}else if(s.kind==="addResponse")this.onAddResponse(s.response);else if(s.kind==="removeRequest"){const r=this._items.findIndex(c=>ip(c)&&c.id===s.requestId);r>=0&&this._items.splice(r,1);const a=s.responseId&&this._items.findIndex(c=>As(c)&&c.id===s.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof r8&&l.dispose()}}const o=s.kind==="addRequest"?{kind:"addRequest"}:s.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(o)}))}onAddResponse(e){const t=this.instantiationService.createInstance(r8,e);this._register(t.onDidChange(()=>(t.isComplete&&this.updateCodeBlockTextModels(t),this._onDidChange.fire(null)))),this._items.push(t),this.updateCodeBlockTextModels(t)}getItems(){return[...this._model.welcomeMessage?[this._model.welcomeMessage]:[],...this._items]}dispose(){super.dispose(),this._items.filter(e=>e instanceof r8).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;ip(e)?t=e.messageText:t=Szt(e.response.value).map(o=>o.content.value).join("");let i=0;const s=new Xg.Renderer;s.code=(o,r)=>(r??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:o,languageId:r}),""),Xg.parse(this.ensureFencedCodeBlocksTerminated(t),{renderer:s})}ensureFencedCodeBlocksTerminated(e){const t=e.split(` `);let i=!1;for(let s=0;se.kind==="reply")}get result(){return this._model.result}get errorDetails(){return this.result?.errorDetails}get vote(){return this._model.vote}get requestId(){return this._model.requestId}get isStale(){return this._model.isStale}get usedReferencesExpanded(){return typeof this._usedReferencesExpanded=="boolean"?this._usedReferencesExpanded:this.response.value.length===0}set usedReferencesExpanded(e){this._usedReferencesExpanded=e}get vulnerabilitiesListExpanded(){return this._vulnerabilitiesListExpanded}set vulnerabilitiesListExpanded(e){this._vulnerabilitiesListExpanded=e}get contentUpdateTimings(){return this._contentUpdateTimings}constructor(e,t,i){super(),this._model=e,this.logService=t,this.chatAgentNameService=i,this._modelChangeCount=0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.renderData=void 0,this._vulnerabilitiesListExpanded=!1,this._contentUpdateTimings=void 0,e.isComplete||(this._contentUpdateTimings={loadingStartTime:Date.now(),lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const s=Date.now(),o=Znt(e.response.asString()),r=s-this._contentUpdateTimings.loadingStartTime,a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={loadingStartTime:this._contentUpdateTimings.loadingStartTime,lastUpdateTime:s,impliedWordLoadRate:a,lastWordCount:o}}else this.logService.warn("ChatResponseViewModel#onDidChange: got model update but contentUpdateTimings is not initialized");this._modelChangeCount++,this._onDidChange.fire()}))}trace(e,t){this.logService.trace(`ChatResponseViewModel#${e}: ${t}`)}setVote(e){this._modelChangeCount++,this._model.setVote(e)}setEditApplied(e,t){this._modelChangeCount++,this._model.setEditApplied(e,t)}};r8=D([_(1,Ze),_(2,Yde)],r8);var v6;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(v6||(v6={}));var Wze;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Wze||(Wze={}));var _Ee;(function(n){n[n.FIRST=0]="FIRST",n[n.LAST=1]="LAST",n[n.NEXT=2]="NEXT",n[n.PREVIOUS=3]="PREVIOUS"})(_Ee||(_Ee={}));var Hze;(function(n){n[n.MAXIMIZE=0]="MAXIMIZE",n[n.EXPAND=1]="EXPAND",n[n.EVEN=2]="EVEN"})(Hze||(Hze={}));var Uze;(function(n){n[n.COPY_EDITORS=0]="COPY_EDITORS",n[n.MOVE_EDITORS=1]="MOVE_EDITORS"})(Uze||(Uze={}));function Vze(n){const e=n;return Qa(e?.editor)&&Qa(e?.replacement)}var gg;(function(n){n[n.CREATION_TIME=0]="CREATION_TIME",n[n.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",n[n.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(gg||(gg={}));function vEe(n){const e=n;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function w6(n){return n.getValue("workbench.editor.openSideBySideDirection")==="down"?v6.DOWN:v6.RIGHT}const wx=-1,Cw=-2,Ezt=-3;function est(n){return typeof n=="number"||vEe(n)}const xzt="vs/workbench/contrib/chat/browser/actions/chatActions",tst=Be(xzt,0,"Chat"),Dzt="workbench.action.chat.open",Ho="vs/workbench/contrib/inlineChat/common/inlineChat";var pI;(function(n){n.Empty="empty",n.OnlyEdits="onlyEdits",n.OnlyMessages="onlyMessages",n.Mixed="mixed"})(pI||(pI={}));const zze="interactiveEditor";var yS;(function(n){n.Live="live",n.Preview="preview"})(yS||(yS={}));const kzt=new Y("inlineChatHasProvider",!1,g(Ho,0,"Whether a provider for interactive editors exists")),Izt=new Y("inlineChatVisible",!1,g(Ho,1,"Whether the interactive editor input is visible")),Lzt=new Y("inlineChatFocused",!1,g(Ho,2,"Whether the interactive editor input is focused")),Tzt=new Y("inlineChatResponseFocused",!1,g(Ho,3,"Whether the interactive widget's response is focused"));new Y("inlineChatEmpty",!1,g(Ho,4,"Whether the interactive editor input is empty"));new Y("inlineChatInnerCursorFirst",!1,g(Ho,5,"Whether the cursor of the iteractive editor input is on the first line"));new Y("inlineChatInnerCursorLast",!1,g(Ho,6,"Whether the cursor of the iteractive editor input is on the last line"));const Rzt=new Y("inlineChatOuterCursorPosition","",g(Ho,9,"Whether the cursor of the outer editor is above or below the interactive editor input")),Mzt=new Y("inlineChatHasStashedSession",!1,g(Ho,10,"Whether interactive editor has kept a session for quick restore")),Nzt=new Y("inlineChatResponseTypes",pI.Empty,g(Ho,11,"What type was the responses have been receieved")),Pzt=new Y("inlineChatUserDidEdit",void 0,g(Ho,12,"Whether the user did changes ontop of the inline chat")),Fzt=new Y("inlineChatDocumentChanged",!1,g(Ho,13,"Whether the document has changed concurrently")),Ozt=new Y("inlineChatChangeHasDiff",!1,g(Ho,14,"Whether the current change supports showing a diff")),Bzt=new Y("inlineChatChangeShowsDiff",!1,g(Ho,15,"Whether the current change showing a diff"));new Y("config.inlineChat.mode",yS.Live);const Wzt="inlineChat.acceptChanges",Hzt="inlineChat.regenerate",Uzt="inlineChat.toggleDiff",Vzt=Te.for("inlineChatWidget"),zzt=Te.for("inlineChatWidget.status"),wEe=B("inlineChat.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Ho,16,"Background color of the interactive editor widget"));B("inlineChat.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,17,"Border color of the interactive editor widget"));B("inlineChat.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Ho,18,"Shadow color of the interactive editor widget"));B("inlineChat.regionHighlight",{dark:Vk,light:Vk,hcDark:Vk,hcLight:Vk},g(Ho,19,"Background highlighting of the current interactive region. Must be transparent."),!0);B("inlineChatInput.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,20,"Border color of the interactive editor input"));B("inlineChatInput.focusBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(Ho,21,"Border color of the interactive editor input when focused"));B("inlineChatInput.placeholderForeground",{dark:xj,light:xj,hcDark:xj,hcLight:xj},g(Ho,22,"Foreground color of the interactive editor input placeholder"));B("inlineChatInput.background",{dark:SE,light:SE,hcDark:SE,hcLight:SE},g(Ho,23,"Background color of the interactive editor input"));B("inlineChatDiff.inserted",{dark:Ie(m_,.5),light:Ie(m_,.5),hcDark:Ie(m_,.5),hcLight:Ie(m_,.5)},g(Ho,24,"Background color of inserted text in the interactive editor input"));const $zt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content.")),Gzt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content."));B("inlineChatDiff.removed",{dark:Ie(yE,.5),light:Ie(yE,.5),hcDark:Ie(yE,.5),hcLight:Ie(yE,.5)},g(Ho,26,"Background color of removed text in the interactive editor input"));B("editorOverviewRuler.inlineChatRemoved",{dark:Ie(yE,.6),light:Ie(yE,.8),hcDark:Ie(yE,.6),hcLight:Ie(yE,.8)},g(Ho,27,"Overview ruler marker color for inline chat removed content."));it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"interactiveEditor.editMode",migrateFn:n=>[["inlineChat.mode",{value:n}]]}]);var Mv;(function(n){n.Mode="inlineChat.mode",n.FinishOnType="inlineChat.finishOnType",n.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",n.HoldToSpeech="inlineChat.holdToSpeech",n.AccessibleDiffView="inlineChat.accessibleDiffView"})(Mv||(Mv={}));it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{[Mv.Mode]:{description:g(Ho,28,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:yS.Live,type:"string",enum:[yS.Live,yS.Preview],markdownEnumDescriptions:[g(Ho,29,"Changes are applied directly to the document, can be highlighted via inline diffs, and accepted/discarded by hunks. Ending a session will keep the changes."),g(Ho,30,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[Mv.FinishOnType]:{description:g(Ho,31,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[Mv.AcceptedOrDiscardBeforeSave]:{description:g(Ho,32,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[Mv.HoldToSpeech]:{description:g(Ho,33,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[Mv.AccessibleDiffView]:{description:g(Ho,34,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(Ho,35,"The accessible diff viewer is based screen reader mode being enabled."),g(Ho,36,"The accessible diff viewer is always enabled."),g(Ho,37,"The accessible diff viewer is never enabled.")]}}});var eT;const Z2=class Z2{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:Z2._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}trackEdits(e){const t=[];for(const i of e)t.push({range:i.range,options:Z2._options});this._decorationIds.push(...this._textModel.deltaDecorations([],t)),this._onDidChange.fire(this)}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new O(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new O(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:Z2._options})}const[i,...s]=this._decorationIds,o=this._textModel.deltaDecorations(s,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new O(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=O.plusRange(e,i):e=i)}return e}};Z2._options=jt.register({description:"inlineChat/session/wholeRange"});let bEe=Z2;class qzt{constructor(e,t,i,s,o,r,a,c,l){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=s,this.agent=o,this.session=r,this.wholeRange=a,this.hunkData=c,this.chatModel=l,this._isUnstashed=!1,this._exchange=[],this._startTime=new Date,this.textModelNAltVersion=s.getAlternativeVersionId(),this._teldata={extension:Cn.toKey(o.extensionId),startTime:this._startTime.toISOString(),endTime:this._startTime.toISOString(),edits:0,finishedByEdit:!1,rounds:"",undos:"",editMode:e,unstashed:0,acceptedHunks:0,discardedHunks:0,responseTypes:""}}addInput(e){this._lastInput=e}get lastInput(){return this._lastInput}get isUnstashed(){return this._isUnstashed}markUnstashed(){this._teldata.unstashed+=1,this._isUnstashed=!0}addExchange(e){this._isUnstashed=!1;const t=this._exchange.push(e);this._teldata.rounds+=`${t}|`}get exchanges(){return this._exchange}get lastExchange(){return this._exchange[this._exchange.length-1]}get hasChangedText(){return!this.textModel0.equalsTextBuffer(this.textModelN.getTextBuffer())}asChangedText(e){if(e.length===0)return;let t=Number.MAX_VALUE,i=Number.MIN_VALUE;for(const s of e)t=Math.min(t,s.modified.startLineNumber),i=Math.max(i,s.modified.endLineNumberExclusive);return this.textModelN.getValueInRange(new O(t,1,i,Number.MAX_VALUE))}recordExternalEditOccurred(e){this._teldata.edits+=1,this._teldata.finishedByEdit=e}asTelemetryData(){for(const e of this.hunkData.getInfo())switch(e.getState()){case zu.Accepted:this._teldata.acceptedHunks+=1;break;case zu.Rejected:this._teldata.discardedHunks+=1;break}return this._teldata.endTime=new Date().toISOString(),this._teldata}asRecording(){const e={session:this.session,when:this._startTime,exchanges:[]};for(const t of this._exchange){const i=t.response;i instanceof WI&&e.exchanges.push({prompt:t.prompt.value,res:i.raw})}return e}}class Qzt{constructor(e,t){this.request=e,this.modelAltVersionId=t,this.value=e.message.text}}class jzt{constructor(e,t){this.prompt=e,this.response=t}}class ist{}class CEe{constructor(e){this.error=e,this.message=Ma(e,!1),this.isCancellation=Na(e)}}let WI=class{constructor(e,t,i,s,o,r,a){this.raw=e,this.modelAltVersionId=i,this.chatRequest=s,this.chatResponse=o,this._textFileService=r,this._languageService=a;const c=new wi,l=_Q.convert(e.edits);for(const d of l)if(d instanceof up)d.newResource&&!d.oldResource&&(c.set(d.newResource,[]),d.options.contents&&console.warn("CONTENT not supported"));else if(d instanceof vS){const h=c.get(d.resource);h?h.push([d.textEdit]):c.set(d.resource,[[d.textEdit]])}for(const[d,h]of c){if(h.flat().length===0){c.delete(d);continue}const f=_n(d,t);if(d.scheme===_e.untitled&&!f&&!this.untitledTextModel){const p=this._languageService.createByFilepathOrFirstLine(d,void 0),m=this._textFileService.untitled.create({associatedResource:d,languageId:p.languageId});this.untitledTextModel=m,m.resolve()}}}};WI=D([_(5,tr),_(6,Di)],WI);let yEe=class{constructor(e,t,i,s,o,r){this._undoCancelEdits=i,this._sessionService=o,this._logService=r,this._ctxHasStashedSession=Mzt.bindTo(s),this._session=t,this._ctxHasStashedSession.set(!0),this._listener=T.once(T.any(e.onDidChangeCursorSelection,e.onDidChangeModelContent,e.onDidChangeModel))(()=>{this._session=void 0,this._sessionService.releaseSession(t),this._ctxHasStashedSession.reset()})}dispose(){this._listener.dispose(),this._ctxHasStashedSession.reset(),this._session&&this._sessionService.releaseSession(this._session)}unstash(){if(!this._session)return;this._listener.dispose();const e=this._session;return e.markUnstashed(),e.hunkData.ignoreTextModelNChanges=!0,e.textModelN.pushEditOperations(null,this._undoCancelEdits,()=>null),e.hunkData.ignoreTextModelNChanges=!1,this._session=void 0,this._logService.debug("[IE] Unstashed session"),e}};yEe=D([_(3,Pe),_(4,LPe),_(5,Ze)],yEe);function $ze(n,e){return n.isEmpty?new O(n.startLineNumber,1,n.startLineNumber,e.getLineLength(n.startLineNumber)):new O(n.startLineNumber,1,n.endLineNumberExclusive-1,e.getLineLength(n.endLineNumberExclusive-1))}var k0;let SEe=(k0=class{constructor(e,t,i){this._editorWorkerService=e,this._textModel0=t,this._textModelN=i,this._store=new Z,this._data=new Map,this._ignoreChanges=!1,this._store.add(i.onDidChangeContent(s=>{this._ignoreChanges||this._mirrorChanges(s)}))}dispose(){this._textModelN.isDisposed()||this._textModelN.changeDecorations(e=>{for(const{textModelNDecorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._textModel0.isDisposed()||this._textModel0.changeDecorations(e=>{for(const{textModel0Decorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._data.clear(),this._store.dispose()}set ignoreTextModelNChanges(e){this._ignoreChanges=e}get ignoreTextModelNChanges(){return this._ignoreChanges}_mirrorChanges(e){const t=[],i=[];for(const{textModelNDecorations:o,textModel0Decorations:r,state:a}of this._data.values())if(a===zu.Pending)for(let c=1;cO.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(O.compareRangesUsingStarts);const s=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(O.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(O.areIntersectingOrTouching(f,o.range)){r=!0;break}else break;if(r)continue;const c=o.rangeOffset-a,l=this._textModel0.getPositionAt(c);let d=0;for(const f of i)f.getEndPosition().isBefore(l)&&(d+=this._textModel0.getValueLengthInRange(f));const h=this._textModel0.getPositionAt(c+d),u=this._textModel0.getPositionAt(c+d+o.rangeLength);s.push(ds.replace(O.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,s,()=>null)}async recompute(e){const t=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced");if(!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew Kzt(o.original,o.modified,o.innerChanges??[]));this._textModelN.changeDecorations(o=>{this._textModel0.changeDecorations(r=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(o.removeDecoration,o),c.forEach(r.removeDecoration,r);this._data.clear();for(const a of s){const c=[],l=[];c.push(o.addDecoration($ze(a.modified,this._textModelN),eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration($ze(a.original,this._textModel0),eT._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,eT._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:zu.Pending})}})})}get size(){return this._data.size}get pending(){return fi.reduce(this._data.values(),(e,{state:t})=>e+(t===zu.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),s=e.getRanges0();for(let o=1;o(t.push(i),null)),t.flat()}getInfo(){const e=[];for(const[t,i]of this._data.entries()){const s={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return iF(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return iF(o),o},discardChanges:()=>{if(i.state===zu.Pending){const o=this._discardEdits(s);this._textModelN.pushEditOperations(null,o,()=>null),i.state=zu.Rejected}},acceptChanges:()=>{if(i.state===zu.Pending){const o=[],r=s.getRangesN(),a=s.getRanges0();for(let c=1;cnull),i.state=zu.Accepted,i.editState.applied+=1}}};e.push(s)}return e}},eT=k0,k0._HUNK_TRACKED_RANGE=jt.register({description:"inline-chat-hunk-tracked-range",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),k0._HUNK_THRESHOLD=8,k0);SEe=eT=D([_(0,kd)],SEe);class Kzt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var zu;(function(n){n[n.Pending=0]="Pending",n[n.Accepted=1]="Accepted",n[n.Rejected=2]="Rejected"})(zu||(zu={}));async function Yzt(n,e,t,i){const[s]=n.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(n.isDisposed())break;const a=n.getDecorationRange(s);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?ds.replace(a,r):ds.insert(a.getEndPosition(),r);i?.start(),n.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function Jzt(n,e,t,i){t=Math.max(30,t);const s=new M9;let o=e.text??"";n.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=GFe(o,1);s.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(n.cancel(),s.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{n.cancel(),s.resolve(),r.dispose()});return{range:e.range,newText:s.asyncIterable}}var Xzt=".interactive-result-code-block{position:relative}.interactive-result-code-block .interactive-result-code-block-toolbar{display:none}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar,.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);height:26px;line-height:26px;max-width:70%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:-13px;z-index:100}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar{left:0}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{right:10px}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .interactive-result-code-block-toolbar:focus-within,.interactive-result-code-block.focused .interactive-result-code-block-toolbar,.interactive-result-code-block:hover .interactive-result-code-block-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-item-container .value .rendered-markdown [data-code]{margin:16px 0}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-result-code-block.compare.no-diff .message{display:inherit}.interactive-result-code-block.compare .message{display:none;padding:6px}.interactive-result-code-block.compare .message A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-result-code-block.compare .message A>CODE{color:var(--vscode-textLink-foreground)}";Ct(Xzt,{});function qFe(n){return{wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden",alwaysConsumeMouseWheel:!1},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",dragAndDrop:!1,revealHorizontalRightPadding:5,minimap:{enabled:!1},guides:{indentation:!1},accessibilitySupport:n.getValue("editor.accessibilitySupport"),cursorBlinking:n.getValue("editor.cursorBlinking")}}function Zzt(){return{isSimpleWidget:!0,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,pm.ID,pc.ID,Ux.ID])}}const $u="vs/workbench/contrib/chat/browser/codeBlockPart",vv=we,e5t="vscode-local-file";function t5t(n){let e;try{e=JSON.parse(n)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=P.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new O(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const Iy=10;let AEe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.currentScrollWidth=0,this.disposableStore=this._register(new Z),this.element=vv(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=o.createChild(new Dl([Pe,this.contextKeyService])),h=he(this.element,vv(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...qFe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const u=he(this.element,vv(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=d.createChild(new Dl([Pe,f]));this.toolbar=this._register(p.createInstance(nC,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=he(this.element,vv(".interactive-result-vulns")),v=he(m,vv(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Tu(v,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0,supportIcons:!0})),this.vulnsListElement=he(m,vv("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const w=this.currentCodeBlockData.element;w.vulnerabilitiesListExpanded=!w.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!w.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(w=>{u.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.editor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),bm.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),bm.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(_1,t,i,{isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,bm.ID,WV.ID,$x.ID,RF.ID,Nc.ID,Du.ID,IF.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.editor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight();this.editor.layout({width:e-2,height:t}),this.updatePaddingForLayout()}getContentHeight(){if(this.currentCodeBlockData?.range){const e=this.currentCodeBlockData.range.endLineNumber-this.currentCodeBlockData.range.startLineNumber+1,t=this.editor.getOption(x.lineHeight);return e*t}return this.editor.getContentHeight()}async render(e,t,i){this.currentCodeBlockData=e,e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e),this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>g1.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>g1.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g($u,3,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Jl(this.toolbar.getElement()):Oh(this.toolbar.getElement()),e.vulns?.length&&As(e.element)?(Yo(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),he(this.vulnsListElement,...e.vulns.map(s=>vv("li",void 0,vv("span.chat-vuln-title",void 0,s.title)," "+s.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns")}reset(){this.clearWidgets()}clearWidgets(){Nc.get(this.editor)?.hideContentHover()}async updateEditor(e){const t=(await e.textModel).textEditorModel;this.editor.setModel(t),e.range&&(this.editor.setSelection(e.range),this.editor.revealRangeInCenter(e.range,vt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),xo.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g($u,4,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g($u,5,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?Ce.chevronDown:Ce.chevronRight)(this.currentCodeBlockData.element).id})`}};AEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur)],AEe);let EEe=class extends ${constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(_e.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};EEe=D([_(0,Rn),_(1,Ai)],EEe);let xEe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this.labelService=d,this.openerService=h,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this._lastDiffEditorViewModel=this._store.add(new Dn),this.currentScrollWidth=0,this.element=vv(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=he(this.element,vv(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=o.createChild(new Dl([Pe,this.contextKeyService])),f=he(this.element,vv(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,f,{...qFe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const p=he(this.element,vv(".interactive-result-code-block-toolbar")),m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(p),v=u.createChild(new Dl([Pe,m]));this.toolbar1=this._register(new Qh(p,{})),this.toolbar2=this._register(v.createInstance(nC,p,t,{menuOptions:{shouldForwardArgs:!0}})),this._register(this.toolbar2.onDidChangeDropdownVisibility(w=>{p.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),bm.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),bm.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const s={isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,bm.ID,WV.ID,$x.ID,RF.ID,Nc.ID,IF.ID])};return this._register(e.createInstance(xm,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g($u,6,"Original"),modifiedAriaLabel:g($u,7,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!1,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,...i},{originalEditor:s,modifiedEditor:s}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.diffEditor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar2.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight(),s={width:e-2,height:t};this.element.style.height=`${s.height}px`,this.element.style.width=`${s.width}px`,this.diffEditor.layout(s),this.updatePaddingForLayout()}getContentHeight(){return this.diffEditor.getContentHeight()}async render(e,t,i){e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e,i),this.layout(t),this.diffEditor.updateOptions({ariaLabel:g($u,8,"Code Edits")}),this.toolbar1.clear(),this.toolbar1.push(_l({label:ui(e.edit.uri),tooltip:g($u,9,"Open '{0}'",this.labelService.getUriLabel(e.edit.uri,{relative:!0})),run:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},id:""}),{icon:!1,label:!0}),e.hideToolbar?Jl(this.toolbar2.getElement()):Oh(this.toolbar2.getElement())}reset(){this.clearWidgets()}clearWidgets(){Nc.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Nc.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!As(e.element))return;const i=!!(e.edit.state?.applied??0);if(KPt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const o=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0}),r=e.edit.state.applied>1?g($u,10,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o):g($u,11,"Made 1 change in [[``{0}``]]",o),a=pNe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});_a(this.messageElement,a)}const s=await e.diffData;if(s){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:s.original,modified:s.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar2.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}};xEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur),_(9,eo),_(10,fr)],xEe);let DEe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new tV}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const o of this.editorService.listDiffEditors()){if(!o.getContainerDomNode().isConnected)continue;const r=o.getModel();if(!r||!_n(r.original.uri,t.uri)||r.modified.uri.scheme!==_e.vscodeChatCodeCompareBlock){i=o;break}}const s=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,s)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const s=e.getDiffComputationResult();if(!s||s.identical||!await this._checkSha1(i.original,t))return 0;const o=new DCe(i.modified),r=s.changes2.map(a=>a.toRangeMapping().toTextEdit(o).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,r,()=>null),i.original.pushStackElement(),r.length}async _apply(e){const t=await this.modelService.createModelReference(e.uri);try{if(!await this._checkSha1(t.object.textEditorModel,e))return 0;t.object.textEditorModel.pushStackElement();let i=0;for(const s of e.edits){const o=s.map(iMe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,o,()=>null),i+=o.length}return t.object.textEditorModel.pushStackElement(),i}finally{t.dispose()}}async _checkSha1(e,t){return!(t.state?.sha1&&this._sha1.computeSHA1(e)&&this._sha1.computeSHA1(e)!==t.state.sha1&&!(await this.dialogService.confirm({message:g($u,12,"The original file has been modified."),detail:g($u,13,"Do you want to apply the changes anyway?")})).confirmed)}};DEe=D([_(0,Rn),_(1,Qt),_(2,To)],DEe);var kEe;const eB="vs/workbench/contrib/inlineChat/browser/inlineChatStrategies";var ZN;let zie=(ZN=class{constructor(e,t,i,s,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=s,this._instaService=o,this._store=new Z,this._onDidAccept=this._store.add(new I),this._onDidDiscard=this._store.add(new I),this.onDidAccept=this._onDidAccept.event,this.onDidDiscard=this._onDidDiscard.event}dispose(){this._store.dispose()}async _doApplyChanges(e){const t=[],i=this._instaService.createInstance(DEe);for(const s of this._session.chatModel.getRequests())if(s.response?.response){for(const o of s.response.response.value)if(o.kind==="textEditGroup"&&!(e&&_n(o.uri,this._session.textModelN.uri))&&(await i.apply(s.response,o,void 0),o.uri.scheme===_e.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const s of t)s.isDisposed()||(await s.resolve(),await s.save({reason:Ln.EXPLICIT}))}cancel(){return this._session.hunkData.discardAll()}async acceptHunk(){this._onDidAccept.fire()}async discardHunk(){this._onDidDiscard.fire()}getWholeRangeDecoration(){const t=[this._session.wholeRange.value].map(i=>i.isEmpty()?void 0:{range:i,options:kEe._decoBlock});return iF(t),t}},kEe=ZN,ZN._decoBlock=jt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),ZN);zie=kEe=D([_(3,tr),_(4,be)],zie);let IEe=class extends zie{constructor(e,t,i,s,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=Fzt.bindTo(o);const c=s.getModel(e.targetUri);T.debounce(c.onDidChangeContent.bind(c),()=>{},350)(l=>{!c.isDisposed()&&!e.textModel0.isDisposed()&&this._ctxDocumentChanged.set(e.hasChangedText)},void 0,this._store)}dispose(){this._ctxDocumentChanged.reset(),super.dispose()}async apply(){await super._doApplyChanges(!1)}async makeChanges(){}async makeProgressiveChanges(){}async renderChanges(e){}hasFocus(){return this._zone.widget.hasFocus()}};IEe=D([_(3,Ai),_(4,Pe),_(5,tr),_(6,be)],IEe);let LEe=class extends zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=jt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:oh.Full,color:b2e($zt)},minimap:{position:xu.Inline,color:b2e(Gzt)}}),this._decoInsertedTextRange=jt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:gi.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=Ozt.bindTo(s),this._ctxCurrentChangeShowsDiff=Bzt.bindTo(s),this._progressiveEditingDecorations=this._editor.createDecorationsCollection()}dispose(){this._resetDiff(),super.dispose()}_resetDiff(){this._ctxCurrentChangeHasDiff.reset(),this._ctxCurrentChangeShowsDiff.reset(),this._zone.widget.updateStatus(""),this._progressiveEditingDecorations.clear();for(const e of this._hunkDisplayData.values())e.remove()}async apply(){this._resetDiff(),this._editCount>0&&this._editor.pushUndoStop(),await super._doApplyChanges(!0)}cancel(){return this._resetDiff(),super.cancel()}async makeChanges(e,t,i){return this._makeChanges(e,t,void 0,void 0,i)}async makeProgressiveChanges(e,t,i,s){const o=new cf(r=>{const a=new Set;for(const d of r)bi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(bi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new O(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,s)}async _makeChanges(e,t,i,s,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=Znt(a.text??"")/r,d=Jzt(new sQ(this._zone.domNode),a,l,i.token);await Yzt(this._session.textModelN,d,s,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(s?.report(r),null)),t.stop()}async renderChanges(e){this._progressiveEditingDecorations.clear();const t=()=>{let i;if(Dpe(this._editor,(s,o)=>{const r=new Set(this._hunkDisplayData.keys());i=void 0;for(const a of this._session.hunkData.getInfo()){r.delete(a);const c=a.getRangesN();let l=this._hunkDisplayData.get(a);if(l)if(a.getState()!==zu.Pending)l.remove();else{const d=this._zone.position.lineNumber,h=c[0];l.position=h.getStartPosition().delta(-1),l.distance=d<=h.startLineNumber?h.startLineNumber-d:d-h.endLineNumber}else{const d=[];for(let z=0;z{a.acceptChanges(),t()},u=()=>{a.discardChanges(),t()},f=this._session.textModel0.mightContainNonBasicASCII(),p=this._session.textModel0.mightContainRTL(),m=Ode.fromEditor(this._editor),v=a.getRanges0()[0],w=new rZe(bi.fromRangeInclusive(v).mapToLineArray(z=>this._session.textModel0.tokenization.getLineTokens(z)),[],f,p),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:oZe(w,m,[new DW(new O(v.startLineNumber,1,v.startLineNumber,1),"",Rc.Regular)],b).heightInLines,domNode:b},S=()=>{const z=M_.capture(this._editor);Dpe(this._editor,(U,J)=>{if(Bt(l),l.viewZoneId)J.removeZone(l.viewZoneId),l.viewZoneId=void 0;else{const[j]=a.getRangesN();y.afterLineNumber=j.startLineNumber-1,l.viewZoneId=J.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof l?.viewZoneId=="string"),z.restore(this._editor)},M=()=>{Dpe(this._editor,(z,U)=>{Bt(l);for(const J of l.decorationIds)z.removeDecoration(J);l.viewZoneId&&U.removeZone(l.viewZoneId),l.decorationIds=[],l.viewZoneId=void 0})},k=z=>{Bt(i);const U=[];for(const J of this._session.hunkData.getInfo())J.getState()===zu.Pending&&U.push(J.getRangesN()[0].getStartPosition().delta(-1));if(!(U.length<2)){for(let J=0;Ji.acceptHunk(),this.discardHunk=async()=>i.discardHunk(),this.move=r=>i.move(r)}else if(this._hunkDisplayData.size>0){let s=!1;for(const o of this._session.hunkData.getInfo())if(o.getState()===zu.Accepted){s=!0;break}s?this._onDidAccept.fire():this._onDidDiscard.fire()}return i};return t()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(Mv.AcceptedOrDiscardBeforeSave);let s;t===0?s=g(eB,0,"Nothing changed."):e===1?s=i?g(eB,1,"$(info) Accept or discard 1 change"):g(eB,2,"1 change"):s=i?g(eB,3,"$(info) Accept or Discard {0} changes",e):g(eB,4,"{0} changes",t);let o;i&&(o=g(eB,5,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(s,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};LEe=D([_(3,Pe),_(4,kd),_(5,Ur),_(6,Re),_(7,tr),_(8,be)],LEe);function Dpe(n,e){n.changeDecorations(t=>{n.changeViewZones(i=>{e(t,i)})})}var i5t=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.monaco-workbench .zone-widget-container.inside-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat{background:var(--vscode-inlineChat-background);border:1px solid var(--vscode-inlineChat-border);border-radius:4px;box-shadow:0 2px 4px 0 var(--vscode-widget-shadow);color:inherit;margin-top:8px;padding:0 8px 8px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-input-and-execute-toolbar{border-radius:2px;width:100%}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list{padding:4px 0 0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact{gap:6px;padding:6px 4px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .header .avatar{outline-offset:-1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .progress{position:relative}.monaco-workbench .part.editor>.content .inline-chat .progress .monaco-progress-container{top:0}.monaco-workbench .inline-chat .status{align-items:center;display:flex;justify-content:space-between;margin-top:3px}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:12px;overflow:hidden}.monaco-workbench .inline-chat .status .label.info{margin-right:auto;padding-left:2px}.monaco-workbench .inline-chat .status .label.status{margin-left:auto}.monaco-workbench .inline-chat .status .label.hidden{display:none}.monaco-workbench .inline-chat .status .label.error{color:var(--vscode-errorForeground)}.monaco-workbench .inline-chat .status .label.warn{color:var(--vscode-editorWarning-foreground)}.monaco-workbench .inline-chat .status .label>.codicon{font-size:12px;line-height:18px;padding:0 5px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent .value{overflow:hidden;-webkit-user-select:text;user-select:text}.monaco-workbench .inline-chat .followUps{padding:5px}.monaco-workbench .inline-chat .followUps .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.monaco-workbench .inline-chat .followUps.hidden{display:none}.monaco-workbench .inline-chat .chatMessage{padding:0 3px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent{padding:2px}.monaco-workbench .inline-chat .chatMessage.hidden{display:none}.monaco-workbench .inline-chat .status .actions{display:flex;padding-top:3px}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:6px}.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown>.monaco-dropdown-button{align-items:center;display:flex;padding:0 4px}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon{display:flex}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon:before{align-self:center}.monaco-workbench .inline-chat .status .actions .monaco-text-button{padding:2px 4px;white-space:nowrap}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item{padding:0 2px}.monaco-workbench .inline-chat .status .monaco-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item.button-item .action-label:is(:hover,:focus){background-color:var(--vscode-button-hoverBackground)}.monaco-workbench .inline-chat .preview{display:none}.monaco-workbench .inline-chat .previewCreate,.monaco-workbench .inline-chat .previewDiff{border:1px solid var(--vscode-inlineChat-border);border-radius:2px;display:inherit;margin:6px 0}.monaco-workbench .inline-chat .previewCreateTitle{padding-top:6px}.monaco-workbench .inline-chat .diff-review.hidden,.monaco-workbench .inline-chat .previewCreate.hidden,.monaco-workbench .inline-chat .previewCreateTitle.hidden,.monaco-workbench .inline-chat .previewDiff.hidden{display:none}.monaco-workbench .inline-chat-toolbar{display:flex}.monaco-workbench .inline-chat-toolbar>.monaco-button{margin-right:6px}.monaco-workbench .inline-chat-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat-inserted-range{background-color:var(--vscode-inlineChatDiff-inserted)}.monaco-workbench .inline-chat-inserted-range-linehighlight{background-color:var(--vscode-diffEditor-insertedLineBackground)}.monaco-workbench .inline-chat-original-zone2{background-color:var(--vscode-diffEditor-removedLineBackground);opacity:.8}.monaco-workbench .inline-chat-lines-inserted-range{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .inline-chat-block-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .interactive-session .interactive-input-and-execute-toolbar .monaco-editor .inline-chat-slash-command{background-color:var(--vscode-chat-slashCommandBackground);border-radius:2px;color:var(--vscode-chat-slashCommandForeground);padding:1px}.monaco-workbench .inline-chat-slash-command-detail{opacity:.5}.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-editor-background,.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-workbench .margin-view-overlays,.monaco-workbench .inline-chat-newfile-widget{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat-newfile-widget .title{align-items:center;display:flex;justify-content:space-between}.monaco-workbench .inline-chat-newfile-widget .title .detail{margin-left:4px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget{display:flex;margin-left:auto;margin-right:8px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget>.monaco-button{display:inline-flex;margin-left:4px;white-space:nowrap}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{cursor:pointer;display:block;transition:opacity .2s ease-in-out}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque{opacity:.5}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{opacity:0}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque:hover,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent:hover{opacity:1}";Ct(i5t,{});const n5t="vs/platform/actions/browser/buttonbar";let TEe=class extends dkt{constructor(e,t,i,s,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=s,this._hoverService=r,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new gw),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{o.publicLog2("workbenchActionExecuted",{id:a.action.id,from:t.telemetrySource})},void 0,this._store)}dispose(){this._onDidChange.dispose(),this._updateStore.dispose(),this._store.dispose(),super.dispose()}update(e){const t=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const i=this._updateStore.add(C1());for(let s=0;s0,r=e[s];let a,c;if(r instanceof u1&&r.actions.length>0){const[h,...u]=r.actions;a=h,c=this.addButtonWithDropdown({secondary:t(a)?.isSecondary??o,actionRunner:this._actionRunner,actions:u,contextMenuProvider:this._contextMenuService,ariaLabel:a.label})}else a=r,c=this.addButton({secondary:t(a)?.isSecondary??o,ariaLabel:a.label});c.enabled=a.enabled,c.element.classList.add("default-colors"),t(a)?.showLabel??!0?c.label=a.label:c.element.classList.add("monaco-text-button"),t(a)?.showIcon&&(a instanceof id&&$e.isThemeIcon(a.item.icon)?c.icon=a.item.icon:a.class&&c.element.classList.add(...a.class.split(" ")));const l=this._keybindingService.lookupKeybinding(a.id);let d;l?d=g(n5t,0,"{0} ({1})",a.label,l.getLabel()):d=a.label,this._updateStore.add(this._hoverService.setupUpdatableHover(i,c.element,d)),this._updateStore.add(c.onDidClick(async()=>{this._actionRunner.run(a)}))}this._onDidChange.fire(this)}};TEe=D([_(2,Vr),_(3,ti),_(4,on),_(5,Zc)],TEe);let REe=class extends TEe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,r,a,c,l);const d=s.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=d.getActions({renderShortTitle:!0}).flatMap(f=>f[1]);super.update(u)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};REe=D([_(3,mc),_(4,Pe),_(5,Vr),_(6,ti),_(7,on),_(8,Zc)],REe);var s5t='.interactive-session{margin:auto;max-width:850px}.interactive-list>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row>.monaco-tl-row>.monaco-tl-twistie{display:none!important}.interactive-item-container{color:var(--vscode-interactive-session-foreground);cursor:default;display:flex;flex-direction:column;gap:8px;padding:16px 20px;user-select:text;-webkit-user-select:text}.interactive-item-container .header{align-items:center;display:flex;justify-content:space-between;position:relative}.interactive-item-container .header.hidden{display:none}.interactive-item-container .header .user{align-items:center;display:flex;gap:8px}.interactive-item-container .header .username{font-size:13px;font-weight:600;margin:0}.interactive-item-container .header .detail-container{color:var(--vscode-descriptionForeground);font-size:12px}.interactive-item-container .header .detail-container .detail .agentOrSlashCommandDetected A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-item-container .chat-animated-ellipsis{display:inline-block;width:11px}.interactive-item-container:not(.show-detail-progress) .chat-animated-ellipsis{display:none}@keyframes ellipsis{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}.interactive-item-container .chat-animated-ellipsis:after{animation:ellipsis 1s steps(4) infinite;content:"";overflow:hidden;white-space:nowrap;width:3em}.interactive-item-container .header .avatar-container{display:flex;pointer-events:none;user-select:none}.interactive-item-container .header .avatar{align-items:center;border-radius:50%;display:flex;height:24px;justify-content:center;outline:1px solid var(--vscode-chat-requestBorder);width:24px}.interactive-item-container .header .avatar.codicon-avatar{background:var(--vscode-chat-avatarBackground)}.interactive-item-container .header .avatar+.avatar{margin-left:-8px}.interactive-item-container .header .avatar .icon{background-color:var(--vscode-chat-list-background);border-radius:50%;height:24px;width:24px}.interactive-item-container .header .avatar .codicon{color:var(--vscode-chat-avatarForeground)!important;font-size:14px}.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label{display:none}.interactive-item-container .header .monaco-toolbar .monaco-action-bar .actions-container{gap:4px}.interactive-item-container .header .monaco-toolbar .action-label{border:1px solid transparent;padding:2px}.interactive-item-container .header .monaco-toolbar{background-color:var(--vscode-chat-list-background);position:absolute;right:0}.interactive-item-container.interactive-request .header .monaco-toolbar{background-color:inherit}.interactive-item-container .header .monaco-toolbar .checked.action-label,.interactive-item-container .header .monaco-toolbar .checked.action-label:hover{background-color:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);color:var(--vscode-inputOption-activeForeground)!important}.interactive-item-container .value{width:100%}.interactive-item-container .chat-progress-task{padding-bottom:8px}.interactive-item-container .value .rendered-markdown table{margin-bottom:16px;text-align:left;width:100%}.interactive-item-container .value .rendered-markdown table,.interactive-item-container .value .rendered-markdown table td,.interactive-item-container .value .rendered-markdown table th{border:1px solid var(--vscode-chat-requestBorder);border-collapse:collapse;padding:4px 6px}.interactive-item-container .value .interactive-session-followups,.interactive-item-container .value .rendered-markdown a,.interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textLink-foreground)}.interactive-item-container .value .rendered-markdown a:active,.interactive-item-container .value .rendered-markdown a:hover{color:var(--vscode-textLink-activeForeground)}.hc-black .interactive-item-container .value .rendered-markdown a code,.hc-light .interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textPreformat-foreground)}.interactive-list{overflow:hidden}.interactive-request{border-bottom:1px solid var(--vscode-chat-requestBorder);border-top:1px solid var(--vscode-chat-requestBorder)}.hc-black .interactive-request,.hc-light .interactive-request{border-left:3px solid var(--vscode-chat-requestBorder);border-right:3px solid var(--vscode-chat-requestBorder)}.interactive-item-container .value{overflow-wrap:anywhere;white-space:normal}.interactive-item-container .value>:last-child.rendered-markdown>:last-child{margin-bottom:0}.interactive-item-container .value .rendered-markdown h1{font-size:20px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h2{font-size:16px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h3{font-size:14px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown p{line-height:1.5em}.interactive-item-container .value>.rendered-markdown p{margin:0 0 16px}.interactive-item-container .value>.rendered-markdown li>p{margin:0}.interactive-item-container .value .rendered-markdown ul{padding-inline-start:24px}.interactive-item-container .value .rendered-markdown ol{padding-inline-start:28px}.interactive-item-container .value .rendered-markdown li{line-height:1.3rem}.interactive-item-container .value .rendered-markdown img{max-width:100%}.interactive-item-container .monaco-tokenized-source,.interactive-item-container code{background-color:var(--vscode-textPreformat-background);border-radius:4px;color:var(--vscode-textPreformat-foreground);font-family:var(--monaco-monospace-font);font-size:12px;padding:1px 3px}.interactive-item-container.interactive-item-compact{padding:8px 20px}.interactive-item-container.interactive-item-compact.no-padding{gap:unset;padding:unset}.interactive-item-container.interactive-item-compact .header{height:16px}.interactive-item-container.interactive-item-compact .header .avatar{height:18px;width:18px}.interactive-item-container.interactive-item-compact .header .avatar .icon{height:16px;width:16px}.interactive-item-container.interactive-item-compact .header .codicon-avatar .codicon{font-size:12px}.interactive-item-container.interactive-item-compact .header .avatar+.avatar{margin-left:-4px}.interactive-item-container.interactive-item-compact .value{min-height:0}.interactive-item-container.interactive-item-compact .value>.rendered-markdown p{margin:0 0 8px}.interactive-item-container.interactive-item-compact .value>.rendered-markdown li>p{margin:0}.interactive-item-container.interactive-item-compact .value .rendered-markdown h1,.interactive-item-container.interactive-item-compact .value .rendered-markdown h2,.interactive-item-container.interactive-item-compact .value .rendered-markdown h3{margin:8px 0}.interactive-session .interactive-input-and-execute-toolbar{align-items:flex-end;background-color:var(--vscode-input-background);border:1px solid var(--vscode-input-border,transparent);border-radius:4px;box-sizing:border-box;cursor:text;display:flex;justify-content:space-between;margin-bottom:4px;padding:0 6px;position:relative}.interactive-session .interactive-input-part.compact .interactive-input-and-execute-toolbar{border-radius:2px;margin-bottom:0}.interactive-session .interactive-input-and-side-toolbar{align-items:center;display:flex;gap:4px}.interactive-session .interactive-input-and-execute-toolbar.focused{border-color:var(--vscode-focusBorder)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .mtk1{color:var(--vscode-input-foreground)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor,.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .monaco-editor-background{background-color:var(--vscode-input-background)!important}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .cursors-layer{padding-left:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar{height:22px;margin-bottom:7px}.interactive-session .interactive-input-part .interactive-execute-toolbar .monaco-action-bar .actions-container{display:flex;gap:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar .codicon-debug-stop{color:var(--vscode-icon-foreground)!important}.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .margin,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .monaco-editor-background{background-color:var(--vscode-interactive-result-editor-background-color)!important}.interactive-item-compact .interactive-result-code-block{margin:0 0 8px}.interactive-item-container .interactive-result-code-block .monaco-toolbar .monaco-action-bar .actions-container{padding-inline-start:unset}.chat-notification-widget .chat-error-codicon,.chat-notification-widget .chat-info-codicon,.chat-notification-widget .chat-warning-codicon{align-items:start;display:flex;gap:8px}.interactive-item-container .value .chat-notification-widget .rendered-markdown p{margin:0}.interactive-response .interactive-response-error-details{align-items:start;display:flex;gap:6px}.interactive-response .interactive-response-error-details .rendered-markdown :last-child{margin-bottom:0}.chat-notification-widget .chat-error-codicon .codicon,.chat-notification-widget .chat-info-codicon .codicon,.chat-notification-widget .chat-warning-codicon .codicon{margin-top:2px}.interactive-response .interactive-response-error-details .codicon{margin-top:1px}.chat-used-context-list .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-used-context-list .monaco-icon-label-container{color:var(--vscode-interactive-session-foreground)}.chat-notification-widget .chat-warning-codicon .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.chat-notification-widget .chat-error-codicon .codicon-error,.interactive-response .interactive-response-error-details .codicon-error{color:var(--vscode-errorForeground)!important}.chat-notification-widget .chat-info-codicon .codicon-info,.interactive-response .interactive-response-error-details .codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}.interactive-session .interactive-input-part{display:flex;flex-direction:column;margin:0 20px;padding:12px 0}.interactive-session .interactive-input-part.compact{margin:0;padding:8px 0 0}.interactive-session .chat-attached-context .chat-attached-context-attachment{display:flex;gap:4px}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button:hover{cursor:pointer}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button{align-items:center;display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container{display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container .monaco-highlighted-label{align-items:center!important;display:flex!important}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button.codicon.codicon-close,.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .monaco-button.codicon.codicon-close{color:var(--vscode-descriptionForeground)}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .codicon{padding-left:4px}.interactive-session .chat-attached-context{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 8px}.interactive-session .chat-attached-context .chat-attached-context-attachment{border:1px solid var(--vscode-chat-requestBorder,var(--vscode-input-background,transparent));border-radius:4px;height:18px;max-width:100%;padding:2px}.interactive-session-followups{align-items:start;display:flex;flex-direction:column;gap:6px}.interactive-session-followups .monaco-button{text-align:left;width:auto}.interactive-session-followups .monaco-button .codicon{margin-left:0;margin-top:1px}.interactive-item-container .interactive-response-followups .monaco-button{padding:4px 8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups{margin-bottom:8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups code{font-family:var(--monaco-monospace-font);font-size:11px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button .codicon-sparkle{float:left}.interactive-session-followups .monaco-button.interactive-followup-reply{border:none;padding:0}.interactive-welcome .value .interactive-session-followups{margin-bottom:16px}.interactive-item-container .monaco-toolbar .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container.filtered-response .value>.rendered-markdown{-webkit-mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);pointer-events:none}.quick-input-widget .interactive-session .interactive-input-part{margin:0 3px;padding:8px 6px 6px}.quick-input-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar{border-radius:2px;margin:0;padding:0 4px 0 6px}.quick-input-widget .interactive-list{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.quick-input-widget .interactive-response{min-height:86px}.interactive-response-progress-tree .monaco-list-row:not(.selected) .monaco-tl-row:hover{background-color:var(--vscode-list-hoverBackground)}.interactive-response-progress-tree{margin:16px 0}.interactive-response-progress-tree.focused{border-color:var(--vscode-focusBorder,transparent)}.interactive-item-container .value .interactive-response-placeholder-codicon .codicon{color:var(--vscode-editorGhostText-foreground)}.interactive-item-container .value .interactive-response-placeholder-content{color:var(--vscode-editorGhostText-foreground);font-size:12px;margin-bottom:16px}.interactive-item-container .value .interactive-response-placeholder-content p{margin:0}.interactive-response .interactive-response-codicon-details{align-items:start;display:flex;gap:6px}.chat-used-context-list .monaco-list{border:none;border-radius:4px;width:auto}.interactive-item-container .chat-resource-widget{background-color:var(--vscode-chat-slashCommandBackground);color:var(--vscode-chat-slashCommandForeground)}.interactive-item-container .chat-agent-widget .monaco-button,.interactive-item-container .chat-resource-widget{border-radius:4px;padding:1px 3px}.interactive-item-container .chat-agent-widget .monaco-text-button{border:none;display:inline}.interactive-session .chat-used-context.chat-used-context-collapsed .chat-used-context-list{display:none}.interactive-session .chat-used-context{display:flex;flex-direction:column;gap:2px}.interactive-item-container .chat-notification-widget,.interactive-response-progress-tree,.interactive-session .chat-used-context-list{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:8px;padding:6px 8px}.interactive-item-container .chat-notification-widget{padding:8px 12px}.interactive-session .chat-used-context-list .monaco-list .monaco-list-row{border-radius:2px}.interactive-session .chat-used-context-label{color:var(--vscode-descriptionForeground);font-size:12px;user-select:none}.interactive-session .chat-used-context-label:hover{opacity:unset}.interactive-session .chat-used-context-label .monaco-button{border:none;border-radius:4px;display:inline-flex;gap:4px;justify-content:normal;padding:4px 8px 4px 0;text-align:initial;width:100%}.interactive-session .chat-used-context-label .monaco-button:hover{background-color:var(--vscode-list-hoverBackground);color:var(--vscode-foreground)}.interactive-session .chat-used-context-label .monaco-text-button:focus{outline:none}.interactive-session .chat-used-context-label .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-session .chat-used-context .chat-used-context-label .monaco-button .codicon{margin:0 0 0 4px}.interactive-item-container .rendered-markdown.progress-step{display:flex;margin-left:4px;white-space:normal}.interactive-item-container .rendered-markdown.progress-step>p{align-items:center;color:var(--vscode-descriptionForeground);display:flex;font-size:12px;gap:8px;margin-bottom:6px}.interactive-item-container .rendered-markdown.progress-step>p .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container .rendered-markdown.progress-step>p .codicon.codicon-check{color:var(--vscode-debugIcon-startForeground)!important}.interactive-item-container .chat-command-button{display:flex;margin-bottom:16px}.interactive-item-container .chat-notification-widget{display:flex;flex-direction:row;gap:6px}.chat-confirmation-widget .chat-confirmation-buttons-container .monaco-button,.interactive-item-container .chat-command-button .monaco-button{padding:4px 8px;text-align:left;width:auto}.interactive-item-container .chat-command-button .monaco-button .codicon{margin-left:0;margin-top:1px}';Ct(s5t,{});var o5t=".chat-agent-hover{line-height:unset;padding:6px 0}.chat-agent-hover-header{display:flex;gap:8px;margin-bottom:4px}.chat-agent-hover-icon .codicon,.chat-agent-hover-icon img{border-radius:50%;height:32px;outline:1px solid var(--vscode-chat-requestBorder);width:32px}.monaco-hover .markdown-hover .hover-contents .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.monaco-hover .chat-agent-hover .chat-agent-hover-publisher .codicon.codicon-extensions-verified-publisher{color:var(--vscode-extensionIcon-verifiedForeground)}.chat-agent-hover .extension-verified-publisher{display:none}.chat-agent-hover.verifiedPublisher .extension-verified-publisher{display:flex}.chat-agent-hover .chat-agent-hover-warning .codicon{color:var(--vscode-notificationsWarningIcon-foreground)!important;margin-right:3px}.chat-agent-hover.allowedName .chat-agent-hover-warning{display:none}.chat-agent-hover-header .chat-agent-hover-name{font-size:14px;font-weight:600}.chat-agent-hover-extension{color:var(--vscode-descriptionForeground);display:flex;gap:6px}.chat-agent-hover.noExtensionName .chat-agent-hover-extension-name,.chat-agent-hover.noExtensionName .chat-agent-hover-separator{display:none}.chat-agent-hover-separator{opacity:.7}.chat-agent-hover-description,.chat-agent-hover-warning{font-size:13px}";Ct(o5t,{});const uA="vs/workbench/contrib/chat/browser/chatAccessibilityProvider";let MEe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(uA,0,"Chat")}getAriaLabel(e){return ip(e)?e.messageText:As(e)?this._getLabelWithCodeBlockCount(e):XW(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` +`)}};mEe=D([_(2,be)],mEe);class Bze{get id(){return this._model.id}get dataId(){return this.id+`_${Vf[this._model.session.initState]}`}get sessionId(){return this._model.session.sessionId}get username(){return this._model.username}get avatarIcon(){return this._model.avatarIconUri}get message(){return this._model.message}get messageText(){return this.message.text}get attempt(){return this._model.attempt}constructor(e){this._model=e}}let r8=class extends ${get model(){return this._model}get id(){return this._model.id}get dataId(){return this._model.id+`_${this._modelChangeCount}_${Vf[this._model.session.initState]}`}get sessionId(){return this._model.session.sessionId}get username(){return this.agent?this.chatAgentNameService.getAgentNameRestriction(this.agent)?this.agent.fullName||this.agent.name:Nhe(this.agent):this._model.username}get avatarIcon(){return this._model.avatarIcon}get agent(){return this._model.agent}get slashCommand(){return this._model.slashCommand}get agentOrSlashCommandDetected(){return this._model.agentOrSlashCommandDetected}get response(){return this._model.response}get usedContext(){return this._model.usedContext}get contentReferences(){return this._model.contentReferences}get progressMessages(){return this._model.progressMessages}get isComplete(){return this._model.isComplete}get isCanceled(){return this._model.isCanceled}get replyFollowups(){return this._model.followups?.filter(e=>e.kind==="reply")}get result(){return this._model.result}get errorDetails(){return this.result?.errorDetails}get vote(){return this._model.vote}get requestId(){return this._model.requestId}get isStale(){return this._model.isStale}get usedReferencesExpanded(){return typeof this._usedReferencesExpanded=="boolean"?this._usedReferencesExpanded:this.response.value.length===0}set usedReferencesExpanded(e){this._usedReferencesExpanded=e}get vulnerabilitiesListExpanded(){return this._vulnerabilitiesListExpanded}set vulnerabilitiesListExpanded(e){this._vulnerabilitiesListExpanded=e}get contentUpdateTimings(){return this._contentUpdateTimings}constructor(e,t,i){super(),this._model=e,this.logService=t,this.chatAgentNameService=i,this._modelChangeCount=0,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.renderData=void 0,this._vulnerabilitiesListExpanded=!1,this._contentUpdateTimings=void 0,e.isComplete||(this._contentUpdateTimings={loadingStartTime:Date.now(),lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const s=Date.now(),o=Znt(e.response.asString()),r=s-this._contentUpdateTimings.loadingStartTime,a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={loadingStartTime:this._contentUpdateTimings.loadingStartTime,lastUpdateTime:s,impliedWordLoadRate:a,lastWordCount:o}}else this.logService.warn("ChatResponseViewModel#onDidChange: got model update but contentUpdateTimings is not initialized");this._modelChangeCount++,this._onDidChange.fire()}))}trace(e,t){this.logService.trace(`ChatResponseViewModel#${e}: ${t}`)}setVote(e){this._modelChangeCount++,this._model.setVote(e)}setEditApplied(e,t){this._modelChangeCount++,this._model.setEditApplied(e,t)}};r8=D([_(1,Ze),_(2,Yde)],r8);var v6;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(v6||(v6={}));var Wze;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Wze||(Wze={}));var _Ee;(function(n){n[n.FIRST=0]="FIRST",n[n.LAST=1]="LAST",n[n.NEXT=2]="NEXT",n[n.PREVIOUS=3]="PREVIOUS"})(_Ee||(_Ee={}));var Hze;(function(n){n[n.MAXIMIZE=0]="MAXIMIZE",n[n.EXPAND=1]="EXPAND",n[n.EVEN=2]="EVEN"})(Hze||(Hze={}));var Uze;(function(n){n[n.COPY_EDITORS=0]="COPY_EDITORS",n[n.MOVE_EDITORS=1]="MOVE_EDITORS"})(Uze||(Uze={}));function Vze(n){const e=n;return Qa(e?.editor)&&Qa(e?.replacement)}var gg;(function(n){n[n.CREATION_TIME=0]="CREATION_TIME",n[n.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",n[n.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(gg||(gg={}));function vEe(n){const e=n;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function w6(n){return n.getValue("workbench.editor.openSideBySideDirection")==="down"?v6.DOWN:v6.RIGHT}const wx=-1,Cw=-2,Ezt=-3;function est(n){return typeof n=="number"||vEe(n)}const xzt="vs/workbench/contrib/chat/browser/actions/chatActions",tst=Be(xzt,0,"Chat"),Dzt="workbench.action.chat.open",Ho="vs/workbench/contrib/inlineChat/common/inlineChat";var pI;(function(n){n.Empty="empty",n.OnlyEdits="onlyEdits",n.OnlyMessages="onlyMessages",n.Mixed="mixed"})(pI||(pI={}));const zze="interactiveEditor";var yS;(function(n){n.Live="live",n.Preview="preview"})(yS||(yS={}));const kzt=new Y("inlineChatHasProvider",!1,g(Ho,0,"Whether a provider for interactive editors exists")),Izt=new Y("inlineChatVisible",!1,g(Ho,1,"Whether the interactive editor input is visible")),Lzt=new Y("inlineChatFocused",!1,g(Ho,2,"Whether the interactive editor input is focused")),Tzt=new Y("inlineChatResponseFocused",!1,g(Ho,3,"Whether the interactive widget's response is focused"));new Y("inlineChatEmpty",!1,g(Ho,4,"Whether the interactive editor input is empty"));new Y("inlineChatInnerCursorFirst",!1,g(Ho,5,"Whether the cursor of the iteractive editor input is on the first line"));new Y("inlineChatInnerCursorLast",!1,g(Ho,6,"Whether the cursor of the iteractive editor input is on the last line"));const Rzt=new Y("inlineChatOuterCursorPosition","",g(Ho,9,"Whether the cursor of the outer editor is above or below the interactive editor input")),Mzt=new Y("inlineChatHasStashedSession",!1,g(Ho,10,"Whether interactive editor has kept a session for quick restore")),Nzt=new Y("inlineChatResponseTypes",pI.Empty,g(Ho,11,"What type was the responses have been receieved")),Pzt=new Y("inlineChatUserDidEdit",void 0,g(Ho,12,"Whether the user did changes ontop of the inline chat")),Fzt=new Y("inlineChatDocumentChanged",!1,g(Ho,13,"Whether the document has changed concurrently")),Ozt=new Y("inlineChatChangeHasDiff",!1,g(Ho,14,"Whether the current change supports showing a diff")),Bzt=new Y("inlineChatChangeShowsDiff",!1,g(Ho,15,"Whether the current change showing a diff"));new Y("config.inlineChat.mode",yS.Live);const Wzt="inlineChat.acceptChanges",Hzt="inlineChat.regenerate",Uzt="inlineChat.toggleDiff",Vzt=Te.for("inlineChatWidget"),zzt=Te.for("inlineChatWidget.status"),wEe=B("inlineChat.background",{dark:Zs,light:Zs,hcDark:Zs,hcLight:Zs},g(Ho,16,"Background color of the interactive editor widget"));B("inlineChat.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,17,"Border color of the interactive editor widget"));B("inlineChat.shadow",{dark:__,light:__,hcDark:__,hcLight:__},g(Ho,18,"Shadow color of the interactive editor widget"));B("inlineChat.regionHighlight",{dark:Vk,light:Vk,hcDark:Vk,hcLight:Vk},g(Ho,19,"Background highlighting of the current interactive region. Must be transparent."),!0);B("inlineChatInput.border",{dark:sg,light:sg,hcDark:sg,hcLight:sg},g(Ho,20,"Border color of the interactive editor input"));B("inlineChatInput.focusBorder",{dark:Zd,light:Zd,hcDark:Zd,hcLight:Zd},g(Ho,21,"Border color of the interactive editor input when focused"));B("inlineChatInput.placeholderForeground",{dark:xj,light:xj,hcDark:xj,hcLight:xj},g(Ho,22,"Foreground color of the interactive editor input placeholder"));B("inlineChatInput.background",{dark:SE,light:SE,hcDark:SE,hcLight:SE},g(Ho,23,"Background color of the interactive editor input"));B("inlineChatDiff.inserted",{dark:Ie(m_,.5),light:Ie(m_,.5),hcDark:Ie(m_,.5),hcLight:Ie(m_,.5)},g(Ho,24,"Background color of inserted text in the interactive editor input"));const $zt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content.")),Gzt=B("editorOverviewRuler.inlineChatInserted",{dark:Ie(m_,.6),light:Ie(m_,.8),hcDark:Ie(m_,.6),hcLight:Ie(m_,.8)},g(Ho,25,"Overview ruler marker color for inline chat inserted content."));B("inlineChatDiff.removed",{dark:Ie(yE,.5),light:Ie(yE,.5),hcDark:Ie(yE,.5),hcLight:Ie(yE,.5)},g(Ho,26,"Background color of removed text in the interactive editor input"));B("editorOverviewRuler.inlineChatRemoved",{dark:Ie(yE,.6),light:Ie(yE,.8),hcDark:Ie(yE,.6),hcLight:Ie(yE,.8)},g(Ho,27,"Overview ruler marker color for inline chat removed content."));it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"interactiveEditor.editMode",migrateFn:n=>[["inlineChat.mode",{value:n}]]}]);var Mv;(function(n){n.Mode="inlineChat.mode",n.FinishOnType="inlineChat.finishOnType",n.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",n.HoldToSpeech="inlineChat.holdToSpeech",n.AccessibleDiffView="inlineChat.accessibleDiffView"})(Mv||(Mv={}));it.as(Cs.Configuration).registerConfiguration({id:"editor",properties:{[Mv.Mode]:{description:g(Ho,28,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:yS.Live,type:"string",enum:[yS.Live,yS.Preview],markdownEnumDescriptions:[g(Ho,29,"Changes are applied directly to the document, can be highlighted via inline diffs, and accepted/discarded by hunks. Ending a session will keep the changes."),g(Ho,30,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[Mv.FinishOnType]:{description:g(Ho,31,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[Mv.AcceptedOrDiscardBeforeSave]:{description:g(Ho,32,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[Mv.HoldToSpeech]:{description:g(Ho,33,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[Mv.AccessibleDiffView]:{description:g(Ho,34,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(Ho,35,"The accessible diff viewer is based screen reader mode being enabled."),g(Ho,36,"The accessible diff viewer is always enabled."),g(Ho,37,"The accessible diff viewer is never enabled.")]}}});var eT;const Z2=class Z2{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:Z2._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}trackEdits(e){const t=[];for(const i of e)t.push({range:i.range,options:Z2._options});this._decorationIds.push(...this._textModel.deltaDecorations([],t)),this._onDidChange.fire(this)}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new O(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new O(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:Z2._options})}const[i,...s]=this._decorationIds,o=this._textModel.deltaDecorations(s,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new O(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=O.plusRange(e,i):e=i)}return e}};Z2._options=Kt.register({description:"inlineChat/session/wholeRange"});let bEe=Z2;class qzt{constructor(e,t,i,s,o,r,a,c,l){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=s,this.agent=o,this.session=r,this.wholeRange=a,this.hunkData=c,this.chatModel=l,this._isUnstashed=!1,this._exchange=[],this._startTime=new Date,this.textModelNAltVersion=s.getAlternativeVersionId(),this._teldata={extension:Cn.toKey(o.extensionId),startTime:this._startTime.toISOString(),endTime:this._startTime.toISOString(),edits:0,finishedByEdit:!1,rounds:"",undos:"",editMode:e,unstashed:0,acceptedHunks:0,discardedHunks:0,responseTypes:""}}addInput(e){this._lastInput=e}get lastInput(){return this._lastInput}get isUnstashed(){return this._isUnstashed}markUnstashed(){this._teldata.unstashed+=1,this._isUnstashed=!0}addExchange(e){this._isUnstashed=!1;const t=this._exchange.push(e);this._teldata.rounds+=`${t}|`}get exchanges(){return this._exchange}get lastExchange(){return this._exchange[this._exchange.length-1]}get hasChangedText(){return!this.textModel0.equalsTextBuffer(this.textModelN.getTextBuffer())}asChangedText(e){if(e.length===0)return;let t=Number.MAX_VALUE,i=Number.MIN_VALUE;for(const s of e)t=Math.min(t,s.modified.startLineNumber),i=Math.max(i,s.modified.endLineNumberExclusive);return this.textModelN.getValueInRange(new O(t,1,i,Number.MAX_VALUE))}recordExternalEditOccurred(e){this._teldata.edits+=1,this._teldata.finishedByEdit=e}asTelemetryData(){for(const e of this.hunkData.getInfo())switch(e.getState()){case zu.Accepted:this._teldata.acceptedHunks+=1;break;case zu.Rejected:this._teldata.discardedHunks+=1;break}return this._teldata.endTime=new Date().toISOString(),this._teldata}asRecording(){const e={session:this.session,when:this._startTime,exchanges:[]};for(const t of this._exchange){const i=t.response;i instanceof WI&&e.exchanges.push({prompt:t.prompt.value,res:i.raw})}return e}}class Qzt{constructor(e,t){this.request=e,this.modelAltVersionId=t,this.value=e.message.text}}class jzt{constructor(e,t){this.prompt=e,this.response=t}}class ist{}class CEe{constructor(e){this.error=e,this.message=Ma(e,!1),this.isCancellation=Na(e)}}let WI=class{constructor(e,t,i,s,o,r,a){this.raw=e,this.modelAltVersionId=i,this.chatRequest=s,this.chatResponse=o,this._textFileService=r,this._languageService=a;const c=new wi,l=_Q.convert(e.edits);for(const d of l)if(d instanceof up)d.newResource&&!d.oldResource&&(c.set(d.newResource,[]),d.options.contents&&console.warn("CONTENT not supported"));else if(d instanceof vS){const h=c.get(d.resource);h?h.push([d.textEdit]):c.set(d.resource,[[d.textEdit]])}for(const[d,h]of c){if(h.flat().length===0){c.delete(d);continue}const f=_n(d,t);if(d.scheme===_e.untitled&&!f&&!this.untitledTextModel){const p=this._languageService.createByFilepathOrFirstLine(d,void 0),m=this._textFileService.untitled.create({associatedResource:d,languageId:p.languageId});this.untitledTextModel=m,m.resolve()}}}};WI=D([_(5,tr),_(6,Di)],WI);let yEe=class{constructor(e,t,i,s,o,r){this._undoCancelEdits=i,this._sessionService=o,this._logService=r,this._ctxHasStashedSession=Mzt.bindTo(s),this._session=t,this._ctxHasStashedSession.set(!0),this._listener=T.once(T.any(e.onDidChangeCursorSelection,e.onDidChangeModelContent,e.onDidChangeModel))(()=>{this._session=void 0,this._sessionService.releaseSession(t),this._ctxHasStashedSession.reset()})}dispose(){this._listener.dispose(),this._ctxHasStashedSession.reset(),this._session&&this._sessionService.releaseSession(this._session)}unstash(){if(!this._session)return;this._listener.dispose();const e=this._session;return e.markUnstashed(),e.hunkData.ignoreTextModelNChanges=!0,e.textModelN.pushEditOperations(null,this._undoCancelEdits,()=>null),e.hunkData.ignoreTextModelNChanges=!1,this._session=void 0,this._logService.debug("[IE] Unstashed session"),e}};yEe=D([_(3,Pe),_(4,LPe),_(5,Ze)],yEe);function $ze(n,e){return n.isEmpty?new O(n.startLineNumber,1,n.startLineNumber,e.getLineLength(n.startLineNumber)):new O(n.startLineNumber,1,n.endLineNumberExclusive-1,e.getLineLength(n.endLineNumberExclusive-1))}var k0;let SEe=(k0=class{constructor(e,t,i){this._editorWorkerService=e,this._textModel0=t,this._textModelN=i,this._store=new Z,this._data=new Map,this._ignoreChanges=!1,this._store.add(i.onDidChangeContent(s=>{this._ignoreChanges||this._mirrorChanges(s)}))}dispose(){this._textModelN.isDisposed()||this._textModelN.changeDecorations(e=>{for(const{textModelNDecorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._textModel0.isDisposed()||this._textModel0.changeDecorations(e=>{for(const{textModel0Decorations:t}of this._data.values())t.forEach(e.removeDecoration,e)}),this._data.clear(),this._store.dispose()}set ignoreTextModelNChanges(e){this._ignoreChanges=e}get ignoreTextModelNChanges(){return this._ignoreChanges}_mirrorChanges(e){const t=[],i=[];for(const{textModelNDecorations:o,textModel0Decorations:r,state:a}of this._data.values())if(a===zu.Pending)for(let c=1;cO.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(O.compareRangesUsingStarts);const s=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(O.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(O.areIntersectingOrTouching(f,o.range)){r=!0;break}else break;if(r)continue;const c=o.rangeOffset-a,l=this._textModel0.getPositionAt(c);let d=0;for(const f of i)f.getEndPosition().isBefore(l)&&(d+=this._textModel0.getValueLengthInRange(f));const h=this._textModel0.getPositionAt(c+d),u=this._textModel0.getPositionAt(c+d+o.rangeLength);s.push(ds.replace(O.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,s,()=>null)}async recompute(e){const t=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced");if(!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew Kzt(o.original,o.modified,o.innerChanges??[]));this._textModelN.changeDecorations(o=>{this._textModel0.changeDecorations(r=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(o.removeDecoration,o),c.forEach(r.removeDecoration,r);this._data.clear();for(const a of s){const c=[],l=[];c.push(o.addDecoration($ze(a.modified,this._textModelN),eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration($ze(a.original,this._textModel0),eT._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,eT._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,eT._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:zu.Pending})}})})}get size(){return this._data.size}get pending(){return fi.reduce(this._data.values(),(e,{state:t})=>e+(t===zu.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),s=e.getRanges0();for(let o=1;o(t.push(i),null)),t.flat()}getInfo(){const e=[];for(const[t,i]of this._data.entries()){const s={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return iF(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return iF(o),o},discardChanges:()=>{if(i.state===zu.Pending){const o=this._discardEdits(s);this._textModelN.pushEditOperations(null,o,()=>null),i.state=zu.Rejected}},acceptChanges:()=>{if(i.state===zu.Pending){const o=[],r=s.getRangesN(),a=s.getRanges0();for(let c=1;cnull),i.state=zu.Accepted,i.editState.applied+=1}}};e.push(s)}return e}},eT=k0,k0._HUNK_TRACKED_RANGE=Kt.register({description:"inline-chat-hunk-tracked-range",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}),k0._HUNK_THRESHOLD=8,k0);SEe=eT=D([_(0,kd)],SEe);class Kzt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var zu;(function(n){n[n.Pending=0]="Pending",n[n.Accepted=1]="Accepted",n[n.Rejected=2]="Rejected"})(zu||(zu={}));async function Yzt(n,e,t,i){const[s]=n.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:gi.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(n.isDisposed())break;const a=n.getDecorationRange(s);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?ds.replace(a,r):ds.insert(a.getEndPosition(),r);i?.start(),n.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function Jzt(n,e,t,i){t=Math.max(30,t);const s=new M9;let o=e.text??"";n.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=GFe(o,1);s.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(n.cancel(),s.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{n.cancel(),s.resolve(),r.dispose()});return{range:e.range,newText:s.asyncIterable}}var Xzt=".interactive-result-code-block{position:relative}.interactive-result-code-block .interactive-result-code-block-toolbar{display:none}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar,.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);height:26px;line-height:26px;max-width:70%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:-13px;z-index:100}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-action-bar{left:0}.interactive-result-code-block .interactive-result-code-block-toolbar>.monaco-toolbar{right:10px}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .interactive-result-code-block-toolbar:focus-within,.interactive-result-code-block.focused .interactive-result-code-block-toolbar,.interactive-result-code-block:hover .interactive-result-code-block-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-item-container .value .rendered-markdown [data-code]{margin:16px 0}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-result-code-block.compare.no-diff .message{display:inherit}.interactive-result-code-block.compare .message{display:none;padding:6px}.interactive-result-code-block.compare .message A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-result-code-block.compare .message A>CODE{color:var(--vscode-textLink-foreground)}";Ct(Xzt,{});function qFe(n){return{wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden",alwaysConsumeMouseWheel:!1},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",dragAndDrop:!1,revealHorizontalRightPadding:5,minimap:{enabled:!1},guides:{indentation:!1},accessibilitySupport:n.getValue("editor.accessibilitySupport"),cursorBlinking:n.getValue("editor.cursorBlinking")}}function Zzt(){return{isSimpleWidget:!0,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,pm.ID,mc.ID,Ux.ID])}}const $u="vs/workbench/contrib/chat/browser/codeBlockPart",vv=we,e5t="vscode-local-file";function t5t(n){let e;try{e=JSON.parse(n)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=P.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new O(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const Iy=10;let AEe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.currentScrollWidth=0,this.disposableStore=this._register(new Z),this.element=vv(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=o.createChild(new Dl([Pe,this.contextKeyService])),h=he(this.element,vv(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...qFe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const u=he(this.element,vv(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=d.createChild(new Dl([Pe,f]));this.toolbar=this._register(p.createInstance(nC,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=he(this.element,vv(".interactive-result-vulns")),v=he(m,vv(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Tu(v,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0,supportIcons:!0})),this.vulnsListElement=he(m,vv("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const w=this.currentCodeBlockData.element;w.vulnerabilitiesListExpanded=!w.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!w.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(w=>{u.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.editor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),bm.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),bm.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(_1,t,i,{isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,bm.ID,WV.ID,$x.ID,RF.ID,Nc.ID,Du.ID,IF.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.editor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight();this.editor.layout({width:e-2,height:t}),this.updatePaddingForLayout()}getContentHeight(){if(this.currentCodeBlockData?.range){const e=this.currentCodeBlockData.range.endLineNumber-this.currentCodeBlockData.range.startLineNumber+1,t=this.editor.getOption(x.lineHeight);return e*t}return this.editor.getContentHeight()}async render(e,t,i){this.currentCodeBlockData=e,e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e),this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>g1.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>g1.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g($u,3,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Jl(this.toolbar.getElement()):Oh(this.toolbar.getElement()),e.vulns?.length&&As(e.element)?(Yo(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),he(this.vulnsListElement,...e.vulns.map(s=>vv("li",void 0,vv("span.chat-vuln-title",void 0,s.title)," "+s.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns")}reset(){this.clearWidgets()}clearWidgets(){Nc.get(this.editor)?.hideContentHover()}async updateEditor(e){const t=(await e.textModel).textEditorModel;this.editor.setModel(t),e.range&&(this.editor.setSelection(e.range),this.editor.revealRangeInCenter(e.range,vt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),xo.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g($u,4,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g($u,5,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?Ce.chevronDown:Ce.chevronRight)(this.currentCodeBlockData.element).id})`}};AEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur)],AEe);let EEe=class extends ${constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(_e.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};EEe=D([_(0,Rn),_(1,Ai)],EEe);let xEe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.options=e,this.menuId=t,this.modelService=a,this.configurationService=c,this.accessibilityService=l,this.labelService=d,this.openerService=h,this._onDidChangeContentHeight=this._register(new I),this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this._lastDiffEditorViewModel=this._store.add(new Dn),this.currentScrollWidth=0,this.element=vv(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=he(this.element,vv(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=o.createChild(new Dl([Pe,this.contextKeyService])),f=he(this.element,vv(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,f,{...qFe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:Iy,bottom:Iy},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g($u,0,"Code block"),overflowWidgetsDomNode:s,...this.getEditorOptionsFromConfig()});const p=he(this.element,vv(".interactive-result-code-block-toolbar")),m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(p),v=u.createChild(new Dl([Pe,m]));this.toolbar1=this._register(new Qh(p,{})),this.toolbar2=this._register(v.createInstance(nC,p,t,{menuOptions:{shouldForwardArgs:!0}})),this._register(this.toolbar2.onDidChangeDropdownVisibility(w=>{p.classList.toggle("force-visibility",w)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(w=>{w.affectedKeys.has(ua.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(w=>{this.currentScrollWidth=w.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(w=>{w.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),bm.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),bm.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(w=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const s={isSimpleWidget:!1,contributions:b_.getSomeEditorContributions([Hx.ID,mhe,QS.ID,bm.ID,WV.ID,$x.ID,RF.ID,Nc.ID,IF.ID])};return this._register(e.createInstance(xm,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g($u,6,"Original"),modifiedAriaLabel:g($u,7,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!1,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,...i},{originalEditor:s,modifiedEditor:s}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Iy-t,2):Iy;this.diffEditor.updateOptions({padding:{top:Iy,bottom:i}})}_configureForScreenReader(){const e=this.toolbar2.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(ua.Chat)?g($u,1,"Toolbar for code block which can be reached via tab"):g($u,2,"Code block toolbar")):e.style.display=""}getEditorOptionsFromConfig(){return{wordWrap:this.options.configuration.resultEditor.wordWrap,fontLigatures:this.options.configuration.resultEditor.fontLigatures,bracketPairColorization:this.options.configuration.resultEditor.bracketPairColorization,fontFamily:this.options.configuration.resultEditor.fontFamily==="default"?Gh.fontFamily:this.options.configuration.resultEditor.fontFamily,fontSize:this.options.configuration.resultEditor.fontSize,fontWeight:this.options.configuration.resultEditor.fontWeight,lineHeight:this.options.configuration.resultEditor.lineHeight}}layout(e){const t=this.getContentHeight(),s={width:e-2,height:t};this.element.style.height=`${s.height}px`,this.element.style.width=`${s.width}px`,this.diffEditor.layout(s),this.updatePaddingForLayout()}getContentHeight(){return this.diffEditor.getContentHeight()}async render(e,t,i){e.parentContextKeyService&&this.contextKeyService.updateParent(e.parentContextKeyService),this.options.configuration.resultEditor.wordWrap==="on"&&this.layout(t),await this.updateEditor(e,i),this.layout(t),this.diffEditor.updateOptions({ariaLabel:g($u,8,"Code Edits")}),this.toolbar1.clear(),this.toolbar1.push(_l({label:ui(e.edit.uri),tooltip:g($u,9,"Open '{0}'",this.labelService.getUriLabel(e.edit.uri,{relative:!0})),run:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},id:""}),{icon:!1,label:!0}),e.hideToolbar?Jl(this.toolbar2.getElement()):Oh(this.toolbar2.getElement())}reset(){this.clearWidgets()}clearWidgets(){Nc.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Nc.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!As(e.element))return;const i=!!(e.edit.state?.applied??0);if(KPt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const o=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0}),r=e.edit.state.applied>1?g($u,10,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o):g($u,11,"Made 1 change in [[``{0}``]]",o),a=pNe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});_a(this.messageElement,a)}const s=await e.diffData;if(s){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:s.original,modified:s.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar2.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}};xEe=D([_(4,be),_(5,Pe),_(6,Ai),_(7,Re),_(8,Ur),_(9,eo),_(10,fr)],xEe);let DEe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new tV}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const o of this.editorService.listDiffEditors()){if(!o.getContainerDomNode().isConnected)continue;const r=o.getModel();if(!r||!_n(r.original.uri,t.uri)||r.modified.uri.scheme!==_e.vscodeChatCodeCompareBlock){i=o;break}}const s=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,s)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const s=e.getDiffComputationResult();if(!s||s.identical||!await this._checkSha1(i.original,t))return 0;const o=new DCe(i.modified),r=s.changes2.map(a=>a.toRangeMapping().toTextEdit(o).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,r,()=>null),i.original.pushStackElement(),r.length}async _apply(e){const t=await this.modelService.createModelReference(e.uri);try{if(!await this._checkSha1(t.object.textEditorModel,e))return 0;t.object.textEditorModel.pushStackElement();let i=0;for(const s of e.edits){const o=s.map(iMe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,o,()=>null),i+=o.length}return t.object.textEditorModel.pushStackElement(),i}finally{t.dispose()}}async _checkSha1(e,t){return!(t.state?.sha1&&this._sha1.computeSHA1(e)&&this._sha1.computeSHA1(e)!==t.state.sha1&&!(await this.dialogService.confirm({message:g($u,12,"The original file has been modified."),detail:g($u,13,"Do you want to apply the changes anyway?")})).confirmed)}};DEe=D([_(0,Rn),_(1,jt),_(2,To)],DEe);var kEe;const eB="vs/workbench/contrib/inlineChat/browser/inlineChatStrategies";var ZN;let zie=(ZN=class{constructor(e,t,i,s,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=s,this._instaService=o,this._store=new Z,this._onDidAccept=this._store.add(new I),this._onDidDiscard=this._store.add(new I),this.onDidAccept=this._onDidAccept.event,this.onDidDiscard=this._onDidDiscard.event}dispose(){this._store.dispose()}async _doApplyChanges(e){const t=[],i=this._instaService.createInstance(DEe);for(const s of this._session.chatModel.getRequests())if(s.response?.response){for(const o of s.response.response.value)if(o.kind==="textEditGroup"&&!(e&&_n(o.uri,this._session.textModelN.uri))&&(await i.apply(s.response,o,void 0),o.uri.scheme===_e.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const s of t)s.isDisposed()||(await s.resolve(),await s.save({reason:Ln.EXPLICIT}))}cancel(){return this._session.hunkData.discardAll()}async acceptHunk(){this._onDidAccept.fire()}async discardHunk(){this._onDidDiscard.fire()}getWholeRangeDecoration(){const t=[this._session.wholeRange.value].map(i=>i.isEmpty()?void 0:{range:i,options:kEe._decoBlock});return iF(t),t}},kEe=ZN,ZN._decoBlock=Kt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),ZN);zie=kEe=D([_(3,tr),_(4,be)],zie);let IEe=class extends zie{constructor(e,t,i,s,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=Fzt.bindTo(o);const c=s.getModel(e.targetUri);T.debounce(c.onDidChangeContent.bind(c),()=>{},350)(l=>{!c.isDisposed()&&!e.textModel0.isDisposed()&&this._ctxDocumentChanged.set(e.hasChangedText)},void 0,this._store)}dispose(){this._ctxDocumentChanged.reset(),super.dispose()}async apply(){await super._doApplyChanges(!1)}async makeChanges(){}async makeProgressiveChanges(){}async renderChanges(e){}hasFocus(){return this._zone.widget.hasFocus()}};IEe=D([_(3,Ai),_(4,Pe),_(5,tr),_(6,be)],IEe);let LEe=class extends zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=Kt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:oh.Full,color:b2e($zt)},minimap:{position:xu.Inline,color:b2e(Gzt)}}),this._decoInsertedTextRange=Kt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:gi.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=Ozt.bindTo(s),this._ctxCurrentChangeShowsDiff=Bzt.bindTo(s),this._progressiveEditingDecorations=this._editor.createDecorationsCollection()}dispose(){this._resetDiff(),super.dispose()}_resetDiff(){this._ctxCurrentChangeHasDiff.reset(),this._ctxCurrentChangeShowsDiff.reset(),this._zone.widget.updateStatus(""),this._progressiveEditingDecorations.clear();for(const e of this._hunkDisplayData.values())e.remove()}async apply(){this._resetDiff(),this._editCount>0&&this._editor.pushUndoStop(),await super._doApplyChanges(!0)}cancel(){return this._resetDiff(),super.cancel()}async makeChanges(e,t,i){return this._makeChanges(e,t,void 0,void 0,i)}async makeProgressiveChanges(e,t,i,s){const o=new cf(r=>{const a=new Set;for(const d of r)bi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(bi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new O(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,s)}async _makeChanges(e,t,i,s,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=Znt(a.text??"")/r,d=Jzt(new sQ(this._zone.domNode),a,l,i.token);await Yzt(this._session.textModelN,d,s,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(s?.report(r),null)),t.stop()}async renderChanges(e){this._progressiveEditingDecorations.clear();const t=()=>{let i;if(Dpe(this._editor,(s,o)=>{const r=new Set(this._hunkDisplayData.keys());i=void 0;for(const a of this._session.hunkData.getInfo()){r.delete(a);const c=a.getRangesN();let l=this._hunkDisplayData.get(a);if(l)if(a.getState()!==zu.Pending)l.remove();else{const d=this._zone.position.lineNumber,h=c[0];l.position=h.getStartPosition().delta(-1),l.distance=d<=h.startLineNumber?h.startLineNumber-d:d-h.endLineNumber}else{const d=[];for(let z=0;z{a.acceptChanges(),t()},u=()=>{a.discardChanges(),t()},f=this._session.textModel0.mightContainNonBasicASCII(),p=this._session.textModel0.mightContainRTL(),m=Ode.fromEditor(this._editor),v=a.getRanges0()[0],w=new rZe(bi.fromRangeInclusive(v).mapToLineArray(z=>this._session.textModel0.tokenization.getLineTokens(z)),[],f,p),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:oZe(w,m,[new DW(new O(v.startLineNumber,1,v.startLineNumber,1),"",Rc.Regular)],b).heightInLines,domNode:b},S=()=>{const z=M_.capture(this._editor);Dpe(this._editor,(U,J)=>{if(Bt(l),l.viewZoneId)J.removeZone(l.viewZoneId),l.viewZoneId=void 0;else{const[j]=a.getRangesN();y.afterLineNumber=j.startLineNumber-1,l.viewZoneId=J.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof l?.viewZoneId=="string"),z.restore(this._editor)},M=()=>{Dpe(this._editor,(z,U)=>{Bt(l);for(const J of l.decorationIds)z.removeDecoration(J);l.viewZoneId&&U.removeZone(l.viewZoneId),l.decorationIds=[],l.viewZoneId=void 0})},k=z=>{Bt(i);const U=[];for(const J of this._session.hunkData.getInfo())J.getState()===zu.Pending&&U.push(J.getRangesN()[0].getStartPosition().delta(-1));if(!(U.length<2)){for(let J=0;Ji.acceptHunk(),this.discardHunk=async()=>i.discardHunk(),this.move=r=>i.move(r)}else if(this._hunkDisplayData.size>0){let s=!1;for(const o of this._session.hunkData.getInfo())if(o.getState()===zu.Accepted){s=!0;break}s?this._onDidAccept.fire():this._onDidDiscard.fire()}return i};return t()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(Mv.AcceptedOrDiscardBeforeSave);let s;t===0?s=g(eB,0,"Nothing changed."):e===1?s=i?g(eB,1,"$(info) Accept or discard 1 change"):g(eB,2,"1 change"):s=i?g(eB,3,"$(info) Accept or Discard {0} changes",e):g(eB,4,"{0} changes",t);let o;i&&(o=g(eB,5,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(s,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};LEe=D([_(3,Pe),_(4,kd),_(5,Ur),_(6,Re),_(7,tr),_(8,be)],LEe);function Dpe(n,e){n.changeDecorations(t=>{n.changeViewZones(i=>{e(t,i)})})}var i5t=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.monaco-workbench .zone-widget-container.inside-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat{background:var(--vscode-inlineChat-background);border:1px solid var(--vscode-inlineChat-border);border-radius:4px;box-shadow:0 2px 4px 0 var(--vscode-widget-shadow);color:inherit;margin-top:8px;padding:0 8px 8px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-input-and-execute-toolbar{border-radius:2px;width:100%}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list{padding:4px 0 0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact{gap:6px;padding:6px 4px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .header .avatar{outline-offset:-1px}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .progress{position:relative}.monaco-workbench .part.editor>.content .inline-chat .progress .monaco-progress-container{top:0}.monaco-workbench .inline-chat .status{align-items:center;display:flex;justify-content:space-between;margin-top:3px}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:12px;overflow:hidden}.monaco-workbench .inline-chat .status .label.info{margin-right:auto;padding-left:2px}.monaco-workbench .inline-chat .status .label.status{margin-left:auto}.monaco-workbench .inline-chat .status .label.hidden{display:none}.monaco-workbench .inline-chat .status .label.error{color:var(--vscode-errorForeground)}.monaco-workbench .inline-chat .status .label.warn{color:var(--vscode-editorWarning-foreground)}.monaco-workbench .inline-chat .status .label>.codicon{font-size:12px;line-height:18px;padding:0 5px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent .value{overflow:hidden;-webkit-user-select:text;user-select:text}.monaco-workbench .inline-chat .followUps{padding:5px}.monaco-workbench .inline-chat .followUps .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.monaco-workbench .inline-chat .followUps.hidden{display:none}.monaco-workbench .inline-chat .chatMessage{padding:0 3px}.monaco-workbench .inline-chat .chatMessage .chatMessageContent{padding:2px}.monaco-workbench .inline-chat .chatMessage.hidden{display:none}.monaco-workbench .inline-chat .status .actions{display:flex;padding-top:3px}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:6px}.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown>.monaco-dropdown-button{align-items:center;display:flex;padding:0 4px}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon{display:flex}.monaco-workbench .inline-chat .status .actions>.monaco-button.codicon:before{align-self:center}.monaco-workbench .inline-chat .status .actions .monaco-text-button{padding:2px 4px;white-space:nowrap}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item{padding:0 2px}.monaco-workbench .inline-chat .status .monaco-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat .status .monaco-toolbar .action-item.button-item .action-label:is(:hover,:focus){background-color:var(--vscode-button-hoverBackground)}.monaco-workbench .inline-chat .preview{display:none}.monaco-workbench .inline-chat .previewCreate,.monaco-workbench .inline-chat .previewDiff{border:1px solid var(--vscode-inlineChat-border);border-radius:2px;display:inherit;margin:6px 0}.monaco-workbench .inline-chat .previewCreateTitle{padding-top:6px}.monaco-workbench .inline-chat .diff-review.hidden,.monaco-workbench .inline-chat .previewCreate.hidden,.monaco-workbench .inline-chat .previewCreateTitle.hidden,.monaco-workbench .inline-chat .previewDiff.hidden{display:none}.monaco-workbench .inline-chat-toolbar{display:flex}.monaco-workbench .inline-chat-toolbar>.monaco-button{margin-right:6px}.monaco-workbench .inline-chat-toolbar .action-label.checked{background-color:var(--vscode-inputOption-activeBackground);color:var(--vscode-inputOption-activeForeground);outline:1px solid var(--vscode-inputOption-activeBorder)}.monaco-workbench .inline-chat-inserted-range{background-color:var(--vscode-inlineChatDiff-inserted)}.monaco-workbench .inline-chat-inserted-range-linehighlight{background-color:var(--vscode-diffEditor-insertedLineBackground)}.monaco-workbench .inline-chat-original-zone2{background-color:var(--vscode-diffEditor-removedLineBackground);opacity:.8}.monaco-workbench .inline-chat-lines-inserted-range{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-workbench .inline-chat-block-selection{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .interactive-session .interactive-input-and-execute-toolbar .monaco-editor .inline-chat-slash-command{background-color:var(--vscode-chat-slashCommandBackground);border-radius:2px;color:var(--vscode-chat-slashCommandForeground);padding:1px}.monaco-workbench .inline-chat-slash-command-detail{opacity:.5}.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-editor-background,.monaco-workbench .inline-chat-diff-widget .monaco-diff-editor .monaco-workbench .margin-view-overlays,.monaco-workbench .inline-chat-newfile-widget{background-color:var(--vscode-inlineChat-regionHighlight)}.monaco-workbench .inline-chat-newfile-widget .title{align-items:center;display:flex;justify-content:space-between}.monaco-workbench .inline-chat-newfile-widget .title .detail{margin-left:4px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget{display:flex;margin-left:auto;margin-right:8px}.monaco-workbench .inline-chat-newfile-widget .buttonbar-widget>.monaco-button{display:inline-flex;margin-left:4px;white-space:nowrap}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{cursor:pointer;display:block;transition:opacity .2s ease-in-out}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque{opacity:.5}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent{opacity:0}.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-opaque:hover,.monaco-workbench .glyph-margin-widgets .cgmr.codicon-inline-chat-transparent:hover{opacity:1}";Ct(i5t,{});const n5t="vs/platform/actions/browser/buttonbar";let TEe=class extends dkt{constructor(e,t,i,s,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=s,this._hoverService=r,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new gw),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{o.publicLog2("workbenchActionExecuted",{id:a.action.id,from:t.telemetrySource})},void 0,this._store)}dispose(){this._onDidChange.dispose(),this._updateStore.dispose(),this._store.dispose(),super.dispose()}update(e){const t=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const i=this._updateStore.add(C1());for(let s=0;s0,r=e[s];let a,c;if(r instanceof u1&&r.actions.length>0){const[h,...u]=r.actions;a=h,c=this.addButtonWithDropdown({secondary:t(a)?.isSecondary??o,actionRunner:this._actionRunner,actions:u,contextMenuProvider:this._contextMenuService,ariaLabel:a.label})}else a=r,c=this.addButton({secondary:t(a)?.isSecondary??o,ariaLabel:a.label});c.enabled=a.enabled,c.element.classList.add("default-colors"),t(a)?.showLabel??!0?c.label=a.label:c.element.classList.add("monaco-text-button"),t(a)?.showIcon&&(a instanceof id&&$e.isThemeIcon(a.item.icon)?c.icon=a.item.icon:a.class&&c.element.classList.add(...a.class.split(" ")));const l=this._keybindingService.lookupKeybinding(a.id);let d;l?d=g(n5t,0,"{0} ({1})",a.label,l.getLabel()):d=a.label,this._updateStore.add(this._hoverService.setupUpdatableHover(i,c.element,d)),this._updateStore.add(c.onDidClick(async()=>{this._actionRunner.run(a)}))}this._onDidChange.fire(this)}};TEe=D([_(2,Vr),_(3,ti),_(4,rn),_(5,el)],TEe);let REe=class extends TEe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,r,a,c,l);const d=s.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=d.getActions({renderShortTitle:!0}).flatMap(f=>f[1]);super.update(u)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};REe=D([_(3,_c),_(4,Pe),_(5,Vr),_(6,ti),_(7,rn),_(8,el)],REe);var s5t='.interactive-session{margin:auto;max-width:850px}.interactive-list>.monaco-list>.monaco-scrollable-element>.monaco-list-rows>.monaco-list-row>.monaco-tl-row>.monaco-tl-twistie{display:none!important}.interactive-item-container{color:var(--vscode-interactive-session-foreground);cursor:default;display:flex;flex-direction:column;gap:8px;padding:16px 20px;user-select:text;-webkit-user-select:text}.interactive-item-container .header{align-items:center;display:flex;justify-content:space-between;position:relative}.interactive-item-container .header.hidden{display:none}.interactive-item-container .header .user{align-items:center;display:flex;gap:8px}.interactive-item-container .header .username{font-size:13px;font-weight:600;margin:0}.interactive-item-container .header .detail-container{color:var(--vscode-descriptionForeground);font-size:12px}.interactive-item-container .header .detail-container .detail .agentOrSlashCommandDetected A{color:var(--vscode-textLink-foreground);cursor:pointer}.interactive-item-container .chat-animated-ellipsis{display:inline-block;width:11px}.interactive-item-container:not(.show-detail-progress) .chat-animated-ellipsis{display:none}@keyframes ellipsis{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}to{content:""}}.interactive-item-container .chat-animated-ellipsis:after{animation:ellipsis 1s steps(4) infinite;content:"";overflow:hidden;white-space:nowrap;width:3em}.interactive-item-container .header .avatar-container{display:flex;pointer-events:none;user-select:none}.interactive-item-container .header .avatar{align-items:center;border-radius:50%;display:flex;height:24px;justify-content:center;outline:1px solid var(--vscode-chat-requestBorder);width:24px}.interactive-item-container .header .avatar.codicon-avatar{background:var(--vscode-chat-avatarBackground)}.interactive-item-container .header .avatar+.avatar{margin-left:-8px}.interactive-item-container .header .avatar .icon{background-color:var(--vscode-chat-list-background);border-radius:50%;height:24px;width:24px}.interactive-item-container .header .avatar .codicon{color:var(--vscode-chat-avatarForeground)!important;font-size:14px}.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar,.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label{display:none}.interactive-item-container .header .monaco-toolbar .monaco-action-bar .actions-container{gap:4px}.interactive-item-container .header .monaco-toolbar .action-label{border:1px solid transparent;padding:2px}.interactive-item-container .header .monaco-toolbar{background-color:var(--vscode-chat-list-background);position:absolute;right:0}.interactive-item-container.interactive-request .header .monaco-toolbar{background-color:inherit}.interactive-item-container .header .monaco-toolbar .checked.action-label,.interactive-item-container .header .monaco-toolbar .checked.action-label:hover{background-color:var(--vscode-inputOption-activeBackground);border-color:var(--vscode-inputOption-activeBorder);color:var(--vscode-inputOption-activeForeground)!important}.interactive-item-container .value{width:100%}.interactive-item-container .chat-progress-task{padding-bottom:8px}.interactive-item-container .value .rendered-markdown table{margin-bottom:16px;text-align:left;width:100%}.interactive-item-container .value .rendered-markdown table,.interactive-item-container .value .rendered-markdown table td,.interactive-item-container .value .rendered-markdown table th{border:1px solid var(--vscode-chat-requestBorder);border-collapse:collapse;padding:4px 6px}.interactive-item-container .value .interactive-session-followups,.interactive-item-container .value .rendered-markdown a,.interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textLink-foreground)}.interactive-item-container .value .rendered-markdown a:active,.interactive-item-container .value .rendered-markdown a:hover{color:var(--vscode-textLink-activeForeground)}.hc-black .interactive-item-container .value .rendered-markdown a code,.hc-light .interactive-item-container .value .rendered-markdown a code{color:var(--vscode-textPreformat-foreground)}.interactive-list{overflow:hidden}.interactive-request{border-bottom:1px solid var(--vscode-chat-requestBorder);border-top:1px solid var(--vscode-chat-requestBorder)}.hc-black .interactive-request,.hc-light .interactive-request{border-left:3px solid var(--vscode-chat-requestBorder);border-right:3px solid var(--vscode-chat-requestBorder)}.interactive-item-container .value{overflow-wrap:anywhere;white-space:normal}.interactive-item-container .value>:last-child.rendered-markdown>:last-child{margin-bottom:0}.interactive-item-container .value .rendered-markdown h1{font-size:20px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h2{font-size:16px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown h3{font-size:14px;font-weight:600;margin:16px 0}.interactive-item-container .value .rendered-markdown p{line-height:1.5em}.interactive-item-container .value>.rendered-markdown p{margin:0 0 16px}.interactive-item-container .value>.rendered-markdown li>p{margin:0}.interactive-item-container .value .rendered-markdown ul{padding-inline-start:24px}.interactive-item-container .value .rendered-markdown ol{padding-inline-start:28px}.interactive-item-container .value .rendered-markdown li{line-height:1.3rem}.interactive-item-container .value .rendered-markdown img{max-width:100%}.interactive-item-container .monaco-tokenized-source,.interactive-item-container code{background-color:var(--vscode-textPreformat-background);border-radius:4px;color:var(--vscode-textPreformat-foreground);font-family:var(--monaco-monospace-font);font-size:12px;padding:1px 3px}.interactive-item-container.interactive-item-compact{padding:8px 20px}.interactive-item-container.interactive-item-compact.no-padding{gap:unset;padding:unset}.interactive-item-container.interactive-item-compact .header{height:16px}.interactive-item-container.interactive-item-compact .header .avatar{height:18px;width:18px}.interactive-item-container.interactive-item-compact .header .avatar .icon{height:16px;width:16px}.interactive-item-container.interactive-item-compact .header .codicon-avatar .codicon{font-size:12px}.interactive-item-container.interactive-item-compact .header .avatar+.avatar{margin-left:-4px}.interactive-item-container.interactive-item-compact .value{min-height:0}.interactive-item-container.interactive-item-compact .value>.rendered-markdown p{margin:0 0 8px}.interactive-item-container.interactive-item-compact .value>.rendered-markdown li>p{margin:0}.interactive-item-container.interactive-item-compact .value .rendered-markdown h1,.interactive-item-container.interactive-item-compact .value .rendered-markdown h2,.interactive-item-container.interactive-item-compact .value .rendered-markdown h3{margin:8px 0}.interactive-session .interactive-input-and-execute-toolbar{align-items:flex-end;background-color:var(--vscode-input-background);border:1px solid var(--vscode-input-border,transparent);border-radius:4px;box-sizing:border-box;cursor:text;display:flex;justify-content:space-between;margin-bottom:4px;padding:0 6px;position:relative}.interactive-session .interactive-input-part.compact .interactive-input-and-execute-toolbar{border-radius:2px;margin-bottom:0}.interactive-session .interactive-input-and-side-toolbar{align-items:center;display:flex;gap:4px}.interactive-session .interactive-input-and-execute-toolbar.focused{border-color:var(--vscode-focusBorder)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .mtk1{color:var(--vscode-input-foreground)}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor,.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .monaco-editor-background{background-color:var(--vscode-input-background)!important}.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .cursors-layer{padding-left:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar{height:22px;margin-bottom:7px}.interactive-session .interactive-input-part .interactive-execute-toolbar .monaco-action-bar .actions-container{display:flex;gap:4px}.interactive-session .interactive-input-part .interactive-execute-toolbar .codicon-debug-stop{color:var(--vscode-icon-foreground)!important}.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .margin,.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .monaco-editor-background{background-color:var(--vscode-interactive-result-editor-background-color)!important}.interactive-item-compact .interactive-result-code-block{margin:0 0 8px}.interactive-item-container .interactive-result-code-block .monaco-toolbar .monaco-action-bar .actions-container{padding-inline-start:unset}.chat-notification-widget .chat-error-codicon,.chat-notification-widget .chat-info-codicon,.chat-notification-widget .chat-warning-codicon{align-items:start;display:flex;gap:8px}.interactive-item-container .value .chat-notification-widget .rendered-markdown p{margin:0}.interactive-response .interactive-response-error-details{align-items:start;display:flex;gap:6px}.interactive-response .interactive-response-error-details .rendered-markdown :last-child{margin-bottom:0}.chat-notification-widget .chat-error-codicon .codicon,.chat-notification-widget .chat-info-codicon .codicon,.chat-notification-widget .chat-warning-codicon .codicon{margin-top:2px}.interactive-response .interactive-response-error-details .codicon{margin-top:1px}.chat-used-context-list .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-used-context-list .monaco-icon-label-container{color:var(--vscode-interactive-session-foreground)}.chat-notification-widget .chat-warning-codicon .codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.chat-notification-widget .chat-error-codicon .codicon-error,.interactive-response .interactive-response-error-details .codicon-error{color:var(--vscode-errorForeground)!important}.chat-notification-widget .chat-info-codicon .codicon-info,.interactive-response .interactive-response-error-details .codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}.interactive-session .interactive-input-part{display:flex;flex-direction:column;margin:0 20px;padding:12px 0}.interactive-session .interactive-input-part.compact{margin:0;padding:8px 0 0}.interactive-session .chat-attached-context .chat-attached-context-attachment{display:flex;gap:4px}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button:hover{cursor:pointer}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button{align-items:center;display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container{display:flex}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container .monaco-highlighted-label{align-items:center!important;display:flex!important}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button.codicon.codicon-close,.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .monaco-button.codicon.codicon-close{color:var(--vscode-descriptionForeground)}.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label .codicon{padding-left:4px}.interactive-session .chat-attached-context{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 8px}.interactive-session .chat-attached-context .chat-attached-context-attachment{border:1px solid var(--vscode-chat-requestBorder,var(--vscode-input-background,transparent));border-radius:4px;height:18px;max-width:100%;padding:2px}.interactive-session-followups{align-items:start;display:flex;flex-direction:column;gap:6px}.interactive-session-followups .monaco-button{text-align:left;width:auto}.interactive-session-followups .monaco-button .codicon{margin-left:0;margin-top:1px}.interactive-item-container .interactive-response-followups .monaco-button{padding:4px 8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups{margin-bottom:8px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button{color:var(--vscode-textLink-foreground);display:block;font-size:12px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups code{font-family:var(--monaco-monospace-font);font-size:11px}.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button .codicon-sparkle{float:left}.interactive-session-followups .monaco-button.interactive-followup-reply{border:none;padding:0}.interactive-welcome .value .interactive-session-followups{margin-bottom:16px}.interactive-item-container .monaco-toolbar .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container.filtered-response .value>.rendered-markdown{-webkit-mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);mask-image:linear-gradient(rgba(0,0,0,.75),rgba(0,0,0,.05) 60%,transparent 80%);pointer-events:none}.quick-input-widget .interactive-session .interactive-input-part{margin:0 3px;padding:8px 6px 6px}.quick-input-widget .interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar{border-radius:2px;margin:0;padding:0 4px 0 6px}.quick-input-widget .interactive-list{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.quick-input-widget .interactive-response{min-height:86px}.interactive-response-progress-tree .monaco-list-row:not(.selected) .monaco-tl-row:hover{background-color:var(--vscode-list-hoverBackground)}.interactive-response-progress-tree{margin:16px 0}.interactive-response-progress-tree.focused{border-color:var(--vscode-focusBorder,transparent)}.interactive-item-container .value .interactive-response-placeholder-codicon .codicon{color:var(--vscode-editorGhostText-foreground)}.interactive-item-container .value .interactive-response-placeholder-content{color:var(--vscode-editorGhostText-foreground);font-size:12px;margin-bottom:16px}.interactive-item-container .value .interactive-response-placeholder-content p{margin:0}.interactive-response .interactive-response-codicon-details{align-items:start;display:flex;gap:6px}.chat-used-context-list .monaco-list{border:none;border-radius:4px;width:auto}.interactive-item-container .chat-resource-widget{background-color:var(--vscode-chat-slashCommandBackground);color:var(--vscode-chat-slashCommandForeground)}.interactive-item-container .chat-agent-widget .monaco-button,.interactive-item-container .chat-resource-widget{border-radius:4px;padding:1px 3px}.interactive-item-container .chat-agent-widget .monaco-text-button{border:none;display:inline}.interactive-session .chat-used-context.chat-used-context-collapsed .chat-used-context-list{display:none}.interactive-session .chat-used-context{display:flex;flex-direction:column;gap:2px}.interactive-item-container .chat-notification-widget,.interactive-response-progress-tree,.interactive-session .chat-used-context-list{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:8px;padding:6px 8px}.interactive-item-container .chat-notification-widget{padding:8px 12px}.interactive-session .chat-used-context-list .monaco-list .monaco-list-row{border-radius:2px}.interactive-session .chat-used-context-label{color:var(--vscode-descriptionForeground);font-size:12px;user-select:none}.interactive-session .chat-used-context-label:hover{opacity:unset}.interactive-session .chat-used-context-label .monaco-button{border:none;border-radius:4px;display:inline-flex;gap:4px;justify-content:normal;padding:4px 8px 4px 0;text-align:initial;width:100%}.interactive-session .chat-used-context-label .monaco-button:hover{background-color:var(--vscode-list-hoverBackground);color:var(--vscode-foreground)}.interactive-session .chat-used-context-label .monaco-text-button:focus{outline:none}.interactive-session .chat-used-context-label .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-session .chat-used-context .chat-used-context-label .monaco-button .codicon{margin:0 0 0 4px}.interactive-item-container .rendered-markdown.progress-step{display:flex;margin-left:4px;white-space:normal}.interactive-item-container .rendered-markdown.progress-step>p{align-items:center;color:var(--vscode-descriptionForeground);display:flex;font-size:12px;gap:8px;margin-bottom:6px}.interactive-item-container .rendered-markdown.progress-step>p .codicon{color:var(--vscode-icon-foreground)!important}.interactive-item-container .rendered-markdown.progress-step>p .codicon.codicon-check{color:var(--vscode-debugIcon-startForeground)!important}.interactive-item-container .chat-command-button{display:flex;margin-bottom:16px}.interactive-item-container .chat-notification-widget{display:flex;flex-direction:row;gap:6px}.chat-confirmation-widget .chat-confirmation-buttons-container .monaco-button,.interactive-item-container .chat-command-button .monaco-button{padding:4px 8px;text-align:left;width:auto}.interactive-item-container .chat-command-button .monaco-button .codicon{margin-left:0;margin-top:1px}';Ct(s5t,{});var o5t=".chat-agent-hover{line-height:unset;padding:6px 0}.chat-agent-hover-header{display:flex;gap:8px;margin-bottom:4px}.chat-agent-hover-icon .codicon,.chat-agent-hover-icon img{border-radius:50%;height:32px;outline:1px solid var(--vscode-chat-requestBorder);width:32px}.monaco-hover .markdown-hover .hover-contents .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.monaco-hover .chat-agent-hover .chat-agent-hover-publisher .codicon.codicon-extensions-verified-publisher{color:var(--vscode-extensionIcon-verifiedForeground)}.chat-agent-hover .extension-verified-publisher{display:none}.chat-agent-hover.verifiedPublisher .extension-verified-publisher{display:flex}.chat-agent-hover .chat-agent-hover-warning .codicon{color:var(--vscode-notificationsWarningIcon-foreground)!important;margin-right:3px}.chat-agent-hover.allowedName .chat-agent-hover-warning{display:none}.chat-agent-hover-header .chat-agent-hover-name{font-size:14px;font-weight:600}.chat-agent-hover-extension{color:var(--vscode-descriptionForeground);display:flex;gap:6px}.chat-agent-hover.noExtensionName .chat-agent-hover-extension-name,.chat-agent-hover.noExtensionName .chat-agent-hover-separator{display:none}.chat-agent-hover-separator{opacity:.7}.chat-agent-hover-description,.chat-agent-hover-warning{font-size:13px}";Ct(o5t,{});const uA="vs/workbench/contrib/chat/browser/chatAccessibilityProvider";let MEe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(uA,0,"Chat")}getAriaLabel(e){return ip(e)?e.messageText:As(e)?this._getLabelWithCodeBlockCount(e):XW(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` `)).join(` -`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(ua.Chat);let i="";const s=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(s){case 0:break;case 1:o=g(uA,1,"1 file tree");break;default:o=g(uA,2,"{0} file trees",s);break}const r=Xg.lexer(e.response.asString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(uA,3,"{0} {1} {2}",o,e.response.asString(),t):g(uA,4,"{0} {1}",o,e.response.asString());break;case 1:i=t?g(uA,5,"{0} 1 code block: {1} {2}",o,e.response.asString(),t):g(uA,6,"{0} 1 code block: {1}",o,e.response.asString());break;default:i=t?g(uA,7,"{0} {1} code blocks: {2}",o,r,e.response.asString(),t):g(uA,8,"{0} {1} code blocks",o,r,e.response.asString());break}return i}};MEe=D([_(0,Tw)],MEe);let NEe=class extends a_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c,l,d,h){super(null,e,{hoverDelegate:r?.hoverDelegate}),this._contextMenuProvider=o,this._options=r,this._container=null,this._dropdownContainer=null,this._primaryAction=new eC(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new gx(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:s?["codicon","codicon-chevron-down",s]:["codicon","codicon-chevron-down"],actionRunner:this._options?.actionRunner,keybindingProvider:this._options?.getKeyBinding,hoverDelegate:r?.hoverDelegate})}setActionContext(e){super.setActionContext(e),this._primaryAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-primary");const t=we(".action-container");this._primaryAction.render(he(this._container,t)),this._dropdownContainer=we(".dropdown-action-container"),this._dropdown.render(he(this._container,this._dropdownContainer)),this._register(pe(t,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())})),this._register(pe(this._dropdownContainer,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),s.stopPropagation())})),this.updateEnabled()}focus(e){e?this._dropdown.focus():(this._primaryAction.element.tabIndex=0,this._primaryAction.element.focus())}blur(){this._primaryAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._primaryAction.element.tabIndex=0:(this._primaryAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}updateEnabled(){const e=!this.action.enabled;this.element?.classList.toggle("disabled",e)}update(e,t,i){this._dropdown.dispose(),this._dropdown=new gx(e,t,this._contextMenuProvider,{menuAsChild:!0,classNames:["codicon",i||"codicon-chevron-down"],actionRunner:this._options?.actionRunner,hoverDelegate:this._options?.hoverDelegate,keybindingProvider:this._options?.getKeyBinding}),this._dropdownContainer&&this._dropdown.render(this._dropdownContainer)}dispose(){this._primaryAction.dispose(),this._dropdown.dispose(),super.dispose()}};NEe=D([_(6,ti),_(7,Pi),_(8,Pe),_(9,pn),_(10,Ur)],NEe);const Gze="vs/workbench/browser/labels";function SC(n){if(!(!n||!n.resource))return P.isUri(n.resource)?n.resource:n.resource.primary}const r5t={onDidChangeVisibility:T.None};let B1=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=s,this.workspaceService=o,this.languageService=r,this.decorationsService=a,this.themeService=c,this.labelService=l,this.textFileService=d,this._onDidChangeDecorations=this._register(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this.widgets=[],this.labels=[],this.registerListeners(e)}registerListeners(e){this._register(e.onDidChangeVisibility(t=>{this.widgets.forEach(i=>i.notifyVisibilityChanged(t))})),this._register(this.languageService.onDidChange(()=>this.widgets.forEach(t=>t.notifyExtensionsRegistered()))),this._register(this.modelService.onModelLanguageChanged(t=>{t.model.uri&&this.widgets.forEach(i=>i.notifyModelLanguageChanged(t.model))})),this._register(this.modelService.onModelAdded(t=>{t.uri&&this.widgets.forEach(i=>i.notifyModelAdded(t))})),this._register(this.workspaceService.onDidChangeWorkspaceFolders(()=>{this.widgets.forEach(t=>t.notifyWorkspaceFoldersChange())})),this._register(this.decorationsService.onDidChangeDecorations(t=>{let i=!1;this.widgets.forEach(s=>{s.notifyFileDecorationsChanges(t)&&(i=!0)}),i&&this._onDidChangeDecorations.fire()})),this._register(this.themeService.onDidColorThemeChange(()=>this.widgets.forEach(t=>t.notifyThemeChange()))),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(SNe)&&this.widgets.forEach(i=>i.notifyFileAssociationsChange())})),this._register(this.labelService.onDidChangeFormatters(t=>{this.widgets.forEach(i=>i.notifyFormattersChange(t.scheme))})),this._register(this.textFileService.untitled.onDidChangeLabel(t=>{this.widgets.forEach(i=>i.notifyUntitledLabelChange(t.resource))}))}get(e){return this.labels[e]}create(e,t){const i=this.instantiationService.createInstance(PEe,e,t),s={element:i.element,onDidRender:i.onDidRender,setLabel:(o,r,a)=>i.setLabel(o,r,a),setResource:(o,r)=>i.setResource(o,r),setFile:(o,r)=>i.setFile(o,r),clear:()=>i.clear(),dispose:()=>this.disposeWidget(i)};return this.labels.push(s),this.widgets.push(i),s}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),St(e)}clear(){this.widgets=St(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};B1=D([_(1,be),_(2,Re),_(3,Ai),_(4,Ti),_(5,Di),_(6,rD),_(7,pn),_(8,eo),_(9,tr)],B1);let qze=class extends B1{get element(){return this.label}constructor(e,t,i,s,o,r,a,c,l,d,h){super(r5t,i,s,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};qze=D([_(2,be),_(3,Re),_(4,Ai),_(5,Ti),_(6,Di),_(7,rD),_(8,pn),_(9,eo),_(10,tr)],qze);var NT;(function(n){n[n.Basic=1]="Basic",n[n.Full=2]="Full"})(NT||(NT={}));let PEe=class extends T7{constructor(e,t,i,s,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=s,this.decorationsService=o,this.labelService=r,this.textFileService=a,this.contextService=c,this.notebookDocumentService=l,this._onDidRender=this._register(new I),this.onDidRender=this._onDidRender.event,this.label=void 0,this.decoration=this._register(new Dn),this.options=void 0,this.computedIconClasses=void 0,this.computedLanguageId=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0,this.needsRedraw=void 0,this.isHidden=!1}notifyVisibilityChanged(e){e===this.isHidden&&(this.isHidden=!e,e&&this.needsRedraw&&(this.render({updateIcon:this.needsRedraw===NT.Full,updateDecoration:this.needsRedraw===NT.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=SC(this.label);t&&_n(e.uri,t)&&this.computedLanguageId!==e.getLanguageId()&&(this.computedLanguageId=e.getLanguageId(),this.render({updateIcon:!0,updateDecoration:!1}))}notifyFileDecorationsChanges(e){if(!this.options)return!1;const t=SC(this.label);return t&&this.options.fileDecorations&&e.affectsResource(t)?this.render({updateIcon:!1,updateDecoration:!0}):!1}notifyExtensionsRegistered(){this.render({updateIcon:!0,updateDecoration:!1})}notifyThemeChange(){this.render({updateIcon:!1,updateDecoration:!1})}notifyFileAssociationsChange(){this.render({updateIcon:!0,updateDecoration:!1})}notifyFormattersChange(e){SC(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){_n(e,SC(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=SC(this.label);P.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let s;if(!i){if(t?.fileKind===Ic.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(s=r.name,this.computedWorkspaceFolderLabel=s)}s||(s=Ay(Mx(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(ma(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:s,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=SC(e),s=e?.resource&&!P.isUri(e.resource);if(!t.forceLabel&&!s&&i?.scheme===_e.untitled){const l=this.textFileService.untitled.get(i);if(l&&!l.hasAssociatedFilePath){if(typeof e.name=="string"&&(e.name=l.name),typeof e.description=="string"){const h=l.resource.path;e.name!==h?e.description=h:e.description=void 0}const d=l.resource.path;l.name!==d?t.title=`${l.name} • ${d}`:t.title=d}}if(!t.forceLabel&&!s&&i?.scheme===_e.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`))}const o=this.hasResourceChanged(e),r=o||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,o&&(this.computedLanguageId=void 0),r&&(this.computedPathLabel=void 0),this.render({updateIcon:o||a||c,updateDecoration:o||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=SC(e),i=SC(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=SC(e);return!!t&&this.computedPathLabel!==this.labelService.getUriLabel(t)}hasIconChanged(e){return this.options?.icon!==e?.icon}clear(){this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.setLabel("")}render(e){if(this.isHidden)return this.needsRedraw!==NT.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?NT.Full:NT.Basic),!1;if(e.updateIcon&&(this.computedIconClasses=void 0),!this.label)return!1;const t={title:"",italic:this.options?.italic,strikethrough:this.options?.strikethrough,matches:this.options?.matches,descriptionMatches:this.options?.descriptionMatches,extraClasses:[],separator:this.options?.separator,domId:this.options?.domId,disabledCommand:this.options?.disabledCommand,labelEscapeNewLines:this.options?.labelEscapeNewLines,descriptionTitle:this.options?.descriptionTitle},i=SC(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==_e.data&&(!this.options?.title||typeof this.options.title!="string"&&!this.options.title.markdownNotSupportedFallback)&&(this.computedPathLabel||(this.computedPathLabel=this.labelService.getUriLabel(i)),!t.title||typeof t.title=="string"?t.title=this.computedPathLabel:t.title.markdownNotSupportedFallback||(t.title.markdownNotSupportedFallback=this.computedPathLabel)),this.options&&!this.options.hideIcon&&(this.computedIconClasses||(this.computedIconClasses=lI(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),P.isUri(this.options.icon)&&(t.iconPath=this.options.icon),t.extraClasses=this.computedIconClasses.slice(0)),this.options?.extraClasses&&t.extraClasses.push(...this.options.extraClasses),this.options?.fileDecorations&&i){e.updateDecoration&&(this.decoration.value=this.decorationsService.getDecoration(i,this.options.fileKind!==Ic.FILE));const s=this.decoration.value;if(s){if(s.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${s.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${s.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}s.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(s.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(s.badgeClassName),t.extraClasses.push(s.iconClassName))}}return this.label.range&&(t.suffix=this.label.range.startLineNumber!==this.label.range.endLineNumber?`:${this.label.range.startLineNumber}-${this.label.range.endLineNumber}`:`:${this.label.range.startLineNumber}`),this.setLabel(this.label.name??"",this.label.description,t),this._onDidRender.fire(),!0}dispose(){super.dispose(),this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0}};PEe=D([_(2,Di),_(3,Ai),_(4,rD),_(5,eo),_(6,tr),_(7,Ti),_(8,Aet)],PEe);const QFe="vs/workbench/contrib/chat/browser/actions/chatExecuteActions",Wce=class Wce extends pi{constructor(){super({id:Wce.ID,title:Be(QFe,0,"Send"),f1:!1,category:tst,icon:Ce.send,precondition:ge.and(eFe,j7.negate()),keybinding:{when:tFe,primary:E.Enter,weight:ye.EditorContrib},menu:[{id:Te.ChatExecuteSecondary,group:"group_1"},{id:Te.ChatExecute,when:j7.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],s=e.get(lL);(i?.widget??s.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Wce.ID="workbench.action.chat.submit";let FEe=Wce;const Hce=class Hce extends pi{constructor(){super({id:Hce.ID,title:Be(QFe,1,"Submit to Secondary Agent"),precondition:ge.and(eFe,gtt.negate(),j7.negate()),keybinding:{when:tFe,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib},menu:{id:Te.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(yp).getSecondaryAgent();if(!o)return;const r=e.get(lL),a=i?.widget??r.lastFocusedWidget;a&&(_zt(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${$z}${o.name}`)))}};Hce.ID="workbench.action.chat.submitSecondaryAgent";let OEe=Hce;const Uce=class Uce extends pi{constructor(){super({id:Uce.ID,title:Be(QFe,3,"Cancel"),f1:!1,category:tst,icon:Ce.debugStop,menu:{id:Te.ChatExecute,when:j7,group:"navigation"},keybinding:{weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.Escape}})}run(e,...t){const i=t[0],s=e.get(lL),o=i?.widget??s.lastFocusedWidget;if(!o)return;const r=e.get(Rw);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Uce.ID="workbench.action.chat.cancel";let BEe=Uce;const a5t="vs/workbench/contrib/chat/browser/chatFollowups",c5t=we;let $ie=class extends ${constructor(e,t,i,s,o,r){super(),this.location=i,this.options=s,this.clickHandler=o,this.chatAgentService=r;const a=he(e,c5t(".interactive-session-followups"));t.forEach(c=>this.renderFollowup(a,c))}renderFollowup(e,t){if(!this.chatAgentService.getDefaultAgent(this.location))return;let i="";if("agentId"in t&&t.agentId&&t.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const c=this.chatAgentService.getAgent(t.agentId);if(!c)return;i+=`${$z}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${O1}${t.subCommand} `)}const s=t.kind==="reply"?t.title||t.message:t.title,o=t.kind==="reply"?t.message:t.title,r=(i+("tooltip"in t&&t.tooltip||o)).trim(),a=this._register(new Tu(e,{...this.options,title:r}));t.kind==="reply"?a.element.classList.add("interactive-followup-reply"):t.kind==="command"&&a.element.classList.add("interactive-followup-command"),a.element.ariaLabel=g(a5t,0,"Follow up question: {0}",s),a.label=new Xt(s),this._register(a.onDidClick(()=>this.clickHandler(t)))}};$ie=D([_(5,yp)],$ie);var QJ;const ND="vs/workbench/contrib/chat/browser/chatInputPart",LL=we,Qze=250;var I0;let b6=(I0=class extends ${get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,s,o,r,a,c,l){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=s,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this._onDidLoadInputState=this._register(new I),this.onDidLoadInputState=this._onDidLoadInputState.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidAcceptFollowup=this._register(new I),this.onDidAcceptFollowup=this._onDidAcceptFollowup.event,this._indexOfLastAttachedContextDeletedWithKeyboard=-1,this._attachedContext=new Set,this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.onHistoryEntry=!1,this.inHistoryNavigation=!1,this.inputUri=P.parse(`${QJ.INPUT_SCHEME}:input-${QJ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?Qze/3:Qze,this.inputEditorHasText=eFe.bindTo(r),this.chatCursorAtTop=XPt.bindTo(r),this.inputEditorHasFocus=YPt.bindTo(r),this.history=new Bbe([],5),this._register(this.historyService.onDidClearHistory(()=>this.history.clear())),this._register(this.configurationService.onDidChangeConfiguration(d=>{d.affectsConfiguration(ua.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}_getAriaLabel(){if(this.configurationService.getValue(ua.Chat)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();return t?g(ND,0,"Chat Input, Type to ask questions or type / for topics, press enter to send out the request. Use {0} for Chat Accessibility Help.",t):g(ND,1,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(ND,2,"Chat Input")}setState(e){const t=this.historyService.getHistory(this.location);this.history=new Bbe(t,50),typeof e=="string"&&this.setValue(e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.navigateHistory(!0)}showNextValue(){this.navigateHistory(!1)}navigateHistory(e){const t=(e?this.history.previous()??this.history.first():this.history.next())??{text:""};if(this.onHistoryEntry=e||this.history.current()!==null,Cu(t.text),this.inHistoryNavigation=!0,this.setValue(t.text),this.inHistoryNavigation=!1,this._onDidLoadInputState.fire(t.state),e)this._inputEditor.setPosition({lineNumber:1,column:1});else{const i=this._inputEditor.getModel();if(!i)return;this._inputEditor.setPosition(jze(i))}}setValue(e){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1})}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e,t){if(e){let i=this.history.getHistory().find(s=>s.text===e);i?i.state=t:i={text:e,state:t},this.history.add(i)}this.accessibilityService.isScreenReaderOptimized()&&ei?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(this._inputEditorElement.removeChild(e),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}attachContext(...e){for(const t of e)this.attachedContext.add(t);this.initAttachedContext(this.attachedContextContainer)}render(e,t,i){this.container=he(e,LL(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=he(this.container,LL(".interactive-input-followups")),this.attachedContextContainer=he(this.container,LL(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const s=he(this.container,LL(".interactive-input-and-side-toolbar")),o=he(s,LL(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));tFe.bindTo(r).set(!0);const a=this.instantiationService.createChild(new Dl([Pe,r])),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(dhe(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=qFe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=iYe,d.fontSize=13,d.lineHeight=20,d.padding=this.options.renderStyle==="compact"?{top:2,bottom:2}:{top:8,bottom:8},d.cursorWidth=1,d.wrappingStrategy="advanced",d.bracketPairColorization={enabled:!1},d.suggest={showIcons:!1,showSnippets:!1,showWords:!0,showStatusBar:!1,insertMode:"replace"},d.scrollbar={...d.scrollbar??{},vertical:"hidden"},this._inputEditorElement=he(o,LL(".interactive-input-editor"));const h=Zzt();if(h.contributions?.push(...b_.getSomeEditorContributions([Nc.ID])),this._inputEditor=this._register(a.createInstance(_1,this._inputEditorElement,d,h)),this._register(this._inputEditor.onDidChangeModelContent(()=>{const f=Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight);f!==this.inputEditorHeight&&(this.inputEditorHeight=f,this._onDidChangeHeight.fire());const p=this._inputEditor.getModel(),m=!!p&&p.getValue().trim().length>0;this.inputEditorHasText.set(m),this.inHistoryNavigation||(this.onHistoryEntry=!1),this.onHistoryEntry||(this.historyNavigationForewardsEnablement.set(!m),this.historyNavigationBackwardsEnablement.set(!m))})),this._register(this._inputEditor.onDidFocusEditorText(()=>{this.inputEditorHasFocus.set(!0),this._onDidFocus.fire(),o.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),o.classList.toggle("focused",!1),this._onDidBlur.fire()})),this._register(this._inputEditor.onDidChangeCursorPosition(f=>{const p=this._inputEditor.getModel();if(!p)return;const m=f.position.column===1&&f.position.lineNumber===1;this.chatCursorAtTop.set(m),this.onHistoryEntry&&(this.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(jze(p))))})),this.toolbar=this._register(this.instantiationService.createInstance(nC,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:wS.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===cc.Panel&&(f.id===FEe.ID||f.id===BEe.ID)&&f instanceof id){const m=this.instantiationService.createInstance(id,{id:"chat.moreExecuteActions",title:g(ND,3,"More..."),icon:Ce.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(WEe,f,m)}}})),this.toolbar.getElement().classList.add("interactive-execute-toolbar"),this.toolbar.context={widget:i},this._register(this.toolbar.onDidChangeMenuItems(()=>{this.cachedDimensions&&typeof this.cachedToolbarWidth=="number"&&this.cachedToolbarWidth!==this.toolbar.getItemsWidth()&&this.layout(this.cachedDimensions.height,this.cachedDimensions.width)})),this.options.menus.inputSideToolbar){const f=this._register(this.instantiationService.createInstance(nC,s,this.options.menus.inputSideToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0}}));this.inputSideToolbarContainer=f.getElement(),f.getElement().classList.add("chat-side-toolbar"),f.context={widget:i}}let u=this.modelService.getModel(this.inputUri);if(u||(u=this.modelService.createModel("",null,this.inputUri,!0),this._register(u)),this.inputModel=u,this.inputModel.updateOptions({bracketColorizationOptions:{enabled:!1,independentColorPoolPerBracketType:!1}}),this._inputEditor.setModel(this.inputModel),t){this.inputModel.setValue(t);const f=this.inputModel.getLineCount();this._inputEditor.setPosition({lineNumber:f,column:this.inputModel.getLineMaxColumn(f)})}}initAttachedContext(e){Yo(e),this.attachedContextDisposables.clear(),_je(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((t,i)=>{const s=he(e,LL(".chat-attached-context-attachment.show-file-icons")),o=this._contextResourceLabels.create(s,{supportIcons:!0}),r=P.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&P.isUri(t.value.uri)?t.value.uri:void 0,a=t.value&&typeof t.value=="object"&&"range"in t.value&&O.isIRange(t.value.range)?t.value.range:void 0;if(r&&t.isFile){const d=yr(r.path),h=lS(r.path),u=`${d} ${h}`,f=a?g(ND,4,"Attached file, {0}, line {1} to line {2}",u,a.startLineNumber,a.endLineNumber):g(ND,5,"Attached file, {0}",u);o.setFile(r,{fileKind:Ic.FILE,hidePath:!0,range:a}),s.ariaLabel=f,s.tabIndex=0}else{const d=t.fullName??t.name;o.setLabel(d,void 0),s.ariaLabel=g(ND,6,"Attached context, {0}",t.name),s.tabIndex=0}const c=new Tu(s,{supportIcons:!0});i===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&c.focus(),this.attachedContextDisposables.add(c),c.icon=Ce.close;const l=c.onDidClick(d=>{if(this.attachedContext.delete(t),l.dispose(),Sv(d)){const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=i)}this._onDidChangeHeight.fire(),this._onDidDeleteContext.fire(t)});this.attachedContextDisposables.add(l)})}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Yo(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance($ie,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))))}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new Tn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const s=this.getLayoutData(),o=Math.min(s.inputPartEditorHeight,e-s.followupsHeight-s.inputPartVerticalPadding);this._inputPartHeight=s.followupsHeight+o+s.inputPartVerticalPadding+s.inputEditorBorder+s.implicitContextHeight;const r=this._inputEditor.getScrollWidth(),c={width:t-s.inputPartHorizontalPadding-s.editorBorder-s.editorPadding-s.executeToolbarWidth-s.sideToolbarWidth-s.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==c.width||this.previousInputEditorDimension.height!==c.height)&&(this._inputEditor.layout(c),this.previousInputEditorDimension=c),i&&r<10)return this._layout(e,t,!1)}getLayoutData(){return{inputEditorBorder:2,followupsHeight:this.followupsContainer.offsetHeight,inputPartEditorHeight:Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight),inputPartHorizontalPadding:this.options.renderStyle==="compact"?8:40,inputPartVerticalPadding:this.options.renderStyle==="compact"?12:24,implicitContextHeight:this.attachedContextContainer.offsetHeight,editorBorder:2,editorPadding:12,toolbarPadding:4,executeToolbarWidth:this.cachedToolbarWidth=this.toolbar.getItemsWidth(),sideToolbarWidth:this.inputSideToolbarContainer?du(this.inputSideToolbarContainer)+4:0}}saveState(){const e=this.history.getHistory();this.historyService.saveHistory(this.location,e)}},QJ=I0,I0.INPUT_SCHEME="chatSessionInput",I0._counter=0,I0);b6=QJ=D([_(2,WZe),_(3,Ai),_(4,be),_(5,Pe),_(6,Re),_(7,ti),_(8,Ur)],b6);function jze(n){return{lineNumber:n.getLineCount(),column:n.getLineLength(n.getLineCount())+1}}let WEe=class extends NEe{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,[],"",s,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(Te.ChatExecuteSecondary,r),u=()=>{const f=[];tD(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===OEe.ID&&(m.label=g(ND,7,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};WEe=D([_(2,mc),_(3,Vr),_(4,yp),_(5,Pe),_(6,ti),_(7,Pi),_(8,pn),_(9,Ur)],WEe);var l5t='.monaco-action-bar .action-item .action-label.extension-action{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-action-bar .action-dropdown-item>.action-label.extension-action.label,.monaco-action-bar .action-item>.action-label.extension-action.label{padding:0 5px}.monaco-action-bar .action-dropdown-item>.monaco-dropdown .action-label{padding:0}.monaco-action-bar .action-item .action-label.extension-action.label{outline-offset:1px}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.text{height:auto;line-height:14px;width:auto}.monaco-action-bar .action-item .action-label.extension-action.built-in-status{border-color:var(--vscode-foreground)}.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{background-color:var(--vscode-extensionButton-background)!important}.monaco-action-bar .action-item .action-label.extension-action.label{color:var(--vscode-extensionButton-foreground)!important}.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label:hover{background-color:var(--vscode-extensionButton-hoverBackground)!important}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{background-color:var(--vscode-extensionButton-separator)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator.prominent{background-color:var(--vscode-extensionButton-prominentBackground)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent{color:var(--vscode-extensionButton-prominentForeground)!important}.monaco-action-bar .action-item.action-item:not(.disabled) .action-label.extension-action.label.prominent:hover{background-color:var(--vscode-extensionButton-prominentHoverBackground)}.monaco-action-bar .action-item .action-label.extension-action:not(.disabled){border:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{border-bottom:1px solid var(--vscode-contrastBorder);border-top:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-error{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info{color:var(--vscode-editorInfo-foreground)}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.icon,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.text{margin-top:2px}.monaco-action-bar .action-item .action-label.extension-action.manage.hide,.monaco-action-bar .action-item.action-dropdown-item .action-label.extension-action.hide,.monaco-action-bar .action-item.action-dropdown-item.disabled,.monaco-action-bar .action-item.checkbox-action-item.disabled,.monaco-action-bar .action-item.disabled .action-label.disable-status.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.extension-sync,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide-when-disabled,.monaco-action-bar .action-item.disabled .action-label.extension-action.ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.install:not(.installing),.monaco-action-bar .action-item.disabled .action-label.extension-action.language,.monaco-action-bar .action-item.disabled .action-label.extension-action.migrate,.monaco-action-bar .action-item.disabled .action-label.extension-action.reload,.monaco-action-bar .action-item.disabled .action-label.extension-action.theme,.monaco-action-bar .action-item.disabled .action-label.extension-action.undo-ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.uninstall:not(.uninstalling),.monaco-action-bar .action-item.disabled .action-label.extension-action.update,.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide,.monaco-action-bar .action-item.disabled .action-label.extension-status.hide{display:none}.monaco-action-bar .extension-action.label{display:inherit}.monaco-action-bar .action-item.disabled .action-label.extension-status:before{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-status-label:before{content:"\\2713";padding-right:4px}.monaco-action-bar .action-item.disabled .action-label.extension-action{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-action.text{font-style:italic;opacity:.9}';Ct(l5t,{});const k5="vs/workbench/contrib/extensions/common/extensionsFileTemplate",d5t="vscode://schemas/extensions";g(k5,0,"Extensions"),g(k5,1,"List of extensions which should be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(k5,3,"List of extensions recommended by VS Code that should not be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const Kze=["{"," // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations."," // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp",""," // List of extensions which should be recommended for users of this workspace.",' "recommendations": ['," "," ],"," // List of extensions recommended by VS Code that should not be recommended for users of this workspace.",' "unwantedRecommendations": ['," "," ]","}"].join(` -`),h5t="vs/workbench/services/extensionManagement/common/extensionManagement";var Yze;(function(n){n[n.Local=1]="Local",n[n.Remote=2]="Remote",n[n.Web=3]="Web"})(Yze||(Yze={}));g(h5t,0,"Extensions");var ga;(function(n){n[n.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",n[n.DisabledByExtensionKind=1]="DisabledByExtensionKind",n[n.DisabledByEnvironment=2]="DisabledByEnvironment",n[n.EnabledByEnvironment=3]="EnabledByEnvironment",n[n.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",n[n.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",n[n.DisabledGlobally=6]="DisabledGlobally",n[n.DisabledWorkspace=7]="DisabledWorkspace",n[n.EnabledGlobally=8]="EnabledGlobally",n[n.EnabledWorkspace=9]="EnabledWorkspace"})(ga||(ga={}));var HEe;(function(n){n[n.Workspace=0]="Workspace",n[n.File=1]="File",n[n.Executable=2]="Executable",n[n.WorkspaceConfig=3]="WorkspaceConfig",n[n.DynamicWorkspace=4]="DynamicWorkspace",n[n.Experimental=5]="Experimental",n[n.Application=6]="Application"})(HEe||(HEe={}));const Gie="vs/workbench/browser/actions/workspaceCommands",u5t="addRootFolder";Be(Gie,0,"Add Folder to Workspace...");const g5t="setRootFolder",nst="_workbench.pickWorkspaceFolder";yt.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:n=>n.get(bf).pickFileFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"_files.pickFolderAndOpen",handler:(n,e)=>n.get(bf).pickFolderAndOpen(e)});yt.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:n=>n.get(bf).pickFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:n=>n.get(bf).pickFileAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:n=>n.get(bf).pickWorkspaceAndOpen({forceNewWindow:!0})});yt.registerCommand({id:u5t,handler:async n=>{const e=n.get($S),t=await sst(n);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});yt.registerCommand({id:g5t,handler:async n=>{const e=n.get($S),t=n.get(Ti),i=await sst(n);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(s=>({uri:s})))}});async function sst(n){const e=n.get(bf),t=n.get(Lm);return await e.showOpenDialog({openLabel:YPe(g(Gie,1,"&&Add")),title:g(Gie,2,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}yt.registerCommand(nst,async function(n,e){const t=n.get(On),i=n.get(eo),s=n.get(Ti),o=n.get(Ai),r=n.get(Di),a=s.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(ma(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:lI(o,r,u.uri,Ic.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(Gie,3,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||qe.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});yt.registerCommand({id:"vscode.openFolder",handler:(n,e,t)=>{const i=n.get(Qi);if(typeof t=="boolean"&&(t={forceNewWindow:t}),!e){const a={forceNewWindow:t?.forceNewWindow};return t?.forceLocalWindow&&(a.remoteAuthority=null,a.availableFileSystems=["file"]),i.executeCommand("_files.pickFolderAndOpen",a)}const s=P.from(e,!0),o={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},r=yde(s)||s.scheme===_e.untitled?{workspaceUri:s}:{folderUri:s};return i.executeCommand("_files.windowOpen",[r],o)},metadata:{description:"Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.",args:[{name:"uri",description:"(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder",constraint:n=>n==null||n instanceof P},{name:"options",description:"(optional) Options. Object with the following properties: `forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. `noRecentEntry`: Whether the opened URI will appear in the 'Open Recent' list. Defaults to false. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.",constraint:n=>n===void 0||typeof n=="object"||typeof n=="boolean"}]}});yt.registerCommand({id:"vscode.newWindow",handler:(n,e)=>{const t=n.get(Qi),i={forceReuseWindow:e&&e.reuseWindow,remoteAuthority:e&&e.remoteAuthority};return t.executeCommand("_files.newWindow",i)},metadata:{description:"Opens an new window depending on the newWindow argument.",args:[{name:"options",description:"(optional) Options. Object with the following properties: `reuseWindow`: Whether to open a new window or the same. Defaults to opening in a new window. ",constraint:n=>n===void 0||typeof n=="object"}]}});yt.registerCommand("_workbench.removeFromRecentlyOpened",function(n,e){return n.get(cL).removeRecentlyOpened([e])});yt.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(n,e)=>{const t=n.get(cL);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?P.parse(e):P.file(e):e=P.revive(e),t.removeRecentlyOpened([e])},metadata:{description:"Removes an entry with the given path from the recently opened list.",args:[{name:"path",description:"URI or URI string to remove from recently opened.",constraint:n=>typeof n=="string"||n instanceof P}]}});yt.registerCommand("_workbench.addToRecentlyOpened",async function(n,e){const t=n.get(cL),i=e.uri,s=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:s,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:s,remoteAuthority:o}:r={fileUri:i,label:s,remoteAuthority:o},t.addRecentlyOpened([r])});yt.registerCommand("_workbench.getRecentlyOpened",async function(n){return n.get(cL).getRecentlyOpened()});const ZQ=pn,tB="vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig",p2=".vscode/extensions.json";let Jze=class extends ${constructor(e,t,i,s,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=s,this.languageService=o,this.jsonEditingService=r,this._onDidChangeExtensionsConfigs=this._register(new I),this.onDidChangeExtensionsConfigs=this._onDidChangeExtensionsConfigs.event,this._register(e.onDidChangeWorkspaceFolders(a=>this._onDidChangeExtensionsConfigs.fire())),this._register(t.onDidFilesChange(a=>{const c=e.getWorkspace();(c.configuration&&a.affects(c.configuration)||c.folders.some(l=>a.affects(l.toResource(p2))))&&this._onDidChangeExtensionsConfigs.fire()}))}async getExtensionsConfigs(){const e=this.workspaceContextService.getWorkspace(),t=[],i=e.configuration?await this.resolveWorkspaceExtensionConfig(e.configuration):void 0;return i&&t.push(i),t.push(...await Promise.all(e.folders.map(s=>this.resolveWorkspaceFolderExtensionConfig(s)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return Lc(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return Lc(e.flatMap(t=>t.unwantedRecommendations?t.unwantedRecommendations.map(i=>i.toLowerCase()):[]))}async toggleRecommendation(e){e=e.toLowerCase();const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>s.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)cbe(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,s.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>s.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)cbe(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,s.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,s){const o=[];if(s){Array.isArray(i.recommendations)?o.push({path:["recommendations",-1],value:e}):o.push({path:["recommendations"],value:[e]});const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","recommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&o.push(a)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,s){const o=[];if(s){const r=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const s=t?[...e,t]:[...e];if(s.length===1)return s;const o=e.map(a=>({label:a.name,description:g(tB,2,"Workspace Folder"),workspaceOrFolder:a,iconClasses:lI(this.modelService,this.languageService,a.uri,Ic.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(tB,3,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(o,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=ow(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(p2)),i=ow(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:Lc((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:Lc((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const s=t?.indexOf(i);if(s!==void 0&&s!==-1)return{path:[...e,s],value:void 0}}};Jze=D([_(0,Ti),_(1,ci),_(2,On),_(3,Ai),_(4,Di),_(5,dL)],Jze);const hl="vs/workbench/contrib/extensions/browser/extensionsIcons";ji("extensions-view-icon",Ce.extensions,g(hl,0,"View icon of the extensions view."));const f5t=ji("extensions-manage",Ce.gear,g(hl,1,"Icon for the 'Manage' action in the extensions view."));ji("extensions-clear-search-results",Ce.clearAll,g(hl,2,"Icon for the 'Clear Search Result' action in the extensions view."));ji("extensions-refresh",Ce.refresh,g(hl,3,"Icon for the 'Refresh' action in the extensions view."));ji("extensions-filter",Ce.filter,g(hl,4,"Icon for the 'Filter' action in the extensions view."));ji("extensions-install-local-in-remote",Ce.cloudDownload,g(hl,5,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));ji("extensions-install-workspace-recommended",Ce.cloudDownload,g(hl,6,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));ji("extensions-configure-recommended",Ce.pencil,g(hl,7,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const p5t=ji("extensions-sync-enabled",Ce.sync,g(hl,8,"Icon to indicate that an extension is synced.")),m5t=ji("extensions-sync-ignored",Ce.syncIgnored,g(hl,9,"Icon to indicate that an extension is ignored when syncing."));ji("extensions-remote",Ce.remote,g(hl,10,"Icon to indicate that an extension is remote in the extensions view and editor."));ji("extensions-install-count",Ce.cloudDownload,g(hl,11,"Icon shown along with the install count in the extensions view and editor."));ji("extensions-rating",Ce.star,g(hl,12,"Icon shown along with the rating in the extensions view and editor."));const _5t=ji("extensions-verified-publisher",Ce.verifiedFilled,g(hl,13,"Icon used for the verified extension publisher in the extensions view and editor."));ji("extensions-pre-release",Ce.versions,g(hl,14,"Icon shown for extensions having pre-release versions in extensions view and editor."));ji("extensions-sponsor",Ce.heartFilled,g(hl,15,"Icon used for sponsoring extensions in the extensions view and editor."));ji("extensions-star-full",Ce.starFull,g(hl,16,"Full star icon used for the rating in the extensions editor."));ji("extensions-star-half",Ce.starHalf,g(hl,17,"Half star icon used for the rating in the extensions editor."));ji("extensions-star-empty",Ce.starEmpty,g(hl,18,"Empty star icon used for the rating in the extensions editor."));const DR=ji("extensions-error-message",Ce.error,g(hl,19,"Icon shown with a error message in the extensions editor.")),Of=ji("extensions-warning-message",Ce.warning,g(hl,20,"Icon shown with a warning message in the extensions editor.")),ay=ji("extensions-info-message",Ce.info,g(hl,21,"Icon shown with an info message in the extensions editor.")),I5=ji("extension-workspace-trust",Ce.shield,g(hl,22,"Icon shown with a workspace trust message in the extension editor."));ji("extension-activation-time",Ce.history,g(hl,23,"Icon shown with a activation time message in the extension editor."));function UEe(n){return n.scheme!==_e.file&&n.scheme!==_e.vscodeRemote}function jFe(n){if(n.folders.length)return n.folders.every(e=>UEe(e.uri))?n.folders[0].uri:void 0;if(n.configuration&&UEe(n.configuration))return n.configuration}function v5t(n){return jFe(n)?.scheme}function ost(n){return jFe(n)!==void 0}const w5t="vs/platform/languagePacks/common/languagePacks";function Phe(n){return n.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let Xze=class extends ${constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ai;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const s=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=Phe(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return s.push(this.createQuickPickItem("en","English")),s}createQuickPickItem(e,t,i){const s=t??e;let o;if(s!==e&&(o=`(${e})`),e.toLowerCase()===Gd.toLowerCase()&&(o??="",o+=g(w5t,0," (Current)")),i?.installCount){o??="";const r=i.installCount;let a;r>1e6?a=`${Math.floor(r/1e5)/10}M`:r>1e3?a=`${Math.floor(r/1e3)}K`:a=String(r),o+=` $(cloud-download) ${a}`}return{id:e,label:s,description:o}}};Xze=D([_(0,aL)],Xze);var VEe,tT,vA,PD,jJ,AB,iT,FD,KJ,YJ,JJ,XJ,ZJ,EB,OD,BD,WD,HD,UD,eX,tX,iX,nX,xB,DB,VD,sX,oX;const Me="vs/workbench/contrib/extensions/browser/extensionsActions";let $V=class extends xn{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=s,this.productService=o,this.openerService=r,this.notificationService=a,this.dialogService=c,this.commandService=l,this.logService=d,this.extensionManagementServerService=h,this.instantiationService=u,this.galleryService=f,this.extensionManifestPropertiesService=p}async run(){if(Na(this.error))return;if(this.logService.error(this.error),this.error.name===EA.Unsupported){const r=Jn?g(Me,0,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(Me,1,"The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",this.extension.displayName||this.extension.identifier.id,r),{confirmed:c}=await this.dialogService.confirm({type:nt.Info,message:a,primaryButton:g(Me,2,"&&More Information"),cancelButton:g(Me,3,"Close")});c&&this.openerService.open(Jn?P.parse("https://aka.ms/vscode-web-extensions-guide"):P.parse("https://aka.ms/vscode-remote"));return}if(EA.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:lg(this.error),buttons:[{label:g(Me,4,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(GV,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}if([EA.Incompatible,EA.IncompatibleTargetPlatform,EA.Malicious,EA.Deprecated].includes(this.error.name)){await this.dialogService.info(lg(this.error));return}if(EA.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(Me,6,"{0} cannot verify the '{1}' extension. Are you sure you want to install it?",this.productService.nameLong,this.extension.displayName||this.extension.identifier.id),buttons:[{label:g(Me,7,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(GV,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}const e=this.installOperation===Bx.Update?g(Me,8,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(Me,9,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],s=await this.getDownloadUrl();s&&(t=g(Me,10,"Please check the [log]({0}) for more details.",`command:${MBt}`),i.push({label:g(Me,11,"Try Downloading Manually..."),run:()=>this.openerService.open(s).then(()=>{this.notificationService.prompt(nt.Info,g(Me,12,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(Me,13,"Install from VSIX..."),run:()=>this.commandService.executeCommand(gBt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(nt.Error,o,i)}async getDownloadUrl(){if(I_||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Hs.UNIVERSAL&&e!==Hs.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,qe.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Hs.UNKNOWN)return P.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Hs.UNDEFINED?`?targetPlatform=${e}`:""}`)}};$V=D([_(4,Ja),_(5,fr),_(6,Pi),_(7,To),_(8,Qi),_(9,Ze),_(10,Mw),_(11,be),_(12,aL),_(13,G_)],$V);const WA=class WA extends xn{constructor(){super(...arguments),this._extension=null}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}};WA.EXTENSION_ACTION_CLASS="extension-action",WA.TEXT_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} text`,WA.LABEL_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} label`,WA.ICON_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} icon`;let kn=WA;class KFe extends kn{get menuActions(){return[...this._menuActions]}get extension(){return super.extension}set extension(e){this.extensionActions.forEach(t=>t.extension=e),super.extension=e}constructor(e,t,i){super(e,t),this.actionsGroups=i,this._menuActions=[],this.extensionActions=i.flat(),this.update(),this._register(T.any(...this.extensionActions.map(s=>s.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(s=>this._register(s))}update(e){e||this.extensionActions.forEach(o=>o.update());const t=this.actionsGroups.map(o=>o.filter(r=>r.enabled));let i=[];for(const o of t)o.length&&(i=[...i,...o,new Kr]);i=i.length?i.slice(0,i.length-1):i,this.action=i[0],this._menuActions=i.length>1?i:[],this.enabled=!!this.action,this.action&&(this.label=this.getLabel(this.action),this.tooltip=this.action.tooltip);let s=(this.action||this.extensionActions[0])?.class||"";s=s?`${s} action-dropdown`:"action-dropdown",this._menuActions.length===0&&(s+=" action-dropdown"),this.class=s}run(){return this.extensionActions.filter(t=>t.enabled)[0].run()}getLabel(e){return e.label}}var eP;let GV=(eP=class extends kn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,s,o,r,a,c,l,d){super("extensions.install",g(Me,14,"Install"),VEe.Class,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=s,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new tQ,this.options={...e,isMachineScoped:!1},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Fr.Uninstalled&&await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=this.options.installPreReleaseVersion?this.extension.hasPreReleaseVersion:this.extension.hasReleaseVersion,this.updateLabel()))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(Me,15,"This extension is deprecated as it is no longer being maintained."),i;(function(r){r[r.InstallAnyway=0]="InstallAnyway",r[r.ShowAlternateExtension=1]="ShowAlternateExtension",r[r.ConfigureSettings=2]="ConfigureSettings",r[r.Cancel=3]="Cancel"})(i||(i={}));const s=[{label:g(Me,7,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(Me,16,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;s.push({label:g(Me,17,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],qe.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(Me,18,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;s.push({label:g(Me,19,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Xt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:nt.Warning,message:g(Me,20,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:zt(t)?t:void 0,custom:zt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:s,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.telemetryService.publicLog("extensions:action:install",{...this.extension.telemetryData,actionId:this.id});const e=await this.install(this.extension);if(e?.local){sa(g(Me,22,"Installing extension {0} is completed.",this.extension.displayName));const t=await this.getRunningExtension(e.local);if(t&&!(t.activationEvents&&t.activationEvents.some(i=>i.startsWith("onLanguage")))){const i=await this.getThemeAction(e);if(i){i.extension=e;try{return i.run({showCurrentTheme:!0,ignoreFocusLost:!0})}finally{i.dispose()}}}}}async getThemeAction(e){if((await this.workbenchThemeService.getColorThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(JEe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(XEe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(ZEe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(ME(e))?new Promise((i,s)=>{const o=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const r=await this.runtimeExtensionService.getExtension(e.identifier.id);r&&(o.dispose(),i(r))})}):null)}updateLabel(){this.label=this.getLabel()}getLabel(e){return this.extension?.isWorkspaceScoped&&this.extension.resourceExtension&&this.contextService.isInsideWorkspace(this.extension.resourceExtension.location)?g(Me,23,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(Me,24,"Install Pre-Release"):g(Me,25,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(Me,14,"Install"):g(Me,26,"Install Release Version"):g(Me,14,"Install")}},VEe=eP,eP.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,eP);GV=VEe=D([_(1,pr),_(2,be),_(3,ho),_(4,ZQ),_(5,eo),_(6,To),_(7,TQ),_(8,on),_(9,Ti)],GV);let Zze=class extends KFe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions","",[[e.createInstance(GV,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(GV,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};Zze=D([_(0,be),_(1,pr)],Zze);const iR=class iR extends kn{constructor(){super("extension.installing",iR.LABEL,iR.CLASS,!1)}update(){this.class=`${iR.CLASS}${this.extension&&this.extension.state===Fr.Installing?"":" hide"}`}};iR.LABEL=g(Me,27,"Installing"),iR.CLASS=`${kn.LABEL_ACTION_CLASS} install installing`;let e5e=iR;var By;let qV=(By=class extends kn{constructor(e,t,i,s,o,r){super(e,tT.INSTALL_LABEL,tT.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=s,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=tT.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>uc(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Fr.Installing&&!e.local&&(this.enabled=!0,this.label=tT.INSTALLING_LABEL,this.class=tT.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Fr.Installed||this.extension.type!==qr.User||this.extension.enablementState===ga.DisabledByEnvironment||this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByVirtualWorkspace?!1:!!(hPe(this.extension.local.manifest)||this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)||this.server===this.extensionManagementServerService.webExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)||this.canInstallAnyWhere&&(this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)))}async run(){if(this.extension?.local&&this.extension?.server&&this.server)return this.extensionsWorkbenchService.open(this.extension),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.extensionsWorkbenchService.installInServer(this.extension,this.server)}},tT=By,By.INSTALL_LABEL=g(Me,14,"Install"),By.INSTALLING_LABEL=g(Me,27,"Installing"),By.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,By.InstallingClass=`${kn.LABEL_ACTION_CLASS} install installing`,By);qV=tT=D([_(3,pr),_(4,Mw),_(5,G_)],qV);let zEe=class extends qV{constructor(e,t,i,s){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,s)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,28,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):qV.INSTALL_LABEL}};zEe=D([_(1,pr),_(2,Mw),_(3,G_)],zEe);let t5e=class extends qV{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,29,"Install Locally")}};t5e=D([_(0,pr),_(1,Mw),_(2,G_)],t5e);let i5e=class extends qV{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,30,"Install in Browser")}};i5e=D([_(0,pr),_(1,Mw),_(2,G_)],i5e);var Wy;let $Ee=(Wy=class extends kn{constructor(e,t){super("extensions.uninstall",vA.UninstallLabel,vA.UninstallClass,!1),this.extensionsWorkbenchService=e,this.dialogService=t,this.update()}update(){if(!this.extension){this.enabled=!1;return}const e=this.extension.state;if(e===Fr.Uninstalling){this.label=vA.UninstallingLabel,this.class=vA.UnInstallingClass,this.enabled=!1;return}if(this.label=vA.UninstallLabel,this.class=vA.UninstallClass,this.tooltip=vA.UninstallLabel,e!==Fr.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){sa(g(Me,33,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),sa(g(Me,34,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){this.dialogService.error(lg(e))}}}},vA=Wy,Wy.UninstallLabel=g(Me,31,"Uninstall"),Wy.UninstallingLabel=g(Me,32,"Uninstalling"),Wy.UninstallClass=`${kn.LABEL_ACTION_CLASS} uninstall`,Wy.UnInstallingClass=`${kn.LABEL_ACTION_CLASS} uninstall uninstalling`,Wy);$Ee=vA=D([_(0,pr),_(1,To)],$Ee);const pk=class pk extends kn{constructor(e,t,i){super(e,t,pk.DisabledClass,!1),this.extensionsWorkbenchService=i,this.updateThrottler=new tQ,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=qEe.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Fr.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?pk.EnabledClass:pk.DisabledClass}};pk.EnabledClass=`${kn.LABEL_ACTION_CLASS} prominent update`,pk.DisabledClass=`${pk.EnabledClass} disabled`;let GEe=pk,qEe=class extends GEe{constructor(e,t,i){super("extensions.update",g(Me,35,"Update"),t),this.verbose=e,this.instantiationService=i}update(){super.update(),this.extension&&(this.label=this.verbose?g(Me,36,"Update to v{0}",this.extension.latestVersion):g(Me,35,"Update"))}async run(){if(this.extension)return sa(g(Me,37,"Updating extension {0} to version {1} started.",this.extension.displayName,this.extension.latestVersion)),this.install(this.extension)}async install(e){try{await this.extensionsWorkbenchService.install(e,e.local?.preRelease?{installPreReleaseVersion:!0}:void 0),sa(g(Me,38,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Update,t).run()}}};qEe=D([_(1,pr),_(2,be)],qEe);var Hy;let QEe=(Hy=class extends kn{constructor(e,t,i,s){super(PD.ID,PD.LABEL.value,PD.DisabledClass),this.enableWhenOutdated=e,this.enableWhenAutoUpdateValue=t,this.extensionsWorkbenchService=i,this._register(s.onDidChangeConfiguration(o=>{o.affectsConfiguration(hBt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=PD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.enableWhenOutdated&&(this.extension.state!==Fr.Installed||!this.extension.outdated)||this.enableWhenAutoUpdateValue.includes(this.extensionsWorkbenchService.getAutoUpdateValue())&&(this.enabled=!0,this.class=PD.EnabledClass,this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)))}async run(){if(!this.extension)return;const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},PD=Hy,Hy.ID="workbench.extensions.action.toggleAutoUpdateForExtension",Hy.LABEL=Be(Me,39,"Auto Update"),Hy.EnabledClass=`${kn.EXTENSION_ACTION_CLASS} auto-update`,Hy.DisabledClass=`${PD.EnabledClass} hide`,Hy);QEe=PD=D([_(2,pr),_(3,Re)],QEe);var L0;let jEe=(L0=class extends kn{constructor(e){super(jJ.ID,jJ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;sa(g(Me,43,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},jJ=L0,L0.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",L0.LABEL=g(Me,42,"Auto Update All (From Publisher)"),L0);jEe=jJ=D([_(0,pr)],jEe);var T0;let n5e=(T0=class extends kn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(Me,44,"Migrate"),AB.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=AB.DisabledClass,!this.extension?.local||this.extension.state!==Fr.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>uc(t.identifier,{id:e}))||(this.enabled=!0,this.class=AB.EnabledClass,this.tooltip=g(Me,45,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(Me,46,"Migrate"):this.tooltip)}async run(){if(!this.extension?.deprecationInfo?.extension)return;const e=this.extension.local;await this.extensionsWorkbenchService.uninstall(this.extension);const[t]=await this.extensionsWorkbenchService.getExtensions([{id:this.extension.deprecationInfo.extension.id,preRelease:this.extension.deprecationInfo?.extension?.preRelease}],qe.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},AB=T0,T0.EnabledClass=`${kn.LABEL_ACTION_CLASS} migrate`,T0.DisabledClass=`${AB.EnabledClass} disabled`,T0);n5e=AB=D([_(1,pr)],n5e);let qie=class extends kn{constructor(e,t,i,s,o){super(e,t,i,s),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(KEe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};qie=D([_(4,be)],qie);let KEe=class extends WS{constructor(e,t,i){super(null,e,{...t,icon:!0,label:!0}),this.contextMenuService=i}showMenu(e,t){if(this.element){const i=this.getActions(e),s=ia(this.element),o={x:s.left,y:s.top+s.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&clt(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Kr];return t.length?t.slice(0,t.length-1):t}};KEe=D([_(2,Vr)],KEe);async function b5t(n,e,t){return t.invokeFunction(async i=>{const s=i.get(pr),o=i.get(mc),r=i.get(bet),a=i.get(ihe),c=i.get(ZQ),l=[];if(n){l.push(["extension",n.identifier.id]),l.push(["isBuiltinExtension",n.isBuiltin]),l.push(["isDefaultApplicationScopedExtension",n.local&&sLt(n.local.manifest)]),l.push(["isApplicationScopedExtension",n.local&&n.local.isApplicationScoped]),l.push(["isWorkspaceScopedExtension",n.isWorkspaceScoped]),n.local&&l.push(["extensionSource",n.local.source]),l.push(["extensionHasConfiguration",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.configuration]),l.push(["extensionHasKeybindings",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.keybindings]),l.push(["extensionHasCommands",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes?.commands]),l.push(["isExtensionRecommended",!!r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]]),l.push(["isExtensionWorkspaceRecommended",r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]?.reasonId===HEe.Workspace]),l.push(["isUserIgnoredRecommendation",a.globalIgnoredRecommendations.some(m=>m===n.identifier.id.toLowerCase())]),n.state===Fr.Installed&&l.push(["extensionStatus","installed"]),l.push(["installedExtensionIsPreReleaseVersion",!!n.local?.isPreReleaseVersion]),l.push(["installedExtensionIsOptedToPreRelease",!!n.local?.preRelease]),l.push(["galleryExtensionIsPreReleaseVersion",!!n.gallery?.properties.isPreReleaseVersion]),l.push(["galleryExtensionHasPreReleaseVersion",n.gallery?.hasPreReleaseVersion]),l.push(["extensionHasReleaseVersion",n.hasReleaseVersion]);const[u,f,p]=await Promise.all([c.getColorThemes(),c.getFileIconThemes(),c.getProductIconThemes()]);l.push(["extensionHasColorThemes",u.some(m=>SS(m,n))]),l.push(["extensionHasFileIconThemes",f.some(m=>SS(m,n))]),l.push(["extensionHasProductIconThemes",p.some(m=>SS(m,n))]),l.push(["canSetLanguage",s.canSetLanguage(n)]),l.push(["isActiveLanguagePackExtension",n.gallery&&Gd===Phe(n.gallery)])}const d=o.createMenu(Te.ExtensionContext,e.createOverlay(l)),h=d.getActions({shouldForwardArgs:!0});return d.dispose(),h})}function KK(n,e){const t=[];for(const[,i]of n)t.push(i.map(s=>s instanceof u1?s:e.createInstance(YEe,s)));return t}var JE;let s5e=(JE=class extends qie{constructor(e,t,i){super(iT.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(Me,47,"Manage"),this.update()}async getActionGroups(){const e=[],t=await b5t(this.extension,this.contextKeyService,this.instantiationService),i=[],s=[],o=[],r=[];for(const[a,c]of t)a===pBt?s.push(...KK([[a,c]],this.instantiationService)[0]):a===mBt?o.push(...KK([[a,c]],this.instantiationService)[0]):a===fBt?i.push(...KK([[a,c]],this.instantiationService)[0]):r.push(...KK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(jie),this.instantiationService.createInstance(Qie)]),e.push([this.instantiationService.createInstance(Yie),this.instantiationService.createInstance(Kie)]),o.length&&e.push(o),e.push([...s.length?s:[],this.instantiationService.createInstance(C6),this.instantiationService.createInstance($Ee)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof kn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=iT.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Fr.Installed,this.class=this.enabled||e===Fr.Uninstalling?iT.Class:iT.HideManageExtensionClass}}},iT=JE,JE.ID="extensions.manage",JE.Class=`${kn.ICON_ACTION_CLASS} manage `+$e.asClassName(f5t),JE.HideManageExtensionClass=`${iT.Class} hide`,JE);s5e=iT=D([_(0,be),_(1,ho),_(2,Pe)],s5e);let YEe=class extends kn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}update(){this.extension&&(this.action.id===uBt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===QEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===jEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?_F(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?_F(this.extension.gallery.publisher,this.extension.gallery.name):this.extension.identifier.id,t={id:this.extension.identifier.id,version:this.extension.version,location:this.extension.local?.location};await this.action.run(e,t)}}};YEe=D([_(1,pr)],YEe);var Uy;let o5e=(Uy=class extends kn{constructor(e){super(FD.ID,FD.LABEL,FD.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=FD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Fr.Installed&&this.extension.hasPreReleaseVersion&&this.extension.gallery&&(this.extension.preRelease&&!this.extension.isPreReleaseVersion||!this.extension.preRelease&&!this.extension.gallery.hasPreReleaseVersion||(this.enabled=!0,this.class=FD.EnabledClass,this.extension.preRelease?(this.label=g(Me,49,"Switch to Release Version"),this.tooltip=g(Me,50,"This will switch and enable updates to release versions")):(this.label=g(Me,51,"Switch to Pre-Release Version"),this.tooltip=g(Me,52,"This will switch to pre-release version and enable updates to latest version always")))))}async run(){this.extension&&(this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:!this.extension.preRelease}),await this.extensionsWorkbenchService.togglePreRelease(this.extension))}},FD=Uy,Uy.ID="workbench.extensions.action.togglePreRlease",Uy.LABEL=g(Me,48,"Pre-Release"),Uy.EnabledClass=`${kn.LABEL_ACTION_CLASS} pre-release`,Uy.DisabledClass=`${FD.EnabledClass} hide`,Uy);o5e=FD=D([_(0,pr)],o5e);var R0;let C6=(R0=class extends kn{constructor(e,t,i,s,o){super(KJ.ID,KJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionGalleryService=t,this.quickInputService=i,this.instantiationService=s,this.dialogService=o,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.gallery&&!!this.extension.local&&!!this.extension.server&&this.extension.state===Fr.Installed&&!this.extension.deprecationInfo}async run(){if(!this.enabled)return;const e=await this.extension.server.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.gallery,this.extension.local.preRelease,e);if(!t.length){await this.dialogService.info(g(Me,54,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${WFe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(Me,55,"pre-release")})`:""}${o.version===this.extension.version?` (${g(Me,56,"current")})`:""}`,latest:r===0,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),s=await this.quickInputService.pick(i,{placeHolder:g(Me,57,"Select Version to Install"),matchOnDetail:!0});if(s){if(this.extension.version===s.id)return;try{if(s.latest){const[o]=s.id!==this.extension?.version?await this.extensionsWorkbenchService.getExtensions([{id:this.extension.identifier.id,preRelease:s.isPreReleaseVersion}],qe.None):[this.extension];await this.extensionsWorkbenchService.install(o??this.extension,{installPreReleaseVersion:s.isPreReleaseVersion})}else await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:s.isPreReleaseVersion,version:s.id})}catch(o){this.instantiationService.createInstance($V,this.extension,s.latest?this.extension.latestVersion:s.id,Bx.Install,o).run()}}return null}},KJ=R0,R0.ID="workbench.extensions.action.install.anotherVersion",R0.LABEL=g(Me,53,"Install Another Version..."),R0);C6=KJ=D([_(0,pr),_(1,aL),_(2,On),_(3,be),_(4,To)],C6);var M0;let Qie=(M0=class extends kn{constructor(e,t){super(YJ.ID,YJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,59,"Enable this extension only in this workspace"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledWorkspace)}},YJ=M0,M0.ID="extensions.enableForWorkspace",M0.LABEL=g(Me,58,"Enable (Workspace)"),M0);Qie=YJ=D([_(0,pr),_(1,Kh)],Qie);var N0;let jie=(N0=class extends kn{constructor(e,t){super(JJ.ID,JJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,61,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledGlobally)}},JJ=N0,N0.ID="extensions.enableGlobally",N0.LABEL=g(Me,60,"Enable"),N0);jie=JJ=D([_(0,pr),_(1,Kh)],jie);var P0;let Kie=(P0=class extends kn{constructor(e,t,i,s){super(XJ.ID,XJ.LABEL,kn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=s,this.tooltip=g(Me,63,"Disable this extension only in this workspace"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>uc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==Nn.EMPTY)&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledWorkspace)}},XJ=P0,P0.ID="extensions.disableForWorkspace",P0.LABEL=g(Me,62,"Disable (Workspace)"),P0);Kie=XJ=D([_(0,Ti),_(1,pr),_(2,Kh),_(3,ho)],Kie);var F0;let Yie=(F0=class extends kn{constructor(e,t,i){super(ZJ.ID,ZJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(Me,65,"Disable this extension"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>uc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledGlobally)}},ZJ=F0,F0.ID="extensions.disableGlobally",F0.LABEL=g(Me,64,"Disable"),F0);Yie=ZJ=D([_(0,pr),_(1,Kh),_(2,ho)],Yie);let r5e=class extends KFe{constructor(e){super("extensions.enable",g(Me,66,"Enable"),[[e.createInstance(jie),e.createInstance(Qie)]])}};r5e=D([_(0,be)],r5e);let a5e=class extends KFe{constructor(e){super("extensions.disable",g(Me,67,"Disable"),[[e.createInstance(Yie),e.createInstance(Kie)]])}};a5e=D([_(0,be)],a5e);var O0;let c5e=(O0=class extends kn{constructor(e,t,i,s,o,r){super("extensions.runtimeState","",EB.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=s,this.productService=o,this.telemetryService=r,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=EB.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Fr.Installing||e===Fr.Uninstalling||this.extension.local&&this.extension.local.manifest&&this.extension.local.manifest.contributes&&this.extension.local.manifest.contributes.localizations&&this.extension.local.manifest.contributes.localizations.length>0)return;const t=this.extension.runtimeState;t&&(this.enabled=!0,this.class=EB.EnabledClass,this.tooltip=t.reason,this.label=t.action===ov.ReloadWindow?g(Me,68,"Reload Window"):t.action===ov.RestartExtensions?g(Me,69,"Restart Extensions"):t.action===ov.QuitAndInstall?g(Me,70,"Restart to Update"):t.action===ov.ApplyUpdate||t.action===ov.DownloadUpdate?g(Me,71,"Update {0}",this.productService.nameShort):"")}async run(){const e=this.extension?.runtimeState;if(e?.action){if(this.telemetryService.publicLog2("extensions:runtimestate:action",{action:e.action}),e?.action===ov.ReloadWindow)return this.hostService.reload();if(e?.action===ov.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===ov.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===ov.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===ov.QuitAndInstall)return this.updateService.quitAndInstall()}}},EB=O0,O0.EnabledClass=`${kn.LABEL_ACTION_CLASS} reload`,O0.DisabledClass=`${EB.EnabledClass} disabled`,O0);c5e=EB=D([_(0,Id),_(1,pr),_(2,NZe),_(3,ho),_(4,Ja),_(5,on)],c5e);function SS(n,e){return!!(e&&n.extensionData&&Cn.equals(n.extensionData.extensionId,e.identifier.id))}function YFe(n,e,t,i){const s=[];for(const o of n)SS(o,t)&&!(i&&o===e)&&s.push({label:o.label,id:o.id});return i&&(s.push({type:"separator",label:g(Me,56,"current")}),s.push({label:e.label,id:e.id})),s}var Vy;let JEe=(Vy=class extends kn{constructor(e,t,i,s){super(OD.ID,OD.TITLE.value,OD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidColorThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getColorThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?OD.EnabledClass:OD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getColorThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getColorTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,73,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:s.id,"auto")}},OD=Vy,Vy.ID="workbench.extensions.action.setColorTheme",Vy.TITLE=Be(Me,72,"Set Color Theme"),Vy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,Vy.DisabledClass=`${OD.EnabledClass} disabled`,Vy);JEe=OD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],JEe);var zy;let XEe=(zy=class extends kn{constructor(e,t,i,s){super(BD.ID,BD.TITLE.value,BD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidFileIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getFileIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?BD.EnabledClass:BD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getFileIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getFileIconTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,75,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:s.id,"auto")}},BD=zy,zy.ID="workbench.extensions.action.setFileIconTheme",zy.TITLE=Be(Me,74,"Set File Icon Theme"),zy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,zy.DisabledClass=`${BD.EnabledClass} disabled`,zy);XEe=BD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],XEe);var $y;let ZEe=($y=class extends kn{constructor(e,t,i,s){super(WD.ID,WD.TITLE.value,WD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidProductIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getProductIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?WD.EnabledClass:WD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getProductIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getProductIconTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,77,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:s.id,"auto")}},WD=$y,$y.ID="workbench.extensions.action.setProductIconTheme",$y.TITLE=Be(Me,76,"Set Product Icon Theme"),$y.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,$y.DisabledClass=`${WD.EnabledClass} disabled`,$y);ZEe=WD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],ZEe);var Gy;let l5e=(Gy=class extends kn{constructor(e){super(HD.ID,HD.TITLE.value,HD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=HD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd===Phe(this.extension.gallery)||(this.enabled=!0,this.class=HD.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},HD=Gy,Gy.ID="workbench.extensions.action.setDisplayLanguage",Gy.TITLE=Be(Me,78,"Set Display Language"),Gy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,Gy.DisabledClass=`${HD.EnabledClass} disabled`,Gy);l5e=HD=D([_(0,pr)],l5e);var qy;let d5e=(qy=class extends kn{constructor(e,t){super(UD.ID,UD.TITLE.value,UD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=UD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd!==Phe(this.extension.gallery)||(this.enabled=!0,this.class=UD.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},UD=qy,qy.ID="workbench.extensions.action.clearLanguage",qy.TITLE=Be(Me,79,"Clear Display Language"),qy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,qy.DisabledClass=`${UD.EnabledClass} disabled`,qy);d5e=UD=D([_(0,pr),_(1,yet)],d5e);var B0;let h5e=(B0=class extends xn{constructor(e,t,i){super(eX.ID,eX.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);return i?this.extensionWorkbenchService.open(i):null}},eX=B0,B0.ID="workbench.extensions.action.showRecommendedExtension",B0.LABEL=g(Me,80,"Show Recommended Extension"),B0);h5e=eX=D([_(1,Nw),_(2,pr)],h5e);var W0;let u5e=(W0=class extends xn{constructor(e,t,i,s){super(tX.ID,tX.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=s,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(s){this.instantiationService.createInstance($V,i,i.latestVersion,Bx.Install,s).run()}}}},tX=W0,W0.ID="workbench.extensions.action.installRecommendedExtension",W0.LABEL=g(Me,81,"Install Recommended Extension"),W0);u5e=tX=D([_(1,Nw),_(2,be),_(3,pr)],u5e);var H0;let g5e=(H0=class extends xn{constructor(e,t){super(iX.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=iX.Class,this.tooltip=g(Me,82,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},iX=H0,H0.ID="extensions.ignore",H0.Class=`${kn.LABEL_ACTION_CLASS} ignore`,H0);g5e=iX=D([_(1,ihe)],g5e);var U0;let f5e=(U0=class extends xn{constructor(e,t){super(nX.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=nX.Class,this.tooltip=g(Me,83,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},nX=U0,U0.ID="extensions.ignore",U0.Class=`${kn.LABEL_ACTION_CLASS} undo-ignore`,U0);f5e=nX=D([_(1,ihe)],f5e);let Jie=class extends xn{constructor(e,t){super("extensions.searchExtensions",g(Me,84,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};Jie=D([_(1,Nw)],Jie);let Xie=class extends xn{constructor(e,t,i,s,o,r,a,c){super(e,t),this.contextService=i,this.fileService=s,this.textFileService=o,this.editorService=r,this.jsonEditingService=a,this.textModelResolverService=c}openExtensionsFile(e){return this.getOrCreateExtensionsFile(e).then(({created:t,content:i})=>this.getSelectionPosition(i,e,["recommendations"]).then(s=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:s}})),t=>Promise.reject(new Error(g(Me,85,"Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",t))))}openWorkspaceConfigurationFile(e){return this.getOrUpdateWorkspaceConfigurationFile(e).then(t=>this.getSelectionPosition(t.value.toString(),t.resource,["extensions","recommendations"])).then(t=>this.editorService.openEditor({resource:e,options:{selection:t,forceReload:!0}}))}getOrUpdateWorkspaceConfigurationFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>{const i=ow(t.value.toString()).extensions;return!i||!i.recommendations?this.jsonEditingService.write(e,[{path:["extensions"],value:{recommendations:[]}}],!0).then(()=>this.fileService.readFile(e)):t})}getSelectionPosition(e,t,i){const s=_Je(e),o=rbe(s,i);if(o&&o.parent&&o.parent.children){const r=o.parent.children[1],a=r.children&&r.children.length?r.children[r.children.length-1]:null,c=a?a.offset+a.length:r.offset+1;return Promise.resolve(this.textModelResolverService.createModelReference(t)).then(l=>{const d=l.object.textEditorModel.getPositionAt(c);return l.dispose(),{startLineNumber:d.lineNumber,startColumn:d.column,endLineNumber:d.lineNumber,endColumn:d.column}})}return Promise.resolve(void 0)}getOrCreateExtensionsFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>({created:!1,extensionsFileResource:e,content:t.value.toString()}),t=>this.textFileService.write(e,Kze).then(()=>({created:!0,extensionsFileResource:e,content:Kze})))}};Xie=D([_(2,Ti),_(3,ci),_(4,tr),_(5,_i),_(6,dL),_(7,Rn)],Xie);var tP;let p5e=(tP=class extends Xie{constructor(e,t,i,s,o,r,a,c){super(e,t,o,i,s,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==Nn.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(p2));case Nn.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},tP.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",tP.LABEL=g(Me,86,"Configure Recommended Extensions (Workspace)"),tP);p5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn)],p5e);var iP;let m5e=(iP=class extends Xie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,i,s,r,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(nst);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(p2)):null)}},iP.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",iP.LABEL=g(Me,87,"Configure Recommended Extensions (Workspace Folder)"),iP);m5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn),_(8,Qi)],m5e);var V0;let _5e=(V0=class extends xn{get extension(){return this._extension}set extension(e){this._extension&&e&&uc(this._extension.identifier,e.identifier)||(this.initialStatus=null,this.status=null,this.enablementState=null),this._extension=e,this.update()}constructor(e,t,i){super("extensions.action.statusLabel","",xB.DISABLED_CLASS,!1),this.extensionService=e,this.extensionManagementServerService=t,this.extensionEnablementService=i,this.initialStatus=null,this.status=null,this.version=null,this.enablementState=null,this._extension=null}update(){const e=this.computeLabel();this.label=e||"",this.class=e?xB.ENABLED_CLASS:xB.DISABLED_CLASS}computeLabel(){if(!this.extension)return null;const e=this.status,t=this.version,i=this.enablementState;this.status=this.extension.state,this.version=this.extension.version,this.initialStatus===null&&(this.initialStatus=this.status),this.enablementState=this.extension.enablementState;const s=()=>{const r=this.extensionService.extensions.filter(a=>uc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?r&&this.extension.version===r.version?!0:this.extensionService.canAddExtension(ME(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(uc({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(che(r))))?!0:this.extensionService.canRemoveExtension(ME(this.extension.local)):!1;if(e!==null){if(e===Fr.Installing&&this.status===Fr.Installed)return s()?this.initialStatus===Fr.Installed&&this.version!==t?g(Me,88,"Updated"):g(Me,89,"Installed"):null;if(e===Fr.Uninstalling&&this.status===Fr.Uninstalled)return this.initialStatus=this.status,o()?g(Me,90,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return s()?g(Me,91,"Enabled"):null;if(r&&!a)return o()?g(Me,92,"Disabled"):null}return null}run(){return Promise.resolve()}},xB=V0,V0.ENABLED_CLASS=`${kn.TEXT_ACTION_CLASS} extension-status-label`,V0.DISABLED_CLASS=`${xB.ENABLED_CLASS} hide`,V0);_5e=xB=D([_(0,ho),_(1,Mw),_(2,Kh)],_5e);var z0;let v5e=(z0=class extends qie{constructor(e,t,i,s){super("extensions.sync","",DB.SYNC_CLASS,!1,s),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration("settingsSync.ignoredExtensions"))(()=>this.update())),this._register(i.onDidChangeEnablement(()=>this.update())),this.update()}update(){if(this.enabled=!!this.extension&&this.userDataSyncEnablementService.isEnabled()&&this.extension.state===Fr.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?DB.IGNORED_SYNC_CLASS:DB.SYNC_CLASS,this.tooltip=e?g(Me,93,"This extension is ignored during sync"):g(Me,94,"This extension is synced")}}async run(){return super.run({actionGroups:[[new xn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(Me,95,"Sync this extension"):g(Me,96,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},DB=z0,z0.IGNORED_SYNC_CLASS=`${kn.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(m5t)}`,z0.SYNC_CLASS=`${DB.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(p5t)}`,z0);v5e=DB=D([_(0,Re),_(1,pr),_(2,PZe),_(3,be)],v5e);var nP;let w5e=(nP=class extends kn{get status(){return this._status}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super("extensions.status","",`${VD.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=s,this.workspaceTrustService=o,this.extensionsWorkbenchService=r,this.extensionService=a,this.extensionManifestPropertiesService=c,this.contextService=l,this.productService=d,this.workbenchExtensionEnablementService=h,this.extensionFeaturesManagementService=u,this.updateWhenCounterExtensionChanges=!0,this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new tQ,this._register(this.labelService.onDidChangeFormatters(()=>this.update(),this)),this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this._register(this.extensionFeaturesManagementService.onDidChangeAccessData(()=>this.update())),this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateStatus())}async computeAndUpdateStatus(){if(this.updateStatus(void 0,!0),this.enabled=!1,!this.extension)return;if(this.extension.isMalicious){this.updateStatus({icon:Of,message:new Xt(g(Me,97,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const o=`[${this.extension.deprecationInfo.extension.displayName}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,98,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(Me,99,"settings")}](${P.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,100,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",o))},!0)}else{const o=new Xt(g(Me,101,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:Of,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.gallery&&this.extension.state===Fr.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const o=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),r=new Xt(`${g(Me,102,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,eMt(o))} [${g(Me,103,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:Of,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(Me,0,"{0} for the Web",this.productService.nameLong),r=new Xt(`${g(Me,104,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(Me,105,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:Of,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Fr.Installed)return;if(this.extension.enablementState===ga.DisabledByEnvironment){this.updateStatus({message:new Xt(g(Me,106,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===ga.EnabledByEnvironment){this.updateStatus({message:new Xt(g(Me,107,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===ga.DisabledByVirtualWorkspace){const o=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:ay,message:new Xt(o?b3(o):g(Me,108,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(ost(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:Of,message:new Xt(r?b3(r):g(Me,109,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===ga.DisabledByTrustRequirement)){this.enabled=!0;const o=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:I5,message:new Xt(o?b3(o):g(Me,110,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const o=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:I5,message:new Xt(r?b3(r):g(Me,111,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>uc(o.identifier,this.extension.identifier)&&o.server!==this.extension.server)){let o;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(o=new Xt(`${g(Me,112,"This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)):this.extensionManagementServerService.remoteExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&(this.extensionManagementServerService.localExtensionManagementServer?o=new Xt(`${g(Me,113,"This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Jn&&(o=new Xt(`${g(Me,114,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Xt(`${g(Me,115,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:Of,message:o},!0);return}const e=new Cn(this.extension.identifier.id),t=it.as(GS.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(Me,116,"Manage Access")}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,ASe.Features,!1,o.id]))}`)})`;if(r?.severity===nt.Error){this.updateStatus({icon:DR,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===nt.Warning){this.updateStatus({icon:Of,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(hPe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>uc(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Xt(g(Me,117,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Xt(g(Me,118,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:ay,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>uc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(che(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,119,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,120,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,121,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionDependency){this.updateStatus({icon:Of,message:new Xt(g(Me,122,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),s=this.extensionService.extensions.some(o=>uc({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&s){if(this.extension.enablementState===ga.EnabledWorkspace){this.updateStatus({message:new Xt(g(Me,123,"This extension is enabled for this workspace by the user."))},!0);return}if(this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer&&this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer){this.updateStatus({message:new Xt(g(Me,124,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===ga.EnabledGlobally)return}if(!i&&!s){if(this.extension.enablementState===ga.DisabledGlobally){this.updateStatus({message:new Xt(g(Me,125,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===ga.DisabledWorkspace){this.updateStatus({message:new Xt(g(Me,126,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!s&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===nt.Error).map(([,r])=>r);this.updateStatus({icon:DR,message:new Xt(o.join(" ").trim())},!0)}}updateStatus(e,t){this._status!==e&&(this._status&&e&&this._status.message===e.message&&this._status.icon?.id===e.icon?.id||(this._status=e,t&&(this._status?.icon===DR?this.class=`${VD.CLASS} extension-status-error ${$e.asClassName(DR)}`:this._status?.icon===Of?this.class=`${VD.CLASS} extension-status-warning ${$e.asClassName(Of)}`:this._status?.icon===ay?this.class=`${VD.CLASS} extension-status-info ${$e.asClassName(ay)}`:this._status?.icon===I5?this.class=`${VD.CLASS} ${$e.asClassName(I5)}`:this.class=`${VD.CLASS} hide`),this._onDidChangeStatus.fire()))}async run(){if(this._status?.icon===I5)return this.commandService.executeCommand("workbench.trust.manage")}},VD=nP,nP.CLASS=`${kn.ICON_ACTION_CLASS} extension-status`,nP);w5e=VD=D([_(0,Mw),_(1,eo),_(2,Qi),_(3,Sde),_(4,oA),_(5,pr),_(6,ho),_(7,G_),_(8,Ti),_(9,Ja),_(10,Kh),_(11,wet)],w5e);var $0;let b5e=($0=class extends xn{constructor(e=sX.ID,t=sX.LABEL,i,s,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=s,this.quickInputService=o,this.notificationService=r,this.hostService=a,this.instantiationService=c,this.extensionService=l}get enabled(){return this.extensionsWorkbenchService.local.filter(e=>!e.isBuiltin&&e.local).length>0}run(){return this.quickInputService.pick(this.getEntries(),{placeHolder:g(Me,128,"Select Extension to Reinstall")}).then(e=>e&&this.reinstallExtension(e.extension))}getEntries(){return this.extensionsWorkbenchService.queryLocal().then(e=>e.filter(i=>!i.isBuiltin&&i.server!==this.extensionManagementServerService.webExtensionManagementServer).map(i=>({id:i.identifier.id,label:i.displayName,description:i.identifier.id,extension:i})))}reinstallExtension(e){return this.instantiationService.createInstance(Jie,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(ME(t.local))),s=i?g(Me,129,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(Me,130,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(Me,131,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(nt.Info,s,o,{sticky:!0})},t=>this.notificationService.error(t)))}},sX=$0,$0.ID="workbench.extensions.action.reinstall",$0.LABEL=g(Me,127,"Reinstall Extension..."),$0);b5e=sX=D([_(2,pr),_(3,Mw),_(4,On),_(5,Pi),_(6,Id),_(7,be),_(8,ho)],b5e);var G0;let C5e=(G0=class extends xn{constructor(e=oX.ID,t=oX.LABEL,i,s,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=s,this.instantiationService=o,this.extensionEnablementService=r}get enabled(){return this.extensionsWorkbenchService.local.some(e=>this.isEnabled(e))}async run(){const e=await this.quickInputService.pick(this.getExtensionEntries(),{placeHolder:g(Me,133,"Select Extension"),matchOnDetail:!0});if(e&&e.extension){const t=this.instantiationService.createInstance(C6);t.extension=e.extension,await t.run(),await this.instantiationService.createInstance(Jie,e.extension.identifier.id).run()}}isEnabled(e){const t=this.instantiationService.createInstance(C6);return t.extension=e,t.enabled&&!!e.local&&this.extensionEnablementService.isEnabled(e.local)}async getExtensionEntries(){const e=await this.extensionsWorkbenchService.queryLocal(),t=[];for(const i of e)this.isEnabled(i)&&t.push({id:i.identifier.id,label:i.displayName||i.identifier.id,description:i.identifier.id,extension:i});return t.sort((i,s)=>i.extension.displayName.localeCompare(s.extension.displayName))}},oX=G0,G0.ID="workbench.extensions.action.install.specificVersion",G0.LABEL=g(Me,132,"Install Specific Version of Extension..."),G0);C5e=oX=D([_(2,pr),_(3,On),_(4,be),_(5,Kh)],C5e);let Zie=class extends xn{constructor(e,t,i,s,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=s,this.progressService=o,this.extensions=void 0,this.update(),this.extensionsWorkbenchService.queryLocal().then(()=>this.updateExtensions()),this._register(this.extensionsWorkbenchService.onChange(()=>{this.extensions&&this.updateExtensions()}))}updateExtensions(){this.extensions=this.extensionsWorkbenchService.local,this.update()}update(){this.enabled=!!this.extensions&&this.getExtensionsToInstall(this.extensions).length>0,this.tooltip=this.label}async run(){return this.selectAndInstallExtensions()}async queryExtensionsToInstall(){const e=await this.extensionsWorkbenchService.queryLocal();return this.getExtensionsToInstall(e)}async selectAndInstallExtensions(){const e=this.quickInputService.createQuickPick();e.busy=!0;const t=e.onDidAccept(()=>{t.dispose(),e.hide(),e.dispose(),this.onDidAccept(e.selectedItems)});e.show();const i=await this.queryExtensionsToInstall();e.busy=!1,i.length?(e.title=this.getQuickPickTitle(),e.placeholder=g(Me,134,"Select extensions to install"),e.canSelectMany=!0,i.sort((s,o)=>s.displayName.localeCompare(o.displayName)),e.items=i.map(s=>({extension:s,label:s.displayName,description:s.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:nt.Info,message:g(Me,135,"There are no extensions to install.")}))}async onDidAccept(e){if(e.length){const t=e.filter(i=>!!i.extension).map(i=>i.extension);t.length&&(await this.progressService.withProgress({location:ch.Notification,title:g(Me,136,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(Me,137,"Successfully installed extensions.")))}}};Zie=D([_(1,pr),_(2,On),_(3,Pi),_(4,Cf)],Zie);let y5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,s,i),this.extensionManagementServerService=o,this.extensionGalleryService=r,this.instantiationService=a,this.fileService=c,this.logService=l}get label(){return this.extensionManagementServerService&&this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,138,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(Me,139,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance(zEe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};y5e=D([_(0,pr),_(1,On),_(2,Cf),_(3,Pi),_(4,Mw),_(5,aL),_(6,be),_(7,ci),_(8,Ze)],y5e);let S5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,o,s),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(Me,140,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(Me,141,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===qr.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&uc(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};S5e=D([_(1,pr),_(2,On),_(3,Cf),_(4,Pi),_(5,Mw),_(6,aL),_(7,ci),_(8,Ze)],S5e);yt.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const exe="workbench.extensions.action.showExtensionsWithIds";yt.registerCommand(exe,function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const s=e.map(o=>`@id:${o}`).join(" ");i.search(s),i.focus()})});B("extensionButton.background",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,142,"Button background color for extension actions."));B("extensionButton.foreground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,143,"Button foreground color for extension actions."));B("extensionButton.hoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,144,"Button background hover color for extension actions."));B("extensionButton.separator",{dark:f3,light:f3,hcDark:f3,hcLight:f3},g(Me,145,"Button separator color for extension actions"));B("extensionButton.prominentBackground",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,146,"Button background color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentForeground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,147,"Button foreground color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentHoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,148,"Button background hover color for extension actions that stand out (e.g. install button)."));Im((n,e)=>{const t=n.getColor(Vh);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(DR)} { color: ${t}; }`));const i=n.getColor(Gc);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(Of)} { color: ${i}; }`));const s=n.getColor(qc);s&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(ay)} { color: ${s}; }`))});const rst="vs/workbench/contrib/chat/browser/chatAgentHover";let ene=class extends ${constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i;const s=di(".chat-agent-hover@root",[di(".chat-agent-hover-header",[di(".chat-agent-hover-icon@icon"),di(".chat-agent-hover-details",[di(".chat-agent-hover-name@name"),di(".chat-agent-hover-extension",[di(".chat-agent-hover-extension-name@extensionName"),di(".chat-agent-hover-separator@separator"),di(".chat-agent-hover-publisher@publisher")])])]),di(".chat-agent-hover-warning@warning"),di("span.chat-agent-hover-description@description")]);this.domNode=s.root,this.icon=s.icon,this.name=s.name,this.extensionName=s.extensionName,this.description=s.description,s.separator.textContent="|";const o=we("span.extension-verified-publisher",void 0,OS(_5t));this.publisherName=we("span.chat-agent-hover-publisher-name"),he(s.publisher,o,this.publisherName),s.warning.appendChild(OS(Ce.warning)),s.warning.appendChild(we("span",void 0,g(rst,0,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof P){const o=we("img.icon");o.src=lp.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(we(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=we($e.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(we(".avatar.codicon-avatar",void 0,o))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:Nhe(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let s=t.description??"";if(s&&(s.match(/[\.\?\!] *$/)||(s+=".")),this.description.textContent=s,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ai);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&this.domNode.classList.toggle("verifiedPublisher",!0)})}}};ene=D([_(0,yp),_(1,pr),_(2,Yde)],ene);function ast(n,e){return{actions:[{commandId:exe,label:g(rst,1,"View Extension"),run:()=>{const t=n();t&&e.executeCommand(exe,[t.extensionId.value])}}]}}var C5t=".chat-confirmation-widget{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:16px;padding:8px 12px 12px}.chat-confirmation-widget .chat-confirmation-widget-title{font-weight:600}.chat-confirmation-widget .chat-confirmation-widget-title p{margin:0 0 4px}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown p{margin-top:0}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown>:last-child{margin-bottom:0}.chat-confirmation-widget .chat-confirmation-buttons-container{display:flex;gap:8px;margin-top:13px}.chat-confirmation-widget.hideButtons .chat-confirmation-buttons-container{display:none}";Ct(C5t,{});let txe=class extends ${get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,s){super(),this.instantiationService=s,this._onDidClick=this._register(new I);const o=di(".chat-confirmation-widget@root",[di(".chat-confirmation-widget-title@title"),di(".chat-confirmation-widget-message@message"),di(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(vw,{})),a=this._register(r.render(new Xt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Xt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new Tu(o.buttonsContainer,{...yQ,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};txe=D([_(3,be)],txe);const Gz="vs/workbench/contrib/chat/common/chatColors";B("chat.requestBorder",{dark:new fe(new gn(255,255,255,.1)),light:new fe(new gn(0,0,0,.1)),hcDark:ft,hcLight:ft},g(Gz,0,"The border color of a chat request."));const y5t=B("chat.requestBackground",{dark:Ie(us,.62),light:Ie(us,.62),hcDark:Zs,hcLight:null},g(Gz,1,"The background color of a chat request.")),A5e=B("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:fe.white,hcLight:kW},g(Gz,2,"The background color of a chat slash command.")),E5e=B("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:fe.black,hcLight:DMe},g(Gz,3,"The foreground color of a chat slash command."));B("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:fe.black,hcLight:fe.white},g(Gz,4,"The background color of a chat avatar."));B("chat.avatarForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Gz,5,"The foreground color of a chat avatar."));const kpe="http://_vscodedecoration_",rX="http://_chatagent_",S5t="http://_chatslash_";function A5t(n,e,t){const i=t.get(Yde),s=t.get(yp),o=i.getAgentNameRestriction(n);let r=`${o?n.name:Nhe(n)}`;o&&s.getAgentsByName(n.name).length>1&&(r+=` (${n.publisherDisplayName})`);const c={agentId:n.id,name:r,isClickable:e};return`[${n.name}](${rX}?${encodeURIComponent(JSON.stringify(c))})`}let ixe=class{constructor(e,t,i,s,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this.hoverService=r,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof kb)t+=i.text;else if(i instanceof tp)t+=this.instantiationService.invokeFunction(s=>A5t(i.agent,!1,s));else{const s=i instanceof VV&&i.data instanceof P?i.data:void 0,o=s?encodeURIComponent(this.labelService.getUriLabel(s,{relative:!0})):i instanceof tp?i.agent.id:"",r=i.text;t+=`[${r}](${kpe}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const s=i.getAttribute("data-href");if(s)if(s.startsWith(rX)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(s.startsWith(S5t)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(s.startsWith(kpe)){const o=decodeURIComponent(s.slice(kpe.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else s.startsWith(Xnt)?this.renderFileWidget(s,i):s.startsWith("command:")&&this.injectKeybindingHint(i,s,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${$z}${e.name}`;let s;if(e.isClickable){s=we("span.chat-agent-widget");const a=t.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));a.label=i,t.add(a.onDidClick(()=>{const c=this.chatAgentService.getAgent(e.agentId),l=this.chatWidgetService.lastFocusedWidget;!l||!c||this.chatService.sendRequest(l.viewModel.sessionId,c.metadata.sampleRequest??"",{location:l.location,agentId:c.id})}))}else s=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new Ka(()=>t.add(this.instantiationService.createInstance(ene)));return t.add(this.hoverService.setupUpdatableHover(va("element"),s,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&ast(()=>o,this.commandService))),s}renderSlashCommandWidget(e,t,i){const s=we("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));return r.label=e,i.add(r.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!o)return;const c=o.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:o.id,slashCommand:t.command})})),s}renderFileWidget(e,t){const i=P.parse(e);let s;try{s=Or(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Ma(a));return}if(!s.uri||!P.isUri(s.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=s.range?`${s.range.startLineNumber}-${s.range.endLineNumber}`:"";t.setAttribute("data-href",s.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(s.uri,{relative:!0});t.title=s.range?`${r}#${s.range.startLineNumber}-${s.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=we("span.chat-resource-widget"),s=we("span",void 0,e);return t&&(s.title=t),i.appendChild(s),i}injectKeybindingHint(e,t,i){const s=t.match(/command:([^\)]+)/)?.[1];if(s){const o=i.lookupKeybinding(s);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};ixe=D([_(0,ti),_(1,eo),_(2,Ze),_(3,yp),_(4,be),_(5,Zc),_(6,Rw),_(7,lL),_(8,Qi)],ixe);var P3;const Nm="vs/workbench/contrib/files/common/files",E5t="workbench.view.explorer",lC="workbench.explorer.fileView";new Y("explorerViewletVisible",!0,{type:"boolean",description:g(Nm,0,"True when the EXPLORER viewlet is visible.")});const JFe=new Y("foldersViewVisible",!0,{type:"boolean",description:g(Nm,1,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),x5t=new Y("explorerResourceIsFolder",!1,{type:"boolean",description:g(Nm,2,"True when the focused item in the EXPLORER is a folder.")}),cst=new Y("explorerResourceReadonly",!1,{type:"boolean",description:g(Nm,3,"True when the focused item in the EXPLORER is read-only.")}),lst=cst.toNegated(),D5t=new Y("explorerResourceAvailableEditorIds",""),k5t=new Y("explorerResourceIsRoot",!1,{type:"boolean",description:g(Nm,4,"True when the focused item in the EXPLORER is a root folder.")}),I5t=new Y("explorerResourceCut",!1,{type:"boolean",description:g(Nm,5,"True when an item in the EXPLORER has been cut for cut and paste.")}),L5t=new Y("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(Nm,6,"True when the focused item in the EXPLORER can be moved to trash.")}),dst=new Y("filesExplorerFocus",!0,{type:"boolean",description:g(Nm,7,"True when the focus is inside the EXPLORER view.")});new Y("openEditorsFocus",!0,{type:"boolean",description:g(Nm,8,"True when the focus is inside the OPEN EDITORS view.")});const hst=new Y("explorerViewletFocus",!0,{type:"boolean",description:g(Nm,9,"True when the focus is inside the EXPLORER viewlet.")}),T5t=new Y("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(Nm,10,"True when the focused item in the EXPLORER view is a compact item.")}),R5t=new Y("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(Nm,11,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),M5t=new Y("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(Nm,12,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),N5t=new Y("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(Nm,13,"True when a workspace in the EXPLORER view has some collapsible root child.")});ge.and(JFe,dst,ge.not(Lde));ge.and(JFe,hst,ge.not(Lde));const ust="workbench.editors.files.textFileEditor",gst="workbench.editors.files.fileEditorInput",P5t="workbench.editors.files.binaryFileEditor";var nxe;(function(n){n.Default="default",n.Mixed="mixed",n.FilesFirst="filesFirst",n.Type="type",n.Modified="modified",n.FoldersNestsFiles="foldersNestsFiles"})(nxe||(nxe={}));var SM;(function(n){n.Verbose="verbose",n.Default="default",n.Light="light"})(SM||(SM={}));var x5e;(function(n){n.Default="default",n.Upper="upper",n.Lower="lower",n.Unicode="unicode"})(x5e||(x5e={}));let D5e=P3=class extends ${constructor(e,t,i,s){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=s,this.fileWatcherDisposable=this._register(new Dn)}static async open(e,t,i,s,o){await s.openEditor({original:{resource:P3.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:o})}static resourceToTextFile(e,t){return t.with({scheme:e,query:JSON.stringify({scheme:t.scheme,query:t.query})})}static textFileToResource(e){const{scheme:t,query:i}=JSON.parse(e.query);return e.with({scheme:t,query:i})}async provideTextContent(e){if(!e.query)return null;const t=P3.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const s=new Z;this.fileWatcherDisposable.value=s,s.add(this.fileService.onDidFilesChange(o=>{o.contains(t,Ko.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&s.add(T.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=P3.textFileToResource(e),s=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,s.value);else if(t){const r=this.modelService.getModel(i);let a;r?a=this.languageService.createById(r.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),o=this.modelService.createModel(s.value,a,e)}return o}};D5e=P3=D([_(0,tr),_(1,ci),_(2,Di),_(3,Ai)],D5e);const Vce=class Vce{constructor(e,t){this._editor=e,this._group=t,this.id=Vce.COUNTER++}get editor(){return this._editor}get group(){return this._group}get groupId(){return this._group.id}getId(){return`openeditor:${this.groupId}:${this.id}`}isPreview(){return!this._group.isPinned(this.editor)}isSticky(){return this._group.isSticky(this.editor)}getResource(){return Qc.getOriginalUri(this.editor,{supportSideBySide:go.PRIMARY})}};Vce.COUNTER=0;let tne=Vce;const k5e="vs/platform/dialogs/common/dialogs";var I5e;(function(n){n[n.Confirmation=1]="Confirmation",n[n.Prompt=2]="Prompt",n[n.Input=3]="Input"})(I5e||(I5e={}));var Ku;(function(n){n[n.SAVE=0]="SAVE",n[n.DONT_SAVE=1]="DONT_SAVE",n[n.CANCEL=2]="CANCEL"})(Ku||(Ku={}));const YK=10;function fst(n){const e=[];return e.push(...n.slice(0,YK).map(t=>typeof t=="string"?t:ui(t))),n.length>YK&&(n.length-YK===1?e.push(g(k5e,3,"...1 additional file not shown")):e.push(g(k5e,4,"...{0} additional files not shown",n.length-YK))),e.push(""),e.join(` -`)}var F5t=".quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-editor:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(F5t,{});const ine=0,L5e=[ine,[]];function T5e(n,e,t,i){if(!n||!e)return L5e;const s=n.length,o=e.length;if(s0,v=n[u],w=e[u];for(let b=0;b0,y=f+b,S=y-1,M=p+b-1,k=C?a[S]:0,F=m&&C?a[M]:0,N=m&&C?c[M]:0;let z;!F&&m?z=0:z=B5t(v,w,i,s,b,N),z&&F+z>=k&&(r||m||s.startsWith(e,b))?(c[y]=N+1,a[y]=F+z):(c[y]=ine,a[y]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===ine||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function B5t(n,e,t,i,s,o){let r=0;if(!W5t(e,i[s]))return r;if(r+=1,o>0&&(r+=o*5),n===t[s]&&(r+=1),s===0)r+=8;else{const a=H5t(t.charCodeAt(s-1));a?r+=a:pQ(t.charCodeAt(s))&&o===0&&(r+=2)}return r}function W5t(n,e){return n===e?!0:n==="/"||n==="\\"?e==="/"||e==="\\":!1}function H5t(n){switch(n){case q.Slash:case q.Backslash:return 5;case q.Underline:case q.Dash:case q.Period:case q.Space:case q.SingleQuote:case q.DoubleQuote:case q.Colon:return 4;default:return 0}}const pst=[void 0,[]];function Ipe(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?U5t(n,s.values,t,i):mst(n,e,t,i)}function U5t(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,c]=mst(n,r,t,i);if(typeof a!="number")return pst;s+=a,o.push(...c)}return[s,axe(o)]}function mst(n,e,t,i){const s=v1(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],Cz(s)]:pst}const nne=Object.freeze({score:0}),aX=1<<18,sxe=1<<17,oxe=65536;function V5t(n,e,t,i){const s=i.values?i.values:[i];return Ed({[i.normalized]:{values:s.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:n,description:e,allowNonContiguousMatches:t}})}function rxe(n,e,t,i,s){if(!n||!e.normalized)return nne;const o=i.getItemLabel(n);if(!o)return nne;const r=i.getItemDescription(n),a=V5t(o,r,t,e),c=s[a];if(c)return c;const l=z5t(o,r,i.getItemPath(n),e);return s[a]=l,l}function z5t(n,e,t,i,s){const o=!t||!i.containsPathSeparator;return t&&(jr?i.pathNormalized===t:Oa(i.pathNormalized,t))?{score:aX,labelMatch:[{start:0,end:n.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?$5t(n,e,t,i.values,o):_st(n,e,t,i,o)}function $5t(n,e,t,i,s,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=_st(n,e,t,l,s);if(d===ine)return nne;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:axe(a),descriptionMatch:axe(c)}}function _st(n,e,t,i,s,o){if(s||!e){const[r,a]=T5e(n,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=dF(i.normalized,n);let l;if(c){l=sxe;const d=Math.round(i.normalized.length/n.length*100);l+=d}else l=oxe;return{score:l+r,labelMatch:c||R5e(a)}}}if(e){let r=e;t&&(r=`${e}${dg}`);const a=r.length,c=`${r}${n}`,[l,d]=T5e(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=R5e(d),u=[],f=[];return h.forEach(p=>{p.starta?(u.push({start:0,end:p.end-a}),f.push({start:p.start,end:a})):p.start>=a?u.push({start:p.start-a,end:p.end-a}):f.push(p)}),{score:l,labelMatch:u,descriptionMatch:f}}}return nne}function R5e(n){const e=[];if(!n)return e;let t;for(const i of n)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function axe(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!G5t(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function G5t(n,e){return!(n.endoxe||l>oxe){if(c!==l)return c>l?-1:1;if(cl?-1:1;const d=Array.isArray(r.labelMatch)&&r.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=M5e(n,r,s),f=M5e(e,a,s);return u&&f&&u!==f?f>u?-1:1:j5t(n,e,t,s)}function M5e(n,e,t){let i=-1,s=-1;if(e.descriptionMatch&&e.descriptionMatch.length?i=e.descriptionMatch[0].start:e.labelMatch&&e.labelMatch.length&&(i=e.labelMatch[0].start),e.labelMatch&&e.labelMatch.length){if(s=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(n);o&&(s+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(s=e.descriptionMatch[e.descriptionMatch.length-1].end);return s-i}function Q5t(n,e){if(!n&&!e||(!n||!n.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!n||!n.length)return 1;const t=n[0].start,s=n[n.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return s===a?0:a=0,r=N5e(n);let a;const c=n.split(vst);if(c.length>1)for(const l of c){const d=N5e(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=P5e(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function P5e(n){let e;Is?e=n.replace(/\//g,dg):e=n.replace(/\\/g,dg);const t=Mlt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function F5e(n){return Array.isArray(n)?y6(n.map(e=>e.original).join(vst)):y6(n.original)}var cxe,lxe,dxe;const L5="vs/workbench/browser/parts/editor/editorQuickAccess";let S6=class extends zFe{constructor(e,t,i,s,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(L5,0,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=s,this.languageService=o,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(r){r||(this.scorerCache=Object.create(null)),this.isQuickNavigating=r}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=y6(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=rxe(o,t,!0,_Ue,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(gg.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):q5t(r,a,t,!0,_Ue,this.pickState.scorerCache))}const s=[];if(this.editorGroupService.count>1){let o;for(const r of i){if(typeof o!="number"||o!==r.groupId){const a=this.editorGroupService.getGroup(r.groupId);a&&s.push({type:"separator",label:a.label}),o=r.groupId}s.push(r)}}else s.push(...i);return s}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const s=this.editorGroupService.getGroup(i);s&&t.set(i,s.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:s})=>{const o=Qc.getOriginalUri(i,{supportSideBySide:go.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:s,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(L5,1,"{0}, unsaved changes, {1}",c,t.get(s)):g(L5,2,"{0}, {1}",c,t.get(s)):r?g(L5,3,"{0}, unsaved changes",c):c,description:a,iconClasses:lI(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(s)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+$e.asClassName(Ce.closeDirty):$e.asClassName(Ce.close),tooltip:g(L5,4,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(s);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?BE.REMOVE_ITEM:BE.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(s)?.openEditor(i,{preserveFocus:d.inBackground})}})}};S6=D([_(1,ur),_(2,_i),_(3,Ai),_(4,Di)],S6);var sP;let O5e=(sP=class extends S6{constructor(e,t,i,s){super(cxe.PREFIX,e,t,i,s)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(eg.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},cxe=sP,sP.PREFIX="edt active ",sP);O5e=cxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],O5e);var oP;let B5e=(oP=class extends S6{constructor(e,t,i,s){super(lxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(gg.GRID_APPEARANCE))for(const i of t.getEditors(eg.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},lxe=oP,oP.PREFIX="edt ",oP);B5e=lxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],B5e);var rP;let W5e=(rP=class extends S6{constructor(e,t,i,s){super(dxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(eg.MOST_RECENTLY_ACTIVE))e.push(t);return e}},dxe=rP,rP.PREFIX="edt mru ",rP);W5e=dxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],W5e);var K5t=".side-by-side-editor-container{height:100%;width:100%}";Ct(K5t,{});var kB;const Y5t="vs/workbench/common/editor/sideBySideEditorInput";var aP;let mm=(aP=class extends cC{get typeId(){return kB.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Mi.CanSplitInGroup,this.secondary.hasCapability(Mi.RequiresTrust)&&(e|=Mi.RequiresTrust),this.secondary.hasCapability(Mi.Singleton)&&(e|=Mi.Singleton),e|=Mi.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,s,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=s,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(T.once(T.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(){const e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():g(Y5t,0,"{0} - {1}",this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){const t=this.getPreferredDescription();return t||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t;this.hasIdenticalSides?t=this.primary.getTitle(e)??this.getName():t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}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,t){const i=await this.primary.save(e,t);return this.saveResultToEditor(i)}async saveAs(e,t){const i=await this.primary.saveAs(e,t);return this.saveResultToEditor(i)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof cC)return new kB(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!Gv(e)&&!V$(e)&&!LE(e)&&!Wb(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,t){return this.primary.revert(e,t)}async rename(e,t){if(!this.hasIdenticalSides)return;const i=await this.primary.rename(e,t);if(i){if(Qa(i.editor))return{editor:new kB(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:qW(this,e,this.editorService)}};if(wb(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:qW(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){const t=this.primary.toUntyped(e),i=this.secondary.toUntyped(e);if(t&&i&&!Gv(t)&&!Gv(i)&&!V$(t)&&!V$(i)&&!LE(t)&&!LE(i)&&!Wb(t)&&!Wb(i)){const s={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(s.options={viewState:qW(this,e.preserveViewState,this.editorService)}),s}}matches(e){return this===e?!0:EZe(e)||Gv(e)?!1:e instanceof kB?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):LE(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},kB=aP,aP.ID="workbench.editorinputs.sidebysideEditorInput",aP);mm=kB=D([_(4,_i)],mm);const Ol=class Ol{constructor(e,t){this.storageService=t,this.id=Ol.COMMON_PREFIX+e}getMemento(e,t){switch(e){case ke.WORKSPACE:{let i=Ol.workspaceMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.workspaceMementos.set(this.id,i)),i.getMemento()}case ke.PROFILE:{let i=Ol.profileMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.profileMementos.set(this.id,i)),i.getMemento()}case ke.APPLICATION:{let i=Ol.applicationMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Ol.workspaceMementos.get(this.id)?.save(),Ol.profileMementos.get(this.id)?.save(),Ol.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case ke.APPLICATION:t=Ol.applicationMementos.get(this.id);break;case ke.PROFILE:t=Ol.profileMementos.get(this.id);break;case ke.WORKSPACE:t=Ol.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case ke.WORKSPACE:Ol.workspaceMementos.clear();break;case ke.PROFILE:Ol.profileMementos.clear();break;case ke.APPLICATION:Ol.applicationMementos.clear();break}}};Ol.applicationMementos=new Map,Ol.profileMementos=new Map,Ol.workspaceMementos=new Map,Ol.COMMON_PREFIX="memento/";let W1=Ol;class Lpe{constructor(e,t,i,s){this.id=e,this.scope=t,this.target=i,this.storageService=s,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){bt(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(const e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){n1(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class wst extends VMe{constructor(e,t,i){super(t),this.id=e,this.memento=new W1(this.id,i),this._register(i.onWillSaveState(()=>{this.saveState(),this.memento.saveMemento()}))}getId(){return this.id}getMemento(e,t){return this.memento.getMemento(e,t)}reloadMemento(e){return this.memento.reloadMemento(e)}onDidChangeMementoValue(e,t){return this.memento.onDidChangeValue(e,t)}saveState(){}}class J5t extends wst{get onDidFocus(){return this._onDidFocus||(this._onDidFocus=this.registerFocusTrackEvents().onDidFocus),this._onDidFocus.event}get onDidBlur(){return this._onDidBlur||(this._onDidBlur=this.registerFocusTrackEvents().onDidBlur),this._onDidBlur.event}hasFocus(){return this._hasFocus}registerFocusTrackEvents(){const e=ws(this.getContainer()),t=this._register(Dd(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const s=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,s.fire()})),{onDidFocus:i,onDidBlur:s}}constructor(e,t,i,s){super(e,i,s),this.telemetryService=t,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._hasFocus=!1,this.visible=!1}getTitle(){}create(e){this.parent=e}getContainer(){return this.parent}setVisible(e){this.visible!==!!e&&(this.visible=e)}focus(){}getMenuIds(){return[]}getActions(){return[]}getSecondaryActions(){return[]}getContextMenuActions(){return[]}getActionViewItem(e,t){}getActionsContext(){return null}getActionRunner(){return this.actionRunner||(this.actionRunner=this._register(new gw)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const eW=class eW extends J5t{get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}get input(){return this._input}get options(){return this._options}get window(){return vZ(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,s,o){super(e,i,s,o),this.group=t,this.onDidChangeSizeConstraints=T.None,this._onDidChangeControl=this._register(new I),this.onDidChangeControl=this._onDidChangeControl.event}create(e){super.create(e),this.createEditor(e)}async setInput(e,t,i,s){this._input=e,this._options=t}clearInput(){this._input=void 0,this._options=void 0}setOptions(e){this._options=e}setVisible(e){super.setVisible(e),this.setEditorVisible(e)}setEditorVisible(e){}setBoundarySashes(e){}getEditorMemento(e,t,i,s=10){const o=`${this.getId()}${i}`;let r=eW.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new hxe(this.getId(),i,this.getMemento(ke.WORKSPACE,ln.MACHINE),s,e,t)),eW.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of eW.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};eW.EDITOR_MEMENTOS=new Map;let sne=eW;const tW=class tW extends ${constructor(e,t,i,s,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=s,this.editorGroupService=o,this.configurationService=r,this.cleanedUp=!1,this.shareEditorState=!1,this.updateConfiguration(void 0),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){(!e||e.affectsConfiguration(void 0,"workbench.editor.sharedViewState"))&&(this.shareEditorState=this.configurationService.getValue(void 0,"workbench.editor.sharedViewState")===!0)}saveEditorState(e,t,i){const s=this.doGetResource(t);if(!s||!e)return;const o=this.doLoad();let r=o.get(s.toString());r||(r=Object.create(null),o.set(s.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[tW.SHARED_EDITOR_STATE]=i),Qa(t)&&this.clearEditorStateOnDispose(s,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const o=this.doLoad().get(i.toString());if(o){const r=o[e.id];if(r)return r;if(this.shareEditorState)return o[tW.SHARED_EDITOR_STATE]}}clearEditorState(e,t){Qa(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const s=this.doLoad();if(t){const o=s.get(i.toString());o&&(delete o[t.id],n1(o)&&s.delete(i.toString()))}else s.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,T.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const s=this.doLoad(),o=[...s.keys()];for(const r of o){const a=P.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(_n(e,a))c=t;else{const d=GQe(a.path,e.path);c=qt(t,a.path.substr(d+e.path.length+1))}const l=s.get(r,Vd.None);l&&(s.delete(r),s.set(c.toString(),l))}}doGetResource(e){return Qa(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new L_(this.limit);const e=this.memento[this.key];Array.isArray(e)&&this.cache.fromJSON(e)}return this.cache}saveState(){const e=this.doLoad();this.cleanedUp||(this.cleanUp(),this.cleanedUp=!0),this.memento[this.key]=e.toJSON()}cleanUp(){const e=this.doLoad(),t=[...e.entries()];for(const[i,s]of t)for(const o of Object.keys(s)){const r=Number(o);r===tW.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete s[r],n1(s)&&e.delete(i))}}};tW.SHARED_EDITOR_STATE=-1;let hxe=tW,one=class extends sne{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,s,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new Dn),this.viewState=this.getEditorMemento(d,a,i,100)}setEditorVisible(e){this.groupListener.value=this.group.onWillCloseEditor(t=>this.onWillCloseEditor(t)),super.setEditorVisible(e)}onWillCloseEditor(e){const t=e.editor;t===this.input&&this.updateEditorViewState(t)}clearInput(){this.updateEditorViewState(this.input),super.clearInput()}saveState(){this.updateEditorViewState(this.input),super.saveState()}updateEditorViewState(e){if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);t&&(this.tracksDisposedEditorViewState()||(this.editorViewStateDisposables||(this.editorViewStateDisposables=new Map),this.editorViewStateDisposables.has(e)||this.editorViewStateDisposables.set(e,T.once(e.onWillDispose)(()=>{this.clearEditorViewState(t,this.group),this.editorViewStateDisposables?.delete(e)}))),e.isDisposed()&&!this.tracksDisposedEditorViewState()||!this.shouldRestoreEditorViewState(e)&&!this.group.contains(e)?this.clearEditorViewState(t,this.group):e.isDisposed()||this.saveEditorViewState(t))}shouldRestoreEditorViewState(e,t){return t?.newInGroup?this.textResourceConfigurationService.getValue(Qc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}),"workbench.editor.restoreViewState")!==!1:!0}getViewState(){const e=this.input;if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);if(t)return this.computeEditorViewState(t)}saveEditorViewState(e){const t=this.computeEditorViewState(e);t&&this.viewState.saveEditorState(this.group,e,t)}loadEditorViewState(e,t){if(!e||!this.tracksEditorViewState(e)||!this.shouldRestoreEditorViewState(e,t))return;const i=this.toEditorViewStateResource(e);if(i)return this.viewState.loadEditorState(this.group,i)}moveEditorViewState(e,t,i){return this.viewState.moveEditorState(e,t,i)}clearEditorViewState(e,t){this.viewState.clearEditorState(e,t)}dispose(){if(super.dispose(),this.editorViewStateDisposables){for(const[,e]of this.editorViewStateDisposables)e.dispose();this.editorViewStateDisposables=void 0}}tracksDisposedEditorViewState(){return!1}};one=D([_(3,on),_(4,be),_(5,sn),_(6,dl),_(7,pn),_(8,_i),_(9,ur)],one);var nT;const X5t="vs/workbench/browser/parts/editor/sideBySideEditor";function Z5t(n){const e=n;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var XE;let uxe=(XE=class extends one{get minimumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.minimumWidth:0}get maximumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.minimumHeight:0}get maximumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}get minimumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumWidth:0}get maximumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumHeight:0}get maximumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}set minimumWidth(e){}set maximumWidth(e){}set minimumHeight(e){}set maximumHeight(e){}get minimumWidth(){return this.minimumPrimaryWidth+this.minimumSecondaryWidth}get maximumWidth(){return this.maximumPrimaryWidth+this.maximumSecondaryWidth}get minimumHeight(){return this.minimumPrimaryHeight+this.minimumSecondaryHeight}get maximumHeight(){return this.maximumPrimaryHeight+this.maximumSecondaryHeight}constructor(e,t,i,s,o,r,a,c,l){super(nT.ID,e,nT.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,s,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new v_e),this.onDidChangeSizeConstraints=T.any(this.onDidCreateEditors.event,this._onDidChangeSizeConstraints.event),this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this.primaryEditorPane=void 0,this.secondaryEditorPane=void 0,this.splitviewDisposables=this._register(new Z),this.editorDisposables=this._register(new Z),this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.dimension=new Tn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(nT.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=ws(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(e.removeChild(this.splitview.el),this.splitviewDisposables.clear()),this.createSplitView(e,t),this.layout(this.dimension)}getSplitViewRatio(){let e;if(this.splitview){const t=this.splitview.getViewSize(0),i=this.splitview.getViewSize(1);if(Math.abs(t-i)>1){const s=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/s}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new x7(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===vi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=A1.Distribute,s=A1.Distribute;if(t){const a=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),s=a-i,this.splitview.layout(this.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=ws(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},i);const r=ws(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},s),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(X5t,0,"Side by Side Editor")}async setInput(e,t,i,s){const o=this.input;await super.setInput(e,t,i,s),(!o||!e.matches(o))&&(o&&this.disposeEditors(),this.createEditors(e));const{primary:r,secondary:a,viewState:c}=this.loadViewState(e,t,i);if(this.lastFocusedSide=c?.focus,typeof c?.ratio=="number"&&this.splitview){const l=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;this.splitview.resizeView(0,Math.round(l*c.ratio))}else this.splitview?.distributeViewSizes();await Promise.all([this.secondaryEditorPane?.setInput(e.secondary,a,i,s),this.primaryEditorPane?.setInput(e.primary,r,i,s)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const s=Z5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===go.SECONDARY?r={...t}:o={...t},o.viewState=s?.primary,s?.secondary&&(r?r.viewState=s?.secondary:r={viewState:s.secondary}),{primary:o,secondary:r,viewState:s}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,ws(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,ws(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=T.any(T.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),T.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.SECONDARY)))}doCreateEditor(e,t){const i=it.as(zS.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const s=i.instantiate(this.instantiationService,this.group);return s.create(t),s.setVisible(this.isVisible()),uVe(s)&&this.editorDisposables.add(s.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(s),s}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(uVe(e)){const t=e.getSelection();if(t)return new XFe(t,e===this.primaryEditorPane?go.PRIMARY:go.SECONDARY)}}setOptions(e){super.setOptions(e),typeof e?.target=="number"&&(this.lastFocusedSide=e.target),this.getLastFocusedEditorPane()?.setOptions(e)}setEditorVisible(e){this.primaryEditorPane?.setVisible(e),this.secondaryEditorPane?.setVisible(e),super.setEditorVisible(e)}clearInput(){super.clearInput(),this.primaryEditorPane?.clearInput(),this.secondaryEditorPane?.clearInput(),this.disposeEditors()}focus(){super.focus(),this.getLastFocusedEditorPane()?.focus()}getLastFocusedEditorPane(){return this.lastFocusedSide===go.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,ws(this.splitview).layout(this.orientation===vi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===vi.HORIZONTAL?new Tn(t,this.dimension.height):new Tn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof mm}computeEditorViewState(e){if(!this.input||!_n(e,this.toEditorViewStateResource(this.input)))return;const t=this.primaryEditorPane?.getViewState(),i=this.secondaryEditorPane?.getViewState();if(!(!t||!i))return{primary:t,secondary:i,focus:this.lastFocusedSide,ratio:this.getSplitViewRatio()}}toEditorViewStateResource(e){let t,i;if(e instanceof mm&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return P.from({scheme:"sideBySide",path:`${O9(i.toString())}${O9(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===vi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(HTt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(WTt)??"",this.primaryEditorContainer.style.borderLeftWidth="0"))}dispose(){this.disposeEditors(),super.dispose()}disposeEditors(){this.editorDisposables.clear(),this.secondaryEditorPane=void 0,this.primaryEditorPane=void 0,this.lastFocusedSide=void 0,this.secondaryEditorContainer&&Yo(this.secondaryEditorContainer),this.primaryEditorContainer&&Yo(this.primaryEditorContainer)}},nT=XE,XE.ID=QLt,XE.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",XE.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",XE);uxe=nT=D([_(1,on),_(2,be),_(3,pn),_(4,sn),_(5,Re),_(6,dl),_(7,_i),_(8,ur)],uxe);class XFe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof XFe)||this.side!==e.side?Jk.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const H5e="vs/workbench/browser/editor",ey=class ey{static didInstantiateEditorPane(e){return ey.instantiatedEditorPanes.has(e)}static create(e,t,i){return new ey(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){ey._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return ey.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};ey.instantiatedEditorPanes=new Set,ey._onWillInstantiateEditorPane=new I,ey.onWillInstantiateEditorPane=ey._onWillInstantiateEditorPane.event;let U5e=ey;class e3t{constructor(){this.mapEditorPanesToEditors=new Map}registerEditorPane(e,t){return this.mapEditorPanesToEditors.set(e,t),Ee(()=>{this.mapEditorPanesToEditors.delete(e)})}getEditorPane(e){const t=this.findEditorPaneDescriptors(e);if(t.length!==0)return t.length===1?t[0]:e.prefersEditorPane(t)}findEditorPaneDescriptors(e,t){const i=[];for(const s of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(s)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(s);break}else if(t&&e instanceof a){i.push(s);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return fi.find(this.mapEditorPanesToEditors.keys(),t=>t.typeId===e)}getEditorPanes(){return Array.from(this.mapEditorPanesToEditors.keys())}getEditors(){const e=[];for(const t of this.mapEditorPanesToEditors.keys()){const i=this.mapEditorPanesToEditors.get(t);i&&e.push(...i.map(s=>s.ctor))}return e}}it.add(zS.EditorPane,new e3t);function t3t(n,e){const t=n.get(_i),i=n.get(_o),s=n.get(Pw);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===mx.MOVE)return;let l=Qc.getOriginalUri(c.editor,{supportSideBySide:go.PRIMARY}),d=Qc.getOriginalUri(c.editor,{supportSideBySide:go.SECONDARY});if(c.context===mx.REPLACE){const h=Qc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),u=Qc.getOriginalUri(t.activeEditor,{supportSideBySide:go.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(r=r.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==mx.REPLACE&&(l?.scheme===_e.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===_e.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>s.isDirty(u));return h.length>0&&await ko.settled(h.map(async u=>await new Promise(f=>{if(!s.isDirty(u))return f();const p=s.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function i3t(n,e,t,i){let s=n.getAriaLabel();return t&&!t.isPinned(n)&&(s=g(H5e,0,"{0}, preview",s)),t?.isSticky(n)&&(s=g(H5e,1,"{0}, pinned",s)),t&&typeof i=="number"&&i>1&&(s=`${s}, ${t.ariaLabel}`),s}var gxe;const n3t="vs/workbench/browser/parts/editor/textEditor";var cP;let fxe=(cP=class extends one{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,gxe.VIEW_STATE_PREFERENCE_KEY,i,s,o,r,a,c,l),this.fileService=d,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeScroll=this._register(new I),this.onDidChangeScroll=this._onDidChangeScroll.event,this.inputListener=this._register(new Dn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(T.any(this.editorGroupService.onDidAddGroup,this.editorGroupService.onDidRemoveGroup)(()=>{const h=this.computeAriaLabel();this.editorContainer?.setAttribute("aria-label",h),this.updateEditorControlOptions({ariaLabel:h})})),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(h=>this.onDidChangeFileSystemProvider(h.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(h=>this.onDidChangeFileSystemProvider(h.scheme)))}handleConfigurationChangeEvent(e){const t=this.getActiveResource();this.shouldHandleConfigurationChangeEvent(e,t)&&(this.isVisible()?this.updateEditorConfiguration(t):this.hasPendingConfigurationChange=!0)}shouldHandleConfigurationChangeEvent(e,t){return e.affectsConfiguration(t,"editor")||e.affectsConfiguration(t,"problems.visibility")}consumePendingConfigurationChangeEvent(){this.hasPendingConfigurationChange&&(this.updateEditorConfiguration(),this.hasPendingConfigurationChange=!1)}computeConfiguration(e){const t=fo(e.editor)?Vs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?i3t(this.input,void 0,this.group,this.editorGroupService.count):g(n3t,0,"Editor")}onDidChangeFileSystemProvider(e){this.input&&this.getActiveResource()?.scheme===e&&this.updateReadonly(this.input)}onDidChangeInputCapabilities(e){this.input===e&&this.updateReadonly(e)}updateReadonly(e){this.updateEditorControlOptions({...this.getReadonlyConfiguration(e.isReadonly())})}getReadonlyConfiguration(e){return{readOnly:!!e,readOnlyMessage:typeof e!="boolean"?e:void 0}}getConfigurationOverrides(e){return{overviewRulerLanes:3,lineNumbersMinChars:3,fixedOverflowWidgets:!0,...this.getReadonlyConfiguration(this.input?.isReadonly()),renderValidationDecorations:e.problems?.visibility!==!1?"on":"off"}}createEditor(e){this.editorContainer=e,this.createEditorControl(e,this.computeConfiguration(this.textResourceConfigurationService.getValue(this.getActiveResource()))),this.registerCodeEditorListeners()}registerCodeEditorListeners(){const e=this.getMainControl();e&&(this._register(e.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeModel(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeCursorPosition(t=>this._onDidChangeSelection.fire({reason:this.toEditorPaneSelectionChangeReason(t)}))),this._register(e.onDidChangeModelContent(()=>this._onDidChangeSelection.fire({reason:RT.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case jb.PROGRAMMATIC:return RT.PROGRAMMATIC;case jb.NAVIGATION:return RT.NAVIGATION;case jb.JUMP:return RT.JUMP;default:return RT.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new pxe(t)}}async setInput(e,t,i,s){await super.setInput(e,t,i,s),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),ws(this.editorContainer).setAttribute("aria-label",this.computeAriaLabel())}clearInput(){this.inputListener.clear(),super.clearInput()}getScrollPosition(){const e=this.getMainControl();if(!e)throw new Error("Control has not yet been initialized");return{scrollTop:e.getScrollTop()-e.getTopForLineNumber(1),scrollLeft:e.getScrollLeft()}}setScrollPosition(e){const t=this.getMainControl();if(!t)throw new Error("Control has not yet been initialized");t.setScrollTop(e.scrollTop),e.scrollLeft&&t.setScrollLeft(e.scrollLeft)}setEditorVisible(e){e&&this.consumePendingConfigurationChangeEvent(),super.setEditorVisible(e)}toEditorViewStateResource(e){return e.resource}updateEditorConfiguration(e=this.getActiveResource()){let t;if(e&&(t=this.textResourceConfigurationService.getValue(e)),!t)return;const i=this.computeConfiguration(t);let s=i;this.lastAppliedEditorOptions&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(s))}getActiveResource(){const e=this.getMainControl();if(e){const t=e.getModel();if(t)return t.uri}if(this.input)return this.input.resource}dispose(){this.lastAppliedEditorOptions=void 0,super.dispose()}},gxe=cP,cP.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",cP);fxe=gxe=D([_(2,on),_(3,be),_(4,sn),_(5,dl),_(6,pn),_(7,_i),_(8,ur),_(9,ci)],fxe);const r9=class r9{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof r9))return Jk.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Jk.IDENTICAL:Math.abs(t-i){this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get hasLanguageSetExplicitly(){return this._hasLanguageSetExplicitly}setLanguageId(e,t){this._hasLanguageSetExplicitly=!0,this.setLanguageIdInternal(e,t)}setLanguageIdInternal(e,t){this.isResolved()&&(!e||e===this.textEditorModel.getLanguageId()||this.textEditorModel.setLanguage(this.languageService.createById(e),t))}installModelListeners(e){const t=this._register(e.onDidChangeLanguage(i=>{i.source!==V5e&&(this._hasLanguageSetExplicitly=!0,t.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()??Kc))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,V5e);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(o3t,0,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const s=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,s);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let s=i&&this.modelService.getModel(i);return s?this.updateTextEditorModel(e,t.languageId):(s=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(s)),this.textEditorModelHandle=s.uri,s}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,s){return!i||i===Kc?t.createByFilepathOrFirstLine(e??null,s):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Kc&&this.textEditorModel.getLanguageId()!==t&&this.textEditorModel.setLanguage(this.languageService.createById(t)))}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()}},mxe=lP,lP.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,lP);H1=mxe=D([_(0,Ai),_(1,Di),_(2,LQ),_(3,Ur)],H1);class bst extends pL{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}class Cst extends bst{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}constructor(e,t){super(e,t),this._textDiffEditorModel=void 0,this._originalModel=e,this._modifiedModel=t,this.updateTextDiffEditorModel()}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 cX;const r3t="vs/workbench/common/editor/diffEditorInput";var dP;let op=(dP=class extends mm{get typeId(){return cX.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|=Mi.ForceDescription),e}constructor(e,t,i,s,o,r){super(e,t,i,s,r),this.original=i,this.modified=s,this.forceOpenAsBinary=o,this.cachedModel=void 0,this.labels=this.computeLabels()}computeLabels(){let e,t=!1;if(this.preferredName)e=this.preferredName;else{const d=this.original.getName(),h=this.modified.getName();e=g(r3t,0,"{0} ↔ {1}",d,h),t=d===h}let i,s,o;if(this.preferredDescription)i=this.preferredDescription,s=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Gs.SHORT),this.modified.getDescription(Gs.SHORT)),o=this.computeLabel(this.original.getDescription(Gs.LONG),this.modified.getDescription(Gs.LONG));const d=this.original.getDescription(Gs.MEDIUM),h=this.modified.getDescription(Gs.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=rPt([d,h]);s=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Gs.SHORT)??this.original.getName(),this.modified.getTitle(Gs.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Gs.MEDIUM)??this.original.getName(),this.modified.getTitle(Gs.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Gs.LONG)??this.original.getName(),this.modified.getTitle(Gs.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:s,longDescription:o,forceDescription:t,shortTitle:r,mediumTitle:a,longTitle:c}}computeLabel(e,t,i=" - "){if(!(!e||!t))return e===t?t:`${e}${i}${t}`}getName(){return this.labels.name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.labels.shortDescription;case Gs.LONG:return this.labels.longDescription;case Gs.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Gs.SHORT:return this.labels.shortTitle;case Gs.LONG:return this.labels.longTitle;default:case Gs.MEDIUM:return this.labels.mediumTitle}}async resolve(){const e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(t=>t.typeId===jLt):e.find(t=>t.typeId===SZe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof H1&&e instanceof H1?new Cst(e,t):new bst(mUe(e)?e:void 0,mUe(t)?t:void 0)}toUntyped(e){const t=super.toUntyped(e);if(t)return{...t,modified:t.primary,original:t.secondary}}matches(e){return this===e?!0:e instanceof cX?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:Gv(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},cX=dP,dP.ID="workbench.editors.diffEditorInput",dP);op=cX=D([_(5,_i)],op);var _xe;const Tpe="vs/workbench/browser/parts/editor/textDiffEditor";var hP;let z5e=(hP=class extends fxe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Pe))}constructor(e,t,i,s,o,r,a,c,l,d){super(_xe.ID,e,t,i,s,o,a,r,c,l),this.preferencesService=d,this.diffEditorControl=void 0,this.inputLifecycleStopWatch=void 0,this._previousViewModel=null}getTitle(){return this.input?this.input.getName():g(Tpe,0,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(xm,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,s){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,s);try{const o=await e.resolve();if(s.isCancellationRequested)return;if(!(o instanceof Cst)){this.openAsBinary(e,t);return}const r=ws(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;mPe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=rne(t,r,vt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new ao(!1)}catch(o){await this.handleSetInputError(o,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===Xi.FILE_TOO_LARGE){let s;throw e instanceof hJ?s=g(Tpe,1,"At least one file is not displayed in the text compare editor because it is very large ({0}).",vl.formatSize(e.size)):s=g(Tpe,2,"At least one file is not displayed in the text compare editor because it is very large."),ZLt(this.group,t,i,s,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,s){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),s.restoreViewState(o),t?.revealIfVisible&&s.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,s=e.modified,o=this.instantiationService.createInstance(op,e.getName(),e.getDescription(),i,s,!0),r=it.as(zS.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(s)&&s.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:y1.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&rne(e,ws(this.diffEditorControl),vt.Smooth)}shouldHandleConfigurationChangeEvent(e,t){return super.shouldHandleConfigurationChangeEvent(e,t)?!0:e.affectsConfiguration(t,"diffEditor")||e.affectsConfiguration(t,"accessibility.verbosity.diffEditor")}computeConfiguration(e){const t=super.computeConfiguration(e);if(fo(e.diffEditor)){const s=Vs(e.diffEditor);s.diffCodeLens=s.codeLens,delete s.codeLens,s.diffWordWrap=s.wordWrap,delete s.wordWrap,Object.assign(t,s)}const i=e.accessibility?.verbosity?.diffEditor??!1;return t.accessibilityVerbose=i,t}getConfigurationOverrides(e){return{...super.getConfigurationOverrides(e),...this.getReadonlyConfiguration(this.input?.isReadonly()),originalEditable:this.input instanceof op&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof op?this.diffEditorControl?.updateOptions({...this.getReadonlyConfiguration(e.isReadonly()),originalEditable:!e.original.isReadonly()}):super.updateReadonly(e)}isFileBinaryError(e){return Array.isArray(e)?e.some(i=>this.isFileBinaryError(i)):e.textFileOperationResult===xV.FILE_IS_BINARY}clearInput(){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),super.clearInput();const e=this.inputLifecycleStopWatch?.elapsed();this.inputLifecycleStopWatch=void 0,typeof e=="number"&&this.logInputLifecycleTelemetry(e,this.getControl()?.getModel()?.modified?.getLanguageId()),this.diffEditorControl?.setModel(null)}logInputLifecycleTelemetry(e,t){let i=!1;this.diffEditorControl instanceof xm&&(i=this.diffEditorControl.collapseUnchangedRegions),this.telemetryService.publicLog2("diffEditor.editorVisibleTime",{editorVisibleTimeMs:e,languageId:t??"",collapseUnchangedRegions:i})}getControl(){return this.diffEditorControl}focus(){super.focus(),this.diffEditorControl?.focus()}hasFocus(){return this.diffEditorControl?.hasTextFocus()||super.hasFocus()}setEditorVisible(e){super.setEditorVisible(e),e?this.diffEditorControl?.onVisible():this.diffEditorControl?.onHide()}layout(e){this.diffEditorControl?.layout(e)}setBoundarySashes(e){this.diffEditorControl?.setBoundarySashes(e)}tracksEditorViewState(e){return e instanceof op}computeEditorViewState(e){if(!this.diffEditorControl)return;const t=this.diffEditorControl.getModel();if(!t||!t.modified||!t.original)return;const i=this.toEditorViewStateResource(t);if(i&&_n(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof op?(t=e.original.resource,i=e.modified.resource):Qa(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return P.from({scheme:"diff",path:`${O9(t.toString())}${O9(i.toString())}`})}},_xe=hP,hP.ID=SZe,hP);z5e=_xe=D([_(1,on),_(2,be),_(3,sn),_(4,dl),_(5,_i),_(6,pn),_(7,ur),_(8,ci),_(9,TQ)],z5e);function ane(n,e,t=wx){if(t===wx||t===Cw)return t;let i=n.getGroups(gg.GRID_APPEARANCE)[t];if(!i&&t<9){for(let s=0;s<=t;s++){const o=n.getGroups(gg.GRID_APPEARANCE);o[s]||n.addGroup(o[s-1],w6(e))}i=n.getGroups(gg.GRID_APPEARANCE)[t]}return i?.id??Cw}function U1(n,e){const t=typeof e=="number"?n.getGroup(e):e;return n.getGroups(gg.GRID_APPEARANCE).indexOf(t??n.activeGroup)}const a3t="workbench.action.closeEditorsAndGroup";function c3t(n,e,t){const i=e.lastFocusedList;if(i instanceof Pc&&i.getHTMLElement()===xl()){const s=c=>{if(vEe(c))return{groupId:c.id,editorIndex:void 0};const l=t.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?l.getIndexOfEditor(c.editor):-1}},o=c=>vEe(c)||HCe(c),r=i.getFocusedElements().filter(o),a=n||(r.length?r.map(s)[0]:void 0);if(a){const c=i.getSelectedElements().filter(o);return c.length>1?c.map(s):[a]}}else{const s=n?t.getGroup(n.groupId):t.activeGroup,o=n&&n.editorIndex!==void 0?s?.getEditorByIndex(n.editorIndex):s?.activeEditor;if(s&&o&&s.isSelected(o))return s.selectedEditors.map(r=>({groupId:s.id,editorIndex:s.getIndexOfEditor(r)}))}return n?[n]:[]}class l3t{constructor(e){this.root=new cne;for(const[t,i]of e)for(const s of i)this.root.add(t,s)}toString(){return this.root.toString()}getAttributes(e,t){const i=e.lastIndexOf(".");return i<1?{dirname:t,basename:e,extname:""}:{dirname:t,basename:e.substring(0,i),extname:e.substring(i+1)}}nest(e,t){const i=new cne;for(const r of e){const a=this.getAttributes(r,t),c=this.root.get(r,a);for(const l of c)i.add(l,r)}const s=(r,a=new Set)=>{if(a.has(r))return[];a.add(r);const c=this.getAttributes(r,t),l=i.get(r,c);return l.length===0?[r]:l.length===1&&l[0]===r?[r]:l.flatMap(d=>s(d,a))},o=new Map;for(const r of e){let a=s(r);a.length===0&&(a=[r]);for(const c of a){let l=o.get(c);l||o.set(c,l=new Set),r!==c&&l.add(r)}}return o}}class cne{constructor(){this.value=new ZFe,this.map=new Map}add(e,t){if(e==="")this.value.add(e,t);else if(e[0]==="*")this.value.add(e,t);else{const i=e[0],s=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new cne),o.add(s,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const s=e[0],o=e.slice(1),r=this.map.get(s);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => +`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(ua.Chat);let i="";const s=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(s){case 0:break;case 1:o=g(uA,1,"1 file tree");break;default:o=g(uA,2,"{0} file trees",s);break}const r=Xg.lexer(e.response.asString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(uA,3,"{0} {1} {2}",o,e.response.asString(),t):g(uA,4,"{0} {1}",o,e.response.asString());break;case 1:i=t?g(uA,5,"{0} 1 code block: {1} {2}",o,e.response.asString(),t):g(uA,6,"{0} 1 code block: {1}",o,e.response.asString());break;default:i=t?g(uA,7,"{0} {1} code blocks: {2}",o,r,e.response.asString(),t):g(uA,8,"{0} {1} code blocks",o,r,e.response.asString());break}return i}};MEe=D([_(0,Tw)],MEe);let NEe=class extends a_{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,s,o,r,a,c,l,d,h){super(null,e,{hoverDelegate:r?.hoverDelegate}),this._contextMenuProvider=o,this._options=r,this._container=null,this._dropdownContainer=null,this._primaryAction=new eC(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new gx(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:s?["codicon","codicon-chevron-down",s]:["codicon","codicon-chevron-down"],actionRunner:this._options?.actionRunner,keybindingProvider:this._options?.getKeyBinding,hoverDelegate:r?.hoverDelegate})}setActionContext(e){super.setActionContext(e),this._primaryAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-primary");const t=we(".action-container");this._primaryAction.render(he(this._container,t)),this._dropdownContainer=we(".dropdown-action-container"),this._dropdown.render(he(this._container,this._dropdownContainer)),this._register(pe(t,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())})),this._register(pe(this._dropdownContainer,xe.KEY_DOWN,i=>{const s=new os(i);s.equals(E.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),s.stopPropagation())})),this.updateEnabled()}focus(e){e?this._dropdown.focus():(this._primaryAction.element.tabIndex=0,this._primaryAction.element.focus())}blur(){this._primaryAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._primaryAction.element.tabIndex=0:(this._primaryAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}updateEnabled(){const e=!this.action.enabled;this.element?.classList.toggle("disabled",e)}update(e,t,i){this._dropdown.dispose(),this._dropdown=new gx(e,t,this._contextMenuProvider,{menuAsChild:!0,classNames:["codicon",i||"codicon-chevron-down"],actionRunner:this._options?.actionRunner,hoverDelegate:this._options?.hoverDelegate,keybindingProvider:this._options?.getKeyBinding}),this._dropdownContainer&&this._dropdown.render(this._dropdownContainer)}dispose(){this._primaryAction.dispose(),this._dropdown.dispose(),super.dispose()}};NEe=D([_(6,ti),_(7,Pi),_(8,Pe),_(9,pn),_(10,Ur)],NEe);const Gze="vs/workbench/browser/labels";function SC(n){if(!(!n||!n.resource))return P.isUri(n.resource)?n.resource:n.resource.primary}const r5t={onDidChangeVisibility:T.None};let B1=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=s,this.workspaceService=o,this.languageService=r,this.decorationsService=a,this.themeService=c,this.labelService=l,this.textFileService=d,this._onDidChangeDecorations=this._register(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this.widgets=[],this.labels=[],this.registerListeners(e)}registerListeners(e){this._register(e.onDidChangeVisibility(t=>{this.widgets.forEach(i=>i.notifyVisibilityChanged(t))})),this._register(this.languageService.onDidChange(()=>this.widgets.forEach(t=>t.notifyExtensionsRegistered()))),this._register(this.modelService.onModelLanguageChanged(t=>{t.model.uri&&this.widgets.forEach(i=>i.notifyModelLanguageChanged(t.model))})),this._register(this.modelService.onModelAdded(t=>{t.uri&&this.widgets.forEach(i=>i.notifyModelAdded(t))})),this._register(this.workspaceService.onDidChangeWorkspaceFolders(()=>{this.widgets.forEach(t=>t.notifyWorkspaceFoldersChange())})),this._register(this.decorationsService.onDidChangeDecorations(t=>{let i=!1;this.widgets.forEach(s=>{s.notifyFileDecorationsChanges(t)&&(i=!0)}),i&&this._onDidChangeDecorations.fire()})),this._register(this.themeService.onDidColorThemeChange(()=>this.widgets.forEach(t=>t.notifyThemeChange()))),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(SNe)&&this.widgets.forEach(i=>i.notifyFileAssociationsChange())})),this._register(this.labelService.onDidChangeFormatters(t=>{this.widgets.forEach(i=>i.notifyFormattersChange(t.scheme))})),this._register(this.textFileService.untitled.onDidChangeLabel(t=>{this.widgets.forEach(i=>i.notifyUntitledLabelChange(t.resource))}))}get(e){return this.labels[e]}create(e,t){const i=this.instantiationService.createInstance(PEe,e,t),s={element:i.element,onDidRender:i.onDidRender,setLabel:(o,r,a)=>i.setLabel(o,r,a),setResource:(o,r)=>i.setResource(o,r),setFile:(o,r)=>i.setFile(o,r),clear:()=>i.clear(),dispose:()=>this.disposeWidget(i)};return this.labels.push(s),this.widgets.push(i),s}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),St(e)}clear(){this.widgets=St(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};B1=D([_(1,be),_(2,Re),_(3,Ai),_(4,Ti),_(5,Di),_(6,rD),_(7,pn),_(8,eo),_(9,tr)],B1);let qze=class extends B1{get element(){return this.label}constructor(e,t,i,s,o,r,a,c,l,d,h){super(r5t,i,s,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};qze=D([_(2,be),_(3,Re),_(4,Ai),_(5,Ti),_(6,Di),_(7,rD),_(8,pn),_(9,eo),_(10,tr)],qze);var NT;(function(n){n[n.Basic=1]="Basic",n[n.Full=2]="Full"})(NT||(NT={}));let PEe=class extends T7{constructor(e,t,i,s,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=s,this.decorationsService=o,this.labelService=r,this.textFileService=a,this.contextService=c,this.notebookDocumentService=l,this._onDidRender=this._register(new I),this.onDidRender=this._onDidRender.event,this.label=void 0,this.decoration=this._register(new Dn),this.options=void 0,this.computedIconClasses=void 0,this.computedLanguageId=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0,this.needsRedraw=void 0,this.isHidden=!1}notifyVisibilityChanged(e){e===this.isHidden&&(this.isHidden=!e,e&&this.needsRedraw&&(this.render({updateIcon:this.needsRedraw===NT.Full,updateDecoration:this.needsRedraw===NT.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=SC(this.label);t&&_n(e.uri,t)&&this.computedLanguageId!==e.getLanguageId()&&(this.computedLanguageId=e.getLanguageId(),this.render({updateIcon:!0,updateDecoration:!1}))}notifyFileDecorationsChanges(e){if(!this.options)return!1;const t=SC(this.label);return t&&this.options.fileDecorations&&e.affectsResource(t)?this.render({updateIcon:!1,updateDecoration:!0}):!1}notifyExtensionsRegistered(){this.render({updateIcon:!0,updateDecoration:!1})}notifyThemeChange(){this.render({updateIcon:!1,updateDecoration:!1})}notifyFileAssociationsChange(){this.render({updateIcon:!0,updateDecoration:!1})}notifyFormattersChange(e){SC(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){_n(e,SC(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=SC(this.label);P.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let s;if(!i){if(t?.fileKind===Ic.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(s=r.name,this.computedWorkspaceFolderLabel=s)}s||(s=Ay(Mx(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(ma(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:s,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=SC(e),s=e?.resource&&!P.isUri(e.resource);if(!t.forceLabel&&!s&&i?.scheme===_e.untitled){const l=this.textFileService.untitled.get(i);if(l&&!l.hasAssociatedFilePath){if(typeof e.name=="string"&&(e.name=l.name),typeof e.description=="string"){const h=l.resource.path;e.name!==h?e.description=h:e.description=void 0}const d=l.resource.path;l.name!==d?t.title=`${l.name} • ${d}`:t.title=d}}if(!t.forceLabel&&!s&&i?.scheme===_e.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(Gze,0,"{0} • Cell {1}",e.name,`${d+1}`))}const o=this.hasResourceChanged(e),r=o||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,o&&(this.computedLanguageId=void 0),r&&(this.computedPathLabel=void 0),this.render({updateIcon:o||a||c,updateDecoration:o||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=SC(e),i=SC(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=SC(e);return!!t&&this.computedPathLabel!==this.labelService.getUriLabel(t)}hasIconChanged(e){return this.options?.icon!==e?.icon}clear(){this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.setLabel("")}render(e){if(this.isHidden)return this.needsRedraw!==NT.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?NT.Full:NT.Basic),!1;if(e.updateIcon&&(this.computedIconClasses=void 0),!this.label)return!1;const t={title:"",italic:this.options?.italic,strikethrough:this.options?.strikethrough,matches:this.options?.matches,descriptionMatches:this.options?.descriptionMatches,extraClasses:[],separator:this.options?.separator,domId:this.options?.domId,disabledCommand:this.options?.disabledCommand,labelEscapeNewLines:this.options?.labelEscapeNewLines,descriptionTitle:this.options?.descriptionTitle},i=SC(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==_e.data&&(!this.options?.title||typeof this.options.title!="string"&&!this.options.title.markdownNotSupportedFallback)&&(this.computedPathLabel||(this.computedPathLabel=this.labelService.getUriLabel(i)),!t.title||typeof t.title=="string"?t.title=this.computedPathLabel:t.title.markdownNotSupportedFallback||(t.title.markdownNotSupportedFallback=this.computedPathLabel)),this.options&&!this.options.hideIcon&&(this.computedIconClasses||(this.computedIconClasses=lI(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),P.isUri(this.options.icon)&&(t.iconPath=this.options.icon),t.extraClasses=this.computedIconClasses.slice(0)),this.options?.extraClasses&&t.extraClasses.push(...this.options.extraClasses),this.options?.fileDecorations&&i){e.updateDecoration&&(this.decoration.value=this.decorationsService.getDecoration(i,this.options.fileKind!==Ic.FILE));const s=this.decoration.value;if(s){if(s.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${s.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${s.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}s.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(s.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(s.badgeClassName),t.extraClasses.push(s.iconClassName))}}return this.label.range&&(t.suffix=this.label.range.startLineNumber!==this.label.range.endLineNumber?`:${this.label.range.startLineNumber}-${this.label.range.endLineNumber}`:`:${this.label.range.startLineNumber}`),this.setLabel(this.label.name??"",this.label.description,t),this._onDidRender.fire(),!0}dispose(){super.dispose(),this.label=void 0,this.options=void 0,this.computedLanguageId=void 0,this.computedIconClasses=void 0,this.computedPathLabel=void 0,this.computedWorkspaceFolderLabel=void 0}};PEe=D([_(2,Di),_(3,Ai),_(4,rD),_(5,eo),_(6,tr),_(7,Ti),_(8,Aet)],PEe);const QFe="vs/workbench/contrib/chat/browser/actions/chatExecuteActions",Wce=class Wce extends pi{constructor(){super({id:Wce.ID,title:Be(QFe,0,"Send"),f1:!1,category:tst,icon:Ce.send,precondition:ge.and(eFe,j7.negate()),keybinding:{when:tFe,primary:E.Enter,weight:ye.EditorContrib},menu:[{id:Te.ChatExecuteSecondary,group:"group_1"},{id:Te.ChatExecute,when:j7.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],s=e.get(lL);(i?.widget??s.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Wce.ID="workbench.action.chat.submit";let FEe=Wce;const Hce=class Hce extends pi{constructor(){super({id:Hce.ID,title:Be(QFe,1,"Submit to Secondary Agent"),precondition:ge.and(eFe,gtt.negate(),j7.negate()),keybinding:{when:tFe,primary:V.CtrlCmd|E.Enter,weight:ye.EditorContrib},menu:{id:Te.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(yp).getSecondaryAgent();if(!o)return;const r=e.get(lL),a=i?.widget??r.lastFocusedWidget;a&&(_zt(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${$z}${o.name}`)))}};Hce.ID="workbench.action.chat.submitSecondaryAgent";let OEe=Hce;const Uce=class Uce extends pi{constructor(){super({id:Uce.ID,title:Be(QFe,3,"Cancel"),f1:!1,category:tst,icon:Ce.debugStop,menu:{id:Te.ChatExecute,when:j7,group:"navigation"},keybinding:{weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.Escape}})}run(e,...t){const i=t[0],s=e.get(lL),o=i?.widget??s.lastFocusedWidget;if(!o)return;const r=e.get(Rw);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Uce.ID="workbench.action.chat.cancel";let BEe=Uce;const a5t="vs/workbench/contrib/chat/browser/chatFollowups",c5t=we;let $ie=class extends ${constructor(e,t,i,s,o,r){super(),this.location=i,this.options=s,this.clickHandler=o,this.chatAgentService=r;const a=he(e,c5t(".interactive-session-followups"));t.forEach(c=>this.renderFollowup(a,c))}renderFollowup(e,t){if(!this.chatAgentService.getDefaultAgent(this.location))return;let i="";if("agentId"in t&&t.agentId&&t.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const c=this.chatAgentService.getAgent(t.agentId);if(!c)return;i+=`${$z}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${O1}${t.subCommand} `)}const s=t.kind==="reply"?t.title||t.message:t.title,o=t.kind==="reply"?t.message:t.title,r=(i+("tooltip"in t&&t.tooltip||o)).trim(),a=this._register(new Tu(e,{...this.options,title:r}));t.kind==="reply"?a.element.classList.add("interactive-followup-reply"):t.kind==="command"&&a.element.classList.add("interactive-followup-command"),a.element.ariaLabel=g(a5t,0,"Follow up question: {0}",s),a.label=new Xt(s),this._register(a.onDidClick(()=>this.clickHandler(t)))}};$ie=D([_(5,yp)],$ie);var QJ;const ND="vs/workbench/contrib/chat/browser/chatInputPart",LL=we,Qze=250;var I0;let b6=(I0=class extends ${get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,s,o,r,a,c,l){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=s,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this._onDidLoadInputState=this._register(new I),this.onDidLoadInputState=this._onDidLoadInputState.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new I),this.onDidBlur=this._onDidBlur.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidAcceptFollowup=this._register(new I),this.onDidAcceptFollowup=this._onDidAcceptFollowup.event,this._indexOfLastAttachedContextDeletedWithKeyboard=-1,this._attachedContext=new Set,this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.onHistoryEntry=!1,this.inHistoryNavigation=!1,this.inputUri=P.parse(`${QJ.INPUT_SCHEME}:input-${QJ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?Qze/3:Qze,this.inputEditorHasText=eFe.bindTo(r),this.chatCursorAtTop=XPt.bindTo(r),this.inputEditorHasFocus=YPt.bindTo(r),this.history=new Bbe([],5),this._register(this.historyService.onDidClearHistory(()=>this.history.clear())),this._register(this.configurationService.onDidChangeConfiguration(d=>{d.affectsConfiguration(ua.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}_getAriaLabel(){if(this.configurationService.getValue(ua.Chat)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();return t?g(ND,0,"Chat Input, Type to ask questions or type / for topics, press enter to send out the request. Use {0} for Chat Accessibility Help.",t):g(ND,1,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(ND,2,"Chat Input")}setState(e){const t=this.historyService.getHistory(this.location);this.history=new Bbe(t,50),typeof e=="string"&&this.setValue(e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.navigateHistory(!0)}showNextValue(){this.navigateHistory(!1)}navigateHistory(e){const t=(e?this.history.previous()??this.history.first():this.history.next())??{text:""};if(this.onHistoryEntry=e||this.history.current()!==null,Cu(t.text),this.inHistoryNavigation=!0,this.setValue(t.text),this.inHistoryNavigation=!1,this._onDidLoadInputState.fire(t.state),e)this._inputEditor.setPosition({lineNumber:1,column:1});else{const i=this._inputEditor.getModel();if(!i)return;this._inputEditor.setPosition(jze(i))}}setValue(e){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1})}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e,t){if(e){let i=this.history.getHistory().find(s=>s.text===e);i?i.state=t:i={text:e,state:t},this.history.add(i)}this.accessibilityService.isScreenReaderOptimized()&&ei?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(this._inputEditorElement.removeChild(e),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}attachContext(...e){for(const t of e)this.attachedContext.add(t);this.initAttachedContext(this.attachedContextContainer)}render(e,t,i){this.container=he(e,LL(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=he(this.container,LL(".interactive-input-followups")),this.attachedContextContainer=he(this.container,LL(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const s=he(this.container,LL(".interactive-input-and-side-toolbar")),o=he(s,LL(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));tFe.bindTo(r).set(!0);const a=this.instantiationService.createChild(new Dl([Pe,r])),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(dhe(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=qFe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=iYe,d.fontSize=13,d.lineHeight=20,d.padding=this.options.renderStyle==="compact"?{top:2,bottom:2}:{top:8,bottom:8},d.cursorWidth=1,d.wrappingStrategy="advanced",d.bracketPairColorization={enabled:!1},d.suggest={showIcons:!1,showSnippets:!1,showWords:!0,showStatusBar:!1,insertMode:"replace"},d.scrollbar={...d.scrollbar??{},vertical:"hidden"},this._inputEditorElement=he(o,LL(".interactive-input-editor"));const h=Zzt();if(h.contributions?.push(...b_.getSomeEditorContributions([Nc.ID])),this._inputEditor=this._register(a.createInstance(_1,this._inputEditorElement,d,h)),this._register(this._inputEditor.onDidChangeModelContent(()=>{const f=Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight);f!==this.inputEditorHeight&&(this.inputEditorHeight=f,this._onDidChangeHeight.fire());const p=this._inputEditor.getModel(),m=!!p&&p.getValue().trim().length>0;this.inputEditorHasText.set(m),this.inHistoryNavigation||(this.onHistoryEntry=!1),this.onHistoryEntry||(this.historyNavigationForewardsEnablement.set(!m),this.historyNavigationBackwardsEnablement.set(!m))})),this._register(this._inputEditor.onDidFocusEditorText(()=>{this.inputEditorHasFocus.set(!0),this._onDidFocus.fire(),o.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),o.classList.toggle("focused",!1),this._onDidBlur.fire()})),this._register(this._inputEditor.onDidChangeCursorPosition(f=>{const p=this._inputEditor.getModel();if(!p)return;const m=f.position.column===1&&f.position.lineNumber===1;this.chatCursorAtTop.set(m),this.onHistoryEntry&&(this.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(jze(p))))})),this.toolbar=this._register(this.instantiationService.createInstance(nC,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:wS.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===lc.Panel&&(f.id===FEe.ID||f.id===BEe.ID)&&f instanceof id){const m=this.instantiationService.createInstance(id,{id:"chat.moreExecuteActions",title:g(ND,3,"More..."),icon:Ce.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(WEe,f,m)}}})),this.toolbar.getElement().classList.add("interactive-execute-toolbar"),this.toolbar.context={widget:i},this._register(this.toolbar.onDidChangeMenuItems(()=>{this.cachedDimensions&&typeof this.cachedToolbarWidth=="number"&&this.cachedToolbarWidth!==this.toolbar.getItemsWidth()&&this.layout(this.cachedDimensions.height,this.cachedDimensions.width)})),this.options.menus.inputSideToolbar){const f=this._register(this.instantiationService.createInstance(nC,s,this.options.menus.inputSideToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0}}));this.inputSideToolbarContainer=f.getElement(),f.getElement().classList.add("chat-side-toolbar"),f.context={widget:i}}let u=this.modelService.getModel(this.inputUri);if(u||(u=this.modelService.createModel("",null,this.inputUri,!0),this._register(u)),this.inputModel=u,this.inputModel.updateOptions({bracketColorizationOptions:{enabled:!1,independentColorPoolPerBracketType:!1}}),this._inputEditor.setModel(this.inputModel),t){this.inputModel.setValue(t);const f=this.inputModel.getLineCount();this._inputEditor.setPosition({lineNumber:f,column:this.inputModel.getLineMaxColumn(f)})}}initAttachedContext(e){Yo(e),this.attachedContextDisposables.clear(),_je(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((t,i)=>{const s=he(e,LL(".chat-attached-context-attachment.show-file-icons")),o=this._contextResourceLabels.create(s,{supportIcons:!0}),r=P.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&P.isUri(t.value.uri)?t.value.uri:void 0,a=t.value&&typeof t.value=="object"&&"range"in t.value&&O.isIRange(t.value.range)?t.value.range:void 0;if(r&&t.isFile){const d=yr(r.path),h=lS(r.path),u=`${d} ${h}`,f=a?g(ND,4,"Attached file, {0}, line {1} to line {2}",u,a.startLineNumber,a.endLineNumber):g(ND,5,"Attached file, {0}",u);o.setFile(r,{fileKind:Ic.FILE,hidePath:!0,range:a}),s.ariaLabel=f,s.tabIndex=0}else{const d=t.fullName??t.name;o.setLabel(d,void 0),s.ariaLabel=g(ND,6,"Attached context, {0}",t.name),s.tabIndex=0}const c=new Tu(s,{supportIcons:!0});i===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&c.focus(),this.attachedContextDisposables.add(c),c.icon=Ce.close;const l=c.onDidClick(d=>{if(this.attachedContext.delete(t),l.dispose(),Sv(d)){const h=new os(d);(h.equals(E.Enter)||h.equals(E.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=i)}this._onDidChangeHeight.fire(),this._onDidDeleteContext.fire(t)});this.attachedContextDisposables.add(l)})}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Yo(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance($ie,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))))}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new Tn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const s=this.getLayoutData(),o=Math.min(s.inputPartEditorHeight,e-s.followupsHeight-s.inputPartVerticalPadding);this._inputPartHeight=s.followupsHeight+o+s.inputPartVerticalPadding+s.inputEditorBorder+s.implicitContextHeight;const r=this._inputEditor.getScrollWidth(),c={width:t-s.inputPartHorizontalPadding-s.editorBorder-s.editorPadding-s.executeToolbarWidth-s.sideToolbarWidth-s.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==c.width||this.previousInputEditorDimension.height!==c.height)&&(this._inputEditor.layout(c),this.previousInputEditorDimension=c),i&&r<10)return this._layout(e,t,!1)}getLayoutData(){return{inputEditorBorder:2,followupsHeight:this.followupsContainer.offsetHeight,inputPartEditorHeight:Math.min(this._inputEditor.getContentHeight(),this.inputEditorMaxHeight),inputPartHorizontalPadding:this.options.renderStyle==="compact"?8:40,inputPartVerticalPadding:this.options.renderStyle==="compact"?12:24,implicitContextHeight:this.attachedContextContainer.offsetHeight,editorBorder:2,editorPadding:12,toolbarPadding:4,executeToolbarWidth:this.cachedToolbarWidth=this.toolbar.getItemsWidth(),sideToolbarWidth:this.inputSideToolbarContainer?du(this.inputSideToolbarContainer)+4:0}}saveState(){const e=this.history.getHistory();this.historyService.saveHistory(this.location,e)}},QJ=I0,I0.INPUT_SCHEME="chatSessionInput",I0._counter=0,I0);b6=QJ=D([_(2,WZe),_(3,Ai),_(4,be),_(5,Pe),_(6,Re),_(7,ti),_(8,Ur)],b6);function jze(n){return{lineNumber:n.getLineCount(),column:n.getLineLength(n.getLineCount())+1}}let WEe=class extends NEe{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,[],"",s,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(Te.ChatExecuteSecondary,r),u=()=>{const f=[];tD(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===OEe.ID&&(m.label=g(ND,7,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};WEe=D([_(2,_c),_(3,Vr),_(4,yp),_(5,Pe),_(6,ti),_(7,Pi),_(8,pn),_(9,Ur)],WEe);var l5t='.monaco-action-bar .action-item .action-label.extension-action{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-action-bar .action-dropdown-item>.action-label.extension-action.label,.monaco-action-bar .action-item>.action-label.extension-action.label{padding:0 5px}.monaco-action-bar .action-dropdown-item>.monaco-dropdown .action-label{padding:0}.monaco-action-bar .action-item .action-label.extension-action.label{outline-offset:1px}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.text{height:auto;line-height:14px;width:auto}.monaco-action-bar .action-item .action-label.extension-action.built-in-status{border-color:var(--vscode-foreground)}.monaco-action-bar .action-item .action-label.extension-action.label,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{background-color:var(--vscode-extensionButton-background)!important}.monaco-action-bar .action-item .action-label.extension-action.label{color:var(--vscode-extensionButton-foreground)!important}.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label:hover{background-color:var(--vscode-extensionButton-hoverBackground)!important}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{background-color:var(--vscode-extensionButton-separator)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent,.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator.prominent{background-color:var(--vscode-extensionButton-prominentBackground)}.monaco-action-bar .action-item .action-label.extension-action.label.prominent{color:var(--vscode-extensionButton-prominentForeground)!important}.monaco-action-bar .action-item.action-item:not(.disabled) .action-label.extension-action.label.prominent:hover{background-color:var(--vscode-extensionButton-prominentHoverBackground)}.monaco-action-bar .action-item .action-label.extension-action:not(.disabled){border:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{border-bottom:1px solid var(--vscode-contrastBorder);border-top:1px solid var(--vscode-contrastBorder)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-error{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info{color:var(--vscode-editorInfo-foreground)}.monaco-action-bar .action-dropdown-item .action-label.extension-action.label,.monaco-action-bar .action-item .action-label.extension-action.icon,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.label,.monaco-action-bar .action-item:not(.disabled) .action-label.extension-action.text{margin-top:2px}.monaco-action-bar .action-item .action-label.extension-action.manage.hide,.monaco-action-bar .action-item.action-dropdown-item .action-label.extension-action.hide,.monaco-action-bar .action-item.action-dropdown-item.disabled,.monaco-action-bar .action-item.checkbox-action-item.disabled,.monaco-action-bar .action-item.disabled .action-label.disable-status.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.extension-sync,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide,.monaco-action-bar .action-item.disabled .action-label.extension-action.hide-when-disabled,.monaco-action-bar .action-item.disabled .action-label.extension-action.ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.install:not(.installing),.monaco-action-bar .action-item.disabled .action-label.extension-action.language,.monaco-action-bar .action-item.disabled .action-label.extension-action.migrate,.monaco-action-bar .action-item.disabled .action-label.extension-action.reload,.monaco-action-bar .action-item.disabled .action-label.extension-action.theme,.monaco-action-bar .action-item.disabled .action-label.extension-action.undo-ignore,.monaco-action-bar .action-item.disabled .action-label.extension-action.uninstall:not(.uninstalling),.monaco-action-bar .action-item.disabled .action-label.extension-action.update,.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide,.monaco-action-bar .action-item.disabled .action-label.extension-status.hide{display:none}.monaco-action-bar .extension-action.label{display:inherit}.monaco-action-bar .action-item.disabled .action-label.extension-status:before{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-status-label:before{content:"\\2713";padding-right:4px}.monaco-action-bar .action-item.disabled .action-label.extension-action{opacity:1}.monaco-action-bar .action-item.disabled .action-label.extension-action.text{font-style:italic;opacity:.9}';Ct(l5t,{});const k5="vs/workbench/contrib/extensions/common/extensionsFileTemplate",d5t="vscode://schemas/extensions";g(k5,0,"Extensions"),g(k5,1,"List of extensions which should be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(k5,3,"List of extensions recommended by VS Code that should not be recommended for users of this workspace. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),g(k5,2,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const Kze=["{"," // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations."," // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp",""," // List of extensions which should be recommended for users of this workspace.",' "recommendations": ['," "," ],"," // List of extensions recommended by VS Code that should not be recommended for users of this workspace.",' "unwantedRecommendations": ['," "," ]","}"].join(` +`),h5t="vs/workbench/services/extensionManagement/common/extensionManagement";var Yze;(function(n){n[n.Local=1]="Local",n[n.Remote=2]="Remote",n[n.Web=3]="Web"})(Yze||(Yze={}));g(h5t,0,"Extensions");var ga;(function(n){n[n.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",n[n.DisabledByExtensionKind=1]="DisabledByExtensionKind",n[n.DisabledByEnvironment=2]="DisabledByEnvironment",n[n.EnabledByEnvironment=3]="EnabledByEnvironment",n[n.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",n[n.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",n[n.DisabledGlobally=6]="DisabledGlobally",n[n.DisabledWorkspace=7]="DisabledWorkspace",n[n.EnabledGlobally=8]="EnabledGlobally",n[n.EnabledWorkspace=9]="EnabledWorkspace"})(ga||(ga={}));var HEe;(function(n){n[n.Workspace=0]="Workspace",n[n.File=1]="File",n[n.Executable=2]="Executable",n[n.WorkspaceConfig=3]="WorkspaceConfig",n[n.DynamicWorkspace=4]="DynamicWorkspace",n[n.Experimental=5]="Experimental",n[n.Application=6]="Application"})(HEe||(HEe={}));const Gie="vs/workbench/browser/actions/workspaceCommands",u5t="addRootFolder";Be(Gie,0,"Add Folder to Workspace...");const g5t="setRootFolder",nst="_workbench.pickWorkspaceFolder";yt.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:n=>n.get(bf).pickFileFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"_files.pickFolderAndOpen",handler:(n,e)=>n.get(bf).pickFolderAndOpen(e)});yt.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:n=>n.get(bf).pickFolderAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:n=>n.get(bf).pickFileAndOpen({forceNewWindow:!0})});yt.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:n=>n.get(bf).pickWorkspaceAndOpen({forceNewWindow:!0})});yt.registerCommand({id:u5t,handler:async n=>{const e=n.get($S),t=await sst(n);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});yt.registerCommand({id:g5t,handler:async n=>{const e=n.get($S),t=n.get(Ti),i=await sst(n);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(s=>({uri:s})))}});async function sst(n){const e=n.get(bf),t=n.get(Lm);return await e.showOpenDialog({openLabel:YPe(g(Gie,1,"&&Add")),title:g(Gie,2,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}yt.registerCommand(nst,async function(n,e){const t=n.get(On),i=n.get(eo),s=n.get(Ti),o=n.get(Ai),r=n.get(Di),a=s.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(ma(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:lI(o,r,u.uri,Ic.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(Gie,3,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||qe.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});yt.registerCommand({id:"vscode.openFolder",handler:(n,e,t)=>{const i=n.get(ji);if(typeof t=="boolean"&&(t={forceNewWindow:t}),!e){const a={forceNewWindow:t?.forceNewWindow};return t?.forceLocalWindow&&(a.remoteAuthority=null,a.availableFileSystems=["file"]),i.executeCommand("_files.pickFolderAndOpen",a)}const s=P.from(e,!0),o={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},r=yde(s)||s.scheme===_e.untitled?{workspaceUri:s}:{folderUri:s};return i.executeCommand("_files.windowOpen",[r],o)},metadata:{description:"Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.",args:[{name:"uri",description:"(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder",constraint:n=>n==null||n instanceof P},{name:"options",description:"(optional) Options. Object with the following properties: `forceNewWindow`: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `forceReuseWindow`: Whether to force opening the folder/workspace in the same window. Defaults to false. `noRecentEntry`: Whether the opened URI will appear in the 'Open Recent' list. Defaults to false. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.",constraint:n=>n===void 0||typeof n=="object"||typeof n=="boolean"}]}});yt.registerCommand({id:"vscode.newWindow",handler:(n,e)=>{const t=n.get(ji),i={forceReuseWindow:e&&e.reuseWindow,remoteAuthority:e&&e.remoteAuthority};return t.executeCommand("_files.newWindow",i)},metadata:{description:"Opens an new window depending on the newWindow argument.",args:[{name:"options",description:"(optional) Options. Object with the following properties: `reuseWindow`: Whether to open a new window or the same. Defaults to opening in a new window. ",constraint:n=>n===void 0||typeof n=="object"}]}});yt.registerCommand("_workbench.removeFromRecentlyOpened",function(n,e){return n.get(cL).removeRecentlyOpened([e])});yt.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(n,e)=>{const t=n.get(cL);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?P.parse(e):P.file(e):e=P.revive(e),t.removeRecentlyOpened([e])},metadata:{description:"Removes an entry with the given path from the recently opened list.",args:[{name:"path",description:"URI or URI string to remove from recently opened.",constraint:n=>typeof n=="string"||n instanceof P}]}});yt.registerCommand("_workbench.addToRecentlyOpened",async function(n,e){const t=n.get(cL),i=e.uri,s=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:s,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:s,remoteAuthority:o}:r={fileUri:i,label:s,remoteAuthority:o},t.addRecentlyOpened([r])});yt.registerCommand("_workbench.getRecentlyOpened",async function(n){return n.get(cL).getRecentlyOpened()});const ZQ=pn,tB="vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig",p2=".vscode/extensions.json";let Jze=class extends ${constructor(e,t,i,s,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=s,this.languageService=o,this.jsonEditingService=r,this._onDidChangeExtensionsConfigs=this._register(new I),this.onDidChangeExtensionsConfigs=this._onDidChangeExtensionsConfigs.event,this._register(e.onDidChangeWorkspaceFolders(a=>this._onDidChangeExtensionsConfigs.fire())),this._register(t.onDidFilesChange(a=>{const c=e.getWorkspace();(c.configuration&&a.affects(c.configuration)||c.folders.some(l=>a.affects(l.toResource(p2))))&&this._onDidChangeExtensionsConfigs.fire()}))}async getExtensionsConfigs(){const e=this.workspaceContextService.getWorkspace(),t=[],i=e.configuration?await this.resolveWorkspaceExtensionConfig(e.configuration):void 0;return i&&t.push(i),t.push(...await Promise.all(e.folders.map(s=>this.resolveWorkspaceFolderExtensionConfig(s)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return Lc(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return Lc(e.flatMap(t=>t.unwantedRecommendations?t.unwantedRecommendations.map(i=>i.toLowerCase()):[]))}async toggleRecommendation(e){e=e.toLowerCase();const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>s.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)cbe(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,s.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,s=new wi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);s.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>s.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(tB,0,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(tB,1,"Add extension recommendation to"));for(const l of c)cbe(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,s.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,s){const o=[];if(s){Array.isArray(i.recommendations)?o.push({path:["recommendations",-1],value:e}):o.push({path:["recommendations"],value:[e]});const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","recommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&o.push(a)}else if(i.recommendations){const r=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,s){const o=[];if(s){const r=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}if(o.length)return this.jsonEditingService.write(t.toResource(p2),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,s){const o=[];if(i){if(s){const r=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?o.push({path:[...r,-1],value:e}):o.push({path:r,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&o.push(a)}else if(i.unwantedRecommendations){const r=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);r&&o.push(r)}}else s&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const s=t?[...e,t]:[...e];if(s.length===1)return s;const o=e.map(a=>({label:a.name,description:g(tB,2,"Workspace Folder"),workspaceOrFolder:a,iconClasses:lI(this.modelService,this.languageService,a.uri,Ic.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(tB,3,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(o,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=ow(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(p2)),i=ow(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:Lc((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:Lc((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const s=t?.indexOf(i);if(s!==void 0&&s!==-1)return{path:[...e,s],value:void 0}}};Jze=D([_(0,Ti),_(1,ci),_(2,On),_(3,Ai),_(4,Di),_(5,dL)],Jze);const hl="vs/workbench/contrib/extensions/browser/extensionsIcons";Ki("extensions-view-icon",Ce.extensions,g(hl,0,"View icon of the extensions view."));const f5t=Ki("extensions-manage",Ce.gear,g(hl,1,"Icon for the 'Manage' action in the extensions view."));Ki("extensions-clear-search-results",Ce.clearAll,g(hl,2,"Icon for the 'Clear Search Result' action in the extensions view."));Ki("extensions-refresh",Ce.refresh,g(hl,3,"Icon for the 'Refresh' action in the extensions view."));Ki("extensions-filter",Ce.filter,g(hl,4,"Icon for the 'Filter' action in the extensions view."));Ki("extensions-install-local-in-remote",Ce.cloudDownload,g(hl,5,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));Ki("extensions-install-workspace-recommended",Ce.cloudDownload,g(hl,6,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));Ki("extensions-configure-recommended",Ce.pencil,g(hl,7,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const p5t=Ki("extensions-sync-enabled",Ce.sync,g(hl,8,"Icon to indicate that an extension is synced.")),m5t=Ki("extensions-sync-ignored",Ce.syncIgnored,g(hl,9,"Icon to indicate that an extension is ignored when syncing."));Ki("extensions-remote",Ce.remote,g(hl,10,"Icon to indicate that an extension is remote in the extensions view and editor."));Ki("extensions-install-count",Ce.cloudDownload,g(hl,11,"Icon shown along with the install count in the extensions view and editor."));Ki("extensions-rating",Ce.star,g(hl,12,"Icon shown along with the rating in the extensions view and editor."));const _5t=Ki("extensions-verified-publisher",Ce.verifiedFilled,g(hl,13,"Icon used for the verified extension publisher in the extensions view and editor."));Ki("extensions-pre-release",Ce.versions,g(hl,14,"Icon shown for extensions having pre-release versions in extensions view and editor."));Ki("extensions-sponsor",Ce.heartFilled,g(hl,15,"Icon used for sponsoring extensions in the extensions view and editor."));Ki("extensions-star-full",Ce.starFull,g(hl,16,"Full star icon used for the rating in the extensions editor."));Ki("extensions-star-half",Ce.starHalf,g(hl,17,"Half star icon used for the rating in the extensions editor."));Ki("extensions-star-empty",Ce.starEmpty,g(hl,18,"Empty star icon used for the rating in the extensions editor."));const DR=Ki("extensions-error-message",Ce.error,g(hl,19,"Icon shown with a error message in the extensions editor.")),Of=Ki("extensions-warning-message",Ce.warning,g(hl,20,"Icon shown with a warning message in the extensions editor.")),ay=Ki("extensions-info-message",Ce.info,g(hl,21,"Icon shown with an info message in the extensions editor.")),I5=Ki("extension-workspace-trust",Ce.shield,g(hl,22,"Icon shown with a workspace trust message in the extension editor."));Ki("extension-activation-time",Ce.history,g(hl,23,"Icon shown with a activation time message in the extension editor."));function UEe(n){return n.scheme!==_e.file&&n.scheme!==_e.vscodeRemote}function jFe(n){if(n.folders.length)return n.folders.every(e=>UEe(e.uri))?n.folders[0].uri:void 0;if(n.configuration&&UEe(n.configuration))return n.configuration}function v5t(n){return jFe(n)?.scheme}function ost(n){return jFe(n)!==void 0}const w5t="vs/platform/languagePacks/common/languagePacks";function Phe(n){return n.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let Xze=class extends ${constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ai;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const s=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=Phe(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return s.push(this.createQuickPickItem("en","English")),s}createQuickPickItem(e,t,i){const s=t??e;let o;if(s!==e&&(o=`(${e})`),e.toLowerCase()===Gd.toLowerCase()&&(o??="",o+=g(w5t,0," (Current)")),i?.installCount){o??="";const r=i.installCount;let a;r>1e6?a=`${Math.floor(r/1e5)/10}M`:r>1e3?a=`${Math.floor(r/1e3)}K`:a=String(r),o+=` $(cloud-download) ${a}`}return{id:e,label:s,description:o}}};Xze=D([_(0,aL)],Xze);var VEe,tT,vA,PD,jJ,AB,iT,FD,KJ,YJ,JJ,XJ,ZJ,EB,OD,BD,WD,HD,UD,eX,tX,iX,nX,xB,DB,VD,sX,oX;const Me="vs/workbench/contrib/extensions/browser/extensionsActions";let $V=class extends xn{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=s,this.productService=o,this.openerService=r,this.notificationService=a,this.dialogService=c,this.commandService=l,this.logService=d,this.extensionManagementServerService=h,this.instantiationService=u,this.galleryService=f,this.extensionManifestPropertiesService=p}async run(){if(Na(this.error))return;if(this.logService.error(this.error),this.error.name===EA.Unsupported){const r=Jn?g(Me,0,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(Me,1,"The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",this.extension.displayName||this.extension.identifier.id,r),{confirmed:c}=await this.dialogService.confirm({type:nt.Info,message:a,primaryButton:g(Me,2,"&&More Information"),cancelButton:g(Me,3,"Close")});c&&this.openerService.open(Jn?P.parse("https://aka.ms/vscode-web-extensions-guide"):P.parse("https://aka.ms/vscode-remote"));return}if(EA.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:lg(this.error),buttons:[{label:g(Me,4,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(GV,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}if([EA.Incompatible,EA.IncompatibleTargetPlatform,EA.Malicious,EA.Deprecated].includes(this.error.name)){await this.dialogService.info(lg(this.error));return}if(EA.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(Me,6,"{0} cannot verify the '{1}' extension. Are you sure you want to install it?",this.productService.nameLong,this.extension.displayName||this.extension.identifier.id),buttons:[{label:g(Me,7,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(GV,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(Me,5,"Cancel")});return}const e=this.installOperation===Bx.Update?g(Me,8,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(Me,9,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],s=await this.getDownloadUrl();s&&(t=g(Me,10,"Please check the [log]({0}) for more details.",`command:${MBt}`),i.push({label:g(Me,11,"Try Downloading Manually..."),run:()=>this.openerService.open(s).then(()=>{this.notificationService.prompt(nt.Info,g(Me,12,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(Me,13,"Install from VSIX..."),run:()=>this.commandService.executeCommand(gBt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(nt.Error,o,i)}async getDownloadUrl(){if(I_||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Hs.UNIVERSAL&&e!==Hs.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,qe.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Hs.UNKNOWN)return P.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Hs.UNDEFINED?`?targetPlatform=${e}`:""}`)}};$V=D([_(4,Ja),_(5,fr),_(6,Pi),_(7,To),_(8,ji),_(9,Ze),_(10,Mw),_(11,be),_(12,aL),_(13,G_)],$V);const WA=class WA extends xn{constructor(){super(...arguments),this._extension=null}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}};WA.EXTENSION_ACTION_CLASS="extension-action",WA.TEXT_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} text`,WA.LABEL_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} label`,WA.ICON_ACTION_CLASS=`${WA.EXTENSION_ACTION_CLASS} icon`;let kn=WA;class KFe extends kn{get menuActions(){return[...this._menuActions]}get extension(){return super.extension}set extension(e){this.extensionActions.forEach(t=>t.extension=e),super.extension=e}constructor(e,t,i){super(e,t),this.actionsGroups=i,this._menuActions=[],this.extensionActions=i.flat(),this.update(),this._register(T.any(...this.extensionActions.map(s=>s.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(s=>this._register(s))}update(e){e||this.extensionActions.forEach(o=>o.update());const t=this.actionsGroups.map(o=>o.filter(r=>r.enabled));let i=[];for(const o of t)o.length&&(i=[...i,...o,new Kr]);i=i.length?i.slice(0,i.length-1):i,this.action=i[0],this._menuActions=i.length>1?i:[],this.enabled=!!this.action,this.action&&(this.label=this.getLabel(this.action),this.tooltip=this.action.tooltip);let s=(this.action||this.extensionActions[0])?.class||"";s=s?`${s} action-dropdown`:"action-dropdown",this._menuActions.length===0&&(s+=" action-dropdown"),this.class=s}run(){return this.extensionActions.filter(t=>t.enabled)[0].run()}getLabel(e){return e.label}}var eP;let GV=(eP=class extends kn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,s,o,r,a,c,l,d){super("extensions.install",g(Me,14,"Install"),VEe.Class,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=s,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new tQ,this.options={...e,isMachineScoped:!1},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Fr.Uninstalled&&await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=this.options.installPreReleaseVersion?this.extension.hasPreReleaseVersion:this.extension.hasReleaseVersion,this.updateLabel()))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(Me,15,"This extension is deprecated as it is no longer being maintained."),i;(function(r){r[r.InstallAnyway=0]="InstallAnyway",r[r.ShowAlternateExtension=1]="ShowAlternateExtension",r[r.ConfigureSettings=2]="ConfigureSettings",r[r.Cancel=3]="Cancel"})(i||(i={}));const s=[{label:g(Me,7,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(Me,16,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;s.push({label:g(Me,17,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],qe.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(Me,18,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;s.push({label:g(Me,19,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Xt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:nt.Warning,message:g(Me,20,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:zt(t)?t:void 0,custom:zt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:s,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.telemetryService.publicLog("extensions:action:install",{...this.extension.telemetryData,actionId:this.id});const e=await this.install(this.extension);if(e?.local){sa(g(Me,22,"Installing extension {0} is completed.",this.extension.displayName));const t=await this.getRunningExtension(e.local);if(t&&!(t.activationEvents&&t.activationEvents.some(i=>i.startsWith("onLanguage")))){const i=await this.getThemeAction(e);if(i){i.extension=e;try{return i.run({showCurrentTheme:!0,ignoreFocusLost:!0})}finally{i.dispose()}}}}}async getThemeAction(e){if((await this.workbenchThemeService.getColorThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(JEe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(XEe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>SS(o,e)))return this.instantiationService.createInstance(ZEe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(ME(e))?new Promise((i,s)=>{const o=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const r=await this.runtimeExtensionService.getExtension(e.identifier.id);r&&(o.dispose(),i(r))})}):null)}updateLabel(){this.label=this.getLabel()}getLabel(e){return this.extension?.isWorkspaceScoped&&this.extension.resourceExtension&&this.contextService.isInsideWorkspace(this.extension.resourceExtension.location)?g(Me,23,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(Me,24,"Install Pre-Release"):g(Me,25,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(Me,14,"Install"):g(Me,26,"Install Release Version"):g(Me,14,"Install")}},VEe=eP,eP.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,eP);GV=VEe=D([_(1,pr),_(2,be),_(3,ho),_(4,ZQ),_(5,eo),_(6,To),_(7,TQ),_(8,rn),_(9,Ti)],GV);let Zze=class extends KFe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions","",[[e.createInstance(GV,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(GV,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};Zze=D([_(0,be),_(1,pr)],Zze);const iR=class iR extends kn{constructor(){super("extension.installing",iR.LABEL,iR.CLASS,!1)}update(){this.class=`${iR.CLASS}${this.extension&&this.extension.state===Fr.Installing?"":" hide"}`}};iR.LABEL=g(Me,27,"Installing"),iR.CLASS=`${kn.LABEL_ACTION_CLASS} install installing`;let e5e=iR;var By;let qV=(By=class extends kn{constructor(e,t,i,s,o,r){super(e,tT.INSTALL_LABEL,tT.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=s,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=tT.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>gc(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Fr.Installing&&!e.local&&(this.enabled=!0,this.label=tT.INSTALLING_LABEL,this.class=tT.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Fr.Installed||this.extension.type!==qr.User||this.extension.enablementState===ga.DisabledByEnvironment||this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByVirtualWorkspace?!1:!!(hPe(this.extension.local.manifest)||this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)||this.server===this.extensionManagementServerService.webExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)||this.canInstallAnyWhere&&(this.server===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)||this.server===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)))}async run(){if(this.extension?.local&&this.extension?.server&&this.server)return this.extensionsWorkbenchService.open(this.extension),sa(g(Me,21,"Installing extension {0} started. An editor is now open with more details on this extension",this.extension.displayName)),this.extensionsWorkbenchService.installInServer(this.extension,this.server)}},tT=By,By.INSTALL_LABEL=g(Me,14,"Install"),By.INSTALLING_LABEL=g(Me,27,"Installing"),By.Class=`${kn.LABEL_ACTION_CLASS} prominent install`,By.InstallingClass=`${kn.LABEL_ACTION_CLASS} install installing`,By);qV=tT=D([_(3,pr),_(4,Mw),_(5,G_)],qV);let zEe=class extends qV{constructor(e,t,i,s){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,s)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,28,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):qV.INSTALL_LABEL}};zEe=D([_(1,pr),_(2,Mw),_(3,G_)],zEe);let t5e=class extends qV{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,29,"Install Locally")}};t5e=D([_(0,pr),_(1,Mw),_(2,G_)],t5e);let i5e=class extends qV{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(Me,30,"Install in Browser")}};i5e=D([_(0,pr),_(1,Mw),_(2,G_)],i5e);var Wy;let $Ee=(Wy=class extends kn{constructor(e,t){super("extensions.uninstall",vA.UninstallLabel,vA.UninstallClass,!1),this.extensionsWorkbenchService=e,this.dialogService=t,this.update()}update(){if(!this.extension){this.enabled=!1;return}const e=this.extension.state;if(e===Fr.Uninstalling){this.label=vA.UninstallingLabel,this.class=vA.UnInstallingClass,this.enabled=!1;return}if(this.label=vA.UninstallLabel,this.class=vA.UninstallClass,this.tooltip=vA.UninstallLabel,e!==Fr.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){sa(g(Me,33,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),sa(g(Me,34,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){this.dialogService.error(lg(e))}}}},vA=Wy,Wy.UninstallLabel=g(Me,31,"Uninstall"),Wy.UninstallingLabel=g(Me,32,"Uninstalling"),Wy.UninstallClass=`${kn.LABEL_ACTION_CLASS} uninstall`,Wy.UnInstallingClass=`${kn.LABEL_ACTION_CLASS} uninstall uninstalling`,Wy);$Ee=vA=D([_(0,pr),_(1,To)],$Ee);const pk=class pk extends kn{constructor(e,t,i){super(e,t,pk.DisabledClass,!1),this.extensionsWorkbenchService=i,this.updateThrottler=new tQ,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=qEe.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Fr.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?pk.EnabledClass:pk.DisabledClass}};pk.EnabledClass=`${kn.LABEL_ACTION_CLASS} prominent update`,pk.DisabledClass=`${pk.EnabledClass} disabled`;let GEe=pk,qEe=class extends GEe{constructor(e,t,i){super("extensions.update",g(Me,35,"Update"),t),this.verbose=e,this.instantiationService=i}update(){super.update(),this.extension&&(this.label=this.verbose?g(Me,36,"Update to v{0}",this.extension.latestVersion):g(Me,35,"Update"))}async run(){if(this.extension)return sa(g(Me,37,"Updating extension {0} to version {1} started.",this.extension.displayName,this.extension.latestVersion)),this.install(this.extension)}async install(e){try{await this.extensionsWorkbenchService.install(e,e.local?.preRelease?{installPreReleaseVersion:!0}:void 0),sa(g(Me,38,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance($V,e,e.latestVersion,Bx.Update,t).run()}}};qEe=D([_(1,pr),_(2,be)],qEe);var Hy;let QEe=(Hy=class extends kn{constructor(e,t,i,s){super(PD.ID,PD.LABEL.value,PD.DisabledClass),this.enableWhenOutdated=e,this.enableWhenAutoUpdateValue=t,this.extensionsWorkbenchService=i,this._register(s.onDidChangeConfiguration(o=>{o.affectsConfiguration(hBt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=PD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.enableWhenOutdated&&(this.extension.state!==Fr.Installed||!this.extension.outdated)||this.enableWhenAutoUpdateValue.includes(this.extensionsWorkbenchService.getAutoUpdateValue())&&(this.enabled=!0,this.class=PD.EnabledClass,this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)))}async run(){if(!this.extension)return;const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},PD=Hy,Hy.ID="workbench.extensions.action.toggleAutoUpdateForExtension",Hy.LABEL=Be(Me,39,"Auto Update"),Hy.EnabledClass=`${kn.EXTENSION_ACTION_CLASS} auto-update`,Hy.DisabledClass=`${PD.EnabledClass} hide`,Hy);QEe=PD=D([_(2,pr),_(3,Re)],QEe);var L0;let jEe=(L0=class extends kn{constructor(e){super(jJ.ID,jJ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;sa(g(Me,43,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),sa(e?g(Me,40,"Enabled auto updates for",this.extension.displayName):g(Me,41,"Disabled auto updates for",this.extension.displayName))}},jJ=L0,L0.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",L0.LABEL=g(Me,42,"Auto Update All (From Publisher)"),L0);jEe=jJ=D([_(0,pr)],jEe);var T0;let n5e=(T0=class extends kn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(Me,44,"Migrate"),AB.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=AB.DisabledClass,!this.extension?.local||this.extension.state!==Fr.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>gc(t.identifier,{id:e}))||(this.enabled=!0,this.class=AB.EnabledClass,this.tooltip=g(Me,45,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(Me,46,"Migrate"):this.tooltip)}async run(){if(!this.extension?.deprecationInfo?.extension)return;const e=this.extension.local;await this.extensionsWorkbenchService.uninstall(this.extension);const[t]=await this.extensionsWorkbenchService.getExtensions([{id:this.extension.deprecationInfo.extension.id,preRelease:this.extension.deprecationInfo?.extension?.preRelease}],qe.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},AB=T0,T0.EnabledClass=`${kn.LABEL_ACTION_CLASS} migrate`,T0.DisabledClass=`${AB.EnabledClass} disabled`,T0);n5e=AB=D([_(1,pr)],n5e);let qie=class extends kn{constructor(e,t,i,s,o){super(e,t,i,s),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(KEe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};qie=D([_(4,be)],qie);let KEe=class extends WS{constructor(e,t,i){super(null,e,{...t,icon:!0,label:!0}),this.contextMenuService=i}showMenu(e,t){if(this.element){const i=this.getActions(e),s=ia(this.element),o={x:s.left,y:s.top+s.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&clt(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Kr];return t.length?t.slice(0,t.length-1):t}};KEe=D([_(2,Vr)],KEe);async function b5t(n,e,t){return t.invokeFunction(async i=>{const s=i.get(pr),o=i.get(_c),r=i.get(bet),a=i.get(ihe),c=i.get(ZQ),l=[];if(n){l.push(["extension",n.identifier.id]),l.push(["isBuiltinExtension",n.isBuiltin]),l.push(["isDefaultApplicationScopedExtension",n.local&&sLt(n.local.manifest)]),l.push(["isApplicationScopedExtension",n.local&&n.local.isApplicationScoped]),l.push(["isWorkspaceScopedExtension",n.isWorkspaceScoped]),n.local&&l.push(["extensionSource",n.local.source]),l.push(["extensionHasConfiguration",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.configuration]),l.push(["extensionHasKeybindings",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes.keybindings]),l.push(["extensionHasCommands",n.local&&!!n.local.manifest.contributes&&!!n.local.manifest.contributes?.commands]),l.push(["isExtensionRecommended",!!r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]]),l.push(["isExtensionWorkspaceRecommended",r.getAllRecommendationsWithReason()[n.identifier.id.toLowerCase()]?.reasonId===HEe.Workspace]),l.push(["isUserIgnoredRecommendation",a.globalIgnoredRecommendations.some(m=>m===n.identifier.id.toLowerCase())]),n.state===Fr.Installed&&l.push(["extensionStatus","installed"]),l.push(["installedExtensionIsPreReleaseVersion",!!n.local?.isPreReleaseVersion]),l.push(["installedExtensionIsOptedToPreRelease",!!n.local?.preRelease]),l.push(["galleryExtensionIsPreReleaseVersion",!!n.gallery?.properties.isPreReleaseVersion]),l.push(["galleryExtensionHasPreReleaseVersion",n.gallery?.hasPreReleaseVersion]),l.push(["extensionHasReleaseVersion",n.hasReleaseVersion]);const[u,f,p]=await Promise.all([c.getColorThemes(),c.getFileIconThemes(),c.getProductIconThemes()]);l.push(["extensionHasColorThemes",u.some(m=>SS(m,n))]),l.push(["extensionHasFileIconThemes",f.some(m=>SS(m,n))]),l.push(["extensionHasProductIconThemes",p.some(m=>SS(m,n))]),l.push(["canSetLanguage",s.canSetLanguage(n)]),l.push(["isActiveLanguagePackExtension",n.gallery&&Gd===Phe(n.gallery)])}const d=o.createMenu(Te.ExtensionContext,e.createOverlay(l)),h=d.getActions({shouldForwardArgs:!0});return d.dispose(),h})}function KK(n,e){const t=[];for(const[,i]of n)t.push(i.map(s=>s instanceof u1?s:e.createInstance(YEe,s)));return t}var JE;let s5e=(JE=class extends qie{constructor(e,t,i){super(iT.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(Me,47,"Manage"),this.update()}async getActionGroups(){const e=[],t=await b5t(this.extension,this.contextKeyService,this.instantiationService),i=[],s=[],o=[],r=[];for(const[a,c]of t)a===pBt?s.push(...KK([[a,c]],this.instantiationService)[0]):a===mBt?o.push(...KK([[a,c]],this.instantiationService)[0]):a===fBt?i.push(...KK([[a,c]],this.instantiationService)[0]):r.push(...KK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(jie),this.instantiationService.createInstance(Qie)]),e.push([this.instantiationService.createInstance(Yie),this.instantiationService.createInstance(Kie)]),o.length&&e.push(o),e.push([...s.length?s:[],this.instantiationService.createInstance(C6),this.instantiationService.createInstance($Ee)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof kn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=iT.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Fr.Installed,this.class=this.enabled||e===Fr.Uninstalling?iT.Class:iT.HideManageExtensionClass}}},iT=JE,JE.ID="extensions.manage",JE.Class=`${kn.ICON_ACTION_CLASS} manage `+$e.asClassName(f5t),JE.HideManageExtensionClass=`${iT.Class} hide`,JE);s5e=iT=D([_(0,be),_(1,ho),_(2,Pe)],s5e);let YEe=class extends kn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}update(){this.extension&&(this.action.id===uBt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===QEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===jEe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?_F(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?_F(this.extension.gallery.publisher,this.extension.gallery.name):this.extension.identifier.id,t={id:this.extension.identifier.id,version:this.extension.version,location:this.extension.local?.location};await this.action.run(e,t)}}};YEe=D([_(1,pr)],YEe);var Uy;let o5e=(Uy=class extends kn{constructor(e){super(FD.ID,FD.LABEL,FD.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=FD.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Fr.Installed&&this.extension.hasPreReleaseVersion&&this.extension.gallery&&(this.extension.preRelease&&!this.extension.isPreReleaseVersion||!this.extension.preRelease&&!this.extension.gallery.hasPreReleaseVersion||(this.enabled=!0,this.class=FD.EnabledClass,this.extension.preRelease?(this.label=g(Me,49,"Switch to Release Version"),this.tooltip=g(Me,50,"This will switch and enable updates to release versions")):(this.label=g(Me,51,"Switch to Pre-Release Version"),this.tooltip=g(Me,52,"This will switch to pre-release version and enable updates to latest version always")))))}async run(){this.extension&&(this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:!this.extension.preRelease}),await this.extensionsWorkbenchService.togglePreRelease(this.extension))}},FD=Uy,Uy.ID="workbench.extensions.action.togglePreRlease",Uy.LABEL=g(Me,48,"Pre-Release"),Uy.EnabledClass=`${kn.LABEL_ACTION_CLASS} pre-release`,Uy.DisabledClass=`${FD.EnabledClass} hide`,Uy);o5e=FD=D([_(0,pr)],o5e);var R0;let C6=(R0=class extends kn{constructor(e,t,i,s,o){super(KJ.ID,KJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionGalleryService=t,this.quickInputService=i,this.instantiationService=s,this.dialogService=o,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.gallery&&!!this.extension.local&&!!this.extension.server&&this.extension.state===Fr.Installed&&!this.extension.deprecationInfo}async run(){if(!this.enabled)return;const e=await this.extension.server.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.gallery,this.extension.local.preRelease,e);if(!t.length){await this.dialogService.info(g(Me,54,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${WFe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(Me,55,"pre-release")})`:""}${o.version===this.extension.version?` (${g(Me,56,"current")})`:""}`,latest:r===0,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),s=await this.quickInputService.pick(i,{placeHolder:g(Me,57,"Select Version to Install"),matchOnDetail:!0});if(s){if(this.extension.version===s.id)return;try{if(s.latest){const[o]=s.id!==this.extension?.version?await this.extensionsWorkbenchService.getExtensions([{id:this.extension.identifier.id,preRelease:s.isPreReleaseVersion}],qe.None):[this.extension];await this.extensionsWorkbenchService.install(o??this.extension,{installPreReleaseVersion:s.isPreReleaseVersion})}else await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:s.isPreReleaseVersion,version:s.id})}catch(o){this.instantiationService.createInstance($V,this.extension,s.latest?this.extension.latestVersion:s.id,Bx.Install,o).run()}}return null}},KJ=R0,R0.ID="workbench.extensions.action.install.anotherVersion",R0.LABEL=g(Me,53,"Install Another Version..."),R0);C6=KJ=D([_(0,pr),_(1,aL),_(2,On),_(3,be),_(4,To)],C6);var M0;let Qie=(M0=class extends kn{constructor(e,t){super(YJ.ID,YJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,59,"Enable this extension only in this workspace"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledWorkspace)}},YJ=M0,M0.ID="extensions.enableForWorkspace",M0.LABEL=g(Me,58,"Enable (Workspace)"),M0);Qie=YJ=D([_(0,pr),_(1,Kh)],Qie);var N0;let jie=(N0=class extends kn{constructor(e,t){super(JJ.ID,JJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(Me,61,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Fr.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.EnabledGlobally)}},JJ=N0,N0.ID="extensions.enableGlobally",N0.LABEL=g(Me,60,"Enable"),N0);jie=JJ=D([_(0,pr),_(1,Kh)],jie);var P0;let Kie=(P0=class extends kn{constructor(e,t,i,s){super(XJ.ID,XJ.LABEL,kn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=s,this.tooltip=g(Me,63,"Disable this extension only in this workspace"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>gc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==Nn.EMPTY)&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledWorkspace)}},XJ=P0,P0.ID="extensions.disableForWorkspace",P0.LABEL=g(Me,62,"Disable (Workspace)"),P0);Kie=XJ=D([_(0,Ti),_(1,pr),_(2,Kh),_(3,ho)],Kie);var F0;let Yie=(F0=class extends kn{constructor(e,t,i){super(ZJ.ID,ZJ.LABEL,kn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(Me,65,"Disable this extension"),this.update(),this._register(this.extensionService.onDidChangeExtensions(()=>this.update()))}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&this.extensionService.extensions.some(e=>gc({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Fr.Installed&&(this.extension.enablementState===ga.EnabledGlobally||this.extension.enablementState===ga.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,ga.DisabledGlobally)}},ZJ=F0,F0.ID="extensions.disableGlobally",F0.LABEL=g(Me,64,"Disable"),F0);Yie=ZJ=D([_(0,pr),_(1,Kh),_(2,ho)],Yie);let r5e=class extends KFe{constructor(e){super("extensions.enable",g(Me,66,"Enable"),[[e.createInstance(jie),e.createInstance(Qie)]])}};r5e=D([_(0,be)],r5e);let a5e=class extends KFe{constructor(e){super("extensions.disable",g(Me,67,"Disable"),[[e.createInstance(Yie),e.createInstance(Kie)]])}};a5e=D([_(0,be)],a5e);var O0;let c5e=(O0=class extends kn{constructor(e,t,i,s,o,r){super("extensions.runtimeState","",EB.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=s,this.productService=o,this.telemetryService=r,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=EB.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Fr.Installing||e===Fr.Uninstalling||this.extension.local&&this.extension.local.manifest&&this.extension.local.manifest.contributes&&this.extension.local.manifest.contributes.localizations&&this.extension.local.manifest.contributes.localizations.length>0)return;const t=this.extension.runtimeState;t&&(this.enabled=!0,this.class=EB.EnabledClass,this.tooltip=t.reason,this.label=t.action===ov.ReloadWindow?g(Me,68,"Reload Window"):t.action===ov.RestartExtensions?g(Me,69,"Restart Extensions"):t.action===ov.QuitAndInstall?g(Me,70,"Restart to Update"):t.action===ov.ApplyUpdate||t.action===ov.DownloadUpdate?g(Me,71,"Update {0}",this.productService.nameShort):"")}async run(){const e=this.extension?.runtimeState;if(e?.action){if(this.telemetryService.publicLog2("extensions:runtimestate:action",{action:e.action}),e?.action===ov.ReloadWindow)return this.hostService.reload();if(e?.action===ov.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===ov.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===ov.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===ov.QuitAndInstall)return this.updateService.quitAndInstall()}}},EB=O0,O0.EnabledClass=`${kn.LABEL_ACTION_CLASS} reload`,O0.DisabledClass=`${EB.EnabledClass} disabled`,O0);c5e=EB=D([_(0,Id),_(1,pr),_(2,NZe),_(3,ho),_(4,Ja),_(5,rn)],c5e);function SS(n,e){return!!(e&&n.extensionData&&Cn.equals(n.extensionData.extensionId,e.identifier.id))}function YFe(n,e,t,i){const s=[];for(const o of n)SS(o,t)&&!(i&&o===e)&&s.push({label:o.label,id:o.id});return i&&(s.push({type:"separator",label:g(Me,56,"current")}),s.push({label:e.label,id:e.id})),s}var Vy;let JEe=(Vy=class extends kn{constructor(e,t,i,s){super(OD.ID,OD.TITLE.value,OD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidColorThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getColorThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?OD.EnabledClass:OD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getColorThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getColorTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,73,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:s.id,"auto")}},OD=Vy,Vy.ID="workbench.extensions.action.setColorTheme",Vy.TITLE=Be(Me,72,"Set Color Theme"),Vy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,Vy.DisabledClass=`${OD.EnabledClass} disabled`,Vy);JEe=OD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],JEe);var zy;let XEe=(zy=class extends kn{constructor(e,t,i,s){super(BD.ID,BD.TITLE.value,BD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidFileIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getFileIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?BD.EnabledClass:BD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getFileIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getFileIconTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,75,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:s.id,"auto")}},BD=zy,zy.ID="workbench.extensions.action.setFileIconTheme",zy.TITLE=Be(Me,74,"Set File Icon Theme"),zy.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,zy.DisabledClass=`${BD.EnabledClass} disabled`,zy);XEe=BD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],XEe);var $y;let ZEe=($y=class extends kn{constructor(e,t,i,s){super(WD.ID,WD.TITLE.value,WD.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=s,this._register(T.any(e.onDidChangeExtensions,t.onDidProductIconThemeChange)(()=>this.update(),this)),this.update()}update(){this.workbenchThemeService.getProductIconThemes().then(e=>{this.enabled=this.computeEnablement(e),this.class=this.enabled?WD.EnabledClass:WD.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Fr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>SS(t,this.extension))}async run({showCurrentTheme:e,ignoreFocusLost:t}={showCurrentTheme:!1,ignoreFocusLost:!1}){const i=await this.workbenchThemeService.getProductIconThemes();if(!this.computeEnablement(i))return;const s=this.workbenchThemeService.getProductIconTheme(),o=new Lu(100),r=YFe(i,s,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(Me,77,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:s.id,"auto")}},WD=$y,$y.ID="workbench.extensions.action.setProductIconTheme",$y.TITLE=Be(Me,76,"Set Product Icon Theme"),$y.EnabledClass=`${kn.LABEL_ACTION_CLASS} theme`,$y.DisabledClass=`${WD.EnabledClass} disabled`,$y);ZEe=WD=D([_(0,ho),_(1,ZQ),_(2,On),_(3,Kh)],ZEe);var Gy;let l5e=(Gy=class extends kn{constructor(e){super(HD.ID,HD.TITLE.value,HD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=HD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd===Phe(this.extension.gallery)||(this.enabled=!0,this.class=HD.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},HD=Gy,Gy.ID="workbench.extensions.action.setDisplayLanguage",Gy.TITLE=Be(Me,78,"Set Display Language"),Gy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,Gy.DisabledClass=`${HD.EnabledClass} disabled`,Gy);l5e=HD=D([_(0,pr)],l5e);var qy;let d5e=(qy=class extends kn{constructor(e,t){super(UD.ID,UD.TITLE.value,UD.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=UD.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Gd!==Phe(this.extension.gallery)||(this.enabled=!0,this.class=UD.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},UD=qy,qy.ID="workbench.extensions.action.clearLanguage",qy.TITLE=Be(Me,79,"Clear Display Language"),qy.EnabledClass=`${kn.LABEL_ACTION_CLASS} language`,qy.DisabledClass=`${UD.EnabledClass} disabled`,qy);d5e=UD=D([_(0,pr),_(1,yet)],d5e);var B0;let h5e=(B0=class extends xn{constructor(e,t,i){super(eX.ID,eX.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);return i?this.extensionWorkbenchService.open(i):null}},eX=B0,B0.ID="workbench.extensions.action.showRecommendedExtension",B0.LABEL=g(Me,80,"Show Recommended Extension"),B0);h5e=eX=D([_(1,Nw),_(2,pr)],h5e);var W0;let u5e=(W0=class extends xn{constructor(e,t,i,s){super(tX.ID,tX.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=s,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},qe.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(s){this.instantiationService.createInstance($V,i,i.latestVersion,Bx.Install,s).run()}}}},tX=W0,W0.ID="workbench.extensions.action.installRecommendedExtension",W0.LABEL=g(Me,81,"Install Recommended Extension"),W0);u5e=tX=D([_(1,Nw),_(2,be),_(3,pr)],u5e);var H0;let g5e=(H0=class extends xn{constructor(e,t){super(iX.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=iX.Class,this.tooltip=g(Me,82,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},iX=H0,H0.ID="extensions.ignore",H0.Class=`${kn.LABEL_ACTION_CLASS} ignore`,H0);g5e=iX=D([_(1,ihe)],g5e);var U0;let f5e=(U0=class extends xn{constructor(e,t){super(nX.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=nX.Class,this.tooltip=g(Me,83,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},nX=U0,U0.ID="extensions.ignore",U0.Class=`${kn.LABEL_ACTION_CLASS} undo-ignore`,U0);f5e=nX=D([_(1,ihe)],f5e);let Jie=class extends xn{constructor(e,t){super("extensions.searchExtensions",g(Me,84,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(Uz,Sr.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};Jie=D([_(1,Nw)],Jie);let Xie=class extends xn{constructor(e,t,i,s,o,r,a,c){super(e,t),this.contextService=i,this.fileService=s,this.textFileService=o,this.editorService=r,this.jsonEditingService=a,this.textModelResolverService=c}openExtensionsFile(e){return this.getOrCreateExtensionsFile(e).then(({created:t,content:i})=>this.getSelectionPosition(i,e,["recommendations"]).then(s=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:s}})),t=>Promise.reject(new Error(g(Me,85,"Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",t))))}openWorkspaceConfigurationFile(e){return this.getOrUpdateWorkspaceConfigurationFile(e).then(t=>this.getSelectionPosition(t.value.toString(),t.resource,["extensions","recommendations"])).then(t=>this.editorService.openEditor({resource:e,options:{selection:t,forceReload:!0}}))}getOrUpdateWorkspaceConfigurationFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>{const i=ow(t.value.toString()).extensions;return!i||!i.recommendations?this.jsonEditingService.write(e,[{path:["extensions"],value:{recommendations:[]}}],!0).then(()=>this.fileService.readFile(e)):t})}getSelectionPosition(e,t,i){const s=_Je(e),o=rbe(s,i);if(o&&o.parent&&o.parent.children){const r=o.parent.children[1],a=r.children&&r.children.length?r.children[r.children.length-1]:null,c=a?a.offset+a.length:r.offset+1;return Promise.resolve(this.textModelResolverService.createModelReference(t)).then(l=>{const d=l.object.textEditorModel.getPositionAt(c);return l.dispose(),{startLineNumber:d.lineNumber,startColumn:d.column,endLineNumber:d.lineNumber,endColumn:d.column}})}return Promise.resolve(void 0)}getOrCreateExtensionsFile(e){return Promise.resolve(this.fileService.readFile(e)).then(t=>({created:!1,extensionsFileResource:e,content:t.value.toString()}),t=>this.textFileService.write(e,Kze).then(()=>({created:!0,extensionsFileResource:e,content:Kze})))}};Xie=D([_(2,Ti),_(3,ci),_(4,tr),_(5,_i),_(6,dL),_(7,Rn)],Xie);var tP;let p5e=(tP=class extends Xie{constructor(e,t,i,s,o,r,a,c){super(e,t,o,i,s,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==Nn.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(p2));case Nn.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},tP.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",tP.LABEL=g(Me,86,"Configure Recommended Extensions (Workspace)"),tP);p5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn)],p5e);var iP;let m5e=(iP=class extends Xie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,i,s,r,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(nst);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(p2)):null)}},iP.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",iP.LABEL=g(Me,87,"Configure Recommended Extensions (Workspace Folder)"),iP);m5e=D([_(2,ci),_(3,tr),_(4,Ti),_(5,_i),_(6,dL),_(7,Rn),_(8,ji)],m5e);var V0;let _5e=(V0=class extends xn{get extension(){return this._extension}set extension(e){this._extension&&e&&gc(this._extension.identifier,e.identifier)||(this.initialStatus=null,this.status=null,this.enablementState=null),this._extension=e,this.update()}constructor(e,t,i){super("extensions.action.statusLabel","",xB.DISABLED_CLASS,!1),this.extensionService=e,this.extensionManagementServerService=t,this.extensionEnablementService=i,this.initialStatus=null,this.status=null,this.version=null,this.enablementState=null,this._extension=null}update(){const e=this.computeLabel();this.label=e||"",this.class=e?xB.ENABLED_CLASS:xB.DISABLED_CLASS}computeLabel(){if(!this.extension)return null;const e=this.status,t=this.version,i=this.enablementState;this.status=this.extension.state,this.version=this.extension.version,this.initialStatus===null&&(this.initialStatus=this.status),this.enablementState=this.extension.enablementState;const s=()=>{const r=this.extensionService.extensions.filter(a=>gc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?r&&this.extension.version===r.version?!0:this.extensionService.canAddExtension(ME(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(gc({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(che(r))))?!0:this.extensionService.canRemoveExtension(ME(this.extension.local)):!1;if(e!==null){if(e===Fr.Installing&&this.status===Fr.Installed)return s()?this.initialStatus===Fr.Installed&&this.version!==t?g(Me,88,"Updated"):g(Me,89,"Installed"):null;if(e===Fr.Uninstalling&&this.status===Fr.Uninstalled)return this.initialStatus=this.status,o()?g(Me,90,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return s()?g(Me,91,"Enabled"):null;if(r&&!a)return o()?g(Me,92,"Disabled"):null}return null}run(){return Promise.resolve()}},xB=V0,V0.ENABLED_CLASS=`${kn.TEXT_ACTION_CLASS} extension-status-label`,V0.DISABLED_CLASS=`${xB.ENABLED_CLASS} hide`,V0);_5e=xB=D([_(0,ho),_(1,Mw),_(2,Kh)],_5e);var z0;let v5e=(z0=class extends qie{constructor(e,t,i,s){super("extensions.sync","",DB.SYNC_CLASS,!1,s),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(T.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration("settingsSync.ignoredExtensions"))(()=>this.update())),this._register(i.onDidChangeEnablement(()=>this.update())),this.update()}update(){if(this.enabled=!!this.extension&&this.userDataSyncEnablementService.isEnabled()&&this.extension.state===Fr.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?DB.IGNORED_SYNC_CLASS:DB.SYNC_CLASS,this.tooltip=e?g(Me,93,"This extension is ignored during sync"):g(Me,94,"This extension is synced")}}async run(){return super.run({actionGroups:[[new xn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(Me,95,"Sync this extension"):g(Me,96,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},DB=z0,z0.IGNORED_SYNC_CLASS=`${kn.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(m5t)}`,z0.SYNC_CLASS=`${DB.ICON_ACTION_CLASS} extension-sync ${$e.asClassName(p5t)}`,z0);v5e=DB=D([_(0,Re),_(1,pr),_(2,PZe),_(3,be)],v5e);var nP;let w5e=(nP=class extends kn{get status(){return this._status}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super("extensions.status","",`${VD.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=s,this.workspaceTrustService=o,this.extensionsWorkbenchService=r,this.extensionService=a,this.extensionManifestPropertiesService=c,this.contextService=l,this.productService=d,this.workbenchExtensionEnablementService=h,this.extensionFeaturesManagementService=u,this.updateWhenCounterExtensionChanges=!0,this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new tQ,this._register(this.labelService.onDidChangeFormatters(()=>this.update(),this)),this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this._register(this.extensionFeaturesManagementService.onDidChangeAccessData(()=>this.update())),this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateStatus())}async computeAndUpdateStatus(){if(this.updateStatus(void 0,!0),this.enabled=!1,!this.extension)return;if(this.extension.isMalicious){this.updateStatus({icon:Of,message:new Xt(g(Me,97,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const o=`[${this.extension.deprecationInfo.extension.displayName}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,98,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(Me,99,"settings")}](${P.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:Of,message:new Xt(g(Me,100,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",o))},!0)}else{const o=new Xt(g(Me,101,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:Of,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.gallery&&this.extension.state===Fr.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const o=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),r=new Xt(`${g(Me,102,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,eMt(o))} [${g(Me,103,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:Of,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(Me,0,"{0} for the Web",this.productService.nameLong),r=new Xt(`${g(Me,104,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(Me,105,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:Of,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Fr.Installed)return;if(this.extension.enablementState===ga.DisabledByEnvironment){this.updateStatus({message:new Xt(g(Me,106,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===ga.EnabledByEnvironment){this.updateStatus({message:new Xt(g(Me,107,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===ga.DisabledByVirtualWorkspace){const o=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:ay,message:new Xt(o?b3(o):g(Me,108,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(ost(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:Of,message:new Xt(r?b3(r):g(Me,109,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===ga.DisabledByTrustRequirement||this.extension.enablementState===ga.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===ga.DisabledByTrustRequirement)){this.enabled=!0;const o=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:I5,message:new Xt(o?b3(o):g(Me,110,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const o=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),r=pK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:I5,message:new Xt(r?b3(r):g(Me,111,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>gc(o.identifier,this.extension.identifier)&&o.server!==this.extension.server)){let o;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(o=new Xt(`${g(Me,112,"This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)):this.extensionManagementServerService.remoteExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&(this.extensionManagementServerService.localExtensionManagementServer?o=new Xt(`${g(Me,113,"This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.",this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Jn&&(o=new Xt(`${g(Me,114,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Xt(`${g(Me,115,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:Of,message:o},!0);return}const e=new Cn(this.extension.identifier.id),t=it.as(GS.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(Me,116,"Manage Access")}](${P.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,ASe.Features,!1,o.id]))}`)})`;if(r?.severity===nt.Error){this.updateStatus({icon:DR,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===nt.Warning){this.updateStatus({icon:Of,message:new Xt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(hPe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>gc(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Xt(g(Me,117,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Xt(g(Me,118,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:ay,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>gc({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(che(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,119,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,120,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}if(this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer&&r===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:ay,message:new Xt(`${g(Me,121,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(Me,103,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===ga.DisabledByExtensionDependency){this.updateStatus({icon:Of,message:new Xt(g(Me,122,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),s=this.extensionService.extensions.some(o=>gc({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&s){if(this.extension.enablementState===ga.EnabledWorkspace){this.updateStatus({message:new Xt(g(Me,123,"This extension is enabled for this workspace by the user."))},!0);return}if(this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer&&this.extension.server===this.extensionManagementServerService.remoteExtensionManagementServer){this.updateStatus({message:new Xt(g(Me,124,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===ga.EnabledGlobally)return}if(!i&&!s){if(this.extension.enablementState===ga.DisabledGlobally){this.updateStatus({message:new Xt(g(Me,125,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===ga.DisabledWorkspace){this.updateStatus({message:new Xt(g(Me,126,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!s&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===nt.Error).map(([,r])=>r);this.updateStatus({icon:DR,message:new Xt(o.join(" ").trim())},!0)}}updateStatus(e,t){this._status!==e&&(this._status&&e&&this._status.message===e.message&&this._status.icon?.id===e.icon?.id||(this._status=e,t&&(this._status?.icon===DR?this.class=`${VD.CLASS} extension-status-error ${$e.asClassName(DR)}`:this._status?.icon===Of?this.class=`${VD.CLASS} extension-status-warning ${$e.asClassName(Of)}`:this._status?.icon===ay?this.class=`${VD.CLASS} extension-status-info ${$e.asClassName(ay)}`:this._status?.icon===I5?this.class=`${VD.CLASS} ${$e.asClassName(I5)}`:this.class=`${VD.CLASS} hide`),this._onDidChangeStatus.fire()))}async run(){if(this._status?.icon===I5)return this.commandService.executeCommand("workbench.trust.manage")}},VD=nP,nP.CLASS=`${kn.ICON_ACTION_CLASS} extension-status`,nP);w5e=VD=D([_(0,Mw),_(1,eo),_(2,ji),_(3,Sde),_(4,oA),_(5,pr),_(6,ho),_(7,G_),_(8,Ti),_(9,Ja),_(10,Kh),_(11,wet)],w5e);var $0;let b5e=($0=class extends xn{constructor(e=sX.ID,t=sX.LABEL,i,s,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=s,this.quickInputService=o,this.notificationService=r,this.hostService=a,this.instantiationService=c,this.extensionService=l}get enabled(){return this.extensionsWorkbenchService.local.filter(e=>!e.isBuiltin&&e.local).length>0}run(){return this.quickInputService.pick(this.getEntries(),{placeHolder:g(Me,128,"Select Extension to Reinstall")}).then(e=>e&&this.reinstallExtension(e.extension))}getEntries(){return this.extensionsWorkbenchService.queryLocal().then(e=>e.filter(i=>!i.isBuiltin&&i.server!==this.extensionManagementServerService.webExtensionManagementServer).map(i=>({id:i.identifier.id,label:i.displayName,description:i.identifier.id,extension:i})))}reinstallExtension(e){return this.instantiationService.createInstance(Jie,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(ME(t.local))),s=i?g(Me,129,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(Me,130,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(Me,131,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(nt.Info,s,o,{sticky:!0})},t=>this.notificationService.error(t)))}},sX=$0,$0.ID="workbench.extensions.action.reinstall",$0.LABEL=g(Me,127,"Reinstall Extension..."),$0);b5e=sX=D([_(2,pr),_(3,Mw),_(4,On),_(5,Pi),_(6,Id),_(7,be),_(8,ho)],b5e);var G0;let C5e=(G0=class extends xn{constructor(e=oX.ID,t=oX.LABEL,i,s,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=s,this.instantiationService=o,this.extensionEnablementService=r}get enabled(){return this.extensionsWorkbenchService.local.some(e=>this.isEnabled(e))}async run(){const e=await this.quickInputService.pick(this.getExtensionEntries(),{placeHolder:g(Me,133,"Select Extension"),matchOnDetail:!0});if(e&&e.extension){const t=this.instantiationService.createInstance(C6);t.extension=e.extension,await t.run(),await this.instantiationService.createInstance(Jie,e.extension.identifier.id).run()}}isEnabled(e){const t=this.instantiationService.createInstance(C6);return t.extension=e,t.enabled&&!!e.local&&this.extensionEnablementService.isEnabled(e.local)}async getExtensionEntries(){const e=await this.extensionsWorkbenchService.queryLocal(),t=[];for(const i of e)this.isEnabled(i)&&t.push({id:i.identifier.id,label:i.displayName||i.identifier.id,description:i.identifier.id,extension:i});return t.sort((i,s)=>i.extension.displayName.localeCompare(s.extension.displayName))}},oX=G0,G0.ID="workbench.extensions.action.install.specificVersion",G0.LABEL=g(Me,132,"Install Specific Version of Extension..."),G0);C5e=oX=D([_(2,pr),_(3,On),_(4,be),_(5,Kh)],C5e);let Zie=class extends xn{constructor(e,t,i,s,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=s,this.progressService=o,this.extensions=void 0,this.update(),this.extensionsWorkbenchService.queryLocal().then(()=>this.updateExtensions()),this._register(this.extensionsWorkbenchService.onChange(()=>{this.extensions&&this.updateExtensions()}))}updateExtensions(){this.extensions=this.extensionsWorkbenchService.local,this.update()}update(){this.enabled=!!this.extensions&&this.getExtensionsToInstall(this.extensions).length>0,this.tooltip=this.label}async run(){return this.selectAndInstallExtensions()}async queryExtensionsToInstall(){const e=await this.extensionsWorkbenchService.queryLocal();return this.getExtensionsToInstall(e)}async selectAndInstallExtensions(){const e=this.quickInputService.createQuickPick();e.busy=!0;const t=e.onDidAccept(()=>{t.dispose(),e.hide(),e.dispose(),this.onDidAccept(e.selectedItems)});e.show();const i=await this.queryExtensionsToInstall();e.busy=!1,i.length?(e.title=this.getQuickPickTitle(),e.placeholder=g(Me,134,"Select extensions to install"),e.canSelectMany=!0,i.sort((s,o)=>s.displayName.localeCompare(o.displayName)),e.items=i.map(s=>({extension:s,label:s.displayName,description:s.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:nt.Info,message:g(Me,135,"There are no extensions to install.")}))}async onDidAccept(e){if(e.length){const t=e.filter(i=>!!i.extension).map(i=>i.extension);t.length&&(await this.progressService.withProgress({location:ch.Notification,title:g(Me,136,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(Me,137,"Successfully installed extensions.")))}}};Zie=D([_(1,pr),_(2,On),_(3,Pi),_(4,Cf)],Zie);let y5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,s,i),this.extensionManagementServerService=o,this.extensionGalleryService=r,this.instantiationService=a,this.fileService=c,this.logService=l}get label(){return this.extensionManagementServerService&&this.extensionManagementServerService.remoteExtensionManagementServer?g(Me,138,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(Me,139,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance(zEe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};y5e=D([_(0,pr),_(1,On),_(2,Cf),_(3,Pi),_(4,Mw),_(5,aL),_(6,be),_(7,ci),_(8,Ze)],y5e);let S5e=class extends Zie{constructor(e,t,i,s,o,r,a,c,l){super(e,t,i,o,s),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(Me,140,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(Me,141,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===qr.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&gc(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],s=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await ko.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:s,compatible:!0},qe.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await ko.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await ko.settled(i.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(o)))}finally{try{await Promise.allSettled(i.map(o=>this.fileService.del(o)))}catch(o){this.logService.error(o)}}}};S5e=D([_(1,pr),_(2,On),_(3,Cf),_(4,Pi),_(5,Mw),_(6,aL),_(7,ci),_(8,Ze)],S5e);yt.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const exe="workbench.extensions.action.showExtensionsWithIds";yt.registerCommand(exe,function(n,e){return n.get(Nw).openPaneComposite(Uz,Sr.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const s=e.map(o=>`@id:${o}`).join(" ");i.search(s),i.focus()})});B("extensionButton.background",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,142,"Button background color for extension actions."));B("extensionButton.foreground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,143,"Button foreground color for extension actions."));B("extensionButton.hoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,144,"Button background hover color for extension actions."));B("extensionButton.separator",{dark:f3,light:f3,hcDark:f3,hcLight:f3},g(Me,145,"Button separator color for extension actions"));B("extensionButton.prominentBackground",{dark:eS,light:eS,hcDark:null,hcLight:null},g(Me,146,"Button background color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentForeground",{dark:Zy,light:Zy,hcDark:null,hcLight:null},g(Me,147,"Button foreground color for extension actions that stand out (e.g. install button)."));B("extensionButton.prominentHoverBackground",{dark:J9,light:J9,hcDark:null,hcLight:null},g(Me,148,"Button background hover color for extension actions that stand out (e.g. install button)."));Im((n,e)=>{const t=n.getColor(Vh);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(DR)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(DR)} { color: ${t}; }`));const i=n.getColor(qc);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(Of)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(Of)} { color: ${i}; }`));const s=n.getColor(Qc);s&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${$e.asCSSSelector(ay)} { color: ${s}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${$e.asCSSSelector(ay)} { color: ${s}; }`))});const rst="vs/workbench/contrib/chat/browser/chatAgentHover";let ene=class extends ${constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i;const s=di(".chat-agent-hover@root",[di(".chat-agent-hover-header",[di(".chat-agent-hover-icon@icon"),di(".chat-agent-hover-details",[di(".chat-agent-hover-name@name"),di(".chat-agent-hover-extension",[di(".chat-agent-hover-extension-name@extensionName"),di(".chat-agent-hover-separator@separator"),di(".chat-agent-hover-publisher@publisher")])])]),di(".chat-agent-hover-warning@warning"),di("span.chat-agent-hover-description@description")]);this.domNode=s.root,this.icon=s.icon,this.name=s.name,this.extensionName=s.extensionName,this.description=s.description,s.separator.textContent="|";const o=we("span.extension-verified-publisher",void 0,OS(_5t));this.publisherName=we("span.chat-agent-hover-publisher-name"),he(s.publisher,o,this.publisherName),s.warning.appendChild(OS(Ce.warning)),s.warning.appendChild(we("span",void 0,g(rst,0,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof P){const o=we("img.icon");o.src=lp.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(we(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=we($e.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(we(".avatar.codicon-avatar",void 0,o))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:Nhe(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let s=t.description??"";if(s&&(s.match(/[\.\?\!] *$/)||(s+=".")),this.description.textContent=s,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ai);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&this.domNode.classList.toggle("verifiedPublisher",!0)})}}};ene=D([_(0,yp),_(1,pr),_(2,Yde)],ene);function ast(n,e){return{actions:[{commandId:exe,label:g(rst,1,"View Extension"),run:()=>{const t=n();t&&e.executeCommand(exe,[t.extensionId.value])}}]}}var C5t=".chat-confirmation-widget{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:16px;padding:8px 12px 12px}.chat-confirmation-widget .chat-confirmation-widget-title{font-weight:600}.chat-confirmation-widget .chat-confirmation-widget-title p{margin:0 0 4px}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown p{margin-top:0}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown>:last-child{margin-bottom:0}.chat-confirmation-widget .chat-confirmation-buttons-container{display:flex;gap:8px;margin-top:13px}.chat-confirmation-widget.hideButtons .chat-confirmation-buttons-container{display:none}";Ct(C5t,{});let txe=class extends ${get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,s){super(),this.instantiationService=s,this._onDidClick=this._register(new I);const o=di(".chat-confirmation-widget@root",[di(".chat-confirmation-widget-title@title"),di(".chat-confirmation-widget-message@message"),di(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(vw,{})),a=this._register(r.render(new Xt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Xt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new Tu(o.buttonsContainer,{...yQ,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};txe=D([_(3,be)],txe);const Gz="vs/workbench/contrib/chat/common/chatColors";B("chat.requestBorder",{dark:new fe(new gn(255,255,255,.1)),light:new fe(new gn(0,0,0,.1)),hcDark:ft,hcLight:ft},g(Gz,0,"The border color of a chat request."));const y5t=B("chat.requestBackground",{dark:Ie(us,.62),light:Ie(us,.62),hcDark:Zs,hcLight:null},g(Gz,1,"The background color of a chat request.")),A5e=B("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:fe.white,hcLight:kW},g(Gz,2,"The background color of a chat slash command.")),E5e=B("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:fe.black,hcLight:DMe},g(Gz,3,"The foreground color of a chat slash command."));B("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:fe.black,hcLight:fe.white},g(Gz,4,"The background color of a chat avatar."));B("chat.avatarForeground",{dark:Ge,light:Ge,hcDark:Ge,hcLight:Ge},g(Gz,5,"The foreground color of a chat avatar."));const kpe="http://_vscodedecoration_",rX="http://_chatagent_",S5t="http://_chatslash_";function A5t(n,e,t){const i=t.get(Yde),s=t.get(yp),o=i.getAgentNameRestriction(n);let r=`${o?n.name:Nhe(n)}`;o&&s.getAgentsByName(n.name).length>1&&(r+=` (${n.publisherDisplayName})`);const c={agentId:n.id,name:r,isClickable:e};return`[${n.name}](${rX}?${encodeURIComponent(JSON.stringify(c))})`}let ixe=class{constructor(e,t,i,s,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=s,this.instantiationService=o,this.hoverService=r,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof kb)t+=i.text;else if(i instanceof tp)t+=this.instantiationService.invokeFunction(s=>A5t(i.agent,!1,s));else{const s=i instanceof VV&&i.data instanceof P?i.data:void 0,o=s?encodeURIComponent(this.labelService.getUriLabel(s,{relative:!0})):i instanceof tp?i.agent.id:"",r=i.text;t+=`[${r}](${kpe}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const s=i.getAttribute("data-href");if(s)if(s.startsWith(rX)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(s.startsWith(S5t)){let o;try{o=JSON.parse(decodeURIComponent(s.slice(rX.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Ma(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(s.startsWith(kpe)){const o=decodeURIComponent(s.slice(kpe.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else s.startsWith(Xnt)?this.renderFileWidget(s,i):s.startsWith("command:")&&this.injectKeybindingHint(i,s,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${$z}${e.name}`;let s;if(e.isClickable){s=we("span.chat-agent-widget");const a=t.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));a.label=i,t.add(a.onDidClick(()=>{const c=this.chatAgentService.getAgent(e.agentId),l=this.chatWidgetService.lastFocusedWidget;!l||!c||this.chatService.sendRequest(l.viewModel.sessionId,c.metadata.sampleRequest??"",{location:l.location,agentId:c.id})}))}else s=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new Ka(()=>t.add(this.instantiationService.createInstance(ene)));return t.add(this.hoverService.setupUpdatableHover(va("element"),s,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&ast(()=>o,this.commandService))),s}renderSlashCommandWidget(e,t,i){const s=we("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new Tu(s,{buttonBackground:Ye(A5e),buttonForeground:Ye(E5e),buttonHoverBackground:void 0}));return r.label=e,i.add(r.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!o)return;const c=o.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:o.id,slashCommand:t.command})})),s}renderFileWidget(e,t){const i=P.parse(e);let s;try{s=Or(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Ma(a));return}if(!s.uri||!P.isUri(s.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=s.range?`${s.range.startLineNumber}-${s.range.endLineNumber}`:"";t.setAttribute("data-href",s.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(s.uri,{relative:!0});t.title=s.range?`${r}#${s.range.startLineNumber}-${s.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=we("span.chat-resource-widget"),s=we("span",void 0,e);return t&&(s.title=t),i.appendChild(s),i}injectKeybindingHint(e,t,i){const s=t.match(/command:([^\)]+)/)?.[1];if(s){const o=i.lookupKeybinding(s);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};ixe=D([_(0,ti),_(1,eo),_(2,Ze),_(3,yp),_(4,be),_(5,el),_(6,Rw),_(7,lL),_(8,ji)],ixe);var P3;const Nm="vs/workbench/contrib/files/common/files",E5t="workbench.view.explorer",lC="workbench.explorer.fileView";new Y("explorerViewletVisible",!0,{type:"boolean",description:g(Nm,0,"True when the EXPLORER viewlet is visible.")});const JFe=new Y("foldersViewVisible",!0,{type:"boolean",description:g(Nm,1,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),x5t=new Y("explorerResourceIsFolder",!1,{type:"boolean",description:g(Nm,2,"True when the focused item in the EXPLORER is a folder.")}),cst=new Y("explorerResourceReadonly",!1,{type:"boolean",description:g(Nm,3,"True when the focused item in the EXPLORER is read-only.")}),lst=cst.toNegated(),D5t=new Y("explorerResourceAvailableEditorIds",""),k5t=new Y("explorerResourceIsRoot",!1,{type:"boolean",description:g(Nm,4,"True when the focused item in the EXPLORER is a root folder.")}),I5t=new Y("explorerResourceCut",!1,{type:"boolean",description:g(Nm,5,"True when an item in the EXPLORER has been cut for cut and paste.")}),L5t=new Y("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(Nm,6,"True when the focused item in the EXPLORER can be moved to trash.")}),dst=new Y("filesExplorerFocus",!0,{type:"boolean",description:g(Nm,7,"True when the focus is inside the EXPLORER view.")});new Y("openEditorsFocus",!0,{type:"boolean",description:g(Nm,8,"True when the focus is inside the OPEN EDITORS view.")});const hst=new Y("explorerViewletFocus",!0,{type:"boolean",description:g(Nm,9,"True when the focus is inside the EXPLORER viewlet.")}),T5t=new Y("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(Nm,10,"True when the focused item in the EXPLORER view is a compact item.")}),R5t=new Y("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(Nm,11,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),M5t=new Y("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(Nm,12,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),N5t=new Y("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(Nm,13,"True when a workspace in the EXPLORER view has some collapsible root child.")});ge.and(JFe,dst,ge.not(Lde));ge.and(JFe,hst,ge.not(Lde));const ust="workbench.editors.files.textFileEditor",gst="workbench.editors.files.fileEditorInput",P5t="workbench.editors.files.binaryFileEditor";var nxe;(function(n){n.Default="default",n.Mixed="mixed",n.FilesFirst="filesFirst",n.Type="type",n.Modified="modified",n.FoldersNestsFiles="foldersNestsFiles"})(nxe||(nxe={}));var SM;(function(n){n.Verbose="verbose",n.Default="default",n.Light="light"})(SM||(SM={}));var x5e;(function(n){n.Default="default",n.Upper="upper",n.Lower="lower",n.Unicode="unicode"})(x5e||(x5e={}));let D5e=P3=class extends ${constructor(e,t,i,s){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=s,this.fileWatcherDisposable=this._register(new Dn)}static async open(e,t,i,s,o){await s.openEditor({original:{resource:P3.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:o})}static resourceToTextFile(e,t){return t.with({scheme:e,query:JSON.stringify({scheme:t.scheme,query:t.query})})}static textFileToResource(e){const{scheme:t,query:i}=JSON.parse(e.query);return e.with({scheme:t,query:i})}async provideTextContent(e){if(!e.query)return null;const t=P3.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const s=new Z;this.fileWatcherDisposable.value=s,s.add(this.fileService.onDidFilesChange(o=>{o.contains(t,Ko.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&s.add(T.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=P3.textFileToResource(e),s=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,s.value);else if(t){const r=this.modelService.getModel(i);let a;r?a=this.languageService.createById(r.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),o=this.modelService.createModel(s.value,a,e)}return o}};D5e=P3=D([_(0,tr),_(1,ci),_(2,Di),_(3,Ai)],D5e);const Vce=class Vce{constructor(e,t){this._editor=e,this._group=t,this.id=Vce.COUNTER++}get editor(){return this._editor}get group(){return this._group}get groupId(){return this._group.id}getId(){return`openeditor:${this.groupId}:${this.id}`}isPreview(){return!this._group.isPinned(this.editor)}isSticky(){return this._group.isSticky(this.editor)}getResource(){return jc.getOriginalUri(this.editor,{supportSideBySide:go.PRIMARY})}};Vce.COUNTER=0;let tne=Vce;const k5e="vs/platform/dialogs/common/dialogs";var I5e;(function(n){n[n.Confirmation=1]="Confirmation",n[n.Prompt=2]="Prompt",n[n.Input=3]="Input"})(I5e||(I5e={}));var Ku;(function(n){n[n.SAVE=0]="SAVE",n[n.DONT_SAVE=1]="DONT_SAVE",n[n.CANCEL=2]="CANCEL"})(Ku||(Ku={}));const YK=10;function fst(n){const e=[];return e.push(...n.slice(0,YK).map(t=>typeof t=="string"?t:ui(t))),n.length>YK&&(n.length-YK===1?e.push(g(k5e,3,"...1 additional file not shown")):e.push(g(k5e,4,"...{0} additional files not shown",n.length-YK))),e.push(""),e.join(` +`)}var F5t=".quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-editor:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}";Ct(F5t,{});const ine=0,L5e=[ine,[]];function T5e(n,e,t,i){if(!n||!e)return L5e;const s=n.length,o=e.length;if(s0,v=n[u],w=e[u];for(let b=0;b0,y=f+b,S=y-1,M=p+b-1,k=C?a[S]:0,F=m&&C?a[M]:0,N=m&&C?c[M]:0;let z;!F&&m?z=0:z=B5t(v,w,i,s,b,N),z&&F+z>=k&&(r||m||s.startsWith(e,b))?(c[y]=N+1,a[y]=F+z):(c[y]=ine,a[y]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===ine||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function B5t(n,e,t,i,s,o){let r=0;if(!W5t(e,i[s]))return r;if(r+=1,o>0&&(r+=o*5),n===t[s]&&(r+=1),s===0)r+=8;else{const a=H5t(t.charCodeAt(s-1));a?r+=a:pQ(t.charCodeAt(s))&&o===0&&(r+=2)}return r}function W5t(n,e){return n===e?!0:n==="/"||n==="\\"?e==="/"||e==="\\":!1}function H5t(n){switch(n){case Q.Slash:case Q.Backslash:return 5;case Q.Underline:case Q.Dash:case Q.Period:case Q.Space:case Q.SingleQuote:case Q.DoubleQuote:case Q.Colon:return 4;default:return 0}}const pst=[void 0,[]];function Ipe(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?U5t(n,s.values,t,i):mst(n,e,t,i)}function U5t(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,c]=mst(n,r,t,i);if(typeof a!="number")return pst;s+=a,o.push(...c)}return[s,axe(o)]}function mst(n,e,t,i){const s=v1(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],Cz(s)]:pst}const nne=Object.freeze({score:0}),aX=1<<18,sxe=1<<17,oxe=65536;function V5t(n,e,t,i){const s=i.values?i.values:[i];return Ed({[i.normalized]:{values:s.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:n,description:e,allowNonContiguousMatches:t}})}function rxe(n,e,t,i,s){if(!n||!e.normalized)return nne;const o=i.getItemLabel(n);if(!o)return nne;const r=i.getItemDescription(n),a=V5t(o,r,t,e),c=s[a];if(c)return c;const l=z5t(o,r,i.getItemPath(n),e);return s[a]=l,l}function z5t(n,e,t,i,s){const o=!t||!i.containsPathSeparator;return t&&(jr?i.pathNormalized===t:Oa(i.pathNormalized,t))?{score:aX,labelMatch:[{start:0,end:n.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?$5t(n,e,t,i.values,o):_st(n,e,t,i,o)}function $5t(n,e,t,i,s,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=_st(n,e,t,l,s);if(d===ine)return nne;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:axe(a),descriptionMatch:axe(c)}}function _st(n,e,t,i,s,o){if(s||!e){const[r,a]=T5e(n,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=dF(i.normalized,n);let l;if(c){l=sxe;const d=Math.round(i.normalized.length/n.length*100);l+=d}else l=oxe;return{score:l+r,labelMatch:c||R5e(a)}}}if(e){let r=e;t&&(r=`${e}${dg}`);const a=r.length,c=`${r}${n}`,[l,d]=T5e(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=R5e(d),u=[],f=[];return h.forEach(p=>{p.starta?(u.push({start:0,end:p.end-a}),f.push({start:p.start,end:a})):p.start>=a?u.push({start:p.start-a,end:p.end-a}):f.push(p)}),{score:l,labelMatch:u,descriptionMatch:f}}}return nne}function R5e(n){const e=[];if(!n)return e;let t;for(const i of n)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function axe(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!G5t(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function G5t(n,e){return!(n.endoxe||l>oxe){if(c!==l)return c>l?-1:1;if(cl?-1:1;const d=Array.isArray(r.labelMatch)&&r.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=M5e(n,r,s),f=M5e(e,a,s);return u&&f&&u!==f?f>u?-1:1:j5t(n,e,t,s)}function M5e(n,e,t){let i=-1,s=-1;if(e.descriptionMatch&&e.descriptionMatch.length?i=e.descriptionMatch[0].start:e.labelMatch&&e.labelMatch.length&&(i=e.labelMatch[0].start),e.labelMatch&&e.labelMatch.length){if(s=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(n);o&&(s+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(s=e.descriptionMatch[e.descriptionMatch.length-1].end);return s-i}function Q5t(n,e){if(!n&&!e||(!n||!n.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!n||!n.length)return 1;const t=n[0].start,s=n[n.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return s===a?0:a=0,r=N5e(n);let a;const c=n.split(vst);if(c.length>1)for(const l of c){const d=N5e(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=P5e(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function P5e(n){let e;Is?e=n.replace(/\//g,dg):e=n.replace(/\\/g,dg);const t=Mlt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function F5e(n){return Array.isArray(n)?y6(n.map(e=>e.original).join(vst)):y6(n.original)}var cxe,lxe,dxe;const L5="vs/workbench/browser/parts/editor/editorQuickAccess";let S6=class extends zFe{constructor(e,t,i,s,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(L5,0,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=s,this.languageService=o,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(r){r||(this.scorerCache=Object.create(null)),this.isQuickNavigating=r}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=y6(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=rxe(o,t,!0,_Ue,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(gg.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):q5t(r,a,t,!0,_Ue,this.pickState.scorerCache))}const s=[];if(this.editorGroupService.count>1){let o;for(const r of i){if(typeof o!="number"||o!==r.groupId){const a=this.editorGroupService.getGroup(r.groupId);a&&s.push({type:"separator",label:a.label}),o=r.groupId}s.push(r)}}else s.push(...i);return s}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const s=this.editorGroupService.getGroup(i);s&&t.set(i,s.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:s})=>{const o=jc.getOriginalUri(i,{supportSideBySide:go.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:s,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(L5,1,"{0}, unsaved changes, {1}",c,t.get(s)):g(L5,2,"{0}, {1}",c,t.get(s)):r?g(L5,3,"{0}, unsaved changes",c):c,description:a,iconClasses:lI(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(s)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+$e.asClassName(Ce.closeDirty):$e.asClassName(Ce.close),tooltip:g(L5,4,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(s);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?BE.REMOVE_ITEM:BE.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(s)?.openEditor(i,{preserveFocus:d.inBackground})}})}};S6=D([_(1,ur),_(2,_i),_(3,Ai),_(4,Di)],S6);var sP;let O5e=(sP=class extends S6{constructor(e,t,i,s){super(cxe.PREFIX,e,t,i,s)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(eg.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},cxe=sP,sP.PREFIX="edt active ",sP);O5e=cxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],O5e);var oP;let B5e=(oP=class extends S6{constructor(e,t,i,s){super(lxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(gg.GRID_APPEARANCE))for(const i of t.getEditors(eg.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},lxe=oP,oP.PREFIX="edt ",oP);B5e=lxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],B5e);var rP;let W5e=(rP=class extends S6{constructor(e,t,i,s){super(dxe.PREFIX,e,t,i,s)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(eg.MOST_RECENTLY_ACTIVE))e.push(t);return e}},dxe=rP,rP.PREFIX="edt mru ",rP);W5e=dxe=D([_(0,ur),_(1,_i),_(2,Ai),_(3,Di)],W5e);var K5t=".side-by-side-editor-container{height:100%;width:100%}";Ct(K5t,{});var kB;const Y5t="vs/workbench/common/editor/sideBySideEditorInput";var aP;let mm=(aP=class extends cC{get typeId(){return kB.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Mi.CanSplitInGroup,this.secondary.hasCapability(Mi.RequiresTrust)&&(e|=Mi.RequiresTrust),this.secondary.hasCapability(Mi.Singleton)&&(e|=Mi.Singleton),e|=Mi.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,s,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=s,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(T.once(T.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(){const e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():g(Y5t,0,"{0} - {1}",this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){const t=this.getPreferredDescription();return t||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t;this.hasIdenticalSides?t=this.primary.getTitle(e)??this.getName():t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}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,t){const i=await this.primary.save(e,t);return this.saveResultToEditor(i)}async saveAs(e,t){const i=await this.primary.saveAs(e,t);return this.saveResultToEditor(i)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof cC)return new kB(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!Gv(e)&&!V$(e)&&!LE(e)&&!Wb(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,t){return this.primary.revert(e,t)}async rename(e,t){if(!this.hasIdenticalSides)return;const i=await this.primary.rename(e,t);if(i){if(Qa(i.editor))return{editor:new kB(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:qW(this,e,this.editorService)}};if(wb(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:qW(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){const t=this.primary.toUntyped(e),i=this.secondary.toUntyped(e);if(t&&i&&!Gv(t)&&!Gv(i)&&!V$(t)&&!V$(i)&&!LE(t)&&!LE(i)&&!Wb(t)&&!Wb(i)){const s={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(s.options={viewState:qW(this,e.preserveViewState,this.editorService)}),s}}matches(e){return this===e?!0:EZe(e)||Gv(e)?!1:e instanceof kB?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):LE(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},kB=aP,aP.ID="workbench.editorinputs.sidebysideEditorInput",aP);mm=kB=D([_(4,_i)],mm);const Ol=class Ol{constructor(e,t){this.storageService=t,this.id=Ol.COMMON_PREFIX+e}getMemento(e,t){switch(e){case ke.WORKSPACE:{let i=Ol.workspaceMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.workspaceMementos.set(this.id,i)),i.getMemento()}case ke.PROFILE:{let i=Ol.profileMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.profileMementos.set(this.id,i)),i.getMemento()}case ke.APPLICATION:{let i=Ol.applicationMementos.get(this.id);return i||(i=new Lpe(this.id,e,t,this.storageService),Ol.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Ol.workspaceMementos.get(this.id)?.save(),Ol.profileMementos.get(this.id)?.save(),Ol.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case ke.APPLICATION:t=Ol.applicationMementos.get(this.id);break;case ke.PROFILE:t=Ol.profileMementos.get(this.id);break;case ke.WORKSPACE:t=Ol.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case ke.WORKSPACE:Ol.workspaceMementos.clear();break;case ke.PROFILE:Ol.profileMementos.clear();break;case ke.APPLICATION:Ol.applicationMementos.clear();break}}};Ol.applicationMementos=new Map,Ol.profileMementos=new Map,Ol.workspaceMementos=new Map,Ol.COMMON_PREFIX="memento/";let W1=Ol;class Lpe{constructor(e,t,i,s){this.id=e,this.scope=t,this.target=i,this.storageService=s,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){bt(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(const e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){n1(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class wst extends VMe{constructor(e,t,i){super(t),this.id=e,this.memento=new W1(this.id,i),this._register(i.onWillSaveState(()=>{this.saveState(),this.memento.saveMemento()}))}getId(){return this.id}getMemento(e,t){return this.memento.getMemento(e,t)}reloadMemento(e){return this.memento.reloadMemento(e)}onDidChangeMementoValue(e,t){return this.memento.onDidChangeValue(e,t)}saveState(){}}class J5t extends wst{get onDidFocus(){return this._onDidFocus||(this._onDidFocus=this.registerFocusTrackEvents().onDidFocus),this._onDidFocus.event}get onDidBlur(){return this._onDidBlur||(this._onDidBlur=this.registerFocusTrackEvents().onDidBlur),this._onDidBlur.event}hasFocus(){return this._hasFocus}registerFocusTrackEvents(){const e=ws(this.getContainer()),t=this._register(Dd(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const s=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,s.fire()})),{onDidFocus:i,onDidBlur:s}}constructor(e,t,i,s){super(e,i,s),this.telemetryService=t,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._hasFocus=!1,this.visible=!1}getTitle(){}create(e){this.parent=e}getContainer(){return this.parent}setVisible(e){this.visible!==!!e&&(this.visible=e)}focus(){}getMenuIds(){return[]}getActions(){return[]}getSecondaryActions(){return[]}getContextMenuActions(){return[]}getActionViewItem(e,t){}getActionsContext(){return null}getActionRunner(){return this.actionRunner||(this.actionRunner=this._register(new gw)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const eW=class eW extends J5t{get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}get input(){return this._input}get options(){return this._options}get window(){return vZ(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,s,o){super(e,i,s,o),this.group=t,this.onDidChangeSizeConstraints=T.None,this._onDidChangeControl=this._register(new I),this.onDidChangeControl=this._onDidChangeControl.event}create(e){super.create(e),this.createEditor(e)}async setInput(e,t,i,s){this._input=e,this._options=t}clearInput(){this._input=void 0,this._options=void 0}setOptions(e){this._options=e}setVisible(e){super.setVisible(e),this.setEditorVisible(e)}setEditorVisible(e){}setBoundarySashes(e){}getEditorMemento(e,t,i,s=10){const o=`${this.getId()}${i}`;let r=eW.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new hxe(this.getId(),i,this.getMemento(ke.WORKSPACE,ln.MACHINE),s,e,t)),eW.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of eW.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};eW.EDITOR_MEMENTOS=new Map;let sne=eW;const tW=class tW extends ${constructor(e,t,i,s,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=s,this.editorGroupService=o,this.configurationService=r,this.cleanedUp=!1,this.shareEditorState=!1,this.updateConfiguration(void 0),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){(!e||e.affectsConfiguration(void 0,"workbench.editor.sharedViewState"))&&(this.shareEditorState=this.configurationService.getValue(void 0,"workbench.editor.sharedViewState")===!0)}saveEditorState(e,t,i){const s=this.doGetResource(t);if(!s||!e)return;const o=this.doLoad();let r=o.get(s.toString());r||(r=Object.create(null),o.set(s.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[tW.SHARED_EDITOR_STATE]=i),Qa(t)&&this.clearEditorStateOnDispose(s,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const o=this.doLoad().get(i.toString());if(o){const r=o[e.id];if(r)return r;if(this.shareEditorState)return o[tW.SHARED_EDITOR_STATE]}}clearEditorState(e,t){Qa(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const s=this.doLoad();if(t){const o=s.get(i.toString());o&&(delete o[t.id],n1(o)&&s.delete(i.toString()))}else s.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,T.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const s=this.doLoad(),o=[...s.keys()];for(const r of o){const a=P.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(_n(e,a))c=t;else{const d=GQe(a.path,e.path);c=Qt(t,a.path.substr(d+e.path.length+1))}const l=s.get(r,Vd.None);l&&(s.delete(r),s.set(c.toString(),l))}}doGetResource(e){return Qa(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new L_(this.limit);const e=this.memento[this.key];Array.isArray(e)&&this.cache.fromJSON(e)}return this.cache}saveState(){const e=this.doLoad();this.cleanedUp||(this.cleanUp(),this.cleanedUp=!0),this.memento[this.key]=e.toJSON()}cleanUp(){const e=this.doLoad(),t=[...e.entries()];for(const[i,s]of t)for(const o of Object.keys(s)){const r=Number(o);r===tW.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete s[r],n1(s)&&e.delete(i))}}};tW.SHARED_EDITOR_STATE=-1;let hxe=tW,one=class extends sne{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,s,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new Dn),this.viewState=this.getEditorMemento(d,a,i,100)}setEditorVisible(e){this.groupListener.value=this.group.onWillCloseEditor(t=>this.onWillCloseEditor(t)),super.setEditorVisible(e)}onWillCloseEditor(e){const t=e.editor;t===this.input&&this.updateEditorViewState(t)}clearInput(){this.updateEditorViewState(this.input),super.clearInput()}saveState(){this.updateEditorViewState(this.input),super.saveState()}updateEditorViewState(e){if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);t&&(this.tracksDisposedEditorViewState()||(this.editorViewStateDisposables||(this.editorViewStateDisposables=new Map),this.editorViewStateDisposables.has(e)||this.editorViewStateDisposables.set(e,T.once(e.onWillDispose)(()=>{this.clearEditorViewState(t,this.group),this.editorViewStateDisposables?.delete(e)}))),e.isDisposed()&&!this.tracksDisposedEditorViewState()||!this.shouldRestoreEditorViewState(e)&&!this.group.contains(e)?this.clearEditorViewState(t,this.group):e.isDisposed()||this.saveEditorViewState(t))}shouldRestoreEditorViewState(e,t){return t?.newInGroup?this.textResourceConfigurationService.getValue(jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}),"workbench.editor.restoreViewState")!==!1:!0}getViewState(){const e=this.input;if(!e||!this.tracksEditorViewState(e))return;const t=this.toEditorViewStateResource(e);if(t)return this.computeEditorViewState(t)}saveEditorViewState(e){const t=this.computeEditorViewState(e);t&&this.viewState.saveEditorState(this.group,e,t)}loadEditorViewState(e,t){if(!e||!this.tracksEditorViewState(e)||!this.shouldRestoreEditorViewState(e,t))return;const i=this.toEditorViewStateResource(e);if(i)return this.viewState.loadEditorState(this.group,i)}moveEditorViewState(e,t,i){return this.viewState.moveEditorState(e,t,i)}clearEditorViewState(e,t){this.viewState.clearEditorState(e,t)}dispose(){if(super.dispose(),this.editorViewStateDisposables){for(const[,e]of this.editorViewStateDisposables)e.dispose();this.editorViewStateDisposables=void 0}}tracksDisposedEditorViewState(){return!1}};one=D([_(3,rn),_(4,be),_(5,on),_(6,dl),_(7,pn),_(8,_i),_(9,ur)],one);var nT;const X5t="vs/workbench/browser/parts/editor/sideBySideEditor";function Z5t(n){const e=n;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var XE;let uxe=(XE=class extends one{get minimumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.minimumWidth:0}get maximumPrimaryWidth(){return this.primaryEditorPane?this.primaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.minimumHeight:0}get maximumPrimaryHeight(){return this.primaryEditorPane?this.primaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}get minimumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumWidth:0}get maximumSecondaryWidth(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumWidth:Number.POSITIVE_INFINITY}get minimumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.minimumHeight:0}get maximumSecondaryHeight(){return this.secondaryEditorPane?this.secondaryEditorPane.maximumHeight:Number.POSITIVE_INFINITY}set minimumWidth(e){}set maximumWidth(e){}set minimumHeight(e){}set maximumHeight(e){}get minimumWidth(){return this.minimumPrimaryWidth+this.minimumSecondaryWidth}get maximumWidth(){return this.maximumPrimaryWidth+this.maximumSecondaryWidth}get minimumHeight(){return this.minimumPrimaryHeight+this.minimumSecondaryHeight}get maximumHeight(){return this.maximumPrimaryHeight+this.maximumSecondaryHeight}constructor(e,t,i,s,o,r,a,c,l){super(nT.ID,e,nT.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,s,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new v_e),this.onDidChangeSizeConstraints=T.any(this.onDidCreateEditors.event,this._onDidChangeSizeConstraints.event),this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this.primaryEditorPane=void 0,this.secondaryEditorPane=void 0,this.splitviewDisposables=this._register(new Z),this.editorDisposables=this._register(new Z),this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.dimension=new Tn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(nT.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(nT.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?vi.VERTICAL:vi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=ws(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(e.removeChild(this.splitview.el),this.splitviewDisposables.clear()),this.createSplitView(e,t),this.layout(this.dimension)}getSplitViewRatio(){let e;if(this.splitview){const t=this.splitview.getViewSize(0),i=this.splitview.getViewSize(1);if(Math.abs(t-i)>1){const s=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/s}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=we(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new x7(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===vi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=A1.Distribute,s=A1.Distribute;if(t){const a=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),s=a-i,this.splitview.layout(this.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=ws(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},i);const r=ws(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===vi.HORIZONTAL?rI.width:rI.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:T.None},s),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(X5t,0,"Side by Side Editor")}async setInput(e,t,i,s){const o=this.input;await super.setInput(e,t,i,s),(!o||!e.matches(o))&&(o&&this.disposeEditors(),this.createEditors(e));const{primary:r,secondary:a,viewState:c}=this.loadViewState(e,t,i);if(this.lastFocusedSide=c?.focus,typeof c?.ratio=="number"&&this.splitview){const l=this.splitview.orientation===vi.HORIZONTAL?this.dimension.width:this.dimension.height;this.splitview.resizeView(0,Math.round(l*c.ratio))}else this.splitview?.distributeViewSizes();await Promise.all([this.secondaryEditorPane?.setInput(e.secondary,a,i,s),this.primaryEditorPane?.setInput(e.primary,r,i,s)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const s=Z5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===go.SECONDARY?r={...t}:o={...t},o.viewState=s?.primary,s?.secondary&&(r?r.viewState=s?.secondary:r={viewState:s.secondary}),{primary:o,secondary:r,viewState:s}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,ws(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,ws(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=T.any(T.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),T.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(go.SECONDARY)))}doCreateEditor(e,t){const i=it.as(zS.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const s=i.instantiate(this.instantiationService,this.group);return s.create(t),s.setVisible(this.isVisible()),uVe(s)&&this.editorDisposables.add(s.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(s),s}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(uVe(e)){const t=e.getSelection();if(t)return new XFe(t,e===this.primaryEditorPane?go.PRIMARY:go.SECONDARY)}}setOptions(e){super.setOptions(e),typeof e?.target=="number"&&(this.lastFocusedSide=e.target),this.getLastFocusedEditorPane()?.setOptions(e)}setEditorVisible(e){this.primaryEditorPane?.setVisible(e),this.secondaryEditorPane?.setVisible(e),super.setEditorVisible(e)}clearInput(){super.clearInput(),this.primaryEditorPane?.clearInput(),this.secondaryEditorPane?.clearInput(),this.disposeEditors()}focus(){super.focus(),this.getLastFocusedEditorPane()?.focus()}getLastFocusedEditorPane(){return this.lastFocusedSide===go.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,ws(this.splitview).layout(this.orientation===vi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===vi.HORIZONTAL?new Tn(t,this.dimension.height):new Tn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof mm}computeEditorViewState(e){if(!this.input||!_n(e,this.toEditorViewStateResource(this.input)))return;const t=this.primaryEditorPane?.getViewState(),i=this.secondaryEditorPane?.getViewState();if(!(!t||!i))return{primary:t,secondary:i,focus:this.lastFocusedSide,ratio:this.getSplitViewRatio()}}toEditorViewStateResource(e){let t,i;if(e instanceof mm&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return P.from({scheme:"sideBySide",path:`${O9(i.toString())}${O9(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===vi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(HTt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(WTt)??"",this.primaryEditorContainer.style.borderLeftWidth="0"))}dispose(){this.disposeEditors(),super.dispose()}disposeEditors(){this.editorDisposables.clear(),this.secondaryEditorPane=void 0,this.primaryEditorPane=void 0,this.lastFocusedSide=void 0,this.secondaryEditorContainer&&Yo(this.secondaryEditorContainer),this.primaryEditorContainer&&Yo(this.primaryEditorContainer)}},nT=XE,XE.ID=QLt,XE.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",XE.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",XE);uxe=nT=D([_(1,rn),_(2,be),_(3,pn),_(4,on),_(5,Re),_(6,dl),_(7,_i),_(8,ur)],uxe);class XFe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof XFe)||this.side!==e.side?Jk.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const H5e="vs/workbench/browser/editor",ey=class ey{static didInstantiateEditorPane(e){return ey.instantiatedEditorPanes.has(e)}static create(e,t,i){return new ey(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){ey._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return ey.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};ey.instantiatedEditorPanes=new Set,ey._onWillInstantiateEditorPane=new I,ey.onWillInstantiateEditorPane=ey._onWillInstantiateEditorPane.event;let U5e=ey;class e3t{constructor(){this.mapEditorPanesToEditors=new Map}registerEditorPane(e,t){return this.mapEditorPanesToEditors.set(e,t),Ee(()=>{this.mapEditorPanesToEditors.delete(e)})}getEditorPane(e){const t=this.findEditorPaneDescriptors(e);if(t.length!==0)return t.length===1?t[0]:e.prefersEditorPane(t)}findEditorPaneDescriptors(e,t){const i=[];for(const s of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(s)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(s);break}else if(t&&e instanceof a){i.push(s);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return fi.find(this.mapEditorPanesToEditors.keys(),t=>t.typeId===e)}getEditorPanes(){return Array.from(this.mapEditorPanesToEditors.keys())}getEditors(){const e=[];for(const t of this.mapEditorPanesToEditors.keys()){const i=this.mapEditorPanesToEditors.get(t);i&&e.push(...i.map(s=>s.ctor))}return e}}it.add(zS.EditorPane,new e3t);function t3t(n,e){const t=n.get(_i),i=n.get(_o),s=n.get(Pw);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===mx.MOVE)return;let l=jc.getOriginalUri(c.editor,{supportSideBySide:go.PRIMARY}),d=jc.getOriginalUri(c.editor,{supportSideBySide:go.SECONDARY});if(c.context===mx.REPLACE){const h=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),u=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(r=r.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==mx.REPLACE&&(l?.scheme===_e.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===_e.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>s.isDirty(u));return h.length>0&&await ko.settled(h.map(async u=>await new Promise(f=>{if(!s.isDirty(u))return f();const p=s.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function i3t(n,e,t,i){let s=n.getAriaLabel();return t&&!t.isPinned(n)&&(s=g(H5e,0,"{0}, preview",s)),t?.isSticky(n)&&(s=g(H5e,1,"{0}, pinned",s)),t&&typeof i=="number"&&i>1&&(s=`${s}, ${t.ariaLabel}`),s}var gxe;const n3t="vs/workbench/browser/parts/editor/textEditor";var cP;let fxe=(cP=class extends one{constructor(e,t,i,s,o,r,a,c,l,d){super(e,t,gxe.VIEW_STATE_PREFERENCE_KEY,i,s,o,r,a,c,l),this.fileService=d,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeScroll=this._register(new I),this.onDidChangeScroll=this._onDidChangeScroll.event,this.inputListener=this._register(new Dn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(T.any(this.editorGroupService.onDidAddGroup,this.editorGroupService.onDidRemoveGroup)(()=>{const h=this.computeAriaLabel();this.editorContainer?.setAttribute("aria-label",h),this.updateEditorControlOptions({ariaLabel:h})})),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(h=>this.onDidChangeFileSystemProvider(h.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(h=>this.onDidChangeFileSystemProvider(h.scheme)))}handleConfigurationChangeEvent(e){const t=this.getActiveResource();this.shouldHandleConfigurationChangeEvent(e,t)&&(this.isVisible()?this.updateEditorConfiguration(t):this.hasPendingConfigurationChange=!0)}shouldHandleConfigurationChangeEvent(e,t){return e.affectsConfiguration(t,"editor")||e.affectsConfiguration(t,"problems.visibility")}consumePendingConfigurationChangeEvent(){this.hasPendingConfigurationChange&&(this.updateEditorConfiguration(),this.hasPendingConfigurationChange=!1)}computeConfiguration(e){const t=fo(e.editor)?Vs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?i3t(this.input,void 0,this.group,this.editorGroupService.count):g(n3t,0,"Editor")}onDidChangeFileSystemProvider(e){this.input&&this.getActiveResource()?.scheme===e&&this.updateReadonly(this.input)}onDidChangeInputCapabilities(e){this.input===e&&this.updateReadonly(e)}updateReadonly(e){this.updateEditorControlOptions({...this.getReadonlyConfiguration(e.isReadonly())})}getReadonlyConfiguration(e){return{readOnly:!!e,readOnlyMessage:typeof e!="boolean"?e:void 0}}getConfigurationOverrides(e){return{overviewRulerLanes:3,lineNumbersMinChars:3,fixedOverflowWidgets:!0,...this.getReadonlyConfiguration(this.input?.isReadonly()),renderValidationDecorations:e.problems?.visibility!==!1?"on":"off"}}createEditor(e){this.editorContainer=e,this.createEditorControl(e,this.computeConfiguration(this.textResourceConfigurationService.getValue(this.getActiveResource()))),this.registerCodeEditorListeners()}registerCodeEditorListeners(){const e=this.getMainControl();e&&(this._register(e.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeModel(()=>this.updateEditorConfiguration())),this._register(e.onDidChangeCursorPosition(t=>this._onDidChangeSelection.fire({reason:this.toEditorPaneSelectionChangeReason(t)}))),this._register(e.onDidChangeModelContent(()=>this._onDidChangeSelection.fire({reason:RT.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case jb.PROGRAMMATIC:return RT.PROGRAMMATIC;case jb.NAVIGATION:return RT.NAVIGATION;case jb.JUMP:return RT.JUMP;default:return RT.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new pxe(t)}}async setInput(e,t,i,s){await super.setInput(e,t,i,s),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),ws(this.editorContainer).setAttribute("aria-label",this.computeAriaLabel())}clearInput(){this.inputListener.clear(),super.clearInput()}getScrollPosition(){const e=this.getMainControl();if(!e)throw new Error("Control has not yet been initialized");return{scrollTop:e.getScrollTop()-e.getTopForLineNumber(1),scrollLeft:e.getScrollLeft()}}setScrollPosition(e){const t=this.getMainControl();if(!t)throw new Error("Control has not yet been initialized");t.setScrollTop(e.scrollTop),e.scrollLeft&&t.setScrollLeft(e.scrollLeft)}setEditorVisible(e){e&&this.consumePendingConfigurationChangeEvent(),super.setEditorVisible(e)}toEditorViewStateResource(e){return e.resource}updateEditorConfiguration(e=this.getActiveResource()){let t;if(e&&(t=this.textResourceConfigurationService.getValue(e)),!t)return;const i=this.computeConfiguration(t);let s=i;this.lastAppliedEditorOptions&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(s))}getActiveResource(){const e=this.getMainControl();if(e){const t=e.getModel();if(t)return t.uri}if(this.input)return this.input.resource}dispose(){this.lastAppliedEditorOptions=void 0,super.dispose()}},gxe=cP,cP.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",cP);fxe=gxe=D([_(2,rn),_(3,be),_(4,on),_(5,dl),_(6,pn),_(7,_i),_(8,ur),_(9,ci)],fxe);const r9=class r9{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof r9))return Jk.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Jk.IDENTICAL:Math.abs(t-i){this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get hasLanguageSetExplicitly(){return this._hasLanguageSetExplicitly}setLanguageId(e,t){this._hasLanguageSetExplicitly=!0,this.setLanguageIdInternal(e,t)}setLanguageIdInternal(e,t){this.isResolved()&&(!e||e===this.textEditorModel.getLanguageId()||this.textEditorModel.setLanguage(this.languageService.createById(e),t))}installModelListeners(e){const t=this._register(e.onDidChangeLanguage(i=>{i.source!==V5e&&(this._hasLanguageSetExplicitly=!0,t.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()??Yc))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,V5e);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(o3t,0,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const s=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,s);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let s=i&&this.modelService.getModel(i);return s?this.updateTextEditorModel(e,t.languageId):(s=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(s)),this.textEditorModelHandle=s.uri,s}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,xZ.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,s){return!i||i===Yc?t.createByFilepathOrFirstLine(e??null,s):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Yc&&this.textEditorModel.getLanguageId()!==t&&this.textEditorModel.setLanguage(this.languageService.createById(t)))}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()}},mxe=lP,lP.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,lP);H1=mxe=D([_(0,Ai),_(1,Di),_(2,LQ),_(3,Ur)],H1);class bst extends pL{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(e,t){super(),this._originalModel=e,this._modifiedModel=t}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}class Cst extends bst{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}constructor(e,t){super(e,t),this._textDiffEditorModel=void 0,this._originalModel=e,this._modifiedModel=t,this.updateTextDiffEditorModel()}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 cX;const r3t="vs/workbench/common/editor/diffEditorInput";var dP;let op=(dP=class extends mm{get typeId(){return cX.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|=Mi.ForceDescription),e}constructor(e,t,i,s,o,r){super(e,t,i,s,r),this.original=i,this.modified=s,this.forceOpenAsBinary=o,this.cachedModel=void 0,this.labels=this.computeLabels()}computeLabels(){let e,t=!1;if(this.preferredName)e=this.preferredName;else{const d=this.original.getName(),h=this.modified.getName();e=g(r3t,0,"{0} ↔ {1}",d,h),t=d===h}let i,s,o;if(this.preferredDescription)i=this.preferredDescription,s=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Gs.SHORT),this.modified.getDescription(Gs.SHORT)),o=this.computeLabel(this.original.getDescription(Gs.LONG),this.modified.getDescription(Gs.LONG));const d=this.original.getDescription(Gs.MEDIUM),h=this.modified.getDescription(Gs.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=rPt([d,h]);s=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Gs.SHORT)??this.original.getName(),this.modified.getTitle(Gs.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Gs.MEDIUM)??this.original.getName(),this.modified.getTitle(Gs.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Gs.LONG)??this.original.getName(),this.modified.getTitle(Gs.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:s,longDescription:o,forceDescription:t,shortTitle:r,mediumTitle:a,longTitle:c}}computeLabel(e,t,i=" - "){if(!(!e||!t))return e===t?t:`${e}${i}${t}`}getName(){return this.labels.name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.labels.shortDescription;case Gs.LONG:return this.labels.longDescription;case Gs.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Gs.SHORT:return this.labels.shortTitle;case Gs.LONG:return this.labels.longTitle;default:case Gs.MEDIUM:return this.labels.mediumTitle}}async resolve(){const e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(t=>t.typeId===jLt):e.find(t=>t.typeId===SZe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof H1&&e instanceof H1?new Cst(e,t):new bst(mUe(e)?e:void 0,mUe(t)?t:void 0)}toUntyped(e){const t=super.toUntyped(e);if(t)return{...t,modified:t.primary,original:t.secondary}}matches(e){return this===e?!0:e instanceof cX?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:Gv(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},cX=dP,dP.ID="workbench.editors.diffEditorInput",dP);op=cX=D([_(5,_i)],op);var _xe;const Tpe="vs/workbench/browser/parts/editor/textDiffEditor";var hP;let z5e=(hP=class extends fxe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Pe))}constructor(e,t,i,s,o,r,a,c,l,d){super(_xe.ID,e,t,i,s,o,a,r,c,l),this.preferencesService=d,this.diffEditorControl=void 0,this.inputLifecycleStopWatch=void 0,this._previousViewModel=null}getTitle(){return this.input?this.input.getName():g(Tpe,0,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(xm,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,s){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,s);try{const o=await e.resolve();if(s.isCancellationRequested)return;if(!(o instanceof Cst)){this.openAsBinary(e,t);return}const r=ws(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;mPe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=rne(t,r,vt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new ao(!1)}catch(o){await this.handleSetInputError(o,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===Zi.FILE_TOO_LARGE){let s;throw e instanceof hJ?s=g(Tpe,1,"At least one file is not displayed in the text compare editor because it is very large ({0}).",vl.formatSize(e.size)):s=g(Tpe,2,"At least one file is not displayed in the text compare editor because it is very large."),ZLt(this.group,t,i,s,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,s){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),s.restoreViewState(o),t?.revealIfVisible&&s.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,s=e.modified,o=this.instantiationService.createInstance(op,e.getName(),e.getDescription(),i,s,!0),r=it.as(zS.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(s)&&s.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:y1.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&rne(e,ws(this.diffEditorControl),vt.Smooth)}shouldHandleConfigurationChangeEvent(e,t){return super.shouldHandleConfigurationChangeEvent(e,t)?!0:e.affectsConfiguration(t,"diffEditor")||e.affectsConfiguration(t,"accessibility.verbosity.diffEditor")}computeConfiguration(e){const t=super.computeConfiguration(e);if(fo(e.diffEditor)){const s=Vs(e.diffEditor);s.diffCodeLens=s.codeLens,delete s.codeLens,s.diffWordWrap=s.wordWrap,delete s.wordWrap,Object.assign(t,s)}const i=e.accessibility?.verbosity?.diffEditor??!1;return t.accessibilityVerbose=i,t}getConfigurationOverrides(e){return{...super.getConfigurationOverrides(e),...this.getReadonlyConfiguration(this.input?.isReadonly()),originalEditable:this.input instanceof op&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof op?this.diffEditorControl?.updateOptions({...this.getReadonlyConfiguration(e.isReadonly()),originalEditable:!e.original.isReadonly()}):super.updateReadonly(e)}isFileBinaryError(e){return Array.isArray(e)?e.some(i=>this.isFileBinaryError(i)):e.textFileOperationResult===xV.FILE_IS_BINARY}clearInput(){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),super.clearInput();const e=this.inputLifecycleStopWatch?.elapsed();this.inputLifecycleStopWatch=void 0,typeof e=="number"&&this.logInputLifecycleTelemetry(e,this.getControl()?.getModel()?.modified?.getLanguageId()),this.diffEditorControl?.setModel(null)}logInputLifecycleTelemetry(e,t){let i=!1;this.diffEditorControl instanceof xm&&(i=this.diffEditorControl.collapseUnchangedRegions),this.telemetryService.publicLog2("diffEditor.editorVisibleTime",{editorVisibleTimeMs:e,languageId:t??"",collapseUnchangedRegions:i})}getControl(){return this.diffEditorControl}focus(){super.focus(),this.diffEditorControl?.focus()}hasFocus(){return this.diffEditorControl?.hasTextFocus()||super.hasFocus()}setEditorVisible(e){super.setEditorVisible(e),e?this.diffEditorControl?.onVisible():this.diffEditorControl?.onHide()}layout(e){this.diffEditorControl?.layout(e)}setBoundarySashes(e){this.diffEditorControl?.setBoundarySashes(e)}tracksEditorViewState(e){return e instanceof op}computeEditorViewState(e){if(!this.diffEditorControl)return;const t=this.diffEditorControl.getModel();if(!t||!t.modified||!t.original)return;const i=this.toEditorViewStateResource(t);if(i&&_n(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof op?(t=e.original.resource,i=e.modified.resource):Qa(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return P.from({scheme:"diff",path:`${O9(t.toString())}${O9(i.toString())}`})}},_xe=hP,hP.ID=SZe,hP);z5e=_xe=D([_(1,rn),_(2,be),_(3,on),_(4,dl),_(5,_i),_(6,pn),_(7,ur),_(8,ci),_(9,TQ)],z5e);function ane(n,e,t=wx){if(t===wx||t===Cw)return t;let i=n.getGroups(gg.GRID_APPEARANCE)[t];if(!i&&t<9){for(let s=0;s<=t;s++){const o=n.getGroups(gg.GRID_APPEARANCE);o[s]||n.addGroup(o[s-1],w6(e))}i=n.getGroups(gg.GRID_APPEARANCE)[t]}return i?.id??Cw}function U1(n,e){const t=typeof e=="number"?n.getGroup(e):e;return n.getGroups(gg.GRID_APPEARANCE).indexOf(t??n.activeGroup)}const a3t="workbench.action.closeEditorsAndGroup";function c3t(n,e,t){const i=e.lastFocusedList;if(i instanceof Pc&&i.getHTMLElement()===xl()){const s=c=>{if(vEe(c))return{groupId:c.id,editorIndex:void 0};const l=t.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?l.getIndexOfEditor(c.editor):-1}},o=c=>vEe(c)||HCe(c),r=i.getFocusedElements().filter(o),a=n||(r.length?r.map(s)[0]:void 0);if(a){const c=i.getSelectedElements().filter(o);return c.length>1?c.map(s):[a]}}else{const s=n?t.getGroup(n.groupId):t.activeGroup,o=n&&n.editorIndex!==void 0?s?.getEditorByIndex(n.editorIndex):s?.activeEditor;if(s&&o&&s.isSelected(o))return s.selectedEditors.map(r=>({groupId:s.id,editorIndex:s.getIndexOfEditor(r)}))}return n?[n]:[]}class l3t{constructor(e){this.root=new cne;for(const[t,i]of e)for(const s of i)this.root.add(t,s)}toString(){return this.root.toString()}getAttributes(e,t){const i=e.lastIndexOf(".");return i<1?{dirname:t,basename:e,extname:""}:{dirname:t,basename:e.substring(0,i),extname:e.substring(i+1)}}nest(e,t){const i=new cne;for(const r of e){const a=this.getAttributes(r,t),c=this.root.get(r,a);for(const l of c)i.add(l,r)}const s=(r,a=new Set)=>{if(a.has(r))return[];a.add(r);const c=this.getAttributes(r,t),l=i.get(r,c);return l.length===0?[r]:l.length===1&&l[0]===r?[r]:l.flatMap(d=>s(d,a))},o=new Map;for(const r of e){let a=s(r);a.length===0&&(a=[r]);for(const c of a){let l=o.get(c);l||o.set(c,l=new Set),r!==c&&l.add(r)}}return o}}class cne{constructor(){this.value=new ZFe,this.map=new Map}add(e,t){if(e==="")this.value.add(e,t);else if(e[0]==="*")this.value.add(e,t);else{const i=e[0],s=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new cne),o.add(s,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const s=e[0],o=e.slice(1),r=this.map.get(s);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => `+this.value.toString(e+" ")),t.map(i=>e+i).join(` `)}}class ZFe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new G5e(t));else if(e==="")this.epsilon.push(new G5e(t));else{const i=e[e.length-1],s=e.slice(0,e.length-1);if(i==="*")throw Error("Unexpected star in SufTrie key: "+e);{let o=this.map.get(i);o||this.map.set(i,o=new ZFe),o.add(s,t)}}}get(e,t){const i=[];e===""&&i.push(...this.epsilon.map(a=>a.substitute(t))),this.star.length&&i.push(...this.star.map(a=>a.substitute(t,e)));const s=e[e.length-1],o=e.slice(0,e.length-1),r=this.map.get(s);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.star.length&&t.push("* => "+this.star.join("; ")),this.epsilon.length&&t.push("ε => "+this.epsilon.join("; ")),t.map(i=>e+i).join(` -`)}}var VC;(function(n){n.capture="capture",n.basename="basename",n.dirname="dirname",n.extname="extname"})(VC||(VC={}));const $5e=/\$[({](capture|basename|dirname|extname)[)}]/g;class G5e{constructor(e){this.tokens=[],$5e.lastIndex=0;let t,i=0;for(;t=$5e.exec(e);){const s=e.slice(i,t.index);this.tokens.push(s);const o=t[1];switch(o){case VC.basename:case VC.dirname:case VC.extname:case VC.capture:this.tokens.push({capture:o});break;default:throw Error("unknown substitution type: "+o)}i=t.index+t[0].length}if(i!==e.length){const s=e.slice(i,e.length);this.tokens.push(s)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case VC.basename:return e.basename;case VC.dirname:return e.dirname;case VC.extname:return e.extname;case VC.capture:return t||""}}).join("")}}class Wh{constructor(e,t,i,s,o,r,a,c,l,d=Mx(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=s,this._parent=o,this._isDirectory=r,this._isSymbolicLink=a,this._readonly=c,this._locked=l,this._name=d,this._mtime=h,this._unknown=u,this.error=void 0,this._isExcluded=!1,this._isDirectoryResolved=!1}get isExcluded(){return this._isExcluded?!0:this._parent?this._parent.isExcluded:!1}set isExcluded(e){this._isExcluded=e}hasChildren(e){return this.hasNests?this.nestedChildren?.some(t=>e(t))??!1:this.isDirectory}get hasNests(){return!!this.nestedChildren?.length}get isDirectoryResolved(){return this._isDirectoryResolved}get isSymbolicLink(){return!!this._isSymbolicLink}get isDirectory(){return!!this._isDirectory}get isReadonly(){return this.filesConfigService.isReadonly(this.resource,{resource:this.resource,name:this.name,readonly:this._readonly,locked:this._locked})}get mtime(){return this._mtime}get name(){return this._name}get isUnknown(){return this._unknown}get parent(){return this._parent}get root(){return this._parent?this._parent.root:this}get children(){return new Map}updateName(e){this._parent?.removeChild(this),this._name=e,this._parent?.addChild(this)}getId(){return this.root.resource.toString()+"::"+this.resource.toString()}toString(){return`ExplorerItem: ${this.name}`}get isRoot(){return this===this.root}static create(e,t,i,s,o,r){const a=new Wh(s.resource,e,t,i,o,s.isDirectory,s.isSymbolicLink,s.readonly,s.locked,s.name,s.mtime,!s.isFile&&!s.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!s.children||!!r&&r.some(c=>MS(c,a.resource)),s.children))for(let c=0,l=s.children.length;c{s.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=s.get(o.resource);r?(Wh.mergeLocalWithDisk(o,r),t.addChild(r),s.delete(o.resource)):t.addChild(o)}),s.forEach(o=>{o instanceof Fhe&&t.addChild(o)})}}addChild(e){e._parent=this,e.updateResource(!1),this.children.set(this.getPlatformAwareName(e.name),e)}getChild(e){return this.children.get(this.getPlatformAwareName(e))}fetchChildren(e){const t=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting;return t.enabled&&this.nestedChildren?this.nestedChildren:(async()=>{if(!this._isDirectoryResolved){const s=e===nxe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:s}),r=Wh.create(this.fileService,this.configService,this.filesConfigService,o,this);Wh.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const s=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):s.push(a);const r=this.fileNester.nest(s.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of s){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=ws(this.children.get(d));c.nestedChildren.push(h),h.nestedParent=c}i.push(c)}else c.nestedChildren=void 0}for(const[a,c]of o.values())i.push(c)}else this.children.forEach(s=>{i.push(s)});return i})()}get fileNester(){if(!this.root._fileNester){const e=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting,t=Object.entries(e.patterns).filter(i=>typeof i[0]=="string"&&typeof i[1]=="string"&&i[0]&&i[1]).map(([i,s])=>[this.getPlatformAwareName(i.trim()),s.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new l3t(t)}return this.root._fileNester}removeChild(e){this.nestedChildren=void 0,this.children.delete(this.getPlatformAwareName(e.name))}forgetChildren(){this.children.clear(),this.nestedChildren=void 0,this._isDirectoryResolved=!1,this._fileNester=void 0}getPlatformAwareName(e){return this.fileService.hasCapability(this.resource,es.PathCaseSensitive)?e:e.toLowerCase()}move(e){this.nestedParent?.removeChild(this),this._parent?.removeChild(this),e.removeChild(this),e.addChild(this),this.updateResource(!0)}updateResource(e){this._parent&&(this.resource=qt(this._parent.resource,this.name)),e&&this.isDirectory&&this.children.forEach(t=>{t.updateResource(!0)})}rename(e){this.updateName(e.name),this._mtime=e.mtime,this.updateResource(!0)}find(e){const t=!this.fileService.hasCapability(e,es.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&Oa(this.resource.authority,e.authority)&&(t?Gq(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(IS(e.path,qi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(zht(IS(this.resource.path,qi.sep),e,i))return this;if(this.isDirectory){for(;tthis.doUpload(e,this.toTransfer(t),o,i.token),()=>i.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>s),s}toTransfer(e){if(tgt(e))return e.dataTransfer;const t={items:[]};for(const i of e)t.items.push({webkitGetAsEntry:()=>({name:i.name,isDirectory:!1,isFile:!0,createReader:()=>{throw new Error("Unsupported for files")},file:s=>s(i)})});return t}async doUpload(e,t,i,s){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new XQe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new Dve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(r.map(h=>l.queue(async()=>{if(s.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(eOe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new up(qt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(Mr,1,"Overwrite {0}",h.name),progressLabel:g(Mr,2,"Overwriting {0}",h.name)}),s.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,s);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!s.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,s,o,r){if(r.isCancellationRequested||!e.name||!e.isFile&&!e.isDirectory)return;let a=0;const c=(d,h)=>{a+=h,o.totalBytesUploaded+=h;const u=o.totalBytesUploaded/((Date.now()-o.startTime)/1e3);let f;de.file(h,u));return r.isCancellationRequested?void 0:(typeof d.stream=="function"&&d.size>vl.MB?await this.doUploadFileBuffered(l,d,c,r):await this.doUploadFileUnbuffered(l,d,c),{isFile:!0,resource:l})}else{if(await this.fileService.createFolder(l),r.isCancellationRequested)return;const d=e.createReader(),h=[];let u=!1;do{const w=await new Promise((b,C)=>d.readEntries(b,C));w.length>0?h.push(...w):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const w of h)w.isFile?p.push(w):w.isDirectory&&m.push(w);const v=new Dve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(p.map(w=>v.queue(()=>this.doUploadEntry(w,l,f,s,o,r))));for(const w of m)await this.doUploadEntry(w,l,f,s,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,s){const o=Lje({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!s.isCancellationRequested;){const l=ze.wrap(c.value);if(await o.write(l),s.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}s.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((s,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=ze.wrap(new Uint8Array(a.target.result));await this.fileService.writeFile(e,c),i(t.size,c.byteLength)}else throw new Error("Could not read from dropped file.");s()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},lX=uP,uP.MAX_PARALLEL_UPLOADS=20,uP);lne=lX=D([_(0,Cf),_(1,To),_(2,Sp),_(3,_i),_(4,ci)],lne);let vxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=s,this.dialogService=o,this.workspaceEditingService=r,this.explorerService=a,this.editorService=c,this.progressService=l,this.notificationService=d,this.instantiationService=h}async import(e,t,i){const s=new ai,o=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:!0,title:g(Mr,5,"Copying...")},async()=>await this.doImport(e,t,i,s.token),()=>s.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>o),o}async doImport(e,t,i,s){const o=Ui((await this.instantiationService.invokeFunction(l=>btt(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Ui(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(s.isCancellationRequested)return;this.hostService.focus(i);const c=a.filter(l=>l.success&&l.stat?.isDirectory).map(l=>({uri:l.stat.resource}));if(c.length>0&&e.isRoot){let l;(function(p){p[p.Copy=1]="Copy",p[p.Add=2]="Add"})(l||(l={}));const d=[{label:c.length>1?g(Mr,6,"&&Copy Folders"):g(Mr,7,"&&Copy Folder"),run:()=>l.Copy}];let h;const u=this.contextService.getWorkspace().folders.map(p=>p.uri.scheme);c.some(p=>u.indexOf(p.uri.scheme)>=0)?(d.unshift({label:c.length>1?g(Mr,8,"&&Add Folders to Workspace"):g(Mr,9,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(Mr,10,"Do you want to copy the folders or add the folders to the workspace?"):g(Mr,11,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",ui(c[0].uri))):h=c.length>1?g(Mr,12,"Are you sure to want to copy folders?"):g(Mr,13,"Are you sure to want to copy '{0}'?",ui(c[0].uri));const{result:f}=await this.dialogService.prompt({type:nt.Info,message:h,buttons:d,cancelButton:!0});if(f===l.Add)return this.workspaceEditingService.addFolders(c);if(f===l.Copy)return this.importResources(e,r,s)}else if(e instanceof Wh)return this.importResources(e,r,s)}async importResources(e,t,i){if(t&&t.length>0){const s=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,es.PathCaseSensitive);s.children&&s.children.forEach(h=>{o.add(r?h.name:h.name.toLowerCase())});let a=0;const c=Ui(await ko.settled(t.map(async h=>{if(!await this.fileService.exists(h)){a++;return}if(!(o.has(r?ui(h):ui(h).toLowerCase())&&!(await this.dialogService.confirm(eOe(ui(h)))).confirmed))return h})));a>0&&this.notificationService.error(a>1?g(Mr,14,"Some or all of the dropped files could not be accessed for import."):g(Mr,15,"The dropped file could not be accessed for import."));const l=c.map(h=>{const u=ui(h),f=qt(e.resource,u);return new up(h,f,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(Mr,16,"Import {0}",ui(c[0])):g(Mr,17,"Import {0} resources",c.length),progressLabel:c.length===1?g(Mr,18,"Copying {0}",ui(c[0])):g(Mr,19,"Copying {0} resources",c.length),progressLocation:ch.Window,confirmBeforeUndo:d===SM.Verbose||d===SM.Default}),l.length===1){const h=this.explorerService.findClosest(l[0].newResource);h&&!h.isDirectory&&this.editorService.openEditor({resource:h.resource,options:{pinned:!0}})}}}};vxe=D([_(0,ci),_(1,Id),_(2,Ti),_(3,Re),_(4,To),_(5,$S),_(6,Sp),_(7,_i),_(8,Cf),_(9,Pi),_(10,be)],vxe);var gP;let wxe=(gP=class{constructor(e,t,i,s,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=s,this.fileDialogService=o,this.storageService=r}download(e){const t=new ai,i=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:Jn,title:g(Mr,20,"Downloading")},async s=>this.doDownload(e,s,t),()=>t.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>i),i}async doDownload(e,t,i){for(const s of e){if(i.token.isCancellationRequested)return;Jn?await this.doDownloadBrowser(s.resource,t,i):await this.doDownloadNative(s,t,i)}}async doDownloadBrowser(e,t,i){const s=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*vl.MB,r=s.isDirectory||s.size>o,a=ax();if(r&&Tv.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new XQe(d=>{t.report(d[d.length-1])},1e3),filesTotal:s.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(s.isDirectory){const d=await c.getDirectoryHandle(s.name,{create:!0});await this.downloadFolderBrowser(s,d,l,i.token)}else await this.downloadFileBrowser(c,s,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(s.isFile){let c;try{c=(await this.fileService.readFile(s.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=lp.uriToBrowserUri(s.resource)}i.token.isCancellationRequested||agt(c,s.name)}}async downloadFileBufferedBrowser(e,t,i,s){const o=await this.fileService.readFileStream(e,void 0,s);if(s.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(cw(s.onCancellationRequested)(()=>{l.dispose(),a(rx())})),hO(c,{onData:d=>{t.write(d.buffer),this.reportProgress(o.name,o.size,d.byteLength,i)},onError:d=>{l.dispose(),a(d)},onEnd:()=>{l.dispose(),r()}},s)})}async downloadFileUnbufferedBrowser(e,t,i,s){const o=await this.fileService.readFile(e,void 0,s);s.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,s){i.filesDownloaded++,i.fileBytesDownloaded=0,this.reportProgress(t.name,0,0,i);const r=await(await e.getFileHandle(t.name,{create:!0})).createWritable();return t.size>vl.MB?this.downloadFileBufferedBrowser(t.resource,r,i,s):this.downloadFileUnbufferedBrowser(t.resource,r,i,s)}async downloadFolderBrowser(e,t,i,s){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(s.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,s);else{const r=await t.getDirectoryHandle(o.name,{create:!0}),a=await this.fileService.resolve(o.resource,{resolveMetadata:!0});await this.downloadFolderBrowser(a,r,i,s)}}}}reportProgress(e,t,i,s){s.fileBytesDownloaded+=i,s.totalBytesDownloaded+=i;const o=s.totalBytesDownloaded/((Date.now()-s.startTime)/1e3);let r;t1?{message:g(Mr,30,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",n.length),detail:fst(n)+` -`+g(Mr,28,"This action is irreversible!"),primaryButton:g(Mr,29,"&&Replace"),type:"warning"}:eOe(ui(n[0]))}const ro="vs/workbench/contrib/files/browser/fileActions",tOe="explorer.newFile";Be(ro,0,"New File...");const yst="explorer.newFolder";Be(ro,1,"New Folder...");g(ro,2,"Rename...");g(ro,3,"Delete");g(ro,4,"Copy");g(ro,5,"Paste");const h3t=new Y("fileCopied",!1),u3t="explorer.download";g(ro,6,"Download...");const g3t="explorer.upload";g(ro,7,"Upload...");function f3t(n,e){e.message==="string"&&(e=e.message),n.error(Ma(e,!1))}async function p3t(n,e){n&&(n.indexOf("/")>=0||n.indexOf("\\")>=0)&&await e.refresh()}async function m3t(n,e,t,i,s,o){let r=typeof s.resource=="string"?s.resource:Mx(s.resource),a=qt(i.resource,r);if(!(o==="disabled"&&!await v3t(e,t,a))){for(;!s.allowOverwrite&&n.findClosest(a);)o!=="disabled"&&(r=_3t(r,!!s.isDirectory,o)),a=qt(i.resource,r);return a}}function _3t(n,e,t){if(t==="simple"){let h=n,u="";e||(u=T_(n),h=yr(n,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const w=v?parseInt(v):1;return w===0?`${m}`:w{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${n.substr(0,c)}.1${n.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&n.match(l))return n.replace(l,(h,u)=>{const f=parseInt(u);return f{let p=parseInt(f);return isNaN(p)&&(p=0),p{const f=parseInt(u[0]);return f{const f=parseInt(u[0]);return fthis.updateEnablement(e)))}updateEnablement(e){const t=e.isDirty()||this.workingCopyService.hasDirty;this.lastDirtyState!==t&&(this.enabled=t,this.lastDirtyState=this.enabled)}async run(e){try{await this.doRun(e)}catch(t){f3t(this.notificationService,t)}}};bxe=D([_(2,Qi),_(3,Pi),_(4,Pw)],bxe);const $ce=class $ce extends bxe{get class(){return"explorer-action "+$e.asClassName(Ce.saveAll)}doRun(e){return this.commandService.executeCommand(rit,{},e)}};$ce.ID="workbench.files.action.saveAllInGroup",$ce.LABEL=g(ro,48,"Save All in Group");let j5e=$ce;var fP;let K5e=(fP=class extends xn{constructor(e,t,i){super(e,t,$e.asClassName(Ce.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(a3t,{},e)}},fP.ID="workbench.files.action.closeGroup",fP.LABEL=g(ro,49,"Close Group"),fP);K5e=D([_(2,Qi)],K5e);const nW=class nW extends pi{constructor(){super({id:nW.ID,title:nW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,51,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Nw).openPaneComposite(E5t,Sr.Sidebar,!0)}};nW.ID="workbench.files.action.focusFilesExplorer",nW.LABEL=Be(ro,50,"Focus on Files Explorer");let Y5e=nW;const sW=class sW extends pi{constructor(){super({id:sW.ID,title:sW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,53,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(Qi),i=e.get(_i),s=Qc.getOriginalUri(i.activeEditor,{supportSideBySide:go.PRIMARY});s&&t.executeCommand(NOt,s)}};sW.ID="workbench.files.action.showActiveFileInExplorer",sW.LABEL=Be(ro,52,"Reveal Active File in Explorer View");let J5e=sW;const oW=class oW extends pi{constructor(){super({id:oW.ID,title:oW.LABEL,f1:!0,category:Xa.File,precondition:iTt,metadata:{description:Be(ro,55,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(_i),i=e.get(Id),s=e.get(To),o=e.get(ci),r=Qc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):s.error(g(ro,56,"The active editor must contain an openable resource.")))}};oW.ID="workbench.action.files.showOpenedFileInNewWindow",oW.LABEL=Be(ro,54,"Open Active File in New Empty Workspace");let X5e=oW;function w3t(n,e,t,i){if(t=C3t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(ro,57,"A file or folder name must be provided."),severity:nt.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(ro,58,"A file or folder name cannot start with a slash."),severity:nt.Error};const s=Ui(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(ro,59,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:nt.Error}}if(s.some(r=>!n.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(ro,60,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",b3t(r)),severity:nt.Error}}return s.some(r=>/^\s|\s$/.test(r))?{content:g(ro,61,"Leading or trailing whitespace detected in file or folder name."),severity:nt.Warning}:null}function b3t(n){return n?.length>255?`${n.substr(0,255)}...`:n}function C3t(n){return n&&(n=jRe(n," "),n=IS(n,"/"),n=IS(n,"\\"),n)}const rW=class rW extends pi{constructor(){super({id:rW.ID,title:rW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,63,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(_i).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};rW.ID="workbench.files.action.compareNewUntitledTextFiles",rW.LABEL=Be(ro,62,"Compare New Untitled Text Files");let Z5e=rW;const mk=class mk extends pi{constructor(){super({id:mk.ID,title:mk.LABEL,f1:!0,category:Xa.File,keybinding:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyC),weight:ye.WorkbenchContrib},metadata:{description:Be(ro,65,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(_i),i=e.get(be),s=e.get(Rn),o=e.get(ci),r=Qc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),a=`clipboardCompare${mk.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===_e.untitled)){if(!this.registrationDisposal){const d=i.createInstance(Cxe);this.registrationDisposal=s.registerTextModelContentProvider(a,d)}const c=ui(r),l=g(ro,66,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{St(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){St(this.registrationDisposal),this.registrationDisposal=void 0}};mk.ID="workbench.files.action.compareWithClipboard",mk.LABEL=Be(ro,64,"Compare Active File with Clipboard"),mk.SCHEME_COUNTER=0;let e3e=mk,Cxe=class{constructor(e,t,i){this.clipboardService=e,this.languageService=t,this.modelService=i}async provideTextContent(e){const t=await this.clipboardService.readText();return this.modelService.createModel(t,this.languageService.createByFilepathOrFirstLine(e),e)}};Cxe=D([_(0,Mu),_(1,Di),_(2,Ai)],Cxe);function y3t(n,e,t){n.prompt(nt.Error,Ma(e,!1),[{label:g(ro,67,"Retry"),run:()=>t()}])}async function Sst(n,e){const t=n.get(Sp),i=n.get(ci),s=n.get(Re),o=n.get(hh),r=n.get(_i),a=n.get(q_),c=n.get(Pi),l=n.get(Sf),d=n.get(Qi),h=n.get(Lm),u=!a.isViewVisible(lC),f=await a.openView(lC,!0);if(u&&await Ta(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(HOt)}const p=t.getContext(!1),m=p.length>0?p[0]:void 0;let v;if(m?v=m.isDirectory?m:m.parent||t.roots[0]:v=t.roots[0],v.isReadonly)throw new Error("Parent folder is readonly.");const w=new Fhe(i,s,o,v,e);v.addChild(w);const b=async y=>{try{const S=qt(v.resource,y);y.endsWith("/")&&(e=!0),await t.applyBulkEdit([new up(void 0,S,{folder:e})],{undoLabel:g(ro,68,"Create {0}",y),progressLabel:g(ro,69,"Creating {0}",y),confirmBeforeUndo:!0}),await p3t(y,t),e?await t.select(S,!0):await r.openEditor({resource:S,options:{pinned:!0}})}catch(S){y3t(c,S,()=>b(y))}},C=(await l.getEnvironment())?.os??zc;await t.setEditable(w,{validationMessage:y=>w3t(h,w,y,C),onFinish:async(y,S)=>{v.removeChild(w),await t.setEditable(w,null),S&&b(y)}})}yt.registerCommand({id:tOe,handler:async n=>{await Sst(n,!1)}});yt.registerCommand({id:yst,handler:async n=>{await Sst(n,!0)}});const S3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!0),o=s.length?s:e.roots,r=i.createInstance(wxe);try{await r.download(o)}catch(a){throw t.error(a),a}};yt.registerCommand({id:u3t,handler:S3t});const A3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!1),o=s.length?s[0]:e.roots[0];try{const r=await cgt();r&&await i.createInstance(lne).upload(o,r)}catch(r){throw t.error(r),r}};yt.registerCommand({id:g3t,handler:A3t});class Ohe extends pi{constructor(e,t,i){super({id:e,title:t,f1:!0,category:Xa.File,precondition:sTt}),this.newReadonlyState=i}async run(e){const t=e.get(_i),i=e.get(hh),s=Qc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});s&&await i.updateReadonly(s,this.newReadonlyState)}}const aW=class aW extends Ohe{constructor(){super(aW.ID,aW.LABEL,!0)}};aW.ID="workbench.action.files.setActiveEditorReadonlyInSession",aW.LABEL=Be(ro,85,"Set Active Editor Read-only in Session");let t3e=aW;const cW=class cW extends Ohe{constructor(){super(cW.ID,cW.LABEL,!1)}};cW.ID="workbench.action.files.setActiveEditorWriteableInSession",cW.LABEL=Be(ro,86,"Set Active Editor Writeable in Session");let i3e=cW;const lW=class lW extends Ohe{constructor(){super(lW.ID,lW.LABEL,"toggle")}};lW.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",lW.LABEL=Be(ro,87,"Toggle Active Editor Read-only in Session");let n3e=lW;const dW=class dW extends Ohe{constructor(){super(dW.ID,dW.LABEL,"reset")}};dW.ID="workbench.action.files.resetActiveEditorReadonlyInSession",dW.LABEL=Be(ro,88,"Reset Active Editor Read-only in Session");let s3e=dW;class iOe extends ${constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in yi)try{this.broadcastChannel=new BroadcastChannel(e);const t=i=>{this._onDidReceiveData.fire(i.data)};this.broadcastChannel.addEventListener("message",t),this._register(Ee(()=>{this.broadcastChannel&&(this.broadcastChannel.removeEventListener("message",t),this.broadcastChannel.close())}))}catch(t){console.warn("Error while creating broadcast channel. Falling back to localStorage.",lg(t))}this.broadcastChannel||(this.channelName=`BroadcastDataChannel.${e}`,this.createBroadcastChannel())}createBroadcastChannel(){const e=t=>{t.key===this.channelName&&t.newValue&&this._onDidReceiveData.fire(JSON.parse(t.newValue))};yi.addEventListener("storage",e),this._register(Ee(()=>yi.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let o3e=class{constructor(e,t,i,s,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=s,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,s,o){const r=await this.instantiationService.invokeFunction(l=>btt(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Ui(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===_e.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Ui(r.filter(l=>l.isExternal&&l.resource?.scheme===_e.file).map(l=>l.resource));a.length&&this.workspacesService.addRecentlyOpened(a.map(l=>({fileUri:l})));const c=i?.();await this.editorService.openEditors(r.map(l=>({...l,resource:l.resource,options:{...l.options,...o,pinned:!0}})),c,{validateTrust:!0}),s?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async s=>{if(yde(s)){t.push({workspaceUri:s});return}try{const o=await this.fileService.stat(s);o.isDirectory&&(t.push({folderUri:o.resource}),i.push({uri:o.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):hx(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};o3e=D([_(1,ci),_(2,cL),_(3,_i),_(4,$S),_(5,Id),_(6,Ti),_(7,be)],o3e);function Ast(n,e,t,i){if(e.length===0||!t.dataTransfer)return;const s=n.get(tr),o=n.get(_i),r=n.get(ci),a=n.get(eo),c=Ui(e.map(f=>P.isUri(f)?{resource:f}:HCe(f)?P.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Is?`\r +`)}}var VC;(function(n){n.capture="capture",n.basename="basename",n.dirname="dirname",n.extname="extname"})(VC||(VC={}));const $5e=/\$[({](capture|basename|dirname|extname)[)}]/g;class G5e{constructor(e){this.tokens=[],$5e.lastIndex=0;let t,i=0;for(;t=$5e.exec(e);){const s=e.slice(i,t.index);this.tokens.push(s);const o=t[1];switch(o){case VC.basename:case VC.dirname:case VC.extname:case VC.capture:this.tokens.push({capture:o});break;default:throw Error("unknown substitution type: "+o)}i=t.index+t[0].length}if(i!==e.length){const s=e.slice(i,e.length);this.tokens.push(s)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case VC.basename:return e.basename;case VC.dirname:return e.dirname;case VC.extname:return e.extname;case VC.capture:return t||""}}).join("")}}class Wh{constructor(e,t,i,s,o,r,a,c,l,d=Mx(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=s,this._parent=o,this._isDirectory=r,this._isSymbolicLink=a,this._readonly=c,this._locked=l,this._name=d,this._mtime=h,this._unknown=u,this.error=void 0,this._isExcluded=!1,this._isDirectoryResolved=!1}get isExcluded(){return this._isExcluded?!0:this._parent?this._parent.isExcluded:!1}set isExcluded(e){this._isExcluded=e}hasChildren(e){return this.hasNests?this.nestedChildren?.some(t=>e(t))??!1:this.isDirectory}get hasNests(){return!!this.nestedChildren?.length}get isDirectoryResolved(){return this._isDirectoryResolved}get isSymbolicLink(){return!!this._isSymbolicLink}get isDirectory(){return!!this._isDirectory}get isReadonly(){return this.filesConfigService.isReadonly(this.resource,{resource:this.resource,name:this.name,readonly:this._readonly,locked:this._locked})}get mtime(){return this._mtime}get name(){return this._name}get isUnknown(){return this._unknown}get parent(){return this._parent}get root(){return this._parent?this._parent.root:this}get children(){return new Map}updateName(e){this._parent?.removeChild(this),this._name=e,this._parent?.addChild(this)}getId(){return this.root.resource.toString()+"::"+this.resource.toString()}toString(){return`ExplorerItem: ${this.name}`}get isRoot(){return this===this.root}static create(e,t,i,s,o,r){const a=new Wh(s.resource,e,t,i,o,s.isDirectory,s.isSymbolicLink,s.readonly,s.locked,s.name,s.mtime,!s.isFile&&!s.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!s.children||!!r&&r.some(c=>MS(c,a.resource)),s.children))for(let c=0,l=s.children.length;c{s.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=s.get(o.resource);r?(Wh.mergeLocalWithDisk(o,r),t.addChild(r),s.delete(o.resource)):t.addChild(o)}),s.forEach(o=>{o instanceof Fhe&&t.addChild(o)})}}addChild(e){e._parent=this,e.updateResource(!1),this.children.set(this.getPlatformAwareName(e.name),e)}getChild(e){return this.children.get(this.getPlatformAwareName(e))}fetchChildren(e){const t=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting;return t.enabled&&this.nestedChildren?this.nestedChildren:(async()=>{if(!this._isDirectoryResolved){const s=e===nxe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:s}),r=Wh.create(this.fileService,this.configService,this.filesConfigService,o,this);Wh.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const s=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):s.push(a);const r=this.fileNester.nest(s.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of s){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=ws(this.children.get(d));c.nestedChildren.push(h),h.nestedParent=c}i.push(c)}else c.nestedChildren=void 0}for(const[a,c]of o.values())i.push(c)}else this.children.forEach(s=>{i.push(s)});return i})()}get fileNester(){if(!this.root._fileNester){const e=this.configService.getValue({resource:this.root.resource}).explorer.fileNesting,t=Object.entries(e.patterns).filter(i=>typeof i[0]=="string"&&typeof i[1]=="string"&&i[0]&&i[1]).map(([i,s])=>[this.getPlatformAwareName(i.trim()),s.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new l3t(t)}return this.root._fileNester}removeChild(e){this.nestedChildren=void 0,this.children.delete(this.getPlatformAwareName(e.name))}forgetChildren(){this.children.clear(),this.nestedChildren=void 0,this._isDirectoryResolved=!1,this._fileNester=void 0}getPlatformAwareName(e){return this.fileService.hasCapability(this.resource,es.PathCaseSensitive)?e:e.toLowerCase()}move(e){this.nestedParent?.removeChild(this),this._parent?.removeChild(this),e.removeChild(this),e.addChild(this),this.updateResource(!0)}updateResource(e){this._parent&&(this.resource=Qt(this._parent.resource,this.name)),e&&this.isDirectory&&this.children.forEach(t=>{t.updateResource(!0)})}rename(e){this.updateName(e.name),this._mtime=e.mtime,this.updateResource(!0)}find(e){const t=!this.fileService.hasCapability(e,es.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&Oa(this.resource.authority,e.authority)&&(t?Gq(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(IS(e.path,Qi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(zht(IS(this.resource.path,Qi.sep),e,i))return this;if(this.isDirectory){for(;tthis.doUpload(e,this.toTransfer(t),o,i.token),()=>i.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>s),s}toTransfer(e){if(tgt(e))return e.dataTransfer;const t={items:[]};for(const i of e)t.items.push({webkitGetAsEntry:()=>({name:i.name,isDirectory:!1,isFile:!0,createReader:()=>{throw new Error("Unsupported for files")},file:s=>s(i)})});return t}async doUpload(e,t,i,s){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new XQe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new Dve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(r.map(h=>l.queue(async()=>{if(s.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(eOe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new up(Qt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(Mr,1,"Overwrite {0}",h.name),progressLabel:g(Mr,2,"Overwriting {0}",h.name)}),s.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,s);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!s.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,s,o,r){if(r.isCancellationRequested||!e.name||!e.isFile&&!e.isDirectory)return;let a=0;const c=(d,h)=>{a+=h,o.totalBytesUploaded+=h;const u=o.totalBytesUploaded/((Date.now()-o.startTime)/1e3);let f;de.file(h,u));return r.isCancellationRequested?void 0:(typeof d.stream=="function"&&d.size>vl.MB?await this.doUploadFileBuffered(l,d,c,r):await this.doUploadFileUnbuffered(l,d,c),{isFile:!0,resource:l})}else{if(await this.fileService.createFolder(l),r.isCancellationRequested)return;const d=e.createReader(),h=[];let u=!1;do{const w=await new Promise((b,C)=>d.readEntries(b,C));w.length>0?h.push(...w):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const w of h)w.isFile?p.push(w):w.isDirectory&&m.push(w);const v=new Dve(lX.MAX_PARALLEL_UPLOADS);await ko.settled(p.map(w=>v.queue(()=>this.doUploadEntry(w,l,f,s,o,r))));for(const w of m)await this.doUploadEntry(w,l,f,s,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,s){const o=Lje({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!s.isCancellationRequested;){const l=ze.wrap(c.value);if(await o.write(l),s.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}s.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((s,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=ze.wrap(new Uint8Array(a.target.result));await this.fileService.writeFile(e,c),i(t.size,c.byteLength)}else throw new Error("Could not read from dropped file.");s()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},lX=uP,uP.MAX_PARALLEL_UPLOADS=20,uP);lne=lX=D([_(0,Cf),_(1,To),_(2,Sp),_(3,_i),_(4,ci)],lne);let vxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=s,this.dialogService=o,this.workspaceEditingService=r,this.explorerService=a,this.editorService=c,this.progressService=l,this.notificationService=d,this.instantiationService=h}async import(e,t,i){const s=new ai,o=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:!0,title:g(Mr,5,"Copying...")},async()=>await this.doImport(e,t,i,s.token),()=>s.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>o),o}async doImport(e,t,i,s){const o=Ui((await this.instantiationService.invokeFunction(l=>btt(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Ui(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(s.isCancellationRequested)return;this.hostService.focus(i);const c=a.filter(l=>l.success&&l.stat?.isDirectory).map(l=>({uri:l.stat.resource}));if(c.length>0&&e.isRoot){let l;(function(p){p[p.Copy=1]="Copy",p[p.Add=2]="Add"})(l||(l={}));const d=[{label:c.length>1?g(Mr,6,"&&Copy Folders"):g(Mr,7,"&&Copy Folder"),run:()=>l.Copy}];let h;const u=this.contextService.getWorkspace().folders.map(p=>p.uri.scheme);c.some(p=>u.indexOf(p.uri.scheme)>=0)?(d.unshift({label:c.length>1?g(Mr,8,"&&Add Folders to Workspace"):g(Mr,9,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(Mr,10,"Do you want to copy the folders or add the folders to the workspace?"):g(Mr,11,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",ui(c[0].uri))):h=c.length>1?g(Mr,12,"Are you sure to want to copy folders?"):g(Mr,13,"Are you sure to want to copy '{0}'?",ui(c[0].uri));const{result:f}=await this.dialogService.prompt({type:nt.Info,message:h,buttons:d,cancelButton:!0});if(f===l.Add)return this.workspaceEditingService.addFolders(c);if(f===l.Copy)return this.importResources(e,r,s)}else if(e instanceof Wh)return this.importResources(e,r,s)}async importResources(e,t,i){if(t&&t.length>0){const s=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,es.PathCaseSensitive);s.children&&s.children.forEach(h=>{o.add(r?h.name:h.name.toLowerCase())});let a=0;const c=Ui(await ko.settled(t.map(async h=>{if(!await this.fileService.exists(h)){a++;return}if(!(o.has(r?ui(h):ui(h).toLowerCase())&&!(await this.dialogService.confirm(eOe(ui(h)))).confirmed))return h})));a>0&&this.notificationService.error(a>1?g(Mr,14,"Some or all of the dropped files could not be accessed for import."):g(Mr,15,"The dropped file could not be accessed for import."));const l=c.map(h=>{const u=ui(h),f=Qt(e.resource,u);return new up(h,f,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(Mr,16,"Import {0}",ui(c[0])):g(Mr,17,"Import {0} resources",c.length),progressLabel:c.length===1?g(Mr,18,"Copying {0}",ui(c[0])):g(Mr,19,"Copying {0} resources",c.length),progressLocation:ch.Window,confirmBeforeUndo:d===SM.Verbose||d===SM.Default}),l.length===1){const h=this.explorerService.findClosest(l[0].newResource);h&&!h.isDirectory&&this.editorService.openEditor({resource:h.resource,options:{pinned:!0}})}}}};vxe=D([_(0,ci),_(1,Id),_(2,Ti),_(3,Re),_(4,To),_(5,$S),_(6,Sp),_(7,_i),_(8,Cf),_(9,Pi),_(10,be)],vxe);var gP;let wxe=(gP=class{constructor(e,t,i,s,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=s,this.fileDialogService=o,this.storageService=r}download(e){const t=new ai,i=this.progressService.withProgress({location:ch.Window,delay:800,cancellable:Jn,title:g(Mr,20,"Downloading")},async s=>this.doDownload(e,s,t),()=>t.dispose(!0));return this.progressService.withProgress({location:lC,delay:500},()=>i),i}async doDownload(e,t,i){for(const s of e){if(i.token.isCancellationRequested)return;Jn?await this.doDownloadBrowser(s.resource,t,i):await this.doDownloadNative(s,t,i)}}async doDownloadBrowser(e,t,i){const s=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*vl.MB,r=s.isDirectory||s.size>o,a=ax();if(r&&Tv.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new XQe(d=>{t.report(d[d.length-1])},1e3),filesTotal:s.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(s.isDirectory){const d=await c.getDirectoryHandle(s.name,{create:!0});await this.downloadFolderBrowser(s,d,l,i.token)}else await this.downloadFileBrowser(c,s,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(s.isFile){let c;try{c=(await this.fileService.readFile(s.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=lp.uriToBrowserUri(s.resource)}i.token.isCancellationRequested||agt(c,s.name)}}async downloadFileBufferedBrowser(e,t,i,s){const o=await this.fileService.readFileStream(e,void 0,s);if(s.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(cw(s.onCancellationRequested)(()=>{l.dispose(),a(rx())})),hO(c,{onData:d=>{t.write(d.buffer),this.reportProgress(o.name,o.size,d.byteLength,i)},onError:d=>{l.dispose(),a(d)},onEnd:()=>{l.dispose(),r()}},s)})}async downloadFileUnbufferedBrowser(e,t,i,s){const o=await this.fileService.readFile(e,void 0,s);s.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,s){i.filesDownloaded++,i.fileBytesDownloaded=0,this.reportProgress(t.name,0,0,i);const r=await(await e.getFileHandle(t.name,{create:!0})).createWritable();return t.size>vl.MB?this.downloadFileBufferedBrowser(t.resource,r,i,s):this.downloadFileUnbufferedBrowser(t.resource,r,i,s)}async downloadFolderBrowser(e,t,i,s){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(s.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,s);else{const r=await t.getDirectoryHandle(o.name,{create:!0}),a=await this.fileService.resolve(o.resource,{resolveMetadata:!0});await this.downloadFolderBrowser(a,r,i,s)}}}}reportProgress(e,t,i,s){s.fileBytesDownloaded+=i,s.totalBytesDownloaded+=i;const o=s.totalBytesDownloaded/((Date.now()-s.startTime)/1e3);let r;t1?{message:g(Mr,30,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",n.length),detail:fst(n)+` +`+g(Mr,28,"This action is irreversible!"),primaryButton:g(Mr,29,"&&Replace"),type:"warning"}:eOe(ui(n[0]))}const ro="vs/workbench/contrib/files/browser/fileActions",tOe="explorer.newFile";Be(ro,0,"New File...");const yst="explorer.newFolder";Be(ro,1,"New Folder...");g(ro,2,"Rename...");g(ro,3,"Delete");g(ro,4,"Copy");g(ro,5,"Paste");const h3t=new Y("fileCopied",!1),u3t="explorer.download";g(ro,6,"Download...");const g3t="explorer.upload";g(ro,7,"Upload...");function f3t(n,e){e.message==="string"&&(e=e.message),n.error(Ma(e,!1))}async function p3t(n,e){n&&(n.indexOf("/")>=0||n.indexOf("\\")>=0)&&await e.refresh()}async function m3t(n,e,t,i,s,o){let r=typeof s.resource=="string"?s.resource:Mx(s.resource),a=Qt(i.resource,r);if(!(o==="disabled"&&!await v3t(e,t,a))){for(;!s.allowOverwrite&&n.findClosest(a);)o!=="disabled"&&(r=_3t(r,!!s.isDirectory,o)),a=Qt(i.resource,r);return a}}function _3t(n,e,t){if(t==="simple"){let h=n,u="";e||(u=T_(n),h=yr(n,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const w=v?parseInt(v):1;return w===0?`${m}`:w{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${n.substr(0,c)}.1${n.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&n.match(l))return n.replace(l,(h,u)=>{const f=parseInt(u);return f{let p=parseInt(f);return isNaN(p)&&(p=0),p{const f=parseInt(u[0]);return f{const f=parseInt(u[0]);return fthis.updateEnablement(e)))}updateEnablement(e){const t=e.isDirty()||this.workingCopyService.hasDirty;this.lastDirtyState!==t&&(this.enabled=t,this.lastDirtyState=this.enabled)}async run(e){try{await this.doRun(e)}catch(t){f3t(this.notificationService,t)}}};bxe=D([_(2,ji),_(3,Pi),_(4,Pw)],bxe);const $ce=class $ce extends bxe{get class(){return"explorer-action "+$e.asClassName(Ce.saveAll)}doRun(e){return this.commandService.executeCommand(rit,{},e)}};$ce.ID="workbench.files.action.saveAllInGroup",$ce.LABEL=g(ro,48,"Save All in Group");let j5e=$ce;var fP;let K5e=(fP=class extends xn{constructor(e,t,i){super(e,t,$e.asClassName(Ce.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(a3t,{},e)}},fP.ID="workbench.files.action.closeGroup",fP.LABEL=g(ro,49,"Close Group"),fP);K5e=D([_(2,ji)],K5e);const nW=class nW extends pi{constructor(){super({id:nW.ID,title:nW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,51,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Nw).openPaneComposite(E5t,Sr.Sidebar,!0)}};nW.ID="workbench.files.action.focusFilesExplorer",nW.LABEL=Be(ro,50,"Focus on Files Explorer");let Y5e=nW;const sW=class sW extends pi{constructor(){super({id:sW.ID,title:sW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,53,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(ji),i=e.get(_i),s=jc.getOriginalUri(i.activeEditor,{supportSideBySide:go.PRIMARY});s&&t.executeCommand(NOt,s)}};sW.ID="workbench.files.action.showActiveFileInExplorer",sW.LABEL=Be(ro,52,"Reveal Active File in Explorer View");let J5e=sW;const oW=class oW extends pi{constructor(){super({id:oW.ID,title:oW.LABEL,f1:!0,category:Xa.File,precondition:iTt,metadata:{description:Be(ro,55,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(_i),i=e.get(Id),s=e.get(To),o=e.get(ci),r=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):s.error(g(ro,56,"The active editor must contain an openable resource.")))}};oW.ID="workbench.action.files.showOpenedFileInNewWindow",oW.LABEL=Be(ro,54,"Open Active File in New Empty Workspace");let X5e=oW;function w3t(n,e,t,i){if(t=C3t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(ro,57,"A file or folder name must be provided."),severity:nt.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(ro,58,"A file or folder name cannot start with a slash."),severity:nt.Error};const s=Ui(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(ro,59,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:nt.Error}}if(s.some(r=>!n.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(ro,60,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",b3t(r)),severity:nt.Error}}return s.some(r=>/^\s|\s$/.test(r))?{content:g(ro,61,"Leading or trailing whitespace detected in file or folder name."),severity:nt.Warning}:null}function b3t(n){return n?.length>255?`${n.substr(0,255)}...`:n}function C3t(n){return n&&(n=jRe(n," "),n=IS(n,"/"),n=IS(n,"\\"),n)}const rW=class rW extends pi{constructor(){super({id:rW.ID,title:rW.LABEL,f1:!0,category:Xa.File,metadata:{description:Be(ro,63,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(_i).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};rW.ID="workbench.files.action.compareNewUntitledTextFiles",rW.LABEL=Be(ro,62,"Compare New Untitled Text Files");let Z5e=rW;const mk=class mk extends pi{constructor(){super({id:mk.ID,title:mk.LABEL,f1:!0,category:Xa.File,keybinding:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyC),weight:ye.WorkbenchContrib},metadata:{description:Be(ro,65,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(_i),i=e.get(be),s=e.get(Rn),o=e.get(ci),r=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY}),a=`clipboardCompare${mk.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===_e.untitled)){if(!this.registrationDisposal){const d=i.createInstance(Cxe);this.registrationDisposal=s.registerTextModelContentProvider(a,d)}const c=ui(r),l=g(ro,66,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{St(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){St(this.registrationDisposal),this.registrationDisposal=void 0}};mk.ID="workbench.files.action.compareWithClipboard",mk.LABEL=Be(ro,64,"Compare Active File with Clipboard"),mk.SCHEME_COUNTER=0;let e3e=mk,Cxe=class{constructor(e,t,i){this.clipboardService=e,this.languageService=t,this.modelService=i}async provideTextContent(e){const t=await this.clipboardService.readText();return this.modelService.createModel(t,this.languageService.createByFilepathOrFirstLine(e),e)}};Cxe=D([_(0,Mu),_(1,Di),_(2,Ai)],Cxe);function y3t(n,e,t){n.prompt(nt.Error,Ma(e,!1),[{label:g(ro,67,"Retry"),run:()=>t()}])}async function Sst(n,e){const t=n.get(Sp),i=n.get(ci),s=n.get(Re),o=n.get(hh),r=n.get(_i),a=n.get(q_),c=n.get(Pi),l=n.get(Sf),d=n.get(ji),h=n.get(Lm),u=!a.isViewVisible(lC),f=await a.openView(lC,!0);if(u&&await Ta(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(HOt)}const p=t.getContext(!1),m=p.length>0?p[0]:void 0;let v;if(m?v=m.isDirectory?m:m.parent||t.roots[0]:v=t.roots[0],v.isReadonly)throw new Error("Parent folder is readonly.");const w=new Fhe(i,s,o,v,e);v.addChild(w);const b=async y=>{try{const S=Qt(v.resource,y);y.endsWith("/")&&(e=!0),await t.applyBulkEdit([new up(void 0,S,{folder:e})],{undoLabel:g(ro,68,"Create {0}",y),progressLabel:g(ro,69,"Creating {0}",y),confirmBeforeUndo:!0}),await p3t(y,t),e?await t.select(S,!0):await r.openEditor({resource:S,options:{pinned:!0}})}catch(S){y3t(c,S,()=>b(y))}},C=(await l.getEnvironment())?.os??$c;await t.setEditable(w,{validationMessage:y=>w3t(h,w,y,C),onFinish:async(y,S)=>{v.removeChild(w),await t.setEditable(w,null),S&&b(y)}})}yt.registerCommand({id:tOe,handler:async n=>{await Sst(n,!1)}});yt.registerCommand({id:yst,handler:async n=>{await Sst(n,!0)}});const S3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!0),o=s.length?s:e.roots,r=i.createInstance(wxe);try{await r.download(o)}catch(a){throw t.error(a),a}};yt.registerCommand({id:u3t,handler:S3t});const A3t=async n=>{const e=n.get(Sp),t=n.get(Pi),i=n.get(be),s=e.getContext(!1),o=s.length?s[0]:e.roots[0];try{const r=await cgt();r&&await i.createInstance(lne).upload(o,r)}catch(r){throw t.error(r),r}};yt.registerCommand({id:g3t,handler:A3t});class Ohe extends pi{constructor(e,t,i){super({id:e,title:t,f1:!0,category:Xa.File,precondition:sTt}),this.newReadonlyState=i}async run(e){const t=e.get(_i),i=e.get(hh),s=jc.getOriginalUri(t.activeEditor,{supportSideBySide:go.PRIMARY});s&&await i.updateReadonly(s,this.newReadonlyState)}}const aW=class aW extends Ohe{constructor(){super(aW.ID,aW.LABEL,!0)}};aW.ID="workbench.action.files.setActiveEditorReadonlyInSession",aW.LABEL=Be(ro,85,"Set Active Editor Read-only in Session");let t3e=aW;const cW=class cW extends Ohe{constructor(){super(cW.ID,cW.LABEL,!1)}};cW.ID="workbench.action.files.setActiveEditorWriteableInSession",cW.LABEL=Be(ro,86,"Set Active Editor Writeable in Session");let i3e=cW;const lW=class lW extends Ohe{constructor(){super(lW.ID,lW.LABEL,"toggle")}};lW.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",lW.LABEL=Be(ro,87,"Toggle Active Editor Read-only in Session");let n3e=lW;const dW=class dW extends Ohe{constructor(){super(dW.ID,dW.LABEL,"reset")}};dW.ID="workbench.action.files.resetActiveEditorReadonlyInSession",dW.LABEL=Be(ro,88,"Reset Active Editor Read-only in Session");let s3e=dW;class iOe extends ${constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in yi)try{this.broadcastChannel=new BroadcastChannel(e);const t=i=>{this._onDidReceiveData.fire(i.data)};this.broadcastChannel.addEventListener("message",t),this._register(Ee(()=>{this.broadcastChannel&&(this.broadcastChannel.removeEventListener("message",t),this.broadcastChannel.close())}))}catch(t){console.warn("Error while creating broadcast channel. Falling back to localStorage.",lg(t))}this.broadcastChannel||(this.channelName=`BroadcastDataChannel.${e}`,this.createBroadcastChannel())}createBroadcastChannel(){const e=t=>{t.key===this.channelName&&t.newValue&&this._onDidReceiveData.fire(JSON.parse(t.newValue))};yi.addEventListener("storage",e),this._register(Ee(()=>yi.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let o3e=class{constructor(e,t,i,s,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=s,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,s,o){const r=await this.instantiationService.invokeFunction(l=>btt(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Ui(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===_e.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Ui(r.filter(l=>l.isExternal&&l.resource?.scheme===_e.file).map(l=>l.resource));a.length&&this.workspacesService.addRecentlyOpened(a.map(l=>({fileUri:l})));const c=i?.();await this.editorService.openEditors(r.map(l=>({...l,resource:l.resource,options:{...l.options,...o,pinned:!0}})),c,{validateTrust:!0}),s?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async s=>{if(yde(s)){t.push({workspaceUri:s});return}try{const o=await this.fileService.stat(s);o.isDirectory&&(t.push({folderUri:o.resource}),i.push({uri:o.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):hx(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};o3e=D([_(1,ci),_(2,cL),_(3,_i),_(4,$S),_(5,Id),_(6,Ti),_(7,be)],o3e);function Ast(n,e,t,i){if(e.length===0||!t.dataTransfer)return;const s=n.get(tr),o=n.get(_i),r=n.get(ci),a=n.get(eo),c=Ui(e.map(f=>P.isUri(f)?{resource:f}:HCe(f)?P.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Is?`\r `:` -`;t.dataTransfer.setData(gm.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=lp.uriToFileUri(p.resource);m.scheme===_e.file&&t.dataTransfer.setData(gm.DOWNLOAD_URL,[Js.binary,ui(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(gm.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=it.as(nFe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(HCe(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Qc.getCanonicalUri(m)})}else if(P.isUri(f)){const{selection:m,uri:v}=TNe(f);p={resource:v,options:m?{selection:m}:void 0}}else f.isDirectory||(p={resource:f.resource});if(p){{const m=p.resource;if(m){const v=s.files.get(m);v&&(typeof p.languageId!="string"&&(p.languageId=v.getLanguageId()),typeof p.encoding!="string"&&(p.encoding=v.getEncoding()),typeof p.contents!="string"&&v.isDirty()&&!v.textEditorModel.isTooLargeForHeapOperation()&&(p.contents=v.textEditorModel.getValue())),p.options?.viewState||(p.options={...p.options,viewState:(()=>{for(const w of o.visibleEditorPanes)if(_n(w.input.resource,m)){const b=w.getViewState();if(b)return b}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(bF.EDITORS,uJe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):Gv(p)?p.modified.resource&&f.push(p.modified.resource):LE(p)?p.primary.resource&&f.push(p.primary.resource):Wb(p)&&f.push(p.result.resource);t.dataTransfer.setData(Js.uriList,R1.create(f.slice(0,1))),t.dataTransfer.setData(gm.INTERNAL_URI_LIST,R1.create(f))}}class E3t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class T5{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class R5{constructor(e){this.viewId=e}get id(){return this.viewId}}class lE extends ${static get INSTANCE(){return lE.instance||(lE.instance=new lE,xU(lE.instance)),lE.instance}constructor(){super(),this.transferData=Ote.getInstance(),this.onDragStart=this._register(new I),this.onDragEnd=this._register(new I),this._register(this.onDragEnd.event(e=>{const t=e.dragAndDropData.getData().id,i=e.dragAndDropData.getData().type;this.readDragData(i)?.getData().id===t&&this.transferData.clearData(i==="view"?R5.prototype:T5.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?R5.prototype:T5.prototype)){const t=this.transferData.getData(e==="view"?R5.prototype:T5.prototype);if(t&&t[0])return new E3t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new R5(e):new T5(e)],t==="view"?R5.prototype:T5.prototype)}registerTarget(e,t){const i=new Z;return i.add(new yZ(e,{onDragEnter:s=>{if(s.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:s,dragAndDropData:o})}},onDragLeave:s=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:s,dragAndDropData:o})},onDrop:s=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:s,dragAndDropData:o}),this.onDragEnd.fire({eventData:s,dragAndDropData:o})}},onDragOver:s=>{if(s.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:s,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(s=>{t.onDragStart(s)},this,i),t.onDragEnd&&this.onDragEnd.event(s=>{t.onDragEnd(s)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const s=new Z;return s.add(new yZ(e,{onDragStart:o=>{const{id:r,type:a}=t();this.writeDragData(r,a),o.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:o,dragAndDropData:this.readDragData(a)})},onDragEnd:o=>{const{type:r}=t(),a=this.readDragData(r);a&&this.onDragEnd.fire({eventData:o,dragAndDropData:a})},onDragEnter:o=>{if(i.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;r&&i.onDragEnter({eventData:o,dragAndDropData:r})}},onDragLeave:o=>{const r=this.readDragData("composite")||this.readDragData("view");r&&i.onDragLeave?.({eventData:o,dragAndDropData:r})},onDrop:o=>{if(i.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDrop({eventData:o,dragAndDropData:r}),this.onDragEnd.fire({eventData:o,dragAndDropData:r})}},onDragOver:o=>{if(i.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDragOver({eventData:o,dragAndDropData:r})}}})),i.onDragStart&&this.onDragStart.event(o=>{i.onDragStart(o)},this,s),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,s),this._register(s)}}function r3e(n,e,t){n&&(n.dropEffect=t?e:"none")}let a3e=class{constructor(e,t){this.toResource=e,this.instantiationService=t}getDragURI(e){const t=this.toResource(e);return t?t.toString():null}getDragLabel(e){const t=Ui(e.map(this.toResource));return t.length===1?ui(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const s of e.elements){const o=this.toResource(s);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(s=>Ast(s,i,t))}onDragOver(e,t,i,s,o){return!1}drop(e,t,i,s,o){}dispose(){}};a3e=D([_(1,be)],a3e);const Gce=class Gce extends ${constructor(){super(),this.broadcaster=this._register(new iOe(Gce.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(T.runAndSubscribe(Vb,({window:e,disposables:t})=>{t.add(pe(e,xe.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(pe(e,xe.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:yi,disposables:this._store})),this._register(this.broadcaster.onDidReceiveData(e=>{e===!0?this.markDraggedOver(!0):this.clearDraggedOver(!0)}))}get isDraggedOver(){return this.draggedOver}markDraggedOver(e){this.draggedOver!==!0&&(this.draggedOver=!0,e||this.broadcaster.postData(!0))}clearDraggedOver(e){this.draggedOver!==!1&&(this.draggedOver=!1,e||this.broadcaster.postData(!1))}};Gce.CHANNEL_NAME="monaco-workbench-global-dragged-over";let yxe=Gce;new yxe;class x3t{constructor(e,t,i){if(this.location=t,this.parent=i,t[t.length-1]==="\\")throw Error("Unexpected path format, do not use trailing backslashes");t[t.length-1]!=="/"&&(t+="/"),this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}updateContents(e){this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}isPathIncludedInTraversal(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);return!this.isPathIgnored(e,t)}isArbitraryPathIgnored(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);const i=e.split("/").filter(r=>r);let s=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of s)o[r]=!0;return _w(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const s=e.split(` -`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=s.filter(m=>!m.endsWith("/")),r=o.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(r,t,!0),c=o.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),l=this.gitignoreLinesToExpression(c,t,!1),d=s.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=s.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),f=this.gitignoreLinesToExpression(u,t,!1);return(m,v)=>m.startsWith(t)?v&&h(m)&&!f(m)||a(m)&&!l(m)?!0:i?i.isPathIgnored(m,v):!1:!1}gitignoreLineToGlob(e,t){const i=e.indexOf("/");return i===-1||i===e.length-1?e="**/"+e:(i===0?t.slice(-1)==="/"&&(e=e.slice(1)):t.slice(-1)!=="/"&&(e="/"+e),e=t+e),e}}var Sxe;(function(n){n.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(Sxe||(Sxe={}));class D3t{constructor(){this._onDidRegisterDescriptor=new I,this.onDidRegisterDescriptor=this._onDidRegisterDescriptor.event,this.descriptors=[]}register(e){this.descriptors.push(e),this._onDidRegisterDescriptor.fire(e)}create(e,t,i){return this.descriptors.map(s=>{const o=s.create(e,t);return i.add(o),o})}}const Axe=new D3t;it.add(Sxe.FileContributionRegistry,Axe);var Exe,Qw;const Fp="vs/workbench/contrib/files/browser/views/explorerViewer",qce=class qce{getHeight(e){return qce.ITEM_HEIGHT}getTemplateId(e){return une.ID}};qce.ITEM_HEIGHT=22;let dne=qce;const xxe=new I;let Dxe=class{constructor(e,t,i,s,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=s,this.layoutService=o,this.fileService=r,this.explorerService=a,this.contextService=c,this.filesConfigService=l}hasChildren(e){return Array.isArray(e)||e.hasChildren(t=>this.fileFilter.filter(t,so.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,s=e.fetchChildren(i);if(Array.isArray(s))return s;const o=s.then(r=>(e instanceof Wh&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==Nn.FOLDER&&xxe.fire(e.resource),r),r=>{if(e instanceof Wh&&e.isRoot)if(this.contextService.getWorkbenchState()===Nn.FOLDER){const a=new Wh(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else xxe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};Dxe=D([_(1,Cf),_(2,Re),_(3,Pi),_(4,kO),_(5,ci),_(6,Sp),_(7,Ti),_(8,hh)],Dxe);const kBe=class kBe{get index(){return this._index}get count(){return this.items.length}get current(){return this.items[this._index]}get currentId(){return`${this.id}_${this.index}`}get labels(){return this._labels}constructor(e,t,i,s,o){this.id=e,this.items=t,this.depth=s,this.collapsed=o,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._index=t.length-1,this.updateLabels(i),this._updateLabelDisposable=i.label.onDidRender(()=>this.updateLabels(i))}updateLabels(e){this._labels=Array.from(e.container.querySelectorAll(".label-name"));let t="";for(let i=0;i=this.items.length-1||this.setIndex(this._index+1)}first(){this._index!==0&&this.setIndex(0)}last(){this._index!==this.items.length-1&&this.setIndex(this.items.length-1)}setIndex(e){e<0||e>=this.items.length||(this.labels[this._index].classList.remove("active"),this._index=e,this.labels[this._index].classList.add("active"),this._onDidChange.fire())}updateCollapsed(e){this.collapsed=e;for(let t=0;t{const f=this.configurationService.getValue("workbench.tree.indent"),p=Math.max(22-f,0);e.style.setProperty("--vscode-explorer-align-offset-margin-left",`${p}px`)};this.configListener=this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("explorer")&&(this.config=this.configurationService.getValue()),f.affectsConfiguration("workbench.tree.indent")&&u()}),u()}getWidgetAriaLabel(){return g(Fp,0,"Files Explorer")}get templateId(){return Exe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{o.currentContext&&this.updateWidth(o.currentContext)}catch{}}));const s=Axe.create(this.instantiationService,e,t);t.add(Axe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);s.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:s};return o}renderElement(e,t,i){const s=e.element;i.currentContext=s;const o=this.explorerService.getEditableData(s);i.label.element.classList.remove("compressed"),o?(i.label.element.style.display="none",i.contribs.forEach(r=>r.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,s,o))):(i.label.element.style.display="flex",this.renderStat(s,s.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,s){const o=e.element.elements[e.element.elements.length-1];i.currentContext=o;const r=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=r.length===0?void 0:this.explorerService.getEditableData(r[0]);if(a)i.label.element.classList.remove("compressed"),i.label.element.style.display="none",i.contribs.forEach(c=>c.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,r[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${hne.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new hne(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(o)??[];this.compressedNavigationControllers.set(o,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(pe(i.container,"mousedown",u=>{const f=gne(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(o)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(o):u.splice(f,1)}))}}renderStat(e,t,i,s,o){o.label.element.style.display="flex";const r=["explorer-item"];this.explorerService.isCut(e)&&r.push("cut");const a=this.themeService.getFileIconTheme();o.container.parentElement?.parentElement?.querySelector(".monaco-tl-twistie")?.classList.toggle("force-twistie",e.hasNests&&a.hidesExplorerArrows);const l=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),d=e.nestedParent&&l;o.contribs.forEach(h=>h.setResource(e.resource)),o.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?Ic.ROOT_FOLDER:e.isDirectory?Ic.FOLDER:Ic.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:Cz(s),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const s=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?Ic.ROOT_FOLDER:t.isDirectory?Ic.FOLDER:Ic.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:r,extraClasses:l?[...o,"align-nest-icon-with-parent-icon"]:o},h=t.name?ma(t.resource):t.resource,u=t.name||"";s.setFile(qt(h,u||" "),d),s.element.firstElementChild.style.display="none";const f=new fXe(s.element,this.contextViewService,{validationOptions:{validation:C=>{const y=i.validationMessage(C);return!y||y.severity!==nt.Error?null:{content:y.content,formatContent:!0,type:Yd.ERROR}}},ariaLabel:g(Fp,1,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:eV}),p=u.lastIndexOf(".");let m="prefix";f.value=u,f.focus(),f.select({start:0,end:p>0&&!t.isDirectory?p:u.length});const v=cw((C,y)=>{s.element.style.display="none";const S=f.value;St(b),s.element.remove(),y&&i.onFinish(S,C)}),w=()=>{if(f.isInputValid()){const C=i.validationMessage(f.value);C?f.showMessage({content:C.content,formatContent:!0,type:C.severity===nt.Info?Yd.INFO:C.severity===nt.Warning?Yd.WARNING:Yd.ERROR}):f.hideMessage()}};w();const b=[f,f.onDidChange(C=>{s.setFile(qt(h,C||" "),d)}),Xo(f.inputElement,xe.KEY_DOWN,C=>{if(C.equals(E.F2)){const y=f.value.lastIndexOf(".");if(t.isDirectory||y===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:y+1,end:f.value.length})):(m="prefix",f.select({start:0,end:y}))}else C.equals(E.Enter)?f.validate()||v(!0,!0):C.equals(E.Escape)&&v(!1,!0)}),Xo(f.inputElement,xe.KEY_UP,C=>{w()}),pe(f.inputElement,xe.BLUR,async()=>{for(;;){await Ta(0);const C=f.inputElement.ownerDocument;if(!C.hasFocus())break;if(kw(f.inputElement))return;if(Ra(C.activeElement)&&GY(C.activeElement,"context-view"))await T.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),s];return Ee(()=>{v(!1,!1)})}disposeElement(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeCompressedElements(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}getCompressedNavigationController(e){return this.compressedNavigationControllers.get(e)}getAriaLabel(e){return e.name}getAriaLevel(e){let t=0,i=e.parent;for(;i;)i=i.parent,t++;return this.contextService.getWorkbenchState()===Nn.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},Exe=pP,pP.ID="file",pP);une=Exe=D([_(3,W_),_(4,pn),_(5,Re),_(6,Sp),_(7,eo),_(8,Ti),_(9,Vr),_(10,be)],une);let kxe=class{constructor(e,t,i,s,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=s,this.uriIdentityService=o,this.fileService=r,this.hiddenExpressionPerRoot=new Map,this.editorsAffectingFilter=new Set,this._onDidChange=new I,this.toDispose=[],this.ignoreFileResourcesPerRoot=new Map,this.ignoreTreesPerRoot=new Map,this.toDispose.push(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateConfiguration())),this.toDispose.push(this.configurationService.onDidChangeConfiguration(a=>{(a.affectsConfiguration("files.exclude")||a.affectsConfiguration("explorer.excludeGitIgnore"))&&this.updateConfiguration()})),this.toDispose.push(this.fileService.onDidFilesChange(a=>{for(const[c,l]of this.ignoreFileResourcesPerRoot.entries())l.forEach(async d=>{a.contains(d,Ko.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,Ko.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(ma(d)),l.delete(d),this._onDidChange.fire())})})),this.toDispose.push(this.editorService.onDidVisibleEditorsChange(()=>{const a=this.editorService.visibleEditors;let c=!1;for(const l of a){if(!l.resource)continue;const d=this.explorerService.findClosest(l.resource);if(d&&d.isExcluded){c=!0;break}}for(const l of this.editorsAffectingFilter)if(!a.includes(l)){c=!0;break}c&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())})),this.updateConfiguration()}get onDidChange(){return this._onDidChange.event}updateConfiguration(){let e=!1,t=!1;this.contextService.getWorkspace().folders.forEach(i=>{const s=this.configurationService.getValue({resource:i.uri}),o=s?.files?.exclude||Object.create(null),r=s.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new o1),this.ignoreTreesPerRoot.set(i.uri.toString(),Su.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!r&&this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.delete(i.uri.toString()),this.ignoreTreesPerRoot.delete(i.uri.toString())),!e){const c=this.hiddenExpressionPerRoot.get(i.uri.toString());e=!c||!Io(c.original,o)}const a=Vs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:_w(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const s=ma(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(s))return;const r=await this.fileService.readFile(t);if(i)o.get(s)?.updateContents(r.value.toString());else{const a=o.findSubstr(s),c=new x3t(r.value.toString(),s.path,a);o.set(s,c),this.ignoreFileResourcesPerRoot.get(e)?.has(t)||this.ignoreFileResourcesPerRoot.get(e)?.add(t)}this._onDidChange.fire()}filter(e,t){return e.name===".gitignore"&&this.ignoreTreesPerRoot.has(e.root.resource.toString())?(this.processIgnoreFile(e.root.resource.toString(),e.resource,!1),!0):this.isVisible(e,t)}isVisible(e,t){if(e.isExcluded=!1,t===so.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const s=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(LU(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(s?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||s||e.parent?.isExcluded){e.isExcluded=!0;const l=this.editorService.visibleEditors.find(d=>d.resource&&this.uriIdentityService.extUri.isEqualOrParent(d.resource,e.resource));return l&&e.root===this.explorerService.findClosestRoot(e.resource)?(this.editorsAffectingFilter.add(l),!0):!1}return!0}dispose(){St(this.toDispose)}};kxe=D([_(0,Ti),_(1,Re),_(2,Sp),_(3,_i),_(4,_o),_(5,ci)],kxe);let Ixe=class{constructor(e,t){this.explorerService=e,this.contextService=t}compare(e,t){if(e.isRoot){if(t.isRoot){const a=this.contextService.getWorkspaceFolder(e.resource),c=this.contextService.getWorkspaceFolder(t.resource);return a&&c?a.index-c.index:-1}return-1}if(t.isRoot)return 1;const i=this.explorerService.sortOrderConfiguration.sortOrder,s=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(s){case"upper":o=jIt,r=XIt;break;case"lower":o=KIt,r=ZIt;break;case"unicode":o=YIt,r=e0t;break;default:o=QIt,r=JIt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return o(e.name,t.name);break;case"filesFirst":if(e.isDirectory&&!t.isDirectory)return 1;if(t.isDirectory&&!e.isDirectory)return-1;break;case"foldersNestsFiles":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.hasNests&&!t.hasNests)return-1;if(t.hasNests&&!e.hasNests)return 1;break;case"mixed":break;default:if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;break}switch(i){case"type":return r(e.name,t.name);case"modified":return e.mtime!==t.mtime?e.mtime&&t.mtime&&e.mtime{(!u||u.affectsConfiguration("explorer.enableDragAndDrop"))&&(this.dropEnabled=this.configurationService.getValue("explorer.enableDragAndDrop"))};h(void 0),this.disposables.add(this.configurationService.onDidChangeConfiguration(u=>h(u)))}onDragOver(e,t,i,s,o){if(!this.dropEnabled)return!1;if(t){const r=Qw.getCompressedStatFromDragEvent(t,o);if(r){const a=gne(o.target);if(a&&a.index{a.element.classList.remove("drop-target"),this.compressedDragOverElement=void 0}),a.element.classList.add("drop-target")),typeof c=="boolean"?c:{...c,feedback:[]}):(this.compressedDropTargetDisposable.dispose(),!1)}}}return this.compressedDropTargetDisposable.dispose(),this.handleDragOver(e,t,i,s,o)}handleDragOver(e,t,i,s,o){const r=o&&(o.ctrlKey&&!ei||o.altKey&&ei),a=e instanceof gbe,l={type:a||r?_R.Copy:_R.Move,position:iS.Over};if(a){if(!Ctt(o,gm.FILES,bF.FILES,gm.RESOURCES))return!1}else{if(e instanceof NJe)return!1;{const d=Qw.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!r&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:_R.Move,position:iS.After}}:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!r&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!r&&this.uriIdentityService.extUri.isEqual(ma(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(s){case AA.TOP:case AA.CENTER_TOP:u=iS.Before;break;case AA.CENTER_BOTTOM:case AA.BOTTOM:u=iS.After;break}return{accept:!0,effect:{type:_R.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:CR.Up,effect:l}}else return{accept:!0,bubble:CR.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Qw.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Qw.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>Ast(o,i,t));const s=i.filter(o=>o.resource.scheme===_e.file).map(o=>o.resource.fsPath);s.length&&t.dataTransfer.setData(bF.FILES,JSON.stringify(s))}}async drop(e,t,i,s,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=Qw.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],s=AA.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof gbe?!Jn||hx(this.contextService.getWorkspace())&&Tv.supported(yi)?await this.instantiationService.createInstance(vxe).import(r,o,yi):await this.instantiationService.createInstance(lne).upload(t,o):await this.handleExplorerDrop(e,r,i,s,o)}catch(a){this.dialogService.error(Ma(a))}}async handleExplorerDrop(e,t,i,s,o){const r=Qw.getStatsFromDragAndDropData(e),a=new Map(r.map(u=>[u,this.isCollapsed(u)]));for(const[u,f]of a)if(f){const p=u.nestedChildren;if(p)for(const m of p)a.set(m,!0)}const c=Kht([...a.keys()],u=>u.resource),l=o.ctrlKey&&!ei||o.altKey&&ei;if(!l&&this.configurationService.getValue(Qw.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(Fp,2,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(Fp,3,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(Fp,4,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(Fp,5,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?fst(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(Fp,6,"Do not ask me again")},primaryButton:g(Fp,7,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(Qw.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,s);const h=c.filter(u=>!u.isRoot);return l?this.doHandleExplorerDropOnCopy(h,t):this.doHandleExplorerDropOnMove(h,t)}async doHandleRootDrop(e,t,i){if(e.length===0)return;const s=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==s[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case AA.BOTTOM:case AA.CENTER_BOTTOM:o++;break}for(const l of r)l{const c=a.newResource?this.explorerService.findClosest(a.newResource):void 0;return c&&!c.isDirectory}).map(a=>({resource:a.newResource,options:{pinned:!0}}));await this.editorService.openEditors(r)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(r=>!r.isReadonly).map(r=>new up(r.resource,qt(t.resource,r.name))),s=c3e(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===SM.Verbose,undoLabel:g(Fp,10,"Move {0}",s),progressLabel:g(Fp,11,"Moving {0}",s)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Xi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=d3t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new up(d.oldResource,d.newResource,{overwrite:!0})),o)}else throw r}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Qw.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=gt(t).document.elementFromPoint(t.clientX,t.clientY),s=gne(i);if(s){const{count:o,index:r}=s;let a=o-1;for(;a>r&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Qw=mP,mP.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",mP);Lxe=Qw=D([_(1,Sp),_(2,_i),_(3,To),_(4,Ti),_(5,ci),_(6,Re),_(7,be),_(8,$S),_(9,_o)],Lxe);function gne(n){if(!Ra(n))return null;let e=n;for(;e&&!e.classList.contains("monaco-list-row");){if(e.classList.contains("label-name")&&e.hasAttribute("data-icon-label-count")){const t=Number(e.getAttribute("data-icon-label-count")),i=Number(e.getAttribute("data-icon-label-index"));if(jc(t)&&jc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function k3t(n){return!!gne(n)}class I3t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Fhe||!e.parent||e.parent.isRoot}}function c3e(n){return n.length===1?n[0].name:n.every(e=>e.isDirectory)?g(Fp,12,"{0} folders",n.length):n.every(e=>!e.isDirectory)?g(Fp,13,"{0} files",n.length):`${n.length} files and folders`}const hX="vs/workbench/contrib/files/browser/views/explorerDecorationsProvider";function L3t(n){if(n.isRoot&&n.error)return{tooltip:g(hX,0,"Unable to resolve workspace folder ({0})",Ma(n.error)),letter:"!",color:__t};if(n.isSymbolicLink)return{tooltip:g(hX,1,"Symbolic Link"),letter:"⤷"};if(n.isUnknown)return{tooltip:g(hX,2,"Unknown File Type"),letter:"?"};if(n.isExcluded)return{color:y_t}}let Txe=class{constructor(e,t){this.explorerService=e,this.label=g(hX,3,"Explorer"),this._onDidChange=new I,this.toDispose=new Z,this.toDispose.add(this._onDidChange),this.toDispose.add(t.onDidChangeWorkspaceFolders(i=>{this._onDidChange.fire(i.changed.concat(i.added).map(s=>s.uri))})),this.toDispose.add(xxe.event(i=>{this._onDidChange.fire([i])}))}get onDidChange(){return this._onDidChange.event}async provideDecorations(e){const t=this.explorerService.findClosest(e);if(!t)throw new Error("ExplorerItem not found");return L3t(t)}dispose(){this.toDispose.dispose()}};Txe=D([_(0,Sp),_(1,Ti)],Txe);var uX;const NF="vs/workbench/contrib/files/browser/views/explorerView";function T3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t)){for(const[,i]of t.children.entries())if(n.hasNode(i)&&n.isCollapsible(i)&&!n.isCollapsed(i))return!0}return!1}function R3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t))return!0;return!1}const M3t={getId:n=>n instanceof Fhe?`new:${n.getId()}`:n.getId()};function N3t(n,e,t,i){let s;s=n.length?n[0]:void 0,t&&e.length>1&&(s=void 0);const o=s&&i.getCompressedNavigationController(s),r=o&&o.length?o[0]:void 0;s=r?r.current:s;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&s&&d===r){c===s&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return s?t&&a.indexOf(s)>=0?a:[s]:t?a:[]}var _P;let QV=(_P=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F){super(e,d,t,u,h,i,s,F,m,v,w),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=b,this.storageService=C,this.clipboardService=y,this.fileService=S,this.uriIdentityService=M,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=s.createInstance(O7),this._register(this.resourceContext),this.folderContext=x5t.bindTo(h),this.readonlyContext=cst.bindTo(h),this.availableEditorIdsContext=D5t.bindTo(h),this.rootContext=k5t.bindTo(h),this.resourceMoveableToTrash=L5t.bindTo(h),this.compressedFocusContext=T5t.bindTo(h),this.compressedFocusFirstContext=R5t.bindTo(h),this.compressedFocusLastContext=M5t.bindTo(h),this.viewHasSomeCollapsibleRootItem=N5t.bindTo(h),this.viewVisibleContextKey=JFe.bindTo(h),this.explorerService.registerView(this)}get autoReveal(){return this._autoReveal}set autoReveal(e){this._autoReveal=e}get name(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get title(){return this.name}set title(e){}setVisible(e){this.viewVisibleContextKey.set(e),super.setVisible(e)}get fileCopiedContextKey(){return h3t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return I5t.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new pxt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(NF,0,"Explorer Section: {0}",this.name),t.setAttribute("aria-label",this.ariaHeaderLabel)};this._register(this.contextService.onDidChangeWorkspaceName(i)),this._register(this.labelService.onDidChangeFormatters(i)),i()}layoutBody(e,t){super.layoutBody(e,t),this.tree.layout(e,t)}renderBody(e){super.renderBody(e),this.container=e,this.treeContainer=he(e,we(".explorer-folders-view")),this.createTree(this.treeContainer),this._register(this.labelService.onDidChangeFormatters(()=>{this._onDidChangeTitleArea.fire()})),this.onConfigurationUpdated(void 0),this._register(this.editorService.onDidActiveEditorChange(()=>{this.selectActiveFile()})),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationUpdated(t))),this._register(this.onDidChangeBodyVisibility(async t=>{t&&(await this.setTreeInput(),this.updateAnyCollapsedContext(),this.selectActiveFile(!0))})),this._register(pe(gt(this.container),xe.PASTE,async t=>{!this.hasFocus()||this.readonlyContext.get()||t.clipboardData?.files?.length&&await this.commandService.executeCommand("filesExplorer.paste",t.clipboardData?.files)}))}focus(){if(super.focus(),this.tree.domFocus(),this.tree.getFocusedPart()===aV.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return cMe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===aV.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return N3t(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,so.Visible):!1}isItemCollapsed(e){return this.tree.isCollapsed(e)}async setEditable(e,t){t?(this.horizontalScrolling=this.tree.options.horizontalScrolling,this.horizontalScrolling&&this.tree.updateOptions({horizontalScrolling:!1}),await this.tree.expand(e.parent)):(this.horizontalScrolling!==void 0&&this.tree.updateOptions({horizontalScrolling:this.horizontalScrolling}),this.horizontalScrolling=void 0,this.treeContainer.classList.remove("highlight")),await this.refresh(!1,e.parent,!1),t?(this.treeContainer.classList.add("highlight"),this.tree.reveal(e)):this.tree.domFocus()}async selectActiveFile(e=this._autoReveal){if(this._autoReveal){const t=Qc.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:go.PRIMARY});if(t){const i=this.tree.getFocus(),s=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&s.length===1&&this.uriIdentityService.extUri.isEqual(s[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(kxe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(une,e,t,i),this._register(this.renderer),this._register(nOe(e,this.themeService));const s=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(Fee,"FileExplorer",e,new dne,new I3t,[this.renderer],this.instantiationService.createInstance(Dxe,this.filter),{compressionEnabled:s(),accessibilityProvider:this.renderer,identityProvider:M3t,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>{if(!this.explorerService.isEditable(a))return a.name},getCompressedNodeKeyboardNavigationLabel:a=>{if(!a.some(c=>this.explorerService.isEditable(c)))return a.map(c=>c.name).join("/")}},multipleSelectionSupport:!0,filter:this.filter,sorter:this.instantiationService.createInstance(Ixe),dnd:this.instantiationService.createInstance(Lxe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof Wh&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof Wh){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:dne.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=T.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:s()}))),dst.bindTo(this.tree.contextKeyService),hst.bindTo(this.tree.contextKeyService),this._register(this.tree.onDidChangeFocus(a=>this.onFocusChanged(a.elements))),this.onFocusChanged([]),this._register(this.tree.onDidOpen(async a=>{const c=a.element;if(!c)return;if(!(Sv(a.browserEvent)&&a.browserEvent.shiftKey)){if(c.isDirectory||this.explorerService.isEditable(void 0))return;this.telemetryService.publicLog2("workbenchActionExecuted",{id:"workbench.files.openFile",from:"explorer"});try{this.delegate?.willOpenElement(a.browserEvent),await this.editorService.openEditor({resource:c.resource,options:{preserveFocus:a.editorOptions.preserveFocus,pinned:a.editorOptions.pinned,source:C7.USER}},a.sideBySide?Cw:wx)}finally{this.delegate?.didOpenElement()}}})),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidScroll(async a=>{const c=this.explorerService.getEditable();a.scrollTopChanged&&c&&this.tree.getRelativeTop(c.stat)===null&&await c.data.onFinish("",!1)})),this._register(this.tree.onDidChangeCollapseState(a=>{const c=a.node.element?.element;c&&this.renderer.getCompressedNavigationController(c instanceof Array?c[0]:c)?.forEach(d=>d.updateCollapsed(a.node.collapsed)),this.updateAnyCollapsedContext()})),this.updateAnyCollapsedContext(),this._register(this.tree.onMouseDblClick(a=>{const c=this.configurationService.getValue("workbench.list.scrollByPage");a.element===null&&!c&&this.commandService.executeCommand(tOe)})),this._register(this.storageService.onWillSaveState(()=>{this.storeTreeViewState()}))}onConfigurationUpdated(e){if(!e||e.affectsConfiguration("explorer.autoReveal")){const t=this.configurationService.getValue();this._autoReveal=t?.explorer?.autoReveal}e&&(e.affectsConfiguration("explorer.decorations.colors")||e.affectsConfiguration("explorer.decorations.badges"))&&this.refresh(!0)}storeTreeViewState(){this.storageService.store(uX.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),ke.WORKSPACE,ln.MACHINE)}setContextKeys(e){const t=this.contextService.getWorkspace().folders,i=e?e.resource:t[t.length-1].uri;if(e=e||this.explorerService.findClosest(i),this.resourceContext.set(i),this.folderContext.set(!!e&&e.isDirectory),this.readonlyContext.set(!!e&&!!e.isReadonly),this.rootContext.set(!!e&&e.isRoot),i){const s=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(s.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(ux(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Ra(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(Sv(e.browserEvent)||k3t(e.browserEvent.target)?i=a[0].labels[a[0].index]:a.forEach(c=>c.last()))}this.fileCopiedContextKey.set(await this.clipboardService.hasResources()),this.setContextKeys(t);const s=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof Wh){const a=this.renderer.getCompressedNavigationController(t);r=a&&a.length?a[0].current.resource:t.resource}else r=o.length===1?o[0].resource:{};this.contextMenuService.showContextMenu({menuId:Te.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&s&&s.indexOf(t)>=0?s.map(a=>a.resource):t instanceof Wh?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const s=this.configurationService.getValue().files.enableTrash,o=this.fileService.hasCapability(t.resource,es.Trash);this.resourceMoveableToTrash.set(s&&o)}else this.resourceMoveableToTrash.reset();const i=t&&this.renderer.getCompressedNavigationController(t);if(!i){this.compressedFocusContext.set(!1);return}this.compressedFocusContext.set(!0),i.forEach(s=>{this.updateCompressedNavigationContextKeys(s)})}refresh(e,t,i=!0){if(!this.tree||!this.isBodyVisible()||t&&!this.tree.hasNode(t))return Promise.resolve(void 0);i&&this.explorerService.isEditable(void 0)&&this.tree.domFocus();const s=t||this.tree.getInput();return this.tree.updateChildren(s,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return zut(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&vs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==Nn.FOLDER||t[0].error)&&(i=t);let s;if(this.tree&&this.tree.getInput())s=this.tree.getViewState();else{const a=this.storageService.get(uX.TREE_VIEW_STATE_STORAGE_KEY,ke.WORKSPACE);a&&(s=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,s).then(async()=>{if(Array.isArray(i)){if(!s||o instanceof Wh)for(let a=0;a{}),Array.isArray(o)){const a=new wi;o.forEach(c=>a.set(c.resource,!0)),await Promise.all(i.map(async c=>{if(!a.has(c.resource))try{await this.tree.expand(c)}catch{}}))}}e&&vs("code/didResolveExplorer")});this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new Txe(this.explorerService,this.contextService),this._register(this.decorationService.registerDecorationsProvider(this.decorationsProvider)))}async selectResource(e,t=this._autoReveal,i=0){if(i===2||!e||!this.isBodyVisible())return;this.setTreeInputPromise&&await this.setTreeInputPromise;let s=this.explorerService.findClosestRoot(e);for(;s&&s.resource.toString()!==e.toString();){try{await this.tree.expand(s)}catch{return this.selectResource(e,t,i+1)}if(!s.children.size)s=null;else for(const o of s.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){s=o;break}s=null}}if(s){if(s===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{s.nestedParent&&await this.tree.expand(s.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(s)===null&&this.tree.reveal(s,.5),this.tree.setFocus([s]),this.tree.setSelection([s])}catch{return this.selectResource(e,t,i+1)}}}itemsCopied(e,t,i){this.fileCopiedContextKey.set(e.length>0),this.resourceCutContextKey.set(t&&e.length>0),i?.forEach(s=>this.tree.rerender(s)),t&&e.forEach(s=>this.tree.rerender(s))}expandAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus(),this.tree.expandAll()}collapseAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus();const e=this.tree.getInput();if(Array.isArray(e)&&T3t(this.tree,e)){e.forEach(t=>{t.children.forEach(i=>this.tree.hasNode(i)&&this.tree.collapse(i,!0))});return}this.tree.collapseAll()}previousCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.previous(),this.updateCompressedNavigationContextKeys(i)})}nextCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.next(),this.updateCompressedNavigationContextKeys(i)})}firstCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.first(),this.updateCompressedNavigationContextKeys(i)})}lastCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.last(),this.updateCompressedNavigationContextKeys(i)})}updateCompressedNavigationContextKeys(e){this.compressedFocusFirstContext.set(e.index===0),this.compressedFocusLastContext.set(e.index===e.count-1)}updateAnyCollapsedContext(){const e=this.tree.getInput();if(e===void 0)return;const t=Array.isArray(e)?e:Array.from(e.children.values());this.viewHasSomeCollapsibleRootItem.set(R3t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},uX=_P,_P.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",_P);QV.__decorator=D([ii],QV.prototype,"fileCopiedContextKey",null);QV.__decorator=D([ii],QV.prototype,"resourceCutContextKey",null);QV=uX=D([_(1,Vr),_(2,z_),_(3,be),_(4,Ti),_(5,Cf),_(6,_i),_(7,Pz),_(8,kO),_(9,ti),_(10,Pe),_(11,Re),_(12,rD),_(13,eo),_(14,pn),_(15,on),_(16,Zc),_(17,Sp),_(18,sn),_(19,Mu),_(20,ci),_(21,_o),_(22,Qi),_(23,fr)],QV);function nOe(n,e){n.classList.add("file-icon-themable-tree"),n.classList.add("show-file-icons");const t=i=>{n.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),n.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends pi{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(NF,1,"New File..."),f1:!1,icon:Ce.newFile,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:10}})}run(n){n.get(Qi).executeCommand(tOe)}});At(class extends pi{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(NF,2,"New Folder..."),f1:!1,icon:Ce.newFolder,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:20}})}run(n){n.get(Qi).executeCommand(yst)}});At(class extends pi{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Be(NF,3,"Refresh Explorer"),f1:!0,icon:Ce.refresh,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:30},metadata:{description:Be(NF,4,"Forces a refresh of the Explorer.")}})}async run(n){const e=n.get(q_),t=n.get(Sp);await e.openView(lC),await t.refresh()}});At(class extends pi{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Be(NF,5,"Collapse Folders in Explorer"),f1:!0,icon:Ce.collapseAll,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:40},metadata:{description:Be(NF,6,"Folds all folders in the Explorer.")}})}run(n){const t=n.get(q_).getViewWithId(lC);t!==null&&t.collapseAll()}});const P3t=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let Rxe=class extends vw{constructor(e,t,i,s){super(e??{},t,i),this.trustedDomainService=s}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:P3t}};const s=e&&e.supportHtml?{...e,value:`${e.value}`}:e;return super.render(s,t,i)}};Rxe=D([_(1,Di),_(2,fr),_(3,lhe)],Rxe);var Mxe,Nxe;const Vm="vs/workbench/contrib/chat/browser/chatListRenderer",Pl=we;var vP;let fne=(vP=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(),this.location=t,this.rendererOptions=i,this.delegate=s,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.openerService=d,this.contextKeyService=h,this.themeService=u,this.commandService=f,this.textModelService=p,this.modelService=m,this.hoverService=v,this.chatService=w,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new wi,this.fileTreesByResponseId=new Map,this.focusedFileTreesByResponseId=new Map,this._onDidClickFollowup=this._register(new I),this.onDidClickFollowup=this._onDidClickFollowup.event,this._onDidClickRerunWithAgentOrCommandDetection=new I,this.onDidClickRerunWithAgentOrCommandDetection=this._onDidClickRerunWithAgentOrCommandDetection.event,this._onDidChangeItemHeight=this._register(new I),this.onDidChangeItemHeight=this._onDidChangeItemHeight.event,this._currentLayoutWidth=0,this._isVisible=!0,this._onDidChangeVisibility=this._register(new I),this._usedReferencesEnabled=!1,this.renderer=this._register(this.instantiationService.createInstance(Rxe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(ixe),this._editorPool=this._register(this.instantiationService.createInstance(Fxe,e,s,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(Oxe,e,s,r)),this._treePool=this._register(this.instantiationService.createInstance(Bxe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(Wxe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(EEe)),this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0,this._register(c.onDidChangeConfiguration(b=>{b.affectsConfiguration("chat.experimental.usedReferences")&&(this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0)}))}get templateId(){return Mxe.ID}editorsInUse(){return this._editorPool.inUse()}traceLayout(e,t){this.logService.trace(`ChatListItemRenderer#${e}: ${t}`)}getProgressiveRenderRate(e){if(e.isComplete)return 80;if(e.contentUpdateTimings&&e.contentUpdateTimings.impliedWordLoadRate){const o=e.contentUpdateTimings.impliedWordLoadRate*1.5;return Dc(o,12,80)}return 8}getCodeBlockInfosForResponse(e){return this.codeBlocksByResponseId.get(e.id)??[]}getCodeBlockInfoForEditor(e){return this.codeBlocksByEditorUri.get(e)}getFileTreeInfosForResponse(e){return this.fileTreesByResponseId.get(e.id)??[]}getLastFocusedFileTreeForResponse(e){const t=this.fileTreesByResponseId.get(e.id),i=this.focusedFileTreesByResponseId.get(e.id);if(t?.length&&i!==void 0&&iy.actions.length<=1},actionViewItemProvider:(y,S)=>y instanceof id&&(y.item.id==="workbench.action.chat.voteDown"||y.item.id==="workbench.action.chat.voteUp")?p.createInstance(O3t,y,S):yO(p,y,S)}));const v=t.add(this.instantiationService.createInstance(ene)),w=()=>{if(As(C.currentElement)&&C.currentElement.agent)return v.setAgent(C.currentElement.agent.id),v.domNode},b=ast(()=>As(C.currentElement)?C.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupUpdatableHover(va("element"),o,w,b)),t.add(pe(o,xe.KEY_DOWN,y=>{const S=new os(y);if(S.equals(E.Space)||S.equals(E.Enter)){const M=w();M&&this.hoverService.showHover({content:M,target:o,trapFocus:!0,actions:b.actions},!0)}else S.equals(E.Escape)&&this.hoverService.hideHover()}));const C={avatarContainer:r,username:a,detail:l,referencesListContainer:d,value:h,rowContainer:i,elementDisposables:u,titleToolbar:m,templateDisposables:t,contextKeyService:f,agentHover:v};return C}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const s=ip(e)?"request":As(e)?"response":"welcome";this.traceLayout("renderElement",`${s}, index=${t}`),QPt.bindTo(i.contextKeyService).set(As(e)),jPt.bindTo(i.contextKeyService).set(ip(e)),GPt.bindTo(i.contextKeyService).set(As(e)&&e.agentOrSlashCommandDetected),As(e)?(qPt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),A4e.bindTo(i.contextKeyService).set(e.vote===zV.Up?"up":e.vote===zV.Down?"down":"")):A4e.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(As(e)&&e.errorDetails?.responseIsFiltered);if(htt.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",ip(e)),i.rowContainer.classList.toggle("interactive-response",As(e)),i.rowContainer.classList.toggle("interactive-welcome",XW(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",As(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Yo(i.detail),As(e)&&this.renderDetail(e,i),As(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${s}, index=${t}`);const r=i.elementDisposables.add(new Z),a=i.elementDisposables.add(new sQ),c=l=>{try{this.doNextProgressiveRender(e,t,i,!!l,r)&&a.cancel()}catch(d){throw a.cancel(),d}};a.cancelAndSet(c,50,gt(i.rowContainer)),c(!0)}else if(As(e)){const r=Oze(e.response.value);this.basicRenderElement(r,e,t,i)}else if(ip(e)){const r="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);this.basicRenderElement([{content:new Xt(r),kind:"markdownContent"}],e,t,i)}else this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(Ni(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Yo(t.detail),e.slashCommand&&e.agentOrSlashCommandDetected){let i="";const s=`${O1}${e.slashCommand.name}`;e.isComplete?i=g(Vm,0,"used {0} [[(rerun without)]]",s):i=g(Vm,1,"using {0}",s),_a(t.detail,pNe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:o=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=rzt)}renderAvatar(e,t){const i=As(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??Ce.account;if(i instanceof P){const s=we("img.icon");s.src=lp.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(we(".avatar",void 0,s))}else{const s=we($e.asCSSSelector(i));t.avatarContainer.replaceChildren(we(".avatar.codicon-avatar",void 0,s))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===sf.DARK?e.iconDark:e?.icon?e.icon:Ce.copilot}basicRenderElement(e,t,i,s){const o=As(t)&&(!t.isComplete||t.isCanceled||t.errorDetails?.responseIsFiltered||t.errorDetails?.responseIsIncomplete);Yo(s.value),Yo(s.referencesListContainer),As(t)&&this.renderDetail(t,s),this.renderContentReferencesIfNeeded(t,s,s.elementDisposables);let r=0,a=0;if(e.forEach((d,h)=>{const u=d.kind==="treeData"?this.renderTreeData(d.treeData,t,s,r++):d.kind==="markdownContent"?this.renderMarkdown(d.content,t,s,o,a):d.kind==="progressMessage"&&JK(e,h)?this.renderProgressMessage(d,!1):d.kind==="progressTask"?this.renderProgressTask(d,!1,t,s):d.kind==="command"?this.renderCommandButton(t,d):d.kind==="textEditGroup"?this.renderTextEdit(t,d,s):d.kind==="warning"?this.renderNotification("warning",d.content):d.kind==="confirmation"?this.renderConfirmation(t,d,s):void 0;u&&(s.value.appendChild(u.element),s.elementDisposables.add(u),"codeBlockCount"in u&&(a+=u.codeBlockCount))}),As(t)&&t.errorDetails?.message){const d=this.renderNotification(t.errorDetails.responseIsFiltered?"info":"error",new Xt(t.errorDetails.message));s.elementDisposables.add(d),s.value.appendChild(d.element)}const c=s.rowContainer.offsetHeight,l=!t.currentRenderedHeight||t.currentRenderedHeight!==c;if(t.currentRenderedHeight=c,l){const d=s.elementDisposables.add(xd(gt(s.value),()=>{t.currentRenderedHeight=s.rowContainer.offsetHeight,d.dispose(),this._onDidChangeItemHeight.fire({element:t,height:t.currentRenderedHeight})}))}}updateItemHeight(e){if(!e.currentElement)return;const t=e.rowContainer.offsetHeight;e.currentElement.currentRenderedHeight=t,this._onDidChangeItemHeight.fire({element:e.currentElement,height:t})}renderWelcomeMessage(e,t){Yo(t.value),Yo(t.referencesListContainer),Jl(t.referencesListContainer);for(const o of e.content)if(Array.isArray(o)){const r=this.instantiationService.createChild(new Dl([Pe,t.contextKeyService]));t.elementDisposables.add(r.createInstance($ie,t.value,o,this.location,void 0,a=>this._onDidClickFollowup.fire(a)))}else{const r=this.renderMarkdown(o,e,t);t.value.appendChild(r.element),t.elementDisposables.add(r)}const i=t.rowContainer.offsetHeight,s=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,s){const o=t.elementDisposables.add(xd(gt(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,s,o){if(!this._isVisible)return!0;const r=Oze(e.response.value);let a=!1;if(e.isCanceled)this.traceLayout("runProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(r,e,t,i),a=!0;else{e.renderData??={renderedParts:[]};const l=e.renderData.renderedParts,d=[],h=[];let u=!1;if(r.forEach((f,p)=>{const m=l[p];if(m){if((f.kind==="markdownContent"||f.kind==="progressMessage")&&Q3t(m)){const v=this.getDataForProgressiveRender(e,l3e(f.content),m);v!==void 0&&m.renderedWordCount!==v?.actualWordCount?(this.traceLayout("doNextProgressiveRender",`Rendering changed part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v):!m.isFullyRendered&&!v&&(u=!0)}else if(f.kind==="progressMessage"&&Uxe(m)&&(m.isAtEndOfResponse!==JK(r,p)||m.isLast!==(p===r.length-1)))h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="progressTask"&&d3e(m)){const v=f.isSettled?.()??!0;(m.isSettled!==v||f.progress.length!==m.progressLength||v)&&(h[p]={task:f,isSettled:v,progressLength:f.progress.length})}}else if(f.kind==="treeData")h[p]=f.treeData;else if(f.kind==="progressMessage")h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="command"||f.kind==="textEditGroup"||f.kind==="confirmation"||f.kind==="warning")h[p]=f;else if(f.kind==="progressTask")h[p]={task:f,isSettled:f.isSettled?.()??!0,progressLength:f.progress.length};else{const v=this.getDataForProgressiveRender(e,l3e(f.content),{renderedWordCount:0,lastRenderTime:0});v!==void 0&&(this.traceLayout("doNextProgressiveRender",`Rendering new part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v)}}),a=h.filter(f=>!("isSettled"in f)||!f.isSettled).length===0&&!u,a&&e.isComplete)this.traceLayout("runProgressiveRender",`end progressive render, index=${t} and clearing renderData, response is complete, index=${t}`),e.renderData=void 0,o.clear(),this.basicRenderElement(r,e,t,i);else{if(a)return!1;{o.clear(),this.renderContentReferencesIfNeeded(e,i,o);let f=!1;h.forEach((p,m)=>{if(!p)return;let v;if(U3t(p))v=this.renderTreeData(p,e,i,m);else if(Uxe(p))j3t(h,m)?v=this.renderProgressMessage(p.progressMessage,m===h.length-1):v=null;else if(d3e(p))v=this.renderProgressTask(p.task,!p.isSettled,e,i);else if($3t(p))v=this.renderCommandButton(e,p);else if(G3t(p))v=this.renderTextEdit(e,p,i);else if(q3t(p))v=this.renderConfirmation(e,p,i);else if(z3t(p))v=this.renderNotification("warning",p.content);else if(!f&&d[m]){const{value:b}=d[m],C=h[m],y="originalMarkdown"in C?C.originalMarkdown:void 0,S=new Xt(b,y);v=this.renderMarkdown(S,e,i,!0),f=!0}if(v===void 0)return;l[m]=p;const w=i.value.children[m];w?v===null?i.value.replaceChild(Pl("span.placeholder-for-deleted-thing"),w):i.value.replaceChild(v.element,w):v&&i.value.appendChild(v.element),v&&o.add(v)})}}}const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,s||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),a}renderTreeData(e,t,i,s){const o=new Z,r=o.add(this._treePool.get()),a=r.object;if(o.add(a.onDidOpen(c=>{c.element&&!("children"in c.element)&&this.openerService.open(c.element.uri)})),o.add(a.onDidChangeCollapseState(()=>{this.updateItemHeight(i)})),o.add(a.onContextMenu(c=>{c.browserEvent.preventDefault(),c.browserEvent.stopPropagation()})),a.setInput(e).then(()=>{r.isStale()||(a.layout(),this.updateItemHeight(i))}),As(t)){const c={treeDataId:e.uri.toString(),treeIndex:s,focus(){a.domFocus()}};o.add(a.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(t.id,c.treeIndex)}));const l=this.fileTreesByResponseId.get(t.id)??[];l.push(c),this.fileTreesByResponseId.set(t.id,Lc(l,d=>d.treeDataId)),o.add(Ee(()=>this.fileTreesByResponseId.set(t.id,l.filter(d=>d.treeDataId!==e.uri.toString()))))}return{element:a.getHTMLElement().parentElement,dispose:()=>{o.dispose()}}}renderContentReferencesIfNeeded(e,t,i){if(As(e)&&this._usedReferencesEnabled&&e.contentReferences.length){Oh(t.referencesListContainer);const s=this.renderContentReferencesListData(null,e.contentReferences,e,t);t.referencesListContainer.firstChild?t.referencesListContainer.replaceChild(s.element,t.referencesListContainer.firstChild):t.referencesListContainer.appendChild(s.element),i.add(s)}else Jl(t.referencesListContainer)}renderContentReferencesListData(e,t,i,s){const o=new Z,r=e?.content.value??(t.length>1?g(Vm,2,"Used {0} references",t.length):g(Vm,3,"Used {0} reference",1)),a=Pl(".chat-used-context-icon"),c=w=>w.usedReferencesExpanded?Ce.chevronDown:Ce.chevronRight;a.classList.add(...$e.asClassNameArray(c(i)));const l=Pl(".chat-used-context-label",void 0),d=o.add(new Tu(l,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0})),h=Pl(".chat-used-context",void 0,l);d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),o.add(d.onDidClick(()=>{a.classList.remove(...$e.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...$e.asClassNameArray(c(i))),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this.updateItemHeight(s),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const f=o.add(this._contentReferencesListPool.get()).object;h.appendChild(f.getHTMLElement().parentElement),o.add(f.onDidOpen(w=>{if(w.element&&"reference"in w.element){const b="variableName"in w.element.reference?w.element.reference.value:w.element.reference,C=P.isUri(b)?b:b?.uri;C&&this.openerService.open(C,{fromUserGesture:!0,editorOptions:{...w.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),o.add(f.onContextMenu(w=>{w.browserEvent.preventDefault(),w.browserEvent.stopPropagation()}));const v=Math.min(t.length,6)*22;return f.layout(v),f.getHTMLElement().style.height=`${v}px`,f.splice(0,f.length,t),{element:h,dispose:()=>{o.dispose()}}}updateAriaLabel(e,t,i){e.ariaLabel=i?g(Vm,4,"{0}, expanded",t):g(Vm,5,"{0}, collapsed",t)}renderProgressTask(e,t,i,s){if(As(i)){if(e.progress.length){const o=this.renderContentReferencesListData(e,e.progress,i,s),r=we(".chat-progress-task");return r.appendChild(o.element),{element:r,dispose:o.dispose}}return this.renderProgressMessage(e,t)}}renderProgressMessage(e,t){t&&sa(e.content.value);const i=t?$e.modify(Ce.loading,"spin").id:Ce.check.id,s=new Xt(`$(${i}) ${e.content.value}`,{supportThemeIcons:!0}),o=this.renderer.render(s);return o.element.classList.add("progress-step"),o}renderCommandButton(e,t){const i=Pl(".chat-command-button"),s=new Z,o=!As(e)||!e.isStale,r=o?t.command.tooltip:g(Vm,6,"Button not available in restored chat"),a=s.add(new Tu(i,{...yQ,supportIcons:!0,title:r}));return a.label=t.command.title,a.enabled=o,s.add(a.onDidClick(()=>this.commandService.executeCommand(t.command.id,...t.command.arguments??[]))),{dispose(){s.dispose()},element:i}}renderNotification(e,t){const i=Pl(".chat-notification-widget");let s,o;switch(e){case"warning":s=Ce.warning,o=".chat-warning-codicon";break;case"error":s=Ce.error,o=".chat-error-codicon";break;case"info":s=Ce.info,o=".chat-info-codicon";break}i.appendChild(Pl(o,void 0,OS(s)));const r=this.renderer.render(t);return i.appendChild(r.element),{element:i,dispose(){r.dispose()}}}renderConfirmation(e,t,i){const s=new Z,o=s.add(this.instantiationService.createInstance(txe,t.title,t.message,[{label:g(Vm,7,"Accept"),data:t.data},{label:g(Vm,8,"Dismiss"),data:t.data,isSecondary:!0}]));return o.setShowButtons(!t.isUsed),s.add(o.onDidClick(async r=>{if(As(e)){const a=`${r.label}: "${t.title}"`,c=r.isSecondary?{rejectedConfirmationData:[r.data]}:{acceptedConfirmationData:[r.data]};c.agentId=e.agent?.id,await this.chatService.sendRequest(e.sessionId,a,c)&&(t.isUsed=!0,o.setShowButtons(!1),this.updateItemHeight(i))}})),{element:o.domNode,dispose(){s.dispose()}}}renderTextEdit(e,t,i){if(this.rendererOptions.renderTextEditsAsSummary?.(t.uri))return As(e)&&e.response.value.every(l=>l.kind==="textEditGroup")?{element:Pl(".interactive-edits-summary",void 0,e.isComplete?g(Vm,10,"Made changes."):g(Vm,9,"Making changes...")),dispose(){}}:void 0;const s=new Z,o=new ai;let r=!1;s.add(Ee(()=>{r=!0,o.dispose(!0)}));const a=this._diffEditorPool.get();s.add(a.object.onDidChangeContentHeight(()=>{a.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)}));const c={element:e,edit:t,diffData:(async()=>{const l=await this.textModelService.createModelReference(t.uri);if(r){l.dispose();return}s.add(l);const d=l.object.textEditorModel;let h="";if(t.state)h=t.state.sha1;else{const m=new tV;m.canComputeSHA1(d)&&(h=m.computeSHA1(d),t.state={sha1:h,applied:0})}const u=this.modelService.createModel(fQ(d.createSnapshot()),{languageId:d.getLanguageId(),onDidChange:T.None},P.from({scheme:_e.vscodeChatCodeBlock,path:d.uri.path,query:Dr()}),!1),f=await this.textModelService.createModelReference(u.uri);s.add(f);const p=[];if(As(e)){const m=this.chatService.getSession(e.sessionId);for(const v of m.getRequests())if(v.response){for(const w of v.response.response.value)if(!(w.kind!=="textEditGroup"||w.state?.applied||!_n(w.uri,t.uri)))for(const b of w.edits){const C=b.map(iMe.asEditOperation);p.push(C)}if(v.response===e.model)break}}for(const m of p)u.pushEditOperations(null,m,()=>null);return{modified:u,original:d,originalSha1:h}})()};return a.object.render(c,this._currentLayoutWidth,o.token),{element:a.object.element,dispose(){s.dispose(),a.dispose()}}}renderMarkdown(e,t,i,s=!1,o=0){const r=new Z,a=[],c=[];let l=o;const d=this.renderer.render(e,{fillInIncompleteTokens:s,codeBlockRendererSync:(h,u)=>{const f=l++;let p,m,v;if(Oa(h,e5t))try{const C=t5t(u);m=C.range&&O.lift(C.range),p=this.textModelService.createModelReference(C.uri).then(y=>y.object)}catch{return Pl("div")}else{if(!ip(t)&&!As(t))return console.error("Trying to render code block in welcome",t.id,f),Pl("div");const C=As(t)||ip(t)?t.sessionId:"",y=this.codeBlockModelCollection.getOrCreate(C,t,f);v=y.vulns,p=y.model}const w=As(t)&&t.errorDetails?.responseIsFiltered,b=this.renderCodeBlock({languageId:h,textModel:p,codeBlockIndex:f,element:t,range:m,hideToolbar:w,parentContextKeyService:i.contextKeyService,vulns:v},u);if(r.add(b.object.onDidChangeContentHeight(()=>{b.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),As(t)){const C={codeBlockIndex:f,element:t,focus(){b.object.focus()}};if(c.push(C),b.object.uri){const y=b.object.uri;this.codeBlocksByEditorUri.set(y,C),r.add(Ee(()=>this.codeBlocksByEditorUri.delete(y)))}}return a.push(b),b.object.element},asyncRenderCallback:()=>this.updateItemHeight(i)});return As(t)&&(this.codeBlocksByResponseId.set(t.id,c),r.add(Ee(()=>this.codeBlocksByResponseId.delete(t.id)))),r.add(this.markdownDecorationsRenderer.walkTreeAndAnnotateReferenceLinks(d.element)),a.reverse().forEach(h=>r.add(h)),{codeBlockCount:l-o,element:d.element,dispose(){d.dispose(),r.dispose()}}}renderCodeBlock(e,t){const i=this._editorPool.get(),s=i.object;return As(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),s.render(e,this._currentLayoutWidth,this.rendererOptions.editableCodeBlock),i}getDataForProgressiveRender(e,t,i){const s=this.getProgressiveRenderRate(e),o=i.lastRenderTime===0?1:i.renderedWordCount+Math.floor((Date.now()-i.lastRenderTime)/1e3*s);if(o!==i.renderedWordCount)return{...GFe(t.value,o),rate:s}}disposeElement(e,t,i){i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},Mxe=vP,vP.ID="item",vP);fne=Mxe=D([_(6,be),_(7,Re),_(8,Ze),_(9,fr),_(10,Pe),_(11,pn),_(12,Qi),_(13,Rn),_(14,Ai),_(15,Zc),_(16,Rw)],fne);let Pxe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=ip(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return fne.ID}hasDynamicHeight(e){return!0}};Pxe=D([_(1,Ze)],Pxe);let Fxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(AEe,e,Te.ChatCodeBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Fxe=D([_(3,be)],Fxe);let Oxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(xEe,e,Te.ChatCompareBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Oxe=D([_(3,be)],Oxe);let Bxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=s,this._pool=this._register(new Bhe(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".interactive-response-progress-tree");return this._register(nOe(t,this.themeService)),this.instantiationService.createInstance(Fee,"ChatListRenderer",t,new Hxe,new B3t,[new W3t(e,this.configService.getValue("explorer.decorations"))],new H3t,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:s=>s.uri.toString()},accessibilityProvider:{getAriaLabel:s=>s.label,getWidgetAriaLabel:()=>g(Vm,11,"File Tree")},alwaysConsumeMouseWheel:!1})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Bxe=D([_(1,be),_(2,Re),_(3,pn)],Bxe);let Wxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.themeService=i,this._pool=this._register(new Bhe(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".chat-used-context-list");return this._register(nOe(t,this.themeService)),this.instantiationService.createInstance(Gbe,"ChatListRenderer",t,new F3t,[this.instantiationService.createInstance(pne,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:s=>{if(s.kind==="warning")return s.content.value;const o=s.reference;return"variableName"in o?o.variableName:P.isUri(o)?yr(o.path):yr(o.uri.path)},getWidgetAriaLabel:()=>g(Vm,12,"Used References")},dnd:{getDragURI:s=>{if(s.kind==="warning")return null;const{reference:o}=s;return"variableName"in o?null:P.isUri(o)?o.toString():o.uri.toString()},dispose:()=>{},onDragOver:()=>!1,drop:()=>{}}})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Wxe=D([_(1,be),_(2,pn)],Wxe);class F3t{getHeight(e){return 22}getTemplateId(e){return pne.TEMPLATE_ID}}var wP;let pne=(wP=class{constructor(e,t,i){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.templateId=Nxe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return $e.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===sf.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,s){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:Ce.warning});return}const o=e.reference,r=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in o)if(o.value){const a=P.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:Mx(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r})}else{const a=this.chatVariablesService.getVariable(o.variableName);i.label.setLabel(`#${o.variableName}`,void 0,{title:a?.description})}else{const a="uri"in o?o.uri:o;L9(a,_e.mailto,_e.http,_e.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??Ce.globe}):i.label.setFile(a,{fileKind:Ic.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0})}}disposeTemplate(e){e.templateDisposables.dispose()}},Nxe=wP,wP.TEMPLATE_ID="contentReferencesListRenderer",wP);pne=Nxe=D([_(1,pn),_(2,Mz)],pne);class Bhe extends ${get inUse(){return this._inUse}constructor(e){super(),this._itemFactory=e,this.pool=[],this._inUse=new Set}get(){if(this.pool.length>0){const t=this.pool.pop();return this._inUse.add(t),t}const e=this._register(this._itemFactory());return this._inUse.add(e),e}release(e){this._inUse.delete(e),this.pool.push(e)}}class O3t extends eC{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}const Qce=class Qce{getHeight(e){return Qce.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Qce.ITEM_HEIGHT=22;let Hxe=Qce;class B3t{isIncompressible(e){return!e.children}}class W3t{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,s){i.label.element.style.display="flex";const o=e.element.elements.map(r=>r.label);i.label.setResource({resource:e.element.elements[0].uri,name:o},{title:e.element.elements[0].label,fileKind:e.children?Ic.FOLDER:Ic.FILE,extraClasses:["explorer-item"],fileDecorations:this.decorations})}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}renderElement(e,t,i,s){i.label.element.style.display="flex",!e.children.length&&e.element.type!==an.Directory?i.label.setFile(e.element.uri,{fileKind:Ic.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:Ic.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class H3t{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}function U3t(n){return"label"in n}function l3e(n){return typeof n=="string"?{value:n}:n}function V3t(n){return n&&"kind"in n&&n.kind==="progressMessage"}function d3e(n){return n&&"isSettled"in n}function z3t(n){return n&&"kind"in n&&n.kind==="warning"}function Uxe(n){return n&&"isAtEndOfResponse"in n}function $3t(n){return n&&"kind"in n&&n.kind==="command"}function G3t(n){return n&&"kind"in n&&n.kind==="textEditGroup"}function q3t(n){return n&&"kind"in n&&n.kind==="confirmation"}function Q3t(n){return n&&"renderedWordCount"in n}function JK(n,e){return n.slice(e).every(V3t)}function j3t(n,e){return n.slice(e).every(Uxe)}var gX,q0;let Vxe=(q0=class extends ${get configuration(){return this._config}constructor(e,t,i,s,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=s,this.configurationService=o,this.themeService=r,this.viewDescriptorService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.themeService.onDidColorThemeChange(c=>this.update())),this._register(this.viewDescriptorService.onDidChangeLocation(c=>{c.views.some(l=>l.id===e)&&this.update()})),this._register(this.configurationService.onDidChangeConfiguration(c=>{gX.relevantSettingIds.some(l=>c.affectsConfiguration(l))&&this.update()})),this.update()}update(){const e=this.configurationService.getValue("editor"),t=this.configurationService.getValue("chat")?.editor,i=this.configurationService.getValue("editor.accessibilitySupport");this._config={foreground:this.themeService.getColorTheme().getColor(this.foreground),inputEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.inputEditorBackgroundColor),accessibilitySupport:i},resultEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),fontSize:t.fontSize,fontFamily:t.fontFamily==="default"?e.fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:t.lineHeight?t.lineHeight:gX.lineHeightEm*t.fontSize,bracketPairColorization:{enabled:this.configurationService.getValue("editor.bracketPairColorization.enabled"),independentColorPoolPerBracketType:this.configurationService.getValue("editor.bracketPairColorization.independentColorPoolPerBracketType")},wordWrap:t.wordWrap,fontLigatures:e.fontLigatures}},this._onDidChange.fire()}},gX=q0,q0.lineHeightEm=1.4,q0.relevantSettingIds=["chat.editor.lineHeight","chat.editor.fontSize","chat.editor.fontFamily","chat.editor.fontWeight","chat.editor.wordWrap","editor.cursorBlinking","editor.fontLigatures","editor.accessibilitySupport","editor.bracketPairColorization.enabled","editor.bracketPairColorization.independentColorPoolPerBracketType"],q0);Vxe=gX=D([_(4,Re),_(5,pn),_(6,z_)],Vxe);const K3t=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,Y3t=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,J3t=/\/([\w_\-]+)(?=(\s|$|\b))/i;let mne=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=cc.Panel,s){const o=[],r=this.variableService.getDynamicVariables(e);let a=1,c=1;for(let h=0;ha.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=lp.uriToFileUri(p.resource);m.scheme===_e.file&&t.dataTransfer.setData(gm.DOWNLOAD_URL,[Js.binary,ui(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(gm.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=it.as(nFe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(HCe(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:jc.getCanonicalUri(m)})}else if(P.isUri(f)){const{selection:m,uri:v}=TNe(f);p={resource:v,options:m?{selection:m}:void 0}}else f.isDirectory||(p={resource:f.resource});if(p){{const m=p.resource;if(m){const v=s.files.get(m);v&&(typeof p.languageId!="string"&&(p.languageId=v.getLanguageId()),typeof p.encoding!="string"&&(p.encoding=v.getEncoding()),typeof p.contents!="string"&&v.isDirty()&&!v.textEditorModel.isTooLargeForHeapOperation()&&(p.contents=v.textEditorModel.getValue())),p.options?.viewState||(p.options={...p.options,viewState:(()=>{for(const w of o.visibleEditorPanes)if(_n(w.input.resource,m)){const b=w.getViewState();if(b)return b}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(bF.EDITORS,uJe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):Gv(p)?p.modified.resource&&f.push(p.modified.resource):LE(p)?p.primary.resource&&f.push(p.primary.resource):Wb(p)&&f.push(p.result.resource);t.dataTransfer.setData(Js.uriList,R1.create(f.slice(0,1))),t.dataTransfer.setData(gm.INTERNAL_URI_LIST,R1.create(f))}}class E3t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class T5{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class R5{constructor(e){this.viewId=e}get id(){return this.viewId}}class lE extends ${static get INSTANCE(){return lE.instance||(lE.instance=new lE,xU(lE.instance)),lE.instance}constructor(){super(),this.transferData=Ote.getInstance(),this.onDragStart=this._register(new I),this.onDragEnd=this._register(new I),this._register(this.onDragEnd.event(e=>{const t=e.dragAndDropData.getData().id,i=e.dragAndDropData.getData().type;this.readDragData(i)?.getData().id===t&&this.transferData.clearData(i==="view"?R5.prototype:T5.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?R5.prototype:T5.prototype)){const t=this.transferData.getData(e==="view"?R5.prototype:T5.prototype);if(t&&t[0])return new E3t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new R5(e):new T5(e)],t==="view"?R5.prototype:T5.prototype)}registerTarget(e,t){const i=new Z;return i.add(new yZ(e,{onDragEnter:s=>{if(s.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:s,dragAndDropData:o})}},onDragLeave:s=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:s,dragAndDropData:o})},onDrop:s=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:s,dragAndDropData:o}),this.onDragEnd.fire({eventData:s,dragAndDropData:o})}},onDragOver:s=>{if(s.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:s,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(s=>{t.onDragStart(s)},this,i),t.onDragEnd&&this.onDragEnd.event(s=>{t.onDragEnd(s)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const s=new Z;return s.add(new yZ(e,{onDragStart:o=>{const{id:r,type:a}=t();this.writeDragData(r,a),o.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:o,dragAndDropData:this.readDragData(a)})},onDragEnd:o=>{const{type:r}=t(),a=this.readDragData(r);a&&this.onDragEnd.fire({eventData:o,dragAndDropData:a})},onDragEnter:o=>{if(i.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;r&&i.onDragEnter({eventData:o,dragAndDropData:r})}},onDragLeave:o=>{const r=this.readDragData("composite")||this.readDragData("view");r&&i.onDragLeave?.({eventData:o,dragAndDropData:r})},onDrop:o=>{if(i.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDrop({eventData:o,dragAndDropData:r}),this.onDragEnd.fire({eventData:o,dragAndDropData:r})}},onDragOver:o=>{if(i.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;i.onDragOver({eventData:o,dragAndDropData:r})}}})),i.onDragStart&&this.onDragStart.event(o=>{i.onDragStart(o)},this,s),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,s),this._register(s)}}function r3e(n,e,t){n&&(n.dropEffect=t?e:"none")}let a3e=class{constructor(e,t){this.toResource=e,this.instantiationService=t}getDragURI(e){const t=this.toResource(e);return t?t.toString():null}getDragLabel(e){const t=Ui(e.map(this.toResource));return t.length===1?ui(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const s of e.elements){const o=this.toResource(s);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(s=>Ast(s,i,t))}onDragOver(e,t,i,s,o){return!1}drop(e,t,i,s,o){}dispose(){}};a3e=D([_(1,be)],a3e);const Gce=class Gce extends ${constructor(){super(),this.broadcaster=this._register(new iOe(Gce.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(T.runAndSubscribe(Vb,({window:e,disposables:t})=>{t.add(pe(e,xe.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(pe(e,xe.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:yi,disposables:this._store})),this._register(this.broadcaster.onDidReceiveData(e=>{e===!0?this.markDraggedOver(!0):this.clearDraggedOver(!0)}))}get isDraggedOver(){return this.draggedOver}markDraggedOver(e){this.draggedOver!==!0&&(this.draggedOver=!0,e||this.broadcaster.postData(!0))}clearDraggedOver(e){this.draggedOver!==!1&&(this.draggedOver=!1,e||this.broadcaster.postData(!1))}};Gce.CHANNEL_NAME="monaco-workbench-global-dragged-over";let yxe=Gce;new yxe;class x3t{constructor(e,t,i){if(this.location=t,this.parent=i,t[t.length-1]==="\\")throw Error("Unexpected path format, do not use trailing backslashes");t[t.length-1]!=="/"&&(t+="/"),this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}updateContents(e){this.isPathIgnored=this.parseIgnoreFile(e,this.location,this.parent)}isPathIncludedInTraversal(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);return!this.isPathIgnored(e,t)}isArbitraryPathIgnored(e,t){if(e[0]!=="/"||e[e.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+e);const i=e.split("/").filter(r=>r);let s=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of s)o[r]=!0;return _w(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const s=e.split(` +`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=s.filter(m=>!m.endsWith("/")),r=o.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(r,t,!0),c=o.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),l=this.gitignoreLinesToExpression(c,t,!1),d=s.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=s.filter(m=>m.includes("!")).map(m=>m.replace(/!/g,"")),f=this.gitignoreLinesToExpression(u,t,!1);return(m,v)=>m.startsWith(t)?v&&h(m)&&!f(m)||a(m)&&!l(m)?!0:i?i.isPathIgnored(m,v):!1:!1}gitignoreLineToGlob(e,t){const i=e.indexOf("/");return i===-1||i===e.length-1?e="**/"+e:(i===0?t.slice(-1)==="/"&&(e=e.slice(1)):t.slice(-1)!=="/"&&(e="/"+e),e=t+e),e}}var Sxe;(function(n){n.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(Sxe||(Sxe={}));class D3t{constructor(){this._onDidRegisterDescriptor=new I,this.onDidRegisterDescriptor=this._onDidRegisterDescriptor.event,this.descriptors=[]}register(e){this.descriptors.push(e),this._onDidRegisterDescriptor.fire(e)}create(e,t,i){return this.descriptors.map(s=>{const o=s.create(e,t);return i.add(o),o})}}const Axe=new D3t;it.add(Sxe.FileContributionRegistry,Axe);var Exe,Qw;const Fp="vs/workbench/contrib/files/browser/views/explorerViewer",qce=class qce{getHeight(e){return qce.ITEM_HEIGHT}getTemplateId(e){return une.ID}};qce.ITEM_HEIGHT=22;let dne=qce;const xxe=new I;let Dxe=class{constructor(e,t,i,s,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=s,this.layoutService=o,this.fileService=r,this.explorerService=a,this.contextService=c,this.filesConfigService=l}hasChildren(e){return Array.isArray(e)||e.hasChildren(t=>this.fileFilter.filter(t,so.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,s=e.fetchChildren(i);if(Array.isArray(s))return s;const o=s.then(r=>(e instanceof Wh&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==Nn.FOLDER&&xxe.fire(e.resource),r),r=>{if(e instanceof Wh&&e.isRoot)if(this.contextService.getWorkbenchState()===Nn.FOLDER){const a=new Wh(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else xxe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};Dxe=D([_(1,Cf),_(2,Re),_(3,Pi),_(4,kO),_(5,ci),_(6,Sp),_(7,Ti),_(8,hh)],Dxe);const kBe=class kBe{get index(){return this._index}get count(){return this.items.length}get current(){return this.items[this._index]}get currentId(){return`${this.id}_${this.index}`}get labels(){return this._labels}constructor(e,t,i,s,o){this.id=e,this.items=t,this.depth=s,this.collapsed=o,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._index=t.length-1,this.updateLabels(i),this._updateLabelDisposable=i.label.onDidRender(()=>this.updateLabels(i))}updateLabels(e){this._labels=Array.from(e.container.querySelectorAll(".label-name"));let t="";for(let i=0;i=this.items.length-1||this.setIndex(this._index+1)}first(){this._index!==0&&this.setIndex(0)}last(){this._index!==this.items.length-1&&this.setIndex(this.items.length-1)}setIndex(e){e<0||e>=this.items.length||(this.labels[this._index].classList.remove("active"),this._index=e,this.labels[this._index].classList.add("active"),this._onDidChange.fire())}updateCollapsed(e){this.collapsed=e;for(let t=0;t{const f=this.configurationService.getValue("workbench.tree.indent"),p=Math.max(22-f,0);e.style.setProperty("--vscode-explorer-align-offset-margin-left",`${p}px`)};this.configListener=this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("explorer")&&(this.config=this.configurationService.getValue()),f.affectsConfiguration("workbench.tree.indent")&&u()}),u()}getWidgetAriaLabel(){return g(Fp,0,"Files Explorer")}get templateId(){return Exe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{o.currentContext&&this.updateWidth(o.currentContext)}catch{}}));const s=Axe.create(this.instantiationService,e,t);t.add(Axe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);s.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:s};return o}renderElement(e,t,i){const s=e.element;i.currentContext=s;const o=this.explorerService.getEditableData(s);i.label.element.classList.remove("compressed"),o?(i.label.element.style.display="none",i.contribs.forEach(r=>r.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,s,o))):(i.label.element.style.display="flex",this.renderStat(s,s.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,s){const o=e.element.elements[e.element.elements.length-1];i.currentContext=o;const r=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=r.length===0?void 0:this.explorerService.getEditableData(r[0]);if(a)i.label.element.classList.remove("compressed"),i.label.element.style.display="none",i.contribs.forEach(c=>c.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,r[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${hne.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new hne(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(o)??[];this.compressedNavigationControllers.set(o,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(pe(i.container,"mousedown",u=>{const f=gne(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(o)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(o):u.splice(f,1)}))}}renderStat(e,t,i,s,o){o.label.element.style.display="flex";const r=["explorer-item"];this.explorerService.isCut(e)&&r.push("cut");const a=this.themeService.getFileIconTheme();o.container.parentElement?.parentElement?.querySelector(".monaco-tl-twistie")?.classList.toggle("force-twistie",e.hasNests&&a.hidesExplorerArrows);const l=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),d=e.nestedParent&&l;o.contribs.forEach(h=>h.setResource(e.resource)),o.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?Ic.ROOT_FOLDER:e.isDirectory?Ic.FOLDER:Ic.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:Cz(s),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const s=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?Ic.ROOT_FOLDER:t.isDirectory?Ic.FOLDER:Ic.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:r,extraClasses:l?[...o,"align-nest-icon-with-parent-icon"]:o},h=t.name?ma(t.resource):t.resource,u=t.name||"";s.setFile(Qt(h,u||" "),d),s.element.firstElementChild.style.display="none";const f=new fXe(s.element,this.contextViewService,{validationOptions:{validation:C=>{const y=i.validationMessage(C);return!y||y.severity!==nt.Error?null:{content:y.content,formatContent:!0,type:Yd.ERROR}}},ariaLabel:g(Fp,1,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:eV}),p=u.lastIndexOf(".");let m="prefix";f.value=u,f.focus(),f.select({start:0,end:p>0&&!t.isDirectory?p:u.length});const v=cw((C,y)=>{s.element.style.display="none";const S=f.value;St(b),s.element.remove(),y&&i.onFinish(S,C)}),w=()=>{if(f.isInputValid()){const C=i.validationMessage(f.value);C?f.showMessage({content:C.content,formatContent:!0,type:C.severity===nt.Info?Yd.INFO:C.severity===nt.Warning?Yd.WARNING:Yd.ERROR}):f.hideMessage()}};w();const b=[f,f.onDidChange(C=>{s.setFile(Qt(h,C||" "),d)}),Xo(f.inputElement,xe.KEY_DOWN,C=>{if(C.equals(E.F2)){const y=f.value.lastIndexOf(".");if(t.isDirectory||y===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:y+1,end:f.value.length})):(m="prefix",f.select({start:0,end:y}))}else C.equals(E.Enter)?f.validate()||v(!0,!0):C.equals(E.Escape)&&v(!1,!0)}),Xo(f.inputElement,xe.KEY_UP,C=>{w()}),pe(f.inputElement,xe.BLUR,async()=>{for(;;){await Ta(0);const C=f.inputElement.ownerDocument;if(!C.hasFocus())break;if(kw(f.inputElement))return;if(Ra(C.activeElement)&&GY(C.activeElement,"context-view"))await T.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),s];return Ee(()=>{v(!1,!1)})}disposeElement(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeCompressedElements(e,t,i){i.currentContext=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}getCompressedNavigationController(e){return this.compressedNavigationControllers.get(e)}getAriaLabel(e){return e.name}getAriaLevel(e){let t=0,i=e.parent;for(;i;)i=i.parent,t++;return this.contextService.getWorkbenchState()===Nn.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},Exe=pP,pP.ID="file",pP);une=Exe=D([_(3,W_),_(4,pn),_(5,Re),_(6,Sp),_(7,eo),_(8,Ti),_(9,Vr),_(10,be)],une);let kxe=class{constructor(e,t,i,s,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=s,this.uriIdentityService=o,this.fileService=r,this.hiddenExpressionPerRoot=new Map,this.editorsAffectingFilter=new Set,this._onDidChange=new I,this.toDispose=[],this.ignoreFileResourcesPerRoot=new Map,this.ignoreTreesPerRoot=new Map,this.toDispose.push(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateConfiguration())),this.toDispose.push(this.configurationService.onDidChangeConfiguration(a=>{(a.affectsConfiguration("files.exclude")||a.affectsConfiguration("explorer.excludeGitIgnore"))&&this.updateConfiguration()})),this.toDispose.push(this.fileService.onDidFilesChange(a=>{for(const[c,l]of this.ignoreFileResourcesPerRoot.entries())l.forEach(async d=>{a.contains(d,Ko.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,Ko.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(ma(d)),l.delete(d),this._onDidChange.fire())})})),this.toDispose.push(this.editorService.onDidVisibleEditorsChange(()=>{const a=this.editorService.visibleEditors;let c=!1;for(const l of a){if(!l.resource)continue;const d=this.explorerService.findClosest(l.resource);if(d&&d.isExcluded){c=!0;break}}for(const l of this.editorsAffectingFilter)if(!a.includes(l)){c=!0;break}c&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())})),this.updateConfiguration()}get onDidChange(){return this._onDidChange.event}updateConfiguration(){let e=!1,t=!1;this.contextService.getWorkspace().folders.forEach(i=>{const s=this.configurationService.getValue({resource:i.uri}),o=s?.files?.exclude||Object.create(null),r=s.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new o1),this.ignoreTreesPerRoot.set(i.uri.toString(),Su.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!r&&this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.delete(i.uri.toString()),this.ignoreTreesPerRoot.delete(i.uri.toString())),!e){const c=this.hiddenExpressionPerRoot.get(i.uri.toString());e=!c||!Io(c.original,o)}const a=Vs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:_w(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const s=ma(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(s))return;const r=await this.fileService.readFile(t);if(i)o.get(s)?.updateContents(r.value.toString());else{const a=o.findSubstr(s),c=new x3t(r.value.toString(),s.path,a);o.set(s,c),this.ignoreFileResourcesPerRoot.get(e)?.has(t)||this.ignoreFileResourcesPerRoot.get(e)?.add(t)}this._onDidChange.fire()}filter(e,t){return e.name===".gitignore"&&this.ignoreTreesPerRoot.has(e.root.resource.toString())?(this.processIgnoreFile(e.root.resource.toString(),e.resource,!1),!0):this.isVisible(e,t)}isVisible(e,t){if(e.isExcluded=!1,t===so.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const s=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(LU(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(s?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||s||e.parent?.isExcluded){e.isExcluded=!0;const l=this.editorService.visibleEditors.find(d=>d.resource&&this.uriIdentityService.extUri.isEqualOrParent(d.resource,e.resource));return l&&e.root===this.explorerService.findClosestRoot(e.resource)?(this.editorsAffectingFilter.add(l),!0):!1}return!0}dispose(){St(this.toDispose)}};kxe=D([_(0,Ti),_(1,Re),_(2,Sp),_(3,_i),_(4,_o),_(5,ci)],kxe);let Ixe=class{constructor(e,t){this.explorerService=e,this.contextService=t}compare(e,t){if(e.isRoot){if(t.isRoot){const a=this.contextService.getWorkspaceFolder(e.resource),c=this.contextService.getWorkspaceFolder(t.resource);return a&&c?a.index-c.index:-1}return-1}if(t.isRoot)return 1;const i=this.explorerService.sortOrderConfiguration.sortOrder,s=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(s){case"upper":o=jIt,r=XIt;break;case"lower":o=KIt,r=ZIt;break;case"unicode":o=YIt,r=e0t;break;default:o=QIt,r=JIt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return o(e.name,t.name);break;case"filesFirst":if(e.isDirectory&&!t.isDirectory)return 1;if(t.isDirectory&&!e.isDirectory)return-1;break;case"foldersNestsFiles":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.hasNests&&!t.hasNests)return-1;if(t.hasNests&&!e.hasNests)return 1;break;case"mixed":break;default:if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;break}switch(i){case"type":return r(e.name,t.name);case"modified":return e.mtime!==t.mtime?e.mtime&&t.mtime&&e.mtime{(!u||u.affectsConfiguration("explorer.enableDragAndDrop"))&&(this.dropEnabled=this.configurationService.getValue("explorer.enableDragAndDrop"))};h(void 0),this.disposables.add(this.configurationService.onDidChangeConfiguration(u=>h(u)))}onDragOver(e,t,i,s,o){if(!this.dropEnabled)return!1;if(t){const r=Qw.getCompressedStatFromDragEvent(t,o);if(r){const a=gne(o.target);if(a&&a.index{a.element.classList.remove("drop-target"),this.compressedDragOverElement=void 0}),a.element.classList.add("drop-target")),typeof c=="boolean"?c:{...c,feedback:[]}):(this.compressedDropTargetDisposable.dispose(),!1)}}}return this.compressedDropTargetDisposable.dispose(),this.handleDragOver(e,t,i,s,o)}handleDragOver(e,t,i,s,o){const r=o&&(o.ctrlKey&&!ei||o.altKey&&ei),a=e instanceof gbe,l={type:a||r?_R.Copy:_R.Move,position:iS.Over};if(a){if(!Ctt(o,gm.FILES,bF.FILES,gm.RESOURCES))return!1}else{if(e instanceof NJe)return!1;{const d=Qw.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!r&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:_R.Move,position:iS.After}}:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!r&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!r&&this.uriIdentityService.extUri.isEqual(ma(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(s){case AA.TOP:case AA.CENTER_TOP:u=iS.Before;break;case AA.CENTER_BOTTOM:case AA.BOTTOM:u=iS.After;break}return{accept:!0,effect:{type:_R.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:CR.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:CR.Up,effect:l}}else return{accept:!0,bubble:CR.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Qw.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Qw.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>Ast(o,i,t));const s=i.filter(o=>o.resource.scheme===_e.file).map(o=>o.resource.fsPath);s.length&&t.dataTransfer.setData(bF.FILES,JSON.stringify(s))}}async drop(e,t,i,s,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=Qw.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],s=AA.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof gbe?!Jn||hx(this.contextService.getWorkspace())&&Tv.supported(yi)?await this.instantiationService.createInstance(vxe).import(r,o,yi):await this.instantiationService.createInstance(lne).upload(t,o):await this.handleExplorerDrop(e,r,i,s,o)}catch(a){this.dialogService.error(Ma(a))}}async handleExplorerDrop(e,t,i,s,o){const r=Qw.getStatsFromDragAndDropData(e),a=new Map(r.map(u=>[u,this.isCollapsed(u)]));for(const[u,f]of a)if(f){const p=u.nestedChildren;if(p)for(const m of p)a.set(m,!0)}const c=Kht([...a.keys()],u=>u.resource),l=o.ctrlKey&&!ei||o.altKey&&ei;if(!l&&this.configurationService.getValue(Qw.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(Fp,2,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(Fp,3,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(Fp,4,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(Fp,5,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?fst(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(Fp,6,"Do not ask me again")},primaryButton:g(Fp,7,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(Qw.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,s);const h=c.filter(u=>!u.isRoot);return l?this.doHandleExplorerDropOnCopy(h,t):this.doHandleExplorerDropOnMove(h,t)}async doHandleRootDrop(e,t,i){if(e.length===0)return;const s=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==s[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case AA.BOTTOM:case AA.CENTER_BOTTOM:o++;break}for(const l of r)l{const c=a.newResource?this.explorerService.findClosest(a.newResource):void 0;return c&&!c.isDirectory}).map(a=>({resource:a.newResource,options:{pinned:!0}}));await this.editorService.openEditors(r)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(r=>!r.isReadonly).map(r=>new up(r.resource,Qt(t.resource,r.name))),s=c3e(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===SM.Verbose,undoLabel:g(Fp,10,"Move {0}",s),progressLabel:g(Fp,11,"Moving {0}",s)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Zi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=d3t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new up(d.oldResource,d.newResource,{overwrite:!0})),o)}else throw r}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Qw.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=gt(t).document.elementFromPoint(t.clientX,t.clientY),s=gne(i);if(s){const{count:o,index:r}=s;let a=o-1;for(;a>r&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Qw=mP,mP.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",mP);Lxe=Qw=D([_(1,Sp),_(2,_i),_(3,To),_(4,Ti),_(5,ci),_(6,Re),_(7,be),_(8,$S),_(9,_o)],Lxe);function gne(n){if(!Ra(n))return null;let e=n;for(;e&&!e.classList.contains("monaco-list-row");){if(e.classList.contains("label-name")&&e.hasAttribute("data-icon-label-count")){const t=Number(e.getAttribute("data-icon-label-count")),i=Number(e.getAttribute("data-icon-label-index"));if(Kc(t)&&Kc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function k3t(n){return!!gne(n)}class I3t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Fhe||!e.parent||e.parent.isRoot}}function c3e(n){return n.length===1?n[0].name:n.every(e=>e.isDirectory)?g(Fp,12,"{0} folders",n.length):n.every(e=>!e.isDirectory)?g(Fp,13,"{0} files",n.length):`${n.length} files and folders`}const hX="vs/workbench/contrib/files/browser/views/explorerDecorationsProvider";function L3t(n){if(n.isRoot&&n.error)return{tooltip:g(hX,0,"Unable to resolve workspace folder ({0})",Ma(n.error)),letter:"!",color:__t};if(n.isSymbolicLink)return{tooltip:g(hX,1,"Symbolic Link"),letter:"⤷"};if(n.isUnknown)return{tooltip:g(hX,2,"Unknown File Type"),letter:"?"};if(n.isExcluded)return{color:y_t}}let Txe=class{constructor(e,t){this.explorerService=e,this.label=g(hX,3,"Explorer"),this._onDidChange=new I,this.toDispose=new Z,this.toDispose.add(this._onDidChange),this.toDispose.add(t.onDidChangeWorkspaceFolders(i=>{this._onDidChange.fire(i.changed.concat(i.added).map(s=>s.uri))})),this.toDispose.add(xxe.event(i=>{this._onDidChange.fire([i])}))}get onDidChange(){return this._onDidChange.event}async provideDecorations(e){const t=this.explorerService.findClosest(e);if(!t)throw new Error("ExplorerItem not found");return L3t(t)}dispose(){this.toDispose.dispose()}};Txe=D([_(0,Sp),_(1,Ti)],Txe);var uX;const NF="vs/workbench/contrib/files/browser/views/explorerView";function T3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t)){for(const[,i]of t.children.entries())if(n.hasNode(i)&&n.isCollapsible(i)&&!n.isCollapsed(i))return!0}return!1}function R3t(n,e){for(const t of e)if(n.hasNode(t)&&!n.isCollapsed(t))return!0;return!1}const M3t={getId:n=>n instanceof Fhe?`new:${n.getId()}`:n.getId()};function N3t(n,e,t,i){let s;s=n.length?n[0]:void 0,t&&e.length>1&&(s=void 0);const o=s&&i.getCompressedNavigationController(s),r=o&&o.length?o[0]:void 0;s=r?r.current:s;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&s&&d===r){c===s&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return s?t&&a.indexOf(s)>=0?a:[s]:t?a:[]}var _P;let QV=(_P=class extends Wie{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F){super(e,d,t,u,h,i,s,F,m,v,w),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=b,this.storageService=C,this.clipboardService=y,this.fileService=S,this.uriIdentityService=M,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=s.createInstance(O7),this._register(this.resourceContext),this.folderContext=x5t.bindTo(h),this.readonlyContext=cst.bindTo(h),this.availableEditorIdsContext=D5t.bindTo(h),this.rootContext=k5t.bindTo(h),this.resourceMoveableToTrash=L5t.bindTo(h),this.compressedFocusContext=T5t.bindTo(h),this.compressedFocusFirstContext=R5t.bindTo(h),this.compressedFocusLastContext=M5t.bindTo(h),this.viewHasSomeCollapsibleRootItem=N5t.bindTo(h),this.viewVisibleContextKey=JFe.bindTo(h),this.explorerService.registerView(this)}get autoReveal(){return this._autoReveal}set autoReveal(e){this._autoReveal=e}get name(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get title(){return this.name}set title(e){}setVisible(e){this.viewVisibleContextKey.set(e),super.setVisible(e)}get fileCopiedContextKey(){return h3t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return I5t.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new pxt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(NF,0,"Explorer Section: {0}",this.name),t.setAttribute("aria-label",this.ariaHeaderLabel)};this._register(this.contextService.onDidChangeWorkspaceName(i)),this._register(this.labelService.onDidChangeFormatters(i)),i()}layoutBody(e,t){super.layoutBody(e,t),this.tree.layout(e,t)}renderBody(e){super.renderBody(e),this.container=e,this.treeContainer=he(e,we(".explorer-folders-view")),this.createTree(this.treeContainer),this._register(this.labelService.onDidChangeFormatters(()=>{this._onDidChangeTitleArea.fire()})),this.onConfigurationUpdated(void 0),this._register(this.editorService.onDidActiveEditorChange(()=>{this.selectActiveFile()})),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationUpdated(t))),this._register(this.onDidChangeBodyVisibility(async t=>{t&&(await this.setTreeInput(),this.updateAnyCollapsedContext(),this.selectActiveFile(!0))})),this._register(pe(gt(this.container),xe.PASTE,async t=>{!this.hasFocus()||this.readonlyContext.get()||t.clipboardData?.files?.length&&await this.commandService.executeCommand("filesExplorer.paste",t.clipboardData?.files)}))}focus(){if(super.focus(),this.tree.domFocus(),this.tree.getFocusedPart()===aV.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return cMe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===aV.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return N3t(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,so.Visible):!1}isItemCollapsed(e){return this.tree.isCollapsed(e)}async setEditable(e,t){t?(this.horizontalScrolling=this.tree.options.horizontalScrolling,this.horizontalScrolling&&this.tree.updateOptions({horizontalScrolling:!1}),await this.tree.expand(e.parent)):(this.horizontalScrolling!==void 0&&this.tree.updateOptions({horizontalScrolling:this.horizontalScrolling}),this.horizontalScrolling=void 0,this.treeContainer.classList.remove("highlight")),await this.refresh(!1,e.parent,!1),t?(this.treeContainer.classList.add("highlight"),this.tree.reveal(e)):this.tree.domFocus()}async selectActiveFile(e=this._autoReveal){if(this._autoReveal){const t=jc.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:go.PRIMARY});if(t){const i=this.tree.getFocus(),s=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&s.length===1&&this.uriIdentityService.extUri.isEqual(s[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(kxe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(B1,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(une,e,t,i),this._register(this.renderer),this._register(nOe(e,this.themeService));const s=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(Fee,"FileExplorer",e,new dne,new I3t,[this.renderer],this.instantiationService.createInstance(Dxe,this.filter),{compressionEnabled:s(),accessibilityProvider:this.renderer,identityProvider:M3t,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>{if(!this.explorerService.isEditable(a))return a.name},getCompressedNodeKeyboardNavigationLabel:a=>{if(!a.some(c=>this.explorerService.isEditable(c)))return a.map(c=>c.name).join("/")}},multipleSelectionSupport:!0,filter:this.filter,sorter:this.instantiationService.createInstance(Ixe),dnd:this.instantiationService.createInstance(Lxe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof Wh&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof Wh){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:dne.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=T.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:s()}))),dst.bindTo(this.tree.contextKeyService),hst.bindTo(this.tree.contextKeyService),this._register(this.tree.onDidChangeFocus(a=>this.onFocusChanged(a.elements))),this.onFocusChanged([]),this._register(this.tree.onDidOpen(async a=>{const c=a.element;if(!c)return;if(!(Sv(a.browserEvent)&&a.browserEvent.shiftKey)){if(c.isDirectory||this.explorerService.isEditable(void 0))return;this.telemetryService.publicLog2("workbenchActionExecuted",{id:"workbench.files.openFile",from:"explorer"});try{this.delegate?.willOpenElement(a.browserEvent),await this.editorService.openEditor({resource:c.resource,options:{preserveFocus:a.editorOptions.preserveFocus,pinned:a.editorOptions.pinned,source:C7.USER}},a.sideBySide?Cw:wx)}finally{this.delegate?.didOpenElement()}}})),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidScroll(async a=>{const c=this.explorerService.getEditable();a.scrollTopChanged&&c&&this.tree.getRelativeTop(c.stat)===null&&await c.data.onFinish("",!1)})),this._register(this.tree.onDidChangeCollapseState(a=>{const c=a.node.element?.element;c&&this.renderer.getCompressedNavigationController(c instanceof Array?c[0]:c)?.forEach(d=>d.updateCollapsed(a.node.collapsed)),this.updateAnyCollapsedContext()})),this.updateAnyCollapsedContext(),this._register(this.tree.onMouseDblClick(a=>{const c=this.configurationService.getValue("workbench.list.scrollByPage");a.element===null&&!c&&this.commandService.executeCommand(tOe)})),this._register(this.storageService.onWillSaveState(()=>{this.storeTreeViewState()}))}onConfigurationUpdated(e){if(!e||e.affectsConfiguration("explorer.autoReveal")){const t=this.configurationService.getValue();this._autoReveal=t?.explorer?.autoReveal}e&&(e.affectsConfiguration("explorer.decorations.colors")||e.affectsConfiguration("explorer.decorations.badges"))&&this.refresh(!0)}storeTreeViewState(){this.storageService.store(uX.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),ke.WORKSPACE,ln.MACHINE)}setContextKeys(e){const t=this.contextService.getWorkspace().folders,i=e?e.resource:t[t.length-1].uri;if(e=e||this.explorerService.findClosest(i),this.resourceContext.set(i),this.folderContext.set(!!e&&e.isDirectory),this.readonlyContext.set(!!e&&!!e.isReadonly),this.rootContext.set(!!e&&e.isRoot),i){const s=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(s.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(ux(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Ra(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(Sv(e.browserEvent)||k3t(e.browserEvent.target)?i=a[0].labels[a[0].index]:a.forEach(c=>c.last()))}this.fileCopiedContextKey.set(await this.clipboardService.hasResources()),this.setContextKeys(t);const s=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof Wh){const a=this.renderer.getCompressedNavigationController(t);r=a&&a.length?a[0].current.resource:t.resource}else r=o.length===1?o[0].resource:{};this.contextMenuService.showContextMenu({menuId:Te.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&s&&s.indexOf(t)>=0?s.map(a=>a.resource):t instanceof Wh?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const s=this.configurationService.getValue().files.enableTrash,o=this.fileService.hasCapability(t.resource,es.Trash);this.resourceMoveableToTrash.set(s&&o)}else this.resourceMoveableToTrash.reset();const i=t&&this.renderer.getCompressedNavigationController(t);if(!i){this.compressedFocusContext.set(!1);return}this.compressedFocusContext.set(!0),i.forEach(s=>{this.updateCompressedNavigationContextKeys(s)})}refresh(e,t,i=!0){if(!this.tree||!this.isBodyVisible()||t&&!this.tree.hasNode(t))return Promise.resolve(void 0);i&&this.explorerService.isEditable(void 0)&&this.tree.domFocus();const s=t||this.tree.getInput();return this.tree.updateChildren(s,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return zut(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&vs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==Nn.FOLDER||t[0].error)&&(i=t);let s;if(this.tree&&this.tree.getInput())s=this.tree.getViewState();else{const a=this.storageService.get(uX.TREE_VIEW_STATE_STORAGE_KEY,ke.WORKSPACE);a&&(s=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,s).then(async()=>{if(Array.isArray(i)){if(!s||o instanceof Wh)for(let a=0;a{}),Array.isArray(o)){const a=new wi;o.forEach(c=>a.set(c.resource,!0)),await Promise.all(i.map(async c=>{if(!a.has(c.resource))try{await this.tree.expand(c)}catch{}}))}}e&&vs("code/didResolveExplorer")});this.progressService.withProgress({location:ch.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new Txe(this.explorerService,this.contextService),this._register(this.decorationService.registerDecorationsProvider(this.decorationsProvider)))}async selectResource(e,t=this._autoReveal,i=0){if(i===2||!e||!this.isBodyVisible())return;this.setTreeInputPromise&&await this.setTreeInputPromise;let s=this.explorerService.findClosestRoot(e);for(;s&&s.resource.toString()!==e.toString();){try{await this.tree.expand(s)}catch{return this.selectResource(e,t,i+1)}if(!s.children.size)s=null;else for(const o of s.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){s=o;break}s=null}}if(s){if(s===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{s.nestedParent&&await this.tree.expand(s.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(s)===null&&this.tree.reveal(s,.5),this.tree.setFocus([s]),this.tree.setSelection([s])}catch{return this.selectResource(e,t,i+1)}}}itemsCopied(e,t,i){this.fileCopiedContextKey.set(e.length>0),this.resourceCutContextKey.set(t&&e.length>0),i?.forEach(s=>this.tree.rerender(s)),t&&e.forEach(s=>this.tree.rerender(s))}expandAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus(),this.tree.expandAll()}collapseAll(){this.explorerService.isEditable(void 0)&&this.tree.domFocus();const e=this.tree.getInput();if(Array.isArray(e)&&T3t(this.tree,e)){e.forEach(t=>{t.children.forEach(i=>this.tree.hasNode(i)&&this.tree.collapse(i,!0))});return}this.tree.collapseAll()}previousCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.previous(),this.updateCompressedNavigationContextKeys(i)})}nextCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.next(),this.updateCompressedNavigationContextKeys(i)})}firstCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.first(),this.updateCompressedNavigationContextKeys(i)})}lastCompressedStat(){const e=this.tree.getFocus();if(!e.length)return;this.renderer.getCompressedNavigationController(e[0]).forEach(i=>{i.last(),this.updateCompressedNavigationContextKeys(i)})}updateCompressedNavigationContextKeys(e){this.compressedFocusFirstContext.set(e.index===0),this.compressedFocusLastContext.set(e.index===e.count-1)}updateAnyCollapsedContext(){const e=this.tree.getInput();if(e===void 0)return;const t=Array.isArray(e)?e:Array.from(e.children.values());this.viewHasSomeCollapsibleRootItem.set(R3t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},uX=_P,_P.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",_P);QV.__decorator=D([ii],QV.prototype,"fileCopiedContextKey",null);QV.__decorator=D([ii],QV.prototype,"resourceCutContextKey",null);QV=uX=D([_(1,Vr),_(2,z_),_(3,be),_(4,Ti),_(5,Cf),_(6,_i),_(7,Pz),_(8,kO),_(9,ti),_(10,Pe),_(11,Re),_(12,rD),_(13,eo),_(14,pn),_(15,rn),_(16,el),_(17,Sp),_(18,on),_(19,Mu),_(20,ci),_(21,_o),_(22,ji),_(23,fr)],QV);function nOe(n,e){n.classList.add("file-icon-themable-tree"),n.classList.add("show-file-icons");const t=i=>{n.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),n.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends pi{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(NF,1,"New File..."),f1:!1,icon:Ce.newFile,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:10}})}run(n){n.get(ji).executeCommand(tOe)}});At(class extends pi{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(NF,2,"New Folder..."),f1:!1,icon:Ce.newFolder,precondition:lst,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:20}})}run(n){n.get(ji).executeCommand(yst)}});At(class extends pi{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Be(NF,3,"Refresh Explorer"),f1:!0,icon:Ce.refresh,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:30},metadata:{description:Be(NF,4,"Forces a refresh of the Explorer.")}})}async run(n){const e=n.get(q_),t=n.get(Sp);await e.openView(lC),await t.refresh()}});At(class extends pi{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Be(NF,5,"Collapse Folders in Explorer"),f1:!0,icon:Ce.collapseAll,menu:{id:Te.ViewTitle,group:"navigation",when:ge.equals("view",lC),order:40},metadata:{description:Be(NF,6,"Folds all folders in the Explorer.")}})}run(n){const t=n.get(q_).getViewWithId(lC);t!==null&&t.collapseAll()}});const P3t=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let Rxe=class extends vw{constructor(e,t,i,s){super(e??{},t,i),this.trustedDomainService=s}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:P3t}};const s=e&&e.supportHtml?{...e,value:`${e.value}`}:e;return super.render(s,t,i)}};Rxe=D([_(1,Di),_(2,fr),_(3,lhe)],Rxe);var Mxe,Nxe;const Vm="vs/workbench/contrib/chat/browser/chatListRenderer",Pl=we;var vP;let fne=(vP=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(),this.location=t,this.rendererOptions=i,this.delegate=s,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.openerService=d,this.contextKeyService=h,this.themeService=u,this.commandService=f,this.textModelService=p,this.modelService=m,this.hoverService=v,this.chatService=w,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new wi,this.fileTreesByResponseId=new Map,this.focusedFileTreesByResponseId=new Map,this._onDidClickFollowup=this._register(new I),this.onDidClickFollowup=this._onDidClickFollowup.event,this._onDidClickRerunWithAgentOrCommandDetection=new I,this.onDidClickRerunWithAgentOrCommandDetection=this._onDidClickRerunWithAgentOrCommandDetection.event,this._onDidChangeItemHeight=this._register(new I),this.onDidChangeItemHeight=this._onDidChangeItemHeight.event,this._currentLayoutWidth=0,this._isVisible=!0,this._onDidChangeVisibility=this._register(new I),this._usedReferencesEnabled=!1,this.renderer=this._register(this.instantiationService.createInstance(Rxe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(ixe),this._editorPool=this._register(this.instantiationService.createInstance(Fxe,e,s,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(Oxe,e,s,r)),this._treePool=this._register(this.instantiationService.createInstance(Bxe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(Wxe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(EEe)),this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0,this._register(c.onDidChangeConfiguration(b=>{b.affectsConfiguration("chat.experimental.usedReferences")&&(this._usedReferencesEnabled=c.getValue("chat.experimental.usedReferences")??!0)}))}get templateId(){return Mxe.ID}editorsInUse(){return this._editorPool.inUse()}traceLayout(e,t){this.logService.trace(`ChatListItemRenderer#${e}: ${t}`)}getProgressiveRenderRate(e){if(e.isComplete)return 80;if(e.contentUpdateTimings&&e.contentUpdateTimings.impliedWordLoadRate){const o=e.contentUpdateTimings.impliedWordLoadRate*1.5;return Dc(o,12,80)}return 8}getCodeBlockInfosForResponse(e){return this.codeBlocksByResponseId.get(e.id)??[]}getCodeBlockInfoForEditor(e){return this.codeBlocksByEditorUri.get(e)}getFileTreeInfosForResponse(e){return this.fileTreesByResponseId.get(e.id)??[]}getLastFocusedFileTreeForResponse(e){const t=this.fileTreesByResponseId.get(e.id),i=this.focusedFileTreesByResponseId.get(e.id);if(t?.length&&i!==void 0&&iy.actions.length<=1},actionViewItemProvider:(y,S)=>y instanceof id&&(y.item.id==="workbench.action.chat.voteDown"||y.item.id==="workbench.action.chat.voteUp")?p.createInstance(O3t,y,S):yO(p,y,S)}));const v=t.add(this.instantiationService.createInstance(ene)),w=()=>{if(As(C.currentElement)&&C.currentElement.agent)return v.setAgent(C.currentElement.agent.id),v.domNode},b=ast(()=>As(C.currentElement)?C.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupUpdatableHover(va("element"),o,w,b)),t.add(pe(o,xe.KEY_DOWN,y=>{const S=new os(y);if(S.equals(E.Space)||S.equals(E.Enter)){const M=w();M&&this.hoverService.showHover({content:M,target:o,trapFocus:!0,actions:b.actions},!0)}else S.equals(E.Escape)&&this.hoverService.hideHover()}));const C={avatarContainer:r,username:a,detail:l,referencesListContainer:d,value:h,rowContainer:i,elementDisposables:u,titleToolbar:m,templateDisposables:t,contextKeyService:f,agentHover:v};return C}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const s=ip(e)?"request":As(e)?"response":"welcome";this.traceLayout("renderElement",`${s}, index=${t}`),QPt.bindTo(i.contextKeyService).set(As(e)),jPt.bindTo(i.contextKeyService).set(ip(e)),GPt.bindTo(i.contextKeyService).set(As(e)&&e.agentOrSlashCommandDetected),As(e)?(qPt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),A4e.bindTo(i.contextKeyService).set(e.vote===zV.Up?"up":e.vote===zV.Down?"down":"")):A4e.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(As(e)&&e.errorDetails?.responseIsFiltered);if(htt.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",ip(e)),i.rowContainer.classList.toggle("interactive-response",As(e)),i.rowContainer.classList.toggle("interactive-welcome",XW(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",As(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Yo(i.detail),As(e)&&this.renderDetail(e,i),As(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${s}, index=${t}`);const r=i.elementDisposables.add(new Z),a=i.elementDisposables.add(new sQ),c=l=>{try{this.doNextProgressiveRender(e,t,i,!!l,r)&&a.cancel()}catch(d){throw a.cancel(),d}};a.cancelAndSet(c,50,gt(i.rowContainer)),c(!0)}else if(As(e)){const r=Oze(e.response.value);this.basicRenderElement(r,e,t,i)}else if(ip(e)){const r="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);this.basicRenderElement([{content:new Xt(r),kind:"markdownContent"}],e,t,i)}else this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(Ni(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Yo(t.detail),e.slashCommand&&e.agentOrSlashCommandDetected){let i="";const s=`${O1}${e.slashCommand.name}`;e.isComplete?i=g(Vm,0,"used {0} [[(rerun without)]]",s):i=g(Vm,1,"using {0}",s),_a(t.detail,pNe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:o=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=rzt)}renderAvatar(e,t){const i=As(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??Ce.account;if(i instanceof P){const s=we("img.icon");s.src=lp.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(we(".avatar",void 0,s))}else{const s=we($e.asCSSSelector(i));t.avatarContainer.replaceChildren(we(".avatar.codicon-avatar",void 0,s))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===sf.DARK?e.iconDark:e?.icon?e.icon:Ce.copilot}basicRenderElement(e,t,i,s){const o=As(t)&&(!t.isComplete||t.isCanceled||t.errorDetails?.responseIsFiltered||t.errorDetails?.responseIsIncomplete);Yo(s.value),Yo(s.referencesListContainer),As(t)&&this.renderDetail(t,s),this.renderContentReferencesIfNeeded(t,s,s.elementDisposables);let r=0,a=0;if(e.forEach((d,h)=>{const u=d.kind==="treeData"?this.renderTreeData(d.treeData,t,s,r++):d.kind==="markdownContent"?this.renderMarkdown(d.content,t,s,o,a):d.kind==="progressMessage"&&JK(e,h)?this.renderProgressMessage(d,!1):d.kind==="progressTask"?this.renderProgressTask(d,!1,t,s):d.kind==="command"?this.renderCommandButton(t,d):d.kind==="textEditGroup"?this.renderTextEdit(t,d,s):d.kind==="warning"?this.renderNotification("warning",d.content):d.kind==="confirmation"?this.renderConfirmation(t,d,s):void 0;u&&(s.value.appendChild(u.element),s.elementDisposables.add(u),"codeBlockCount"in u&&(a+=u.codeBlockCount))}),As(t)&&t.errorDetails?.message){const d=this.renderNotification(t.errorDetails.responseIsFiltered?"info":"error",new Xt(t.errorDetails.message));s.elementDisposables.add(d),s.value.appendChild(d.element)}const c=s.rowContainer.offsetHeight,l=!t.currentRenderedHeight||t.currentRenderedHeight!==c;if(t.currentRenderedHeight=c,l){const d=s.elementDisposables.add(xd(gt(s.value),()=>{t.currentRenderedHeight=s.rowContainer.offsetHeight,d.dispose(),this._onDidChangeItemHeight.fire({element:t,height:t.currentRenderedHeight})}))}}updateItemHeight(e){if(!e.currentElement)return;const t=e.rowContainer.offsetHeight;e.currentElement.currentRenderedHeight=t,this._onDidChangeItemHeight.fire({element:e.currentElement,height:t})}renderWelcomeMessage(e,t){Yo(t.value),Yo(t.referencesListContainer),Jl(t.referencesListContainer);for(const o of e.content)if(Array.isArray(o)){const r=this.instantiationService.createChild(new Dl([Pe,t.contextKeyService]));t.elementDisposables.add(r.createInstance($ie,t.value,o,this.location,void 0,a=>this._onDidClickFollowup.fire(a)))}else{const r=this.renderMarkdown(o,e,t);t.value.appendChild(r.element),t.elementDisposables.add(r)}const i=t.rowContainer.offsetHeight,s=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,s){const o=t.elementDisposables.add(xd(gt(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,s,o){if(!this._isVisible)return!0;const r=Oze(e.response.value);let a=!1;if(e.isCanceled)this.traceLayout("runProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(r,e,t,i),a=!0;else{e.renderData??={renderedParts:[]};const l=e.renderData.renderedParts,d=[],h=[];let u=!1;if(r.forEach((f,p)=>{const m=l[p];if(m){if((f.kind==="markdownContent"||f.kind==="progressMessage")&&Q3t(m)){const v=this.getDataForProgressiveRender(e,l3e(f.content),m);v!==void 0&&m.renderedWordCount!==v?.actualWordCount?(this.traceLayout("doNextProgressiveRender",`Rendering changed part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v):!m.isFullyRendered&&!v&&(u=!0)}else if(f.kind==="progressMessage"&&Uxe(m)&&(m.isAtEndOfResponse!==JK(r,p)||m.isLast!==(p===r.length-1)))h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="progressTask"&&d3e(m)){const v=f.isSettled?.()??!0;(m.isSettled!==v||f.progress.length!==m.progressLength||v)&&(h[p]={task:f,isSettled:v,progressLength:f.progress.length})}}else if(f.kind==="treeData")h[p]=f.treeData;else if(f.kind==="progressMessage")h[p]={progressMessage:f,isAtEndOfResponse:JK(r,p),isLast:p===r.length-1};else if(f.kind==="command"||f.kind==="textEditGroup"||f.kind==="confirmation"||f.kind==="warning")h[p]=f;else if(f.kind==="progressTask")h[p]={task:f,isSettled:f.isSettled?.()??!0,progressLength:f.progress.length};else{const v=this.getDataForProgressiveRender(e,l3e(f.content),{renderedWordCount:0,lastRenderTime:0});v!==void 0&&(this.traceLayout("doNextProgressiveRender",`Rendering new part ${p}, wordCountResult=${v.actualWordCount}, rate=${v.rate}`),h[p]={renderedWordCount:v.actualWordCount,lastRenderTime:Date.now(),isFullyRendered:v.isFullString,originalMarkdown:f.content},d[p]=v)}}),a=h.filter(f=>!("isSettled"in f)||!f.isSettled).length===0&&!u,a&&e.isComplete)this.traceLayout("runProgressiveRender",`end progressive render, index=${t} and clearing renderData, response is complete, index=${t}`),e.renderData=void 0,o.clear(),this.basicRenderElement(r,e,t,i);else{if(a)return!1;{o.clear(),this.renderContentReferencesIfNeeded(e,i,o);let f=!1;h.forEach((p,m)=>{if(!p)return;let v;if(U3t(p))v=this.renderTreeData(p,e,i,m);else if(Uxe(p))j3t(h,m)?v=this.renderProgressMessage(p.progressMessage,m===h.length-1):v=null;else if(d3e(p))v=this.renderProgressTask(p.task,!p.isSettled,e,i);else if($3t(p))v=this.renderCommandButton(e,p);else if(G3t(p))v=this.renderTextEdit(e,p,i);else if(q3t(p))v=this.renderConfirmation(e,p,i);else if(z3t(p))v=this.renderNotification("warning",p.content);else if(!f&&d[m]){const{value:b}=d[m],C=h[m],y="originalMarkdown"in C?C.originalMarkdown:void 0,S=new Xt(b,y);v=this.renderMarkdown(S,e,i,!0),f=!0}if(v===void 0)return;l[m]=p;const w=i.value.children[m];w?v===null?i.value.replaceChild(Pl("span.placeholder-for-deleted-thing"),w):i.value.replaceChild(v.element,w):v&&i.value.appendChild(v.element),v&&o.add(v)})}}}const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,s||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),a}renderTreeData(e,t,i,s){const o=new Z,r=o.add(this._treePool.get()),a=r.object;if(o.add(a.onDidOpen(c=>{c.element&&!("children"in c.element)&&this.openerService.open(c.element.uri)})),o.add(a.onDidChangeCollapseState(()=>{this.updateItemHeight(i)})),o.add(a.onContextMenu(c=>{c.browserEvent.preventDefault(),c.browserEvent.stopPropagation()})),a.setInput(e).then(()=>{r.isStale()||(a.layout(),this.updateItemHeight(i))}),As(t)){const c={treeDataId:e.uri.toString(),treeIndex:s,focus(){a.domFocus()}};o.add(a.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(t.id,c.treeIndex)}));const l=this.fileTreesByResponseId.get(t.id)??[];l.push(c),this.fileTreesByResponseId.set(t.id,Lc(l,d=>d.treeDataId)),o.add(Ee(()=>this.fileTreesByResponseId.set(t.id,l.filter(d=>d.treeDataId!==e.uri.toString()))))}return{element:a.getHTMLElement().parentElement,dispose:()=>{o.dispose()}}}renderContentReferencesIfNeeded(e,t,i){if(As(e)&&this._usedReferencesEnabled&&e.contentReferences.length){Oh(t.referencesListContainer);const s=this.renderContentReferencesListData(null,e.contentReferences,e,t);t.referencesListContainer.firstChild?t.referencesListContainer.replaceChild(s.element,t.referencesListContainer.firstChild):t.referencesListContainer.appendChild(s.element),i.add(s)}else Jl(t.referencesListContainer)}renderContentReferencesListData(e,t,i,s){const o=new Z,r=e?.content.value??(t.length>1?g(Vm,2,"Used {0} references",t.length):g(Vm,3,"Used {0} reference",1)),a=Pl(".chat-used-context-icon"),c=w=>w.usedReferencesExpanded?Ce.chevronDown:Ce.chevronRight;a.classList.add(...$e.asClassNameArray(c(i)));const l=Pl(".chat-used-context-label",void 0),d=o.add(new Tu(l,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0})),h=Pl(".chat-used-context",void 0,l);d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),o.add(d.onDidClick(()=>{a.classList.remove(...$e.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...$e.asClassNameArray(c(i))),h.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this.updateItemHeight(s),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const f=o.add(this._contentReferencesListPool.get()).object;h.appendChild(f.getHTMLElement().parentElement),o.add(f.onDidOpen(w=>{if(w.element&&"reference"in w.element){const b="variableName"in w.element.reference?w.element.reference.value:w.element.reference,C=P.isUri(b)?b:b?.uri;C&&this.openerService.open(C,{fromUserGesture:!0,editorOptions:{...w.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),o.add(f.onContextMenu(w=>{w.browserEvent.preventDefault(),w.browserEvent.stopPropagation()}));const v=Math.min(t.length,6)*22;return f.layout(v),f.getHTMLElement().style.height=`${v}px`,f.splice(0,f.length,t),{element:h,dispose:()=>{o.dispose()}}}updateAriaLabel(e,t,i){e.ariaLabel=i?g(Vm,4,"{0}, expanded",t):g(Vm,5,"{0}, collapsed",t)}renderProgressTask(e,t,i,s){if(As(i)){if(e.progress.length){const o=this.renderContentReferencesListData(e,e.progress,i,s),r=we(".chat-progress-task");return r.appendChild(o.element),{element:r,dispose:o.dispose}}return this.renderProgressMessage(e,t)}}renderProgressMessage(e,t){t&&sa(e.content.value);const i=t?$e.modify(Ce.loading,"spin").id:Ce.check.id,s=new Xt(`$(${i}) ${e.content.value}`,{supportThemeIcons:!0}),o=this.renderer.render(s);return o.element.classList.add("progress-step"),o}renderCommandButton(e,t){const i=Pl(".chat-command-button"),s=new Z,o=!As(e)||!e.isStale,r=o?t.command.tooltip:g(Vm,6,"Button not available in restored chat"),a=s.add(new Tu(i,{...yQ,supportIcons:!0,title:r}));return a.label=t.command.title,a.enabled=o,s.add(a.onDidClick(()=>this.commandService.executeCommand(t.command.id,...t.command.arguments??[]))),{dispose(){s.dispose()},element:i}}renderNotification(e,t){const i=Pl(".chat-notification-widget");let s,o;switch(e){case"warning":s=Ce.warning,o=".chat-warning-codicon";break;case"error":s=Ce.error,o=".chat-error-codicon";break;case"info":s=Ce.info,o=".chat-info-codicon";break}i.appendChild(Pl(o,void 0,OS(s)));const r=this.renderer.render(t);return i.appendChild(r.element),{element:i,dispose(){r.dispose()}}}renderConfirmation(e,t,i){const s=new Z,o=s.add(this.instantiationService.createInstance(txe,t.title,t.message,[{label:g(Vm,7,"Accept"),data:t.data},{label:g(Vm,8,"Dismiss"),data:t.data,isSecondary:!0}]));return o.setShowButtons(!t.isUsed),s.add(o.onDidClick(async r=>{if(As(e)){const a=`${r.label}: "${t.title}"`,c=r.isSecondary?{rejectedConfirmationData:[r.data]}:{acceptedConfirmationData:[r.data]};c.agentId=e.agent?.id,await this.chatService.sendRequest(e.sessionId,a,c)&&(t.isUsed=!0,o.setShowButtons(!1),this.updateItemHeight(i))}})),{element:o.domNode,dispose(){s.dispose()}}}renderTextEdit(e,t,i){if(this.rendererOptions.renderTextEditsAsSummary?.(t.uri))return As(e)&&e.response.value.every(l=>l.kind==="textEditGroup")?{element:Pl(".interactive-edits-summary",void 0,e.isComplete?g(Vm,10,"Made changes."):g(Vm,9,"Making changes...")),dispose(){}}:void 0;const s=new Z,o=new ai;let r=!1;s.add(Ee(()=>{r=!0,o.dispose(!0)}));const a=this._diffEditorPool.get();s.add(a.object.onDidChangeContentHeight(()=>{a.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)}));const c={element:e,edit:t,diffData:(async()=>{const l=await this.textModelService.createModelReference(t.uri);if(r){l.dispose();return}s.add(l);const d=l.object.textEditorModel;let h="";if(t.state)h=t.state.sha1;else{const m=new tV;m.canComputeSHA1(d)&&(h=m.computeSHA1(d),t.state={sha1:h,applied:0})}const u=this.modelService.createModel(fQ(d.createSnapshot()),{languageId:d.getLanguageId(),onDidChange:T.None},P.from({scheme:_e.vscodeChatCodeBlock,path:d.uri.path,query:Dr()}),!1),f=await this.textModelService.createModelReference(u.uri);s.add(f);const p=[];if(As(e)){const m=this.chatService.getSession(e.sessionId);for(const v of m.getRequests())if(v.response){for(const w of v.response.response.value)if(!(w.kind!=="textEditGroup"||w.state?.applied||!_n(w.uri,t.uri)))for(const b of w.edits){const C=b.map(iMe.asEditOperation);p.push(C)}if(v.response===e.model)break}}for(const m of p)u.pushEditOperations(null,m,()=>null);return{modified:u,original:d,originalSha1:h}})()};return a.object.render(c,this._currentLayoutWidth,o.token),{element:a.object.element,dispose(){s.dispose(),a.dispose()}}}renderMarkdown(e,t,i,s=!1,o=0){const r=new Z,a=[],c=[];let l=o;const d=this.renderer.render(e,{fillInIncompleteTokens:s,codeBlockRendererSync:(h,u)=>{const f=l++;let p,m,v;if(Oa(h,e5t))try{const C=t5t(u);m=C.range&&O.lift(C.range),p=this.textModelService.createModelReference(C.uri).then(y=>y.object)}catch{return Pl("div")}else{if(!ip(t)&&!As(t))return console.error("Trying to render code block in welcome",t.id,f),Pl("div");const C=As(t)||ip(t)?t.sessionId:"",y=this.codeBlockModelCollection.getOrCreate(C,t,f);v=y.vulns,p=y.model}const w=As(t)&&t.errorDetails?.responseIsFiltered,b=this.renderCodeBlock({languageId:h,textModel:p,codeBlockIndex:f,element:t,range:m,hideToolbar:w,parentContextKeyService:i.contextKeyService,vulns:v},u);if(r.add(b.object.onDidChangeContentHeight(()=>{b.object.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),As(t)){const C={codeBlockIndex:f,element:t,focus(){b.object.focus()}};if(c.push(C),b.object.uri){const y=b.object.uri;this.codeBlocksByEditorUri.set(y,C),r.add(Ee(()=>this.codeBlocksByEditorUri.delete(y)))}}return a.push(b),b.object.element},asyncRenderCallback:()=>this.updateItemHeight(i)});return As(t)&&(this.codeBlocksByResponseId.set(t.id,c),r.add(Ee(()=>this.codeBlocksByResponseId.delete(t.id)))),r.add(this.markdownDecorationsRenderer.walkTreeAndAnnotateReferenceLinks(d.element)),a.reverse().forEach(h=>r.add(h)),{codeBlockCount:l-o,element:d.element,dispose(){d.dispose(),r.dispose()}}}renderCodeBlock(e,t){const i=this._editorPool.get(),s=i.object;return As(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),s.render(e,this._currentLayoutWidth,this.rendererOptions.editableCodeBlock),i}getDataForProgressiveRender(e,t,i){const s=this.getProgressiveRenderRate(e),o=i.lastRenderTime===0?1:i.renderedWordCount+Math.floor((Date.now()-i.lastRenderTime)/1e3*s);if(o!==i.renderedWordCount)return{...GFe(t.value,o),rate:s}}disposeElement(e,t,i){i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},Mxe=vP,vP.ID="item",vP);fne=Mxe=D([_(6,be),_(7,Re),_(8,Ze),_(9,fr),_(10,Pe),_(11,pn),_(12,ji),_(13,Rn),_(14,Ai),_(15,el),_(16,Rw)],fne);let Pxe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=ip(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return fne.ID}hasDynamicHeight(e){return!0}};Pxe=D([_(1,Ze)],Pxe);let Fxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(AEe,e,Te.ChatCodeBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Fxe=D([_(3,be)],Fxe);let Oxe=class extends ${inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._pool=this._register(new Bhe(()=>s.createInstance(xEe,e,Te.ChatCompareBlock,t,i)))}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{e.reset(),t=!0,this._pool.release(e)}}}};Oxe=D([_(3,be)],Oxe);let Bxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i,s){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=s,this._pool=this._register(new Bhe(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".interactive-response-progress-tree");return this._register(nOe(t,this.themeService)),this.instantiationService.createInstance(Fee,"ChatListRenderer",t,new Hxe,new B3t,[new W3t(e,this.configService.getValue("explorer.decorations"))],new H3t,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:s=>s.uri.toString()},accessibilityProvider:{getAriaLabel:s=>s.label,getWidgetAriaLabel:()=>g(Vm,11,"File Tree")},alwaysConsumeMouseWheel:!1})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Bxe=D([_(1,be),_(2,Re),_(3,pn)],Bxe);let Wxe=class extends ${get inUse(){return this._pool.inUse}constructor(e,t,i){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.themeService=i,this._pool=this._register(new Bhe(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(B1,{onDidChangeVisibility:this._onDidChangeVisibility})),t=Pl(".chat-used-context-list");return this._register(nOe(t,this.themeService)),this.instantiationService.createInstance(Gbe,"ChatListRenderer",t,new F3t,[this.instantiationService.createInstance(pne,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:s=>{if(s.kind==="warning")return s.content.value;const o=s.reference;return"variableName"in o?o.variableName:P.isUri(o)?yr(o.path):yr(o.uri.path)},getWidgetAriaLabel:()=>g(Vm,12,"Used References")},dnd:{getDragURI:s=>{if(s.kind==="warning")return null;const{reference:o}=s;return"variableName"in o?null:P.isUri(o)?o.toString():o.uri.toString()},dispose:()=>{},onDragOver:()=>!1,drop:()=>{}}})}get(){const e=this._pool.get();let t=!1;return{object:e,isStale:()=>t,dispose:()=>{t=!0,this._pool.release(e)}}}};Wxe=D([_(1,be),_(2,pn)],Wxe);class F3t{getHeight(e){return 22}getTemplateId(e){return pne.TEMPLATE_ID}}var wP;let pne=(wP=class{constructor(e,t,i){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.templateId=Nxe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return $e.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===sf.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,s){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:Ce.warning});return}const o=e.reference,r=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in o)if(o.value){const a=P.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:Mx(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r})}else{const a=this.chatVariablesService.getVariable(o.variableName);i.label.setLabel(`#${o.variableName}`,void 0,{title:a?.description})}else{const a="uri"in o?o.uri:o;L9(a,_e.mailto,_e.http,_e.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??Ce.globe}):i.label.setFile(a,{fileKind:Ic.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0})}}disposeTemplate(e){e.templateDisposables.dispose()}},Nxe=wP,wP.TEMPLATE_ID="contentReferencesListRenderer",wP);pne=Nxe=D([_(1,pn),_(2,Mz)],pne);class Bhe extends ${get inUse(){return this._inUse}constructor(e){super(),this._itemFactory=e,this.pool=[],this._inUse=new Set}get(){if(this.pool.length>0){const t=this.pool.pop();return this._inUse.add(t),t}const e=this._register(this._itemFactory());return this._inUse.add(e),e}release(e){this._inUse.delete(e),this.pool.push(e)}}class O3t extends eC{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}const Qce=class Qce{getHeight(e){return Qce.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Qce.ITEM_HEIGHT=22;let Hxe=Qce;class B3t{isIncompressible(e){return!e.children}}class W3t{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,s){i.label.element.style.display="flex";const o=e.element.elements.map(r=>r.label);i.label.setResource({resource:e.element.elements[0].uri,name:o},{title:e.element.elements[0].label,fileKind:e.children?Ic.FOLDER:Ic.FILE,extraClasses:["explorer-item"],fileDecorations:this.decorations})}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));return{templateDisposables:t,label:i}}renderElement(e,t,i,s){i.label.element.style.display="flex",!e.children.length&&e.element.type!==an.Directory?i.label.setFile(e.element.uri,{fileKind:Ic.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:Ic.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class H3t{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}function U3t(n){return"label"in n}function l3e(n){return typeof n=="string"?{value:n}:n}function V3t(n){return n&&"kind"in n&&n.kind==="progressMessage"}function d3e(n){return n&&"isSettled"in n}function z3t(n){return n&&"kind"in n&&n.kind==="warning"}function Uxe(n){return n&&"isAtEndOfResponse"in n}function $3t(n){return n&&"kind"in n&&n.kind==="command"}function G3t(n){return n&&"kind"in n&&n.kind==="textEditGroup"}function q3t(n){return n&&"kind"in n&&n.kind==="confirmation"}function Q3t(n){return n&&"renderedWordCount"in n}function JK(n,e){return n.slice(e).every(V3t)}function j3t(n,e){return n.slice(e).every(Uxe)}var gX,q0;let Vxe=(q0=class extends ${get configuration(){return this._config}constructor(e,t,i,s,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=s,this.configurationService=o,this.themeService=r,this.viewDescriptorService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.themeService.onDidColorThemeChange(c=>this.update())),this._register(this.viewDescriptorService.onDidChangeLocation(c=>{c.views.some(l=>l.id===e)&&this.update()})),this._register(this.configurationService.onDidChangeConfiguration(c=>{gX.relevantSettingIds.some(l=>c.affectsConfiguration(l))&&this.update()})),this.update()}update(){const e=this.configurationService.getValue("editor"),t=this.configurationService.getValue("chat")?.editor,i=this.configurationService.getValue("editor.accessibilitySupport");this._config={foreground:this.themeService.getColorTheme().getColor(this.foreground),inputEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.inputEditorBackgroundColor),accessibilitySupport:i},resultEditor:{backgroundColor:this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),fontSize:t.fontSize,fontFamily:t.fontFamily==="default"?e.fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:t.lineHeight?t.lineHeight:gX.lineHeightEm*t.fontSize,bracketPairColorization:{enabled:this.configurationService.getValue("editor.bracketPairColorization.enabled"),independentColorPoolPerBracketType:this.configurationService.getValue("editor.bracketPairColorization.independentColorPoolPerBracketType")},wordWrap:t.wordWrap,fontLigatures:e.fontLigatures}},this._onDidChange.fire()}},gX=q0,q0.lineHeightEm=1.4,q0.relevantSettingIds=["chat.editor.lineHeight","chat.editor.fontSize","chat.editor.fontFamily","chat.editor.fontWeight","chat.editor.wordWrap","editor.cursorBlinking","editor.fontLigatures","editor.accessibilitySupport","editor.bracketPairColorization.enabled","editor.bracketPairColorization.independentColorPoolPerBracketType"],q0);Vxe=gX=D([_(4,Re),_(5,pn),_(6,z_)],Vxe);const K3t=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,Y3t=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,J3t=/\/([\w_\-]+)(?=(\s|$|\b))/i;let mne=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=lc.Panel,s){const o=[],r=this.variableService.getDynamicVariables(e);let a=1,c=1;for(let h=0;h1&&a?.selectedAgent?a.selectedAgent:f[0];if(!p||!p.locations.includes(r)||o.some(b=>b instanceof tp)||o.some(b=>b instanceof kb&&b.text.trim()!==""||!(b instanceof tp)))return;const v=o.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new tp(h,u,p)}tryToParseVariable(e,t,i,s){const o=e.match(Y3t);if(!o)return;const[r,a]=o,c=o[2]??"",l=new hi(t,t+r.length),d=new O(i.lineNumber,i.column,i.lineNumber,i.column+r.length),h=s.find(p=>p instanceof tp),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new m6(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,s,o){const r=e.match(J3t);if(!r||o.some(u=>u instanceof UV))return;const[a,c]=r,l=new hi(i,i+a.length),d=new O(s.lineNumber,s.column,s.lineNumber,s.column+a.length),h=o.find(u=>u instanceof tp);if(h){if(o.some(v=>v instanceof kb&&v.text.trim()!==""||!(v instanceof tp)&&!(v instanceof kb)))return;const f=o.at(-1)?.range.endExclusive??0;if(t.slice(f,i).trim()!=="")return;const m=h.agent.slashCommands.find(v=>v.name===c);if(m)return new HV(l,d,m)}else{const f=this.slashCommandService.getCommands().find(p=>p.command===c);if(f)return new UV(l,d,f)}}tryToParseDynamicVariable(e,t,i,s){const o=s.find(r=>r.range.startLineNumber===i.lineNumber&&r.range.startColumn===i.column);if(o){const r=o.range.endColumn-o.range.startColumn,a=e.substring(0,r),c=new hi(t,t+r);return new VV(c,o.range,a,o.id,o.modelDescription,o.data)}}};mne=D([_(0,yp),_(1,Mz),_(2,DPe)],mne);let zxe=class extends ${constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new wi}dispose(){super.dispose(),this.clear()}get(e,t,i){const s=this.getUri(e,t,i),o=this._models.get(s);if(o)return{model:o.model.then(r=>r.object),vulns:o.vulns}}getOrCreate(e,t,i){const s=this.get(e,t,i);if(s)return s;const o=this.getUri(e,t,i),r=this.textModelService.createModelReference(o);return this._models.set(o,{model:r,vulns:[]}),{model:r.then(a=>a.object),vulns:[]}}clear(){this._models.forEach(async e=>(await e.model).dispose()),this._models.clear()}async update(e,t,i,s){const o=this.getOrCreate(e,t,i),r=Azt(s.text),a=X3t(r.newText,s.languageId);this.setVulns(e,t,i,r.vulnerabilities);const c=(await o.model).textEditorModel;if(s.languageId){const d=this.languageService.getLanguageIdByLanguageName(s.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(xo.LF);if(a!==l)if(a.startsWith(l)){const d=a.slice(l.length),h=c.getLineCount(),u=c.getLineMaxColumn(h);c.applyEdits([{range:new O(h,u,h,u),text:d}])}else c.setValue(a)}setVulns(e,t,i,s){const o=this.getUri(e,t,i),r=this._models.get(o);r&&(r.vulns=s)}getUri(e,t,i){const s=this.getUriMetaData(t);return P.from({scheme:_e.vscodeChatCodeBlock,authority:e,path:`/${t.id}/${i}`,fragment:s?JSON.stringify(s):void 0})}getUriMetaData(e){if(As(e))return{references:e.contentReferences.map(t=>{const i="variableName"in t.reference?t.reference.value:t.reference;if(i)return P.isUri(i)?{uri:i.toJSON()}:{uri:i.uri.toJSON(),range:i.range}})}}};zxe=D([_(0,Di),_(1,Rn)],zxe);function X3t(n,e){return e==="php"&&!n.trim().startsWith("<")?`e instanceof tp))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(),this.location=e,this.viewContext=t,this.viewOptions=i,this.styles=s,this.contextKeyService=r,this.instantiationService=a,this.chatService=c,this.chatAgentService=l,this.contextMenuService=h,this.chatAccessibilityService=u,this.logService=f,this.themeService=p,this.chatSlashCommandService=m,this._onDidSubmitAgent=this._register(new I),this.onDidSubmitAgent=this._onDidSubmitAgent.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidChangeViewModel=this._register(new I),this.onDidChangeViewModel=this._onDidChangeViewModel.event,this._onDidScroll=this._register(new I),this.onDidScroll=this._onDidScroll.event,this._onDidClear=this._register(new I),this.onDidClear=this._onDidClear.event,this._onDidAcceptInput=this._register(new I),this.onDidAcceptInput=this._onDidAcceptInput.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidChangeContentHeight=new I,this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.contribs=[],this.visibleChangeCount=0,this._visible=!1,this.previousTreeScrollHeight=0,this.viewModelDisposables=this._register(new Z),JPt.bindTo(r).set(!0),ZPt.bindTo(r).set(e),eFt.bindTo(r).set("resource"in t),this.agentInInput=gtt.bindTo(r),this.requestInProgress=j7.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(zxe)),this._register(o.registerCodeEditorOpenHandler(async(v,w,b)=>{let C=v.resource;if(Rx(C,_e.vscodeCopilotBackingChatCodeBlock)&&(C=C.with({scheme:_e.vscodeChatCodeBlock})),C.scheme!==_e.vscodeChatCodeBlock)return null;const y=C.path.split("/").at(1);if(!y)return null;const S=this.viewModel?.getItems().find(M=>M.id===y);if(!S)return null;this.reveal(S),await Ta(0);for(const M of this.renderer.editorsInUse()??[])if(Fn.isEqual(M.uri,C,!0)){const k=M.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.startLineNumber??v.options.selection.endLineNumber,endColumn:v.options.selection.startColumn??v.options.selection.endColumn}),k}return null}))}set lastSelectedAgent(e){this.parsedChatRequest=void 0,this._lastSelectedAgent=e,this._onDidChangeParsedInput.fire()}get lastSelectedAgent(){return this._lastSelectedAgent}get supportsFileReferences(){return!!this.viewOptions.supportsFileReferences}get input(){return this.inputPart}get inputEditor(){return this.inputPart.inputEditor}get inputUri(){return this.inputPart.inputUri}get contentHeight(){return this.inputPart.contentHeight+this.tree.contentHeight}render(e){const t="viewId"in this.viewContext?this.viewContext.viewId:void 0;this.editorOptions=this._register(this.instantiationService.createInstance(Vxe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,s=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=he(e,Rpe(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:s,renderStyle:o}),this.listContainer=he(this.container,Rpe(".interactive-list"))):(this.listContainer=he(this.container,Rpe(".interactive-list")),this.createInput(this.container,{renderFollowups:s,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),iB(this.tree)),this.contribs=$xe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Ma(a));return}}).filter(yl)}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}moveFocus(e,t){if(!As(e))return;const i=this.viewModel?.getItems();if(!i)return;const s=i.filter(a=>As(a)),o=s.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;r<0||r>s.length-1||this.focus(s[r])}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(s=>({element:s,collapsed:!1,collapsible:!1}));this.tree.setChildren(null,t,{diffIdentityProvider:{getId:s=>(As(s)||ip(s)?s.dataId:s.id)+(XW(s)&&this.viewModel?`_${Vf[this.viewModel.initState]}`:"")+`${ip(s)||XW(s)}${As(s)&&s.renderData?`_${this.visibleChangeCount}`:""}`+(As(s)?`_${s.contentReferences.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&As(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&XW(i)?this.renderFollowups(i.sampleQuestions):this.renderFollowups(void 0)}}async renderFollowups(e,t){this.inputPart.renderFollowups(e,t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}setVisible(e){const t=this._visible;this._visible=e,this.visibleChangeCount++,this.renderer.setVisible(e),this.input.setVisible(e),e?this._register(PS(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this.instantiationService.createChild(new Dl([Pe,this.contextKeyService]))),s=i.createInstance(Pxe,this.viewOptions.defaultElementHeight??200),o={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},r=document.createElement("div");r.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(r),this.renderer=this._register(i.createInstance(fne,this.editorOptions,this.location,t,o,this._codeBlockModelCollection,r)),this._register(this.renderer.onDidClickFollowup(a=>{this.acceptInput(a.message)})),this._register(this.renderer.onDidClickRerunWithAgentOrCommandDetection(a=>{const c=this.chatService.getSession(a.sessionId)?.getRequests().find(l=>l.id===a.requestId);c&&this.chatService.resendRequest(c,{noCommandDetection:!0,attempt:c.attempt,location:this.location}).catch(l=>this.logService.error("FAILED to rerun request",l))})),this.tree=i.createInstance(L7,"Chat",e,s,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(MEe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>ip(a)?a.message:As(a)?a.response.value:""},setRowLineHeight:!1,filter:this.viewOptions.filter?{filter:this.viewOptions.filter.bind(this.viewOptions)}:void 0,overrideStyles:{listFocusBackground:this.styles.listBackground,listInactiveFocusBackground:this.styles.listBackground,listActiveSelectionBackground:this.styles.listBackground,listFocusAndSelectionBackground:this.styles.listBackground,listInactiveSelectionBackground:this.styles.listBackground,listHoverBackground:this.styles.listBackground,listBackground:this.styles.listBackground,listFocusForeground:this.styles.listForeground,listHoverForeground:this.styles.listForeground,listInactiveFocusForeground:this.styles.listForeground,listInactiveSelectionForeground:this.styles.listForeground,listActiveSelectionForeground:this.styles.listForeground,listFocusAndSelectionForeground:this.styles.listForeground}}),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidChangeContentHeight(()=>{this.onDidChangeTreeContentHeight()})),this._register(this.renderer.onDidChangeItemHeight(a=>{this.tree.updateElementHeight(a.element,a.height)})),this._register(this.tree.onDidFocus(()=>{this._onDidFocus.fire()})),this._register(this.tree.onDidScroll(()=>{this._onDidScroll.fire()}))}onContextMenu(e){e.browserEvent.preventDefault(),e.browserEvent.stopPropagation();const t=e.element,i=this.contextKeyService.createOverlay([[htt.key,As(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:Te.ChatContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:i,getAnchor:()=>e.anchor,getActionsContext:()=>t})}onDidChangeTreeContentHeight(){this.tree.scrollHeight!==this.previousTreeScrollHeight&&this.tree.scrollTop+this.tree.renderHeight>=this.previousTreeScrollHeight-2&&xd(gt(this.listContainer),()=>{iB(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(b6,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle,menus:{executeToolbar:Te.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(s=>{s.setInputState&&typeof i=="object"&&i?.[s.id]&&s.setInputState(i[s.id])})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidDeleteContext(i=>this._onDidDeleteContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let s="";if(i.followup.agentId&&i.followup.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const o=this.chatAgentService.getAgent(i.followup.agentId);if(!o)return;this.lastSelectedAgent=o,s=`${$z}${o.name} `,i.followup.subCommand&&(s+=`${O1}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(s=`${O1}${i.followup.subCommand} `);s+=i.followup.message,this.acceptInput(s),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,result:i.response.result,action:{kind:"followUp",followup:i.followup}})})),this._register(this.inputPart.onDidChangeHeight(()=>{this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width),this._onDidChangeContentHeight.fire()})),this._register(this.inputEditor.onDidChangeModelContent(()=>this.parsedChatRequest=void 0)),this._register(this.chatAgentService.onDidChangeAgents(()=>this.parsedChatRequest=void 0))}onDidStyleChange(){this.container.style.setProperty("--vscode-interactive-result-editor-background-color",this.editorOptions.configuration.resultEditor.backgroundColor?.toString()??""),this.container.style.setProperty("--vscode-interactive-session-foreground",this.editorOptions.configuration.foreground?.toString()??""),this.container.style.setProperty("--vscode-chat-list-background",this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString()??"")}setModel(e,t){if(!this.container)throw new Error("Call render() before setModel()");this._codeBlockModelCollection.clear(),this.container.setAttribute("data-session-id",e.sessionId),this.viewModel=this.instantiationService.createInstance(mEe,e,this._codeBlockModelCollection),this.viewModelDisposables.add(T.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(s=>s?.kind==="addRequest")&&this.visible&&(iB(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.setState(t.inputValue),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.tree&&(this.onDidChangeItems(),iB(this.tree))}getFocus(){return this.tree.getFocus()[0]??void 0}reveal(e){this.tree.reveal(e)}focus(e){const i=this.tree.getNode(null).children.find(s=>s.element?.id===e.id);i&&(this.tree.setFocus([i.element]),this.tree.domFocus())}refilter(){this.tree.refilter()}setInputPlaceholder(e){this.viewModel?.setInputPlaceholder(e)}resetInputPlaceholder(){this.viewModel?.resetInputPlaceholder()}setInput(e=""){this.inputPart.setValue(e)}getInput(){return this.inputPart.inputEditor.getValue()}async acceptInput(e){return this._acceptInput(e?{query:e}:void 0)}async acceptInputWithPrefix(e){this._acceptInput({prefix:e})}collectInputState(){const e={};return this.contribs.forEach(t=>{t.getInputState&&(e[t.id]=t.getInputState())}),e}async _acceptInput(e){if(this.viewModel){this._onDidAcceptInput.fire();const t=this.getInput(),i=this.chatAccessibilityService.acceptRequest(),s=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,s,{location:this.location,parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r){this.inputPart.attachedContext.clear();const a=this.collectInputState();return this.inputPart.acceptInput(o?s:void 0,o?a:void 0),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),r.responseCompletePromise.then(()=>{const c=this.viewModel?.getItems().filter(As),l=c?.[c.length-1];this.chatAccessibilityService.acceptResponse(l,i)}),r.responseCreatedPromise}}}setContext(e,...t){e&&this.inputPart.attachedContext.clear(),this.inputPart.attachContext(...t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}getCodeBlockInfosForResponse(e){return this.renderer.getCodeBlockInfosForResponse(e)}getCodeBlockInfoForEditor(e){return this.renderer.getCodeBlockInfoForEditor(e)}getFileTreeInfosForResponse(e){return this.renderer.getFileTreeInfosForResponse(e)}getLastFocusedFileTreeForResponse(e){return this.renderer.getLastFocusedFileTreeForResponse(e)}focusLastMessage(){if(!this.viewModel)return;const e=this.tree.getNode(null).children,t=e[e.length-1];t&&(this.tree.setFocus([t.element]),this.tree.domFocus())}layout(e,t){t=Math.min(t,850),this.bodyDimension=new Tn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,s=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,o=e-i;this.tree.layout(o,t),this.tree.getHTMLElement().style.height=`${o}px`,this.renderer.layout(t),s&&iB(this.tree),this.listContainer.style.height=`${e-i}px`,this._onDidChangeHeight.fire(e)}setDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0},this._register(this.renderer.onDidChangeItemHeight(()=>this.layoutDynamicChatTreeItemMode()));const i=this._register(new Dn);this._register(this.tree.onDidScroll(s=>{this._dynamicMessageLayoutData?.enabled&&(i.value=xd(gt(this.listContainer),()=>{if(!s.scrollTopChanged||s.heightChanged||s.scrollHeightChanged)return;const o=s.height,r=s.scrollHeight-o-s.scrollTop;if(r===0)return;const a=this._dynamicMessageLayoutData?.maxHeight??t,c=this.bodyDimension?.width??this.container.offsetWidth;this.inputPart.layout(a,c);const l=this.inputPart.inputPartHeight,d=Math.min(o+r,a-l);this.layout(d+l,c)}))}))}updateDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0};let i=!1,s=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:s.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&iB(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},$xe=bP,bP.CONTRIBS=[],bP);A6=$xe=D([_(4,Qt),_(5,Pe),_(6,be),_(7,Rw),_(8,yp),_(9,lL),_(10,Vr),_(11,BZe),_(12,Ze),_(13,pn),_(14,DPe)],A6);var fX;const Gxe="vs/workbench/contrib/inlineChat/browser/inlineChatWidget";let qxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=s,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=di("div.inline-chat@root",[di("div.chat-widget@chatWidget"),di("div.progress@progress"),di("div.followUps.hidden@followUps"),di("div.previewDiff.hidden@previewDiff"),di("div.accessibleViewer@accessibleViewer"),di("div.status@status",[di("div.label.info.hidden@infoLabel"),di("div.actions.hidden@statusToolbar"),di("div.label.status.hidden@statusLabel"),di("div.actions.hidden@feedbackToolbar")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=T.filter(this._onDidChangeHeight.event,S=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this._progressBar=new y7(this._elements.progress),this._store.add(this._progressBar);let u=!1;this.scopedContextKeyService=this._store.add(s.createScoped(this._elements.chatWidget));const f=i.createChild(new Dl([Pe,this.scopedContextKeyService]),this._store);this._chatWidget=f.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!0,editorOverflowWidgetsDomNode:t.editorOverflowWidgetsDomNode,rendererOptions:t.rendererOptions,menus:{executeToolbar:t.inputMenuId,inputSideToolbar:t.widgetMenuId,telemetrySource:t.telemetrySource},filter:S=>XW(S)?!1:ip(S)?u:!0},{listForeground:Mc,listBackground:wEe,inputEditorBackground:SE,resultEditorBackground:us}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(tde(y5t),Ye(wEe)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const p=this._store.add(new Dn);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{const S=this._chatWidget.viewModel;if(!S){u=!1,p.clear();return}const M=()=>{let k=0;for(const N of S.getItems())if(ip(N)&&++k>=2)break;const F=k>=2;F!==u&&(u=F,this._chatWidget.refilter())};p.value=S.onDidChange(M)}));const m=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{m.clear();const S=this._chatWidget.viewModel;S&&m.add(S.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=Tzt.bindTo(this._contextKeyService);const v=this._store.add(Dd(this.domNode));this._store.add(v.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(v.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=Lzt.bindTo(s),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const w=t.statusMenuId instanceof Te?t.statusMenuId:t.statusMenuId.menu,b=t.statusMenuId instanceof Te?void 0:t.statusMenuId.options,C=this._instantiationService.createInstance(REe,this._elements.statusToolbar,w,b);this._store.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(C);const y={hiddenItemStrategy:wS.NoHide,toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}};if(t.feedbackMenuId){const S=this._instantiationService.createInstance(nC,this._elements.feedbackToolbar,t.feedbackMenuId,{...y,hiddenItemStrategy:wS.Ignore});this._store.add(S.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(S)}this._store.add(this._configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.followUps.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupUpdatableHover(va("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(S=>{S.sessionId===this._chatWidget.viewModel?.model.sessionId&&S.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(Vie,void 0,cc.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(ua.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=Z3t;if(this._configurationService.getValue(ua.InlineChat)){const t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();e=t?g(Gxe,0,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(Gxe,1,"Inline Chat Input, Run the Inline Chat Accessibility Help command for more information.")}this._chatWidget.inputEditor.updateOptions({ariaLabel:e})}}dispose(){this._store.dispose()}get domNode(){return this._elements.root}get chatWidget(){return this._chatWidget}saveState(){this._chatWidget.saveState()}layout(e){this._isLayouting=!0;try{this._doLayout(e)}finally{this._isLayouting=!1}}_doLayout(e){const t=this._getExtraHeight(),i=Zf(this._elements.progress),s=Zf(this._elements.followUps),o=Zf(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._elements.progress.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-s-o-t,e.width)}get contentHeight(){const e={followUpsHeight:Zf(this._elements.followUps),chatWidgetContentHeight:this._chatWidget.contentHeight,progressHeight:Zf(this._elements.progress),statusHeight:Zf(this._elements.status),extraHeight:this._getExtraHeight()};return e.progressHeight+e.chatWidgetContentHeight+e.followUpsHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(As(i)&&i.response.value.some(s=>s.kind==="textEditGroup"&&!s.state?.applied)){e=270;break}let t=this.contentHeight;return t-=this._chatWidget.contentHeight,t+=Math.min(this._chatWidget.input.contentHeight+e,this._chatWidget.contentHeight),t}_getExtraHeight(){return 26}updateProgress(e){e?(this._progressBar.show(),this._progressBar.infinite()):(this._progressBar.stop(),this._progressBar.hide())}get value(){return this._chatWidget.getInput()}set value(e){this._chatWidget.setInput(e)}selectAll(e=!0){let t=1;if(!e){const i=/^(\/\w+)\s*/.exec(this._chatWidget.inputEditor.getModel().getLineContent(1));i&&(t=i[1].length+1)}this._chatWidget.inputEditor.setSelection(new mt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.statusToolbar.classList.toggle("hidden",!e),this._elements.feedbackToolbar.classList.toggle("hidden",!e),this._elements.status.classList.toggle("actions",e),this._elements.infoLabel.classList.toggle("hidden",e),this._onDidChangeHeight.fire()}async getCodeBlockInfo(e){const{viewModel:t}=this._chatWidget;if(t){for(const i of t.getItems())if(As(i))return t.codeBlockModelCollection.get(t.sessionId,i,e)?.model}}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(mo(e))return Mf(e)?.response?.response.asString()}get usesDefaultChatModel(){return this.getChatModel()===this._defaultChatModel}getChatModel(){return this._chatWidget.viewModel?.model??this._defaultChatModel}setChatModel(e){this._chatWidget.setModel(e,{inputValue:void 0})}addToHistory(e){this._chatWidget.viewModel?.model===this._defaultChatModel&&this._chatWidget.input.acceptInput(e)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const s=this._defaultChatModel;if(!e?.message.value){for(const r of s.getRequests())s.removeRequest(r.id);return}const o=s.addRequest({parts:[],text:""},{variables:[]},0);if(s.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){s.completeResponse(o);return}return{cancel:()=>s.cancelRequest(o),complete:()=>s.completeResponse(o),appendContent:r=>{s.acceptResponseProgress(o,{kind:"markdownContent",content:new Xt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=nw(e);_a(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const o=this._elements.statusLabel.innerText,r=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(o,{classes:a,keepMessage:!0,title:r})},t.resetAfter)}const s=nw(e);_a(this._elements.statusLabel,...s),this._elements.statusLabel.className=`label status ${(t.classes??[]).join(" ")}`,this._elements.statusLabel.classList.toggle("hidden",!e),i?this._elements.statusLabel.dataset.state="temp":delete this._elements.statusLabel.dataset.state,t.title?this._elements.statusLabel.dataset.title=t.title:delete this._elements.statusLabel.dataset.title,this._onDidChangeHeight.fire()}reset(){this._chatWidget.saveState(),this.updateChatMessage(void 0),_a(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.statusToolbar.classList.add("hidden"),this._elements.feedbackToolbar.classList.add("hidden"),this.updateInfo(""),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(xl())}};qxe=D([_(2,be),_(3,Pe),_(4,ti),_(5,Ur),_(6,Re),_(7,Tw),_(8,Rn),_(9,Rw),_(10,Zc)],qxe);const Z3t=g(Gxe,2,"Inline Chat Input");let Qxe=class extends qxe{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,{...i,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()},r,s,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new Dn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height),super._doLayout(e.with(void 0,t)),this._elements.root.style.height=`${e.height-this._getExtraHeight()}px`}reset(){this._accessibleViewer.clear(),super.reset()}showAccessibleHunk(e,t){this._elements.accessibleViewer.classList.remove("hidden"),this._accessibleViewer.clear(),this._accessibleViewer.value=this._instantiationService.createInstance(jxe,this._elements.accessibleViewer,e,t,new e$t(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};Qxe=D([_(3,Pe),_(4,ti),_(5,be),_(6,Ur),_(7,Re),_(8,Tw),_(9,Rn),_(10,Rw),_(11,Zc)],Qxe);let jxe=fX=class extends Kk{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,s,o){const r=xi("width",0),a=xi("diff",fX._asMapping(i)),c=Dt(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=s.getModifiedOptions().get(x.lineHeight)*l;super(e,Au(!0),()=>{},Au(!1),r,Au(d),c,s,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(fX._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),s=bi.fromRangeInclusive(t[0]),o=bi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(Qxe,e,this.editor,{telemetrySource:"interactiveEditorWidget-toolbar",inputMenuId:Te.ChatExecute,widgetMenuId:Vzt,statusMenuId:{menu:zzt,options:{buttonConfigProvider:a=>new Set([Hzt,Uzt]).has(a.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:a.id===Wzt?{isSecondary:!1}:{isSecondary:!0}}},rendererOptions:{renderTextEditsAsSummary:a=>_n(a,t.getModel()?.uri)&&o.getValue(Mv.Mode)===yS.Live}}),this._disposables.add(this.widget.onDidChangeHeight(()=>{this.position&&this._relayout(this._computeHeight().linesValue)})),this._disposables.add(this.widget),this.create(),this._disposables.add(pe(this.domNode,"click",a=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const r=()=>{!this.position||!this.editor.hasModel()?this._ctxCursorPosition.reset():this.position.lineNumber===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("above"):this.position.lineNumber+1===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("below"):this._ctxCursorPosition.reset()};this._disposables.add(this.editor.onDidChangeCursorPosition(a=>r())),this._disposables.add(this.editor.onDidFocusEditorText(a=>r())),r()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=Math.min(640,this._availableSpaceGivenIndentation(this._indentationWidth));this._dimension=new Tn(t,e),this.widget.layout(this._dimension)}_availableSpaceGivenIndentation(e){const t=this.editor.getLayoutInfo();return t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth+(e??0))}_computeHeight(){const e=this.widget.contentHeight,t=this.editor.getLayoutInfo().height,i=Math.min(e,Math.max(this.widget.minHeight,t*.42));return{linesValue:i/this.editor.getOption(x.lineHeight),pixelsValue:i}}_onWidth(e){this._dimension&&this._doLayout(this._dimension.height)}show(e){Bt(this.container);const t=Gee.capture(this.editor),i=this.editor.getLayoutInfo(),s=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${s}px`;const o=this._computeHeight();if(super.show(e,o.linesValue),this._setWidgetMargins(e),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),e.lineNumber>1)this.editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e.delta(-1)),vt.Immediate);else{const a=this.editor.getTopForLineNumber(e.lineNumber)-o.pixelsValue,c=this.editor.getScrollHeight()-this.editor.getBottomForLineNumber(e.lineNumber),l=this.editor.getScrollTop()-c,d=Math.max(a,l);dt.startLineNumber&&i=i.startLineNumber;r--){const a=t.getLineFirstNonWhitespaceColumn(r);if(a!==0){o=r,s=a;break}}return Math.max(0,this.editor.getOffsetForColumn(o,s))}_setWidgetMargins(e){const t=this._calculateIndentationWidth(e);this._indentationWidth!==t&&(this._indentationWidth=this._availableSpaceGivenIndentation(t)>400?t:0,this.widget.domNode.style.marginLeft=`${this._indentationWidth}px`,this.widget.domNode.style.marginRight=`${this.editor.getLayoutInfo().minimap.minimapWidth}px`)}hide(){this.container.classList.remove("inside-selection"),this._ctxCursorPosition.reset(),this.widget.reset(),this.widget.chatWidget.setVisible(!1),super.hide(),Cu(g(t$t,0,"Closed inline chat widget"))}};Kxe=D([_(2,be),_(3,Pe),_(4,Re)],Kxe);var i$t=".monaco-workbench .inline-chat-content-widget{background-color:var(--vscode-inlineChat-background);border-radius:4px;box-shadow:0 4px 8px var(--vscode-inlineChat-shadow);padding:6px;z-index:50}.monaco-workbench .inline-chat-content-widget .hidden{display:none}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-session{max-width:unset}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part.compact{padding:0}.monaco-workbench .inline-chat-content-widget .message{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:11px;overflow:hidden}.monaco-workbench .inline-chat-content-widget .message>.codicon{font-size:12px;line-height:18px;padding-right:5px}";Ct(i$t,{});let Yxe=class{constructor(e,t,i,s){this._editor=t,this.suppressMouseDown=!1,this.allowEditorOverflow=!0,this._store=new Z,this._domNode=document.createElement("div"),this._inputContainer=document.createElement("div"),this._messageContainer=document.createElement("div"),this._onDidBlur=this._store.add(new I),this.onDidBlur=this._onDidBlur.event,this._visible=!1,this._focusNext=!1,this._defaultChatModel=this._store.add(i.createInstance(Vie,void 0,cc.Editor));const o=i.createChild(new Dl([Pe,this._store.add(s.createScoped(this._domNode))]),this._store);this._widget=o.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode(),renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!1,menus:{telemetrySource:"inlineChat-content"},filter:a=>!1},{listForeground:Mc,listBackground:wEe,inputEditorBackground:SE,resultEditorBackground:us}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.inputEditor.onDidContentSizeChange(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._messageContainer.classList.add("hidden","message"),this._domNode.appendChild(this._messageContainer);const r=Dd(this._domNode);this._store.add(r.onDidBlur(()=>{this._visible&&this._onDidBlur.fire()})),this._store.add(r)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[hs.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight;return this._widget.layout(Math.min(e,t),360),null}afterRender(){this._focusNext&&(this._focusNext=!1,this._widget.focusInput())}get chatWidget(){return this._widget}get isVisible(){return this._visible}get value(){return this._widget.inputEditor.getValue()}show(e){if(!this._visible){this._visible=!0,this._focusNext=!0,this._editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e),vt.Immediate),this._widget.inputEditor.setValue("");const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.session.placeholder??""),this._updateMessage(e.session.message??"")}_updateMessage(e){if(e){const t=nw(e);_a(this._messageContainer,...t)}this._messageContainer.style.display=e?"inherit":"none",this._editor.layoutContentWidget(this)}};Yxe=D([_(2,be),_(3,Pe)],Yxe);let _ne=class extends cC{get capabilities(){let e=Mi.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,s,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=s,this.filesConfigurationService=o,this.textResourceConfigurationService=r,this.customEditorLabelService=a,this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._preferredResource=t||e,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this._preferredResource.scheme&&this.updateLabel()}updateLabel(){this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}setPreferredResource(e){_n(e,this._preferredResource)||(this._preferredResource=e,this.updateLabel())}getName(){return typeof this._name!="string"&&(this._name=this.customEditorLabelService.getName(this._preferredResource)??this.labelService.getUriBasenameLabel(this._preferredResource)),this._name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this._preferredResource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this._preferredResource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this._preferredResource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=jEt(this.resource);let i;const s=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Aft(s)&&(i=s.value*vl.MB),{size:i??t}}};_ne=D([_(2,eo),_(3,ci),_(4,hh),_(5,dl),_(6,aD)],_ne);let Jxe=class extends H1{constructor(e,t,i,s,o){super(i,t,s,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};Jxe=D([_(1,Di),_(2,Ai),_(3,LQ),_(4,Ur)],Jxe);var pX;let Ib=class extends _ne{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=s}save(e,t){return this.resource.scheme!==_e.untitled&&!this.fileService.hasProvider(this.resource)?this.saveAs(e,t):this.doSave(t,!1,e)}saveAs(e,t){return this.doSave(t,!0,e)}async doSave(e,t,i){let s;if(t?s=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):s=await this.textFileService.save(this.resource,e),!!s)return{resource:s}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};Ib=D([_(2,_i),_(3,tr),_(4,eo),_(5,ci),_(6,hh),_(7,dl),_(8,aD)],Ib);var CP;let AM=(CP=class extends Ib{get typeId(){return pX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,void 0,c,a,d,l,h,u,f),this.name=t,this.description=i,this.preferredLanguageId=s,this.preferredContents=o,this.textModelService=r,this.cachedModel=void 0,this.modelReference=void 0}getName(){return this.name||super.getName()}setName(e){this.name!==e&&(this.name=e,this._onDidChangeLabel.fire())}getDescription(){return this.description}setDescription(e){this.description!==e&&(this.description=e,this._onDidChangeLabel.fire())}setLanguageId(e,t){this.setPreferredLanguageId(e),this.cachedModel?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e}setPreferredContents(e){this.preferredContents=e}async resolve(){const e=this.preferredContents,t=this.preferredLanguageId;this.preferredContents=void 0,this.preferredLanguageId=void 0,this.modelReference||(this.modelReference=this.textModelService.createModelReference(this.resource));const i=await this.modelReference,s=i.object;if(!(s instanceof Jxe))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=s,(typeof e=="string"||typeof t=="string")&&s.updateTextEditorModel(typeof e=="string"?hde(e):void 0,t),s}matches(e){return this===e?!0:e instanceof pX?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},pX=CP,CP.ID="workbench.editors.resourceEditorInput",CP);AM=pX=D([_(5,Rn),_(6,tr),_(7,_i),_(8,ci),_(9,eo),_(10,hh),_(11,dl),_(12,aD)],AM);const Za=Il;var mX,yP;let E6=(yP=class extends Ib{get typeId(){return mX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h){super(e.resource,void 0,s,t,i,o,c,d,h),this.model=e,this.environmentService=r,this.pathService=a,this.textModelService=l,this.modelResolve=void 0,this.modelDisposables=this._register(new Z),this.cachedUntitledTextEditorModelReference=void 0,this.registerModelListeners(e),this._register(this.textFileService.untitled.onDidCreate(u=>this.onDidCreateUntitledModel(u)))}registerModelListeners(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelDisposables.add(e.onDidChangeName(()=>this._onDidChangeLabel.fire())),this.modelDisposables.add(e.onDidRevert(()=>this.dispose()))}onDidCreateUntitledModel(e){_n(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Gs.MEDIUM){if(!this.model.hasAssociatedFilePath){const t=this.resource.path;return t!==this.getName()?t:void 0}return super.getDescription(e)}getTitle(e){if(!this.model.hasAssociatedFilePath){const t=this.getName(),i=this.getDescription();return i&&i!==t?`${t} • ${i}`:t}return super.getTitle(e)}isDirty(){return this.model.isDirty()}getEncoding(){return this.model.getEncoding()}setEncoding(e,t){return this.model.setEncoding(e)}get hasLanguageSetExplicitly(){return this.model.hasLanguageSetExplicitly}get hasAssociatedFilePath(){return this.model.hasAssociatedFilePath}setLanguageId(e,t){this.model.setLanguageId(e,t)}getLanguageId(){return this.model.getLanguageId()}async resolve(){return this.modelResolve||(this.modelResolve=(async()=>{this.cachedUntitledTextEditorModelReference=await this.textModelService.createModelReference(this.resource)})()),await this.modelResolve,this.isDisposed()&&this.disposeModelReference(),this.model}toUntyped(e){const t={resource:this.model.hasAssociatedFilePath?R9(this.model.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme):this.resource,forceUntitled:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=this.model.isModified()?this.model.textEditorModel?.getValue():void 0,t.options.viewState=qW(this,e.preserveViewState,this.editorService),typeof t.contents=="string"&&!this.model.hasAssociatedFilePath&&!e.preserveResource&&(t.resource=void 0)),t}matches(e){return this===e?!0:e instanceof mX?_n(e.resource,this.resource):KLt(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},mX=yP,yP.ID="workbench.editors.untitledEditorInput",yP);E6=mX=D([_(1,tr),_(2,eo),_(3,_i),_(4,ci),_(5,Za),_(6,Lm),_(7,hh),_(8,Rn),_(9,dl),_(10,aD)],E6);const jce=class jce extends Error{constructor(e){super(e),this.name=jce.code}};jce.code="InlineChatError";let vne=jce;const h3e="_inlineChatContext",u3e="_inlineChatDocument",IBe=class IBe{constructor(e,t,i){this.uri=e,this.selection=t,this.wholeRange=i}};IBe.variableName="_inlineChatContext";let Xxe=IBe,g3e=class{constructor(e,t,i,s,o,r,a,c,l,d){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=s,this._logService=o,this._instaService=r,this._editorService=a,this._chatService=c,this._chatAgentService=l,this._store=new Z,this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._onDidMoveSession=this._store.add(new I),this.onDidMoveSession=this._onDidMoveSession.event,this._onDidEndSession=this._store.add(new I),this.onDidEndSession=this._onDidEndSession.event,this._onDidStashSession=this._store.add(new I),this.onDidStashSession=this._onDidStashSession.event,this._sessions=new Map,this._keyComputers=new Map,this._recordings=[],this._store.add(d.registerVariable({id:h3e,name:h3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return JSON.stringify(new Xxe(p.session.textModelN.uri,p.editor.getSelection(),p.session.wholeRange.trackedInitialRange))})),this._store.add(d.registerVariable({id:u3e,name:u3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return p.session.textModelN.uri}))}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const s=this._chatAgentService.getDefaultAgent(cc.Editor);if(!s){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a={id:Math.random(),wholeRange:new O(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn),placeholder:s.description,slashCommands:s.slashCommands},c=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${s.extensionId}`);const l=this._chatService.startSession(cc.Editor,i);if(!l){this._logService.trace("[IE] NO chatModel found");return}c.add(Ee(()=>{this._chatService.clearSession(l.sessionId),l.dispose()}));const d=c.add(new Dn);c.add(l.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const C=o.getAlternativeVersionId(),{response:y}=b.request;d.value=y.onDidChange(()=>{if(!y.isComplete)return;d.clear();let S;if(y.isCanceled)S=new CEe(new Tc);else if(y.result?.errorDetails)S=new CEe(new Error(y.result.errorDetails.message));else if(y.response.value.length===0)S=new ist;else{const M={edits:{edits:[]}};for(const k of y.response.value)if(k.kind==="textEditGroup")for(const F of k.edits)for(const N of F)M.edits.edits.push({resource:k.uri,textEdit:N,versionId:void 0});S=this._instaService.createInstance(WI,M,v.textModelN.uri,C,b.request,y)}v.addExchange(new jzt(v.lastInput,S)),S instanceof WI&&S.untitledTextModel&&this._textModelService.createModelReference(S.untitledTextModel.resource).then(M=>{c.add(M)})})})),c.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(s.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${s.extensionId}`),this._releaseSession(v,!0))}));const h=Dr(),u=o.uri;c.add(await this._textModelService.createModelReference(o.uri));const f=o,p=c.add(this._modelService.createModel(fQ(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:T.None},u.with({scheme:_e.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:h,textModel0:""}).toString()}),!0));u.scheme===_e.untitled&&c.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:u,typeId:E6.ID,editorId:A_.id})||this._releaseSession(v,!0)}));let m=t.wholeRange;if(m||(m=a.wholeRange?O.lift(a.wholeRange):e.getSelection()),i.isCancellationRequested){c.dispose();return}const v=new qzt(t.editMode,u,p,f,s,a,c.add(new bEe(f,m)),c.add(new SEe(this._editorWorkerService,p,f)),l),w=this._key(e,v.targetUri);if(this._sessions.has(w))throw c.dispose(),new Error(`Session already stored for ${w}`);return this._sessions.set(w,{session:v,editor:e,store:c}),v}moveSession(e,t){const i=this._key(t,e.targetUri),s=this._sessions.get(i);if(s){if(s.session!==e)throw new Error("Cannot move session because the target editor already/still has one");return}let o=!1;for(const[r,a]of this._sessions)if(a.session===e){o=!0,this._sessions.delete(r),this._sessions.set(i,{...a,editor:t}),this._logService.trace(`[IE] did MOVE session for ${a.editor.getId()} to NEW EDITOR ${t.getId()}, ${e.agent.extensionId}`),this._onDidMoveSession.fire({session:e,editor:t});break}if(!o)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const r of this._sessions)if(r[1].session===e){i=r;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[s,o]=i;this._sessions.delete(s),this._logService.trace(`[IE] did RELEASED session for ${o.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:o.editor,session:e,endedByExternalCause:t}),o.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const s=this._instaService.createInstance(yEe,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),s}getCodeEditor(e){for(const[,t]of this._sessions)if(t.session===e)return t.editor;throw new Error("session not found")}getSession(e,t){const i=this._key(e,t);return this._sessions.get(i)?.session}_key(e,t){const i=this._keyComputers.get(t.scheme);return i?i.getComparisonKey(e,t):`${e.getId()}@${t.toString()}`}registerSessionKeyComputer(e,t){return this._keyComputers.set(e,t),Ee(()=>this._keyComputers.delete(e))}_keepRecording(e){this._recordings.unshift(e.asRecording())>5&&this._recordings.pop()}recordings(){return this._recordings}};g3e=D([_(0,on),_(1,Ai),_(2,Rn),_(3,kd),_(4,Ze),_(5,be),_(6,_i),_(7,Rw),_(8,yp),_(9,Mz)],g3e);var VH;let f3e=(VH=class{constructor(e,t){this._ctxHasProvider=kzt.bindTo(e),t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(cc.Editor);this._ctxHasProvider.set(i)})}dispose(){this._ctxHasProvider.reset()}},VH.Id="inlineChat.enabler",VH);f3e=D([_(0,Pe),_(1,yp)],f3e);const TL="vs/workbench/contrib/inlineChat/browser/inlineChatController";var Xr;(function(n){n.CREATE_SESSION="CREATE_SESSION",n.INIT_UI="INIT_UI",n.WAIT_FOR_INPUT="WAIT_FOR_INPUT",n.SHOW_REQUEST="SHOW_REQUEST",n.SHOW_RESPONSE="SHOW_RESPONSE",n.PAUSE="PAUSE",n.CANCEL="CANCEL",n.ACCEPT="DONE"})(Xr||(Xr={}));var Od;(function(n){n[n.NONE=0]="NONE",n[n.ACCEPT_SESSION=1]="ACCEPT_SESSION",n[n.CANCEL_SESSION=2]="CANCEL_SESSION",n[n.PAUSE_SESSION=4]="PAUSE_SESSION",n[n.CANCEL_REQUEST=8]="CANCEL_REQUEST",n[n.CANCEL_INPUT=16]="CANCEL_INPUT",n[n.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Od||(Od={}));let p3e=class{static get(e){return e.getContribution(zze)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=s,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,this._languageFeatureService=h,this._chatWidgetService=u,this._isDisposed=!1,this._store=new Z,this._messages=this._store.add(new I),this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._sessionStore=this._store.add(new Z),this._stashedSession=this._store.add(new Dn),this._forcedPlaceholder=void 0,this._ctxVisible=Izt.bindTo(l),this._ctxUserDidEdit=Pzt.bindTo(l),this._ctxResponseTypes=Nzt.bindTo(l),this._ui=new Ka(()=>{let p=cc.Editor;for(const w of f.listNotebookEditors())for(const[,b]of w.codeEditors)if(b===this._editor){p=cc.Notebook;break}const m=this._store.add(t.createInstance(Yxe,p,this._editor)),v=this._store.add(t.createInstance(Kxe,p,this._editor));return{content:m,zone:v}}),this._store.add(this._editor.onDidChangeModel(async p=>{if(this._session||!p.newModelUrl)return;const m=this._inlineChatSessionService.getSession(this._editor,p.newModelUrl);m&&(this._log("session RESUMING after model change",p),await this.run({existingSession:m}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(p=>{p.session===this._session&&p.endedByExternalCause&&(this._log("session ENDED by external cause"),this._session=void 0,this._strategy?.cancel(),this._resetWidget(),this.cancelSession())})),this._store.add(this._inlineChatSessionService.onDidMoveSession(async p=>{p.editor===this._editor&&(this._log("session RESUMING after move",p),await this.run({existingSession:p.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION),this._store.dispose(),this._isDisposed=!0,this._log("DISPOSED controller")}_log(e,...t){e instanceof Error?this._logService.error(e,...t):this._logService.trace(`[IE] (editor:${this._editor.getId()})${e}`,...t)}getMessage(){return this._ui.value.zone.widget.responseContent}getId(){return zze}_getMode(){return this._configurationService.getValue(Mv.Mode)}getWidgetPosition(){return this._ui.value.zone.position}async run(e={}){try{this.finishExistingSession(),this._currentRun&&await this._currentRun,e.initialSelection&&this._editor.setSelection(e.initialSelection),this._stashedSession.clear(),this._onWillStartSession.fire(),this._currentRun=this._nextState(Xr.CREATE_SESSION,e),await this._currentRun}catch(t){bt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Xr.PAUSE]()}finally{this._currentRun=void 0}}async _nextState(e,t){let i=e;for(;i&&!this._isDisposed;)this._log("setState to ",i),i=await this[i](t)}async[Xr.CREATE_SESSION](e){Bt(this._session===void 0),Bt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const s=this._showWidget(!0,i);let o=g(TL,0,"Failed to start editor chat");if(!t){const r=new ai,a=T.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Od.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateProgress(!0),this._ui.value.zone.widget.updateInfo(g(TL,1,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof vne||c?.name===vne.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Xr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Du.get(this._editor)?.showMessage(o,s),this._log("Failed to start editor chat"),Xr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case yS.Preview:this._strategy=this._instaService.createInstance(IEe,t,this._editor,this._ui.value.zone);break;case yS.Live:default:this._strategy=this._instaService.createInstance(LEe,t,this._editor,this._ui.value.zone);break}return this._session=t,Xr.INIT_UI}async[Xr.INIT_UI](e){Bt(this._session),Bt(this._strategy),_g.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const h=this._strategy?.getWholeRangeDecoration()??[];t.set(h)};this._sessionStore.add(Ee(()=>t.clear())),this._sessionStore.add(this._session.wholeRange.onDidChange(i)),i(),this._sessionStore.add(this._ui.value.content.onDidBlur(()=>this.cancelSession())),this._ui.value.content.setSession(this._session),this._updatePlaceholder();const s=this._session.session.message??g(TL,2,"AI-generated code may be incorrect");this._ui.value.zone.widget.updateInfo(s),this._showWidget(!this._session.chatModel.hasRequests),this._sessionStore.add(this._editor.onDidChangeModel(h=>{const u=this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION;this._log("model changed, pause or cancel session",u,h),this._messages.fire(u)}));const o=this._editor.getModel()?.getAlternativeVersionId();this._sessionStore.add(this._editor.onDidChangeModelContent(h=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(o!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const u=this._session.wholeRange;let f=!1;if(this._configurationService.getValue(Mv.FinishOnType))for(const{range:p}of h.changes)f=!O.areIntersectingOrTouching(p,u.value);this._session.recordExternalEditOccurred(f),f&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async h=>{if(h.kind==="addRequest"&&h.request.response){this._ui.value.zone.widget.updateProgress(!0);const u=h.request.response.onDidChange(()=>{(h.request.response?.isCanceled||h.request.response?.isComplete)&&(this._ui.value.zone.widget.updateProgress(!1),u.dispose())})}else if(h.kind==="removeRequest"){const u=this._session.exchanges.find(f=>f.prompt.request.id===h.requestId);if(u&&this._editor.hasModel()){this._session.hunkData.ignoreTextModelNChanges=!0;try{const f=this._editor.getModel(),p=u.prompt.modelAltVersionId;for(;p{if(u.lineNumber!==1||!this._session||!this._session.session.slashCommands)return;const m=this._chatWidgetService.getWidgetByInputUri(h.uri);if(m!==this._ui.value.zone.widget.chatWidget&&m!==this._ui.value.content.chatWidget)return;const v={suggestions:[],incomplete:!1};for(const w of this._session.session.slashCommands){const b=`/${w.name}`;v.suggestions.push({label:{label:b,description:w.description??""},kind:Ne.Text,insertText:b,range:O.fromPositions(new oe(1,1),u)})}return v}}));const r=(h,u)=>{const f=[];for(const p of(this._session?.session.slashCommands??[]).sort((m,v)=>v.name.length-m.name.length)){const m=`/${p.name}`,v=u.getLineContent(1);if(v.startsWith(m)){f.push({range:new O(1,1,1,m.length+1),options:{description:"inline-chat-slash-command",inlineClassName:"inline-chat-slash-command",after:{content:" "}}}),v.trim()===`/${p.name}`&&f.push({range:new O(1,m.length,1,m.length),options:{description:"inline-chat-slash-command-detail",after:{content:`${p.description}`,inlineClassName:"inline-chat-slash-command-detail"}}});break}}h.set(f)},a=this._ui.value.content.chatWidget.inputEditor,c=this._ui.value.zone.widget.chatWidget.inputEditor,l=a.createDecorationsCollection(),d=c.createDecorationsCollection();return this._sessionStore.add(a.onDidChangeModelContent(()=>r(l,a.getModel()))),this._sessionStore.add(c.onDidChangeModelContent(()=>r(d,c.getModel()))),this._sessionStore.add(Ee(()=>{l.clear(),d.clear()})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Xr.SHOW_RESPONSE):Xr.WAIT_FOR_INPUT}async[Xr.WAIT_FOR_INPUT](e){Bt(this._session),Bt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),sa(e.message),delete e.message,this._showWidget(!1));let t=Od.NONE,i;const s=new Uh,o=new Z;if(o.add(this._session.chatModel.onDidChange(a=>{a.kind==="addRequest"&&(i=a.request,t=Od.ACCEPT_INPUT,s.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(T.once(this._messages.event)(a=>{this._log("state=_waitForInput) message received",a),t=a,s.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await s.wait(),o.dispose(),t&(Od.CANCEL_INPUT|Od.CANCEL_SESSION))return Xr.CANCEL;if(t&Od.PAUSE_SESSION)return Xr.PAUSE;if(t&Od.ACCEPT_SESSION)return this._ui.value.zone.widget.selectAll(!1),Xr.ACCEPT;if(!i?.message.text)return Xr.WAIT_FOR_INPUT;const r=i.message.text;return this._ui.value.zone.widget.value=r,this._session.addInput(new Qzt(i,this._editor.getModel().getAlternativeVersionId())),Xr.SHOW_REQUEST}async[Xr.SHOW_REQUEST](){Bt(this._session),Bt(this._session.chatModel.requestInProgress);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Bt(t),Bt(t.response),this._showWidget(!1),this._ui.value.zone.widget.value=t.message.text,this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,s=new sd,o=new Z,r=o.add(new ai),a=new lNe,c=ao.create(),l=new dO;let d=Xr.SHOW_RESPONSE;o.add(T.once(this._messages.event)(C=>{this._log("state=_makeRequest) message received",C),this._chatService.cancelCurrentRequestForSession(e.sessionId),C&Od.CANCEL_SESSION?d=Xr.CANCEL:C&Od.PAUSE_SESSION?d=Xr.PAUSE:C&Od.ACCEPT_SESSION&&(d=Xr.ACCEPT)})),o.add(e.onDidChange(C=>{C.kind==="removeRequest"&&C.requestId===t.id&&(r.cancel(),s.complete(),C.reason===_6.Resend?d=Xr.SHOW_REQUEST:d=Xr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new tV,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):Dr(),applied:0};let v;const w=()=>{if(v||(v=i.response.value.find(C=>C.kind==="textEditGroup"&&_n(C.uri,this._session?.textModelN.uri))),v){v.state??=m;const C=v.edits,y=C.slice(h);y.length>0&&(h=C.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const S=this._session.wholeRange.value.getStartPosition();for(const k of y)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const M=this._session.wholeRange.value.getStartPosition();(!M.equals(S)||!this._ui.value.zone.position?.equals(M))&&this._showWidget(!1,M.delta(-1))}))}i.isCanceled?(r.cancel(),s.complete()):i.isComplete&&s.complete()};o.add(i.onDidChange(w)),w(),await s.p,await l.whenIdle(),o.dispose();const b=await this._editorWorkerService.computeDiff(this._session.textModel0.uri,this._session.textModelN.uri,{computeMoves:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,ignoreTrimWhitespace:!1},"advanced");return this._session.wholeRange.fixup(b?.changes??[]),await this._session.hunkData.recompute(m),this._ui.value.zone.widget.updateToolbar(!0),this._ui.value.zone.widget.updateProgress(!1),d}async[Xr.SHOW_RESPONSE](){Bt(this._session),Bt(this._strategy);const{response:e}=this._session.lastExchange;let t;for(const s of this._session.chatModel.getRequests()){if(!s.response)continue;const o=s$t(s.response.response);if(t===void 0)t=o;else if(t!==o){t=pI.Mixed;break}}this._ctxResponseTypes.set(t);let i;if(e instanceof ist){const s=g(TL,3,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(s,{classes:["warn"]}),Xr.WAIT_FOR_INPUT}else e instanceof CEe?e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel()):e instanceof WI&&(this._ui.value.zone.widget.updateStatus(""),this._ui.value.zone.widget.updateToolbar(!0),i=await this._strategy.renderChanges(e));return this._showWidget(!1,i),Xr.WAIT_FOR_INPUT}async[Xr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Xr.ACCEPT](){Bt(this._session),Bt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(TL,4,"Failed to apply changes.",Ma(e))),this._log("FAILED to apply changes"),this._log(e)}this._inlineChatSessionService.releaseSession(this._session),this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}async[Xr.CANCEL](){if(this._session){Bt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&!!this._session.lastExchange&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(TL,5,"Failed to discard changes.",Ma(i))),this._log("FAILED to discard changes"),this._log(i)}this._stashedSession.clear(),e?this._stashedSession.value=this._inlineChatSessionService.stashSession(this._session,this._editor,t):this._inlineChatSessionService.releaseSession(this._session)}this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}_showWidget(e=!1,t){Bt(this._editor.hasModel());let i;return t?i=t:this._ui.rawValue?.zone?.position?this._ui.rawValue?.zone.position.lineNumber===1?i=this._ui.rawValue?.zone.position.delta(-1):i=this._ui.rawValue?.zone.position:i=this._editor.getSelection().getStartPosition().delta(-1),this._session&&!t&&(this._session.hasChangedText||this._session.lastExchange)&&(i=this._session.wholeRange.value.getStartPosition().delta(-1)),this._ui.rawValue?.zone?.position?this._ui.value.zone.updatePositionAndHeight(i):e?(i=this._editor.getSelection().getStartPosition(),this._ui.value.content.show(i)):(this._ui.value.content.hide(),this._ui.value.zone.show(i),this._session&&this._ui.value.zone.widget.setChatModel(this._session.chatModel)),this._session&&this._ui.rawValue?.zone&&this._ui.rawValue?.zone.updateBackgroundColor(i,this._session.wholeRange.value),this._ctxVisible.set(!0),i}_resetWidget(){this._sessionStore.clear(),this._ctxVisible.reset(),this._ctxUserDidEdit.reset(),this._ui.rawValue?.content.hide(),this._ui.rawValue?.zone?.hide(),this._editor.hasWidgetFocus()&&this._editor.focus()}async _makeChanges(e,t,i){Bt(this._session),Bt(this._strategy);const s=await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri,e);if(this._log("edits from PROVIDER and after making them MORE MINIMAL",this._session.agent.extensionId,e,s),s?.length===0)return;const r=(!t&&s?s:e).map(iMe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),this._session.wholeRange.trackEdits(r),t?await this._strategy.makeProgressiveChanges(r,a,t,i):await this._strategy.makeChanges(r,a,i)}_updatePlaceholder(){this._ui.value.zone.widget.placeholder=this._getPlaceholderText()}_getPlaceholderText(){return this._forcedPlaceholder??this._session?.session.placeholder??""}showSaveHint(){const e=g(TL,6,"Accept or discard changes to continue saving");this._ui.value.zone.widget.updateStatus(e,{classes:["warn"]})}acceptInput(){return this.chatWidget.acceptInput()}updateInput(e,t=!0){if(this._ui.value.content.chatWidget.setInput(e),this._ui.value.zone.widget.chatWidget.setInput(e),t){const i=new mt(1,1,Number.MAX_SAFE_INTEGER,1);this._ui.value.content.chatWidget.inputEditor.setSelection(i),this._ui.value.zone.widget.chatWidget.inputEditor.setSelection(i)}}cancelCurrentRequest(){this._messages.fire(Od.CANCEL_INPUT|Od.CANCEL_REQUEST)}arrowOut(e){if(this._ui.value.zone.position&&this._editor.hasModel()){const{column:t}=this._editor.getPosition(),{lineNumber:i}=this._ui.value.zone.position,s=e?i:i+1;this._editor.setPosition({lineNumber:s,column:t}),this._editor.focus()}}focus(){this._ui.value.zone.widget.focus()}hasFocus(){return this._ui.value.zone.widget.hasFocus()}moveHunk(e){this.focus(),this._strategy?.move?.(e)}async viewInChat(){if(!this._strategy||!this._session)return;let e=!1,t;const i=this._editor.getModel()?.uri,s=this._session.chatModel.getRequests();for(const r of s)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&_n(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Bt(t),t.edits=[o]),await this._instaService.invokeFunction(n$t,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"accepted"}})}this._messages.fire(Od.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"discarded"}})}this._messages.fire(Od.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===yS.Preview?(this._log("finishing existing session, using CANCEL",this._session.editMode),this.cancelSession()):(this._log("finishing existing session, using APPLY",this._session.editMode),this.acceptSession()))}unstashLastSession(){const e=this._stashedSession.value?.unstash();return e&&this._inlineChatSavingService.markChanged(e),e}joinCurrentRun(){return this._currentRun}};p3e=D([_(1,be),_(2,LPe),_(3,zZe),_(4,kd),_(5,Ze),_(6,Re),_(7,To),_(8,Pe),_(9,Rw),_(10,ht),_(11,lL),_(12,xQ)],p3e);async function n$t(n,e){const t=n.get(q_),i=n.get(Rw),s=await ozt(t);if(s&&s.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(s.viewModel.model.sessionId,o);s.focusLastMessage()}}function s$t(n){let e;for(const t of n.value){let i;switch(t.kind){case"textEditGroup":i=pI.OnlyEdits;break;case"markdownContent":default:i=pI.OnlyMessages;break}if(e===void 0)e=i;else if(e!==i)return pI.Mixed}return e??pI.Empty}const o$t="workbench.action.quickchat.toggle";var Zxe;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Zxe||(Zxe={}));function r$t(n){const e=[],t=new Map,i=(s,o)=>{if(!t.has(s)&&(t.set(s,!0),!(s[0]==="_"||s.indexOf("vscode.")===0)&&n.get(s)!==!0)){if(!o){const r=yt.getCommand(s);if(r&&typeof r.metadata=="object"&&mo(r.metadata.args))return}e.push(s)}};for(const s of Xs.getMenuItems(Te.CommandPalette))lR(s)&&i(s.command.id,!0);for(const s of b_.getEditorActions())i(s.id,!0);for(const s of yt.getCommands().keys())i(s,!1);return e}var X_;const PF="vs/workbench/services/preferences/browser/keybindingsEditorModel",Mpe="keybinding.entry.template",m3e=g(PF,0,"System"),_3e=g(PF,1,"Extension"),v3e=g(PF,2,"User");function a$t(n,e){const t=e?` +when:${e}`:"";return`@command:${n}${t}`}const c$t=KU(dF,YD,pde),l$t=/@command:\s*([^\+]+)/i,d$t=/\+when:\s*(.+)/i,w3e=/@source:\s*(user|default|system|extension)/i,b3e=/@ext:\s*((".+")|([^\s]+))/i,h$t=/@keybinding:\s*((\".+\")|(\S+))/i;let C3e=X_=class extends pL{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:bde.modifierLabels[e],aria:AJe.modifierLabels[e],user:EJe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const s=l$t.exec(e);if(s&&s[1]){const o=s[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=d$t.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:X_.getId(a),keybindingItem:a,templateId:Mpe}))}if(w3e.test(e))i=this.filterBySource(i,e),e=e.replace(w3e,"");else{const o=b3e.exec(e);if(o&&(o[2]||o[3])){const r=o[2]?o[2].substring(1,o[2].length-1):o[3];i=this.filterByExtension(i,r),e=e.replace(b3e,"")}else{const r=h$t.exec(e);r&&(r[2]||r[3])&&(e=r[2]||`"${r[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(o=>({id:X_.getId(o),keybindingItem:o,templateId:Mpe}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===m3e):/@source:\s*user/i.test(t)?e.filter(i=>i.source===v3e):/@source:\s*extension/i.test(t)?e.filter(i=>!zt(i.source)||i.source===_3e):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!zt(i.source)&&(Cn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',s=t.charAt(t.length-1)==='"',o=i&&s;i&&(t=t.substring(1)),s&&(t=t.substring(0,t.length-1)),t=t.trim();const r=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new u$t(this.modifierLabels,l,t,a,c,o);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&r.push({id:X_.getId(l),templateId:Mpe,commandLabelMatches:d.commandLabelMatches||void 0,commandDefaultLabelMatches:d.commandDefaultLabelMatches||void 0,keybindingItem:l,keybindingMatches:d.keybindingMatches||void 0,commandIdMatches:d.commandIdMatches||void 0,sourceMatches:d.sourceMatches||void 0,whenMatches:d.whenMatches||void 0,extensionIdMatches:d.extensionIdMatches||void 0,extensionLabelMatches:d.extensionLabelMatches||void 0})}return r}filterByWhen(e,t,i){if(e.length===0)return[];const s=e.filter(c=>c.when===i);if(s.length)return s;const o=e[0].commandLabel,r=new vee(void 0,t,null,ge.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[X_.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Ui(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const o of this.keybindingsService.getKeybindings())o.command&&(this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const s=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of r$t(i)){const r=new vee(void 0,o,null,void 0,s.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=Lc(this._keybindingItemsSortedByPrecedence,o=>X_.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>X_.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(zt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new $a;for(const t of this.extensionService.extensions)e.set(t.identifier,t);return e}static compareKeybindingData(e,t){return e.keybinding&&!t.keybinding?-1:t.keybinding&&!e.keybinding?1:e.commandLabel&&!t.commandLabel?-1:t.commandLabel&&!e.commandLabel?1:e.commandLabel&&t.commandLabel&&e.commandLabel!==t.commandLabel?e.commandLabel.localeCompare(t.commandLabel):e.command===t.command?e.keybindingItem.isDefault?1:-1:e.command.localeCompare(t.command)}static toKeybindingEntry(e,t,i,s){const o=Xs.getCommand(e),r=i.get(e);let a=v3e;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?s.get(c)??_3e:m3e}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:X_.getCommandLabel(o,r),commandDefaultLabel:X_.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!s1.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(PF,3,"{0}: {1}",t,i):i}return null}static getCommandLabel(e,t){if(e){const i=e.category?typeof e.category=="string"?e.category:e.category.value:void 0,s=typeof e.title=="string"?e.title:e.title.value;return i?g(PF,3,"{0}: {1}",i,s):s}return t||""}};C3e=X_=D([_(1,ti),_(2,ho)],C3e);class u$t{constructor(e,t,i,s,o,r){this.modifierLabels=e,this.commandIdMatches=null,this.commandLabelMatches=null,this.commandDefaultLabelMatches=null,this.sourceMatches=null,this.whenMatches=null,this.keybindingMatches=null,this.extensionIdMatches=null,this.extensionLabelMatches=null,r||(this.commandIdMatches=this.matches(i,t.command,KU(YD,lee),s),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>YD(a,t.commandLabel,!0),s):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>YD(a,t.commandDefaultLabel,!0),s):null,this.whenMatches=t.when?this.matches(null,t.when,KU(YD,lee),s):null,zt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>YD(a,t.source,!0),s):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>YD(a,t.commandLabel,!0),s):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,s){let o=e?c$t(e,t):null;return o||(o=this.matchesWords(s,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let s=[];for(const o of e){const r=i(o,t);if(r)s=[...s||[],...r];else{s=null;break}}return s}filterAndSort(e){return Lc(e,t=>t.start+"."+t.end).filter(t=>!e.some(i=>!(i.start===t.start&&i.end===t.end)&&i.start<=t.start&&i.end>=t.end)).sort((t,i)=>t.start-i.start)}matchesKeybinding(e,t,i,s){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&mE(t,a)===0||c&&mE(t,c)===0||l&&mE(t,l)===0)return{firstPart:this.createCompleteMatch(o),chordPart:this.createCompleteMatch(r)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(WE,0,"No matching commands"),commandId:""})},s,o,r,a,c),this.editorService=e,this.menuService=t,this.extensionService=i,this.configurationService=l,this.editorGroupService=d,this.preferencesService=h,this.productService=u,this.aiRelatedInformationService=f,this.chatAgentService=p,this.extensionRegistrationRace=JQe(this.extensionService.whenInstalledExtensionsRegistered(),800),this.useAiRelatedInfo=!1,this._register(l.onDidChangeConfiguration(m=>this.updateOptions(m))),this.updateOptions()}get configuration(){const e=this.configurationService.getValue().workbench.commandPalette;return{preserveInput:e.preserveInput,experimental:e.experimental}}updateOptions(e){if(e&&!e.affectsConfiguration("workbench.commandPalette.experimental"))return;const t=this.configuration,i=t.experimental.suggestCommands&&this.productService.commandPaletteSuggestedCommandIds?.length?new Set(this.productService.commandPaletteSuggestedCommandIds):void 0;this.options.suggestedCommandIds=i,this.useAiRelatedInfo=t.experimental.enableNaturalLanguageSearch}async getCommandPicks(e){return await this.extensionRegistrationRace,e.isCancellationRequested?[]:[...this.getCodeEditorCommandPicks(),...this.getGlobalCommandPicks()].map(t=>({...t,buttons:[{iconClass:$e.asClassName(Ce.gear),tooltip:g(WE,1,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:a$t(t.commandId,t.commandWhen)}),BE.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,s){if(!this.hasAdditionalCommandPicks(i,s))return[];let o;try{await Ta(F3.AI_RELATED_INFORMATION_DEBOUNCE,s),o=await this.getRelatedInformationPicks(e,t,i,s)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(cc.Panel);return r&&o.push({label:g(WE,2,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?o$t:Dzt,args:[i]}),o}async getRelatedInformationPicks(e,t,i,s){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[Zxe.CommandInformation],s);o.sort((c,l)=>l.weight-c.weight);const r=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of o){if(c.weightd.commandId===c.command&&!r.has(d.commandId));l&&a.push(l)}return a}getGlobalCommandPicks(){const e=[],t=this.editorService.activeEditorPane?.scopedContextKeyService||this.editorGroupService.activeGroup.scopedContextKeyService,i=this.menuService.createMenu(Te.CommandPalette,t),s=i.getActions().reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof id&&o.enabled);for(const o of s){let r=(typeof o.item.title=="string"?o.item.title:o.item.title.value)||o.item.id;const a=typeof o.item.category=="string"?o.item.category:o.item.category?.value;a&&(r=g(WE,3,"{0}: {1}",a,r));const c=typeof o.item.title!="string"?o.item.title.original:void 0,l=a&&o.item.category&&typeof o.item.category!="string"?o.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=o.item.metadata?.description,u=h===void 0||XJe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:mde(r),commandDescription:u})}return i.dispose(),e}},F3=ZE,ZE.AI_RELATED_INFORMATION_MAX_PICKS=5,ZE.AI_RELATED_INFORMATION_THRESHOLD=.8,ZE.AI_RELATED_INFORMATION_DEBOUNCE=200,ZE);FF=F3=D([_(0,_i),_(1,mc),_(2,ho),_(3,be),_(4,ti),_(5,Qi),_(6,on),_(7,To),_(8,Re),_(9,ur),_(10,TQ),_(11,Ja),_(12,NPe),_(13,yp)],FF);const Kce=class Kce extends pi{constructor(){super({id:Kce.ID,title:Be(WE,4,"Show All Commands"),keybinding:{weight:ye.WorkbenchContrib,when:void 0,primary:pp?void 0:V.CtrlCmd|V.Shift|E.KeyP,secondary:[E.F1]},f1:!0})}async run(e){e.get(On).quickAccess.show(FF.PREFIX)}};Kce.ID="workbench.action.showCommands";let V1=Kce;class g$t extends pi{constructor(){super({id:"workbench.action.clearCommandHistory",title:Be(WE,5,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Re),i=e.get(sn),s=e.get(To);if(p6.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await s.confirm({type:"warning",message:g(WE,6,"Do you want to clear the history of recently used commands?"),detail:g(WE,7,"This action is irreversible!"),primaryButton:g(WE,8,"&&Clear")});if(!r)return;p6.clearHistory(t,i)}}}class Est{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Dn);return o.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=_z(o);if(a){let c=o.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},s.add(cw(t.onCancellationRequested)(()=>r.restoreViewState?.()))}s.add(Ee(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,jb.JUMP),e.revealRangeInCenter(t.range,vt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Cu(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return ew(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const M5="vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess",Yce=class Yce extends Est{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(M5,0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,$.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(s,l.lineNumber))return;this.gotoLocation(e,{range:this.toRange(l.lineNumber,l.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=this.parsePosition(s,t.value.trim().substr(Yce.PREFIX.length)),l=this.getPickLabel(s,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(s,c.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(c.lineNumber,c.column);s.revealRangeInCenter(d,vt.Smooth),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=_z(s);return a&&a.getOptions().get(x.lineNumbers).renderType===Qr.Relative&&(a.updateOptions({lineNumbers:"on"}),o.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(M5,1,"Go to line {0} and character {1}.",t,i):g(M5,2,"Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(M5,3,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):g(M5,4,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Yce.PREFIX=":";let wne=Yce;const eDe="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess";let bne=class extends wne{constructor(e,t,i){super(),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview}}get activeTextEditorControl(){return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}};bne=D([_(0,_i),_(1,ur),_(2,Re)],bne);const Jce=class Jce extends pi{constructor(){super({id:Jce.ID,title:Be(eDe,0,"Go to Line/Column..."),f1:!0,keybinding:{weight:ye.WorkbenchContrib,when:null,primary:V.CtrlCmd|E.KeyG,mac:{primary:V.WinCtrl|E.KeyG}}})}async run(e){e.get(On).quickAccess.show(bne.PREFIX)}};Jce.ID="workbench.action.gotoLine";let Cne=Jce;At(Cne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:bne,prefix:wne.PREFIX,placeholder:g(eDe,1,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(eDe,2,"Go to Line/Column"),commandId:Cne.ID}]});var IB;const Rr="vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess";var ex;let EM=(ex=class extends Est{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,g(Rr,0,"To go to a symbol, first open a text editor with symbol information.")),$.None}provideWithTextEditor(e,t,i,s){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,s):this.doProvideWithoutEditorSymbols(e,r,t,i):$.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new Z;return this.provideLabelPick(i,g(Rr,1,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:_t.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new sd,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,o){const r=e.editor,a=new Z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),o?.handleAccept?.(u),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const c=this.getDocumentSymbols(t,s);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ai(s),i.busy=!0;try{const u=y6(i.value.substr(IB.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(s.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=t1(f,m=>!!(m.type!=="separator"&&m.range&&O.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(Rr,2,"No matching editor symbols")):this.provideLabelPick(i,g(Rr,3,"No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,vt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,o){const r=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(IB.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=F5e(t.values[0]),d=F5e(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?$e.asClassName(Ce.splitHorizontal):$e.asClassName(Ce.splitVertical),tooltip:u==="right"?g(Rr,4,"Open to the Side"):g(Rr,5,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let U=!1;if(l!==t&&([M,k]=Ipe(C,{...t,values:void 0},c,y),typeof M=="number"&&(U=!0)),typeof M!="number"&&([M,k]=Ipe(C,l,c,y),typeof M!="number"))continue;if(!U&&d){if(S&&d.original.length>0&&([F,N]=Ipe(S,d)),typeof F!="number")continue;typeof M=="number"&&(M+=F)}}const z=w.tags&&w.tags.indexOf(k9.Deprecated)>=0;f.push({index:v,kind:w.kind,score:M,label:C,ariaLabel:yht(w.name,w.kind),description:S,highlights:z?void 0:{label:k,description:N},range:{selection:O.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:b,strikethrough:z,buttons:h})}const p=f.sort((v,w)=>a?this.compareByKindAndScore(v,w):this.compareByScore(v,w));let m=[];if(a){let C=function(){w&&typeof v=="number"&&b>0&&(w.label=r_(Ppe[v]||Npe,b))},v,w,b=0;for(const y of p)v!==y.kind?(C(),v=y.kind,b=1,w={type:"separator"},m.push(w)):b++,m.push(y);C()}else p.length>0&&(m=[{label:g(Rr,6,"symbols ({0})",f.length),type:"separator"},...p]);return m}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=Ppe[e.kind]||Npe,s=Ppe[t.kind]||Npe,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},IB=ex,ex.PREFIX="@",ex.SCOPE_PREFIX=":",ex.PREFIX_BY_CATEGORY=`${IB.PREFIX}${IB.SCOPE_PREFIX}`,ex);EM=IB=D([_(0,ht),_(1,JQ)],EM);const Npe=g(Rr,7,"properties ({0})"),Ppe={[_t.Method]:g(Rr,8,"methods ({0})"),[_t.Function]:g(Rr,9,"functions ({0})"),[_t.Constructor]:g(Rr,10,"constructors ({0})"),[_t.Variable]:g(Rr,11,"variables ({0})"),[_t.Class]:g(Rr,12,"classes ({0})"),[_t.Struct]:g(Rr,13,"structs ({0})"),[_t.Event]:g(Rr,14,"events ({0})"),[_t.Operator]:g(Rr,15,"operators ({0})"),[_t.Interface]:g(Rr,16,"interfaces ({0})"),[_t.Namespace]:g(Rr,17,"namespaces ({0})"),[_t.Package]:g(Rr,18,"packages ({0})"),[_t.TypeParameter]:g(Rr,19,"type parameters ({0})"),[_t.Module]:g(Rr,20,"modules ({0})"),[_t.Property]:g(Rr,7,"properties ({0})"),[_t.Enum]:g(Rr,21,"enumerations ({0})"),[_t.EnumMember]:g(Rr,22,"enumeration members ({0})"),[_t.String]:g(Rr,23,"strings ({0})"),[_t.File]:g(Rr,24,"files ({0})"),[_t.Array]:g(Rr,25,"arrays ({0})"),[_t.Number]:g(Rr,26,"numbers ({0})"),[_t.Boolean]:g(Rr,27,"booleans ({0})"),[_t.Object]:g(Rr,28,"objects ({0})"),[_t.Key]:g(Rr,29,"keys ({0})"),[_t.Field]:g(Rr,30,"fields ({0})"),[_t.Constant]:g(Rr,31,"constants ({0})")};var tDe;(function(n){n[n.OutlinePane=1]="OutlinePane",n[n.Breadcrumbs=2]="Breadcrumbs",n[n.QuickPick=4]="QuickPick"})(tDe||(tDe={}));var y3e;(function(n){n.icons="outline.icons",n.collapseItems="outline.collapseItems",n.problemsEnabled="outline.problems.enabled",n.problemsColors="outline.problems.colors",n.problemsBadges="outline.problems.badges"})(y3e||(y3e={}));var S3e;(function(n){n.Collapsed="alwaysCollapse",n.Expanded="alwaysExpand"})(S3e||(S3e={}));var iDe;const ZW="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess";var SP;let yne=(SP=class extends EM{constructor(e,t,i,s,o,r){super(s,r,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=o,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview,openSideBySideDirection:e?.openSideBySideDirection}}get activeTextEditorControl(){if(!HU(this.editorService.activeEditorPane?.getControl()))return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}async getSymbolPicks(e,t,i,s,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,s),Ta(iDe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),y6(t),i,o,e)}provideWithoutTextEditor(e){return this.canPickWithOutlineService()?this.doGetOutlinePicks(e):super.provideWithoutTextEditor(e)}canPickWithOutlineService(){return this.editorService.activeEditorPane?this.outlineService.canCreateOutline(this.editorService.activeEditorPane):!1}doGetOutlinePicks(e){const t=this.editorService.activeEditorPane;if(!t)return $.None;const i=new ai,s=new Z;return s.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,tDe.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}s.add(o);const r=o.captureViewState();s.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:_t.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));s.add(e.onDidAccept(()=>{e.hide();const[h]=e.selectedItems;h&&a[h.index]&&o.reveal(a[h.index].element,{},!1,!1)}));const l=()=>{const h=c.filter(u=>{if(e.value==="@")return u.score=0,u.highlights=void 0,!0;const f=e.value.substring(EM.PREFIX.length).trim(),p=n2(u.label),m=v1(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:lJ(f,p)??void 0},!0):!1});if(h.length===0){const u=g(ZW,0,"No matching entries");e.items=[{label:u,index:-1,kind:_t.String}],e.ariaLabel=u}else e.items=h};l(),s.add(e.onDidChangeValue(l));const d=new Dn;s.add(d),s.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{bt(o),e.hide()}).finally(()=>{e.busy=!1}),s}},iDe=SP,SP.SYMBOL_PICKS_TIMEOUT=8e3,SP);yne=iDe=D([_(0,_i),_(1,ur),_(2,Re),_(3,ht),_(4,Eet),_(5,JQ)],yne);const Xce=class Xce extends pi{constructor(){super({id:Xce.ID,title:{...Be(ZW,1,"Go to Symbol in Editor..."),mnemonicTitle:g(ZW,2,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:ge.and(Dm.negate(),T1.negate()),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|V.Shift|E.KeyO},menu:[{id:Te.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(On).quickAccess.show(yne.PREFIX,{itemActivation:Qp.NONE})}};Xce.ID="workbench.action.gotoSymbol";let Sne=Xce;At(Sne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:yne,prefix:EM.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(ZW,3,"Type the name of a symbol to go to."),helpEntries:[{description:g(ZW,4,"Go to Symbol in Editor"),prefix:EM.PREFIX,commandId:Sne.ID,commandCenterOrder:40},{description:g(ZW,5,"Go to Symbol in Editor by Category"),prefix:EM.PREFIX_BY_CATEGORY}]});const qz="vs/workbench/browser/actions/quickAccessActions",bx={primary:V.CtrlCmd|E.KeyP,secondary:[V.CtrlCmd|E.KeyE],mac:{primary:V.CtrlCmd|E.KeyP,secondary:void 0}};xr.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:E.Escape,secondary:[V.Shift|E.Escape],handler:n=>n.get(On).cancel()});xr.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept()});xr.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept({ctrlCmd:!0,alt:!1})});xr.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).focus()}});const A3e="workbench.action.quickOpenNavigateNextInFilePicker";xr.registerCommandAndKeybindingRule({id:A3e,weight:ye.WorkbenchContrib+50,handler:Rhe(A3e,!0),when:Gnt,primary:bx.primary,secondary:bx.secondary,mac:bx.mac});const E3e="workbench.action.quickOpenNavigatePreviousInFilePicker";xr.registerCommandAndKeybindingRule({id:E3e,weight:ye.WorkbenchContrib+50,handler:Rhe(E3e,!1),when:Gnt,primary:bx.primary|V.Shift,secondary:[bx.secondary[0]|V.Shift],mac:{primary:bx.mac.primary|V.Shift,secondary:void 0}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).toggle()}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:ye.WorkbenchContrib+50,when:aA,primary:0,win:{primary:V.Alt|E.LeftArrow},mac:{primary:V.WinCtrl|E.Minus},linux:{primary:V.CtrlCmd|V.Alt|E.Minus},handler:n=>{n.get(On).back()}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpen",title:Be(qz,0,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:ye.WorkbenchContrib,primary:bx.primary,secondary:bx.secondary,mac:bx.mac},f1:!0})}run(e,t){e.get(On).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(qz,1,"Quick Open"),icon:Ce.search,menu:{id:Te.CommandCenterCenter,order:100}})}run(e){e.get(On).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});yt.registerCommand("workbench.action.quickOpenPreviousEditor",async n=>{n.get(On).quickAccess.show("",{itemActivation:Qp.SECOND})});class Whe extends pi{constructor(e,t,i,s,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=s}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:s}:void 0;i.navigate(this.next,o)}}class f$t extends Whe{constructor(){super("workbench.action.quickOpenNavigateNext",Be(qz,2,"Navigate Next in Quick Open"),!0,!0)}}class p$t extends Whe{constructor(){super("workbench.action.quickOpenNavigatePrevious",Be(qz,3,"Navigate Previous in Quick Open"),!1,!0)}}class m$t extends Whe{constructor(){super("workbench.action.quickOpenSelectNext",Be(qz,4,"Select Next in Quick Open"),!0,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyN}})}}class _$t extends Whe{constructor(){super("workbench.action.quickOpenSelectPrevious",Be(qz,5,"Select Previous in Quick Open"),!1,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyP}})}}At(m$t);At(_$t);At(f$t);At(p$t);var O3;const v$t="vs/platform/quickinput/browser/helpQuickAccess";var AP;let a8=(AP=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=it.as(xz.Quickaccess)}provide(e){const t=new Z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(O3.PREFIX.length));s&&s.prefix&&s.prefix!==O3.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==O3.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(v$t,0,"{0}, {1}",s,t.description),description:t.description}})}},O3=AP,AP.PREFIX="?",AP);a8=O3=D([_(0,On),_(1,ti)],a8);const Ki="vs/workbench/contrib/debug/common/debug",x3e="workbench.panel.repl.view";new Y("debugType",void 0,{type:"string",description:g(Ki,0,"Debug type of the active debug session. For example 'python'.")});new Y("debugConfigurationType",void 0,{type:"string",description:g(Ki,1,"Debug type of the selected launch configuration. For example 'python'.")});new Y("debugState","inactive",{type:"string",description:g(Ki,2,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const w$t="debugUx";new Y(w$t,"default",{type:"string",description:g(Ki,3,"Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.")});new Y("hasDebugged",!1,{type:"boolean",description:g(Ki,4,"True when a debug session has been started at least once, false otherwise.")});new Y("inDebugMode",!1,{type:"boolean",description:g(Ki,5,"True when debugging, false otherwise.")});new Y("inDebugRepl",!1,{type:"boolean",description:g(Ki,6,"True when focus is in the debug console, false otherwise.")});new Y("breakpointWidgetVisible",!1,{type:"boolean",description:g(Ki,7,"True when breakpoint editor zone widget is visible, false otherwise.")});new Y("inBreakpointWidget",!1,{type:"boolean",description:g(Ki,8,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Y("breakpointsFocused",!0,{type:"boolean",description:g(Ki,9,"True when the BREAKPOINTS view is focused, false otherwise.")});new Y("watchExpressionsFocused",!0,{type:"boolean",description:g(Ki,10,"True when the WATCH view is focused, false otherwsie.")});new Y("watchExpressionsExist",!1,{type:"boolean",description:g(Ki,11,"True when at least one watch expression exists, false otherwise.")});new Y("variablesFocused",!0,{type:"boolean",description:g(Ki,12,"True when the VARIABLES views is focused, false otherwsie")});new Y("expressionSelected",!1,{type:"boolean",description:g(Ki,13,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new Y("breakpointInputFocused",!1,{type:"boolean",description:g(Ki,14,"True when the input box has focus in the BREAKPOINTS view.")});new Y("callStackItemType",void 0,{type:"string",description:g(Ki,15,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new Y("callStackSessionIsAttach",!1,{type:"boolean",description:g(Ki,16,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new Y("callStackItemStopped",!1,{type:"boolean",description:g(Ki,17,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new Y("callStackSessionHasOneThread",!1,{type:"boolean",description:g(Ki,18,"True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.")});new Y("watchItemType",void 0,{type:"string",description:g(Ki,19,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new Y("canViewMemory",void 0,{type:"boolean",description:g(Ki,20,"Indicates whether the item in the view has an associated memory refrence.")});new Y("breakpointItemType",void 0,{type:"string",description:g(Ki,21,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new Y("breakpointItemBytes",void 0,{type:"boolean",description:g(Ki,22,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Y("breakpointHasModes",!1,{type:"boolean",description:g(Ki,23,"Whether the breakpoint has multiple modes it can switch to.")});new Y("breakpointSupportsCondition",!1,{type:"boolean",description:g(Ki,24,"True when the focused breakpoint supports conditions.")});new Y("loadedScriptsSupported",!1,{type:"boolean",description:g(Ki,25,"True when the focused sessions supports the LOADED SCRIPTS view")});new Y("loadedScriptsItemType",void 0,{type:"string",description:g(Ki,26,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Y("focusedSessionIsAttach",!1,{type:"boolean",description:g(Ki,27,"True when the focused session is 'attach'.")});new Y("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(Ki,28,"True when the focused session is run without debugging.")});new Y("stepBackSupported",!1,{type:"boolean",description:g(Ki,29,"True when the focused session supports 'stepBack' requests.")});new Y("restartFrameSupported",!1,{type:"boolean",description:g(Ki,30,"True when the focused session supports 'restartFrame' requests.")});new Y("stackFrameSupportsRestart",!1,{type:"boolean",description:g(Ki,31,"True when the focused stack frame suppots 'restartFrame'.")});new Y("jumpToCursorSupported",!1,{type:"boolean",description:g(Ki,32,"True when the focused session supports 'jumpToCursor' request.")});new Y("stepIntoTargetsSupported",!1,{type:"boolean",description:g(Ki,33,"True when the focused session supports 'stepIntoTargets' request.")});new Y("breakpointsExist",!1,{type:"boolean",description:g(Ki,34,"True when at least one breakpoint exists.")});new Y("debuggersAvailable",!1,{type:"boolean",description:g(Ki,35,"True when there is at least one debug extensions active.")});new Y("debugExtensionAvailable",!0,{type:"boolean",description:g(Ki,36,"True when there is at least one debug extension installed and enabled.")});new Y("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(Ki,37,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Y("debugSetVariableSupported",!1,{type:"boolean",description:g(Ki,38,"True when the focused session supports 'setVariable' request.")});new Y("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(Ki,39,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Y("debugSetExpressionSupported",!1,{type:"boolean",description:g(Ki,40,"True when the focused session supports 'setExpression' request.")});new Y("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(Ki,41,"True when the focused session supports to break when value changes.")});new Y("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(Ki,42,"True when the focused breakpoint supports to break when value is accessed.")});new Y("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(Ki,43,"True when the focused breakpoint supports to break when value is read.")});new Y("terminateDebuggeeSupported",!1,{type:"boolean",description:g(Ki,44,"True when the focused session supports the terminate debuggee capability.")});new Y("suspendDebuggeeSupported",!1,{type:"boolean",description:g(Ki,45,"True when the focused session supports the suspend debuggee capability.")});new Y("variableEvaluateNamePresent",!1,{type:"boolean",description:g(Ki,46,"True when the focused variable has an 'evalauteName' field set.")});new Y("variableIsReadonly",!1,{type:"boolean",description:g(Ki,47,"True when the focused variable is read-only.")});new Y("variableValue",!1,{type:"string",description:g(Ki,48,"Value of the variable, present for debug visualization clauses.")});new Y("variableType",!1,{type:"string",description:g(Ki,49,"Type of the variable, present for debug visualization clauses.")});new Y("variableInterfaces",!1,{type:"array",description:g(Ki,50,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Y("variableName",!1,{type:"string",description:g(Ki,51,"Name of the variable, present for debug visualization clauses.")});new Y("variableLanguage",!1,{type:"string",description:g(Ki,52,"Language of the variable source, present for debug visualization clauses.")});new Y("variableExtensionId",!1,{type:"string",description:g(Ki,53,"Extension ID of the variable source, present for debug visualization clauses.")});new Y("exceptionWidgetVisible",!1,{type:"boolean",description:g(Ki,54,"True when the exception widget is visible.")});new Y("multiSessionRepl",!1,{type:"boolean",description:g(Ki,55,"True when there is more than 1 debug console.")});new Y("multiSessionDebug",!1,{type:"boolean",description:g(Ki,56,"True when there is more than 1 active debug session.")});new Y("disassembleRequestSupported",!1,{type:"boolean",description:g(Ki,57,"True when the focused sessions supports disassemble request.")});new Y("disassemblyViewFocus",!1,{type:"boolean",description:g(Ki,58,"True when the Disassembly View is focused.")});new Y("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(Ki,59,"True when the language in the current editor supports disassemble request.")});new Y("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(Ki,60,"True when the focused stack frame has instruction pointer reference.")});g(Ki,62,"Controls when the internal Debug Console should open.");var D3e;(function(n){n[n.Inactive=0]="Inactive",n[n.Initializing=1]="Initializing",n[n.Stopped=2]="Stopped",n[n.Running=3]="Running"})(D3e||(D3e={}));var k3e;(function(n){n[n.Valid=0]="Valid",n[n.Unreadable=1]="Unreadable",n[n.Error=2]="Error"})(k3e||(k3e={}));var Ane;(function(n){n[n.Variable=0]="Variable",n[n.Address=1]="Address"})(Ane||(Ane={}));var x6;(function(n){n[n.Initial=1]="Initial",n[n.Dynamic=2]="Dynamic"})(x6||(x6={}));var I3e;(function(n){n.UnverifiedBreakpoints="unverifiedBreakpoints"})(I3e||(I3e={}));var L3e;(function(n){n[n.CONDITION=0]="CONDITION",n[n.HIT_COUNT=1]="HIT_COUNT",n[n.LOG_MESSAGE=2]="LOG_MESSAGE",n[n.TRIGGER_POINT=3]="TRIGGER_POINT"})(L3e||(L3e={}));var Ene;(function(n){n[n.Command=0]="Command",n[n.Tree=1]="Tree"})(Ene||(Ene={}));var nDe;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(nDe||(nDe={}));var sDe;(function(n){n.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:P.revive(e.iconPath.light),dark:P.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),n.serialize=e=>e})(sDe||(sDe={}));var oDe;const zC="vs/workbench/contrib/quickaccess/browser/viewQuickAccess";var EP;let jV=(EP=class extends zFe{constructor(e,t,i,s,o,r,a,c){super(oDe.PREFIX,{noResultsPick:{label:g(zC,0,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=s,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:dee(e,r.label,!0)??void 0},r.highlights.label||Hlt(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const s=[];let o;for(const r of t){if(o!==r.containerLabel){o=r.containerLabel;let a;i.has(o)?a=`${i.get(o)} / ${o}`:a=o,s.push({type:"separator",label:a})}s.push(r)}return s}doGetViewPickItems(){const e=[],t=(r,a)=>{const c=this.viewDescriptorService.getViewContainerModel(a),l=[];for(const d of c.allViewDescriptors)this.contextKeyService.contextMatchesRules(d.when)&&l.push({label:d.name.value,containerLabel:c.title,accept:()=>this.viewsService.openView(d.id,!0)});return l},i=(r,a)=>{const c=this.paneCompositeService.getPaneComposites(r),l=this.paneCompositeService.getVisiblePaneCompositeIds(r);c.sort((d,h)=>{let u=l.findIndex(p=>d.id===p),f=l.findIndex(p=>h.id===p);return u<0&&(u=c.indexOf(d)+l.length),f<0&&(f=c.indexOf(h)+l.length),u-f});for(const d of c)if(this.includeViewContainer(d)){const h=this.viewDescriptorService.getViewContainerById(d.id);h&&e.push({label:this.viewDescriptorService.getViewContainerModel(h).title,containerLabel:a,accept:()=>this.paneCompositeService.openPaneComposite(d.id,r,!0)})}};i(Sr.Sidebar,g(zC,1,"Side Bar")),i(Sr.Panel,g(zC,2,"Panel")),i(Sr.AuxiliaryBar,g(zC,3,"Secondary Side Bar"));const s=r=>{const a=this.paneCompositeService.getPaneComposites(r);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};s(Sr.Sidebar),s(Sr.Panel),s(Sr.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(zC,4,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(zC,5,"Terminal"),accept:async()=>{await this.terminalGroupService.showPanel(!0),this.terminalService.setActiveInstance(c)}})})}),this.debugService.getModel().getSessions(!0).filter(r=>r.hasSeparateRepl()).forEach((r,a)=>{const c=r.name;e.push({label:c,containerLabel:g(zC,6,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(x3e)||await this.viewsService.openView(x3e,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(zC,7,"Output"),accept:()=>this.outputService.showChannel(r.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},oDe=EP,EP.PREFIX="view ",EP);jV=oDe=D([_(0,z_),_(1,q_),_(2,nhe),_(3,Nz),_(4,MPe),_(5,IPe),_(6,Nw),_(7,Pe)],jV);const Zce=class Zce extends pi{constructor(){super({id:Zce.ID,title:Be(zC,8,"Open View"),category:Xa.View,f1:!0})}async run(e){e.get(On).quickAccess.show(jV.PREFIX)}};Zce.ID="workbench.action.openView";let D6=Zce;const nR=class nR extends pi{constructor(){super({id:nR.ID,title:Be(zC,9,"Quick Open View"),category:Xa.View,f1:!1,keybinding:{weight:ye.WorkbenchContrib,when:void 0,...nR.KEYBINDING}})}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(nR.ID);i.quickAccess.show(jV.PREFIX,{quickNavigateConfiguration:{keybindings:s},itemActivation:Qp.FIRST})}};nR.ID="workbench.action.quickOpenView",nR.KEYBINDING={primary:V.CtrlCmd|E.KeyQ,mac:{primary:V.WinCtrl|E.KeyQ},linux:{primary:0}};let xne=nR;const E_="vs/workbench/contrib/quickaccess/browser/quickAccess.contribution",sOe=it.as(xz.Quickaccess);sOe.registerQuickAccessProvider({ctor:a8,prefix:a8.PREFIX,placeholder:g(E_,0,"Type '{0}' to get help on the actions you can take from here.",a8.PREFIX),helpEntries:[{description:g(E_,1,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(E_,2,"More")}]});sOe.registerQuickAccessProvider({ctor:jV,prefix:jV.PREFIX,contextKey:"inViewsPicker",placeholder:g(E_,3,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(E_,4,"Open View"),commandId:D6.ID}]});sOe.registerQuickAccessProvider({ctor:FF,prefix:FF.PREFIX,contextKey:"inCommandsPicker",placeholder:g(E_,5,"Type the name of a command to run."),helpEntries:[{description:g(E_,6,"Show and Run Commands"),commandId:V1.ID,commandCenterOrder:20}]});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:V1.ID,title:g(E_,7,"&&Command Palette...")},order:1});Xs.appendMenuItem(Te.MenubarHelpMenu,{group:"1_welcome",command:{id:V1.ID,title:g(E_,8,"Show All Commands")},order:2});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:D6.ID,title:g(E_,9,"&&Open View...")},order:2});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(E_,10,"Go to &&Line/Column...")},order:1});Xs.appendMenuItem(Te.GlobalActivity,{group:"1_command",command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});Xs.appendMenuItem(Te.EditorContext,{group:"z_commands",when:X.editorSimpleInput.toNegated(),command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});At(g$t);At(V1);At(D6);At(xne);const b$t="inViewsPicker",xst=ge.and(aA,ge.has(b$t)),eH=xne.KEYBINDING,T3e="workbench.action.quickOpenNavigateNextInViewPicker";xr.registerCommandAndKeybindingRule({id:T3e,weight:ye.WorkbenchContrib+50,handler:Rhe(T3e,!0),when:xst,primary:eH.primary,linux:eH.linux,mac:eH.mac});const R3e="workbench.action.quickOpenNavigatePreviousInViewPicker";xr.registerCommandAndKeybindingRule({id:R3e,weight:ye.WorkbenchContrib+50,handler:Rhe(R3e,!1),when:xst,primary:eH.primary|V.Shift,linux:eH.linux,mac:{primary:eH.mac.primary|V.Shift}});const Ow=Il;var zH;let Dne=(zH=class extends ${constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},zH.ID="workbench.contrib.externalUriResolver",zH);Dne=D([_(0,fr),_(1,Ow)],Dne);const LB="vs/workbench/contrib/url/browser/trustedDomains",Dst=P.parse("trustedDomains:/Trusted Domains"),Hhe="http.linkProtectionTrustedDomains",rDe="http.linkProtectionTrustedDomainsContent",aDe={id:"workbench.action.manageTrustedDomain",description:{description:Be(LB,0,"Manage Trusted Domains"),args:[]},handler:async n=>{n.get(_i).openEditor({resource:Dst,languageId:"jsonc",options:{pinned:!0}})}};async function C$t(n,e,t,i,s,o,r){const a=P.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(LB,1,"Trust {0}",e),id:"trust",toTrust:e,picked:!0}),c.length===4&&c.every(p=>Number.isInteger(+p)||Number.isInteger(+p.split(":")[0]))){if(a.authority.includes(":")){const p=a.authority.split(":")[0];h.push({type:"item",label:g(LB,2,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(LB,3,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(LB,4,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(LB,5,"Manage Trusted Domains"),id:"manage"});const f=await i.pick(h,{activeItem:h[0]});if(f&&f.id)switch(f.id){case"manage":return await o.openEditor({resource:Dst.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),n;case"trust":{const p=f.toTrust;if(n.indexOf(p)===-1)return s.remove(rDe,ke.APPLICATION),s.store(Hhe,JSON.stringify([...n,p]),ke.APPLICATION,ln.USER),[...n,p]}}return[]}async function y$t(n){const{defaultTrustedDomains:e,trustedDomains:t}=kne(n);return{defaultTrustedDomains:e,trustedDomains:t}}function kne(n){const e=n.get(sn),t=n.get(Ja),i=n.get(Ow),s=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Hhe,ke.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:s,trustedDomains:o}}const S$t="trustedDomains",A$t={type:an.File,ctime:Date.now(),mtime:Date.now(),size:0},kst=`// Links matching one or more entries in the list below can be opened without link protection. +${n}`:n}var $xe;const Rpe=we;function iB(n){n.scrollTop=n.scrollHeight-n.renderHeight}var bP;let A6=(bP=class extends ${get visible(){return this._visible}set viewModel(e){this._viewModel!==e&&(this.viewModelDisposables.clear(),this._viewModel=e,e&&this.viewModelDisposables.add(e),this._onDidChangeViewModel.fire())}get viewModel(){return this._viewModel}get parsedInput(){return this.parsedChatRequest===void 0&&(this.parsedChatRequest=this.instantiationService.createInstance(mne).parseChatRequest(this.viewModel.sessionId,this.getInput(),this.location,{selectedAgent:this._lastSelectedAgent}),this.agentInInput.set(!!this.parsedChatRequest.parts.find(e=>e instanceof tp))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(),this.location=e,this.viewContext=t,this.viewOptions=i,this.styles=s,this.contextKeyService=r,this.instantiationService=a,this.chatService=c,this.chatAgentService=l,this.contextMenuService=h,this.chatAccessibilityService=u,this.logService=f,this.themeService=p,this.chatSlashCommandService=m,this._onDidSubmitAgent=this._register(new I),this.onDidSubmitAgent=this._onDidSubmitAgent.event,this._onDidFocus=this._register(new I),this.onDidFocus=this._onDidFocus.event,this._onDidChangeViewModel=this._register(new I),this.onDidChangeViewModel=this._onDidChangeViewModel.event,this._onDidScroll=this._register(new I),this.onDidScroll=this._onDidScroll.event,this._onDidClear=this._register(new I),this.onDidClear=this._onDidClear.event,this._onDidAcceptInput=this._register(new I),this.onDidAcceptInput=this._onDidAcceptInput.event,this._onDidDeleteContext=this._register(new I),this.onDidDeleteContext=this._onDidDeleteContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this._onDidChangeContentHeight=new I,this.onDidChangeContentHeight=this._onDidChangeContentHeight.event,this.contribs=[],this.visibleChangeCount=0,this._visible=!1,this.previousTreeScrollHeight=0,this.viewModelDisposables=this._register(new Z),JPt.bindTo(r).set(!0),ZPt.bindTo(r).set(e),eFt.bindTo(r).set("resource"in t),this.agentInInput=gtt.bindTo(r),this.requestInProgress=j7.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(zxe)),this._register(o.registerCodeEditorOpenHandler(async(v,w,b)=>{let C=v.resource;if(Rx(C,_e.vscodeCopilotBackingChatCodeBlock)&&(C=C.with({scheme:_e.vscodeChatCodeBlock})),C.scheme!==_e.vscodeChatCodeBlock)return null;const y=C.path.split("/").at(1);if(!y)return null;const S=this.viewModel?.getItems().find(M=>M.id===y);if(!S)return null;this.reveal(S),await Ta(0);for(const M of this.renderer.editorsInUse()??[])if(Fn.isEqual(M.uri,C,!0)){const k=M.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.startLineNumber??v.options.selection.endLineNumber,endColumn:v.options.selection.startColumn??v.options.selection.endColumn}),k}return null}))}set lastSelectedAgent(e){this.parsedChatRequest=void 0,this._lastSelectedAgent=e,this._onDidChangeParsedInput.fire()}get lastSelectedAgent(){return this._lastSelectedAgent}get supportsFileReferences(){return!!this.viewOptions.supportsFileReferences}get input(){return this.inputPart}get inputEditor(){return this.inputPart.inputEditor}get inputUri(){return this.inputPart.inputUri}get contentHeight(){return this.inputPart.contentHeight+this.tree.contentHeight}render(e){const t="viewId"in this.viewContext?this.viewContext.viewId:void 0;this.editorOptions=this._register(this.instantiationService.createInstance(Vxe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,s=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=he(e,Rpe(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:s,renderStyle:o}),this.listContainer=he(this.container,Rpe(".interactive-list"))):(this.listContainer=he(this.container,Rpe(".interactive-list")),this.createInput(this.container,{renderFollowups:s,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),iB(this.tree)),this.contribs=$xe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Ma(a));return}}).filter(yl)}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}moveFocus(e,t){if(!As(e))return;const i=this.viewModel?.getItems();if(!i)return;const s=i.filter(a=>As(a)),o=s.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;r<0||r>s.length-1||this.focus(s[r])}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(s=>({element:s,collapsed:!1,collapsible:!1}));this.tree.setChildren(null,t,{diffIdentityProvider:{getId:s=>(As(s)||ip(s)?s.dataId:s.id)+(XW(s)&&this.viewModel?`_${Vf[this.viewModel.initState]}`:"")+`${ip(s)||XW(s)}${As(s)&&s.renderData?`_${this.visibleChangeCount}`:""}`+(As(s)?`_${s.contentReferences.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&As(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&XW(i)?this.renderFollowups(i.sampleQuestions):this.renderFollowups(void 0)}}async renderFollowups(e,t){this.inputPart.renderFollowups(e,t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}setVisible(e){const t=this._visible;this._visible=e,this.visibleChangeCount++,this.renderer.setVisible(e),this.input.setVisible(e),e?this._register(PS(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this.instantiationService.createChild(new Dl([Pe,this.contextKeyService]))),s=i.createInstance(Pxe,this.viewOptions.defaultElementHeight??200),o={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},r=document.createElement("div");r.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(r),this.renderer=this._register(i.createInstance(fne,this.editorOptions,this.location,t,o,this._codeBlockModelCollection,r)),this._register(this.renderer.onDidClickFollowup(a=>{this.acceptInput(a.message)})),this._register(this.renderer.onDidClickRerunWithAgentOrCommandDetection(a=>{const c=this.chatService.getSession(a.sessionId)?.getRequests().find(l=>l.id===a.requestId);c&&this.chatService.resendRequest(c,{noCommandDetection:!0,attempt:c.attempt,location:this.location}).catch(l=>this.logService.error("FAILED to rerun request",l))})),this.tree=i.createInstance(L7,"Chat",e,s,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(MEe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>ip(a)?a.message:As(a)?a.response.value:""},setRowLineHeight:!1,filter:this.viewOptions.filter?{filter:this.viewOptions.filter.bind(this.viewOptions)}:void 0,overrideStyles:{listFocusBackground:this.styles.listBackground,listInactiveFocusBackground:this.styles.listBackground,listActiveSelectionBackground:this.styles.listBackground,listFocusAndSelectionBackground:this.styles.listBackground,listInactiveSelectionBackground:this.styles.listBackground,listHoverBackground:this.styles.listBackground,listBackground:this.styles.listBackground,listFocusForeground:this.styles.listForeground,listHoverForeground:this.styles.listForeground,listInactiveFocusForeground:this.styles.listForeground,listInactiveSelectionForeground:this.styles.listForeground,listActiveSelectionForeground:this.styles.listForeground,listFocusAndSelectionForeground:this.styles.listForeground}}),this._register(this.tree.onContextMenu(a=>this.onContextMenu(a))),this._register(this.tree.onDidChangeContentHeight(()=>{this.onDidChangeTreeContentHeight()})),this._register(this.renderer.onDidChangeItemHeight(a=>{this.tree.updateElementHeight(a.element,a.height)})),this._register(this.tree.onDidFocus(()=>{this._onDidFocus.fire()})),this._register(this.tree.onDidScroll(()=>{this._onDidScroll.fire()}))}onContextMenu(e){e.browserEvent.preventDefault(),e.browserEvent.stopPropagation();const t=e.element,i=this.contextKeyService.createOverlay([[htt.key,As(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:Te.ChatContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:i,getAnchor:()=>e.anchor,getActionsContext:()=>t})}onDidChangeTreeContentHeight(){this.tree.scrollHeight!==this.previousTreeScrollHeight&&this.tree.scrollTop+this.tree.renderHeight>=this.previousTreeScrollHeight-2&&xd(gt(this.listContainer),()=>{iB(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(b6,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle,menus:{executeToolbar:Te.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(s=>{s.setInputState&&typeof i=="object"&&i?.[s.id]&&s.setInputState(i[s.id])})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidDeleteContext(i=>this._onDidDeleteContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let s="";if(i.followup.agentId&&i.followup.agentId!==this.chatAgentService.getDefaultAgent(this.location)?.id){const o=this.chatAgentService.getAgent(i.followup.agentId);if(!o)return;this.lastSelectedAgent=o,s=`${$z}${o.name} `,i.followup.subCommand&&(s+=`${O1}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(s=`${O1}${i.followup.subCommand} `);s+=i.followup.message,this.acceptInput(s),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,result:i.response.result,action:{kind:"followUp",followup:i.followup}})})),this._register(this.inputPart.onDidChangeHeight(()=>{this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width),this._onDidChangeContentHeight.fire()})),this._register(this.inputEditor.onDidChangeModelContent(()=>this.parsedChatRequest=void 0)),this._register(this.chatAgentService.onDidChangeAgents(()=>this.parsedChatRequest=void 0))}onDidStyleChange(){this.container.style.setProperty("--vscode-interactive-result-editor-background-color",this.editorOptions.configuration.resultEditor.backgroundColor?.toString()??""),this.container.style.setProperty("--vscode-interactive-session-foreground",this.editorOptions.configuration.foreground?.toString()??""),this.container.style.setProperty("--vscode-chat-list-background",this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString()??"")}setModel(e,t){if(!this.container)throw new Error("Call render() before setModel()");this._codeBlockModelCollection.clear(),this.container.setAttribute("data-session-id",e.sessionId),this.viewModel=this.instantiationService.createInstance(mEe,e,this._codeBlockModelCollection),this.viewModelDisposables.add(T.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(s=>s?.kind==="addRequest")&&this.visible&&(iB(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.setState(t.inputValue),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.tree&&(this.onDidChangeItems(),iB(this.tree))}getFocus(){return this.tree.getFocus()[0]??void 0}reveal(e){this.tree.reveal(e)}focus(e){const i=this.tree.getNode(null).children.find(s=>s.element?.id===e.id);i&&(this.tree.setFocus([i.element]),this.tree.domFocus())}refilter(){this.tree.refilter()}setInputPlaceholder(e){this.viewModel?.setInputPlaceholder(e)}resetInputPlaceholder(){this.viewModel?.resetInputPlaceholder()}setInput(e=""){this.inputPart.setValue(e)}getInput(){return this.inputPart.inputEditor.getValue()}async acceptInput(e){return this._acceptInput(e?{query:e}:void 0)}async acceptInputWithPrefix(e){this._acceptInput({prefix:e})}collectInputState(){const e={};return this.contribs.forEach(t=>{t.getInputState&&(e[t.id]=t.getInputState())}),e}async _acceptInput(e){if(this.viewModel){this._onDidAcceptInput.fire();const t=this.getInput(),i=this.chatAccessibilityService.acceptRequest(),s=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,s,{location:this.location,parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r){this.inputPart.attachedContext.clear();const a=this.collectInputState();return this.inputPart.acceptInput(o?s:void 0,o?a:void 0),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),r.responseCompletePromise.then(()=>{const c=this.viewModel?.getItems().filter(As),l=c?.[c.length-1];this.chatAccessibilityService.acceptResponse(l,i)}),r.responseCreatedPromise}}}setContext(e,...t){e&&this.inputPart.attachedContext.clear(),this.inputPart.attachContext(...t),this.bodyDimension&&this.layout(this.bodyDimension.height,this.bodyDimension.width)}getCodeBlockInfosForResponse(e){return this.renderer.getCodeBlockInfosForResponse(e)}getCodeBlockInfoForEditor(e){return this.renderer.getCodeBlockInfoForEditor(e)}getFileTreeInfosForResponse(e){return this.renderer.getFileTreeInfosForResponse(e)}getLastFocusedFileTreeForResponse(e){return this.renderer.getLastFocusedFileTreeForResponse(e)}focusLastMessage(){if(!this.viewModel)return;const e=this.tree.getNode(null).children,t=e[e.length-1];t&&(this.tree.setFocus([t.element]),this.tree.domFocus())}layout(e,t){t=Math.min(t,850),this.bodyDimension=new Tn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,s=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,o=e-i;this.tree.layout(o,t),this.tree.getHTMLElement().style.height=`${o}px`,this.renderer.layout(t),s&&iB(this.tree),this.listContainer.style.height=`${e-i}px`,this._onDidChangeHeight.fire(e)}setDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0},this._register(this.renderer.onDidChangeItemHeight(()=>this.layoutDynamicChatTreeItemMode()));const i=this._register(new Dn);this._register(this.tree.onDidScroll(s=>{this._dynamicMessageLayoutData?.enabled&&(i.value=xd(gt(this.listContainer),()=>{if(!s.scrollTopChanged||s.heightChanged||s.scrollHeightChanged)return;const o=s.height,r=s.scrollHeight-o-s.scrollTop;if(r===0)return;const a=this._dynamicMessageLayoutData?.maxHeight??t,c=this.bodyDimension?.width??this.container.offsetWidth;this.inputPart.layout(a,c);const l=this.inputPart.inputPartHeight,d=Math.min(o+r,a-l);this.layout(d+l,c)}))}))}updateDynamicChatTreeItemLayout(e,t){this._dynamicMessageLayoutData={numOfMessages:e,maxHeight:t,enabled:!0};let i=!1,s=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:s.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&iB(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},$xe=bP,bP.CONTRIBS=[],bP);A6=$xe=D([_(4,jt),_(5,Pe),_(6,be),_(7,Rw),_(8,yp),_(9,lL),_(10,Vr),_(11,BZe),_(12,Ze),_(13,pn),_(14,DPe)],A6);var fX;const Gxe="vs/workbench/contrib/inlineChat/browser/inlineChatWidget";let qxe=class{constructor(e,t,i,s,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=s,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=di("div.inline-chat@root",[di("div.chat-widget@chatWidget"),di("div.progress@progress"),di("div.followUps.hidden@followUps"),di("div.previewDiff.hidden@previewDiff"),di("div.accessibleViewer@accessibleViewer"),di("div.status@status",[di("div.label.info.hidden@infoLabel"),di("div.actions.hidden@statusToolbar"),di("div.label.status.hidden@statusLabel"),di("div.actions.hidden@feedbackToolbar")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=T.filter(this._onDidChangeHeight.event,S=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this._progressBar=new y7(this._elements.progress),this._store.add(this._progressBar);let u=!1;this.scopedContextKeyService=this._store.add(s.createScoped(this._elements.chatWidget));const f=i.createChild(new Dl([Pe,this.scopedContextKeyService]),this._store);this._chatWidget=f.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!0,editorOverflowWidgetsDomNode:t.editorOverflowWidgetsDomNode,rendererOptions:t.rendererOptions,menus:{executeToolbar:t.inputMenuId,inputSideToolbar:t.widgetMenuId,telemetrySource:t.telemetrySource},filter:S=>XW(S)?!1:ip(S)?u:!0},{listForeground:Mc,listBackground:wEe,inputEditorBackground:SE,resultEditorBackground:us}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(tde(y5t),Ye(wEe)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const p=this._store.add(new Dn);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{const S=this._chatWidget.viewModel;if(!S){u=!1,p.clear();return}const M=()=>{let k=0;for(const N of S.getItems())if(ip(N)&&++k>=2)break;const F=k>=2;F!==u&&(u=F,this._chatWidget.refilter())};p.value=S.onDidChange(M)}));const m=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{m.clear();const S=this._chatWidget.viewModel;S&&m.add(S.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=Tzt.bindTo(this._contextKeyService);const v=this._store.add(Dd(this.domNode));this._store.add(v.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(v.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=Lzt.bindTo(s),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const w=t.statusMenuId instanceof Te?t.statusMenuId:t.statusMenuId.menu,b=t.statusMenuId instanceof Te?void 0:t.statusMenuId.options,C=this._instantiationService.createInstance(REe,this._elements.statusToolbar,w,b);this._store.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(C);const y={hiddenItemStrategy:wS.NoHide,toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}};if(t.feedbackMenuId){const S=this._instantiationService.createInstance(nC,this._elements.feedbackToolbar,t.feedbackMenuId,{...y,hiddenItemStrategy:wS.Ignore});this._store.add(S.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(S)}this._store.add(this._configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.followUps.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupUpdatableHover(va("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(S=>{S.sessionId===this._chatWidget.viewModel?.model.sessionId&&S.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(Vie,void 0,lc.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(ua.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=Z3t;if(this._configurationService.getValue(ua.InlineChat)){const t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getLabel();e=t?g(Gxe,0,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(Gxe,1,"Inline Chat Input, Run the Inline Chat Accessibility Help command for more information.")}this._chatWidget.inputEditor.updateOptions({ariaLabel:e})}}dispose(){this._store.dispose()}get domNode(){return this._elements.root}get chatWidget(){return this._chatWidget}saveState(){this._chatWidget.saveState()}layout(e){this._isLayouting=!0;try{this._doLayout(e)}finally{this._isLayouting=!1}}_doLayout(e){const t=this._getExtraHeight(),i=Zf(this._elements.progress),s=Zf(this._elements.followUps),o=Zf(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._elements.progress.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-s-o-t,e.width)}get contentHeight(){const e={followUpsHeight:Zf(this._elements.followUps),chatWidgetContentHeight:this._chatWidget.contentHeight,progressHeight:Zf(this._elements.progress),statusHeight:Zf(this._elements.status),extraHeight:this._getExtraHeight()};return e.progressHeight+e.chatWidgetContentHeight+e.followUpsHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(As(i)&&i.response.value.some(s=>s.kind==="textEditGroup"&&!s.state?.applied)){e=270;break}let t=this.contentHeight;return t-=this._chatWidget.contentHeight,t+=Math.min(this._chatWidget.input.contentHeight+e,this._chatWidget.contentHeight),t}_getExtraHeight(){return 26}updateProgress(e){e?(this._progressBar.show(),this._progressBar.infinite()):(this._progressBar.stop(),this._progressBar.hide())}get value(){return this._chatWidget.getInput()}set value(e){this._chatWidget.setInput(e)}selectAll(e=!0){let t=1;if(!e){const i=/^(\/\w+)\s*/.exec(this._chatWidget.inputEditor.getModel().getLineContent(1));i&&(t=i[1].length+1)}this._chatWidget.inputEditor.setSelection(new mt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.statusToolbar.classList.toggle("hidden",!e),this._elements.feedbackToolbar.classList.toggle("hidden",!e),this._elements.status.classList.toggle("actions",e),this._elements.infoLabel.classList.toggle("hidden",e),this._onDidChangeHeight.fire()}async getCodeBlockInfo(e){const{viewModel:t}=this._chatWidget;if(t){for(const i of t.getItems())if(As(i))return t.codeBlockModelCollection.get(t.sessionId,i,e)?.model}}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(mo(e))return Mf(e)?.response?.response.asString()}get usesDefaultChatModel(){return this.getChatModel()===this._defaultChatModel}getChatModel(){return this._chatWidget.viewModel?.model??this._defaultChatModel}setChatModel(e){this._chatWidget.setModel(e,{inputValue:void 0})}addToHistory(e){this._chatWidget.viewModel?.model===this._defaultChatModel&&this._chatWidget.input.acceptInput(e)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const s=this._defaultChatModel;if(!e?.message.value){for(const r of s.getRequests())s.removeRequest(r.id);return}const o=s.addRequest({parts:[],text:""},{variables:[]},0);if(s.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){s.completeResponse(o);return}return{cancel:()=>s.cancelRequest(o),complete:()=>s.completeResponse(o),appendContent:r=>{s.acceptResponseProgress(o,{kind:"markdownContent",content:new Xt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=nw(e);_a(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const o=this._elements.statusLabel.innerText,r=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(o,{classes:a,keepMessage:!0,title:r})},t.resetAfter)}const s=nw(e);_a(this._elements.statusLabel,...s),this._elements.statusLabel.className=`label status ${(t.classes??[]).join(" ")}`,this._elements.statusLabel.classList.toggle("hidden",!e),i?this._elements.statusLabel.dataset.state="temp":delete this._elements.statusLabel.dataset.state,t.title?this._elements.statusLabel.dataset.title=t.title:delete this._elements.statusLabel.dataset.title,this._onDidChangeHeight.fire()}reset(){this._chatWidget.saveState(),this.updateChatMessage(void 0),_a(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.statusToolbar.classList.add("hidden"),this._elements.feedbackToolbar.classList.add("hidden"),this.updateInfo(""),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(xl())}};qxe=D([_(2,be),_(3,Pe),_(4,ti),_(5,Ur),_(6,Re),_(7,Tw),_(8,Rn),_(9,Rw),_(10,el)],qxe);const Z3t=g(Gxe,2,"Inline Chat Input");let Qxe=class extends qxe{constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,{...i,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()},r,s,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new Dn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height),super._doLayout(e.with(void 0,t)),this._elements.root.style.height=`${e.height-this._getExtraHeight()}px`}reset(){this._accessibleViewer.clear(),super.reset()}showAccessibleHunk(e,t){this._elements.accessibleViewer.classList.remove("hidden"),this._accessibleViewer.clear(),this._accessibleViewer.value=this._instantiationService.createInstance(jxe,this._elements.accessibleViewer,e,t,new e$t(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};Qxe=D([_(3,Pe),_(4,ti),_(5,be),_(6,Ur),_(7,Re),_(8,Tw),_(9,Rn),_(10,Rw),_(11,el)],Qxe);let jxe=fX=class extends Kk{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,s,o){const r=xi("width",0),a=xi("diff",fX._asMapping(i)),c=Dt(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=s.getModifiedOptions().get(x.lineHeight)*l;super(e,Au(!0),()=>{},Au(!1),r,Au(d),c,s,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(fX._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),s=bi.fromRangeInclusive(t[0]),o=bi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(Qxe,e,this.editor,{telemetrySource:"interactiveEditorWidget-toolbar",inputMenuId:Te.ChatExecute,widgetMenuId:Vzt,statusMenuId:{menu:zzt,options:{buttonConfigProvider:a=>new Set([Hzt,Uzt]).has(a.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:a.id===Wzt?{isSecondary:!1}:{isSecondary:!0}}},rendererOptions:{renderTextEditsAsSummary:a=>_n(a,t.getModel()?.uri)&&o.getValue(Mv.Mode)===yS.Live}}),this._disposables.add(this.widget.onDidChangeHeight(()=>{this.position&&this._relayout(this._computeHeight().linesValue)})),this._disposables.add(this.widget),this.create(),this._disposables.add(pe(this.domNode,"click",a=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const r=()=>{!this.position||!this.editor.hasModel()?this._ctxCursorPosition.reset():this.position.lineNumber===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("above"):this.position.lineNumber+1===this.editor.getPosition().lineNumber?this._ctxCursorPosition.set("below"):this._ctxCursorPosition.reset()};this._disposables.add(this.editor.onDidChangeCursorPosition(a=>r())),this._disposables.add(this.editor.onDidFocusEditorText(a=>r())),r()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=Math.min(640,this._availableSpaceGivenIndentation(this._indentationWidth));this._dimension=new Tn(t,e),this.widget.layout(this._dimension)}_availableSpaceGivenIndentation(e){const t=this.editor.getLayoutInfo();return t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth+(e??0))}_computeHeight(){const e=this.widget.contentHeight,t=this.editor.getLayoutInfo().height,i=Math.min(e,Math.max(this.widget.minHeight,t*.42));return{linesValue:i/this.editor.getOption(x.lineHeight),pixelsValue:i}}_onWidth(e){this._dimension&&this._doLayout(this._dimension.height)}show(e){Bt(this.container);const t=Gee.capture(this.editor),i=this.editor.getLayoutInfo(),s=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${s}px`;const o=this._computeHeight();if(super.show(e,o.linesValue),this._setWidgetMargins(e),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),e.lineNumber>1)this.editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e.delta(-1)),vt.Immediate);else{const a=this.editor.getTopForLineNumber(e.lineNumber)-o.pixelsValue,c=this.editor.getScrollHeight()-this.editor.getBottomForLineNumber(e.lineNumber),l=this.editor.getScrollTop()-c,d=Math.max(a,l);dt.startLineNumber&&i=i.startLineNumber;r--){const a=t.getLineFirstNonWhitespaceColumn(r);if(a!==0){o=r,s=a;break}}return Math.max(0,this.editor.getOffsetForColumn(o,s))}_setWidgetMargins(e){const t=this._calculateIndentationWidth(e);this._indentationWidth!==t&&(this._indentationWidth=this._availableSpaceGivenIndentation(t)>400?t:0,this.widget.domNode.style.marginLeft=`${this._indentationWidth}px`,this.widget.domNode.style.marginRight=`${this.editor.getLayoutInfo().minimap.minimapWidth}px`)}hide(){this.container.classList.remove("inside-selection"),this._ctxCursorPosition.reset(),this.widget.reset(),this.widget.chatWidget.setVisible(!1),super.hide(),Cu(g(t$t,0,"Closed inline chat widget"))}};Kxe=D([_(2,be),_(3,Pe),_(4,Re)],Kxe);var i$t=".monaco-workbench .inline-chat-content-widget{background-color:var(--vscode-inlineChat-background);border-radius:4px;box-shadow:0 4px 8px var(--vscode-inlineChat-shadow);padding:6px;z-index:50}.monaco-workbench .inline-chat-content-widget .hidden{display:none}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-session{max-width:unset}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part .interactive-execute-toolbar{margin-bottom:1px}.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part.compact{padding:0}.monaco-workbench .inline-chat-content-widget .message{color:var(--vscode-descriptionForeground);display:inline-flex;font-size:11px;overflow:hidden}.monaco-workbench .inline-chat-content-widget .message>.codicon{font-size:12px;line-height:18px;padding-right:5px}";Ct(i$t,{});let Yxe=class{constructor(e,t,i,s){this._editor=t,this.suppressMouseDown=!1,this.allowEditorOverflow=!0,this._store=new Z,this._domNode=document.createElement("div"),this._inputContainer=document.createElement("div"),this._messageContainer=document.createElement("div"),this._onDidBlur=this._store.add(new I),this.onDidBlur=this._onDidBlur.event,this._visible=!1,this._focusNext=!1,this._defaultChatModel=this._store.add(i.createInstance(Vie,void 0,lc.Editor));const o=i.createChild(new Dl([Pe,this._store.add(s.createScoped(this._domNode))]),this._store);this._widget=o.createInstance(A6,e,{resource:!0},{defaultElementHeight:32,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode(),renderStyle:"compact",renderInputOnTop:!0,renderFollowups:!0,supportsFileReferences:!1,menus:{telemetrySource:"inlineChat-content"},filter:a=>!1},{listForeground:Mc,listBackground:wEe,inputEditorBackground:SE,resultEditorBackground:us}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.inputEditor.onDidContentSizeChange(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._messageContainer.classList.add("hidden","message"),this._domNode.appendChild(this._messageContainer);const r=Dd(this._domNode);this._store.add(r.onDidBlur(()=>{this._visible&&this._onDidBlur.fire()})),this._store.add(r)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[hs.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight;return this._widget.layout(Math.min(e,t),360),null}afterRender(){this._focusNext&&(this._focusNext=!1,this._widget.focusInput())}get chatWidget(){return this._widget}get isVisible(){return this._visible}get value(){return this._widget.inputEditor.getValue()}show(e){if(!this._visible){this._visible=!0,this._focusNext=!0,this._editor.revealRangeNearTopIfOutsideViewport(O.fromPositions(e),vt.Immediate),this._widget.inputEditor.setValue("");const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.session.placeholder??""),this._updateMessage(e.session.message??"")}_updateMessage(e){if(e){const t=nw(e);_a(this._messageContainer,...t)}this._messageContainer.style.display=e?"inherit":"none",this._editor.layoutContentWidget(this)}};Yxe=D([_(2,be),_(3,Pe)],Yxe);let _ne=class extends cC{get capabilities(){let e=Mi.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,s,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=s,this.filesConfigurationService=o,this.textResourceConfigurationService=r,this.customEditorLabelService=a,this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._preferredResource=t||e,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this._preferredResource.scheme&&this.updateLabel()}updateLabel(){this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}setPreferredResource(e){_n(e,this._preferredResource)||(this._preferredResource=e,this.updateLabel())}getName(){return typeof this._name!="string"&&(this._name=this.customEditorLabelService.getName(this._preferredResource)??this.labelService.getUriBasenameLabel(this._preferredResource)),this._name}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this._preferredResource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this._preferredResource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this._preferredResource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=jEt(this.resource);let i;const s=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Aft(s)&&(i=s.value*vl.MB),{size:i??t}}};_ne=D([_(2,eo),_(3,ci),_(4,hh),_(5,dl),_(6,aD)],_ne);let Jxe=class extends H1{constructor(e,t,i,s,o){super(i,t,s,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};Jxe=D([_(1,Di),_(2,Ai),_(3,LQ),_(4,Ur)],Jxe);var pX;let Ib=class extends _ne{constructor(e,t,i,s,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=s}save(e,t){return this.resource.scheme!==_e.untitled&&!this.fileService.hasProvider(this.resource)?this.saveAs(e,t):this.doSave(t,!1,e)}saveAs(e,t){return this.doSave(t,!0,e)}async doSave(e,t,i){let s;if(t?s=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):s=await this.textFileService.save(this.resource,e),!!s)return{resource:s}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};Ib=D([_(2,_i),_(3,tr),_(4,eo),_(5,ci),_(6,hh),_(7,dl),_(8,aD)],Ib);var CP;let AM=(CP=class extends Ib{get typeId(){return pX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(e,void 0,c,a,d,l,h,u,f),this.name=t,this.description=i,this.preferredLanguageId=s,this.preferredContents=o,this.textModelService=r,this.cachedModel=void 0,this.modelReference=void 0}getName(){return this.name||super.getName()}setName(e){this.name!==e&&(this.name=e,this._onDidChangeLabel.fire())}getDescription(){return this.description}setDescription(e){this.description!==e&&(this.description=e,this._onDidChangeLabel.fire())}setLanguageId(e,t){this.setPreferredLanguageId(e),this.cachedModel?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e}setPreferredContents(e){this.preferredContents=e}async resolve(){const e=this.preferredContents,t=this.preferredLanguageId;this.preferredContents=void 0,this.preferredLanguageId=void 0,this.modelReference||(this.modelReference=this.textModelService.createModelReference(this.resource));const i=await this.modelReference,s=i.object;if(!(s instanceof Jxe))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=s,(typeof e=="string"||typeof t=="string")&&s.updateTextEditorModel(typeof e=="string"?hde(e):void 0,t),s}matches(e){return this===e?!0:e instanceof pX?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},pX=CP,CP.ID="workbench.editors.resourceEditorInput",CP);AM=pX=D([_(5,Rn),_(6,tr),_(7,_i),_(8,ci),_(9,eo),_(10,hh),_(11,dl),_(12,aD)],AM);const Za=Il;var mX,yP;let E6=(yP=class extends Ib{get typeId(){return mX.ID}get editorId(){return A_.id}constructor(e,t,i,s,o,r,a,c,l,d,h){super(e.resource,void 0,s,t,i,o,c,d,h),this.model=e,this.environmentService=r,this.pathService=a,this.textModelService=l,this.modelResolve=void 0,this.modelDisposables=this._register(new Z),this.cachedUntitledTextEditorModelReference=void 0,this.registerModelListeners(e),this._register(this.textFileService.untitled.onDidCreate(u=>this.onDidCreateUntitledModel(u)))}registerModelListeners(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelDisposables.add(e.onDidChangeName(()=>this._onDidChangeLabel.fire())),this.modelDisposables.add(e.onDidRevert(()=>this.dispose()))}onDidCreateUntitledModel(e){_n(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Gs.MEDIUM){if(!this.model.hasAssociatedFilePath){const t=this.resource.path;return t!==this.getName()?t:void 0}return super.getDescription(e)}getTitle(e){if(!this.model.hasAssociatedFilePath){const t=this.getName(),i=this.getDescription();return i&&i!==t?`${t} • ${i}`:t}return super.getTitle(e)}isDirty(){return this.model.isDirty()}getEncoding(){return this.model.getEncoding()}setEncoding(e,t){return this.model.setEncoding(e)}get hasLanguageSetExplicitly(){return this.model.hasLanguageSetExplicitly}get hasAssociatedFilePath(){return this.model.hasAssociatedFilePath}setLanguageId(e,t){this.model.setLanguageId(e,t)}getLanguageId(){return this.model.getLanguageId()}async resolve(){return this.modelResolve||(this.modelResolve=(async()=>{this.cachedUntitledTextEditorModelReference=await this.textModelService.createModelReference(this.resource)})()),await this.modelResolve,this.isDisposed()&&this.disposeModelReference(),this.model}toUntyped(e){const t={resource:this.model.hasAssociatedFilePath?R9(this.model.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme):this.resource,forceUntitled:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=this.model.isModified()?this.model.textEditorModel?.getValue():void 0,t.options.viewState=qW(this,e.preserveViewState,this.editorService),typeof t.contents=="string"&&!this.model.hasAssociatedFilePath&&!e.preserveResource&&(t.resource=void 0)),t}matches(e){return this===e?!0:e instanceof mX?_n(e.resource,this.resource):KLt(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},mX=yP,yP.ID="workbench.editors.untitledEditorInput",yP);E6=mX=D([_(1,tr),_(2,eo),_(3,_i),_(4,ci),_(5,Za),_(6,Lm),_(7,hh),_(8,Rn),_(9,dl),_(10,aD)],E6);const jce=class jce extends Error{constructor(e){super(e),this.name=jce.code}};jce.code="InlineChatError";let vne=jce;const h3e="_inlineChatContext",u3e="_inlineChatDocument",IBe=class IBe{constructor(e,t,i){this.uri=e,this.selection=t,this.wholeRange=i}};IBe.variableName="_inlineChatContext";let Xxe=IBe,g3e=class{constructor(e,t,i,s,o,r,a,c,l,d){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=s,this._logService=o,this._instaService=r,this._editorService=a,this._chatService=c,this._chatAgentService=l,this._store=new Z,this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._onDidMoveSession=this._store.add(new I),this.onDidMoveSession=this._onDidMoveSession.event,this._onDidEndSession=this._store.add(new I),this.onDidEndSession=this._onDidEndSession.event,this._onDidStashSession=this._store.add(new I),this.onDidStashSession=this._onDidStashSession.event,this._sessions=new Map,this._keyComputers=new Map,this._recordings=[],this._store.add(d.registerVariable({id:h3e,name:h3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return JSON.stringify(new Xxe(p.session.textModelN.uri,p.editor.getSelection(),p.session.wholeRange.trackedInitialRange))})),this._store.add(d.registerVariable({id:u3e,name:u3e,description:"",hidden:!0},async(h,u,f)=>{for(const[,p]of this._sessions)if(p.session.chatModel===f)return p.session.textModelN.uri}))}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const s=this._chatAgentService.getDefaultAgent(lc.Editor);if(!s){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a={id:Math.random(),wholeRange:new O(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn),placeholder:s.description,slashCommands:s.slashCommands},c=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${s.extensionId}`);const l=this._chatService.startSession(lc.Editor,i);if(!l){this._logService.trace("[IE] NO chatModel found");return}c.add(Ee(()=>{this._chatService.clearSession(l.sessionId),l.dispose()}));const d=c.add(new Dn);c.add(l.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const C=o.getAlternativeVersionId(),{response:y}=b.request;d.value=y.onDidChange(()=>{if(!y.isComplete)return;d.clear();let S;if(y.isCanceled)S=new CEe(new Tc);else if(y.result?.errorDetails)S=new CEe(new Error(y.result.errorDetails.message));else if(y.response.value.length===0)S=new ist;else{const M={edits:{edits:[]}};for(const k of y.response.value)if(k.kind==="textEditGroup")for(const F of k.edits)for(const N of F)M.edits.edits.push({resource:k.uri,textEdit:N,versionId:void 0});S=this._instaService.createInstance(WI,M,v.textModelN.uri,C,b.request,y)}v.addExchange(new jzt(v.lastInput,S)),S instanceof WI&&S.untitledTextModel&&this._textModelService.createModelReference(S.untitledTextModel.resource).then(M=>{c.add(M)})})})),c.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(s.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${s.extensionId}`),this._releaseSession(v,!0))}));const h=Dr(),u=o.uri;c.add(await this._textModelService.createModelReference(o.uri));const f=o,p=c.add(this._modelService.createModel(fQ(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:T.None},u.with({scheme:_e.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:h,textModel0:""}).toString()}),!0));u.scheme===_e.untitled&&c.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:u,typeId:E6.ID,editorId:A_.id})||this._releaseSession(v,!0)}));let m=t.wholeRange;if(m||(m=a.wholeRange?O.lift(a.wholeRange):e.getSelection()),i.isCancellationRequested){c.dispose();return}const v=new qzt(t.editMode,u,p,f,s,a,c.add(new bEe(f,m)),c.add(new SEe(this._editorWorkerService,p,f)),l),w=this._key(e,v.targetUri);if(this._sessions.has(w))throw c.dispose(),new Error(`Session already stored for ${w}`);return this._sessions.set(w,{session:v,editor:e,store:c}),v}moveSession(e,t){const i=this._key(t,e.targetUri),s=this._sessions.get(i);if(s){if(s.session!==e)throw new Error("Cannot move session because the target editor already/still has one");return}let o=!1;for(const[r,a]of this._sessions)if(a.session===e){o=!0,this._sessions.delete(r),this._sessions.set(i,{...a,editor:t}),this._logService.trace(`[IE] did MOVE session for ${a.editor.getId()} to NEW EDITOR ${t.getId()}, ${e.agent.extensionId}`),this._onDidMoveSession.fire({session:e,editor:t});break}if(!o)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const r of this._sessions)if(r[1].session===e){i=r;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[s,o]=i;this._sessions.delete(s),this._logService.trace(`[IE] did RELEASED session for ${o.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:o.editor,session:e,endedByExternalCause:t}),o.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const s=this._instaService.createInstance(yEe,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),s}getCodeEditor(e){for(const[,t]of this._sessions)if(t.session===e)return t.editor;throw new Error("session not found")}getSession(e,t){const i=this._key(e,t);return this._sessions.get(i)?.session}_key(e,t){const i=this._keyComputers.get(t.scheme);return i?i.getComparisonKey(e,t):`${e.getId()}@${t.toString()}`}registerSessionKeyComputer(e,t){return this._keyComputers.set(e,t),Ee(()=>this._keyComputers.delete(e))}_keepRecording(e){this._recordings.unshift(e.asRecording())>5&&this._recordings.pop()}recordings(){return this._recordings}};g3e=D([_(0,rn),_(1,Ai),_(2,Rn),_(3,kd),_(4,Ze),_(5,be),_(6,_i),_(7,Rw),_(8,yp),_(9,Mz)],g3e);var VH;let f3e=(VH=class{constructor(e,t){this._ctxHasProvider=kzt.bindTo(e),t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(lc.Editor);this._ctxHasProvider.set(i)})}dispose(){this._ctxHasProvider.reset()}},VH.Id="inlineChat.enabler",VH);f3e=D([_(0,Pe),_(1,yp)],f3e);const TL="vs/workbench/contrib/inlineChat/browser/inlineChatController";var Xr;(function(n){n.CREATE_SESSION="CREATE_SESSION",n.INIT_UI="INIT_UI",n.WAIT_FOR_INPUT="WAIT_FOR_INPUT",n.SHOW_REQUEST="SHOW_REQUEST",n.SHOW_RESPONSE="SHOW_RESPONSE",n.PAUSE="PAUSE",n.CANCEL="CANCEL",n.ACCEPT="DONE"})(Xr||(Xr={}));var Od;(function(n){n[n.NONE=0]="NONE",n[n.ACCEPT_SESSION=1]="ACCEPT_SESSION",n[n.CANCEL_SESSION=2]="CANCEL_SESSION",n[n.PAUSE_SESSION=4]="PAUSE_SESSION",n[n.CANCEL_REQUEST=8]="CANCEL_REQUEST",n[n.CANCEL_INPUT=16]="CANCEL_INPUT",n[n.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Od||(Od={}));let p3e=class{static get(e){return e.getContribution(zze)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=s,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,this._languageFeatureService=h,this._chatWidgetService=u,this._isDisposed=!1,this._store=new Z,this._messages=this._store.add(new I),this._onWillStartSession=this._store.add(new I),this.onWillStartSession=this._onWillStartSession.event,this._sessionStore=this._store.add(new Z),this._stashedSession=this._store.add(new Dn),this._forcedPlaceholder=void 0,this._ctxVisible=Izt.bindTo(l),this._ctxUserDidEdit=Pzt.bindTo(l),this._ctxResponseTypes=Nzt.bindTo(l),this._ui=new Ka(()=>{let p=lc.Editor;for(const w of f.listNotebookEditors())for(const[,b]of w.codeEditors)if(b===this._editor){p=lc.Notebook;break}const m=this._store.add(t.createInstance(Yxe,p,this._editor)),v=this._store.add(t.createInstance(Kxe,p,this._editor));return{content:m,zone:v}}),this._store.add(this._editor.onDidChangeModel(async p=>{if(this._session||!p.newModelUrl)return;const m=this._inlineChatSessionService.getSession(this._editor,p.newModelUrl);m&&(this._log("session RESUMING after model change",p),await this.run({existingSession:m}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(p=>{p.session===this._session&&p.endedByExternalCause&&(this._log("session ENDED by external cause"),this._session=void 0,this._strategy?.cancel(),this._resetWidget(),this.cancelSession())})),this._store.add(this._inlineChatSessionService.onDidMoveSession(async p=>{p.editor===this._editor&&(this._log("session RESUMING after move",p),await this.run({existingSession:p.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION),this._store.dispose(),this._isDisposed=!0,this._log("DISPOSED controller")}_log(e,...t){e instanceof Error?this._logService.error(e,...t):this._logService.trace(`[IE] (editor:${this._editor.getId()})${e}`,...t)}getMessage(){return this._ui.value.zone.widget.responseContent}getId(){return zze}_getMode(){return this._configurationService.getValue(Mv.Mode)}getWidgetPosition(){return this._ui.value.zone.position}async run(e={}){try{this.finishExistingSession(),this._currentRun&&await this._currentRun,e.initialSelection&&this._editor.setSelection(e.initialSelection),this._stashedSession.clear(),this._onWillStartSession.fire(),this._currentRun=this._nextState(Xr.CREATE_SESSION,e),await this._currentRun}catch(t){bt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Xr.PAUSE]()}finally{this._currentRun=void 0}}async _nextState(e,t){let i=e;for(;i&&!this._isDisposed;)this._log("setState to ",i),i=await this[i](t)}async[Xr.CREATE_SESSION](e){Bt(this._session===void 0),Bt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const s=this._showWidget(!0,i);let o=g(TL,0,"Failed to start editor chat");if(!t){const r=new ai,a=T.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Od.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateProgress(!0),this._ui.value.zone.widget.updateInfo(g(TL,1,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof vne||c?.name===vne.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Xr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Du.get(this._editor)?.showMessage(o,s),this._log("Failed to start editor chat"),Xr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case yS.Preview:this._strategy=this._instaService.createInstance(IEe,t,this._editor,this._ui.value.zone);break;case yS.Live:default:this._strategy=this._instaService.createInstance(LEe,t,this._editor,this._ui.value.zone);break}return this._session=t,Xr.INIT_UI}async[Xr.INIT_UI](e){Bt(this._session),Bt(this._strategy),_g.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const h=this._strategy?.getWholeRangeDecoration()??[];t.set(h)};this._sessionStore.add(Ee(()=>t.clear())),this._sessionStore.add(this._session.wholeRange.onDidChange(i)),i(),this._sessionStore.add(this._ui.value.content.onDidBlur(()=>this.cancelSession())),this._ui.value.content.setSession(this._session),this._updatePlaceholder();const s=this._session.session.message??g(TL,2,"AI-generated code may be incorrect");this._ui.value.zone.widget.updateInfo(s),this._showWidget(!this._session.chatModel.hasRequests),this._sessionStore.add(this._editor.onDidChangeModel(h=>{const u=this._session?.chatModel.hasRequests?Od.PAUSE_SESSION:Od.CANCEL_SESSION;this._log("model changed, pause or cancel session",u,h),this._messages.fire(u)}));const o=this._editor.getModel()?.getAlternativeVersionId();this._sessionStore.add(this._editor.onDidChangeModelContent(h=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(o!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const u=this._session.wholeRange;let f=!1;if(this._configurationService.getValue(Mv.FinishOnType))for(const{range:p}of h.changes)f=!O.areIntersectingOrTouching(p,u.value);this._session.recordExternalEditOccurred(f),f&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async h=>{if(h.kind==="addRequest"&&h.request.response){this._ui.value.zone.widget.updateProgress(!0);const u=h.request.response.onDidChange(()=>{(h.request.response?.isCanceled||h.request.response?.isComplete)&&(this._ui.value.zone.widget.updateProgress(!1),u.dispose())})}else if(h.kind==="removeRequest"){const u=this._session.exchanges.find(f=>f.prompt.request.id===h.requestId);if(u&&this._editor.hasModel()){this._session.hunkData.ignoreTextModelNChanges=!0;try{const f=this._editor.getModel(),p=u.prompt.modelAltVersionId;for(;p{if(u.lineNumber!==1||!this._session||!this._session.session.slashCommands)return;const m=this._chatWidgetService.getWidgetByInputUri(h.uri);if(m!==this._ui.value.zone.widget.chatWidget&&m!==this._ui.value.content.chatWidget)return;const v={suggestions:[],incomplete:!1};for(const w of this._session.session.slashCommands){const b=`/${w.name}`;v.suggestions.push({label:{label:b,description:w.description??""},kind:Ne.Text,insertText:b,range:O.fromPositions(new oe(1,1),u)})}return v}}));const r=(h,u)=>{const f=[];for(const p of(this._session?.session.slashCommands??[]).sort((m,v)=>v.name.length-m.name.length)){const m=`/${p.name}`,v=u.getLineContent(1);if(v.startsWith(m)){f.push({range:new O(1,1,1,m.length+1),options:{description:"inline-chat-slash-command",inlineClassName:"inline-chat-slash-command",after:{content:" "}}}),v.trim()===`/${p.name}`&&f.push({range:new O(1,m.length,1,m.length),options:{description:"inline-chat-slash-command-detail",after:{content:`${p.description}`,inlineClassName:"inline-chat-slash-command-detail"}}});break}}h.set(f)},a=this._ui.value.content.chatWidget.inputEditor,c=this._ui.value.zone.widget.chatWidget.inputEditor,l=a.createDecorationsCollection(),d=c.createDecorationsCollection();return this._sessionStore.add(a.onDidChangeModelContent(()=>r(l,a.getModel()))),this._sessionStore.add(c.onDidChangeModelContent(()=>r(d,c.getModel()))),this._sessionStore.add(Ee(()=>{l.clear(),d.clear()})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Xr.SHOW_RESPONSE):Xr.WAIT_FOR_INPUT}async[Xr.WAIT_FOR_INPUT](e){Bt(this._session),Bt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),sa(e.message),delete e.message,this._showWidget(!1));let t=Od.NONE,i;const s=new Uh,o=new Z;if(o.add(this._session.chatModel.onDidChange(a=>{a.kind==="addRequest"&&(i=a.request,t=Od.ACCEPT_INPUT,s.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(T.once(this._messages.event)(a=>{this._log("state=_waitForInput) message received",a),t=a,s.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await s.wait(),o.dispose(),t&(Od.CANCEL_INPUT|Od.CANCEL_SESSION))return Xr.CANCEL;if(t&Od.PAUSE_SESSION)return Xr.PAUSE;if(t&Od.ACCEPT_SESSION)return this._ui.value.zone.widget.selectAll(!1),Xr.ACCEPT;if(!i?.message.text)return Xr.WAIT_FOR_INPUT;const r=i.message.text;return this._ui.value.zone.widget.value=r,this._session.addInput(new Qzt(i,this._editor.getModel().getAlternativeVersionId())),Xr.SHOW_REQUEST}async[Xr.SHOW_REQUEST](){Bt(this._session),Bt(this._session.chatModel.requestInProgress);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Bt(t),Bt(t.response),this._showWidget(!1),this._ui.value.zone.widget.value=t.message.text,this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,s=new sd,o=new Z,r=o.add(new ai),a=new lNe,c=ao.create(),l=new dO;let d=Xr.SHOW_RESPONSE;o.add(T.once(this._messages.event)(C=>{this._log("state=_makeRequest) message received",C),this._chatService.cancelCurrentRequestForSession(e.sessionId),C&Od.CANCEL_SESSION?d=Xr.CANCEL:C&Od.PAUSE_SESSION?d=Xr.PAUSE:C&Od.ACCEPT_SESSION&&(d=Xr.ACCEPT)})),o.add(e.onDidChange(C=>{C.kind==="removeRequest"&&C.requestId===t.id&&(r.cancel(),s.complete(),C.reason===_6.Resend?d=Xr.SHOW_REQUEST:d=Xr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new tV,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):Dr(),applied:0};let v;const w=()=>{if(v||(v=i.response.value.find(C=>C.kind==="textEditGroup"&&_n(C.uri,this._session?.textModelN.uri))),v){v.state??=m;const C=v.edits,y=C.slice(h);y.length>0&&(h=C.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const S=this._session.wholeRange.value.getStartPosition();for(const k of y)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const M=this._session.wholeRange.value.getStartPosition();(!M.equals(S)||!this._ui.value.zone.position?.equals(M))&&this._showWidget(!1,M.delta(-1))}))}i.isCanceled?(r.cancel(),s.complete()):i.isComplete&&s.complete()};o.add(i.onDidChange(w)),w(),await s.p,await l.whenIdle(),o.dispose();const b=await this._editorWorkerService.computeDiff(this._session.textModel0.uri,this._session.textModelN.uri,{computeMoves:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,ignoreTrimWhitespace:!1},"advanced");return this._session.wholeRange.fixup(b?.changes??[]),await this._session.hunkData.recompute(m),this._ui.value.zone.widget.updateToolbar(!0),this._ui.value.zone.widget.updateProgress(!1),d}async[Xr.SHOW_RESPONSE](){Bt(this._session),Bt(this._strategy);const{response:e}=this._session.lastExchange;let t;for(const s of this._session.chatModel.getRequests()){if(!s.response)continue;const o=s$t(s.response.response);if(t===void 0)t=o;else if(t!==o){t=pI.Mixed;break}}this._ctxResponseTypes.set(t);let i;if(e instanceof ist){const s=g(TL,3,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(s,{classes:["warn"]}),Xr.WAIT_FOR_INPUT}else e instanceof CEe?e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel()):e instanceof WI&&(this._ui.value.zone.widget.updateStatus(""),this._ui.value.zone.widget.updateToolbar(!0),i=await this._strategy.renderChanges(e));return this._showWidget(!1,i),Xr.WAIT_FOR_INPUT}async[Xr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Xr.ACCEPT](){Bt(this._session),Bt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(TL,4,"Failed to apply changes.",Ma(e))),this._log("FAILED to apply changes"),this._log(e)}this._inlineChatSessionService.releaseSession(this._session),this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}async[Xr.CANCEL](){if(this._session){Bt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&!!this._session.lastExchange&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(TL,5,"Failed to discard changes.",Ma(i))),this._log("FAILED to discard changes"),this._log(i)}this._stashedSession.clear(),e?this._stashedSession.value=this._inlineChatSessionService.stashSession(this._session,this._editor,t):this._inlineChatSessionService.releaseSession(this._session)}this._resetWidget(),this._strategy?.dispose(),this._strategy=void 0,this._session=void 0}_showWidget(e=!1,t){Bt(this._editor.hasModel());let i;return t?i=t:this._ui.rawValue?.zone?.position?this._ui.rawValue?.zone.position.lineNumber===1?i=this._ui.rawValue?.zone.position.delta(-1):i=this._ui.rawValue?.zone.position:i=this._editor.getSelection().getStartPosition().delta(-1),this._session&&!t&&(this._session.hasChangedText||this._session.lastExchange)&&(i=this._session.wholeRange.value.getStartPosition().delta(-1)),this._ui.rawValue?.zone?.position?this._ui.value.zone.updatePositionAndHeight(i):e?(i=this._editor.getSelection().getStartPosition(),this._ui.value.content.show(i)):(this._ui.value.content.hide(),this._ui.value.zone.show(i),this._session&&this._ui.value.zone.widget.setChatModel(this._session.chatModel)),this._session&&this._ui.rawValue?.zone&&this._ui.rawValue?.zone.updateBackgroundColor(i,this._session.wholeRange.value),this._ctxVisible.set(!0),i}_resetWidget(){this._sessionStore.clear(),this._ctxVisible.reset(),this._ctxUserDidEdit.reset(),this._ui.rawValue?.content.hide(),this._ui.rawValue?.zone?.hide(),this._editor.hasWidgetFocus()&&this._editor.focus()}async _makeChanges(e,t,i){Bt(this._session),Bt(this._strategy);const s=await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri,e);if(this._log("edits from PROVIDER and after making them MORE MINIMAL",this._session.agent.extensionId,e,s),s?.length===0)return;const r=(!t&&s?s:e).map(iMe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),this._session.wholeRange.trackEdits(r),t?await this._strategy.makeProgressiveChanges(r,a,t,i):await this._strategy.makeChanges(r,a,i)}_updatePlaceholder(){this._ui.value.zone.widget.placeholder=this._getPlaceholderText()}_getPlaceholderText(){return this._forcedPlaceholder??this._session?.session.placeholder??""}showSaveHint(){const e=g(TL,6,"Accept or discard changes to continue saving");this._ui.value.zone.widget.updateStatus(e,{classes:["warn"]})}acceptInput(){return this.chatWidget.acceptInput()}updateInput(e,t=!0){if(this._ui.value.content.chatWidget.setInput(e),this._ui.value.zone.widget.chatWidget.setInput(e),t){const i=new mt(1,1,Number.MAX_SAFE_INTEGER,1);this._ui.value.content.chatWidget.inputEditor.setSelection(i),this._ui.value.zone.widget.chatWidget.inputEditor.setSelection(i)}}cancelCurrentRequest(){this._messages.fire(Od.CANCEL_INPUT|Od.CANCEL_REQUEST)}arrowOut(e){if(this._ui.value.zone.position&&this._editor.hasModel()){const{column:t}=this._editor.getPosition(),{lineNumber:i}=this._ui.value.zone.position,s=e?i:i+1;this._editor.setPosition({lineNumber:s,column:t}),this._editor.focus()}}focus(){this._ui.value.zone.widget.focus()}hasFocus(){return this._ui.value.zone.widget.hasFocus()}moveHunk(e){this.focus(),this._strategy?.move?.(e)}async viewInChat(){if(!this._strategy||!this._session)return;let e=!1,t;const i=this._editor.getModel()?.uri,s=this._session.chatModel.getRequests();for(const r of s)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&_n(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Bt(t),t.edits=[o]),await this._instaService.invokeFunction(n$t,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"accepted"}})}this._messages.fire(Od.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){if(this._session?.lastExchange?.response instanceof WI&&this._session?.lastExchange?.response.chatResponse){const e=this._session?.lastExchange?.response.chatResponse;this._chatService.notifyUserAction({sessionId:this._session.chatModel.sessionId,requestId:e.requestId,agentId:e.agent?.id,result:e.result,action:{kind:"inlineChat",action:"discarded"}})}this._messages.fire(Od.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===yS.Preview?(this._log("finishing existing session, using CANCEL",this._session.editMode),this.cancelSession()):(this._log("finishing existing session, using APPLY",this._session.editMode),this.acceptSession()))}unstashLastSession(){const e=this._stashedSession.value?.unstash();return e&&this._inlineChatSavingService.markChanged(e),e}joinCurrentRun(){return this._currentRun}};p3e=D([_(1,be),_(2,LPe),_(3,zZe),_(4,kd),_(5,Ze),_(6,Re),_(7,To),_(8,Pe),_(9,Rw),_(10,ht),_(11,lL),_(12,xQ)],p3e);async function n$t(n,e){const t=n.get(q_),i=n.get(Rw),s=await ozt(t);if(s&&s.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(s.viewModel.model.sessionId,o);s.focusLastMessage()}}function s$t(n){let e;for(const t of n.value){let i;switch(t.kind){case"textEditGroup":i=pI.OnlyEdits;break;case"markdownContent":default:i=pI.OnlyMessages;break}if(e===void 0)e=i;else if(e!==i)return pI.Mixed}return e??pI.Empty}const o$t="workbench.action.quickchat.toggle";var Zxe;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Zxe||(Zxe={}));function r$t(n){const e=[],t=new Map,i=(s,o)=>{if(!t.has(s)&&(t.set(s,!0),!(s[0]==="_"||s.indexOf("vscode.")===0)&&n.get(s)!==!0)){if(!o){const r=yt.getCommand(s);if(r&&typeof r.metadata=="object"&&mo(r.metadata.args))return}e.push(s)}};for(const s of Xs.getMenuItems(Te.CommandPalette))lR(s)&&i(s.command.id,!0);for(const s of b_.getEditorActions())i(s.id,!0);for(const s of yt.getCommands().keys())i(s,!1);return e}var X_;const PF="vs/workbench/services/preferences/browser/keybindingsEditorModel",Mpe="keybinding.entry.template",m3e=g(PF,0,"System"),_3e=g(PF,1,"Extension"),v3e=g(PF,2,"User");function a$t(n,e){const t=e?` +when:${e}`:"";return`@command:${n}${t}`}const c$t=KU(dF,YD,pde),l$t=/@command:\s*([^\+]+)/i,d$t=/\+when:\s*(.+)/i,w3e=/@source:\s*(user|default|system|extension)/i,b3e=/@ext:\s*((".+")|([^\s]+))/i,h$t=/@keybinding:\s*((\".+\")|(\S+))/i;let C3e=X_=class extends pL{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:bde.modifierLabels[e],aria:AJe.modifierLabels[e],user:EJe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const s=l$t.exec(e);if(s&&s[1]){const o=s[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=d$t.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:X_.getId(a),keybindingItem:a,templateId:Mpe}))}if(w3e.test(e))i=this.filterBySource(i,e),e=e.replace(w3e,"");else{const o=b3e.exec(e);if(o&&(o[2]||o[3])){const r=o[2]?o[2].substring(1,o[2].length-1):o[3];i=this.filterByExtension(i,r),e=e.replace(b3e,"")}else{const r=h$t.exec(e);r&&(r[2]||r[3])&&(e=r[2]||`"${r[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(o=>({id:X_.getId(o),keybindingItem:o,templateId:Mpe}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===m3e):/@source:\s*user/i.test(t)?e.filter(i=>i.source===v3e):/@source:\s*extension/i.test(t)?e.filter(i=>!zt(i.source)||i.source===_3e):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!zt(i.source)&&(Cn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',s=t.charAt(t.length-1)==='"',o=i&&s;i&&(t=t.substring(1)),s&&(t=t.substring(0,t.length-1)),t=t.trim();const r=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new u$t(this.modifierLabels,l,t,a,c,o);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&r.push({id:X_.getId(l),templateId:Mpe,commandLabelMatches:d.commandLabelMatches||void 0,commandDefaultLabelMatches:d.commandDefaultLabelMatches||void 0,keybindingItem:l,keybindingMatches:d.keybindingMatches||void 0,commandIdMatches:d.commandIdMatches||void 0,sourceMatches:d.sourceMatches||void 0,whenMatches:d.whenMatches||void 0,extensionIdMatches:d.extensionIdMatches||void 0,extensionLabelMatches:d.extensionLabelMatches||void 0})}return r}filterByWhen(e,t,i){if(e.length===0)return[];const s=e.filter(c=>c.when===i);if(s.length)return s;const o=e[0].commandLabel,r=new vee(void 0,t,null,ge.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[X_.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Ui(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const o of this.keybindingsService.getKeybindings())o.command&&(this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const s=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of r$t(i)){const r=new vee(void 0,o,null,void 0,s.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(X_.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=Lc(this._keybindingItemsSortedByPrecedence,o=>X_.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>X_.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(zt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new $a;for(const t of this.extensionService.extensions)e.set(t.identifier,t);return e}static compareKeybindingData(e,t){return e.keybinding&&!t.keybinding?-1:t.keybinding&&!e.keybinding?1:e.commandLabel&&!t.commandLabel?-1:t.commandLabel&&!e.commandLabel?1:e.commandLabel&&t.commandLabel&&e.commandLabel!==t.commandLabel?e.commandLabel.localeCompare(t.commandLabel):e.command===t.command?e.keybindingItem.isDefault?1:-1:e.command.localeCompare(t.command)}static toKeybindingEntry(e,t,i,s){const o=Xs.getCommand(e),r=i.get(e);let a=v3e;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?s.get(c)??_3e:m3e}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:X_.getCommandLabel(o,r),commandDefaultLabel:X_.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!s1.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(PF,3,"{0}: {1}",t,i):i}return null}static getCommandLabel(e,t){if(e){const i=e.category?typeof e.category=="string"?e.category:e.category.value:void 0,s=typeof e.title=="string"?e.title:e.title.value;return i?g(PF,3,"{0}: {1}",i,s):s}return t||""}};C3e=X_=D([_(1,ti),_(2,ho)],C3e);class u$t{constructor(e,t,i,s,o,r){this.modifierLabels=e,this.commandIdMatches=null,this.commandLabelMatches=null,this.commandDefaultLabelMatches=null,this.sourceMatches=null,this.whenMatches=null,this.keybindingMatches=null,this.extensionIdMatches=null,this.extensionLabelMatches=null,r||(this.commandIdMatches=this.matches(i,t.command,KU(YD,lee),s),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>YD(a,t.commandLabel,!0),s):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>YD(a,t.commandDefaultLabel,!0),s):null,this.whenMatches=t.when?this.matches(null,t.when,KU(YD,lee),s):null,zt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>YD(a,t.source,!0),s):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>YD(a,t.commandLabel,!0),s):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,s){let o=e?c$t(e,t):null;return o||(o=this.matchesWords(s,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let s=[];for(const o of e){const r=i(o,t);if(r)s=[...s||[],...r];else{s=null;break}}return s}filterAndSort(e){return Lc(e,t=>t.start+"."+t.end).filter(t=>!e.some(i=>!(i.start===t.start&&i.end===t.end)&&i.start<=t.start&&i.end>=t.end)).sort((t,i)=>t.start-i.start)}matchesKeybinding(e,t,i,s){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&mE(t,a)===0||c&&mE(t,c)===0||l&&mE(t,l)===0)return{firstPart:this.createCompleteMatch(o),chordPart:this.createCompleteMatch(r)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(WE,0,"No matching commands"),commandId:""})},s,o,r,a,c),this.editorService=e,this.menuService=t,this.extensionService=i,this.configurationService=l,this.editorGroupService=d,this.preferencesService=h,this.productService=u,this.aiRelatedInformationService=f,this.chatAgentService=p,this.extensionRegistrationRace=JQe(this.extensionService.whenInstalledExtensionsRegistered(),800),this.useAiRelatedInfo=!1,this._register(l.onDidChangeConfiguration(m=>this.updateOptions(m))),this.updateOptions()}get configuration(){const e=this.configurationService.getValue().workbench.commandPalette;return{preserveInput:e.preserveInput,experimental:e.experimental}}updateOptions(e){if(e&&!e.affectsConfiguration("workbench.commandPalette.experimental"))return;const t=this.configuration,i=t.experimental.suggestCommands&&this.productService.commandPaletteSuggestedCommandIds?.length?new Set(this.productService.commandPaletteSuggestedCommandIds):void 0;this.options.suggestedCommandIds=i,this.useAiRelatedInfo=t.experimental.enableNaturalLanguageSearch}async getCommandPicks(e){return await this.extensionRegistrationRace,e.isCancellationRequested?[]:[...this.getCodeEditorCommandPicks(),...this.getGlobalCommandPicks()].map(t=>({...t,buttons:[{iconClass:$e.asClassName(Ce.gear),tooltip:g(WE,1,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:a$t(t.commandId,t.commandWhen)}),BE.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,s){if(!this.hasAdditionalCommandPicks(i,s))return[];let o;try{await Ta(F3.AI_RELATED_INFORMATION_DEBOUNCE,s),o=await this.getRelatedInformationPicks(e,t,i,s)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(lc.Panel);return r&&o.push({label:g(WE,2,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?o$t:Dzt,args:[i]}),o}async getRelatedInformationPicks(e,t,i,s){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[Zxe.CommandInformation],s);o.sort((c,l)=>l.weight-c.weight);const r=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of o){if(c.weightd.commandId===c.command&&!r.has(d.commandId));l&&a.push(l)}return a}getGlobalCommandPicks(){const e=[],t=this.editorService.activeEditorPane?.scopedContextKeyService||this.editorGroupService.activeGroup.scopedContextKeyService,i=this.menuService.createMenu(Te.CommandPalette,t),s=i.getActions().reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof id&&o.enabled);for(const o of s){let r=(typeof o.item.title=="string"?o.item.title:o.item.title.value)||o.item.id;const a=typeof o.item.category=="string"?o.item.category:o.item.category?.value;a&&(r=g(WE,3,"{0}: {1}",a,r));const c=typeof o.item.title!="string"?o.item.title.original:void 0,l=a&&o.item.category&&typeof o.item.category!="string"?o.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=o.item.metadata?.description,u=h===void 0||XJe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:mde(r),commandDescription:u})}return i.dispose(),e}},F3=ZE,ZE.AI_RELATED_INFORMATION_MAX_PICKS=5,ZE.AI_RELATED_INFORMATION_THRESHOLD=.8,ZE.AI_RELATED_INFORMATION_DEBOUNCE=200,ZE);FF=F3=D([_(0,_i),_(1,_c),_(2,ho),_(3,be),_(4,ti),_(5,ji),_(6,rn),_(7,To),_(8,Re),_(9,ur),_(10,TQ),_(11,Ja),_(12,NPe),_(13,yp)],FF);const Kce=class Kce extends pi{constructor(){super({id:Kce.ID,title:Be(WE,4,"Show All Commands"),keybinding:{weight:ye.WorkbenchContrib,when:void 0,primary:pp?void 0:V.CtrlCmd|V.Shift|E.KeyP,secondary:[E.F1]},f1:!0})}async run(e){e.get(On).quickAccess.show(FF.PREFIX)}};Kce.ID="workbench.action.showCommands";let V1=Kce;class g$t extends pi{constructor(){super({id:"workbench.action.clearCommandHistory",title:Be(WE,5,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Re),i=e.get(on),s=e.get(To);if(p6.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await s.confirm({type:"warning",message:g(WE,6,"Do you want to clear the history of recently used commands?"),detail:g(WE,7,"This action is irreversible!"),primaryButton:g(WE,8,"&&Clear")});if(!r)return;p6.clearHistory(t,i)}}}class Est{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const s=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Dn);return o.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=_z(o);if(a){let c=o.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},s.add(cw(t.onCancellationRequested)(()=>r.restoreViewState?.()))}s.add(Ee(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,jb.JUMP),e.revealRangeInCenter(t.range,vt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Cu(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return ew(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Nr(VKe),position:oh.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const M5="vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess",Yce=class Yce extends Est{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(M5,0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,$.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(s,l.lineNumber))return;this.gotoLocation(e,{range:this.toRange(l.lineNumber,l.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=this.parsePosition(s,t.value.trim().substr(Yce.PREFIX.length)),l=this.getPickLabel(s,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(s,c.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(c.lineNumber,c.column);s.revealRangeInCenter(d,vt.Smooth),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=_z(s);return a&&a.getOptions().get(x.lineNumbers).renderType===Qr.Relative&&(a.updateOptions({lineNumbers:"on"}),o.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(M5,1,"Go to line {0} and character {1}.",t,i):g(M5,2,"Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(M5,3,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):g(M5,4,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Yce.PREFIX=":";let wne=Yce;const eDe="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess";let bne=class extends wne{constructor(e,t,i){super(),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview}}get activeTextEditorControl(){return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}};bne=D([_(0,_i),_(1,ur),_(2,Re)],bne);const Jce=class Jce extends pi{constructor(){super({id:Jce.ID,title:Be(eDe,0,"Go to Line/Column..."),f1:!0,keybinding:{weight:ye.WorkbenchContrib,when:null,primary:V.CtrlCmd|E.KeyG,mac:{primary:V.WinCtrl|E.KeyG}}})}async run(e){e.get(On).quickAccess.show(bne.PREFIX)}};Jce.ID="workbench.action.gotoLine";let Cne=Jce;At(Cne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:bne,prefix:wne.PREFIX,placeholder:g(eDe,1,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(eDe,2,"Go to Line/Column"),commandId:Cne.ID}]});var IB;const Rr="vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess";var ex;let EM=(ex=class extends Est{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,g(Rr,0,"To go to a symbol, first open a text editor with symbol information.")),$.None}provideWithTextEditor(e,t,i,s){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,s):this.doProvideWithoutEditorSymbols(e,r,t,i):$.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new Z;return this.provideLabelPick(i,g(Rr,1,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:_t.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new sd,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,o){const r=e.editor,a=new Z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),o?.handleAccept?.(u),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const c=this.getDocumentSymbols(t,s);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ai(s),i.busy=!0;try{const u=y6(i.value.substr(IB.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(s.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=t1(f,m=>!!(m.type!=="separator"&&m.range&&O.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(Rr,2,"No matching editor symbols")):this.provideLabelPick(i,g(Rr,3,"No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,vt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,o){const r=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(IB.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=F5e(t.values[0]),d=F5e(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?$e.asClassName(Ce.splitHorizontal):$e.asClassName(Ce.splitVertical),tooltip:u==="right"?g(Rr,4,"Open to the Side"):g(Rr,5,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let U=!1;if(l!==t&&([M,k]=Ipe(C,{...t,values:void 0},c,y),typeof M=="number"&&(U=!0)),typeof M!="number"&&([M,k]=Ipe(C,l,c,y),typeof M!="number"))continue;if(!U&&d){if(S&&d.original.length>0&&([F,N]=Ipe(S,d)),typeof F!="number")continue;typeof M=="number"&&(M+=F)}}const z=w.tags&&w.tags.indexOf(k9.Deprecated)>=0;f.push({index:v,kind:w.kind,score:M,label:C,ariaLabel:yht(w.name,w.kind),description:S,highlights:z?void 0:{label:k,description:N},range:{selection:O.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:b,strikethrough:z,buttons:h})}const p=f.sort((v,w)=>a?this.compareByKindAndScore(v,w):this.compareByScore(v,w));let m=[];if(a){let C=function(){w&&typeof v=="number"&&b>0&&(w.label=r_(Ppe[v]||Npe,b))},v,w,b=0;for(const y of p)v!==y.kind?(C(),v=y.kind,b=1,w={type:"separator"},m.push(w)):b++,m.push(y);C()}else p.length>0&&(m=[{label:g(Rr,6,"symbols ({0})",f.length),type:"separator"},...p]);return m}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=Ppe[e.kind]||Npe,s=Ppe[t.kind]||Npe,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},IB=ex,ex.PREFIX="@",ex.SCOPE_PREFIX=":",ex.PREFIX_BY_CATEGORY=`${IB.PREFIX}${IB.SCOPE_PREFIX}`,ex);EM=IB=D([_(0,ht),_(1,JQ)],EM);const Npe=g(Rr,7,"properties ({0})"),Ppe={[_t.Method]:g(Rr,8,"methods ({0})"),[_t.Function]:g(Rr,9,"functions ({0})"),[_t.Constructor]:g(Rr,10,"constructors ({0})"),[_t.Variable]:g(Rr,11,"variables ({0})"),[_t.Class]:g(Rr,12,"classes ({0})"),[_t.Struct]:g(Rr,13,"structs ({0})"),[_t.Event]:g(Rr,14,"events ({0})"),[_t.Operator]:g(Rr,15,"operators ({0})"),[_t.Interface]:g(Rr,16,"interfaces ({0})"),[_t.Namespace]:g(Rr,17,"namespaces ({0})"),[_t.Package]:g(Rr,18,"packages ({0})"),[_t.TypeParameter]:g(Rr,19,"type parameters ({0})"),[_t.Module]:g(Rr,20,"modules ({0})"),[_t.Property]:g(Rr,7,"properties ({0})"),[_t.Enum]:g(Rr,21,"enumerations ({0})"),[_t.EnumMember]:g(Rr,22,"enumeration members ({0})"),[_t.String]:g(Rr,23,"strings ({0})"),[_t.File]:g(Rr,24,"files ({0})"),[_t.Array]:g(Rr,25,"arrays ({0})"),[_t.Number]:g(Rr,26,"numbers ({0})"),[_t.Boolean]:g(Rr,27,"booleans ({0})"),[_t.Object]:g(Rr,28,"objects ({0})"),[_t.Key]:g(Rr,29,"keys ({0})"),[_t.Field]:g(Rr,30,"fields ({0})"),[_t.Constant]:g(Rr,31,"constants ({0})")};var tDe;(function(n){n[n.OutlinePane=1]="OutlinePane",n[n.Breadcrumbs=2]="Breadcrumbs",n[n.QuickPick=4]="QuickPick"})(tDe||(tDe={}));var y3e;(function(n){n.icons="outline.icons",n.collapseItems="outline.collapseItems",n.problemsEnabled="outline.problems.enabled",n.problemsColors="outline.problems.colors",n.problemsBadges="outline.problems.badges"})(y3e||(y3e={}));var S3e;(function(n){n.Collapsed="alwaysCollapse",n.Expanded="alwaysExpand"})(S3e||(S3e={}));var iDe;const ZW="vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess";var SP;let yne=(SP=class extends EM{constructor(e,t,i,s,o,r){super(s,r,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=o,this.onDidActiveTextEditorControlChange=this.editorService.onDidActiveEditorChange}get configuration(){const e=this.configurationService.getValue().workbench?.editor;return{openEditorPinned:!e?.enablePreviewFromQuickOpen||!e?.enablePreview,openSideBySideDirection:e?.openSideBySideDirection}}get activeTextEditorControl(){if(!HU(this.editorService.activeEditorPane?.getControl()))return this.editorService.activeTextEditorControl}gotoLocation(e,t){if((t.keyMods.alt||this.configuration.openEditorPinned&&t.keyMods.ctrlCmd||t.forceSideBySide)&&this.editorService.activeEditor){e.restoreViewState?.();const i={selection:t.range,pinned:t.keyMods.ctrlCmd||this.configuration.openEditorPinned,preserveFocus:t.preserveFocus};this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor,i)}else super.gotoLocation(e,t)}async getSymbolPicks(e,t,i,s,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,s),Ta(iDe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),y6(t),i,o,e)}provideWithoutTextEditor(e){return this.canPickWithOutlineService()?this.doGetOutlinePicks(e):super.provideWithoutTextEditor(e)}canPickWithOutlineService(){return this.editorService.activeEditorPane?this.outlineService.canCreateOutline(this.editorService.activeEditorPane):!1}doGetOutlinePicks(e){const t=this.editorService.activeEditorPane;if(!t)return $.None;const i=new ai,s=new Z;return s.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,tDe.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}s.add(o);const r=o.captureViewState();s.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:_t.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));s.add(e.onDidAccept(()=>{e.hide();const[h]=e.selectedItems;h&&a[h.index]&&o.reveal(a[h.index].element,{},!1,!1)}));const l=()=>{const h=c.filter(u=>{if(e.value==="@")return u.score=0,u.highlights=void 0,!0;const f=e.value.substring(EM.PREFIX.length).trim(),p=n2(u.label),m=v1(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:lJ(f,p)??void 0},!0):!1});if(h.length===0){const u=g(ZW,0,"No matching entries");e.items=[{label:u,index:-1,kind:_t.String}],e.ariaLabel=u}else e.items=h};l(),s.add(e.onDidChangeValue(l));const d=new Dn;s.add(d),s.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{bt(o),e.hide()}).finally(()=>{e.busy=!1}),s}},iDe=SP,SP.SYMBOL_PICKS_TIMEOUT=8e3,SP);yne=iDe=D([_(0,_i),_(1,ur),_(2,Re),_(3,ht),_(4,Eet),_(5,JQ)],yne);const Xce=class Xce extends pi{constructor(){super({id:Xce.ID,title:{...Be(ZW,1,"Go to Symbol in Editor..."),mnemonicTitle:g(ZW,2,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:ge.and(Dm.negate(),T1.negate()),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|V.Shift|E.KeyO},menu:[{id:Te.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(On).quickAccess.show(yne.PREFIX,{itemActivation:Qp.NONE})}};Xce.ID="workbench.action.gotoSymbol";let Sne=Xce;At(Sne);it.as(xz.Quickaccess).registerQuickAccessProvider({ctor:yne,prefix:EM.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(ZW,3,"Type the name of a symbol to go to."),helpEntries:[{description:g(ZW,4,"Go to Symbol in Editor"),prefix:EM.PREFIX,commandId:Sne.ID,commandCenterOrder:40},{description:g(ZW,5,"Go to Symbol in Editor by Category"),prefix:EM.PREFIX_BY_CATEGORY}]});const qz="vs/workbench/browser/actions/quickAccessActions",bx={primary:V.CtrlCmd|E.KeyP,secondary:[V.CtrlCmd|E.KeyE],mac:{primary:V.CtrlCmd|E.KeyP,secondary:void 0}};xr.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:E.Escape,secondary:[V.Shift|E.Escape],handler:n=>n.get(On).cancel()});xr.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept()});xr.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>n.get(On).accept({ctrlCmd:!0,alt:!1})});xr.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).focus()}});const A3e="workbench.action.quickOpenNavigateNextInFilePicker";xr.registerCommandAndKeybindingRule({id:A3e,weight:ye.WorkbenchContrib+50,handler:Rhe(A3e,!0),when:Gnt,primary:bx.primary,secondary:bx.secondary,mac:bx.mac});const E3e="workbench.action.quickOpenNavigatePreviousInFilePicker";xr.registerCommandAndKeybindingRule({id:E3e,weight:ye.WorkbenchContrib+50,handler:Rhe(E3e,!1),when:Gnt,primary:bx.primary|V.Shift,secondary:[bx.secondary[0]|V.Shift],mac:{primary:bx.mac.primary|V.Shift,secondary:void 0}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:ye.WorkbenchContrib,when:aA,primary:0,handler:n=>{n.get(On).toggle()}});xr.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:ye.WorkbenchContrib+50,when:aA,primary:0,win:{primary:V.Alt|E.LeftArrow},mac:{primary:V.WinCtrl|E.Minus},linux:{primary:V.CtrlCmd|V.Alt|E.Minus},handler:n=>{n.get(On).back()}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpen",title:Be(qz,0,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:ye.WorkbenchContrib,primary:bx.primary,secondary:bx.secondary,mac:bx.mac},f1:!0})}run(e,t){e.get(On).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends pi{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(qz,1,"Quick Open"),icon:Ce.search,menu:{id:Te.CommandCenterCenter,order:100}})}run(e){e.get(On).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});yt.registerCommand("workbench.action.quickOpenPreviousEditor",async n=>{n.get(On).quickAccess.show("",{itemActivation:Qp.SECOND})});class Whe extends pi{constructor(e,t,i,s,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=s}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:s}:void 0;i.navigate(this.next,o)}}class f$t extends Whe{constructor(){super("workbench.action.quickOpenNavigateNext",Be(qz,2,"Navigate Next in Quick Open"),!0,!0)}}class p$t extends Whe{constructor(){super("workbench.action.quickOpenNavigatePrevious",Be(qz,3,"Navigate Previous in Quick Open"),!1,!0)}}class m$t extends Whe{constructor(){super("workbench.action.quickOpenSelectNext",Be(qz,4,"Select Next in Quick Open"),!0,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyN}})}}class _$t extends Whe{constructor(){super("workbench.action.quickOpenSelectPrevious",Be(qz,5,"Select Previous in Quick Open"),!1,!1,{weight:ye.WorkbenchContrib+50,when:aA,primary:0,mac:{primary:V.WinCtrl|E.KeyP}})}}At(m$t);At(_$t);At(f$t);At(p$t);var O3;const v$t="vs/platform/quickinput/browser/helpQuickAccess";var AP;let a8=(AP=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=it.as(xz.Quickaccess)}provide(e){const t=new Z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(O3.PREFIX.length));s&&s.prefix&&s.prefix!==O3.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==O3.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(v$t,0,"{0}, {1}",s,t.description),description:t.description}})}},O3=AP,AP.PREFIX="?",AP);a8=O3=D([_(0,On),_(1,ti)],a8);const Yi="vs/workbench/contrib/debug/common/debug",x3e="workbench.panel.repl.view";new Y("debugType",void 0,{type:"string",description:g(Yi,0,"Debug type of the active debug session. For example 'python'.")});new Y("debugConfigurationType",void 0,{type:"string",description:g(Yi,1,"Debug type of the selected launch configuration. For example 'python'.")});new Y("debugState","inactive",{type:"string",description:g(Yi,2,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const w$t="debugUx";new Y(w$t,"default",{type:"string",description:g(Yi,3,"Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.")});new Y("hasDebugged",!1,{type:"boolean",description:g(Yi,4,"True when a debug session has been started at least once, false otherwise.")});new Y("inDebugMode",!1,{type:"boolean",description:g(Yi,5,"True when debugging, false otherwise.")});new Y("inDebugRepl",!1,{type:"boolean",description:g(Yi,6,"True when focus is in the debug console, false otherwise.")});new Y("breakpointWidgetVisible",!1,{type:"boolean",description:g(Yi,7,"True when breakpoint editor zone widget is visible, false otherwise.")});new Y("inBreakpointWidget",!1,{type:"boolean",description:g(Yi,8,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Y("breakpointsFocused",!0,{type:"boolean",description:g(Yi,9,"True when the BREAKPOINTS view is focused, false otherwise.")});new Y("watchExpressionsFocused",!0,{type:"boolean",description:g(Yi,10,"True when the WATCH view is focused, false otherwsie.")});new Y("watchExpressionsExist",!1,{type:"boolean",description:g(Yi,11,"True when at least one watch expression exists, false otherwise.")});new Y("variablesFocused",!0,{type:"boolean",description:g(Yi,12,"True when the VARIABLES views is focused, false otherwsie")});new Y("expressionSelected",!1,{type:"boolean",description:g(Yi,13,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new Y("breakpointInputFocused",!1,{type:"boolean",description:g(Yi,14,"True when the input box has focus in the BREAKPOINTS view.")});new Y("callStackItemType",void 0,{type:"string",description:g(Yi,15,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new Y("callStackSessionIsAttach",!1,{type:"boolean",description:g(Yi,16,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new Y("callStackItemStopped",!1,{type:"boolean",description:g(Yi,17,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new Y("callStackSessionHasOneThread",!1,{type:"boolean",description:g(Yi,18,"True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.")});new Y("watchItemType",void 0,{type:"string",description:g(Yi,19,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new Y("canViewMemory",void 0,{type:"boolean",description:g(Yi,20,"Indicates whether the item in the view has an associated memory refrence.")});new Y("breakpointItemType",void 0,{type:"string",description:g(Yi,21,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new Y("breakpointItemBytes",void 0,{type:"boolean",description:g(Yi,22,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Y("breakpointHasModes",!1,{type:"boolean",description:g(Yi,23,"Whether the breakpoint has multiple modes it can switch to.")});new Y("breakpointSupportsCondition",!1,{type:"boolean",description:g(Yi,24,"True when the focused breakpoint supports conditions.")});new Y("loadedScriptsSupported",!1,{type:"boolean",description:g(Yi,25,"True when the focused sessions supports the LOADED SCRIPTS view")});new Y("loadedScriptsItemType",void 0,{type:"string",description:g(Yi,26,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Y("focusedSessionIsAttach",!1,{type:"boolean",description:g(Yi,27,"True when the focused session is 'attach'.")});new Y("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(Yi,28,"True when the focused session is run without debugging.")});new Y("stepBackSupported",!1,{type:"boolean",description:g(Yi,29,"True when the focused session supports 'stepBack' requests.")});new Y("restartFrameSupported",!1,{type:"boolean",description:g(Yi,30,"True when the focused session supports 'restartFrame' requests.")});new Y("stackFrameSupportsRestart",!1,{type:"boolean",description:g(Yi,31,"True when the focused stack frame suppots 'restartFrame'.")});new Y("jumpToCursorSupported",!1,{type:"boolean",description:g(Yi,32,"True when the focused session supports 'jumpToCursor' request.")});new Y("stepIntoTargetsSupported",!1,{type:"boolean",description:g(Yi,33,"True when the focused session supports 'stepIntoTargets' request.")});new Y("breakpointsExist",!1,{type:"boolean",description:g(Yi,34,"True when at least one breakpoint exists.")});new Y("debuggersAvailable",!1,{type:"boolean",description:g(Yi,35,"True when there is at least one debug extensions active.")});new Y("debugExtensionAvailable",!0,{type:"boolean",description:g(Yi,36,"True when there is at least one debug extension installed and enabled.")});new Y("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(Yi,37,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Y("debugSetVariableSupported",!1,{type:"boolean",description:g(Yi,38,"True when the focused session supports 'setVariable' request.")});new Y("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(Yi,39,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Y("debugSetExpressionSupported",!1,{type:"boolean",description:g(Yi,40,"True when the focused session supports 'setExpression' request.")});new Y("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(Yi,41,"True when the focused session supports to break when value changes.")});new Y("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(Yi,42,"True when the focused breakpoint supports to break when value is accessed.")});new Y("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(Yi,43,"True when the focused breakpoint supports to break when value is read.")});new Y("terminateDebuggeeSupported",!1,{type:"boolean",description:g(Yi,44,"True when the focused session supports the terminate debuggee capability.")});new Y("suspendDebuggeeSupported",!1,{type:"boolean",description:g(Yi,45,"True when the focused session supports the suspend debuggee capability.")});new Y("variableEvaluateNamePresent",!1,{type:"boolean",description:g(Yi,46,"True when the focused variable has an 'evalauteName' field set.")});new Y("variableIsReadonly",!1,{type:"boolean",description:g(Yi,47,"True when the focused variable is read-only.")});new Y("variableValue",!1,{type:"string",description:g(Yi,48,"Value of the variable, present for debug visualization clauses.")});new Y("variableType",!1,{type:"string",description:g(Yi,49,"Type of the variable, present for debug visualization clauses.")});new Y("variableInterfaces",!1,{type:"array",description:g(Yi,50,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Y("variableName",!1,{type:"string",description:g(Yi,51,"Name of the variable, present for debug visualization clauses.")});new Y("variableLanguage",!1,{type:"string",description:g(Yi,52,"Language of the variable source, present for debug visualization clauses.")});new Y("variableExtensionId",!1,{type:"string",description:g(Yi,53,"Extension ID of the variable source, present for debug visualization clauses.")});new Y("exceptionWidgetVisible",!1,{type:"boolean",description:g(Yi,54,"True when the exception widget is visible.")});new Y("multiSessionRepl",!1,{type:"boolean",description:g(Yi,55,"True when there is more than 1 debug console.")});new Y("multiSessionDebug",!1,{type:"boolean",description:g(Yi,56,"True when there is more than 1 active debug session.")});new Y("disassembleRequestSupported",!1,{type:"boolean",description:g(Yi,57,"True when the focused sessions supports disassemble request.")});new Y("disassemblyViewFocus",!1,{type:"boolean",description:g(Yi,58,"True when the Disassembly View is focused.")});new Y("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(Yi,59,"True when the language in the current editor supports disassemble request.")});new Y("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(Yi,60,"True when the focused stack frame has instruction pointer reference.")});g(Yi,62,"Controls when the internal Debug Console should open.");var D3e;(function(n){n[n.Inactive=0]="Inactive",n[n.Initializing=1]="Initializing",n[n.Stopped=2]="Stopped",n[n.Running=3]="Running"})(D3e||(D3e={}));var k3e;(function(n){n[n.Valid=0]="Valid",n[n.Unreadable=1]="Unreadable",n[n.Error=2]="Error"})(k3e||(k3e={}));var Ane;(function(n){n[n.Variable=0]="Variable",n[n.Address=1]="Address"})(Ane||(Ane={}));var x6;(function(n){n[n.Initial=1]="Initial",n[n.Dynamic=2]="Dynamic"})(x6||(x6={}));var I3e;(function(n){n.UnverifiedBreakpoints="unverifiedBreakpoints"})(I3e||(I3e={}));var L3e;(function(n){n[n.CONDITION=0]="CONDITION",n[n.HIT_COUNT=1]="HIT_COUNT",n[n.LOG_MESSAGE=2]="LOG_MESSAGE",n[n.TRIGGER_POINT=3]="TRIGGER_POINT"})(L3e||(L3e={}));var Ene;(function(n){n[n.Command=0]="Command",n[n.Tree=1]="Tree"})(Ene||(Ene={}));var nDe;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(nDe||(nDe={}));var sDe;(function(n){n.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:P.revive(e.iconPath.light),dark:P.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),n.serialize=e=>e})(sDe||(sDe={}));var oDe;const zC="vs/workbench/contrib/quickaccess/browser/viewQuickAccess";var EP;let jV=(EP=class extends zFe{constructor(e,t,i,s,o,r,a,c){super(oDe.PREFIX,{noResultsPick:{label:g(zC,0,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=s,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:dee(e,r.label,!0)??void 0},r.highlights.label||Hlt(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const s=[];let o;for(const r of t){if(o!==r.containerLabel){o=r.containerLabel;let a;i.has(o)?a=`${i.get(o)} / ${o}`:a=o,s.push({type:"separator",label:a})}s.push(r)}return s}doGetViewPickItems(){const e=[],t=(r,a)=>{const c=this.viewDescriptorService.getViewContainerModel(a),l=[];for(const d of c.allViewDescriptors)this.contextKeyService.contextMatchesRules(d.when)&&l.push({label:d.name.value,containerLabel:c.title,accept:()=>this.viewsService.openView(d.id,!0)});return l},i=(r,a)=>{const c=this.paneCompositeService.getPaneComposites(r),l=this.paneCompositeService.getVisiblePaneCompositeIds(r);c.sort((d,h)=>{let u=l.findIndex(p=>d.id===p),f=l.findIndex(p=>h.id===p);return u<0&&(u=c.indexOf(d)+l.length),f<0&&(f=c.indexOf(h)+l.length),u-f});for(const d of c)if(this.includeViewContainer(d)){const h=this.viewDescriptorService.getViewContainerById(d.id);h&&e.push({label:this.viewDescriptorService.getViewContainerModel(h).title,containerLabel:a,accept:()=>this.paneCompositeService.openPaneComposite(d.id,r,!0)})}};i(Sr.Sidebar,g(zC,1,"Side Bar")),i(Sr.Panel,g(zC,2,"Panel")),i(Sr.AuxiliaryBar,g(zC,3,"Secondary Side Bar"));const s=r=>{const a=this.paneCompositeService.getPaneComposites(r);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};s(Sr.Sidebar),s(Sr.Panel),s(Sr.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(zC,4,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(zC,5,"Terminal"),accept:async()=>{await this.terminalGroupService.showPanel(!0),this.terminalService.setActiveInstance(c)}})})}),this.debugService.getModel().getSessions(!0).filter(r=>r.hasSeparateRepl()).forEach((r,a)=>{const c=r.name;e.push({label:c,containerLabel:g(zC,6,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(x3e)||await this.viewsService.openView(x3e,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(zC,7,"Output"),accept:()=>this.outputService.showChannel(r.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},oDe=EP,EP.PREFIX="view ",EP);jV=oDe=D([_(0,z_),_(1,q_),_(2,nhe),_(3,Nz),_(4,MPe),_(5,IPe),_(6,Nw),_(7,Pe)],jV);const Zce=class Zce extends pi{constructor(){super({id:Zce.ID,title:Be(zC,8,"Open View"),category:Xa.View,f1:!0})}async run(e){e.get(On).quickAccess.show(jV.PREFIX)}};Zce.ID="workbench.action.openView";let D6=Zce;const nR=class nR extends pi{constructor(){super({id:nR.ID,title:Be(zC,9,"Quick Open View"),category:Xa.View,f1:!1,keybinding:{weight:ye.WorkbenchContrib,when:void 0,...nR.KEYBINDING}})}async run(e){const t=e.get(ti),i=e.get(On),s=t.lookupKeybindings(nR.ID);i.quickAccess.show(jV.PREFIX,{quickNavigateConfiguration:{keybindings:s},itemActivation:Qp.FIRST})}};nR.ID="workbench.action.quickOpenView",nR.KEYBINDING={primary:V.CtrlCmd|E.KeyQ,mac:{primary:V.WinCtrl|E.KeyQ},linux:{primary:0}};let xne=nR;const E_="vs/workbench/contrib/quickaccess/browser/quickAccess.contribution",sOe=it.as(xz.Quickaccess);sOe.registerQuickAccessProvider({ctor:a8,prefix:a8.PREFIX,placeholder:g(E_,0,"Type '{0}' to get help on the actions you can take from here.",a8.PREFIX),helpEntries:[{description:g(E_,1,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(E_,2,"More")}]});sOe.registerQuickAccessProvider({ctor:jV,prefix:jV.PREFIX,contextKey:"inViewsPicker",placeholder:g(E_,3,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(E_,4,"Open View"),commandId:D6.ID}]});sOe.registerQuickAccessProvider({ctor:FF,prefix:FF.PREFIX,contextKey:"inCommandsPicker",placeholder:g(E_,5,"Type the name of a command to run."),helpEntries:[{description:g(E_,6,"Show and Run Commands"),commandId:V1.ID,commandCenterOrder:20}]});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:V1.ID,title:g(E_,7,"&&Command Palette...")},order:1});Xs.appendMenuItem(Te.MenubarHelpMenu,{group:"1_welcome",command:{id:V1.ID,title:g(E_,8,"Show All Commands")},order:2});Xs.appendMenuItem(Te.MenubarViewMenu,{group:"1_open",command:{id:D6.ID,title:g(E_,9,"&&Open View...")},order:2});Xs.appendMenuItem(Te.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(E_,10,"Go to &&Line/Column...")},order:1});Xs.appendMenuItem(Te.GlobalActivity,{group:"1_command",command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});Xs.appendMenuItem(Te.EditorContext,{group:"z_commands",when:X.editorSimpleInput.toNegated(),command:{id:V1.ID,title:g(E_,11,"Command Palette...")},order:1});At(g$t);At(V1);At(D6);At(xne);const b$t="inViewsPicker",xst=ge.and(aA,ge.has(b$t)),eH=xne.KEYBINDING,T3e="workbench.action.quickOpenNavigateNextInViewPicker";xr.registerCommandAndKeybindingRule({id:T3e,weight:ye.WorkbenchContrib+50,handler:Rhe(T3e,!0),when:xst,primary:eH.primary,linux:eH.linux,mac:eH.mac});const R3e="workbench.action.quickOpenNavigatePreviousInViewPicker";xr.registerCommandAndKeybindingRule({id:R3e,weight:ye.WorkbenchContrib+50,handler:Rhe(R3e,!1),when:xst,primary:eH.primary|V.Shift,linux:eH.linux,mac:{primary:eH.mac.primary|V.Shift}});const Ow=Il;var zH;let Dne=(zH=class extends ${constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},zH.ID="workbench.contrib.externalUriResolver",zH);Dne=D([_(0,fr),_(1,Ow)],Dne);const LB="vs/workbench/contrib/url/browser/trustedDomains",Dst=P.parse("trustedDomains:/Trusted Domains"),Hhe="http.linkProtectionTrustedDomains",rDe="http.linkProtectionTrustedDomainsContent",aDe={id:"workbench.action.manageTrustedDomain",description:{description:Be(LB,0,"Manage Trusted Domains"),args:[]},handler:async n=>{n.get(_i).openEditor({resource:Dst,languageId:"jsonc",options:{pinned:!0}})}};async function C$t(n,e,t,i,s,o,r){const a=P.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(LB,1,"Trust {0}",e),id:"trust",toTrust:e,picked:!0}),c.length===4&&c.every(p=>Number.isInteger(+p)||Number.isInteger(+p.split(":")[0]))){if(a.authority.includes(":")){const p=a.authority.split(":")[0];h.push({type:"item",label:g(LB,2,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(LB,3,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(LB,4,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(LB,5,"Manage Trusted Domains"),id:"manage"});const f=await i.pick(h,{activeItem:h[0]});if(f&&f.id)switch(f.id){case"manage":return await o.openEditor({resource:Dst.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),n;case"trust":{const p=f.toTrust;if(n.indexOf(p)===-1)return s.remove(rDe,ke.APPLICATION),s.store(Hhe,JSON.stringify([...n,p]),ke.APPLICATION,ln.USER),[...n,p]}}return[]}async function y$t(n){const{defaultTrustedDomains:e,trustedDomains:t}=kne(n);return{defaultTrustedDomains:e,trustedDomains:t}}function kne(n){const e=n.get(on),t=n.get(Ja),i=n.get(Ow),s=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Hhe,ke.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:s,trustedDomains:o}}const S$t="trustedDomains",A$t={type:an.File,ctime:Date.now(),mtime:Date.now(),size:0},kst=`// Links matching one or more entries in the list below can be opened without link protection. // The following examples show what entries can look like: // - "https://microsoft.com": Matches this specific domain using https // - "https://microsoft.com:8080": Matches this specific domain on this port using https @@ -835,90 +835,90 @@ ${n}`:n}var $xe;const Rpe=we;function iB(n){n.scrollTop=n.scrollHeight-n.renderH `})):i+=`// By default, VS Code trusts "localhost". `,i+=Ist,i+=t?` // Currently configuring trust for ${t} -`:"",e.length===0?i+=E$t:i+=JSON.stringify(e,null,2),i}var $H;let Ine=($H=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=es.FileReadWrite,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.fileService.registerProvider(S$t,this)}stat(e){return Promise.resolve(A$t)}async readFile(e){let t=this.storageService.get(rDe,ke.APPLICATION);const i=e.fragment,{defaultTrustedDomains:s,trustedDomains:o}=await this.instantiationService.invokeFunction(y$t);return(!t||t.indexOf(kst)===-1||t.indexOf(Ist)===-1||t.indexOf(i??"")===-1||[...s,...o].some(a=>!ws(t).includes(a)))&&(t=x$t(s,o,i)),ze.fromString(t).buffer}writeFile(e,t,i){try{const s=ze.wrap(t).toString(),o=ow(s);this.storageService.store(rDe,s,ke.APPLICATION,ln.USER),this.storageService.store(Hhe,JSON.stringify(o)||"",ke.APPLICATION,ln.USER)}catch{}return Promise.resolve()}watch(e,t){return{dispose(){}}}mkdir(e){return Promise.resolve(void 0)}readdir(e){return Promise.resolve(void 0)}delete(e,t){return Promise.resolve(void 0)}rename(e,t,i){return Promise.resolve(void 0)}},$H.ID="workbench.contrib.trustedDomainsFileSystemProvider",$H);Ine=D([_(0,ci),_(1,sn),_(2,be)],Ine);const D$t=(n,e)=>{let t=n.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const s=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return $C(s,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?$C(s,t,`${o}://${e}`,0,0):!1},$C=(n,e,t,i,s)=>{if(n[i]?.[s]!==void 0)return n[i][s];const o=[];if(i===e.length)return s===t.length;if(s===t.length)return e.slice(i)[0]==="/";if(e[i]===t[s]&&o.push($C(n,e,t,i+1,s+1)),t[s]+t[s+1]==="*."&&(["/",":"].includes(e[i])||o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+2))),t[s]==="*"&&(i+1===e.length?o.push($C(n,e,t,i+1,s+1)):o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+1))),t[s]+t[s+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push($C(n,e,t,r,s+2))}else o.push($C(n,e,t,i,s+2));return n[i][s]=o.some(r=>r===!0)};let cDe=class extends ${constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new d$(yi,()=>{const{defaultTrustedDomains:s,trustedDomains:o}=this._instantiationService.invokeFunction(kne);return[...s,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(ke.APPLICATION,Hhe,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(kne),s=[...t,...i];return Lst(e,s)}};cDe=D([_(0,be),_(1,sn)],cDe);const k$t=/^localhost(:\d+)?$/i,I$t=/^127.0.0.1(:\d+)?$/;function L$t(n){return k$t.test(n)||I$t.test(n)}function M3e(n){const e=["github.com"];try{const t=typeof n=="string"?P.parse(n,!0):n;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return n.toString()}}function Lst(n,e){if(n=P.parse(M3e(n)),e=e.map(M3e),L$t(n.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!Rx(e,_e.http)&&!Rx(e,_e.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let s;if(typeof e=="string"?s=P.parse(e):s=e,await this._trustedDomainService.isValid(s))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=s;let d=`${o}://${r}${a}`;const h=`${c?"?"+c:""}${l?"#"+l:""}`,u=Math.max(0,60-d.length),f=Math.min(Math.max(5,u),h.length);f===h.length?d+=h:d+=h.charAt(0)+"..."+h.substring(h.length-f+1);const{result:p}=await this._dialogService.prompt({type:nt.Info,message:g(XK,0,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(XK,1,"&&Open"),run:()=>!0},{label:g(XK,2,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:s.toString(!0)),!1)},{label:g(XK,3,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(kne),v=`${o}://${r}`,w=await C$t(m,v,s,this._quickInputService,this._storageService,this._editorService);return!!(w.indexOf("*")!==-1||Lst(s,w))}}],cancelButton:{run:()=>!1}});return p}}};lDe=D([_(0,fr),_(1,sn),_(2,To),_(3,Ja),_(4,On),_(5,_i),_(6,Mu),_(7,on),_(8,be),_(9,Re),_(10,oA),_(11,lhe)],lDe);const dDe="vs/workbench/contrib/url/browser/url.contribution";class T$t extends pi{constructor(){super({id:"workbench.action.url.openUrl",title:Be(dDe,0,"Open URL"),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(On),i=e.get(jde);return t.input({prompt:g(dDe,1,"URL to open")}).then(s=>{if(s){const o=P.parse(s);i.open(o,{originalUrl:s})}})}}At(T$t);yt.registerCommand(aDe);Xs.appendMenuItem(Te.CommandPalette,{command:{id:aDe.id,title:aDe.description.description}});it.as(pf.Workbench).registerWorkbenchContribution(lDe,Us.Restored);gp(Ine.ID,Ine,Sl.BlockRestore);gp(Dne.ID,Dne,Sl.BlockRestore);const R$t=it.as(Cs.Configuration);R$t.registerConfiguration({...PQ,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:ut.APPLICATION,type:"boolean",default:!1,description:g(dDe,2,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var Lne;(function(n){n.TITLEBAR_PART="workbench.parts.titlebar",n.BANNER_PART="workbench.parts.banner",n.ACTIVITYBAR_PART="workbench.parts.activitybar",n.SIDEBAR_PART="workbench.parts.sidebar",n.PANEL_PART="workbench.parts.panel",n.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",n.EDITOR_PART="workbench.parts.editor",n.STATUSBAR_PART="workbench.parts.statusbar"})(Lne||(Lne={}));var N3e;(function(n){n.SHOW_TABS="zenMode.showTabs",n.HIDE_LINENUMBERS="zenMode.hideLineNumbers",n.HIDE_STATUSBAR="zenMode.hideStatusBar",n.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",n.CENTER_LAYOUT="zenMode.centerLayout",n.FULLSCREEN="zenMode.fullScreen",n.RESTORE="zenMode.restore",n.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(N3e||(N3e={}));var u_;(function(n){n.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",n.EDITOR_TABS_MODE="workbench.editor.showTabs",n.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",n.COMMAND_CENTER="window.commandCenter",n.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(u_||(u_={}));var Tne;(function(n){n.DEFAULT="default",n.TOP="top",n.BOTTOM="bottom",n.HIDDEN="hidden"})(Tne||(Tne={}));var xM;(function(n){n.MULTIPLE="multiple",n.SINGLE="single",n.NONE="none"})(xM||(xM={}));var c8;(function(n){n.DEFAULT="default",n.TITLEBAR="titleBar",n.HIDDEN="hidden"})(c8||(c8={}));var kv;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BOTTOM=2]="BOTTOM"})(kv||(kv={}));var Cb;(function(n){n[n.ALWAYS=0]="ALWAYS",n[n.NEVER=1]="NEVER",n[n.REMEMBER_LAST=2]="REMEMBER_LAST"})(Cb||(Cb={}));function l8(n){switch(n){case kv.LEFT:return"left";case kv.RIGHT:return"right";case kv.BOTTOM:return"bottom";default:return"bottom"}}const M$t={[l8(kv.LEFT)]:kv.LEFT,[l8(kv.RIGHT)]:kv.RIGHT,[l8(kv.BOTTOM)]:kv.BOTTOM};function ZK(n){return M$t[n]}function Fpe(n){switch(n){case Cb.ALWAYS:return"always";case Cb.NEVER:return"never";case Cb.REMEMBER_LAST:return"preserve";default:return"preserve"}}Fpe(Cb.ALWAYS)+"",Cb.ALWAYS,Fpe(Cb.NEVER)+"",Cb.NEVER,Fpe(Cb.REMEMBER_LAST)+"",Cb.REMEMBER_LAST;var e_;(function(n){n[n.SHORT=0]="SHORT",n[n.MEDIUM=1]="MEDIUM",n[n.LONG=2]="LONG"})(e_||(e_={}));var zD;const Ope="vs/workbench/browser/parts/titlebar/windowTitle";var GC;(function(n){n.titleSeparator="window.titleSeparator",n.title="window.title"})(GC||(GC={}));const Tst=(()=>{if(ei&&rf)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const n="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Jn?n+"${separator}${remoteName}":n})(),Rst=ei?" — ":" - ";var tx;let P3e=(tx=class extends ${get value(){return this.title??""}get workspaceName(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get fileName(){const e=this.editorService.activeEditor;if(!e)return;const t=e.getTitle(Gs.SHORT);return`${e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:""}${t}`}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=s,this.environmentService=r,this.contextService=a,this.labelService=c,this.userDataProfileService=l,this.productService=d,this.viewsService=h,this.properties={isPure:!0,isAdmin:!1,prefix:void 0},this.variables=new Map,this.activeEditorListeners=this._register(new Z),this.titleUpdater=this._register(new yn(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=o.createScoped(t,this._store),this.windowId=e.vscodeWindowId,this.updateTitleIncludesFocusedView(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationChanged(e))),this._register(this.editorService.onDidActiveEditorChange(()=>this.onActiveEditorChange())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkspaceName(()=>this.titleUpdater.schedule())),this._register(this.labelService.onDidChangeFormatters(()=>this.titleUpdater.schedule())),this._register(this.userDataProfileService.onDidChangeCurrentProfile(()=>this.titleUpdater.schedule())),this._register(this.viewsService.onDidChangeFocusedView(()=>{this.titleIncludesFocusedView&&this.titleUpdater.schedule()})),this._register(this.contextKeyService.onDidChangeContext(e=>{e.affectsSome(this.variables)&&this.titleUpdater.schedule()}))}onConfigurationChanged(e){e.affectsConfiguration(GC.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(GC.title)||e.affectsConfiguration(GC.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(GC.title);this.titleIncludesFocusedView=typeof e=="string"&&e.includes("${focusedView}")}onActiveEditorChange(){this.activeEditorListeners.clear(),this.titleUpdater.schedule();const e=this.editorService.activeEditor;if(e&&(this.activeEditorListeners.add(e.onDidChangeDirty(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(e.onDidChangeLabel(()=>this.titleUpdater.schedule()))),this.titleIncludesFocusedView){const t=this.editorService.activeTextEditorControl,i=[];ja(t)?i.push(t):ew(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const s of i)this.activeEditorListeners.add(s.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(s.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;jRe(t)||(t=this.productService.nameLong);const i=vZ(this.windowId,!0).window;!i.document.title&&ei&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${zD.TITLE_DIRTY}`),i.document.title=t,this.title=e,this.onDidChangeEmitter.fire()}}getFullWindowTitle(){const{prefix:e,suffix:t}=this.getTitleDecorations();let i=this.getWindowTitle()||this.productService.nameLong;return e&&(i=`${e} ${i}`),t&&(i=`${i} ${t}`),i.replace(/[^\S ]/g," ")}getTitleDecorations(){let e,t;return this.properties.prefix&&(e=this.properties.prefix),this.environmentService.isExtensionDevelopment&&(e=e?`${zD.NLS_EXTENSION_HOST} - ${e}`:zD.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=zD.NLS_USER_IS_ADMIN),{prefix:e,suffix:t}}updateProperties(e){const t=typeof e.isAdmin=="boolean"?e.isAdmin:this.properties.isAdmin,i=typeof e.isPure=="boolean"?e.isPure:this.properties.isPure,s=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||s!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=s,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:s}of e)this.variables.has(s)||(this.variables.set(s,i),t=!0);t&&this.titleUpdater.schedule()}getWindowTitle(){const e=this.editorService.activeEditor,t=this.contextService.getWorkspace();let i;t.configuration?i=t.configuration:t.folders.length&&(i=t.folders[0].uri);const s=Qc.getOriginalUri(e,{supportSideBySide:go.PRIMARY});let o=s?ma(s):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===Nn.FOLDER?r=t.folders[0]:s&&(r=this.contextService.getWorkspaceFolder(s)??void 0);let a;if(this.environmentService.remoteAuthority&&!Jn)a=this.labelService.getHostLabel(_e.vscodeRemote,this.environmentService.remoteAuthority);else{const z=jFe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Gs.SHORT):"",l=e?e.getTitle(Gs.MEDIUM):c,d=e?e.getTitle(Gs.LONG):l,h=o?ui(o):"",u=o?this.labelService.getUriLabel(o,{relative:!0}):"",f=o?this.labelService.getUriLabel(o):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:e_.SHORT}),v=i?this.labelService.getUriLabel(i):"",w=r?r.name:"",b=r?this.labelService.getUriLabel(r.uri):"",C=e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:"",y=this.productService.nameLong,S=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,M=this.viewsService.getFocusedViewName(),k={};for(const[z,U]of this.variables)k[U]=this.contextKeyService.getContextKeyValue(z)??"";let F=this.configurationService.getValue(GC.title);typeof F!="string"&&(F=Tst);let N=this.configurationService.getValue(GC.titleSeparator);return typeof N!="string"&&(N=Rst),aPt(F,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:w,folderPath:b,dirty:C,appName:y,remoteName:a,profileName:S,focusedView:M,separator:{label:N}})}isCustomTitleFormat(){const e=this.configurationService.inspect(GC.title),t=this.configurationService.inspect(GC.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},zD=tx,tx.NLS_USER_IS_ADMIN=Is?g(Ope,0,"[Administrator]"):g(Ope,1,"[Superuser]"),tx.NLS_EXTENSION_HOST=g(Ope,2,"[Extension Development Host]"),tx.TITLE_DIRTY="● ",tx);P3e=zD=D([_(2,Re),_(3,Pe),_(4,_i),_(5,Ow),_(6,Ti),_(7,eo),_(8,Tm),_(9,Ja),_(10,q_)],P3e);var TB,Q0;let Rne=(Q0=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceContextService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.patterns=[],this.enabled=!0,this.cache=new olt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|dirname\(([-+]?\d+)\))\}/g,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListernes()}registerListernes(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(TB.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(TB.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(TB.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(TB.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const s=oF(t),o=_w(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:s,parsedPattern:o})}this.patterns.sort((t,i)=>this.patternWeight(i.pattern)-this.patternWeight(t.pattern))}patternWeight(e){let t=0;for(const i of e.split("/"))i==="**"?t+=1:i==="*"?t+=10:i.includes("*")||i.includes("?")?t+=50:i!==""&&(t+=100);return t}getName(e){if(!this.enabled||this.patterns.length===0)return;const t=e.toString(),i=this.cache.get(t);if(i!==void 0)return i??void 0;const s=this.applyPatterns(e);return this.cache.set(t,s??null),s}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const s of this.patterns){let o;if(t&&!s.isAbsolutePath?(i||(i=lO(ma(t.uri),e)??e.path),o=i):o=e.path,s.parsedPattern(o))return this.applyTempate(s.template,e,o)}}applyTempate(e,t,i){let s;return e.replace(this._parsedTemplateExpression,(o,r,a)=>{switch(s=s??cht(t.path),r){case"filename":return s.name;case"extname":return s.ext.slice(1);default:{const c=r==="dirname"?0:parseInt(a),l=this.getNthDirname(lS(i),c);if(l)return l}}return o})}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/"),s=i.length;let o;t<0?o=Math.abs(t)-1:o=s-t-1;const r=i[o];if(!(r===void 0||r===""))return r}},TB=Q0,Q0.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",Q0.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",Q0);Rne=TB=D([_(0,Re),_(1,Ti)],Rne);const Ae="vs/workbench/browser/workbench.contribution",eY=it.as(Cs.Configuration);(function(){gp(wte.ID,wte,Sl.Eventually),gp(bte.ID,bte,Sl.AfterRestored),eY.registerConfiguration({...PQ,properties:{"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(Ae,0,"The default size."),g(Ae,1,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(Ae,2,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[u_.EDITOR_TABS_MODE]:{type:"string",enum:[xM.MULTIPLE,xM.SINGLE,xM.NONE],enumDescriptions:[g(Ae,3,"Each editor is displayed as a tab in the editor title area."),g(Ae,4,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,5,"The editor title area is not displayed.")],description:g(Ae,6,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[u_.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[c8.DEFAULT,c8.TITLEBAR,c8.HIDDEN],markdownEnumDescriptions:[g(Ae,7,"Show editor actions in the window title bar when {0} is set to {1}. Otherwise, editor actions are shown in the editor tab bar.","`#workbench.editor.showTabs#`","`none`"),g(Ae,8,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(Ae,9,"Editor actions are not shown.")],markdownDescription:g(Ae,10,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(Ae,11,"Controls whether to always show the editor actions, even when the editor group is not active."),default:!1},"workbench.editor.wrapTabs":{type:"boolean",markdownDescription:g(Ae,12,"Controls whether tabs should be wrapped over multiple lines when exceeding available space or whether a scrollbar should appear instead. This value is ignored when {0} is not set to '{1}'.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.scrollToSwitchTabs":{type:"boolean",markdownDescription:g(Ae,13,"Controls whether scrolling over tabs will open them or not. By default tabs will only reveal upon scrolling, but not open. You can press and hold the Shift-key while scrolling to change this behavior for that duration. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.highlightModifiedTabs":{type:"boolean",markdownDescription:g(Ae,14,"Controls whether a top border is drawn on tabs for editors that have unsaved changes. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","multiple"),default:!1},"workbench.editor.decorations.badges":{type:"boolean",markdownDescription:g(Ae,15,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(Ae,16,"Controls whether editor file decorations should use colors."),default:!0},[Rne.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(Ae,17,"Controls whether the custom workbench editor labels should be applied."),default:!0},[Rne.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(Ae,18,"Controls the rendering of the editor label. Each __Item__ is a pattern that matches a file path. Both relative and absolute file paths are supported. The relative path must include the WORKSPACE_FOLDER (e.g `WORKSPACE_FOLDER/src/**.tsx` or `*/src/**.tsx`). Absolute patterns must start with a `/`. In case multiple patterns match, the longest matching path will be picked. Each __Value__ is the template for the rendered editor when the __Item__ matches. Variables are substituted based on the context:");return t+=` +`:"",e.length===0?i+=E$t:i+=JSON.stringify(e,null,2),i}var $H;let Ine=($H=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=es.FileReadWrite,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None,this.fileService.registerProvider(S$t,this)}stat(e){return Promise.resolve(A$t)}async readFile(e){let t=this.storageService.get(rDe,ke.APPLICATION);const i=e.fragment,{defaultTrustedDomains:s,trustedDomains:o}=await this.instantiationService.invokeFunction(y$t);return(!t||t.indexOf(kst)===-1||t.indexOf(Ist)===-1||t.indexOf(i??"")===-1||[...s,...o].some(a=>!ws(t).includes(a)))&&(t=x$t(s,o,i)),ze.fromString(t).buffer}writeFile(e,t,i){try{const s=ze.wrap(t).toString(),o=ow(s);this.storageService.store(rDe,s,ke.APPLICATION,ln.USER),this.storageService.store(Hhe,JSON.stringify(o)||"",ke.APPLICATION,ln.USER)}catch{}return Promise.resolve()}watch(e,t){return{dispose(){}}}mkdir(e){return Promise.resolve(void 0)}readdir(e){return Promise.resolve(void 0)}delete(e,t){return Promise.resolve(void 0)}rename(e,t,i){return Promise.resolve(void 0)}},$H.ID="workbench.contrib.trustedDomainsFileSystemProvider",$H);Ine=D([_(0,ci),_(1,on),_(2,be)],Ine);const D$t=(n,e)=>{let t=n.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const s=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return $C(s,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?$C(s,t,`${o}://${e}`,0,0):!1},$C=(n,e,t,i,s)=>{if(n[i]?.[s]!==void 0)return n[i][s];const o=[];if(i===e.length)return s===t.length;if(s===t.length)return e.slice(i)[0]==="/";if(e[i]===t[s]&&o.push($C(n,e,t,i+1,s+1)),t[s]+t[s+1]==="*."&&(["/",":"].includes(e[i])||o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+2))),t[s]==="*"&&(i+1===e.length?o.push($C(n,e,t,i+1,s+1)):o.push($C(n,e,t,i+1,s)),o.push($C(n,e,t,i,s+1))),t[s]+t[s+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push($C(n,e,t,r,s+2))}else o.push($C(n,e,t,i,s+2));return n[i][s]=o.some(r=>r===!0)};let cDe=class extends ${constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new d$(yi,()=>{const{defaultTrustedDomains:s,trustedDomains:o}=this._instantiationService.invokeFunction(kne);return[...s,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(ke.APPLICATION,Hhe,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(kne),s=[...t,...i];return Lst(e,s)}};cDe=D([_(0,be),_(1,on)],cDe);const k$t=/^localhost(:\d+)?$/i,I$t=/^127.0.0.1(:\d+)?$/;function L$t(n){return k$t.test(n)||I$t.test(n)}function M3e(n){const e=["github.com"];try{const t=typeof n=="string"?P.parse(n,!0):n;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return n.toString()}}function Lst(n,e){if(n=P.parse(M3e(n)),e=e.map(M3e),L$t(n.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!Rx(e,_e.http)&&!Rx(e,_e.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let s;if(typeof e=="string"?s=P.parse(e):s=e,await this._trustedDomainService.isValid(s))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=s;let d=`${o}://${r}${a}`;const h=`${c?"?"+c:""}${l?"#"+l:""}`,u=Math.max(0,60-d.length),f=Math.min(Math.max(5,u),h.length);f===h.length?d+=h:d+=h.charAt(0)+"..."+h.substring(h.length-f+1);const{result:p}=await this._dialogService.prompt({type:nt.Info,message:g(XK,0,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(XK,1,"&&Open"),run:()=>!0},{label:g(XK,2,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:s.toString(!0)),!1)},{label:g(XK,3,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(kne),v=`${o}://${r}`,w=await C$t(m,v,s,this._quickInputService,this._storageService,this._editorService);return!!(w.indexOf("*")!==-1||Lst(s,w))}}],cancelButton:{run:()=>!1}});return p}}};lDe=D([_(0,fr),_(1,on),_(2,To),_(3,Ja),_(4,On),_(5,_i),_(6,Mu),_(7,rn),_(8,be),_(9,Re),_(10,oA),_(11,lhe)],lDe);const dDe="vs/workbench/contrib/url/browser/url.contribution";class T$t extends pi{constructor(){super({id:"workbench.action.url.openUrl",title:Be(dDe,0,"Open URL"),category:Xa.Developer,f1:!0})}async run(e){const t=e.get(On),i=e.get(jde);return t.input({prompt:g(dDe,1,"URL to open")}).then(s=>{if(s){const o=P.parse(s);i.open(o,{originalUrl:s})}})}}At(T$t);yt.registerCommand(aDe);Xs.appendMenuItem(Te.CommandPalette,{command:{id:aDe.id,title:aDe.description.description}});it.as(pf.Workbench).registerWorkbenchContribution(lDe,Us.Restored);gp(Ine.ID,Ine,Sl.BlockRestore);gp(Dne.ID,Dne,Sl.BlockRestore);const R$t=it.as(Cs.Configuration);R$t.registerConfiguration({...PQ,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:ut.APPLICATION,type:"boolean",default:!1,description:g(dDe,2,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var Lne;(function(n){n.TITLEBAR_PART="workbench.parts.titlebar",n.BANNER_PART="workbench.parts.banner",n.ACTIVITYBAR_PART="workbench.parts.activitybar",n.SIDEBAR_PART="workbench.parts.sidebar",n.PANEL_PART="workbench.parts.panel",n.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",n.EDITOR_PART="workbench.parts.editor",n.STATUSBAR_PART="workbench.parts.statusbar"})(Lne||(Lne={}));var N3e;(function(n){n.SHOW_TABS="zenMode.showTabs",n.HIDE_LINENUMBERS="zenMode.hideLineNumbers",n.HIDE_STATUSBAR="zenMode.hideStatusBar",n.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",n.CENTER_LAYOUT="zenMode.centerLayout",n.FULLSCREEN="zenMode.fullScreen",n.RESTORE="zenMode.restore",n.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(N3e||(N3e={}));var u_;(function(n){n.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",n.EDITOR_TABS_MODE="workbench.editor.showTabs",n.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",n.COMMAND_CENTER="window.commandCenter",n.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(u_||(u_={}));var Tne;(function(n){n.DEFAULT="default",n.TOP="top",n.BOTTOM="bottom",n.HIDDEN="hidden"})(Tne||(Tne={}));var xM;(function(n){n.MULTIPLE="multiple",n.SINGLE="single",n.NONE="none"})(xM||(xM={}));var c8;(function(n){n.DEFAULT="default",n.TITLEBAR="titleBar",n.HIDDEN="hidden"})(c8||(c8={}));var kv;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT",n[n.BOTTOM=2]="BOTTOM"})(kv||(kv={}));var Cb;(function(n){n[n.ALWAYS=0]="ALWAYS",n[n.NEVER=1]="NEVER",n[n.REMEMBER_LAST=2]="REMEMBER_LAST"})(Cb||(Cb={}));function l8(n){switch(n){case kv.LEFT:return"left";case kv.RIGHT:return"right";case kv.BOTTOM:return"bottom";default:return"bottom"}}const M$t={[l8(kv.LEFT)]:kv.LEFT,[l8(kv.RIGHT)]:kv.RIGHT,[l8(kv.BOTTOM)]:kv.BOTTOM};function ZK(n){return M$t[n]}function Fpe(n){switch(n){case Cb.ALWAYS:return"always";case Cb.NEVER:return"never";case Cb.REMEMBER_LAST:return"preserve";default:return"preserve"}}Fpe(Cb.ALWAYS)+"",Cb.ALWAYS,Fpe(Cb.NEVER)+"",Cb.NEVER,Fpe(Cb.REMEMBER_LAST)+"",Cb.REMEMBER_LAST;var e_;(function(n){n[n.SHORT=0]="SHORT",n[n.MEDIUM=1]="MEDIUM",n[n.LONG=2]="LONG"})(e_||(e_={}));var zD;const Ope="vs/workbench/browser/parts/titlebar/windowTitle";var GC;(function(n){n.titleSeparator="window.titleSeparator",n.title="window.title"})(GC||(GC={}));const Tst=(()=>{if(ei&&rf)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const n="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Jn?n+"${separator}${remoteName}":n})(),Rst=ei?" — ":" - ";var tx;let P3e=(tx=class extends ${get value(){return this.title??""}get workspaceName(){return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace())}get fileName(){const e=this.editorService.activeEditor;if(!e)return;const t=e.getTitle(Gs.SHORT);return`${e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:""}${t}`}constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=s,this.environmentService=r,this.contextService=a,this.labelService=c,this.userDataProfileService=l,this.productService=d,this.viewsService=h,this.properties={isPure:!0,isAdmin:!1,prefix:void 0},this.variables=new Map,this.activeEditorListeners=this._register(new Z),this.titleUpdater=this._register(new yn(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=o.createScoped(t,this._store),this.windowId=e.vscodeWindowId,this.updateTitleIncludesFocusedView(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationChanged(e))),this._register(this.editorService.onDidActiveEditorChange(()=>this.onActiveEditorChange())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.titleUpdater.schedule())),this._register(this.contextService.onDidChangeWorkspaceName(()=>this.titleUpdater.schedule())),this._register(this.labelService.onDidChangeFormatters(()=>this.titleUpdater.schedule())),this._register(this.userDataProfileService.onDidChangeCurrentProfile(()=>this.titleUpdater.schedule())),this._register(this.viewsService.onDidChangeFocusedView(()=>{this.titleIncludesFocusedView&&this.titleUpdater.schedule()})),this._register(this.contextKeyService.onDidChangeContext(e=>{e.affectsSome(this.variables)&&this.titleUpdater.schedule()}))}onConfigurationChanged(e){e.affectsConfiguration(GC.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(GC.title)||e.affectsConfiguration(GC.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(GC.title);this.titleIncludesFocusedView=typeof e=="string"&&e.includes("${focusedView}")}onActiveEditorChange(){this.activeEditorListeners.clear(),this.titleUpdater.schedule();const e=this.editorService.activeEditor;if(e&&(this.activeEditorListeners.add(e.onDidChangeDirty(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(e.onDidChangeLabel(()=>this.titleUpdater.schedule()))),this.titleIncludesFocusedView){const t=this.editorService.activeTextEditorControl,i=[];ja(t)?i.push(t):ew(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const s of i)this.activeEditorListeners.add(s.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(s.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;jRe(t)||(t=this.productService.nameLong);const i=vZ(this.windowId,!0).window;!i.document.title&&ei&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${zD.TITLE_DIRTY}`),i.document.title=t,this.title=e,this.onDidChangeEmitter.fire()}}getFullWindowTitle(){const{prefix:e,suffix:t}=this.getTitleDecorations();let i=this.getWindowTitle()||this.productService.nameLong;return e&&(i=`${e} ${i}`),t&&(i=`${i} ${t}`),i.replace(/[^\S ]/g," ")}getTitleDecorations(){let e,t;return this.properties.prefix&&(e=this.properties.prefix),this.environmentService.isExtensionDevelopment&&(e=e?`${zD.NLS_EXTENSION_HOST} - ${e}`:zD.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=zD.NLS_USER_IS_ADMIN),{prefix:e,suffix:t}}updateProperties(e){const t=typeof e.isAdmin=="boolean"?e.isAdmin:this.properties.isAdmin,i=typeof e.isPure=="boolean"?e.isPure:this.properties.isPure,s=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||s!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=s,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:s}of e)this.variables.has(s)||(this.variables.set(s,i),t=!0);t&&this.titleUpdater.schedule()}getWindowTitle(){const e=this.editorService.activeEditor,t=this.contextService.getWorkspace();let i;t.configuration?i=t.configuration:t.folders.length&&(i=t.folders[0].uri);const s=jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY});let o=s?ma(s):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===Nn.FOLDER?r=t.folders[0]:s&&(r=this.contextService.getWorkspaceFolder(s)??void 0);let a;if(this.environmentService.remoteAuthority&&!Jn)a=this.labelService.getHostLabel(_e.vscodeRemote,this.environmentService.remoteAuthority);else{const z=jFe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Gs.SHORT):"",l=e?e.getTitle(Gs.MEDIUM):c,d=e?e.getTitle(Gs.LONG):l,h=o?ui(o):"",u=o?this.labelService.getUriLabel(o,{relative:!0}):"",f=o?this.labelService.getUriLabel(o):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:e_.SHORT}),v=i?this.labelService.getUriLabel(i):"",w=r?r.name:"",b=r?this.labelService.getUriLabel(r.uri):"",C=e?.isDirty()&&!e.isSaving()?zD.TITLE_DIRTY:"",y=this.productService.nameLong,S=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,M=this.viewsService.getFocusedViewName(),k={};for(const[z,U]of this.variables)k[U]=this.contextKeyService.getContextKeyValue(z)??"";let F=this.configurationService.getValue(GC.title);typeof F!="string"&&(F=Tst);let N=this.configurationService.getValue(GC.titleSeparator);return typeof N!="string"&&(N=Rst),aPt(F,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:w,folderPath:b,dirty:C,appName:y,remoteName:a,profileName:S,focusedView:M,separator:{label:N}})}isCustomTitleFormat(){const e=this.configurationService.inspect(GC.title),t=this.configurationService.inspect(GC.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},zD=tx,tx.NLS_USER_IS_ADMIN=Is?g(Ope,0,"[Administrator]"):g(Ope,1,"[Superuser]"),tx.NLS_EXTENSION_HOST=g(Ope,2,"[Extension Development Host]"),tx.TITLE_DIRTY="● ",tx);P3e=zD=D([_(2,Re),_(3,Pe),_(4,_i),_(5,Ow),_(6,Ti),_(7,eo),_(8,Tm),_(9,Ja),_(10,q_)],P3e);var TB,Q0;let Rne=(Q0=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceContextService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.patterns=[],this.enabled=!0,this.cache=new olt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|dirname\(([-+]?\d+)\))\}/g,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListernes()}registerListernes(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(TB.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(TB.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(TB.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(TB.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const s=oF(t),o=_w(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:s,parsedPattern:o})}this.patterns.sort((t,i)=>this.patternWeight(i.pattern)-this.patternWeight(t.pattern))}patternWeight(e){let t=0;for(const i of e.split("/"))i==="**"?t+=1:i==="*"?t+=10:i.includes("*")||i.includes("?")?t+=50:i!==""&&(t+=100);return t}getName(e){if(!this.enabled||this.patterns.length===0)return;const t=e.toString(),i=this.cache.get(t);if(i!==void 0)return i??void 0;const s=this.applyPatterns(e);return this.cache.set(t,s??null),s}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const s of this.patterns){let o;if(t&&!s.isAbsolutePath?(i||(i=lO(ma(t.uri),e)??e.path),o=i):o=e.path,s.parsedPattern(o))return this.applyTempate(s.template,e,o)}}applyTempate(e,t,i){let s;return e.replace(this._parsedTemplateExpression,(o,r,a)=>{switch(s=s??cht(t.path),r){case"filename":return s.name;case"extname":return s.ext.slice(1);default:{const c=r==="dirname"?0:parseInt(a),l=this.getNthDirname(lS(i),c);if(l)return l}}return o})}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/"),s=i.length;let o;t<0?o=Math.abs(t)-1:o=s-t-1;const r=i[o];if(!(r===void 0||r===""))return r}},TB=Q0,Q0.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",Q0.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",Q0);Rne=TB=D([_(0,Re),_(1,Ti)],Rne);const Ae="vs/workbench/browser/workbench.contribution",eY=it.as(Cs.Configuration);(function(){gp(wte.ID,wte,Sl.Eventually),gp(bte.ID,bte,Sl.AfterRestored),eY.registerConfiguration({...PQ,properties:{"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(Ae,0,"The default size."),g(Ae,1,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(Ae,2,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[u_.EDITOR_TABS_MODE]:{type:"string",enum:[xM.MULTIPLE,xM.SINGLE,xM.NONE],enumDescriptions:[g(Ae,3,"Each editor is displayed as a tab in the editor title area."),g(Ae,4,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,5,"The editor title area is not displayed.")],description:g(Ae,6,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[u_.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[c8.DEFAULT,c8.TITLEBAR,c8.HIDDEN],markdownEnumDescriptions:[g(Ae,7,"Show editor actions in the window title bar when {0} is set to {1}. Otherwise, editor actions are shown in the editor tab bar.","`#workbench.editor.showTabs#`","`none`"),g(Ae,8,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(Ae,9,"Editor actions are not shown.")],markdownDescription:g(Ae,10,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(Ae,11,"Controls whether to always show the editor actions, even when the editor group is not active."),default:!1},"workbench.editor.wrapTabs":{type:"boolean",markdownDescription:g(Ae,12,"Controls whether tabs should be wrapped over multiple lines when exceeding available space or whether a scrollbar should appear instead. This value is ignored when {0} is not set to '{1}'.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.scrollToSwitchTabs":{type:"boolean",markdownDescription:g(Ae,13,"Controls whether scrolling over tabs will open them or not. By default tabs will only reveal upon scrolling, but not open. You can press and hold the Shift-key while scrolling to change this behavior for that duration. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.highlightModifiedTabs":{type:"boolean",markdownDescription:g(Ae,14,"Controls whether a top border is drawn on tabs for editors that have unsaved changes. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","multiple"),default:!1},"workbench.editor.decorations.badges":{type:"boolean",markdownDescription:g(Ae,15,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(Ae,16,"Controls whether editor file decorations should use colors."),default:!0},[Rne.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(Ae,17,"Controls whether the custom workbench editor labels should be applied."),default:!0},[Rne.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(Ae,18,"Controls the rendering of the editor label. Each __Item__ is a pattern that matches a file path. Both relative and absolute file paths are supported. The relative path must include the WORKSPACE_FOLDER (e.g `WORKSPACE_FOLDER/src/**.tsx` or `*/src/**.tsx`). Absolute patterns must start with a `/`. In case multiple patterns match, the longest matching path will be picked. Each __Value__ is the template for the rendered editor when the __Item__ matches. Variables are substituted based on the context:");return t+=` - `+[g(Ae,19,"`${dirname}`: name of the folder in which the file is located (e.g. `WORKSPACE_FOLDER/folder/file.txt -> folder`)."),g(Ae,20,"`${dirname(N)}`: name of the nth parent folder in which the file is located (e.g. `N=2: WORKSPACE_FOLDER/static/folder/file.txt -> WORKSPACE_FOLDER`). Folders can be picked from the start of the path by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.txt -> WORKSPACE_FOLDER`). If the __Item__ is an absolute pattern path, the first folder (`N=-1`) refers to the first folder in the absoulte path, otherwise it corresponds to the workspace folder."),g(Ae,21,"`${filename}`: name of the file without the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> file`)."),g(Ae,22,"`${extname}`: the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> txt`).")].join(` - `),t+=` `+g(Ae,23,'Example: `"**/static/**/*.html": "${filename} - ${dirname} (${extname})"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.'),t})(),additionalProperties:{type:"string",markdownDescription:g(Ae,24,"The template which should be rendered when the pattern mtches. May include the variables ${dirname}, ${filename} and ${extname}."),minLength:1,pattern:".*[a-zA-Z0-9].*"},default:{}},"workbench.editor.labelFormat":{type:"string",enum:["default","short","medium","long"],enumDescriptions:[g(Ae,25,"Show the name of the file. When tabs are enabled and two files have the same name in one group the distinguishing sections of each file's path are added. When tabs are disabled, the path relative to the workspace folder is shown if the editor is active."),g(Ae,26,"Show the name of the file followed by its directory name."),g(Ae,27,"Show the name of the file followed by its path relative to the workspace folder."),g(Ae,28,"Show the name of the file followed by its absolute path.")],default:"default",description:g(Ae,29,"Controls the format of the label for an editor.")},"workbench.editor.untitled.labelFormat":{type:"string",enum:["content","name"],enumDescriptions:[g(Ae,30,"The name of the untitled file is derived from the contents of its first line unless it has an associated file path. It will fallback to the name in case the line is empty or contains no word characters."),g(Ae,31,"The name of the untitled file is not derived from the contents of the file.")],default:"content",description:g(Ae,32,"Controls the format of the label for an untitled editor.")},"workbench.editor.empty.hint":{type:"string",enum:["text","hidden"],default:"text",markdownDescription:g(Ae,33,"Controls if the empty editor text hint should be visible in the editor.")},"workbench.editor.languageDetection":{type:"boolean",default:!0,description:g(Ae,34,"Controls whether the language in a text editor is automatically detected unless the language has been explicitly set by the language picker. This can also be scoped by language so you can specify which languages you do not want to be switched off of. This is useful for languages like Markdown that often contain other languages that might trick language detection into thinking it's the embedded language and not Markdown."),scope:ut.LANGUAGE_OVERRIDABLE},"workbench.editor.historyBasedLanguageDetection":{type:"boolean",default:!0,tags:["experimental"],description:g(Ae,35,"Enables use of editor history in language detection. This causes automatic language detection to favor languages that have been recently opened and allows for automatic language detection to operate with smaller inputs.")},"workbench.editor.preferHistoryBasedLanguageDetection":{type:"boolean",default:!1,tags:["experimental"],description:g(Ae,36,"When enabled, a language detection model that takes into account editor history will be given higher precedence.")},"workbench.editor.languageDetectionHints":{type:"object",default:{untitledEditors:!0,notebookEditors:!0},tags:["experimental"],description:g(Ae,37,"When enabled, shows a Status bar Quick Fix when the editor language doesn't match detected content language."),additionalProperties:!1,properties:{untitledEditors:{type:"boolean",description:g(Ae,38,"Show in untitled text editors")},notebookEditors:{type:"boolean",description:g(Ae,39,"Show in notebook editors")}}},"workbench.editor.tabActionLocation":{type:"string",enum:["left","right"],default:"right",markdownDescription:g(Ae,40,"Controls the position of the editor's tabs action buttons (close, unpin). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabActionCloseVisibility":{type:"boolean",default:!0,description:g(Ae,41,"Controls the visibility of the tab close action button.")},"workbench.editor.tabActionUnpinVisibility":{type:"boolean",default:!0,description:g(Ae,42,"Controls the visibility of the tab unpin action button.")},"workbench.editor.tabSizing":{type:"string",enum:["fit","shrink","fixed"],default:"fit",enumDescriptions:[g(Ae,43,"Always keep tabs large enough to show the full editor label."),g(Ae,44,"Allow tabs to get smaller when the available space is not enough to show all tabs at once."),g(Ae,45,"Make all tabs the same size, while allowing them to get smaller when the available space is not enough to show all tabs at once.")],markdownDescription:g(Ae,46,"Controls the size of editor tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.tabSizingFixedMinWidth":{type:"number",default:50,minimum:38,markdownDescription:g(Ae,47,"Controls the minimum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"workbench.editor.tabSizingFixedMaxWidth":{type:"number",default:160,minimum:38,markdownDescription:g(Ae,48,"Controls the maximum width of tabs when {0} size is set to {1}.","`#workbench.editor.tabSizing#`","`fixed`")},"window.density.editorTabHeight":{type:"string",enum:["default","compact"],default:"default",markdownDescription:g(Ae,49,"Controls the height of editor tabs. Also applies to the title control bar when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabSizing":{type:"string",enum:["normal","compact","shrink"],default:"normal",enumDescriptions:[g(Ae,50,"A pinned tab inherits the look of non pinned tabs."),g(Ae,51,"A pinned tab will show in a compact form with only icon or first letter of the editor name."),g(Ae,52,"A pinned tab shrinks to a compact fixed size showing parts of the editor name.")],markdownDescription:g(Ae,53,"Controls the size of pinned editor tabs. Pinned tabs are sorted to the beginning of all opened tabs and typically do not close until unpinned. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.pinnedTabsOnSeparateRow":{type:"boolean",default:!1,markdownDescription:g(Ae,54,"When enabled, displays pinned tabs in a separate row above all other tabs. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`")},"workbench.editor.preventPinnedEditorClose":{type:"string",enum:["keyboardAndMouse","keyboard","mouse","never"],default:"keyboardAndMouse",enumDescriptions:[g(Ae,55,"Always prevent closing the pinned editor when using mouse middle click or keyboard."),g(Ae,56,"Prevent closing the pinned editor when using the keyboard."),g(Ae,57,"Prevent closing the pinned editor when using mouse middle click."),g(Ae,58,"Never prevent closing a pinned editor.")],description:g(Ae,59,"Controls whether pinned editors should close when keyboard or middle mouse click is used for closing.")},"workbench.editor.splitSizing":{type:"string",enum:["auto","distribute","split"],default:"auto",enumDescriptions:[g(Ae,60,"Splits the active editor group to equal parts, unless all editor groups are already in equal parts. In that case, splits all the editor groups to equal parts."),g(Ae,61,"Splits all the editor groups to equal parts."),g(Ae,62,"Splits the active editor group to equal parts.")],description:g(Ae,63,"Controls the size of editor groups when splitting them.")},"workbench.editor.splitOnDragAndDrop":{type:"boolean",default:!0,description:g(Ae,64,"Controls if editor groups can be split from drag and drop operations by dropping an editor or file on the edges of the editor area.")},"workbench.editor.dragToOpenWindow":{type:"boolean",default:!0,markdownDescription:g(Ae,65,"Controls if editors can be dragged out of the window to open them in a new window. Press and hold the `Alt` key while dragging to toggle this dynamically.")},"workbench.editor.focusRecentEditorAfterClose":{type:"boolean",description:g(Ae,66,"Controls whether editors are closed in most recently used order or from left to right."),default:!0},"workbench.editor.showIcons":{type:"boolean",description:g(Ae,67,"Controls whether opened editors should show with an icon or not. This requires a file icon theme to be enabled as well."),default:!0},"workbench.editor.enablePreview":{type:"boolean",description:g(Ae,68,"Controls whether opened editors show as preview editors. Preview editors do not stay open, are reused until explicitly set to be kept open (via double-click or editing), and show file names in italics."),default:!0},"workbench.editor.enablePreviewFromQuickOpen":{type:"boolean",markdownDescription:g(Ae,69,"Controls whether editors opened from Quick Open show as preview editors. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). When enabled, hold Ctrl before selection to open an editor as a non-preview. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.enablePreviewFromCodeNavigation":{type:"boolean",markdownDescription:g(Ae,70,"Controls whether editors remain in preview when a code navigation is started from them. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),default:!1},"workbench.editor.closeOnFileDelete":{type:"boolean",description:g(Ae,71,"Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that editors with unsaved changes will never close to preserve your data."),default:!1},"workbench.editor.openPositioning":{type:"string",enum:["left","right","first","last"],default:"right",markdownDescription:g(Ae,72,"Controls where editors open. Select {0} or {1} to open editors to the left or right of the currently active one. Select {2} or {3} to open editors independently from the currently active one.","`left`","`right`","`first`","`last`")},"workbench.editor.openSideBySideDirection":{type:"string",enum:["right","down"],default:"right",markdownDescription:g(Ae,73,"Controls the default direction of editors that are opened side by side (for example, from the Explorer). By default, editors will open on the right hand side of the currently active one. If changed to `down`, the editors will open below the currently active one.")},"workbench.editor.closeEmptyGroups":{type:"boolean",description:g(Ae,74,"Controls the behavior of empty editor groups when the last tab in the group is closed. When enabled, empty groups will automatically close. When disabled, empty groups will remain part of the grid."),default:!0},"workbench.editor.revealIfOpen":{type:"boolean",description:g(Ae,75,"Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, such as when forcing an editor to open in a specific group or to the side of the currently active group."),default:!1},"workbench.editor.mouseBackForwardToNavigate":{type:"boolean",description:g(Ae,76,"Enables the use of mouse buttons four and five for commands 'Go Back' and 'Go Forward'."),default:!0},"workbench.editor.navigationScope":{type:"string",enum:["default","editorGroup","editor"],default:"default",markdownDescription:g(Ae,77,"Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),enumDescriptions:[g(Ae,78,"Navigate across all opened editors and editor groups."),g(Ae,79,"Navigate only in editors of the active editor group."),g(Ae,80,"Navigate only in the active editor.")]},"workbench.editor.restoreViewState":{type:"boolean",markdownDescription:g(Ae,81,"Restores the last editor view state (such as scroll position) when re-opening editors after they have been closed. Editor view state is stored per editor group and discarded when a group closes. Use the {0} setting to use the last known view state across all editor groups in case no previous view state was found for a editor group.","`#workbench.editor.sharedViewState#`"),default:!0,scope:ut.LANGUAGE_OVERRIDABLE},"workbench.editor.sharedViewState":{type:"boolean",description:g(Ae,82,"Preserves the most recent editor view state (such as scroll position) across all editor groups and restores that if no specific editor view state is found for the editor group."),default:!1},"workbench.editor.splitInGroupLayout":{type:"string",enum:["vertical","horizontal"],default:"horizontal",markdownDescription:g(Ae,83,"Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),enumDescriptions:[g(Ae,84,"Editors are positioned from top to bottom."),g(Ae,85,"Editors are positioned from left to right.")]},"workbench.editor.centeredLayoutAutoResize":{type:"boolean",default:!0,description:g(Ae,86,"Controls if the centered layout should automatically resize to maximum width when more than one group is open. Once only one group is open it will resize back to the original centered width.")},"workbench.editor.centeredLayoutFixedWidth":{type:"boolean",default:!1,description:g(Ae,87,"Controls whether the centered layout tries to maintain constant width when the window is resized.")},"workbench.editor.doubleClickTabToToggleEditorGroupSizes":{type:"string",enum:["maximize","expand","off"],default:"expand",markdownDescription:g(Ae,88,"Controls how the editor group is resized when double clicking on a tab. This value is ignored when {0} is not set to {1}.","`#workbench.editor.showTabs#`","`multiple`"),enumDescriptions:[g(Ae,89,"All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),g(Ae,90,"The editor group takes as much space as possible by making all other editor groups as small as possible."),g(Ae,91,"No editor group is resized when double clicking on a tab.")]},"workbench.editor.limit.enabled":{type:"boolean",default:!1,description:g(Ae,92,"Controls if the number of opened editors should be limited or not. When enabled, less recently used editors will close to make space for newly opening editors.")},"workbench.editor.limit.value":{type:"number",default:10,exclusiveMinimum:0,markdownDescription:g(Ae,93,"Controls the maximum number of opened editors. Use the {0} setting to control this limit per editor group or across all groups.","`#workbench.editor.limit.perEditorGroup#`")},"workbench.editor.limit.excludeDirty":{type:"boolean",default:!1,description:g(Ae,94,"Controls if the maximum number of opened editors should exclude dirty editors for counting towards the configured limit.")},"workbench.editor.limit.perEditorGroup":{type:"boolean",default:!1,description:g(Ae,95,"Controls if the limit of maximum opened editors should apply per editor group or across all editor groups.")},"workbench.localHistory.enabled":{type:"boolean",default:!0,description:g(Ae,96,"Controls whether local file history is enabled. When enabled, the file contents of an editor that is saved will be stored to a backup location to be able to restore or review the contents later. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.maxFileSize":{type:"number",default:256,minimum:1,description:g(Ae,97,"Controls the maximum size of a file (in KB) to be considered for local file history. Files that are larger will not be added to the local file history. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.maxFileEntries":{type:"number",default:50,minimum:0,description:g(Ae,98,"Controls the maximum number of local file history entries per file. When the number of local file history entries exceeds this number for a file, the oldest entries will be discarded."),scope:ut.RESOURCE},"workbench.localHistory.exclude":{type:"object",patternProperties:{".*":{type:"boolean"}},markdownDescription:g(Ae,99,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files from the local file history. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.localHistory.mergeWindow":{type:"number",default:10,minimum:1,markdownDescription:g(Ae,100,"Configure an interval in seconds during which the last entry in local file history is replaced with the entry that is being added. This helps reduce the overall number of entries that are added, for example when auto save is enabled. This setting is only applied to entries that have the same source of origin. Changing this setting has no effect on existing local file history entries."),scope:ut.RESOURCE},"workbench.commandPalette.history":{type:"number",description:g(Ae,101,"Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history."),default:50,minimum:0},"workbench.commandPalette.preserveInput":{type:"boolean",description:g(Ae,102,"Controls whether the last typed input to the command palette should be restored when opening it the next time."),default:!1},"workbench.commandPalette.experimental.suggestCommands":{type:"boolean",tags:["experimental"],description:g(Ae,103,"Controls whether the command palette should have a list of commonly used commands."),default:!1},"workbench.commandPalette.experimental.askChatLocation":{type:"string",tags:["experimental"],description:g(Ae,104,"Controls where the command palette should ask chat questions."),default:"chatView",enum:["chatView","quickChat"],enumDescriptions:[g(Ae,105,"Ask chat questions in the Chat view."),g(Ae,106,"Ask chat questions in Quick Chat.")]},"workbench.commandPalette.experimental.enableNaturalLanguageSearch":{type:"boolean",tags:["experimental"],description:g(Ae,107,"Controls whether the command palette should include similar commands. You must have an extension installed that provides Natural Language support."),default:!0},"workbench.quickOpen.closeOnFocusLost":{type:"boolean",description:g(Ae,108,"Controls whether Quick Open should close automatically once it loses focus."),default:!0},"workbench.quickOpen.preserveInput":{type:"boolean",description:g(Ae,109,"Controls whether the last typed input to Quick Open should be restored when opening it the next time."),default:!1},"workbench.settings.openDefaultSettings":{type:"boolean",description:g(Ae,110,"Controls whether opening settings also opens an editor showing all default settings."),default:!1},"workbench.settings.useSplitJSON":{type:"boolean",markdownDescription:g(Ae,111,"Controls whether to use the split JSON editor when editing settings as JSON."),default:!1},"workbench.settings.openDefaultKeybindings":{type:"boolean",description:g(Ae,112,"Controls whether opening keybinding settings also opens an editor showing all default keybindings."),default:!1},"workbench.sideBar.location":{type:"string",enum:["left","right"],default:"left",description:g(Ae,113,"Controls the location of the primary side bar and activity bar. They can either show on the left or right of the workbench. The secondary side bar will show on the opposite side of the workbench.")},"workbench.panel.defaultLocation":{type:"string",enum:["left","bottom","right"],default:"bottom",description:g(Ae,114,"Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, right, or left of the editor area.")},"workbench.panel.opensMaximized":{type:"string",enum:["always","never","preserve"],default:"preserve",description:g(Ae,115,"Controls whether the panel opens maximized. It can either always open maximized, never open maximized, or open to the last state it was in before being closed."),enumDescriptions:[g(Ae,116,"Always maximize the panel when opening it."),g(Ae,117,"Never maximize the panel when opening it. The panel will open un-maximized."),g(Ae,118,"Open the panel to the state that it was in, before it was closed.")]},"workbench.statusBar.visible":{type:"boolean",default:!0,description:g(Ae,119,"Controls the visibility of the status bar at the bottom of the workbench.")},[u_.ACTIVITY_BAR_LOCATION]:{type:"string",enum:["default","top","bottom","hidden"],default:"default",markdownDescription:g(Ae,120,"Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),enumDescriptions:[g(Ae,121,"Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),g(Ae,122,"Show the Activity Bar on top of the Primary and Secondary Side Bars."),g(Ae,123,"Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),g(Ae,124,"Hide the Activity Bar in the Primary and Secondary Side Bars.")]},"workbench.activityBar.iconClickBehavior":{type:"string",enum:["toggle","focus"],default:"toggle",markdownDescription:g(Ae,125,"Controls the behavior of clicking an Activity Bar icon in the workbench. This value is ignored when {0} is not set to {1}.","`#workbench.activityBar.location#`","`default`"),enumDescriptions:[g(Ae,126,"Hide the Primary Side Bar if the clicked item is already visible."),g(Ae,127,"Focus the Primary Side Bar if the clicked item is already visible.")]},"workbench.view.alwaysShowHeaderActions":{type:"boolean",default:!1,description:g(Ae,128,"Controls the visibility of view header actions. View header actions may either be always visible, or only visible when that view is focused or hovered over.")},"workbench.fontAliasing":{type:"string",enum:["default","antialiased","none","auto"],default:"default",description:g(Ae,129,"Controls font aliasing method in the workbench."),enumDescriptions:[g(Ae,130,"Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),g(Ae,131,"Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),g(Ae,132,"Disables font smoothing. Text will show with jagged sharp edges."),g(Ae,133,"Applies `default` or `antialiased` automatically based on the DPI of displays.")],included:ei},"workbench.settings.editor":{type:"string",enum:["ui","json"],enumDescriptions:[g(Ae,134,"Use the settings UI editor."),g(Ae,135,"Use the JSON file editor.")],description:g(Ae,136,"Determines which settings editor to use by default."),default:"ui",scope:ut.WINDOW},"workbench.hover.delay":{type:"number",description:g(Ae,137,"Controls the delay in milliseconds after which the hover is shown for workbench items (ex. some extension provided tree view items). Already visible items may require a refresh before reflecting this setting change."),default:ei?1500:500,minimum:0},"workbench.reduceMotion":{type:"string",description:g(Ae,138,"Controls whether the workbench should render with fewer animations."),enumDescriptions:[g(Ae,139,"Always render with reduced motion."),g(Ae,140,"Do not render with reduced motion"),g(Ae,141,"Render with reduced motion based on OS configuration.")],default:"auto",tags:["accessibility"],enum:["on","off","auto"]},[u_.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Jn?g(Ae,142,"Controls whether the layout control in the title bar is shown."):g(Ae,143,"Controls whether the layout control is shown in the custom title bar. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"workbench.layoutControl.type":{type:"string",enum:["menu","toggles","both"],enumDescriptions:[g(Ae,144,"Shows a single button with a dropdown of layout options."),g(Ae,145,"Shows several buttons for toggling the visibility of the panels and side bar."),g(Ae,146,"Shows both the dropdown and toggle buttons.")],default:"both",description:g(Ae,147,"Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles.")},"workbench.tips.enabled":{type:"boolean",default:!0,description:g(Ae,148,"When enabled, will show the watermark tips when no editor is open.")}}});let e=g(Ae,149,"Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:");e+=` - `+[g(Ae,150,"`${activeEditorShort}`: the file name (e.g. myFile.txt)."),g(Ae,151,"`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),g(Ae,152,"`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)."),g(Ae,153,"`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder)."),g(Ae,154,"`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)."),g(Ae,155,"`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)."),g(Ae,156,"`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder)."),g(Ae,157,"`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)."),g(Ae,158,"`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace))."),g(Ae,159,"`${rootNameShort}`: shortened name of the workspace without suffixes (e.g. myFolder, myRemoteFolder or myWorkspace)."),g(Ae,160,"`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)."),g(Ae,161,"`${profileName}`: name of the profile in which the workspace is opened (e.g. Data Science (Profile)). Ignored if default profile is used."),g(Ae,162,"`${appName}`: e.g. VS Code."),g(Ae,163,"`${remoteName}`: e.g. SSH"),g(Ae,164,"`${dirty}`: an indicator for when the active editor has unsaved changes."),g(Ae,165,"`${focusedView}`: the name of the view that is currently focused."),g(Ae,166,"`${activeRepositoryName}`: the name of the active repository (e.g. vscode)."),g(Ae,167,"`${activeRepositoryBranchName}`: the name of the active branch in the active repository (e.g. main)."),g(Ae,168,'`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.')].join(` -- `),eY.registerConfiguration({...Het,properties:{"window.title":{type:"string",default:Tst,markdownDescription:e},"window.titleSeparator":{type:"string",default:Rst,markdownDescription:g(Ae,169,"Separator used by {0}.","`#window.title#`")},[u_.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Jn?g(Ae,170,"Show command launcher together with the window title."):g(Ae,171,"Show command launcher together with the window title. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"window.menuBarVisibility":{type:"string",enum:["classic","visible","toggle","hidden","compact"],markdownEnumDescriptions:[g(Ae,172,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(Ae,173,"Menu is always visible at the top of the window even in full screen mode."),ei?g(Ae,174,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(Ae,175,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(Ae,176,"Menu is always hidden."),Jn?g(Ae,177,"Menu is displayed as a compact button in the side bar."):g(Ae,178,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Jn?"compact":"classic",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,179,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and executing `Focus Application Menu` will show it. A setting of 'compact' will move the menu into the side bar."):g(Ae,180,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. A setting of 'compact' will move the menu into the side bar."),included:Is||jr||Jn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:ut.APPLICATION,description:g(Ae,181,"Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),included:Is||jr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:ut.APPLICATION,markdownDescription:g(Ae,182,"Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),included:Is||jr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,183,"Files will open in a new window."),g(Ae,184,"Files will open in the window with the files' folder open or the last active window."),ei?g(Ae,185,"Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder."):g(Ae,186,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,187,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option)."):g(Ae,188,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.openFoldersInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,189,"Folders will open in a new window."),g(Ae,190,"Folders will replace the last active window."),g(Ae,191,"Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu).")],default:"default",scope:ut.APPLICATION,markdownDescription:g(Ae,192,"Controls whether folders should open in a new window or replace the last active window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.confirmBeforeClose":{type:"string",enum:["always","keyboardOnly","never"],enumDescriptions:[Jn?g(Ae,193,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(Ae,194,"Always ask for confirmation."),Jn?g(Ae,195,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(Ae,196,"Only ask for confirmation if a keybinding was used."),Jn?g(Ae,197,"Never explicitly ask for confirmation unless data loss is imminent."):g(Ae,198,"Never explicitly ask for confirmation.")],default:Jn&&!UQe()?"keyboardOnly":"never",markdownDescription:Jn?g(Ae,199,"Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases."):g(Ae,200,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:ut.APPLICATION}}}),gp(Cte.ID,Cte,Sl.Eventually),eY.registerConfiguration({...lNt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(Ae,201,"Controls whether the problems are visible throughout the editor and workbench.")}}}),eY.registerConfiguration({id:"zenMode",order:9,title:g(Ae,202,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(Ae,203,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(Ae,204,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(Ae,205,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(Ae,206,"Each editor is displayed as a tab in the editor title area."),g(Ae,207,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,208,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(Ae,209,"Controls whether turning on Zen Mode also hides the status bar at the bottom of the workbench.")},"zenMode.hideActivityBar":{type:"boolean",default:!0,description:g(Ae,210,"Controls whether turning on Zen Mode also hides the activity bar either at the left or right of the workbench.")},"zenMode.hideLineNumbers":{type:"boolean",default:!0,description:g(Ae,211,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(Ae,212,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(Ae,213,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:n=>{const e=[];return n!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),n===!1&&e.push([u_.ACTIVITY_BAR_LOCATION,{value:Tne.HIDDEN}]),e}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:u_.ACTIVITY_BAR_LOCATION,migrateFn:n=>{const e=[];return n==="side"&&e.push([u_.ACTIVITY_BAR_LOCATION,{value:Tne.DEFAULT}]),e}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:n}])),e}},{key:u_.EDITOR_TABS_MODE,migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?xM.MULTIPLE:xM.SINGLE,e.push([u_.EDITOR_TABS_MODE,{value:n}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:n=>{const e=[];return n==="left"||n==="right"?e.push(["workbench.editor.tabActionLocation",{value:n}]):n==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:n=>{const e=[["zenMode.hideTabs",{value:void 0}]];return n===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let Mst=()=>!1,Nst=(n,e)=>!1;const N$t=FF.prototype.getCommandPicks;FF.prototype.getCommandPicks=async function(n){let e=await N$t.call(this,n);return Mst()||(e=e.map(t=>({...t,buttons:void 0}))),e};let hDe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(sEe)}get activeService(){const e=Lt.get(Qt).getFocusedCodeEditor();return e==null||Nst(e,e instanceof k1)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(R7)),this.standaloneQuickInputService)}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}createQuickWidget(){return this.activeService.createQuickWidget()}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};hDe=D([_(0,be)],hDe);function P$t({isKeybindingConfigurationVisible:n,shouldUseGlobalPicker:e}={}){return n!=null&&(Mst=n),e!=null&&(Nst=e),{[On.toString()]:new $i(hDe,[],!0)}}const F$t="vs/platform/files/common/io";async function O$t(n,e,t,i,s,o){let r;try{await B$t(n,e,t,i,s,o)}catch(a){r=a}finally{r&&s.errorTransformer&&(r=s.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function B$t(n,e,t,i,s,o){Bpe(o);const r=await n.open(e,{create:!1});try{Bpe(o);let a=0,c=0,l=s&&typeof s.length=="number"?s.length:void 0,d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),h=s&&typeof s.position=="number"?s.position:0,u=0;do c=await n.read(r,h,d.buffer,u,d.byteLength-u),h+=c,u+=c,a+=c,typeof l=="number"&&(l-=c),u===d.byteLength&&(await t.write(i(d)),d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&Bpe(o)&&W$t(a,s));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw qL(a)}finally{await n.close(r)}}function Bpe(n){if(n.isCancellationRequested)throw rx();return!0}function W$t(n,e){if(typeof e?.limits?.size=="number"&&n>e.limits.size)throw xs(g(F$t,0,"File is too large to open"),rt.FileTooLarge);return!0}var uDe;const sc="vs/platform/files/common/fileService";function Pst(n){return n.scheme===_e.file?n.fsPath:n.toString(!0)}async function Fst(n,e,t){const i=[];for(;!n.isEqual(t,n.dirname(t));)try{if(!((await e.stat(t)).type&an.Directory))throw new Error(g(sc,0,"Unable to create folder '{0}' that already exists but is not a directory",Pst(t)));break}catch(s){if(w1(s)!==rt.FileNotFound)throw s;i.push(n.basename(t)),t=n.dirname(t)}for(let s=i.length-1;s>=0;s--){t=n.joinPath(t,i[s]);try{await e.mkdir(t)}catch(o){if(w1(o)!==rt.FileExists)throw o}}}var xP;let gDe=(xP=class extends ${constructor(e){super(),this.logService=e,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new I),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new I),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new I),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new I),this.onDidRunOperation=this._onDidRunOperation.event,this.internalOnDidFilesChange=this._register(new I),this._onDidUncorrelatedFilesChange=this._register(new I),this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event,this._onDidWatchError=this._register(new I),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new sMe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);vs(`code/registerFilesystem/${e}`);const i=new Z;return this.provider.set(e,t),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:t}),i.add(t.onDidChangeFile(s=>{const o=new mee(s,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(s=>this._onDidWatchError.fire(new Error(s)))),i.add(t.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:t,scheme:e}))),Ee(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:t}),this.provider.delete(e),St(i)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){const t=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(i){t.push(i)}}),!this.provider.has(e)&&await ko.settled(t)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,t){const i=this.provider.get(e.scheme);return!!(i&&i.capabilities&t)}listCapabilities(){return fi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!KQe(e))throw new Ah(g(sc,1,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Xi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new hc;throw i.message=g(sc,2,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t)||dJ(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,t){try{return await this.doResolveFile(e,t)}catch(i){throw w1(i)===rt.FileNotFound?new Ah(g(sc,3,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Xi.FILE_NOT_FOUND):qL(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),s=this.isPathCaseSensitive(i),o=t?.resolveTo,r=t?.resolveSingleChildDescendants,a=t?.resolveMetadata,c=await i.stat(e);let l;return this.toFileStat(i,e,c,void 0,!!a,(d,h)=>(l||(l=Su.forUris(()=>!s),l.set(e,!0),o&&l.fill(!0,o)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&r?h===1:!1))}async toFileStat(e,t,i,s,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&an.File)!==0,isDirectory:(i.type&an.Directory)!==0,isSymbolicLink:(i.type&an.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&vm.Readonly)||!!(e.capabilities&es.Readonly),locked:!!((i.permissions??0)&vm.Locked),etag:_ee({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,s)){try{const l=await e.readdir(t),d=await ko.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=o?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,o,r)}catch(f){return this.logService.trace(f),null}}));c.children=Ui(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return ko.settled(e.map(async t=>{try{return{stat:await this.doResolveFile(t.resource,t.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(e){const t=await this.withProvider(e),i=await t.stat(e);return this.toFileStat(t,e,i,void 0,!0,()=>!1)}async exists(e){const t=await this.withProvider(e);try{return!!await t.stat(e)}catch{return!1}}async canCreateFile(e,t){try{await this.doValidateCreateFile(e,t)}catch(i){return i}return!0}async doValidateCreateFile(e,t){if(!t?.overwrite&&await this.exists(e))throw new Ah(g(sc,4,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Xi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=ze.fromString(""),i){await this.doValidateCreateFile(e,i);const s=await this.writeFile(e,t);return this._onDidRunOperation.fire(new qO(e,Li.CREATE,s)),s}async writeFile(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(s);let r=i;if(KHe(s)&&!r?.atomic){const a=s.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(s,e,r)||await this.mkdirp(s,o.dirname(e));let c;if(sv(s)&&!(t instanceof ze))if(KY(t)){const l=await Kgt(t,3);l.ended?c=ze.concat(l.buffer):c=l}else c=jgt(t,l=>ze.concat(l),3);else c=t;!mD(s)||sv(s)&&c instanceof ze||sv(s)&&KHe(s)&&r?.atomic?await this.doWriteUnbuffered(s,e,r,c):await this.doWriteBuffered(s,e,r,c instanceof ze?Ije(c):c),this._onDidRunOperation.fire(new qO(e,Li.WRITE))}catch(a){throw new Ah(g(sc,5,"Unable to write file '{0}' ({1})",this.resourceForError(e),qL(a).toString()),Cy(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const s=!!i?.unlock;if(s&&!(e.capabilities&es.FileWriteUnlock))throw new Error(g(sc,6,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&es.FileAtomicWrite))throw new Error(g(sc,7,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&es.FileReadWrite))throw new Error(g(sc,8,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(s)throw new Error(g(sc,9,"Unable to unlock file '{0}' because atomic write is enabled.",this.resourceForError(t)))}let r;try{r=await e.stat(t)}catch{return}if(r.type&an.Directory)throw new Ah(g(sc,10,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Xi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==zv&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,s);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,s){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},s);return{...o,value:await II(o.value)}}async readFileStream(e,t,i){const s=await this.withReadProvider(e);return this.doReadFileStream(s,e,t,i)}async doReadFileStream(e,t,i,s){const o=new ai(s);let r=i;Tfe(e)&&e.enforceAtomicReadFile?.(t)&&(r={...i,atomic:!0});const a=this.validateReadFile(t,r).then(l=>l,l=>{throw o.dispose(!0),l});let c;try{return typeof r?.etag=="string"&&r.etag!==zv&&await a,r?.atomic&&Tfe(e)||!(mD(e)||dJ(e))||sv(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):dJ(e)?c=this.readFileStreamed(e,t,o.token,r):c=this.readFileBuffered(e,t,o.token,r),c.on("end",()=>o.dispose()),c.on("error",()=>o.dispose()),{...await a,value:c}}catch(l){throw c&&await gMe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const s=g(sc,12,"Unable to read file '{0}' ({1})",this.resourceForError(t),qL(e).toString());return e instanceof P$?new P$(s,e.stat,i):e instanceof hJ?new hJ(s,e.fileOperationResult,e.size,e.options):new Ah(s,Cy(e),i)}readFileStreamed(e,t,i,s=Object.create(null)){const o=e.readFileStream(t,s,i);return Xgt(o,{data:r=>r instanceof ze?r:ze.wrap(r),error:r=>this.restoreReadError(r,t,s)},r=>ze.concat(r))}readFileBuffered(e,t,i,s=Object.create(null)){const o=Lje();return O$t(e,t,o,r=>r,{...s,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,s)},i),o}readFileUnbuffered(e,t,i){const s=Xx(o=>ze.concat(o));return(async()=>{try{let o;i?.atomic&&Tfe(e)?o=await e.readFile(t,{atomic:!0}):o=await e.readFile(t),typeof i?.position=="number"&&(o=o.slice(i.position)),typeof i?.length=="number"&&(o=o.slice(0,i.length)),this.validateReadFileLimits(t,o.byteLength,i),s.end(ze.wrap(o))}catch(o){s.error(o),s.end()}})(),s}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Ah(g(sc,13,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Xi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==zv&&t.etag===i.etag)throw new P$(g(sc,14,"File not modified since"),i,t);return this.validateReadFileLimits(e,i.size,t),i}validateReadFileLimits(e,t,i){if(typeof i?.limits?.size=="number"&&t>i.limits.size)throw new hJ(g(sc,15,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Xi.FILE_TOO_LARGE,t,i)}async canMove(e,t,i){return this.doCanMoveCopy(e,t,"move",i)}async canCopy(e,t,i){return this.doCanMoveCopy(e,t,"copy",i)}async doCanMoveCopy(e,t,i,s){if(e.toString()!==t.toString())try{const o=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(o,e,r,t,i,s)}catch(o){return o}return!0}async move(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="move"?Li.MOVE:Li.COPY,a)),a}async copy(e,t,i){const s=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="copy"?Li.COPY:Li.MOVE,a)),a}async doMoveCopy(e,t,i,s,o,r){if(t.toString()===s.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,s,o,r);if(a&&!c&&r&&await this.del(s,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(s)),o==="copy"){if(e===i&&jHe(e))await e.copy(t,s,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,s):await this.doCopyFile(e,t,i,s)}return o}else return e===i?(await e.rename(t,s,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,s,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,s){if(mD(e)&&mD(i))return this.doPipeBuffered(e,t,i,s);if(mD(e)&&sv(i))return this.doPipeBufferedToUnbuffered(e,t,i,s);if(sv(e)&&mD(i))return this.doPipeUnbufferedToBuffered(e,t,i,s);if(sv(e)&&sv(i))return this.doPipeUnbuffered(e,t,i,s)}async doCopyFolder(e,t,i,s){await i.mkdir(s),Array.isArray(t.children)&&await ko.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(s,o.name);return o.isDirectory?this.doCopyFolder(e,await this.resolve(o.resource),i,r):this.doCopyFile(e,o.resource,i,r)}))}async doValidateMoveCopy(e,t,i,s,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,s)),a&&o==="copy")throw new Error(g(sc,16,"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",this.resourceForError(t),this.resourceForError(s)));if(!a&&l.isEqualOrParent(s,t))throw new Error(g(sc,17,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(s)))}const c=await this.exists(s);if(c&&!a){if(!r)throw new Ah(g(sc,18,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(s)),Xi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,s))throw new Error(g(sc,19,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(s)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?Fn:Gle,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&es.PathCaseSensitive)}async createFolder(e){const t=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(t,e);const i=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,Li.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return Fst(i,e,t)}async canDelete(e,t){try{await this.doValidateDelete(e,t)}catch(i){return i}return!0}async doValidateDelete(e,t){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),s=!!t?.useTrash;if(s&&!(i.capabilities&es.Trash))throw new Error(g(sc,20,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&es.FileAtomicDelete))throw new Error(g(sc,21,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(s&&o)throw new Error(g(sc,22,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let r;try{r=await i.stat(e)}catch{}if(r)this.throwIfFileIsReadonly(e,r);else throw new Ah(g(sc,23,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Xi.FILE_NOT_FOUND);if(!!!t?.recursive){const c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(g(sc,24,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let s=t;if($Et(i)&&!s?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(s={...t,atomic:c})}const o=!!s?.useTrash,r=!!s?.recursive,a=s?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new qO(e,Li.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===s&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===s&&zEt(i)?i.cloneFile(e,t):(await this.mkdirp(s,this.getExtUri(s).providerExtUri.dirname(t)),i===s&&jHe(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,s,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:uDe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let s=!1,o=()=>{s=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);s?St(a):o=()=>St(a)}catch(a){this.logService.error(a)}})();const r=t.correlationId;if(typeof r=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(r)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),s=Ed([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(s);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(s,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(St(o.disposable),this.activeWatchers.delete(s)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)St(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,s){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{KY(s)||Oge(s)?await this.doWriteStreamBufferedQueued(e,o,s):await this.doWriteReadableBufferedQueued(e,o,s)}catch(r){throw qL(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let s=0,o;if(Oge(i)){if(i.buffer.length>0){const r=ze.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,s,0),s+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{hO(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,s,0)}catch(l){return a(l)}s+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let s=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,s,0),s+=o.byteLength}async doWriteBuffer(e,t,i,s,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,s),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,s){let o;s instanceof ze?o=s:KY(s)?o=await II(s):Oge(s)?o=await rft(s):o=oft(s),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,s){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(s,{create:!0,unlock:!1});const a=ze.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(o,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,r,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw qL(a)}finally{await ko.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,s){return i.writeFile(s,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,s){const o=await i.open(s,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,ze.wrap(r),r.byteLength,0,0)}catch(r){throw qL(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,s){const o=await II(this.readFileBuffered(e,t,qe.None));await this.doWriteUnbuffered(i,s,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&es.Readonly)throw new Ah(g(sc,25,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Xi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&vm.Readonly)throw new Ah(g(sc,25,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Xi.FILE_PERMISSION_DENIED)}resourceForError(e){return Pst(e)}},uDe=xP,xP.WATCHER_CORRELATION_IDS=0,xP);gDe=uDe=D([_(0,Ze)],gDe);class F3e{constructor(e){this.type=an.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class N5{constructor(e){this.type=an.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class Mne extends ${constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=es.FileReadWrite|es.PathCaseSensitive,this.root=new N5(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&es.Readonly);e!==t&&(this._capabilities=e?es.Readonly|es.PathCaseSensitive|es.FileReadWrite:es.FileReadWrite|es.PathCaseSensitive,this._onDidChangeCapabilities.fire())}async stat(e){return this._lookup(e,!1)}async readdir(e){const t=this._lookupAsDirectory(e,!1),i=[];return t.entries.forEach((s,o)=>i.push([o,s.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw xs("file not found",rt.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=Xx(s=>ze.concat(s.map(o=>ze.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const s=ui(e),o=this._lookupParentDirectory(e);let r=o.entries.get(s);if(r instanceof N5)throw xs("file is directory",rt.FileIsADirectory);if(!r&&!i.create)throw xs("file not found",rt.FileNotFound);if(r&&i.create&&!i.overwrite)throw xs("file exists already",rt.FileExists);r||(r=new F3e(s),o.entries.set(s,r),this._fireSoon({type:Ko.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:Ko.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const s=this.memoryFdCounter++;return this.fdMemory.set(s,i),Promise.resolve(s)}throw xs("file not found",rt.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),Promise.resolve(a.byteLength)}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw xs("file exists already",rt.FileExists);const s=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=ui(t);o.entries.delete(s.name),s.name=a,r.entries.set(a,s),this._fireSoon({type:Ko.DELETED,resource:e},{type:Ko.ADDED,resource:t})}async delete(e,t){const i=ma(e),s=ui(e),o=this._lookupAsDirectory(i,!1);o.entries.has(s)&&(o.entries.delete(s),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:Ko.UPDATED,resource:i},{resource:e,type:Ko.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new N5(t);s.entries.set(o.name,o),s.mtime=Date.now(),s.size+=1,this._fireSoon({type:Ko.UPDATED,resource:i},{type:Ko.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let s=this.root;for(const o of i){if(!o)continue;let r;if(s instanceof N5&&(r=s.entries.get(o)),!r){if(t)return;throw xs("file not found",rt.FileNotFound)}s=r}return s}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof N5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof F3e)return i;throw xs("file is a directory",rt.FileIsADirectory)}_lookupParentDirectory(e){const t=ma(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return $.None}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}dispose(){super.dispose(),this.fdMemory.clear()}}class O3e extends Error{constructor(e){super("Missing stores"),this.db=e}}class fDe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class PT{static async create(e,t,i){const s=await PT.openDatabase(e,t,i);return new PT(s,e)}static async openDatabase(e,t,i){vs(`code/willOpenDatabase/${e}`);try{return await PT.doOpenDatabase(e,t,i)}catch(s){if(s instanceof O3e){console.info("Attempting to recreate the IndexedDB once.",e);try{await PT.deleteDatabase(s.db)}catch(o){throw console.error("Error while deleting the IndexedDB",lg(o)),o}return await PT.doOpenDatabase(e,t,i)}throw s}finally{vs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((s,o)=>{const r=indexedDB.open(e,t);r.onerror=()=>o(r.error),r.onsuccess=()=>{const a=r.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),o(new O3e(a));return}s(a)},r.onupgradeneeded=()=>{const a=r.result;for(const c of i)a.objectStoreNames.contains(c)||a.createObjectStore(c)}})}static deleteDatabase(e){return new Promise((t,i)=>{e.close();const s=indexedDB.deleteDatabase(e.name);s.onerror=o=>i(s.error),s.onsuccess=()=>t()})}constructor(e,t){this.name=t,this.database=null,this.pendingTransactions=[],this.database=e}hasPendingTransactions(){return this.pendingTransactions.length>0}close(){this.pendingTransactions.length&&this.pendingTransactions.splice(0,this.pendingTransactions.length).forEach(e=>e.abort()),this.database?.close(),this.database=null}async runInTransaction(e,t,i){if(!this.database)throw new fDe(this.name);const s=this.database.transaction(e,t);return this.pendingTransactions.push(s),new Promise((o,r)=>{s.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},s.onerror=()=>r(s.error?hc.fromError(s.error):new hc("unknown error")),s.onabort=()=>r(s.error?hc.fromError(s.error):new hc("unknown error"));const a=i(s.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(s),1))}async getKeyValues(e,t){if(!this.database)throw new fDe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(s=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return s(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):s(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Ma(l,!0)}`),s(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Qz="vs/platform/files/browser/indexedDBFileSystemProvider",Wpe=xs(g(Qz,0,"File does not exist"),rt.FileNotFound),H$t=xs(g(Qz,1,"File is Directory"),rt.FileIsADirectory),B3e=xs(g(Qz,2,"File is not a directory"),rt.FileNotADirectory),U$t=xs(g(Qz,3,"Directory is not empty"),rt.Unknown),V$t=xs(g(Qz,4,"File exceeds available storage quota"),rt.FileExceedsStorageQuota),jw=n=>xs(g(Qz,5,"Internal error occurred in IndexedDB File System Provider. ({0})",n),rt.Unknown);class d8{constructor(e){this.entry=e,this.type=e.type}read(e){return this.doRead(e.split("/").filter(t=>t.length))}doRead(e){if(e.length===0)return this.entry;if(this.entry.type!==an.Directory)throw jw("Internal error reading from IndexedDBFSNode -- expected directory at "+this.entry.path);const t=this.entry.children.get(e[0]);if(t)return t.doRead(e.slice(1))}delete(e){const t=e.split("/").filter(i=>i.length);if(t.length===0){if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode. Expected root entry to be directory");this.entry.children.clear()}else return this.doDelete(t,e)}doDelete(e,t){if(e.length===0)throw jw(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode -- expected directory at "+this.entry.path);if(e.length===1)this.entry.children.delete(e[0]);else{const i=this.entry.children.get(e[0]);if(!i)throw jw("Internal error deleting from IndexedDBFSNode -- expected entry at "+this.entry.path+"/"+i);i.doDelete(e.slice(1),t)}}add(e,t){this.doAdd(e.split("/").filter(i=>i.length),t,e)}doAdd(e,t,i){if(e.length===0)throw jw(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const s=e[0],o=this.entry.children.get(s);if(t.type==="dir"){if(o?.entry.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,o??new d8({type:an.Directory,path:this.entry.path+"/"+s,children:new Map}))}else{if(o?.entry.type===an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,new d8({type:an.File,path:this.entry.path+"/"+s,size:t.size}))}}else if(e.length>1){const s=e[0];let o=this.entry.children.get(s);if(!o)o=new d8({children:new Map,path:this.entry.path+"/"+s,type:an.Directory}),this.entry.children.set(s,o);else if(o.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===an.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class z$t extends ${constructor(e,t,i,s){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=es.FileReadWrite|es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.extUri=new cO(()=>!1),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._onReportError=this._register(new I),this.onReportError=this._onReportError.event,this.mtimes=new Map,this.fileWriteBatch=[],this.writeManyThrottler=new tQ,s&&(this.changesBroadcastChannel=this._register(new iOe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:P.revive(r.resource)})))})))}watch(e,t){return $.None}async mkdir(e){try{if((await this.stat(e)).type===an.File)throw B3e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===an.File)return{type:an.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===an.Directory)return{type:an.Directory,ctime:0,mtime:0,size:0};throw Wpe}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==an.Directory)throw B3e;return[...t.children.entries()].map(([i,s])=>[i,s.type])}catch(t){throw this.reportError("readDir",t),t}}async readFile(e){try{const t=await this.indexedDB.runInTransaction(this.store,"readonly",o=>o.get(e.path));if(t===void 0)throw Wpe;const i=t instanceof Uint8Array?t:zt(t)?ze.fromString(t).buffer:void 0;if(i===void 0)throw jw(`IndexedDB entry at "${e.path}" in unexpected format`);return(await this.getFiletree()).add(e.path,{type:"file",size:i.byteLength}),i}catch(t){throw this.reportError("readFile",t),t}}async writeFile(e,t,i){try{if((await this.stat(e).catch(()=>{}))?.type===an.Directory)throw H$t;await this.bulkWrite([[e,t]])}catch(s){throw this.reportError("writeFile",s),s}}async rename(e,t,i){const s=await this.getFiletree(),o=s.read(e.path);if(!o)throw Wpe;const r=s.read(t.path);if(r){if(!i.overwrite)throw xs("file exists already",rt.FileExists);if(r.type!==o.type)throw xs("Cannot rename files with different types",rt.Unknown);await this.delete(t,{recursive:!0,useTrash:!1,atomic:!1})}const a=d=>this.extUri.joinPath(t,this.extUri.relativePath(e,e.with({path:d}))||""),c=await this.tree(e),l=[];for(const d of c)d[1]===an.File?l.push(d):d[1]===an.Directory&&s.add(a(d[0]).path,{type:"dir"});if(l.length){const d=[],h=await this.indexedDB.runInTransaction(this.store,"readonly",u=>l.map(([f])=>u.get(f)));for(let u=0;ur);else{if(i.type===an.Directory&&(await this.readdir(e)).length)throw U$t;s=[e.path]}await this.deleteKeys(s),(await this.getFiletree()).delete(e.path),s.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(s.map(o=>({resource:e.with({path:o}),type:Ko.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===an.Directory){const s=await this.readdir(e);for(const[o,r]of s){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===an.Directory){const c=await this.tree(a);i.push(...c)}}}return i}triggerChanges(e){e.length&&(this._onDidChangeFile.fire(e),this.changesBroadcastChannel?.postData(e))}getFiletree(){return this.cachedFiletree||(this.cachedFiletree=(async()=>{const e=new d8({children:new Map,path:"",type:an.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",s=>s.getAllKeys())).map(s=>s.toString()).forEach(s=>e.add(s,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,s])=>this.fileWriteBatch.push({content:s,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,s]of e)t.add(i.path,{type:"file",size:s.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:Ko.UPDATED})))}async writeMany(){if(this.fileWriteBatch.length){const e=this.fileWriteBatch.splice(0,this.fileWriteBatch.length);try{await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.put(i.content,i.resource.path)))}catch(t){throw t instanceof DOMException&&t.name==="QuotaExceededError"?V$t:t}}}async deleteKeys(e){e.length&&await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.delete(i)))}async reset(){await this.indexedDB.runInTransaction(this.store,"readwrite",e=>e.clear())}reportError(e,t){this._onReportError.fire({scheme:this.scheme,operation:e,code:t instanceof Nx||t instanceof fDe?t.code:"unknown"})}}class $$t extends ude{constructor(e=dNe){super(),this.buffer=[],this._logger=void 0,this.setLevel(e),this._register(this.onDidChangeLogLevel(t=>{this._logger?.setLevel(t)}))}set logger(e){this._logger=e;for(const{level:t,message:i}of this.buffer)see(e,t,i);this.buffer=[]}log(e,t){this._logger?see(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}var JS;(function(n){n[n.None=0]="None",n[n.Untitled=2]="Untitled",n[n.Scratchpad=4]="Scratchpad"})(JS||(JS={}));const oOe="",G$t="modulepreload",q$t=function(n,e){return new URL(n,e).href},W3e={},Uhe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=r?.nonce||r?.getAttribute("nonce");s=Promise.allSettled(t.map(c=>{if(c=q$t(c,i),c in W3e)return;W3e[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(!!i)for(let f=o.length-1;f>=0;f--){const p=o[f];if(p.href===c&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":G$t,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((f,p)=>{u.addEventListener("load",f),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}return s.then(o=>{for(const r of o||[]){if(r.status!=="rejected")continue;const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r.reason,window.dispatchEvent(a),!a.defaultPrevented)throw r.reason}return e()})},Rh="utf8",dE="utf8bom",OF="utf16be",BF="utf16le",_X=[254,255],pDe=[255,254],B3=[239,187,191],Q$t=512,j$t=512,K$t=512*8,Y$t=512*128;var Nne;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(Nne||(Nne={}));class J$t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class rOe{static async create(e){let t;if(e!==Rh)t=(await Uhe(()=>import("./iconv-lite-umd-CrNoX83z.js").then(s=>s.i),[],import.meta.url).then(s=>s.default??s)).getDecoder(aOe(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new rOe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function X$t(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?K$t:j$t;return new Promise((i,s)=>{const o=Xx(h=>h.join("")),r=[];let a=0,c;const l=new ai,d=async()=>{try{const h=await a8t({buffer:ze.concat(r),bytesRead:a},e.guessEncoding);if(h.seemsBinary&&e.acceptTextOnly)throw new J$t("Stream is binary but only text is accepted for decoding",Nne.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await rOe.create(h.encoding);const u=c.write(ze.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),s(h)}};hO(n,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(n.pause(),await d(),setTimeout(()=>n.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function Z$t(n,e,t){const s=(await Uhe(()=>import("./iconv-lite-umd-CrNoX83z.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(aOe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=n.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Rh:case dE:return ze.wrap(Uint8Array.from(B3));case OF:return ze.wrap(Uint8Array.from(_X));case BF:return ze.wrap(Uint8Array.from(pDe))}const c=s.end();return c&&c.length>0?(o=!0,ze.wrap(c)):null}return o=!0,ze.wrap(s.write(a))}}}async function e8t(n){return(await Uhe(()=>import("./iconv-lite-umd-CrNoX83z.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(aOe(n))}function aOe(n){return n===dE||n===null?Rh:n}function t8t(n,e){if(!n||e<_X.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===_X[0]&&i===_X[1])return OF;if(t===pDe[0]&&i===pDe[1])return BF;if(eimport("./index-BYRp-nkN.js").then(r=>r.i),[],import.meta.url).then(r=>r.default??r),t=n.slice(0,Y$t),i=r8t(t.buffer),s=e.detect(i);if(!s||!s.encoding)return null;const o=s.encoding.toLowerCase();return 0<=i8t.indexOf(o)?null:o8t(s.encoding)}const s8t={ibm866:"cp866",big5:"cp950"};function o8t(n){const e=n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return s8t[e]||e}function r8t(n){let e="";for(let t=0;t({seemsBinary:!1,encoding:o})):{seemsBinary:s,encoding:i}}const P5={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:23},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:24},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:25},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:29},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:30},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:31},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:32},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:33},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:34},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:35},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:36},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:41},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:42},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:43},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:44},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:45},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}};var sT,ix;let mDe=(ix=class extends H1{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(a,r,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=s,this.preferredEncoding=o,this.workingCopyBackupService=c,this.textResourceConfigurationService=l,this.workingCopyService=d,this.textFileService=h,this.labelService=u,this.editorService=f,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeName=this._register(new I),this.onDidChangeName=this._onDidChangeName.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this.typeId=oOe,this.capabilities=JS.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),s&&this.setLanguageId(s),this.onConfigurationChange(void 0,!1),this.registerListeners()}registerListeners(){this._register(this.textResourceConfigurationService.onDidChangeConfiguration(e=>this.onConfigurationChange(e,!0)))}onConfigurationChange(e,t){if(!e||e.affectsConfiguration(this.resource,"files.encoding")){const i=this.textResourceConfigurationService.getValue(this.resource,"files.encoding");this.configuredEncoding!==i&&typeof i=="string"&&(this.configuredEncoding=i,t&&!this.preferredEncoding&&this._onDidChangeEncoding.fire())}if(!e||e.affectsConfiguration(this.resource,"workbench.editor.untitled.labelFormat")){const i=this.textResourceConfigurationService.getValue(this.resource,"workbench.editor.untitled.labelFormat");this.configuredLabelFormat!==i&&(i==="content"||i==="name")&&(this.configuredLabelFormat=i,t&&this._onDidChangeName.fire())}}setLanguageId(e,t){const i=e===sT.ACTIVE_EDITOR_LANGUAGE_ID?this.editorService.activeTextEditorLanguageId:e;this.preferredLanguageId=i,i&&super.setLanguageId(i,t)}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}getEncoding(){return this.preferredEncoding||this.configuredEncoding}async setEncoding(e){const t=this.getEncoding();this.preferredEncoding=e,t!==this.preferredEncoding&&this._onDidChangeEncoding.fire()}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){this.dirty!==e&&(this.dirty=e,this._onDidChangeDirty.fire())}async save(e){const t=await this.textFileService.save(this.resource,e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),!!t}async revert(){this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(hde(""))}finally{this.ignoreDirtyOnModelContentChange=!1}this.setDirty(!1),this._onDidRevert.fire()}async backup(e){let t;return this.isResolved()?t=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh}):typeof this.initialValue=="string"&&(t=Ije(ze.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let s;const o=await this.workingCopyBackupService.resolve(this);o?(s=o.value,t=!0):s=aQ(ze.fromString(this.initialValue||""));const r=await eNe(await this.textFileService.getDecodedStream(this.resource,s,{encoding:Rh}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=ws(this.textEditorModel);return this.installModelListeners(i),e&&((t||this.initialValue)&&this.updateNameFromFirstLine(i),this.setDirty(this.hasAssociatedFilePath||!!t||!!this.initialValue),(t||this.initialValue)&&this._onDidChangeContent.fire()),super.resolve()}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t))),this._register(e.onDidChangeLanguage(()=>this.onConfigurationChange(void 0,!0))),super.installModelListeners(e)}onModelContentChanged(e,t){this.ignoreDirtyOnModelContentChange||(!this.hasAssociatedFilePath&&e.getLineCount()===1&&e.getLineLength(1)===0?this.setDirty(!1):this.setDirty(!0)),t.changes.some(i=>(i.range.startLineNumber===1||i.range.endLineNumber===1)&&i.range.startColumn<=sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH)&&this.updateNameFromFirstLine(e),this._onDidChangeContent.fire(),this.autoDetectLanguage()}updateNameFromFirstLine(e){if(this.hasAssociatedFilePath)return;let t,i=e.getValueInRange({startLineNumber:1,endLineNumber:1,startColumn:1,endColumn:sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,bQe(i,sT.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&zq().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},sT=ix,ix.FIRST_LINE_NAME_MAX_LENGTH=40,ix.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=sT.FIRST_LINE_NAME_MAX_LENGTH*10,ix.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ix);mDe=sT=D([_(5,Di),_(6,Ai),_(7,MQ),_(8,dl),_(9,Pw),_(10,tr),_(11,eo),_(12,_i),_(13,LQ),_(14,Ur)],mDe);var W3;const c8t="vs/workbench/services/textfile/common/textFileEditorModel";var j0;let _De=(j0=class extends H1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(o,s,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=r,this.textFileService=a,this.workingCopyBackupService=c,this.logService=l,this.workingCopyService=d,this.filesConfigurationService=h,this.labelService=u,this.pathService=m,this.extensionService=v,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.typeId=oOe,this.capabilities=JS.None,this.name=yr(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!Fn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.dirty=!1,this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,this.hasEncodingSetExplicitly=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.filesConfigurationService.onDidChangeFilesAssociation(()=>this.onDidChangeFilesAssociation())),this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}async onDidFilesChange(e){let t=!1,i;if(this.inOrphanMode?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.inOrphanMode!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.inOrphanMode!==e&&(this.inOrphanMode=e,this._onDidChangeOrphaned.fire())}onDidChangeFilesAssociation(){if(!this.isResolved())return;const e=this.getFirstLineText(this.textEditorModel),t=this.getOrCreateLanguage(this.resource,this.languageService,this.preferredLanguageId,e);this.textEditorModel.setLanguage(t)}setLanguageId(e,t){super.setLanguageId(e,t),this.preferredLanguageId=e}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.inOrphanMode});const i=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh});return{meta:t,content:i}}async revert(e){if(!this.isResolved())return;const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Xi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),vs("code/willResolveTextFileEditorModel"),this.isDisposed()){this.trace("resolve() - exit - without resolving because model is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because model is dirty or being saved");return}await this.doResolve(e),vs("code/didResolveTextFileEditorModel")}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents,e);if(!(!this.isResolved()&&await this.resolveFromBackup(e)))return this.resolveFromFile(e)}async resolveFromBuffer(e,t){this.trace("resolveFromBuffer()");let i,s,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,s=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),s=Date.now(),o=0,r=zv,this.setOrphaned(c.fileOperationResult===Xi.FILE_NOT_FOUND)}const a=await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding);this.resolveFromContent({resource:this.resource,name:this.name,mtime:i,ctime:s,size:o,etag:r,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Rh;return t&&(i=(await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding)).encoding),!this.isResolved()?t?(await this.doResolveFromBackup(t,i,e),!0):!1:(this.trace("resolveFromBackup() - exit - without resolving because previously new model got created meanwhile"),!0)}async doResolveFromBackup(e,t,i){this.trace("doResolveFromBackup()"),this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:await eNe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Rh})),encoding:t,readonly:!1,locked:!1},!0,i),e.meta?.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile,i=this.isResolved()||e?.allowBinary;let s;t?s=zv:this.lastResolvedFileStat&&(s=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:s,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),o!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(r,!1,e)}catch(r){const a=r.fileOperationResult;if(this.setOrphaned(a===Xi.FILE_NOT_FOUND),this.isResolved()&&a===Xi.FILE_NOT_MODIFIED_SINCE){r instanceof P$&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Xi.FILE_NOT_FOUND&&!t)return;throw r}}resolveFromContent(e,t,i){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because model is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0});const s=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):s!==this.contentEncoding&&this._onDidChangeEncoding.fire(),this.textEditorModel?this.doUpdateTextModel(e.value):this.doCreateTextModel(e.resource,e.value),this.setDirty(!!t),this._onDidResolve.fire(i?.reason??Zte.OTHER)}doCreateTextModel(e,t){this.trace("doCreateTextModel()");const i=this.createTextEditorModel(t,e,this.preferredLanguageId);this.installModelListeners(i),this.autoDetectLanguage()}doUpdateTextModel(e){this.trace("doUpdateTextModel()"),this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(e,this.preferredLanguageId)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onDidChangeLanguage(()=>this.onMaybeShouldChangeEncoding())),super.installModelListeners(e)}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastModelContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.getAlternativeVersionId()===this.bufferSavedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire(),this.autoDetectLanguage()}async autoDetectLanguage(){await this.extensionService?.whenInstalledExtensionsRegistered();const e=this.getLanguageId();if(this.resource.scheme===this.pathService.defaultUriScheme&&(!e||e===Kc)&&!this.resourceHasExtension)return super.autoDetectLanguage()}async forceResolveFromFile(){this.isDisposed()||await this.textFileService.files.resolve(this.resource,{reload:{async:!1},forceReadFromFile:!0})}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.bufferSavedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.updateSavedVersionId()),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.bufferSavedVersionId=o}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(uu.CONFLICT)||this.hasState(uu.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for model that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(uu.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.textEditorModel.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastModelContentChangeFromUndoRedo;r{try{const r=await this.textFileService.write(s.resource,o.createSnapshot(),{mtime:s.mtime,encoding:this.getEncoding(),etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource,o.getLanguageId())?zv:s.etag,unlock:e.writeUnlock,writeElevated:e.writeElevated});this.handleSaveSuccess(r,t,e)}catch(r){this.handleSaveError(r,t,e)}})())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[text file model] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString()]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Xi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.textFileService.files.saveErrorHandler.onSaveError(e,this,i),this._onDidSaveError.fire()}updateSavedVersionId(){this.isResolved()&&(this.bufferSavedVersionId=this.textEditorModel.getAlternativeVersionId())}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}hasState(e){switch(e){case uu.CONFLICT:return this.inConflictMode;case uu.DIRTY:return this.dirty;case uu.ERROR:return this.inErrorMode;case uu.ORPHAN:return this.inOrphanMode;case uu.PENDING_SAVE:return this.saveSequentializer.isRunning();case uu.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}async onMaybeShouldChangeEncoding(){if(this.hasEncodingSetExplicitly){this.trace("onMaybeShouldChangeEncoding() - ignoring because encoding was set explicitly");return}if(this.contentEncoding===dE||this.contentEncoding===OF||this.contentEncoding===BF){this.trace("onMaybeShouldChangeEncoding() - ignoring because content encoding has a BOM");return}const{encoding:e}=await this.textFileService.encoding.getPreferredReadEncoding(this.resource);if(typeof e!="string"||!this.isNewEncoding(e)){this.trace(`onMaybeShouldChangeEncoding() - ignoring because preferred encoding ${e} is not new`);return}if(this.isDirty()){this.trace("onMaybeShouldChangeEncoding() - ignoring because model is dirty");return}return this.logService.info(`Adjusting encoding based on configured language override to '${e}' for ${this.resource.toString(!0)}.`),this.setEncodingInternal(e,Z7.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Z7.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:W3.TEXTFILE_SAVE_ENCODING_SOURCE});else{if(!this.isNewEncoding(e))return;this.isDirty()&&!this.inConflictMode&&await this.save(),this.updatePreferredEncoding(e),await this.forceResolveFromFile()}}updatePreferredEncoding(e){this.isNewEncoding(e)&&(this.preferredEncoding=e,this._onDidChangeEncoding.fire())}isNewEncoding(e){return!(this.preferredEncoding===e||!this.preferredEncoding&&this.contentEncoding===e)}getEncoding(){return this.preferredEncoding||this.contentEncoding}trace(e){this.logService.trace(`[text file model] ${e}`,this.resource.toString())}isResolved(){return!!this.textEditorModel}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,super.dispose()}},W3=j0,j0.TEXTFILE_SAVE_ENCODING_SOURCE=ote.registerSource("textFileEncoding.source",g(c8t,0,"File Encoding Changed")),j0.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,j0);_De=W3=D([_(3,Di),_(4,Ai),_(5,ci),_(6,tr),_(7,MQ),_(8,Ze),_(9,Pw),_(10,hh),_(11,eo),_(12,LQ),_(13,Ur),_(14,Lm),_(15,ho)],_De);const l8t="vs/workbench/services/textfile/common/textFileSaveParticipant";let vDe=class extends ${constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=FRe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(l8t,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.textEditorModel?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||!e.textEditorModel)break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.error(a)}}e.textEditorModel?.pushStackElement()},()=>{s.cancel()}).finally(()=>{s.dispose()})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};vDe=D([_(0,Cf),_(1,Ze)],vDe);const d8t="vs/workbench/services/textfile/common/textFileEditorModelManager";let wDe=class extends ${get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,s,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=s,this.uriIdentityService=o,this._onDidCreate=this._register(new I({leakWarningThreshold:500})),this.onDidCreate=this._onDidCreate.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidRemove=this._register(new I),this.onDidRemove=this._onDidRemove.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this.mapResourceToModel=new wi,this.mapResourceToModelListeners=new wi,this.mapResourceToDisposeListener=new wi,this.mapResourceToPendingModelResolvers=new wi,this.modelResolveQueue=this._register(new sMe),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(d8t,0,"Failed to save '{0}': {1}",c.name,Ma(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(vDe)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onDidChangeFileSystemProviderCapabilities(e))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onDidChangeFileSystemProviderRegistrations(e))),this._register(this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e=>this.onWillRunWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e=>this.onDidFailWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e=>this.onDidRunWorkingCopyFileOperation(e)))}onDidFilesChange(e){for(const t of this.models)t.isDirty()||e.contains(t.resource,Ko.UPDATED,Ko.ADDED)&&this.queueModelReload(t)}onDidChangeFileSystemProviderCapabilities(e){this.queueModelReloads(e.scheme)}onDidChangeFileSystemProviderRegistrations(e){e.added&&this.queueModelReloads(e.scheme)}queueModelReloads(e){for(const t of this.models)t.isDirty()||e===t.resource.scheme&&this.queueModelReload(t)}queueModelReload(e){this.modelResolveQueue.queueSize(e.resource)<=1&&this.modelResolveQueue.queueFor(e.resource,async()=>{try{await this.reload(e)}catch(i){bt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=[];for(const{source:i,target:s}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,s))continue;const o=[];for(const r of this.models)this.uriIdentityService.extUri.isEqualOrParent(r.resource,i)&&o.push(r);for(const r of o){const a=r.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=s:c=qt(s,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:r.getLanguageId(),encoding:r.getEncoding(),snapshot:r.isDirty()?r.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),t.forEach(i=>{i.snapshot&&this.get(i.source)?.setDirty(!0)}))}}onDidRunWorkingCopyFileOperation(e){switch(e.operation){case Li.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Li.MOVE:case Li.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await ko.settled(t.map(async i=>{const s=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(s,{reload:{async:!1},contents:i.snapshot?fQ(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Kc&&o.getLanguageId()===Kc&&uz(s)!==Gje&&o.updateTextEditorModel(void 0,i.languageId)})))})());break}}get(e){return this.mapResourceToModel.get(e)}has(e){return this.mapResourceToModel.has(e)}async reload(e){await this.joinPendingResolves(e.resource),!(e.isDirty()||e.isDisposed()||!this.has(e.resource))&&await this.doResolve(e,{reload:{async:!1}})}async resolve(e,t){const i=this.joinPendingResolves(e);return i&&await i,this.doResolve(e,t)}async doResolve(e,t){let i,s;P.isUri(e)?(s=e,i=this.get(s)):(s=e.resource,i=e);let o,r=!1;if(i)t?.contents?o=i.resolve(t):t?.reload?t.reload.async?(o=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){bt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(_De,s,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(s,o),this.add(s,i),r&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await o}catch(a){throw r&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(s)}return t?.languageId&&i.setLanguageId(t.languageId),r&&i.isDirty()&&this._onDidChangeDirty.fire(i),i}joinPendingResolves(e){if(this.mapResourceToPendingModelResolvers.get(e))return this.doJoinPendingResolves(e)}async doJoinPendingResolves(e){let t;for(;this.mapResourceToPendingModelResolvers.has(e);){const i=this.mapResourceToPendingModelResolvers.get(e);if(i===t)return;t=i;try{await i}catch{}}}registerModel(e){const t=new Z;t.add(e.onDidResolve(i=>this._onDidResolve.fire({model:e,reason:i}))),t.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire(e))),t.add(e.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire(e))),t.add(e.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire(e))),t.add(e.onDidSaveError(()=>this._onDidSaveError.fire(e))),t.add(e.onDidSave(i=>this._onDidSave.fire({model:e,...i}))),t.add(e.onDidRevert(()=>this._onDidRevert.fire(e))),t.add(e.onDidChangeEncoding(()=>this._onDidChangeEncoding.fire(e))),this.mapResourceToModelListeners.set(e.resource,t)}add(e,t){if(this.mapResourceToModel.get(e)===t)return;this.mapResourceToDisposeListener.get(e)?.dispose(),this.mapResourceToModel.set(e,t),this.mapResourceToDisposeListener.set(e,t.onWillDispose(()=>this.remove(e)))}remove(e){const t=this.mapResourceToModel.delete(e),i=this.mapResourceToDisposeListener.get(e);i&&(St(i),this.mapResourceToDisposeListener.delete(e));const s=this.mapResourceToModelListeners.get(e);s&&(St(s),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}canDispose(e){return e.isDisposed()||!this.mapResourceToPendingModelResolvers.has(e.resource)&&!e.isDirty()?!0:this.doCanDispose(e)}async doCanDispose(e){const t=this.joinPendingResolves(e.resource);return t?(await t,this.canDispose(e)):e.isDirty()?(await T.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),St(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),St(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};wDe=D([_(0,be),_(1,ci),_(2,Pi),_(3,fC),_(4,_o)],wDe);var vX;const Fm="vs/workbench/services/textfile/browser/textFileService";var K0;let bDe=(K0=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=s,this.modelService=o,this.environmentService=r,this.dialogService=a,this.fileDialogService=c,this.textResourceConfigurationService=l,this.filesConfigurationService=d,this.codeEditorService=h,this.pathService=u,this.workingCopyFileService=f,this.uriIdentityService=p,this.languageService=m,this.logService=v,this.elevatedFileService=w,this.decorationsService=b,this.files=this._register(this.instantiationService.createInstance(wDe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends ${constructor(t){super(),this.files=t,this.label=g(Fm,2,"Text File Model Decorations"),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.registerListeners()}registerListeners(){this._register(this.files.onDidResolve(({model:t})=>{(t.isReadonly()||t.hasState(uu.ORPHAN))&&this._onDidChange.fire([t.resource])})),this._register(this.files.onDidRemove(t=>this._onDidChange.fire([t]))),this._register(this.files.onDidChangeReadonly(t=>this._onDidChange.fire([t.resource]))),this._register(this.files.onDidChangeOrphaned(t=>this._onDidChange.fire([t.resource])))}provideDecorations(t){const i=this.files.get(t);if(!i||i.isDisposed())return;const s=i.isReadonly(),o=i.hasState(uu.ORPHAN);if(s&&o)return{color:pWe,letter:Ce.lockSmall,strikethrough:!0,tooltip:g(Fm,3,"Deleted, Read-only")};if(s)return{letter:Ce.lockSmall,tooltip:g(Fm,4,"Read-only")};if(o)return{color:pWe,strikethrough:!0,tooltip:g(Fm,5,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(CDe))),this._encoding}async read(e,t){const[i,s]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:s.detected.encoding||Rh,value:await gMe(s.stream,o=>o.join(""))}}async readStream(e,t){const[i,s]=await this.doRead(e,t);return{...i,encoding:s.detected.encoding||Rh,value:await eNe(s.stream)}}async doRead(e,t){const i=new ai;let s;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);s={...o,value:aQ(o.value)}}else s=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,s.value,t);return[s,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===Nne.STREAM_IS_BINARY?new GOt(g(Fm,6,"File seems to be binary and cannot be opened as text"),xV.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async s=>{const o=await this.getEncodedReadable(s.resource,s.value);return{resource:s.resource,contents:o,overwrite:s.options?.overwrite}}));return this.workingCopyFileService.create(i,qe.None,t)}async write(e,t,i){const s=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,s,i):this.fileService.writeFile(e,s,i)}async getEncodedReadable(e,t,i){const{encoding:s,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(s===Rh&&!o)return typeof t>"u"?void 0:jOt(t);t=t||"";const r=typeof t=="string"?QOt(t):t;return Z$t(r,s,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return X$t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),overwriteEncoding:async s=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,s??void 0);return o}})}async save(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i){let s;if(i.hasAssociatedFilePath?s=await this.suggestSavePath(e):s=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),s)return this.saveAs(e,s,t)}}else{const i=this.files.get(e);if(i)return await i.save(t)?e:void 0}}async saveAs(e,t,i){if(t||(t=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(i?.suggestedTarget??e),i?.availableFileSystems)),!!t){if(this.filesConfigurationService.isReadonly(t))if(await this.confirmMakeWriteable(t))this.filesConfigurationService.updateReadonly(t,!1);else return;return _n(e,t)?this.save(e,{...i,force:!0}):this.fileService.hasProvider(e)&&this.uriIdentityService.extUri.isEqual(e,t)&&await this.fileService.exists(e)?(await this.workingCopyFileService.move([{file:{source:e,target:t}}],qe.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let s=!1;const o=this.files.get(e);if(o?.isResolved())s=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),s=!0;else{const r=this.modelService.getModel(e);r&&(s=await this.doSaveAsTextFile(r,e,t,i))}if(s){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,s){let o;const r=e;typeof r.getEncoding=="function"&&(o=r.getEncoding());let a=!1,c=this.files.get(i);if(c?.isResolved())a=!0;else{a=await this.fileService.exists(i),a||await this.create([{resource:i,value:""}]);try{c=await this.files.resolve(i,{encoding:o})}catch(u){if(a&&(u.textFileOperationResult===xV.FILE_IS_BINARY||u.fileOperationResult===Xi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,s);throw u}}let l;if(e instanceof mDe&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,R9(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof H1?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(o),this.modelService.updateModel(h,fQ(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Kc&&f===Kc&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return s?.source||(s={...s,source:a?vX.TEXTFILE_SAVE_REPLACE_SOURCE:vX.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...s,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Fm,7,"'{0}' already exists. Do you want to replace it?",ui(e)),detail:g(Fm,8,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",ui(e),ui(ma(e))),primaryButton:g(Fm,9,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Fm,10,"'{0}' is marked as read-only. Do you want to save anyway?",ui(e)),detail:g(Fm,11,"Paths can be configured as read-only via settings."),primaryButton:g(Fm,12,"&&Save Anyway")});return t}async suggestSavePath(e){if(this.fileService.hasProvider(e))return e;const t=this.environmentService.remoteAuthority,i=await this.fileDialogService.defaultFilePath();let s;if(e.scheme===_e.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return R9(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(qt(i,o.name),o.name)?r=o.name:r=ui(e);const a=o.getLanguageId();a&&a!==Kc?s=this.suggestFilename(a,r):s=r}}return s||(s=ui(e)),qt(i,s)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const s=T_(t),o=this.languageService.getExtensions(e);if(o.includes(s))return t;const r=k_(o);if(r)return s?`${t.substring(0,t.indexOf(s))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:k_(a)??t}async revert(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i)return i.revert(t)}else{const i=this.files.get(e);if(i&&(i.isDirty()||t?.force))return i.revert(t)}}isDirty(e){const t=e.scheme===_e.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},vX=K0,K0.TEXTFILE_SAVE_CREATE_SOURCE=ote.registerSource("textFileCreate.source",g(Fm,0,"File Created")),K0.TEXTFILE_SAVE_REPLACE_SOURCE=ote.registerSource("textFileOverwrite.source",g(Fm,1,"File Replaced")),K0);bDe=vX=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,Za),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,Qt),_(11,Lm),_(12,fC),_(13,_o),_(14,Di),_(15,Ze),_(16,IQ),_(17,rD)],bDe);let CDe=class extends ${get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,s){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=s,this._encodingOverrides=this.getDefaultEncodingOverrides(),this.registerListeners()}registerListeners(){this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.encodingOverrides=this.getDefaultEncodingOverrides()))}getDefaultEncodingOverrides(){const e=[];return e.push({parent:this.environmentService.userRoamingDataHome,encoding:Rh}),e.push({extension:qb,encoding:Rh}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Rh}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:qt(t.uri,".vscode"),encoding:Rh})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:s}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:s}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===OF||i===BF||i===dE}}async getPreferredReadEncoding(e,t,i){let s;t?.encoding?i===dE&&t.encoding===Rh?s=dE:s=t.encoding:typeof i=="string"?s=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===dE&&(s=Rh);const o=await this.getEncodingForResource(e,s);return{encoding:o,hasBOM:o===OF||o===BF||o===dE}}async getEncodingForResource(e,t){let i;const s=this.getEncodingOverride(e);return s?i=s:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Rh&&(!i||!await e8t(i))&&(i=Rh),i}getEncodingOverride(e){if(this.encodingOverrides?.length){for(const t of this.encodingOverrides)if(t.parent&&this.uriIdentityService.extUri.isEqualOrParent(e,t.parent)||t.extension&&uz(e)===`.${t.extension}`)return t.encoding}}};CDe=D([_(0,dl),_(1,Za),_(2,Ti),_(3,_o)],CDe);let yDe=class extends bDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,w,v,b),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(uu.PENDING_SAVE))}};yDe=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,Za),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,Qt),_(11,Lm),_(12,fC),_(13,_o),_(14,Di),_(15,IQ),_(16,Ze),_(17,rD)],yDe);var IC,DP;let SDe=(DP=class extends ${constructor(e,t,i,s){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=s,this._onExpressionChange=this._register(new I),this.onExpressionChange=this._onExpressionChange.event,this.mapFolderToParsedExpression=new Map,this.mapFolderToConfiguredExpression=new Map,this.updateExpressions(!1),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{this.shouldUpdate(e)&&this.updateExpressions(!0)})),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateExpressions(!0)))}updateExpressions(e){let t=!1;for(const r of this.contextService.getWorkspace().folders){const a=r.uri.toString(),c=this.doGetExpression(r.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Io(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,_w(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new o1(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==IC.NO_FOLDER&&(i.has(P.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const s=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER);s?(!o||!Io(o.expression,s.expression))&&(t=!0,this.mapFolderToParsedExpression.set(IC.NO_FOLDER,_w(s.expression)),this.mapFolderToConfiguredExpression.set(IC.NO_FOLDER,s)):o&&(t=!0,this.mapFolderToParsedExpression.delete(IC.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(IC.NO_FOLDER)),e&&t&&this._onExpressionChange.fire()}doGetExpression(e){const t=this.getExpression(e);if(!t)return;const i=Object.keys(t);if(i.length===0)return;let s=!1;const o=Object.create(null);for(const r of i){s||(s=oF(r));let a=r;const c=$ht(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:s}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let s,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(s=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(s=this.mapFolderToParsedExpression.get(IC.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER)),!s)return!1;let r;return i?r=lO(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&s(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!s(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.path}},IC=DP,DP.NO_FOLDER=null,DP);SDe=IC=D([_(2,Ti),_(3,Re)],SDe);var Kw;const F5="vs/workbench/services/filesConfiguration/common/filesConfigurationService",h8t=new Y("autoSaveAfterShortDelayContext",!1,!0);var Uc;(function(n){n[n.OFF=0]="OFF",n[n.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",n[n.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",n[n.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",n[n.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(Uc||(Uc={}));var Kf;(function(n){n[n.SETTINGS=1]="SETTINGS",n[n.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",n[n.ERRORS=3]="ERRORS",n[n.DISABLED=4]="DISABLED"})(Kf||(Kf={}));var nx;let ADe=(nx=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=s,this.uriIdentityService=o,this.fileService=r,this.markerService=a,this.textResourceConfigurationService=c,this._onDidChangeAutoSaveConfiguration=this._register(new I),this.onDidChangeAutoSaveConfiguration=this._onDidChangeAutoSaveConfiguration.event,this._onDidChangeAutoSaveDisabled=this._register(new I),this.onDidChangeAutoSaveDisabled=this._onDidChangeAutoSaveDisabled.event,this._onDidChangeFilesAssociation=this._register(new I),this.onDidChangeFilesAssociation=this._onDidChangeFilesAssociation.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.autoSaveConfigurationCache=new L_(1e3),this.autoSaveDisabledOverrides=new wi,this.autoSaveAfterShortDelayContext=h8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new kve(()=>this.createReadonlyMatcher(wJe))),this.readonlyExcludeMatcher=this._register(new kve(()=>this.createReadonlyMatcher(bJe))),this.sessionReadonlyOverrides=new wi(d=>this.uriIdentityService.extUri.getComparisonKey(d));const l=t.getValue();this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,l.files),this.currentFilesAssociationConfiguration=l?.files?.associations,this.currentHotExitConfiguration=l?.files?.hotExit||Ng.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new SDe(i=>this.configurationService.getValue(e,{resource:i}),i=>i.affectsConfiguration(e),this.contextService,this.configurationService));return this._register(t.onExpressionChange(()=>this._onDidChangeReadonly.fire())),t}isReadonly(e,t){const i=this.fileService.getProvider(e.scheme);if(i&&GEt(i))return i.readOnlyMessage??Kw.READONLY_MESSAGES.providerReadonly;const s=this.sessionReadonlyOverrides.get(e);return typeof s=="boolean"?s===!0?Kw.READONLY_MESSAGES.sessionReadonly:!1:this.uriIdentityService.extUri.isEqualOrParent(e,this.environmentService.userRoamingDataHome)||this.uriIdentityService.extUri.isEqual(e,this.contextService.getWorkspace().configuration??void 0)?!1:this.readonlyIncludeMatcher.value.matches(e)?this.readonlyExcludeMatcher.value.matches(e)?!1:Kw.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Kw.READONLY_MESSAGES.fileLocked:t?.readonly?Kw.READONLY_MESSAGES.fileReadonly:!1}async updateReadonly(e,t){if(t==="toggle"){let i;try{i=await this.fileService.resolve(e,{resolveMetadata:!0})}catch{}t=!this.isReadonly(e,i)}t==="reset"?this.sessionReadonlyOverrides.delete(e):this.sessionReadonlyOverrides.set(e,t),this._onDidChangeReadonly.fire()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("files")&&this.onFilesConfigurationChange(this.configurationService.getValue(),!0)}))}onFilesConfigurationChange(e,t){this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,e.files),this.autoSaveConfigurationCache.clear(),this.autoSaveAfterShortDelayContext.set(this.getAutoSaveMode(void 0).mode===Uc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Io(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const s=e?.files?.hotExit;s===Ng.OFF||s===Ng.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=s:this.currentHotExitConfiguration=Ng.ON_EXIT;const o=!!e?.files?.readonlyFromPermissions;o!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=o,t&&this._onDidChangeReadonly.fire())}getAutoSaveConfiguration(e){const t=this.toResource(e);if(t){let i=this.autoSaveConfigurationCache.get(t);return i||(i=this.computeAutoSaveConfiguration(t,this.textResourceConfigurationService.getValue(t,"files")),this.autoSaveConfigurationCache.set(t,i)),i}return this.currentGlobalAutoSaveConfiguration}computeAutoSaveConfiguration(e,t){let i,s,o,r,a,c;switch(t.autoSave??Kw.DEFAULT_AUTO_SAVE_MODE){case $l.AFTER_DELAY:{i="afterDelay",s=typeof t.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Kw.DEFAULT_AUTO_SAVE_DELAY,c=s<=Kw.DEFAULT_AUTO_SAVE_DELAY;break}case $l.ON_FOCUS_CHANGE:i="onFocusChange";break;case $l.ON_WINDOW_CHANGE:i="onWindowChange";break}return t.autoSaveWorkspaceFilesOnly===!0&&(o=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t.autoSaveWhenNoErrors===!0&&(r=!0,c=void 0),{autoSave:i,autoSaveDelay:s,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof cC?Qc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}):e}hasShortAutoSaveDelay(e){const t=this.toResource(e);return this.getAutoSaveConfiguration(t).isShortAutoSaveDelay?!t||!this.autoSaveDisabledOverrides.has(t):!1}getAutoSaveMode(e,t){const i=this.toResource(e);if(i&&this.autoSaveDisabledOverrides.has(i))return{mode:Uc.OFF,reason:Kf.DISABLED};const s=this.getAutoSaveConfiguration(i);if(typeof s.autoSave>"u")return{mode:Uc.OFF,reason:Kf.SETTINGS};if(typeof t=="number"&&(s.autoSave==="afterDelay"&&t!==Ln.AUTO||s.autoSave==="onFocusChange"&&t!==Ln.FOCUS_CHANGE&&t!==Ln.WINDOW_CHANGE||s.autoSave==="onWindowChange"&&t!==Ln.WINDOW_CHANGE))return{mode:Uc.OFF,reason:Kf.SETTINGS};if(i){if(s.autoSaveWorkspaceFilesOnly&&s.isOutOfWorkspace)return{mode:Uc.OFF,reason:Kf.OUT_OF_WORKSPACE};if(s.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ys.Error}).length>0)return{mode:Uc.OFF,reason:Kf.ERRORS}}switch(s.autoSave){case"afterDelay":return typeof s.autoSaveDelay=="number"&&s.autoSaveDelay<=Kw.DEFAULT_AUTO_SAVE_DELAY?{mode:s.autoSaveWhenNoErrors?Uc.AFTER_LONG_DELAY:Uc.AFTER_SHORT_DELAY}:{mode:Uc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:Uc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:Uc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE].some(i=>i===e)?t=$l.OFF:t=$l.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return $.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const s=this.autoSaveDisabledOverrides.get(t)??0;s<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,s-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Ng.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Kw=nx,nx.DEFAULT_AUTO_SAVE_MODE=Jn?$l.AFTER_DELAY:$l.OFF,nx.DEFAULT_AUTO_SAVE_DELAY=1e3,nx.READONLY_MESSAGES={providerReadonly:{value:g(F5,0,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(F5,1,"Editor is read-only because the file was set read-only in this session. [Click here](command:{0}) to set writeable.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},configuredReadonly:{value:g(F5,2,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure.",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`),isTrusted:!0},fileLocked:{value:g(F5,3,"Editor is read-only because of file permissions. [Click here](command:{0}) to set writeable anyway.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},fileReadonly:{value:g(F5,4,"Editor is read-only because the file is read-only."),isTrusted:!0}},nx);ADe=Kw=D([_(0,Pe),_(1,Re),_(2,Ti),_(3,Il),_(4,_o),_(5,ci),_(6,U_),_(7,dl)],ADe);class u8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const dn="vs/workbench/contrib/files/browser/files.contribution",cOe=it.as(Cs.Configuration),g8t=rf?{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,1,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`"),g(dn,2,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it's the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,4,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)};cOe.registerConfiguration({id:"files",order:9,title:g(dn,5,"Files"),type:"object",properties:{[qEt]:{type:"object",markdownDescription:g(dn,6,"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."),default:{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,...Jn?{"**/*.crswap":!0}:void 0},scope:ut.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(dn,7,"Enable the pattern."),g(dn,8,"Disable the pattern.")],description:g(dn,9,"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.")},{type:"object",properties:{when:{type:"string",pattern:"\\w*\\$\\(basename\\)\\w*",default:"$(basename).ext",markdownDescription:g(dn,10,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[SNe]:{type:"object",markdownDescription:g(dn,11,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `"*.extension": "html"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed.'),additionalProperties:{type:"string"}},"files.encoding":{type:"string",enum:Object.keys(P5),default:"utf8",description:g(dn,12,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:ut.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(P5).map(n=>P5[n].labelLong),enumItemLabels:Object.keys(P5).map(n=>P5[n].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(dn,13,"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.","`#files.encoding#`"),scope:ut.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` +- `),eY.registerConfiguration({...Het,properties:{"window.title":{type:"string",default:Tst,markdownDescription:e},"window.titleSeparator":{type:"string",default:Rst,markdownDescription:g(Ae,169,"Separator used by {0}.","`#window.title#`")},[u_.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Jn?g(Ae,170,"Show command launcher together with the window title."):g(Ae,171,"Show command launcher together with the window title. This setting only has an effect when {0} is not set to {1}.","`#window.customTitleBarVisibility#`","`never`")},"window.menuBarVisibility":{type:"string",enum:["classic","visible","toggle","hidden","compact"],markdownEnumDescriptions:[g(Ae,172,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(Ae,173,"Menu is always visible at the top of the window even in full screen mode."),ei?g(Ae,174,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(Ae,175,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(Ae,176,"Menu is always hidden."),Jn?g(Ae,177,"Menu is displayed as a compact button in the side bar."):g(Ae,178,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Jn?"compact":"classic",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,179,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and executing `Focus Application Menu` will show it. A setting of 'compact' will move the menu into the side bar."):g(Ae,180,"Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. A setting of 'compact' will move the menu into the side bar."),included:Is||jr||Jn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:ut.APPLICATION,description:g(Ae,181,"Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),included:Is||jr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:ut.APPLICATION,markdownDescription:g(Ae,182,"Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),included:Is||jr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,183,"Files will open in a new window."),g(Ae,184,"Files will open in the window with the files' folder open or the last active window."),ei?g(Ae,185,"Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder."):g(Ae,186,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:ut.APPLICATION,markdownDescription:ei?g(Ae,187,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option)."):g(Ae,188,"Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.openFoldersInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(Ae,189,"Folders will open in a new window."),g(Ae,190,"Folders will replace the last active window."),g(Ae,191,"Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu).")],default:"default",scope:ut.APPLICATION,markdownDescription:g(Ae,192,"Controls whether folders should open in a new window or replace the last active window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")},"window.confirmBeforeClose":{type:"string",enum:["always","keyboardOnly","never"],enumDescriptions:[Jn?g(Ae,193,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(Ae,194,"Always ask for confirmation."),Jn?g(Ae,195,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(Ae,196,"Only ask for confirmation if a keybinding was used."),Jn?g(Ae,197,"Never explicitly ask for confirmation unless data loss is imminent."):g(Ae,198,"Never explicitly ask for confirmation.")],default:Jn&&!UQe()?"keyboardOnly":"never",markdownDescription:Jn?g(Ae,199,"Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases."):g(Ae,200,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:ut.APPLICATION}}}),gp(Cte.ID,Cte,Sl.Eventually),eY.registerConfiguration({...lNt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(Ae,201,"Controls whether the problems are visible throughout the editor and workbench.")}}}),eY.registerConfiguration({id:"zenMode",order:9,title:g(Ae,202,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(Ae,203,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(Ae,204,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(Ae,205,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(Ae,206,"Each editor is displayed as a tab in the editor title area."),g(Ae,207,"The active editor is displayed as a single large tab in the editor title area."),g(Ae,208,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(Ae,209,"Controls whether turning on Zen Mode also hides the status bar at the bottom of the workbench.")},"zenMode.hideActivityBar":{type:"boolean",default:!0,description:g(Ae,210,"Controls whether turning on Zen Mode also hides the activity bar either at the left or right of the workbench.")},"zenMode.hideLineNumbers":{type:"boolean",default:!0,description:g(Ae,211,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(Ae,212,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(Ae,213,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:n=>{const e=[];return n!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),n===!1&&e.push([u_.ACTIVITY_BAR_LOCATION,{value:Tne.HIDDEN}]),e}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:u_.ACTIVITY_BAR_LOCATION,migrateFn:n=>{const e=[];return n==="side"&&e.push([u_.ACTIVITY_BAR_LOCATION,{value:Tne.DEFAULT}]),e}}]);it.as(Rm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:n}])),e}},{key:u_.EDITOR_TABS_MODE,migrateFn:n=>{const e=[];return typeof n=="boolean"&&(n=n?xM.MULTIPLE:xM.SINGLE,e.push([u_.EDITOR_TABS_MODE,{value:n}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:n=>{const e=[];return n==="left"||n==="right"?e.push(["workbench.editor.tabActionLocation",{value:n}]):n==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:n=>{const e=[["zenMode.hideTabs",{value:void 0}]];return n===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let Mst=()=>!1,Nst=(n,e)=>!1;const N$t=FF.prototype.getCommandPicks;FF.prototype.getCommandPicks=async function(n){let e=await N$t.call(this,n);return Mst()||(e=e.map(t=>({...t,buttons:void 0}))),e};let hDe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(sEe)}get activeService(){const e=Lt.get(jt).getFocusedCodeEditor();return e==null||Nst(e,e instanceof k1)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(R7)),this.standaloneQuickInputService)}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}get backButton(){return this.activeService.backButton}get onShow(){return this.activeService.onShow}get onHide(){return this.activeService.onHide}createQuickWidget(){return this.activeService.createQuickWidget()}pick(e,t={},i=qe.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}focus(){return this.activeService.focus()}toggle(){return this.activeService.toggle()}navigate(e,t){return this.activeService.navigate(e,t)}accept(){return this.activeService.accept()}back(){return this.activeService.back()}cancel(){return this.activeService.cancel()}};hDe=D([_(0,be)],hDe);function P$t({isKeybindingConfigurationVisible:n,shouldUseGlobalPicker:e}={}){return n!=null&&(Mst=n),e!=null&&(Nst=e),{[On.toString()]:new Gi(hDe,[],!0)}}const F$t="vs/platform/files/common/io";async function O$t(n,e,t,i,s,o){let r;try{await B$t(n,e,t,i,s,o)}catch(a){r=a}finally{r&&s.errorTransformer&&(r=s.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function B$t(n,e,t,i,s,o){Bpe(o);const r=await n.open(e,{create:!1});try{Bpe(o);let a=0,c=0,l=s&&typeof s.length=="number"?s.length:void 0,d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),h=s&&typeof s.position=="number"?s.position:0,u=0;do c=await n.read(r,h,d.buffer,u,d.byteLength-u),h+=c,u+=c,a+=c,typeof l=="number"&&(l-=c),u===d.byteLength&&(await t.write(i(d)),d=ze.alloc(Math.min(s.bufferSize,typeof l=="number"?l:s.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&Bpe(o)&&W$t(a,s));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw qL(a)}finally{await n.close(r)}}function Bpe(n){if(n.isCancellationRequested)throw rx();return!0}function W$t(n,e){if(typeof e?.limits?.size=="number"&&n>e.limits.size)throw xs(g(F$t,0,"File is too large to open"),rt.FileTooLarge);return!0}var uDe;const sc="vs/platform/files/common/fileService";function Pst(n){return n.scheme===_e.file?n.fsPath:n.toString(!0)}async function Fst(n,e,t){const i=[];for(;!n.isEqual(t,n.dirname(t));)try{if(!((await e.stat(t)).type&an.Directory))throw new Error(g(sc,0,"Unable to create folder '{0}' that already exists but is not a directory",Pst(t)));break}catch(s){if(w1(s)!==rt.FileNotFound)throw s;i.push(n.basename(t)),t=n.dirname(t)}for(let s=i.length-1;s>=0;s--){t=n.joinPath(t,i[s]);try{await e.mkdir(t)}catch(o){if(w1(o)!==rt.FileExists)throw o}}}var xP;let gDe=(xP=class extends ${constructor(e){super(),this.logService=e,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new I),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new I),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new I),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new I),this.onDidRunOperation=this._onDidRunOperation.event,this.internalOnDidFilesChange=this._register(new I),this._onDidUncorrelatedFilesChange=this._register(new I),this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event,this._onDidWatchError=this._register(new I),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new sMe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);vs(`code/registerFilesystem/${e}`);const i=new Z;return this.provider.set(e,t),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:t}),i.add(t.onDidChangeFile(s=>{const o=new mee(s,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(s=>this._onDidWatchError.fire(new Error(s)))),i.add(t.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:t,scheme:e}))),Ee(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:t}),this.provider.delete(e),St(i)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){const t=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(i){t.push(i)}}),!this.provider.has(e)&&await ko.settled(t)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,t){const i=this.provider.get(e.scheme);return!!(i&&i.capabilities&t)}listCapabilities(){return fi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!KQe(e))throw new Ah(g(sc,1,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Zi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new uc;throw i.message=g(sc,2,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t)||dJ(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){const t=await this.withProvider(e);if(mD(t)||sv(t))return t;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,t){try{return await this.doResolveFile(e,t)}catch(i){throw w1(i)===rt.FileNotFound?new Ah(g(sc,3,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Zi.FILE_NOT_FOUND):qL(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),s=this.isPathCaseSensitive(i),o=t?.resolveTo,r=t?.resolveSingleChildDescendants,a=t?.resolveMetadata,c=await i.stat(e);let l;return this.toFileStat(i,e,c,void 0,!!a,(d,h)=>(l||(l=Su.forUris(()=>!s),l.set(e,!0),o&&l.fill(!0,o)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&r?h===1:!1))}async toFileStat(e,t,i,s,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&an.File)!==0,isDirectory:(i.type&an.Directory)!==0,isSymbolicLink:(i.type&an.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&vm.Readonly)||!!(e.capabilities&es.Readonly),locked:!!((i.permissions??0)&vm.Locked),etag:_ee({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,s)){try{const l=await e.readdir(t),d=await ko.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=o?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,o,r)}catch(f){return this.logService.trace(f),null}}));c.children=Ui(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return ko.settled(e.map(async t=>{try{return{stat:await this.doResolveFile(t.resource,t.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(e){const t=await this.withProvider(e),i=await t.stat(e);return this.toFileStat(t,e,i,void 0,!0,()=>!1)}async exists(e){const t=await this.withProvider(e);try{return!!await t.stat(e)}catch{return!1}}async canCreateFile(e,t){try{await this.doValidateCreateFile(e,t)}catch(i){return i}return!0}async doValidateCreateFile(e,t){if(!t?.overwrite&&await this.exists(e))throw new Ah(g(sc,4,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Zi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=ze.fromString(""),i){await this.doValidateCreateFile(e,i);const s=await this.writeFile(e,t);return this._onDidRunOperation.fire(new qO(e,Li.CREATE,s)),s}async writeFile(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(s);let r=i;if(KHe(s)&&!r?.atomic){const a=s.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(s,e,r)||await this.mkdirp(s,o.dirname(e));let c;if(sv(s)&&!(t instanceof ze))if(KY(t)){const l=await Kgt(t,3);l.ended?c=ze.concat(l.buffer):c=l}else c=jgt(t,l=>ze.concat(l),3);else c=t;!mD(s)||sv(s)&&c instanceof ze||sv(s)&&KHe(s)&&r?.atomic?await this.doWriteUnbuffered(s,e,r,c):await this.doWriteBuffered(s,e,r,c instanceof ze?Ije(c):c),this._onDidRunOperation.fire(new qO(e,Li.WRITE))}catch(a){throw new Ah(g(sc,5,"Unable to write file '{0}' ({1})",this.resourceForError(e),qL(a).toString()),Cy(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const s=!!i?.unlock;if(s&&!(e.capabilities&es.FileWriteUnlock))throw new Error(g(sc,6,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&es.FileAtomicWrite))throw new Error(g(sc,7,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&es.FileReadWrite))throw new Error(g(sc,8,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(s)throw new Error(g(sc,9,"Unable to unlock file '{0}' because atomic write is enabled.",this.resourceForError(t)))}let r;try{r=await e.stat(t)}catch{return}if(r.type&an.Directory)throw new Ah(g(sc,10,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Zi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==zv&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,s);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,s){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},s);return{...o,value:await II(o.value)}}async readFileStream(e,t,i){const s=await this.withReadProvider(e);return this.doReadFileStream(s,e,t,i)}async doReadFileStream(e,t,i,s){const o=new ai(s);let r=i;Tfe(e)&&e.enforceAtomicReadFile?.(t)&&(r={...i,atomic:!0});const a=this.validateReadFile(t,r).then(l=>l,l=>{throw o.dispose(!0),l});let c;try{return typeof r?.etag=="string"&&r.etag!==zv&&await a,r?.atomic&&Tfe(e)||!(mD(e)||dJ(e))||sv(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):dJ(e)?c=this.readFileStreamed(e,t,o.token,r):c=this.readFileBuffered(e,t,o.token,r),c.on("end",()=>o.dispose()),c.on("error",()=>o.dispose()),{...await a,value:c}}catch(l){throw c&&await gMe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const s=g(sc,12,"Unable to read file '{0}' ({1})",this.resourceForError(t),qL(e).toString());return e instanceof P$?new P$(s,e.stat,i):e instanceof hJ?new hJ(s,e.fileOperationResult,e.size,e.options):new Ah(s,Cy(e),i)}readFileStreamed(e,t,i,s=Object.create(null)){const o=e.readFileStream(t,s,i);return Xgt(o,{data:r=>r instanceof ze?r:ze.wrap(r),error:r=>this.restoreReadError(r,t,s)},r=>ze.concat(r))}readFileBuffered(e,t,i,s=Object.create(null)){const o=Lje();return O$t(e,t,o,r=>r,{...s,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,s)},i),o}readFileUnbuffered(e,t,i){const s=Xx(o=>ze.concat(o));return(async()=>{try{let o;i?.atomic&&Tfe(e)?o=await e.readFile(t,{atomic:!0}):o=await e.readFile(t),typeof i?.position=="number"&&(o=o.slice(i.position)),typeof i?.length=="number"&&(o=o.slice(0,i.length)),this.validateReadFileLimits(t,o.byteLength,i),s.end(ze.wrap(o))}catch(o){s.error(o),s.end()}})(),s}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Ah(g(sc,13,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Zi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==zv&&t.etag===i.etag)throw new P$(g(sc,14,"File not modified since"),i,t);return this.validateReadFileLimits(e,i.size,t),i}validateReadFileLimits(e,t,i){if(typeof i?.limits?.size=="number"&&t>i.limits.size)throw new hJ(g(sc,15,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Zi.FILE_TOO_LARGE,t,i)}async canMove(e,t,i){return this.doCanMoveCopy(e,t,"move",i)}async canCopy(e,t,i){return this.doCanMoveCopy(e,t,"copy",i)}async doCanMoveCopy(e,t,i,s){if(e.toString()!==t.toString())try{const o=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(o,e,r,t,i,s)}catch(o){return o}return!0}async move(e,t,i){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="move"?Li.MOVE:Li.COPY,a)),a}async copy(e,t,i){const s=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(s,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,r==="copy"?Li.COPY:Li.MOVE,a)),a}async doMoveCopy(e,t,i,s,o,r){if(t.toString()===s.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,s,o,r);if(a&&!c&&r&&await this.del(s,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(s)),o==="copy"){if(e===i&&jHe(e))await e.copy(t,s,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,s):await this.doCopyFile(e,t,i,s)}return o}else return e===i?(await e.rename(t,s,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,s,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,s){if(mD(e)&&mD(i))return this.doPipeBuffered(e,t,i,s);if(mD(e)&&sv(i))return this.doPipeBufferedToUnbuffered(e,t,i,s);if(sv(e)&&mD(i))return this.doPipeUnbufferedToBuffered(e,t,i,s);if(sv(e)&&sv(i))return this.doPipeUnbuffered(e,t,i,s)}async doCopyFolder(e,t,i,s){await i.mkdir(s),Array.isArray(t.children)&&await ko.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(s,o.name);return o.isDirectory?this.doCopyFolder(e,await this.resolve(o.resource),i,r):this.doCopyFile(e,o.resource,i,r)}))}async doValidateMoveCopy(e,t,i,s,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,s)),a&&o==="copy")throw new Error(g(sc,16,"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",this.resourceForError(t),this.resourceForError(s)));if(!a&&l.isEqualOrParent(s,t))throw new Error(g(sc,17,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(s)))}const c=await this.exists(s);if(c&&!a){if(!r)throw new Ah(g(sc,18,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(s)),Zi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,s))throw new Error(g(sc,19,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(s)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?Fn:Gle,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&es.PathCaseSensitive)}async createFolder(e){const t=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(t,e);const i=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new qO(e,Li.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return Fst(i,e,t)}async canDelete(e,t){try{await this.doValidateDelete(e,t)}catch(i){return i}return!0}async doValidateDelete(e,t){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),s=!!t?.useTrash;if(s&&!(i.capabilities&es.Trash))throw new Error(g(sc,20,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&es.FileAtomicDelete))throw new Error(g(sc,21,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(s&&o)throw new Error(g(sc,22,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let r;try{r=await i.stat(e)}catch{}if(r)this.throwIfFileIsReadonly(e,r);else throw new Ah(g(sc,23,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Zi.FILE_NOT_FOUND);if(!!!t?.recursive){const c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(g(sc,24,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let s=t;if($Et(i)&&!s?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(s={...t,atomic:c})}const o=!!s?.useTrash,r=!!s?.recursive,a=s?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new qO(e,Li.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===s&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===s&&zEt(i)?i.cloneFile(e,t):(await this.mkdirp(s,this.getExtUri(s).providerExtUri.dirname(t)),i===s&&jHe(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,s,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:uDe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let s=!1,o=()=>{s=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);s?St(a):o=()=>St(a)}catch(a){this.logService.error(a)}})();const r=t.correlationId;if(typeof r=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(r)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),s=Ed([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(s);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(s,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(St(o.disposable),this.activeWatchers.delete(s)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)St(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,s){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{KY(s)||Oge(s)?await this.doWriteStreamBufferedQueued(e,o,s):await this.doWriteReadableBufferedQueued(e,o,s)}catch(r){throw qL(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let s=0,o;if(Oge(i)){if(i.buffer.length>0){const r=ze.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,s,0),s+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{hO(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,s,0)}catch(l){return a(l)}s+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let s=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,s,0),s+=o.byteLength}async doWriteBuffer(e,t,i,s,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,s),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,s){let o;s instanceof ze?o=s:KY(s)?o=await II(s):Oge(s)?o=await rft(s):o=oft(s),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,s){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(s,{create:!0,unlock:!1});const a=ze.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(o,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,r,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw qL(a)}finally{await ko.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,s){return i.writeFile(s,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,s){return this.writeQueue.queueFor(s,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,s),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,s){const o=await i.open(s,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,ze.wrap(r),r.byteLength,0,0)}catch(r){throw qL(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,s){const o=await II(this.readFileBuffered(e,t,qe.None));await this.doWriteUnbuffered(i,s,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&es.Readonly)throw new Ah(g(sc,25,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Zi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&vm.Readonly)throw new Ah(g(sc,25,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Zi.FILE_PERMISSION_DENIED)}resourceForError(e){return Pst(e)}},uDe=xP,xP.WATCHER_CORRELATION_IDS=0,xP);gDe=uDe=D([_(0,Ze)],gDe);class F3e{constructor(e){this.type=an.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class N5{constructor(e){this.type=an.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class Mne extends ${constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=es.FileReadWrite|es.PathCaseSensitive,this.root=new N5(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&es.Readonly);e!==t&&(this._capabilities=e?es.Readonly|es.PathCaseSensitive|es.FileReadWrite:es.FileReadWrite|es.PathCaseSensitive,this._onDidChangeCapabilities.fire())}async stat(e){return this._lookup(e,!1)}async readdir(e){const t=this._lookupAsDirectory(e,!1),i=[];return t.entries.forEach((s,o)=>i.push([o,s.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw xs("file not found",rt.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=Xx(s=>ze.concat(s.map(o=>ze.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const s=ui(e),o=this._lookupParentDirectory(e);let r=o.entries.get(s);if(r instanceof N5)throw xs("file is directory",rt.FileIsADirectory);if(!r&&!i.create)throw xs("file not found",rt.FileNotFound);if(r&&i.create&&!i.overwrite)throw xs("file exists already",rt.FileExists);r||(r=new F3e(s),o.entries.set(s,r),this._fireSoon({type:Ko.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:Ko.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const s=this.memoryFdCounter++;return this.fdMemory.set(s,i),Promise.resolve(s)}throw xs("file not found",rt.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),Promise.resolve(a.byteLength)}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(!r)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw xs("file exists already",rt.FileExists);const s=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=ui(t);o.entries.delete(s.name),s.name=a,r.entries.set(a,s),this._fireSoon({type:Ko.DELETED,resource:e},{type:Ko.ADDED,resource:t})}async delete(e,t){const i=ma(e),s=ui(e),o=this._lookupAsDirectory(i,!1);o.entries.has(s)&&(o.entries.delete(s),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:Ko.UPDATED,resource:i},{resource:e,type:Ko.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new N5(t);s.entries.set(o.name,o),s.mtime=Date.now(),s.size+=1,this._fireSoon({type:Ko.UPDATED,resource:i},{type:Ko.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let s=this.root;for(const o of i){if(!o)continue;let r;if(s instanceof N5&&(r=s.entries.get(o)),!r){if(t)return;throw xs("file not found",rt.FileNotFound)}s=r}return s}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof N5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof F3e)return i;throw xs("file is a directory",rt.FileIsADirectory)}_lookupParentDirectory(e){const t=ma(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return $.None}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}dispose(){super.dispose(),this.fdMemory.clear()}}class O3e extends Error{constructor(e){super("Missing stores"),this.db=e}}class fDe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class PT{static async create(e,t,i){const s=await PT.openDatabase(e,t,i);return new PT(s,e)}static async openDatabase(e,t,i){vs(`code/willOpenDatabase/${e}`);try{return await PT.doOpenDatabase(e,t,i)}catch(s){if(s instanceof O3e){console.info("Attempting to recreate the IndexedDB once.",e);try{await PT.deleteDatabase(s.db)}catch(o){throw console.error("Error while deleting the IndexedDB",lg(o)),o}return await PT.doOpenDatabase(e,t,i)}throw s}finally{vs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((s,o)=>{const r=indexedDB.open(e,t);r.onerror=()=>o(r.error),r.onsuccess=()=>{const a=r.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),o(new O3e(a));return}s(a)},r.onupgradeneeded=()=>{const a=r.result;for(const c of i)a.objectStoreNames.contains(c)||a.createObjectStore(c)}})}static deleteDatabase(e){return new Promise((t,i)=>{e.close();const s=indexedDB.deleteDatabase(e.name);s.onerror=o=>i(s.error),s.onsuccess=()=>t()})}constructor(e,t){this.name=t,this.database=null,this.pendingTransactions=[],this.database=e}hasPendingTransactions(){return this.pendingTransactions.length>0}close(){this.pendingTransactions.length&&this.pendingTransactions.splice(0,this.pendingTransactions.length).forEach(e=>e.abort()),this.database?.close(),this.database=null}async runInTransaction(e,t,i){if(!this.database)throw new fDe(this.name);const s=this.database.transaction(e,t);return this.pendingTransactions.push(s),new Promise((o,r)=>{s.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},s.onerror=()=>r(s.error?uc.fromError(s.error):new uc("unknown error")),s.onabort=()=>r(s.error?uc.fromError(s.error):new uc("unknown error"));const a=i(s.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(s),1))}async getKeyValues(e,t){if(!this.database)throw new fDe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(s=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return s(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):s(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Ma(l,!0)}`),s(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Qz="vs/platform/files/browser/indexedDBFileSystemProvider",Wpe=xs(g(Qz,0,"File does not exist"),rt.FileNotFound),H$t=xs(g(Qz,1,"File is Directory"),rt.FileIsADirectory),B3e=xs(g(Qz,2,"File is not a directory"),rt.FileNotADirectory),U$t=xs(g(Qz,3,"Directory is not empty"),rt.Unknown),V$t=xs(g(Qz,4,"File exceeds available storage quota"),rt.FileExceedsStorageQuota),jw=n=>xs(g(Qz,5,"Internal error occurred in IndexedDB File System Provider. ({0})",n),rt.Unknown);class d8{constructor(e){this.entry=e,this.type=e.type}read(e){return this.doRead(e.split("/").filter(t=>t.length))}doRead(e){if(e.length===0)return this.entry;if(this.entry.type!==an.Directory)throw jw("Internal error reading from IndexedDBFSNode -- expected directory at "+this.entry.path);const t=this.entry.children.get(e[0]);if(t)return t.doRead(e.slice(1))}delete(e){const t=e.split("/").filter(i=>i.length);if(t.length===0){if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode. Expected root entry to be directory");this.entry.children.clear()}else return this.doDelete(t,e)}doDelete(e,t){if(e.length===0)throw jw(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==an.Directory)throw jw("Internal error deleting from IndexedDBFSNode -- expected directory at "+this.entry.path);if(e.length===1)this.entry.children.delete(e[0]);else{const i=this.entry.children.get(e[0]);if(!i)throw jw("Internal error deleting from IndexedDBFSNode -- expected entry at "+this.entry.path+"/"+i);i.doDelete(e.slice(1),t)}}add(e,t){this.doAdd(e.split("/").filter(i=>i.length),t,e)}doAdd(e,t,i){if(e.length===0)throw jw(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const s=e[0],o=this.entry.children.get(s);if(t.type==="dir"){if(o?.entry.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,o??new d8({type:an.Directory,path:this.entry.path+"/"+s,children:new Map}))}else{if(o?.entry.type===an.Directory)throw jw(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${s} (encountered while adding ${i})`);this.entry.children.set(s,new d8({type:an.File,path:this.entry.path+"/"+s,size:t.size}))}}else if(e.length>1){const s=e[0];let o=this.entry.children.get(s);if(!o)o=new d8({children:new Map,path:this.entry.path+"/"+s,type:an.Directory}),this.entry.children.set(s,o);else if(o.type===an.File)throw jw(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${s} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===an.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class z$t extends ${constructor(e,t,i,s){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=es.FileReadWrite|es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.extUri=new cO(()=>!1),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._onReportError=this._register(new I),this.onReportError=this._onReportError.event,this.mtimes=new Map,this.fileWriteBatch=[],this.writeManyThrottler=new tQ,s&&(this.changesBroadcastChannel=this._register(new iOe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:P.revive(r.resource)})))})))}watch(e,t){return $.None}async mkdir(e){try{if((await this.stat(e)).type===an.File)throw B3e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===an.File)return{type:an.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===an.Directory)return{type:an.Directory,ctime:0,mtime:0,size:0};throw Wpe}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==an.Directory)throw B3e;return[...t.children.entries()].map(([i,s])=>[i,s.type])}catch(t){throw this.reportError("readDir",t),t}}async readFile(e){try{const t=await this.indexedDB.runInTransaction(this.store,"readonly",o=>o.get(e.path));if(t===void 0)throw Wpe;const i=t instanceof Uint8Array?t:zt(t)?ze.fromString(t).buffer:void 0;if(i===void 0)throw jw(`IndexedDB entry at "${e.path}" in unexpected format`);return(await this.getFiletree()).add(e.path,{type:"file",size:i.byteLength}),i}catch(t){throw this.reportError("readFile",t),t}}async writeFile(e,t,i){try{if((await this.stat(e).catch(()=>{}))?.type===an.Directory)throw H$t;await this.bulkWrite([[e,t]])}catch(s){throw this.reportError("writeFile",s),s}}async rename(e,t,i){const s=await this.getFiletree(),o=s.read(e.path);if(!o)throw Wpe;const r=s.read(t.path);if(r){if(!i.overwrite)throw xs("file exists already",rt.FileExists);if(r.type!==o.type)throw xs("Cannot rename files with different types",rt.Unknown);await this.delete(t,{recursive:!0,useTrash:!1,atomic:!1})}const a=d=>this.extUri.joinPath(t,this.extUri.relativePath(e,e.with({path:d}))||""),c=await this.tree(e),l=[];for(const d of c)d[1]===an.File?l.push(d):d[1]===an.Directory&&s.add(a(d[0]).path,{type:"dir"});if(l.length){const d=[],h=await this.indexedDB.runInTransaction(this.store,"readonly",u=>l.map(([f])=>u.get(f)));for(let u=0;ur);else{if(i.type===an.Directory&&(await this.readdir(e)).length)throw U$t;s=[e.path]}await this.deleteKeys(s),(await this.getFiletree()).delete(e.path),s.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(s.map(o=>({resource:e.with({path:o}),type:Ko.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===an.Directory){const s=await this.readdir(e);for(const[o,r]of s){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===an.Directory){const c=await this.tree(a);i.push(...c)}}}return i}triggerChanges(e){e.length&&(this._onDidChangeFile.fire(e),this.changesBroadcastChannel?.postData(e))}getFiletree(){return this.cachedFiletree||(this.cachedFiletree=(async()=>{const e=new d8({children:new Map,path:"",type:an.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",s=>s.getAllKeys())).map(s=>s.toString()).forEach(s=>e.add(s,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,s])=>this.fileWriteBatch.push({content:s,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,s]of e)t.add(i.path,{type:"file",size:s.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:Ko.UPDATED})))}async writeMany(){if(this.fileWriteBatch.length){const e=this.fileWriteBatch.splice(0,this.fileWriteBatch.length);try{await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.put(i.content,i.resource.path)))}catch(t){throw t instanceof DOMException&&t.name==="QuotaExceededError"?V$t:t}}}async deleteKeys(e){e.length&&await this.indexedDB.runInTransaction(this.store,"readwrite",t=>e.map(i=>t.delete(i)))}async reset(){await this.indexedDB.runInTransaction(this.store,"readwrite",e=>e.clear())}reportError(e,t){this._onReportError.fire({scheme:this.scheme,operation:e,code:t instanceof Nx||t instanceof fDe?t.code:"unknown"})}}class $$t extends ude{constructor(e=dNe){super(),this.buffer=[],this._logger=void 0,this.setLevel(e),this._register(this.onDidChangeLogLevel(t=>{this._logger?.setLevel(t)}))}set logger(e){this._logger=e;for(const{level:t,message:i}of this.buffer)see(e,t,i);this.buffer=[]}log(e,t){this._logger?see(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}var JS;(function(n){n[n.None=0]="None",n[n.Untitled=2]="Untitled",n[n.Scratchpad=4]="Scratchpad"})(JS||(JS={}));const oOe="",G$t="modulepreload",q$t=function(n,e){return new URL(n,e).href},W3e={},Uhe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=r?.nonce||r?.getAttribute("nonce");s=Promise.allSettled(t.map(c=>{if(c=q$t(c,i),c in W3e)return;W3e[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(!!i)for(let f=o.length-1;f>=0;f--){const p=o[f];if(p.href===c&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":G$t,l||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),l)return new Promise((f,p)=>{u.addEventListener("load",f),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}return s.then(o=>{for(const r of o||[]){if(r.status!=="rejected")continue;const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r.reason,window.dispatchEvent(a),!a.defaultPrevented)throw r.reason}return e()})},Rh="utf8",dE="utf8bom",OF="utf16be",BF="utf16le",_X=[254,255],pDe=[255,254],B3=[239,187,191],Q$t=512,j$t=512,K$t=512*8,Y$t=512*128;var Nne;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(Nne||(Nne={}));class J$t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class rOe{static async create(e){let t;if(e!==Rh)t=(await Uhe(()=>import("./iconv-lite-umd-BRv7p1EY.js").then(s=>s.i),[],import.meta.url).then(s=>s.default??s)).getDecoder(aOe(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new rOe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function X$t(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?K$t:j$t;return new Promise((i,s)=>{const o=Xx(h=>h.join("")),r=[];let a=0,c;const l=new ai,d=async()=>{try{const h=await a8t({buffer:ze.concat(r),bytesRead:a},e.guessEncoding);if(h.seemsBinary&&e.acceptTextOnly)throw new J$t("Stream is binary but only text is accepted for decoding",Nne.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await rOe.create(h.encoding);const u=c.write(ze.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),s(h)}};hO(n,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(n.pause(),await d(),setTimeout(()=>n.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function Z$t(n,e,t){const s=(await Uhe(()=>import("./iconv-lite-umd-BRv7p1EY.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(aOe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=n.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Rh:case dE:return ze.wrap(Uint8Array.from(B3));case OF:return ze.wrap(Uint8Array.from(_X));case BF:return ze.wrap(Uint8Array.from(pDe))}const c=s.end();return c&&c.length>0?(o=!0,ze.wrap(c)):null}return o=!0,ze.wrap(s.write(a))}}}async function e8t(n){return(await Uhe(()=>import("./iconv-lite-umd-BRv7p1EY.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(aOe(n))}function aOe(n){return n===dE||n===null?Rh:n}function t8t(n,e){if(!n||e<_X.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===_X[0]&&i===_X[1])return OF;if(t===pDe[0]&&i===pDe[1])return BF;if(eimport("./index-BAaz2hCZ.js").then(r=>r.i),[],import.meta.url).then(r=>r.default??r),t=n.slice(0,Y$t),i=r8t(t.buffer),s=e.detect(i);if(!s||!s.encoding)return null;const o=s.encoding.toLowerCase();return 0<=i8t.indexOf(o)?null:o8t(s.encoding)}const s8t={ibm866:"cp866",big5:"cp950"};function o8t(n){const e=n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return s8t[e]||e}function r8t(n){let e="";for(let t=0;t({seemsBinary:!1,encoding:o})):{seemsBinary:s,encoding:i}}const P5={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom"},utf8bom:{labelLong:"UTF-8 with BOM",labelShort:"UTF-8 with BOM",encodeOnly:!0,order:2,alias:"utf8"},utf16le:{labelLong:"UTF-16 LE",labelShort:"UTF-16 LE",order:3},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5},iso88591:{labelLong:"Western (ISO 8859-1)",labelShort:"ISO 8859-1",order:6},iso88593:{labelLong:"Western (ISO 8859-3)",labelShort:"ISO 8859-3",order:7},iso885915:{labelLong:"Western (ISO 8859-15)",labelShort:"ISO 8859-15",order:8},macroman:{labelLong:"Western (Mac Roman)",labelShort:"Mac Roman",order:9},cp437:{labelLong:"DOS (CP 437)",labelShort:"CP437",order:10},windows1256:{labelLong:"Arabic (Windows 1256)",labelShort:"Windows 1256",order:11},iso88596:{labelLong:"Arabic (ISO 8859-6)",labelShort:"ISO 8859-6",order:12},windows1257:{labelLong:"Baltic (Windows 1257)",labelShort:"Windows 1257",order:13},iso88594:{labelLong:"Baltic (ISO 8859-4)",labelShort:"ISO 8859-4",order:14},iso885914:{labelLong:"Celtic (ISO 8859-14)",labelShort:"ISO 8859-14",order:15},windows1250:{labelLong:"Central European (Windows 1250)",labelShort:"Windows 1250",order:16},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22},koi8u:{labelLong:"Cyrillic (KOI8-U)",labelShort:"KOI8-U",order:23},iso885913:{labelLong:"Estonian (ISO 8859-13)",labelShort:"ISO 8859-13",order:24},windows1253:{labelLong:"Greek (Windows 1253)",labelShort:"Windows 1253",order:25},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28},iso885910:{labelLong:"Nordic (ISO 8859-10)",labelShort:"ISO 8859-10",order:29},iso885916:{labelLong:"Romanian (ISO 8859-16)",labelShort:"ISO 8859-16",order:30},windows1254:{labelLong:"Turkish (Windows 1254)",labelShort:"Windows 1254",order:31},iso88599:{labelLong:"Turkish (ISO 8859-9)",labelShort:"ISO 8859-9",order:32},windows1258:{labelLong:"Vietnamese (Windows 1258)",labelShort:"Windows 1258",order:33},gbk:{labelLong:"Simplified Chinese (GBK)",labelShort:"GBK",order:34},gb18030:{labelLong:"Simplified Chinese (GB18030)",labelShort:"GB18030",order:35},cp950:{labelLong:"Traditional Chinese (Big5)",labelShort:"Big5",order:36},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40},windows874:{labelLong:"Thai (Windows 874)",labelShort:"Windows 874",order:41},iso885911:{labelLong:"Latin/Thai (ISO 8859-11)",labelShort:"ISO 8859-11",order:42},koi8ru:{labelLong:"Cyrillic (KOI8-RU)",labelShort:"KOI8-RU",order:43},koi8t:{labelLong:"Tajik (KOI8-T)",labelShort:"KOI8-T",order:44},gb2312:{labelLong:"Simplified Chinese (GB 2312)",labelShort:"GB 2312",order:45},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}};var sT,ix;let mDe=(ix=class extends H1{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(a,r,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=s,this.preferredEncoding=o,this.workingCopyBackupService=c,this.textResourceConfigurationService=l,this.workingCopyService=d,this.textFileService=h,this.labelService=u,this.editorService=f,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeName=this._register(new I),this.onDidChangeName=this._onDidChangeName.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this.typeId=oOe,this.capabilities=JS.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),s&&this.setLanguageId(s),this.onConfigurationChange(void 0,!1),this.registerListeners()}registerListeners(){this._register(this.textResourceConfigurationService.onDidChangeConfiguration(e=>this.onConfigurationChange(e,!0)))}onConfigurationChange(e,t){if(!e||e.affectsConfiguration(this.resource,"files.encoding")){const i=this.textResourceConfigurationService.getValue(this.resource,"files.encoding");this.configuredEncoding!==i&&typeof i=="string"&&(this.configuredEncoding=i,t&&!this.preferredEncoding&&this._onDidChangeEncoding.fire())}if(!e||e.affectsConfiguration(this.resource,"workbench.editor.untitled.labelFormat")){const i=this.textResourceConfigurationService.getValue(this.resource,"workbench.editor.untitled.labelFormat");this.configuredLabelFormat!==i&&(i==="content"||i==="name")&&(this.configuredLabelFormat=i,t&&this._onDidChangeName.fire())}}setLanguageId(e,t){const i=e===sT.ACTIVE_EDITOR_LANGUAGE_ID?this.editorService.activeTextEditorLanguageId:e;this.preferredLanguageId=i,i&&super.setLanguageId(i,t)}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}getEncoding(){return this.preferredEncoding||this.configuredEncoding}async setEncoding(e){const t=this.getEncoding();this.preferredEncoding=e,t!==this.preferredEncoding&&this._onDidChangeEncoding.fire()}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){this.dirty!==e&&(this.dirty=e,this._onDidChangeDirty.fire())}async save(e){const t=await this.textFileService.save(this.resource,e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),!!t}async revert(){this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(hde(""))}finally{this.ignoreDirtyOnModelContentChange=!1}this.setDirty(!1),this._onDidRevert.fire()}async backup(e){let t;return this.isResolved()?t=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh}):typeof this.initialValue=="string"&&(t=Ije(ze.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let s;const o=await this.workingCopyBackupService.resolve(this);o?(s=o.value,t=!0):s=aQ(ze.fromString(this.initialValue||""));const r=await eNe(await this.textFileService.getDecodedStream(this.resource,s,{encoding:Rh}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=ws(this.textEditorModel);return this.installModelListeners(i),e&&((t||this.initialValue)&&this.updateNameFromFirstLine(i),this.setDirty(this.hasAssociatedFilePath||!!t||!!this.initialValue),(t||this.initialValue)&&this._onDidChangeContent.fire()),super.resolve()}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t))),this._register(e.onDidChangeLanguage(()=>this.onConfigurationChange(void 0,!0))),super.installModelListeners(e)}onModelContentChanged(e,t){this.ignoreDirtyOnModelContentChange||(!this.hasAssociatedFilePath&&e.getLineCount()===1&&e.getLineLength(1)===0?this.setDirty(!1):this.setDirty(!0)),t.changes.some(i=>(i.range.startLineNumber===1||i.range.endLineNumber===1)&&i.range.startColumn<=sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH)&&this.updateNameFromFirstLine(e),this._onDidChangeContent.fire(),this.autoDetectLanguage()}updateNameFromFirstLine(e){if(this.hasAssociatedFilePath)return;let t,i=e.getValueInRange({startLineNumber:1,endLineNumber:1,startColumn:1,endColumn:sT.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,bQe(i,sT.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&zq().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},sT=ix,ix.FIRST_LINE_NAME_MAX_LENGTH=40,ix.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=sT.FIRST_LINE_NAME_MAX_LENGTH*10,ix.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ix);mDe=sT=D([_(5,Di),_(6,Ai),_(7,MQ),_(8,dl),_(9,Pw),_(10,tr),_(11,eo),_(12,_i),_(13,LQ),_(14,Ur)],mDe);var W3;const c8t="vs/workbench/services/textfile/common/textFileEditorModel";var j0;let _De=(j0=class extends H1{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(o,s,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=r,this.textFileService=a,this.workingCopyBackupService=c,this.logService=l,this.workingCopyService=d,this.filesConfigurationService=h,this.labelService=u,this.pathService=m,this.extensionService=v,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.typeId=oOe,this.capabilities=JS.None,this.name=yr(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!Fn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.dirty=!1,this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,this.hasEncodingSetExplicitly=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.filesConfigurationService.onDidChangeFilesAssociation(()=>this.onDidChangeFilesAssociation())),this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}async onDidFilesChange(e){let t=!1,i;if(this.inOrphanMode?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.inOrphanMode!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.inOrphanMode!==e&&(this.inOrphanMode=e,this._onDidChangeOrphaned.fire())}onDidChangeFilesAssociation(){if(!this.isResolved())return;const e=this.getFirstLineText(this.textEditorModel),t=this.getOrCreateLanguage(this.resource,this.languageService,this.preferredLanguageId,e);this.textEditorModel.setLanguage(t)}setLanguageId(e,t){super.setLanguageId(e,t),this.preferredLanguageId=e}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.inOrphanMode});const i=await this.textFileService.getEncodedReadable(this.resource,this.createSnapshot()??void 0,{encoding:Rh});return{meta:t,content:i}}async revert(e){if(!this.isResolved())return;const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Zi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),vs("code/willResolveTextFileEditorModel"),this.isDisposed()){this.trace("resolve() - exit - without resolving because model is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because model is dirty or being saved");return}await this.doResolve(e),vs("code/didResolveTextFileEditorModel")}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents,e);if(!(!this.isResolved()&&await this.resolveFromBackup(e)))return this.resolveFromFile(e)}async resolveFromBuffer(e,t){this.trace("resolveFromBuffer()");let i,s,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,s=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),s=Date.now(),o=0,r=zv,this.setOrphaned(c.fileOperationResult===Zi.FILE_NOT_FOUND)}const a=await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding);this.resolveFromContent({resource:this.resource,name:this.name,mtime:i,ctime:s,size:o,etag:r,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Rh;return t&&(i=(await this.textFileService.encoding.getPreferredWriteEncoding(this.resource,this.preferredEncoding)).encoding),!this.isResolved()?t?(await this.doResolveFromBackup(t,i,e),!0):!1:(this.trace("resolveFromBackup() - exit - without resolving because previously new model got created meanwhile"),!0)}async doResolveFromBackup(e,t,i){this.trace("doResolveFromBackup()"),this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:await eNe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Rh})),encoding:t,readonly:!1,locked:!1},!0,i),e.meta?.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile,i=this.isResolved()||e?.allowBinary;let s;t?s=zv:this.lastResolvedFileStat&&(s=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:s,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),o!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(r,!1,e)}catch(r){const a=r.fileOperationResult;if(this.setOrphaned(a===Zi.FILE_NOT_FOUND),this.isResolved()&&a===Zi.FILE_NOT_MODIFIED_SINCE){r instanceof P$&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Zi.FILE_NOT_FOUND&&!t)return;throw r}}resolveFromContent(e,t,i){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because model is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0});const s=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):s!==this.contentEncoding&&this._onDidChangeEncoding.fire(),this.textEditorModel?this.doUpdateTextModel(e.value):this.doCreateTextModel(e.resource,e.value),this.setDirty(!!t),this._onDidResolve.fire(i?.reason??Zte.OTHER)}doCreateTextModel(e,t){this.trace("doCreateTextModel()");const i=this.createTextEditorModel(t,e,this.preferredLanguageId);this.installModelListeners(i),this.autoDetectLanguage()}doUpdateTextModel(e){this.trace("doUpdateTextModel()"),this.ignoreDirtyOnModelContentChange=!0;try{this.updateTextEditorModel(e,this.preferredLanguageId)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onDidChangeLanguage(()=>this.onMaybeShouldChangeEncoding())),super.installModelListeners(e)}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastModelContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.getAlternativeVersionId()===this.bufferSavedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire(),this.autoDetectLanguage()}async autoDetectLanguage(){await this.extensionService?.whenInstalledExtensionsRegistered();const e=this.getLanguageId();if(this.resource.scheme===this.pathService.defaultUriScheme&&(!e||e===Yc)&&!this.resourceHasExtension)return super.autoDetectLanguage()}async forceResolveFromFile(){this.isDisposed()||await this.textFileService.files.resolve(this.resource,{reload:{async:!1},forceReadFromFile:!0})}isDirty(){return this.dirty}isModified(){return this.isDirty()}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.bufferSavedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.updateSavedVersionId()),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.bufferSavedVersionId=o}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(uu.CONFLICT)||this.hasState(uu.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for model that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(uu.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.textEditorModel.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastModelContentChangeFromUndoRedo;r{try{const r=await this.textFileService.write(s.resource,o.createSnapshot(),{mtime:s.mtime,encoding:this.getEncoding(),etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource,o.getLanguageId())?zv:s.etag,unlock:e.writeUnlock,writeElevated:e.writeElevated});this.handleSaveSuccess(r,t,e)}catch(r){this.handleSaveError(r,t,e)}})())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[text file model] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString()]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Zi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.textFileService.files.saveErrorHandler.onSaveError(e,this,i),this._onDidSaveError.fire()}updateSavedVersionId(){this.isResolved()&&(this.bufferSavedVersionId=this.textEditorModel.getAlternativeVersionId())}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}hasState(e){switch(e){case uu.CONFLICT:return this.inConflictMode;case uu.DIRTY:return this.dirty;case uu.ERROR:return this.inErrorMode;case uu.ORPHAN:return this.inOrphanMode;case uu.PENDING_SAVE:return this.saveSequentializer.isRunning();case uu.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}getLanguageId(){return this.textEditorModel?this.textEditorModel.getLanguageId():this.preferredLanguageId}async onMaybeShouldChangeEncoding(){if(this.hasEncodingSetExplicitly){this.trace("onMaybeShouldChangeEncoding() - ignoring because encoding was set explicitly");return}if(this.contentEncoding===dE||this.contentEncoding===OF||this.contentEncoding===BF){this.trace("onMaybeShouldChangeEncoding() - ignoring because content encoding has a BOM");return}const{encoding:e}=await this.textFileService.encoding.getPreferredReadEncoding(this.resource);if(typeof e!="string"||!this.isNewEncoding(e)){this.trace(`onMaybeShouldChangeEncoding() - ignoring because preferred encoding ${e} is not new`);return}if(this.isDirty()){this.trace("onMaybeShouldChangeEncoding() - ignoring because model is dirty");return}return this.logService.info(`Adjusting encoding based on configured language override to '${e}' for ${this.resource.toString(!0)}.`),this.setEncodingInternal(e,Z7.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Z7.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:W3.TEXTFILE_SAVE_ENCODING_SOURCE});else{if(!this.isNewEncoding(e))return;this.isDirty()&&!this.inConflictMode&&await this.save(),this.updatePreferredEncoding(e),await this.forceResolveFromFile()}}updatePreferredEncoding(e){this.isNewEncoding(e)&&(this.preferredEncoding=e,this._onDidChangeEncoding.fire())}isNewEncoding(e){return!(this.preferredEncoding===e||!this.preferredEncoding&&this.contentEncoding===e)}getEncoding(){return this.preferredEncoding||this.contentEncoding}trace(e){this.logService.trace(`[text file model] ${e}`,this.resource.toString())}isResolved(){return!!this.textEditorModel}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inOrphanMode=!1,this.inErrorMode=!1,super.dispose()}},W3=j0,j0.TEXTFILE_SAVE_ENCODING_SOURCE=ote.registerSource("textFileEncoding.source",g(c8t,0,"File Encoding Changed")),j0.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,j0);_De=W3=D([_(3,Di),_(4,Ai),_(5,ci),_(6,tr),_(7,MQ),_(8,Ze),_(9,Pw),_(10,hh),_(11,eo),_(12,LQ),_(13,Ur),_(14,Lm),_(15,ho)],_De);const l8t="vs/workbench/services/textfile/common/textFileSaveParticipant";let vDe=class extends ${constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=FRe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(l8t,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.textEditorModel?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||!e.textEditorModel)break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.error(a)}}e.textEditorModel?.pushStackElement()},()=>{s.cancel()}).finally(()=>{s.dispose()})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};vDe=D([_(0,Cf),_(1,Ze)],vDe);const d8t="vs/workbench/services/textfile/common/textFileEditorModelManager";let wDe=class extends ${get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,s,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=s,this.uriIdentityService=o,this._onDidCreate=this._register(new I({leakWarningThreshold:500})),this.onDidCreate=this._onDidCreate.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidRemove=this._register(new I),this.onDidRemove=this._onDidRemove.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeEncoding=this._register(new I),this.onDidChangeEncoding=this._onDidChangeEncoding.event,this.mapResourceToModel=new wi,this.mapResourceToModelListeners=new wi,this.mapResourceToDisposeListener=new wi,this.mapResourceToPendingModelResolvers=new wi,this.modelResolveQueue=this._register(new sMe),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(d8t,0,"Failed to save '{0}': {1}",c.name,Ma(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(vDe)),this.registerListeners()}registerListeners(){this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onDidChangeFileSystemProviderCapabilities(e))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onDidChangeFileSystemProviderRegistrations(e))),this._register(this.workingCopyFileService.onWillRunWorkingCopyFileOperation(e=>this.onWillRunWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidFailWorkingCopyFileOperation(e=>this.onDidFailWorkingCopyFileOperation(e))),this._register(this.workingCopyFileService.onDidRunWorkingCopyFileOperation(e=>this.onDidRunWorkingCopyFileOperation(e)))}onDidFilesChange(e){for(const t of this.models)t.isDirty()||e.contains(t.resource,Ko.UPDATED,Ko.ADDED)&&this.queueModelReload(t)}onDidChangeFileSystemProviderCapabilities(e){this.queueModelReloads(e.scheme)}onDidChangeFileSystemProviderRegistrations(e){e.added&&this.queueModelReloads(e.scheme)}queueModelReloads(e){for(const t of this.models)t.isDirty()||e===t.resource.scheme&&this.queueModelReload(t)}queueModelReload(e){this.modelResolveQueue.queueSize(e.resource)<=1&&this.modelResolveQueue.queueFor(e.resource,async()=>{try{await this.reload(e)}catch(i){bt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=[];for(const{source:i,target:s}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,s))continue;const o=[];for(const r of this.models)this.uriIdentityService.extUri.isEqualOrParent(r.resource,i)&&o.push(r);for(const r of o){const a=r.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=s:c=Qt(s,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:r.getLanguageId(),encoding:r.getEncoding(),snapshot:r.isDirty()?r.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Li.MOVE||e.operation===Li.COPY){const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),t.forEach(i=>{i.snapshot&&this.get(i.source)?.setDirty(!0)}))}}onDidRunWorkingCopyFileOperation(e){switch(e.operation){case Li.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Li.MOVE:case Li.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await ko.settled(t.map(async i=>{const s=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(s,{reload:{async:!1},contents:i.snapshot?fQ(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Yc&&o.getLanguageId()===Yc&&uz(s)!==Gje&&o.updateTextEditorModel(void 0,i.languageId)})))})());break}}get(e){return this.mapResourceToModel.get(e)}has(e){return this.mapResourceToModel.has(e)}async reload(e){await this.joinPendingResolves(e.resource),!(e.isDirty()||e.isDisposed()||!this.has(e.resource))&&await this.doResolve(e,{reload:{async:!1}})}async resolve(e,t){const i=this.joinPendingResolves(e);return i&&await i,this.doResolve(e,t)}async doResolve(e,t){let i,s;P.isUri(e)?(s=e,i=this.get(s)):(s=e.resource,i=e);let o,r=!1;if(i)t?.contents?o=i.resolve(t):t?.reload?t.reload.async?(o=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){bt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(_De,s,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(s,o),this.add(s,i),r&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await o}catch(a){throw r&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(s)}return t?.languageId&&i.setLanguageId(t.languageId),r&&i.isDirty()&&this._onDidChangeDirty.fire(i),i}joinPendingResolves(e){if(this.mapResourceToPendingModelResolvers.get(e))return this.doJoinPendingResolves(e)}async doJoinPendingResolves(e){let t;for(;this.mapResourceToPendingModelResolvers.has(e);){const i=this.mapResourceToPendingModelResolvers.get(e);if(i===t)return;t=i;try{await i}catch{}}}registerModel(e){const t=new Z;t.add(e.onDidResolve(i=>this._onDidResolve.fire({model:e,reason:i}))),t.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire(e))),t.add(e.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire(e))),t.add(e.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire(e))),t.add(e.onDidSaveError(()=>this._onDidSaveError.fire(e))),t.add(e.onDidSave(i=>this._onDidSave.fire({model:e,...i}))),t.add(e.onDidRevert(()=>this._onDidRevert.fire(e))),t.add(e.onDidChangeEncoding(()=>this._onDidChangeEncoding.fire(e))),this.mapResourceToModelListeners.set(e.resource,t)}add(e,t){if(this.mapResourceToModel.get(e)===t)return;this.mapResourceToDisposeListener.get(e)?.dispose(),this.mapResourceToModel.set(e,t),this.mapResourceToDisposeListener.set(e,t.onWillDispose(()=>this.remove(e)))}remove(e){const t=this.mapResourceToModel.delete(e),i=this.mapResourceToDisposeListener.get(e);i&&(St(i),this.mapResourceToDisposeListener.delete(e));const s=this.mapResourceToModelListeners.get(e);s&&(St(s),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}canDispose(e){return e.isDisposed()||!this.mapResourceToPendingModelResolvers.has(e.resource)&&!e.isDirty()?!0:this.doCanDispose(e)}async doCanDispose(e){const t=this.joinPendingResolves(e.resource);return t?(await t,this.canDispose(e)):e.isDirty()?(await T.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),St(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),St(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};wDe=D([_(0,be),_(1,ci),_(2,Pi),_(3,fC),_(4,_o)],wDe);var vX;const Fm="vs/workbench/services/textfile/browser/textFileService";var K0;let bDe=(K0=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=s,this.modelService=o,this.environmentService=r,this.dialogService=a,this.fileDialogService=c,this.textResourceConfigurationService=l,this.filesConfigurationService=d,this.codeEditorService=h,this.pathService=u,this.workingCopyFileService=f,this.uriIdentityService=p,this.languageService=m,this.logService=v,this.elevatedFileService=w,this.decorationsService=b,this.files=this._register(this.instantiationService.createInstance(wDe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends ${constructor(t){super(),this.files=t,this.label=g(Fm,2,"Text File Model Decorations"),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.registerListeners()}registerListeners(){this._register(this.files.onDidResolve(({model:t})=>{(t.isReadonly()||t.hasState(uu.ORPHAN))&&this._onDidChange.fire([t.resource])})),this._register(this.files.onDidRemove(t=>this._onDidChange.fire([t]))),this._register(this.files.onDidChangeReadonly(t=>this._onDidChange.fire([t.resource]))),this._register(this.files.onDidChangeOrphaned(t=>this._onDidChange.fire([t.resource])))}provideDecorations(t){const i=this.files.get(t);if(!i||i.isDisposed())return;const s=i.isReadonly(),o=i.hasState(uu.ORPHAN);if(s&&o)return{color:pWe,letter:Ce.lockSmall,strikethrough:!0,tooltip:g(Fm,3,"Deleted, Read-only")};if(s)return{letter:Ce.lockSmall,tooltip:g(Fm,4,"Read-only")};if(o)return{color:pWe,strikethrough:!0,tooltip:g(Fm,5,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(CDe))),this._encoding}async read(e,t){const[i,s]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:s.detected.encoding||Rh,value:await gMe(s.stream,o=>o.join(""))}}async readStream(e,t){const[i,s]=await this.doRead(e,t);return{...i,encoding:s.detected.encoding||Rh,value:await eNe(s.stream)}}async doRead(e,t){const i=new ai;let s;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);s={...o,value:aQ(o.value)}}else s=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,s.value,t);return[s,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===Nne.STREAM_IS_BINARY?new GOt(g(Fm,6,"File seems to be binary and cannot be opened as text"),xV.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async s=>{const o=await this.getEncodedReadable(s.resource,s.value);return{resource:s.resource,contents:o,overwrite:s.options?.overwrite}}));return this.workingCopyFileService.create(i,qe.None,t)}async write(e,t,i){const s=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,s,i):this.fileService.writeFile(e,s,i)}async getEncodedReadable(e,t,i){const{encoding:s,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(s===Rh&&!o)return typeof t>"u"?void 0:jOt(t);t=t||"";const r=typeof t=="string"?QOt(t):t;return Z$t(r,s,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return X$t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),overwriteEncoding:async s=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,s??void 0);return o}})}async save(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i){let s;if(i.hasAssociatedFilePath?s=await this.suggestSavePath(e):s=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),s)return this.saveAs(e,s,t)}}else{const i=this.files.get(e);if(i)return await i.save(t)?e:void 0}}async saveAs(e,t,i){if(t||(t=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(i?.suggestedTarget??e),i?.availableFileSystems)),!!t){if(this.filesConfigurationService.isReadonly(t))if(await this.confirmMakeWriteable(t))this.filesConfigurationService.updateReadonly(t,!1);else return;return _n(e,t)?this.save(e,{...i,force:!0}):this.fileService.hasProvider(e)&&this.uriIdentityService.extUri.isEqual(e,t)&&await this.fileService.exists(e)?(await this.workingCopyFileService.move([{file:{source:e,target:t}}],qe.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let s=!1;const o=this.files.get(e);if(o?.isResolved())s=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),s=!0;else{const r=this.modelService.getModel(e);r&&(s=await this.doSaveAsTextFile(r,e,t,i))}if(s){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,s){let o;const r=e;typeof r.getEncoding=="function"&&(o=r.getEncoding());let a=!1,c=this.files.get(i);if(c?.isResolved())a=!0;else{a=await this.fileService.exists(i),a||await this.create([{resource:i,value:""}]);try{c=await this.files.resolve(i,{encoding:o})}catch(u){if(a&&(u.textFileOperationResult===xV.FILE_IS_BINARY||u.fileOperationResult===Zi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,s);throw u}}let l;if(e instanceof mDe&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,R9(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof H1?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(o),this.modelService.updateModel(h,fQ(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Yc&&f===Yc&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return s?.source||(s={...s,source:a?vX.TEXTFILE_SAVE_REPLACE_SOURCE:vX.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...s,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Fm,7,"'{0}' already exists. Do you want to replace it?",ui(e)),detail:g(Fm,8,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",ui(e),ui(ma(e))),primaryButton:g(Fm,9,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(Fm,10,"'{0}' is marked as read-only. Do you want to save anyway?",ui(e)),detail:g(Fm,11,"Paths can be configured as read-only via settings."),primaryButton:g(Fm,12,"&&Save Anyway")});return t}async suggestSavePath(e){if(this.fileService.hasProvider(e))return e;const t=this.environmentService.remoteAuthority,i=await this.fileDialogService.defaultFilePath();let s;if(e.scheme===_e.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return R9(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(Qt(i,o.name),o.name)?r=o.name:r=ui(e);const a=o.getLanguageId();a&&a!==Yc?s=this.suggestFilename(a,r):s=r}}return s||(s=ui(e)),Qt(i,s)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const s=T_(t),o=this.languageService.getExtensions(e);if(o.includes(s))return t;const r=k_(o);if(r)return s?`${t.substring(0,t.indexOf(s))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:k_(a)??t}async revert(e,t){if(e.scheme===_e.untitled){const i=this.untitled.get(e);if(i)return i.revert(t)}else{const i=this.files.get(e);if(i&&(i.isDirty()||t?.force))return i.revert(t)}}isDirty(e){const t=e.scheme===_e.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},vX=K0,K0.TEXTFILE_SAVE_CREATE_SOURCE=ote.registerSource("textFileCreate.source",g(Fm,0,"File Created")),K0.TEXTFILE_SAVE_REPLACE_SOURCE=ote.registerSource("textFileOverwrite.source",g(Fm,1,"File Replaced")),K0);bDe=vX=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,Za),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,jt),_(11,Lm),_(12,fC),_(13,_o),_(14,Di),_(15,Ze),_(16,IQ),_(17,rD)],bDe);let CDe=class extends ${get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,s){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=s,this._encodingOverrides=this.getDefaultEncodingOverrides(),this.registerListeners()}registerListeners(){this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.encodingOverrides=this.getDefaultEncodingOverrides()))}getDefaultEncodingOverrides(){const e=[];return e.push({parent:this.environmentService.userRoamingDataHome,encoding:Rh}),e.push({extension:qb,encoding:Rh}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Rh}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Qt(t.uri,".vscode"),encoding:Rh})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:s}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:s}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===OF||i===BF||i===dE}}async getPreferredReadEncoding(e,t,i){let s;t?.encoding?i===dE&&t.encoding===Rh?s=dE:s=t.encoding:typeof i=="string"?s=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===dE&&(s=Rh);const o=await this.getEncodingForResource(e,s);return{encoding:o,hasBOM:o===OF||o===BF||o===dE}}async getEncodingForResource(e,t){let i;const s=this.getEncodingOverride(e);return s?i=s:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Rh&&(!i||!await e8t(i))&&(i=Rh),i}getEncodingOverride(e){if(this.encodingOverrides?.length){for(const t of this.encodingOverrides)if(t.parent&&this.uriIdentityService.extUri.isEqualOrParent(e,t.parent)||t.extension&&uz(e)===`.${t.extension}`)return t.encoding}}};CDe=D([_(0,dl),_(1,Za),_(2,Ti),_(3,_o)],CDe);let yDe=class extends bDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,w,v,b),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(uu.PENDING_SAVE))}};yDe=D([_(0,ci),_(1,RQ),_(2,mg),_(3,be),_(4,Ai),_(5,Za),_(6,To),_(7,bf),_(8,dl),_(9,hh),_(10,jt),_(11,Lm),_(12,fC),_(13,_o),_(14,Di),_(15,IQ),_(16,Ze),_(17,rD)],yDe);var IC,DP;let SDe=(DP=class extends ${constructor(e,t,i,s){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=s,this._onExpressionChange=this._register(new I),this.onExpressionChange=this._onExpressionChange.event,this.mapFolderToParsedExpression=new Map,this.mapFolderToConfiguredExpression=new Map,this.updateExpressions(!1),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{this.shouldUpdate(e)&&this.updateExpressions(!0)})),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.updateExpressions(!0)))}updateExpressions(e){let t=!1;for(const r of this.contextService.getWorkspace().folders){const a=r.uri.toString(),c=this.doGetExpression(r.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Io(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,_w(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new o1(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==IC.NO_FOLDER&&(i.has(P.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const s=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER);s?(!o||!Io(o.expression,s.expression))&&(t=!0,this.mapFolderToParsedExpression.set(IC.NO_FOLDER,_w(s.expression)),this.mapFolderToConfiguredExpression.set(IC.NO_FOLDER,s)):o&&(t=!0,this.mapFolderToParsedExpression.delete(IC.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(IC.NO_FOLDER)),e&&t&&this._onExpressionChange.fire()}doGetExpression(e){const t=this.getExpression(e);if(!t)return;const i=Object.keys(t);if(i.length===0)return;let s=!1;const o=Object.create(null);for(const r of i){s||(s=oF(r));let a=r;const c=$ht(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:s}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let s,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(s=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(s=this.mapFolderToParsedExpression.get(IC.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(IC.NO_FOLDER)),!s)return!1;let r;return i?r=lO(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&s(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!s(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===_e.file?e.fsPath:e.path}},IC=DP,DP.NO_FOLDER=null,DP);SDe=IC=D([_(2,Ti),_(3,Re)],SDe);var Kw;const F5="vs/workbench/services/filesConfiguration/common/filesConfigurationService",h8t=new Y("autoSaveAfterShortDelayContext",!1,!0);var Vc;(function(n){n[n.OFF=0]="OFF",n[n.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",n[n.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",n[n.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",n[n.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(Vc||(Vc={}));var Kf;(function(n){n[n.SETTINGS=1]="SETTINGS",n[n.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",n[n.ERRORS=3]="ERRORS",n[n.DISABLED=4]="DISABLED"})(Kf||(Kf={}));var nx;let ADe=(nx=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=s,this.uriIdentityService=o,this.fileService=r,this.markerService=a,this.textResourceConfigurationService=c,this._onDidChangeAutoSaveConfiguration=this._register(new I),this.onDidChangeAutoSaveConfiguration=this._onDidChangeAutoSaveConfiguration.event,this._onDidChangeAutoSaveDisabled=this._register(new I),this.onDidChangeAutoSaveDisabled=this._onDidChangeAutoSaveDisabled.event,this._onDidChangeFilesAssociation=this._register(new I),this.onDidChangeFilesAssociation=this._onDidChangeFilesAssociation.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.autoSaveConfigurationCache=new L_(1e3),this.autoSaveDisabledOverrides=new wi,this.autoSaveAfterShortDelayContext=h8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new kve(()=>this.createReadonlyMatcher(wJe))),this.readonlyExcludeMatcher=this._register(new kve(()=>this.createReadonlyMatcher(bJe))),this.sessionReadonlyOverrides=new wi(d=>this.uriIdentityService.extUri.getComparisonKey(d));const l=t.getValue();this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,l.files),this.currentFilesAssociationConfiguration=l?.files?.associations,this.currentHotExitConfiguration=l?.files?.hotExit||Ng.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new SDe(i=>this.configurationService.getValue(e,{resource:i}),i=>i.affectsConfiguration(e),this.contextService,this.configurationService));return this._register(t.onExpressionChange(()=>this._onDidChangeReadonly.fire())),t}isReadonly(e,t){const i=this.fileService.getProvider(e.scheme);if(i&&GEt(i))return i.readOnlyMessage??Kw.READONLY_MESSAGES.providerReadonly;const s=this.sessionReadonlyOverrides.get(e);return typeof s=="boolean"?s===!0?Kw.READONLY_MESSAGES.sessionReadonly:!1:this.uriIdentityService.extUri.isEqualOrParent(e,this.environmentService.userRoamingDataHome)||this.uriIdentityService.extUri.isEqual(e,this.contextService.getWorkspace().configuration??void 0)?!1:this.readonlyIncludeMatcher.value.matches(e)?this.readonlyExcludeMatcher.value.matches(e)?!1:Kw.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Kw.READONLY_MESSAGES.fileLocked:t?.readonly?Kw.READONLY_MESSAGES.fileReadonly:!1}async updateReadonly(e,t){if(t==="toggle"){let i;try{i=await this.fileService.resolve(e,{resolveMetadata:!0})}catch{}t=!this.isReadonly(e,i)}t==="reset"?this.sessionReadonlyOverrides.delete(e):this.sessionReadonlyOverrides.set(e,t),this._onDidChangeReadonly.fire()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("files")&&this.onFilesConfigurationChange(this.configurationService.getValue(),!0)}))}onFilesConfigurationChange(e,t){this.currentGlobalAutoSaveConfiguration=this.computeAutoSaveConfiguration(void 0,e.files),this.autoSaveConfigurationCache.clear(),this.autoSaveAfterShortDelayContext.set(this.getAutoSaveMode(void 0).mode===Vc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Io(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const s=e?.files?.hotExit;s===Ng.OFF||s===Ng.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=s:this.currentHotExitConfiguration=Ng.ON_EXIT;const o=!!e?.files?.readonlyFromPermissions;o!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=o,t&&this._onDidChangeReadonly.fire())}getAutoSaveConfiguration(e){const t=this.toResource(e);if(t){let i=this.autoSaveConfigurationCache.get(t);return i||(i=this.computeAutoSaveConfiguration(t,this.textResourceConfigurationService.getValue(t,"files")),this.autoSaveConfigurationCache.set(t,i)),i}return this.currentGlobalAutoSaveConfiguration}computeAutoSaveConfiguration(e,t){let i,s,o,r,a,c;switch(t.autoSave??Kw.DEFAULT_AUTO_SAVE_MODE){case $l.AFTER_DELAY:{i="afterDelay",s=typeof t.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Kw.DEFAULT_AUTO_SAVE_DELAY,c=s<=Kw.DEFAULT_AUTO_SAVE_DELAY;break}case $l.ON_FOCUS_CHANGE:i="onFocusChange";break;case $l.ON_WINDOW_CHANGE:i="onWindowChange";break}return t.autoSaveWorkspaceFilesOnly===!0&&(o=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t.autoSaveWhenNoErrors===!0&&(r=!0,c=void 0),{autoSave:i,autoSaveDelay:s,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof cC?jc.getOriginalUri(e,{supportSideBySide:go.PRIMARY}):e}hasShortAutoSaveDelay(e){const t=this.toResource(e);return this.getAutoSaveConfiguration(t).isShortAutoSaveDelay?!t||!this.autoSaveDisabledOverrides.has(t):!1}getAutoSaveMode(e,t){const i=this.toResource(e);if(i&&this.autoSaveDisabledOverrides.has(i))return{mode:Vc.OFF,reason:Kf.DISABLED};const s=this.getAutoSaveConfiguration(i);if(typeof s.autoSave>"u")return{mode:Vc.OFF,reason:Kf.SETTINGS};if(typeof t=="number"&&(s.autoSave==="afterDelay"&&t!==Ln.AUTO||s.autoSave==="onFocusChange"&&t!==Ln.FOCUS_CHANGE&&t!==Ln.WINDOW_CHANGE||s.autoSave==="onWindowChange"&&t!==Ln.WINDOW_CHANGE))return{mode:Vc.OFF,reason:Kf.SETTINGS};if(i){if(s.autoSaveWorkspaceFilesOnly&&s.isOutOfWorkspace)return{mode:Vc.OFF,reason:Kf.OUT_OF_WORKSPACE};if(s.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ys.Error}).length>0)return{mode:Vc.OFF,reason:Kf.ERRORS}}switch(s.autoSave){case"afterDelay":return typeof s.autoSaveDelay=="number"&&s.autoSaveDelay<=Kw.DEFAULT_AUTO_SAVE_DELAY?{mode:s.autoSaveWhenNoErrors?Vc.AFTER_LONG_DELAY:Vc.AFTER_SHORT_DELAY}:{mode:Vc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:Vc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:Vc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE].some(i=>i===e)?t=$l.OFF:t=$l.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return $.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const s=this.autoSaveDisabledOverrides.get(t)??0;s<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,s-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Ng.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Kw=nx,nx.DEFAULT_AUTO_SAVE_MODE=Jn?$l.AFTER_DELAY:$l.OFF,nx.DEFAULT_AUTO_SAVE_DELAY=1e3,nx.READONLY_MESSAGES={providerReadonly:{value:g(F5,0,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(F5,1,"Editor is read-only because the file was set read-only in this session. [Click here](command:{0}) to set writeable.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},configuredReadonly:{value:g(F5,2,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure.",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`),isTrusted:!0},fileLocked:{value:g(F5,3,"Editor is read-only because of file permissions. [Click here](command:{0}) to set writeable anyway.","workbench.action.files.setActiveEditorWriteableInSession"),isTrusted:!0},fileReadonly:{value:g(F5,4,"Editor is read-only because the file is read-only."),isTrusted:!0}},nx);ADe=Kw=D([_(0,Pe),_(1,Re),_(2,Ti),_(3,Il),_(4,_o),_(5,ci),_(6,U_),_(7,dl)],ADe);class u8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const dn="vs/workbench/contrib/files/browser/files.contribution",cOe=it.as(Cs.Configuration),g8t=rf?{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,1,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`"),g(dn,2,"Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it's the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:ut.APPLICATION,enum:[Ng.OFF,Ng.ON_EXIT_AND_WINDOW_CLOSE],default:Ng.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(dn,0,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(dn,4,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(dn,3,"[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.",Ng.ON_EXIT,Ng.ON_EXIT_AND_WINDOW_CLOSE)};cOe.registerConfiguration({id:"files",order:9,title:g(dn,5,"Files"),type:"object",properties:{[qEt]:{type:"object",markdownDescription:g(dn,6,"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."),default:{"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0,...Jn?{"**/*.crswap":!0}:void 0},scope:ut.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(dn,7,"Enable the pattern."),g(dn,8,"Disable the pattern.")],description:g(dn,9,"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.")},{type:"object",properties:{when:{type:"string",pattern:"\\w*\\$\\(basename\\)\\w*",default:"$(basename).ext",markdownDescription:g(dn,10,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[SNe]:{type:"object",markdownDescription:g(dn,11,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `"*.extension": "html"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed.'),additionalProperties:{type:"string"}},"files.encoding":{type:"string",enum:Object.keys(P5),default:"utf8",description:g(dn,12,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:ut.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(P5).map(n=>P5[n].labelLong),enumItemLabels:Object.keys(P5).map(n=>P5[n].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(dn,13,"When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.","`#files.encoding#`"),scope:ut.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` `,`\r -`,"auto"],enumDescriptions:[g(dn,14,"LF"),g(dn,15,"CRLF"),g(dn,16,"Uses operating system specific end of line character.")],default:"auto",description:g(dn,17,"The default end of line character."),scope:ut.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(dn,18,"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.")},"files.trimTrailingWhitespace":{type:"boolean",default:!1,description:g(dn,19,"When enabled, will trim trailing whitespace when saving a file."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(dn,20,"When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."),scope:ut.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(dn,21,"When enabled, insert a final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(dn,22,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(dn,23,"An editor with changes is never automatically saved."),g(dn,24,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(dn,25,"An editor with changes is automatically saved when the editor loses focus."),g(dn,26,"An editor with changes is automatically saved when the window loses focus.")],default:Jn?$l.AFTER_DELAY:$l.OFF,markdownDescription:g(dn,27,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE,$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(dn,28,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(dn,29,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(dn,30,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.watcherExclude":{type:"object",patternProperties:{".*":{type:"boolean"}},default:{"**/.git/objects/**":!0,"**/.git/subtree-cache/**":!0,"**/node_modules/*/**":!0,"**/.hg/store/**":!0},markdownDescription:g(dn,31,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."),scope:ut.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(dn,32,"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."),scope:ut.RESOURCE},"files.hotExit":g8t,"files.defaultLanguage":{type:"string",markdownDescription:g(dn,33,"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.")},[wJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,34,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[bJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,35,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[QEt]:{type:"boolean",markdownDescription:g(dn,36,"Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."),default:!1},"files.restoreUndoStack":{type:"boolean",description:g(dn,37,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(dn,38,"Will refuse to save and ask for resolving the save conflict manually."),g(dn,39,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(dn,40,"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."),default:"askUser",scope:ut.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(dn,41,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(dn,42,"Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."),scope:ut.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(dn,43,"Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."),default:!1},"files.participants.timeout":{type:"number",default:6e4,markdownDescription:g(dn,44,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});cOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});cOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});class O5{constructor(){this.type=an.Directory,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.type=an.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:an.Directory}}delete(){this._onDidDelete.fire()}addChild(e,t){this.entries.set(e,t),this._onDidChange.fire();const i={dispose:()=>{this.deleteChild(e)}};return t.onDidDelete(()=>{i.dispose()}),i}deleteChild(e){return this.entries.delete(e)?(this.mtime=Date.now(),this._onDidChange.fire(),this.entries.size===0&&this.delete(),!0):!1}getChildren(e){return this.entries.get(e)}read(){return Array.from(this.entries.entries()).map(([e,t])=>[e,t.type])}}class f8t{constructor(e,t){this.uri=e,this.readonly=t,this.type=an.File,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.onDidChange(()=>{this.mtime=Date.now()})}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:await this.getSize(),type:an.File,permissions:this.readonly?vm.Readonly:void 0}}async delete(){if(this.readonly)throw xs("Not allowed",rt.FileWriteLocked);this._onDidDelete.fire()}}new TextEncoder;class p8t extends ${constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[],this.rootByAuthority=new Map,this.capabilities=1042,e&&(this.capabilities|=2048)}async open(e){const t=await this.readFile(e),i=this.memoryFdCounter++;return this.fdMemory.set(i,t),i}async close(e){this.fdMemory.delete(e)}async read(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),a.byteLength}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}_lookupRoot(e){const t=e.toLowerCase();let i=this.rootByAuthority.get(t);return i==null&&(i=new O5,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let o=this._lookupRoot(e.authority);for(const r of i){if(r.length===0)continue;let a;if(o instanceof O5&&(a=o.getChildren(r)),a==null){if(t)return;throw xs("file not found",rt.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof O5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===an.File)return i;throw xs("file is a directory",rt.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),s=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;s=Fn.joinPath(s,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(s)),!(c instanceof O5))throw new Error(`file '${s.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${Fn.joinPath(s,o).toString()}/' already exists`);const r=new Z;return r.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),r.add(e.onDidDelete(()=>{r.dispose()})),r.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),r.add(i.addChild(o,e)),this._fireSoon({resource:e.uri,type:1}),r}async stat(e){return this._lookup(e,!1).stats()}readdirSync(e){return this._lookupAsDirectory(e,!1).read()}async readdir(e){return this.readdirSync(e)}async readFile(e){return await this._lookupAsFile(e,!1).read()}readFileStream(e,t,i){const s=this._lookupAsFile(e,!1),o=Xx(r=>ze.concat(r.map(a=>ze.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(s.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await s.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await s.readStream()).getReader();let a=await r.read();for(;!a.done&&!(i.isCancellationRequested||(await o.write(a.value),i.isCancellationRequested));)a=await r.read();o.end(void 0)}}catch(r){o.error(xs(r,rt.Unknown)),o.end()}})(),o}watch(){return $.None}async writeFile(e,t,i){const s=this._lookup(e,!0);if(s!=null&&!(s instanceof f8t))throw xs("file is directory",rt.FileIsADirectory);if(s==null)throw xs("file not found",rt.FileNotFound);if(!i.overwrite)throw xs("file exists already",rt.FileExists);await s.write(t)}async rename(){throw xs("Not allowed",rt.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new O5,r=new Z;return r.add(o.onDidDelete(()=>{r.dispose(),this._fireSoon({resource:e,type:2})})),r.add(o.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),s.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw xs("Can' create a directory",rt.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw xs("Not found",rt.FileNotFound);if(t.type===an.Directory)throw xs("Can't delete a directory",rt.NoPermissions);t.delete()}async delete(e){this.deleteSync(e)}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle!=null&&(clearTimeout(this._fireSoonHandle),this._fireSoonHandle=void 0),this._fireSoonHandle=window.setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}}function H3e(n){return n.status==="fulfilled"}class Ost{constructor(){this.providers=[],this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._onDidChangeOverlays=new I,this.onDidChangeOverlays=this._onDidChangeOverlays.event,this.capabilities=1042}register(e,t){const i={priority:e,provider:t};this.providers.push(i),this.providers.sort((o,r)=>r.priority-o.priority);const s=new Z;return s.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),s.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),s}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);let i;for(const s of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(s)}catch(o){if(i??(i=o),o instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(i.code))continue;throw i}throw xs("Not allowed",rt.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),s=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(s?vm.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(dJ(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;hO(r,{onData(d){l=!0,s.write(d)},onEnd(){s.end(),a()},onError(d){l?s.error(d):c(d)}},i)})}else{let r=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),s.end(r)}},i).catch(o=>{s.error(o)}),s}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(H3e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(H3e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const s of this.delegates)i.add(s.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async s=>{let o;try{o=await s.stat(e)}catch{}if(o!=null&&((o.permissions??0)&vm.Readonly)>0)throw xs("Not allowed",rt.NoPermissions);return s.writeFile(e,t,i)})}async mkdir(e){await this.writeToDelegates(t=>t.mkdir(e))}async delete(e,t){await this.writeToDelegates(i=>i.delete(e,t))}async rename(e,t,i){await this.writeToDelegates(s=>s.rename(e,t,i))}}class m8t extends Mne{async writeFile(e,t,i){return await Fst(Fn,this,Fn.dirname(e)),super.writeFile(e,t,i)}}const Bst=new Ost;Bst.register(0,new m8t);const _8t=new p8t(!0),Wst=new Mne;Wst.mkdir(P.from({scheme:_e.vscodeUserData,path:"/User/"}));var k6;(function(n){n.extensionFile="extension-file"})(k6||(k6={}));const v8t={[k6.extensionFile]:_8t,[Pnt.scheme]:new Mne,[_e.vscodeUserData]:Wst,[_e.tmp]:new Mne,[_e.file]:Bst};let EDe=class extends gDe{constructor(e,t){super(e);for(const[i,s]of Object.entries(v8t)){let o=this.registerProvider(i,s);s instanceof Ost&&s.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,s)}),s instanceof z$t&&this._register(s.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};EDe=D([_(1,on)],EDe);const Hst=new $$t;VFe(async n=>{Hst.logger=n.get(Ze)});function lOe(){return{[ci.toString()]:new $i(EDe,[Hst],!0),[tr.toString()]:new $i(yDe,[],!0),[hh.toString()]:new $i(ADe,[],!0),[IQ.toString()]:new $i(u8t,[],!0)}}function w8t(n,e){if(n.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const s of n){if(s===!0)return Promise.resolve(!0);NS(s)&&t.push(s.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return ko.settled(t).then(()=>i)}var KV;(function(n){n[n.WebSocket=0]="WebSocket",n[n.Managed=1]="Managed"})(KV||(KV={}));class Ust{constructor(e){this.id=e,this.type=KV.Managed}toString(){return`Managed(${this.id})`}}class Vst{constructor(e,t){this.host=e,this.port=t,this.type=KV.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var Xd;(function(n){n.Unknown="Unknown",n.NotAvailable="NotAvailable",n.TemporarilyNotAvailable="TemporarilyNotAvailable",n.NoResolverFound="NoResolverFound",n.InvalidAuthority="InvalidAuthority"})(Xd||(Xd={}));let HI=class oT extends hc{static isNotAvailable(e){return e instanceof oT&&e._code===Xd.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof oT&&e._code===Xd.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof oT&&e._code===Xd.NoResolverFound}static isInvalidAuthority(e){return e instanceof oT&&e._code===Xd.InvalidAuthority}static isHandled(e){return e instanceof oT&&e.isHandled}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===Xd.NotAvailable&&i===!0,Object.setPrototypeOf(this,oT.prototype)}};function Pne(n){const e=n.indexOf("+");return e===-1?n:n.substring(0,e)}class b8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class UI{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const s=i.getExtensionDescription(e);return s?!!((s.main||s.browser)&&s.api==="none"):!1}constructor(e,t){this._activationEventsReader=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(x8t),this._extensionsMap=new $a,this._extensionsArr=[],this._activationMap=new Map;for(const e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);const t=this._activationEventsReader.readActivationEvents(e);for(const i of t)this._activationMap.has(i)||this._activationMap.set(i,[]),this._activationMap.get(i).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(e,t){this._extensionDescriptions=U3e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=UI._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=U3e(this._extensionDescriptions,i.map(s=>s.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new b8t(this._versionId,i)}static _findLoopingExtensions(e){const t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(a){this._nodesSet.has(a)||(this._nodesSet.add(a),this._nodesArr.push(a))}addArc(a,c){this.addNode(a),this.addNode(c),this._arcs.has(a)?this._arcs.get(a).push(c):this._arcs.set(a,[c])}getArcs(a){return this._arcs.has(a)?this._arcs.get(a):[]}hasOnlyGoodArcs(a,c){const l=t.getArcs(a);for(let d=0;dt.getArcs(a).length===0).forEach(a=>s.add(a));const o=t.getNodes().filter(a=>!s.has(a));let r;do{r=!1;for(let a=0;ai.get(a))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){const t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new C8t(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){const t=this._extensionsMap.get(e);return t||void 0}getExtensionDescriptionByUUID(e){for(const t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}}class C8t{constructor(e,t){this.versionId=e,this.extensions=t}}class y8t{constructor(e){this._lock=new E8t,this._actual=new UI(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new S8t(this,t)}deltaExtensions(e,t,i){if(!e.isAcquiredFor(this))throw new Error("Lock is not held");return this._actual.deltaExtensions(t,i)}containsActivationEvent(e){return this._actual.containsActivationEvent(e)}containsExtension(e){return this._actual.containsExtension(e)}getExtensionDescriptionsForActivationEvent(e){return this._actual.getExtensionDescriptionsForActivationEvent(e)}getAllExtensionDescriptions(){return this._actual.getAllExtensionDescriptions()}getSnapshot(){return this._actual.getSnapshot()}getExtensionDescription(e){return this._actual.getExtensionDescription(e)}getExtensionDescriptionByUUID(e){return this._actual.getExtensionDescriptionByUUID(e)}getExtensionDescriptionByIdOrUUID(e,t){return this._actual.getExtensionDescriptionByIdOrUUID(e,t)}}class S8t extends ${constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class A8t{constructor(e){this.name=e;const t=NU();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class E8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new A8t(e);return this._pendingCustomers.push(t),this._advance(),t.promise}_advance(){if(this._isLocked||this._pendingCustomers.length===0)return;const e=this._pendingCustomers.shift();this._isLocked=!0;let t=!0;const i=setTimeout(()=>{t&&console.warn(`The customer named ${e.name} has been holding on to the lock for 30s. This might be a problem.`)},30*1e3),s=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(s))}}var ik;(function(n){n[n.Builtin=0]="Builtin",n[n.User=1]="User",n[n.Dev=2]="Dev"})(ik||(ik={}));function x8t(n,e){const t=n.isBuiltin?ik.Builtin:n.isUnderDevelopment?ik.Dev:ik.User,i=e.isBuiltin?ik.Builtin:e.isUnderDevelopment?ik.Dev:ik.User;if(t!==i)return t-i;const s=qi.basename(n.extensionLocation.path),o=qi.basename(e.extensionLocation.path);return so?1:0}function U3e(n,e){const t=new $v(e);return n.filter(i=>!t.has(i.identifier))}function dOe(n){const e=n.isExtensionDevelopment;let t=!0;const i=n.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==_e.file&&(t=!1);const s=t&&typeof n.debugExtensionHost.port=="number",o=t&&!!n.debugExtensionHost.break,r=e&&!!n.extensionTestsLocationURI&&!n.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:s,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var Ao;(function(n){n[n.LocalProcess=1]="LocalProcess",n[n.LocalWebWorker=2]="LocalWebWorker",n[n.Remote=3]="Remote"})(Ao||(Ao={}));function hE(n){if(n===null)return"None";switch(n){case Ao.LocalProcess:return"LocalProcess";case Ao.LocalWebWorker:return"LocalWebWorker";case Ao.Remote:return"Remote"}}var rp;(function(n){n[n.None=0]="None",n[n.Local=1]="Local",n[n.Remote=2]="Remote"})(rp||(rp={}));function D8t(n){switch(n){case rp.None:return"None";case rp.Local:return"Local";case rp.Remote:return"Remote"}}function k8t(n,e,t,i){const s=V3e(n,t),o=V3e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=s.get(l.key)||null,h=o.get(l.key)||null,u=new L8t(d,h);r.set(u.key,u)};s.forEach(l=>a(l)),o.forEach(l=>a(l));const c=new Map;return r.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=rp.None;u&&!f?p=rp.Local:f&&!u&&(p=rp.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function V3e(n,e){const t=new Map;return n.forEach(i=>{const s=new I8t(i,e(i));t.set(s.key,s)}),t}class I8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Cn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class L8t{constructor(e,t){this.local=e,this.remote=t}get key(){return this.local?this.local.key:this.remote.key}get identifier(){return this.local?this.local.desc.identifier:this.remote.desc.identifier}get kind(){return this.local?this.local.kind:this.remote.kind}}function Zi(n){return function(e){YV.INSTANCE.registerNamedCustomer(n,e)}}function TO(n){YV.INSTANCE.registerCustomer(n)}var Fne;(function(n){function e(){return YV.INSTANCE.getNamedCustomers()}n.getNamedCustomers=e;function t(){return YV.INSTANCE.getCustomers()}n.getCustomers=t})(Fne||(Fne={}));const ele=class ele{constructor(){this._namedCustomers=[],this._customers=[]}registerNamedCustomer(e,t){const i=[e,t];this._namedCustomers.push(i)}getNamedCustomers(){return this._namedCustomers}registerCustomer(e){this._customers.push(e)}getCustomers(){return this._customers}};ele.INSTANCE=new ele;let YV=ele;function zst(n,e,t,i){if(!n||i>200)return null;if(typeof n=="object"){if(n.$mid===Fs.Uri)return t?P.revive(e.transformIncoming(n)):e.transformIncoming(n);if(n instanceof ze)return null;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const o=zst(n[s],e,t,i+1);o!==null&&(n[s]=o)}}return null}function B5(n,e){const t=zst(n,e,!1,0);return t===null?n:t}class $st{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||(this._actual=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)})),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):bt(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}}class T8t extends $st{constructor(){super(),this._hasErr=!0,this._err=new Tc}}const tle=class tle{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++tle.count}};tle.count=0;let One=tle;const Gst=[];function Xe(n){const e=new One(n);return Gst[e.nid]=e,e}function tY(n){return Gst[n].sid}class $h{constructor(e){this.value=e}}var z3e;function xDe(n,e){try{return JSON.stringify(n,e)}catch{return"null"}}const hOe="$$ref$$",R8t={[hOe]:-1};function $3e(n,e=null,t=!1){const i=[];return{jsonString:(t?xDe:JSON.stringify)(n,(o,r)=>{if(typeof r>"u")return R8t;if(typeof r=="object"){if(r instanceof ze){const a=i.push(r)-1;return{[hOe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function qst(n,e,t){return JSON.parse(n,(i,s)=>{if(s){const o=s[hOe];if(typeof o=="number")return e[o];if(t&&s.$mid===Fs.Uri)return t.transformIncoming(s)}return s})}function G3e(n,e){return JSON.stringify(n,e)}function M8t(n){return n?(e,t)=>t&&t.$mid===Fs.Uri?n.transformOutgoing(t):t:null}var zf;(function(n){n[n.LocalSide=0]="LocalSide",n[n.OtherSide=1]="OtherSide"})(zf||(zf={}));var DM;(function(n){n[n.Responsive=0]="Responsive",n[n.Unresponsive=1]="Unresponsive"})(DM||(DM={}));const N8t=()=>{},P8t=Symbol.for("rpcProtocol"),F8t=Symbol.for("rpcProxy"),a9=class a9 extends ${constructor(e,t=null,i=null){super(),this[z3e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=M8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let s=0,o=One.count;sthis._checkUnresponsive(),1e3)),this._protocol.onMessage(s=>this._receiveOneMessage(s))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(rx())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(DM.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(DM.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?B5(e,this._uriTransformer):e}getProxy(e){const{nid:t,sid:i}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,i)),this._proxies[t]}_createProxy(e,t){const i={get:(s,o)=>(typeof o=="string"&&!s[o]&&o.charCodeAt(0)===q.DollarSign&&(s[o]=(...r)=>this._remoteCall(e,o,r)),o===F8t?t:s[o])};return new Proxy(Object.create(null),i)}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,i=e.length;th.cancel()}else c=this._invokeHandler(i,s,o),l=N8t;this._cancelInvokedHandlers[a]=l;const d=Om.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,zf.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Om.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Om.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,zf.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReply:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReplyErr:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s];let r;i&&(i.$isError?(r=new Error,r.name=i.name,r.message=i.message,r.stack=i.stack):r=i),o.resolveErr(r)}_invokeHandler(e,t,i){try{return Promise.resolve(this._doInvokeHandler(e,t,i))}catch(s){return Promise.reject(s)}}_doInvokeHandler(e,t,i){const s=this._locals[e];if(!s)throw new Error("Unknown actor "+tY(e));const o=s[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+tY(e));return o.apply(s,i)}_remoteCall(e,t,i){if(this._isDisposed)return new T8t;let s=null;if(i.length>0&&qe.isCancellationToken(i[i.length-1])&&(s=i.pop()),s&&s.isCancellationRequested)return Promise.reject(rx());const o=Om.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new $st,l=new Z;s&&l.add(s.onCancellationRequested(()=>{const h=Om.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,zf.LocalSide,"cancel"),this._protocol.send(Om.serializeCancel(r))})),this._pendingRPCReplies[a]=new O8t(c,l),this._onWillSendRequest(r);const d=Om.serializeRequest(r,e,t,o,!!s);return this._logger?.logOutgoing(d.byteLength,r,zf.LocalSide,`request: ${tY(e)}.${t}(`,i),this._protocol.send(d),c}};z3e=P8t,a9.UNRESPONSIVE_TIME=3*1e3;let Bne=a9;class O8t{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}}var Y0;let fl=(Y0=class{static alloc(e,t,i){const s=new Y0(ze.alloc(i+1+4),0);return s.writeUInt8(e),s.writeUInt32(t),s}static read(e,t){return new Y0(e,t)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){const e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){const e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){const e=this._buff.readUInt8(this._offset);this._offset+=1;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let i=0,s=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let s=0,o=e.length;s"u")i[s]={type:fd.Undefined};else if(r instanceof $h){const{jsonString:a,referencedBuffers:c}=$3e(r.value,t);i[s]={type:fd.SerializedObjectWithBuffers,value:ze.fromString(a),buffers:c}}else i[s]={type:fd.String,value:ze.fromString(G3e(r,t))}}return{type:m2.Mixed,args:i}}return{type:m2.Simple,args:G3e(e,t)}}static serializeRequest(e,t,i,s,o){switch(s.type){case m2.Simple:return this._requestJSONArgs(e,t,i,s.args,o);case m2.Mixed:return this._requestMixedArgs(e,t,i,s.args,o)}}static _requestJSONArgs(e,t,i,s,o){const r=ze.fromString(i),a=ze.fromString(s);let c=0;c+=fl.sizeUInt8(),c+=fl.sizeShortString(r),c+=fl.sizeLongString(a);const l=fl.alloc(o?Ba.RequestJSONArgsWithCancellation:Ba.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(r),l.writeLongString(a),l.buffer}static deserializeRequestJSONArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(s)}}static _requestMixedArgs(e,t,i,s,o){const r=ze.fromString(i);let a=0;a+=fl.sizeUInt8(),a+=fl.sizeShortString(r),a+=fl.sizeMixedArray(s);const c=fl.alloc(o?Ba.RequestMixedArgsWithCancellation:Ba.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(s),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readMixedArray(),o=new Array(s.length);for(let r=0,a=s.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof ze)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof $h){const{jsonString:s,referencedBuffers:o}=$3e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,s,o)}else return this._serializeReplyOKJSON(e,xDe(t,i))}static _serializeReplyOKEmpty(e){return fl.alloc(Ba.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=fl.sizeVSBuffer(t);const s=fl.alloc(Ba.ReplyOKVSBuffer,e,i);return s.writeVSBuffer(t),s.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=ze.fromString(t);let s=0;s+=fl.sizeLongString(i);const o=fl.alloc(Ba.ReplyOKJSON,e,s);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const s=ze.fromString(t);let o=0;o+=fl.sizeUInt32,o+=fl.sizeLongString(s);for(const a of i)o+=fl.sizeVSBuffer(a);const r=fl.alloc(Ba.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(s);for(const a of i)r.writeBuffer(a);return r.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),s=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:hE(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${hE(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:hE(this.kind)};return l&&l.name&&(d.errorName=l.name),l&&l.message&&(d.errorMessage=l.message),l&&l.stack&&(d.errorStack=l.stack),this._telemetryService.publicLog2("extensionHostStartup",d),null}),this._proxy.then(()=>{t.forEach(l=>this.activateByEvent(l,sC.Normal)),this._register(V8t({measure:()=>this.measure()}))})}dispose(){this._extensionHost&&this._extensionHost.dispose(),this._rpcProtocol&&this._rpcProtocol.dispose();for(let e=0,t=this._customers.length;ethis._onDidChangeResponsiveState.fire(l)));let s=null,o=[];const r={remoteAuthority:this._extensionHost.remoteAuthority,extensionHostKind:this.kind,getProxy:l=>this._rpcProtocol.getProxy(l),set:(l,d)=>this._rpcProtocol.set(l,d),dispose:()=>this._rpcProtocol.dispose(),assertRegistered:l=>this._rpcProtocol.assertRegistered(l),drain:()=>this._rpcProtocol.drain(),internalExtensionService:this._internalExtensionService,_setExtensionHostProxy:l=>{s=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=Fne.getNamedCustomers();for(let l=0,d=a.length;l`[${hE(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${s()}${l}`),r=(l,d=void 0)=>this._logService.error(`${s()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:Xd.Unknown,detail:void 0}};o("invoking...");const c=new nQ;try{c.cancelAndSet(()=>o("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?o(`returned ${l.value.authority.connectTo}`):r("returned an error",l.error),l}catch(l){return c.dispose(),r("returned an error",l),{type:"error",error:{message:l.message,code:Xd.Unknown,detail:l}}}}async getCanonicalURI(e,t){const i=await this._proxy;if(!i)throw new Error("Cannot resolve canonical URI");return i.getCanonicalURI(e,t)}async start(e,t,i){const s=await this._proxy;if(!s)return;const o=this._extensionHost.extensions.set(e,t,i);return s.startExtensionHost(o)}async extensionTestsExecute(){const e=await this._proxy;if(!e)throw new Error("Could not obtain Extension Host Proxy");return e.extensionTestsExecute()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){const t=await this._proxy;if(!t)return;const i=this._extensionHost.extensions.delta(e);if(i)return t.deltaExtensions(i)}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async setRemoteEnvironment(e){const t=await this._proxy;if(t)return t.setRemoteEnvironment(e)}};Wne=wX=D([_(3,be),_(4,Za),_(5,on),_(6,Ze)],Wne);function Qst(n,e){return e?`${hE(n)} pid: ${e}`:`${hE(n)}`}const W8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function q3e(n){if(Array.isArray(n))return n;if(n&&typeof n=="object"&&typeof n.toString=="function"){const e=n.toString();if(e!=="[object Object]")return e}return n}function H8t(n){return Array.isArray(n)?n.map(q3e):q3e(n)}class U8t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,s,o,r,a){a=H8t(a);const c=W8t[o],l=c[s%c.length];let d=[`%c[${hE(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(s).padStart(5)} - ${r}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(r)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,s,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,s,o)}logOutgoing(e,t,i,s,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,s,o)}}let Hne=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,s){if(i===zf.LocalSide&&/^receiveReply(Err)?:/.test(s)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s} ${o}`,length:e})}i===zf.OtherSide&&/^receiveRequest /.test(s)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s}`,length:e})}logOutgoing(e,t,i,s){i===zf.LocalSide&&s.startsWith("request: ")&&(this._pendingRequests.set(t,s),this._telemetryService.publicLog2("extensionhost.outgoing",{type:s,length:e}))}};Hne=D([_(0,on)],Hne);const H3=[];function V8t(n){return H3.push(n),{dispose:()=>{for(let e=0;es.measure()));t.openEditor({resource:void 0,contents:i.map(bX._print).join(` +`,"auto"],enumDescriptions:[g(dn,14,"LF"),g(dn,15,"CRLF"),g(dn,16,"Uses operating system specific end of line character.")],default:"auto",description:g(dn,17,"The default end of line character."),scope:ut.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(dn,18,"Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.")},"files.trimTrailingWhitespace":{type:"boolean",default:!1,description:g(dn,19,"When enabled, will trim trailing whitespace when saving a file."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(dn,20,"When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."),scope:ut.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(dn,21,"When enabled, insert a final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(dn,22,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(dn,23,"An editor with changes is never automatically saved."),g(dn,24,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(dn,25,"An editor with changes is automatically saved when the editor loses focus."),g(dn,26,"An editor with changes is automatically saved when the window loses focus.")],default:Jn?$l.AFTER_DELAY:$l.OFF,markdownDescription:g(dn,27,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",$l.OFF,$l.AFTER_DELAY,$l.ON_FOCUS_CHANGE,$l.ON_WINDOW_CHANGE,$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(dn,28,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",$l.AFTER_DELAY),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(dn,29,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(dn,30,"When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when `#files.autoSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE},"files.watcherExclude":{type:"object",patternProperties:{".*":{type:"boolean"}},default:{"**/.git/objects/**":!0,"**/.git/subtree-cache/**":!0,"**/node_modules/*/**":!0,"**/.hg/store/**":!0},markdownDescription:g(dn,31,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."),scope:ut.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(dn,32,"Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."),scope:ut.RESOURCE},"files.hotExit":g8t,"files.defaultLanguage":{type:"string",markdownDescription:g(dn,33,"The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.")},[wJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,34,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[bJe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(dn,35,"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."),scope:ut.RESOURCE},[QEt]:{type:"boolean",markdownDescription:g(dn,36,"Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."),default:!1},"files.restoreUndoStack":{type:"boolean",description:g(dn,37,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(dn,38,"Will refuse to save and ask for resolving the save conflict manually."),g(dn,39,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(dn,40,"A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."),default:"askUser",scope:ut.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(dn,41,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(dn,42,"Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."),scope:ut.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(dn,43,"Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."),default:!1},"files.participants.timeout":{type:"number",default:6e4,markdownDescription:g(dn,44,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});cOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});cOe.registerConfiguration({...sA,properties:{"editor.formatOnSave":{type:"boolean",description:g(dn,45,"Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."),scope:ut.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(dn,46,"Format the whole file."),g(dn,47,"Format modifications (requires source control)."),g(dn,48,"Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted.")],markdownDescription:g(dn,49,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:ut.LANGUAGE_OVERRIDABLE}}});class O5{constructor(){this.type=an.Directory,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.type=an.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:an.Directory}}delete(){this._onDidDelete.fire()}addChild(e,t){this.entries.set(e,t),this._onDidChange.fire();const i={dispose:()=>{this.deleteChild(e)}};return t.onDidDelete(()=>{i.dispose()}),i}deleteChild(e){return this.entries.delete(e)?(this.mtime=Date.now(),this._onDidChange.fire(),this.entries.size===0&&this.delete(),!0):!1}getChildren(e){return this.entries.get(e)}read(){return Array.from(this.entries.entries()).map(([e,t])=>[e,t.type])}}class f8t{constructor(e,t){this.uri=e,this.readonly=t,this.type=an.File,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidDelete=new I,this.onDidDelete=this._onDidDelete.event,this.ctime=Date.now(),this.mtime=Date.now(),this.onDidChange(()=>{this.mtime=Date.now()})}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:await this.getSize(),type:an.File,permissions:this.readonly?vm.Readonly:void 0}}async delete(){if(this.readonly)throw xs("Not allowed",rt.FileWriteLocked);this._onDidDelete.fire()}}new TextEncoder;class p8t extends ${constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[],this.rootByAuthority=new Map,this.capabilities=1042,e&&(this.capabilities|=2048)}async open(e){const t=await this.readFile(e),i=this.memoryFdCounter++;return this.fdMemory.set(i,t),i}async close(e){this.fdMemory.delete(e)}async read(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(r).slice(t,t+o);return i.set(a.buffer,s),a.byteLength}write(e,t,i,s,o){const r=this.fdMemory.get(e);if(r==null)throw xs("No file with that descriptor open",rt.Unavailable);const a=ze.wrap(i).slice(s,s+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}_lookupRoot(e){const t=e.toLowerCase();let i=this.rootByAuthority.get(t);return i==null&&(i=new O5,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let o=this._lookupRoot(e.authority);for(const r of i){if(r.length===0)continue;let a;if(o instanceof O5&&(a=o.getChildren(r)),a==null){if(t)return;throw xs("file not found",rt.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof O5)return i;throw xs("file not a directory",rt.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===an.File)return i;throw xs("file is a directory",rt.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),s=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;s=Fn.joinPath(s,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(s)),!(c instanceof O5))throw new Error(`file '${s.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${Fn.joinPath(s,o).toString()}/' already exists`);const r=new Z;return r.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),r.add(e.onDidDelete(()=>{r.dispose()})),r.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),r.add(i.addChild(o,e)),this._fireSoon({resource:e.uri,type:1}),r}async stat(e){return this._lookup(e,!1).stats()}readdirSync(e){return this._lookupAsDirectory(e,!1).read()}async readdir(e){return this.readdirSync(e)}async readFile(e){return await this._lookupAsFile(e,!1).read()}readFileStream(e,t,i){const s=this._lookupAsFile(e,!1),o=Xx(r=>ze.concat(r.map(a=>ze.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(s.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await s.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await s.readStream()).getReader();let a=await r.read();for(;!a.done&&!(i.isCancellationRequested||(await o.write(a.value),i.isCancellationRequested));)a=await r.read();o.end(void 0)}}catch(r){o.error(xs(r,rt.Unknown)),o.end()}})(),o}watch(){return $.None}async writeFile(e,t,i){const s=this._lookup(e,!0);if(s!=null&&!(s instanceof f8t))throw xs("file is directory",rt.FileIsADirectory);if(s==null)throw xs("file not found",rt.FileNotFound);if(!i.overwrite)throw xs("file exists already",rt.FileExists);await s.write(t)}async rename(){throw xs("Not allowed",rt.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw xs("file exists already",rt.FileExists);const t=ui(e),i=ma(e),s=this._lookupAsDirectory(i,!1),o=new O5,r=new Z;return r.add(o.onDidDelete(()=>{r.dispose(),this._fireSoon({resource:e,type:2})})),r.add(o.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),s.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw xs("Can' create a directory",rt.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw xs("Not found",rt.FileNotFound);if(t.type===an.Directory)throw xs("Can't delete a directory",rt.NoPermissions);t.delete()}async delete(e){this.deleteSync(e)}_fireSoon(...e){this._bufferedChanges.push(...e),this._fireSoonHandle!=null&&(clearTimeout(this._fireSoonHandle),this._fireSoonHandle=void 0),this._fireSoonHandle=window.setTimeout(()=>{this._onDidChangeFile.fire(this._bufferedChanges),this._bufferedChanges.length=0},5)}}function H3e(n){return n.status==="fulfilled"}class Ost{constructor(){this.providers=[],this.onDidChangeCapabilities=T.None,this._onDidChangeFile=new I,this.onDidChangeFile=this._onDidChangeFile.event,this._onDidChangeOverlays=new I,this.onDidChangeOverlays=this._onDidChangeOverlays.event,this.capabilities=1042}register(e,t){const i={priority:e,provider:t};this.providers.push(i),this.providers.sort((o,r)=>r.priority-o.priority);const s=new Z;return s.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),s.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),s}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);let i;for(const s of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(s)}catch(o){if(i??(i=o),o instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw xs("No delegate",rt.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof Nx&&[rt.NoPermissions,rt.FileNotFound,rt.Unavailable].includes(i.code))continue;throw i}throw xs("Not allowed",rt.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),s=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(s?vm.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const s=Xx(o=>ze.concat(o.map(r=>ze.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(dJ(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;hO(r,{onData(d){l=!0,s.write(d)},onEnd(){s.end(),a()},onError(d){l?s.error(d):c(d)}},i)})}else{let r=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),s.end(r)}},i).catch(o=>{s.error(o)}),s}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(H3e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(H3e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const s of this.delegates)i.add(s.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async s=>{let o;try{o=await s.stat(e)}catch{}if(o!=null&&((o.permissions??0)&vm.Readonly)>0)throw xs("Not allowed",rt.NoPermissions);return s.writeFile(e,t,i)})}async mkdir(e){await this.writeToDelegates(t=>t.mkdir(e))}async delete(e,t){await this.writeToDelegates(i=>i.delete(e,t))}async rename(e,t,i){await this.writeToDelegates(s=>s.rename(e,t,i))}}class m8t extends Mne{async writeFile(e,t,i){return await Fst(Fn,this,Fn.dirname(e)),super.writeFile(e,t,i)}}const Bst=new Ost;Bst.register(0,new m8t);const _8t=new p8t(!0),Wst=new Mne;Wst.mkdir(P.from({scheme:_e.vscodeUserData,path:"/User/"}));var k6;(function(n){n.extensionFile="extension-file"})(k6||(k6={}));const v8t={[k6.extensionFile]:_8t,[Pnt.scheme]:new Mne,[_e.vscodeUserData]:Wst,[_e.tmp]:new Mne,[_e.file]:Bst};let EDe=class extends gDe{constructor(e,t){super(e);for(const[i,s]of Object.entries(v8t)){let o=this.registerProvider(i,s);s instanceof Ost&&s.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,s)}),s instanceof z$t&&this._register(s.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};EDe=D([_(1,rn)],EDe);const Hst=new $$t;VFe(async n=>{Hst.logger=n.get(Ze)});function lOe(){return{[ci.toString()]:new Gi(EDe,[Hst],!0),[tr.toString()]:new Gi(yDe,[],!0),[hh.toString()]:new Gi(ADe,[],!0),[IQ.toString()]:new Gi(u8t,[],!0)}}function w8t(n,e){if(n.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const s of n){if(s===!0)return Promise.resolve(!0);NS(s)&&t.push(s.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return ko.settled(t).then(()=>i)}var KV;(function(n){n[n.WebSocket=0]="WebSocket",n[n.Managed=1]="Managed"})(KV||(KV={}));class Ust{constructor(e){this.id=e,this.type=KV.Managed}toString(){return`Managed(${this.id})`}}class Vst{constructor(e,t){this.host=e,this.port=t,this.type=KV.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var Xd;(function(n){n.Unknown="Unknown",n.NotAvailable="NotAvailable",n.TemporarilyNotAvailable="TemporarilyNotAvailable",n.NoResolverFound="NoResolverFound",n.InvalidAuthority="InvalidAuthority"})(Xd||(Xd={}));let HI=class oT extends uc{static isNotAvailable(e){return e instanceof oT&&e._code===Xd.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof oT&&e._code===Xd.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof oT&&e._code===Xd.NoResolverFound}static isInvalidAuthority(e){return e instanceof oT&&e._code===Xd.InvalidAuthority}static isHandled(e){return e instanceof oT&&e.isHandled}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===Xd.NotAvailable&&i===!0,Object.setPrototypeOf(this,oT.prototype)}};function Pne(n){const e=n.indexOf("+");return e===-1?n:n.substring(0,e)}class b8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class UI{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const s=i.getExtensionDescription(e);return s?!!((s.main||s.browser)&&s.api==="none"):!1}constructor(e,t){this._activationEventsReader=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(x8t),this._extensionsMap=new $a,this._extensionsArr=[],this._activationMap=new Map;for(const e of this._extensionDescriptions){if(this._extensionsMap.has(e.identifier)){console.error("Extension `"+e.identifier.value+"` is already registered");continue}this._extensionsMap.set(e.identifier,e),this._extensionsArr.push(e);const t=this._activationEventsReader.readActivationEvents(e);for(const i of t)this._activationMap.has(i)||this._activationMap.set(i,[]),this._activationMap.get(i).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(e,t){this._extensionDescriptions=U3e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=UI._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=U3e(this._extensionDescriptions,i.map(s=>s.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new b8t(this._versionId,i)}static _findLoopingExtensions(e){const t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(a){this._nodesSet.has(a)||(this._nodesSet.add(a),this._nodesArr.push(a))}addArc(a,c){this.addNode(a),this.addNode(c),this._arcs.has(a)?this._arcs.get(a).push(c):this._arcs.set(a,[c])}getArcs(a){return this._arcs.has(a)?this._arcs.get(a):[]}hasOnlyGoodArcs(a,c){const l=t.getArcs(a);for(let d=0;dt.getArcs(a).length===0).forEach(a=>s.add(a));const o=t.getNodes().filter(a=>!s.has(a));let r;do{r=!1;for(let a=0;ai.get(a))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){const t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new C8t(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){const t=this._extensionsMap.get(e);return t||void 0}getExtensionDescriptionByUUID(e){for(const t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}}class C8t{constructor(e,t){this.versionId=e,this.extensions=t}}class y8t{constructor(e){this._lock=new E8t,this._actual=new UI(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new S8t(this,t)}deltaExtensions(e,t,i){if(!e.isAcquiredFor(this))throw new Error("Lock is not held");return this._actual.deltaExtensions(t,i)}containsActivationEvent(e){return this._actual.containsActivationEvent(e)}containsExtension(e){return this._actual.containsExtension(e)}getExtensionDescriptionsForActivationEvent(e){return this._actual.getExtensionDescriptionsForActivationEvent(e)}getAllExtensionDescriptions(){return this._actual.getAllExtensionDescriptions()}getSnapshot(){return this._actual.getSnapshot()}getExtensionDescription(e){return this._actual.getExtensionDescription(e)}getExtensionDescriptionByUUID(e){return this._actual.getExtensionDescriptionByUUID(e)}getExtensionDescriptionByIdOrUUID(e,t){return this._actual.getExtensionDescriptionByIdOrUUID(e,t)}}class S8t extends ${constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class A8t{constructor(e){this.name=e;const t=NU();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class E8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new A8t(e);return this._pendingCustomers.push(t),this._advance(),t.promise}_advance(){if(this._isLocked||this._pendingCustomers.length===0)return;const e=this._pendingCustomers.shift();this._isLocked=!0;let t=!0;const i=setTimeout(()=>{t&&console.warn(`The customer named ${e.name} has been holding on to the lock for 30s. This might be a problem.`)},30*1e3),s=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(s))}}var ik;(function(n){n[n.Builtin=0]="Builtin",n[n.User=1]="User",n[n.Dev=2]="Dev"})(ik||(ik={}));function x8t(n,e){const t=n.isBuiltin?ik.Builtin:n.isUnderDevelopment?ik.Dev:ik.User,i=e.isBuiltin?ik.Builtin:e.isUnderDevelopment?ik.Dev:ik.User;if(t!==i)return t-i;const s=Qi.basename(n.extensionLocation.path),o=Qi.basename(e.extensionLocation.path);return so?1:0}function U3e(n,e){const t=new $v(e);return n.filter(i=>!t.has(i.identifier))}function dOe(n){const e=n.isExtensionDevelopment;let t=!0;const i=n.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==_e.file&&(t=!1);const s=t&&typeof n.debugExtensionHost.port=="number",o=t&&!!n.debugExtensionHost.break,r=e&&!!n.extensionTestsLocationURI&&!n.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:s,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var Ao;(function(n){n[n.LocalProcess=1]="LocalProcess",n[n.LocalWebWorker=2]="LocalWebWorker",n[n.Remote=3]="Remote"})(Ao||(Ao={}));function hE(n){if(n===null)return"None";switch(n){case Ao.LocalProcess:return"LocalProcess";case Ao.LocalWebWorker:return"LocalWebWorker";case Ao.Remote:return"Remote"}}var rp;(function(n){n[n.None=0]="None",n[n.Local=1]="Local",n[n.Remote=2]="Remote"})(rp||(rp={}));function D8t(n){switch(n){case rp.None:return"None";case rp.Local:return"Local";case rp.Remote:return"Remote"}}function k8t(n,e,t,i){const s=V3e(n,t),o=V3e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=s.get(l.key)||null,h=o.get(l.key)||null,u=new L8t(d,h);r.set(u.key,u)};s.forEach(l=>a(l)),o.forEach(l=>a(l));const c=new Map;return r.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=rp.None;u&&!f?p=rp.Local:f&&!u&&(p=rp.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function V3e(n,e){const t=new Map;return n.forEach(i=>{const s=new I8t(i,e(i));t.set(s.key,s)}),t}class I8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Cn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class L8t{constructor(e,t){this.local=e,this.remote=t}get key(){return this.local?this.local.key:this.remote.key}get identifier(){return this.local?this.local.desc.identifier:this.remote.desc.identifier}get kind(){return this.local?this.local.kind:this.remote.kind}}function en(n){return function(e){YV.INSTANCE.registerNamedCustomer(n,e)}}function TO(n){YV.INSTANCE.registerCustomer(n)}var Fne;(function(n){function e(){return YV.INSTANCE.getNamedCustomers()}n.getNamedCustomers=e;function t(){return YV.INSTANCE.getCustomers()}n.getCustomers=t})(Fne||(Fne={}));const ele=class ele{constructor(){this._namedCustomers=[],this._customers=[]}registerNamedCustomer(e,t){const i=[e,t];this._namedCustomers.push(i)}getNamedCustomers(){return this._namedCustomers}registerCustomer(e){this._customers.push(e)}getCustomers(){return this._customers}};ele.INSTANCE=new ele;let YV=ele;function zst(n,e,t,i){if(!n||i>200)return null;if(typeof n=="object"){if(n.$mid===Fs.Uri)return t?P.revive(e.transformIncoming(n)):e.transformIncoming(n);if(n instanceof ze)return null;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const o=zst(n[s],e,t,i+1);o!==null&&(n[s]=o)}}return null}function B5(n,e){const t=zst(n,e,!1,0);return t===null?n:t}class $st{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||(this._actual=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)})),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):bt(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}}class T8t extends $st{constructor(){super(),this._hasErr=!0,this._err=new Tc}}const tle=class tle{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++tle.count}};tle.count=0;let One=tle;const Gst=[];function Xe(n){const e=new One(n);return Gst[e.nid]=e,e}function tY(n){return Gst[n].sid}class $h{constructor(e){this.value=e}}var z3e;function xDe(n,e){try{return JSON.stringify(n,e)}catch{return"null"}}const hOe="$$ref$$",R8t={[hOe]:-1};function $3e(n,e=null,t=!1){const i=[];return{jsonString:(t?xDe:JSON.stringify)(n,(o,r)=>{if(typeof r>"u")return R8t;if(typeof r=="object"){if(r instanceof ze){const a=i.push(r)-1;return{[hOe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function qst(n,e,t){return JSON.parse(n,(i,s)=>{if(s){const o=s[hOe];if(typeof o=="number")return e[o];if(t&&s.$mid===Fs.Uri)return t.transformIncoming(s)}return s})}function G3e(n,e){return JSON.stringify(n,e)}function M8t(n){return n?(e,t)=>t&&t.$mid===Fs.Uri?n.transformOutgoing(t):t:null}var zf;(function(n){n[n.LocalSide=0]="LocalSide",n[n.OtherSide=1]="OtherSide"})(zf||(zf={}));var DM;(function(n){n[n.Responsive=0]="Responsive",n[n.Unresponsive=1]="Unresponsive"})(DM||(DM={}));const N8t=()=>{},P8t=Symbol.for("rpcProtocol"),F8t=Symbol.for("rpcProxy"),a9=class a9 extends ${constructor(e,t=null,i=null){super(),this[z3e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=M8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let s=0,o=One.count;sthis._checkUnresponsive(),1e3)),this._protocol.onMessage(s=>this._receiveOneMessage(s))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(rx())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+a9.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(DM.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(DM.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?B5(e,this._uriTransformer):e}getProxy(e){const{nid:t,sid:i}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,i)),this._proxies[t]}_createProxy(e,t){const i={get:(s,o)=>(typeof o=="string"&&!s[o]&&o.charCodeAt(0)===Q.DollarSign&&(s[o]=(...r)=>this._remoteCall(e,o,r)),o===F8t?t:s[o])};return new Proxy(Object.create(null),i)}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,i=e.length;th.cancel()}else c=this._invokeHandler(i,s,o),l=N8t;this._cancelInvokedHandlers[a]=l;const d=Om.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,zf.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Om.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Om.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,zf.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,zf.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReply:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,zf.LocalSide,"receiveReplyErr:",i);const s=String(t);if(!this._pendingRPCReplies.hasOwnProperty(s))return;const o=this._pendingRPCReplies[s];delete this._pendingRPCReplies[s];let r;i&&(i.$isError?(r=new Error,r.name=i.name,r.message=i.message,r.stack=i.stack):r=i),o.resolveErr(r)}_invokeHandler(e,t,i){try{return Promise.resolve(this._doInvokeHandler(e,t,i))}catch(s){return Promise.reject(s)}}_doInvokeHandler(e,t,i){const s=this._locals[e];if(!s)throw new Error("Unknown actor "+tY(e));const o=s[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+tY(e));return o.apply(s,i)}_remoteCall(e,t,i){if(this._isDisposed)return new T8t;let s=null;if(i.length>0&&qe.isCancellationToken(i[i.length-1])&&(s=i.pop()),s&&s.isCancellationRequested)return Promise.reject(rx());const o=Om.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new $st,l=new Z;s&&l.add(s.onCancellationRequested(()=>{const h=Om.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,zf.LocalSide,"cancel"),this._protocol.send(Om.serializeCancel(r))})),this._pendingRPCReplies[a]=new O8t(c,l),this._onWillSendRequest(r);const d=Om.serializeRequest(r,e,t,o,!!s);return this._logger?.logOutgoing(d.byteLength,r,zf.LocalSide,`request: ${tY(e)}.${t}(`,i),this._protocol.send(d),c}};z3e=P8t,a9.UNRESPONSIVE_TIME=3*1e3;let Bne=a9;class O8t{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}}var Y0;let fl=(Y0=class{static alloc(e,t,i){const s=new Y0(ze.alloc(i+1+4),0);return s.writeUInt8(e),s.writeUInt32(t),s}static read(e,t){return new Y0(e,t)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){const e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){const e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){const e=this._buff.readUInt8(this._offset);this._offset+=1;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const i=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,i}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){const e=this._buff.readUInt32BE(this._offset);this._offset+=4;const t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let i=0,s=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let s=0,o=e.length;s"u")i[s]={type:fd.Undefined};else if(r instanceof $h){const{jsonString:a,referencedBuffers:c}=$3e(r.value,t);i[s]={type:fd.SerializedObjectWithBuffers,value:ze.fromString(a),buffers:c}}else i[s]={type:fd.String,value:ze.fromString(G3e(r,t))}}return{type:m2.Mixed,args:i}}return{type:m2.Simple,args:G3e(e,t)}}static serializeRequest(e,t,i,s,o){switch(s.type){case m2.Simple:return this._requestJSONArgs(e,t,i,s.args,o);case m2.Mixed:return this._requestMixedArgs(e,t,i,s.args,o)}}static _requestJSONArgs(e,t,i,s,o){const r=ze.fromString(i),a=ze.fromString(s);let c=0;c+=fl.sizeUInt8(),c+=fl.sizeShortString(r),c+=fl.sizeLongString(a);const l=fl.alloc(o?Ba.RequestJSONArgsWithCancellation:Ba.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(r),l.writeLongString(a),l.buffer}static deserializeRequestJSONArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(s)}}static _requestMixedArgs(e,t,i,s,o){const r=ze.fromString(i);let a=0;a+=fl.sizeUInt8(),a+=fl.sizeShortString(r),a+=fl.sizeMixedArray(s);const c=fl.alloc(o?Ba.RequestMixedArgsWithCancellation:Ba.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(s),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),s=e.readMixedArray(),o=new Array(s.length);for(let r=0,a=s.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof ze)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof $h){const{jsonString:s,referencedBuffers:o}=$3e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,s,o)}else return this._serializeReplyOKJSON(e,xDe(t,i))}static _serializeReplyOKEmpty(e){return fl.alloc(Ba.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=fl.sizeVSBuffer(t);const s=fl.alloc(Ba.ReplyOKVSBuffer,e,i);return s.writeVSBuffer(t),s.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=ze.fromString(t);let s=0;s+=fl.sizeLongString(i);const o=fl.alloc(Ba.ReplyOKJSON,e,s);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const s=ze.fromString(t);let o=0;o+=fl.sizeUInt32,o+=fl.sizeLongString(s);for(const a of i)o+=fl.sizeVSBuffer(a);const r=fl.alloc(Ba.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(s);for(const a of i)r.writeBuffer(a);return r.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),s=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:hE(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${hE(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:hE(this.kind)};return l&&l.name&&(d.errorName=l.name),l&&l.message&&(d.errorMessage=l.message),l&&l.stack&&(d.errorStack=l.stack),this._telemetryService.publicLog2("extensionHostStartup",d),null}),this._proxy.then(()=>{t.forEach(l=>this.activateByEvent(l,sC.Normal)),this._register(V8t({measure:()=>this.measure()}))})}dispose(){this._extensionHost&&this._extensionHost.dispose(),this._rpcProtocol&&this._rpcProtocol.dispose();for(let e=0,t=this._customers.length;ethis._onDidChangeResponsiveState.fire(l)));let s=null,o=[];const r={remoteAuthority:this._extensionHost.remoteAuthority,extensionHostKind:this.kind,getProxy:l=>this._rpcProtocol.getProxy(l),set:(l,d)=>this._rpcProtocol.set(l,d),dispose:()=>this._rpcProtocol.dispose(),assertRegistered:l=>this._rpcProtocol.assertRegistered(l),drain:()=>this._rpcProtocol.drain(),internalExtensionService:this._internalExtensionService,_setExtensionHostProxy:l=>{s=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=Fne.getNamedCustomers();for(let l=0,d=a.length;l`[${hE(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${s()}${l}`),r=(l,d=void 0)=>this._logService.error(`${s()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:Xd.Unknown,detail:void 0}};o("invoking...");const c=new nQ;try{c.cancelAndSet(()=>o("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?o(`returned ${l.value.authority.connectTo}`):r("returned an error",l.error),l}catch(l){return c.dispose(),r("returned an error",l),{type:"error",error:{message:l.message,code:Xd.Unknown,detail:l}}}}async getCanonicalURI(e,t){const i=await this._proxy;if(!i)throw new Error("Cannot resolve canonical URI");return i.getCanonicalURI(e,t)}async start(e,t,i){const s=await this._proxy;if(!s)return;const o=this._extensionHost.extensions.set(e,t,i);return s.startExtensionHost(o)}async extensionTestsExecute(){const e=await this._proxy;if(!e)throw new Error("Could not obtain Extension Host Proxy");return e.extensionTestsExecute()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){const t=await this._proxy;if(!t)return;const i=this._extensionHost.extensions.delta(e);if(i)return t.deltaExtensions(i)}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async setRemoteEnvironment(e){const t=await this._proxy;if(t)return t.setRemoteEnvironment(e)}};Wne=wX=D([_(3,be),_(4,Za),_(5,rn),_(6,Ze)],Wne);function Qst(n,e){return e?`${hE(n)} pid: ${e}`:`${hE(n)}`}const W8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function q3e(n){if(Array.isArray(n))return n;if(n&&typeof n=="object"&&typeof n.toString=="function"){const e=n.toString();if(e!=="[object Object]")return e}return n}function H8t(n){return Array.isArray(n)?n.map(q3e):q3e(n)}class U8t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,s,o,r,a){a=H8t(a);const c=W8t[o],l=c[s%c.length];let d=[`%c[${hE(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(s).padStart(5)} - ${r}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(r)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,s,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,s,o)}logOutgoing(e,t,i,s,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,s,o)}}let Hne=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,s){if(i===zf.LocalSide&&/^receiveReply(Err)?:/.test(s)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s} ${o}`,length:e})}i===zf.OtherSide&&/^receiveRequest /.test(s)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${s}`,length:e})}logOutgoing(e,t,i,s){i===zf.LocalSide&&s.startsWith("request: ")&&(this._pendingRequests.set(t,s),this._telemetryService.publicLog2("extensionhost.outgoing",{type:s,length:e}))}};Hne=D([_(0,rn)],Hne);const H3=[];function V8t(n){return H3.push(n),{dispose:()=>{for(let e=0;es.measure()));t.openEditor({resource:void 0,contents:i.map(bX._print).join(` `),options:{pinned:!0}})}static _print(e){return e?`${e.remoteAuthority?`Authority: ${e.remoteAuthority} `:""}Roundtrip latency: ${e.latency.toFixed(3)}ms Up: ${bX._printSpeed(e.up)} Down: ${bX._printSpeed(e.down)} `:""}static _printSpeed(e){return e<=1024?`${e} bps`:e<1024*1024?`${(e/1024).toFixed(1)} kbps`:`${(e/1024/1024).toFixed(1)} Mbps`}});class Une{constructor(e){this.affinity=e,this.kind=Ao.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class DDe{constructor(e){this.affinity=e,this.kind=Ao.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class Vne{constructor(){this.kind=Ao.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let kDe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,s,o,r){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=s,this._logService=o,this._extensionManifestPropertiesService=r,this._runningLocation=new $a,this._maxLocalProcessAffinity=0,this._maxLocalWebWorkerAffinity=0}set(e,t){this._runningLocation.set(e,t)}readExtensionKinds(e){return e.isUnderDevelopment&&this._environmentService.extensionDevelopmentKind?this._environmentService.extensionDevelopmentKind:this._extensionManifestPropertiesService.getExtensionKind(e)}getRunningLocation(e){return this._runningLocation.get(e)||null}filterByRunningLocation(e,t){return CX(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return CX(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return CX(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const s=new $a;for(const h of e)(h.main||h.browser)&&s.set(h.identifier,h);for(const h of this._registry.getAllExtensionDescriptions())if(h.main||h.browser){const u=this._runningLocation.get(h.identifier);u&&u.kind===t&&s.set(h.identifier,h)}const o=new $a;let r=0;for(const[h,u]of s)o.set(u.identifier,++r);const a=(h,u)=>{for(const[f,p]of o)p===h&&o.set(f,u)};for(const[h,u]of s){if(!u.extensionDependencies)continue;const f=o.get(u.identifier);for(const p of u.extensionDependencies){const m=o.get(p);m&&m!==f&&a(m,f)}}const c=new Map;let l=0;for(const[h,u]of s){const f=this._runningLocation.get(u.identifier);if(f){const p=o.get(u.identifier);c.set(p,f.affinity),l=Math.max(l,f.affinity)}}if(!this._environmentService.isExtensionDevelopment){const h=this._configurationService.getValue("extensions.experimental.affinity")||{},u=Object.keys(h),f=new Map;for(const p of u){const m=h[p];if(typeof m!="number"||m<=0||Math.floor(m)!==m){this._logService.info(`Ignoring configured affinity for '${p}' because the value is not a positive integer.`);continue}const v=o.get(p);if(!v)continue;const w=c.get(v);if(w){f.set(m,w);continue}const b=f.get(m);if(b){c.set(v,b);continue}if(!i){this._logService.info(`Ignoring configured affinity for '${p}' because extension host(s) are already running. Reload window.`);continue}const C=++l;f.set(m,C),c.set(v,C)}}const d=new $a;for(const h of e){const u=o.get(h.identifier)||0,f=c.get(u)||0;d.set(h.identifier,f)}if(l>0&&i)for(let h=1;h<=l;h++){const u=[];for(const f of e)d.get(f.identifier)===h&&u.push(f.identifier);this._logService.info(`Placing extension(s) ${u.map(f=>f.value).join(", ")} on a separate extension host.`)}return{affinities:d,maxAffinity:l}}computeRunningLocation(e,t,i){return this._doComputeRunningLocation(this._runningLocation,e,t,i).runningLocation}_doComputeRunningLocation(e,t,i,s){t=t.filter(p=>!e.has(p.identifier)),i=i.filter(p=>!e.has(p.identifier));const o=k8t(t,i,p=>this.readExtensionKinds(p),(p,m,v,w,b)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,w,b)),r=new $a;for(const p of t)r.set(p.identifier,p);for(const p of i)r.set(p.identifier,p);const a=new $a,c=[],l=[];for(const[p,m]of o){let v=null;if(m===Ao.LocalProcess){const w=r.get(p);w&&c.push(w)}else if(m===Ao.LocalWebWorker){const w=r.get(p);w&&l.push(w)}else m===Ao.Remote&&(v=new Vne);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,Ao.LocalProcess,s);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new Une(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,Ao.LocalWebWorker,s);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new DDe(m))}for(const[p,m]of e)m&&a.set(p,m);return{runningLocation:a,maxLocalProcessAffinity:h,maxLocalWebWorkerAffinity:f}}initializeRunningLocation(e,t){const{runningLocation:i,maxLocalProcessAffinity:s,maxLocalWebWorkerAffinity:o}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=s,this._maxLocalWebWorkerAffinity=o}deltaExtensions(e,t){const i=new $a;for(const s of t){const o=s;i.set(o,this._runningLocation.get(o)||null),this._runningLocation.delete(o)}return this._updateRunningLocationForAddedExtensions(e),i}_updateRunningLocationForAddedExtensions(e){const t=[],i=[];for(const r of e){const a=this.readExtensionKinds(r),c=r.extensionLocation.scheme===_e.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(r.identifier,a,!c,c,rp.None);let d=null;l===Ao.LocalProcess?t.push(r):l===Ao.LocalWebWorker?i.push(r):l===Ao.Remote&&(d=new Vne),this._runningLocation.set(r.identifier,d)}const{affinities:s}=this._computeAffinity(t,Ao.LocalProcess,!1);for(const r of t){const a=s.get(r.identifier)||0;this._runningLocation.set(r.identifier,new Une(a))}const{affinities:o}=this._computeAffinity(i,Ao.LocalWebWorker,!1);for(const r of i){const a=o.get(r.identifier)||0;this._runningLocation.set(r.identifier,new DDe(a))}}};kDe=D([_(2,Za),_(3,Re),_(4,Ze),_(5,G_)],kDe);function CX(n,e,t){return n.filter(i=>{const s=e.get(i.identifier);return s&&t(s)})}function $8t(n,e,t){return n.filter(i=>{const s=e.get(i);return s&&t(s)})}let IDe=class extends ${get pid(){return this._actual?this._actual.pid:null}get kind(){return this._extensionHost.runningLocation.kind}get startup(){return this._extensionHost.startup}get friendyName(){return Qst(this.kind,this.pid)}constructor(e,t,i,s){super(),this._internalExtensionService=t,this._instantiationService=i,this._logService=s,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._extensionHost=e,this.onDidExit=e.onExit,this._startCalled=new Uh,this._actual=null,this._lazyStartExtensions=null}_createActual(e){return this._logService.info(`Creating lazy extension host (${this.friendyName}). Reason: ${e}`),this._actual=this._register(this._instantiationService.createInstance(Wne,this._extensionHost,[],this._internalExtensionService)),this._register(this._actual.onDidChangeResponsiveState(t=>this._onDidChangeResponsiveState.fire(t))),this._actual}async _getOrCreateActualAndStart(e){if(this._actual)return this._actual;const t=this._createActual(e);return await t.start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions),t}async ready(){await this._startCalled.wait(),this._actual&&await this._actual.ready()}representsRunningLocation(e){return this._extensionHost.runningLocation.equals(e)}async deltaExtensions(e){if(await this._startCalled.wait(),this._actual)return this._actual.deltaExtensions(e);if(this._lazyStartExtensions.delta(e),e.myToAdd.length>0){await this._createActual(`contains ${e.myToAdd.length} new extension(s) (installed or enabled): ${e.myToAdd.map(i=>i.value)}`).start(this._lazyStartExtensions.versionId,this._lazyStartExtensions.allExtensions,this._lazyStartExtensions.myExtensions);return}}containsExtension(e){return this._extensionHost.extensions?.containsExtension(e)??!1}async activate(e,t){return await this._startCalled.wait(),this._actual?this._actual.activate(e,t):!1}async activateByEvent(e,t){if(t===sC.Immediate)return this._actual?this._actual.activateByEvent(e,t):void 0;if(await this._startCalled.wait(),this._actual)return this._actual.activateByEvent(e,t)}activationEventIsDone(e){return this._startCalled.isOpen()?this._actual?this._actual.activationEventIsDone(e):!0:!1}async getInspectPort(e){return await this._startCalled.wait(),this._actual?.getInspectPort(e)}async resolveAuthority(e,t){return await this._startCalled.wait(),this._actual?this._actual.resolveAuthority(e,t):{type:"error",error:{message:"Cannot resolve authority",code:Xd.Unknown,detail:void 0}}}async getCanonicalURI(e,t){if(await this._startCalled.wait(),this._actual)return this._actual.getCanonicalURI(e,t);throw new Error("Cannot resolve canonical URI")}async start(e,t,i){if(i.length>0){const o=this._createActual(`contains ${i.length} extension(s): ${i.map(r=>r.value)}.`).start(e,t,i);return this._startCalled.open(),o}this._lazyStartExtensions=new xJ(e,t,i),this._startCalled.open()}async extensionTestsExecute(){return await this._startCalled.wait(),(await this._getOrCreateActualAndStart("execute tests.")).extensionTestsExecute()}async setRemoteEnvironment(e){if(await this._startCalled.wait(),this._actual)return this._actual.setRemoteEnvironment(e)}};IDe=D([_(2,be),_(3,Ze)],IDe);var zne;(function(n){n[n.Information=1]="Information",n[n.Warning=2]="Warning"})(zne||(zne={}));const jst="⟪ ",Kst=" characters skipped ⟫",G8t=(jst.length+Kst.length+5)*2;var h8;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(h8||(h8={}));var z1;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(z1||(z1={}));function q8t(n){return!!n.preview}var Q3e;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(Q3e||(Q3e={}));class Q8t{constructor(e,t,i,s){this.ranges=t,this.webviewIndex=s;const o=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&j8t(o)){e=Ult(e,i.matchLines);let r="",a=0,c=0;const l=Math.floor(i.charsPerLine/5),d=[];for(const h of o){const u=Math.max(h.startColumn-l,0),f=h.startColumn+i.charsPerLine;if(u>c+l+G8t){const p=jst+(u-c)+Kst;r+=p+e.slice(u,f),a+=u-(c+p.length)}else r+=e.slice(c,f);d.push(new K8t(0,h.startColumn-a,h.endColumn-a)),c=f}this.preview={text:r,matches:Array.isArray(this.ranges)?d:d[0]}}else{const r=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber;this.preview={text:e,matches:u9(t,a=>new Yst(a.startLineNumber-r,a.startColumn,a.endLineNumber-r,a.endColumn))}}}}function j8t(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class Yst{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class K8t extends Yst{constructor(e,t,i){super(e,t,e,i)}}var j3e;(function(n){n.List="list",n.Tree="tree"})(j3e||(j3e={}));var K3e;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(K3e||(K3e={}));function Y8t(n,e=!0){const t=n&&n.files&&n.files.exclude,i=e&&n&&n.search&&n.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i;let s=Object.create(null);return s=ym(s,Vs(t)),s=ym(s,Vs(i),!0),s}function Y3e(n,e){return n.excludePattern&&WW(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&WW(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(mZ(e,i)){const s=LU(i,e);return!t.includePattern||!!WW(t.includePattern,s)}else return!1}):!1:!0}var J3e;(function(n){n[n.unknownEncoding=1]="unknownEncoding",n[n.regexParseError=2]="regexParseError",n[n.globParseError=3]="globParseError",n[n.invalidLiteral=4]="invalidLiteral",n[n.rgProcessError=5]="rgProcessError",n[n.other=6]="other",n[n.canceled=7]="canceled"})(J3e||(J3e={}));function $ne(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class Jst{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=_w(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=_w(i))}matchesExcludesSync(e,t,i){return!!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i))}includedInQuerySync(e,t,i){return!(this._parsedExcludeExpression&&this._parsedExcludeExpression(e,t,i)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,i))}includedInQuery(e,t,i){const s=this._parsedExcludeExpression(e,t,i),o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return NS(s)?s.then(r=>r?!1:o()):o()}hasSiblingExcludeClauses(){return J8t(this._excludeExpression)}}function J8t(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function X8t(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?Xst(i):{})),e.then(i=>!!i[t]))}function Z8t(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?Xst(i):{}}return!!e[t]}}function Xst(n){const e={};for(const t of n)e[t]=!0;return e}const e9t="vs/workbench/services/search/common/queryBuilder";let Gne=class{constructor(e,t,i,s,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=s,this.pathService=o}text(e,t,i={}){e=this.getContentPattern(e,i);const s=this.configurationService.getValue(),o=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(wee),i),type:z1.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:s.search.usePCRE2||o||!1,beforeContext:i.beforeContext,afterContext:i.afterContext,userDisabledExcludesAndIgnoreFiles:i.disregardExcludeSettings&&i.disregardIgnoreFiles}}getContentPattern(e,t){const i=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,"\\n"));const s={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(s.isCaseSensitive=!0),this.isMultiline(e)&&(s.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(s.notebookInfo||(s.notebookInfo={}),s.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),s}file(e,t={}){return{...this.commonQuery(e,t),type:z1.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){return e?(e=Array.isArray(e)?e.map(yX):yX(e),t?this.parseSearchPaths(e):{pattern:Hpe(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),s=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),o=e.length>1,r=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,s)):e.map(l=>this.getFolderQueryForRoot(l,t,s,o))).filter(l=>!!l),a={_reason:t._reason,folderQueries:r,usingSearchPaths:!!(i.searchPaths&&i.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:s.pattern,includePattern:i.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults};if(t.onlyOpenEditors){const l=Ui(this.editorGroupsService.groups.flatMap(u=>u.editors.map(f=>f.resource)));this.logService.trace("QueryBuilder#commonQuery - openEditor URIs",JSON.stringify(l));const d=l.filter(u=>Y3e(a,u.fsPath)),h=this.commonQueryFromFileList(d);return this.logService.trace("QueryBuilder#commonQuery - openEditor Query",JSON.stringify(h)),{...a,...h}}const c=t.extraFileResources&&t.extraFileResources.filter(l=>Y3e(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new wi,s={};let o=!1;return e.forEach(r=>{if(r.scheme===_e.walkThrough)return;if(KQe(r)){const c=this.workspaceContextService.getWorkspaceFolder(r)?.uri??r.with({path:lS(r.fsPath)});let l=i.get(c);l||(o=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=LU(c.fsPath,r.fsPath);ws(l.includePattern)[d.replace(/\\/g,"/")]=!0}else r.fsPath&&(o=!0,s[r.fsPath]=!0)}),{folderQueries:t,includePattern:s,usingSearchPaths:!0,excludePattern:o?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(b_e(e.pattern,!0))return!0}else if(b_e(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&Xje(e.pattern)||e.pattern.indexOf(` -`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>oF(h)||/^\.\.?([\/\\]|$)/.test(h),s=(Array.isArray(e)?e:i9t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?oPt(h,u.scheme===_e.file?u.fsPath:u.path):h}),o=cQe(s,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>IS(h,"/")).map(h=>IS(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),n9t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=Hpe(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:Y8t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(s=>{let{pathPortion:o,globPortion:r}=t9t(s);return r&&(r=Upe(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(s=>{const o=s.searchPath.toString(),r=i.get(o);r?s.pattern&&(r.pattern=r.pattern||{},r.pattern[s.pattern]=!0):i.set(o,{searchPath:s.searchPath,pattern:s.pattern?Hpe(s.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(oF(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==_e.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:P.file(d1(e))}]}if(this.workspaceContextService.getWorkbenchState()===Nn.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=yX(e),e.startsWith("../")||e===".."){const s=qi.resolve(t.path,e);return[{searchPath:t.with({path:s})}]}const i=Upe(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),s=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Iu(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(yl);if(s.length)return s.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&Upe(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(e9t,0,"Workspace folder does not exist: {0}",r);throw new Error(a)}}}}resolveOneSearchPathPattern(e,t){const i=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,s=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&s.push({searchPath:e.searchPath,pattern:i+"/**"}),s}getFolderQueryForSearchPath(e,t,i){const s=this.getFolderQueryForRoot(wee(e.searchPath),t,i,!1);return s?{...s,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,s){let o;const r=P.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>_n(u.searchPath,r))[0];if(h&&!h.pattern)return null;h&&(o=h.pattern)}const a=this.configurationService.getValue({resource:r}),l={...this.getExcludesForFolder(a,t)||{},...o||{}},d=P.isUri(e)?ui(e):e.name;return{folder:r,folderName:s?d:void 0,excludePattern:Object.keys(l).length>0?l:void 0,fileEncoding:a.files&&a.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles=="boolean"?t.disregardIgnoreFiles:!a.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles=="boolean"?t.disregardGlobalIgnoreFiles:!a.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles=="boolean"?t.disregardParentIgnoreFiles:!a.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks=="boolean"?t.ignoreSymlinks:!a.search?.followSymlinks}}};Gne=D([_(0,Re),_(1,Ti),_(2,ur),_(3,Ze),_(4,Lm)],Gne);function t9t(n){const e=n.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=n.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let s=n.substr(0,i.index);return s.match(/[/\\]/)||(s+="/"),{pathPortion:s,globPortion:n.substr((i.index||0)+1)}}}return{pathPortion:n}}function Hpe(...n){return n.length?n.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function i9t(n){return qwe(n,",").map(e=>e.trim()).filter(e=>!!e.length)}function n9t(n){return[`**/${n}/**`,`**/${n}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function yX(n){return n.replace(/\\/g,"/")}function Upe(n){return yX(n).replace(/^\.\//,"").replace(/\/+$/g,"")}const s9t=7e3;function Zst(n,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],s=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||n.forceUsingSearch?s.push(h):i.push(h)}if(i.length===0&&s.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=NU(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>o9t(n,d,a))).then(()=>{}),l=r9t(n,e.identifier,s,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function o9t(n,e,t){for(const i of n.folders)if(await n.exists(qt(P.revive(i),e))){t(`workspaceContains:${e}`);return}}async function r9t(n,e,t,i){if(t.length===0)return Promise.resolve(void 0);const s=new ai,o=n.checkExists(n.folders,t,s.token),r=setTimeout(async()=>{s.cancel(),n.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},s9t);let a=!1;try{a=await o}catch(c){Na(c)||bt(c)}s.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function eot(n,e,t,i){const s=n.get(be),o=n.get(ohe),a=s.createInstance(Gne).file(e.map(c=>wee(P.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Na(c)?!1:Promise.reject(c))}var LDe;const Yw="vs/workbench/services/extensions/common/abstractExtensionService",Vpe=Object.hasOwnProperty,a9t=Promise.resolve(void 0);let TDe=LDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=s,this._notificationService=o,this._environmentService=r,this._telemetryService=a,this._extensionEnablementService=c,this._fileService=l,this._productService=d,this._extensionManagementService=h,this._contextService=u,this._configurationService=f,this._extensionManifestPropertiesService=p,this._logService=m,this._remoteAgentService=v,this._remoteExtensionsScannerService=w,this._lifecycleService=b,this._remoteAuthorityResolverService=C,this._dialogService=y,this._onDidRegisterExtensions=this._register(new I),this.onDidRegisterExtensions=this._onDidRegisterExtensions.event,this._onDidChangeExtensionsStatus=this._register(new I),this.onDidChangeExtensionsStatus=this._onDidChangeExtensionsStatus.event,this._onDidChangeExtensions=this._register(new I({leakWarningThreshold:400})),this.onDidChangeExtensions=this._onDidChangeExtensions.event,this._onWillActivateByEvent=this._register(new I),this.onWillActivateByEvent=this._onWillActivateByEvent.event,this._onDidChangeResponsiveChange=this._register(new I),this.onDidChangeResponsiveChange=this._onDidChangeResponsiveChange.event,this._onWillStop=this._register(new I),this.onWillStop=this._onWillStop.event,this._activationEventReader=new u9t,this._registry=new y8t(this._activationEventReader),this._installedExtensionsReady=new Uh,this._extensionStatus=new $a,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new MDe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=[],this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(S=>{S.scheme!==_e.vscodeRemote&&S.join(this.activateByEvent(`onFileSystem:${S.scheme}`))})),this._runningLocations=new kDe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(S=>{const M=[],k=[];for(const F of S)this._safeInvokeIsEnabled(F)?M.push(F):k.push(F);Vu&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${S.map(F=>F.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:S,removed:M})=>{(S.length||M.length)&&(Vu&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new rT(S,M)))})),this._register(this._extensionManagementService.onDidEnableExtensions(S=>{S.length&&(Vu&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new rT(S,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(S=>{const M=[];for(const{local:k,operation:F}of S)k&&k.isValid&&F!==Bx.Migrate&&this._safeInvokeIsEnabled(k)&&M.push(k);M.length&&(Vu&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${M.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(S=>{S.error||(Vu&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${S.identifier.id}`),this._handleDeltaExtensions(new rT([],[S.identifier.id])))})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.filter(t=>t.kind===e)}_getExtensionHostManagerByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.representsRunningLocation(e))return t;return null}async _handleDeltaExtensions(e){if(this._deltaExtensionsQueue.push(e),this._inHandleDeltaExtensions)return;let t=null;try{for(this._inHandleDeltaExtensions=!0,await this._installedExtensionsReady.wait(),t=await this._registry.acquireLock("handleDeltaExtensions");this._deltaExtensionsQueue.length>0;){const i=this._deltaExtensionsQueue.shift();await this._deltaExtensions(t,i.toAdd,i.toRemove)}}finally{this._inHandleDeltaExtensions=!1,t?.dispose()}}async _deltaExtensions(e,t,i){Vu&&this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${t.map(a=>a.identifier.id).join(",")}] toRemove: [${i.map(a=>typeof a=="string"?a:a.identifier.id).join(",")}]`);let s=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:s}),s=s.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",r.removedDueToLooping.map(a=>`'${a.identifier.value}'`).join(", "))}),this._extensionsProposedApi.updateEnabledApiProposals(o),this._doHandleExtensionPoints([].concat(o).concat(s)),await this._updateExtensionsOnExtHosts(r.versionId,o,s.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,s));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,s,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=$8t(s,o,l=>e.representsRunningLocation(l)),c=QW.createActivationEventsMap(i);if(Vu){const l=h=>h.map(u=>u.identifier.value).join(","),d=h=>h.map(u=>u.value).join(",");this._logService.info(`AbstractExtensionService: Calling deltaExtensions: toRemove: [${d(s)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:s,toAdd:i,addActivationEvents:c,myToRemove:a,myToAdd:r.map(l=>l.identifier)})}canAddExtension(e){return this._canAddExtension(e,[])}_canAddExtension(e,t){if(this._registry.getExtensionDescriptionByIdOrUUID(e.identifier,e.id)&&!t.some(c=>Cn.equals(e.identifier,c.identifier)))return!1;const s=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===_e.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,s,!o,o,rp.None)!==null}canRemoveExtension(e){const t=this._registry.getExtensionDescription(e.identifier);return!(!t||this._extensionStatus.get(t.identifier)?.activationStarted)}async _activateAddedExtensionIfNeeded(e){let t=!1,i=null,s=!1;const o=this._activationEventReader.readActivationEvents(e);for(const r of o){if(this._allRequestedActivateEvents.has(r)){t=!0,i=r;break}if(r==="*"){t=!0,i=r;break}if(/^workspaceContains/.test(r)&&(s=!0),r==="onStartupFinished"){t=!0,i=r;break}}if(t)await Promise.all(this._extensionHostManagers.map(r=>r.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:i}))).then(()=>{});else if(s){const r=await this._contextService.getCompleteWorkspace(),a=!!this._environmentService.remoteAuthority,c={logService:this._logService,folders:r.folders.map(d=>d.uri),forceUsingSearch:a,exists:d=>this._fileService.exists(d),checkExists:(d,h,u)=>this._instantiationService.invokeFunction(f=>eot(f,d,h,u))},l=await Zst(c,e);if(!l)return;await Promise.all(this._extensionHostManagers.map(d=>d.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:l.activationEvent}))).then(()=>{})}}async _initialize(){vs("code/willLoadExtensions"),this._startExtensionHostsIfNecessary(!0,[]);const e=await this._registry.acquireLock("_initialize");try{const t=await this._resolveExtensions();this._processExtensions(e,t);const i=this._registry.getSnapshot();for(const s of this._extensionHostManagers)if(s.startup!==Wx.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,s);s.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),vs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:s}=t,o=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,Ao.LocalWebWorker):[],c=s?this._runningLocations.filterByExtensionHostKind(o,Ao.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,Ao.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,Ao.Remote);for(const u of a)d9t(l,u.identifier)||l.push(u);const d=r.concat(c).concat(l),h=this._registry.deltaExtensions(e,d,[]);h.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",h.removedDueToLooping.map(u=>`'${u.identifier.value}'`).join(", "))}),this._doHandleExtensionPoints(this._registry.getAllExtensionDescriptions())}async _handleExtensionTests(){if(!this._environmentService.isExtensionDevelopment||!this._environmentService.extensionTestsLocationURI)return;const e=this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);if(!e){const i=g(Yw,1,"No extension host found that can launch the test runner at {0}.",this._environmentService.extensionTestsLocationURI.toString());console.error(i),this._notificationService.error(i);return}let t;try{t=await e.extensionTestsExecute(),Vu&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Vu&&this._logService.error("Extension host test runner error",i),console.error(i),t=1}this._onExtensionHostExit(t)}findTestExtensionHost(e){let t=null;for(const i of this._registry.getAllExtensionDescriptions())if(MS(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===_e.vscodeRemote?t=new Vne:t=new Une(0)),t!==null?this._getExtensionHostManagerByRunningLocation(t):null}_releaseBarrier(){this._installedExtensionsReady.open(),this._onDidRegisterExtensions.fire(void 0),this._onDidChangeExtensionsStatus.fire(this._registry.getAllExtensionDescriptions().map(e=>e.identifier))}async _resolveAuthorityInitial(e){for(let i=1;;i++)try{return this._resolveAuthorityWithLogging(e)}catch(s){if(HI.isNoResolverFound(s)||HI.isNotAvailable(s)||i>=5)throw s}}async _resolveAuthorityAgain(){const e=this._environmentService.remoteAuthority;if(e){this._remoteAuthorityResolverService._clearResolvedAuthority(e);try{const t=await this._resolveAuthorityWithLogging(e);this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options)}catch(t){this._remoteAuthorityResolverService._setResolvedAuthorityError(e,t)}}}async _resolveAuthorityWithLogging(e){const t=Pne(e),i=ao.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{vs(`code/willResolveAuthority/${t}`);const s=await this._resolveAuthority(e);return vs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${s.authority.connectTo}' after ${i.elapsed()} ms`),s}catch(s){throw vs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,s),s}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const s=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of s){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===Xd.Unknown,c=r.error.code===Xd.Unknown;a&&!c&&(o=r)}throw new HI(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e){return this._doStopExtensionHostsWithVeto(e)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);for(let t=this._extensionHostManagers.length-1;t>=0;t--)this._extensionHostManagers[t].dispose();this._extensionHostManagers=[];for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e){const t=[],i=new Set;this._onWillStop.fire({reason:e,veto(o,r){t.push(o),typeof o=="boolean"?o===!0&&i.add(r):o.then(a=>{a&&i.add(r)}).catch(a=>{i.add(g(Yw,2,"{0} (Error: {1})",r,Ma(a)))})}});const s=await w8t(t,o=>this._logService.error(o));if(!s)this._doStopExtensionHosts();else{const o=Array.from(i);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${o.join(", ")})`),await this._dialogService.warn(g(Yw,3,"The following operation was blocked: {0}",e),o.length===1?g(Yw,4,"The reason for blocking the operation: {0}",o[0]):g(Yw,5,`The reasons for blocking the operation: +`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>oF(h)||/^\.\.?([\/\\]|$)/.test(h),s=(Array.isArray(e)?e:i9t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?oPt(h,u.scheme===_e.file?u.fsPath:u.path):h}),o=cQe(s,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>IS(h,"/")).map(h=>IS(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),n9t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=Hpe(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:Y8t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(s=>{let{pathPortion:o,globPortion:r}=t9t(s);return r&&(r=Upe(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(s=>{const o=s.searchPath.toString(),r=i.get(o);r?s.pattern&&(r.pattern=r.pattern||{},r.pattern[s.pattern]=!0):i.set(o,{searchPath:s.searchPath,pattern:s.pattern?Hpe(s.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(oF(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==_e.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:P.file(d1(e))}]}if(this.workspaceContextService.getWorkbenchState()===Nn.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=yX(e),e.startsWith("../")||e===".."){const s=Qi.resolve(t.path,e);return[{searchPath:t.with({path:s})}]}const i=Upe(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),s=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Iu(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(yl);if(s.length)return s.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&Upe(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(e9t,0,"Workspace folder does not exist: {0}",r);throw new Error(a)}}}}resolveOneSearchPathPattern(e,t){const i=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,s=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&s.push({searchPath:e.searchPath,pattern:i+"/**"}),s}getFolderQueryForSearchPath(e,t,i){const s=this.getFolderQueryForRoot(wee(e.searchPath),t,i,!1);return s?{...s,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,s){let o;const r=P.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>_n(u.searchPath,r))[0];if(h&&!h.pattern)return null;h&&(o=h.pattern)}const a=this.configurationService.getValue({resource:r}),l={...this.getExcludesForFolder(a,t)||{},...o||{}},d=P.isUri(e)?ui(e):e.name;return{folder:r,folderName:s?d:void 0,excludePattern:Object.keys(l).length>0?l:void 0,fileEncoding:a.files&&a.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles=="boolean"?t.disregardIgnoreFiles:!a.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles=="boolean"?t.disregardGlobalIgnoreFiles:!a.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles=="boolean"?t.disregardParentIgnoreFiles:!a.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks=="boolean"?t.ignoreSymlinks:!a.search?.followSymlinks}}};Gne=D([_(0,Re),_(1,Ti),_(2,ur),_(3,Ze),_(4,Lm)],Gne);function t9t(n){const e=n.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=n.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let s=n.substr(0,i.index);return s.match(/[/\\]/)||(s+="/"),{pathPortion:s,globPortion:n.substr((i.index||0)+1)}}}return{pathPortion:n}}function Hpe(...n){return n.length?n.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function i9t(n){return qwe(n,",").map(e=>e.trim()).filter(e=>!!e.length)}function n9t(n){return[`**/${n}/**`,`**/${n}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function yX(n){return n.replace(/\\/g,"/")}function Upe(n){return yX(n).replace(/^\.\//,"").replace(/\/+$/g,"")}const s9t=7e3;function Zst(n,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],s=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||n.forceUsingSearch?s.push(h):i.push(h)}if(i.length===0&&s.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=NU(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>o9t(n,d,a))).then(()=>{}),l=r9t(n,e.identifier,s,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function o9t(n,e,t){for(const i of n.folders)if(await n.exists(Qt(P.revive(i),e))){t(`workspaceContains:${e}`);return}}async function r9t(n,e,t,i){if(t.length===0)return Promise.resolve(void 0);const s=new ai,o=n.checkExists(n.folders,t,s.token),r=setTimeout(async()=>{s.cancel(),n.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},s9t);let a=!1;try{a=await o}catch(c){Na(c)||bt(c)}s.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function eot(n,e,t,i){const s=n.get(be),o=n.get(ohe),a=s.createInstance(Gne).file(e.map(c=>wee(P.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Na(c)?!1:Promise.reject(c))}var LDe;const Yw="vs/workbench/services/extensions/common/abstractExtensionService",Vpe=Object.hasOwnProperty,a9t=Promise.resolve(void 0);let TDe=LDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=s,this._notificationService=o,this._environmentService=r,this._telemetryService=a,this._extensionEnablementService=c,this._fileService=l,this._productService=d,this._extensionManagementService=h,this._contextService=u,this._configurationService=f,this._extensionManifestPropertiesService=p,this._logService=m,this._remoteAgentService=v,this._remoteExtensionsScannerService=w,this._lifecycleService=b,this._remoteAuthorityResolverService=C,this._dialogService=y,this._onDidRegisterExtensions=this._register(new I),this.onDidRegisterExtensions=this._onDidRegisterExtensions.event,this._onDidChangeExtensionsStatus=this._register(new I),this.onDidChangeExtensionsStatus=this._onDidChangeExtensionsStatus.event,this._onDidChangeExtensions=this._register(new I({leakWarningThreshold:400})),this.onDidChangeExtensions=this._onDidChangeExtensions.event,this._onWillActivateByEvent=this._register(new I),this.onWillActivateByEvent=this._onWillActivateByEvent.event,this._onDidChangeResponsiveChange=this._register(new I),this.onDidChangeResponsiveChange=this._onDidChangeResponsiveChange.event,this._onWillStop=this._register(new I),this.onWillStop=this._onWillStop.event,this._activationEventReader=new u9t,this._registry=new y8t(this._activationEventReader),this._installedExtensionsReady=new Uh,this._extensionStatus=new $a,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new MDe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=[],this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(S=>{S.scheme!==_e.vscodeRemote&&S.join(this.activateByEvent(`onFileSystem:${S.scheme}`))})),this._runningLocations=new kDe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(S=>{const M=[],k=[];for(const F of S)this._safeInvokeIsEnabled(F)?M.push(F):k.push(F);Vu&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${S.map(F=>F.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:S,removed:M})=>{(S.length||M.length)&&(Vu&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new rT(S,M)))})),this._register(this._extensionManagementService.onDidEnableExtensions(S=>{S.length&&(Vu&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new rT(S,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(S=>{const M=[];for(const{local:k,operation:F}of S)k&&k.isValid&&F!==Bx.Migrate&&this._safeInvokeIsEnabled(k)&&M.push(k);M.length&&(Vu&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${M.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new rT(M,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(S=>{S.error||(Vu&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${S.identifier.id}`),this._handleDeltaExtensions(new rT([],[S.identifier.id])))})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.filter(t=>t.kind===e)}_getExtensionHostManagerByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.representsRunningLocation(e))return t;return null}async _handleDeltaExtensions(e){if(this._deltaExtensionsQueue.push(e),this._inHandleDeltaExtensions)return;let t=null;try{for(this._inHandleDeltaExtensions=!0,await this._installedExtensionsReady.wait(),t=await this._registry.acquireLock("handleDeltaExtensions");this._deltaExtensionsQueue.length>0;){const i=this._deltaExtensionsQueue.shift();await this._deltaExtensions(t,i.toAdd,i.toRemove)}}finally{this._inHandleDeltaExtensions=!1,t?.dispose()}}async _deltaExtensions(e,t,i){Vu&&this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${t.map(a=>a.identifier.id).join(",")}] toRemove: [${i.map(a=>typeof a=="string"?a:a.identifier.id).join(",")}]`);let s=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:s}),s=s.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",r.removedDueToLooping.map(a=>`'${a.identifier.value}'`).join(", "))}),this._extensionsProposedApi.updateEnabledApiProposals(o),this._doHandleExtensionPoints([].concat(o).concat(s)),await this._updateExtensionsOnExtHosts(r.versionId,o,s.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,s));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,s,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=$8t(s,o,l=>e.representsRunningLocation(l)),c=QW.createActivationEventsMap(i);if(Vu){const l=h=>h.map(u=>u.identifier.value).join(","),d=h=>h.map(u=>u.value).join(",");this._logService.info(`AbstractExtensionService: Calling deltaExtensions: toRemove: [${d(s)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:s,toAdd:i,addActivationEvents:c,myToRemove:a,myToAdd:r.map(l=>l.identifier)})}canAddExtension(e){return this._canAddExtension(e,[])}_canAddExtension(e,t){if(this._registry.getExtensionDescriptionByIdOrUUID(e.identifier,e.id)&&!t.some(c=>Cn.equals(e.identifier,c.identifier)))return!1;const s=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===_e.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,s,!o,o,rp.None)!==null}canRemoveExtension(e){const t=this._registry.getExtensionDescription(e.identifier);return!(!t||this._extensionStatus.get(t.identifier)?.activationStarted)}async _activateAddedExtensionIfNeeded(e){let t=!1,i=null,s=!1;const o=this._activationEventReader.readActivationEvents(e);for(const r of o){if(this._allRequestedActivateEvents.has(r)){t=!0,i=r;break}if(r==="*"){t=!0,i=r;break}if(/^workspaceContains/.test(r)&&(s=!0),r==="onStartupFinished"){t=!0,i=r;break}}if(t)await Promise.all(this._extensionHostManagers.map(r=>r.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:i}))).then(()=>{});else if(s){const r=await this._contextService.getCompleteWorkspace(),a=!!this._environmentService.remoteAuthority,c={logService:this._logService,folders:r.folders.map(d=>d.uri),forceUsingSearch:a,exists:d=>this._fileService.exists(d),checkExists:(d,h,u)=>this._instantiationService.invokeFunction(f=>eot(f,d,h,u))},l=await Zst(c,e);if(!l)return;await Promise.all(this._extensionHostManagers.map(d=>d.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:l.activationEvent}))).then(()=>{})}}async _initialize(){vs("code/willLoadExtensions"),this._startExtensionHostsIfNecessary(!0,[]);const e=await this._registry.acquireLock("_initialize");try{const t=await this._resolveExtensions();this._processExtensions(e,t);const i=this._registry.getSnapshot();for(const s of this._extensionHostManagers)if(s.startup!==Wx.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,s);s.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),vs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:s}=t,o=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,Ao.LocalWebWorker):[],c=s?this._runningLocations.filterByExtensionHostKind(o,Ao.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,Ao.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,Ao.Remote);for(const u of a)d9t(l,u.identifier)||l.push(u);const d=r.concat(c).concat(l),h=this._registry.deltaExtensions(e,d,[]);h.removedDueToLooping.length>0&&this._notificationService.notify({severity:nt.Error,message:g(Yw,0,"The following extensions contain dependency loops and have been disabled: {0}",h.removedDueToLooping.map(u=>`'${u.identifier.value}'`).join(", "))}),this._doHandleExtensionPoints(this._registry.getAllExtensionDescriptions())}async _handleExtensionTests(){if(!this._environmentService.isExtensionDevelopment||!this._environmentService.extensionTestsLocationURI)return;const e=this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);if(!e){const i=g(Yw,1,"No extension host found that can launch the test runner at {0}.",this._environmentService.extensionTestsLocationURI.toString());console.error(i),this._notificationService.error(i);return}let t;try{t=await e.extensionTestsExecute(),Vu&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Vu&&this._logService.error("Extension host test runner error",i),console.error(i),t=1}this._onExtensionHostExit(t)}findTestExtensionHost(e){let t=null;for(const i of this._registry.getAllExtensionDescriptions())if(MS(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===_e.vscodeRemote?t=new Vne:t=new Une(0)),t!==null?this._getExtensionHostManagerByRunningLocation(t):null}_releaseBarrier(){this._installedExtensionsReady.open(),this._onDidRegisterExtensions.fire(void 0),this._onDidChangeExtensionsStatus.fire(this._registry.getAllExtensionDescriptions().map(e=>e.identifier))}async _resolveAuthorityInitial(e){for(let i=1;;i++)try{return this._resolveAuthorityWithLogging(e)}catch(s){if(HI.isNoResolverFound(s)||HI.isNotAvailable(s)||i>=5)throw s}}async _resolveAuthorityAgain(){const e=this._environmentService.remoteAuthority;if(e){this._remoteAuthorityResolverService._clearResolvedAuthority(e);try{const t=await this._resolveAuthorityWithLogging(e);this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options)}catch(t){this._remoteAuthorityResolverService._setResolvedAuthorityError(e,t)}}}async _resolveAuthorityWithLogging(e){const t=Pne(e),i=ao.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{vs(`code/willResolveAuthority/${t}`);const s=await this._resolveAuthority(e);return vs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${s.authority.connectTo}' after ${i.elapsed()} ms`),s}catch(s){throw vs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,s),s}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const s=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of s){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===Xd.Unknown,c=r.error.code===Xd.Unknown;a&&!c&&(o=r)}throw new HI(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e){return this._doStopExtensionHostsWithVeto(e)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);for(let t=this._extensionHostManagers.length-1;t>=0;t--)this._extensionHostManagers[t].dispose();this._extensionHostManagers=[];for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e){const t=[],i=new Set;this._onWillStop.fire({reason:e,veto(o,r){t.push(o),typeof o=="boolean"?o===!0&&i.add(r):o.then(a=>{a&&i.add(r)}).catch(a=>{i.add(g(Yw,2,"{0} (Error: {1})",r,Ma(a)))})}});const s=await w8t(t,o=>this._logService.error(o));if(!s)this._doStopExtensionHosts();else{const o=Array.from(i);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${o.join(", ")})`),await this._dialogService.warn(g(Yw,3,"The following operation was blocked: {0}",e),o.length===1?g(Yw,4,"The reason for blocking the operation: {0}",o[0]):g(Yw,5,`The reasons for blocking the operation: - {0}`,o.join(` - -`)))}return!s}_startExtensionHostsIfNecessary(e,t){const i=[];for(let s=0;s<=this._runningLocations.maxLocalProcessAffinity;s++)i.push(new Une(s));for(let s=0;s<=this._runningLocations.maxLocalWebWorkerAffinity;s++)i.push(new DDe(s));i.push(new Vne);for(const s of i){if(this._getExtensionHostManagerByRunningLocation(s))continue;const o=this._createExtensionHostManager(s,e,t);o&&this._extensionHostManagers.push(o)}}_createExtensionHostManager(e,t,i){const s=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!s)return null;const o=this._doCreateExtensionHostManager(s,i);return o.onDidExit(([r,a])=>this._onExtensionHostCrashOrExit(o,r,a)),o.onDidChangeResponsiveState(r=>{this._logService.info(`Extension host (${o.friendyName}) is ${r===DM.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:r===DM.Responsive,getInspectListener:a=>o.getInspectPort(a)})}),o}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===Wx.Lazy&&t.length===0?this._instantiationService.createInstance(IDe,e,i):this._instantiationService.createInstance(Wne,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!dOe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){if(console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===Ao.LocalProcess)this._doStopExtensionHosts();else if(e.kind===Ao.Remote){i&&this._onRemoteExtensionHostCrashed(e,i);for(let s=0;s{const s=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(s),t(o)},i)})}async _onRemoteExtensionHostCrashed(e,t){try{const i=await this._getExtensionHostExitInfoWithTimeout(t);i&&this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly with code ${i.code}.`),this._logExtensionHostCrash(e),this._remoteCrashTracker.registerCrash(),this._remoteCrashTracker.shouldAutomaticallyRestart()?(this._logService.info("Automatically restarting the remote extension host."),this._notificationService.status(g(Yw,6,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(nt.Error,g(Yw,7,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(Yw,8,"Restart Remote Extension Host"),run:()=>{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))}}])}catch{}}_logExtensionHostCrash(e){const t=[];for(const i of this._extensionStatus.values())i.activationStarted&&e.containsExtension(i.id)&&t.push(i.id);t.length>0?this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. The following extensions were running: ${t.map(i=>i.value).join(", ")}`):this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. No extensions were activated.`)}async startExtensionHosts(e){this._doStopExtensionHosts(),e&&await this._handleDeltaExtensions(new rT(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(Ao.LocalProcess);await Promise.all(i.map(s=>s.ready()))}finally{t.dispose()}}activateByEvent(e,t=sC.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):a9t):(this._allRequestedActivateEvents.add(e),t===sC.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(s=>s.activateByEvent(e,t))).then(()=>{});return this._onWillActivateByEvent.fire({event:e,activation:i}),i}activateById(e,t){return this._activateById(e,t)}activationEventIsDone(e){return this._installedExtensionsReady.isOpen()?this._registry.containsActivationEvent(e)?this._extensionHostManagers.every(t=>t.activationEventIsDone(e)):!0:!1}whenInstalledExtensionsRegistered(){return this._installedExtensionsReady.wait()}get extensions(){return this._registry.getAllExtensionDescriptions()}_getExtensionRegistrySnapshotWhenReady(){return this._installedExtensionsReady.wait().then(()=>this._registry.getSnapshot())}getExtension(e){return this._installedExtensionsReady.wait().then(()=>this._registry.getExtensionDescription(e))}readExtensionPointContributions(e){return this._installedExtensionsReady.wait().then(()=>{const t=this._registry.getAllExtensionDescriptions(),i=[];for(const s of t)s.contributes&&Vpe.call(s.contributes,e.name)&&i.push(new lMt(s,s.contributes[e.name]));return i})}getExtensionsStatus(){const e=Object.create(null);if(this._registry){const t=this._registry.getAllExtensionDescriptions();for(const i of t){const s=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:s?.messages??[],activationStarted:s?.activationStarted??!1,activationTimes:s?.activationTimes??void 0,runtimeErrors:s?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(s=>s.getInspectPort(t)))).filter(yl)}async setRemoteEnvironment(e){await this._extensionHostManagers.map(t=>t.setRemoteEnvironment(e))}_safeInvokeIsEnabled(e){try{return this._extensionEnablementService.isEnabled(e)}catch{return!1}}_doHandleExtensionPoints(e){const t=Object.create(null);for(const r of e)if(r.contributes)for(const a in r.contributes)Vpe.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),s=this._registry.getAllExtensionDescriptions(),o=Ap.getExtensionPoints();vs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(vs(`code/willHandleExtensionPoint/${r.name}`),LDe._handleExtensionPoint(r,s,i),vs(`code/didHandleExtensionPoint/${r.name}`));vs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new h9t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),s=`[${e.extensionId.value}]: ${e.message}`;if(e.type===nt.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Error,message:s}),this._logService.error(s)):e.type===nt.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Warning,message:s}),this._logService.warn(s)):this._logService.info(s),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:o,extensionId:r,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:o,extensionId:r.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const s=[];for(const o of t)o.contributes&&Vpe.call(o.contributes,e.name)&&s.push({description:o,value:o.contributes[e.name],collector:new kMt(i,o,e.name)});e.acceptUsers(s)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,s,o,r)=>this._onDidActivateExtension(t,i,s,o,r),_onDidActivateExtensionError:(t,i)=>this._onDidActivateExtensionError(t,i),_onExtensionRuntimeError:(t,i)=>this._onExtensionRuntimeError(t,i)}}async _activateById(e,t){if(!(await Promise.all(this._extensionHostManagers.map(o=>o.activate(e,t)))).some(o=>o))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,s,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new cMt(t,i,s,o)),this._onDidChangeExtensionsStatus.fire([e])}_onDidActivateExtensionError(e,t){this._telemetryService.publicLog2("extensionActivationError",{extensionId:e.value,error:t.message})}_onExtensionRuntimeError(e,t){this._getOrCreateExtensionStatus(e).addRuntimeError(t),this._onDidChangeExtensionsStatus.fire([e])}};TDe=LDe=D([_(3,be),_(4,Pi),_(5,Za),_(6,on),_(7,Kh),_(8,ci),_(9,Ja),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,Ze),_(15,Sf),_(16,Gde),_(17,mg),_(18,rA),_(19,To)],TDe);class c9t{constructor(e,t,i,s){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=s}}class rT{constructor(e,t){this.toAdd=e,this.toRemove=t}}function RDe(n,e,t,i,s){return t.updateEnabledApiProposals(i),l9t(n,e,i,s)}function l9t(n,e,t,i){const s=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?s.push(c):(o.push(c),r.push(che(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(Yw,9,"Activation Events"),access:{canToggle:!1},renderer:new $i(g9t)});var t_;(function(n){n[n.Open=1]="Open",n[n.OpenInNewWindow=2]="OpenInNewWindow",n[n.Cancel=3]="Cancel"})(t_||(t_={}));const f9t="security.workspace.trust.enabled",X3e="security.workspace.trust.untrustedFiles",p9t="security.workspace.trust.emptyWindow",m9t="extensions.supportUntrustedWorkspaces",_9t="content.trust.model.key";class v9t{constructor(e,t,i){this.originalWorkspace=e,this.canonicalFolderUris=t,this.canonicalConfiguration=i}get folders(){return this.originalWorkspace.folders.map((e,t)=>({index:e.index,name:e.name,toResource:e.toResource,uri:this.canonicalFolderUris[t]}))}get transient(){return this.originalWorkspace.transient}get configuration(){return this.canonicalConfiguration??this.originalWorkspace.configuration}get id(){return this.originalWorkspace.id}}let Z3e=class extends ${constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(f9t)}};Z3e=D([_(0,Re),_(1,Za)],Z3e);let e$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=s,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=_9t,this._onDidChangeTrust=this._register(new I),this.onDidChangeTrust=this._onDidChangeTrust.event,this._onDidChangeTrustedFolders=this._register(new I),this.onDidChangeTrustedFolders=this._onDidChangeTrustedFolders.event,this._canonicalStartupFiles=[],this._canonicalUrisResolved=!1,this._canonicalWorkspace=this.workspaceService.getWorkspace(),{promise:this._workspaceResolvedPromise,resolve:this._workspaceResolvedPromiseResolve}=NU(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=NU(),this._storedTrustState=new b9t(Jn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new w9t),this._trustStateInfo=this.loadTrustInfo(),this._isTrusted=this.calculateWorkspaceTrust(),this.initializeWorkspaceTrust(),this.registerListeners()}initializeWorkspaceTrust(){this.resolveCanonicalUris().then(async()=>{this._canonicalUrisResolved=!0,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceResolvedPromiseResolve(),this.environmentService.remoteAuthority||this._workspaceTrustInitializedPromiseResolve()}),this.environmentService.remoteAuthority&&this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority).then(async e=>{this._remoteAuthority=e,await this.fileService.activateProvider(_e.vscodeRemote),await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceTrustInitializedPromiseResolve()}),this.isEmptyWorkspace()&&this._workspaceTrustInitializedPromise.then(()=>{this._storedTrustState.isEmptyWorkspaceTrusted===void 0&&(this._storedTrustState.isEmptyWorkspaceTrusted=this.isWorkspaceTrusted())})}registerListeners(){this._register(this.workspaceService.onDidChangeWorkspaceFolders(async()=>await this.updateWorkspaceTrust())),this._register(this.storageService.onDidChangeValue(ke.APPLICATION,this.storageKey,this._register(new Z))(async()=>{JSON.stringify(this._trustStateInfo)!==JSON.stringify(this.loadTrustInfo())&&(this._trustStateInfo=this.loadTrustInfo(),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust())}))}async getCanonicalUri(e){let t=e;if(this.environmentService.remoteAuthority&&e.scheme===_e.vscodeRemote)t=await this.remoteAuthorityResolverService.getCanonicalURI(e);else if(e.scheme==="vscode-vfs"){const i=e.authority.indexOf("+");i!==-1&&(t=e.with({authority:e.authority.substr(0,i)}))}return t.with({query:null,fragment:null})}async resolveCanonicalUris(){const e=[];if(this.environmentService.filesToOpenOrCreate&&e.push(...this.environmentService.filesToOpenOrCreate),this.environmentService.filesToDiff&&e.push(...this.environmentService.filesToDiff),this.environmentService.filesToMerge&&e.push(...this.environmentService.filesToMerge),e.length){const o=e.filter(a=>!!a.fileUri).map(a=>a.fileUri),r=await Promise.all(o.map(a=>this.getCanonicalUri(a)));this._canonicalStartupFiles.push(...r.filter(a=>this._canonicalStartupFiles.every(c=>!this.uriIdentityService.extUri.isEqual(a,c))))}const t=this.workspaceService.getWorkspace().folders.map(o=>o.uri),i=await Promise.all(t.map(o=>this.getCanonicalUri(o)));let s=this.workspaceService.getWorkspace().configuration;s&&lbe(s,this.environmentService)&&(s=await this.getCanonicalUri(s)),this._canonicalWorkspace=new v9t(this.workspaceService.getWorkspace(),i,s)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,ke.APPLICATION);let t;try{e&&(t=JSON.parse(e))}catch{}return t||(t={uriTrustInfo:[]}),t.uriTrustInfo||(t.uriTrustInfo=[]),t.uriTrustInfo=t.uriTrustInfo.map(i=>({uri:P.revive(i.uri),trusted:i.trusted})),t.uriTrustInfo=t.uriTrustInfo.filter(i=>i.trusted),t}async saveTrustInfo(){this.storageService.store(this.storageKey,JSON.stringify(this._trustStateInfo),ke.APPLICATION,ln.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&lbe(t,this.environmentService)&&e.push(t),e}calculateWorkspaceTrust(){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this._canonicalUrisResolved?this.environmentService.remoteAuthority&&this._remoteAuthority?.options?.isTrusted?this._remoteAuthority.options.isTrusted:this.isEmptyWorkspace()?this._storedTrustState.isEmptyWorkspaceTrusted!==void 0?this._storedTrustState.isEmptyWorkspaceTrusted:this._canonicalStartupFiles.length?this.getUrisTrust(this._canonicalStartupFiles):!!this.configurationService.getValue(p9t):this.getUrisTrust(this.getWorkspaceUris()):!1:!0}async updateWorkspaceTrust(e){this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&(e===void 0&&(await this.resolveCanonicalUris(),e=this.calculateWorkspaceTrust()),this.isWorkspaceTrusted()!==e&&(this.isTrusted=e,await this._trustTransitionManager.participate(e),this._onDidChangeTrust.fire(e)))}getUrisTrust(e){let t=!0;for(const i of e){const{trusted:s}=this.doGetUriTrustInfo(i);if(!s)return t=s,t}return t}doGetUriTrustInfo(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled())return{trusted:!0,uri:e};if(this.isTrustedVirtualResource(e))return{trusted:!0,uri:e};if(this.isTrustedByRemote(e))return{trusted:!0,uri:e};let t=!1,i=-1,s=e;for(const o of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(e,o.uri)){const r=o.uri.fsPath;r.length>i&&(i=r.length,t=o.trusted,s=o.uri)}return{trusted:t,uri:s}}async doSetUrisTrust(e,t){let i=!1;for(const s of e)if(t){if(this.isTrustedVirtualResource(s)||this.isTrustedByRemote(s))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,s))||(this._trustStateInfo.uriTrustInfo.push({uri:s,trusted:!0}),i=!0)}else{const o=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(r=>!this.uriIdentityService.extUri.isEqual(r.uri,s)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===Nn.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?hx(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return UEe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:_Z(uZe(e),this._remoteAuthority.authority.authority)&&!!this._remoteAuthority.options?.isTrusted}set isTrusted(e){this._isTrusted=e,e||(this._storedTrustState.acceptsOutOfWorkspaceFiles=!1),this.isEmptyWorkspace()&&(this._storedTrustState.isEmptyWorkspaceTrusted=e)}get workspaceResolved(){return this._workspaceResolvedPromise}get workspaceTrustInitialized(){return this._workspaceTrustInitializedPromise}get acceptsOutOfWorkspaceFiles(){return this._storedTrustState.acceptsOutOfWorkspaceFiles}set acceptsOutOfWorkspaceFiles(e){this._storedTrustState.acceptsOutOfWorkspaceFiles=e}isWorkspaceTrusted(){return this._isTrusted}isWorkspaceTrustForced(){return!!(this.environmentService.remoteAuthority&&this._remoteAuthority&&this._remoteAuthority.options?.isTrusted!==void 0||this.getWorkspaceUris().filter(t=>!this.isTrustedVirtualResource(t)).length===0)}canSetParentFolderTrust(){const e=UW(this._canonicalWorkspace);if(!BS(e)||e.uri.scheme!==_e.file&&e.uri.scheme!==_e.vscodeRemote)return!1;const t=this.uriIdentityService.extUri.dirname(e.uri);return!this.uriIdentityService.extUri.isEqual(e.uri,t)}async setParentFolderTrust(e){if(this.canSetParentFolderTrust()){const t=UW(this._canonicalWorkspace).uri,i=this.uriIdentityService.extUri.dirname(t);await this.setUrisTrust([i],e)}}canSetWorkspaceTrust(){if(this.environmentService.remoteAuthority&&(!this._remoteAuthority||this._remoteAuthority.options?.isTrusted!==void 0))return!1;if(this.isEmptyWorkspace())return!0;if(this.getWorkspaceUris().filter(s=>!this.isTrustedVirtualResource(s)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=UW(this._canonicalWorkspace);if(!BS(t)||t.uri.scheme!==_e.file&&t.uri.scheme!=="vscode-vfs")return!1;const i=this.doGetUriTrustInfo(t.uri);if(!i.trusted||!this.uriIdentityService.extUri.isEqual(t.uri,i.uri))return!1;if(this.canSetParentFolderTrust()){const s=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(s).trusted)return!1}return!0}async setWorkspaceTrust(e){if(this.isEmptyWorkspace()){await this.updateWorkspaceTrust(e);return}const t=this.getWorkspaceUris();await this.setUrisTrust(t,e)}async getUriTrustInfo(e){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this.isTrustedByRemote(e)?{trusted:!0,uri:e}:this.doGetUriTrustInfo(await this.getCanonicalUri(e)):{trusted:!0,uri:e}}async setUrisTrust(e,t){this.doSetUrisTrust(await Promise.all(e.map(i=>this.getCanonicalUri(i))),t)}getTrustedUris(){return this._trustStateInfo.uriTrustInfo.map(e=>e.uri)}async setTrustedUris(e){this._trustStateInfo.uriTrustInfo=[];for(const t of e){const i=await this.getCanonicalUri(t),s=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,s)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:s})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};e$e=D([_(0,Re),_(1,rA),_(2,sn),_(3,_o),_(4,Za),_(5,Ti),_(6,Sde),_(7,ci)],e$e);let t$e=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceTrustManagementService=t,this._onDidInitiateOpenFilesTrustRequest=this._register(new I),this.onDidInitiateOpenFilesTrustRequest=this._onDidInitiateOpenFilesTrustRequest.event,this._onDidInitiateWorkspaceTrustRequest=this._register(new I),this.onDidInitiateWorkspaceTrustRequest=this._onDidInitiateWorkspaceTrustRequest.event,this._onDidInitiateWorkspaceTrustRequestOnStartup=this._register(new I),this.onDidInitiateWorkspaceTrustRequestOnStartup=this._onDidInitiateWorkspaceTrustRequestOnStartup.event}get untrustedFilesSetting(){return this.configurationService.getValue(X3e)}set untrustedFilesSetting(e){this.configurationService.updateValue(X3e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===t_.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===t_.Open&&(this.untrustedFilesSetting="open"),e===t_.OpenInNewWindow&&(this.untrustedFilesSetting="newWindow")),this._openFilesTrustRequestResolver(e),this._openFilesTrustRequestResolver=void 0,this._openFilesTrustRequestPromise=void 0)}async requestOpenFilesTrust(e){if(!this.workspaceTrustManagementService.isWorkspaceTrusted()||(await Promise.all(e.map(i=>this.workspaceTrustManagementService.getUriTrustInfo(i)))).map(i=>i.trusted).every(i=>i))return t_.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return t_.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return t_.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return t_.Open;if(!this._openFilesTrustRequestPromise)this._openFilesTrustRequestPromise=new Promise(i=>{this._openFilesTrustRequestResolver=i});else return this._openFilesTrustRequestPromise;return this._onDidInitiateOpenFilesTrustRequest.fire(),this._openFilesTrustRequestPromise}resolveWorkspaceTrustRequest(e){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(e??this.workspaceTrustManagementService.isWorkspaceTrusted()),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}cancelWorkspaceTrustRequest(){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(void 0),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}async completeWorkspaceTrustRequest(e){if(e===void 0||e===this.workspaceTrustManagementService.isWorkspaceTrusted()){this.resolveWorkspaceTrustRequest(e);return}T.once(this.workspaceTrustManagementService.onDidChangeTrust)(t=>this.resolveWorkspaceTrustRequest(t)),await this.workspaceTrustManagementService.setWorkspaceTrust(e)}async requestWorkspaceTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return this.workspaceTrustManagementService.isWorkspaceTrusted();if(!this._workspaceTrustRequestPromise)this._workspaceTrustRequestPromise=new Promise(t=>{this._workspaceTrustRequestResolver=t});else return this._workspaceTrustRequestPromise;return this._onDidInitiateWorkspaceTrustRequest.fire(e),this._workspaceTrustRequestPromise}requestWorkspaceTrustOnStartup(){this._workspaceTrustRequestPromise||(this._workspaceTrustRequestPromise=new Promise(e=>{this._workspaceTrustRequestResolver=e})),this._onDidInitiateWorkspaceTrustRequestOnStartup.fire()}};t$e=D([_(0,Re),_(1,oA)],t$e);class w9t extends ${constructor(){super(...arguments),this.participants=new td}addWorkspaceTrustTransitionParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e){for(const t of this.participants)await t.participate(e)}dispose(){this.participants.clear(),super.dispose()}}class b9t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new W1("workspaceTrust",e),this._mementoObject=this._memento.getMemento(ke.WORKSPACE,ln.MACHINE)):this._mementoObject={}}get acceptsOutOfWorkspaceFiles(){return this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]??!1}set acceptsOutOfWorkspaceFiles(e){this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]=e,this._memento?.saveMemento()}get isEmptyWorkspaceTrusted(){return this._mementoObject[this._isEmptyWorkspaceTrustedKey]}set isEmptyWorkspaceTrusted(e){this._mementoObject[this._isEmptyWorkspaceTrustedKey]=e,this._memento?.saveMemento()}}let NDe=class extends ${constructor(e,t,i,s){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=s,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new $a;const o=t.inspect(m9t).userValue||{};for(const r of Object.keys(o))this._configuredExtensionWorkspaceTrustRequestMap.set(r,o[r]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,e.extensionUntrustedWorkspaceSupport)for(const r of Object.keys(e.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(r,e.extensionUntrustedWorkspaceSupport[r])}prefersExecuteOnUI(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="ui"}prefersExecuteOnWorkspace(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="workspace"}prefersExecuteOnWeb(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="web"}canExecuteOnUI(e){return this.getExtensionKind(e).some(i=>i==="ui")}canExecuteOnWorkspace(e){return this.getExtensionKind(e).some(i=>i==="workspace")}canExecuteOnWeb(e){return this.getExtensionKind(e).some(i=>i==="web")}getExtensionKind(e){const t=this.deduceExtensionKind(e),i=this.getConfiguredExtensionKind(e);if(i&&i.length>0){const s=[];for(const o of i)o!=="-web"&&s.push(o);return i.includes("-web")&&!s.length&&(s.push("ui"),s.push("workspace")),Jn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&s.push("web"),s}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new $a,s=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(s))i.set(o,s[o]);this._configuredExtensionKindsMap=i}const t=this._configuredExtensionKindsMap.get(e.id);return t?this.toArray(t):void 0}getExtensionUntrustedWorkspaceSupportType(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||!e.main)return!0;const t=this.getConfiguredExtensionWorkspaceTrustRequest(e),i=this.getProductExtensionWorkspaceTrustRequest(e);return t!==void 0?t:i?.override!==void 0?i.override:e.capabilities?.untrustedWorkspaces?.supported!==void 0?e.capabilities.untrustedWorkspaces.supported:i?.default!==void 0?i.default:!1}getExtensionVirtualWorkspaceSupportType(e){const t=this.getConfiguredVirtualWorkspaceSupport(e);if(t!==void 0)return t;const i=this.getProductVirtualWorkspaceSupport(e);if(i?.override!==void 0)return i.override;const s=e.capabilities?.virtualWorkspaces;if(g9(s))return s;if(s){const o=s.supported;if(g9(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Jn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...nLt];if((mo(e.extensionPack)||mo(e.extensionDependencies))&&(t=Jn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const s=this.getSupportedExtensionKindsForExtensionPoint(i);s.length&&(t=t.filter(o=>s.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",ny(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;Ap.getExtensionPoints().forEach(s=>i.set(s.name,s.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Jn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:ny(e.publisher,e.name)};let i=this.getUserConfiguredExtensionKind(t);return typeof i<"u"?this.toArray(i):(i=this.getProductExtensionKind(e),typeof i<"u"?i:(i=e.extensionKind,typeof i<"u"?(i=this.toArray(i),i.filter(s=>["ui","workspace"].includes(s))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new $a;if(this.productService.extensionKind)for(const s of Object.keys(this.productService.extensionKind))i.set(s,this.productService.extensionKind[s]);this._productExtensionKindsMap=i}const t=ny(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new $a;if(this.productService.extensionVirtualWorkspacesSupport)for(const s of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(s,this.productService.extensionVirtualWorkspacesSupport[s]);this._productVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new $a,s=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(s))s[o]!==void 0&&i.set(o,s[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name),i=this._configuredExtensionWorkspaceTrustRequestMap.get(t);if(i&&(i.version===void 0||i.version===e.version))return i.supported}getProductExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};NDe=D([_(0,Ja),_(1,Re),_(2,Sde),_(3,Ze)],NDe);let PDe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(s=>Cn.toKey(s))),this._envEnablesProposedApiForAll=!t.isBuilt||t.isExtensionDevelopment&&i.quality!=="stable"||this._envEnabledExtensions.size===0&&Array.isArray(t.extensionEnabledProposedApi),this._productEnabledExtensions=new Map,i.extensionEnabledApiProposals)for(const[s,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Cn.toKey(s),a=o.filter(c=>mV[c]?!0:(e.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${r}' wants API proposal '${c}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),!1));this._productEnabledExtensions.set(r,a)}}updateEnabledApiProposals(e){for(const t of e)this.doUpdateEnabledApiProposals(t)}doUpdateEnabledApiProposals(e){const t=e,i=Cn.toKey(e.identifier);if(mo(t.enabledApiProposals)&&(t.enabledApiProposals=t.enabledApiProposals.filter(s=>{const o=!!mV[s];return o||this._logService.error(`Extension '${i}' wants API proposal '${s}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),o})),this._productEnabledExtensions.has(i)){const s=this._productEnabledExtensions.get(i),o=new Set(s),r=new Set(t.enabledApiProposals),a=new Set([...r].filter(c=>!o.has(c)));a.size>0&&(this._logService.error(`Extension '${i}' appears in product.json but enables LESS API proposals than the extension wants. + -`)))}return!s}_startExtensionHostsIfNecessary(e,t){const i=[];for(let s=0;s<=this._runningLocations.maxLocalProcessAffinity;s++)i.push(new Une(s));for(let s=0;s<=this._runningLocations.maxLocalWebWorkerAffinity;s++)i.push(new DDe(s));i.push(new Vne);for(const s of i){if(this._getExtensionHostManagerByRunningLocation(s))continue;const o=this._createExtensionHostManager(s,e,t);o&&this._extensionHostManagers.push(o)}}_createExtensionHostManager(e,t,i){const s=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!s)return null;const o=this._doCreateExtensionHostManager(s,i);return o.onDidExit(([r,a])=>this._onExtensionHostCrashOrExit(o,r,a)),o.onDidChangeResponsiveState(r=>{this._logService.info(`Extension host (${o.friendyName}) is ${r===DM.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:r===DM.Responsive,getInspectListener:a=>o.getInspectPort(a)})}),o}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===Wx.Lazy&&t.length===0?this._instantiationService.createInstance(IDe,e,i):this._instantiationService.createInstance(Wne,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!dOe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){if(console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===Ao.LocalProcess)this._doStopExtensionHosts();else if(e.kind===Ao.Remote){i&&this._onRemoteExtensionHostCrashed(e,i);for(let s=0;s{const s=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(s),t(o)},i)})}async _onRemoteExtensionHostCrashed(e,t){try{const i=await this._getExtensionHostExitInfoWithTimeout(t);i&&this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly with code ${i.code}.`),this._logExtensionHostCrash(e),this._remoteCrashTracker.registerCrash(),this._remoteCrashTracker.shouldAutomaticallyRestart()?(this._logService.info("Automatically restarting the remote extension host."),this._notificationService.status(g(Yw,6,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(nt.Error,g(Yw,7,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(Yw,8,"Restart Remote Extension Host"),run:()=>{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))}}])}catch{}}_logExtensionHostCrash(e){const t=[];for(const i of this._extensionStatus.values())i.activationStarted&&e.containsExtension(i.id)&&t.push(i.id);t.length>0?this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. The following extensions were running: ${t.map(i=>i.value).join(", ")}`):this._logService.error(`Extension host (${e.friendyName}) terminated unexpectedly. No extensions were activated.`)}async startExtensionHosts(e){this._doStopExtensionHosts(),e&&await this._handleDeltaExtensions(new rT(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(Ao.LocalProcess);await Promise.all(i.map(s=>s.ready()))}finally{t.dispose()}}activateByEvent(e,t=sC.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):a9t):(this._allRequestedActivateEvents.add(e),t===sC.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(s=>s.activateByEvent(e,t))).then(()=>{});return this._onWillActivateByEvent.fire({event:e,activation:i}),i}activateById(e,t){return this._activateById(e,t)}activationEventIsDone(e){return this._installedExtensionsReady.isOpen()?this._registry.containsActivationEvent(e)?this._extensionHostManagers.every(t=>t.activationEventIsDone(e)):!0:!1}whenInstalledExtensionsRegistered(){return this._installedExtensionsReady.wait()}get extensions(){return this._registry.getAllExtensionDescriptions()}_getExtensionRegistrySnapshotWhenReady(){return this._installedExtensionsReady.wait().then(()=>this._registry.getSnapshot())}getExtension(e){return this._installedExtensionsReady.wait().then(()=>this._registry.getExtensionDescription(e))}readExtensionPointContributions(e){return this._installedExtensionsReady.wait().then(()=>{const t=this._registry.getAllExtensionDescriptions(),i=[];for(const s of t)s.contributes&&Vpe.call(s.contributes,e.name)&&i.push(new lMt(s,s.contributes[e.name]));return i})}getExtensionsStatus(){const e=Object.create(null);if(this._registry){const t=this._registry.getAllExtensionDescriptions();for(const i of t){const s=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:s?.messages??[],activationStarted:s?.activationStarted??!1,activationTimes:s?.activationTimes??void 0,runtimeErrors:s?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(s=>s.getInspectPort(t)))).filter(yl)}async setRemoteEnvironment(e){await this._extensionHostManagers.map(t=>t.setRemoteEnvironment(e))}_safeInvokeIsEnabled(e){try{return this._extensionEnablementService.isEnabled(e)}catch{return!1}}_doHandleExtensionPoints(e){const t=Object.create(null);for(const r of e)if(r.contributes)for(const a in r.contributes)Vpe.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),s=this._registry.getAllExtensionDescriptions(),o=Ap.getExtensionPoints();vs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(vs(`code/willHandleExtensionPoint/${r.name}`),LDe._handleExtensionPoint(r,s,i),vs(`code/didHandleExtensionPoint/${r.name}`));vs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new h9t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),s=`[${e.extensionId.value}]: ${e.message}`;if(e.type===nt.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Error,message:s}),this._logService.error(s)):e.type===nt.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:nt.Warning,message:s}),this._logService.warn(s)):this._logService.info(s),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:o,extensionId:r,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:o,extensionId:r.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const s=[];for(const o of t)o.contributes&&Vpe.call(o.contributes,e.name)&&s.push({description:o,value:o.contributes[e.name],collector:new kMt(i,o,e.name)});e.acceptUsers(s)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,s,o,r)=>this._onDidActivateExtension(t,i,s,o,r),_onDidActivateExtensionError:(t,i)=>this._onDidActivateExtensionError(t,i),_onExtensionRuntimeError:(t,i)=>this._onExtensionRuntimeError(t,i)}}async _activateById(e,t){if(!(await Promise.all(this._extensionHostManagers.map(o=>o.activate(e,t)))).some(o=>o))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,s,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new cMt(t,i,s,o)),this._onDidChangeExtensionsStatus.fire([e])}_onDidActivateExtensionError(e,t){this._telemetryService.publicLog2("extensionActivationError",{extensionId:e.value,error:t.message})}_onExtensionRuntimeError(e,t){this._getOrCreateExtensionStatus(e).addRuntimeError(t),this._onDidChangeExtensionsStatus.fire([e])}};TDe=LDe=D([_(3,be),_(4,Pi),_(5,Za),_(6,rn),_(7,Kh),_(8,ci),_(9,Ja),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,Ze),_(15,Sf),_(16,Gde),_(17,mg),_(18,rA),_(19,To)],TDe);class c9t{constructor(e,t,i,s){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=s}}class rT{constructor(e,t){this.toAdd=e,this.toRemove=t}}function RDe(n,e,t,i,s){return t.updateEnabledApiProposals(i),l9t(n,e,i,s)}function l9t(n,e,t,i){const s=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?s.push(c):(o.push(c),r.push(che(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(Yw,9,"Activation Events"),access:{canToggle:!1},renderer:new Gi(g9t)});var t_;(function(n){n[n.Open=1]="Open",n[n.OpenInNewWindow=2]="OpenInNewWindow",n[n.Cancel=3]="Cancel"})(t_||(t_={}));const f9t="security.workspace.trust.enabled",X3e="security.workspace.trust.untrustedFiles",p9t="security.workspace.trust.emptyWindow",m9t="extensions.supportUntrustedWorkspaces",_9t="content.trust.model.key";class v9t{constructor(e,t,i){this.originalWorkspace=e,this.canonicalFolderUris=t,this.canonicalConfiguration=i}get folders(){return this.originalWorkspace.folders.map((e,t)=>({index:e.index,name:e.name,toResource:e.toResource,uri:this.canonicalFolderUris[t]}))}get transient(){return this.originalWorkspace.transient}get configuration(){return this.canonicalConfiguration??this.originalWorkspace.configuration}get id(){return this.originalWorkspace.id}}let Z3e=class extends ${constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(f9t)}};Z3e=D([_(0,Re),_(1,Za)],Z3e);let e$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=s,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=_9t,this._onDidChangeTrust=this._register(new I),this.onDidChangeTrust=this._onDidChangeTrust.event,this._onDidChangeTrustedFolders=this._register(new I),this.onDidChangeTrustedFolders=this._onDidChangeTrustedFolders.event,this._canonicalStartupFiles=[],this._canonicalUrisResolved=!1,this._canonicalWorkspace=this.workspaceService.getWorkspace(),{promise:this._workspaceResolvedPromise,resolve:this._workspaceResolvedPromiseResolve}=NU(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=NU(),this._storedTrustState=new b9t(Jn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new w9t),this._trustStateInfo=this.loadTrustInfo(),this._isTrusted=this.calculateWorkspaceTrust(),this.initializeWorkspaceTrust(),this.registerListeners()}initializeWorkspaceTrust(){this.resolveCanonicalUris().then(async()=>{this._canonicalUrisResolved=!0,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceResolvedPromiseResolve(),this.environmentService.remoteAuthority||this._workspaceTrustInitializedPromiseResolve()}),this.environmentService.remoteAuthority&&this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority).then(async e=>{this._remoteAuthority=e,await this.fileService.activateProvider(_e.vscodeRemote),await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceTrustInitializedPromiseResolve()}),this.isEmptyWorkspace()&&this._workspaceTrustInitializedPromise.then(()=>{this._storedTrustState.isEmptyWorkspaceTrusted===void 0&&(this._storedTrustState.isEmptyWorkspaceTrusted=this.isWorkspaceTrusted())})}registerListeners(){this._register(this.workspaceService.onDidChangeWorkspaceFolders(async()=>await this.updateWorkspaceTrust())),this._register(this.storageService.onDidChangeValue(ke.APPLICATION,this.storageKey,this._register(new Z))(async()=>{JSON.stringify(this._trustStateInfo)!==JSON.stringify(this.loadTrustInfo())&&(this._trustStateInfo=this.loadTrustInfo(),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust())}))}async getCanonicalUri(e){let t=e;if(this.environmentService.remoteAuthority&&e.scheme===_e.vscodeRemote)t=await this.remoteAuthorityResolverService.getCanonicalURI(e);else if(e.scheme==="vscode-vfs"){const i=e.authority.indexOf("+");i!==-1&&(t=e.with({authority:e.authority.substr(0,i)}))}return t.with({query:null,fragment:null})}async resolveCanonicalUris(){const e=[];if(this.environmentService.filesToOpenOrCreate&&e.push(...this.environmentService.filesToOpenOrCreate),this.environmentService.filesToDiff&&e.push(...this.environmentService.filesToDiff),this.environmentService.filesToMerge&&e.push(...this.environmentService.filesToMerge),e.length){const o=e.filter(a=>!!a.fileUri).map(a=>a.fileUri),r=await Promise.all(o.map(a=>this.getCanonicalUri(a)));this._canonicalStartupFiles.push(...r.filter(a=>this._canonicalStartupFiles.every(c=>!this.uriIdentityService.extUri.isEqual(a,c))))}const t=this.workspaceService.getWorkspace().folders.map(o=>o.uri),i=await Promise.all(t.map(o=>this.getCanonicalUri(o)));let s=this.workspaceService.getWorkspace().configuration;s&&lbe(s,this.environmentService)&&(s=await this.getCanonicalUri(s)),this._canonicalWorkspace=new v9t(this.workspaceService.getWorkspace(),i,s)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,ke.APPLICATION);let t;try{e&&(t=JSON.parse(e))}catch{}return t||(t={uriTrustInfo:[]}),t.uriTrustInfo||(t.uriTrustInfo=[]),t.uriTrustInfo=t.uriTrustInfo.map(i=>({uri:P.revive(i.uri),trusted:i.trusted})),t.uriTrustInfo=t.uriTrustInfo.filter(i=>i.trusted),t}async saveTrustInfo(){this.storageService.store(this.storageKey,JSON.stringify(this._trustStateInfo),ke.APPLICATION,ln.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&lbe(t,this.environmentService)&&e.push(t),e}calculateWorkspaceTrust(){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this._canonicalUrisResolved?this.environmentService.remoteAuthority&&this._remoteAuthority?.options?.isTrusted?this._remoteAuthority.options.isTrusted:this.isEmptyWorkspace()?this._storedTrustState.isEmptyWorkspaceTrusted!==void 0?this._storedTrustState.isEmptyWorkspaceTrusted:this._canonicalStartupFiles.length?this.getUrisTrust(this._canonicalStartupFiles):!!this.configurationService.getValue(p9t):this.getUrisTrust(this.getWorkspaceUris()):!1:!0}async updateWorkspaceTrust(e){this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&(e===void 0&&(await this.resolveCanonicalUris(),e=this.calculateWorkspaceTrust()),this.isWorkspaceTrusted()!==e&&(this.isTrusted=e,await this._trustTransitionManager.participate(e),this._onDidChangeTrust.fire(e)))}getUrisTrust(e){let t=!0;for(const i of e){const{trusted:s}=this.doGetUriTrustInfo(i);if(!s)return t=s,t}return t}doGetUriTrustInfo(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled())return{trusted:!0,uri:e};if(this.isTrustedVirtualResource(e))return{trusted:!0,uri:e};if(this.isTrustedByRemote(e))return{trusted:!0,uri:e};let t=!1,i=-1,s=e;for(const o of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(e,o.uri)){const r=o.uri.fsPath;r.length>i&&(i=r.length,t=o.trusted,s=o.uri)}return{trusted:t,uri:s}}async doSetUrisTrust(e,t){let i=!1;for(const s of e)if(t){if(this.isTrustedVirtualResource(s)||this.isTrustedByRemote(s))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,s))||(this._trustStateInfo.uriTrustInfo.push({uri:s,trusted:!0}),i=!0)}else{const o=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(r=>!this.uriIdentityService.extUri.isEqual(r.uri,s)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===Nn.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?hx(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return UEe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:_Z(uZe(e),this._remoteAuthority.authority.authority)&&!!this._remoteAuthority.options?.isTrusted}set isTrusted(e){this._isTrusted=e,e||(this._storedTrustState.acceptsOutOfWorkspaceFiles=!1),this.isEmptyWorkspace()&&(this._storedTrustState.isEmptyWorkspaceTrusted=e)}get workspaceResolved(){return this._workspaceResolvedPromise}get workspaceTrustInitialized(){return this._workspaceTrustInitializedPromise}get acceptsOutOfWorkspaceFiles(){return this._storedTrustState.acceptsOutOfWorkspaceFiles}set acceptsOutOfWorkspaceFiles(e){this._storedTrustState.acceptsOutOfWorkspaceFiles=e}isWorkspaceTrusted(){return this._isTrusted}isWorkspaceTrustForced(){return!!(this.environmentService.remoteAuthority&&this._remoteAuthority&&this._remoteAuthority.options?.isTrusted!==void 0||this.getWorkspaceUris().filter(t=>!this.isTrustedVirtualResource(t)).length===0)}canSetParentFolderTrust(){const e=UW(this._canonicalWorkspace);if(!BS(e)||e.uri.scheme!==_e.file&&e.uri.scheme!==_e.vscodeRemote)return!1;const t=this.uriIdentityService.extUri.dirname(e.uri);return!this.uriIdentityService.extUri.isEqual(e.uri,t)}async setParentFolderTrust(e){if(this.canSetParentFolderTrust()){const t=UW(this._canonicalWorkspace).uri,i=this.uriIdentityService.extUri.dirname(t);await this.setUrisTrust([i],e)}}canSetWorkspaceTrust(){if(this.environmentService.remoteAuthority&&(!this._remoteAuthority||this._remoteAuthority.options?.isTrusted!==void 0))return!1;if(this.isEmptyWorkspace())return!0;if(this.getWorkspaceUris().filter(s=>!this.isTrustedVirtualResource(s)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=UW(this._canonicalWorkspace);if(!BS(t)||t.uri.scheme!==_e.file&&t.uri.scheme!=="vscode-vfs")return!1;const i=this.doGetUriTrustInfo(t.uri);if(!i.trusted||!this.uriIdentityService.extUri.isEqual(t.uri,i.uri))return!1;if(this.canSetParentFolderTrust()){const s=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(s).trusted)return!1}return!0}async setWorkspaceTrust(e){if(this.isEmptyWorkspace()){await this.updateWorkspaceTrust(e);return}const t=this.getWorkspaceUris();await this.setUrisTrust(t,e)}async getUriTrustInfo(e){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this.isTrustedByRemote(e)?{trusted:!0,uri:e}:this.doGetUriTrustInfo(await this.getCanonicalUri(e)):{trusted:!0,uri:e}}async setUrisTrust(e,t){this.doSetUrisTrust(await Promise.all(e.map(i=>this.getCanonicalUri(i))),t)}getTrustedUris(){return this._trustStateInfo.uriTrustInfo.map(e=>e.uri)}async setTrustedUris(e){this._trustStateInfo.uriTrustInfo=[];for(const t of e){const i=await this.getCanonicalUri(t),s=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,s)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:s})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};e$e=D([_(0,Re),_(1,rA),_(2,on),_(3,_o),_(4,Za),_(5,Ti),_(6,Sde),_(7,ci)],e$e);let t$e=class extends ${constructor(e,t){super(),this.configurationService=e,this.workspaceTrustManagementService=t,this._onDidInitiateOpenFilesTrustRequest=this._register(new I),this.onDidInitiateOpenFilesTrustRequest=this._onDidInitiateOpenFilesTrustRequest.event,this._onDidInitiateWorkspaceTrustRequest=this._register(new I),this.onDidInitiateWorkspaceTrustRequest=this._onDidInitiateWorkspaceTrustRequest.event,this._onDidInitiateWorkspaceTrustRequestOnStartup=this._register(new I),this.onDidInitiateWorkspaceTrustRequestOnStartup=this._onDidInitiateWorkspaceTrustRequestOnStartup.event}get untrustedFilesSetting(){return this.configurationService.getValue(X3e)}set untrustedFilesSetting(e){this.configurationService.updateValue(X3e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===t_.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===t_.Open&&(this.untrustedFilesSetting="open"),e===t_.OpenInNewWindow&&(this.untrustedFilesSetting="newWindow")),this._openFilesTrustRequestResolver(e),this._openFilesTrustRequestResolver=void 0,this._openFilesTrustRequestPromise=void 0)}async requestOpenFilesTrust(e){if(!this.workspaceTrustManagementService.isWorkspaceTrusted()||(await Promise.all(e.map(i=>this.workspaceTrustManagementService.getUriTrustInfo(i)))).map(i=>i.trusted).every(i=>i))return t_.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return t_.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return t_.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return t_.Open;if(!this._openFilesTrustRequestPromise)this._openFilesTrustRequestPromise=new Promise(i=>{this._openFilesTrustRequestResolver=i});else return this._openFilesTrustRequestPromise;return this._onDidInitiateOpenFilesTrustRequest.fire(),this._openFilesTrustRequestPromise}resolveWorkspaceTrustRequest(e){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(e??this.workspaceTrustManagementService.isWorkspaceTrusted()),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}cancelWorkspaceTrustRequest(){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(void 0),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}async completeWorkspaceTrustRequest(e){if(e===void 0||e===this.workspaceTrustManagementService.isWorkspaceTrusted()){this.resolveWorkspaceTrustRequest(e);return}T.once(this.workspaceTrustManagementService.onDidChangeTrust)(t=>this.resolveWorkspaceTrustRequest(t)),await this.workspaceTrustManagementService.setWorkspaceTrust(e)}async requestWorkspaceTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return this.workspaceTrustManagementService.isWorkspaceTrusted();if(!this._workspaceTrustRequestPromise)this._workspaceTrustRequestPromise=new Promise(t=>{this._workspaceTrustRequestResolver=t});else return this._workspaceTrustRequestPromise;return this._onDidInitiateWorkspaceTrustRequest.fire(e),this._workspaceTrustRequestPromise}requestWorkspaceTrustOnStartup(){this._workspaceTrustRequestPromise||(this._workspaceTrustRequestPromise=new Promise(e=>{this._workspaceTrustRequestResolver=e})),this._onDidInitiateWorkspaceTrustRequestOnStartup.fire()}};t$e=D([_(0,Re),_(1,oA)],t$e);class w9t extends ${constructor(){super(...arguments),this.participants=new td}addWorkspaceTrustTransitionParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e){for(const t of this.participants)await t.participate(e)}dispose(){this.participants.clear(),super.dispose()}}class b9t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new W1("workspaceTrust",e),this._mementoObject=this._memento.getMemento(ke.WORKSPACE,ln.MACHINE)):this._mementoObject={}}get acceptsOutOfWorkspaceFiles(){return this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]??!1}set acceptsOutOfWorkspaceFiles(e){this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]=e,this._memento?.saveMemento()}get isEmptyWorkspaceTrusted(){return this._mementoObject[this._isEmptyWorkspaceTrustedKey]}set isEmptyWorkspaceTrusted(e){this._mementoObject[this._isEmptyWorkspaceTrustedKey]=e,this._memento?.saveMemento()}}let NDe=class extends ${constructor(e,t,i,s){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=s,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new $a;const o=t.inspect(m9t).userValue||{};for(const r of Object.keys(o))this._configuredExtensionWorkspaceTrustRequestMap.set(r,o[r]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,e.extensionUntrustedWorkspaceSupport)for(const r of Object.keys(e.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(r,e.extensionUntrustedWorkspaceSupport[r])}prefersExecuteOnUI(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="ui"}prefersExecuteOnWorkspace(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="workspace"}prefersExecuteOnWeb(e){const t=this.getExtensionKind(e);return t.length>0&&t[0]==="web"}canExecuteOnUI(e){return this.getExtensionKind(e).some(i=>i==="ui")}canExecuteOnWorkspace(e){return this.getExtensionKind(e).some(i=>i==="workspace")}canExecuteOnWeb(e){return this.getExtensionKind(e).some(i=>i==="web")}getExtensionKind(e){const t=this.deduceExtensionKind(e),i=this.getConfiguredExtensionKind(e);if(i&&i.length>0){const s=[];for(const o of i)o!=="-web"&&s.push(o);return i.includes("-web")&&!s.length&&(s.push("ui"),s.push("workspace")),Jn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&s.push("web"),s}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new $a,s=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(s))i.set(o,s[o]);this._configuredExtensionKindsMap=i}const t=this._configuredExtensionKindsMap.get(e.id);return t?this.toArray(t):void 0}getExtensionUntrustedWorkspaceSupportType(e){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||!e.main)return!0;const t=this.getConfiguredExtensionWorkspaceTrustRequest(e),i=this.getProductExtensionWorkspaceTrustRequest(e);return t!==void 0?t:i?.override!==void 0?i.override:e.capabilities?.untrustedWorkspaces?.supported!==void 0?e.capabilities.untrustedWorkspaces.supported:i?.default!==void 0?i.default:!1}getExtensionVirtualWorkspaceSupportType(e){const t=this.getConfiguredVirtualWorkspaceSupport(e);if(t!==void 0)return t;const i=this.getProductVirtualWorkspaceSupport(e);if(i?.override!==void 0)return i.override;const s=e.capabilities?.virtualWorkspaces;if(g9(s))return s;if(s){const o=s.supported;if(g9(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Jn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...nLt];if((mo(e.extensionPack)||mo(e.extensionDependencies))&&(t=Jn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const s=this.getSupportedExtensionKindsForExtensionPoint(i);s.length&&(t=t.filter(o=>s.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",ny(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;Ap.getExtensionPoints().forEach(s=>i.set(s.name,s.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Jn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:ny(e.publisher,e.name)};let i=this.getUserConfiguredExtensionKind(t);return typeof i<"u"?this.toArray(i):(i=this.getProductExtensionKind(e),typeof i<"u"?i:(i=e.extensionKind,typeof i<"u"?(i=this.toArray(i),i.filter(s=>["ui","workspace"].includes(s))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new $a;if(this.productService.extensionKind)for(const s of Object.keys(this.productService.extensionKind))i.set(s,this.productService.extensionKind[s]);this._productExtensionKindsMap=i}const t=ny(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new $a;if(this.productService.extensionVirtualWorkspacesSupport)for(const s of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(s,this.productService.extensionVirtualWorkspacesSupport[s]);this._productVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new $a,s=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(s))s[o]!==void 0&&i.set(o,s[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=ny(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name),i=this._configuredExtensionWorkspaceTrustRequestMap.get(t);if(i&&(i.version===void 0||i.version===e.version))return i.supported}getProductExtensionWorkspaceTrustRequest(e){const t=ny(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};NDe=D([_(0,Ja),_(1,Re),_(2,Sde),_(3,Ze)],NDe);let PDe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(s=>Cn.toKey(s))),this._envEnablesProposedApiForAll=!t.isBuilt||t.isExtensionDevelopment&&i.quality!=="stable"||this._envEnabledExtensions.size===0&&Array.isArray(t.extensionEnabledProposedApi),this._productEnabledExtensions=new Map,i.extensionEnabledApiProposals)for(const[s,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Cn.toKey(s),a=o.filter(c=>mV[c]?!0:(e.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${r}' wants API proposal '${c}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),!1));this._productEnabledExtensions.set(r,a)}}updateEnabledApiProposals(e){for(const t of e)this.doUpdateEnabledApiProposals(t)}doUpdateEnabledApiProposals(e){const t=e,i=Cn.toKey(e.identifier);if(mo(t.enabledApiProposals)&&(t.enabledApiProposals=t.enabledApiProposals.filter(s=>{const o=!!mV[s];return o||this._logService.error(`Extension '${i}' wants API proposal '${s}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),o})),this._productEnabledExtensions.has(i)){const s=this._productEnabledExtensions.get(i),o=new Set(s),r=new Set(t.enabledApiProposals),a=new Set([...r].filter(c=>!o.has(c)));a.size>0&&(this._logService.error(`Extension '${i}' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): ${[...r].join(", ")} product.json (WINS): ${[...o].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...a].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),s.push(...a))),t.enabledApiProposals=s;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(i)||!t.isBuiltin&&mo(t.enabledApiProposals)&&(this._logService.error(`Extension '${t.identifier.value} CANNOT USE these API proposals '${t.enabledApiProposals?.join(", ")||"*"}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`),t.enabledApiProposals=[])}};PDe=D([_(0,Ze),_(1,Za),_(2,Ja)],PDe);async function C9t(n,e){const t=[];return await tot(n,t,e.logsHome,e.logsHome),t}async function tot(n,e,t,i){const s=await n.resolve(t);for(const{resource:o,isDirectory:r}of s.children||[])if(r)await tot(n,e,o,i);else{const a=(await n.readFile(o)).value.toString();if(a){const c=lO(i,o);c&&e.push({relativePath:c,contents:a})}}}var zp;(function(n){n[n.Promise=100]="Promise",n[n.PromiseCancel=101]="PromiseCancel",n[n.EventListen=102]="EventListen",n[n.EventDispose=103]="EventDispose"})(zp||(zp={}));function i$e(n){switch(n){case zp.Promise:return"req";case zp.PromiseCancel:return"cancel";case zp.EventListen:return"subscribe";case zp.EventDispose:return"unsubscribe"}}var Fg;(function(n){n[n.Initialize=200]="Initialize",n[n.PromiseSuccess=201]="PromiseSuccess",n[n.PromiseError=202]="PromiseError",n[n.PromiseErrorObj=203]="PromiseErrorObj",n[n.EventFire=204]="EventFire"})(Fg||(Fg={}));function n$e(n){switch(n){case Fg.Initialize:return"init";case Fg.PromiseSuccess:return"reply:";case Fg.PromiseError:case Fg.PromiseErrorObj:return"replyErr:";case Fg.EventFire:return"event:"}}var _2;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Idle=1]="Idle"})(_2||(_2={}));function nB(n){let e=0;for(let t=0;;t+=7){const i=n.read(1);if(e|=(i.buffer[0]&127)<>>7)t++;const i=ze.alloc(t);for(let s=0;e!==0;s++)i.buffer[s]=e&127,e=e>>>7,e>0&&(i.buffer[s]|=128);n.write(i)}class S9t{constructor(e){this.buffer=e,this.pos=0}read(e){const t=this.buffer.slice(this.pos,this.pos+e);return this.pos+=t.byteLength,t}}class A9t{constructor(){this.buffers=[]}get buffer(){return ze.concat(this.buffers)}write(e){this.buffers.push(e)}}var Gg;(function(n){n[n.Undefined=0]="Undefined",n[n.String=1]="String",n[n.Buffer=2]="Buffer",n[n.VSBuffer=3]="VSBuffer",n[n.Array=4]="Array",n[n.Object=5]="Object",n[n.Int=6]="Int"})(Gg||(Gg={}));function $D(n){const e=ze.alloc(1);return e.writeUInt8(n,0),e}const RL={Undefined:$D(Gg.Undefined),String:$D(Gg.String),Buffer:$D(Gg.Buffer),VSBuffer:$D(Gg.VSBuffer),Array:$D(Gg.Array),Object:$D(Gg.Object),Uint:$D(Gg.Int)},E9t=typeof Buffer<"u";function FDe(n,e){if(typeof e>"u")n.write(RL.Undefined);else if(typeof e=="string"){const t=ze.fromString(e);n.write(RL.String),sB(n,t.byteLength),n.write(t)}else if(E9t&&Buffer.isBuffer(e)){const t=ze.wrap(e);n.write(RL.Buffer),sB(n,t.byteLength),n.write(t)}else if(e instanceof ze)n.write(RL.VSBuffer),sB(n,e.byteLength),n.write(e);else if(Array.isArray(e)){n.write(RL.Array),sB(n,e.length);for(const t of e)FDe(n,t)}else if(typeof e=="number"&&(e|0)===e)n.write(RL.Uint),sB(n,e);else{const t=ze.fromString(JSON.stringify(e));n.write(RL.Object),sB(n,t.byteLength),n.write(t)}}function ODe(n){switch(n.read(1).readUInt8(0)){case Gg.Undefined:return;case Gg.String:return n.read(nB(n)).toString();case Gg.Buffer:return n.read(nB(n)).buffer;case Gg.VSBuffer:return n.read(nB(n));case Gg.Array:{const t=nB(n),i=[];for(let s=0;sthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,s,o){return t.isDisposed?Promise.reject(new Tc):t.requestPromise(e,i,s,o)},listen(i,s){return t.isDisposed?T.None:t.requestEvent(e,i,s)}}}requestPromise(e,t,i,s=qe.None){const o=this.lastRequestId++,r=zp.Promise,a={id:o,type:r,channelName:e,name:t,arg:i};if(s.isCancellationRequested)return Promise.reject(new Tc);let c;return new Promise((d,h)=>{if(s.isCancellationRequested)return h(new Tc);const u=()=>{const v=w=>{switch(w.type){case Fg.PromiseSuccess:this.handlers.delete(o),d(w.data);break;case Fg.PromiseError:{this.handlers.delete(o);const b=new Error(w.data.message);b.stack=Array.isArray(w.data.stack)?w.data.stack.join(` -`):w.data.stack,b.name=w.data.name,h(b);break}case Fg.PromiseErrorObj:this.handlers.delete(o),h(w.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===_2.Idle?u():(f=na(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:zp.PromiseCancel}),h(new Tc)},m=s.onCancellationRequested(p);c=pa(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const s=this.lastRequestId++,o=zp.EventListen,r={id:s,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=na(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(r)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:s,type:zp.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(s,l),c.event}sendRequest(e){switch(e.type){case zp.Promise:case zp.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,v2.LocalSide,`${i$e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case zp.PromiseCancel:case zp.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,v2.LocalSide,i$e(e.type));return}}}send(e,t=void 0){const i=new A9t;return FDe(i,e),FDe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new S9t(e),i=ODe(t),s=ODe(t),o=i[0];switch(o){case Fg.Initialize:return this.logger?.logIncoming(e.byteLength,0,v2.LocalSide,n$e(o)),this.onResponse({type:i[0]});case Fg.PromiseSuccess:case Fg.PromiseError:case Fg.EventFire:case Fg.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],v2.LocalSide,n$e(o),s),this.onResponse({type:i[0],id:i[1],data:s})}}onResponse(e){if(e.type===Fg.Initialize){this.state=_2.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return T.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===_2.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),St(this.activeRequests.values()),this.activeRequests.clear()}}s$e.__decorator=D([ii],s$e.prototype,"onDidInitializePromise",null);var kM;(function(n){n.Created="created",n.Read="read",n.Write="write",n.Open="open",n.Error="error",n.Close="close",n.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",n.NodeEndReceived="nodeEndReceived",n.NodeEndSent="nodeEndSent",n.NodeDrainBegin="nodeDrainBegin",n.NodeDrainEnd="nodeDrainEnd",n.zlibInflateError="zlibInflateError",n.zlibInflateData="zlibInflateData",n.zlibInflateInitialWrite="zlibInflateInitialWrite",n.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",n.zlibInflateWrite="zlibInflateWrite",n.zlibInflateFlushFired="zlibInflateFlushFired",n.zlibDeflateError="zlibDeflateError",n.zlibDeflateData="zlibDeflateData",n.zlibDeflateWrite="zlibDeflateWrite",n.zlibDeflateFlushFired="zlibDeflateFlushFired",n.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",n.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",n.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",n.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",n.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",n.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",n.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",n.ProtocolHeaderRead="protocolHeaderRead",n.ProtocolMessageRead="protocolMessageRead",n.ProtocolHeaderWrite="protocolHeaderWrite",n.ProtocolMessageWrite="protocolMessageWrite",n.ProtocolWrite="protocolWrite"})(kM||(kM={}));var BDe;(function(n){n.enableDiagnostics=!1,n.records=[];const e=new WeakMap;let t=0;function i(o,r){if(!e.has(o)){const a=String(++t);e.set(o,a)}return e.get(o)}function s(o,r,a,c){if(!n.enableDiagnostics)return;const l=i(o);if(c instanceof ze||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=ze.alloc(c.byteLength);d.set(c),n.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else n.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}n.traceSocketEvent=s})(BDe||(BDe={}));var qne;(function(n){n[n.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",n[n.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(qne||(qne={}));let zpe=null;function GD(){return zpe||(zpe=ze.alloc(0)),zpe}class x9t{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(e){this._chunks.push(e),this._totalLength+=e.byteLength}read(e){return this._read(e,!0)}peek(e){return this._read(e,!1)}_read(e,t){if(e===0)return GD();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),r}if(this._chunks[0].byteLength>e){const r=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),r}const i=ze.alloc(e);let s=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,s),s+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,s),s+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var la;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Control=2]="Control",n[n.Ack=3]="Ack",n[n.Disconnect=5]="Disconnect",n[n.ReplayRequest=6]="ReplayRequest",n[n.Pause=7]="Pause",n[n.Resume=8]="Resume",n[n.KeepAlive=9]="KeepAlive"})(la||(la={}));function iot(n){switch(n){case la.None:return"None";case la.Regular:return"Regular";case la.Control:return"Control";case la.Ack:return"Ack";case la.Disconnect:return"Disconnect";case la.ReplayRequest:return"ReplayRequest";case la.Pause:return"PauseWriting";case la.Resume:return"ResumeWriting";case la.KeepAlive:return"KeepAlive"}}var Wp;(function(n){n[n.HeaderLength=13]="HeaderLength",n[n.AcknowledgeTime=2e3]="AcknowledgeTime",n[n.TimeoutTime=2e4]="TimeoutTime",n[n.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",n[n.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",n[n.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(Wp||(Wp={}));class LC{constructor(e,t,i,s){this.type=e,this.id=t,this.ack=i,this.data=s,this.writtenTime=0}get size(){return this.data.byteLength}}class o$e extends ${constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Wp.HeaderLength,messageType:la.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new x9t,this._register(this._socket.onData(t=>this.acceptChunk(t))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){const t=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=t.readUInt32BE(9),this._state.messageType=t.readUInt8(0),this._state.id=t.readUInt32BE(1),this._state.ack=t.readUInt32BE(5),this._socket.traceSocketEvent(kM.ProtocolHeaderRead,{messageType:iot(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,s=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Wp.HeaderLength,this._state.messageType=la.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(kM.ProtocolMessageRead,t),this._onMessage.fire(new LC(i,s,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class r$e{constructor(e){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=e,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(e){if(this._isDisposed)return;e.writtenTime=Date.now(),this.lastWriteTime=Date.now();const t=ze.alloc(Wp.HeaderLength);t.writeUInt8(e.type,0),t.writeUInt32BE(e.id,1),t.writeUInt32BE(e.ack,5),t.writeUInt32BE(e.data.byteLength,9),this._socket.traceSocketEvent(kM.ProtocolHeaderWrite,{messageType:iot(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(kM.ProtocolMessageWrite,e.data),this._writeSoon(t,e.data)}_bufferAdd(e,t){const i=this._totalLength===0;return this._data.push(e,t),this._totalLength+=e.byteLength+t.byteLength,i}_bufferTake(){const e=ze.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,e}_writeSoon(e,t){this._bufferAdd(e,t)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const e=this._bufferTake();this._socket.traceSocketEvent(kM.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class FT{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new I({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(e){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(e):this._emitter.fire(e):this._bufferedMessages.push(e)}flushBuffer(){this._bufferedMessages=[]}}class D9t{constructor(e){this.data=e,this.next=null}}class k9t{constructor(){this._first=null,this._last=null}length(){let e=0,t=this._first;for(;t;)t=t.next,e++;return e}peek(){return this._first?this._first.data:null}toArray(){const e=[];let t=0,i=this._first;for(;i;)e[t++]=i.data,i=i.next;return e}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(e){const t=new D9t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const qm=class qm{static getInstance(){return qm._INSTANCE||(qm._INSTANCE=new qm),qm._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=qm._HISTORY_LENGTH;t>=1;t--)this.lastRuns[t]=this.lastRuns[t-1];this.lastRuns[0]=Date.now()},1e3)}load(){const e=Date.now(),t=(1+qm._HISTORY_LENGTH)*1e3;let i=0;for(let s=0;s=.5}};qm._HISTORY_LENGTH=10,qm._INSTANCE=null;let WDe=qm;class I9t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new FT,this.onControlMessage=this._onControlMessage.event,this._onMessage=new FT,this.onMessage=this._onMessage.event,this._onDidDispose=new FT,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new FT,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new FT,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??WDe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new k9t,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 Z,this._socket=e.socket,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(t=>this._receiveMessage(t))),this._socketDisposables.add(this._socket.onClose(t=>this._onSocketClose.fire(t))),e.initialChunk&&this._socketReader.acceptChunk(e.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},Wp.KeepAliveSendTime):this._keepAliveInterval=null}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(){const e=new LC(la.Disconnect,0,0,GD());this._socketWriter.write(e),this._socketWriter.flush()}sendPause(){const e=new LC(la.Pause,0,0,GD());this._socketWriter.write(e)}sendResume(){const e=new LC(la.Resume,0,0,GD());this._socketWriter.write(e)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(e,t){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new Z,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=e,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(i=>this._receiveMessage(i))),this._socketDisposables.add(this._socket.onClose(i=>this._onSocketClose.fire(i))),this._socketReader.acceptChunk(t)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;ithis._outgoingAckId){this._outgoingAckId=e.ack;do{const t=this._outgoingUnackMsg.peek();if(t&&t.id<=e.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(e.type){case la.None:break;case la.Regular:{if(e.id>this._incomingMsgId)if(e.id!==this._incomingMsgId+1){const t=Date.now();t-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=t,this._socketWriter.write(new LC(la.ReplayRequest,0,0,GD())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case la.Control:{this._onControlMessage.fire(e.data);break}case la.Ack:break;case la.Disconnect:{this._onDidDispose.fire();break}case la.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;i=Wp.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Wp.AcknowledgeTime-e+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const e=this._outgoingUnackMsg.peek(),t=Date.now()-e.writtenTime,i=Date.now()-this._socketReader.lastReadTime,s=Date.now()-this._lastSocketTimeoutTime;if(t>=Wp.TimeoutTime&&i>=Wp.TimeoutTime&&s>=Wp.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(Wp.TimeoutTime-t,Wp.TimeoutTime-i,Wp.TimeoutTime-s,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new LC(la.KeepAlive,0,this._incomingAckId,GD());this._socketWriter.write(e)}}const L9t=30*1e3;var IM;(function(n){n[n.Management=1]="Management",n[n.ExtensionHost=2]="ExtensionHost",n[n.Tunnel=3]="Tunnel"})(IM||(IM={}));function HDe(n){switch(n){case IM.Management:return"Management";case IM.ExtensionHost:return"ExtensionHost";case IM.Tunnel:return"Tunnel"}}function not(n){const e=new ai;return setTimeout(()=>e.cancel(),n),e.token}function T9t(n,e){if(n.isCancellationRequested||e.isCancellationRequested)return qe.Cancelled;const t=new ai;return n.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Vhe{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=NU(),e.isCancellationRequested?this._timeout():this._disposables.add(e.onCancellationRequested(()=>this._timeout()))}registerDisposable(e){this._state==="pending"?this._disposables.add(e):e.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const e=new Error("Time limit reached");return e.code="ETIMEDOUT",e.syscall="connect",e}resolve(e){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(e))}reject(e){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(e))}}function R9t(n,e){const t=new Vhe(e);return t.registerDisposable(n.onControlMessage(i=>{const s=JSON.parse(i.toString()),o=rot(s);o?t.reject(o):t.resolve(s)})),t.promise}function M9t(n,e,t,i,s,o,r,a){const c=new Vhe(a),l=ao.create(!1);return n.info(`Creating a socket (${r})...`),vs(`code/willCreateSocket/${o}`),e.connect(t,i,s,r).then(d=>{c.didTimeout?(vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(vs(`code/didCreateSocketOK/${o}`),n.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),n.error(d),c.reject(d)}),c.promise}function $pe(n,e){const t=new Vhe(e);return n.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function N9t(n,e,t,i){const s=aot(n,e);n.logService.trace(`${s} 1/6. invoking socketFactory.connect().`);let o;try{o=await M9t(n.logService,n.remoteSocketFactoryService,n.connectTo,T9.getServerRootPath(),`reconnectionToken=${n.reconnectionToken}&reconnection=${n.reconnectionProtocol?"true":"false"}`,HDe(e),`renderer-${HDe(e)}-${n.reconnectionToken}`,i)}catch(d){throw n.logService.error(`${s} socketFactory.connect() failed or timed out. Error:`),n.logService.error(d),d}n.logService.trace(`${s} 2/6. socketFactory.connect() was successful.`);let r,a;n.reconnectionProtocol?(n.reconnectionProtocol.beginAcceptReconnection(o,null),r=n.reconnectionProtocol,a=!1):(r=new I9t({socket:o}),a=!0),n.logService.trace(`${s} 3/6. sending AuthRequest control message.`);const c=await $pe(n.signService.createNewMessage(Dr()),i),l={type:"auth",auth:n.connectionToken||"00000000000000000000",data:c.data};r.sendControl(ze.fromString(JSON.stringify(l)));try{const d=await R9t(r,T9t(i,not(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(n.logService.trace(`${s} 4/6. received SignRequest control message.`),!await $pe(n.signService.validate(c,d.signedData),i)){const p=new Error("Refused to connect to unsupported server");throw p.code="VSCODE_CONNECTION_ERROR",p}const u=await $pe(n.signService.sign(d.data),i),f={type:"connectionType",commit:n.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),n.logService.trace(`${s} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl(ze.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(n.logService.error(`${s} the handshake timed out. Error:`),n.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(n.logService.error(`${s} received error control message when negotiating connection. Error:`),n.logService.error(d)),a&&uOe(r),d}}async function P9t(n,e,t,i){const s=Date.now(),o=aot(n,e),{protocol:r,ownsProtocol:a}=await N9t(n,e,t,i),c=new Vhe(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=rot(d);h?(n.logService.error(`${o} received error control message when negotiating connection. Error:`),n.logService.error(h),a&&uOe(r),c.reject(h)):(n.reconnectionProtocol?.endAcceptReconnection(),n.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${q9t(s)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function sot(n,e,t){const{protocol:i,firstMessage:s}=await P9t(n,IM.ExtensionHost,e,t),o=s&&s.debugPort;return{protocol:i,debugPort:o}}async function oot(n,e,t){const{connectTo:i,connectionToken:s}=await n.addressProvider.getAddress();return{commit:n.commit,quality:n.quality,connectTo:i,connectionToken:s,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:n.remoteSocketFactoryService,signService:n.signService,logService:n.logService}}async function F9t(n,e){return O9t(n,async t=>{const{protocol:i,debugPort:s}=await sot(t,e,qe.None);return new z9t(n,e,t.reconnectionToken,i,s)})}async function O9t(n,e){for(let i=1;;i++)try{const s=Dr(),o=await oot(n,s,null);return await e(o)}catch(s){if(i<5)n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),n.logService.error(s);else throw n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),n.logService.error(s),Qne.triggerPermanentFailure(0,0,HI.isHandled(s)),s}}function B9t(n){return na(e=>new Promise((t,i)=>{const s=setTimeout(t,n*1e3);e.onCancellationRequested(()=>{clearTimeout(s),t()})}))}var $1;(function(n){n[n.ConnectionLost=0]="ConnectionLost",n[n.ReconnectionWait=1]="ReconnectionWait",n[n.ReconnectionRunning=2]="ReconnectionRunning",n[n.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",n[n.ConnectionGain=4]="ConnectionGain"})($1||($1={}));class W9t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=$1.ConnectionLost}}class H9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=s,this.type=$1.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class U9t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ReconnectionRunning}}class a$e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ConnectionGain}}class V9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=s,this.type=$1.ReconnectionPermanentFailure}}const Ff=class Ff extends ${static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(s=>s._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}get _isPermanentFailure(){return this._permanentFailure||Ff._permanentFailure}constructor(e,t,i,s,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=s,this._reconnectionFailureIsFatal=o,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new a$e(this.reconnectionToken,0,0)),this._register(s.onSocketClose(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);r?r.type===qne.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${r.hadError}).`),r.error&&this._options.logService.error(r.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${r.wasClean}, code: ${r.code}, reason: ${r.reason}).`),r.event&&this._options.logService.error(r.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(s.onSocketTimeout(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${r.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${r.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${r.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Ff._instances.push(this),this._register(Ee(()=>{const r=Ff._instances.indexOf(this);r>=0&&Ff._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Ff._permanentFailureMillisSinceLastIncomingData,Ff._permanentFailureAttempt,Ff._permanentFailureHandled)}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;const e=SX(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 W9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const s=i0){const r=B9t(s);this._onDidStateChange.fire(new H9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s,r)),this._options.logService.info(`${e} waiting for ${s} seconds before reconnecting...`);try{await r}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new U9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await oot(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,not(L9t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new a$e(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(o){if(o.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(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(i>360){this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(HI.isTemporarilyNotAvailable(o)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if((o.code==="ETIMEDOUT"||o.code==="ENETUNREACH"||o.code==="ECONNREFUSED"||o.code==="ECONNRESET")&&o.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(Na(o)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(o instanceof HI){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,HI.isHandled(o));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(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?Ff.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new V9t(this.reconnectionToken,e,t,i)),uOe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Ff._permanentFailure=!1,Ff._permanentFailureMillisSinceLastIncomingData=0,Ff._permanentFailureAttempt=0,Ff._permanentFailureHandled=!1,Ff._instances=[];let Qne=Ff;class z9t extends Qne{constructor(e,t,i,s,o){super(IM.ExtensionHost,e,i,s,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await sot(e,this._startArguments,t)}}function uOe(n){try{n.acceptDisconnect();const e=n.getSocket();n.dispose(),e.dispose()}catch(e){bt(e)}}function rot(n){if(n&&n.type==="error"){const e=new Error(`Connection error: ${n.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function $9t(n,e){for(;n.length"u"&&(l=Dr(),this._storageService.store(c,l,ke.WORKSPACE,ln.MACHINE));const d=await Fht(yi.origin,l),h=o.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",r).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",yi.origin),u.searchParams.set("salt",l),u.toString()}}return`${lp.asBrowserUri(i).toString(!0)}${t}`}async start(){return this._protocolPromise||(this._protocolPromise=this._startInsideIframe(),this._protocolPromise.then(e=>this._protocol=e)),this._protocolPromise}async _startInsideIframe(){const e=await this._getWebWorkerExtensionHostIframeSrc(),t=this._register(new I),i=document.createElement("iframe");i.setAttribute("class","web-worker-ext-host-iframe"),i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("allow","usb; serial; hid; cross-origin-isolated;"),i.setAttribute("aria-hidden","true"),i.style.display="none";const s=Dr();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${s}`);const o=new Uh;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,bt(a),clearTimeout(l),this._onDidExit.fire([u8.UnexpectedError,a.message]),o.open()},h=p=>{r=p,clearTimeout(l),o.open()};if(l=setTimeout(()=>{console.warn("The Web Worker Extension Host did not start in 60s, that might be a problem.")},6e4),this._register(pe(yi,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==s)return;if(p.data.error){const{name:v,message:w,stack:b}=p.data.error,C=new Error;return C.message=w,C.name=v,C.stack=b,d(u8.UnexpectedError,C)}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(u8.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await o.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),r.onmessage=p=>{const{data:m}=p;if(!(m instanceof ArrayBuffer)){console.warn("UNKNOWN data received",m),this._onDidExit.fire([77,"UNKNOWN data received"]);return}t.fire(ze.wrap(new Uint8Array(m,0,m.byteLength)))};const f={onMessage:t.event,send:p=>{const m=p.buffer.buffer.slice(p.buffer.byteOffset,p.buffer.byteOffset+p.buffer.byteLength);r.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await T.toPromise(T.filter(e.onMessage,t=>jne(t,Cm.Ready))),this._isTerminating||(e.send(ze.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await T.toPromise(T.filter(e.onMessage,t=>jne(t,Cm.Initialized))),this._isTerminating))throw rx();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(cot(Cm.Terminate)),super.dispose())}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i&&this._productService.commit&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?void 0:{configuration:t.configuration||void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:this.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===Wx.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}};Kne=D([_(3,on),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,V_),_(10,Ja),_(11,bg),_(12,sn)],Kne);class Q9t{constructor(){this.capabilities=es.Readonly+es.FileReadWrite+es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw xs(t.statusText,rt.Unknown)}catch(t){throw xs(t,rt.Unknown)}}async stat(e){return{type:an.File,size:0,mtime:0,ctime:0}}watch(){return $.None}writeFile(e,t,i){throw new tE}readdir(e){throw new tE}mkdir(e){throw new tE}delete(e,t){throw new tE}rename(e,t,i){throw new tE}}var UDe={exports:{}},Gpe={};(function(n,e){e=n.exports=Qn;var t;typeof process=="object"&&Gpe&&Gpe.NODE_DEBUG&&/\bsemver\b/i.test(Gpe.NODE_DEBUG)?t=function(){var G=Array.prototype.slice.call(arguments,0);G.unshift("SEMVER"),console.log.apply(console,G)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,r=e.re=[],a=e.src=[],c=0,l=c++;a[l]="0|[1-9]\\d*";var d=c++;a[d]="[0-9]+";var h=c++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=c++;a[u]="("+a[l]+")\\.("+a[l]+")\\.("+a[l]+")";var f=c++;a[f]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var p=c++;a[p]="(?:"+a[l]+"|"+a[h]+")";var m=c++;a[m]="(?:"+a[d]+"|"+a[h]+")";var v=c++;a[v]="(?:-("+a[p]+"(?:\\."+a[p]+")*))";var w=c++;a[w]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var b=c++;a[b]="[0-9A-Za-z-]+";var C=c++;a[C]="(?:\\+("+a[b]+"(?:\\."+a[b]+")*))";var y=c++,S="v?"+a[u]+a[v]+"?"+a[C]+"?";a[y]="^"+S+"$";var M="[v=\\s]*"+a[f]+a[w]+"?"+a[C]+"?",k=c++;a[k]="^"+M+"$";var F=c++;a[F]="((?:<|>)?=?)";var N=c++;a[N]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var U=c++;a[U]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[C]+"?)?)?";var J=c++;a[J]="[v=\\s]*("+a[N]+")(?:\\.("+a[N]+")(?:\\.("+a[N]+")(?:"+a[w]+")?"+a[C]+"?)?)?";var j=c++;a[j]="^"+a[F]+"\\s*"+a[U]+"$";var re=c++;a[re]="^"+a[F]+"\\s*"+a[J]+"$";var me=c++;a[me]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Qe=c++;a[Qe]="(\\s*)"+a[De]+"\\s+",r[Qe]=new RegExp(a[Qe],"g");var Tt="$1~",Oe=c++;a[Oe]="^"+a[De]+a[U]+"$";var wt=c++;a[wt]="^"+a[De]+a[J]+"$";var Nt=c++;a[Nt]="(?:\\^)";var Yi=c++;a[Yi]="(\\s*)"+a[Nt]+"\\s+",r[Yi]=new RegExp(a[Yi],"g");var Vi="$1^",Gn=c++;a[Gn]="^"+a[Nt]+a[U]+"$";var Ro=c++;a[Ro]="^"+a[Nt]+a[J]+"$";var qn=c++;a[qn]="^"+a[F]+"\\s*("+M+")$|^$";var ec=c++;a[ec]="^"+a[F]+"\\s*("+S+")$|^$";var ys=c++;a[ys]="(\\s*)"+a[F]+"\\s*("+M+"|"+a[U]+")",r[ys]=new RegExp(a[ys],"g");var mr="$1$2$3",ba=c++;a[ba]="^\\s*("+a[U]+")\\s+-\\s+("+a[U]+")\\s*$";var ki=c++;a[ki]="^\\s*("+a[J]+")\\s+-\\s+("+a[J]+")\\s*$";var gs=c++;a[gs]="(<|>)?=?\\s*\\*";for(var ir=0;iri)return null;var L=de?r[k]:r[y];if(!L.test(G))return null;try{return new Qn(G,de)}catch{return null}}e.valid=_c;function _c(G,de){var L=Hn(G,de);return L?L.version:null}e.clean=gh;function gh(G,de){var L=Hn(G.trim().replace(/^[=v]+/,""),de);return L?L.version:null}e.SemVer=Qn;function Qn(G,de){if(G instanceof Qn){if(G.loose===de)return G;G=G.version}else if(typeof G!="string")throw new TypeError("Invalid Version: "+G);if(G.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Qn))return new Qn(G,de);t("SemVer",G,de),this.loose=de;var L=G.trim().match(de?r[k]:r[y]);if(!L)throw new TypeError("Invalid Version: "+G);if(this.raw=G,this.major=+L[1],this.minor=+L[2],this.patch=+L[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");L[4]?this.prerelease=L[4].split(".").map(function(ne){if(/^[0-9]+$/.test(ne)){var R=+ne;if(R>=0&&R=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);L===-1&&this.prerelease.push(0)}de&&(this.prerelease[0]===de?isNaN(this.prerelease[1])&&(this.prerelease=[de,0]):this.prerelease=[de,0]);break;default:throw new Error("invalid increment argument: "+G)}return this.format(),this.raw=this.version,this},e.inc=Yh;function Yh(G,de,L,ne){typeof L=="string"&&(ne=L,L=void 0);try{return new Qn(G,L).inc(de,ne).version}catch{return null}}e.diff=el;function el(G,de){if(Ld(G,de))return null;var L=Hn(G),ne=Hn(de);if(L.prerelease.length||ne.prerelease.length){for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return"pre"+R;return"prerelease"}for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return R}e.compareIdentifiers=to;var Tl=/^[0-9]+$/;function to(G,de){var L=Tl.test(G),ne=Tl.test(de);return L&&ne&&(G=+G,de=+de),L&&!ne?-1:ne&&!L?1:Gde?1:0}e.rcompareIdentifiers=Fc;function Fc(G,de){return to(de,G)}e.major=rd;function rd(G,de){return new Qn(G,de).major}e.minor=Jh;function Jh(G,de){return new Qn(G,de).minor}e.patch=Af;function Af(G,de){return new Qn(G,de).patch}e.compare=tl;function tl(G,de,L){return new Qn(G,L).compare(new Qn(de,L))}e.compareLoose=Rl;function Rl(G,de){return tl(G,de,!0)}e.rcompare=Xh;function Xh(G,de,L){return tl(de,G,L)}e.sort=ul;function ul(G,de){return G.sort(function(L,ne){return e.compare(L,ne,de)})}e.rsort=ad;function ad(G,de){return G.sort(function(L,ne){return e.rcompare(L,ne,de)})}e.gt=vc;function vc(G,de,L){return tl(G,de,L)>0}e.lt=Ca;function Ca(G,de,L){return tl(G,de,L)<0}e.eq=Ld;function Ld(G,de,L){return tl(G,de,L)===0}e.neq=fh;function fh(G,de,L){return tl(G,de,L)!==0}e.gte=Fu;function Fu(G,de,L){return tl(G,de,L)>=0}e.lte=wc;function wc(G,de,L){return tl(G,de,L)<=0}e.cmp=Zh;function Zh(G,de,L,ne){var R;switch(de){case"===":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G===L;break;case"!==":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G!==L;break;case"":case"=":case"==":R=Ld(G,L,ne);break;case"!=":R=fh(G,L,ne);break;case">":R=vc(G,L,ne);break;case">=":R=Fu(G,L,ne);break;case"<":R=Ca(G,L,ne);break;case"<=":R=wc(G,L,ne);break;default:throw new TypeError("Invalid operator: "+de)}return R}e.Comparator=bc;function bc(G,de){if(G instanceof bc){if(G.loose===de)return G;G=G.value}if(!(this instanceof bc))return new bc(G,de);t("comparator",G,de),this.loose=de,this.parse(G),this.semver===nr?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var nr={};bc.prototype.parse=function(G){var de=this.loose?r[qn]:r[ec],L=G.match(de);if(!L)throw new TypeError("Invalid comparator: "+G);this.operator=L[1],this.operator==="="&&(this.operator=""),L[2]?this.semver=new Qn(L[2],this.loose):this.semver=nr},bc.prototype.toString=function(){return this.value},bc.prototype.test=function(G){return t("Comparator.test",G,this.loose),this.semver===nr?!0:(typeof G=="string"&&(G=new Qn(G,this.loose)),Zh(G,this.operator,this.semver,this.loose))},bc.prototype.intersects=function(G,de){if(!(G instanceof bc))throw new TypeError("a Comparator is required");var L;if(this.operator==="")return L=new Rs(G.value,de),Ou(this.value,L,de);if(G.operator==="")return L=new Rs(this.value,de),Ou(G.semver,L,de);var ne=(this.operator===">="||this.operator===">")&&(G.operator===">="||G.operator===">"),R=(this.operator==="<="||this.operator==="<")&&(G.operator==="<="||G.operator==="<"),H=this.semver.version===G.semver.version,ie=(this.operator===">="||this.operator==="<=")&&(G.operator===">="||G.operator==="<="),je=Zh(this.semver,"<",G.semver,de)&&(this.operator===">="||this.operator===">")&&(G.operator==="<="||G.operator==="<"),pt=Zh(this.semver,">",G.semver,de)&&(this.operator==="<="||this.operator==="<")&&(G.operator===">="||G.operator===">");return ne||R||H&&ie||je||pt},e.Range=Rs;function Rs(G,de){if(G instanceof Rs)return G.loose===de?G:new Rs(G.raw,de);if(G instanceof bc)return new Rs(G.value,de);if(!(this instanceof Rs))return new Rs(G,de);if(this.loose=de,this.raw=G,this.set=G.split(/\s*\|\|\s*/).map(function(L){return this.parseRange(L.trim())},this).filter(function(L){return L.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+G);this.format()}Rs.prototype.format=function(){return this.range=this.set.map(function(G){return G.join(" ").trim()}).join("||").trim(),this.range},Rs.prototype.toString=function(){return this.range},Rs.prototype.parseRange=function(G){var de=this.loose;G=G.trim(),t("range",G,de);var L=de?r[ki]:r[ba];G=G.replace(L,ya),t("hyphen replace",G),G=G.replace(r[ys],mr),t("comparator trim",G,r[ys]),G=G.replace(r[Qe],Tt),G=G.replace(r[Yi],Vi),G=G.split(/\s+/).join(" ");var ne=de?r[qn]:r[ec],R=G.split(" ").map(function(H){return Se(H,de)}).join(" ").split(/\s+/);return this.loose&&(R=R.filter(function(H){return!!H.match(ne)})),R=R.map(function(H){return new bc(H,de)}),R},Rs.prototype.intersects=function(G,de){if(!(G instanceof Rs))throw new TypeError("a Range is required");return this.set.some(function(L){return L.every(function(ne){return G.set.some(function(R){return R.every(function(H){return ne.intersects(H,de)})})})})},e.toComparators=Ml;function Ml(G,de){return new Rs(G,de).set.map(function(L){return L.map(function(ne){return ne.value}).join(" ").trim().split(" ")})}function Se(G,de){return t("comp",G),G=Le(G,de),t("caret",G),G=cd(G,de),t("tildes",G),G=ts(G,de),t("xrange",G),G=sr(G,de),t("stars",G),G}function Mo(G){return!G||G.toLowerCase()==="x"||G==="*"}function cd(G,de){return G.trim().split(/\s+/).map(function(L){return K(L,de)}).join(" ")}function K(G,de){var L=de?r[wt]:r[Oe];return G.replace(L,function(ne,R,H,ie,je){t("tilde",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":je?(t("replaceTilde pr",je),je.charAt(0)!=="-"&&(je="-"+je),pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0"):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0",t("tilde return",pt),pt})}function Le(G,de){return G.trim().split(/\s+/).map(function(L){return ri(L,de)}).join(" ")}function ri(G,de){t("caret",G,de);var L=de?r[Ro]:r[Gn];return G.replace(L,function(ne,R,H,ie,je){t("caret",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?R==="0"?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+".0 <"+(+R+1)+".0.0":je?(t("replaceCaret pr",je),je.charAt(0)!=="-"&&(je="-"+je),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+je+" <"+(+R+1)+".0.0"):(t("no pr"),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+" <"+(+R+1)+".0.0"),t("caret return",pt),pt})}function ts(G,de){return t("replaceXRanges",G,de),G.split(/\s+/).map(function(L){return Os(L,de)}).join(" ")}function Os(G,de){G=G.trim();var L=de?r[re]:r[j];return G.replace(L,function(ne,R,H,ie,je,pt){t("xRange",G,ne,R,H,ie,je,pt);var is=Mo(H),Ss=is||Mo(ie),ld=Ss||Mo(je),Eg=ld;return R==="="&&Eg&&(R=""),is?R===">"||R==="<"?ne="<0.0.0":ne="*":R&&Eg?(Ss&&(ie=0),ld&&(je=0),R===">"?(R=">=",Ss?(H=+H+1,ie=0,je=0):ld&&(ie=+ie+1,je=0)):R==="<="&&(R="<",Ss?H=+H+1:ie=+ie+1),ne=R+H+"."+ie+"."+je):Ss?ne=">="+H+".0.0 <"+(+H+1)+".0.0":ld&&(ne=">="+H+"."+ie+".0 <"+H+"."+(+ie+1)+".0"),t("xRange return",ne),ne})}function sr(G,de){return t("replaceStars",G,de),G.trim().replace(r[gs],"")}function ya(G,de,L,ne,R,H,ie,je,pt,is,Ss,ld,Eg){return Mo(L)?de="":Mo(ne)?de=">="+L+".0.0":Mo(R)?de=">="+L+"."+ne+".0":de=">="+de,Mo(pt)?je="":Mo(is)?je="<"+(+pt+1)+".0.0":Mo(Ss)?je="<"+pt+"."+(+is+1)+".0":ld?je="<="+pt+"."+is+"."+Ss+"-"+ld:je="<="+je,(de+" "+je).trim()}Rs.prototype.test=function(G){if(!G)return!1;typeof G=="string"&&(G=new Qn(G,this.loose));for(var de=0;de0){var ne=G[L].semver;if(ne.major===de.major&&ne.minor===de.minor&&ne.patch===de.patch)return!0}return!1}return!0}e.satisfies=Ou;function Ou(G,de,L){try{de=new Rs(de,L)}catch{return!1}return de.test(G)}e.maxSatisfying=le;function le(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===-1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.minSatisfying=_r;function _r(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.validRange=No;function No(G,de){try{return new Rs(G,de).range||"*"}catch{return null}}e.ltr=mn;function mn(G,de,L){return ct(G,de,"<",L)}e.gtr=ve;function ve(G,de,L){return ct(G,de,">",L)}e.outside=ct;function ct(G,de,L,ne){G=new Qn(G,ne),de=new Rs(de,ne);var R,H,ie,je,pt;switch(L){case">":R=vc,H=wc,ie=Ca,je=">",pt=">=";break;case"<":R=Ca,H=Fu,ie=vc,je="<",pt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ou(G,de,ne))return!1;for(var is=0;is=0.0.0")),ld=ld||Bw,Eg=Eg||Bw,R(Bw.semver,ld.semver,ne)?ld=Bw:ie(Bw.semver,Eg.semver,ne)&&(Eg=Bw)}),ld.operator===je||ld.operator===pt||(!Eg.operator||Eg.operator===je)&&H(G,Eg.semver))return!1;if(Eg.operator===pt&&ie(G,Eg.semver))return!1}return!0}e.prerelease=Ht;function Ht(G,de){var L=Hn(G,de);return L&&L.prerelease.length?L.prerelease:null}e.intersects=Ei;function Ei(G,de,L){return G=new Rs(G,L),de=new Rs(de,L),G.intersects(de)}e.coerce=Ut;function Ut(G){if(G instanceof Qn)return G;if(typeof G!="string")return null;var de=G.match(r[me]);return de==null?null:Hn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(UDe,UDe.exports);var JV=UDe.exports;const iY="vs/workbench/services/extensions/common/extensionsUtil";function j9t(n,e,t,i,s){const o=new $a;return n.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),e.forEach(r=>{const a=o.get(r.identifier);if(a)if(a.isBuiltin){if(JV.gte(a.version,r.version)){s.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){s.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,1,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{s.info(g(iY,2,"Loading development extension at {0}",r.extensionLocation.fsPath));const a=o.get(r.identifier);a&&a.isBuiltin&&(r.isBuiltin=!0),o.set(r.identifier,r)}),Array.from(o.values())}let VDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=s,this._environmentService=o,this._telemetryService=r,this._logService=a,this._loggerService=c,this._labelService=l,this.remoteAuthorityResolverService=d,this._extensionHostDebugService=h,this._productService=u,this._signService=f,this.pid=null,this.startup=Wx.EagerAutoStart,this.extensions=null,this._onExit=this._register(new I),this.onExit=this._onExit.event,this.remoteAuthority=this._initDataProvider.remoteAuthority,this._protocol=null,this._hasLostConnection=!1,this._terminating=!1;const p=dOe(this._environmentService);this._isExtensionDevHost=p.isExtensionDevHost}start(){const e={commit:this._productService.commit,quality:this._productService.quality,addressProvider:{getAddress:async()=>{const{authority:t}=await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);return{connectTo:t.connectTo,connectionToken:t.connectionToken}}},remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this._signService,logService:this._logService,ipcLogger:null};return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then(t=>{const i={language:Gd,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},s=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return s&&s.length>0&&s[0].scheme===_e.file&&(o=!1),o||(i.break=!1),F9t(e,i).then(r=>{this._register(r);const{protocol:a,debugPort:c,reconnectionToken:l}=r,d=typeof c=="number";return o&&this._environmentService.isExtensionDevelopment&&this._environmentService.debugExtensionHost.debugId&&c&&this._extensionHostDebugService.attachSession(this._environmentService.debugExtensionHost.debugId,c,this._initDataProvider.remoteAuthority),a.onDidDispose(()=>{this._onExtHostConnectionLost(l)}),a.onSocketClose(()=>{this._isExtensionDevHost&&this._onExtHostConnectionLost(l)}),new Promise((h,u)=>{const f=setTimeout(()=>{u("The remote extension host took longer than 60s to send its ready message.")},6e4),p=a.onMessage(m=>{if(jne(m,Cm.Ready)){this._createExtHostInitData(d).then(v=>{a.send(ze.fromString(JSON.stringify(v)))});return}if(jne(m,Cm.Initialized)){clearTimeout(f),p.dispose(),this._protocol=a,h(a);return}console.error("received unexpected message during handshake phase from the extension host: ",m)})})})})}_onExtHostConnectionLost(e){this._hasLostConnection||(this._hasLostConnection=!0,this._isExtensionDevHost&&this._environmentService.debugExtensionHost.debugId&&this._extensionHostDebugService.close(this._environmentService.debugExtensionHost.debugId),!this._terminating&&this._onExit.fire([0,e]))}async _createExtHostInitData(e){const t=await this._initDataProvider.getInitData();this.extensions=t.extensions;const i=this._contextService.getWorkspace();return{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:t.pid,environment:{isExtensionDevelopmentDebug:e,appRoot:t.appRoot,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier||"desktop",appUriScheme:this._productService.urlProtocol,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),appLanguage:Gd,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:i.configuration,id:i.id,name:this._labelService.getWorkspaceLabel(i),transient:i.transient},remote:{isRemote:!0,authority:this._initDataProvider.remoteAuthority,connectionData:t.connectionData},consoleForward:{includeStack:!1,logNative:!!this._environmentService.debugExtensionHost.debugId},extensions:this.extensions.toSnapshot(),telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:t.extensionHostLogsPath,autoStart:this.startup===Wx.EagerAutoStart,uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(cot(Cm.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};VDe=D([_(2,CPe),_(3,Ti),_(4,Za),_(5,on),_(6,Ze),_(7,wp),_(8,eo),_(9,rA),_(10,kZe),_(11,Ja),_(12,MZe)],VDe);var zDe;let $De=class extends TDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F,N){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,v,w,b,C,y,N),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=S,this._userDataProfileService=M,this._workspaceTrustManagementService=k,this._remoteExplorerService=F,C.when(Us.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}async _scanSingleExtension(e){if(e.location.scheme===_e.vscodeRemote)return this._remoteExtensionsScannerService.scanSingleExtension(e.location,e.type===qr.System);const t=await this._webExtensionsScannerService.scanExistingExtension(e.location,e.type,this._userDataProfileService.currentProfile.extensionsResource);return t?ME(t):null}_initFetchFileSystem(){const e=new Q9t;this._register(this._fileService.registerProvider(_e.http,e)),this._register(this._fileService.registerProvider(_e.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(s=>e.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(s=>t.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(s=>i.push(...s.map(o=>ME(o,!0))))])}catch(s){this._logService.error(s)}return j9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new c9t(e,t,!1,!0)}async _resolveExtensions(){if(!this._browserEnvironmentService.expectsResolverExtension)return this._resolveExtensionsDefault();const e=this._environmentService.remoteAuthority;await this._workspaceTrustManagementService.workspaceResolved;let t;try{t=await this._resolveAuthorityInitial(e)}catch(s){return HI.isHandled(s)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,s),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async s=>{s.type===$1.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=yi;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await C9t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(Ao.LocalWebWorker,e)}};$De=D([_(3,be),_(4,Pi),_(5,Ow),_(6,on),_(7,Kh),_(8,ci),_(9,Ja),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,FPe),_(15,Ze),_(16,Sf),_(17,Gde),_(18,mg),_(19,rA),_(20,ahe),_(21,Tm),_(22,oA),_(23,she),_(24,To)],$De);let GDe=class{constructor(e,t,i,s,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=s,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case Ao.LocalProcess:return null;case Ao.LocalWebWorker:{const s=i?Wx.EagerManualStart:Wx.EagerAutoStart;return this._instantiationService.createInstance(Kne,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case Ao.Remote:{const s=this._remoteAgentService.getConnection();return s?this._instantiationService.createInstance(VDe,t,this._createRemoteExtensionHostDataProvider(e,s.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const s=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(s,[],!1),r=CX(s,o,c=>t.equals(c));return{extensions:new xJ(0,s,r.map(c=>c.identifier))}}else{const s=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(s.extensions,t);return{extensions:new xJ(s.versionId,s.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),s=await this._remoteAgentService.getEnvironment();if(!s)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,Ao.Remote),r=new xJ(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:s.pid,appRoot:s.appRoot,extensionHostLogsPath:s.extensionHostLogsPath,globalStorageHome:s.globalStorageHome,workspaceStorageHome:s.workspaceStorageHome,extensions:r}}}}};GDe=D([_(3,be),_(4,Sf),_(5,rA),_(6,Kh),_(7,Ze)],GDe);let qDe=zDe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,s,o){const r=zDe.pickRunningLocation(t,i,s,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${s}, preference: ${D8t(o)} => ${hE(r)}`),r}static pickRunningLocation(e,t,i,s){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(s===rp.Remote)return Ao.Remote;r=!0}if(a==="workspace"&&i){if(s===rp.None||s===rp.Remote)return Ao.Remote;o.push(Ao.Remote)}if(a==="web"&&(t||i)){if(s===rp.None||s===rp.Local)return Ao.LocalWebWorker;o.push(Ao.LocalWebWorker)}}return r&&o.push(Ao.Remote),o.length>0?o[0]:null}};qDe=zDe=D([_(0,Ze)],qDe);async function K9t(n,e,t){let i=t&&t.get("storage.serviceMachineId",ke.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(n.serviceMachineIdResource)).value.toString();i=xDt(o)?o:null}catch{i=null}if(!i){i=Dr();try{await e.writeFile(n.serviceMachineIdResource,ze.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,ke.APPLICATION,ln.MACHINE),i}const Y9t="/web-extension-resource/";class J9t{constructor(e,t,i,s,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=s,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(P.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:s},o){if(this._extensionGalleryResourceUrlTemplate){const r=P.parse(w_e(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:s!==void 0&&s!==Hs.UNDEFINED&&s!==Hs.UNKNOWN&&s!==Hs.UNIVERSAL?`${i}+${s}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:T9.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Jn?"-web":""}`,"X-Client-Version":this._productService.version};return EJ(this._productService,this._environmentService)&&vTt(this._configurationService)===sp.USAGE&&(e["X-Machine-Id"]=await this._getServiceMachineId()),this._productService.commit&&(e["X-Client-Commit"]=this._productService.commit),e}_getServiceMachineId(){return this._serviceMachineIdPromise||(this._serviceMachineIdPromise=K9t(this._environmentService,this._fileService,this._storageService)),this._serviceMachineIdPromise}_getExtensionGalleryAuthority(e){if(this._isWebExtensionResourceEndPoint(e))return e.authority;const t=e.authority.indexOf(".");return t!==-1?e.authority.substring(t+1):void 0}_isWebExtensionResourceEndPoint(e){const t=e.path,i=T9.getServerRootPath();return t.startsWith(i)&&t.startsWith(Y9t,i.length)}}let QDe=class extends J9t{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._logService=r}async readExtensionResource(e){if(e=lp.uriToBrowserUri(e),e.scheme!==_e.http&&e.scheme!==_e.https&&e.scheme!==_e.data)return(await this._fileService.readFile(e)).value.toString();const t={};this.isExtensionGalleryResource(e)&&(t.headers=await this.getExtensionGalleryRequestHeaders(),t.mode="cors");const i=await fetch(e.toString(!0),t);if(i.status!==200)throw this._logService.info(`Request to '${e.toString(!0)}' failed with status code ${i.status}`),new Error(i.statusText);return i.text()}};QDe=D([_(0,ci),_(1,sn),_(2,Ja),_(3,Il),_(4,Re),_(5,Ze)],QDe);var RB,jDe;const pl="vs/workbench/services/extensionManagement/browser/extensionBisect";class g8{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new g8(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,s=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=s}}var kP;let KDe=(kP=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const s=t.get(RB._storageKey,ke.APPLICATION);if(this._state=g8.fromJSON(s),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&auc({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(s=>s.identifier.id),i=new g8(t,0,t.length,0);this._storageService.store(RB._storageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async next(e){if(!this._state)throw new Error("invalid state");if(e&&this._state.mid===0&&this._state.high===this._state.extensions.length)return{bad:!0,id:""};if(this._state.low===this._state.high-1)return await this.reset(),{id:this._state.extensions[this._state.low],bad:e};const t=new g8(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(RB._storageKey,JSON.stringify(t),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(RB._storageKey,ke.APPLICATION),await this._storageService.flush()}},RB=kP,kP._storageKey="extensionBisectState",kP);KDe=RB=D([_(0,Ze),_(1,sn),_(2,Za)],KDe);var IP;let XV=(IP=class{constructor(e,t,i,s){this._extensionBisectService=t,this._notificationService=i,this._commandService=s,t.isActive&&(jDe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(pl,0,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(pl,1,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},s=this._extensionBisectService.disabledCount===1?g(pl,2,"Extension Bisect is active and has disabled 1 extension. Check if you can still reproduce the problem and proceed by selecting from these options."):g(pl,3,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",this._extensionBisectService.disabledCount);this._notificationService.prompt(nt.Info,s,[e,t,i],{sticky:!0,priority:jU.URGENT})}},jDe=IP,IP.ctxIsBisectActive=new Y("isExtensionBisectActive",!1),IP);XV=jDe=D([_(0,Pe),_(1,Fz),_(2,Pi),_(3,Qi)],XV);it.as(pf.Workbench).registerWorkbenchContribution(XV,Us.Restored);At(class extends pi{constructor(){super({id:"extension.bisect.start",title:Be(pl,4,"Start Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive.negate(),menu:{id:Te.ViewContainerTitle,when:ge.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(n){const e=n.get(To),t=n.get(Id),i=n.get(Rz),s=n.get(Kh),o=n.get(Fz),r=(await i.getInstalled(qr.User)).filter(c=>s.isEnabled(c));(await e.confirm({message:g(pl,5,"Extension Bisect"),detail:g(pl,6,"Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~{0} times). Each time you must confirm if you are still seeing problems.",2+Math.log2(r.length)|0),primaryButton:g(pl,7,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends pi{constructor(){super({id:"extension.bisect.next",title:Be(pl,8,"Continue Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n,e){const t=n.get(To),i=n.get(Id),s=n.get(Fz),o=n.get(Ja),r=n.get(IZe),a=n.get(Qi);if(!s.isActive)return;if(e===void 0){const l=await this._checkForBad(t,s);if(l===null)return;e=l}if(e===void 0){await s.reset(),i.reload();return}const c=await s.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(pl,9,"Extension Bisect"),g(pl,10,"Extension Bisect is done but no extension has been identified. This might be a problem with {0}.",o.nameShort));else{const l=await t.confirm({type:nt.Info,message:g(pl,9,"Extension Bisect"),primaryButton:g(pl,11,"&&Report Issue & Continue"),cancelButton:g(pl,12,"Continue"),detail:g(pl,13,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(pl,14,"Keep this extension disabled"),checked:!0}});l.checkboxChecked&&await r.disableExtension({id:c.id},void 0),l.confirmed&&await a.executeCommand("workbench.action.openIssueReporter",c.id)}await s.reset(),i.reload()}async _checkForBad(n,e){const{result:t}=await n.prompt({type:nt.Info,message:g(pl,15,"Extension Bisect"),detail:g(pl,16,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",e.disabledCount),buttons:[{label:g(pl,17,"I ca&&n't reproduce"),run:()=>!1},{label:g(pl,18,"I can &&reproduce"),run:()=>!0},{label:g(pl,19,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(pl,20,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends pi{constructor(){super({id:"extension.bisect.stop",title:Be(pl,21,"Stop Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n){const e=n.get(Fz),t=n.get(Id);await e.reset(),t.reload()}});function X9t(n,e){return n}function Z9t(n){for(const[e,t]of Object.entries(n))lp.registerAppResourcePathUrl(e,t)}const gA="vs/base/common/jsonErrorMessages";function YDe(n){switch(n){case or.InvalidSymbol:return g(gA,0,"Invalid symbol");case or.InvalidNumberFormat:return g(gA,1,"Invalid number format");case or.PropertyNameExpected:return g(gA,2,"Property name expected");case or.ValueExpected:return g(gA,3,"Value expected");case or.ColonExpected:return g(gA,4,"Colon expected");case or.CommaExpected:return g(gA,5,"Comma expected");case or.CloseBraceExpected:return g(gA,6,"Closing brace expected");case or.CloseBracketExpected:return g(gA,7,"Closing bracket expected");case or.EndOfFileExpected:return g(gA,8,"End of file expected");default:return""}}const au="vs/platform/extensions/common/extensionValidator",lot=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,e7t=/^-(\d{4})(\d{2})(\d{2})$/;function t7t(n){return n=n.trim(),n==="*"||lot.test(n)}function I6(n){if(!t7t(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=n.match(lot);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function L6(n){if(!n)return null;const e=n.majorBase,t=n.majorMustEqual,i=n.minorBase;let s=n.minorMustEqual;const o=n.patchBase;let r=n.patchMustEqual;n.hasCaret&&(e===0||(s=!1),r=!1);let a=0;if(n.preRelease){const c=e7t.exec(n.preRelease);if(c){const[,l,d,h]=c;a=Date.UTC(Number(l),Number(d)-1,Number(h))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:s,patchBase:o,patchMustEqual:r,isMinimum:n.hasGreaterEquals,notBefore:a}}function i7t(n,e,t){let i;typeof n=="string"?i=L6(I6(n)):i=n;let s;e instanceof Date?s=e.getTime():typeof e=="string"&&(s=new Date(e).getTime());let o;if(typeof t=="string"?o=L6(I6(t)):o=t,!i||!o)return!1;const r=i.majorBase,a=i.minorBase,c=i.patchBase;let l=o.majorBase,d=o.minorBase,h=o.patchBase;const u=o.notBefore;let f=o.majorMustEqual,p=o.minorMustEqual,m=o.patchMustEqual;return o.isMinimum?r>l?!0:rd?!0:a=h:(r===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),rl?!f:ad?!p:ch?!m:!(s&&s"u"&&typeof i.browser>"u")return o.push([nt.Error,g(au,7,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),o}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&o.push([nt.Warning,g(au,8,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return o.push([nt.Error,g(au,9,"property `{0}` can be omitted or must be of type `string`","main")]),o;{const c=qt(t,i.main);MS(c,t)||o.push([nt.Warning,g(au,10,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return o.push([nt.Error,g(au,11,"property `{0}` can be omitted or must be of type `string`","browser")]),o;{const c=qt(t,i.browser);MS(c,t)||o.push([nt.Warning,g(au,12,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(!JV.valid(i.version))return o.push([nt.Error,g(au,13,"Extension version is not semver compatible.")]),o;const r=[];if(!s7t(n,e,i,s,r))for(const c of r)o.push([nt.Error,c]);return o}function s7t(n,e,t,i,s){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:o7t(n,e,t.engines.vscode,s)}function o7t(n,e,t,i=[]){const s=L6(I6(t));if(!s)return i.push(g(au,14,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(s.majorBase===0){if(!s.majorMustEqual||!s.minorMustEqual)return i.push(g(au,15,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions before 1.0.0, please define at a minimum the major and minor desired version. E.g. ^0.10.0, 0.10.x, 0.11.0, etc.",t)),!1}else if(!s.majorMustEqual)return i.push(g(au,16,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions after 1.0.0, please define at a minimum the major desired version. E.g. ^1.10.0, 1.10.x, 1.x.x, 2.x.x, etc.",t)),!1;return i7t(n,e,s)?!0:(i.push(g(au,17,"Extension is not compatible with Code {0}. Extension requires: {1}.",n,t)),!1)}function c$e(n){if(!Array.isArray(n))return!1;for(let e=0,t=n.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>uc(l.identifier,c.identifier)&&l.manifest.version!==c.version)?s.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>uc(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(o.push(h),a.push(h)):a.splice(d,1,h)}return o.length&&this._onAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onRemoveExtensions.fire({extensions:s,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,s=>{const o=[];for(const r of s){const a=e.find(([c])=>uc(c.identifier,r.identifier)&&c.manifest.version===r.version);a&&(r.metadata={...r.metadata,...a[1]},i.push(r)),o.push(r)}return o}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,s=>{const o=[];for(const r of s)uc(r.identifier,e.identifier)?i.push(r):o.push(r);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),o}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:t})}catch(s){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:s,profileLocation:t}),s}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let s=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if(Cy(r)!==Xi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Yne(lg(r),ZV.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){d$e(a)||this.reportAndThrowInvalidConentError(e);let c;if(zt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(zt(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=P.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}ll(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),s.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,ze.fromString(JSON.stringify(o)))}if(t){s=t(s);const r=s.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.toRelativePath(a.location),metadata:a.metadata}));await this.fileService.writeFile(e,ze.fromString(JSON.stringify(r)))}return s})}reportAndThrowInvalidConentError(e){const t=new Yne(`Invalid extensions content in ${e.toString()}`,ZV.ERROR_INVALID_CONTENT);throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:t.code}),t}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()=>{const e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),t=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let i;try{i=(await this.fileService.readFile(e)).value.toString()}catch(o){if(Cy(o)===Xi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let s;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>d$e(r))?s=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(s)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify(s)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(o){if(Cy(o)===Xi.FILE_MODIFIED_SINCE)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 o}try{await this.fileService.del(e)}catch(o){Cy(o)!==Xi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){Cy(o)!==Xi.FILE_NOT_FOUND&&this.logService.error(o)}return s})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new dO,this.resourcesAccessQueueMap.set(e,t)),t}};l$e=D([_(1,ci),_(2,V_),_(3,_o),_(4,on),_(5,Ze)],l$e);function d$e(n){return fo(n)&&iMt(n.identifier)&&(r7t(n.location)||zt(n.location)&&n.location)&&(ll(n.relativeLocation)||zt(n.relativeLocation))&&n.version&&zt(n.version)}function r7t(n){return n?zt(n.path)&&zt(n.scheme):!1}const a7t="vs/platform/extensionManagement/common/extensionNls";function c7t(n,e,t,i){try{l7t(n,e,t,i)}catch(s){n.error(s?.message??s)}return e}function l7t(n,e,t,i){const s=(o,r,a)=>{const c=o[r];if(zt(c)){const l=c,d=l.length;if(d>1&&l[0]==="%"&&l[d-1]==="%"){const h=l.substr(1,d-2);let u=t[h];u===void 0&&i&&(u=i[h]);const f=typeof u=="string"?u:u?.message,p=i?.[h],m=typeof p=="string"?p:p?.message;if(!f){m||n.warn(`[${e.name}]: ${g(a7t,0,"Couldn't find message for key {0}.",h)}`);return}if(a&&(r==="title"||r==="category")&&m&&m!==f){const v={value:f,original:m};o[r]=v}else o[r]=f}}else if(fo(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?s(c,l,!0):s(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(qr.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(qr.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=rMt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[s,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...s,...o]):[];return this.dedupExtensions(s,o,r,await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){const t=[];t.push(this.scanDefaultSystemExtensions(!!e.useCache,e.language)),t.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));const[i,s]=await Promise.all(t);return this.applyScanOptions([...i,...s],qr.System,e,!1)}async scanUserExtensions(e){const t=e.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",t);const i=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,s=await this.createExtensionScannerInput(t,!!e.profileLocation,qr.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!s.devMode&&s.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(s)}catch(a){if(a instanceof Yne&&a.code===ZV.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(s);else throw a}return r=await this.applyScanOptions(r,qr.User,e,!0),this.logService.trace("Scanned user extensions:",r.length),r}async scanExtensionsUnderDevelopment(e,t){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const i=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(s=>s.scheme===_e.file).map(async s=>{const o=await this.createExtensionScannerInput(s,!1,qr.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>uc(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,o)))}))).flat();return this.applyScanOptions(i,"development",e,!0)}return[]}async scanExistingExtension(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(s);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(s);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const s=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);s.push(...r)})),this.applyScanOptions(s,t,i,!0)}async scanMetadata(e){const t=qt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=qt(e,"package.json"),s=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(s);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(qt(e,"package.json"),ze.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Yne&&e.code===ZV.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());const e=await this.scanUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(t=>[t,t.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify([])))}catch(t){Cy(t)!==Xi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),lg(t))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,t,i,s){return i.includeAllVersions||(e=this.dedupExtensions(t===qr.System?e:void 0,t===qr.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),s)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=yr(o.location.fsPath),c=yr(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,s,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&JV.gt(c.manifest.version,l.manifest.version))return this.logService.debug(`Skipping extension ${l.location.path} with lower version ${l.manifest.version} in favour of ${c.location.path} with version ${c.manifest.version}`),!1;if(JV.eq(c.manifest.version,l.manifest.version)){if(c.type===qr.System)return this.logService.debug(`Skipping extension ${l.location.path} in favour of system extension ${c.location.path} with same version`),!1;if(c.targetPlatform===s)return this.logService.debug(`Skipping extension ${l.location.path} from different target platform ${l.targetPlatform}`),!1}}return d?this.logService.warn(`Overwriting user extension ${c.location.path} with ${l.location.path}.`):this.logService.debug(`Overwriting user extension ${c.location.path} with ${l.location.path}.`),!0},a=new $a;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===qr.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!0))&&a.set(c.identifier.id,c),a.set(c.identifier.id,c)}),[...a.values()]}async scanDefaultSystemExtensions(e,t){this.logService.trace("Started scanning system extensions");const i=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,qr.System,!0,t,!0,void 0,this.getProductVersion()),o=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",o.length),o}async scanDevSystemExtensions(e,t){const i=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!i?.length)return[];this.logService.trace("Started scanning dev system extensions");const s=t?await this.getBuiltInExtensionControl():{},o=[],r=P.file(d1(D_e(lp.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=s[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(qt(r,c.name));break;default:o.push(P.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,qr.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Ui(a)}async getBuiltInExtensionControl(){try{const e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,t,i,s,o,r,a,c){const l=await this.getTranslations(o??Gd),d=await this.getMtime(e),h=t&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,u=h?await this.getMtime(h):void 0;return new f8(e,d,h,u,t,a,i,s,r,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,o,l)}async getMtime(e){try{const t=await this.fileService.stat(e);if(typeof t.mtime=="number")return t.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};h$e=D([_(4,V_),_(5,$de),_(6,ci),_(7,Ze),_(8,Il),_(9,Ja),_(10,_o),_(11,be)],h$e);class f8{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=s,this.profile=o,this.profileScanOptions=r,this.type=a,this.excludeObsolete=c,this.validate=l,this.productVersion=d,this.productDate=h,this.productCommit=u,this.devMode=f,this.language=p,this.translations=m}static createNlsConfiguration(e){return{language:e.language,pseudo:e.language==="pseudo",devMode:e.devMode,translations:e.translations}}static equals(e,t){return _n(e.location,t.location)&&e.mtime===t.mtime&&_n(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Io(e.profileScanOptions,t.profileScanOptions)&&e.type===t.type&&e.excludeObsolete===t.excludeObsolete&&e.validate===t.validate&&e.productVersion===t.productVersion&&e.productDate===t.productDate&&e.productCommit===t.productCommit&&e.devMode===t.devMode&&e.language===t.language&&JDe.equals(e.translations,t.translations)}}let XDe=class extends ${constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const s=qt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",l?.path,YDe(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=P.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=ow(d,h);return h.length>0?(o(l,h),{values:void 0,default:s}):HW(u)!=="object"?(r(l),{values:void 0,default:s}):{values:u.contents?u.contents.package:void 0,default:s}}catch{return{values:void 0,default:s}}else{if(!await this.fileService.exists(s))return;let d;try{d=await this.findMessageBundles(e,i)}catch{return}if(!d.localized)return{values:void 0,default:d.original};try{const h=(await this.fileService.readFile(d.localized)).value.toString(),u=[],f=ow(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):HW(f)!=="object"?(r(d.localized),{values:void 0,default:d.original}):{values:f,default:d.original}}catch{return{values:void 0,default:d.original}}}}async translateManifest(e,t,i){const s=await this.getLocalizedMessages(e,t,i);if(s)try{const o=[],r=await this.resolveOriginalMessageBundle(s.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",s.default?.path,YDe(c.error))))}),t;if(HW(s)!=="object")return this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",s.default?.path))),t;const a=s.values||Object.create(null);return c7t(this.logService,t,a,r)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return ow(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,s)=>{const o=r=>{const a=qt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:qt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:qt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:qt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};XDe=D([_(0,ci),_(1,Ze)],XDe);let Jne=class extends XDe{constructor(e,t,i,s,o){super(s,o),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===qr.User)try{const s=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(s)}catch{}return n1(i)?t:t.filter(s=>!i[G$.create(s).toString()])}async scanExtensionsFromLocation(e){const t=await this.fileService.resolve(e.location);if(!t.children?.length)return[];const i=await Promise.all(t.children.map(async s=>{if(!s.isDirectory||e.type===qr.User&&ui(s.resource).indexOf(".")===0)return null;const o=new f8(s.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.excludeObsolete,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(o)}));return Ui(i).sort((s,o)=>s.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(s=>!s.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,s=>!!s.metadata?.isBuiltin||!!s.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const s=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!s.length)return[];const o=await Promise.all(s.map(async r=>{if(t(r)){const a=new f8(r.location,i.mtime,i.applicationExtensionslocation,i.applicationExtensionslocationMtime,i.profile,i.profileScanOptions,i.type,i.excludeObsolete,i.validate,i.productVersion,i.productDate,i.productCommit,i.devMode,i.language,i.translations);return this.scanExtension(a,r.metadata)}return null}));return Ui(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(qt(e.location,"package.json"))){const t=await this.scanExtension(e);return t?[t]:[]}else return await this.scanExtensions(e)}catch(t){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,lg(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=gZe),t=t??i.__metadata,delete i.__metadata;const s=ny(i.publisher,i.name),o=t?.id?{id:s,uuid:t.id}:{id:s},r=t?.isSystem?qr.System:e.type,a=r===qr.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,f8.createNlsConfiguration(e));const c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Hs.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate?this.validate(c,e):c}}catch(i){e.type!==qr.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const s=n7t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin);for(const[o,r]of s)o===nt.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,r)));return e.isValid=i,e.validations=s,e}async scanExtensionManifest(e){const t=qt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return Cy(o)!==Xi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(kR,2,"Cannot read file {0}: {1}.",t.path,o.message))),null}let s;try{s=JSON.parse(i)}catch{const r=[];ow(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(kR,3,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,YDe(a.error))));return null}return HW(s)!=="object"?(this.logService.error(this.formatMessage(e,g(kR,4,"Invalid manifest file {0}: Not an JSON object.",t.path))),null):s}};Jne=D([_(1,$de),_(2,_o),_(3,ci),_(4,Ze)],Jne);let Xne=class extends Jne{constructor(e,t,i,s,o,r,a){super(t,s,o,r,a),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new iQ(3e3)),this._onDidChangeCache=this._register(new I),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){const t=this.getCacheFile(e),i=await this.readExtensionCache(t);if(this.input=e,i&&i.input&&f8.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=P.revive(o.location),o));const s=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:s}),s}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Or(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,lg(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,ze.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,lg(i))}}async validateCache(){if(!this.input)return;const e=this.getCacheFile(this.input),t=await this.readExtensionCache(e);if(!t)return;const i=t.result,s=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Io(s,i))try{this.logService.info("Invalidating Cache",i,s),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(o){this.logService.error(o)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===qr.System?iLt:tLt)}getProfile(e){return e.type===qr.System?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(t=>this.uriIdentityService.extUri.isEqual(e.location,t.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};Xne=D([_(2,V_),_(3,$de),_(4,_o),_(5,ci),_(6,Ze)],Xne);const ZDe=["W","X","Y","Z","a","b","c","d","e","f"],d7t=new RegExp(`^[${ZDe.join("")}]+`),dot=7;function h7t(n){if(n.scheme!==_e.vscodeNotebookCell)return;const e=n.fragment.indexOf("s");if(e<0)return;const t=parseInt(n.fragment.substring(0,e).replace(d7t,""),dot),i=Tje(n.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:n.with({scheme:i,fragment:null})}}function u7t(n,e){const t=e.toString(dot),s=`${t.lengthze.wrap(r))),o=y7t(s);return i=i||o.byteLength!==s.byteLength,{data:o,didCompression:i}}const AX="\x1B[A",qpe=AX.split("").map(n=>n.charCodeAt(0)),m7t=10;function _7t(n){let e=!1;return n.forEach((t,i)=>{if(i===0||t.length-1;){const e=n.match(/^(.*)\r+/m)[1];let t=n.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),n=n.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return n}const b7t=8,C7t=13;function y7t(n){return!n.buffer.includes(b7t)&&!n.buffer.includes(C7t)?n:ze.fromString(w7t(v7t(f7t.decode(n.buffer))))}var ike,aT,wA,nke,cT,qD,lT,ske,oke,EX,U3,rke,TC,RC,ake,Rf,cke;function Ri(n){return Object.assign(n,{apply:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(n,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const[i,...s]=t;return Reflect.construct(n,s,i.constructor)}}})}var tse;(function(n){n[n.Top=0]="Top",n[n.Bottom=1]="Bottom"})(tse||(tse={}));var OR,Hqe;let oo=ike=(Hqe=class{constructor(e){kt(this,OR);st(this,OR,e)}static from(...e){let t=e;return new ike(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof se(this,OR)=="function"&&(se(this,OR).call(this),st(this,OR,void 0))}},OR=new WeakMap,Hqe);oo=ike=D([Ri],oo);let Ps=aT=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;ie.line?1:this._charactere._character?1:0}translate(e,t=0){if(e===null||t===null)throw Hi();let i;return typeof e>"u"?i=0:typeof e=="number"?i=e:(i=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),i===0&&t===0?this:new aT(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Hi();let i;return typeof e>"u"?i=this.line:typeof e=="number"?i=e:(i=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),i===this.line&&t===this.character?this:new aT(i,t)}toJSON(){return{line:this.line,character:this.character}}};Ps=aT=D([Ri],Ps);let rs=wA=class{static isRange(e){return e instanceof wA?!0:e?Ps.isPosition(e.start)&&Ps.isPosition(e.end):!1}static of(e){if(e instanceof wA)return e;if(this.isRange(e))return new wA(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");o.isBefore(r)?(this._start=o,this._end=r):(this._start=r,this._end=o)}contains(e){return wA.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ps.isPosition(e)?!(Ps.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){const t=Ps.Max(e.start,this._start),i=Ps.Min(e.end,this._end);if(!t.isAfter(i))return new wA(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=Ps.Min(e.start,this._start),i=Ps.Max(e.end,this.end);return new wA(t,i)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw Hi();let i;return e?Ps.isPosition(e)?i=e:(i=e.start||this.start,t=e.end||this.end):i=this.start,i.isEqual(this._start)&&t.isEqual(this.end)?this:new wA(i,t)}toJSON(){return[this.start,this.end]}};rs=wA=D([Ri],rs);let XS=nke=class extends rs{static isSelection(e){return e instanceof nke?!0:e?rs.isRange(e)&&Ps.isPosition(e.anchor)&&Ps.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");super(o,r),this._anchor=o,this._active=r}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}};XS=nke=D([Ri],XS);const uot=n=>{if(typeof n!="string"||n.length===0||!/^[0-9A-Za-z_\-]+$/.test(n))throw Hi("connectionToken")};let got=class{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,i){if(typeof e!="string"||e.length===0)throw Hi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Hi("port");typeof i<"u"&&uot(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},m8=class{static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t){this.makeConnection=e,this.connectionToken=t,typeof t<"u"&&uot(t)}},OT=class xX extends Error{static NotAvailable(e,t){return new xX(e,Xd.NotAvailable,t)}static TemporarilyNotAvailable(e){return new xX(e,Xd.TemporarilyNotAvailable)}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,xX.prototype)}};var jv;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(jv||(jv={}));var LM;(function(n){n[n.Replace=1]="Replace",n[n.Append=2]="Append",n[n.Prepend=3]="Prepend"})(LM||(LM={}));let qx=cT=class{static isTextEdit(e){return e instanceof cT?!0:e?rs.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new cT(e,t)}static insert(e,t){return cT.replace(new rs(e,e),t)}static delete(e){return cT.replace(e,"")}static setEndOfLine(e){const t=new cT(new rs(new Ps(0,0),new Ps(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!rs.isRange(e))throw Hi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Hi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Hi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};qx=cT=D([Ri],qx);let T6=qD=class{static isNotebookCellEdit(e){return e instanceof qD?!0:e?rS.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new qD(e,t)}static insertCells(e,t){return new qD(new rS(e,e),t)}static deleteCells(e){return new qD(e,[])}static updateCellMetadata(e,t){const i=new qD(new rS(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new qD(new rS(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};T6=qD=D([Ri],T6);let zhe=class DX{static isSnippetTextEdit(e){return e instanceof DX?!0:e?rs.isRange(e.range)&&Q1.isSnippetString(e.snippet):!1}static replace(e,t){return new DX(e,t)}static insert(e,t){return DX.replace(new rs(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var sl;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.Cell=3]="Cell",n[n.CellReplace=5]="CellReplace",n[n.Snippet=6]="Snippet"})(sl||(sl={}));let q1=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,s){this._edits.push({_type:sl.File,from:e,to:t,options:i,metadata:s})}createFile(e,t,i){this._edits.push({_type:sl.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:sl.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:sl.Cell,metadata:i,uri:e,edit:{editType:G1.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,s){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:sl.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:s})}replaceNotebookCellMetadata(e,t,i,s){this._edits.push({_type:sl.Cell,metadata:s,uri:e,edit:{editType:G1.Metadata,index:t,metadata:i}})}replace(e,t,i,s){this._edits.push({_type:sl.Text,uri:e,edit:new qx(t,i),metadata:s})}insert(e,t,i,s){this.replace(e,new rs(t,t),i,s)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===sl.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let s,o;Array.isArray(i)?(s=i[0],o=i[1]):s=i,T6.isNotebookCellEdit(s)?s.newCellMetadata?this.replaceNotebookCellMetadata(e,s.range.start,s.newCellMetadata,o):s.newNotebookMetadata?this.replaceNotebookMetadata(e,s.newNotebookMetadata,o):this.replaceNotebookCells(e,s.range,s.newCells,o):zhe.isSnippetTextEdit(s)?this._edits.push({_type:sl.Snippet,uri:e,range:s.range,edit:s.snippet,metadata:o}):this._edits.push({_type:sl.Text,uri:e,edit:s,metadata:o})}else{for(let i=0;is.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){const i=new lT;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};Q1=lT=D([Ri],Q1);var mI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(mI||(mI={}));var Th;(function(n){n[n.Hint=3]="Hint",n[n.Information=2]="Information",n[n.Warning=1]="Warning",n[n.Error=0]="Error"})(Th||(Th={}));let _p=ske=class{static isLocation(e){return e instanceof ske?!0:e?rs.isRange(e.range)&&P.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(rs.isRange(t))this.range=rs.of(t);else if(Ps.isPosition(t))this.range=new rs(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};_p=ske=D([Ri],_p);let e4=class{static is(e){return e?typeof e.message=="string"&&e.location&&rs.isRange(e.location.range)&&P.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};e4=D([Ri],e4);let R6=class{constructor(e,t,i=Th.Error){if(!rs.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=i}toJSON(){return{severity:Th[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&Ls(e.tags,t.tags)&&Ls(e.relatedInformation,t.relatedInformation,e4.isEqual)}};R6=D([Ri],R6);let M6=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};M6=D([Ri],M6);let ise=class extends M6{constructor(e,t,i,s){super(e,t),this.canIncreaseHover=i,this.canDecreaseHover=s}};ise=D([Ri],ise);var lke;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(lke||(lke={}));var t4;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(t4||(t4={}));let N6=class{constructor(e,t=t4.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:t4[this.kind]}}};N6=D([Ri],N6);let P6=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};P6=D([Ri],P6);var Gr;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(Gr||(Gr={}));var i4;(function(n){n[n.Deprecated=1]="Deprecated"})(i4||(i4={}));let n4=oke=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,s,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),s instanceof _p?this.location=s:i instanceof rs&&(this.location=new _p(s,i)),oke.validate(this)}toJSON(){return{name:this.name,kind:Gr[this.kind],location:this.location,containerName:this.containerName}}};n4=oke=D([Ri],n4);let s4=EX=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(EX.validate)}constructor(e,t,i,s,o){this.name=e,this.detail=t,this.kind=i,this.range=s,this.selectionRange=o,this.children=[],EX.validate(this)}};s4=EX=D([Ri],s4);var o4;(function(n){n[n.Invoke=1]="Invoke",n[n.Automatic=2]="Automatic"})(o4||(o4={}));let F6=class{constructor(e,t){this.title=e,this.kind=t}};F6=D([Ri],F6);var LP;let Ya=(LP=class{constructor(e){this.value=e}append(e){return new U3(this.value?this.value+U3.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+U3.sep)}},U3=LP,LP.sep=".",LP);Ya=U3=D([Ri],Ya);Ya.Empty=new Ya("");Ya.QuickFix=Ya.Empty.append("quickfix");Ya.Refactor=Ya.Empty.append("refactor");Ya.RefactorExtract=Ya.Refactor.append("extract");Ya.RefactorInline=Ya.Refactor.append("inline");Ya.RefactorMove=Ya.Refactor.append("move");Ya.RefactorRewrite=Ya.Refactor.append("rewrite");Ya.Source=Ya.Empty.append("source");Ya.SourceOrganizeImports=Ya.Source.append("organizeImports");Ya.SourceFixAll=Ya.Source.append("fixAll");Ya.Notebook=Ya.Empty.append("notebook");let r4=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};r4=D([Ri],r4);let $he=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}},gOe=class{constructor(e,t){this.fromRanges=t,this.from=e}},fOe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var TM;(function(n){n[n.Information=0]="Information",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(TM||(TM={}));let O6=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};O6=D([Ri],O6);var Uu,Uqe;let vp=rke=(Uqe=class{constructor(e,t=!1){kt(this,Uu);st(this,Uu,new Xt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof rke?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return se(this,Uu).value}set value(e){se(this,Uu).value=e}get isTrusted(){return se(this,Uu).isTrusted}set isTrusted(e){se(this,Uu).isTrusted=e}get supportThemeIcons(){return se(this,Uu).supportThemeIcons}set supportThemeIcons(e){se(this,Uu).supportThemeIcons=e}get supportHtml(){return se(this,Uu).supportHtml}set supportHtml(e){se(this,Uu).supportHtml=e}get baseUri(){return se(this,Uu).baseUri}set baseUri(e){se(this,Uu).baseUri=e}appendText(e){return se(this,Uu).appendText(e),this}appendMarkdown(e){return se(this,Uu).appendMarkdown(e),this}appendCodeblock(e,t){return se(this,Uu).appendCodeblock(t??"",e),this}},Uu=new WeakMap,Uqe);vp=rke=D([Ri],vp);let nse=class{constructor(e,t){this.label=e,this.documentation=t}};nse=D([Ri],nse);let sse=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};sse=D([Ri],sse);let ose=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};ose=D([Ri],ose);var rse;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(rse||(rse={}));var ase;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(ase||(ase={}));let B6=class{constructor(e){this.value=e}};B6=D([Ri],B6);let W6=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};W6=D([Ri],W6);var RM;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(RM||(RM={}));var en;(function(n){n[n.Text=0]="Text",n[n.Method=1]="Method",n[n.Function=2]="Function",n[n.Constructor=3]="Constructor",n[n.Field=4]="Field",n[n.Variable=5]="Variable",n[n.Class=6]="Class",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Unit=10]="Unit",n[n.Value=11]="Value",n[n.Enum=12]="Enum",n[n.Keyword=13]="Keyword",n[n.Snippet=14]="Snippet",n[n.Color=15]="Color",n[n.File=16]="File",n[n.Reference=17]="Reference",n[n.Folder=18]="Folder",n[n.EnumMember=19]="EnumMember",n[n.Constant=20]="Constant",n[n.Struct=21]="Struct",n[n.Event=22]="Event",n[n.Operator=23]="Operator",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue"})(en||(en={}));var a4;(function(n){n[n.Deprecated=1]="Deprecated"})(a4||(a4={}));let H6=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&en[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};H6=D([Ri],H6);let WF=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};WF=D([Ri],WF);let cse=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};cse=D([Ri],cse);let lse=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};lse=D([Ri],lse);var IR;(function(n){n[n.Unknown=0]="Unknown",n[n.Word=1]="Word",n[n.Line=2]="Line",n[n.Suggest=3]="Suggest"})(IR||(IR={}));var c4;(function(n){n[n.Active=-1]="Active",n[n.Beside=-2]="Beside",n[n.One=1]="One",n[n.Two=2]="Two",n[n.Three=3]="Three",n[n.Four=4]="Four",n[n.Five=5]="Five",n[n.Six=6]="Six",n[n.Seven=7]="Seven",n[n.Eight=8]="Eight",n[n.Nine=9]="Nine"})(c4||(c4={}));var HE;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(HE||(HE={}));function S7t(n,e){return`${Cn.toKey(n)}.${e}`}var wv;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval"})(wv||(wv={}));var MM;(function(n){n[n.Manual=1]="Manual",n[n.AfterDelay=2]="AfterDelay",n[n.FocusOut=3]="FocusOut"})(MM||(MM={}));var U6;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(U6||(U6={}));var HF;(function(n){n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command"})(HF||(HF={}));var l4;(function(n){n[n.Undo=1]="Undo",n[n.Redo=2]="Redo"})(l4||(l4={}));var _I;(function(n){n[n.OpenOpen=0]="OpenOpen",n[n.ClosedClosed=1]="ClosedClosed",n[n.OpenClosed=2]="OpenClosed",n[n.ClosedOpen=3]="ClosedOpen"})(_I||(_I={}));(function(n){function e(t){switch(t){case"keyboard":return n.Keyboard;case"mouse":return n.Mouse;case"api":return n.Command}}n.fromValue=e})(HF||(HF={}));var UF;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UF||(UF={}));(function(n){function e(t){switch(t){case n.Other:return"other";case n.Comment:return"comment";case n.String:return"string";case n.RegEx:return"regex"}return"other"}n.toString=e})(UF||(UF={}));let V6=class{constructor(e,t){if(t&&!P.isUri(t))throw Hi("target");if(!rs.isRange(e)||e.isEmpty)throw Hi("range");this.range=e,this.target=t}};V6=D([Ri],V6);let VF=class{constructor(e,t,i,s){this.red=e,this.green=t,this.blue=i,this.alpha=s}};VF=D([Ri],VF);let z6=class{constructor(e,t){if(t&&!(t instanceof VF))throw Hi("color");if(!rs.isRange(e)||e.isEmpty)throw Hi("range");this.range=e,this.color=t}};z6=D([Ri],z6);let $6=class{constructor(e){if(!e||typeof e!="string")throw Hi("label");this.label=e}};$6=D([Ri],$6);var dse;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Information=2]="Information"})(dse||(dse={}));var hse;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(hse||(hse={}));var NM;(function(n){n[n.Low=0]="Low",n[n.Medium=1]="Medium",n[n.High=2]="High"})(NM||(NM={}));let fot=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Hi("startIndex");if(typeof t!="number"||t<1)throw Hi("length");if(i!==void 0&&typeof i!="string")throw Hi("tooltip")}},pot=class{constructor(e){this.uri=e}};class mot{constructor(e){this.terminalCommand=e}}var use;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(use||(use={}));let _ot=class{constructor(e){if(this.options=e,typeof e!="object")throw Hi("options")}};var gse;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(gse||(gse={}));var fse;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(fse||(fse={}));var Qy;let d4=(Qy=class{static from(e){switch(e){case"clean":return TC.Clean;case"build":return TC.Build;case"rebuild":return TC.Rebuild;case"test":return TC.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Hi("name");this._id=e}get id(){return this._id}},TC=Qy,Qy.Clean=new TC("clean","Clean"),Qy.Build=new TC("build","Build"),Qy.Rebuild=new TC("rebuild","Rebuild"),Qy.Test=new TC("test","Test"),Qy);d4=TC=D([Ri],d4);function vot(n){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return vot(e)}};zF=D([Ri],zF);let j1=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Hi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Hi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Hi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Hi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Hi("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(const t of this._args)e.push(typeof t=="string"?t:t.value);return vot(e)}};j1=D([Ri],j1);var pse;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(pse||(pse={}));var K1;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace"})(K1||(K1={}));let Ghe=class{constructor(e){this._callback=e}computeId(){return"customExecution"+Dr()}set callback(e){this._callback=e}get callback(){return this._callback}};var jy;let G6=(jy=class{constructor(e,t,i,s,o,r){this.__deprecated=!1,this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=i,this.execution=s,a=o,this.__deprecated=!0):t===K1.Global||t===K1.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r),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(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof zF?this._definition={type:RC.ProcessType,id:this._execution.computeId()}:this._execution instanceof j1?this._definition={type:RC.ShellType,id:this._execution.computeId()}:this._execution instanceof Ghe?this._definition={type:RC.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:RC.EmptyType,id:Dr()}}get definition(){return this._definition}set definition(e){if(e==null)throw Hi("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw Hi("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;const t=this._definition.type;(RC.EmptyType===t||RC.ProcessType===t||RC.ShellType===t||RC.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw Hi("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}},RC=jy,jy.ExtensionCallbackType="customExecution",jy.ProcessType="process",jy.ShellType="shell",jy.EmptyType="$empty",jy);G6=RC=D([Ri],G6);var VI;(function(n){n[n.SourceControl=1]="SourceControl",n[n.Window=10]="Window",n[n.Notification=15]="Notification"})(VI||(VI={}));var dke;(function(n){function e(t){const i=t;return jc(i.value)?i.tooltip&&!zt(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}n.isViewBadge=e})(dke||(dke={}));let q6=ake=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const s=jc(i.checkboxState)?i.checkboxState:fo(i.checkboxState)&&jc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!jc(i.checkboxState)&&fo(i.checkboxState)?i.checkboxState.tooltip:void 0;if(s===void 0||s!==Lb.Checked&&s!==Lb.Unchecked||o!==void 0&&!zt(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof ake)return!0;if(i.label!==void 0&&!zt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!zt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!zt(i.iconPath)&&!P.isUri(i.iconPath)&&(!i.iconPath||!zt(i.iconPath.id))){const s=i.iconPath;if(!s||!zt(s.light)&&!P.isUri(s.light)&&!zt(s.dark)&&!P.isUri(s.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!zt(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!P.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!zt(i.tooltip)&&!(i.tooltip instanceof vp)?(console.log("INVALID tree item, invalid tooltip",i.tooltip),!1):i.command!==void 0&&!i.command.command?(console.log("INVALID tree item, invalid command",i.command),!1):i.collapsibleState!==void 0&&i.collapsibleStatezI.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!zt(i.contextValue)?(console.log("INVALID tree item, invalid contextValue",i.contextValue),!1):i.accessibilityInformation!==void 0&&!i.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",i.accessibilityInformation),!1):!0}constructor(e,t=zI.None){this.collapsibleState=t,P.isUri(e)?this.resourceUri=e:this.label=e}};q6=ake=D([Ri],q6);var zI;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(zI||(zI={}));var Lb;(function(n){n[n.Unchecked=0]="Unchecked",n[n.Checked=1]="Checked"})(Lb||(Lb={}));let Q6=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Q6=D([Ri],Q6);class mse extends Q6{}var wq;class A7t extends mse{constructor(t){super("");kt(this,wq);st(this,wq,t)}asFile(){return se(this,wq)}}wq=new WeakMap;class E7t{constructor(e,t,i,s){this.name=e,this.uri=t,this._itemId=i,this._getData=s}data(){return this._getData()}}var jA,BR,V3,Vqe;let h4=(Vqe=class{constructor(e){kt(this,BR);kt(this,jA,new Map);for(const[t,i]of e??[]){const s=se(this,jA).get(Zz(this,BR,V3).call(this,t));s?s.push(i):se(this,jA).set(Zz(this,BR,V3).call(this,t),[i])}}get(e){return se(this,jA).get(Zz(this,BR,V3).call(this,e))?.[0]}set(e,t){se(this,jA).set(Zz(this,BR,V3).call(this,e),[t])}forEach(e,t){for(const[i,s]of se(this,jA))for(const o of s)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of se(this,jA))for(const i of t)yield[e,i]}},jA=new WeakMap,BR=new WeakSet,V3=function(e){return e.toLowerCase()},Vqe);h4=D([Ri],h4);let _se=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};_se=D([Ri],_se);var hke;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(hke||(hke={}));const gW=class gW{constructor(e){this.value=e}append(...e){return new gW((this.value?[this.value,...e]:e).join(gW.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+gW.sep)}};gW.sep=".";let u4=gW;u4.Empty=new u4("");let wot=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},fg=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};fg=D([Ri],fg);fg.File=new fg("file");fg.Folder=new fg("folder");let g4=class{constructor(e){this.id=e}};g4=D([Ri],g4);var PM;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.WorkspaceFolder=3]="WorkspaceFolder"})(PM||(PM={}));let FM=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=P.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!P.isUri(e)&&!P.isUri(e.uri)))throw Hi("base");if(typeof t!="string")throw Hi("pattern");typeof e=="string"?this.baseUri=P.file(e):P.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};FM=D([Ri],FM);const bot=new WeakMap;function x7t(n,e){bot.set(n,e)}let $F=class{constructor(e,t,i,s,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof s=="string"&&(this.logMessage=s),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=bot.get(this)??Dr()),this._id}};$F=D([Ri],$F);let vI=class extends $F{constructor(e,t,i,s,o,r){if(super(t,i,s,o,r),e===null)throw Hi("location");this.location=e}};vI=D([Ri],vI);let wI=class extends $F{constructor(e,t,i,s,o,r){super(t,i,s,o,r),this.functionName=e}};wI=D([Ri],wI);let vse=class extends $F{constructor(e,t,i,s,o,r,a,c){if(super(s,o,r,a,c),!t)throw Hi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};vse=D([Ri],vse);let j6=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};j6=D([Ri],j6);let f4=class{constructor(e,t){this.port=e,this.host=t}};f4=D([Ri],f4);let K6=class{constructor(e){this.path=e}};K6=D([Ri],K6);let Y6=class{constructor(e){this.implementation=e}};Y6=D([Ri],Y6);class Cot{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}}class yot{constructor(e,t){this.session=e,this.threadId=t}}let J6=class{constructor(e,t){this.range=e,this.expression=t}};J6=D([Ri],J6);var p4;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(p4||(p4={}));let X6=class{constructor(e,t){this.range=e,this.text=t}};X6=D([Ri],X6);let Z6=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};Z6=D([Ri],Z6);let eG=class{constructor(e,t){this.range=e,this.expression=t}};eG=D([Ri],eG);let uke=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};uke=D([Ri],uke);var gke;(function(n){n[n.AIGenerated=1]="AIGenerated"})(gke||(gke={}));var tG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(tG||(tG={}));class D7t{constructor(e,t){this.newSymbolName=e,this.tags=t}}var OM;(function(n){n[n.Changed=1]="Changed",n[n.Created=2]="Created",n[n.Deleted=3]="Deleted"})(OM||(OM={}));let Wl=Rf=class extends Error{static FileExists(e){return new Rf(e,rt.FileExists,Rf.FileExists)}static FileNotFound(e){return new Rf(e,rt.FileNotFound,Rf.FileNotFound)}static FileNotADirectory(e){return new Rf(e,rt.FileNotADirectory,Rf.FileNotADirectory)}static FileIsADirectory(e){return new Rf(e,rt.FileIsADirectory,Rf.FileIsADirectory)}static NoPermissions(e){return new Rf(e,rt.NoPermissions,Rf.NoPermissions)}static Unavailable(e){return new Rf(e,rt.Unavailable,Rf.Unavailable)}constructor(e,t=rt.Unknown,i){super(P.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",vJe(this,t),Object.setPrototypeOf(this,Rf.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Wl=Rf=D([Ri],Wl);let wse=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};wse=D([Ri],wse);var vy;(function(n){n[n.Comment=1]="Comment",n[n.Imports=2]="Imports",n[n.Region=3]="Region"})(vy||(vy={}));var m4;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(m4||(m4={}));var bse;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(bse||(bse={}));var Cse;(function(n){n[n.Published=0]="Published",n[n.Draft=1]="Draft"})(Cse||(Cse={}));var _4;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(_4||(_4={}));var iG;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(iG||(iG={}));let yse=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function k7t(n){return typeof n>"u"||Yqe(n)}let Sot=class Aot{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,i=e.tokenTypes.length;t"u"))return typeof o>"u"&&(o=0),this._pushEncoded(e,t,i,s,o);if(rs.isRange(e)&&typeof t=="string"&&k7t(i))return this._push(e,t,i);throw Hi()}_push(e,t,i){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");const s=e.start.line,o=e.start.character,r=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t);let c=0;if(i)for(const l of i){if(!this._tokenModifierStrToInt.has(l))throw new Error("`tokenModifier` is not in the provided legend");const d=this._tokenModifierStrToInt.get(l);c|=1<>>0}this._pushEncoded(s,o,r,a,c)}_pushEncoded(e,t,i,s,o){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(r-=this._prevLine,r===0&&(a-=this._prevChar)),this._data[this._dataLen++]=r,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){const t=[],i=e.length/5|0;for(let a=0;a{const l=e[5*a],d=e[5*c];if(l===d){const h=e[5*a+1],u=e[5*c+1];return h-u}return l-d});const s=new Uint32Array(e.length);let o=0,r=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!fg.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,i){this.badge=e,this.tooltip=t,this.color=i}},Sse=class{constructor(e){this.kind=e}};Sse=D([Ri],Sse);var uE;(function(n){n[n.Light=1]="Light",n[n.Dark=2]="Dark",n[n.HighContrast=3]="HighContrast",n[n.HighContrastLight=4]="HighContrastLight"})(uE||(uE={}));let rS=class fke{static isNotebookRange(e){return e instanceof fke?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw Hi("start must be positive");if(t<0)throw Hi("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,i=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(i=e.end),t===this._start&&i===this._end?this:new fke(t,i)}},ej=class pke{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>pke.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,s,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=s,this.outputs=o??[],this.metadata=r,this.executionSummary=a,pke.validate(this)}},mOe=class{constructor(e){this.cells=e}};var Gp,ile;let _Oe=(Gp=class{static isNotebookCellOutputItem(e){return e instanceof Gp?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){const t={name:e.name,message:e.message,stack:e.stack};return Gp.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Gp.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Gp.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Gp(e,t)}static text(e,t=Js.text){const i=se(Gp,ile).encode(String(e));return new Gp(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Gp.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=Oje(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},ile=new WeakMap,kt(Gp,ile,new TextEncoder),Gp),oG=class mke{static isNotebookCellOutput(e){return e instanceof mke?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,s=new Set;for(let o=0;o!s.has(r))}constructor(e,t,i){this.items=mke.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=Dr(),this.metadata=t??i)}};var bI;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(bI||(bI={}));var qF;(function(n){n[n.Idle=1]="Idle",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(qF||(qF={}));var rG;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(rG||(rG={}));var aG;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(aG||(aG={}));let xot=class{constructor(e,t){this.text=e,this.alignment=t}};var Ase;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred"})(Ase||(Ase={}));var cG;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred",n[n.Hidden=-1]="Hidden"})(cG||(cG={}));let vOe=class{constructor(e,t=[]){this.uri=e,this.provides=Kb(t)}},Dot=class{constructor(e){this.label=e}};var lG;(function(n){n[n.Named=1]="Named",n[n.Indexed=2]="Indexed"})(lG||(lG={}));let Ese=class{constructor(e,t){this.label=e,this.timestamp=t}};Ese=D([Ri],Ese);var WM;(function(n){n[n.Production=1]="Production",n[n.Development=2]="Development",n[n.Test=3]="Test"})(WM||(WM={}));var dG;(function(n){n[n.Node=1]="Node",n[n.Webworker=2]="Webworker"})(dG||(dG={}));var UE;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UE||(UE={}));let kot=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},Iot=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var xse;(function(n){n[n.Queued=1]="Queued",n[n.Running=2]="Running",n[n.Passed=3]="Passed",n[n.Failed=4]="Failed",n[n.Skipped=5]="Skipped",n[n.Errored=6]="Errored"})(xse||(xse={}));var HM;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(HM||(HM={}));let hG=class{constructor(e=void 0,t=void 0,i=void 0,s=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=s,this.preserveFocus=o}};hG=D([Ri],hG);let b4=cke=class{static diff(e,t,i){const s=new cke(e);return s.expectedOutput=t,s.actualOutput=i,s}constructor(e){this.message=e}};b4=cke=D([Ri],b4);let C4=class{constructor(e){this.id=e}};C4=D([Ri],C4);class kX{constructor(e,t){this.covered=e,this.total=t,IX(this)}}function IX(n){if(n){if(n.covered>n.total)throw new Error(`The total number of covered items (${n.covered}) cannot be greater than the total (${n.total})`);if(n.total<0)throw new Error(`The number of covered items (${n.total}) cannot be negative`)}}let uG=class Lot{static fromDetails(e,t){const i=new kX(0,0),s=new kX(0,0),o=new kX(0,0);for(const a of t)if("branches"in a){i.total+=1,i.covered+=a.executed?1:0;for(const c of a.branches)s.total+=1,s.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new Lot(e,i,s.total>0?s:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,s,o){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=s,this.testItem=o}},Tot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i=[]){this.executed=e,this.location=t,this.branches=i}},Rot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.executed=e,this.location=t,this.label=i}};class Mot{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.name=e,this.executed=t,this.location=i}}var Dse;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(Dse||(Dse={}));var kse;(function(n){n[n.Untrusted=0]="Untrusted",n[n.Trusted=1]="Trusted",n[n.Unspecified=2]="Unspecified"})(kse||(kse={}));var Ise;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(Ise||(Ise={}));let qhe=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}};class Qhe{constructor(e){this.uri=e}}class gG{constructor(e,t){this.original=e,this.modified=t}}class wOe{constructor(e,t,i,s){this.base=e,this.input1=t,this.input2=i,this.result=s}}class jhe{constructor(e,t){this.uri=e,this.viewType=t}}class bOe{constructor(e){this.viewType=e}}class Khe{constructor(e,t){this.uri=e,this.notebookType=t}}class Yhe{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class COe{constructor(){}}class yOe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class SOe{constructor(){}}class Not{constructor(e){this.textDiffs=e}}var Lse;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(Lse||(Lse={}));var Tse;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Tse||(Tse={}));var Rse;(function(n){n[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Full=3]="Full"})(Rse||(Rse={}));let Pot=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var Mse;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful",n[n.Undone=2]="Undone",n[n.Accepted=3]="Accepted",n[n.Bug=4]="Bug"})(Mse||(Mse={}));var y4;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful"})(y4||(y4={}));let Jhe=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},fG=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e,this.vulnerabilities=t}},pG=class{constructor(e,t){this.participant=e,this.command=t}},_ke=class{constructor(e,t,i){this.title=e,this.message=t,this.data=i}};class Xhe{constructor(e,t){this.value=e,this.baseUri=t}}let Zhe=class{constructor(e,t){this.value=e,this.title=t}},mG=class{constructor(e){this.value=e}};class Fot{constructor(e,t){this.value=e,this.task=t}}let _G=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},eue=class{constructor(e){this.value=e}},GI=class{constructor(e,t){this.value=e,this.iconPath=t}},vG=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}};class Oot{constructor(e,t,i,s){this.prompt=e,this.command=t,this.references=i,this.participant=s}}class Bot{constructor(e,t,i,s){this.response=e,this.result=t,this.participant=i,this.command=s}}var cb;(function(n){n[n.Panel=1]="Panel",n[n.Terminal=2]="Terminal",n[n.Notebook=3]="Notebook",n[n.Editor=4]="Editor"})(cb||(cb={}));var Iv;(function(n){n[n.User=1]="User",n[n.Assistant=2]="Assistant",n[n.System=3]="System"})(Iv||(Iv={}));let v8=class vke{static User(e,t){return new vke(Iv.User,e,t)}static Assistant(e,t){return new vke(Iv.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.name=i}};class I7t{constructor(e){this.content=e}}class L7t{constructor(e,t){this.content=e,this.name=t}}class T7t{constructor(e,t){this.content=e,this.name=t}}class qg extends Error{static NotFound(e){return new qg(e,qg.NotFound.name)}static NoPermissions(e){return new qg(e,qg.NoPermissions.name)}static Blocked(e){return new qg(e,qg.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}}var Nse;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Nse||(Nse={}));var Pse;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(Pse||(Pse={}));var wke;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(wke||(wke={}));var Fse;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped"})(Fse||(Fse={}));class R7t{constructor(e,t){this.text=e,this.range=t}}var wG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(wG||(wG={}));var b2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(b2||(b2={}));var Fa;(function(n){n[n.UnknownInput=0]="UnknownInput",n[n.TextInput=1]="TextInput",n[n.TextDiffInput=2]="TextDiffInput",n[n.TextMergeInput=3]="TextMergeInput",n[n.NotebookInput=4]="NotebookInput",n[n.NotebookDiffInput=5]="NotebookDiffInput",n[n.CustomEditorInput=6]="CustomEditorInput",n[n.WebviewEditorInput=7]="WebviewEditorInput",n[n.TerminalEditorInput=8]="TerminalEditorInput",n[n.InteractiveEditorInput=9]="InteractiveEditorInput",n[n.ChatEditorInput=10]="ChatEditorInput",n[n.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(Fa||(Fa={}));var gu;(function(n){n[n.TAB_OPEN=0]="TAB_OPEN",n[n.TAB_CLOSE=1]="TAB_CLOSE",n[n.TAB_UPDATE=2]="TAB_UPDATE",n[n.TAB_MOVE=3]="TAB_MOVE"})(gu||(gu={}));var ol;(function(n){n[n.Int8Array=1]="Int8Array",n[n.Uint8Array=2]="Uint8Array",n[n.Uint8ClampedArray=3]="Uint8ClampedArray",n[n.Int16Array=4]="Int16Array",n[n.Uint16Array=5]="Uint16Array",n[n.Int32Array=6]="Int32Array",n[n.Uint32Array=7]="Uint32Array",n[n.Float32Array=8]="Float32Array",n[n.Float64Array=9]="Float64Array",n[n.BigInt64Array=10]="BigInt64Array",n[n.BigUint64Array=11]="BigUint64Array"})(ol||(ol={}));var C2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(C2||(C2={}));var UM;(function(n){n[n.None=0]="None",n[n.Process=1]="Process",n[n.Output=2]="Output",n[n.Hybrid=3]="Hybrid"})(UM||(UM={}));var Fi;(function(n){n.label="a",n.kind="b",n.detail="c",n.documentation="d",n.sortText="e",n.filterText="f",n.preselect="g",n.insertText="h",n.insertTextRules="i",n.range="j",n.commitCharacters="k",n.additionalTextEdits="l",n.kindModifier="m",n.commandIdent="n",n.commandId="o",n.commandArguments="p"})(Fi||(Fi={}));var aS;(function(n){n.defaultRanges="a",n.completions="b",n.isIncomplete="c",n.duration="d"})(aS||(aS={}));const Ue={MainThreadAuthentication:Xe("MainThreadAuthentication"),MainThreadBulkEdits:Xe("MainThreadBulkEdits"),MainThreadLanguageModels:Xe("MainThreadLanguageModels"),MainThreadEmbeddings:Xe("MainThreadEmbeddings"),MainThreadChatAgents2:Xe("MainThreadChatAgents2"),MainThreadChatVariables:Xe("MainThreadChatVariables"),MainThreadClipboard:Xe("MainThreadClipboard"),MainThreadCommands:Xe("MainThreadCommands"),MainThreadComments:Xe("MainThreadComments"),MainThreadConfiguration:Xe("MainThreadConfiguration"),MainThreadConsole:Xe("MainThreadConsole"),MainThreadDebugService:Xe("MainThreadDebugService"),MainThreadDecorations:Xe("MainThreadDecorations"),MainThreadDiagnostics:Xe("MainThreadDiagnostics"),MainThreadDialogs:Xe("MainThreadDiaglogs"),MainThreadDocuments:Xe("MainThreadDocuments"),MainThreadDocumentContentProviders:Xe("MainThreadDocumentContentProviders"),MainThreadTextEditors:Xe("MainThreadTextEditors"),MainThreadEditorInsets:Xe("MainThreadEditorInsets"),MainThreadEditorTabs:Xe("MainThreadEditorTabs"),MainThreadErrors:Xe("MainThreadErrors"),MainThreadTreeViews:Xe("MainThreadTreeViews"),MainThreadDownloadService:Xe("MainThreadDownloadService"),MainThreadLanguageFeatures:Xe("MainThreadLanguageFeatures"),MainThreadLanguages:Xe("MainThreadLanguages"),MainThreadLogger:Xe("MainThreadLogger"),MainThreadMessageService:Xe("MainThreadMessageService"),MainThreadOutputService:Xe("MainThreadOutputService"),MainThreadProgress:Xe("MainThreadProgress"),MainThreadQuickDiff:Xe("MainThreadQuickDiff"),MainThreadQuickOpen:Xe("MainThreadQuickOpen"),MainThreadStatusBar:Xe("MainThreadStatusBar"),MainThreadSecretState:Xe("MainThreadSecretState"),MainThreadStorage:Xe("MainThreadStorage"),MainThreadSpeech:Xe("MainThreadSpeechProvider"),MainThreadTelemetry:Xe("MainThreadTelemetry"),MainThreadTerminalService:Xe("MainThreadTerminalService"),MainThreadTerminalShellIntegration:Xe("MainThreadTerminalShellIntegration"),MainThreadWebviews:Xe("MainThreadWebviews"),MainThreadWebviewPanels:Xe("MainThreadWebviewPanels"),MainThreadWebviewViews:Xe("MainThreadWebviewViews"),MainThreadCustomEditors:Xe("MainThreadCustomEditors"),MainThreadUrls:Xe("MainThreadUrls"),MainThreadUriOpeners:Xe("MainThreadUriOpeners"),MainThreadProfileContentHandlers:Xe("MainThreadProfileContentHandlers"),MainThreadWorkspace:Xe("MainThreadWorkspace"),MainThreadFileSystem:Xe("MainThreadFileSystem"),MainThreadFileSystemEventService:Xe("MainThreadFileSystemEventService"),MainThreadExtensionService:Xe("MainThreadExtensionService"),MainThreadSCM:Xe("MainThreadSCM"),MainThreadSearch:Xe("MainThreadSearch"),MainThreadShare:Xe("MainThreadShare"),MainThreadTask:Xe("MainThreadTask"),MainThreadWindow:Xe("MainThreadWindow"),MainThreadLabelService:Xe("MainThreadLabelService"),MainThreadNotebook:Xe("MainThreadNotebook"),MainThreadNotebookDocuments:Xe("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:Xe("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:Xe("MainThreadNotebookKernels"),MainThreadNotebookRenderers:Xe("MainThreadNotebookRenderers"),MainThreadInteractive:Xe("MainThreadInteractive"),MainThreadTheming:Xe("MainThreadTheming"),MainThreadTunnelService:Xe("MainThreadTunnelService"),MainThreadManagedSockets:Xe("MainThreadManagedSockets"),MainThreadTimeline:Xe("MainThreadTimeline"),MainThreadTesting:Xe("MainThreadTesting"),MainThreadLocalization:Xe("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:Xe("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:Xe("MainThreadAiEmbeddingVector")},et={ExtHostCommands:Xe("ExtHostCommands"),ExtHostConfiguration:Xe("ExtHostConfiguration"),ExtHostDiagnostics:Xe("ExtHostDiagnostics"),ExtHostDebugService:Xe("ExtHostDebugService"),ExtHostDecorations:Xe("ExtHostDecorations"),ExtHostDocumentsAndEditors:Xe("ExtHostDocumentsAndEditors"),ExtHostDocuments:Xe("ExtHostDocuments"),ExtHostDocumentContentProviders:Xe("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:Xe("ExtHostDocumentSaveParticipant"),ExtHostEditors:Xe("ExtHostEditors"),ExtHostTreeViews:Xe("ExtHostTreeViews"),ExtHostFileSystem:Xe("ExtHostFileSystem"),ExtHostFileSystemInfo:Xe("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:Xe("ExtHostFileSystemEventService"),ExtHostLanguages:Xe("ExtHostLanguages"),ExtHostLanguageFeatures:Xe("ExtHostLanguageFeatures"),ExtHostQuickOpen:Xe("ExtHostQuickOpen"),ExtHostQuickDiff:Xe("ExtHostQuickDiff"),ExtHostStatusBar:Xe("ExtHostStatusBar"),ExtHostShare:Xe("ExtHostShare"),ExtHostExtensionService:Xe("ExtHostExtensionService"),ExtHostLogLevelServiceShape:Xe("ExtHostLogLevelServiceShape"),ExtHostTerminalService:Xe("ExtHostTerminalService"),ExtHostTerminalShellIntegration:Xe("ExtHostTerminalShellIntegration"),ExtHostSCM:Xe("ExtHostSCM"),ExtHostSearch:Xe("ExtHostSearch"),ExtHostTask:Xe("ExtHostTask"),ExtHostWorkspace:Xe("ExtHostWorkspace"),ExtHostWindow:Xe("ExtHostWindow"),ExtHostWebviews:Xe("ExtHostWebviews"),ExtHostWebviewPanels:Xe("ExtHostWebviewPanels"),ExtHostCustomEditors:Xe("ExtHostCustomEditors"),ExtHostWebviewViews:Xe("ExtHostWebviewViews"),ExtHostEditorInsets:Xe("ExtHostEditorInsets"),ExtHostEditorTabs:Xe("ExtHostEditorTabs"),ExtHostProgress:Xe("ExtHostProgress"),ExtHostComments:Xe("ExtHostComments"),ExtHostSecretState:Xe("ExtHostSecretState"),ExtHostStorage:Xe("ExtHostStorage"),ExtHostUrls:Xe("ExtHostUrls"),ExtHostUriOpeners:Xe("ExtHostUriOpeners"),ExtHostProfileContentHandlers:Xe("ExtHostProfileContentHandlers"),ExtHostOutputService:Xe("ExtHostOutputService"),ExtHostLabelService:Xe("ExtHostLabelService"),ExtHostNotebook:Xe("ExtHostNotebook"),ExtHostNotebookDocuments:Xe("ExtHostNotebookDocuments"),ExtHostNotebookEditors:Xe("ExtHostNotebookEditors"),ExtHostNotebookKernels:Xe("ExtHostNotebookKernels"),ExtHostNotebookRenderers:Xe("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:Xe("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:Xe("ExtHostInteractive"),ExtHostChatAgents2:Xe("ExtHostChatAgents"),ExtHostChatVariables:Xe("ExtHostChatVariables"),ExtHostChatProvider:Xe("ExtHostChatProvider"),ExtHostSpeech:Xe("ExtHostSpeech"),ExtHostEmbeddings:Xe("ExtHostEmbeddings"),ExtHostAiRelatedInformation:Xe("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:Xe("ExtHostAiEmbeddingVector"),ExtHostTheming:Xe("ExtHostTheming"),ExtHostTunnelService:Xe("ExtHostTunnelService"),ExtHostManagedSockets:Xe("ExtHostManagedSockets"),ExtHostAuthentication:Xe("ExtHostAuthentication"),ExtHostTimeline:Xe("ExtHostTimeline"),ExtHostTesting:Xe("ExtHostTesting"),ExtHostTelemetry:Xe("ExtHostTelemetry"),ExtHostLocalization:Xe("ExtHostLocalization")};var Ose;(function(n){n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None"})(Ose||(Ose={}));let bke;function Wot(n){bke=n}function tu(n){return new Proxy({},{get(e,t){if(bke==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return bke[n][t]}})}const M7t={version:"1.90.2",tasks:tu("tasks"),notebooks:tu("notebooks"),scm:tu("scm"),comments:tu("comments"),authentication:tu("authentication"),tests:tu("tests"),extensions:tu("extensions"),debug:tu("debug"),env:tu("env"),commands:tu("commands"),window:tu("window"),workspace:tu("workspace"),languages:tu("languages"),l10n:tu("l10n"),interactive:tu("interactive"),ai:tu("ai"),chat:tu("chat"),speech:tu("speech"),Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:gOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:fOe,CancellationError:Tc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ya,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CompletionItem:H6,CompletionItemKind:en,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:vm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,IndentAction:Ga,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:pOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentDropEdit:_se,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:mOe,NotebookRendererScript:vOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:_Oe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestMessage2:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,FileCoverage:uG,StatementCoverage:Tot,BranchCoverage:Rot,FunctionCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:wOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:bOe,TabInputTerminal:COe,TabInputInteractiveWindow:yOe,TabInputChat:SOe,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,RelatedInformationType:Nse,SpeechToTextStatus:Pse,KeywordRecognitionStatus:Fse},{version:N7t,tasks:P7t,notebooks:F7t,scm:O7t,comments:B7t,authentication:W7t,tests:H7t,extensions:U7t,debug:V7t,env:z7t,commands:$7t,window:G7t,workspace:q7t,languages:Q7t,l10n:j7t,interactive:K7t,ai:Y7t,chat:J7t,speech:X7t,Breakpoint:Z7t,TerminalOutputAnchor:e6t,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,ChatCompletionItem:n6t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentHighlight:V6t,DocumentHighlightKind:z6t,MultiDocumentHighlight:$6t,DocumentLink:G6t,DocumentSymbol:q6t,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InlineValueEvaluatableExpression:X6t,InlineCompletionTriggerKind:Z6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileDecoration:oGt,FileDecoration2:rGt,FileSystemError:aGt,FileType:cGt,FilePermission:lGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,InlineCompletionItem:gGt,InlineCompletionList:fGt,Hover:pGt,IndentAction:mGt,Location:_Gt,MarkdownString:vGt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,Range:xGt,RelativePattern:DGt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SourceBreakpoint:UGt,StandardTokenType:VGt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TerminalLink:XGt,TerminalQuickFixTerminalCommand:ZGt,TerminalQuickFixOpener:eqt,TerminalLocation:tqt,TerminalProfile:iqt,TerminalExitReason:nqt,TextDocumentSaveReason:sqt,TextEdit:oqt,SnippetTextEdit:rqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,SyntaxTokenType:hqt,TextDocumentChangeReason:uqt,ThemeColor:gqt,ThemeIcon:fqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,DocumentDropEdit:Sqt,DocumentPasteEdit:Aqt,InlayHint:Eqt,InlayHintLabelPart:xqt,InlayHintKind:Dqt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,ManagedResolvedAuthority:Lqt,SourceControlInputBoxValidationType:Tqt,ExtensionRuntime:Rqt,TimelineItem:Mqt,NotebookRange:Nqt,NotebookCellKind:Pqt,NotebookCellExecutionState:Fqt,NotebookCellData:Oqt,NotebookData:Bqt,NotebookRendererScript:Wqt,NotebookCellStatusBarAlignment:Hqt,NotebookEditorRevealType:Uqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookEdit:Qqt,NotebookKernelSourceAction:jqt,PortAttributes:Kqt,LinkedEditingRanges:Yqt,TestResultState:Jqt,TestRunRequest:Xqt,TestMessage:Zqt,TestMessage2:eQt,TestTag:tQt,TestRunProfileKind:iQt,TextSearchCompleteMessageType:nQt,DataTransfer:sQt,DataTransferItem:oQt,FileCoverage:rQt,StatementCoverage:aQt,BranchCoverage:cQt,FunctionCoverage:lQt,WorkspaceTrustState:dQt,LanguageStatusSeverity:hQt,QuickPickItemKind:uQt,InputBoxValidationSeverity:gQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputCustom:_Qt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputWebview:bQt,TabInputTerminal:CQt,TabInputInteractiveWindow:yQt,TabInputChat:SQt,TelemetryTrustedValue:AQt,LogLevel:EQt,EditSessionIdentityMatch:xQt,InteractiveSessionVoteDirection:DQt,ChatCopyKind:kQt,InteractiveEditorResponseFeedbackKind:IQt,RelatedInformationType:LQt,SpeechToTextStatus:TQt,KeywordRecognitionStatus:RQt}=M7t,MQt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:cQt,Breakpoint:Z7t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,ChatCompletionItem:n6t,ChatCopyKind:kQt,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DataTransfer:sQt,DataTransferItem:oQt,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentDropEdit:Sqt,DocumentHighlight:V6t,DocumentHighlightKind:z6t,DocumentLink:G6t,DocumentPasteEdit:Aqt,DocumentSymbol:q6t,EditSessionIdentityMatch:xQt,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExtensionRuntime:Rqt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileCoverage:rQt,FileDecoration:oGt,FileDecoration2:rGt,FilePermission:lGt,FileSystemError:aGt,FileType:cGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,FunctionCoverage:lQt,Hover:pGt,IndentAction:mGt,InlayHint:Eqt,InlayHintKind:Dqt,InlayHintLabelPart:xqt,InlineCompletionItem:gGt,InlineCompletionList:fGt,InlineCompletionTriggerKind:Z6t,InlineValueEvaluatableExpression:X6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InputBoxValidationSeverity:gQt,InteractiveEditorResponseFeedbackKind:IQt,InteractiveSessionVoteDirection:DQt,KeywordRecognitionStatus:RQt,LanguageStatusSeverity:hQt,LinkedEditingRanges:Yqt,Location:_Gt,LogLevel:EQt,ManagedResolvedAuthority:Lqt,MarkdownString:vGt,MultiDocumentHighlight:$6t,NotebookCellData:Oqt,NotebookCellExecutionState:Fqt,NotebookCellKind:Pqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarAlignment:Hqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookData:Bqt,NotebookEdit:Qqt,NotebookEditorRevealType:Uqt,NotebookKernelSourceAction:jqt,NotebookRange:Nqt,NotebookRendererScript:Wqt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAttributes:Kqt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,QuickPickItemKind:uQt,Range:xGt,RelatedInformationType:LQt,RelativePattern:DGt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SnippetTextEdit:rqt,SourceBreakpoint:UGt,SourceControlInputBoxValidationType:Tqt,SpeechToTextStatus:TQt,StandardTokenType:VGt,StatementCoverage:aQt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,SyntaxTokenType:hqt,TabInputChat:SQt,TabInputCustom:_Qt,TabInputInteractiveWindow:yQt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputTerminal:CQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputWebview:bQt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TelemetryTrustedValue:AQt,TerminalExitReason:nqt,TerminalLink:XGt,TerminalLocation:tqt,TerminalOutputAnchor:e6t,TerminalProfile:iqt,TerminalQuickFixOpener:eqt,TerminalQuickFixTerminalCommand:ZGt,TestMessage:Zqt,TestMessage2:eQt,TestResultState:Jqt,TestRunProfileKind:iQt,TestRunRequest:Xqt,TestTag:tQt,TextDocumentChangeReason:uqt,TextDocumentSaveReason:sqt,TextEdit:oqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,TextSearchCompleteMessageType:nQt,ThemeColor:gqt,ThemeIcon:fqt,TimelineItem:Mqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,WorkspaceTrustState:dQt,ai:Y7t,authentication:W7t,chat:J7t,commands:$7t,comments:B7t,debug:V7t,env:z7t,extensions:U7t,interactive:K7t,l10n:j7t,languages:Q7t,notebooks:F7t,scm:O7t,setDefaultApi:Wot,speech:X7t,tasks:P7t,tests:H7t,version:N7t,window:G7t,workspace:q7t},Symbol.toStringTag,{value:"Module"}));bMt(async({toAdd:n,toRemove:e})=>{await znt(),await Lt.get(ho).deltaExtensions(n,e)},(n,e)=>({toAdd:[...n.toAdd,...e.toAdd],toRemove:[...n.toRemove,...e.toRemove]}),0);const NQt=new Map;function PQt(n){return NQt.get(n)}let _$e=class extends ${constructor(e,t,i){super(),this.fileService=t,this.languagePackService=i}async $fetchBuiltInBundleUri(e,t){try{return await this.languagePackService.getBuiltInExtensionTranslationsUri(e,t)}catch{return}}async $fetchBundleContents(e){return(await this.fileService.readFile(P.revive(e))).value.toString()}};_$e=D([Zi(Ue.MainThreadLocalization),_(1,ci),_(2,LZe)],_$e);class tj{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var z3;const FQt="vs/workbench/contrib/notebook/common/notebookEditorInput";var TP;let VM=(TP=class extends _ne{static getOrCreate(e,t,i,s,o={}){const r=e.createInstance(z3,t,i,s,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=s,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this._editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!s.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(bt)}),this._register(h.onWillStop(m=>{this.isDirty()&&m.veto((async()=>{const v=u.findEditors(this);return!(v.length>0&&(await u.save(v[0])).success)})(),g(FQt,0,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,super.dispose()}get typeId(){return z3.ID}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),this._editorModelReference?this._editorModelReference.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}getDescription(e=Gs.MEDIUM){if(!this.hasCapability(Mi.Untitled)||this._editorModelReference?.object.hasAssociatedFilePath())return super.getDescription(e)}isReadonly(){return this._editorModelReference?this._editorModelReference.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._editorModelReference?this._editorModelReference.object.isDirty():this._defaultDirtyState}isSaving(){const e=this._editorModelReference?.object;return!e||!e.isDirty()||e.hasErrorState||this.hasCapability(Mi.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.object.save(t),this)}async saveAs(e,t){if(!this._editorModelReference)return;const i=this._notebookService.getContributedNotebookType(this.viewType);if(!i)return;const s=this.hasCapability(Mi.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this._editorModelReference.object.resource;let o;if(this._editorModelReference.object.hasAssociatedFilePath())o=s;else if(o=await this._fileDialogService.pickFileToSave(s,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:NYe(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${o} is not supported by ${i.providerDisplayName}. +`):w.data.stack,b.name=w.data.name,h(b);break}case Fg.PromiseErrorObj:this.handlers.delete(o),h(w.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===_2.Idle?u():(f=na(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:zp.PromiseCancel}),h(new Tc)},m=s.onCancellationRequested(p);c=pa(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const s=this.lastRequestId++,o=zp.EventListen,r={id:s,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=na(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(r)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:s,type:zp.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(s,l),c.event}sendRequest(e){switch(e.type){case zp.Promise:case zp.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,v2.LocalSide,`${i$e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case zp.PromiseCancel:case zp.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,v2.LocalSide,i$e(e.type));return}}}send(e,t=void 0){const i=new A9t;return FDe(i,e),FDe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new S9t(e),i=ODe(t),s=ODe(t),o=i[0];switch(o){case Fg.Initialize:return this.logger?.logIncoming(e.byteLength,0,v2.LocalSide,n$e(o)),this.onResponse({type:i[0]});case Fg.PromiseSuccess:case Fg.PromiseError:case Fg.EventFire:case Fg.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],v2.LocalSide,n$e(o),s),this.onResponse({type:i[0],id:i[1],data:s})}}onResponse(e){if(e.type===Fg.Initialize){this.state=_2.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return T.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===_2.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),St(this.activeRequests.values()),this.activeRequests.clear()}}s$e.__decorator=D([ii],s$e.prototype,"onDidInitializePromise",null);var kM;(function(n){n.Created="created",n.Read="read",n.Write="write",n.Open="open",n.Error="error",n.Close="close",n.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",n.NodeEndReceived="nodeEndReceived",n.NodeEndSent="nodeEndSent",n.NodeDrainBegin="nodeDrainBegin",n.NodeDrainEnd="nodeDrainEnd",n.zlibInflateError="zlibInflateError",n.zlibInflateData="zlibInflateData",n.zlibInflateInitialWrite="zlibInflateInitialWrite",n.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",n.zlibInflateWrite="zlibInflateWrite",n.zlibInflateFlushFired="zlibInflateFlushFired",n.zlibDeflateError="zlibDeflateError",n.zlibDeflateData="zlibDeflateData",n.zlibDeflateWrite="zlibDeflateWrite",n.zlibDeflateFlushFired="zlibDeflateFlushFired",n.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",n.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",n.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",n.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",n.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",n.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",n.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",n.ProtocolHeaderRead="protocolHeaderRead",n.ProtocolMessageRead="protocolMessageRead",n.ProtocolHeaderWrite="protocolHeaderWrite",n.ProtocolMessageWrite="protocolMessageWrite",n.ProtocolWrite="protocolWrite"})(kM||(kM={}));var BDe;(function(n){n.enableDiagnostics=!1,n.records=[];const e=new WeakMap;let t=0;function i(o,r){if(!e.has(o)){const a=String(++t);e.set(o,a)}return e.get(o)}function s(o,r,a,c){if(!n.enableDiagnostics)return;const l=i(o);if(c instanceof ze||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=ze.alloc(c.byteLength);d.set(c),n.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else n.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}n.traceSocketEvent=s})(BDe||(BDe={}));var qne;(function(n){n[n.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",n[n.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(qne||(qne={}));let zpe=null;function GD(){return zpe||(zpe=ze.alloc(0)),zpe}class x9t{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(e){this._chunks.push(e),this._totalLength+=e.byteLength}read(e){return this._read(e,!0)}peek(e){return this._read(e,!1)}_read(e,t){if(e===0)return GD();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),r}if(this._chunks[0].byteLength>e){const r=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),r}const i=ze.alloc(e);let s=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,s),s+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,s),s+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var la;(function(n){n[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Control=2]="Control",n[n.Ack=3]="Ack",n[n.Disconnect=5]="Disconnect",n[n.ReplayRequest=6]="ReplayRequest",n[n.Pause=7]="Pause",n[n.Resume=8]="Resume",n[n.KeepAlive=9]="KeepAlive"})(la||(la={}));function iot(n){switch(n){case la.None:return"None";case la.Regular:return"Regular";case la.Control:return"Control";case la.Ack:return"Ack";case la.Disconnect:return"Disconnect";case la.ReplayRequest:return"ReplayRequest";case la.Pause:return"PauseWriting";case la.Resume:return"ResumeWriting";case la.KeepAlive:return"KeepAlive"}}var Wp;(function(n){n[n.HeaderLength=13]="HeaderLength",n[n.AcknowledgeTime=2e3]="AcknowledgeTime",n[n.TimeoutTime=2e4]="TimeoutTime",n[n.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",n[n.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",n[n.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(Wp||(Wp={}));class LC{constructor(e,t,i,s){this.type=e,this.id=t,this.ack=i,this.data=s,this.writtenTime=0}get size(){return this.data.byteLength}}class o$e extends ${constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Wp.HeaderLength,messageType:la.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new x9t,this._register(this._socket.onData(t=>this.acceptChunk(t))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){const t=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=t.readUInt32BE(9),this._state.messageType=t.readUInt8(0),this._state.id=t.readUInt32BE(1),this._state.ack=t.readUInt32BE(5),this._socket.traceSocketEvent(kM.ProtocolHeaderRead,{messageType:iot(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,s=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Wp.HeaderLength,this._state.messageType=la.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(kM.ProtocolMessageRead,t),this._onMessage.fire(new LC(i,s,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class r$e{constructor(e){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=e,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(e){if(this._isDisposed)return;e.writtenTime=Date.now(),this.lastWriteTime=Date.now();const t=ze.alloc(Wp.HeaderLength);t.writeUInt8(e.type,0),t.writeUInt32BE(e.id,1),t.writeUInt32BE(e.ack,5),t.writeUInt32BE(e.data.byteLength,9),this._socket.traceSocketEvent(kM.ProtocolHeaderWrite,{messageType:iot(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(kM.ProtocolMessageWrite,e.data),this._writeSoon(t,e.data)}_bufferAdd(e,t){const i=this._totalLength===0;return this._data.push(e,t),this._totalLength+=e.byteLength+t.byteLength,i}_bufferTake(){const e=ze.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,e}_writeSoon(e,t){this._bufferAdd(e,t)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const e=this._bufferTake();this._socket.traceSocketEvent(kM.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class FT{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new I({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(e){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(e):this._emitter.fire(e):this._bufferedMessages.push(e)}flushBuffer(){this._bufferedMessages=[]}}class D9t{constructor(e){this.data=e,this.next=null}}class k9t{constructor(){this._first=null,this._last=null}length(){let e=0,t=this._first;for(;t;)t=t.next,e++;return e}peek(){return this._first?this._first.data:null}toArray(){const e=[];let t=0,i=this._first;for(;i;)e[t++]=i.data,i=i.next;return e}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(e){const t=new D9t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const qm=class qm{static getInstance(){return qm._INSTANCE||(qm._INSTANCE=new qm),qm._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=qm._HISTORY_LENGTH;t>=1;t--)this.lastRuns[t]=this.lastRuns[t-1];this.lastRuns[0]=Date.now()},1e3)}load(){const e=Date.now(),t=(1+qm._HISTORY_LENGTH)*1e3;let i=0;for(let s=0;s=.5}};qm._HISTORY_LENGTH=10,qm._INSTANCE=null;let WDe=qm;class I9t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new FT,this.onControlMessage=this._onControlMessage.event,this._onMessage=new FT,this.onMessage=this._onMessage.event,this._onDidDispose=new FT,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new FT,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new FT,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??WDe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new k9t,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 Z,this._socket=e.socket,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(t=>this._receiveMessage(t))),this._socketDisposables.add(this._socket.onClose(t=>this._onSocketClose.fire(t))),e.initialChunk&&this._socketReader.acceptChunk(e.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},Wp.KeepAliveSendTime):this._keepAliveInterval=null}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(){const e=new LC(la.Disconnect,0,0,GD());this._socketWriter.write(e),this._socketWriter.flush()}sendPause(){const e=new LC(la.Pause,0,0,GD());this._socketWriter.write(e)}sendResume(){const e=new LC(la.Resume,0,0,GD());this._socketWriter.write(e)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(e,t){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new Z,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=e,this._socketWriter=this._socketDisposables.add(new r$e(this._socket)),this._socketReader=this._socketDisposables.add(new o$e(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(i=>this._receiveMessage(i))),this._socketDisposables.add(this._socket.onClose(i=>this._onSocketClose.fire(i))),this._socketReader.acceptChunk(t)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;ithis._outgoingAckId){this._outgoingAckId=e.ack;do{const t=this._outgoingUnackMsg.peek();if(t&&t.id<=e.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(e.type){case la.None:break;case la.Regular:{if(e.id>this._incomingMsgId)if(e.id!==this._incomingMsgId+1){const t=Date.now();t-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=t,this._socketWriter.write(new LC(la.ReplayRequest,0,0,GD())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case la.Control:{this._onControlMessage.fire(e.data);break}case la.Ack:break;case la.Disconnect:{this._onDidDispose.fire();break}case la.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,s=t.length;i=Wp.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Wp.AcknowledgeTime-e+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const e=this._outgoingUnackMsg.peek(),t=Date.now()-e.writtenTime,i=Date.now()-this._socketReader.lastReadTime,s=Date.now()-this._lastSocketTimeoutTime;if(t>=Wp.TimeoutTime&&i>=Wp.TimeoutTime&&s>=Wp.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(Wp.TimeoutTime-t,Wp.TimeoutTime-i,Wp.TimeoutTime-s,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new LC(la.Ack,0,this._incomingAckId,GD());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new LC(la.KeepAlive,0,this._incomingAckId,GD());this._socketWriter.write(e)}}const L9t=30*1e3;var IM;(function(n){n[n.Management=1]="Management",n[n.ExtensionHost=2]="ExtensionHost",n[n.Tunnel=3]="Tunnel"})(IM||(IM={}));function HDe(n){switch(n){case IM.Management:return"Management";case IM.ExtensionHost:return"ExtensionHost";case IM.Tunnel:return"Tunnel"}}function not(n){const e=new ai;return setTimeout(()=>e.cancel(),n),e.token}function T9t(n,e){if(n.isCancellationRequested||e.isCancellationRequested)return qe.Cancelled;const t=new ai;return n.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Vhe{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=NU(),e.isCancellationRequested?this._timeout():this._disposables.add(e.onCancellationRequested(()=>this._timeout()))}registerDisposable(e){this._state==="pending"?this._disposables.add(e):e.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const e=new Error("Time limit reached");return e.code="ETIMEDOUT",e.syscall="connect",e}resolve(e){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(e))}reject(e){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(e))}}function R9t(n,e){const t=new Vhe(e);return t.registerDisposable(n.onControlMessage(i=>{const s=JSON.parse(i.toString()),o=rot(s);o?t.reject(o):t.resolve(s)})),t.promise}function M9t(n,e,t,i,s,o,r,a){const c=new Vhe(a),l=ao.create(!1);return n.info(`Creating a socket (${r})...`),vs(`code/willCreateSocket/${o}`),e.connect(t,i,s,r).then(d=>{c.didTimeout?(vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(vs(`code/didCreateSocketOK/${o}`),n.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{vs(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),n.error(d),c.reject(d)}),c.promise}function $pe(n,e){const t=new Vhe(e);return n.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function N9t(n,e,t,i){const s=aot(n,e);n.logService.trace(`${s} 1/6. invoking socketFactory.connect().`);let o;try{o=await M9t(n.logService,n.remoteSocketFactoryService,n.connectTo,T9.getServerRootPath(),`reconnectionToken=${n.reconnectionToken}&reconnection=${n.reconnectionProtocol?"true":"false"}`,HDe(e),`renderer-${HDe(e)}-${n.reconnectionToken}`,i)}catch(d){throw n.logService.error(`${s} socketFactory.connect() failed or timed out. Error:`),n.logService.error(d),d}n.logService.trace(`${s} 2/6. socketFactory.connect() was successful.`);let r,a;n.reconnectionProtocol?(n.reconnectionProtocol.beginAcceptReconnection(o,null),r=n.reconnectionProtocol,a=!1):(r=new I9t({socket:o}),a=!0),n.logService.trace(`${s} 3/6. sending AuthRequest control message.`);const c=await $pe(n.signService.createNewMessage(Dr()),i),l={type:"auth",auth:n.connectionToken||"00000000000000000000",data:c.data};r.sendControl(ze.fromString(JSON.stringify(l)));try{const d=await R9t(r,T9t(i,not(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(n.logService.trace(`${s} 4/6. received SignRequest control message.`),!await $pe(n.signService.validate(c,d.signedData),i)){const p=new Error("Refused to connect to unsupported server");throw p.code="VSCODE_CONNECTION_ERROR",p}const u=await $pe(n.signService.sign(d.data),i),f={type:"connectionType",commit:n.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),n.logService.trace(`${s} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl(ze.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(n.logService.error(`${s} the handshake timed out. Error:`),n.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(n.logService.error(`${s} received error control message when negotiating connection. Error:`),n.logService.error(d)),a&&uOe(r),d}}async function P9t(n,e,t,i){const s=Date.now(),o=aot(n,e),{protocol:r,ownsProtocol:a}=await N9t(n,e,t,i),c=new Vhe(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=rot(d);h?(n.logService.error(`${o} received error control message when negotiating connection. Error:`),n.logService.error(h),a&&uOe(r),c.reject(h)):(n.reconnectionProtocol?.endAcceptReconnection(),n.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${q9t(s)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function sot(n,e,t){const{protocol:i,firstMessage:s}=await P9t(n,IM.ExtensionHost,e,t),o=s&&s.debugPort;return{protocol:i,debugPort:o}}async function oot(n,e,t){const{connectTo:i,connectionToken:s}=await n.addressProvider.getAddress();return{commit:n.commit,quality:n.quality,connectTo:i,connectionToken:s,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:n.remoteSocketFactoryService,signService:n.signService,logService:n.logService}}async function F9t(n,e){return O9t(n,async t=>{const{protocol:i,debugPort:s}=await sot(t,e,qe.None);return new z9t(n,e,t.reconnectionToken,i,s)})}async function O9t(n,e){for(let i=1;;i++)try{const s=Dr(),o=await oot(n,s,null);return await e(o)}catch(s){if(i<5)n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),n.logService.error(s);else throw n.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),n.logService.error(s),Qne.triggerPermanentFailure(0,0,HI.isHandled(s)),s}}function B9t(n){return na(e=>new Promise((t,i)=>{const s=setTimeout(t,n*1e3);e.onCancellationRequested(()=>{clearTimeout(s),t()})}))}var $1;(function(n){n[n.ConnectionLost=0]="ConnectionLost",n[n.ReconnectionWait=1]="ReconnectionWait",n[n.ReconnectionRunning=2]="ReconnectionRunning",n[n.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",n[n.ConnectionGain=4]="ConnectionGain"})($1||($1={}));class W9t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=$1.ConnectionLost}}class H9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=s,this.type=$1.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class U9t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ReconnectionRunning}}class a$e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=$1.ConnectionGain}}class V9t{constructor(e,t,i,s){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=s,this.type=$1.ReconnectionPermanentFailure}}const Ff=class Ff extends ${static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(s=>s._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}get _isPermanentFailure(){return this._permanentFailure||Ff._permanentFailure}constructor(e,t,i,s,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=s,this._reconnectionFailureIsFatal=o,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new a$e(this.reconnectionToken,0,0)),this._register(s.onSocketClose(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);r?r.type===qne.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${r.hadError}).`),r.error&&this._options.logService.error(r.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${r.wasClean}, code: ${r.code}, reason: ${r.reason}).`),r.event&&this._options.logService.error(r.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(s.onSocketTimeout(r=>{const a=SX(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${r.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${r.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${r.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Ff._instances.push(this),this._register(Ee(()=>{const r=Ff._instances.indexOf(this);r>=0&&Ff._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Ff._permanentFailureMillisSinceLastIncomingData,Ff._permanentFailureAttempt,Ff._permanentFailureHandled)}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;const e=SX(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 W9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const s=i0){const r=B9t(s);this._onDidStateChange.fire(new H9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s,r)),this._options.logService.info(`${e} waiting for ${s} seconds before reconnecting...`);try{await r}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new U9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await oot(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,not(L9t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new a$e(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(o){if(o.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(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(i>360){this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(HI.isTemporarilyNotAvailable(o)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if((o.code==="ETIMEDOUT"||o.code==="ENETUNREACH"||o.code==="ECONNREFUSED"||o.code==="ECONNRESET")&&o.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(Na(o)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(o);continue}if(o instanceof HI){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,HI.isHandled(o));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(o),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?Ff.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new V9t(this.reconnectionToken,e,t,i)),uOe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Ff._permanentFailure=!1,Ff._permanentFailureMillisSinceLastIncomingData=0,Ff._permanentFailureAttempt=0,Ff._permanentFailureHandled=!1,Ff._instances=[];let Qne=Ff;class z9t extends Qne{constructor(e,t,i,s,o){super(IM.ExtensionHost,e,i,s,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await sot(e,this._startArguments,t)}}function uOe(n){try{n.acceptDisconnect();const e=n.getSocket();n.dispose(),e.dispose()}catch(e){bt(e)}}function rot(n){if(n&&n.type==="error"){const e=new Error(`Connection error: ${n.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function $9t(n,e){for(;n.length"u"&&(l=Dr(),this._storageService.store(c,l,ke.WORKSPACE,ln.MACHINE));const d=await Fht(yi.origin,l),h=o.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",r).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",yi.origin),u.searchParams.set("salt",l),u.toString()}}return`${lp.asBrowserUri(i).toString(!0)}${t}`}async start(){return this._protocolPromise||(this._protocolPromise=this._startInsideIframe(),this._protocolPromise.then(e=>this._protocol=e)),this._protocolPromise}async _startInsideIframe(){const e=await this._getWebWorkerExtensionHostIframeSrc(),t=this._register(new I),i=document.createElement("iframe");i.setAttribute("class","web-worker-ext-host-iframe"),i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("allow","usb; serial; hid; cross-origin-isolated;"),i.setAttribute("aria-hidden","true"),i.style.display="none";const s=Dr();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${s}`);const o=new Uh;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,bt(a),clearTimeout(l),this._onDidExit.fire([u8.UnexpectedError,a.message]),o.open()},h=p=>{r=p,clearTimeout(l),o.open()};if(l=setTimeout(()=>{console.warn("The Web Worker Extension Host did not start in 60s, that might be a problem.")},6e4),this._register(pe(yi,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==s)return;if(p.data.error){const{name:v,message:w,stack:b}=p.data.error,C=new Error;return C.message=w,C.name=v,C.stack=b,d(u8.UnexpectedError,C)}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(u8.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await o.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),r.onmessage=p=>{const{data:m}=p;if(!(m instanceof ArrayBuffer)){console.warn("UNKNOWN data received",m),this._onDidExit.fire([77,"UNKNOWN data received"]);return}t.fire(ze.wrap(new Uint8Array(m,0,m.byteLength)))};const f={onMessage:t.event,send:p=>{const m=p.buffer.buffer.slice(p.buffer.byteOffset,p.buffer.byteOffset+p.buffer.byteLength);r.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await T.toPromise(T.filter(e.onMessage,t=>jne(t,Cm.Ready))),this._isTerminating||(e.send(ze.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await T.toPromise(T.filter(e.onMessage,t=>jne(t,Cm.Initialized))),this._isTerminating))throw rx();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(cot(Cm.Terminate)),super.dispose())}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i&&this._productService.commit&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?void 0:{configuration:t.configuration||void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:this.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===Wx.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}};Kne=D([_(3,rn),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,V_),_(10,Ja),_(11,bg),_(12,on)],Kne);class Q9t{constructor(){this.capabilities=es.Readonly+es.FileReadWrite+es.PathCaseSensitive,this.onDidChangeCapabilities=T.None,this.onDidChangeFile=T.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw xs(t.statusText,rt.Unknown)}catch(t){throw xs(t,rt.Unknown)}}async stat(e){return{type:an.File,size:0,mtime:0,ctime:0}}watch(){return $.None}writeFile(e,t,i){throw new tE}readdir(e){throw new tE}mkdir(e){throw new tE}delete(e,t){throw new tE}rename(e,t,i){throw new tE}}var UDe={exports:{}},Gpe={};(function(n,e){e=n.exports=Qn;var t;typeof process=="object"&&Gpe&&Gpe.NODE_DEBUG&&/\bsemver\b/i.test(Gpe.NODE_DEBUG)?t=function(){var G=Array.prototype.slice.call(arguments,0);G.unshift("SEMVER"),console.log.apply(console,G)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,r=e.re=[],a=e.src=[],c=0,l=c++;a[l]="0|[1-9]\\d*";var d=c++;a[d]="[0-9]+";var h=c++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=c++;a[u]="("+a[l]+")\\.("+a[l]+")\\.("+a[l]+")";var f=c++;a[f]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var p=c++;a[p]="(?:"+a[l]+"|"+a[h]+")";var m=c++;a[m]="(?:"+a[d]+"|"+a[h]+")";var v=c++;a[v]="(?:-("+a[p]+"(?:\\."+a[p]+")*))";var w=c++;a[w]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var b=c++;a[b]="[0-9A-Za-z-]+";var C=c++;a[C]="(?:\\+("+a[b]+"(?:\\."+a[b]+")*))";var y=c++,S="v?"+a[u]+a[v]+"?"+a[C]+"?";a[y]="^"+S+"$";var M="[v=\\s]*"+a[f]+a[w]+"?"+a[C]+"?",k=c++;a[k]="^"+M+"$";var F=c++;a[F]="((?:<|>)?=?)";var N=c++;a[N]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var U=c++;a[U]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[C]+"?)?)?";var J=c++;a[J]="[v=\\s]*("+a[N]+")(?:\\.("+a[N]+")(?:\\.("+a[N]+")(?:"+a[w]+")?"+a[C]+"?)?)?";var j=c++;a[j]="^"+a[F]+"\\s*"+a[U]+"$";var re=c++;a[re]="^"+a[F]+"\\s*"+a[J]+"$";var me=c++;a[me]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Qe=c++;a[Qe]="(\\s*)"+a[De]+"\\s+",r[Qe]=new RegExp(a[Qe],"g");var Tt="$1~",Oe=c++;a[Oe]="^"+a[De]+a[U]+"$";var wt=c++;a[wt]="^"+a[De]+a[J]+"$";var Nt=c++;a[Nt]="(?:\\^)";var Ji=c++;a[Ji]="(\\s*)"+a[Nt]+"\\s+",r[Ji]=new RegExp(a[Ji],"g");var Vi="$1^",Gn=c++;a[Gn]="^"+a[Nt]+a[U]+"$";var Ro=c++;a[Ro]="^"+a[Nt]+a[J]+"$";var qn=c++;a[qn]="^"+a[F]+"\\s*("+M+")$|^$";var ec=c++;a[ec]="^"+a[F]+"\\s*("+S+")$|^$";var ys=c++;a[ys]="(\\s*)"+a[F]+"\\s*("+M+"|"+a[U]+")",r[ys]=new RegExp(a[ys],"g");var mr="$1$2$3",ba=c++;a[ba]="^\\s*("+a[U]+")\\s+-\\s+("+a[U]+")\\s*$";var ki=c++;a[ki]="^\\s*("+a[J]+")\\s+-\\s+("+a[J]+")\\s*$";var gs=c++;a[gs]="(<|>)?=?\\s*\\*";for(var ir=0;iri)return null;var L=de?r[k]:r[y];if(!L.test(G))return null;try{return new Qn(G,de)}catch{return null}}e.valid=vc;function vc(G,de){var L=Hn(G,de);return L?L.version:null}e.clean=gh;function gh(G,de){var L=Hn(G.trim().replace(/^[=v]+/,""),de);return L?L.version:null}e.SemVer=Qn;function Qn(G,de){if(G instanceof Qn){if(G.loose===de)return G;G=G.version}else if(typeof G!="string")throw new TypeError("Invalid Version: "+G);if(G.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Qn))return new Qn(G,de);t("SemVer",G,de),this.loose=de;var L=G.trim().match(de?r[k]:r[y]);if(!L)throw new TypeError("Invalid Version: "+G);if(this.raw=G,this.major=+L[1],this.minor=+L[2],this.patch=+L[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");L[4]?this.prerelease=L[4].split(".").map(function(ne){if(/^[0-9]+$/.test(ne)){var R=+ne;if(R>=0&&R=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);L===-1&&this.prerelease.push(0)}de&&(this.prerelease[0]===de?isNaN(this.prerelease[1])&&(this.prerelease=[de,0]):this.prerelease=[de,0]);break;default:throw new Error("invalid increment argument: "+G)}return this.format(),this.raw=this.version,this},e.inc=Yh;function Yh(G,de,L,ne){typeof L=="string"&&(ne=L,L=void 0);try{return new Qn(G,L).inc(de,ne).version}catch{return null}}e.diff=tl;function tl(G,de){if(Ld(G,de))return null;var L=Hn(G),ne=Hn(de);if(L.prerelease.length||ne.prerelease.length){for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return"pre"+R;return"prerelease"}for(var R in L)if((R==="major"||R==="minor"||R==="patch")&&L[R]!==ne[R])return R}e.compareIdentifiers=to;var Tl=/^[0-9]+$/;function to(G,de){var L=Tl.test(G),ne=Tl.test(de);return L&&ne&&(G=+G,de=+de),L&&!ne?-1:ne&&!L?1:Gde?1:0}e.rcompareIdentifiers=Fc;function Fc(G,de){return to(de,G)}e.major=rd;function rd(G,de){return new Qn(G,de).major}e.minor=Jh;function Jh(G,de){return new Qn(G,de).minor}e.patch=Af;function Af(G,de){return new Qn(G,de).patch}e.compare=il;function il(G,de,L){return new Qn(G,L).compare(new Qn(de,L))}e.compareLoose=Rl;function Rl(G,de){return il(G,de,!0)}e.rcompare=Xh;function Xh(G,de,L){return il(de,G,L)}e.sort=ul;function ul(G,de){return G.sort(function(L,ne){return e.compare(L,ne,de)})}e.rsort=ad;function ad(G,de){return G.sort(function(L,ne){return e.rcompare(L,ne,de)})}e.gt=wc;function wc(G,de,L){return il(G,de,L)>0}e.lt=Ca;function Ca(G,de,L){return il(G,de,L)<0}e.eq=Ld;function Ld(G,de,L){return il(G,de,L)===0}e.neq=fh;function fh(G,de,L){return il(G,de,L)!==0}e.gte=Fu;function Fu(G,de,L){return il(G,de,L)>=0}e.lte=bc;function bc(G,de,L){return il(G,de,L)<=0}e.cmp=Zh;function Zh(G,de,L,ne){var R;switch(de){case"===":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G===L;break;case"!==":typeof G=="object"&&(G=G.version),typeof L=="object"&&(L=L.version),R=G!==L;break;case"":case"=":case"==":R=Ld(G,L,ne);break;case"!=":R=fh(G,L,ne);break;case">":R=wc(G,L,ne);break;case">=":R=Fu(G,L,ne);break;case"<":R=Ca(G,L,ne);break;case"<=":R=bc(G,L,ne);break;default:throw new TypeError("Invalid operator: "+de)}return R}e.Comparator=Cc;function Cc(G,de){if(G instanceof Cc){if(G.loose===de)return G;G=G.value}if(!(this instanceof Cc))return new Cc(G,de);t("comparator",G,de),this.loose=de,this.parse(G),this.semver===nr?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var nr={};Cc.prototype.parse=function(G){var de=this.loose?r[qn]:r[ec],L=G.match(de);if(!L)throw new TypeError("Invalid comparator: "+G);this.operator=L[1],this.operator==="="&&(this.operator=""),L[2]?this.semver=new Qn(L[2],this.loose):this.semver=nr},Cc.prototype.toString=function(){return this.value},Cc.prototype.test=function(G){return t("Comparator.test",G,this.loose),this.semver===nr?!0:(typeof G=="string"&&(G=new Qn(G,this.loose)),Zh(G,this.operator,this.semver,this.loose))},Cc.prototype.intersects=function(G,de){if(!(G instanceof Cc))throw new TypeError("a Comparator is required");var L;if(this.operator==="")return L=new Rs(G.value,de),Ou(this.value,L,de);if(G.operator==="")return L=new Rs(this.value,de),Ou(G.semver,L,de);var ne=(this.operator===">="||this.operator===">")&&(G.operator===">="||G.operator===">"),R=(this.operator==="<="||this.operator==="<")&&(G.operator==="<="||G.operator==="<"),H=this.semver.version===G.semver.version,ie=(this.operator===">="||this.operator==="<=")&&(G.operator===">="||G.operator==="<="),je=Zh(this.semver,"<",G.semver,de)&&(this.operator===">="||this.operator===">")&&(G.operator==="<="||G.operator==="<"),pt=Zh(this.semver,">",G.semver,de)&&(this.operator==="<="||this.operator==="<")&&(G.operator===">="||G.operator===">");return ne||R||H&&ie||je||pt},e.Range=Rs;function Rs(G,de){if(G instanceof Rs)return G.loose===de?G:new Rs(G.raw,de);if(G instanceof Cc)return new Rs(G.value,de);if(!(this instanceof Rs))return new Rs(G,de);if(this.loose=de,this.raw=G,this.set=G.split(/\s*\|\|\s*/).map(function(L){return this.parseRange(L.trim())},this).filter(function(L){return L.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+G);this.format()}Rs.prototype.format=function(){return this.range=this.set.map(function(G){return G.join(" ").trim()}).join("||").trim(),this.range},Rs.prototype.toString=function(){return this.range},Rs.prototype.parseRange=function(G){var de=this.loose;G=G.trim(),t("range",G,de);var L=de?r[ki]:r[ba];G=G.replace(L,ya),t("hyphen replace",G),G=G.replace(r[ys],mr),t("comparator trim",G,r[ys]),G=G.replace(r[Qe],Tt),G=G.replace(r[Ji],Vi),G=G.split(/\s+/).join(" ");var ne=de?r[qn]:r[ec],R=G.split(" ").map(function(H){return Se(H,de)}).join(" ").split(/\s+/);return this.loose&&(R=R.filter(function(H){return!!H.match(ne)})),R=R.map(function(H){return new Cc(H,de)}),R},Rs.prototype.intersects=function(G,de){if(!(G instanceof Rs))throw new TypeError("a Range is required");return this.set.some(function(L){return L.every(function(ne){return G.set.some(function(R){return R.every(function(H){return ne.intersects(H,de)})})})})},e.toComparators=Ml;function Ml(G,de){return new Rs(G,de).set.map(function(L){return L.map(function(ne){return ne.value}).join(" ").trim().split(" ")})}function Se(G,de){return t("comp",G),G=Le(G,de),t("caret",G),G=cd(G,de),t("tildes",G),G=ts(G,de),t("xrange",G),G=sr(G,de),t("stars",G),G}function Mo(G){return!G||G.toLowerCase()==="x"||G==="*"}function cd(G,de){return G.trim().split(/\s+/).map(function(L){return K(L,de)}).join(" ")}function K(G,de){var L=de?r[wt]:r[Oe];return G.replace(L,function(ne,R,H,ie,je){t("tilde",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":je?(t("replaceTilde pr",je),je.charAt(0)!=="-"&&(je="-"+je),pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0"):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0",t("tilde return",pt),pt})}function Le(G,de){return G.trim().split(/\s+/).map(function(L){return ri(L,de)}).join(" ")}function ri(G,de){t("caret",G,de);var L=de?r[Ro]:r[Gn];return G.replace(L,function(ne,R,H,ie,je){t("caret",G,ne,R,H,ie,je);var pt;return Mo(R)?pt="":Mo(H)?pt=">="+R+".0.0 <"+(+R+1)+".0.0":Mo(ie)?R==="0"?pt=">="+R+"."+H+".0 <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+".0 <"+(+R+1)+".0.0":je?(t("replaceCaret pr",je),je.charAt(0)!=="-"&&(je="-"+je),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+je+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+je+" <"+(+R+1)+".0.0"):(t("no pr"),R==="0"?H==="0"?pt=">="+R+"."+H+"."+ie+" <"+R+"."+H+"."+(+ie+1):pt=">="+R+"."+H+"."+ie+" <"+R+"."+(+H+1)+".0":pt=">="+R+"."+H+"."+ie+" <"+(+R+1)+".0.0"),t("caret return",pt),pt})}function ts(G,de){return t("replaceXRanges",G,de),G.split(/\s+/).map(function(L){return Os(L,de)}).join(" ")}function Os(G,de){G=G.trim();var L=de?r[re]:r[j];return G.replace(L,function(ne,R,H,ie,je,pt){t("xRange",G,ne,R,H,ie,je,pt);var is=Mo(H),Ss=is||Mo(ie),ld=Ss||Mo(je),Eg=ld;return R==="="&&Eg&&(R=""),is?R===">"||R==="<"?ne="<0.0.0":ne="*":R&&Eg?(Ss&&(ie=0),ld&&(je=0),R===">"?(R=">=",Ss?(H=+H+1,ie=0,je=0):ld&&(ie=+ie+1,je=0)):R==="<="&&(R="<",Ss?H=+H+1:ie=+ie+1),ne=R+H+"."+ie+"."+je):Ss?ne=">="+H+".0.0 <"+(+H+1)+".0.0":ld&&(ne=">="+H+"."+ie+".0 <"+H+"."+(+ie+1)+".0"),t("xRange return",ne),ne})}function sr(G,de){return t("replaceStars",G,de),G.trim().replace(r[gs],"")}function ya(G,de,L,ne,R,H,ie,je,pt,is,Ss,ld,Eg){return Mo(L)?de="":Mo(ne)?de=">="+L+".0.0":Mo(R)?de=">="+L+"."+ne+".0":de=">="+de,Mo(pt)?je="":Mo(is)?je="<"+(+pt+1)+".0.0":Mo(Ss)?je="<"+pt+"."+(+is+1)+".0":ld?je="<="+pt+"."+is+"."+Ss+"-"+ld:je="<="+je,(de+" "+je).trim()}Rs.prototype.test=function(G){if(!G)return!1;typeof G=="string"&&(G=new Qn(G,this.loose));for(var de=0;de0){var ne=G[L].semver;if(ne.major===de.major&&ne.minor===de.minor&&ne.patch===de.patch)return!0}return!1}return!0}e.satisfies=Ou;function Ou(G,de,L){try{de=new Rs(de,L)}catch{return!1}return de.test(G)}e.maxSatisfying=le;function le(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===-1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.minSatisfying=_r;function _r(G,de,L){var ne=null,R=null;try{var H=new Rs(de,L)}catch{return null}return G.forEach(function(ie){H.test(ie)&&(!ne||R.compare(ie)===1)&&(ne=ie,R=new Qn(ne,L))}),ne}e.validRange=No;function No(G,de){try{return new Rs(G,de).range||"*"}catch{return null}}e.ltr=mn;function mn(G,de,L){return ct(G,de,"<",L)}e.gtr=ve;function ve(G,de,L){return ct(G,de,">",L)}e.outside=ct;function ct(G,de,L,ne){G=new Qn(G,ne),de=new Rs(de,ne);var R,H,ie,je,pt;switch(L){case">":R=wc,H=bc,ie=Ca,je=">",pt=">=";break;case"<":R=Ca,H=Fu,ie=wc,je="<",pt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ou(G,de,ne))return!1;for(var is=0;is=0.0.0")),ld=ld||Bw,Eg=Eg||Bw,R(Bw.semver,ld.semver,ne)?ld=Bw:ie(Bw.semver,Eg.semver,ne)&&(Eg=Bw)}),ld.operator===je||ld.operator===pt||(!Eg.operator||Eg.operator===je)&&H(G,Eg.semver))return!1;if(Eg.operator===pt&&ie(G,Eg.semver))return!1}return!0}e.prerelease=Ht;function Ht(G,de){var L=Hn(G,de);return L&&L.prerelease.length?L.prerelease:null}e.intersects=Ei;function Ei(G,de,L){return G=new Rs(G,L),de=new Rs(de,L),G.intersects(de)}e.coerce=Ut;function Ut(G){if(G instanceof Qn)return G;if(typeof G!="string")return null;var de=G.match(r[me]);return de==null?null:Hn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(UDe,UDe.exports);var JV=UDe.exports;const iY="vs/workbench/services/extensions/common/extensionsUtil";function j9t(n,e,t,i,s){const o=new $a;return n.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),e.forEach(r=>{const a=o.get(r.identifier);if(a)if(a.isBuiltin){if(JV.gte(a.version,r.version)){s.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else s.warn(g(iY,0,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){s.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&s.warn(g(iY,1,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{s.info(g(iY,2,"Loading development extension at {0}",r.extensionLocation.fsPath));const a=o.get(r.identifier);a&&a.isBuiltin&&(r.isBuiltin=!0),o.set(r.identifier,r)}),Array.from(o.values())}let VDe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=s,this._environmentService=o,this._telemetryService=r,this._logService=a,this._loggerService=c,this._labelService=l,this.remoteAuthorityResolverService=d,this._extensionHostDebugService=h,this._productService=u,this._signService=f,this.pid=null,this.startup=Wx.EagerAutoStart,this.extensions=null,this._onExit=this._register(new I),this.onExit=this._onExit.event,this.remoteAuthority=this._initDataProvider.remoteAuthority,this._protocol=null,this._hasLostConnection=!1,this._terminating=!1;const p=dOe(this._environmentService);this._isExtensionDevHost=p.isExtensionDevHost}start(){const e={commit:this._productService.commit,quality:this._productService.quality,addressProvider:{getAddress:async()=>{const{authority:t}=await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);return{connectTo:t.connectTo,connectionToken:t.connectionToken}}},remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this._signService,logService:this._logService,ipcLogger:null};return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then(t=>{const i={language:Gd,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},s=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return s&&s.length>0&&s[0].scheme===_e.file&&(o=!1),o||(i.break=!1),F9t(e,i).then(r=>{this._register(r);const{protocol:a,debugPort:c,reconnectionToken:l}=r,d=typeof c=="number";return o&&this._environmentService.isExtensionDevelopment&&this._environmentService.debugExtensionHost.debugId&&c&&this._extensionHostDebugService.attachSession(this._environmentService.debugExtensionHost.debugId,c,this._initDataProvider.remoteAuthority),a.onDidDispose(()=>{this._onExtHostConnectionLost(l)}),a.onSocketClose(()=>{this._isExtensionDevHost&&this._onExtHostConnectionLost(l)}),new Promise((h,u)=>{const f=setTimeout(()=>{u("The remote extension host took longer than 60s to send its ready message.")},6e4),p=a.onMessage(m=>{if(jne(m,Cm.Ready)){this._createExtHostInitData(d).then(v=>{a.send(ze.fromString(JSON.stringify(v)))});return}if(jne(m,Cm.Initialized)){clearTimeout(f),p.dispose(),this._protocol=a,h(a);return}console.error("received unexpected message during handshake phase from the extension host: ",m)})})})})}_onExtHostConnectionLost(e){this._hasLostConnection||(this._hasLostConnection=!0,this._isExtensionDevHost&&this._environmentService.debugExtensionHost.debugId&&this._extensionHostDebugService.close(this._environmentService.debugExtensionHost.debugId),!this._terminating&&this._onExit.fire([0,e]))}async _createExtHostInitData(e){const t=await this._initDataProvider.getInitData();this.extensions=t.extensions;const i=this._contextService.getWorkspace();return{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:t.pid,environment:{isExtensionDevelopmentDebug:e,appRoot:t.appRoot,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier||"desktop",appUriScheme:this._productService.urlProtocol,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),appLanguage:Gd,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:i.configuration,id:i.id,name:this._labelService.getWorkspaceLabel(i),transient:i.transient},remote:{isRemote:!0,authority:this._initDataProvider.remoteAuthority,connectionData:t.connectionData},consoleForward:{includeStack:!1,logNative:!!this._environmentService.debugExtensionHost.debugId},extensions:this.extensions.toSnapshot(),telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:t.extensionHostLogsPath,autoStart:this.startup===Wx.EagerAutoStart,uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(cot(Cm.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};VDe=D([_(2,CPe),_(3,Ti),_(4,Za),_(5,rn),_(6,Ze),_(7,wp),_(8,eo),_(9,rA),_(10,kZe),_(11,Ja),_(12,MZe)],VDe);var zDe;let $De=class extends TDe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k,F,N){super(e,t,i,s,o,r,a,c,l,d,h,u,f,p,v,w,b,C,y,N),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=S,this._userDataProfileService=M,this._workspaceTrustManagementService=k,this._remoteExplorerService=F,C.when(Us.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}async _scanSingleExtension(e){if(e.location.scheme===_e.vscodeRemote)return this._remoteExtensionsScannerService.scanSingleExtension(e.location,e.type===qr.System);const t=await this._webExtensionsScannerService.scanExistingExtension(e.location,e.type,this._userDataProfileService.currentProfile.extensionsResource);return t?ME(t):null}_initFetchFileSystem(){const e=new Q9t;this._register(this._fileService.registerProvider(_e.http,e)),this._register(this._fileService.registerProvider(_e.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(s=>e.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(s=>t.push(...s.map(o=>ME(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(s=>i.push(...s.map(o=>ME(o,!0))))])}catch(s){this._logService.error(s)}return j9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new c9t(e,t,!1,!0)}async _resolveExtensions(){if(!this._browserEnvironmentService.expectsResolverExtension)return this._resolveExtensionsDefault();const e=this._environmentService.remoteAuthority;await this._workspaceTrustManagementService.workspaceResolved;let t;try{t=await this._resolveAuthorityInitial(e)}catch(s){return HI.isHandled(s)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,s),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async s=>{s.type===$1.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=yi;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await C9t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(Ao.LocalWebWorker,e)}};$De=D([_(3,be),_(4,Pi),_(5,Ow),_(6,rn),_(7,Kh),_(8,ci),_(9,Ja),_(10,the),_(11,Ti),_(12,Re),_(13,G_),_(14,FPe),_(15,Ze),_(16,Sf),_(17,Gde),_(18,mg),_(19,rA),_(20,ahe),_(21,Tm),_(22,oA),_(23,she),_(24,To)],$De);let GDe=class{constructor(e,t,i,s,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=s,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case Ao.LocalProcess:return null;case Ao.LocalWebWorker:{const s=i?Wx.EagerManualStart:Wx.EagerAutoStart;return this._instantiationService.createInstance(Kne,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case Ao.Remote:{const s=this._remoteAgentService.getConnection();return s?this._instantiationService.createInstance(VDe,t,this._createRemoteExtensionHostDataProvider(e,s.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const s=RDe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(s,[],!1),r=CX(s,o,c=>t.equals(c));return{extensions:new xJ(0,s,r.map(c=>c.identifier))}}else{const s=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(s.extensions,t);return{extensions:new xJ(s.versionId,s.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),s=await this._remoteAgentService.getEnvironment();if(!s)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,Ao.Remote),r=new xJ(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:s.pid,appRoot:s.appRoot,extensionHostLogsPath:s.extensionHostLogsPath,globalStorageHome:s.globalStorageHome,workspaceStorageHome:s.workspaceStorageHome,extensions:r}}}}};GDe=D([_(3,be),_(4,Sf),_(5,rA),_(6,Kh),_(7,Ze)],GDe);let qDe=zDe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,s,o){const r=zDe.pickRunningLocation(t,i,s,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${s}, preference: ${D8t(o)} => ${hE(r)}`),r}static pickRunningLocation(e,t,i,s){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(s===rp.Remote)return Ao.Remote;r=!0}if(a==="workspace"&&i){if(s===rp.None||s===rp.Remote)return Ao.Remote;o.push(Ao.Remote)}if(a==="web"&&(t||i)){if(s===rp.None||s===rp.Local)return Ao.LocalWebWorker;o.push(Ao.LocalWebWorker)}}return r&&o.push(Ao.Remote),o.length>0?o[0]:null}};qDe=zDe=D([_(0,Ze)],qDe);async function K9t(n,e,t){let i=t&&t.get("storage.serviceMachineId",ke.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(n.serviceMachineIdResource)).value.toString();i=xDt(o)?o:null}catch{i=null}if(!i){i=Dr();try{await e.writeFile(n.serviceMachineIdResource,ze.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,ke.APPLICATION,ln.MACHINE),i}const Y9t="/web-extension-resource/";class J9t{constructor(e,t,i,s,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=s,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(P.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:s},o){if(this._extensionGalleryResourceUrlTemplate){const r=P.parse(w_e(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:s!==void 0&&s!==Hs.UNDEFINED&&s!==Hs.UNKNOWN&&s!==Hs.UNIVERSAL?`${i}+${s}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:T9.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Jn?"-web":""}`,"X-Client-Version":this._productService.version};return EJ(this._productService,this._environmentService)&&vTt(this._configurationService)===sp.USAGE&&(e["X-Machine-Id"]=await this._getServiceMachineId()),this._productService.commit&&(e["X-Client-Commit"]=this._productService.commit),e}_getServiceMachineId(){return this._serviceMachineIdPromise||(this._serviceMachineIdPromise=K9t(this._environmentService,this._fileService,this._storageService)),this._serviceMachineIdPromise}_getExtensionGalleryAuthority(e){if(this._isWebExtensionResourceEndPoint(e))return e.authority;const t=e.authority.indexOf(".");return t!==-1?e.authority.substring(t+1):void 0}_isWebExtensionResourceEndPoint(e){const t=e.path,i=T9.getServerRootPath();return t.startsWith(i)&&t.startsWith(Y9t,i.length)}}let QDe=class extends J9t{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._logService=r}async readExtensionResource(e){if(e=lp.uriToBrowserUri(e),e.scheme!==_e.http&&e.scheme!==_e.https&&e.scheme!==_e.data)return(await this._fileService.readFile(e)).value.toString();const t={};this.isExtensionGalleryResource(e)&&(t.headers=await this.getExtensionGalleryRequestHeaders(),t.mode="cors");const i=await fetch(e.toString(!0),t);if(i.status!==200)throw this._logService.info(`Request to '${e.toString(!0)}' failed with status code ${i.status}`),new Error(i.statusText);return i.text()}};QDe=D([_(0,ci),_(1,on),_(2,Ja),_(3,Il),_(4,Re),_(5,Ze)],QDe);var RB,jDe;const pl="vs/workbench/services/extensionManagement/browser/extensionBisect";class g8{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new g8(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,s=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=s}}var kP;let KDe=(kP=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const s=t.get(RB._storageKey,ke.APPLICATION);if(this._state=g8.fromJSON(s),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&agc({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(s=>s.identifier.id),i=new g8(t,0,t.length,0);this._storageService.store(RB._storageKey,JSON.stringify(i),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async next(e){if(!this._state)throw new Error("invalid state");if(e&&this._state.mid===0&&this._state.high===this._state.extensions.length)return{bad:!0,id:""};if(this._state.low===this._state.high-1)return await this.reset(),{id:this._state.extensions[this._state.low],bad:e};const t=new g8(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(RB._storageKey,JSON.stringify(t),ke.APPLICATION,ln.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(RB._storageKey,ke.APPLICATION),await this._storageService.flush()}},RB=kP,kP._storageKey="extensionBisectState",kP);KDe=RB=D([_(0,Ze),_(1,on),_(2,Za)],KDe);var IP;let XV=(IP=class{constructor(e,t,i,s){this._extensionBisectService=t,this._notificationService=i,this._commandService=s,t.isActive&&(jDe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(pl,0,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(pl,1,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},s=this._extensionBisectService.disabledCount===1?g(pl,2,"Extension Bisect is active and has disabled 1 extension. Check if you can still reproduce the problem and proceed by selecting from these options."):g(pl,3,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",this._extensionBisectService.disabledCount);this._notificationService.prompt(nt.Info,s,[e,t,i],{sticky:!0,priority:jU.URGENT})}},jDe=IP,IP.ctxIsBisectActive=new Y("isExtensionBisectActive",!1),IP);XV=jDe=D([_(0,Pe),_(1,Fz),_(2,Pi),_(3,ji)],XV);it.as(pf.Workbench).registerWorkbenchContribution(XV,Us.Restored);At(class extends pi{constructor(){super({id:"extension.bisect.start",title:Be(pl,4,"Start Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive.negate(),menu:{id:Te.ViewContainerTitle,when:ge.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(n){const e=n.get(To),t=n.get(Id),i=n.get(Rz),s=n.get(Kh),o=n.get(Fz),r=(await i.getInstalled(qr.User)).filter(c=>s.isEnabled(c));(await e.confirm({message:g(pl,5,"Extension Bisect"),detail:g(pl,6,"Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~{0} times). Each time you must confirm if you are still seeing problems.",2+Math.log2(r.length)|0),primaryButton:g(pl,7,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends pi{constructor(){super({id:"extension.bisect.next",title:Be(pl,8,"Continue Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n,e){const t=n.get(To),i=n.get(Id),s=n.get(Fz),o=n.get(Ja),r=n.get(IZe),a=n.get(ji);if(!s.isActive)return;if(e===void 0){const l=await this._checkForBad(t,s);if(l===null)return;e=l}if(e===void 0){await s.reset(),i.reload();return}const c=await s.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(pl,9,"Extension Bisect"),g(pl,10,"Extension Bisect is done but no extension has been identified. This might be a problem with {0}.",o.nameShort));else{const l=await t.confirm({type:nt.Info,message:g(pl,9,"Extension Bisect"),primaryButton:g(pl,11,"&&Report Issue & Continue"),cancelButton:g(pl,12,"Continue"),detail:g(pl,13,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(pl,14,"Keep this extension disabled"),checked:!0}});l.checkboxChecked&&await r.disableExtension({id:c.id},void 0),l.confirmed&&await a.executeCommand("workbench.action.openIssueReporter",c.id)}await s.reset(),i.reload()}async _checkForBad(n,e){const{result:t}=await n.prompt({type:nt.Info,message:g(pl,15,"Extension Bisect"),detail:g(pl,16,"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",e.disabledCount),buttons:[{label:g(pl,17,"I ca&&n't reproduce"),run:()=>!1},{label:g(pl,18,"I can &&reproduce"),run:()=>!0},{label:g(pl,19,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(pl,20,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends pi{constructor(){super({id:"extension.bisect.stop",title:Be(pl,21,"Stop Extension Bisect"),category:Xa.Help,f1:!0,precondition:XV.ctxIsBisectActive})}async run(n){const e=n.get(Fz),t=n.get(Id);await e.reset(),t.reload()}});function X9t(n,e){return n}function Z9t(n){for(const[e,t]of Object.entries(n))lp.registerAppResourcePathUrl(e,t)}const gA="vs/base/common/jsonErrorMessages";function YDe(n){switch(n){case or.InvalidSymbol:return g(gA,0,"Invalid symbol");case or.InvalidNumberFormat:return g(gA,1,"Invalid number format");case or.PropertyNameExpected:return g(gA,2,"Property name expected");case or.ValueExpected:return g(gA,3,"Value expected");case or.ColonExpected:return g(gA,4,"Colon expected");case or.CommaExpected:return g(gA,5,"Comma expected");case or.CloseBraceExpected:return g(gA,6,"Closing brace expected");case or.CloseBracketExpected:return g(gA,7,"Closing bracket expected");case or.EndOfFileExpected:return g(gA,8,"End of file expected");default:return""}}const au="vs/platform/extensions/common/extensionValidator",lot=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,e7t=/^-(\d{4})(\d{2})(\d{2})$/;function t7t(n){return n=n.trim(),n==="*"||lot.test(n)}function I6(n){if(!t7t(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=n.match(lot);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function L6(n){if(!n)return null;const e=n.majorBase,t=n.majorMustEqual,i=n.minorBase;let s=n.minorMustEqual;const o=n.patchBase;let r=n.patchMustEqual;n.hasCaret&&(e===0||(s=!1),r=!1);let a=0;if(n.preRelease){const c=e7t.exec(n.preRelease);if(c){const[,l,d,h]=c;a=Date.UTC(Number(l),Number(d)-1,Number(h))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:s,patchBase:o,patchMustEqual:r,isMinimum:n.hasGreaterEquals,notBefore:a}}function i7t(n,e,t){let i;typeof n=="string"?i=L6(I6(n)):i=n;let s;e instanceof Date?s=e.getTime():typeof e=="string"&&(s=new Date(e).getTime());let o;if(typeof t=="string"?o=L6(I6(t)):o=t,!i||!o)return!1;const r=i.majorBase,a=i.minorBase,c=i.patchBase;let l=o.majorBase,d=o.minorBase,h=o.patchBase;const u=o.notBefore;let f=o.majorMustEqual,p=o.minorMustEqual,m=o.patchMustEqual;return o.isMinimum?r>l?!0:rd?!0:a=h:(r===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),rl?!f:ad?!p:ch?!m:!(s&&s"u"&&typeof i.browser>"u")return o.push([nt.Error,g(au,7,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),o}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&o.push([nt.Warning,g(au,8,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return o.push([nt.Error,g(au,9,"property `{0}` can be omitted or must be of type `string`","main")]),o;{const c=Qt(t,i.main);MS(c,t)||o.push([nt.Warning,g(au,10,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return o.push([nt.Error,g(au,11,"property `{0}` can be omitted or must be of type `string`","browser")]),o;{const c=Qt(t,i.browser);MS(c,t)||o.push([nt.Warning,g(au,12,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",c.path,t.path)])}}if(!JV.valid(i.version))return o.push([nt.Error,g(au,13,"Extension version is not semver compatible.")]),o;const r=[];if(!s7t(n,e,i,s,r))for(const c of r)o.push([nt.Error,c]);return o}function s7t(n,e,t,i,s){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:o7t(n,e,t.engines.vscode,s)}function o7t(n,e,t,i=[]){const s=L6(I6(t));if(!s)return i.push(g(au,14,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(s.majorBase===0){if(!s.majorMustEqual||!s.minorMustEqual)return i.push(g(au,15,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions before 1.0.0, please define at a minimum the major and minor desired version. E.g. ^0.10.0, 0.10.x, 0.11.0, etc.",t)),!1}else if(!s.majorMustEqual)return i.push(g(au,16,"Version specified in `engines.vscode` ({0}) is not specific enough. For vscode versions after 1.0.0, please define at a minimum the major desired version. E.g. ^1.10.0, 1.10.x, 1.x.x, 2.x.x, etc.",t)),!1;return i7t(n,e,s)?!0:(i.push(g(au,17,"Extension is not compatible with Code {0}. Extension requires: {1}.",n,t)),!1)}function c$e(n){if(!Array.isArray(n))return!1;for(let e=0,t=n.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>gc(l.identifier,c.identifier)&&l.manifest.version!==c.version)?s.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>gc(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(o.push(h),a.push(h)):a.splice(d,1,h)}return o.length&&this._onAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onRemoveExtensions.fire({extensions:s,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),s.length&&this._onDidRemoveExtensions.fire({extensions:s,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,s=>{const o=[];for(const r of s){const a=e.find(([c])=>gc(c.identifier,r.identifier)&&c.manifest.version===r.version);a&&(r.metadata={...r.metadata,...a[1]},i.push(r)),o.push(r)}return o}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,s=>{const o=[];for(const r of s)gc(r.identifier,e.identifier)?i.push(r):o.push(r);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),o}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:t})}catch(s){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:s,profileLocation:t}),s}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let s=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if(Cy(r)!==Zi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Yne(lg(r),ZV.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){d$e(a)||this.reportAndThrowInvalidConentError(e);let c;if(zt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(zt(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=P.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}ll(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),s.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,ze.fromString(JSON.stringify(o)))}if(t){s=t(s);const r=s.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.toRelativePath(a.location),metadata:a.metadata}));await this.fileService.writeFile(e,ze.fromString(JSON.stringify(r)))}return s})}reportAndThrowInvalidConentError(e){const t=new Yne(`Invalid extensions content in ${e.toString()}`,ZV.ERROR_INVALID_CONTENT);throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:t.code}),t}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()=>{const e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),t=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let i;try{i=(await this.fileService.readFile(e)).value.toString()}catch(o){if(Cy(o)===Zi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let s;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>d$e(r))?s=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(s)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify(s)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(o){if(Cy(o)===Zi.FILE_MODIFIED_SINCE)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 o}try{await this.fileService.del(e)}catch(o){Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(o)}return s})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new dO,this.resourcesAccessQueueMap.set(e,t)),t}};l$e=D([_(1,ci),_(2,V_),_(3,_o),_(4,rn),_(5,Ze)],l$e);function d$e(n){return fo(n)&&iMt(n.identifier)&&(r7t(n.location)||zt(n.location)&&n.location)&&(ll(n.relativeLocation)||zt(n.relativeLocation))&&n.version&&zt(n.version)}function r7t(n){return n?zt(n.path)&&zt(n.scheme):!1}const a7t="vs/platform/extensionManagement/common/extensionNls";function c7t(n,e,t,i){try{l7t(n,e,t,i)}catch(s){n.error(s?.message??s)}return e}function l7t(n,e,t,i){const s=(o,r,a)=>{const c=o[r];if(zt(c)){const l=c,d=l.length;if(d>1&&l[0]==="%"&&l[d-1]==="%"){const h=l.substr(1,d-2);let u=t[h];u===void 0&&i&&(u=i[h]);const f=typeof u=="string"?u:u?.message,p=i?.[h],m=typeof p=="string"?p:p?.message;if(!f){m||n.warn(`[${e.name}]: ${g(a7t,0,"Couldn't find message for key {0}.",h)}`);return}if(a&&(r==="title"||r==="category")&&m&&m!==f){const v={value:f,original:m};o[r]=v}else o[r]=f}}else if(fo(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?s(c,l,!0):s(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(qr.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(qr.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=rMt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[s,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...s,...o]):[];return this.dedupExtensions(s,o,r,await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){const t=[];t.push(this.scanDefaultSystemExtensions(!!e.useCache,e.language)),t.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));const[i,s]=await Promise.all(t);return this.applyScanOptions([...i,...s],qr.System,e,!1)}async scanUserExtensions(e){const t=e.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",t);const i=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,s=await this.createExtensionScannerInput(t,!!e.profileLocation,qr.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!s.devMode&&s.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(s)}catch(a){if(a instanceof Yne&&a.code===ZV.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(s);else throw a}return r=await this.applyScanOptions(r,qr.User,e,!0),this.logService.trace("Scanned user extensions:",r.length),r}async scanExtensionsUnderDevelopment(e,t){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const i=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(s=>s.scheme===_e.file).map(async s=>{const o=await this.createExtensionScannerInput(s,!1,qr.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>gc(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,o)))}))).flat();return this.applyScanOptions(i,"development",e,!0)}return[]}async scanExistingExtension(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(s);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const s=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(s);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const s=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);s.push(...r)})),this.applyScanOptions(s,t,i,!0)}async scanMetadata(e){const t=Qt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Qt(e,"package.json"),s=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(s);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(Qt(e,"package.json"),ze.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Yne&&e.code===ZV.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());const e=await this.scanUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(t=>[t,t.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,ze.fromString(JSON.stringify([])))}catch(t){Cy(t)!==Zi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),lg(t))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,t,i,s){return i.includeAllVersions||(e=this.dedupExtensions(t===qr.System?e:void 0,t===qr.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),s)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=yr(o.location.fsPath),c=yr(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,s,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&JV.gt(c.manifest.version,l.manifest.version))return this.logService.debug(`Skipping extension ${l.location.path} with lower version ${l.manifest.version} in favour of ${c.location.path} with version ${c.manifest.version}`),!1;if(JV.eq(c.manifest.version,l.manifest.version)){if(c.type===qr.System)return this.logService.debug(`Skipping extension ${l.location.path} in favour of system extension ${c.location.path} with same version`),!1;if(c.targetPlatform===s)return this.logService.debug(`Skipping extension ${l.location.path} from different target platform ${l.targetPlatform}`),!1}}return d?this.logService.warn(`Overwriting user extension ${c.location.path} with ${l.location.path}.`):this.logService.debug(`Overwriting user extension ${c.location.path} with ${l.location.path}.`),!0},a=new $a;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===qr.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||r(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||r(l,c,!0))&&a.set(c.identifier.id,c),a.set(c.identifier.id,c)}),[...a.values()]}async scanDefaultSystemExtensions(e,t){this.logService.trace("Started scanning system extensions");const i=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,qr.System,!0,t,!0,void 0,this.getProductVersion()),o=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",o.length),o}async scanDevSystemExtensions(e,t){const i=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!i?.length)return[];this.logService.trace("Started scanning dev system extensions");const s=t?await this.getBuiltInExtensionControl():{},o=[],r=P.file(d1(D_e(lp.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=s[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(Qt(r,c.name));break;default:o.push(P.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,qr.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Ui(a)}async getBuiltInExtensionControl(){try{const e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,t,i,s,o,r,a,c){const l=await this.getTranslations(o??Gd),d=await this.getMtime(e),h=t&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,u=h?await this.getMtime(h):void 0;return new f8(e,d,h,u,t,a,i,s,r,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,o,l)}async getMtime(e){try{const t=await this.fileService.stat(e);if(typeof t.mtime=="number")return t.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};h$e=D([_(4,V_),_(5,$de),_(6,ci),_(7,Ze),_(8,Il),_(9,Ja),_(10,_o),_(11,be)],h$e);class f8{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=s,this.profile=o,this.profileScanOptions=r,this.type=a,this.excludeObsolete=c,this.validate=l,this.productVersion=d,this.productDate=h,this.productCommit=u,this.devMode=f,this.language=p,this.translations=m}static createNlsConfiguration(e){return{language:e.language,pseudo:e.language==="pseudo",devMode:e.devMode,translations:e.translations}}static equals(e,t){return _n(e.location,t.location)&&e.mtime===t.mtime&&_n(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Io(e.profileScanOptions,t.profileScanOptions)&&e.type===t.type&&e.excludeObsolete===t.excludeObsolete&&e.validate===t.validate&&e.productVersion===t.productVersion&&e.productDate===t.productDate&&e.productCommit===t.productCommit&&e.devMode===t.devMode&&e.language===t.language&&JDe.equals(e.translations,t.translations)}}let XDe=class extends ${constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const s=Qt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",l?.path,YDe(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=P.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=ow(d,h);return h.length>0?(o(l,h),{values:void 0,default:s}):HW(u)!=="object"?(r(l),{values:void 0,default:s}):{values:u.contents?u.contents.package:void 0,default:s}}catch{return{values:void 0,default:s}}else{if(!await this.fileService.exists(s))return;let d;try{d=await this.findMessageBundles(e,i)}catch{return}if(!d.localized)return{values:void 0,default:d.original};try{const h=(await this.fileService.readFile(d.localized)).value.toString(),u=[],f=ow(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):HW(f)!=="object"?(r(d.localized),{values:void 0,default:d.original}):{values:f,default:d.original}}catch{return{values:void 0,default:d.original}}}}async translateManifest(e,t,i){const s=await this.getLocalizedMessages(e,t,i);if(s)try{const o=[],r=await this.resolveOriginalMessageBundle(s.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(kR,0,"Failed to parse {0}: {1}.",s.default?.path,YDe(c.error))))}),t;if(HW(s)!=="object")return this.logService.error(this.formatMessage(e,g(kR,1,"Invalid format {0}: JSON object expected.",s.default?.path))),t;const a=s.values||Object.create(null);return c7t(this.logService,t,a,r)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return ow(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,s)=>{const o=r=>{const a=Qt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Qt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:Qt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Qt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};XDe=D([_(0,ci),_(1,Ze)],XDe);let Jne=class extends XDe{constructor(e,t,i,s,o){super(s,o),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===qr.User)try{const s=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(s)}catch{}return n1(i)?t:t.filter(s=>!i[G$.create(s).toString()])}async scanExtensionsFromLocation(e){const t=await this.fileService.resolve(e.location);if(!t.children?.length)return[];const i=await Promise.all(t.children.map(async s=>{if(!s.isDirectory||e.type===qr.User&&ui(s.resource).indexOf(".")===0)return null;const o=new f8(s.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.excludeObsolete,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(o)}));return Ui(i).sort((s,o)=>s.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(s=>!s.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,s=>!!s.metadata?.isBuiltin||!!s.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const s=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!s.length)return[];const o=await Promise.all(s.map(async r=>{if(t(r)){const a=new f8(r.location,i.mtime,i.applicationExtensionslocation,i.applicationExtensionslocationMtime,i.profile,i.profileScanOptions,i.type,i.excludeObsolete,i.validate,i.productVersion,i.productDate,i.productCommit,i.devMode,i.language,i.translations);return this.scanExtension(a,r.metadata)}return null}));return Ui(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Qt(e.location,"package.json"))){const t=await this.scanExtension(e);return t?[t]:[]}else return await this.scanExtensions(e)}catch(t){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,lg(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=gZe),t=t??i.__metadata,delete i.__metadata;const s=ny(i.publisher,i.name),o=t?.id?{id:s,uuid:t.id}:{id:s},r=t?.isSystem?qr.System:e.type,a=r===qr.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,f8.createNlsConfiguration(e));const c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Hs.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate?this.validate(c,e):c}}catch(i){e.type!==qr.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const s=n7t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin);for(const[o,r]of s)o===nt.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,r)));return e.isValid=i,e.validations=s,e}async scanExtensionManifest(e){const t=Qt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return Cy(o)!==Zi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(kR,2,"Cannot read file {0}: {1}.",t.path,o.message))),null}let s;try{s=JSON.parse(i)}catch{const r=[];ow(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(kR,3,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,YDe(a.error))));return null}return HW(s)!=="object"?(this.logService.error(this.formatMessage(e,g(kR,4,"Invalid manifest file {0}: Not an JSON object.",t.path))),null):s}};Jne=D([_(1,$de),_(2,_o),_(3,ci),_(4,Ze)],Jne);let Xne=class extends Jne{constructor(e,t,i,s,o,r,a){super(t,s,o,r,a),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new iQ(3e3)),this._onDidChangeCache=this._register(new I),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){const t=this.getCacheFile(e),i=await this.readExtensionCache(t);if(this.input=e,i&&i.input&&f8.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=P.revive(o.location),o));const s=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:s}),s}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Or(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,lg(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,ze.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,lg(i))}}async validateCache(){if(!this.input)return;const e=this.getCacheFile(this.input),t=await this.readExtensionCache(e);if(!t)return;const i=t.result,s=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Io(s,i))try{this.logService.info("Invalidating Cache",i,s),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(o){this.logService.error(o)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===qr.System?iLt:tLt)}getProfile(e){return e.type===qr.System?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(t=>this.uriIdentityService.extUri.isEqual(e.location,t.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};Xne=D([_(2,V_),_(3,$de),_(4,_o),_(5,ci),_(6,Ze)],Xne);const ZDe=["W","X","Y","Z","a","b","c","d","e","f"],d7t=new RegExp(`^[${ZDe.join("")}]+`),dot=7;function h7t(n){if(n.scheme!==_e.vscodeNotebookCell)return;const e=n.fragment.indexOf("s");if(e<0)return;const t=parseInt(n.fragment.substring(0,e).replace(d7t,""),dot),i=Tje(n.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:n.with({scheme:i,fragment:null})}}function u7t(n,e){const t=e.toString(dot),s=`${t.lengthze.wrap(r))),o=y7t(s);return i=i||o.byteLength!==s.byteLength,{data:o,didCompression:i}}const AX="\x1B[A",qpe=AX.split("").map(n=>n.charCodeAt(0)),m7t=10;function _7t(n){let e=!1;return n.forEach((t,i)=>{if(i===0||t.length-1;){const e=n.match(/^(.*)\r+/m)[1];let t=n.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),n=n.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return n}const b7t=8,C7t=13;function y7t(n){return!n.buffer.includes(b7t)&&!n.buffer.includes(C7t)?n:ze.fromString(w7t(v7t(f7t.decode(n.buffer))))}var ike,aT,wA,nke,cT,qD,lT,ske,oke,EX,U3,rke,TC,RC,ake,Rf,cke;function Ri(n){return Object.assign(n,{apply:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(n,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const[i,...s]=t;return Reflect.construct(n,s,i.constructor)}}})}var tse;(function(n){n[n.Top=0]="Top",n[n.Bottom=1]="Bottom"})(tse||(tse={}));var OR,Hqe;let oo=ike=(Hqe=class{constructor(e){kt(this,OR);st(this,OR,e)}static from(...e){let t=e;return new ike(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof se(this,OR)=="function"&&(se(this,OR).call(this),st(this,OR,void 0))}},OR=new WeakMap,Hqe);oo=ike=D([Ri],oo);let Ps=aT=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;ie.line?1:this._charactere._character?1:0}translate(e,t=0){if(e===null||t===null)throw Hi();let i;return typeof e>"u"?i=0:typeof e=="number"?i=e:(i=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),i===0&&t===0?this:new aT(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Hi();let i;return typeof e>"u"?i=this.line:typeof e=="number"?i=e:(i=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),i===this.line&&t===this.character?this:new aT(i,t)}toJSON(){return{line:this.line,character:this.character}}};Ps=aT=D([Ri],Ps);let rs=wA=class{static isRange(e){return e instanceof wA?!0:e?Ps.isPosition(e.start)&&Ps.isPosition(e.end):!1}static of(e){if(e instanceof wA)return e;if(this.isRange(e))return new wA(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");o.isBefore(r)?(this._start=o,this._end=r):(this._start=r,this._end=o)}contains(e){return wA.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ps.isPosition(e)?!(Ps.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){const t=Ps.Max(e.start,this._start),i=Ps.Min(e.end,this._end);if(!t.isAfter(i))return new wA(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=Ps.Min(e.start,this._start),i=Ps.Max(e.end,this.end);return new wA(t,i)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw Hi();let i;return e?Ps.isPosition(e)?i=e:(i=e.start||this.start,t=e.end||this.end):i=this.start,i.isEqual(this._start)&&t.isEqual(this.end)?this:new wA(i,t)}toJSON(){return[this.start,this.end]}};rs=wA=D([Ri],rs);let XS=nke=class extends rs{static isSelection(e){return e instanceof nke?!0:e?rs.isRange(e)&&Ps.isPosition(e.anchor)&&Ps.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,s){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(o=new Ps(e,t),r=new Ps(i,s)):Ps.isPosition(e)&&Ps.isPosition(t)&&(o=Ps.of(e),r=Ps.of(t)),!o||!r)throw new Error("Invalid arguments");super(o,r),this._anchor=o,this._active=r}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}};XS=nke=D([Ri],XS);const uot=n=>{if(typeof n!="string"||n.length===0||!/^[0-9A-Za-z_\-]+$/.test(n))throw Hi("connectionToken")};let got=class{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,i){if(typeof e!="string"||e.length===0)throw Hi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Hi("port");typeof i<"u"&&uot(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},m8=class{static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t){this.makeConnection=e,this.connectionToken=t,typeof t<"u"&&uot(t)}},OT=class xX extends Error{static NotAvailable(e,t){return new xX(e,Xd.NotAvailable,t)}static TemporarilyNotAvailable(e){return new xX(e,Xd.TemporarilyNotAvailable)}constructor(e,t=Xd.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,xX.prototype)}};var jv;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(jv||(jv={}));var LM;(function(n){n[n.Replace=1]="Replace",n[n.Append=2]="Append",n[n.Prepend=3]="Prepend"})(LM||(LM={}));let qx=cT=class{static isTextEdit(e){return e instanceof cT?!0:e?rs.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new cT(e,t)}static insert(e,t){return cT.replace(new rs(e,e),t)}static delete(e){return cT.replace(e,"")}static setEndOfLine(e){const t=new cT(new rs(new Ps(0,0),new Ps(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!rs.isRange(e))throw Hi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Hi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Hi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};qx=cT=D([Ri],qx);let T6=qD=class{static isNotebookCellEdit(e){return e instanceof qD?!0:e?rS.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new qD(e,t)}static insertCells(e,t){return new qD(new rS(e,e),t)}static deleteCells(e){return new qD(e,[])}static updateCellMetadata(e,t){const i=new qD(new rS(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new qD(new rS(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};T6=qD=D([Ri],T6);let zhe=class DX{static isSnippetTextEdit(e){return e instanceof DX?!0:e?rs.isRange(e.range)&&Q1.isSnippetString(e.snippet):!1}static replace(e,t){return new DX(e,t)}static insert(e,t){return DX.replace(new rs(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var sl;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.Cell=3]="Cell",n[n.CellReplace=5]="CellReplace",n[n.Snippet=6]="Snippet"})(sl||(sl={}));let q1=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,s){this._edits.push({_type:sl.File,from:e,to:t,options:i,metadata:s})}createFile(e,t,i){this._edits.push({_type:sl.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:sl.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:sl.Cell,metadata:i,uri:e,edit:{editType:G1.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,s){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:sl.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:s})}replaceNotebookCellMetadata(e,t,i,s){this._edits.push({_type:sl.Cell,metadata:s,uri:e,edit:{editType:G1.Metadata,index:t,metadata:i}})}replace(e,t,i,s){this._edits.push({_type:sl.Text,uri:e,edit:new qx(t,i),metadata:s})}insert(e,t,i,s){this.replace(e,new rs(t,t),i,s)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===sl.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let s,o;Array.isArray(i)?(s=i[0],o=i[1]):s=i,T6.isNotebookCellEdit(s)?s.newCellMetadata?this.replaceNotebookCellMetadata(e,s.range.start,s.newCellMetadata,o):s.newNotebookMetadata?this.replaceNotebookMetadata(e,s.newNotebookMetadata,o):this.replaceNotebookCells(e,s.range,s.newCells,o):zhe.isSnippetTextEdit(s)?this._edits.push({_type:sl.Snippet,uri:e,range:s.range,edit:s.snippet,metadata:o}):this._edits.push({_type:sl.Text,uri:e,edit:s,metadata:o})}else{for(let i=0;is.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){const i=new lT;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};Q1=lT=D([Ri],Q1);var mI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(mI||(mI={}));var Th;(function(n){n[n.Hint=3]="Hint",n[n.Information=2]="Information",n[n.Warning=1]="Warning",n[n.Error=0]="Error"})(Th||(Th={}));let _p=ske=class{static isLocation(e){return e instanceof ske?!0:e?rs.isRange(e.range)&&P.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(rs.isRange(t))this.range=rs.of(t);else if(Ps.isPosition(t))this.range=new rs(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};_p=ske=D([Ri],_p);let e4=class{static is(e){return e?typeof e.message=="string"&&e.location&&rs.isRange(e.location.range)&&P.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};e4=D([Ri],e4);let R6=class{constructor(e,t,i=Th.Error){if(!rs.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=i}toJSON(){return{severity:Th[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&Ls(e.tags,t.tags)&&Ls(e.relatedInformation,t.relatedInformation,e4.isEqual)}};R6=D([Ri],R6);let M6=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};M6=D([Ri],M6);let ise=class extends M6{constructor(e,t,i,s){super(e,t),this.canIncreaseHover=i,this.canDecreaseHover=s}};ise=D([Ri],ise);var lke;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(lke||(lke={}));var t4;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(t4||(t4={}));let N6=class{constructor(e,t=t4.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:t4[this.kind]}}};N6=D([Ri],N6);let P6=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};P6=D([Ri],P6);var Gr;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(Gr||(Gr={}));var i4;(function(n){n[n.Deprecated=1]="Deprecated"})(i4||(i4={}));let n4=oke=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,s,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),s instanceof _p?this.location=s:i instanceof rs&&(this.location=new _p(s,i)),oke.validate(this)}toJSON(){return{name:this.name,kind:Gr[this.kind],location:this.location,containerName:this.containerName}}};n4=oke=D([Ri],n4);let s4=EX=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(EX.validate)}constructor(e,t,i,s,o){this.name=e,this.detail=t,this.kind=i,this.range=s,this.selectionRange=o,this.children=[],EX.validate(this)}};s4=EX=D([Ri],s4);var o4;(function(n){n[n.Invoke=1]="Invoke",n[n.Automatic=2]="Automatic"})(o4||(o4={}));let F6=class{constructor(e,t){this.title=e,this.kind=t}};F6=D([Ri],F6);var LP;let Ya=(LP=class{constructor(e){this.value=e}append(e){return new U3(this.value?this.value+U3.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+U3.sep)}},U3=LP,LP.sep=".",LP);Ya=U3=D([Ri],Ya);Ya.Empty=new Ya("");Ya.QuickFix=Ya.Empty.append("quickfix");Ya.Refactor=Ya.Empty.append("refactor");Ya.RefactorExtract=Ya.Refactor.append("extract");Ya.RefactorInline=Ya.Refactor.append("inline");Ya.RefactorMove=Ya.Refactor.append("move");Ya.RefactorRewrite=Ya.Refactor.append("rewrite");Ya.Source=Ya.Empty.append("source");Ya.SourceOrganizeImports=Ya.Source.append("organizeImports");Ya.SourceFixAll=Ya.Source.append("fixAll");Ya.Notebook=Ya.Empty.append("notebook");let r4=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};r4=D([Ri],r4);let $he=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}},gOe=class{constructor(e,t){this.fromRanges=t,this.from=e}},fOe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var TM;(function(n){n[n.Information=0]="Information",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(TM||(TM={}));let O6=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};O6=D([Ri],O6);var Uu,Uqe;let vp=rke=(Uqe=class{constructor(e,t=!1){kt(this,Uu);st(this,Uu,new Xt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof rke?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return se(this,Uu).value}set value(e){se(this,Uu).value=e}get isTrusted(){return se(this,Uu).isTrusted}set isTrusted(e){se(this,Uu).isTrusted=e}get supportThemeIcons(){return se(this,Uu).supportThemeIcons}set supportThemeIcons(e){se(this,Uu).supportThemeIcons=e}get supportHtml(){return se(this,Uu).supportHtml}set supportHtml(e){se(this,Uu).supportHtml=e}get baseUri(){return se(this,Uu).baseUri}set baseUri(e){se(this,Uu).baseUri=e}appendText(e){return se(this,Uu).appendText(e),this}appendMarkdown(e){return se(this,Uu).appendMarkdown(e),this}appendCodeblock(e,t){return se(this,Uu).appendCodeblock(t??"",e),this}},Uu=new WeakMap,Uqe);vp=rke=D([Ri],vp);let nse=class{constructor(e,t){this.label=e,this.documentation=t}};nse=D([Ri],nse);let sse=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};sse=D([Ri],sse);let ose=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};ose=D([Ri],ose);var rse;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(rse||(rse={}));var ase;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(ase||(ase={}));let B6=class{constructor(e){this.value=e}};B6=D([Ri],B6);let W6=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};W6=D([Ri],W6);var RM;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(RM||(RM={}));var nn;(function(n){n[n.Text=0]="Text",n[n.Method=1]="Method",n[n.Function=2]="Function",n[n.Constructor=3]="Constructor",n[n.Field=4]="Field",n[n.Variable=5]="Variable",n[n.Class=6]="Class",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Unit=10]="Unit",n[n.Value=11]="Value",n[n.Enum=12]="Enum",n[n.Keyword=13]="Keyword",n[n.Snippet=14]="Snippet",n[n.Color=15]="Color",n[n.File=16]="File",n[n.Reference=17]="Reference",n[n.Folder=18]="Folder",n[n.EnumMember=19]="EnumMember",n[n.Constant=20]="Constant",n[n.Struct=21]="Struct",n[n.Event=22]="Event",n[n.Operator=23]="Operator",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue"})(nn||(nn={}));var a4;(function(n){n[n.Deprecated=1]="Deprecated"})(a4||(a4={}));let H6=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&nn[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};H6=D([Ri],H6);let WF=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};WF=D([Ri],WF);let cse=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};cse=D([Ri],cse);let lse=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};lse=D([Ri],lse);var IR;(function(n){n[n.Unknown=0]="Unknown",n[n.Word=1]="Word",n[n.Line=2]="Line",n[n.Suggest=3]="Suggest"})(IR||(IR={}));var c4;(function(n){n[n.Active=-1]="Active",n[n.Beside=-2]="Beside",n[n.One=1]="One",n[n.Two=2]="Two",n[n.Three=3]="Three",n[n.Four=4]="Four",n[n.Five=5]="Five",n[n.Six=6]="Six",n[n.Seven=7]="Seven",n[n.Eight=8]="Eight",n[n.Nine=9]="Nine"})(c4||(c4={}));var HE;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(HE||(HE={}));function S7t(n,e){return`${Cn.toKey(n)}.${e}`}var wv;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval"})(wv||(wv={}));var MM;(function(n){n[n.Manual=1]="Manual",n[n.AfterDelay=2]="AfterDelay",n[n.FocusOut=3]="FocusOut"})(MM||(MM={}));var U6;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(U6||(U6={}));var HF;(function(n){n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command"})(HF||(HF={}));var l4;(function(n){n[n.Undo=1]="Undo",n[n.Redo=2]="Redo"})(l4||(l4={}));var _I;(function(n){n[n.OpenOpen=0]="OpenOpen",n[n.ClosedClosed=1]="ClosedClosed",n[n.OpenClosed=2]="OpenClosed",n[n.ClosedOpen=3]="ClosedOpen"})(_I||(_I={}));(function(n){function e(t){switch(t){case"keyboard":return n.Keyboard;case"mouse":return n.Mouse;case"api":return n.Command}}n.fromValue=e})(HF||(HF={}));var UF;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UF||(UF={}));(function(n){function e(t){switch(t){case n.Other:return"other";case n.Comment:return"comment";case n.String:return"string";case n.RegEx:return"regex"}return"other"}n.toString=e})(UF||(UF={}));let V6=class{constructor(e,t){if(t&&!P.isUri(t))throw Hi("target");if(!rs.isRange(e)||e.isEmpty)throw Hi("range");this.range=e,this.target=t}};V6=D([Ri],V6);let VF=class{constructor(e,t,i,s){this.red=e,this.green=t,this.blue=i,this.alpha=s}};VF=D([Ri],VF);let z6=class{constructor(e,t){if(t&&!(t instanceof VF))throw Hi("color");if(!rs.isRange(e)||e.isEmpty)throw Hi("range");this.range=e,this.color=t}};z6=D([Ri],z6);let $6=class{constructor(e){if(!e||typeof e!="string")throw Hi("label");this.label=e}};$6=D([Ri],$6);var dse;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Information=2]="Information"})(dse||(dse={}));var hse;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(hse||(hse={}));var NM;(function(n){n[n.Low=0]="Low",n[n.Medium=1]="Medium",n[n.High=2]="High"})(NM||(NM={}));let fot=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Hi("startIndex");if(typeof t!="number"||t<1)throw Hi("length");if(i!==void 0&&typeof i!="string")throw Hi("tooltip")}},pot=class{constructor(e){this.uri=e}};class mot{constructor(e){this.terminalCommand=e}}var use;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(use||(use={}));let _ot=class{constructor(e){if(this.options=e,typeof e!="object")throw Hi("options")}};var gse;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(gse||(gse={}));var fse;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(fse||(fse={}));var Qy;let d4=(Qy=class{static from(e){switch(e){case"clean":return TC.Clean;case"build":return TC.Build;case"rebuild":return TC.Rebuild;case"test":return TC.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Hi("name");this._id=e}get id(){return this._id}},TC=Qy,Qy.Clean=new TC("clean","Clean"),Qy.Build=new TC("build","Build"),Qy.Rebuild=new TC("rebuild","Rebuild"),Qy.Test=new TC("test","Test"),Qy);d4=TC=D([Ri],d4);function vot(n){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return vot(e)}};zF=D([Ri],zF);let j1=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Hi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Hi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Hi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Hi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Hi("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(const t of this._args)e.push(typeof t=="string"?t:t.value);return vot(e)}};j1=D([Ri],j1);var pse;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(pse||(pse={}));var K1;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace"})(K1||(K1={}));let Ghe=class{constructor(e){this._callback=e}computeId(){return"customExecution"+Dr()}set callback(e){this._callback=e}get callback(){return this._callback}};var jy;let G6=(jy=class{constructor(e,t,i,s,o,r){this.__deprecated=!1,this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=i,this.execution=s,a=o,this.__deprecated=!0):t===K1.Global||t===K1.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=o,a=r),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(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof zF?this._definition={type:RC.ProcessType,id:this._execution.computeId()}:this._execution instanceof j1?this._definition={type:RC.ShellType,id:this._execution.computeId()}:this._execution instanceof Ghe?this._definition={type:RC.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:RC.EmptyType,id:Dr()}}get definition(){return this._definition}set definition(e){if(e==null)throw Hi("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw Hi("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;const t=this._definition.type;(RC.EmptyType===t||RC.ProcessType===t||RC.ShellType===t||RC.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw Hi("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}},RC=jy,jy.ExtensionCallbackType="customExecution",jy.ProcessType="process",jy.ShellType="shell",jy.EmptyType="$empty",jy);G6=RC=D([Ri],G6);var VI;(function(n){n[n.SourceControl=1]="SourceControl",n[n.Window=10]="Window",n[n.Notification=15]="Notification"})(VI||(VI={}));var dke;(function(n){function e(t){const i=t;return Kc(i.value)?i.tooltip&&!zt(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}n.isViewBadge=e})(dke||(dke={}));let q6=ake=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const s=Kc(i.checkboxState)?i.checkboxState:fo(i.checkboxState)&&Kc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!Kc(i.checkboxState)&&fo(i.checkboxState)?i.checkboxState.tooltip:void 0;if(s===void 0||s!==Lb.Checked&&s!==Lb.Unchecked||o!==void 0&&!zt(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof ake)return!0;if(i.label!==void 0&&!zt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!zt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!zt(i.iconPath)&&!P.isUri(i.iconPath)&&(!i.iconPath||!zt(i.iconPath.id))){const s=i.iconPath;if(!s||!zt(s.light)&&!P.isUri(s.light)&&!zt(s.dark)&&!P.isUri(s.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!zt(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!P.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!zt(i.tooltip)&&!(i.tooltip instanceof vp)?(console.log("INVALID tree item, invalid tooltip",i.tooltip),!1):i.command!==void 0&&!i.command.command?(console.log("INVALID tree item, invalid command",i.command),!1):i.collapsibleState!==void 0&&i.collapsibleStatezI.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!zt(i.contextValue)?(console.log("INVALID tree item, invalid contextValue",i.contextValue),!1):i.accessibilityInformation!==void 0&&!i.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",i.accessibilityInformation),!1):!0}constructor(e,t=zI.None){this.collapsibleState=t,P.isUri(e)?this.resourceUri=e:this.label=e}};q6=ake=D([Ri],q6);var zI;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(zI||(zI={}));var Lb;(function(n){n[n.Unchecked=0]="Unchecked",n[n.Checked=1]="Checked"})(Lb||(Lb={}));let Q6=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Q6=D([Ri],Q6);class mse extends Q6{}var wq;class A7t extends mse{constructor(t){super("");kt(this,wq);st(this,wq,t)}asFile(){return se(this,wq)}}wq=new WeakMap;class E7t{constructor(e,t,i,s){this.name=e,this.uri=t,this._itemId=i,this._getData=s}data(){return this._getData()}}var jA,BR,V3,Vqe;let h4=(Vqe=class{constructor(e){kt(this,BR);kt(this,jA,new Map);for(const[t,i]of e??[]){const s=se(this,jA).get(Zz(this,BR,V3).call(this,t));s?s.push(i):se(this,jA).set(Zz(this,BR,V3).call(this,t),[i])}}get(e){return se(this,jA).get(Zz(this,BR,V3).call(this,e))?.[0]}set(e,t){se(this,jA).set(Zz(this,BR,V3).call(this,e),[t])}forEach(e,t){for(const[i,s]of se(this,jA))for(const o of s)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of se(this,jA))for(const i of t)yield[e,i]}},jA=new WeakMap,BR=new WeakSet,V3=function(e){return e.toLowerCase()},Vqe);h4=D([Ri],h4);let _se=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};_se=D([Ri],_se);var hke;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(hke||(hke={}));const gW=class gW{constructor(e){this.value=e}append(...e){return new gW((this.value?[this.value,...e]:e).join(gW.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+gW.sep)}};gW.sep=".";let u4=gW;u4.Empty=new u4("");let wot=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},fg=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};fg=D([Ri],fg);fg.File=new fg("file");fg.Folder=new fg("folder");let g4=class{constructor(e){this.id=e}};g4=D([Ri],g4);var PM;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.WorkspaceFolder=3]="WorkspaceFolder"})(PM||(PM={}));let FM=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=P.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!P.isUri(e)&&!P.isUri(e.uri)))throw Hi("base");if(typeof t!="string")throw Hi("pattern");typeof e=="string"?this.baseUri=P.file(e):P.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};FM=D([Ri],FM);const bot=new WeakMap;function x7t(n,e){bot.set(n,e)}let $F=class{constructor(e,t,i,s,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof s=="string"&&(this.logMessage=s),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=bot.get(this)??Dr()),this._id}};$F=D([Ri],$F);let vI=class extends $F{constructor(e,t,i,s,o,r){if(super(t,i,s,o,r),e===null)throw Hi("location");this.location=e}};vI=D([Ri],vI);let wI=class extends $F{constructor(e,t,i,s,o,r){super(t,i,s,o,r),this.functionName=e}};wI=D([Ri],wI);let vse=class extends $F{constructor(e,t,i,s,o,r,a,c){if(super(s,o,r,a,c),!t)throw Hi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};vse=D([Ri],vse);let j6=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};j6=D([Ri],j6);let f4=class{constructor(e,t){this.port=e,this.host=t}};f4=D([Ri],f4);let K6=class{constructor(e){this.path=e}};K6=D([Ri],K6);let Y6=class{constructor(e){this.implementation=e}};Y6=D([Ri],Y6);class Cot{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}}class yot{constructor(e,t){this.session=e,this.threadId=t}}let J6=class{constructor(e,t){this.range=e,this.expression=t}};J6=D([Ri],J6);var p4;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(p4||(p4={}));let X6=class{constructor(e,t){this.range=e,this.text=t}};X6=D([Ri],X6);let Z6=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};Z6=D([Ri],Z6);let eG=class{constructor(e,t){this.range=e,this.expression=t}};eG=D([Ri],eG);let uke=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};uke=D([Ri],uke);var gke;(function(n){n[n.AIGenerated=1]="AIGenerated"})(gke||(gke={}));var tG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(tG||(tG={}));class D7t{constructor(e,t){this.newSymbolName=e,this.tags=t}}var OM;(function(n){n[n.Changed=1]="Changed",n[n.Created=2]="Created",n[n.Deleted=3]="Deleted"})(OM||(OM={}));let Wl=Rf=class extends Error{static FileExists(e){return new Rf(e,rt.FileExists,Rf.FileExists)}static FileNotFound(e){return new Rf(e,rt.FileNotFound,Rf.FileNotFound)}static FileNotADirectory(e){return new Rf(e,rt.FileNotADirectory,Rf.FileNotADirectory)}static FileIsADirectory(e){return new Rf(e,rt.FileIsADirectory,Rf.FileIsADirectory)}static NoPermissions(e){return new Rf(e,rt.NoPermissions,Rf.NoPermissions)}static Unavailable(e){return new Rf(e,rt.Unavailable,Rf.Unavailable)}constructor(e,t=rt.Unknown,i){super(P.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",vJe(this,t),Object.setPrototypeOf(this,Rf.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Wl=Rf=D([Ri],Wl);let wse=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};wse=D([Ri],wse);var vy;(function(n){n[n.Comment=1]="Comment",n[n.Imports=2]="Imports",n[n.Region=3]="Region"})(vy||(vy={}));var m4;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(m4||(m4={}));var bse;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(bse||(bse={}));var Cse;(function(n){n[n.Published=0]="Published",n[n.Draft=1]="Draft"})(Cse||(Cse={}));var _4;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(_4||(_4={}));var iG;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(iG||(iG={}));let yse=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function k7t(n){return typeof n>"u"||Yqe(n)}let Sot=class Aot{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,i=e.tokenTypes.length;t"u"))return typeof o>"u"&&(o=0),this._pushEncoded(e,t,i,s,o);if(rs.isRange(e)&&typeof t=="string"&&k7t(i))return this._push(e,t,i);throw Hi()}_push(e,t,i){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");const s=e.start.line,o=e.start.character,r=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t);let c=0;if(i)for(const l of i){if(!this._tokenModifierStrToInt.has(l))throw new Error("`tokenModifier` is not in the provided legend");const d=this._tokenModifierStrToInt.get(l);c|=1<>>0}this._pushEncoded(s,o,r,a,c)}_pushEncoded(e,t,i,s,o){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(r-=this._prevLine,r===0&&(a-=this._prevChar)),this._data[this._dataLen++]=r,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){const t=[],i=e.length/5|0;for(let a=0;a{const l=e[5*a],d=e[5*c];if(l===d){const h=e[5*a+1],u=e[5*c+1];return h-u}return l-d});const s=new Uint32Array(e.length);let o=0,r=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!fg.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,i){this.badge=e,this.tooltip=t,this.color=i}},Sse=class{constructor(e){this.kind=e}};Sse=D([Ri],Sse);var uE;(function(n){n[n.Light=1]="Light",n[n.Dark=2]="Dark",n[n.HighContrast=3]="HighContrast",n[n.HighContrastLight=4]="HighContrastLight"})(uE||(uE={}));let rS=class fke{static isNotebookRange(e){return e instanceof fke?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw Hi("start must be positive");if(t<0)throw Hi("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,i=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(i=e.end),t===this._start&&i===this._end?this:new fke(t,i)}},ej=class pke{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>pke.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,s,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=s,this.outputs=o??[],this.metadata=r,this.executionSummary=a,pke.validate(this)}},mOe=class{constructor(e){this.cells=e}};var Gp,ile;let _Oe=(Gp=class{static isNotebookCellOutputItem(e){return e instanceof Gp?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){const t={name:e.name,message:e.message,stack:e.stack};return Gp.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Gp.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Gp.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Gp(e,t)}static text(e,t=Js.text){const i=se(Gp,ile).encode(String(e));return new Gp(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Gp.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=Oje(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},ile=new WeakMap,kt(Gp,ile,new TextEncoder),Gp),oG=class mke{static isNotebookCellOutput(e){return e instanceof mke?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,s=new Set;for(let o=0;o!s.has(r))}constructor(e,t,i){this.items=mke.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=Dr(),this.metadata=t??i)}};var bI;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(bI||(bI={}));var qF;(function(n){n[n.Idle=1]="Idle",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(qF||(qF={}));var rG;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(rG||(rG={}));var aG;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(aG||(aG={}));let xot=class{constructor(e,t){this.text=e,this.alignment=t}};var Ase;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred"})(Ase||(Ase={}));var cG;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred",n[n.Hidden=-1]="Hidden"})(cG||(cG={}));let vOe=class{constructor(e,t=[]){this.uri=e,this.provides=Kb(t)}},Dot=class{constructor(e){this.label=e}};var lG;(function(n){n[n.Named=1]="Named",n[n.Indexed=2]="Indexed"})(lG||(lG={}));let Ese=class{constructor(e,t){this.label=e,this.timestamp=t}};Ese=D([Ri],Ese);var WM;(function(n){n[n.Production=1]="Production",n[n.Development=2]="Development",n[n.Test=3]="Test"})(WM||(WM={}));var dG;(function(n){n[n.Node=1]="Node",n[n.Webworker=2]="Webworker"})(dG||(dG={}));var UE;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(UE||(UE={}));let kot=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},Iot=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var xse;(function(n){n[n.Queued=1]="Queued",n[n.Running=2]="Running",n[n.Passed=3]="Passed",n[n.Failed=4]="Failed",n[n.Skipped=5]="Skipped",n[n.Errored=6]="Errored"})(xse||(xse={}));var HM;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(HM||(HM={}));let hG=class{constructor(e=void 0,t=void 0,i=void 0,s=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=s,this.preserveFocus=o}};hG=D([Ri],hG);let b4=cke=class{static diff(e,t,i){const s=new cke(e);return s.expectedOutput=t,s.actualOutput=i,s}constructor(e){this.message=e}};b4=cke=D([Ri],b4);let C4=class{constructor(e){this.id=e}};C4=D([Ri],C4);class kX{constructor(e,t){this.covered=e,this.total=t,IX(this)}}function IX(n){if(n){if(n.covered>n.total)throw new Error(`The total number of covered items (${n.covered}) cannot be greater than the total (${n.total})`);if(n.total<0)throw new Error(`The number of covered items (${n.total}) cannot be negative`)}}let uG=class Lot{static fromDetails(e,t){const i=new kX(0,0),s=new kX(0,0),o=new kX(0,0);for(const a of t)if("branches"in a){i.total+=1,i.covered+=a.executed?1:0;for(const c of a.branches)s.total+=1,s.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new Lot(e,i,s.total>0?s:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,s,o){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=s,this.testItem=o}},Tot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i=[]){this.executed=e,this.location=t,this.branches=i}},Rot=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.executed=e,this.location=t,this.label=i}};class Mot{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.name=e,this.executed=t,this.location=i}}var Dse;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(Dse||(Dse={}));var kse;(function(n){n[n.Untrusted=0]="Untrusted",n[n.Trusted=1]="Trusted",n[n.Unspecified=2]="Unspecified"})(kse||(kse={}));var Ise;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(Ise||(Ise={}));let qhe=class{constructor(e,t,i,s,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=o,this.selectionRange=r}};class Qhe{constructor(e){this.uri=e}}class gG{constructor(e,t){this.original=e,this.modified=t}}class wOe{constructor(e,t,i,s){this.base=e,this.input1=t,this.input2=i,this.result=s}}class jhe{constructor(e,t){this.uri=e,this.viewType=t}}class bOe{constructor(e){this.viewType=e}}class Khe{constructor(e,t){this.uri=e,this.notebookType=t}}class Yhe{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class COe{constructor(){}}class yOe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class SOe{constructor(){}}class Not{constructor(e){this.textDiffs=e}}var Lse;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(Lse||(Lse={}));var Tse;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Tse||(Tse={}));var Rse;(function(n){n[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Full=3]="Full"})(Rse||(Rse={}));let Pot=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var Mse;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful",n[n.Undone=2]="Undone",n[n.Accepted=3]="Accepted",n[n.Bug=4]="Bug"})(Mse||(Mse={}));var y4;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful"})(y4||(y4={}));let Jhe=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},fG=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e,this.vulnerabilities=t}},pG=class{constructor(e,t){this.participant=e,this.command=t}},_ke=class{constructor(e,t,i){this.title=e,this.message=t,this.data=i}};class Xhe{constructor(e,t){this.value=e,this.baseUri=t}}let Zhe=class{constructor(e,t){this.value=e,this.title=t}},mG=class{constructor(e){this.value=e}};class Fot{constructor(e,t){this.value=e,this.task=t}}let _G=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new vp(e):e}},eue=class{constructor(e){this.value=e}},GI=class{constructor(e,t){this.value=e,this.iconPath=t}},vG=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}};class Oot{constructor(e,t,i,s){this.prompt=e,this.command=t,this.references=i,this.participant=s}}class Bot{constructor(e,t,i,s){this.response=e,this.result=t,this.participant=i,this.command=s}}var cb;(function(n){n[n.Panel=1]="Panel",n[n.Terminal=2]="Terminal",n[n.Notebook=3]="Notebook",n[n.Editor=4]="Editor"})(cb||(cb={}));var Iv;(function(n){n[n.User=1]="User",n[n.Assistant=2]="Assistant",n[n.System=3]="System"})(Iv||(Iv={}));let v8=class vke{static User(e,t){return new vke(Iv.User,e,t)}static Assistant(e,t){return new vke(Iv.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.name=i}};class I7t{constructor(e){this.content=e}}class L7t{constructor(e,t){this.content=e,this.name=t}}class T7t{constructor(e,t){this.content=e,this.name=t}}class qg extends Error{static NotFound(e){return new qg(e,qg.NotFound.name)}static NoPermissions(e){return new qg(e,qg.NoPermissions.name)}static Blocked(e){return new qg(e,qg.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}}var Nse;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Nse||(Nse={}));var Pse;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(Pse||(Pse={}));var wke;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(wke||(wke={}));var Fse;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped"})(Fse||(Fse={}));class R7t{constructor(e,t){this.text=e,this.range=t}}var wG;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(wG||(wG={}));var b2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(b2||(b2={}));var Fa;(function(n){n[n.UnknownInput=0]="UnknownInput",n[n.TextInput=1]="TextInput",n[n.TextDiffInput=2]="TextDiffInput",n[n.TextMergeInput=3]="TextMergeInput",n[n.NotebookInput=4]="NotebookInput",n[n.NotebookDiffInput=5]="NotebookDiffInput",n[n.CustomEditorInput=6]="CustomEditorInput",n[n.WebviewEditorInput=7]="WebviewEditorInput",n[n.TerminalEditorInput=8]="TerminalEditorInput",n[n.InteractiveEditorInput=9]="InteractiveEditorInput",n[n.ChatEditorInput=10]="ChatEditorInput",n[n.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(Fa||(Fa={}));var gu;(function(n){n[n.TAB_OPEN=0]="TAB_OPEN",n[n.TAB_CLOSE=1]="TAB_CLOSE",n[n.TAB_UPDATE=2]="TAB_UPDATE",n[n.TAB_MOVE=3]="TAB_MOVE"})(gu||(gu={}));var ol;(function(n){n[n.Int8Array=1]="Int8Array",n[n.Uint8Array=2]="Uint8Array",n[n.Uint8ClampedArray=3]="Uint8ClampedArray",n[n.Int16Array=4]="Int16Array",n[n.Uint16Array=5]="Uint16Array",n[n.Int32Array=6]="Int32Array",n[n.Uint32Array=7]="Uint32Array",n[n.Float32Array=8]="Float32Array",n[n.Float64Array=9]="Float64Array",n[n.BigInt64Array=10]="BigInt64Array",n[n.BigUint64Array=11]="BigUint64Array"})(ol||(ol={}));var C2;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(C2||(C2={}));var UM;(function(n){n[n.None=0]="None",n[n.Process=1]="Process",n[n.Output=2]="Output",n[n.Hybrid=3]="Hybrid"})(UM||(UM={}));var Fi;(function(n){n.label="a",n.kind="b",n.detail="c",n.documentation="d",n.sortText="e",n.filterText="f",n.preselect="g",n.insertText="h",n.insertTextRules="i",n.range="j",n.commitCharacters="k",n.additionalTextEdits="l",n.kindModifier="m",n.commandIdent="n",n.commandId="o",n.commandArguments="p"})(Fi||(Fi={}));var aS;(function(n){n.defaultRanges="a",n.completions="b",n.isIncomplete="c",n.duration="d"})(aS||(aS={}));const Ue={MainThreadAuthentication:Xe("MainThreadAuthentication"),MainThreadBulkEdits:Xe("MainThreadBulkEdits"),MainThreadLanguageModels:Xe("MainThreadLanguageModels"),MainThreadEmbeddings:Xe("MainThreadEmbeddings"),MainThreadChatAgents2:Xe("MainThreadChatAgents2"),MainThreadChatVariables:Xe("MainThreadChatVariables"),MainThreadClipboard:Xe("MainThreadClipboard"),MainThreadCommands:Xe("MainThreadCommands"),MainThreadComments:Xe("MainThreadComments"),MainThreadConfiguration:Xe("MainThreadConfiguration"),MainThreadConsole:Xe("MainThreadConsole"),MainThreadDebugService:Xe("MainThreadDebugService"),MainThreadDecorations:Xe("MainThreadDecorations"),MainThreadDiagnostics:Xe("MainThreadDiagnostics"),MainThreadDialogs:Xe("MainThreadDiaglogs"),MainThreadDocuments:Xe("MainThreadDocuments"),MainThreadDocumentContentProviders:Xe("MainThreadDocumentContentProviders"),MainThreadTextEditors:Xe("MainThreadTextEditors"),MainThreadEditorInsets:Xe("MainThreadEditorInsets"),MainThreadEditorTabs:Xe("MainThreadEditorTabs"),MainThreadErrors:Xe("MainThreadErrors"),MainThreadTreeViews:Xe("MainThreadTreeViews"),MainThreadDownloadService:Xe("MainThreadDownloadService"),MainThreadLanguageFeatures:Xe("MainThreadLanguageFeatures"),MainThreadLanguages:Xe("MainThreadLanguages"),MainThreadLogger:Xe("MainThreadLogger"),MainThreadMessageService:Xe("MainThreadMessageService"),MainThreadOutputService:Xe("MainThreadOutputService"),MainThreadProgress:Xe("MainThreadProgress"),MainThreadQuickDiff:Xe("MainThreadQuickDiff"),MainThreadQuickOpen:Xe("MainThreadQuickOpen"),MainThreadStatusBar:Xe("MainThreadStatusBar"),MainThreadSecretState:Xe("MainThreadSecretState"),MainThreadStorage:Xe("MainThreadStorage"),MainThreadSpeech:Xe("MainThreadSpeechProvider"),MainThreadTelemetry:Xe("MainThreadTelemetry"),MainThreadTerminalService:Xe("MainThreadTerminalService"),MainThreadTerminalShellIntegration:Xe("MainThreadTerminalShellIntegration"),MainThreadWebviews:Xe("MainThreadWebviews"),MainThreadWebviewPanels:Xe("MainThreadWebviewPanels"),MainThreadWebviewViews:Xe("MainThreadWebviewViews"),MainThreadCustomEditors:Xe("MainThreadCustomEditors"),MainThreadUrls:Xe("MainThreadUrls"),MainThreadUriOpeners:Xe("MainThreadUriOpeners"),MainThreadProfileContentHandlers:Xe("MainThreadProfileContentHandlers"),MainThreadWorkspace:Xe("MainThreadWorkspace"),MainThreadFileSystem:Xe("MainThreadFileSystem"),MainThreadFileSystemEventService:Xe("MainThreadFileSystemEventService"),MainThreadExtensionService:Xe("MainThreadExtensionService"),MainThreadSCM:Xe("MainThreadSCM"),MainThreadSearch:Xe("MainThreadSearch"),MainThreadShare:Xe("MainThreadShare"),MainThreadTask:Xe("MainThreadTask"),MainThreadWindow:Xe("MainThreadWindow"),MainThreadLabelService:Xe("MainThreadLabelService"),MainThreadNotebook:Xe("MainThreadNotebook"),MainThreadNotebookDocuments:Xe("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:Xe("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:Xe("MainThreadNotebookKernels"),MainThreadNotebookRenderers:Xe("MainThreadNotebookRenderers"),MainThreadInteractive:Xe("MainThreadInteractive"),MainThreadTheming:Xe("MainThreadTheming"),MainThreadTunnelService:Xe("MainThreadTunnelService"),MainThreadManagedSockets:Xe("MainThreadManagedSockets"),MainThreadTimeline:Xe("MainThreadTimeline"),MainThreadTesting:Xe("MainThreadTesting"),MainThreadLocalization:Xe("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:Xe("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:Xe("MainThreadAiEmbeddingVector")},et={ExtHostCommands:Xe("ExtHostCommands"),ExtHostConfiguration:Xe("ExtHostConfiguration"),ExtHostDiagnostics:Xe("ExtHostDiagnostics"),ExtHostDebugService:Xe("ExtHostDebugService"),ExtHostDecorations:Xe("ExtHostDecorations"),ExtHostDocumentsAndEditors:Xe("ExtHostDocumentsAndEditors"),ExtHostDocuments:Xe("ExtHostDocuments"),ExtHostDocumentContentProviders:Xe("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:Xe("ExtHostDocumentSaveParticipant"),ExtHostEditors:Xe("ExtHostEditors"),ExtHostTreeViews:Xe("ExtHostTreeViews"),ExtHostFileSystem:Xe("ExtHostFileSystem"),ExtHostFileSystemInfo:Xe("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:Xe("ExtHostFileSystemEventService"),ExtHostLanguages:Xe("ExtHostLanguages"),ExtHostLanguageFeatures:Xe("ExtHostLanguageFeatures"),ExtHostQuickOpen:Xe("ExtHostQuickOpen"),ExtHostQuickDiff:Xe("ExtHostQuickDiff"),ExtHostStatusBar:Xe("ExtHostStatusBar"),ExtHostShare:Xe("ExtHostShare"),ExtHostExtensionService:Xe("ExtHostExtensionService"),ExtHostLogLevelServiceShape:Xe("ExtHostLogLevelServiceShape"),ExtHostTerminalService:Xe("ExtHostTerminalService"),ExtHostTerminalShellIntegration:Xe("ExtHostTerminalShellIntegration"),ExtHostSCM:Xe("ExtHostSCM"),ExtHostSearch:Xe("ExtHostSearch"),ExtHostTask:Xe("ExtHostTask"),ExtHostWorkspace:Xe("ExtHostWorkspace"),ExtHostWindow:Xe("ExtHostWindow"),ExtHostWebviews:Xe("ExtHostWebviews"),ExtHostWebviewPanels:Xe("ExtHostWebviewPanels"),ExtHostCustomEditors:Xe("ExtHostCustomEditors"),ExtHostWebviewViews:Xe("ExtHostWebviewViews"),ExtHostEditorInsets:Xe("ExtHostEditorInsets"),ExtHostEditorTabs:Xe("ExtHostEditorTabs"),ExtHostProgress:Xe("ExtHostProgress"),ExtHostComments:Xe("ExtHostComments"),ExtHostSecretState:Xe("ExtHostSecretState"),ExtHostStorage:Xe("ExtHostStorage"),ExtHostUrls:Xe("ExtHostUrls"),ExtHostUriOpeners:Xe("ExtHostUriOpeners"),ExtHostProfileContentHandlers:Xe("ExtHostProfileContentHandlers"),ExtHostOutputService:Xe("ExtHostOutputService"),ExtHostLabelService:Xe("ExtHostLabelService"),ExtHostNotebook:Xe("ExtHostNotebook"),ExtHostNotebookDocuments:Xe("ExtHostNotebookDocuments"),ExtHostNotebookEditors:Xe("ExtHostNotebookEditors"),ExtHostNotebookKernels:Xe("ExtHostNotebookKernels"),ExtHostNotebookRenderers:Xe("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:Xe("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:Xe("ExtHostInteractive"),ExtHostChatAgents2:Xe("ExtHostChatAgents"),ExtHostChatVariables:Xe("ExtHostChatVariables"),ExtHostChatProvider:Xe("ExtHostChatProvider"),ExtHostSpeech:Xe("ExtHostSpeech"),ExtHostEmbeddings:Xe("ExtHostEmbeddings"),ExtHostAiRelatedInformation:Xe("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:Xe("ExtHostAiEmbeddingVector"),ExtHostTheming:Xe("ExtHostTheming"),ExtHostTunnelService:Xe("ExtHostTunnelService"),ExtHostManagedSockets:Xe("ExtHostManagedSockets"),ExtHostAuthentication:Xe("ExtHostAuthentication"),ExtHostTimeline:Xe("ExtHostTimeline"),ExtHostTesting:Xe("ExtHostTesting"),ExtHostTelemetry:Xe("ExtHostTelemetry"),ExtHostLocalization:Xe("ExtHostLocalization")};var Ose;(function(n){n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None"})(Ose||(Ose={}));let bke;function Wot(n){bke=n}function tu(n){return new Proxy({},{get(e,t){if(bke==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return bke[n][t]}})}const M7t={version:"1.90.2",tasks:tu("tasks"),notebooks:tu("notebooks"),scm:tu("scm"),comments:tu("comments"),authentication:tu("authentication"),tests:tu("tests"),extensions:tu("extensions"),debug:tu("debug"),env:tu("env"),commands:tu("commands"),window:tu("window"),workspace:tu("workspace"),languages:tu("languages"),l10n:tu("l10n"),interactive:tu("interactive"),ai:tu("ai"),chat:tu("chat"),speech:tu("speech"),Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:gOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:fOe,CancellationError:Tc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ya,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CompletionItem:H6,CompletionItemKind:nn,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:vm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,IndentAction:Ga,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:pOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentDropEdit:_se,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:mOe,NotebookRendererScript:vOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:_Oe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestMessage2:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,FileCoverage:uG,StatementCoverage:Tot,BranchCoverage:Rot,FunctionCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:wOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:bOe,TabInputTerminal:COe,TabInputInteractiveWindow:yOe,TabInputChat:SOe,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,RelatedInformationType:Nse,SpeechToTextStatus:Pse,KeywordRecognitionStatus:Fse},{version:N7t,tasks:P7t,notebooks:F7t,scm:O7t,comments:B7t,authentication:W7t,tests:H7t,extensions:U7t,debug:V7t,env:z7t,commands:$7t,window:G7t,workspace:q7t,languages:Q7t,l10n:j7t,interactive:K7t,ai:Y7t,chat:J7t,speech:X7t,Breakpoint:Z7t,TerminalOutputAnchor:e6t,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,ChatCompletionItem:n6t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentHighlight:V6t,DocumentHighlightKind:z6t,MultiDocumentHighlight:$6t,DocumentLink:G6t,DocumentSymbol:q6t,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InlineValueEvaluatableExpression:X6t,InlineCompletionTriggerKind:Z6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileDecoration:oGt,FileDecoration2:rGt,FileSystemError:aGt,FileType:cGt,FilePermission:lGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,InlineCompletionItem:gGt,InlineCompletionList:fGt,Hover:pGt,IndentAction:mGt,Location:_Gt,MarkdownString:vGt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,Range:xGt,RelativePattern:DGt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SourceBreakpoint:UGt,StandardTokenType:VGt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TerminalLink:XGt,TerminalQuickFixTerminalCommand:ZGt,TerminalQuickFixOpener:eqt,TerminalLocation:tqt,TerminalProfile:iqt,TerminalExitReason:nqt,TextDocumentSaveReason:sqt,TextEdit:oqt,SnippetTextEdit:rqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,SyntaxTokenType:hqt,TextDocumentChangeReason:uqt,ThemeColor:gqt,ThemeIcon:fqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,DocumentDropEdit:Sqt,DocumentPasteEdit:Aqt,InlayHint:Eqt,InlayHintLabelPart:xqt,InlayHintKind:Dqt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,ManagedResolvedAuthority:Lqt,SourceControlInputBoxValidationType:Tqt,ExtensionRuntime:Rqt,TimelineItem:Mqt,NotebookRange:Nqt,NotebookCellKind:Pqt,NotebookCellExecutionState:Fqt,NotebookCellData:Oqt,NotebookData:Bqt,NotebookRendererScript:Wqt,NotebookCellStatusBarAlignment:Hqt,NotebookEditorRevealType:Uqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookEdit:Qqt,NotebookKernelSourceAction:jqt,PortAttributes:Kqt,LinkedEditingRanges:Yqt,TestResultState:Jqt,TestRunRequest:Xqt,TestMessage:Zqt,TestMessage2:eQt,TestTag:tQt,TestRunProfileKind:iQt,TextSearchCompleteMessageType:nQt,DataTransfer:sQt,DataTransferItem:oQt,FileCoverage:rQt,StatementCoverage:aQt,BranchCoverage:cQt,FunctionCoverage:lQt,WorkspaceTrustState:dQt,LanguageStatusSeverity:hQt,QuickPickItemKind:uQt,InputBoxValidationSeverity:gQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputCustom:_Qt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputWebview:bQt,TabInputTerminal:CQt,TabInputInteractiveWindow:yQt,TabInputChat:SQt,TelemetryTrustedValue:AQt,LogLevel:EQt,EditSessionIdentityMatch:xQt,InteractiveSessionVoteDirection:DQt,ChatCopyKind:kQt,InteractiveEditorResponseFeedbackKind:IQt,RelatedInformationType:LQt,SpeechToTextStatus:TQt,KeywordRecognitionStatus:RQt}=M7t,MQt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:cQt,Breakpoint:Z7t,CallHierarchyIncomingCall:s6t,CallHierarchyItem:o6t,CallHierarchyOutgoingCall:r6t,CancellationError:a6t,CancellationTokenSource:c6t,CandidatePortSource:l6t,ChatCompletionItem:n6t,ChatCopyKind:kQt,ChatResultFeedbackKind:t6t,ChatVariableLevel:i6t,CodeAction:d6t,CodeActionKind:h6t,CodeActionTriggerKind:u6t,CodeLens:g6t,Color:f6t,ColorInformation:p6t,ColorPresentation:m6t,ColorThemeKind:_6t,CommentMode:v6t,CommentState:w6t,CommentThreadCollapsibleState:b6t,CommentThreadState:C6t,CompletionItem:y6t,CompletionItemKind:S6t,CompletionItemTag:A6t,CompletionList:E6t,CompletionTriggerKind:x6t,ConfigurationTarget:D6t,CustomExecution:k6t,DataTransfer:sQt,DataTransferItem:oQt,DebugAdapterExecutable:I6t,DebugAdapterInlineImplementation:L6t,DebugAdapterNamedPipeServer:T6t,DebugAdapterServer:R6t,DebugConfigurationProviderTriggerKind:M6t,DebugConsoleMode:N6t,DebugVisualization:P6t,DecorationRangeBehavior:F6t,Diagnostic:O6t,DiagnosticRelatedInformation:B6t,DiagnosticSeverity:W6t,DiagnosticTag:H6t,Disposable:U6t,DocumentDropEdit:Sqt,DocumentHighlight:V6t,DocumentHighlightKind:z6t,DocumentLink:G6t,DocumentPasteEdit:Aqt,DocumentSymbol:q6t,EditSessionIdentityMatch:xQt,EndOfLine:Q6t,EnvironmentVariableMutatorType:j6t,EvaluatableExpression:K6t,EventEmitter:eGt,ExtensionKind:tGt,ExtensionMode:iGt,ExtensionRuntime:Rqt,ExternalUriOpenerPriority:nGt,FileChangeType:sGt,FileCoverage:rQt,FileDecoration:oGt,FileDecoration2:rGt,FilePermission:lGt,FileSystemError:aGt,FileType:cGt,FoldingRange:dGt,FoldingRangeKind:hGt,FunctionBreakpoint:uGt,FunctionCoverage:lQt,Hover:pGt,IndentAction:mGt,InlayHint:Eqt,InlayHintKind:Dqt,InlayHintLabelPart:xqt,InlineCompletionItem:gGt,InlineCompletionList:fGt,InlineCompletionTriggerKind:Z6t,InlineValueEvaluatableExpression:X6t,InlineValueText:Y6t,InlineValueVariableLookup:J6t,InputBoxValidationSeverity:gQt,InteractiveEditorResponseFeedbackKind:IQt,InteractiveSessionVoteDirection:DQt,KeywordRecognitionStatus:RQt,LanguageStatusSeverity:hQt,LinkedEditingRanges:Yqt,Location:_Gt,LogLevel:EQt,ManagedResolvedAuthority:Lqt,MarkdownString:vGt,MultiDocumentHighlight:$6t,NotebookCellData:Oqt,NotebookCellExecutionState:Fqt,NotebookCellKind:Pqt,NotebookCellOutput:Vqt,NotebookCellOutputItem:zqt,NotebookCellStatusBarAlignment:Hqt,NotebookCellStatusBarItem:$qt,NotebookControllerAffinity:Gqt,NotebookControllerAffinity2:qqt,NotebookData:Bqt,NotebookEdit:Qqt,NotebookEditorRevealType:Uqt,NotebookKernelSourceAction:jqt,NotebookRange:Nqt,NotebookRendererScript:Wqt,OverviewRulerLane:wGt,ParameterInformation:bGt,PortAttributes:Kqt,PortAutoForwardAction:CGt,Position:yGt,ProcessExecution:SGt,ProgressLocation:AGt,QuickInputButtons:EGt,QuickPickItemKind:uQt,Range:xGt,RelatedInformationType:LQt,RelativePattern:DGt,RemoteAuthorityResolverError:kqt,ResolvedAuthority:Iqt,Selection:kGt,SelectionRange:IGt,SemanticTokens:LGt,SemanticTokensBuilder:TGt,SemanticTokensEdit:RGt,SemanticTokensEdits:MGt,SemanticTokensLegend:NGt,ShellExecution:PGt,ShellQuoting:FGt,SignatureHelp:OGt,SignatureHelpTriggerKind:BGt,SignatureInformation:WGt,SnippetString:HGt,SnippetTextEdit:rqt,SourceBreakpoint:UGt,SourceControlInputBoxValidationType:Tqt,SpeechToTextStatus:TQt,StandardTokenType:VGt,StatementCoverage:aQt,StatusBarAlignment:zGt,SymbolInformation:$Gt,SymbolKind:GGt,SymbolTag:qGt,SyntaxTokenType:hqt,TabInputChat:SQt,TabInputCustom:_Qt,TabInputInteractiveWindow:yQt,TabInputNotebook:vQt,TabInputNotebookDiff:wQt,TabInputTerminal:CQt,TabInputText:fQt,TabInputTextDiff:pQt,TabInputTextMerge:mQt,TabInputWebview:bQt,Task:QGt,TaskGroup:jGt,TaskPanelKind:KGt,TaskRevealKind:YGt,TaskScope:JGt,TelemetryTrustedValue:AQt,TerminalExitReason:nqt,TerminalLink:XGt,TerminalLocation:tqt,TerminalOutputAnchor:e6t,TerminalProfile:iqt,TerminalQuickFixOpener:eqt,TerminalQuickFixTerminalCommand:ZGt,TestMessage:Zqt,TestMessage2:eQt,TestResultState:Jqt,TestRunProfileKind:iQt,TestRunRequest:Xqt,TestTag:tQt,TextDocumentChangeReason:uqt,TextDocumentSaveReason:sqt,TextEdit:oqt,TextEditorCursorStyle:aqt,TextEditorLineNumbersStyle:cqt,TextEditorRevealType:lqt,TextEditorSelectionChangeKind:dqt,TextSearchCompleteMessageType:nQt,ThemeColor:gqt,ThemeIcon:fqt,TimelineItem:Mqt,TreeItem:pqt,TreeItemCheckboxState:mqt,TreeItemCollapsibleState:_qt,TypeHierarchyItem:vqt,UIKind:wqt,Uri:bqt,ViewColumn:Cqt,WorkspaceEdit:yqt,WorkspaceTrustState:dQt,ai:Y7t,authentication:W7t,chat:J7t,commands:$7t,comments:B7t,debug:V7t,env:z7t,extensions:U7t,interactive:K7t,l10n:j7t,languages:Q7t,notebooks:F7t,scm:O7t,setDefaultApi:Wot,speech:X7t,tasks:P7t,tests:H7t,version:N7t,window:G7t,workspace:q7t},Symbol.toStringTag,{value:"Module"}));bMt(async({toAdd:n,toRemove:e})=>{await znt(),await Lt.get(ho).deltaExtensions(n,e)},(n,e)=>({toAdd:[...n.toAdd,...e.toAdd],toRemove:[...n.toRemove,...e.toRemove]}),0);const NQt=new Map;function PQt(n){return NQt.get(n)}let _$e=class extends ${constructor(e,t,i){super(),this.fileService=t,this.languagePackService=i}async $fetchBuiltInBundleUri(e,t){try{return await this.languagePackService.getBuiltInExtensionTranslationsUri(e,t)}catch{return}}async $fetchBundleContents(e){return(await this.fileService.readFile(P.revive(e))).value.toString()}};_$e=D([en(Ue.MainThreadLocalization),_(1,ci),_(2,LZe)],_$e);class tj{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var z3;const FQt="vs/workbench/contrib/notebook/common/notebookEditorInput";var TP;let VM=(TP=class extends _ne{static getOrCreate(e,t,i,s,o={}){const r=e.createInstance(z3,t,i,s,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=s,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this._editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!s.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(bt)}),this._register(h.onWillStop(m=>{this.isDirty()&&m.veto((async()=>{const v=u.findEditors(this);return!(v.length>0&&(await u.save(v[0])).success)})(),g(FQt,0,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,super.dispose()}get typeId(){return z3.ID}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),this._editorModelReference?this._editorModelReference.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}getDescription(e=Gs.MEDIUM){if(!this.hasCapability(Mi.Untitled)||this._editorModelReference?.object.hasAssociatedFilePath())return super.getDescription(e)}isReadonly(){return this._editorModelReference?this._editorModelReference.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._editorModelReference?this._editorModelReference.object.isDirty():this._defaultDirtyState}isSaving(){const e=this._editorModelReference?.object;return!e||!e.isDirty()||e.hasErrorState||this.hasCapability(Mi.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.object.save(t),this)}async saveAs(e,t){if(!this._editorModelReference)return;const i=this._notebookService.getContributedNotebookType(this.viewType);if(!i)return;const s=this.hasCapability(Mi.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this._editorModelReference.object.resource;let o;if(this._editorModelReference.object.hasAssociatedFilePath())o=s;else if(o=await this._fileDialogService.pickFileToSave(s,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:NYe(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${o} is not supported by ${i.providerDisplayName}. Please make sure the file name matches following patterns: -${r}`)}return await this._editorModelReference.object.saveAs(o)}async _suggestName(e,t){const i=e.selectors[0];let s=i&&typeof i=="string"?i:void 0;if(!s&&i){const o=i.include;typeof o=="string"&&(s=o)}if(s){const o=/^\*\.([A-Za-z_-]*)$/.exec(s);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return qt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return qt(await this._fileDialogService.defaultFilePath(),t)}async rename(e,t){if(this._editorModelReference)return{editor:{resource:t},options:{override:this.viewType}}}async revert(e,t){this._editorModelReference&&this._editorModelReference.object.isDirty()&&await this._editorModelReference.object.revert(t)}async resolve(e,t){if(!await this._notebookService.canResolve(this.viewType))return null;if(t?.mark("extensionActivated"),this._sideLoadedListener.dispose(),this._editorModelReference)this._editorModelReference.object.load({limits:this.ensureLimits(e)});else{const i=await this._notebookModelResolverService.resolve(this.resource,this.viewType,this.ensureLimits(e));if(this._editorModelReference)return i.dispose(),this._editorModelReference.object;if(this._editorModelReference=i,this.isDisposed())return this._editorModelReference.dispose(),this._editorModelReference=null,null;this._register(this._editorModelReference.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._editorModelReference.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._register(this._editorModelReference.object.onDidRevertUntitled(()=>this.dispose())),this._editorModelReference.object.isDirty()&&this._onDidChangeDirty.fire()}if(this.options._backupId){const i=await this._notebookService.withNotebookDataProvider(this._editorModelReference.object.notebook.viewType);if(!(i instanceof tj))throw new Error("CANNOT open file notebook with this provider");const s=await i.serializer.dataToNotebook(ze.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this._editorModelReference.object.notebook.applyEdits([{editType:G1.Replace,index:0,count:this._editorModelReference.object.notebook.length,cells:s.cells}],!0,void 0,()=>{},void 0,!1),this.options._workingCopy&&(this.options._backupId=void 0,this.options._workingCopy=void 0,this.options.startDirty=void 0)}return this._editorModelReference.object}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}matches(e){return super.matches(e)?!0:e instanceof z3?this.viewType===e.viewType&&_n(this.resource,e.resource):!1}},z3=TP,TP.ID="workbench.input.notebook",TP);VM=z3=D([_(4,oD),_(5,Jde),_(6,bf),_(7,eo),_(8,ci),_(9,hh),_(10,ho),_(11,_i),_(12,dl),_(13,aD)],VM);function OQt(n){return!!n&&typeof n=="object"&&Array.isArray(n.editorInputs)&&n.editorInputs.every(e=>e instanceof VM)}const Hot="jupyter-notebook",BQt="ms-toolsai.jupyter",Uot=new Map;Uot.set(Hot,new Map);Uot.get(Hot)?.set("python",{extensionIds:["ms-python.python",BQt],displayName:"Python + Jupyter"});var v$e;(function(n){n[n.Html=0]="Html",n[n.Extension=1]="Extension"})(v$e||(v$e={}));var w$e;(function(n){n[n.fullCell=0]="fullCell",n[n.firstLine=1]="firstLine"})(w$e||(w$e={}));var b$e;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Estimated=1]="Estimated",n[n.FromCache=2]="FromCache",n[n.Measured=3]="Measured"})(b$e||(b$e={}));var C$e;(function(n){n[n.Fold=0]="Fold"})(C$e||(C$e={}));var y$e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(y$e||(y$e={}));var S$e;(function(n){n[n.Default=1]="Default",n[n.Top=2]="Top",n[n.Center=3]="Center",n[n.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",n[n.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",n[n.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(S$e||(S$e={}));var A$e;(function(n){n[n.Default=1]="Default",n[n.Center=2]="Center",n[n.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(A$e||(A$e={}));var E$e;(function(n){n[n.Preview=0]="Preview",n[n.Editing=1]="Editing"})(E$e||(E$e={}));var x$e;(function(n){n[n.Container=0]="Container",n[n.Editor=1]="Editor",n[n.Output=2]="Output",n[n.ChatInput=3]="ChatInput"})(x$e||(x$e={}));var D$e;(function(n){n[n.None=0]="None",n[n.Top=1]="Top",n[n.Bottom=2]="Bottom",n[n.Both=3]="Both"})(D$e||(D$e={}));var k$e;(function(n){n[n.None=0]="None",n[n.Start=1]="Start",n[n.End=2]="End",n[n.Both=3]="Both"})(k$e||(k$e={}));function tH(n){if(!n)return;if(n.getId()===g7t)return n.getControl();const e=n.input;if(e&&OQt(e))return n.getControl()?.notebookEditor}var I$e;(function(n){n[n.None=0]="None",n[n.Expanded=1]="Expanded",n[n.Collapsed=2]="Collapsed"})(I$e||(I$e={}));class iH extends _Q{static is(e){return e instanceof iH?!0:P.isUri(e.resource)&&fo(e.cellEdit)}static lift(e){return e instanceof iH?e:new iH(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let L$e=class{constructor(e,t,i,s,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=s,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Zne.scheme){const l=Zne.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new iH(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=yU(this._edits,(i,s)=>lw(i.resource.toString(),s.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[s]=i,o=await this._notebookModelService.resolve(s.resource);if(typeof s.notebookVersionId=="number"&&o.object.notebook.versionId!==s.notebookVersionId)throw o.dispose(),new Error(`Notebook '${s.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=tH(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:eke.Index,focus:c.getFocus(),selections:c.getSelections()}:void 0;o.object.notebook.applyEdits(r,!0,l,()=>{},this._undoRedoGroup,a),o.dispose(),this._progress.report(void 0),e.push(s.resource)}return e}};L$e=D([_(5,_i),_(6,Jde)],L$e);let T$e=class{constructor(e,t,i,s){this._bulkEditService=t,this._logService=i,this._uriIdentService=s}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const s=AS(e.value,this._uriIdentService);return this._bulkEditService.apply(s,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};T$e=D([Zi(Ue.MainThreadBulkEdits),_(1,vO),_(2,Ze),_(3,_o)],T$e);function AS(n,e,t){if(!n||!n.edits)return n;const i=Or(n);for(const s of i.edits){if(vS.is(s)&&(s.resource=e.asCanonicalUri(s.resource)),up.is(s)){if(s.options){const o=s.options?.contents;if(o)if(o.type==="base64")s.options.contents=Promise.resolve(Tje(o.value));else if(t)s.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}s.newResource=s.newResource&&e.asCanonicalUri(s.newResource),s.oldResource=s.oldResource&&e.asCanonicalUri(s.oldResource)}if(iH.is(s)){s.resource=e.asCanonicalUri(s.resource);const o=s.cellEdit;o.editType===G1.Replace&&(s.cellEdit={...o,cells:o.cells.map(r=>({...r,outputs:r.outputs.map(a=>({...a,outputs:a.items.map(c=>({mime:c.mime,data:c.valueBytes}))}))}))})}}return n}const tue="__",WQt="vs/workbench/api/browser/mainThreadLanguageModels";let R$e=class{constructor(e,t,i,s,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=s,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatProvider),this._proxy.$acceptChatModelMetadata({added:t.getLanguageModelIds().map(c=>({identifier:c,metadata:t.lookupLanguageModel(c)}))}),this._store.add(t.onDidChangeLanguageModels(this._proxy.$acceptChatModelMetadata,this._proxy))}dispose(){this._providerRegistrations.dispose(),this._store.dispose()}$registerLanguageModelProvider(e,t,i){const s=new Z;s.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,provideChatResponse:async(o,r,a,c,l)=>{const d=Math.random()*1e6|0;this._pendingProgress.set(d,c);try{await this._proxy.$provideLanguageModelResponse(e,d,r,o,a,l)}finally{this._pendingProgress.delete(d)}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&s.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,s)}async $handleProgressChunk(e,t){this._pendingProgress.get(e)?.report(t)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,s){this._languageModelStatsService.update(e,t,i,s)}async $fetchResponse(e,t,i,s,o,r){this._logService.debug("[CHAT] extension request STARTED",e.value,i);const a=this._chatProviderService.makeLanguageModelChatRequest(t,e,s,o,new cf(c=>{this._proxy.$handleResponseFragment(i,c)}),r);return a.catch(c=>{throw this._logService.error("[CHAT] extension request ERRORED",c,e.value,i),c}).finally(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i)}),a}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=tue+e.value;if(this._authenticationService.getProviderIds().includes(i))return $.None;const s=t.accountLabel??g(WQt,0,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new HQt(i,t.providerLabel,s)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,s),c=[];for(const l of a){const d=await this._extensionService.getExtension(l.id);d&&c.push({from:d.identifier,to:e,enabled:l.allowed??!0})}this._proxy.$updateModelAccesslist(c)})),o}};R$e=D([Zi(Ue.MainThreadLanguageModels),_(1,HZe),_(2,Ret),_(3,Ze),_(4,PPe),_(5,ehe),_(6,ho)],R$e);class HQt{constructor(e,t,i){this.id=e,this.label=t,this._accountLabel=i,this.supportsMultipleAccounts=!1,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event}async getSessions(e){return e===void 0&&!this._session?[]:this._session?[this._session]:[await this.createSession(e||[],{})]}async createSession(e,t){return this._session=this._createFakeSession(e),this._onDidChangeSessions.fire({added:[this._session],changed:[],removed:[]}),this._session}removeSession(e){return this._session&&(this._onDidChangeSessions.fire({added:[],changed:[],removed:[this._session]}),this._session=void 0),Promise.resolve()}_createFakeSession(e){return{id:"fake-session",account:{id:this.id,label:this._accountLabel},accessToken:"fake-access-token",scopes:e}}}var Cke;const M$e="vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables",UQt="chat-dynamic-variable";var RP;let bG=(RP=class extends ${get variables(){return[...this._variables]}get id(){return Cke.ID}constructor(e,t,i){super(),this.widget=e,this.labelService=t,this.logService=i,this._variables=[],this._register(e.inputEditor.onDidChangeModelContent(s=>{s.changes.forEach(o=>{this._variables=Ui(this._variables.map(r=>{const a=O.intersectRanges(r.range,o.range);if(a&&!a.isEmpty()){const c=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);return this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}]),null}else if(O.compareRangesUsingStarts(r.range,o.range)>0){const c=o.text.length-o.rangeLength;return{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r}))}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){if(!Array.isArray(e)){this.logService.warn("ChatDynamicVariableModel.setInputState called with invalid state: "+JSON.stringify(e));return}this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",UQt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return P.isUri(t)?new Xt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},Cke=RP,RP.ID="chatDynamicVariableModel",RP);bG=Cke=D([_(1,eo),_(2,Ze)],bG);A6.CONTRIBS.push(bG);function VQt(n){return"widget"in n&&"range"in n}const ty=class ty extends pi{constructor(){super({id:ty.ID,title:""})}async run(e,...t){const i=e.get(Rn),s=e.get(Ze),o=e.get(On),r=e.get(Mz),a=t[0];if(!VQt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(ty.Name)&&(l={providerOptions:{additionPicks:[ty.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){s.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===ty.Item){const w=`#${ty.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:w+" "}])||(s.trace(`SelectAndInsertFileAction: failed to insert "${w}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){s.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${ui(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){s.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(bG.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};ty.Name="files",ty.Item={label:g(M$e,0,"All Files"),description:g(M$e,1,"Search for relevant files in the workspace and provide context from them")},ty.ID="workbench.action.chat.selectAndInsertFile";let yke=ty;At(yke);function zQt(n){return"widget"in n&&"range"in n&&"variableData"in n}const nle=class nle extends pi{constructor(){super({id:nle.ID,title:""})}async run(e,...t){const i=t[0];if(!zQt(i))return;let s=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(Qi).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new O(s.startLineNumber,s.endColumn,s.endLineNumber,s.endColumn+l.length);if(s=new O(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(bG.ID)?.addReference({id:i.id,range:s,data:o})}};nle.ID="workbench.action.chat.addDynamicVariable";let Bse=nle;At(Bse);class $Qt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new sd,this._onDidAddProgress=new I,this.progress=[]}task(){return this.deferred.p}isSettled(){return this.deferred.isSettled}complete(e){this.deferred.complete(e)}add(e){this.progress.push(e),this._onDidAddProgress.fire(e)}}let N$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=s,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new Zo),this._agentCompletionProviders=this._register(new Zo),this._agentIdsToCompletionProviders=this._register(new Zo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(et.ExtHostChatAgents2),this._register(this._chatService.onDidDisposeSession(l=>{this._proxy.$releaseSession(l.sessionId)})),this._register(this._chatService.onDidPerformUserAction(l=>{if(typeof l.agentId=="string"){for(const[d,h]of this._agents)if(h.id===l.agentId){l.action.kind==="vote"?this._proxy.$acceptFeedback(d,l.result??{},l.action.direction):this._proxy.$acceptAction(d,l.result||{},l);break}}}))}$unregisterAgent(e){this._agents.deleteAndDispose(e)}$transferActiveChatSession(e){const t=this._chatWidgetService.lastFocusedWidget,i=t?.viewModel?.model.sessionId;if(!i){this._logService.error("MainThreadChat#$transferActiveChatSession: No active chat session found");return}const s=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:s},P.revive(e))}$registerAgent(e,t,i,s,o){const r=this._chatAgentService.getAgent(i);if(!r&&!o)throw this._chatAgentService.getAgentsByName(i).length?new Error(`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${i}"`):new Error(`chatParticipant must be declared in package.json: ${i}`);const a={invoke:async(l,d,h,u)=>{this._pendingProgress.set(l.requestId,d);try{return await this._proxy.$invokeAgent(e,l,{history:h},u)??{}}finally{this._pendingProgress.delete(l.requestId)}},provideFollowups:async(l,d,h,u)=>this._agents.get(e)?.hasFollowups?this._proxy.$provideFollowups(l,e,d,{history:h},u):[],provideWelcomeMessage:(l,d)=>this._proxy.$provideWelcomeMessage(e,l,d),provideSampleQuestions:(l,d)=>this._proxy.$provideSampleQuestions(e,l,d)};let c;if(!r&&o){const l=this._extensionService.extensions.find(d=>Cn.equals(d.identifier,t));c=this._chatAgentService.registerDynamicAgent({id:i,name:o.name??"",description:o.description,extensionId:t,extensionDisplayName:l?.displayName??t.value,extensionPublisherId:l?.publisher??"",publisherDisplayName:o.publisherName,fullName:o.fullName,metadata:Or(s),slashCommands:[],locations:[cc.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:s.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i)throw new Error(`No agent with handle ${e} registered`);i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Or(t))}async $handleProgressChunk(e,t,i){const s=Or(t);if(s.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new $Qt(s.content);return this._activeTasks.set(r,a),this._pendingProgress.get(e)?.(a),o}else if(i!==void 0){const o=`${e}_${i}`,r=this._activeTasks.get(o);switch(s.kind){case"progressTaskResult":return r&&s.content?(r.complete(s.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(s);return}}this._pendingProgress.get(e)?.(s)}$registerAgentCompletionsProvider(e,t,i){const s=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?$e.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,s)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:b6.INPUT_SCHEME,hasAccessToAllModels:!0},{_debugDisplayName:"chatAgentCompletions:"+e,triggerCharacters:i,provideCompletionItems:async(o,r,a,c)=>{const l=this._chatWidgetService.getWidgetByInputUri(o.uri);if(!l||!l.viewModel)return;const d=i.map(C=>Iu(C)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=a1(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(C=>u.startsWith(C)))return;const p=this._instantiationService.createInstance(mne).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(C=>C instanceof tp),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=GQt(o,r,h);return v?{suggestions:(await s(u,c)).map(C=>{const y=C.insertText??(typeof C.label=="string"?C.label:C.label.label),S=new O(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+y.length);return{label:C.label,range:v,insertText:y+" ",kind:Ne.Text,detail:C.detail,documentation:C.documentation,command:{id:Bse.ID,title:"",arguments:[{id:C.id,widget:l,range:S,variableData:Or(C.value),command:C.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};N$e=D([Zi(Ue.MainThreadChatAgents2),_(1,yp),_(2,Rw),_(3,ht),_(4,lL),_(5,be),_(6,Ze),_(7,ho)],N$e);function GQt(n,e,t){const i=a1(e.column,t,n.getLineContent(e.lineNumber),0);if(!i&&n.getWordUntilPosition(e).word)return;let s,o;return i?(s=new O(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new O(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):s=o=O.fromPositions(e),{insert:s,replace:o}}let P$e=class{constructor(e,t){this._chatVariablesService=t,this._variables=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(s,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Or(await this._proxy.$resolveVariable(e,l,s,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Or(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}$attachContext(e,t,i){this._chatVariablesService.attachContext(e,Or(t),i)}};P$e=D([Zi(Ue.MainThreadChatVariables),_(1,Mz)],P$e);const Vot=ae("embeddingsService");class qQt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.providers=new Map}get allProviders(){return this.providers.keys()}registerProvider(e,t){return this.providers.set(e,t),this._onDidChange.fire(),{dispose:()=>{this.providers.delete(e),this._onDidChange.fire()}}}computeEmbeddings(e,t,i){const s=this.providers.get(e);return s?s.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(Vot,qQt,Kt.Delayed);let F$e=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new Zo),this._proxy=e.getProxy(et.ExtHostEmbeddings),this._store.add(t.onDidChange(()=>{this._proxy.$acceptEmbeddingModels(Array.from(t.allProviders))}))}dispose(){this._store.dispose()}$registerEmbeddingProvider(e,t){const i=this.embeddingsService.registerProvider(t,{provideEmbeddings:(s,o)=>this._proxy.$provideEmbeddings(e,s,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};F$e=D([Zi(Ue.MainThreadEmbeddings),_(1,Vot)],F$e);class QQt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function zot(n,e){if(e.serializeBuffersForPostMessage){const t=new QQt,s=JSON.stringify(n,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=jQt(a);if(c)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:c,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),o=t.buffers.map(r=>{const a=new Uint8Array(r);return ze.wrap(a)});return{message:s,buffers:o}}else return{message:JSON.stringify(n),buffers:[]}}function jQt(n){switch(n.constructor.name){case"Int8Array":return ol.Int8Array;case"Uint8Array":return ol.Uint8Array;case"Uint8ClampedArray":return ol.Uint8ClampedArray;case"Int16Array":return ol.Int16Array;case"Uint16Array":return ol.Uint16Array;case"Int32Array":return ol.Int32Array;case"Uint32Array":return ol.Uint32Array;case"Float32Array":return ol.Float32Array;case"Float64Array":return ol.Float64Array;case"BigInt64Array":return ol.BigInt64Array;case"BigUint64Array":return ol.BigUint64Array}}function $ot(n,e){const t=e.map(o=>{const r=new ArrayBuffer(o.byteLength);return new Uint8Array(r).set(o.buffer),r}),i=e.length?(o,r)=>{if(r&&typeof r=="object"&&r.$$vscode_array_buffer_reference$$){const a=r,{index:c}=a,l=t[c];if(a.view)switch(a.view.type){case ol.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case ol.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case ol.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case ol.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case ol.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case ol.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case ol.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case ol.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case ol.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case ol.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case ol.BigUint64Array:return new BigUint64Array(l,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return l}return r}:void 0;return{message:JSON.parse(n,i),arrayBuffers:t}}var Ske;const KQt="vs/workbench/api/browser/mainThreadWebviews";var MP;let Ake=(MP=class extends ${constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(et.ExtHostWebviews)}addWebview(e,t,i){if(this._webviews.has(e))throw new Error("Webview already registered");this._webviews.set(e,t),this.hookupWebviewEventDelegate(e,t,i)}$setHtml(e,t){this.tryGetWebview(e)?.setHtml(t)}$setOptions(e,t){const i=this.tryGetWebview(e);i&&(i.contentOptions=Hse(t))}async $postMessage(e,t,...i){const s=this.tryGetWebview(e);if(!s)return!1;const{message:o,arrayBuffers:r}=$ot(t,i);return s.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const s=new Z;s.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),s.add(t.onMessage(o=>{const r=zot(o.message,i);this._proxy.$onMessage(e,r.message,new $h(r.buffers))})),s.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),s.add(t.onDidDispose(()=>{s.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,P.parse(t))&&this._openerService.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Array.isArray(i.contentOptions.enableCommandUris)||i.contentOptions.enableCommandUris===!0,fromWorkspace:!0})}isSupportedLink(e,t){return Ske.standardSupportedLinkSchemes.has(t.scheme)||!Jn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===_e.command?Array.isArray(e.contentOptions.enableCommandUris)?e.contentOptions.enableCommandUris.includes(t.path):e.contentOptions.enableCommandUris===!0:!1}tryGetWebview(e){return this._webviews.get(e)}getWebview(e){const t=this.tryGetWebview(e);if(!t)throw new Error(`Unknown webview handle:${e}`);return t}getWebviewResolvedFailedContent(e){return` +${r}`)}return await this._editorModelReference.object.saveAs(o)}async _suggestName(e,t){const i=e.selectors[0];let s=i&&typeof i=="string"?i:void 0;if(!s&&i){const o=i.include;typeof o=="string"&&(s=o)}if(s){const o=/^\*\.([A-Za-z_-]*)$/.exec(s);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return Qt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return Qt(await this._fileDialogService.defaultFilePath(),t)}async rename(e,t){if(this._editorModelReference)return{editor:{resource:t},options:{override:this.viewType}}}async revert(e,t){this._editorModelReference&&this._editorModelReference.object.isDirty()&&await this._editorModelReference.object.revert(t)}async resolve(e,t){if(!await this._notebookService.canResolve(this.viewType))return null;if(t?.mark("extensionActivated"),this._sideLoadedListener.dispose(),this._editorModelReference)this._editorModelReference.object.load({limits:this.ensureLimits(e)});else{const i=await this._notebookModelResolverService.resolve(this.resource,this.viewType,this.ensureLimits(e));if(this._editorModelReference)return i.dispose(),this._editorModelReference.object;if(this._editorModelReference=i,this.isDisposed())return this._editorModelReference.dispose(),this._editorModelReference=null,null;this._register(this._editorModelReference.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._editorModelReference.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._register(this._editorModelReference.object.onDidRevertUntitled(()=>this.dispose())),this._editorModelReference.object.isDirty()&&this._onDidChangeDirty.fire()}if(this.options._backupId){const i=await this._notebookService.withNotebookDataProvider(this._editorModelReference.object.notebook.viewType);if(!(i instanceof tj))throw new Error("CANNOT open file notebook with this provider");const s=await i.serializer.dataToNotebook(ze.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this._editorModelReference.object.notebook.applyEdits([{editType:G1.Replace,index:0,count:this._editorModelReference.object.notebook.length,cells:s.cells}],!0,void 0,()=>{},void 0,!1),this.options._workingCopy&&(this.options._backupId=void 0,this.options._workingCopy=void 0,this.options.startDirty=void 0)}return this._editorModelReference.object}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}matches(e){return super.matches(e)?!0:e instanceof z3?this.viewType===e.viewType&&_n(this.resource,e.resource):!1}},z3=TP,TP.ID="workbench.input.notebook",TP);VM=z3=D([_(4,oD),_(5,Jde),_(6,bf),_(7,eo),_(8,ci),_(9,hh),_(10,ho),_(11,_i),_(12,dl),_(13,aD)],VM);function OQt(n){return!!n&&typeof n=="object"&&Array.isArray(n.editorInputs)&&n.editorInputs.every(e=>e instanceof VM)}const Hot="jupyter-notebook",BQt="ms-toolsai.jupyter",Uot=new Map;Uot.set(Hot,new Map);Uot.get(Hot)?.set("python",{extensionIds:["ms-python.python",BQt],displayName:"Python + Jupyter"});var v$e;(function(n){n[n.Html=0]="Html",n[n.Extension=1]="Extension"})(v$e||(v$e={}));var w$e;(function(n){n[n.fullCell=0]="fullCell",n[n.firstLine=1]="firstLine"})(w$e||(w$e={}));var b$e;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Estimated=1]="Estimated",n[n.FromCache=2]="FromCache",n[n.Measured=3]="Measured"})(b$e||(b$e={}));var C$e;(function(n){n[n.Fold=0]="Fold"})(C$e||(C$e={}));var y$e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(y$e||(y$e={}));var S$e;(function(n){n[n.Default=1]="Default",n[n.Top=2]="Top",n[n.Center=3]="Center",n[n.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",n[n.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",n[n.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(S$e||(S$e={}));var A$e;(function(n){n[n.Default=1]="Default",n[n.Center=2]="Center",n[n.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(A$e||(A$e={}));var E$e;(function(n){n[n.Preview=0]="Preview",n[n.Editing=1]="Editing"})(E$e||(E$e={}));var x$e;(function(n){n[n.Container=0]="Container",n[n.Editor=1]="Editor",n[n.Output=2]="Output",n[n.ChatInput=3]="ChatInput"})(x$e||(x$e={}));var D$e;(function(n){n[n.None=0]="None",n[n.Top=1]="Top",n[n.Bottom=2]="Bottom",n[n.Both=3]="Both"})(D$e||(D$e={}));var k$e;(function(n){n[n.None=0]="None",n[n.Start=1]="Start",n[n.End=2]="End",n[n.Both=3]="Both"})(k$e||(k$e={}));function tH(n){if(!n)return;if(n.getId()===g7t)return n.getControl();const e=n.input;if(e&&OQt(e))return n.getControl()?.notebookEditor}var I$e;(function(n){n[n.None=0]="None",n[n.Expanded=1]="Expanded",n[n.Collapsed=2]="Collapsed"})(I$e||(I$e={}));class iH extends _Q{static is(e){return e instanceof iH?!0:P.isUri(e.resource)&&fo(e.cellEdit)}static lift(e){return e instanceof iH?e:new iH(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let L$e=class{constructor(e,t,i,s,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=s,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Zne.scheme){const l=Zne.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new iH(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=yU(this._edits,(i,s)=>lw(i.resource.toString(),s.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[s]=i,o=await this._notebookModelService.resolve(s.resource);if(typeof s.notebookVersionId=="number"&&o.object.notebook.versionId!==s.notebookVersionId)throw o.dispose(),new Error(`Notebook '${s.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=tH(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:eke.Index,focus:c.getFocus(),selections:c.getSelections()}:void 0;o.object.notebook.applyEdits(r,!0,l,()=>{},this._undoRedoGroup,a),o.dispose(),this._progress.report(void 0),e.push(s.resource)}return e}};L$e=D([_(5,_i),_(6,Jde)],L$e);let T$e=class{constructor(e,t,i,s){this._bulkEditService=t,this._logService=i,this._uriIdentService=s}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const s=AS(e.value,this._uriIdentService);return this._bulkEditService.apply(s,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};T$e=D([en(Ue.MainThreadBulkEdits),_(1,vO),_(2,Ze),_(3,_o)],T$e);function AS(n,e,t){if(!n||!n.edits)return n;const i=Or(n);for(const s of i.edits){if(vS.is(s)&&(s.resource=e.asCanonicalUri(s.resource)),up.is(s)){if(s.options){const o=s.options?.contents;if(o)if(o.type==="base64")s.options.contents=Promise.resolve(Tje(o.value));else if(t)s.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}s.newResource=s.newResource&&e.asCanonicalUri(s.newResource),s.oldResource=s.oldResource&&e.asCanonicalUri(s.oldResource)}if(iH.is(s)){s.resource=e.asCanonicalUri(s.resource);const o=s.cellEdit;o.editType===G1.Replace&&(s.cellEdit={...o,cells:o.cells.map(r=>({...r,outputs:r.outputs.map(a=>({...a,outputs:a.items.map(c=>({mime:c.mime,data:c.valueBytes}))}))}))})}}return n}const tue="__",WQt="vs/workbench/api/browser/mainThreadLanguageModels";let R$e=class{constructor(e,t,i,s,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=s,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatProvider),this._proxy.$acceptChatModelMetadata({added:t.getLanguageModelIds().map(c=>({identifier:c,metadata:t.lookupLanguageModel(c)}))}),this._store.add(t.onDidChangeLanguageModels(this._proxy.$acceptChatModelMetadata,this._proxy))}dispose(){this._providerRegistrations.dispose(),this._store.dispose()}$registerLanguageModelProvider(e,t,i){const s=new Z;s.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,provideChatResponse:async(o,r,a,c,l)=>{const d=Math.random()*1e6|0;this._pendingProgress.set(d,c);try{await this._proxy.$provideLanguageModelResponse(e,d,r,o,a,l)}finally{this._pendingProgress.delete(d)}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&s.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,s)}async $handleProgressChunk(e,t){this._pendingProgress.get(e)?.report(t)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,s){this._languageModelStatsService.update(e,t,i,s)}async $fetchResponse(e,t,i,s,o,r){this._logService.debug("[CHAT] extension request STARTED",e.value,i);const a=this._chatProviderService.makeLanguageModelChatRequest(t,e,s,o,new cf(c=>{this._proxy.$handleResponseFragment(i,c)}),r);return a.catch(c=>{throw this._logService.error("[CHAT] extension request ERRORED",c,e.value,i),c}).finally(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i)}),a}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=tue+e.value;if(this._authenticationService.getProviderIds().includes(i))return $.None;const s=t.accountLabel??g(WQt,0,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new HQt(i,t.providerLabel,s)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,s),c=[];for(const l of a){const d=await this._extensionService.getExtension(l.id);d&&c.push({from:d.identifier,to:e,enabled:l.allowed??!0})}this._proxy.$updateModelAccesslist(c)})),o}};R$e=D([en(Ue.MainThreadLanguageModels),_(1,HZe),_(2,Ret),_(3,Ze),_(4,PPe),_(5,ehe),_(6,ho)],R$e);class HQt{constructor(e,t,i){this.id=e,this.label=t,this._accountLabel=i,this.supportsMultipleAccounts=!1,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event}async getSessions(e){return e===void 0&&!this._session?[]:this._session?[this._session]:[await this.createSession(e||[],{})]}async createSession(e,t){return this._session=this._createFakeSession(e),this._onDidChangeSessions.fire({added:[this._session],changed:[],removed:[]}),this._session}removeSession(e){return this._session&&(this._onDidChangeSessions.fire({added:[],changed:[],removed:[this._session]}),this._session=void 0),Promise.resolve()}_createFakeSession(e){return{id:"fake-session",account:{id:this.id,label:this._accountLabel},accessToken:"fake-access-token",scopes:e}}}var Cke;const M$e="vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables",UQt="chat-dynamic-variable";var RP;let bG=(RP=class extends ${get variables(){return[...this._variables]}get id(){return Cke.ID}constructor(e,t,i){super(),this.widget=e,this.labelService=t,this.logService=i,this._variables=[],this._register(e.inputEditor.onDidChangeModelContent(s=>{s.changes.forEach(o=>{this._variables=Ui(this._variables.map(r=>{const a=O.intersectRanges(r.range,o.range);if(a&&!a.isEmpty()){const c=new O(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);return this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}]),null}else if(O.compareRangesUsingStarts(r.range,o.range)>0){const c=o.text.length-o.rangeLength;return{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r}))}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){if(!Array.isArray(e)){this.logService.warn("ChatDynamicVariableModel.setInputState called with invalid state: "+JSON.stringify(e));return}this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",UQt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return P.isUri(t)?new Xt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},Cke=RP,RP.ID="chatDynamicVariableModel",RP);bG=Cke=D([_(1,eo),_(2,Ze)],bG);A6.CONTRIBS.push(bG);function VQt(n){return"widget"in n&&"range"in n}const ty=class ty extends pi{constructor(){super({id:ty.ID,title:""})}async run(e,...t){const i=e.get(Rn),s=e.get(Ze),o=e.get(On),r=e.get(Mz),a=t[0];if(!VQt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(ty.Name)&&(l={providerOptions:{additionPicks:[ty.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){s.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===ty.Item){const w=`#${ty.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:w+" "}])||(s.trace(`SelectAndInsertFileAction: failed to insert "${w}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){s.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${ui(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){s.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(bG.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};ty.Name="files",ty.Item={label:g(M$e,0,"All Files"),description:g(M$e,1,"Search for relevant files in the workspace and provide context from them")},ty.ID="workbench.action.chat.selectAndInsertFile";let yke=ty;At(yke);function zQt(n){return"widget"in n&&"range"in n&&"variableData"in n}const nle=class nle extends pi{constructor(){super({id:nle.ID,title:""})}async run(e,...t){const i=t[0];if(!zQt(i))return;let s=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(ji).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new O(s.startLineNumber,s.endColumn,s.endLineNumber,s.endColumn+l.length);if(s=new O(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(bG.ID)?.addReference({id:i.id,range:s,data:o})}};nle.ID="workbench.action.chat.addDynamicVariable";let Bse=nle;At(Bse);class $Qt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new sd,this._onDidAddProgress=new I,this.progress=[]}task(){return this.deferred.p}isSettled(){return this.deferred.isSettled}complete(e){this.deferred.complete(e)}add(e){this.progress.push(e),this._onDidAddProgress.fire(e)}}let N$e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=s,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new Zo),this._agentCompletionProviders=this._register(new Zo),this._agentIdsToCompletionProviders=this._register(new Zo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(et.ExtHostChatAgents2),this._register(this._chatService.onDidDisposeSession(l=>{this._proxy.$releaseSession(l.sessionId)})),this._register(this._chatService.onDidPerformUserAction(l=>{if(typeof l.agentId=="string"){for(const[d,h]of this._agents)if(h.id===l.agentId){l.action.kind==="vote"?this._proxy.$acceptFeedback(d,l.result??{},l.action.direction):this._proxy.$acceptAction(d,l.result||{},l);break}}}))}$unregisterAgent(e){this._agents.deleteAndDispose(e)}$transferActiveChatSession(e){const t=this._chatWidgetService.lastFocusedWidget,i=t?.viewModel?.model.sessionId;if(!i){this._logService.error("MainThreadChat#$transferActiveChatSession: No active chat session found");return}const s=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:s},P.revive(e))}$registerAgent(e,t,i,s,o){const r=this._chatAgentService.getAgent(i);if(!r&&!o)throw this._chatAgentService.getAgentsByName(i).length?new Error(`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${i}"`):new Error(`chatParticipant must be declared in package.json: ${i}`);const a={invoke:async(l,d,h,u)=>{this._pendingProgress.set(l.requestId,d);try{return await this._proxy.$invokeAgent(e,l,{history:h},u)??{}}finally{this._pendingProgress.delete(l.requestId)}},provideFollowups:async(l,d,h,u)=>this._agents.get(e)?.hasFollowups?this._proxy.$provideFollowups(l,e,d,{history:h},u):[],provideWelcomeMessage:(l,d)=>this._proxy.$provideWelcomeMessage(e,l,d),provideSampleQuestions:(l,d)=>this._proxy.$provideSampleQuestions(e,l,d)};let c;if(!r&&o){const l=this._extensionService.extensions.find(d=>Cn.equals(d.identifier,t));c=this._chatAgentService.registerDynamicAgent({id:i,name:o.name??"",description:o.description,extensionId:t,extensionDisplayName:l?.displayName??t.value,extensionPublisherId:l?.publisher??"",publisherDisplayName:o.publisherName,fullName:o.fullName,metadata:Or(s),slashCommands:[],locations:[lc.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:s.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i)throw new Error(`No agent with handle ${e} registered`);i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Or(t))}async $handleProgressChunk(e,t,i){const s=Or(t);if(s.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new $Qt(s.content);return this._activeTasks.set(r,a),this._pendingProgress.get(e)?.(a),o}else if(i!==void 0){const o=`${e}_${i}`,r=this._activeTasks.get(o);switch(s.kind){case"progressTaskResult":return r&&s.content?(r.complete(s.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(s);return}}this._pendingProgress.get(e)?.(s)}$registerAgentCompletionsProvider(e,t,i){const s=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?$e.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,s)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:b6.INPUT_SCHEME,hasAccessToAllModels:!0},{_debugDisplayName:"chatAgentCompletions:"+e,triggerCharacters:i,provideCompletionItems:async(o,r,a,c)=>{const l=this._chatWidgetService.getWidgetByInputUri(o.uri);if(!l||!l.viewModel)return;const d=i.map(C=>Iu(C)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=a1(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(C=>u.startsWith(C)))return;const p=this._instantiationService.createInstance(mne).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(C=>C instanceof tp),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=GQt(o,r,h);return v?{suggestions:(await s(u,c)).map(C=>{const y=C.insertText??(typeof C.label=="string"?C.label:C.label.label),S=new O(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+y.length);return{label:C.label,range:v,insertText:y+" ",kind:Ne.Text,detail:C.detail,documentation:C.documentation,command:{id:Bse.ID,title:"",arguments:[{id:C.id,widget:l,range:S,variableData:Or(C.value),command:C.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};N$e=D([en(Ue.MainThreadChatAgents2),_(1,yp),_(2,Rw),_(3,ht),_(4,lL),_(5,be),_(6,Ze),_(7,ho)],N$e);function GQt(n,e,t){const i=a1(e.column,t,n.getLineContent(e.lineNumber),0);if(!i&&n.getWordUntilPosition(e).word)return;let s,o;return i?(s=new O(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new O(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):s=o=O.fromPositions(e),{insert:s,replace:o}}let P$e=class{constructor(e,t){this._chatVariablesService=t,this._variables=new Zo,this._pendingProgress=new Map,this._proxy=e.getProxy(et.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(s,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Or(await this._proxy.$resolveVariable(e,l,s,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Or(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}$attachContext(e,t,i){this._chatVariablesService.attachContext(e,Or(t),i)}};P$e=D([en(Ue.MainThreadChatVariables),_(1,Mz)],P$e);const Vot=ae("embeddingsService");class qQt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.providers=new Map}get allProviders(){return this.providers.keys()}registerProvider(e,t){return this.providers.set(e,t),this._onDidChange.fire(),{dispose:()=>{this.providers.delete(e),this._onDidChange.fire()}}}computeEmbeddings(e,t,i){const s=this.providers.get(e);return s?s.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(Vot,qQt,Yt.Delayed);let F$e=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new Zo),this._proxy=e.getProxy(et.ExtHostEmbeddings),this._store.add(t.onDidChange(()=>{this._proxy.$acceptEmbeddingModels(Array.from(t.allProviders))}))}dispose(){this._store.dispose()}$registerEmbeddingProvider(e,t){const i=this.embeddingsService.registerProvider(t,{provideEmbeddings:(s,o)=>this._proxy.$provideEmbeddings(e,s,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};F$e=D([en(Ue.MainThreadEmbeddings),_(1,Vot)],F$e);class QQt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function zot(n,e){if(e.serializeBuffersForPostMessage){const t=new QQt,s=JSON.stringify(n,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=jQt(a);if(c)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:c,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),o=t.buffers.map(r=>{const a=new Uint8Array(r);return ze.wrap(a)});return{message:s,buffers:o}}else return{message:JSON.stringify(n),buffers:[]}}function jQt(n){switch(n.constructor.name){case"Int8Array":return ol.Int8Array;case"Uint8Array":return ol.Uint8Array;case"Uint8ClampedArray":return ol.Uint8ClampedArray;case"Int16Array":return ol.Int16Array;case"Uint16Array":return ol.Uint16Array;case"Int32Array":return ol.Int32Array;case"Uint32Array":return ol.Uint32Array;case"Float32Array":return ol.Float32Array;case"Float64Array":return ol.Float64Array;case"BigInt64Array":return ol.BigInt64Array;case"BigUint64Array":return ol.BigUint64Array}}function $ot(n,e){const t=e.map(o=>{const r=new ArrayBuffer(o.byteLength);return new Uint8Array(r).set(o.buffer),r}),i=e.length?(o,r)=>{if(r&&typeof r=="object"&&r.$$vscode_array_buffer_reference$$){const a=r,{index:c}=a,l=t[c];if(a.view)switch(a.view.type){case ol.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case ol.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case ol.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case ol.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case ol.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case ol.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case ol.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case ol.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case ol.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case ol.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case ol.BigUint64Array:return new BigUint64Array(l,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return l}return r}:void 0;return{message:JSON.parse(n,i),arrayBuffers:t}}var Ske;const KQt="vs/workbench/api/browser/mainThreadWebviews";var MP;let Ake=(MP=class extends ${constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(et.ExtHostWebviews)}addWebview(e,t,i){if(this._webviews.has(e))throw new Error("Webview already registered");this._webviews.set(e,t),this.hookupWebviewEventDelegate(e,t,i)}$setHtml(e,t){this.tryGetWebview(e)?.setHtml(t)}$setOptions(e,t){const i=this.tryGetWebview(e);i&&(i.contentOptions=Hse(t))}async $postMessage(e,t,...i){const s=this.tryGetWebview(e);if(!s)return!1;const{message:o,arrayBuffers:r}=$ot(t,i);return s.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const s=new Z;s.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),s.add(t.onMessage(o=>{const r=zot(o.message,i);this._proxy.$onMessage(e,r.message,new $h(r.buffers))})),s.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),s.add(t.onDidDispose(()=>{s.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,P.parse(t))&&this._openerService.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Array.isArray(i.contentOptions.enableCommandUris)||i.contentOptions.enableCommandUris===!0,fromWorkspace:!0})}isSupportedLink(e,t){return Ske.standardSupportedLinkSchemes.has(t.scheme)||!Jn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===_e.command?Array.isArray(e.contentOptions.enableCommandUris)?e.contentOptions.enableCommandUris.includes(t.path):e.contentOptions.enableCommandUris===!0:!1}tryGetWebview(e){return this._webviews.get(e)}getWebview(e){const t=this.tryGetWebview(e);if(!t)throw new Error(`Unknown webview handle:${e}`);return t}getWebviewResolvedFailedContent(e){return` ${g(KQt,0,"An error occurred while loading view: {0}",rM(e))} - `}},Ske=MP,MP.standardSupportedLinkSchemes=new Set([_e.http,_e.https,_e.mailto,_e.vscode,"vscode-insider"]),MP);Ake=Ske=D([_(1,fr),_(2,Ja)],Ake);function Wse(n){return{id:n.id,location:P.revive(n.location)}}function Hse(n){return{allowScripts:n.enableScripts,allowForms:n.enableForms,enableCommandUris:n.enableCommandUris,localResourceRoots:Array.isArray(n.localResourceRoots)?n.localResourceRoots.map(e=>P.revive(e)):void 0,portMapping:n.portMapping}}class YQt{constructor(e,t,i,s){this.editor=e,this.line=t,this.height=i,this.webview=s,this.domNode=document.createElement("div"),this.domNode.style.zIndex="10",this.afterLineNumber=t,this.afterColumn=1,this.heightInLines=i,e.changeViewZones(o=>this._id=o.addZone(this)),s.mountTo(this.domNode,gt(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let O$e=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(et.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,s,o,r,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&_n(p.getModel().uri,P.revive(i))){l=p;break}if(!l){setTimeout(()=>this._proxy.$onDidDispose(e));return}const d=new Z,h=this._webviewService.createWebviewElement({title:void 0,options:{enableFindWidget:!1},contentOptions:Hse(r),extension:{id:a,location:P.revive(c)}}),u=new YQt(l,s,o,h),f=()=>{d.dispose(),this._proxy.$onDidDispose(e),this._insets.delete(e)};d.add(l.onDidChangeModel(f)),d.add(l.onDidDispose(f)),d.add(u),d.add(h),d.add(h.onMessage(p=>this._proxy.$onDidReceiveMessage(e,p.message))),this._insets.set(e,u)}$disposeEditorInset(e){const t=this.getInset(e);this._insets.delete(e),t.dispose()}$setHtml(e,t){this.getInset(e).webview.setHtml(t)}$setOptions(e,t){const i=this.getInset(e);i.webview.contentOptions=Hse(t)}async $postMessage(e,t){return this.getInset(e).webview.postMessage(t),!0}getInset(e){const t=this._insets.get(e);if(!t)throw new Error("Unknown inset");return t}};O$e=D([Zi(Ue.MainThreadEditorInsets),_(1,Qt),_(2,Zde)],O$e);const $r="vs/platform/extensionManagement/common/extensionManagementCLI",JQt=n=>g($r,0,"Extension '{0}' not found.",n),B$e=g($r,1,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let Eke=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let s=await this.extensionManagementService.getInstalled(qr.User,i);const o=fZe.map(a=>a.toLowerCase());if(t&&t!==""){if(o.indexOf(t.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}s=s.filter(a=>a.manifest.categories?a.manifest.categories.map(l=>l.toLowerCase()).indexOf(t.toLowerCase())>-1:!1)}else if(t===""){this.logger.info("Possible Categories: "),o.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(g($r,2,"Extensions installed on {0}:",this.location)),s=s.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of s)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,s){const o=[];try{e.length&&this.logger.info(this.location?g($r,3,"Installing extensions on {0}...",this.location):g($r,4,"Installing extensions..."));const r=[],a=[],c=(d,h,u)=>{a.push({id:d,version:h!=="prerelease"?h:void 0,installOptions:{...i,isBuiltin:u,installPreReleaseVersion:h==="prerelease"||i.installPreReleaseVersion}})};for(const d of e)if(d instanceof P)r.push({vsix:d,installOptions:i});else{const[h,u]=HVe(d);c(h,u,!1)}for(const d of t)if(d instanceof P)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=HVe(d);c(h,u,!0)}const l=await this.extensionManagementService.getInstalled(void 0,i.profileLocation);if(r.length&&await Promise.all(r.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,s,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,s);o.push(...d)}}catch(r){throw this.logger.error(g($r,5,"Error while installing extensions: {0}",lg(r))),r}if(o.length)throw new Error(g($r,6,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(qr.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g($r,7,"Fetching latest versions for {0} extensions",i.length));const s=await this.extensionGalleryService.getExtensions(i,{compatible:!0},qe.None),o=[];for(const a of s)for(const c of t)uc(c.identifier,a.identifier)&&JV.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:Bx.Update,installPreReleaseVersion:c.preRelease,profileLocation:e}});if(!o.length){this.logger.info(g($r,8,"No extension to update"));return}this.logger.info(g($r,9,"Updating extensions: {0}",o.map(a=>a.extension.identifier.id).join(", ")));const r=await this.extensionManagementService.installGalleryExtensions(o);for(const a of r)a.error?this.logger.error(g($r,10,"Error while updating extension {0}: {1}",a.identifier.id,lg(a.error))):this.logger.info(g($r,11,"Extension '{0}' v{1} was successfully updated.",a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(e,t,i){if(e=e.filter(({id:a,version:c})=>{const l=t.find(d=>uc(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g($r,12,"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: '{2}@1.2.3'.",a,l.manifest.version,a)),!1;if(c&&l.manifest.version===c)return this.logger.info(g($r,13,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const s=[],o=[],r=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=r.get(a.toLowerCase());if(!d){this.logger.error(`${JQt(c?`${a}@${c}`:a)} -${B$e}`),s.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,qe.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),s.push(a);return}const h=t.find(u=>uc(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g($r,13,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g($r,14,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g($r,15,"Installing builtin extension '{0}' v{1}...",a,c):g($r,16,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g($r,17,"Installing extension '{0}' v{1}...",a,c):g($r,18,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g($r,19,"Error while installing extension {0}: {1}",c.identifier.id,lg(c.error))),s.push(c.identifier.id)):this.logger.info(g($r,20,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return s}async installVSIX(e,t,i,s){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,s))try{await this.extensionManagementService.install(e,t),this.logger.info(g($r,21,"Extension '{0}' was successfully installed.",ui(e)))}catch(a){if(Na(a))this.logger.info(g($r,22,"Cancelled installing extension '{0}'.",ui(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),s=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)ZRt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:s},qe.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,s){if(!t){const o={id:ny(e.publisher,e.name)},r=s.find(a=>uc(o,a.identifier)&&JV.gt(a.manifest.version,e.version));if(r)return this.logger.info(g($r,23,"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",r.identifier.id,r.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const s=async o=>{if(o instanceof P){const r=await this.extensionManagementService.getManifest(o);return _F(r.publisher,r.name)}return o};for(const o of e){const r=await s(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>uc(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} -${B$e}`);if(c.some(l=>l.type===qr.System)){this.logger.info(g($r,24,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g($r,25,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g($r,26,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g($r,27,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g($r,28,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(s=>{if(s.identifier.id===i&&s.location.scheme===_e.file){this.logger.info(s.location.fsPath);return}})})}notInstalled(e){return this.location?g($r,29,"Extension '{0}' is not installed on {1}.",e,this.location):g($r,30,"Extension '{0}' is not installed.",e)}};Eke=D([_(1,Rz),_(2,aL)],Eke);const XQt="vs/workbench/api/browser/mainThreadCLICommands";yt.registerCommand("_remoteCLI.openExternal",function(n,e){return n.get(fr).open(zt(e)?e:P.revive(e),{openExternal:!0,allowTunneling:!0})});yt.registerCommand("_remoteCLI.windowOpen",function(n,e,t){const i=n.get(Qi);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});yt.registerCommand("_remoteCLI.getSystemStatus",function(n){return n.get(Qi).executeCommand("_issues.getSystemStatus")});yt.registerCommand("_remoteCLI.manageExtensions",async function(n,e){const t=n.get(be),s=n.get(Mw).remoteExtensionManagementServer?.extensionManagementService;if(!s)return;const o=[],r=new class extends ude{log(c,l){o.push(l)}},a=t.createChild(new Dl([Rz,s])).createInstance(xke,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>zt(d)?d:P.revive(d));if(Array.isArray(e.install)&&e.install.length)try{await a.installExtensions(c(e.install),[],{isMachineScoped:!0},!!e.force)}catch(l){o.push(l.message)}if(Array.isArray(e.uninstall)&&e.uninstall.length)try{await a.uninstallExtensions(c(e.uninstall),!!e.force,void 0)}catch(l){o.push(l.message)}}return o.join(` -`)});let xke=class extends Eke{constructor(e,t,i,s,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?s.getHostLabel(_e.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Jn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(XQt,0,"Cannot install the '{0}' extension because it is declared to not run in this setup.",_F(e.publisher,e.name))),!1):!0}};xke=D([_(1,Rz),_(2,aL),_(3,eo),_(4,Za),_(5,G_)],xke);let W$e=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};W$e=D([Zi(Ue.MainThreadClipboard),_(1,Mu)],W$e);let H$e=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new Zo,this._proxy=e.getProxy(et.ExtHostCommands),this._generateCommandsDocumentationRegistration=yt.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=yt.getCommands();for(const[s,o]of t)o.metadata&&(e[s]=o.metadata);const i=[];for(const s in e)i.push("`"+s+"` - "+ZQt(e[s]));console.log(i.join(` -`))}$registerCommand(e){this._commandRegistrations.set(e,yt.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(s=>Or(s))))}$unregisterCommand(e){this._commandRegistrations.deleteAndDispose(e)}$fireCommandActivationEvent(e){const t=`onCommand:${e}`;this._extensionService.activationEventIsDone(t)||this._extensionService.activateByEvent(t)}async $executeCommand(e,t,i){t instanceof $h&&(t=t.value);for(let s=0;s0&&!yt.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([...yt.getCommands().keys()])}};H$e=D([Zi(Ue.MainThreadCommands),_(1,Qi),_(2,ho)],H$e);function ZQt(n){if(typeof n=="string")return n;{const t=[zt(n.description)?n.description:n.description.original];if(t.push(` + `}},Ske=MP,MP.standardSupportedLinkSchemes=new Set([_e.http,_e.https,_e.mailto,_e.vscode,"vscode-insider"]),MP);Ake=Ske=D([_(1,fr),_(2,Ja)],Ake);function Wse(n){return{id:n.id,location:P.revive(n.location)}}function Hse(n){return{allowScripts:n.enableScripts,allowForms:n.enableForms,enableCommandUris:n.enableCommandUris,localResourceRoots:Array.isArray(n.localResourceRoots)?n.localResourceRoots.map(e=>P.revive(e)):void 0,portMapping:n.portMapping}}class YQt{constructor(e,t,i,s){this.editor=e,this.line=t,this.height=i,this.webview=s,this.domNode=document.createElement("div"),this.domNode.style.zIndex="10",this.afterLineNumber=t,this.afterColumn=1,this.heightInLines=i,e.changeViewZones(o=>this._id=o.addZone(this)),s.mountTo(this.domNode,gt(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let O$e=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(et.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,s,o,r,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&_n(p.getModel().uri,P.revive(i))){l=p;break}if(!l){setTimeout(()=>this._proxy.$onDidDispose(e));return}const d=new Z,h=this._webviewService.createWebviewElement({title:void 0,options:{enableFindWidget:!1},contentOptions:Hse(r),extension:{id:a,location:P.revive(c)}}),u=new YQt(l,s,o,h),f=()=>{d.dispose(),this._proxy.$onDidDispose(e),this._insets.delete(e)};d.add(l.onDidChangeModel(f)),d.add(l.onDidDispose(f)),d.add(u),d.add(h),d.add(h.onMessage(p=>this._proxy.$onDidReceiveMessage(e,p.message))),this._insets.set(e,u)}$disposeEditorInset(e){const t=this.getInset(e);this._insets.delete(e),t.dispose()}$setHtml(e,t){this.getInset(e).webview.setHtml(t)}$setOptions(e,t){const i=this.getInset(e);i.webview.contentOptions=Hse(t)}async $postMessage(e,t){return this.getInset(e).webview.postMessage(t),!0}getInset(e){const t=this._insets.get(e);if(!t)throw new Error("Unknown inset");return t}};O$e=D([en(Ue.MainThreadEditorInsets),_(1,jt),_(2,Zde)],O$e);const $r="vs/platform/extensionManagement/common/extensionManagementCLI",JQt=n=>g($r,0,"Extension '{0}' not found.",n),B$e=g($r,1,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let Eke=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let s=await this.extensionManagementService.getInstalled(qr.User,i);const o=fZe.map(a=>a.toLowerCase());if(t&&t!==""){if(o.indexOf(t.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}s=s.filter(a=>a.manifest.categories?a.manifest.categories.map(l=>l.toLowerCase()).indexOf(t.toLowerCase())>-1:!1)}else if(t===""){this.logger.info("Possible Categories: "),o.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(g($r,2,"Extensions installed on {0}:",this.location)),s=s.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of s)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,s){const o=[];try{e.length&&this.logger.info(this.location?g($r,3,"Installing extensions on {0}...",this.location):g($r,4,"Installing extensions..."));const r=[],a=[],c=(d,h,u)=>{a.push({id:d,version:h!=="prerelease"?h:void 0,installOptions:{...i,isBuiltin:u,installPreReleaseVersion:h==="prerelease"||i.installPreReleaseVersion}})};for(const d of e)if(d instanceof P)r.push({vsix:d,installOptions:i});else{const[h,u]=HVe(d);c(h,u,!1)}for(const d of t)if(d instanceof P)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=HVe(d);c(h,u,!0)}const l=await this.extensionManagementService.getInstalled(void 0,i.profileLocation);if(r.length&&await Promise.all(r.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,s,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,s);o.push(...d)}}catch(r){throw this.logger.error(g($r,5,"Error while installing extensions: {0}",lg(r))),r}if(o.length)throw new Error(g($r,6,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(qr.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g($r,7,"Fetching latest versions for {0} extensions",i.length));const s=await this.extensionGalleryService.getExtensions(i,{compatible:!0},qe.None),o=[];for(const a of s)for(const c of t)gc(c.identifier,a.identifier)&&JV.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:Bx.Update,installPreReleaseVersion:c.preRelease,profileLocation:e}});if(!o.length){this.logger.info(g($r,8,"No extension to update"));return}this.logger.info(g($r,9,"Updating extensions: {0}",o.map(a=>a.extension.identifier.id).join(", ")));const r=await this.extensionManagementService.installGalleryExtensions(o);for(const a of r)a.error?this.logger.error(g($r,10,"Error while updating extension {0}: {1}",a.identifier.id,lg(a.error))):this.logger.info(g($r,11,"Extension '{0}' v{1} was successfully updated.",a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(e,t,i){if(e=e.filter(({id:a,version:c})=>{const l=t.find(d=>gc(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g($r,12,"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@' to install a specific version, for example: '{2}@1.2.3'.",a,l.manifest.version,a)),!1;if(c&&l.manifest.version===c)return this.logger.info(g($r,13,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const s=[],o=[],r=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=r.get(a.toLowerCase());if(!d){this.logger.error(`${JQt(c?`${a}@${c}`:a)} +${B$e}`),s.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,qe.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),s.push(a);return}const h=t.find(u=>gc(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g($r,13,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g($r,14,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g($r,15,"Installing builtin extension '{0}' v{1}...",a,c):g($r,16,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g($r,17,"Installing extension '{0}' v{1}...",a,c):g($r,18,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g($r,19,"Error while installing extension {0}: {1}",c.identifier.id,lg(c.error))),s.push(c.identifier.id)):this.logger.info(g($r,20,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return s}async installVSIX(e,t,i,s){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,s))try{await this.extensionManagementService.install(e,t),this.logger.info(g($r,21,"Extension '{0}' was successfully installed.",ui(e)))}catch(a){if(Na(a))this.logger.info(g($r,22,"Cancelled installing extension '{0}'.",ui(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),s=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)ZRt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:s},qe.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,s){if(!t){const o={id:ny(e.publisher,e.name)},r=s.find(a=>gc(o,a.identifier)&&JV.gt(a.manifest.version,e.version));if(r)return this.logger.info(g($r,23,"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",r.identifier.id,r.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const s=async o=>{if(o instanceof P){const r=await this.extensionManagementService.getManifest(o);return _F(r.publisher,r.name)}return o};for(const o of e){const r=await s(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>gc(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} +${B$e}`);if(c.some(l=>l.type===qr.System)){this.logger.info(g($r,24,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g($r,25,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g($r,26,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g($r,27,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g($r,28,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(s=>{if(s.identifier.id===i&&s.location.scheme===_e.file){this.logger.info(s.location.fsPath);return}})})}notInstalled(e){return this.location?g($r,29,"Extension '{0}' is not installed on {1}.",e,this.location):g($r,30,"Extension '{0}' is not installed.",e)}};Eke=D([_(1,Rz),_(2,aL)],Eke);const XQt="vs/workbench/api/browser/mainThreadCLICommands";yt.registerCommand("_remoteCLI.openExternal",function(n,e){return n.get(fr).open(zt(e)?e:P.revive(e),{openExternal:!0,allowTunneling:!0})});yt.registerCommand("_remoteCLI.windowOpen",function(n,e,t){const i=n.get(ji);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});yt.registerCommand("_remoteCLI.getSystemStatus",function(n){return n.get(ji).executeCommand("_issues.getSystemStatus")});yt.registerCommand("_remoteCLI.manageExtensions",async function(n,e){const t=n.get(be),s=n.get(Mw).remoteExtensionManagementServer?.extensionManagementService;if(!s)return;const o=[],r=new class extends ude{log(c,l){o.push(l)}},a=t.createChild(new Dl([Rz,s])).createInstance(xke,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>zt(d)?d:P.revive(d));if(Array.isArray(e.install)&&e.install.length)try{await a.installExtensions(c(e.install),[],{isMachineScoped:!0},!!e.force)}catch(l){o.push(l.message)}if(Array.isArray(e.uninstall)&&e.uninstall.length)try{await a.uninstallExtensions(c(e.uninstall),!!e.force,void 0)}catch(l){o.push(l.message)}}return o.join(` +`)});let xke=class extends Eke{constructor(e,t,i,s,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?s.getHostLabel(_e.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Jn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(XQt,0,"Cannot install the '{0}' extension because it is declared to not run in this setup.",_F(e.publisher,e.name))),!1):!0}};xke=D([_(1,Rz),_(2,aL),_(3,eo),_(4,Za),_(5,G_)],xke);let W$e=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};W$e=D([en(Ue.MainThreadClipboard),_(1,Mu)],W$e);let H$e=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new Zo,this._proxy=e.getProxy(et.ExtHostCommands),this._generateCommandsDocumentationRegistration=yt.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=yt.getCommands();for(const[s,o]of t)o.metadata&&(e[s]=o.metadata);const i=[];for(const s in e)i.push("`"+s+"` - "+ZQt(e[s]));console.log(i.join(` +`))}$registerCommand(e){this._commandRegistrations.set(e,yt.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(s=>Or(s))))}$unregisterCommand(e){this._commandRegistrations.deleteAndDispose(e)}$fireCommandActivationEvent(e){const t=`onCommand:${e}`;this._extensionService.activationEventIsDone(t)||this._extensionService.activateByEvent(t)}async $executeCommand(e,t,i){t instanceof $h&&(t=t.value);for(let s=0;s0&&!yt.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([...yt.getCommands().keys()])}};H$e=D([en(Ue.MainThreadCommands),_(1,ji),_(2,ho)],H$e);function ZQt(n){if(typeof n=="string")return n;{const t=[zt(n.description)?n.description:n.description.original];if(t.push(` `),n.args)for(const i of n.args)t.push(`* _${i.name}_ - ${i.description||""} `);return n.returns&&t.push(`* _(returns)_ - ${n.returns}`),t.push(` -`),t.join("")}}let U$e=class{constructor(e,t,i,s){this._workspaceContextService=t,this.configurationService=i,this._environmentService=s;const o=e.getProxy(et.ExtHostConfiguration);o.$initializeConfiguration(this._getConfigurationData()),this._configurationListener=i.onDidChangeConfiguration(r=>{o.$acceptConfigurationChanged(this._getConfigurationData(),r.change)})}_getConfigurationData(){const e={...this.configurationService.getConfigurationData(),configurationScopes:[]};return(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment)&&(e.configurationScopes=Tft()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,s,o){return s={resource:s?.resource?P.revive(s.resource):void 0,overrideIdentifier:s?.overrideIdentifier},this.writeConfiguration(e,t,i,s,o)}$removeConfigurationOption(e,t,i,s){return i={resource:i?.resource?P.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,s)}writeConfiguration(e,t,i,s,o){e=e??this.deriveConfigurationTarget(t,s);const r=this.configurationService.inspect(t,s);switch(e){case Ot.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,s,o);case Ot.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,s,o);case Ot.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,s,o);case Ot.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,s,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,s,o)}}_updateValue(e,t,i,s,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&s!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===Nn.WORKSPACE){const i=it.as(Cs.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===ut.RESOURCE||i[e].scope===ut.LANGUAGE_OVERRIDABLE))return Ot.WORKSPACE_FOLDER}return Ot.WORKSPACE}};U$e=D([Zi(Ue.MainThreadConfiguration),_(1,Ti),_(2,Re),_(3,Il)],U$e);function AOe(n){const e=[];let t;try{const i=JSON.parse(n.arguments),s=i[i.length-1];s&&s.__$stack&&(i.pop(),t=s.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",n.arguments)}return{args:e,stack:t}}function ejt(n){if(!n)return n;const e=n.indexOf(` -`);return e===-1?n:n.substring(0,e)}function tjt(n,e){const{args:t,stack:i}=AOe(n),s=typeof t[0]=="string"&&t.length===1;let o=ejt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&s?r=[`%c[${e}] %c${t[0]} %c${o}`,oB("blue"),oB(""),oB("grey")]:r=[`%c[${e}] %c${t[0]}`,oB("blue"),oB(""),...t.slice(1)]:r=[`%c[${e}]%`,oB("blue"),...t],o&&!s&&r.push(o),typeof console[n.severity]!="function")throw new Error("Unknown console method");console[n.severity].apply(console,r)}function oB(n){return`color: ${n}`}function ijt(n,e,t=null){const i=AOe(e).args;let s=i.shift();if(typeof s=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s=t+s),e.severity){case"log":case"info":n.info(s,...i);break;case"warn":n.warn(s,...i);break;case"error":n.error(s,...i);break}}function njt(n,e,t){const i=AOe(e).args,s=i.shift();typeof s!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n.error(t+s,...i))}let V$e=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const s=dOe(this._environmentService);this._isExtensionDevTestFromCli=s.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?ijt(this._logService,e):(njt(this._logService,e,"Extension Host"),tjt(e,"Extension Host"))}};V$e=D([Zi(Ue.MainThreadConsole),_(1,Il),_(2,Ze)],V$e);const sjt="vs/workbench/contrib/debug/common/abstractDebugAdapter";class Got{constructor(){this.pendingRequests=new Map,this.queue=[],this._onError=new I,this._onExit=new I,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,i,s){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof s=="number"){const r=setTimeout(()=>{clearTimeout(r);const a=this.pendingRequests.get(o.seq);if(a){this.pendingRequests.delete(o.seq);const c={type:"response",seq:0,request_seq:o.seq,success:!1,command:e,message:g(sjt,0,"Timeout after {0} ms for '{1}'",s,e)};a(c)}},s)}return i&&this.pendingRequests.set(o.seq,i),o.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Ta(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{const t=e,i=this.pendingRequests.get(t.request_seq);i&&(this.pendingRequests.delete(t.request_seq),i(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();const e=new Map;this.pendingRequests.forEach((t,i)=>e.set(i,t)),await Ta(500),e.forEach((t,i)=>{t({type:"response",seq:0,request_seq:i,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(i)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this.queue=[]}}function qot(n){return n.configuration.request==="attach"&&!Qot(n)&&(!n.parentSession||qot(n.parentSession))}function Qot(n){let e=n.configuration.type;if(e)return e==="vslsShare"&&(e=n.configuration.adapterProxy.configuration.type),Oa(e,"extensionhost")||Oa(e,"pwa-extensionhost")?n:n.parentSession?Qot(n.parentSession):void 0}function ojt(n){return n.type&&(n.label||n.program||n.runtime)}const rjt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function ajt(n){return!!(n&&n.match(rjt))}function jot(n){if(typeof n.path=="string"&&!(typeof n.sourceReference=="number"&&n.sourceReference>0)){if(ajt(n.path))return P.parse(n.path);if(oF(n.path))return P.file(n.path)}return n.path}function Kot(n){if(typeof n.path=="object"){const e=P.revive(n.path);if(e)return e.scheme===_e.file?e.fsPath:e.toString()}return n.path}function Yot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{s&&o&&(o.path=t(o))}),i}function Jot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{!s&&o&&(o.path=t(o))}),i}function Xot(n,e){switch(n.type){case"event":{const t=n;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break}break}case"request":{const t=n;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(i=>e(!1,i));break}break}case"response":{const t=n;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(i=>e(!1,i.source));break;case"loadedSources":t.body.sources.forEach(i=>e(!1,i));break;case"scopes":t.body.scopes.forEach(i=>e(!1,i.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"setBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"disassemble":t.body?.instructions.forEach(s=>e(!1,s.location));break}break}}}let z$e=class{constructor(e,t,i){this.debugService=t,this.visualizerService=i,this._toDispose=new Z,this._debugAdaptersHandleCounter=1,this._visualizerHandles=new Map,this._visualizerTreeHandles=new Map,this._proxy=e.getProxy(et.ExtHostDebugService);const s=new Zo;this._toDispose.add(s),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),s.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=s.get(r);a||(a=new Z,s.set(r,a)),a.add(r.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(r),c)))})),this._toDispose.add(t.onDidEndSession(({session:r,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(r)),this._extHostKnownSessions.delete(r.getId()),a||s.deleteAndDispose(r);for(const[c,l]of this._debugAdapters)l.session===r&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(r=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(r))})),this._toDispose.add(Ee(()=>{for(const[r,a]of this._debugAdapters)a.fireError(r,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const o=this.debugService.getViewModel();this._toDispose.add(T.any(o.onDidFocusStackFrame,o.onDidFocusThread)(()=>{const r=o.focusedStackFrame,a=o.focusedThread;r?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:r.thread.threadId,frameId:r.frameId,sessionId:r.thread.session.getId()}):a?this._proxy.$acceptStackFrameFocus({kind:"thread",threadId:a.threadId,sessionId:a.session.getId()}):this._proxy.$acceptStackFrameFocus(void 0)})),this.sendBreakpointsAndListen()}$registerDebugVisualizerTree(e,t){this.visualizerService.registerTree(e,{disposeItem:i=>this._proxy.$disposeVisualizedTree(i),getChildren:i=>this._proxy.$getVisualizerTreeItemChildren(e,i),getTreeItem:i=>this._proxy.$getVisualizerTreeItem(e,i),editItem:t?(i,s)=>this._proxy.$editVisualizerTreeItem(i,s):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Cn(e),id:t,disposeDebugVisualizers:s=>this._proxy.$disposeDebugVisualizers(s),executeDebugVisualizerCommand:s=>this._proxy.$executeDebugVisualizerCommand(s),provideDebugVisualizers:(s,o)=>this._proxy.$provideDebugVisualizers(e,t,s,o).then(r=>r.map(sDe.deserialize)),resolveDebugVisualizer:(s,o)=>this._proxy.$resolveDebugVisualizer(s.id,o)});this._visualizerHandles.set(`${e}/${t}`,i)}$unregisterDebugVisualizer(e,t){const i=`${e}/${t}`;this._visualizerHandles.get(i)?.dispose(),this._visualizerHandles.delete(i)}sendBreakpointsAndListen(){this._toDispose.add(this.debugService.getModel().onDidChangeBreakpoints(s=>{if(s&&!s.sessionOnly){const o={};s.added&&(o.added=this.convertToDto(s.added)),s.removed&&(o.removed=s.removed.map(r=>r.getId())),s.changed&&(o.changed=this.convertToDto(s.changed)),(o.added||o.removed||o.changed)&&this._proxy.$acceptBreakpointsDelta(o)}}));const e=this.debugService.getModel().getBreakpoints(),t=this.debugService.getModel().getFunctionBreakpoints(),i=this.debugService.getModel().getDataBreakpoints();(e.length>0||t.length>0)&&this._proxy.$acceptBreakpointsDelta({added:this.convertToDto(e).concat(this.convertToDto(t)).concat(this.convertToDto(i))})}dispose(){this._toDispose.dispose()}createDebugAdapter(e){const t=this._debugAdaptersHandleCounter++,i=new cjt(this,t,this._proxy,e);return this._debugAdapters.set(t,i),i}substituteVariables(e,t){return Promise.resolve(this._proxy.$substituteVariables(e?e.uri:void 0,t))}runInTerminal(e,t){return this._proxy.$runInTerminal(e,t)}$registerDebugTypes(e){this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterFactory(e,this))}$registerBreakpoints(e){for(const t of e)if(t.type==="sourceMulti"){const i=t.lines.map(s=>({id:s.id,enabled:s.enabled,lineNumber:s.line+1,column:s.character>0?s.character+1:void 0,condition:s.condition,hitCondition:s.hitCondition,logMessage:s.logMessage,mode:s.mode}));this.debugService.addBreakpoints(P.revive(t.uri),i)}else t.type==="function"?this.debugService.addFunctionBreakpoint({name:t.functionName,mode:t.mode,condition:t.condition,hitCondition:t.hitCondition,enabled:t.enabled,logMessage:t.logMessage},t.id):t.type==="data"&&this.debugService.addDataBreakpoint({description:t.label,src:{type:Ane.Variable,dataId:t.dataId},canPersist:t.canPersist,accessTypes:t.accessTypes,accessType:t.accessType,mode:t.mode});return Promise.resolve()}$unregisterBreakpoints(e,t,i){return e.forEach(s=>this.debugService.removeBreakpoints(s)),t.forEach(s=>this.debugService.removeFunctionBreakpoints(s)),i.forEach(s=>this.debugService.removeDataBreakpoints(s)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,s,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),s&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(r,c,l,d)),o&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(r,c,l,d)),this._debugConfigurationProviders.set(r,a),this._toDispose.add(this.debugService.getConfigurationManager().registerDebugConfigurationProvider(a)),Promise.resolve(void 0)}$unregisterDebugConfigurationProvider(e){const t=this._debugConfigurationProviders.get(e);t&&(this._debugConfigurationProviders.delete(e),this.debugService.getConfigurationManager().unregisterDebugConfigurationProvider(t))}$registerDebugAdapterDescriptorFactory(e,t){const i={type:e,createDebugAdapterDescriptor:s=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(s)))};return this._debugAdapterDescriptorFactories.set(t,i),this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterDescriptorFactory(i)),Promise.resolve(void 0)}$unregisterDebugAdapterDescriptorFactory(e){const t=this._debugAdapterDescriptorFactories.get(e);t&&(this._debugAdapterDescriptorFactories.delete(e),this.debugService.getAdapterManager().unregisterDebugAdapterDescriptorFactory(t))}getSession(e){if(e)return this.debugService.getModel().getSession(e,!0)}async $startDebugging(e,t,i){const s=e?P.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(s),r=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:r,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:r?.compoundRoot,saveBeforeRestart:a,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new hc(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const s=this.debugService.getModel().getSession(e,!0);return s?s.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new hc(o?o.message:"custom request failed"))):Promise.reject(new hc("debug session not found"))}$getDebugProtocolBreakpoint(e,t){const i=this.debugService.getModel().getSession(e,!0);return i?Promise.resolve(i.getDebugProtocolBreakpoint(t)):Promise.reject(new hc("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,qot(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new hc("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:nt.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(Jot(t,!1))}$acceptDAError(e,t,i,s){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} -${s}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAdapter(e){const t=this._debugAdapters.get(e);if(!t)throw new Error("Invalid debug adapter");return t}$sessionCached(e){this._extHostKnownSessions.add(e)}getSessionDto(e){if(e){const t=e.getId();return this._extHostKnownSessions.has(t)?t:{id:t,type:e.configuration.type,name:e.name,folderUri:e.root?e.root.uri:void 0,configuration:e.configuration,parent:e.parentSession?.getId()}}}convertToDto(e){return e.map(t=>{if("name"in t){const i=t;return{type:"function",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,functionName:i.name}}else if("src"in t){const i=t;return{type:"data",id:i.getId(),dataId:i.src.type===Ane.Variable?i.src.dataId:i.src.address,enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,accessType:i.accessType,label:i.description,canPersist:i.canPersist}}else if("uri"in t){const i=t;return{type:"source",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,uri:i.uri,line:i.lineNumber>0?i.lineNumber-1:0,character:typeof i.column=="number"&&i.column>0?i.column-1:0}}else return}).filter(yl)}};z$e=D([Zi(Ue.MainThreadDebugService),_(1,IPe),_(2,UZe)],z$e);class cjt extends Got{constructor(e,t,i,s){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=s}fireError(e,t){this._onError.fire(t)}fireExit(e,t,i){this._onExit.fire(t)}startSession(){return Promise.resolve(this._proxy.$startDASession(this._handle,this._ds.getSessionDto(this.session)))}sendMessage(e){this._proxy.$sendDAMessage(this._handle,Yot(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class ljt{constructor(e,t){this._proxy=e,this._handle=t,this._idPool=0,this._requests=new Map,this._resolver=new Map}enqueue(e,t){const i=++this._idPool,s=new Promise(r=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,r),this._processQueue()}),o=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return s.finally(()=>o.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],qe.None).then(i=>{for(const[s,o]of t)o(i[s])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let $$e=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(et.ExtHostDecorations)}dispose(){this._provider.forEach(e=>St(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,s=new ljt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await s.enqueue(r,a);if(!c)return;const[l,d,h,u]=c;return{weight:10,bubble:l??!1,color:u?.id,tooltip:d,letter:h}}});this._provider.set(e,[i,o])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[s]=i;s.fire(t&&t.map(o=>P.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(St(t),this._provider.delete(e))}};$$e=D([Zi(Ue.MainThreadDecorations),_(1,rD)],$$e);let G$e=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(et.ExtHostDiagnostics),this._markerListener=this._markerService.onMarkerChanged(this._forwardMarkers,this)}dispose(){this._markerListener.dispose(),this._activeOwners.forEach(e=>this._markerService.changeAll(e,[])),this._activeOwners.clear()}_forwardMarkers(e){const t=[];for(const i of e){const s=this._markerService.read({resource:i});if(s.length===0)t.push([i,[]]);else{const o=s.filter(r=>!this._activeOwners.has(r.owner));o.length>0&&t.push([i,o])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[s,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=P.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=P.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(P.revive(s)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};G$e=D([Zi(Ue.MainThreadDiagnostics),_(1,U_),_(2,_o)],G$e);var LX;let q$e=LX=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=LX._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=LX._convertSaveOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showSaveDialog(t))}static _convertOpenOptions(e){const t={openLabel:e?.openLabel||void 0,canSelectFiles:e?.canSelectFiles||!e?.canSelectFiles&&!e?.canSelectFolders,canSelectFolders:e?.canSelectFolders,canSelectMany:e?.canSelectMany,defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[_e.vscodeRemote,_e.file]:[]};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}};q$e=LX=D([Zi(Ue.MainThreadDialogs),_(1,bf)],q$e);let Q$e=class{constructor(e,t,i,s,o){this._textModelResolverService=t,this._languageService=i,this._modelService=s,this._editorWorkerService=o,this._resourceContentProvider=new Zo,this._pendingUpdate=new Map,this._proxy=e.getProxy(et.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),St(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:s=>this._proxy.$provideTextDocumentContent(e,s).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(s,r);return this._modelService.createModel(o,a,s)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(P.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ai;this._pendingUpdate.set(i.id,o);try{const r=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),o.token.isCancellationRequested)return;r&&r.length>0&&i.applyEdits(r.map(a=>ds.replace(O.lift(a.range),a.text)))}catch(r){bt(r)}}};Q$e=D([Zi(Ue.MainThreadDocumentContentProviders),_(1,Rn),_(2,Di),_(3,Ai),_(4,kd)],Q$e);class Zot{constructor(e,t=1e3*60*3,i=1024*1024*80,s=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=s,this._data=new Array,this._length=0}dispose(){this._data=St(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const s=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(s,this._maxAge),r={uri:e,length:i,dispose:s};this._data.push(r),this._length+=i,this._cleanup()}_cleanup(){for(;this._length>this._maxLength;)this._data[0].dispose();const e=Math.ceil(this._maxSize*1.2);this._data.length>=e&&St(this._data.slice(0,e-this._maxSize))}}class djt extends ${constructor(e,t,i,s){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=s,this._knownVersionId=this._model.getVersionId(),this._store.add(this._model.onDidChangeContent(o=>{this._knownVersionId=o.versionId,this._proxy.$acceptModelChanged(this._model.uri,o,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let Dke=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=s,this._textModelResolverService=o,this._environmentService=r,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new wi,this._modelReferenceCollection=this._store.add(new Zot(a.extUri)),this._proxy=e.getProxy(et.ExtHostDocuments),this._store.add(t.onModelLanguageChanged(this._onModelModeChanged,this)),this._store.add(i.files.onDidSave(d=>{this._shouldHandleFileEvent(d.model.resource)&&this._proxy.$acceptModelSaved(d.model.resource)})),this._store.add(i.files.onDidChangeDirty(d=>{this._shouldHandleFileEvent(d.resource)&&this._proxy.$acceptDirtyStateChanged(d.resource,d.isDirty())})),this._store.add(c.onDidRunWorkingCopyFileOperation(d=>{const h=d.operation===Li.MOVE;if(h||d.operation===Li.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){St(this._modelTrackers.values()),this._modelTrackers.clear(),super.dispose()}isCaughtUpWithContentChanges(e){const t=this._modelTrackers.get(e);return t?t.isCaughtUpWithContentChanges():!0}_shouldHandleFileEvent(e){const t=this._modelService.getModel(e);return!!t&&gS(t)}handleModelAdded(e){gS(e)&&this._modelTrackers.set(e.uri,new djt(e,this._onIsCaughtUpWithContentChanges,this._proxy,this._textFileService))}_onModelModeChanged(e){const{model:t}=e;this._modelTrackers.has(t.uri)&&this._proxy.$acceptModelLanguageChanged(t.uri,t.getLanguageId())}handleModelRemoved(e){this._modelTrackers.has(e)&&(this._modelTrackers.get(e).dispose(),this._modelTrackers.delete(e))}async $trySaveDocument(e){return!!await this._textFileService.save(P.revive(e))}async $tryOpenDocument(e){const t=P.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new hc("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let s;switch(i.scheme){case _e.untitled:s=this._handleUntitledScheme(i);break;case _e.file:default:s=this._handleAsResourceInput(i);break}let o;try{o=await s}catch(r){throw new hc(`cannot open ${i.toString()}. Detail: ${Ma(r)}`)}if(o)if(Fn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new hc(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new hc(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new hc(`cannot open ${i.toString()}`)}$tryCreateDocument(e){return this._doCreateUntitled(void 0,e?e.language:void 0,e?e.content:void 0)}async _handleAsResourceInput(e){const t=await this._textModelResolverService.createModelReference(e);return this._modelReferenceCollection.add(e,t,t.object.textEditorModel.getValueLength()),t.object.textEditorModel.uri}async _handleUntitledScheme(e){const t=R9(e,this._environmentService.remoteAuthority,this._pathService.defaultUriScheme);return await this._fileService.exists(t)?Promise.reject(new Error("file already exists")):await this._doCreateUntitled(e.path?e:void 0)}async _doCreateUntitled(e,t,i){const s=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=s.resource,r=await this._textModelResolverService.createModelReference(o);if(!this._modelTrackers.has(o))throw r.dispose(),new Error(`expected URI ${o.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(o,r,r.object.textEditorModel.getValueLength()),T.once(s.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};Dke=D([_(1,Ai),_(2,tr),_(3,ci),_(4,Rn),_(5,Za),_(6,_o),_(7,fC),_(8,Lm)],Dke);class cy{static readFromEditor(e,t,i){const s=cy._readSelectionsFromCodeEditor(e,i),o=cy._readOptionsFromCodeEditor(e,t,i),r=cy._readVisibleRangesFromCodeEditor(e,i);return new cy(s,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new mt(1,1,1,1)]),i}static _readOptionsFromCodeEditor(e,t,i){if(t.isDisposed()){if(e)return e.options;throw new Error("No valid properties")}let s,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);s=a.get(x.cursorStyle),o=c.renderType}else e?(s=e.options.cursorStyle,o=e.options.lineNumbers):(s=fa.Line,o=Qr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:s,lineNumbers:o}}static _readVisibleRangesFromCodeEditor(e,t){return t?t.getVisibleRanges():[]}constructor(e,t,i){this.selections=e,this.options=t,this.visibleRanges=i}generateDelta(e,t){const i={options:null,selections:null,visibleRanges:null};return(!e||!cy._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!cy._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!cy._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return Ls(e,t,(i,s)=>i.equalsSelection(s))}static _rangesEqual(e,t){return Ls(e,t,(i,s)=>i.equalsRange(s))}static _optionsEqual(e,t){return e&&!t||!e&&t?!1:!e&&!t?!0:e.tabSize===t.tabSize&&e.indentSize===t.indentSize&&e.insertSpaces===t.insertSpaces&&e.cursorStyle===t.cursorStyle&&e.lineNumbers===t.lineNumbers}}class hjt{constructor(e,t,i,s,o,r,a){this._modelListeners=new Z,this._codeEditorListeners=new Z,this._id=e,this._model=t,this._codeEditor=null,this._properties=null,this._focusTracker=s,this._mainThreadDocuments=o,this._modelService=r,this._clipboardService=a,this._onPropertiesChanged=new I,this._modelListeners.add(this._model.onDidChangeOptions(c=>{this._updatePropertiesNow(null)})),this.setCodeEditor(i),this._updatePropertiesNow(null)}dispose(){this._modelListeners.dispose(),this._codeEditor=null,this._codeEditorListeners.dispose()}_updatePropertiesNow(e){this._setProperties(cy.readFromEditor(this._properties,this._model,this._codeEditor),e)}_setProperties(e,t){const i=e.generateDelta(this._properties,t);this._properties=e,i&&this._onPropertiesChanged.fire(i)}getId(){return this._id}getModel(){return this._model}getCodeEditor(){return this._codeEditor}hasCodeEditor(e){return this._codeEditor===e}setCodeEditor(e){if(!this.hasCodeEditor(e)&&(this._codeEditorListeners.clear(),this._codeEditor=e,this._codeEditor)){this._codeEditorListeners.add(this._codeEditor.onDidChangeModel(()=>{this.setCodeEditor(null)})),this._codeEditorListeners.add(this._codeEditor.onDidFocusEditorWidget(()=>{this._focusTracker.onGainedFocus()})),this._codeEditorListeners.add(this._codeEditor.onDidBlurEditorWidget(()=>{this._focusTracker.onLostFocus()}));let t=null;this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(o=>{if(o.toString()===this._model.uri.toString()){const r=t;t=null,this._updatePropertiesNow(r)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,s=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&s(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&s(null)})),this._updatePropertiesNow(null)}}isVisible(){return!!this._codeEditor}getProperties(){return this._properties}get onPropertiesChanged(){return this._onPropertiesChanged.event}setSelections(e){if(this._codeEditor){this._codeEditor.setSelections(e);return}const t=e.map(mt.liftSelection);this._setProperties(new cy(t,this._properties.options,this._properties.visibleRanges),null)}_setIndentConfiguration(e){const t=this._modelService.getCreationOptions(this._model.getLanguageId(),this._model.uri,this._model.isForSimpleWidget);if(e.tabSize==="auto"||e.insertSpaces==="auto"){let s=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(s=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(s,o);return}const i={};typeof e.insertSpaces<"u"&&(i.insertSpaces=e.insertSpaces),typeof e.tabSize<"u"&&(i.tabSize=e.tabSize),typeof e.indentSize<"u"&&(i.indentSize=e.indentSize),this._model.updateOptions(i)}setConfiguration(e){if(this._setIndentConfiguration(e),!!this._codeEditor){if(e.cursorStyle){const t=ddt(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case Qr.On:t="on";break;case Qr.Relative:t="relative";break;case Qr.Interval:t="interval";break;default:t="off"}this._codeEditor.updateOptions({lineNumbers:t})}}}setDecorations(e,t){this._codeEditor&&this._codeEditor.setDecorationsByType("exthost-api",e,t)}setDecorationsFast(e,t){if(!this._codeEditor)return;const i=[];for(let s=0,o=Math.floor(t.length/4);s({range:O.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",s),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,s){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(ww.guessNeedsClipboard(t)){const l=new Bde(this._codeEditor,hr.Value|hr.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=pc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:O.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:s.undoStopBefore,undoStopAfter:s.undoStopAfter,clipboardText:o}),!0}}var kke,NP;let Ike=(NP=class{constructor(e,t,i,s,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=s,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++kke.INSTANCE_COUNT),this._proxy=t.getProxy(et.ExtHostEditors),this._textEditorsListenersMap=Object.create(null),this._editorPositionData=null,this._toDispose.add(this._editorService.onDidVisibleEditorsChange(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidRemoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidMoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._registeredDecorationTypes=Object.create(null)}dispose(){Object.keys(this._textEditorsListenersMap).forEach(e=>{St(this._textEditorsListenersMap[e])}),this._textEditorsListenersMap=Object.create(null),this._toDispose.dispose();for(const e in this._registeredDecorationTypes)this._codeEditorService.removeDecorationType(e);this._registeredDecorationTypes=Object.create(null)}handleTextEditorAdded(e){const t=e.getId(),i=[];i.push(e.onPropertiesChanged(s=>{this._proxy.$acceptEditorPropertiesChanged(t,s)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){St(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Io(this._editorPositionData,e)||(this._editorPositionData=e,this._proxy.$acceptEditorPositionData(this._editorPositionData))}_getTextEditorPositionData(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=this._editorLocator.findTextEditorIdFor(t);i&&(e[i]=U1(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=P.revive(e),s={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?y1.RESTORE:void 0,override:kbe.EXCLUSIVE_ONLY},o={resource:i,options:s},r=await this._editorService.openEditor(o,ane(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=_z(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const s=i.getModel();await this._editorService.openEditor({resource:s.uri,options:{preserveFocus:!1}},ane(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const s of i)if(t.matches(s)){await s.group.closeEditor(s.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const s=this._editorLocator.getEditor(e);return s?(s.revealRange(t,i),Promise.resolve()):Promise.reject(Hi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,s){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,s)):Promise.reject(Hi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,s,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,s,o)):Promise.reject(Hi(`TextEditor(${e})`))}$registerTextEditorDecorationType(e,t,i){t=`${this._instanceId}-${t}`,this._registeredDecorationTypes[t]=!0,this._codeEditorService.registerDecorationType(`exthost-api-${e}`,t,i)}$removeTextEditorDecorationType(e){e=`${this._instanceId}-${e}`,delete this._registeredDecorationTypes[e],this._codeEditorService.removeDecorationType(e)}$getDiffInformation(e){const t=this._editorLocator.getEditor(e);if(!t)return Promise.reject(new Error("No such TextEditor"));const i=t.getCodeEditor();if(!i)return Promise.reject(new Error("No such CodeEditor"));const s=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===s||c.getModifiedEditor().getId()===s);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},kke=NP,NP.INSTANCE_COUNT=0,NP);Ike=kke=D([_(2,Qt),_(3,_i),_(4,ur),_(5,Re)],Ike);yt.registerCommand("_workbench.revertAllDirty",async function(n){if(!n.get(Il).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=n.get(Pw);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let j$e=class{};class ujt{static[Symbol.hasInstance](e){return j$e!=null&&e instanceof j$e}}class gjt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class Lke{constructor(e,t,i,s,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=s,this.oldActiveEditor=o,this.newActiveEditor=r,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&o===r}toString(){let e=`DocumentAndEditorStateDelta +`),t.join("")}}let U$e=class{constructor(e,t,i,s){this._workspaceContextService=t,this.configurationService=i,this._environmentService=s;const o=e.getProxy(et.ExtHostConfiguration);o.$initializeConfiguration(this._getConfigurationData()),this._configurationListener=i.onDidChangeConfiguration(r=>{o.$acceptConfigurationChanged(this._getConfigurationData(),r.change)})}_getConfigurationData(){const e={...this.configurationService.getConfigurationData(),configurationScopes:[]};return(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment)&&(e.configurationScopes=Tft()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,s,o){return s={resource:s?.resource?P.revive(s.resource):void 0,overrideIdentifier:s?.overrideIdentifier},this.writeConfiguration(e,t,i,s,o)}$removeConfigurationOption(e,t,i,s){return i={resource:i?.resource?P.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,s)}writeConfiguration(e,t,i,s,o){e=e??this.deriveConfigurationTarget(t,s);const r=this.configurationService.inspect(t,s);switch(e){case Ot.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,s,o);case Ot.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,s,o);case Ot.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,s,o);case Ot.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,s,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,s,o)}}_updateValue(e,t,i,s,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&s!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===Nn.WORKSPACE){const i=it.as(Cs.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===ut.RESOURCE||i[e].scope===ut.LANGUAGE_OVERRIDABLE))return Ot.WORKSPACE_FOLDER}return Ot.WORKSPACE}};U$e=D([en(Ue.MainThreadConfiguration),_(1,Ti),_(2,Re),_(3,Il)],U$e);function AOe(n){const e=[];let t;try{const i=JSON.parse(n.arguments),s=i[i.length-1];s&&s.__$stack&&(i.pop(),t=s.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",n.arguments)}return{args:e,stack:t}}function ejt(n){if(!n)return n;const e=n.indexOf(` +`);return e===-1?n:n.substring(0,e)}function tjt(n,e){const{args:t,stack:i}=AOe(n),s=typeof t[0]=="string"&&t.length===1;let o=ejt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&s?r=[`%c[${e}] %c${t[0]} %c${o}`,oB("blue"),oB(""),oB("grey")]:r=[`%c[${e}] %c${t[0]}`,oB("blue"),oB(""),...t.slice(1)]:r=[`%c[${e}]%`,oB("blue"),...t],o&&!s&&r.push(o),typeof console[n.severity]!="function")throw new Error("Unknown console method");console[n.severity].apply(console,r)}function oB(n){return`color: ${n}`}function ijt(n,e,t=null){const i=AOe(e).args;let s=i.shift();if(typeof s=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s=t+s),e.severity){case"log":case"info":n.info(s,...i);break;case"warn":n.warn(s,...i);break;case"error":n.error(s,...i);break}}function njt(n,e,t){const i=AOe(e).args,s=i.shift();typeof s!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n.error(t+s,...i))}let V$e=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const s=dOe(this._environmentService);this._isExtensionDevTestFromCli=s.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?ijt(this._logService,e):(njt(this._logService,e,"Extension Host"),tjt(e,"Extension Host"))}};V$e=D([en(Ue.MainThreadConsole),_(1,Il),_(2,Ze)],V$e);const sjt="vs/workbench/contrib/debug/common/abstractDebugAdapter";class Got{constructor(){this.pendingRequests=new Map,this.queue=[],this._onError=new I,this._onExit=new I,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(new Error("attempt to set more than one 'Message' callback")),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(new Error("attempt to set more than one 'Event' callback")),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(new Error("attempt to set more than one 'Request' callback")),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(new Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend("response",e)}sendRequest(e,t,i,s){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof s=="number"){const r=setTimeout(()=>{clearTimeout(r);const a=this.pendingRequests.get(o.seq);if(a){this.pendingRequests.delete(o.seq);const c={type:"response",seq:0,request_seq:o.seq,success:!1,command:e,message:g(sjt,0,"Timeout after {0} ms for '{1}'",s,e)};a(c)}},s)}return i&&this.pendingRequests.set(o.seq,i),o.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!=="event"||t.type!=="event"}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Ta(0),e=this.queue.shift(),!e)return;switch(e.type){case"event":this.eventCallback?.(e);break;case"request":this.requestCallback?.(e);break;case"response":{const t=e,i=this.pendingRequests.get(t.request_seq);i&&(this.pendingRequests.delete(t.request_seq),i(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();const e=new Map;this.pendingRequests.forEach((t,i)=>e.set(i,t)),await Ta(500),e.forEach((t,i)=>{t({type:"response",seq:0,request_seq:i,success:!1,command:"canceled",message:"canceled"}),this.pendingRequests.delete(i)})}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){this.queue=[]}}function qot(n){return n.configuration.request==="attach"&&!Qot(n)&&(!n.parentSession||qot(n.parentSession))}function Qot(n){let e=n.configuration.type;if(e)return e==="vslsShare"&&(e=n.configuration.adapterProxy.configuration.type),Oa(e,"extensionhost")||Oa(e,"pwa-extensionhost")?n:n.parentSession?Qot(n.parentSession):void 0}function ojt(n){return n.type&&(n.label||n.program||n.runtime)}const rjt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function ajt(n){return!!(n&&n.match(rjt))}function jot(n){if(typeof n.path=="string"&&!(typeof n.sourceReference=="number"&&n.sourceReference>0)){if(ajt(n.path))return P.parse(n.path);if(oF(n.path))return P.file(n.path)}return n.path}function Kot(n){if(typeof n.path=="object"){const e=P.revive(n.path);if(e)return e.scheme===_e.file?e.fsPath:e.toString()}return n.path}function Yot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{s&&o&&(o.path=t(o))}),i}function Jot(n,e){const t=e?jot:Kot,i=Vs(n);return Xot(i,(s,o)=>{!s&&o&&(o.path=t(o))}),i}function Xot(n,e){switch(n.type){case"event":{const t=n;switch(t.event){case"output":e(!1,t.body.source);break;case"loadedSource":e(!1,t.body.source);break;case"breakpoint":e(!1,t.body.breakpoint.source);break}break}case"request":{const t=n;switch(t.command){case"setBreakpoints":e(!0,t.arguments.source);break;case"breakpointLocations":e(!0,t.arguments.source);break;case"source":e(!0,t.arguments.source);break;case"gotoTargets":e(!0,t.arguments.source);break;case"launchVSCode":t.arguments.args.forEach(i=>e(!1,i));break}break}case"response":{const t=n;if(t.success&&t.body)switch(t.command){case"stackTrace":t.body.stackFrames.forEach(i=>e(!1,i.source));break;case"loadedSources":t.body.sources.forEach(i=>e(!1,i));break;case"scopes":t.body.scopes.forEach(i=>e(!1,i.source));break;case"setFunctionBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"setBreakpoints":t.body.breakpoints.forEach(i=>e(!1,i.source));break;case"disassemble":t.body?.instructions.forEach(s=>e(!1,s.location));break}break}}}let z$e=class{constructor(e,t,i){this.debugService=t,this.visualizerService=i,this._toDispose=new Z,this._debugAdaptersHandleCounter=1,this._visualizerHandles=new Map,this._visualizerTreeHandles=new Map,this._proxy=e.getProxy(et.ExtHostDebugService);const s=new Zo;this._toDispose.add(s),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),s.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=s.get(r);a||(a=new Z,s.set(r,a)),a.add(r.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(r),c)))})),this._toDispose.add(t.onDidEndSession(({session:r,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(r)),this._extHostKnownSessions.delete(r.getId()),a||s.deleteAndDispose(r);for(const[c,l]of this._debugAdapters)l.session===r&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(r=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(r))})),this._toDispose.add(Ee(()=>{for(const[r,a]of this._debugAdapters)a.fireError(r,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const o=this.debugService.getViewModel();this._toDispose.add(T.any(o.onDidFocusStackFrame,o.onDidFocusThread)(()=>{const r=o.focusedStackFrame,a=o.focusedThread;r?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:r.thread.threadId,frameId:r.frameId,sessionId:r.thread.session.getId()}):a?this._proxy.$acceptStackFrameFocus({kind:"thread",threadId:a.threadId,sessionId:a.session.getId()}):this._proxy.$acceptStackFrameFocus(void 0)})),this.sendBreakpointsAndListen()}$registerDebugVisualizerTree(e,t){this.visualizerService.registerTree(e,{disposeItem:i=>this._proxy.$disposeVisualizedTree(i),getChildren:i=>this._proxy.$getVisualizerTreeItemChildren(e,i),getTreeItem:i=>this._proxy.$getVisualizerTreeItem(e,i),editItem:t?(i,s)=>this._proxy.$editVisualizerTreeItem(i,s):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Cn(e),id:t,disposeDebugVisualizers:s=>this._proxy.$disposeDebugVisualizers(s),executeDebugVisualizerCommand:s=>this._proxy.$executeDebugVisualizerCommand(s),provideDebugVisualizers:(s,o)=>this._proxy.$provideDebugVisualizers(e,t,s,o).then(r=>r.map(sDe.deserialize)),resolveDebugVisualizer:(s,o)=>this._proxy.$resolveDebugVisualizer(s.id,o)});this._visualizerHandles.set(`${e}/${t}`,i)}$unregisterDebugVisualizer(e,t){const i=`${e}/${t}`;this._visualizerHandles.get(i)?.dispose(),this._visualizerHandles.delete(i)}sendBreakpointsAndListen(){this._toDispose.add(this.debugService.getModel().onDidChangeBreakpoints(s=>{if(s&&!s.sessionOnly){const o={};s.added&&(o.added=this.convertToDto(s.added)),s.removed&&(o.removed=s.removed.map(r=>r.getId())),s.changed&&(o.changed=this.convertToDto(s.changed)),(o.added||o.removed||o.changed)&&this._proxy.$acceptBreakpointsDelta(o)}}));const e=this.debugService.getModel().getBreakpoints(),t=this.debugService.getModel().getFunctionBreakpoints(),i=this.debugService.getModel().getDataBreakpoints();(e.length>0||t.length>0)&&this._proxy.$acceptBreakpointsDelta({added:this.convertToDto(e).concat(this.convertToDto(t)).concat(this.convertToDto(i))})}dispose(){this._toDispose.dispose()}createDebugAdapter(e){const t=this._debugAdaptersHandleCounter++,i=new cjt(this,t,this._proxy,e);return this._debugAdapters.set(t,i),i}substituteVariables(e,t){return Promise.resolve(this._proxy.$substituteVariables(e?e.uri:void 0,t))}runInTerminal(e,t){return this._proxy.$runInTerminal(e,t)}$registerDebugTypes(e){this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterFactory(e,this))}$registerBreakpoints(e){for(const t of e)if(t.type==="sourceMulti"){const i=t.lines.map(s=>({id:s.id,enabled:s.enabled,lineNumber:s.line+1,column:s.character>0?s.character+1:void 0,condition:s.condition,hitCondition:s.hitCondition,logMessage:s.logMessage,mode:s.mode}));this.debugService.addBreakpoints(P.revive(t.uri),i)}else t.type==="function"?this.debugService.addFunctionBreakpoint({name:t.functionName,mode:t.mode,condition:t.condition,hitCondition:t.hitCondition,enabled:t.enabled,logMessage:t.logMessage},t.id):t.type==="data"&&this.debugService.addDataBreakpoint({description:t.label,src:{type:Ane.Variable,dataId:t.dataId},canPersist:t.canPersist,accessTypes:t.accessTypes,accessType:t.accessType,mode:t.mode});return Promise.resolve()}$unregisterBreakpoints(e,t,i){return e.forEach(s=>this.debugService.removeBreakpoints(s)),t.forEach(s=>this.debugService.removeFunctionBreakpoints(s)),i.forEach(s=>this.debugService.removeDataBreakpoints(s)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,s,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),s&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(r,c,l,d)),o&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(r,c,l,d)),this._debugConfigurationProviders.set(r,a),this._toDispose.add(this.debugService.getConfigurationManager().registerDebugConfigurationProvider(a)),Promise.resolve(void 0)}$unregisterDebugConfigurationProvider(e){const t=this._debugConfigurationProviders.get(e);t&&(this._debugConfigurationProviders.delete(e),this.debugService.getConfigurationManager().unregisterDebugConfigurationProvider(t))}$registerDebugAdapterDescriptorFactory(e,t){const i={type:e,createDebugAdapterDescriptor:s=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(s)))};return this._debugAdapterDescriptorFactories.set(t,i),this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterDescriptorFactory(i)),Promise.resolve(void 0)}$unregisterDebugAdapterDescriptorFactory(e){const t=this._debugAdapterDescriptorFactories.get(e);t&&(this._debugAdapterDescriptorFactories.delete(e),this.debugService.getAdapterManager().unregisterDebugAdapterDescriptorFactory(t))}getSession(e){if(e)return this.debugService.getModel().getSession(e,!0)}async $startDebugging(e,t,i){const s=e?P.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(s),r=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:r,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:r?.compoundRoot,saveBeforeRestart:a,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new uc(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const s=this.debugService.getModel().getSession(e,!0);return s?s.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new uc(o?o.message:"custom request failed"))):Promise.reject(new uc("debug session not found"))}$getDebugProtocolBreakpoint(e,t){const i=this.debugService.getModel().getSession(e,!0);return i?Promise.resolve(i.getDebugProtocolBreakpoint(t)):Promise.reject(new uc("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,qot(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new uc("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:nt.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(Jot(t,!1))}$acceptDAError(e,t,i,s){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} +${s}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAdapter(e){const t=this._debugAdapters.get(e);if(!t)throw new Error("Invalid debug adapter");return t}$sessionCached(e){this._extHostKnownSessions.add(e)}getSessionDto(e){if(e){const t=e.getId();return this._extHostKnownSessions.has(t)?t:{id:t,type:e.configuration.type,name:e.name,folderUri:e.root?e.root.uri:void 0,configuration:e.configuration,parent:e.parentSession?.getId()}}}convertToDto(e){return e.map(t=>{if("name"in t){const i=t;return{type:"function",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,functionName:i.name}}else if("src"in t){const i=t;return{type:"data",id:i.getId(),dataId:i.src.type===Ane.Variable?i.src.dataId:i.src.address,enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,accessType:i.accessType,label:i.description,canPersist:i.canPersist}}else if("uri"in t){const i=t;return{type:"source",id:i.getId(),enabled:i.enabled,condition:i.condition,hitCondition:i.hitCondition,logMessage:i.logMessage,uri:i.uri,line:i.lineNumber>0?i.lineNumber-1:0,character:typeof i.column=="number"&&i.column>0?i.column-1:0}}else return}).filter(yl)}};z$e=D([en(Ue.MainThreadDebugService),_(1,IPe),_(2,UZe)],z$e);class cjt extends Got{constructor(e,t,i,s){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=s}fireError(e,t){this._onError.fire(t)}fireExit(e,t,i){this._onExit.fire(t)}startSession(){return Promise.resolve(this._proxy.$startDASession(this._handle,this._ds.getSessionDto(this.session)))}sendMessage(e){this._proxy.$sendDAMessage(this._handle,Yot(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class ljt{constructor(e,t){this._proxy=e,this._handle=t,this._idPool=0,this._requests=new Map,this._resolver=new Map}enqueue(e,t){const i=++this._idPool,s=new Promise(r=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,r),this._processQueue()}),o=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return s.finally(()=>o.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],qe.None).then(i=>{for(const[s,o]of t)o(i[s])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let $$e=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(et.ExtHostDecorations)}dispose(){this._provider.forEach(e=>St(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,s=new ljt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await s.enqueue(r,a);if(!c)return;const[l,d,h,u]=c;return{weight:10,bubble:l??!1,color:u?.id,tooltip:d,letter:h}}});this._provider.set(e,[i,o])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[s]=i;s.fire(t&&t.map(o=>P.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(St(t),this._provider.delete(e))}};$$e=D([en(Ue.MainThreadDecorations),_(1,rD)],$$e);let G$e=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(et.ExtHostDiagnostics),this._markerListener=this._markerService.onMarkerChanged(this._forwardMarkers,this)}dispose(){this._markerListener.dispose(),this._activeOwners.forEach(e=>this._markerService.changeAll(e,[])),this._activeOwners.clear()}_forwardMarkers(e){const t=[];for(const i of e){const s=this._markerService.read({resource:i});if(s.length===0)t.push([i,[]]);else{const o=s.filter(r=>!this._activeOwners.has(r.owner));o.length>0&&t.push([i,o])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[s,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=P.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=P.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(P.revive(s)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};G$e=D([en(Ue.MainThreadDiagnostics),_(1,U_),_(2,_o)],G$e);var LX;let q$e=LX=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=LX._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=LX._convertSaveOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showSaveDialog(t))}static _convertOpenOptions(e){const t={openLabel:e?.openLabel||void 0,canSelectFiles:e?.canSelectFiles||!e?.canSelectFiles&&!e?.canSelectFolders,canSelectFolders:e?.canSelectFolders,canSelectMany:e?.canSelectMany,defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[_e.vscodeRemote,_e.file]:[]};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?P.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,s]of Object.entries(e.filters))t.filters.push({name:i,extensions:s})}return t}};q$e=LX=D([en(Ue.MainThreadDialogs),_(1,bf)],q$e);let Q$e=class{constructor(e,t,i,s,o){this._textModelResolverService=t,this._languageService=i,this._modelService=s,this._editorWorkerService=o,this._resourceContentProvider=new Zo,this._pendingUpdate=new Map,this._proxy=e.getProxy(et.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),St(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:s=>this._proxy.$provideTextDocumentContent(e,s).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(s,r);return this._modelService.createModel(o,a,s)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(P.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ai;this._pendingUpdate.set(i.id,o);try{const r=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),o.token.isCancellationRequested)return;r&&r.length>0&&i.applyEdits(r.map(a=>ds.replace(O.lift(a.range),a.text)))}catch(r){bt(r)}}};Q$e=D([en(Ue.MainThreadDocumentContentProviders),_(1,Rn),_(2,Di),_(3,Ai),_(4,kd)],Q$e);class Zot{constructor(e,t=1e3*60*3,i=1024*1024*80,s=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=s,this._data=new Array,this._length=0}dispose(){this._data=St(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const s=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(s,this._maxAge),r={uri:e,length:i,dispose:s};this._data.push(r),this._length+=i,this._cleanup()}_cleanup(){for(;this._length>this._maxLength;)this._data[0].dispose();const e=Math.ceil(this._maxSize*1.2);this._data.length>=e&&St(this._data.slice(0,e-this._maxSize))}}class djt extends ${constructor(e,t,i,s){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=s,this._knownVersionId=this._model.getVersionId(),this._store.add(this._model.onDidChangeContent(o=>{this._knownVersionId=o.versionId,this._proxy.$acceptModelChanged(this._model.uri,o,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let Dke=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=s,this._textModelResolverService=o,this._environmentService=r,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new wi,this._modelReferenceCollection=this._store.add(new Zot(a.extUri)),this._proxy=e.getProxy(et.ExtHostDocuments),this._store.add(t.onModelLanguageChanged(this._onModelModeChanged,this)),this._store.add(i.files.onDidSave(d=>{this._shouldHandleFileEvent(d.model.resource)&&this._proxy.$acceptModelSaved(d.model.resource)})),this._store.add(i.files.onDidChangeDirty(d=>{this._shouldHandleFileEvent(d.resource)&&this._proxy.$acceptDirtyStateChanged(d.resource,d.isDirty())})),this._store.add(c.onDidRunWorkingCopyFileOperation(d=>{const h=d.operation===Li.MOVE;if(h||d.operation===Li.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){St(this._modelTrackers.values()),this._modelTrackers.clear(),super.dispose()}isCaughtUpWithContentChanges(e){const t=this._modelTrackers.get(e);return t?t.isCaughtUpWithContentChanges():!0}_shouldHandleFileEvent(e){const t=this._modelService.getModel(e);return!!t&&gS(t)}handleModelAdded(e){gS(e)&&this._modelTrackers.set(e.uri,new djt(e,this._onIsCaughtUpWithContentChanges,this._proxy,this._textFileService))}_onModelModeChanged(e){const{model:t}=e;this._modelTrackers.has(t.uri)&&this._proxy.$acceptModelLanguageChanged(t.uri,t.getLanguageId())}handleModelRemoved(e){this._modelTrackers.has(e)&&(this._modelTrackers.get(e).dispose(),this._modelTrackers.delete(e))}async $trySaveDocument(e){return!!await this._textFileService.save(P.revive(e))}async $tryOpenDocument(e){const t=P.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new uc("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let s;switch(i.scheme){case _e.untitled:s=this._handleUntitledScheme(i);break;case _e.file:default:s=this._handleAsResourceInput(i);break}let o;try{o=await s}catch(r){throw new uc(`cannot open ${i.toString()}. Detail: ${Ma(r)}`)}if(o)if(Fn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new uc(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new uc(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new uc(`cannot open ${i.toString()}`)}$tryCreateDocument(e){return this._doCreateUntitled(void 0,e?e.language:void 0,e?e.content:void 0)}async _handleAsResourceInput(e){const t=await this._textModelResolverService.createModelReference(e);return this._modelReferenceCollection.add(e,t,t.object.textEditorModel.getValueLength()),t.object.textEditorModel.uri}async _handleUntitledScheme(e){const t=R9(e,this._environmentService.remoteAuthority,this._pathService.defaultUriScheme);return await this._fileService.exists(t)?Promise.reject(new Error("file already exists")):await this._doCreateUntitled(e.path?e:void 0)}async _doCreateUntitled(e,t,i){const s=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=s.resource,r=await this._textModelResolverService.createModelReference(o);if(!this._modelTrackers.has(o))throw r.dispose(),new Error(`expected URI ${o.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(o,r,r.object.textEditorModel.getValueLength()),T.once(s.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};Dke=D([_(1,Ai),_(2,tr),_(3,ci),_(4,Rn),_(5,Za),_(6,_o),_(7,fC),_(8,Lm)],Dke);class cy{static readFromEditor(e,t,i){const s=cy._readSelectionsFromCodeEditor(e,i),o=cy._readOptionsFromCodeEditor(e,t,i),r=cy._readVisibleRangesFromCodeEditor(e,i);return new cy(s,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new mt(1,1,1,1)]),i}static _readOptionsFromCodeEditor(e,t,i){if(t.isDisposed()){if(e)return e.options;throw new Error("No valid properties")}let s,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);s=a.get(x.cursorStyle),o=c.renderType}else e?(s=e.options.cursorStyle,o=e.options.lineNumbers):(s=fa.Line,o=Qr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:s,lineNumbers:o}}static _readVisibleRangesFromCodeEditor(e,t){return t?t.getVisibleRanges():[]}constructor(e,t,i){this.selections=e,this.options=t,this.visibleRanges=i}generateDelta(e,t){const i={options:null,selections:null,visibleRanges:null};return(!e||!cy._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!cy._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!cy._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return Ls(e,t,(i,s)=>i.equalsSelection(s))}static _rangesEqual(e,t){return Ls(e,t,(i,s)=>i.equalsRange(s))}static _optionsEqual(e,t){return e&&!t||!e&&t?!1:!e&&!t?!0:e.tabSize===t.tabSize&&e.indentSize===t.indentSize&&e.insertSpaces===t.insertSpaces&&e.cursorStyle===t.cursorStyle&&e.lineNumbers===t.lineNumbers}}class hjt{constructor(e,t,i,s,o,r,a){this._modelListeners=new Z,this._codeEditorListeners=new Z,this._id=e,this._model=t,this._codeEditor=null,this._properties=null,this._focusTracker=s,this._mainThreadDocuments=o,this._modelService=r,this._clipboardService=a,this._onPropertiesChanged=new I,this._modelListeners.add(this._model.onDidChangeOptions(c=>{this._updatePropertiesNow(null)})),this.setCodeEditor(i),this._updatePropertiesNow(null)}dispose(){this._modelListeners.dispose(),this._codeEditor=null,this._codeEditorListeners.dispose()}_updatePropertiesNow(e){this._setProperties(cy.readFromEditor(this._properties,this._model,this._codeEditor),e)}_setProperties(e,t){const i=e.generateDelta(this._properties,t);this._properties=e,i&&this._onPropertiesChanged.fire(i)}getId(){return this._id}getModel(){return this._model}getCodeEditor(){return this._codeEditor}hasCodeEditor(e){return this._codeEditor===e}setCodeEditor(e){if(!this.hasCodeEditor(e)&&(this._codeEditorListeners.clear(),this._codeEditor=e,this._codeEditor)){this._codeEditorListeners.add(this._codeEditor.onDidChangeModel(()=>{this.setCodeEditor(null)})),this._codeEditorListeners.add(this._codeEditor.onDidFocusEditorWidget(()=>{this._focusTracker.onGainedFocus()})),this._codeEditorListeners.add(this._codeEditor.onDidBlurEditorWidget(()=>{this._focusTracker.onLostFocus()}));let t=null;this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(o=>{if(o.toString()===this._model.uri.toString()){const r=t;t=null,this._updatePropertiesNow(r)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,s=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&s(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&s(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&s(null)})),this._updatePropertiesNow(null)}}isVisible(){return!!this._codeEditor}getProperties(){return this._properties}get onPropertiesChanged(){return this._onPropertiesChanged.event}setSelections(e){if(this._codeEditor){this._codeEditor.setSelections(e);return}const t=e.map(mt.liftSelection);this._setProperties(new cy(t,this._properties.options,this._properties.visibleRanges),null)}_setIndentConfiguration(e){const t=this._modelService.getCreationOptions(this._model.getLanguageId(),this._model.uri,this._model.isForSimpleWidget);if(e.tabSize==="auto"||e.insertSpaces==="auto"){let s=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(s=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(s,o);return}const i={};typeof e.insertSpaces<"u"&&(i.insertSpaces=e.insertSpaces),typeof e.tabSize<"u"&&(i.tabSize=e.tabSize),typeof e.indentSize<"u"&&(i.indentSize=e.indentSize),this._model.updateOptions(i)}setConfiguration(e){if(this._setIndentConfiguration(e),!!this._codeEditor){if(e.cursorStyle){const t=ddt(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case Qr.On:t="on";break;case Qr.Relative:t="relative";break;case Qr.Interval:t="interval";break;default:t="off"}this._codeEditor.updateOptions({lineNumbers:t})}}}setDecorations(e,t){this._codeEditor&&this._codeEditor.setDecorationsByType("exthost-api",e,t)}setDecorationsFast(e,t){if(!this._codeEditor)return;const i=[];for(let s=0,o=Math.floor(t.length/4);s({range:O.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",s),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,s){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(ww.guessNeedsClipboard(t)){const l=new Bde(this._codeEditor,hr.Value|hr.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=mc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:O.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:s.undoStopBefore,undoStopAfter:s.undoStopAfter,clipboardText:o}),!0}}var kke,NP;let Ike=(NP=class{constructor(e,t,i,s,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=s,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++kke.INSTANCE_COUNT),this._proxy=t.getProxy(et.ExtHostEditors),this._textEditorsListenersMap=Object.create(null),this._editorPositionData=null,this._toDispose.add(this._editorService.onDidVisibleEditorsChange(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidRemoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._toDispose.add(this._editorGroupService.onDidMoveGroup(()=>this._updateActiveAndVisibleTextEditors())),this._registeredDecorationTypes=Object.create(null)}dispose(){Object.keys(this._textEditorsListenersMap).forEach(e=>{St(this._textEditorsListenersMap[e])}),this._textEditorsListenersMap=Object.create(null),this._toDispose.dispose();for(const e in this._registeredDecorationTypes)this._codeEditorService.removeDecorationType(e);this._registeredDecorationTypes=Object.create(null)}handleTextEditorAdded(e){const t=e.getId(),i=[];i.push(e.onPropertiesChanged(s=>{this._proxy.$acceptEditorPropertiesChanged(t,s)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){St(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Io(this._editorPositionData,e)||(this._editorPositionData=e,this._proxy.$acceptEditorPositionData(this._editorPositionData))}_getTextEditorPositionData(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=this._editorLocator.findTextEditorIdFor(t);i&&(e[i]=U1(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=P.revive(e),s={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?y1.RESTORE:void 0,override:kbe.EXCLUSIVE_ONLY},o={resource:i,options:s},r=await this._editorService.openEditor(o,ane(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=_z(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const s=i.getModel();await this._editorService.openEditor({resource:s.uri,options:{preserveFocus:!1}},ane(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const s of i)if(t.matches(s)){await s.group.closeEditor(s.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const s=this._editorLocator.getEditor(e);return s?(s.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const s=this._editorLocator.getEditor(e);return s?(s.revealRange(t,i),Promise.resolve()):Promise.reject(Hi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Hi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,s){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,s)):Promise.reject(Hi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,s,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,s,o)):Promise.reject(Hi(`TextEditor(${e})`))}$registerTextEditorDecorationType(e,t,i){t=`${this._instanceId}-${t}`,this._registeredDecorationTypes[t]=!0,this._codeEditorService.registerDecorationType(`exthost-api-${e}`,t,i)}$removeTextEditorDecorationType(e){e=`${this._instanceId}-${e}`,delete this._registeredDecorationTypes[e],this._codeEditorService.removeDecorationType(e)}$getDiffInformation(e){const t=this._editorLocator.getEditor(e);if(!t)return Promise.reject(new Error("No such TextEditor"));const i=t.getCodeEditor();if(!i)return Promise.reject(new Error("No such CodeEditor"));const s=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===s||c.getModifiedEditor().getId()===s);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},kke=NP,NP.INSTANCE_COUNT=0,NP);Ike=kke=D([_(2,jt),_(3,_i),_(4,ur),_(5,Re)],Ike);yt.registerCommand("_workbench.revertAllDirty",async function(n){if(!n.get(Il).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=n.get(Pw);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let j$e=class{};class ujt{static[Symbol.hasInstance](e){return j$e!=null&&e instanceof j$e}}class gjt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class Lke{constructor(e,t,i,s,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=s,this.oldActiveEditor=o,this.newActiveEditor=r,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&o===r}toString(){let e=`DocumentAndEditorStateDelta `;return e+=` Removed Documents: [${this.removedDocuments.map(t=>t.uri.toString(!0)).join(", ")}] `,e+=` Added Documents: [${this.addedDocuments.map(t=>t.uri.toString(!0)).join(", ")}] `,e+=` Removed Editors: [${this.removedEditors.map(t=>t.id).join(", ")}] `,e+=` Added Editors: [${this.addedEditors.map(t=>t.id).join(", ")}] `,e+=` New Active Editor: ${this.newActiveEditor} -`,e}}class Qpe{static compute(e,t){if(!e)return new Lke([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=Ple(e.documents,t.documents),s=p_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new Lke(i.removed,i.added,s.removed,s.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var BT;(function(n){n[n.Editor=0]="Editor",n[n.Panel=1]="Panel"})(BT||(BT={}));let Tke=class{constructor(e,t,i,s,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=s,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new Zo,this._activeEditorOrder=BT.Editor,this._modelService.onModelAdded(this._updateStateOnModelAdd,this,this._toDispose),this._modelService.onModelRemoved(r=>this._updateState(),this,this._toDispose),this._editorService.onDidActiveEditorChange(r=>this._updateState(),this,this._toDispose),this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor,this,this._toDispose),this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor,this,this._toDispose),this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor,this),T.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Panel,void 0,this._toDispose),T.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusEditorText(()=>this._updateState()),e.onDidFocusEditorWidget(()=>this._updateState(e)))),this._updateState()}_onDidRemoveEditor(e){const t=e.getId();this._toDisposeOnEditorRemove.has(t)&&(this._toDisposeOnEditorRemove.deleteAndDispose(t),this._updateState())}_updateStateOnModelAdd(e){if(gS(e)){if(!this._currentState){this._updateState();return}this._currentState=new Qpe(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new Lke([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())gS(a)&&t.add(a);const i=new Map;let s=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&gS(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new gjt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(s=l.id)}}if(!s){let a;if(this._activeEditorOrder===BT.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(s=c.id)}const o=new Qpe(t,i,s),r=Qpe.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(Sr.Panel);if(e instanceof ujt){const t=e.getControl();if(ja(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return ew(e)&&(e=e.getModifiedEditor()),e}};Tke=D([_(1,Ai),_(2,Qt),_(3,_i),_(4,Nw)],Tke);let K$e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=s,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(et.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new Dke(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Ue.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new Ike(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Ue.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new Tke(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],s=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new hjt(a.id,a.editor.getModel(),a.editor,{onGainedFocus(){},onLostFocus(){}},this._mainThreadDocuments,this._modelService,this._clipboardService);this._textEditors.set(a.id,c),i.push(c)}for(const{id:a}of e.removedEditors){const c=this._textEditors.get(a);c&&(c.dispose(),this._textEditors.delete(a),t.push(a))}const o=Object.create(null);let r=!0;e.newActiveEditor!==void 0&&(r=!1,o.newActiveEditor=e.newActiveEditor),s.length>0&&(r=!1,o.removedDocuments=s),t.length>0&&(r=!1,o.removedEditors=t),e.addedDocuments.length>0&&(r=!1,o.addedDocuments=e.addedDocuments.map(a=>this._toModelAddData(a))),e.addedEditors.length>0&&(r=!1,o.addedEditors=i.map(a=>this._toTextEditorAddData(a))),r||(this._proxy.$acceptDocumentsAndEditorsDelta(o),s.forEach(this._mainThreadDocuments.handleModelRemoved,this._mainThreadDocuments),e.addedDocuments.forEach(this._mainThreadDocuments.handleModelAdded,this._mainThreadDocuments),t.forEach(this._mainThreadEditors.handleTextEditorRemoved,this._mainThreadEditors),i.forEach(this._mainThreadEditors.handleTextEditorAdded,this._mainThreadEditors))}_toModelAddData(e){return{uri:e.uri,versionId:e.getVersionId(),lines:e.getLinesContent(),EOL:e.getEOL(),languageId:e.getLanguageId(),isDirty:this._textFileService.isDirty(e.uri)}}_toTextEditorAddData(e){const t=e.getProperties();return{id:e.getId(),documentUri:e.getModel().uri,options:t.options,selections:t.selections,visibleRanges:t.visibleRanges,editorPosition:this._findEditorPosition(e)}}_findEditorPosition(e){for(const t of this._editorService.visibleEditorPanes)if(e.matches(t))return U1(this._editorGroupService,t.group)}findTextEditorIdFor(e){for(const[t,i]of this._textEditors)if(i.matches(e))return t}getIdOfCodeEditor(e){for(const[t,i]of this._textEditors)if(i.getCodeEditor()===e)return t}getEditor(e){return this._textEditors.get(e)}};K$e=D([TO,_(1,Ai),_(2,tr),_(3,_i),_(4,Qt),_(5,ci),_(6,Rn),_(7,ur),_(8,Nw),_(9,Za),_(10,fC),_(11,_o),_(12,Mu),_(13,Lm),_(14,Re)],K$e);var dT;const jpe={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function fjt(n){const e=n;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function pjt(n){const e=n;return e.kind===qo.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var PP;let Y$e=(PP=class extends ${get id(){return this._id}get active(){return this.selection[0]??null}constructor(e,t,i){super(),this.instantiationService=t,this.configurationService=i,this._onDidModelChange=this._register(new I({leakWarningThreshold:500})),this.onDidModelChange=this._onDidModelChange.event,this.editors=[],this.mru=[],this.editorListeners=new Set,this.locked=!1,this.selection=[],this.preview=null,this.sticky=-1,this.transient=new Set,fjt(e)?this._id=this.deserialize(e):this._id=dT.IDS++,this.onConfigurationUpdated(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e&&!e.affectsConfiguration("workbench.editor.openPositioning")&&!e.affectsConfiguration("workbench.editor.focusRecentEditorAfterClose")||(this.editorOpenPositioning=this.configurationService.getValue("workbench.editor.openPositioning"),this.focusRecentEditorAfterClose=this.configurationService.getValue("workbench.editor.focusRecentEditorAfterClose"))}get count(){return this.editors.length}get stickyCount(){return this.sticky+1}getEditors(e,t){const i=e===eg.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===eg.MOST_RECENTLY_ACTIVE?i.filter(s=>!this.isSticky(s)):i.slice(this.sticky+1):i}getEditorByIndex(e){return this.editors[e]}get activeEditor(){return this.active}isActive(e){return this.matches(this.active,e)}get previewEditor(){return this.preview}openEditor(e,t){const i=t?.sticky||typeof t?.index=="number"&&this.isSticky(t.index),s=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!s&&this.preview===this.activeEditor,a=this.findEditor(e,t);if(a){const[c,l]=a;return this.doSetTransient(c,l,o===!1?!1:this.isTransient(c)),s&&this.doPin(c,l),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),t&&typeof t.index=="number"&&this.moveEditor(c,t.index),i&&this.doStick(c,this.indexOf(c)),{editor:c,isNew:!1}}else{const c=e,l=this.indexOf(this.active);let d;if(t&&typeof t.index=="number"?d=t.index:this.editorOpenPositioning===jpe.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===jpe.LAST?d=this.editors.length:(this.editorOpenPositioning===jpe.LEFT?l===0||!this.editors.length?d=0:d=l:d=l+1,!i&&this.isSticky(d)&&(d=this.sticky+1)),i&&(this.sticky++,this.isSticky(d)||(d=this.sticky)),(s||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!s){if(this.preview){const u=this.indexOf(this.preview);d>u&&d--,this.replaceEditor(this.preview,c,d,!r)}this.preview=c}this.registerEditorListeners(c);const h={kind:qo.EDITOR_OPEN,editor:c,editorIndex:d};return this._onDidModelChange.fire(h),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),{editor:c,isNew:!0}}}registerEditorListeners(e){const t=new Z;this.editorListeners.add(t),t.add(T.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const s={kind:qo.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:qo.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:qo.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:qo.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===qo.EDITOR_CLOSE&&i.editor?.matches(e)&&(St(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,s=!0){const o=this.doCloseEditor(e,mx.REPLACE,s);if(this.splice(i,!1,t),o){const r={kind:qo.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=mx.UNKNOWN,i=!0){const s=this.doCloseEditor(e,t,i);if(s){const o={kind:qo.EDITOR_CLOSE,...s};return this._onDidModelChange.fire(o),s}}doCloseEditor(e,t,i){const s=this.indexOf(e);if(s===-1)return;const o=this.editors[s],r=this.isSticky(s),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:s===this.editors.length-1?c=this.editors[s-1]:c=this.editors[s+1];const l=this.selection.filter(d=>d!==o&&d!==c);this.doSetSelection(c,this.editors.indexOf(c),l)}else this.doSetSelection(null,void 0,[]);else if(!a&&this.doIsSelected(o)){const c=this.selection.filter(l=>l!==o&&l!==this.activeEditor);this.doSetSelection(this.activeEditor,this.indexOf(this.activeEditor),c)}return this.preview===o&&(this.preview=null),this.transient.delete(o),this.splice(s,!0),{editor:o,sticky:r,editorIndex:s,context:t}}moveEditor(e,t){t>=this.editors.length?t=this.editors.length-1:t<0&&(t=0);const i=this.indexOf(e);if(i<0||t===i)return;const s=this.editors[i],o=this.sticky;this.isSticky(i)&&t>this.sticky?this.sticky--:!this.isSticky(i)&&t<=this.sticky&&this.sticky++,this.editors.splice(i,1),this.editors.splice(t,0,s);const r={kind:qo.EDITOR_MOVE,editor:s,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:qo.EDITOR_STICKY,editor:s,editorIndex:t};this._onDidModelChange.fire(a)}return s}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:qo.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doSetSelection(i,s,[]),i}get selectedEditors(){return this.editors.filter(e=>this.doIsSelected(e))}isSelected(e){let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.doIsSelected(t)}doIsSelected(e){return this.selection.includes(e)}setSelection(e,t){const i=this.findEditor(e);if(!i)return;const[s,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==s&&r.add(l)}this.doSetSelection(s,o,Array.from(r))}doSetSelection(e,t,i){const s=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&s!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:qo.EDITOR_ACTIVE,editor:e,editorIndex:t};this._onDidModelChange.fire(l)}if(a||o.length!==r.length||o.some(c=>!r.includes(c))){const c={kind:qo.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:qo.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:qo.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doPin(i,s),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnpin(i,s),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const s={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(s),i&&this.closeEditor(i,mx.UNPIN)}isPinned(e){let t;return typeof e=="number"?t=this.editors[e]:t=e,!this.matches(this.preview,t)}stick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doStick(i,s),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnstick(i,s),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}isSticky(e){if(this.sticky<0)return!1;let t;return typeof e=="number"?t=e:t=this.indexOf(e),t<0?!1:t<=this.sticky}setTransient(e,t){if(!t&&this.transient.size===0)return;const i=this.findEditor(e);if(!i)return;const[s,o]=i;return this.doSetTransient(s,o,t),s}doSetTransient(e,t,i){if(i){if(this.transient.has(e))return;this.transient.add(e)}else{if(!this.transient.has(e))return;this.transient.delete(e)}const s={kind:qo.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(s)}isTransient(e){if(this.transient.size===0)return!1;let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.transient.has(t)}splice(e,t,i){const s=this.editors[e];if(t&&this.isSticky(e)&&this.sticky--,i?this.editors.splice(e,t?1:0,i):this.editors.splice(e,t?1:0),!t&&i)this.mru.length===0?this.mru.push(i):this.mru.splice(1,0,i);else{const o=this.indexOf(s,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let s=-1;if(!e)return s;for(let o=0;othis.indexOf(a,t)).filter(a=>a>=0);return{id:this.id,locked:this.locked?!0:void 0,editors:i,mru:r,preview:s,sticky:o>=0?o:void 0}}deserialize(e){const t=it.as(zS.EditorFactory);return typeof e.id=="number"?(this._id=e.id,dT.IDS=Math.max(e.id+1,dT.IDS)):this._id=dT.IDS++,e.locked&&(this.locked=!0),this.editors=Ui(e.editors.map((i,s)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof cC&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&s<=e.sticky&&e.sticky--,o})),this.mru=Ui(e.mru.map(i=>this.editors[i])),this.selection=this.mru.length>0?[this.mru[0]]:[],typeof e.preview=="number"&&(this.preview=this.editors[e.preview]),typeof e.sticky=="number"&&(this.sticky=e.sticky),this._id}dispose(){St(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},dT=PP,PP.IDS=0,PP);Y$e=dT=D([_(1,be),_(2,Re)],Y$e);class mjt extends ${constructor(e,t){super(),this._register(pe(e,xe.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(pe(e,xe.DRAG_END,i)),this._register(pe(e,xe.MOUSE_MOVE,s=>{s.buttons===0&&i()}))}}const sle=class sle extends cC{get typeId(){return sle.typeId}get editorId(){return this.viewType}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor}get resource(){return P.from({scheme:_e.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=Dr(),this._hasTransfered=!1,this.viewType=e.viewType,this.providedId=e.providedId,this._name=e.name,this._webview=t}dispose(){this.isDisposed()||this._hasTransfered||this._webview?.dispose(),super.dispose()}getName(){return this._name}getTitle(e){return this.getName()}getDescription(){}setName(e){this._name=e,this.webview.setTitle(e),this._onDidChangeLabel.fire()}get webview(){return this._webview}get extension(){return this.webview.extension}get iconPath(){return this._iconPath}set iconPath(e){this._iconPath=e,this._iconManager.setIcons(this._resourceId,e)}matches(e){return super.matches(e)||e===this}get group(){return this._group}updateGroup(e){this._group=e}transfer(e){if(!this._hasTransfered)return this._hasTransfered=!0,e._webview=this._webview,e}claim(e,t,i){return this._webview.claim(e,t,i)}};sle.typeId="workbench.editors.webviewInput";let Qg=sle;var Rke;const _jt="vs/workbench/contrib/webviewPanel/browser/webviewEditor",vjt=new Y("activeWebviewPanelId","",{type:"string",description:g(_jt,0,"The viewType of the currently active webview panel.")});var FP;let J$e=(FP=class extends sne{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,s,o,r,a,c,l){super(Rke.ID,e,t,i,s),this._editorGroupsService=o,this._editorService=r,this._workbenchLayoutService=a,this._hostService=c,this._contextKeyService=l,this._visible=!1,this._isDisposed=!1,this._webviewVisibleDisposables=this._register(new Z),this._onFocusWindowHandler=this._register(new Dn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new Dn);const d=o.getPart(e);this._register(T.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Qg?this.input.webview:void 0}get scopedContextKeyService(){return this._scopedContextKeyService.value}createEditor(e){const t=document.createElement("div");this._element=t,this._element.id=`webview-editor-element-${Dr()}`,e.appendChild(t),this._scopedContextKeyService.value=this._register(this._contextKeyService.createScoped(t))}dispose(){this._isDisposed=!0,this._element?.remove(),this._element=void 0,super.dispose()}layout(e){this._dimension=e,this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview,e)}focus(){super.focus(),!this._onFocusWindowHandler.value&&!Jn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus(Lne.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Qg&&this.webview&&(e?this.claimWebview(this.input):this.webview.release(this)),super.setEditorVisible(e)}clearInput(){this.webview&&(this.webview.release(this),this._webviewVisibleDisposables.clear()),super.clearInput()}async setInput(e,t,i,s){if(this.input&&e.matches(this.input))return;const o=e instanceof Qg&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,s),await e.resolve(),!(s.isCancellationRequested||this._isDisposed)&&e instanceof Qg&&(e.updateGroup(this.group.id),o||this.claimWebview(e),this._dimension&&this.layout(this._dimension))}claimWebview(e){e.claim(this,this.window,this.scopedContextKeyService),this._element&&(this._element.setAttribute("aria-flowto",e.webview.container.id),$ut(e.webview.container,this._element)),this._webviewVisibleDisposables.clear(),this._webviewVisibleDisposables.add(this._editorGroupsService.createEditorDropTarget(e.webview.container,{containsGroup:t=>this.group.id===t.id})),this._webviewVisibleDisposables.add(new mjt(this.window,()=>this.webview)),this.synchronizeWebviewContainerDimensions(e.webview),this._webviewVisibleDisposables.add(this.trackFocus(e.webview))}synchronizeWebviewContainerDimensions(e,t){if(!this._element?.isConnected)return;const i=this._workbenchLayoutService.getContainer(this.window,Lne.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Dd(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},Rke=FP,FP.ID="WebviewEditor",FP);J$e=Rke=D([_(1,on),_(2,pn),_(3,sn),_(4,ur),_(5,_i),_(6,kO),_(7,Id),_(8,Pe)],J$e);let Mke=class{constructor(e,t){this._lifecycleService=e,this._configService=t,this._icons=new Map,this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()})}dispose(){this._styleElementDisposable?.dispose(),this._styleElementDisposable=void 0,this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElementDisposable=new Z,this._styleElement=od(void 0,void 0,this._styleElementDisposable),this._styleElement.className="webview-icons"),this._styleElement}setIcons(e,t){t?this._icons.set(e,t):this._icons.delete(e),this.updateStyleSheet()}async updateStyleSheet(){await this._lifecycleService.when(Us.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const s=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${s}, .monaco-workbench.hc-light ${s} { content: ""; background-image: ${uf(i.light)}; }`,`.monaco-workbench.vs-dark ${s}, .monaco-workbench.hc-black ${s} { content: ""; background-image: ${uf(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` -`)}};Mke=D([_(0,mg),_(1,Re)],Mke);function Use(n,e){return n.canResolve(e)}let QF=class extends Qg{constructor(e,t,i){super(e,t,i.iconManager),this._webviewWorkbenchService=i,this._resolved=!1}dispose(){super.dispose(),this._resolvePromise?.cancel(),this._resolvePromise=void 0}async resolve(){if(!this._resolved){this._resolved=!0,this._resolvePromise=na(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Na(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};QF.__decorator=D([ii],QF.prototype,"resolve",null);QF=D([_(2,kQ)],QF);class wjt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new sd,s=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=pa(e.webview.onDidDispose(s),t.onCancellationRequested(()=>{s(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:s})=>Use(e,s));this._awaitingRevival=this._awaitingRevival.filter(({input:s})=>!Use(e,s));for(const{input:s,promise:o,disposable:r}of i)e.resolveWebview(s,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let X$e=class extends ${constructor(e,t,i,s){super(),this._editorService=t,this._instantiationService=i,this._webviewService=s,this._revivers=new Set,this._revivalPool=new wjt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(Mke)),this._register(e.registerContextKeyProvider({contextKey:vjt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(s.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg?t=e.primary:e.secondary instanceof Qg&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Qg&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,s){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Qg,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:s.preserveFocus,activation:s.preserveFocus?y1.RESTORE:void 0},s.group),r}revealWebview(e,t,i){const s=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(s,{preserveFocus:i,activation:i?y1.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof op&&(e===t.primary||e===t.secondary))return t;return e}openRevivedWebview(e){const t=this._webviewService.createWebviewOverlay(e.webviewInitInfo);t.state=e.state;const i=this._instantiationService.createInstance(QF,{viewType:e.viewType,providedId:e.webviewInitInfo.providedViewType,name:e.title},t);return i.iconPath=e.iconPath,typeof e.group=="number"&&i.updateGroup(e.group),i}registerResolver(e){this._revivers.add(e);const t=new ai;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof QF?!0:fi.some(this._revivers.values(),t=>Use(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Use(i,e))return await i.resolveWebview(e,t),!0;return!1}async resolveWebview(e,t){if(!await this.tryRevive(e,t)&&!t.isCancellationRequested)return this._revivalPool.enqueueForRestoration(e,t)}setIcons(e,t){this._iconManager.setIcons(e,t)}};X$e=D([_(0,ur),_(1,_i),_(2,be),_(3,Zde)],X$e);var MB;const Kpe="vs/workbench/contrib/customEditor/browser/customEditorInput";var OP;let nH=(OP=class extends QF{static create(e,t,i,s,o){return e.invokeFunction(r=>{const a=r.get(RQ).getValue(t),c=a?ze.fromString(a):void 0,l=r.get(Zde).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(MB,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof s<"u"&&d.updateGroup(s),d})}get resource(){return this._editorResource}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,s),this.instantiationService=o,this.labelService=r,this.customEditorService=a,this.fileDialogService=c,this.undoRedoService=l,this.fileService=d,this.filesConfigurationService=h,this.editorGroupsService=u,this.layoutService=f,this.customEditorLabelService=p,this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._editorResource=e.resource,this.oldResource=i.oldResource,this._defaultDirtyState=i.startsDirty,this._backupId=i.backupId,this._untitledDocumentData=i.untitledDocumentData,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this.resource.scheme&&this.updateLabel()}updateLabel(){this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}get typeId(){return MB.typeId}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return e|=Mi.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Mi.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??yr(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this.resource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this.resource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this.resource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof MB&&this.viewType===e.viewType&&_n(this.resource,e.resource)}copy(){return MB.create(this.instantiationService,this.resource,this.viewType,this.group,this.webview.options)}isReadonly(){return this._modelRef?this._modelRef.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._modelRef?this._modelRef.object.isDirty():!!this._defaultDirtyState}async save(e,t){if(!this._modelRef)return;const i=await this._modelRef.object.saveCustomEditor(t);if(i)return _n(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,s=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(s&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,s,t))return(await this.rename(e,s))?.editor}async revert(e,t){if(this._modelRef)return this._modelRef.object.revert(t);this._defaultDirtyState=!1,this._onDidChangeDirty.fire()}async resolve(){if(await super.resolve(),this.isDisposed())return null;if(!this._modelRef){const e=this.capabilities;this._modelRef=this._register(ws(await this.customEditorService.models.tryRetain(this.resource,this.viewType))),this._register(this._modelRef.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._modelRef.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._untitledDocumentData&&(this._defaultDirtyState=!0),this.isDirty()&&this._onDidChangeDirty.fire(),this.capabilities!==e&&this._onDidChangeCapabilities.fire()}return null}async rename(e,t){return{editor:{resource:t}}}undo(){return ws(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return ws(this._modelRef),this.undoRedoService.redo(this.resource)}onMove(e){this._moveHandler=e}transfer(e){if(super.transfer(e))return e._moveHandler=this._moveHandler,this._moveHandler=void 0,e}get backupId(){return this._modelRef?this._modelRef.object.backupId:this._backupId}get untitledDocumentData(){return this._untitledDocumentData}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}claim(e,t,i){if(this.doCanMove(t.vscodeWindowId)!==!0)throw xZe(g(Kpe,0,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[_l({id:"openInOriginalWindow",label:g(Kpe,1,"Open in Original Window"),run:async()=>{const s=this.editorGroupsService.getPart(this.layoutService.getContainer(gt(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,s.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const s=this.doCanMove(i.windowId);if(typeof s=="string")return s}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&>(this.webview.container).vscodeWindowId!==e?g(Kpe,2,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},MB=OP,OP.typeId="workbench.editors.webviewEditor",OP);nH=MB=D([_(3,kQ),_(4,be),_(5,eo),_(6,kPe),_(7,bf),_(8,pO),_(9,ci),_(10,hh),_(11,ur),_(12,kO),_(13,aD)],nH);var NB,J0;let Nke=(J0=class extends cC{static create(e,t,i,s,o){return e.createInstance(NB,t,i,s,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return NB.ID}get language(){return this._inputModelRef?.object.textEditorModel.getLanguageId()??this._initLanguage}get notebookEditorInput(){return this._notebookEditorInput}get editorInputs(){return[this._notebookEditorInput]}get resource(){return this._resource}get inputResource(){return this._inputResource}get primary(){return this._notebookEditorInput}constructor(e,t,i,s,o,r,a,c,l,d,h){const u=VM.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(tke.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??NB.windowNames[e.path]??yr(e.path,T_(e.path)),this._initLanguage=s,this._resource=e,this._inputResource=t,this._inputResolver=null,this._editorModelReference=null,this._inputModelRef=null,this._textModelService=r,this._interactiveDocumentService=a,this._historyService=c,this._registerListeners()}_registerListeners(){const e=T.once(this.primary.onWillDispose);this._register(e(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire()))}get capabilities(){const e=this.isScratchpad?Mi.Scratchpad:0;return Mi.Untitled|Mi.Readonly|e}async _resolveEditorModel(){return this._editorModelReference||(this._editorModelReference=await this._notebookEditorInput.resolve()),this._editorModelReference}async resolve(){return this._editorModelReference?this._editorModelReference:this._inputResolver?this._inputResolver:(this._inputResolver=this._resolveEditorModel(),this._inputResolver)}async resolveInput(e){if(this._inputModelRef)return this._inputModelRef.object.textEditorModel;const t=e??this._initLanguage??Kc;return this._interactiveDocumentService.willCreateInteractiveDocument(this.resource,this.inputResource,t),this._inputModelRef=await this._textModelService.createModelReference(this.inputResource),this._inputModelRef.object.textEditorModel}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const s=this.getName()+".ipynb",o=qt(await this._fileDialogService.defaultFilePath(),s),r=await this._fileDialogService.pickFileToSave(o,t?.availableFileSystems);if(!r)return;const a=await this._editorModelReference.saveAs(r);return a&&"resource"in a&&a.resource&&this._notebookService.getNotebookTextModel(a.resource)?.dispose(),a}matches(e){return super.matches(e)?!0:e instanceof NB?_n(this.resource,e.resource)&&_n(this.inputResource,e.inputResource):!1}getName(){return this.name}isDirty(){return this.isScratchpad?!1:this._editorModelReference?.isDirty()??!1}isModified(){return this._editorModelReference?.isModified()??!1}async revert(e,t){this._editorModelReference&&this._editorModelReference.isDirty()&&await this._editorModelReference.revert(t)}dispose(){this._editorModelReference?.revert({soft:!0}),this._notebookEditorInput?.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,this._interactiveDocumentService.willRemoveInteractiveDocument(this.resource,this.inputResource),this._inputModelRef?.dispose(),this._inputModelRef=null,super.dispose()}get historyService(){return this._historyService}},NB=J0,J0.windowNames={},J0.ID="workbench.input.interactive",J0);Nke=NB=D([_(4,be),_(5,Rn),_(6,TPe),_(7,$Ze),_(8,oD),_(9,bf),_(10,Re)],Nke);const HA=class HA{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const s of e)t=Math.min(t,s.startLineNumber),i=Math.max(i,s.startLineNumber+s.lineCount);return new HA(t,i-t)}static fromLineNumbers(e,t){return new HA(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new cn}join(e){return new HA(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive)-this.startLineNumber)}get endLineNumberExclusive(){return this.startLineNumber+this.lineCount}get isEmpty(){return this.lineCount===0}touches(e){return this.endLineNumberExclusive>=e.startLineNumber&&e.endLineNumberExclusive>=this.startLineNumber}isAfter(e){return this.startLineNumber>=e.endLineNumberExclusive}isBefore(e){return e.startLineNumber>=this.endLineNumberExclusive}delta(e){return new HA(this.startLineNumber+e,this.lineCount)}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}equals(e){return this.startLineNumber===e.startLineNumber&&this.lineCount===e.lineCount}contains(e){return this.startLineNumber<=e&&ee.startLineNumber,cg);let ap=HA;const bjt={start:"<<<<<<<",end:">>>>>>>"};function*Cjt(n,e,t){const i=new DS(e);for(const s of n){i.takeWhile(r=>i1.isGreaterThan(t(s,r)));const o=i.takeWhile(r=>i1.isNeitherLessOrGreaterThan(t(s,r)));yield{left:s,rights:o||[]}}}function ert(...n){return[].concat(...n)}let Z$e=class{constructor(e,t){this.key=e,this.storageService=t,this.hasValue=!1,this.value=void 0}get(){if(!this.hasValue){const e=this.storageService.get(this.key,ke.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){bt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),ke.PROFILE,ln.USER)}};Z$e=D([_(1,sn)],Z$e);class CG{constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&Ls(this.newLines,e.newLines)}toEdits(e){return new Sjt([this]).toEdits(e)}}class yjt{constructor(e,t){this.range=e,this.newText=t}equals(e){return O.equalsRange(this.range,e.range)&&this.newText===e.newText}}class Sjt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new O(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` +`,e}}class Qpe{static compute(e,t){if(!e)return new Lke([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=Ple(e.documents,t.documents),s=p_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new Lke(i.removed,i.added,s.removed,s.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var BT;(function(n){n[n.Editor=0]="Editor",n[n.Panel=1]="Panel"})(BT||(BT={}));let Tke=class{constructor(e,t,i,s,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=s,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new Zo,this._activeEditorOrder=BT.Editor,this._modelService.onModelAdded(this._updateStateOnModelAdd,this,this._toDispose),this._modelService.onModelRemoved(r=>this._updateState(),this,this._toDispose),this._editorService.onDidActiveEditorChange(r=>this._updateState(),this,this._toDispose),this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor,this,this._toDispose),this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor,this,this._toDispose),this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor,this),T.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Panel,void 0,this._toDispose),T.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===Sr.Panel)(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=BT.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusEditorText(()=>this._updateState()),e.onDidFocusEditorWidget(()=>this._updateState(e)))),this._updateState()}_onDidRemoveEditor(e){const t=e.getId();this._toDisposeOnEditorRemove.has(t)&&(this._toDisposeOnEditorRemove.deleteAndDispose(t),this._updateState())}_updateStateOnModelAdd(e){if(gS(e)){if(!this._currentState){this._updateState();return}this._currentState=new Qpe(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new Lke([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())gS(a)&&t.add(a);const i=new Map;let s=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&gS(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new gjt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(s=l.id)}}if(!s){let a;if(this._activeEditorOrder===BT.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(s=c.id)}const o=new Qpe(t,i,s),r=Qpe.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(Sr.Panel);if(e instanceof ujt){const t=e.getControl();if(ja(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return ew(e)&&(e=e.getModifiedEditor()),e}};Tke=D([_(1,Ai),_(2,jt),_(3,_i),_(4,Nw)],Tke);let K$e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=s,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(et.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new Dke(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Ue.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new Ike(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Ue.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new Tke(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],s=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new hjt(a.id,a.editor.getModel(),a.editor,{onGainedFocus(){},onLostFocus(){}},this._mainThreadDocuments,this._modelService,this._clipboardService);this._textEditors.set(a.id,c),i.push(c)}for(const{id:a}of e.removedEditors){const c=this._textEditors.get(a);c&&(c.dispose(),this._textEditors.delete(a),t.push(a))}const o=Object.create(null);let r=!0;e.newActiveEditor!==void 0&&(r=!1,o.newActiveEditor=e.newActiveEditor),s.length>0&&(r=!1,o.removedDocuments=s),t.length>0&&(r=!1,o.removedEditors=t),e.addedDocuments.length>0&&(r=!1,o.addedDocuments=e.addedDocuments.map(a=>this._toModelAddData(a))),e.addedEditors.length>0&&(r=!1,o.addedEditors=i.map(a=>this._toTextEditorAddData(a))),r||(this._proxy.$acceptDocumentsAndEditorsDelta(o),s.forEach(this._mainThreadDocuments.handleModelRemoved,this._mainThreadDocuments),e.addedDocuments.forEach(this._mainThreadDocuments.handleModelAdded,this._mainThreadDocuments),t.forEach(this._mainThreadEditors.handleTextEditorRemoved,this._mainThreadEditors),i.forEach(this._mainThreadEditors.handleTextEditorAdded,this._mainThreadEditors))}_toModelAddData(e){return{uri:e.uri,versionId:e.getVersionId(),lines:e.getLinesContent(),EOL:e.getEOL(),languageId:e.getLanguageId(),isDirty:this._textFileService.isDirty(e.uri)}}_toTextEditorAddData(e){const t=e.getProperties();return{id:e.getId(),documentUri:e.getModel().uri,options:t.options,selections:t.selections,visibleRanges:t.visibleRanges,editorPosition:this._findEditorPosition(e)}}_findEditorPosition(e){for(const t of this._editorService.visibleEditorPanes)if(e.matches(t))return U1(this._editorGroupService,t.group)}findTextEditorIdFor(e){for(const[t,i]of this._textEditors)if(i.matches(e))return t}getIdOfCodeEditor(e){for(const[t,i]of this._textEditors)if(i.getCodeEditor()===e)return t}getEditor(e){return this._textEditors.get(e)}};K$e=D([TO,_(1,Ai),_(2,tr),_(3,_i),_(4,jt),_(5,ci),_(6,Rn),_(7,ur),_(8,Nw),_(9,Za),_(10,fC),_(11,_o),_(12,Mu),_(13,Lm),_(14,Re)],K$e);var dT;const jpe={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function fjt(n){const e=n;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function pjt(n){const e=n;return e.kind===qo.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var PP;let Y$e=(PP=class extends ${get id(){return this._id}get active(){return this.selection[0]??null}constructor(e,t,i){super(),this.instantiationService=t,this.configurationService=i,this._onDidModelChange=this._register(new I({leakWarningThreshold:500})),this.onDidModelChange=this._onDidModelChange.event,this.editors=[],this.mru=[],this.editorListeners=new Set,this.locked=!1,this.selection=[],this.preview=null,this.sticky=-1,this.transient=new Set,fjt(e)?this._id=this.deserialize(e):this._id=dT.IDS++,this.onConfigurationUpdated(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e&&!e.affectsConfiguration("workbench.editor.openPositioning")&&!e.affectsConfiguration("workbench.editor.focusRecentEditorAfterClose")||(this.editorOpenPositioning=this.configurationService.getValue("workbench.editor.openPositioning"),this.focusRecentEditorAfterClose=this.configurationService.getValue("workbench.editor.focusRecentEditorAfterClose"))}get count(){return this.editors.length}get stickyCount(){return this.sticky+1}getEditors(e,t){const i=e===eg.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===eg.MOST_RECENTLY_ACTIVE?i.filter(s=>!this.isSticky(s)):i.slice(this.sticky+1):i}getEditorByIndex(e){return this.editors[e]}get activeEditor(){return this.active}isActive(e){return this.matches(this.active,e)}get previewEditor(){return this.preview}openEditor(e,t){const i=t?.sticky||typeof t?.index=="number"&&this.isSticky(t.index),s=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!s&&this.preview===this.activeEditor,a=this.findEditor(e,t);if(a){const[c,l]=a;return this.doSetTransient(c,l,o===!1?!1:this.isTransient(c)),s&&this.doPin(c,l),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),t&&typeof t.index=="number"&&this.moveEditor(c,t.index),i&&this.doStick(c,this.indexOf(c)),{editor:c,isNew:!1}}else{const c=e,l=this.indexOf(this.active);let d;if(t&&typeof t.index=="number"?d=t.index:this.editorOpenPositioning===jpe.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===jpe.LAST?d=this.editors.length:(this.editorOpenPositioning===jpe.LEFT?l===0||!this.editors.length?d=0:d=l:d=l+1,!i&&this.isSticky(d)&&(d=this.sticky+1)),i&&(this.sticky++,this.isSticky(d)||(d=this.sticky)),(s||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!s){if(this.preview){const u=this.indexOf(this.preview);d>u&&d--,this.replaceEditor(this.preview,c,d,!r)}this.preview=c}this.registerEditorListeners(c);const h={kind:qo.EDITOR_OPEN,editor:c,editorIndex:d};return this._onDidModelChange.fire(h),this.setSelection(r?c:this.activeEditor,t?.inactiveSelection??[]),{editor:c,isNew:!0}}}registerEditorListeners(e){const t=new Z;this.editorListeners.add(t),t.add(T.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const s={kind:qo.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:qo.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:qo.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:qo.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===qo.EDITOR_CLOSE&&i.editor?.matches(e)&&(St(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,s=!0){const o=this.doCloseEditor(e,mx.REPLACE,s);if(this.splice(i,!1,t),o){const r={kind:qo.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=mx.UNKNOWN,i=!0){const s=this.doCloseEditor(e,t,i);if(s){const o={kind:qo.EDITOR_CLOSE,...s};return this._onDidModelChange.fire(o),s}}doCloseEditor(e,t,i){const s=this.indexOf(e);if(s===-1)return;const o=this.editors[s],r=this.isSticky(s),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:s===this.editors.length-1?c=this.editors[s-1]:c=this.editors[s+1];const l=this.selection.filter(d=>d!==o&&d!==c);this.doSetSelection(c,this.editors.indexOf(c),l)}else this.doSetSelection(null,void 0,[]);else if(!a&&this.doIsSelected(o)){const c=this.selection.filter(l=>l!==o&&l!==this.activeEditor);this.doSetSelection(this.activeEditor,this.indexOf(this.activeEditor),c)}return this.preview===o&&(this.preview=null),this.transient.delete(o),this.splice(s,!0),{editor:o,sticky:r,editorIndex:s,context:t}}moveEditor(e,t){t>=this.editors.length?t=this.editors.length-1:t<0&&(t=0);const i=this.indexOf(e);if(i<0||t===i)return;const s=this.editors[i],o=this.sticky;this.isSticky(i)&&t>this.sticky?this.sticky--:!this.isSticky(i)&&t<=this.sticky&&this.sticky++,this.editors.splice(i,1),this.editors.splice(t,0,s);const r={kind:qo.EDITOR_MOVE,editor:s,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:qo.EDITOR_STICKY,editor:s,editorIndex:t};this._onDidModelChange.fire(a)}return s}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:qo.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doSetSelection(i,s,[]),i}get selectedEditors(){return this.editors.filter(e=>this.doIsSelected(e))}isSelected(e){let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.doIsSelected(t)}doIsSelected(e){return this.selection.includes(e)}setSelection(e,t){const i=this.findEditor(e);if(!i)return;const[s,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==s&&r.add(l)}this.doSetSelection(s,o,Array.from(r))}doSetSelection(e,t,i){const s=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&s!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:qo.EDITOR_ACTIVE,editor:e,editorIndex:t};this._onDidModelChange.fire(l)}if(a||o.length!==r.length||o.some(c=>!r.includes(c))){const c={kind:qo.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:qo.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:qo.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doPin(i,s),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnpin(i,s),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const s={kind:qo.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(s),i&&this.closeEditor(i,mx.UNPIN)}isPinned(e){let t;return typeof e=="number"?t=this.editors[e]:t=e,!this.matches(this.preview,t)}stick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doStick(i,s),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,s]=t;return this.doUnstick(i,s),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const s={kind:qo.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(s)}isSticky(e){if(this.sticky<0)return!1;let t;return typeof e=="number"?t=e:t=this.indexOf(e),t<0?!1:t<=this.sticky}setTransient(e,t){if(!t&&this.transient.size===0)return;const i=this.findEditor(e);if(!i)return;const[s,o]=i;return this.doSetTransient(s,o,t),s}doSetTransient(e,t,i){if(i){if(this.transient.has(e))return;this.transient.add(e)}else{if(!this.transient.has(e))return;this.transient.delete(e)}const s={kind:qo.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(s)}isTransient(e){if(this.transient.size===0)return!1;let t;return typeof e=="number"?t=this.editors[e]:t=this.findEditor(e)?.[0],!!t&&this.transient.has(t)}splice(e,t,i){const s=this.editors[e];if(t&&this.isSticky(e)&&this.sticky--,i?this.editors.splice(e,t?1:0,i):this.editors.splice(e,t?1:0),!t&&i)this.mru.length===0?this.mru.push(i):this.mru.splice(1,0,i);else{const o=this.indexOf(s,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let s=-1;if(!e)return s;for(let o=0;othis.indexOf(a,t)).filter(a=>a>=0);return{id:this.id,locked:this.locked?!0:void 0,editors:i,mru:r,preview:s,sticky:o>=0?o:void 0}}deserialize(e){const t=it.as(zS.EditorFactory);return typeof e.id=="number"?(this._id=e.id,dT.IDS=Math.max(e.id+1,dT.IDS)):this._id=dT.IDS++,e.locked&&(this.locked=!0),this.editors=Ui(e.editors.map((i,s)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof cC&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&s<=e.sticky&&e.sticky--,o})),this.mru=Ui(e.mru.map(i=>this.editors[i])),this.selection=this.mru.length>0?[this.mru[0]]:[],typeof e.preview=="number"&&(this.preview=this.editors[e.preview]),typeof e.sticky=="number"&&(this.sticky=e.sticky),this._id}dispose(){St(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},dT=PP,PP.IDS=0,PP);Y$e=dT=D([_(1,be),_(2,Re)],Y$e);class mjt extends ${constructor(e,t){super(),this._register(pe(e,xe.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(pe(e,xe.DRAG_END,i)),this._register(pe(e,xe.MOUSE_MOVE,s=>{s.buttons===0&&i()}))}}const sle=class sle extends cC{get typeId(){return sle.typeId}get editorId(){return this.viewType}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor}get resource(){return P.from({scheme:_e.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=Dr(),this._hasTransfered=!1,this.viewType=e.viewType,this.providedId=e.providedId,this._name=e.name,this._webview=t}dispose(){this.isDisposed()||this._hasTransfered||this._webview?.dispose(),super.dispose()}getName(){return this._name}getTitle(e){return this.getName()}getDescription(){}setName(e){this._name=e,this.webview.setTitle(e),this._onDidChangeLabel.fire()}get webview(){return this._webview}get extension(){return this.webview.extension}get iconPath(){return this._iconPath}set iconPath(e){this._iconPath=e,this._iconManager.setIcons(this._resourceId,e)}matches(e){return super.matches(e)||e===this}get group(){return this._group}updateGroup(e){this._group=e}transfer(e){if(!this._hasTransfered)return this._hasTransfered=!0,e._webview=this._webview,e}claim(e,t,i){return this._webview.claim(e,t,i)}};sle.typeId="workbench.editors.webviewInput";let Qg=sle;var Rke;const _jt="vs/workbench/contrib/webviewPanel/browser/webviewEditor",vjt=new Y("activeWebviewPanelId","",{type:"string",description:g(_jt,0,"The viewType of the currently active webview panel.")});var FP;let J$e=(FP=class extends sne{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,s,o,r,a,c,l){super(Rke.ID,e,t,i,s),this._editorGroupsService=o,this._editorService=r,this._workbenchLayoutService=a,this._hostService=c,this._contextKeyService=l,this._visible=!1,this._isDisposed=!1,this._webviewVisibleDisposables=this._register(new Z),this._onFocusWindowHandler=this._register(new Dn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new Dn);const d=o.getPart(e);this._register(T.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Qg?this.input.webview:void 0}get scopedContextKeyService(){return this._scopedContextKeyService.value}createEditor(e){const t=document.createElement("div");this._element=t,this._element.id=`webview-editor-element-${Dr()}`,e.appendChild(t),this._scopedContextKeyService.value=this._register(this._contextKeyService.createScoped(t))}dispose(){this._isDisposed=!0,this._element?.remove(),this._element=void 0,super.dispose()}layout(e){this._dimension=e,this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview,e)}focus(){super.focus(),!this._onFocusWindowHandler.value&&!Jn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus(Lne.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Qg&&this.webview&&(e?this.claimWebview(this.input):this.webview.release(this)),super.setEditorVisible(e)}clearInput(){this.webview&&(this.webview.release(this),this._webviewVisibleDisposables.clear()),super.clearInput()}async setInput(e,t,i,s){if(this.input&&e.matches(this.input))return;const o=e instanceof Qg&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,s),await e.resolve(),!(s.isCancellationRequested||this._isDisposed)&&e instanceof Qg&&(e.updateGroup(this.group.id),o||this.claimWebview(e),this._dimension&&this.layout(this._dimension))}claimWebview(e){e.claim(this,this.window,this.scopedContextKeyService),this._element&&(this._element.setAttribute("aria-flowto",e.webview.container.id),$ut(e.webview.container,this._element)),this._webviewVisibleDisposables.clear(),this._webviewVisibleDisposables.add(this._editorGroupsService.createEditorDropTarget(e.webview.container,{containsGroup:t=>this.group.id===t.id})),this._webviewVisibleDisposables.add(new mjt(this.window,()=>this.webview)),this.synchronizeWebviewContainerDimensions(e.webview),this._webviewVisibleDisposables.add(this.trackFocus(e.webview))}synchronizeWebviewContainerDimensions(e,t){if(!this._element?.isConnected)return;const i=this._workbenchLayoutService.getContainer(this.window,Lne.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Dd(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},Rke=FP,FP.ID="WebviewEditor",FP);J$e=Rke=D([_(1,rn),_(2,pn),_(3,on),_(4,ur),_(5,_i),_(6,kO),_(7,Id),_(8,Pe)],J$e);let Mke=class{constructor(e,t){this._lifecycleService=e,this._configService=t,this._icons=new Map,this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()})}dispose(){this._styleElementDisposable?.dispose(),this._styleElementDisposable=void 0,this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElementDisposable=new Z,this._styleElement=od(void 0,void 0,this._styleElementDisposable),this._styleElement.className="webview-icons"),this._styleElement}setIcons(e,t){t?this._icons.set(e,t):this._icons.delete(e),this.updateStyleSheet()}async updateStyleSheet(){await this._lifecycleService.when(Us.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const s=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${s}, .monaco-workbench.hc-light ${s} { content: ""; background-image: ${uf(i.light)}; }`,`.monaco-workbench.vs-dark ${s}, .monaco-workbench.hc-black ${s} { content: ""; background-image: ${uf(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` +`)}};Mke=D([_(0,mg),_(1,Re)],Mke);function Use(n,e){return n.canResolve(e)}let QF=class extends Qg{constructor(e,t,i){super(e,t,i.iconManager),this._webviewWorkbenchService=i,this._resolved=!1}dispose(){super.dispose(),this._resolvePromise?.cancel(),this._resolvePromise=void 0}async resolve(){if(!this._resolved){this._resolved=!0,this._resolvePromise=na(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Na(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};QF.__decorator=D([ii],QF.prototype,"resolve",null);QF=D([_(2,kQ)],QF);class wjt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new sd,s=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=pa(e.webview.onDidDispose(s),t.onCancellationRequested(()=>{s(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:s})=>Use(e,s));this._awaitingRevival=this._awaitingRevival.filter(({input:s})=>!Use(e,s));for(const{input:s,promise:o,disposable:r}of i)e.resolveWebview(s,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let X$e=class extends ${constructor(e,t,i,s){super(),this._editorService=t,this._instantiationService=i,this._webviewService=s,this._revivers=new Set,this._revivalPool=new wjt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(Mke)),this._register(e.registerContextKeyProvider({contextKey:vjt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(s.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg?t=e.primary:e.secondary instanceof Qg&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Qg?t=e:e instanceof op&&(e.primary instanceof Qg&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Qg&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,s){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Qg,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:s.preserveFocus,activation:s.preserveFocus?y1.RESTORE:void 0},s.group),r}revealWebview(e,t,i){const s=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(s,{preserveFocus:i,activation:i?y1.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof op&&(e===t.primary||e===t.secondary))return t;return e}openRevivedWebview(e){const t=this._webviewService.createWebviewOverlay(e.webviewInitInfo);t.state=e.state;const i=this._instantiationService.createInstance(QF,{viewType:e.viewType,providedId:e.webviewInitInfo.providedViewType,name:e.title},t);return i.iconPath=e.iconPath,typeof e.group=="number"&&i.updateGroup(e.group),i}registerResolver(e){this._revivers.add(e);const t=new ai;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof QF?!0:fi.some(this._revivers.values(),t=>Use(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Use(i,e))return await i.resolveWebview(e,t),!0;return!1}async resolveWebview(e,t){if(!await this.tryRevive(e,t)&&!t.isCancellationRequested)return this._revivalPool.enqueueForRestoration(e,t)}setIcons(e,t){this._iconManager.setIcons(e,t)}};X$e=D([_(0,ur),_(1,_i),_(2,be),_(3,Zde)],X$e);var MB;const Kpe="vs/workbench/contrib/customEditor/browser/customEditorInput";var OP;let nH=(OP=class extends QF{static create(e,t,i,s,o){return e.invokeFunction(r=>{const a=r.get(RQ).getValue(t),c=a?ze.fromString(a):void 0,l=r.get(Zde).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(MB,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof s<"u"&&d.updateGroup(s),d})}get resource(){return this._editorResource}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,s),this.instantiationService=o,this.labelService=r,this.customEditorService=a,this.fileDialogService=c,this.undoRedoService=l,this.fileService=d,this.filesConfigurationService=h,this.editorGroupsService=u,this.layoutService=f,this.customEditorLabelService=p,this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._editorResource=e.resource,this.oldResource=i.oldResource,this._defaultDirtyState=i.startsDirty,this._backupId=i.backupId,this._untitledDocumentData=i.untitledDocumentData,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel()))}onLabelEvent(e){e===this.resource.scheme&&this.updateLabel()}updateLabel(){this._editorName=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}get typeId(){return MB.typeId}get editorId(){return this.viewType}get capabilities(){let e=Mi.None;return e|=Mi.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Mi.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Mi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly),this.resource.scheme===_e.untitled&&(e|=Mi.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??yr(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Gs.MEDIUM){switch(e){case Gs.SHORT:return this.shortDescription;case Gs.LONG:return this.longDescription;case Gs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(ma(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(ma(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(ma(this.resource))),this._longDescription}get shortTitle(){return typeof this._shortTitle!="string"&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return typeof this._mediumTitle!="string"&&(this._mediumTitle=this.labelService.getUriLabel(this.resource,{relative:!0})),this._mediumTitle}get longTitle(){return typeof this._longTitle!="string"&&(this._longTitle=this.labelService.getUriLabel(this.resource)),this._longTitle}getTitle(e){switch(e){case Gs.SHORT:return this.shortTitle;case Gs.LONG:return this.longTitle;default:case Gs.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof MB&&this.viewType===e.viewType&&_n(this.resource,e.resource)}copy(){return MB.create(this.instantiationService,this.resource,this.viewType,this.group,this.webview.options)}isReadonly(){return this._modelRef?this._modelRef.object.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}isDirty(){return this._modelRef?this._modelRef.object.isDirty():!!this._defaultDirtyState}async save(e,t){if(!this._modelRef)return;const i=await this._modelRef.object.saveCustomEditor(t);if(i)return _n(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,s=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(s&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,s,t))return(await this.rename(e,s))?.editor}async revert(e,t){if(this._modelRef)return this._modelRef.object.revert(t);this._defaultDirtyState=!1,this._onDidChangeDirty.fire()}async resolve(){if(await super.resolve(),this.isDisposed())return null;if(!this._modelRef){const e=this.capabilities;this._modelRef=this._register(ws(await this.customEditorService.models.tryRetain(this.resource,this.viewType))),this._register(this._modelRef.object.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this._modelRef.object.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this._untitledDocumentData&&(this._defaultDirtyState=!0),this.isDirty()&&this._onDidChangeDirty.fire(),this.capabilities!==e&&this._onDidChangeCapabilities.fire()}return null}async rename(e,t){return{editor:{resource:t}}}undo(){return ws(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return ws(this._modelRef),this.undoRedoService.redo(this.resource)}onMove(e){this._moveHandler=e}transfer(e){if(super.transfer(e))return e._moveHandler=this._moveHandler,this._moveHandler=void 0,e}get backupId(){return this._modelRef?this._modelRef.object.backupId:this._backupId}get untitledDocumentData(){return this._untitledDocumentData}toUntyped(){return{resource:this.resource,options:{override:this.viewType}}}claim(e,t,i){if(this.doCanMove(t.vscodeWindowId)!==!0)throw xZe(g(Kpe,0,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[_l({id:"openInOriginalWindow",label:g(Kpe,1,"Open in Original Window"),run:async()=>{const s=this.editorGroupsService.getPart(this.layoutService.getContainer(gt(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,s.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const s=this.doCanMove(i.windowId);if(typeof s=="string")return s}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&>(this.webview.container).vscodeWindowId!==e?g(Kpe,2,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},MB=OP,OP.typeId="workbench.editors.webviewEditor",OP);nH=MB=D([_(3,kQ),_(4,be),_(5,eo),_(6,kPe),_(7,bf),_(8,pO),_(9,ci),_(10,hh),_(11,ur),_(12,kO),_(13,aD)],nH);var NB,J0;let Nke=(J0=class extends cC{static create(e,t,i,s,o){return e.createInstance(NB,t,i,s,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return NB.ID}get language(){return this._inputModelRef?.object.textEditorModel.getLanguageId()??this._initLanguage}get notebookEditorInput(){return this._notebookEditorInput}get editorInputs(){return[this._notebookEditorInput]}get resource(){return this._resource}get inputResource(){return this._inputResource}get primary(){return this._notebookEditorInput}constructor(e,t,i,s,o,r,a,c,l,d,h){const u=VM.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(tke.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??NB.windowNames[e.path]??yr(e.path,T_(e.path)),this._initLanguage=s,this._resource=e,this._inputResource=t,this._inputResolver=null,this._editorModelReference=null,this._inputModelRef=null,this._textModelService=r,this._interactiveDocumentService=a,this._historyService=c,this._registerListeners()}_registerListeners(){const e=T.once(this.primary.onWillDispose);this._register(e(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire()))}get capabilities(){const e=this.isScratchpad?Mi.Scratchpad:0;return Mi.Untitled|Mi.Readonly|e}async _resolveEditorModel(){return this._editorModelReference||(this._editorModelReference=await this._notebookEditorInput.resolve()),this._editorModelReference}async resolve(){return this._editorModelReference?this._editorModelReference:this._inputResolver?this._inputResolver:(this._inputResolver=this._resolveEditorModel(),this._inputResolver)}async resolveInput(e){if(this._inputModelRef)return this._inputModelRef.object.textEditorModel;const t=e??this._initLanguage??Yc;return this._interactiveDocumentService.willCreateInteractiveDocument(this.resource,this.inputResource,t),this._inputModelRef=await this._textModelService.createModelReference(this.inputResource),this._inputModelRef.object.textEditorModel}async save(e,t){if(this._editorModelReference)return this.hasCapability(Mi.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const s=this.getName()+".ipynb",o=Qt(await this._fileDialogService.defaultFilePath(),s),r=await this._fileDialogService.pickFileToSave(o,t?.availableFileSystems);if(!r)return;const a=await this._editorModelReference.saveAs(r);return a&&"resource"in a&&a.resource&&this._notebookService.getNotebookTextModel(a.resource)?.dispose(),a}matches(e){return super.matches(e)?!0:e instanceof NB?_n(this.resource,e.resource)&&_n(this.inputResource,e.inputResource):!1}getName(){return this.name}isDirty(){return this.isScratchpad?!1:this._editorModelReference?.isDirty()??!1}isModified(){return this._editorModelReference?.isModified()??!1}async revert(e,t){this._editorModelReference&&this._editorModelReference.isDirty()&&await this._editorModelReference.revert(t)}dispose(){this._editorModelReference?.revert({soft:!0}),this._notebookEditorInput?.dispose(),this._editorModelReference?.dispose(),this._editorModelReference=null,this._interactiveDocumentService.willRemoveInteractiveDocument(this.resource,this.inputResource),this._inputModelRef?.dispose(),this._inputModelRef=null,super.dispose()}get historyService(){return this._historyService}},NB=J0,J0.windowNames={},J0.ID="workbench.input.interactive",J0);Nke=NB=D([_(4,be),_(5,Rn),_(6,TPe),_(7,$Ze),_(8,oD),_(9,bf),_(10,Re)],Nke);const HA=class HA{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const s of e)t=Math.min(t,s.startLineNumber),i=Math.max(i,s.startLineNumber+s.lineCount);return new HA(t,i-t)}static fromLineNumbers(e,t){return new HA(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new cn}join(e){return new HA(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive)-this.startLineNumber)}get endLineNumberExclusive(){return this.startLineNumber+this.lineCount}get isEmpty(){return this.lineCount===0}touches(e){return this.endLineNumberExclusive>=e.startLineNumber&&e.endLineNumberExclusive>=this.startLineNumber}isAfter(e){return this.startLineNumber>=e.endLineNumberExclusive}isBefore(e){return e.startLineNumber>=this.endLineNumberExclusive}delta(e){return new HA(this.startLineNumber+e,this.lineCount)}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}equals(e){return this.startLineNumber===e.startLineNumber&&this.lineCount===e.lineCount}contains(e){return this.startLineNumber<=e&&ee.startLineNumber,cg);let ap=HA;const bjt={start:"<<<<<<<",end:">>>>>>>"};function*Cjt(n,e,t){const i=new DS(e);for(const s of n){i.takeWhile(r=>i1.isGreaterThan(t(s,r)));const o=i.takeWhile(r=>i1.isNeitherLessOrGreaterThan(t(s,r)));yield{left:s,rights:o||[]}}}function ert(...n){return[].concat(...n)}let Z$e=class{constructor(e,t){this.key=e,this.storageService=t,this.hasValue=!1,this.value=void 0}get(){if(!this.hasValue){const e=this.storageService.get(this.key,ke.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){bt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),ke.PROFILE,ln.USER)}};Z$e=D([_(1,on)],Z$e);class CG{constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&Ls(this.newLines,e.newLines)}toEdits(e){return new Sjt([this]).toEdits(e)}}class yjt{constructor(e,t){this.range=e,this.newText=t}equals(e){return O.equalsRange(this.range,e.range)&&this.newText===e.newText}}class Sjt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new O(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` `).join("")}:t.range.startLineNumber===1?{range:new O(1,1,e,Number.MAX_SAFE_INTEGER),text:t.newLines.join(` `)}:{range:new O(t.range.startLineNumber-1,Number.MAX_SAFE_INTEGER,e,Number.MAX_SAFE_INTEGER),text:t.newLines.map(i=>` `+i).join("")})}}function Ajt(n,e){return!(e.lineNumbern.endLineNumber||e.lineNumber===n.startLineNumber&&e.column=n.endColumn)}function Ejt(n,e){return n.lineNumber===e.lineNumber?new gf(0,e.column-n.column):new gf(e.lineNumber-n.lineNumber,e.column-1)}function xjt(n,e){return e.lineCount===0?new oe(n.lineNumber,n.column+e.columnCount):new oe(n.lineNumber+e.lineCount,e.columnCount+1)}function e8e(n,e){return n.endLineNumbert?t.join(i):i,void 0)}constructor(e,t){this.inputRange=e,this.outputRange=t}extendInputRange(e){if(!e.containsRange(this.inputRange))throw new cn;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new ef(e,new ap(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new ef(this.inputRange.join(e.inputRange),this.outputRange.join(e.outputRange))}get resultingDeltaFromOriginalToModified(){return this.outputRange.endLineNumberExclusive-this.inputRange.endLineNumberExclusive}toString(){return`${this.inputRange.toString()} -> ${this.outputRange.toString()}`}addOutputLineDelta(e){return new ef(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new ef(this.inputRange.delta(e),this.outputRange)}reverse(){return new ef(this.outputRange,this.inputRange)}}class LR{static betweenOutputs(e,t,i){const o=iue.compute(e,t).map(r=>new ef(r.output1Range,r.output2Range));return new LR(o,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,fw(()=>gz(e,(i,s)=>i.inputRange.isBefore(s.inputRange)&&i.outputRange.isBefore(s.outputRange)&&s.inputRange.startLineNumber-i.inputRange.endLineNumberExclusive===s.outputRange.startLineNumber-i.outputRange.endLineNumberExclusive))}project(e){const t=t1(this.lineRangeMappings,o=>o.inputRange.startLineNumber<=e);if(!t)return new ef(new ap(e,1),new ap(e,1));if(t.inputRange.contains(e))return t;const i=new ap(e,1),s=new ap(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new ef(i,s)}get outputLineCount(){const e=Gqe(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new LR(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class iue{static compute(e,t){const i=El(d=>d.inputRange.startLineNumber,cg),s=ert(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(El(d=>d.diff,i)),o=[new Array,new Array],r=[0,0],a=new Array;function c(d){const h=ef.join(o[0])||new ef(d,d.delta(r[0])),u=ef.join(o[1])||new ef(d,d.delta(r[1]));a.push(new iue(l,h.extendInputRange(l).outputRange,o[0],u.extendInputRange(l).outputRange,o[1])),o[0]=[],o[1]=[]}let l;for(const d of s){const h=d.diff.inputRange;l&&!l.touches(h)&&(c(l),l=void 0),r[d.source]=d.diff.resultingDeltaFromOriginalToModified,l=l?l.join(h):h,o[d.source].push(d.diff)}return l&&c(l),a}constructor(e,t,i,s,o){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=s,this.output2LineMappings=o}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class qI extends ef{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,s,o){super(e,i),this.inputTextModel=t,this.outputTextModel=s,this.rangeMappings=o||[new Cx(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new qI(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new qI(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new qI(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new CG(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new CG(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class Cx{constructor(e,t){this.inputRange=e,this.outputRange=t}toString(){function e(t){return`[${t.startLineNumber}:${t.startColumn}, ${t.endLineNumber}:${t.endColumn})`}return`${e(this.inputRange)} -> ${e(this.outputRange)}`}addOutputLineDelta(e){return new Cx(this.inputRange,new O(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new Cx(new O(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new Cx(this.outputRange,this.inputRange)}}class y2{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,fw(()=>gz(e,(i,s)=>e8e(i.inputRange,s.inputRange)&&e8e(i.outputRange,s.outputRange)))}project(e){const t=t1(this.rangeMappings,o=>o.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new Cx(O.fromPositions(e,e),O.fromPositions(e,e));if(Ajt(t.inputRange,e))return t;const i=Ejt(t.inputRange.getEndPosition(),e),s=xjt(t.outputRange.getEndPosition(),i);return new Cx(O.fromPositions(e),O.fromPositions(s))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new Cx(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=Gqe(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new y2(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Vse=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=eZe("mergeEditor.diffAlgorithm","advanced",this.configurationService).map(i=>i==="smart"?"legacy":i==="experimental"?"advanced":i)}async computeDiff(e,t,i){const s=this.mergeAlgorithm.read(i),o=e.getVersionId(),r=t.getVersionId(),a=await this.editorWorkerService.computeDiff(e.uri,t.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1},s);if(!a)throw new Error("Diff computation failed");if(e.isDisposed()||t.isDisposed())return{diffs:null};const c=a.changes.map(h=>new qI(t8e(h.original),e,t8e(h.modified),t,h.innerChanges?.map(u=>Djt(u)))),l=e.getVersionId(),d=t.getVersionId();return o!==l||r!==d?{diffs:null}:(fw(()=>{for(const h of c){const u=h.inputRange,f=h.outputRange,p=h.inputTextModel,m=h.outputTextModel;for(const v of h.rangeMappings){let w=u.startLineNumber-1<=v.inputRange.startLineNumber&&v.inputRange.endLineNumber<=u.endLineNumberExclusive;w&&v.inputRange.startLineNumber===u.startLineNumber-1&&(w=v.inputRange.endColumn>=p.getLineMaxColumn(v.inputRange.startLineNumber)),w&&v.inputRange.endLineNumber===u.endLineNumberExclusive&&(w=v.inputRange.endColumn===1);let b=f.startLineNumber-1<=v.outputRange.startLineNumber&&v.outputRange.endLineNumber<=f.endLineNumberExclusive;if(b&&v.outputRange.startLineNumber===f.startLineNumber-1&&(b=v.outputRange.endColumn>=m.getLineMaxColumn(v.outputRange.endLineNumber)),b&&v.outputRange.endLineNumber===f.endLineNumberExclusive&&(b=v.outputRange.endColumn===1),!w||!b)return!1}}return c.length===0||c[0].inputRange.startLineNumber===c[0].outputRange.startLineNumber&&gz(c,(h,u)=>u.inputRange.startLineNumber-h.inputRange.endLineNumberExclusive===u.outputRange.startLineNumber-h.outputRange.endLineNumberExclusive&&h.inputRange.endLineNumberExclusive{if(!this._isOccupied){this._isOccupied=!0;try{return e(...t)}finally{this._isOccupied=!1}}}}}class Ype extends ${get isApplyingChange(){return this._barrier.isOccupied}constructor(e,t,i){super(),this.baseTextModel=e,this.textModel=t,this.diffComputer=i,this._recomputeCount=0,this._state=xi(this,o_.initializing),this._diffs=xi(this,[]),this._barrier=new kjt,this._isDisposed=!1,this._isInitializing=!0;const s=oL("recompute");this._register(Ni(o=>{s.read(o),this._recompute(o)})),this._register(e.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{s.trigger(void 0)}))),this._register(t.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{s.trigger(void 0)}))),this._register(Ee(()=>{this._isDisposed=!0}))}get state(){return this._state}get diffs(){return this._diffs}_recompute(e){this._recomputeCount++;const t=this._recomputeCount;this._state.get()===o_.initializing&&(this._isInitializing=!0),En(s=>{this._state.set(this._isInitializing?o_.initializing:o_.updating,s,GA.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(s=>{this._isDisposed||t===this._recomputeCount&&En(o=>{s.diffs?(this._state.set(o_.upToDate,o,GA.textChange),this._diffs.set(s.diffs,o,GA.textChange)):this._state.set(o_.error,o,GA.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==o_.upToDate)throw new cn("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(El(o=>o.inputRange.startLineNumber,cg)),e.reverse();let s=this._diffs.get();for(const o of e){const r=s.length;if(s=s.filter(a=>a!==o),r===s.length)throw new cn;this._barrier.runExclusivelyOrThrow(()=>{const a=o.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),s=s.map(a=>a.outputRange.isAfter(o.outputRange)?a.addOutputLineDelta(o.inputRange.lineCount-o.outputRange.lineCount):a)}this._diffs.set(s,t,GA.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const s=new qI(e.range,this.baseTextModel,new ap(e.range.startLineNumber,e.newLines.length),this.textModel);let o=!1,r=0;const a=new Array;for(const c of this.diffs.get()){if(c.inputRange.touches(e.range))throw new cn("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(o||(o=!0,a.push(s.addOutputLineDelta(r))),a.push(c.addOutputLineDelta(e.newLines.length-e.range.lineCount))):a.push(c),o||(r+=c.outputRange.lineCount-c.inputRange.lineCount)}o||(o=!0,a.push(s.addOutputLineDelta(r))),this._barrier.runExclusivelyOrThrow(()=>{const c=new CG(e.range.delta(r),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,GA.other)}findTouchingDiffs(e){return this.diffs.get().filter(t=>t.inputRange.touches(e))}getResultLine(e,t){let i=0;const s=t?this.diffs.read(t):this.diffs.get();for(const o of s){if(o.inputRange.contains(e)||o.inputRange.endLineNumberExclusive===e)return o;if(o.inputRange.endLineNumberExclusivenew EOe(a.inputRange,i,a.output1Range,s,a.output1LineMappings,a.output2Range,o,a.output2LineMappings))}constructor(e,t,i,s,o,r,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=s,this.input1Diffs=o,this.input2Range=r,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=qI.join(this.input1Diffs),this.input2CombinedDiff=qI.join(this.input2Diffs),this.isEqualChange=Ls(this.input1Diffs,this.input2Diffs,(l,d)=>l.getLineEdit().equals(d.getLineEdit())),this.smartInput1LineRangeEdit=null,this.smartInput2LineRangeEdit=null,this.dumbInput1LineRangeEdit=null,this.dumbInput2LineRangeEdit=null,this.input1Diffs.length===0&&this.input2Diffs.length===0)throw new cn("must have at least one diff")}getInputRange(e){return e===1?this.input1Range:this.input2Range}getInputCombinedDiff(e){return e===1?this.input1CombinedDiff:this.input2CombinedDiff}getInputDiffs(e){return e===1?this.input1Diffs:this.input2Diffs}get isConflicting(){return this.input1Diffs.length>0&&this.input2Diffs.length>0}get canBeCombined(){return this.smartCombineInputs(1)!==void 0}get isOrderRelevant(){const e=this.smartCombineInputs(1),t=this.smartCombineInputs(2);return!e||!t?!1:!e.equals(t)}getEditForBase(e){const t=[];if(e.includesInput1&&this.input1CombinedDiff&&t.push({diff:this.input1CombinedDiff,inputNumber:1}),e.includesInput2&&this.input2CombinedDiff&&t.push({diff:this.input2CombinedDiff,inputNumber:2}),t.length===0)return{edit:void 0,effectiveState:Sh.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Sh.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==rr.both)throw new cn;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[Pke(e.firstInput)-1].diff.getLineEdit(),effectiveState:Sh.base.withInputValue(Pke(e.firstInput),!0,!1)}}smartCombineInputs(e){if(e===1&&this.smartInput1LineRangeEdit!==null)return this.smartInput1LineRangeEdit;if(e===2&&this.smartInput2LineRangeEdit!==null)return this.smartInput2LineRangeEdit;const i=ert(this.input1Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:1}))),this.input2Diffs.flatMap(o=>o.rangeMappings.map(r=>({diff:r,input:2})))).sort(jqe(El(o=>o.diff.inputRange,O.compareRangesUsingStarts),El(o=>o.input===e?1:2,cg))).map(o=>{const r=o.input===1?this.input1TextModel:this.input2TextModel;return new yjt(o.diff.inputRange,r.getValueInRange(o.diff.outputRange))}),s=Ijt(this.baseRange,i,this.baseTextModel);return e===1?this.smartInput1LineRangeEdit=s:this.smartInput2LineRangeEdit=s,s}dumbCombineInputs(e){if(e===1&&this.dumbInput1LineRangeEdit!==null)return this.dumbInput1LineRangeEdit;if(e===2&&this.dumbInput2LineRangeEdit!==null)return this.dumbInput2LineRangeEdit;let t=this.input1Range.getLines(this.input1TextModel),i=this.input2Range.getLines(this.input2TextModel);e===2&&([t,i]=[i,t]);const s=new CG(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=s:this.dumbInput2LineRangeEdit=s,s}}function Ijt(n,e,t){let i="";const s=n.startLineNumber>1;let o=s?new oe(n.startLineNumber-1,t.getLineMaxColumn(n.startLineNumber-1)):new oe(n.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!o.isBeforeOrEqual(h))return;let u=t.getValueInRange(O.fromPositions(o,h));h.lineNumber>t.getLineCount()&&(u+=` `),i+=u,i+=d.newText,o=d.range.getEndPosition()}const r=n.endLineNumberExclusive<=t.getLineCount(),a=r?new oe(n.endLineNumberExclusive,1):new oe(n.endLineNumberExclusive-1,Zn.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(O.fromPositions(o,a));i+=c;const l=xw(i);if(s){if(l[0]!=="")return;l.shift()}if(r){if(l[l.length-1]!=="")return;l.pop()}return new CG(n,l)}var rr;(function(n){n[n.base=0]="base",n[n.input1=1]="input1",n[n.input2=2]="input2",n[n.both=3]="both",n[n.unrecognized=4]="unrecognized"})(rr||(rr={}));function Pke(n){return n===1?2:1}class ij{constructor(){}get includesInput1(){return!1}get includesInput2(){return!1}includesInput(e){return e===1?this.includesInput1:this.includesInput2}isInputIncluded(e){return e===1?this.includesInput1:this.includesInput2}toggle(e){return this.withInputValue(e,!this.includesInput(e),!0)}getInput(e){return this.isInputIncluded(e)?S4.first:S4.excluded}}class xOe extends ij{get kind(){return rr.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new nue:this:t?new jF:this}equals(e){return e.kind===rr.base}}class nue extends ij{get kind(){return rr.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new jF}withInputValue(e,t,i=!1){return e===1?t?this:new xOe:t?new sue(1,i):new jF}equals(e){return e.kind===rr.input1}}class jF extends ij{get kind(){return rr.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new nue}withInputValue(e,t,i=!1){return e===2?t?this:new xOe:t?new sue(2,i):new jF}equals(e){return e.kind===rr.input2}}class sue extends ij{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return rr.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new sue(Pke(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new jF:new nue}equals(e){return e.kind===rr.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?S4.first:S4.second}}class Ljt extends ij{get kind(){return rr.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new nue:new jF:this}equals(e){return e.kind===rr.unrecognized}}var Sh;(function(n){n.base=new xOe,n.unrecognized=new Ljt})(Sh||(Sh={}));var S4;(function(n){n[n.excluded=0]="excluded",n[n.first=1]="first",n[n.second=2]="second",n[n.unrecognized=3]="unrecognized"})(S4||(S4={}));const trt="vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel";let zse=class extends pL{constructor(e,t,i,s,o,r,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=s,this.diffComputer=o,this.options=r,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Ype(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Ype(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Ype(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=Dt(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return EOe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=Dt(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new i8e(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=Dt(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=Dt(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=Dt(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=Dt(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=Dt(this,h=>{const u=new LR(this.baseResultDiffs.read(h),-1);return new LR(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new ef(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=Dt(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=Dt(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===o_.initializing)?rv.initializing:u.some(f=>f===o_.updating)?rv.updating:rv.upToDate}),this.inputDiffComputingState=Dt(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===o_.initializing)?rv.initializing:u.some(f=>f===o_.updating)?rv.updating:rv.upToDate}),this.isUpToDate=Dt(this,h=>this.diffComputingState.read(h)===rv.upToDate),this.onInitialized=U$(this.diffComputingState,h=>h===rv.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=Dt(this,h=>{const u=this.modifiedBaseRangeResultStates.read(h);let f=0;for(const[p,m]of u)m.handled.read(h)||f++;return f}),this.hasUnhandledConflicts=this.unhandledConflictsCount.map(h=>h>0),this._register(gJ(this.modifiedBaseRangeResultStates)),this._register(gJ(this.input1ResultMapping)),this._register(gJ(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(Az({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===GA.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);En(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,w]of f){const b=w.accepted.get(),C=!(b.kind===rr.base||b.kind===rr.unrecognized);w.handledInput1.set(C,m),w.handledInput2.set(C,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await U$(this.inputDiffComputingState,t=>t===rv.upToDate);const e=this.modifiedBaseRangeResultStates.get();En(t=>{for(const[i,s]of e){let o,r=!1;i.input1Diffs.length===0?(o=Sh.base.withInputValue(2,!0),r=!0):i.input2Diffs.length===0||i.isEqualChange?(o=Sh.base.withInputValue(1,!0),r=!0):(o=Sh.base,r=!1),s.accepted.set(o,t),s.computedFromDiffing=!1,s.previousNonDiffingState=void 0,s.handledInput1.set(r,t),s.handledInput2.set(r,t)}this.resultTextModel.pushEditOperations(null,[{range:new O(1,1,Number.MAX_SAFE_INTEGER,1),text:this.computeAutoMergedResult()}],()=>null)})}computeAutoMergedResult(){const e=this.modifiedBaseRanges.get(),t=this.base.getLinesContent(),i=this.input1.textModel.getLinesContent(),s=this.input2.textModel.getLinesContent(),o=[];function r(c,l){for(let d=l.startLineNumber;do.inputRange.isEmpty||o.outputRange.isEmpty?new ef(o.inputRange.deltaStart(-1),o.outputRange.deltaStart(-1)):o),s.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new y2(i.flatMap(o=>o.rangeMappings),0).reverse().projectRange(t).outputRange}translateBaseRangeToInput(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new y2(i.flatMap(o=>o.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new y2(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new y2(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).projectRange(e).outputRange}findModifiedBaseRangesInRange(e){return this.modifiedBaseRanges.get().filter(t=>t.baseRange.intersects(e))}updateBaseRangeAcceptedState(e,t,i){const s=Cjt(t,e,(o,r)=>o[0].baseRange.touches(r.inputRange)?i1.neitherLessOrGreaterThan:ap.compareByStart(o[0].baseRange,r.inputRange));for(const o of s){const r=this.computeState(o.left[0],o.rights),a=o.left[1],c=a.accepted.get();c.equals(r)||(!this.firstRun&&!a.computedFromDiffing&&(a.computedFromDiffing=!0,a.previousNonDiffingState=c),a.accepted.set(r,i))}this.firstRun&&(this.firstRun=!1)}computeState(e,t){if(t.length===0)return Sh.base;const i=t.map(r=>r.getLineEdit());function s(r){return Ls(i,r.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(s(e.input1Diffs))return Sh.base.withInputValue(1,!0);if(s(e.input2Diffs))return Sh.base.withInputValue(2,!0);const o=[Sh.base.withInputValue(1,!0).withInputValue(2,!0,!0),Sh.base.withInputValue(2,!0).withInputValue(1,!0,!0),Sh.base.withInputValue(1,!0).withInputValue(2,!0,!1),Sh.base.withInputValue(2,!0).withInputValue(1,!0,!1)];for(const r of o){const{edit:a}=e.getEditForBase(r);if(a){const l=this.resultTextModelDiffs.getResultLineRange(e.baseRange).getLines(this.resultTextModel);if(Ls(a.newLines,l,(d,h)=>d===h))return r}}return Sh.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new cn("object must be from this instance");return t.accepted}setState(e,t,i,s,o=!1){if(!this.isUpToDate.get())throw new cn("Cannot set state while updating");const r=this.modifiedBaseRangeResultStates.get().get(e);if(!r)throw new cn("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new qZ;a&&this.resultTextModelDiffs.removeDiffs(a,s,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);r.accepted.set(d,s),r.previousNonDiffingState=void 0,r.computedFromDiffing=!1;const h=r.handledInput1.get(),u=r.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new Tjt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(r),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,s,c),this.resultTextModel.pushStackElement()),r.handledInput1.set(!0,s),r.handledInput2.set(!0,s)}resetDirtyConflictsToBase(){En(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===rr.unrecognized&&this.setState(t,Sh.base,!1,e,!1);this.resultTextModel.pushStackElement()})}isHandled(e){return this.modifiedBaseRangeResultStates.get().get(e).handled}isInputHandled(e,t){const i=this.modifiedBaseRangeResultStates.get().get(e);return t===1?i.handledInput1:i.handledInput2}setInputHandled(e,t,i,s){const o=this.modifiedBaseRangeResultStates.get().get(e);if(o.handled.get()===i)return;const r=new WeakRef(i8e),a=new WeakRef(this);this.undoRedoService.pushElement({type:wd.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(trt,0,"Set Input Handled"),redo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&En(d=>{t===1?o.handledInput1.set(i,d):o.handledInput2.set(i,d)})},undo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&En(d=>{t===1?o.handledInput1.set(!i,d):o.handledInput2.set(!i,d)})}}),t===1?o.handledInput1.set(i,s):o.handledInput2.set(i,s)}setHandled(e,t,i){const s=this.modifiedBaseRangeResultStates.get().get(e);s.handled.get()!==t&&(s.handledInput1.set(t,i),s.handledInput2.set(t,i))}setLanguageId(e,t){const i=this.languageService.createById(e);this.base.setLanguage(i,t),this.input1.textModel.setLanguage(i,t),this.input2.textModel.setLanguage(i,t),this.resultTextModel.setLanguage(i,t)}getInitialResultValue(){const e=[];for(;;){const t=this.resultSnapshot.read();if(t===null)break;e.push(t)}return e.join()}async getResultValueWithConflictMarkers(){if(await U$(this.diffComputingState,c=>c===rv.upToDate),this.unhandledConflictsCount.get()===0)return this.resultTextModel.getValue();const e=this.resultTextModel.getLinesContent(),t=this.input1.textModel.getLinesContent(),i=this.input2.textModel.getLinesContent(),s=this.modifiedBaseRangeResultStates.get(),o=[];function r(c,l){for(let d=l.startLineNumber;d>>>>>>")}return r(e,ap.fromLineNumbers(a,e.length+1)),o.join(` -`)}get conflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.base)}get conflictsResolvedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input1)}get conflictsResolvedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input2)}get conflictsResolvedWithSmartCombination(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input1})}get manuallySolvedConflictCountThatEqualInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&t.previousNonDiffingState?.smartCombination})}};zse=D([_(7,Di),_(8,pO)],zse);function Df(n,e){let t=0;for(const i of n)e(i)&&t++;return t}class i8e{constructor(e){this.baseRange=e,this.accepted=xi(`BaseRangeState${this.baseRange.baseRange}`,Sh.base),this.handledInput1=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Dt(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var rv;(function(n){n[n.initializing=1]="initializing",n[n.upToDate=2]="upToDate",n[n.updating=3]="updating"})(rv||(rv={}));class Tjt{constructor(e,t,i,s,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=s,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(trt,1,"Undo Mark As Handled"),this.type=wd.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(!0,i),t.handledInput2.set(!0,i)})}undo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}const mL="vs/workbench/contrib/mergeEditor/common/mergeEditor";new Y("isMergeEditor",!1,{type:"boolean",description:g(mL,0,"The editor is a merge editor")});new Y("isMergeResultEditor",!1,{type:"boolean",description:g(mL,1,"The editor is a the result editor of a merge editor.")});new Y("mergeEditorLayout","mixed",{type:"string",description:g(mL,2,"The layout mode of a merge editor")});new Y("mergeEditorShowBase",!1,{type:"boolean",description:g(mL,3,"If the merge editor shows the base version")});new Y("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(mL,4,"If base should be shown at the top")});new Y("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(mL,5,"If the merge editor shows non-conflicting changes")});new Y("mergeEditorBaseUri","",{type:"string",description:g(mL,6,"The uri of the baser of a merge editor")});new Y("mergeEditorResultUri","",{type:"string",description:g(mL,7,"The uri of the result of a merge editor")});const n8e="mergeEditorCloseWithConflicts";var Fke;const ka="vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel";let Oke=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=s}async createInputModel(e){const t=new Z,[i,s,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);t.add(i),t.add(s);const a=s.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:s.object.textEditorModel.getLanguageId(),onDidChange:T.None},a);t.add(c);const l=this._instantiationService.createInstance(Vse),d=this._instantiationService.createInstance(zse,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(Bke,d,t,s.object,e.result)}};Oke=D([_(1,be),_(2,Rn),_(3,Ai)],Oke);let Bke=class extends pL{constructor(e,t,i,s,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=s,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=xi(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Wn(c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Dt(this,c=>this.altVersionId.read(c)!==this.savedAltVersionId.read(c)),this.finished=!1}dispose(){this.disposable.dispose(),super.dispose()}async accept(){const e=await this.model.resultTextModel.getValue();this.result.textEditorModel.setValue(e),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),await this.textFileService.save(this.result.textEditorModel.uri),this.finished=!0}async _discard(){await this.textFileService.revert(this.model.resultTextModel.uri),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),this.finished=!0}shouldConfirmClose(){return!0}async confirmClose(e){fw(()=>e.some(s=>s===this));const t=e.some(s=>s.isDirty.get());let i;if(t){const s=e.length>1,o=s?g(ka,0,"Do you want keep the merge result of {0} files?",e.length):g(ka,1,"Do you want keep the merge result of {0}?",ui(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(ka,2,"&&Save With Conflicts"):g(ka,3,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,4,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}];i=(await this.dialogService.prompt({type:nt.Info,message:o,detail:r?s?g(ka,5,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(ka,6,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):s?g(ka,7,"The merge results will be lost if you don't save them."):g(ka,8,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>Ku.CANCEL}})).result}else i=Ku.DONT_SAVE;return i===Ku.SAVE?await Promise.all(e.map(s=>s.accept())):i===Ku.DONT_SAVE&&await Promise.all(e.map(s=>s._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(ka,9,"Do you want to accept the merge result?"),detail:g(ka,10,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(ka,11,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(s=>s.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};Bke=D([_(4,tr),_(5,To),_(6,_i)],Bke);var BP;let Wke=(BP=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=s}async createInputModel(e){const t=new Z;let i;const s=t.add(new Z),o=m=>{_n(e.result,m.resource)&&(s.clear(),i=m)};s.add(this.textFileService.files.onDidCreate(o)),this.textFileService.files.models.forEach(o);const[r,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new cn;await i.save({source:Fke.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(bjt.start)),f=this._instantiationService.createInstance(Vse),p=this._instantiationService.createInstance(zse,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(Hke,p,t,i,this._mergeEditorTelemetry)}},Fke=BP,BP.FILE_SAVED_SOURCE=ote.registerSource("merge-editor.source",g(ka,12,"Before Resolving Conflicts In Merge Editor")),BP);Wke=Fke=D([_(1,be),_(2,Rn),_(3,tr)],Wke);let Hke=class extends pL{constructor(e,t,i,s,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=s,this._dialogService=o,this._storageService=r,this.isDirty=Wn(T.any(this.resultTextFileModel.onDidChangeDirty,this.resultTextFileModel.onDidSaveError),()=>this.resultTextFileModel.isDirty()),this.reported=!1,this.dateTimeOpened=new Date}dispose(){this.disposableStore.dispose(),super.dispose(),this.reportClose(!1)}reportClose(e){if(!this.reported){const t=this.model.unhandledConflictsCount.get(),i=new Date().getTime()-this.dateTimeOpened.getTime();this.telemetry.reportMergeEditorClosed({durationOpenedSecs:i/1e3,remainingConflictCount:t,accepted:e,conflictCount:this.model.conflictCount,combinableConflictCount:this.model.combinableConflictCount,conflictsResolvedWithBase:this.model.conflictsResolvedWithBase,conflictsResolvedWithInput1:this.model.conflictsResolvedWithInput1,conflictsResolvedWithInput2:this.model.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:this.model.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:this.model.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:this.model.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:this.model.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:this.model.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart}),this.reported=!0}}async accept(){this.reportClose(!0),await this.resultTextFileModel.save()}get resultUri(){return this.resultTextFileModel.resource}async save(e){await this.resultTextFileModel.save(e)}async revert(e){await this.resultTextFileModel.revert(e)}shouldConfirmClose(){return!0}async confirmClose(e){const t=e.length>1,i=e.some(o=>o.isDirty.get()),s=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(ka,13,"Do you want to save the changes you made to {0} files?",e.length):g(ka,14,"Do you want to save the changes you made to {0}?",ui(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:nt.Info,message:o,detail:s?t?g(ka,15,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(ka,16,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):t?g(ka,17,"Your changes will be lost if you don't save them."):g(ka,18,"Your changes will be lost if you don't save them."),buttons:[{label:s?g(ka,19,"&&Save with Conflicts"):g(ka,20,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,21,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}],cancelButton:{run:()=>Ku.CANCEL}});return r}else if(s&&!this._storageService.getBoolean(n8e,ke.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(ka,22,"Do you want to close {0} merge editors?",e.length):g(ka,23,"Do you want to close the merge editor for {0}?",ui(e[0].resultUri)),detail:s?t?g(ka,24,"The files contain unhandled conflicts."):g(ka,25,"The file contains unhandled conflicts."):void 0,primaryButton:s?g(ka,26,"&&Close with Conflicts"):g(ka,27,"&&Close"),checkbox:{label:g(ka,28,"Do not ask me again")}});return r&&this._storageService.store(n8e,!0,ke.PROFILE,ln.USER),o?Ku.SAVE:Ku.CANCEL}else return Ku.SAVE}};Hke=D([_(4,To),_(5,sn)],Hke);async function $se(n,e,t){const i=await e.createModelReference(n.uri);return t.add(i),{textModel:i.object.textEditorModel,title:n.title,description:n.description,detail:n.detail}}let Uke=class{constructor(e){this.telemetryService=e}reportMergeEditorOpened(e){this.telemetryService.publicLog2("mergeEditor.opened",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportLayoutChange(e){this.telemetryService.publicLog2("mergeEditor.layoutChanged",{baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportMergeEditorClosed(e){this.telemetryService.publicLog2("mergeEditor.closed",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,durationOpenedSecs:e.durationOpenedSecs,remainingConflictCount:e.remainingConflictCount,accepted:e.accepted,conflictsResolvedWithBase:e.conflictsResolvedWithBase,conflictsResolvedWithInput1:e.conflictsResolvedWithInput1,conflictsResolvedWithInput2:e.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:e.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:e.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:e.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:e.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:e.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart})}reportAcceptInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.accept",{otherAccepted:t,isInput1:e===1})}reportSmartCombinationInvoked(e){this.telemetryService.publicLog2("mergeEditor.action.smartCombination",{otherAccepted:e})}reportRemoveInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.remove",{otherAccepted:t,isInput1:e===1})}reportResetToBaseInvoked(){this.telemetryService.publicLog2("mergeEditor.action.resetToBase",{})}reportNavigationToNextConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToNextConflict",{})}reportNavigationToPreviousConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToPreviousConflict",{})}reportConflictCounterClicked(){this.telemetryService.publicLog2("mergeEditor.action.conflictCounterClicked",{})}};Uke=D([_(0,on)],Uke);var $3;const Rjt="vs/workbench/contrib/mergeEditor/browser/mergeEditorInput";var WP;let Vke=(WP=class extends Ib{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(s,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=s,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{fw(()=>p.every(v=>v.editor instanceof $3));const m=p.map(v=>v.editor._inputModel).filter(yl);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?Oke:Wke,this._instaService.createInstance(Uke))}dispose(){super.dispose()}get typeId(){return $3.ID}get editorId(){return A_.id}get capabilities(){let e=super.capabilities|Mi.MultipleEditors;return this.useWorkingCopy&&(e|=Mi.Untitled),e}getName(){return g(Rjt,0,"Merging: {0}",super.getName())}async resolve(){if(!this._inputModel){const e=this._register(await this.mergeEditorModeFactory.createInputModel({base:this.base,input1:this.input1,input2:this.input2,result:this.result}));this._inputModel=e,this._register(Ni(t=>{e.isDirty.read(t),this._onDidChangeDirty.fire()})),await this._inputModel.model.onInitialized}return this._inputModel}async accept(){await this._inputModel?.accept()}async save(e,t){await this._inputModel?.save(t)}toUntyped(){return{input1:{resource:this.input1.uri,label:this.input1.title,description:this.input1.description,detail:this.input1.detail},input2:{resource:this.input2.uri,label:this.input2.title,description:this.input2.description,detail:this.input2.detail},base:{resource:this.base},result:{resource:this.result},options:{override:this.typeId}}}matches(e){return this===e?!0:e instanceof $3?_n(this.base,e.base)&&_n(this.input1.uri,e.input1.uri)&&_n(this.input2.uri,e.input2.uri)&&_n(this.result,e.result):Wb(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&_n(this.base,e.base.resource)&&_n(this.input1.uri,e.input1.resource)&&_n(this.input2.uri,e.input2.resource)&&_n(this.result,e.result.resource):!1}async revert(e,t){return this._inputModel?.revert(t)}isDirty(){return this._inputModel?.isDirty.get()??!1}setLanguageId(e,t){this._inputModel?.model.setLanguageId(e,t)}},$3=WP,WP.ID="mergeEditor.Input",WP);Vke=$3=D([_(4,be),_(5,_i),_(6,tr),_(7,eo),_(8,ci),_(9,Re),_(10,hh),_(11,dl),_(12,aD)],Vke);class Mjt{constructor(e){this._value=e,this.onHasValueDidChange=T.None}request(){return Promise.resolve(this._value)}get value(){return this._value}}const Njt="vs/workbench/contrib/multiDiffEditor/browser/icons.contribution",Pjt=ji("multi-diff-editor-label-icon",Ce.diffMultiple,g(Njt,0,"Icon of the multi diff editor label."));class s8e{constructor(e,t){if(this.original=e,this.modified=t,!e&&!t)throw new cn("Invalid arguments")}getKey(){return JSON.stringify([this.modified?.toString(),this.original?.toString()])}}const Fjt="vs/workbench/services/editor/common/editorResolverService",Ojt=it.as(Cs.Configuration),Bjt={...PQ,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(Fjt,0,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};Ojt.registerConfiguration(Bjt);var Gse;(function(n){n.builtin="builtin",n.option="option",n.exclusive="exclusive",n.default="default"})(Gse||(Gse={}));var w8;(function(n){n[n.ABORT=1]="ABORT",n[n.NONE=2]="NONE"})(w8||(w8={}));function Wjt(n,e){if(new Set([_e.extension,_e.webviewPanel,_e.vscodeWorkspaceTrust,_e.vscodeSettings]).has(e.scheme))return!1;const s=typeof n=="string"&&n.indexOf(qi.sep)>=0?`${e.scheme}:${e.path}`:ui(e);return WW(typeof n=="string"?n.toLowerCase():n,s.toLowerCase())}var PB;const o8e="vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput";var HP;let sH=(HP=class extends cC{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new cn("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??P.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(PB,i,e.label,e.resources?.map(s=>new s8e(s.original.resource,s.modified.resource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(PB,P.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new s8e(i.originalUri?P.parse(i.originalUri):void 0,i.modifiedUri?P.parse(i.modifiedUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Mi.Readonly}get typeId(){return PB.ID}getName(){return this._name}get editorId(){return A_.id}getIcon(){return Pjt}constructor(e,t,i,s=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=s,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new tut(async()=>{const d=await this._createModel();this._register(d);const h=new dZe(d,this._instantiationService);return this._register(h),await JQe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new N1t(async()=>{const d=this.initialResources?{resources:gQe.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?VJe(this,d.resources):Au([])}}),this.resources=Dt(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=yee(this,this.resources.map(d=>d??[]),d=>{const h=d.modified?r8e(this._textFileService,d.modified):Au(!1),u=d.original?r8e(this._textFileService,d.original):Au(!1);return Dt(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Dt(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=T.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return Ku.DONT_SAVE},showConfirm(){return!1}},this._register(Ni(d=>{const h=this.resources.read(d),u=this.label??g(o8e,0,"Multi Diff Editor");h?this._name=u+g(o8e,1," ({0} files)",h.length):this._name=u,this._onDidChangeLabel.fire()}))}serialize(){return{label:this.label,multiDiffSourceUri:this.multiDiffSource.toString(),resources:this.initialResources?.map(e=>({originalUri:e.original?.toString(),modifiedUri:e.modified?.toString()}))}}setLanguageId(e,t){const s=this._viewModel.requireValue().activeDiffItem.get()?.entry?.value;if(!s)return;const o=s.modified??s.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=new Z,s=yee(this,e.resources,async(l,d)=>{let h,u;const f=new Z;d.add(Ee(()=>{i.add(f)}));try{[h,u]=await Promise.all([l.original?this._textModelService.createModelReference(l.original):void 0,l.modified?this._textModelService.createModelReference(l.modified):void 0]),h&&f.add(h),u&&f.add(u)}catch(m){console.error(m),bt(m);return}const p=l.modified??l.original;return new Mjt({original:h?.object.textEditorModel,modified:u?.object.textEditorModel,get options(){return{...Hjt(u?.object.isReadonly()??!0),...Ujt(t.getValue(p))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(p,"editor")||v.affectsConfiguration(p,"diffEditor"))&&m()})})},l=>JSON.stringify([l.modified?.toString(),l.original?.toString()])),o=xi("documents",[]),r=Dt(async l=>{const d=s.read(l),u=(await Promise.all(d)).filter(yl);o.set(u,void 0),i.clear()}),a=Ez(r);return await r.get(),{dispose:()=>{a.dispose(),i.dispose()},documents:new LNe(o),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof PB?this.multiDiffSource.toString()===e.multiDiffSource.toString():!1}isDirty(){return this._isDirtyObservable.get()}async save(e,t){return await this.doSaveOrRevert("save",e,t),this}revert(e,t){return this.doSaveOrRevert("revert",e,t)}async doSaveOrRevert(e,t,i){const s=this._viewModel.currentValue?.items.get();s&&await Promise.all(s.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==_e.untitled&&this._textFileService.isDirty(r.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(r.original.uri,i):this._textFileService.revert(r.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(r.modified.uri,i):this._textFileService.revert(r.modified.uri,i)])}))}},PB=HP,HP.ID="workbench.input.multiDiffEditor",HP);sH=PB=D([_(4,Rn),_(5,dl),_(6,be),_(7,GZe),_(8,tr)],sH);function r8e(n,e){return Wn(T.filter(n.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>n.isDirty(e))}function Hjt(n){return{readOnly:!!n,readOnlyMessage:typeof n!="boolean"?n:void 0}}function Ujt(n){const e=Vs(n.editor);if(fo(n.diffEditor)){const t=Vs(n.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var qH;let a8e=(qH=class extends ${constructor(e,t){super(),this._register(e.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createMultiDiffEditorInput:i=>({editor:sH.fromResourceMultiDiffEditorInput(i,t)})}))}},qH.ID="workbench.contrib.multiDiffEditorResolver",qH);a8e=D([_(0,Pz),_(1,be)],a8e);var c8e;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.Up=2]="Up",n[n.Down=3]="Down"})(c8e||(c8e={}));var l8e;(function(n){n[n.Connecting=0]="Connecting",n[n.Connected=1]="Connected"})(l8e||(l8e={}));const d8e="terminalEditor";var h8e;(function(n){n[n.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(h8e||(h8e={}));var u8e;(function(n){n[n.Unknown=1]="Unknown",n[n.Fedora=2]="Fedora",n[n.Ubuntu=3]="Ubuntu"})(u8e||(u8e={}));var g8e;(function(n){n.Terminals="Terminals"})(g8e||(g8e={}));const uh="vs/workbench/contrib/terminal/common/terminalColorRegistry";B("terminal.background",null,g(uh,0,"The background color of the terminal, this allows coloring the terminal differently to the panel."));B("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(uh,1,"The foreground color of the terminal."));B("terminalCursor.foreground",null,g(uh,2,"The foreground color of the terminal cursor."));B("terminalCursor.background",null,g(uh,3,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const nY=B("terminal.selectionBackground",{light:Hv,dark:Hv,hcDark:Hv,hcLight:Hv},g(uh,4,"The selection background color of the terminal."));B("terminal.inactiveSelectionBackground",{light:Ie(nY,.5),dark:Ie(nY,.5),hcDark:Ie(nY,.7),hcLight:Ie(nY,.5)},g(uh,5,"The selection background color of the terminal when it does not have focus."));B("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(uh,6,"The selection foreground color of the terminal. When this is null the selection foreground will be retained and have the minimum contrast ratio feature applied."));B("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(uh,7,"The default terminal command decoration background color."));B("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(uh,8,"The terminal command decoration background color for successful commands."));B("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(uh,9,"The terminal command decoration background color for error commands."));B("terminalOverviewRuler.cursorForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(uh,10,"The overview ruler cursor color."));B("terminal.border",{dark:TE,light:TE,hcDark:TE,hcLight:TE},g(uh,11,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));B("terminal.findMatchBackground",{dark:lWe,light:lWe,hcDark:null,hcLight:"#0F4A85"},g(uh,12,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.hoverHighlightBackground",{dark:Ie(Vk,.5),light:Ie(Vk,.5),hcDark:Ie(Vk,.5),hcLight:Ie(Vk,.5)},g(uh,13,"Border color of the other search matches in the terminal."));B("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,14,"Border color of the current search match in the terminal."));B("terminal.findMatchHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(uh,15,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,13,"Border color of the other search matches in the terminal."));B("terminalOverviewRuler.findMatchForeground",{dark:m$,light:m$,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,16,"Overview ruler marker color for find matches in the terminal."));B("terminal.dropBackground",{dark:qv,light:qv,hcDark:qv,hcLight:qv},g(uh,17,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);B("terminal.tab.activeBorder",{dark:a2,light:a2,hcDark:a2,hcLight:a2},g(uh,18,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));function Vjt(n){let e;if(typeof n=="string"?e=n:n.color?e=n.color.replace(/\./g,"_"):$e.isThemeIcon(n.icon)&&n.icon.color&&(e=n.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function zjt(n,e,t){const i=n.icon;if(!i)return;const s=[];let o;if(i instanceof P?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===sf.LIGHT?i.light:i.dark),o instanceof P){const a=`terminal-uri-icon-${Ed(o.path).toString(36)}`;s.push(a),s.push("terminal-uri-icon")}return s}var zke;(function(n){n.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",n.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",n.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",n.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",n.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})(zke||(zke={}));const $jt=[zke.FocusAccessibleBuffer];var qC;(function(n){n.FindFocus="workbench.action.terminal.focusFind",n.FindHide="workbench.action.terminal.hideFind",n.FindNext="workbench.action.terminal.findNext",n.FindPrevious="workbench.action.terminal.findPrevious",n.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",n.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",n.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",n.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(qC||(qC={}));const Gjt=[qC.FindFocus,qC.FindHide,qC.FindNext,qC.FindPrevious,qC.ToggleFindRegex,qC.ToggleFindWholeWord,qC.ToggleFindCaseSensitive,qC.SearchWorkspace];var nk;(function(n){n.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",n.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",n.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",n.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",n.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",n.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget"})(nk||(nk={}));const qjt=[nk.SelectPrevSuggestion,nk.SelectPrevPageSuggestion,nk.SelectNextSuggestion,nk.SelectNextPageSuggestion,nk.AcceptSelectedSuggestion,nk.HideSuggestWidget],ML="vs/workbench/contrib/terminal/common/terminal",Qjt="terminal";var f8e;(function(n){n[n.Uninitialized=1]="Uninitialized",n[n.Launching=2]="Launching",n[n.Running=3]="Running",n[n.KilledDuringLaunch=4]="KilledDuringLaunch",n[n.KilledByUser=5]="KilledByUser",n[n.KilledByProcess=6]="KilledByProcess"})(f8e||(f8e={}));var wn;(function(n){n.Toggle="workbench.action.terminal.toggleTerminal",n.Kill="workbench.action.terminal.kill",n.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",n.KillEditor="workbench.action.terminal.killEditor",n.KillActiveTab="workbench.action.terminal.killActiveTab",n.KillAll="workbench.action.terminal.killAll",n.QuickKill="workbench.action.terminal.quickKill",n.ConfigureTerminalSettings="workbench.action.terminal.openSettings",n.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",n.RunRecentCommand="workbench.action.terminal.runRecentCommand",n.CopyLastCommand="workbench.action.terminal.copyLastCommand",n.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",n.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",n.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",n.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",n.CopySelection="workbench.action.terminal.copySelection",n.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",n.SelectAll="workbench.action.terminal.selectAll",n.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",n.DeleteWordRight="workbench.action.terminal.deleteWordRight",n.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",n.MoveToLineStart="workbench.action.terminal.moveToLineStart",n.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",n.New="workbench.action.terminal.new",n.NewWithCwd="workbench.action.terminal.newWithCwd",n.NewLocal="workbench.action.terminal.newLocal",n.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",n.NewWithProfile="workbench.action.terminal.newWithProfile",n.Split="workbench.action.terminal.split",n.SplitActiveTab="workbench.action.terminal.splitActiveTab",n.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",n.Unsplit="workbench.action.terminal.unsplit",n.JoinActiveTab="workbench.action.terminal.joinActiveTab",n.Join="workbench.action.terminal.join",n.Relaunch="workbench.action.terminal.relaunch",n.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",n.CreateTerminalEditor="workbench.action.createTerminalEditor",n.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",n.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",n.FocusTabs="workbench.action.terminal.focusTabs",n.FocusNextPane="workbench.action.terminal.focusNextPane",n.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",n.ResizePaneRight="workbench.action.terminal.resizePaneRight",n.ResizePaneUp="workbench.action.terminal.resizePaneUp",n.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",n.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",n.ResizePaneDown="workbench.action.terminal.resizePaneDown",n.Focus="workbench.action.terminal.focus",n.FocusNext="workbench.action.terminal.focusNext",n.FocusPrevious="workbench.action.terminal.focusPrevious",n.Paste="workbench.action.terminal.paste",n.PasteSelection="workbench.action.terminal.pasteSelection",n.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",n.RunSelectedText="workbench.action.terminal.runSelectedText",n.RunActiveFile="workbench.action.terminal.runActiveFile",n.SwitchTerminal="workbench.action.terminal.switchTerminal",n.ScrollDownLine="workbench.action.terminal.scrollDown",n.ScrollDownPage="workbench.action.terminal.scrollDownPage",n.ScrollToBottom="workbench.action.terminal.scrollToBottom",n.ScrollUpLine="workbench.action.terminal.scrollUp",n.ScrollUpPage="workbench.action.terminal.scrollUpPage",n.ScrollToTop="workbench.action.terminal.scrollToTop",n.Clear="workbench.action.terminal.clear",n.ClearSelection="workbench.action.terminal.clearSelection",n.ChangeIcon="workbench.action.terminal.changeIcon",n.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",n.ChangeColor="workbench.action.terminal.changeColor",n.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",n.Rename="workbench.action.terminal.rename",n.RenameActiveTab="workbench.action.terminal.renameActiveTab",n.RenameWithArgs="workbench.action.terminal.renameWithArg",n.QuickOpenTerm="workbench.action.quickOpenTerm",n.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",n.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",n.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",n.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",n.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",n.SelectToNextLine="workbench.action.terminal.selectToNextLine",n.SendSequence="workbench.action.terminal.sendSequence",n.AttachToSession="workbench.action.terminal.attachToSession",n.DetachSession="workbench.action.terminal.detachSession",n.MoveToEditor="workbench.action.terminal.moveToEditor",n.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",n.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",n.SetDimensions="workbench.action.terminal.setDimensions",n.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",n.FocusHover="workbench.action.terminal.focusHover",n.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",n.StartVoice="workbench.action.terminal.startVoice",n.StopVoice="workbench.action.terminal.stopVoice"})(wn||(wn={}));[wn.ClearSelection,wn.Clear,wn.CopyAndClearSelection,wn.CopySelection,wn.CopySelectionAsHtml,wn.CopyLastCommand,wn.CopyLastCommandOutput,wn.CopyLastCommandAndLastCommandOutput,wn.DeleteToLineStart,wn.DeleteWordLeft,wn.DeleteWordRight,wn.GoToRecentDirectory,wn.FocusNextPane,wn.FocusNext,wn.FocusPreviousPane,wn.FocusPrevious,wn.Focus,wn.SizeToContentWidth,wn.Kill,wn.KillEditor,wn.MoveToEditor,wn.MoveToLineEnd,wn.MoveToLineStart,wn.MoveToTerminalPanel,wn.NewInActiveWorkspace,wn.New,wn.Paste,wn.PasteSelection,wn.ResizePaneDown,wn.ResizePaneLeft,wn.ResizePaneRight,wn.ResizePaneUp,wn.RunActiveFile,wn.RunSelectedText,wn.RunRecentCommand,wn.ScrollDownLine,wn.ScrollDownPage,wn.ScrollToBottom,wn.ScrollToNextCommand,wn.ScrollToPreviousCommand,wn.ScrollToTop,wn.ScrollUpLine,wn.ScrollUpPage,wn.SendSequence,wn.SelectAll,wn.SelectToNextCommand,wn.SelectToNextLine,wn.SelectToPreviousCommand,wn.SelectToPreviousLine,wn.SplitInActiveWorkspace,wn.Split,wn.Toggle,wn.FocusHover,Ru.OpenAccessibilityHelp,...$jt,...Gjt,...qjt];g(ML,0,"Contributes terminal functionality."),g(ML,1,"Defines additional terminal profiles that the user can create."),g(ML,2,"The ID of the terminal profile provider."),g(ML,3,"Title for this terminal profile."),g(ML,4,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(ML,5,"Icon path when a light theme is used"),g(ML,6,"Icon path when a dark theme is used");const xg="vs/workbench/contrib/terminal/common/terminalContextKey";var Lr;(function(n){n.IsOpen="terminalIsOpen",n.Count="terminalCount",n.GroupCount="terminalGroupCount",n.TabsNarrow="isTerminalTabsNarrow",n.HasFixedWidth="terminalHasFixedWidth",n.ProcessSupported="terminalProcessSupported",n.Focus="terminalFocus",n.FocusInAny="terminalFocusInAny",n.AccessibleBufferFocus="terminalAccessibleBufferFocus",n.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",n.EditorFocus="terminalEditorFocus",n.TabsFocus="terminalTabsFocus",n.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",n.TerminalHasBeenCreated="terminalHasBeenCreated",n.TerminalEditorActive="terminalEditorActive",n.TabsMouse="terminalTabsMouse",n.AltBufferActive="terminalAltBufferActive",n.SuggestWidgetVisible="terminalSuggestWidgetVisible",n.A11yTreeFocus="terminalA11yTreeFocus",n.ViewShowing="terminalViewShowing",n.TextSelected="terminalTextSelected",n.TextSelectedInFocused="terminalTextSelectedInFocused",n.FindVisible="terminalFindVisible",n.FindInputFocused="terminalFindInputFocused",n.FindFocused="terminalFindFocused",n.TabsSingularSelection="terminalTabsSingularSelection",n.SplitTerminal="terminalSplitTerminal",n.ShellType="terminalShellType",n.InTerminalRunCommandPicker="inTerminalRunCommandPicker",n.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(Lr||(Lr={}));var $ke;(function(n){n.isOpen=new Y(Lr.IsOpen,!1,!0),n.focus=new Y(Lr.Focus,!1,g(xg,0,"Whether the terminal is focused.")),n.focusInAny=new Y(Lr.FocusInAny,!1,g(xg,1,"Whether any terminal is focused, including detached terminals used in other UI.")),n.editorFocus=new Y(Lr.EditorFocus,!1,g(xg,2,"Whether a terminal in the editor area is focused.")),n.count=new Y(Lr.Count,0,g(xg,3,"The current number of terminals.")),n.groupCount=new Y(Lr.GroupCount,0,!0),n.tabsNarrow=new Y(Lr.TabsNarrow,!1,!0),n.terminalHasFixedWidth=new Y(Lr.HasFixedWidth,!1,!0),n.tabsFocus=new Y(Lr.TabsFocus,!1,g(xg,4,"Whether the terminal tabs widget is focused.")),n.webExtensionContributedProfile=new Y(Lr.WebExtensionContributedProfile,!1,!0),n.terminalHasBeenCreated=new Y(Lr.TerminalHasBeenCreated,!1,!0),n.terminalEditorActive=new Y(Lr.TerminalEditorActive,!1,!0),n.tabsMouse=new Y(Lr.TabsMouse,!1,!0),n.shellType=new Y(Lr.ShellType,void 0,{type:"string",description:g(xg,5,"The shell type of the active terminal, this is set to the last known value when no terminals exist.")}),n.altBufferActive=new Y(Lr.AltBufferActive,!1,g(xg,6,"Whether the terminal's alt buffer is active.")),n.suggestWidgetVisible=new Y(Lr.SuggestWidgetVisible,!1,g(xg,7,"Whether the terminal's suggest widget is visible.")),n.notFocus=n.focus.toNegated(),n.viewShowing=new Y(Lr.ViewShowing,!1,g(xg,8,"Whether the terminal view is showing")),n.textSelected=new Y(Lr.TextSelected,!1,g(xg,9,"Whether text is selected in the active terminal.")),n.textSelectedInFocused=new Y(Lr.TextSelectedInFocused,!1,g(xg,10,"Whether text is selected in a focused terminal.")),n.notTextSelected=n.textSelected.toNegated(),n.findVisible=new Y(Lr.FindVisible,!1,!0),n.notFindVisible=n.findVisible.toNegated(),n.findInputFocus=new Y(Lr.FindInputFocused,!1,!0),n.findFocus=new Y(Lr.FindFocused,!1,!0),n.notFindFocus=n.findInputFocus.toNegated(),n.processSupported=new Y(Lr.ProcessSupported,!1,g(xg,11,"Whether terminal processes can be launched in the current workspace.")),n.tabsSingularSelection=new Y(Lr.TabsSingularSelection,!1,g(xg,12,"Whether one terminal is selected in the terminal tabs list.")),n.splitTerminal=new Y(Lr.SplitTerminal,!1,g(xg,13,"Whether the focused tab's terminal is a split terminal.")),n.inTerminalRunCommandPicker=new Y(Lr.InTerminalRunCommandPicker,!1,g(xg,14,"Whether the terminal run command picker is currently open.")),n.terminalShellIntegrationEnabled=new Y(Lr.TerminalShellIntegrationEnabled,!1,g(xg,15,"Whether shell integration is enabled in the active terminal")),n.shouldShowViewInlineActions=ge.and(ge.equals("view",Qjt),ge.notEquals(`config.${_y.TabsHideCondition}`,"never"),ge.or(ge.not(`config.${_y.TabsEnabled}`),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminal"),ge.equals(Lr.GroupCount,1)),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminalOrNarrow"),ge.or(ge.equals(Lr.GroupCount,1),ge.has(Lr.TabsNarrow))),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleGroup"),ge.equals(Lr.GroupCount,1)),ge.equals(`config.${_y.TabsShowActions}`,"always")))})($ke||($ke={}));var TX;const sY="vs/workbench/contrib/terminal/browser/terminalEditorInput";var UP;let Gke=(UP=class extends cC{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return TX.ID}get editorId(){return d8e}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor|Mi.ForceDescription}setTerminalInstance(e){if(this._terminalInstance)throw new Error("cannot set instance that has already been set");this._terminalInstance=e,this._setupInstanceListeners()}copy(){const e=this._terminalInstanceService.createInstance(this._copyLaunchConfig||{},fV.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(TX,e.resource,e)}setCopyLaunchConfig(e){this._copyLaunchConfig=e}get terminalInstance(){return this._isDetached?void 0:this._terminalInstance}showConfirm(){if(this._isReverted)return!1;const e=this._configurationService.getValue(_y.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:nt.Warning,message:g(sY,0,"Do you want to terminate running processes?"),primaryButton:g(sY,1,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` +`)}get conflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return Df(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.base)}get conflictsResolvedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input1)}get conflictsResolvedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.input2)}get conflictsResolvedWithSmartCombination(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===rr.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input1})}get manuallySolvedConflictCountThatEqualInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return Df(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===rr.unrecognized&&t.previousNonDiffingState?.kind===rr.both&&t.previousNonDiffingState?.smartCombination})}};zse=D([_(7,Di),_(8,pO)],zse);function Df(n,e){let t=0;for(const i of n)e(i)&&t++;return t}class i8e{constructor(e){this.baseRange=e,this.accepted=xi(`BaseRangeState${this.baseRange.baseRange}`,Sh.base),this.handledInput1=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=xi(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Dt(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var rv;(function(n){n[n.initializing=1]="initializing",n[n.upToDate=2]="upToDate",n[n.updating=3]="updating"})(rv||(rv={}));class Tjt{constructor(e,t,i,s,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=s,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(trt,1,"Undo Mark As Handled"),this.type=wd.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(!0,i),t.handledInput2.set(!0,i)})}undo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&En(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}const mL="vs/workbench/contrib/mergeEditor/common/mergeEditor";new Y("isMergeEditor",!1,{type:"boolean",description:g(mL,0,"The editor is a merge editor")});new Y("isMergeResultEditor",!1,{type:"boolean",description:g(mL,1,"The editor is a the result editor of a merge editor.")});new Y("mergeEditorLayout","mixed",{type:"string",description:g(mL,2,"The layout mode of a merge editor")});new Y("mergeEditorShowBase",!1,{type:"boolean",description:g(mL,3,"If the merge editor shows the base version")});new Y("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(mL,4,"If base should be shown at the top")});new Y("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(mL,5,"If the merge editor shows non-conflicting changes")});new Y("mergeEditorBaseUri","",{type:"string",description:g(mL,6,"The uri of the baser of a merge editor")});new Y("mergeEditorResultUri","",{type:"string",description:g(mL,7,"The uri of the result of a merge editor")});const n8e="mergeEditorCloseWithConflicts";var Fke;const ka="vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel";let Oke=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=s}async createInputModel(e){const t=new Z,[i,s,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);t.add(i),t.add(s);const a=s.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:s.object.textEditorModel.getLanguageId(),onDidChange:T.None},a);t.add(c);const l=this._instantiationService.createInstance(Vse),d=this._instantiationService.createInstance(zse,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(Bke,d,t,s.object,e.result)}};Oke=D([_(1,be),_(2,Rn),_(3,Ai)],Oke);let Bke=class extends pL{constructor(e,t,i,s,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=s,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=xi(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Wn(c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Dt(this,c=>this.altVersionId.read(c)!==this.savedAltVersionId.read(c)),this.finished=!1}dispose(){this.disposable.dispose(),super.dispose()}async accept(){const e=await this.model.resultTextModel.getValue();this.result.textEditorModel.setValue(e),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),await this.textFileService.save(this.result.textEditorModel.uri),this.finished=!0}async _discard(){await this.textFileService.revert(this.model.resultTextModel.uri),this.savedAltVersionId.set(this.model.resultTextModel.getAlternativeVersionId(),void 0),this.finished=!0}shouldConfirmClose(){return!0}async confirmClose(e){fw(()=>e.some(s=>s===this));const t=e.some(s=>s.isDirty.get());let i;if(t){const s=e.length>1,o=s?g(ka,0,"Do you want keep the merge result of {0} files?",e.length):g(ka,1,"Do you want keep the merge result of {0}?",ui(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(ka,2,"&&Save With Conflicts"):g(ka,3,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,4,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}];i=(await this.dialogService.prompt({type:nt.Info,message:o,detail:r?s?g(ka,5,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(ka,6,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):s?g(ka,7,"The merge results will be lost if you don't save them."):g(ka,8,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>Ku.CANCEL}})).result}else i=Ku.DONT_SAVE;return i===Ku.SAVE?await Promise.all(e.map(s=>s.accept())):i===Ku.DONT_SAVE&&await Promise.all(e.map(s=>s._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(ka,9,"Do you want to accept the merge result?"),detail:g(ka,10,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(ka,11,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(s=>s.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};Bke=D([_(4,tr),_(5,To),_(6,_i)],Bke);var BP;let Wke=(BP=class{constructor(e,t,i,s){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=s}async createInputModel(e){const t=new Z;let i;const s=t.add(new Z),o=m=>{_n(e.result,m.resource)&&(s.clear(),i=m)};s.add(this.textFileService.files.onDidCreate(o)),this.textFileService.files.models.forEach(o);const[r,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),$se(e.input1,this._textModelService,t),$se(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new cn;await i.save({source:Fke.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(bjt.start)),f=this._instantiationService.createInstance(Vse),p=this._instantiationService.createInstance(zse,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(Hke,p,t,i,this._mergeEditorTelemetry)}},Fke=BP,BP.FILE_SAVED_SOURCE=ote.registerSource("merge-editor.source",g(ka,12,"Before Resolving Conflicts In Merge Editor")),BP);Wke=Fke=D([_(1,be),_(2,Rn),_(3,tr)],Wke);let Hke=class extends pL{constructor(e,t,i,s,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=s,this._dialogService=o,this._storageService=r,this.isDirty=Wn(T.any(this.resultTextFileModel.onDidChangeDirty,this.resultTextFileModel.onDidSaveError),()=>this.resultTextFileModel.isDirty()),this.reported=!1,this.dateTimeOpened=new Date}dispose(){this.disposableStore.dispose(),super.dispose(),this.reportClose(!1)}reportClose(e){if(!this.reported){const t=this.model.unhandledConflictsCount.get(),i=new Date().getTime()-this.dateTimeOpened.getTime();this.telemetry.reportMergeEditorClosed({durationOpenedSecs:i/1e3,remainingConflictCount:t,accepted:e,conflictCount:this.model.conflictCount,combinableConflictCount:this.model.combinableConflictCount,conflictsResolvedWithBase:this.model.conflictsResolvedWithBase,conflictsResolvedWithInput1:this.model.conflictsResolvedWithInput1,conflictsResolvedWithInput2:this.model.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:this.model.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:this.model.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:this.model.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:this.model.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:this.model.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:this.model.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart}),this.reported=!0}}async accept(){this.reportClose(!0),await this.resultTextFileModel.save()}get resultUri(){return this.resultTextFileModel.resource}async save(e){await this.resultTextFileModel.save(e)}async revert(e){await this.resultTextFileModel.revert(e)}shouldConfirmClose(){return!0}async confirmClose(e){const t=e.length>1,i=e.some(o=>o.isDirty.get()),s=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(ka,13,"Do you want to save the changes you made to {0} files?",e.length):g(ka,14,"Do you want to save the changes you made to {0}?",ui(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:nt.Info,message:o,detail:s?t?g(ka,15,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(ka,16,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):t?g(ka,17,"Your changes will be lost if you don't save them."):g(ka,18,"Your changes will be lost if you don't save them."),buttons:[{label:s?g(ka,19,"&&Save with Conflicts"):g(ka,20,"&&Save"),run:()=>Ku.SAVE},{label:g(ka,21,"Do&&n't Save"),run:()=>Ku.DONT_SAVE}],cancelButton:{run:()=>Ku.CANCEL}});return r}else if(s&&!this._storageService.getBoolean(n8e,ke.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(ka,22,"Do you want to close {0} merge editors?",e.length):g(ka,23,"Do you want to close the merge editor for {0}?",ui(e[0].resultUri)),detail:s?t?g(ka,24,"The files contain unhandled conflicts."):g(ka,25,"The file contains unhandled conflicts."):void 0,primaryButton:s?g(ka,26,"&&Close with Conflicts"):g(ka,27,"&&Close"),checkbox:{label:g(ka,28,"Do not ask me again")}});return r&&this._storageService.store(n8e,!0,ke.PROFILE,ln.USER),o?Ku.SAVE:Ku.CANCEL}else return Ku.SAVE}};Hke=D([_(4,To),_(5,on)],Hke);async function $se(n,e,t){const i=await e.createModelReference(n.uri);return t.add(i),{textModel:i.object.textEditorModel,title:n.title,description:n.description,detail:n.detail}}let Uke=class{constructor(e){this.telemetryService=e}reportMergeEditorOpened(e){this.telemetryService.publicLog2("mergeEditor.opened",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportLayoutChange(e){this.telemetryService.publicLog2("mergeEditor.layoutChanged",{baseVisible:e.baseVisible,isColumnView:e.isColumnView,baseTop:e.baseTop})}reportMergeEditorClosed(e){this.telemetryService.publicLog2("mergeEditor.closed",{conflictCount:e.conflictCount,combinableConflictCount:e.combinableConflictCount,durationOpenedSecs:e.durationOpenedSecs,remainingConflictCount:e.remainingConflictCount,accepted:e.accepted,conflictsResolvedWithBase:e.conflictsResolvedWithBase,conflictsResolvedWithInput1:e.conflictsResolvedWithInput1,conflictsResolvedWithInput2:e.conflictsResolvedWithInput2,conflictsResolvedWithSmartCombination:e.conflictsResolvedWithSmartCombination,manuallySolvedConflictCountThatEqualNone:e.manuallySolvedConflictCountThatEqualNone,manuallySolvedConflictCountThatEqualSmartCombine:e.manuallySolvedConflictCountThatEqualSmartCombine,manuallySolvedConflictCountThatEqualInput1:e.manuallySolvedConflictCountThatEqualInput1,manuallySolvedConflictCountThatEqualInput2:e.manuallySolvedConflictCountThatEqualInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBase:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBase,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1,manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart,manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart:e.manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart})}reportAcceptInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.accept",{otherAccepted:t,isInput1:e===1})}reportSmartCombinationInvoked(e){this.telemetryService.publicLog2("mergeEditor.action.smartCombination",{otherAccepted:e})}reportRemoveInvoked(e,t){this.telemetryService.publicLog2("mergeEditor.action.remove",{otherAccepted:t,isInput1:e===1})}reportResetToBaseInvoked(){this.telemetryService.publicLog2("mergeEditor.action.resetToBase",{})}reportNavigationToNextConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToNextConflict",{})}reportNavigationToPreviousConflict(){this.telemetryService.publicLog2("mergeEditor.action.goToPreviousConflict",{})}reportConflictCounterClicked(){this.telemetryService.publicLog2("mergeEditor.action.conflictCounterClicked",{})}};Uke=D([_(0,rn)],Uke);var $3;const Rjt="vs/workbench/contrib/mergeEditor/browser/mergeEditorInput";var WP;let Vke=(WP=class extends Ib{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(s,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=s,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{fw(()=>p.every(v=>v.editor instanceof $3));const m=p.map(v=>v.editor._inputModel).filter(yl);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?Oke:Wke,this._instaService.createInstance(Uke))}dispose(){super.dispose()}get typeId(){return $3.ID}get editorId(){return A_.id}get capabilities(){let e=super.capabilities|Mi.MultipleEditors;return this.useWorkingCopy&&(e|=Mi.Untitled),e}getName(){return g(Rjt,0,"Merging: {0}",super.getName())}async resolve(){if(!this._inputModel){const e=this._register(await this.mergeEditorModeFactory.createInputModel({base:this.base,input1:this.input1,input2:this.input2,result:this.result}));this._inputModel=e,this._register(Ni(t=>{e.isDirty.read(t),this._onDidChangeDirty.fire()})),await this._inputModel.model.onInitialized}return this._inputModel}async accept(){await this._inputModel?.accept()}async save(e,t){await this._inputModel?.save(t)}toUntyped(){return{input1:{resource:this.input1.uri,label:this.input1.title,description:this.input1.description,detail:this.input1.detail},input2:{resource:this.input2.uri,label:this.input2.title,description:this.input2.description,detail:this.input2.detail},base:{resource:this.base},result:{resource:this.result},options:{override:this.typeId}}}matches(e){return this===e?!0:e instanceof $3?_n(this.base,e.base)&&_n(this.input1.uri,e.input1.uri)&&_n(this.input2.uri,e.input2.uri)&&_n(this.result,e.result):Wb(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&_n(this.base,e.base.resource)&&_n(this.input1.uri,e.input1.resource)&&_n(this.input2.uri,e.input2.resource)&&_n(this.result,e.result.resource):!1}async revert(e,t){return this._inputModel?.revert(t)}isDirty(){return this._inputModel?.isDirty.get()??!1}setLanguageId(e,t){this._inputModel?.model.setLanguageId(e,t)}},$3=WP,WP.ID="mergeEditor.Input",WP);Vke=$3=D([_(4,be),_(5,_i),_(6,tr),_(7,eo),_(8,ci),_(9,Re),_(10,hh),_(11,dl),_(12,aD)],Vke);class Mjt{constructor(e){this._value=e,this.onHasValueDidChange=T.None}request(){return Promise.resolve(this._value)}get value(){return this._value}}const Njt="vs/workbench/contrib/multiDiffEditor/browser/icons.contribution",Pjt=Ki("multi-diff-editor-label-icon",Ce.diffMultiple,g(Njt,0,"Icon of the multi diff editor label."));class s8e{constructor(e,t){if(this.original=e,this.modified=t,!e&&!t)throw new cn("Invalid arguments")}getKey(){return JSON.stringify([this.modified?.toString(),this.original?.toString()])}}const Fjt="vs/workbench/services/editor/common/editorResolverService",Ojt=it.as(Cs.Configuration),Bjt={...PQ,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(Fjt,0,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};Ojt.registerConfiguration(Bjt);var Gse;(function(n){n.builtin="builtin",n.option="option",n.exclusive="exclusive",n.default="default"})(Gse||(Gse={}));var w8;(function(n){n[n.ABORT=1]="ABORT",n[n.NONE=2]="NONE"})(w8||(w8={}));function Wjt(n,e){if(new Set([_e.extension,_e.webviewPanel,_e.vscodeWorkspaceTrust,_e.vscodeSettings]).has(e.scheme))return!1;const s=typeof n=="string"&&n.indexOf(Qi.sep)>=0?`${e.scheme}:${e.path}`:ui(e);return WW(typeof n=="string"?n.toLowerCase():n,s.toLowerCase())}var PB;const o8e="vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput";var HP;let sH=(HP=class extends cC{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new cn("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??P.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(PB,i,e.label,e.resources?.map(s=>new s8e(s.original.resource,s.modified.resource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(PB,P.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new s8e(i.originalUri?P.parse(i.originalUri):void 0,i.modifiedUri?P.parse(i.modifiedUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Mi.Readonly}get typeId(){return PB.ID}getName(){return this._name}get editorId(){return A_.id}getIcon(){return Pjt}constructor(e,t,i,s=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=s,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new tut(async()=>{const d=await this._createModel();this._register(d);const h=new dZe(d,this._instantiationService);return this._register(h),await JQe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new N1t(async()=>{const d=this.initialResources?{resources:gQe.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?VJe(this,d.resources):Au([])}}),this.resources=Dt(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=yee(this,this.resources.map(d=>d??[]),d=>{const h=d.modified?r8e(this._textFileService,d.modified):Au(!1),u=d.original?r8e(this._textFileService,d.original):Au(!1);return Dt(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Dt(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=T.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return Ku.DONT_SAVE},showConfirm(){return!1}},this._register(Ni(d=>{const h=this.resources.read(d),u=this.label??g(o8e,0,"Multi Diff Editor");h?this._name=u+g(o8e,1," ({0} files)",h.length):this._name=u,this._onDidChangeLabel.fire()}))}serialize(){return{label:this.label,multiDiffSourceUri:this.multiDiffSource.toString(),resources:this.initialResources?.map(e=>({originalUri:e.original?.toString(),modifiedUri:e.modified?.toString()}))}}setLanguageId(e,t){const s=this._viewModel.requireValue().activeDiffItem.get()?.entry?.value;if(!s)return;const o=s.modified??s.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=new Z,s=yee(this,e.resources,async(l,d)=>{let h,u;const f=new Z;d.add(Ee(()=>{i.add(f)}));try{[h,u]=await Promise.all([l.original?this._textModelService.createModelReference(l.original):void 0,l.modified?this._textModelService.createModelReference(l.modified):void 0]),h&&f.add(h),u&&f.add(u)}catch(m){console.error(m),bt(m);return}const p=l.modified??l.original;return new Mjt({original:h?.object.textEditorModel,modified:u?.object.textEditorModel,get options(){return{...Hjt(u?.object.isReadonly()??!0),...Ujt(t.getValue(p))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(p,"editor")||v.affectsConfiguration(p,"diffEditor"))&&m()})})},l=>JSON.stringify([l.modified?.toString(),l.original?.toString()])),o=xi("documents",[]),r=Dt(async l=>{const d=s.read(l),u=(await Promise.all(d)).filter(yl);o.set(u,void 0),i.clear()}),a=Ez(r);return await r.get(),{dispose:()=>{a.dispose(),i.dispose()},documents:new LNe(o),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof PB?this.multiDiffSource.toString()===e.multiDiffSource.toString():!1}isDirty(){return this._isDirtyObservable.get()}async save(e,t){return await this.doSaveOrRevert("save",e,t),this}revert(e,t){return this.doSaveOrRevert("revert",e,t)}async doSaveOrRevert(e,t,i){const s=this._viewModel.currentValue?.items.get();s&&await Promise.all(s.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==_e.untitled&&this._textFileService.isDirty(r.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(r.original.uri,i):this._textFileService.revert(r.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(r.modified.uri,i):this._textFileService.revert(r.modified.uri,i)])}))}},PB=HP,HP.ID="workbench.input.multiDiffEditor",HP);sH=PB=D([_(4,Rn),_(5,dl),_(6,be),_(7,GZe),_(8,tr)],sH);function r8e(n,e){return Wn(T.filter(n.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>n.isDirty(e))}function Hjt(n){return{readOnly:!!n,readOnlyMessage:typeof n!="boolean"?n:void 0}}function Ujt(n){const e=Vs(n.editor);if(fo(n.diffEditor)){const t=Vs(n.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var qH;let a8e=(qH=class extends ${constructor(e,t){super(),this._register(e.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createMultiDiffEditorInput:i=>({editor:sH.fromResourceMultiDiffEditorInput(i,t)})}))}},qH.ID="workbench.contrib.multiDiffEditorResolver",qH);a8e=D([_(0,Pz),_(1,be)],a8e);var c8e;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.Up=2]="Up",n[n.Down=3]="Down"})(c8e||(c8e={}));var l8e;(function(n){n[n.Connecting=0]="Connecting",n[n.Connected=1]="Connected"})(l8e||(l8e={}));const d8e="terminalEditor";var h8e;(function(n){n[n.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(h8e||(h8e={}));var u8e;(function(n){n[n.Unknown=1]="Unknown",n[n.Fedora=2]="Fedora",n[n.Ubuntu=3]="Ubuntu"})(u8e||(u8e={}));var g8e;(function(n){n.Terminals="Terminals"})(g8e||(g8e={}));const uh="vs/workbench/contrib/terminal/common/terminalColorRegistry";B("terminal.background",null,g(uh,0,"The background color of the terminal, this allows coloring the terminal differently to the panel."));B("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(uh,1,"The foreground color of the terminal."));B("terminalCursor.foreground",null,g(uh,2,"The foreground color of the terminal cursor."));B("terminalCursor.background",null,g(uh,3,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const nY=B("terminal.selectionBackground",{light:Hv,dark:Hv,hcDark:Hv,hcLight:Hv},g(uh,4,"The selection background color of the terminal."));B("terminal.inactiveSelectionBackground",{light:Ie(nY,.5),dark:Ie(nY,.5),hcDark:Ie(nY,.7),hcLight:Ie(nY,.5)},g(uh,5,"The selection background color of the terminal when it does not have focus."));B("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(uh,6,"The selection foreground color of the terminal. When this is null the selection foreground will be retained and have the minimum contrast ratio feature applied."));B("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(uh,7,"The default terminal command decoration background color."));B("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(uh,8,"The terminal command decoration background color for successful commands."));B("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(uh,9,"The terminal command decoration background color for error commands."));B("terminalOverviewRuler.cursorForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},g(uh,10,"The overview ruler cursor color."));B("terminal.border",{dark:TE,light:TE,hcDark:TE,hcLight:TE},g(uh,11,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));B("terminal.findMatchBackground",{dark:lWe,light:lWe,hcDark:null,hcLight:"#0F4A85"},g(uh,12,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.hoverHighlightBackground",{dark:Ie(Vk,.5),light:Ie(Vk,.5),hcDark:Ie(Vk,.5),hcLight:Ie(Vk,.5)},g(uh,13,"Border color of the other search matches in the terminal."));B("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,14,"Border color of the current search match in the terminal."));B("terminal.findMatchHighlightBackground",{dark:Fb,light:Fb,hcDark:null,hcLight:null},g(uh,15,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);B("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,13,"Border color of the other search matches in the terminal."));B("terminalOverviewRuler.findMatchForeground",{dark:m$,light:m$,hcDark:"#f38518",hcLight:"#0F4A85"},g(uh,16,"Overview ruler marker color for find matches in the terminal."));B("terminal.dropBackground",{dark:qv,light:qv,hcDark:qv,hcLight:qv},g(uh,17,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);B("terminal.tab.activeBorder",{dark:a2,light:a2,hcDark:a2,hcLight:a2},g(uh,18,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));function Vjt(n){let e;if(typeof n=="string"?e=n:n.color?e=n.color.replace(/\./g,"_"):$e.isThemeIcon(n.icon)&&n.icon.color&&(e=n.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function zjt(n,e,t){const i=n.icon;if(!i)return;const s=[];let o;if(i instanceof P?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===sf.LIGHT?i.light:i.dark),o instanceof P){const a=`terminal-uri-icon-${Ed(o.path).toString(36)}`;s.push(a),s.push("terminal-uri-icon")}return s}var zke;(function(n){n.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",n.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",n.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",n.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",n.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})(zke||(zke={}));const $jt=[zke.FocusAccessibleBuffer];var qC;(function(n){n.FindFocus="workbench.action.terminal.focusFind",n.FindHide="workbench.action.terminal.hideFind",n.FindNext="workbench.action.terminal.findNext",n.FindPrevious="workbench.action.terminal.findPrevious",n.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",n.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",n.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",n.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(qC||(qC={}));const Gjt=[qC.FindFocus,qC.FindHide,qC.FindNext,qC.FindPrevious,qC.ToggleFindRegex,qC.ToggleFindWholeWord,qC.ToggleFindCaseSensitive,qC.SearchWorkspace];var nk;(function(n){n.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",n.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",n.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",n.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",n.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",n.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget"})(nk||(nk={}));const qjt=[nk.SelectPrevSuggestion,nk.SelectPrevPageSuggestion,nk.SelectNextSuggestion,nk.SelectNextPageSuggestion,nk.AcceptSelectedSuggestion,nk.HideSuggestWidget],ML="vs/workbench/contrib/terminal/common/terminal",Qjt="terminal";var f8e;(function(n){n[n.Uninitialized=1]="Uninitialized",n[n.Launching=2]="Launching",n[n.Running=3]="Running",n[n.KilledDuringLaunch=4]="KilledDuringLaunch",n[n.KilledByUser=5]="KilledByUser",n[n.KilledByProcess=6]="KilledByProcess"})(f8e||(f8e={}));var wn;(function(n){n.Toggle="workbench.action.terminal.toggleTerminal",n.Kill="workbench.action.terminal.kill",n.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",n.KillEditor="workbench.action.terminal.killEditor",n.KillActiveTab="workbench.action.terminal.killActiveTab",n.KillAll="workbench.action.terminal.killAll",n.QuickKill="workbench.action.terminal.quickKill",n.ConfigureTerminalSettings="workbench.action.terminal.openSettings",n.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",n.RunRecentCommand="workbench.action.terminal.runRecentCommand",n.CopyLastCommand="workbench.action.terminal.copyLastCommand",n.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",n.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",n.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",n.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",n.CopySelection="workbench.action.terminal.copySelection",n.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",n.SelectAll="workbench.action.terminal.selectAll",n.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",n.DeleteWordRight="workbench.action.terminal.deleteWordRight",n.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",n.MoveToLineStart="workbench.action.terminal.moveToLineStart",n.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",n.New="workbench.action.terminal.new",n.NewWithCwd="workbench.action.terminal.newWithCwd",n.NewLocal="workbench.action.terminal.newLocal",n.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",n.NewWithProfile="workbench.action.terminal.newWithProfile",n.Split="workbench.action.terminal.split",n.SplitActiveTab="workbench.action.terminal.splitActiveTab",n.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",n.Unsplit="workbench.action.terminal.unsplit",n.JoinActiveTab="workbench.action.terminal.joinActiveTab",n.Join="workbench.action.terminal.join",n.Relaunch="workbench.action.terminal.relaunch",n.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",n.CreateTerminalEditor="workbench.action.createTerminalEditor",n.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",n.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",n.FocusTabs="workbench.action.terminal.focusTabs",n.FocusNextPane="workbench.action.terminal.focusNextPane",n.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",n.ResizePaneRight="workbench.action.terminal.resizePaneRight",n.ResizePaneUp="workbench.action.terminal.resizePaneUp",n.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",n.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",n.ResizePaneDown="workbench.action.terminal.resizePaneDown",n.Focus="workbench.action.terminal.focus",n.FocusNext="workbench.action.terminal.focusNext",n.FocusPrevious="workbench.action.terminal.focusPrevious",n.Paste="workbench.action.terminal.paste",n.PasteSelection="workbench.action.terminal.pasteSelection",n.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",n.RunSelectedText="workbench.action.terminal.runSelectedText",n.RunActiveFile="workbench.action.terminal.runActiveFile",n.SwitchTerminal="workbench.action.terminal.switchTerminal",n.ScrollDownLine="workbench.action.terminal.scrollDown",n.ScrollDownPage="workbench.action.terminal.scrollDownPage",n.ScrollToBottom="workbench.action.terminal.scrollToBottom",n.ScrollUpLine="workbench.action.terminal.scrollUp",n.ScrollUpPage="workbench.action.terminal.scrollUpPage",n.ScrollToTop="workbench.action.terminal.scrollToTop",n.Clear="workbench.action.terminal.clear",n.ClearSelection="workbench.action.terminal.clearSelection",n.ChangeIcon="workbench.action.terminal.changeIcon",n.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",n.ChangeColor="workbench.action.terminal.changeColor",n.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",n.Rename="workbench.action.terminal.rename",n.RenameActiveTab="workbench.action.terminal.renameActiveTab",n.RenameWithArgs="workbench.action.terminal.renameWithArg",n.QuickOpenTerm="workbench.action.quickOpenTerm",n.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",n.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",n.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",n.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",n.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",n.SelectToNextLine="workbench.action.terminal.selectToNextLine",n.SendSequence="workbench.action.terminal.sendSequence",n.AttachToSession="workbench.action.terminal.attachToSession",n.DetachSession="workbench.action.terminal.detachSession",n.MoveToEditor="workbench.action.terminal.moveToEditor",n.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",n.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",n.SetDimensions="workbench.action.terminal.setDimensions",n.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",n.FocusHover="workbench.action.terminal.focusHover",n.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",n.StartVoice="workbench.action.terminal.startVoice",n.StopVoice="workbench.action.terminal.stopVoice"})(wn||(wn={}));[wn.ClearSelection,wn.Clear,wn.CopyAndClearSelection,wn.CopySelection,wn.CopySelectionAsHtml,wn.CopyLastCommand,wn.CopyLastCommandOutput,wn.CopyLastCommandAndLastCommandOutput,wn.DeleteToLineStart,wn.DeleteWordLeft,wn.DeleteWordRight,wn.GoToRecentDirectory,wn.FocusNextPane,wn.FocusNext,wn.FocusPreviousPane,wn.FocusPrevious,wn.Focus,wn.SizeToContentWidth,wn.Kill,wn.KillEditor,wn.MoveToEditor,wn.MoveToLineEnd,wn.MoveToLineStart,wn.MoveToTerminalPanel,wn.NewInActiveWorkspace,wn.New,wn.Paste,wn.PasteSelection,wn.ResizePaneDown,wn.ResizePaneLeft,wn.ResizePaneRight,wn.ResizePaneUp,wn.RunActiveFile,wn.RunSelectedText,wn.RunRecentCommand,wn.ScrollDownLine,wn.ScrollDownPage,wn.ScrollToBottom,wn.ScrollToNextCommand,wn.ScrollToPreviousCommand,wn.ScrollToTop,wn.ScrollUpLine,wn.ScrollUpPage,wn.SendSequence,wn.SelectAll,wn.SelectToNextCommand,wn.SelectToNextLine,wn.SelectToPreviousCommand,wn.SelectToPreviousLine,wn.SplitInActiveWorkspace,wn.Split,wn.Toggle,wn.FocusHover,Ru.OpenAccessibilityHelp,...$jt,...Gjt,...qjt];g(ML,0,"Contributes terminal functionality."),g(ML,1,"Defines additional terminal profiles that the user can create."),g(ML,2,"The ID of the terminal profile provider."),g(ML,3,"Title for this terminal profile."),g(ML,4,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(ML,5,"Icon path when a light theme is used"),g(ML,6,"Icon path when a dark theme is used");const xg="vs/workbench/contrib/terminal/common/terminalContextKey";var Lr;(function(n){n.IsOpen="terminalIsOpen",n.Count="terminalCount",n.GroupCount="terminalGroupCount",n.TabsNarrow="isTerminalTabsNarrow",n.HasFixedWidth="terminalHasFixedWidth",n.ProcessSupported="terminalProcessSupported",n.Focus="terminalFocus",n.FocusInAny="terminalFocusInAny",n.AccessibleBufferFocus="terminalAccessibleBufferFocus",n.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",n.EditorFocus="terminalEditorFocus",n.TabsFocus="terminalTabsFocus",n.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",n.TerminalHasBeenCreated="terminalHasBeenCreated",n.TerminalEditorActive="terminalEditorActive",n.TabsMouse="terminalTabsMouse",n.AltBufferActive="terminalAltBufferActive",n.SuggestWidgetVisible="terminalSuggestWidgetVisible",n.A11yTreeFocus="terminalA11yTreeFocus",n.ViewShowing="terminalViewShowing",n.TextSelected="terminalTextSelected",n.TextSelectedInFocused="terminalTextSelectedInFocused",n.FindVisible="terminalFindVisible",n.FindInputFocused="terminalFindInputFocused",n.FindFocused="terminalFindFocused",n.TabsSingularSelection="terminalTabsSingularSelection",n.SplitTerminal="terminalSplitTerminal",n.ShellType="terminalShellType",n.InTerminalRunCommandPicker="inTerminalRunCommandPicker",n.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(Lr||(Lr={}));var $ke;(function(n){n.isOpen=new Y(Lr.IsOpen,!1,!0),n.focus=new Y(Lr.Focus,!1,g(xg,0,"Whether the terminal is focused.")),n.focusInAny=new Y(Lr.FocusInAny,!1,g(xg,1,"Whether any terminal is focused, including detached terminals used in other UI.")),n.editorFocus=new Y(Lr.EditorFocus,!1,g(xg,2,"Whether a terminal in the editor area is focused.")),n.count=new Y(Lr.Count,0,g(xg,3,"The current number of terminals.")),n.groupCount=new Y(Lr.GroupCount,0,!0),n.tabsNarrow=new Y(Lr.TabsNarrow,!1,!0),n.terminalHasFixedWidth=new Y(Lr.HasFixedWidth,!1,!0),n.tabsFocus=new Y(Lr.TabsFocus,!1,g(xg,4,"Whether the terminal tabs widget is focused.")),n.webExtensionContributedProfile=new Y(Lr.WebExtensionContributedProfile,!1,!0),n.terminalHasBeenCreated=new Y(Lr.TerminalHasBeenCreated,!1,!0),n.terminalEditorActive=new Y(Lr.TerminalEditorActive,!1,!0),n.tabsMouse=new Y(Lr.TabsMouse,!1,!0),n.shellType=new Y(Lr.ShellType,void 0,{type:"string",description:g(xg,5,"The shell type of the active terminal, this is set to the last known value when no terminals exist.")}),n.altBufferActive=new Y(Lr.AltBufferActive,!1,g(xg,6,"Whether the terminal's alt buffer is active.")),n.suggestWidgetVisible=new Y(Lr.SuggestWidgetVisible,!1,g(xg,7,"Whether the terminal's suggest widget is visible.")),n.notFocus=n.focus.toNegated(),n.viewShowing=new Y(Lr.ViewShowing,!1,g(xg,8,"Whether the terminal view is showing")),n.textSelected=new Y(Lr.TextSelected,!1,g(xg,9,"Whether text is selected in the active terminal.")),n.textSelectedInFocused=new Y(Lr.TextSelectedInFocused,!1,g(xg,10,"Whether text is selected in a focused terminal.")),n.notTextSelected=n.textSelected.toNegated(),n.findVisible=new Y(Lr.FindVisible,!1,!0),n.notFindVisible=n.findVisible.toNegated(),n.findInputFocus=new Y(Lr.FindInputFocused,!1,!0),n.findFocus=new Y(Lr.FindFocused,!1,!0),n.notFindFocus=n.findInputFocus.toNegated(),n.processSupported=new Y(Lr.ProcessSupported,!1,g(xg,11,"Whether terminal processes can be launched in the current workspace.")),n.tabsSingularSelection=new Y(Lr.TabsSingularSelection,!1,g(xg,12,"Whether one terminal is selected in the terminal tabs list.")),n.splitTerminal=new Y(Lr.SplitTerminal,!1,g(xg,13,"Whether the focused tab's terminal is a split terminal.")),n.inTerminalRunCommandPicker=new Y(Lr.InTerminalRunCommandPicker,!1,g(xg,14,"Whether the terminal run command picker is currently open.")),n.terminalShellIntegrationEnabled=new Y(Lr.TerminalShellIntegrationEnabled,!1,g(xg,15,"Whether shell integration is enabled in the active terminal")),n.shouldShowViewInlineActions=ge.and(ge.equals("view",Qjt),ge.notEquals(`config.${_y.TabsHideCondition}`,"never"),ge.or(ge.not(`config.${_y.TabsEnabled}`),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminal"),ge.equals(Lr.GroupCount,1)),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleTerminalOrNarrow"),ge.or(ge.equals(Lr.GroupCount,1),ge.has(Lr.TabsNarrow))),ge.and(ge.equals(`config.${_y.TabsShowActions}`,"singleGroup"),ge.equals(Lr.GroupCount,1)),ge.equals(`config.${_y.TabsShowActions}`,"always")))})($ke||($ke={}));var TX;const sY="vs/workbench/contrib/terminal/browser/terminalEditorInput";var UP;let Gke=(UP=class extends cC{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return TX.ID}get editorId(){return d8e}get capabilities(){return Mi.Readonly|Mi.Singleton|Mi.CanDropIntoEditor|Mi.ForceDescription}setTerminalInstance(e){if(this._terminalInstance)throw new Error("cannot set instance that has already been set");this._terminalInstance=e,this._setupInstanceListeners()}copy(){const e=this._terminalInstanceService.createInstance(this._copyLaunchConfig||{},fV.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(TX,e.resource,e)}setCopyLaunchConfig(e){this._copyLaunchConfig=e}get terminalInstance(){return this._isDetached?void 0:this._terminalInstance}showConfirm(){if(this._isReverted)return!1;const e=this._configurationService.getValue(_y.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:nt.Warning,message:g(sY,0,"Do you want to terminate running processes?"),primaryButton:g(sY,1,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` `)+` -`+g(sY,2,"Closing will terminate the running processes in the terminals."):g(sY,3,"Closing will terminate the running processes in this terminal.")});return t?Ku.DONT_SAVE:Ku.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,s,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=s,this._instantiationService=o,this._configurationService=r,this._lifecycleService=a,this._contextKeyService=c,this._dialogService=l,this.closeHandler=this,this._isDetached=!1,this._isShuttingDown=!1,this._isReverted=!1,this._onDidRequestAttach=this._register(new I),this.onDidRequestAttach=this._onDidRequestAttach.event,this._terminalEditorFocusContextKey=$ke.editorFocus.bindTo(c),t&&this._setupInstanceListeners()}_setupInstanceListeners(){const e=this._terminalInstance;if(!e)return;const t=e.onDidFocus(()=>this._terminalEditorFocusContextKey.set(!0)),i=e.onDidBlur(()=>this._terminalEditorFocusContextKey.reset());this._register(Ee(()=>{!this._isDetached&&!this._isShuttingDown&&e.dispose(vM.User),St([t,i])}));const s=[e.onExit(o=>{e.waitOnExit||this.dispose()}),e.onDisposed(()=>this.dispose()),e.onTitleChanged(()=>this._onDidChangeLabel.fire()),e.onIconChanged(()=>this._onDidChangeLabel.fire()),t,i,e.statusList.onDidChangePrimaryStatus(()=>this._onDidChangeLabel.fire())];this._lifecycleService.onWillShutdown(o=>{this._isShuttingDown=!0,St(s),this._configurationService.getValue(_y.EnablePersistentSessions)&&o.reason===PI.RELOAD?e.detachProcessAndDispose(vM.Shutdown):e.dispose(vM.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!$e.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=Vjt(this._terminalInstance);t&&e.push(t);const i=zjt(this._terminalInstance,this._themeService.getColorTheme().type);return i&&e.push(...i),e}detachInstance(){this._isShuttingDown||(this._terminalInstance?.detachFromElement(),this._terminalInstance?.setParentContextKeyService(this._contextKeyService),this._isDetached=!0)}getDescription(){return this._terminalInstance?.description}toUntyped(){return{resource:this.resource,options:{override:d8e,pinned:!0,forceReload:!0}}}},TX=UP,UP.ID="workbench.editors.terminal",UP);Gke=TX=D([_(2,pn),_(3,eet),_(4,be),_(5,Re),_(6,mg),_(7,Pe),_(8,To)],Gke);let p8e=class{constructor(e,t,i,s,o){this._editorGroupsService=t,this._configurationService=i,this._logService=s,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new Zo,this._proxy=e.getProxy(et.ExtHostEditorTabs),this._dispoables.add(o.onDidEditorsChange(r=>{try{this._updateTabsModel(r)}catch{this._logService.error("Failed to update model, rebuilding"),this._createTabsModel()}})),this._dispoables.add(this._multiDiffEditorInputListeners),this._dispoables.add(this._editorGroupsService.onDidAddGroup(()=>this._createTabsModel())),this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(()=>this._createTabsModel())),this._editorGroupsService.whenReady.then(()=>this._createTabsModel())}dispose(){this._groupLookup.clear(),this._tabInfoLookup.clear(),this._dispoables.dispose()}_buildTabObject(e,t,i){const s=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:s,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof Vke)return{kind:Fa.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof Ib)return{kind:Fa.TextInput,uri:e.resource};if(e instanceof mm&&!(e instanceof op)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof Ib&&e.secondary instanceof Ib&&_n(t,i)&&t&&i?{kind:Fa.TextInput,uri:t}:{kind:Fa.UnknownInput}}if(e instanceof VM)return{kind:Fa.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof nH)return{kind:Fa.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Qg)return{kind:Fa.WebviewEditorInput,viewType:e.viewType};if(e instanceof Gke)return{kind:Fa.TerminalEditorInput};if(e instanceof op){if(e.modified instanceof Ib&&e.original instanceof Ib)return{kind:Fa.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof VM&&e.original instanceof VM)return{kind:Fa.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof Nke)return{kind:Fa.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof uEe)return{kind:Fa.ChatEditorInput};if(e instanceof sH){const t=[];for(const i of e?.resources.get()??[])i.original&&i.modified&&t.push({kind:Fa.TextDiffInput,original:i.original,modified:i.modified});return{kind:Fa.MultiDiffEditorInput,diffEditors:t}}return{kind:Fa.UnknownInput}}_generateTabId(e,t){let i;const s=Qc.getCanonicalUri(e,{supportSideBySide:go.BOTH});return s instanceof P?i=s.toString():i=`${s?.primary?.toString()}-${s?.secondary?.toString()}`,`${t}~${e.editorId}-${e.typeId}-${i} `}_onDidGroupActivate(){const e=this._editorGroupsService.activeGroup.id,t=this._groupLookup.get(e);t&&(t.isActive=!0,this._proxy.$acceptTabGroupUpdate(t))}_onDidTabLabelChange(e,t,i){const s=this._generateTabId(t,e),o=this._tabInfoLookup.get(s);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:gu.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const s=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!s||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(s,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:s,editorInput:t,tab:a}),t instanceof sH&&this._multiDiffEditorInputListeners.set(t,T.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(s,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:gu.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:gu.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),s=this._groupLookup.get(e)?.tabs;if(!i||!s){this._createTabsModel();return}const o=s.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof sH&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:gu.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const s=i[t];s.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:s,kind:gu.TAB_UPDATE})}_onDidTabDirty(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s);if(!o){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}o.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o.tab,kind:gu.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=r.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:gu.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!r.isPinned(t),this._proxy.$acceptTabOperation({kind:gu.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,s){const o=this._groupLookup.get(e)?.tabs;if(!o){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const r=o.splice(i,1);r.length!==0&&(o.splice(t,0,r[0]),this._proxy.$acceptTabOperation({kind:gu.TAB_MOVE,groupId:e,tabDto:r[0],index:t,oldIndex:i}))}_createTabsModel(){if(this._editorGroupsService.groups.length===0)return;this._tabGroupModel=[],this._groupLookup.clear(),this._tabInfoLookup.clear();let e=[];for(const t of this._editorGroupsService.groups){const i={groupId:t.id,isActive:t.id===this._editorGroupsService.activeGroup.id,viewColumn:U1(this._editorGroupsService,t),tabs:[]};t.editors.forEach((s,o)=>{const r=this._buildTabObject(t,s,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(s,t.id),{group:t,tab:r,editorInput:s})}),i.tabs=e,this._tabGroupModel.push(i),this._groupLookup.set(t.id,i),e=[]}this._proxy.$acceptEditorTabModel(this._tabGroupModel)}_updateTabsModel(e){const t=e.event,i=e.groupId;switch(t.kind){case qo.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case qo.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case qo.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case qo.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case qo.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case qo.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case qo.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_TRANSIENT:break;case qo.EDITOR_MOVE:if(pjt(t)&&t.editor&&t.editorIndex!==void 0&&t.oldEditorIndex!==void 0){this._onDidTabMove(i,t.editorIndex,t.oldEditorIndex,t.editor);break}default:this._createTabsModel()}}$moveTab(e,t,i,s){const o=ane(this._editorGroupsService,this._configurationService,i),r=this._tabInfoLookup.get(e);if(!r?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(r.group.id);if(!l)return;if(this._groupLookup.get(o)===void 0){let h=v6.RIGHT;i===Cw&&(h=w6(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(o);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=r?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:s})}async $closeTab(e,t){const i=new Map;for(const o of e){const r=this._tabInfoLookup.get(o),a=r?.tab,c=r?.group,l=r?.editorInput;if(!c||!a||!r||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const s=[];for(const[o,r]of i)s.push(await o.closeEditors(r,{preserveFocus:t}));return s.every(o=>o)}async $closeGroup(e,t){const i=[];for(const s of e){const o=this._editorGroupsService.getGroup(s);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(s=>s)}};p8e=D([Zi(Ue.MainThreadEditorTabs),_(1,ur),_(2,Re),_(3,Ze),_(4,_i)],p8e);let m8e=class{dispose(){}$onUnexpectedError(e){if(e&&e.$isError){const{name:t,message:i,stack:s}=e;e=e.noTelemetry?new hc:new Error,e.message=i,e.name=t,e.stack=s}bt(e)}};m8e=D([Zi(Ue.MainThreadErrors)],m8e);const Uw="vs/workbench/api/browser/mainThreadExtensionService";let _8e=class{constructor(e,t,i,s,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=s,this._hostService=o,this._extensionEnablementService=r,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new jjt(e.getProxy(et.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Ue).map(h=>Ue[h]))}dispose(){}$getExtension(e){return this._extensionService.getExtension(e)}$activateExtension(e,t){return this._internalExtensionService._activateById(e,t)}async $onWillActivateExtension(e){this._internalExtensionService._onWillActivateExtension(e)}$onDidActivateExtension(e,t,i,s,o){this._internalExtensionService._onDidActivateExtension(e,t,i,s,o)}$onExtensionRuntimeError(e,t){const i=new Error;i.name=t.name,i.message=t.message,i.stack=t.stack,this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const s=new Error;if(s.name=t.name,s.message=t.message,s.stack=t.stack,this._internalExtensionService._onDidActivateExtensionError(e,s),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>uc(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(r,c.local);return}else{await this._handleMissingNotInstalledDependency(r,i.dependency);return}}}if(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment){this._notificationService.error(s);return}console.error(s.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:nt.Error,message:g(Uw,0,"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("reload",g(Uw,1,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const s=this._extensionEnablementService.getEnablementState(t);s===ga.DisabledByVirtualWorkspace?this._notificationService.notify({severity:nt.Error,message:g(Uw,2,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",i,t.manifest.displayName||t.manifest.name)}):s===ga.DisabledByTrustRequirement?this._notificationService.notify({severity:nt.Error,message:g(Uw,3,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("manageWorkspaceTrust",g(Uw,4,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:nt.Error,message:g(Uw,5,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("enable",g(Uw,6,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],s===ga.DisabledGlobally?ga.EnabledGlobally:ga.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:nt.Error,message:g(Uw,7,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",i,t.manifest.displayName||t.manifest.name)})}}async _handleMissingNotInstalledDependency(e,t){const i=e.displayName||e.name;let s=null;try{s=(await this._extensionsWorkbenchService.getExtensions([{id:t}],qe.None))[0]}catch{}s?this._notificationService.notify({severity:nt.Error,message:g(Uw,8,"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",i,s.displayName,s.publisherDisplayName),actions:{primary:[new xn("install",g(Uw,9,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(s).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(Uw,10,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===Ao.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===Ao.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return lp.uriToBrowserUri(P.revive(e))}async $getAllStaticBrowserUris(){return Array.from(lp.getRegisteredBrowserUris(),e=>[e,lp.uriToBrowserUri(e)])}};_8e=D([Zi(Ue.MainThreadExtensionService),_(1,ho),_(2,Pi),_(3,pr),_(4,Id),_(5,Kh),_(6,Det),_(7,Qi),_(8,Za)],_8e);class jjt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Kjt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&P.revive(i)}startExtensionHost(e){return this._actual.$startExtensionHost(e)}extensionTestsExecute(){return this._actual.$extensionTestsExecute()}activateByEvent(e,t){return this._actual.$activateByEvent(e,t)}activate(e,t){return this._actual.$activate(e,t)}setRemoteEnvironment(e){return this._actual.$setRemoteEnvironment(e)}updateRemoteConnectionData(e){return this._actual.$updateRemoteConnectionData(e)}deltaExtensions(e){return this._actual.$deltaExtensions(e)}test_latency(e){return this._actual.$test_latency(e)}test_up(e){return this._actual.$test_up(e)}test_down(e){return this._actual.$test_down(e)}}function Kjt(n){return n.type==="ok"?{type:"ok",value:{...n.value,authority:Yjt(n.value.authority)}}:n}function Yjt(n){return{...n,connectTo:Jjt(n.connectTo)}}function Jjt(n){return n.type===KV.WebSocket?new Vst(n.host,n.port):new Ust(n.id)}var Z_;let v8e=Z_=class{constructor(e,t){this._fileService=t,this._fileProvider=new Zo,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostFileSystem);const i=e.getProxy(et.ExtHostFileSystemInfo);for(const s of t.listCapabilities())i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,s){this._fileProvider.set(e,new DOe(this._fileService,t,i,s,e,this._proxy))}$unregisterProvider(e){this._fileProvider.deleteAndDispose(e)}$onFileSystemChange(e,t){const i=this._fileProvider.get(e);if(!i)throw new Error("Unknown file provider");i.$onFileSystemChange(t)}$stat(e){return this._fileService.stat(P.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?vm.Readonly:void 0,type:Z_._asFileType(t)})).catch(Z_._handleError)}$readdir(e){return this._fileService.resolve(P.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=rt.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Z_._asFileType(i)]):[]}).catch(Z_._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=an.File:e.isDirectory&&(t+=an.Directory),e.isSymbolicLink&&(t+=an.SymbolicLink),t}$readFile(e){return this._fileService.readFile(P.revive(e)).then(t=>t.value).catch(Z_._handleError)}$writeFile(e,t){return this._fileService.writeFile(P.revive(e),t).then(()=>{}).catch(Z_._handleError)}$rename(e,t,i){return this._fileService.move(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$copy(e,t,i){return this._fileService.copy(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$mkdir(e){return this._fileService.createFolder(P.revive(e)).then(()=>{}).catch(Z_._handleError)}$delete(e,t){return this._fileService.del(P.revive(e),t).catch(Z_._handleError)}static _handleError(e){if(e instanceof Ah)switch(e.fileOperationResult){case Xi.FILE_NOT_FOUND:e.name=rt.FileNotFound;break;case Xi.FILE_IS_DIRECTORY:e.name=rt.FileIsADirectory;break;case Xi.FILE_PERMISSION_DENIED:e.name=rt.NoPermissions;break;case Xi.FILE_MOVE_CONFLICT:e.name=rt.FileExists;break}else if(e instanceof Error){const t=w1(e);t!==rt.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};v8e=Z_=D([Zi(Ue.MainThreadFileSystem),_(1,ci)],v8e);class DOe{constructor(e,t,i,s,o,r){this.readOnlyMessage=s,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=T.None,this.capabilities=i,this._registration=e.registerProvider(t,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(e,t){const i=Math.random();return this._proxy.$watch(this._handle,i,e,t),Ee(()=>{this._proxy.$unwatch(this._handle,i)})}$onFileSystemChange(e){this._onDidChange.fire(e.map(DOe._createFileChange))}static _createFileChange(e){return{resource:P.revive(e.resource),type:e.type}}stat(e){return this._proxy.$stat(this._handle,e).then(void 0,t=>{throw t})}readFile(e){return this._proxy.$readFile(this._handle,e).then(t=>t.buffer)}writeFile(e,t,i){return this._proxy.$writeFile(this._handle,e,ze.wrap(t),i)}delete(e,t){return this._proxy.$delete(this._handle,e,t)}mkdir(e){return this._proxy.$mkdir(this._handle,e)}readdir(e){return this._proxy.$readdir(this._handle,e)}rename(e,t,i){return this._proxy.$rename(this._handle,e,t,i)}copy(e,t,i){return this._proxy.$copy(this._handle,e,t,i)}open(e,t){return this._proxy.$open(this._handle,e,t)}close(e){return this._proxy.$close(this._handle,e)}read(e,t,i,s,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,s),r.byteLength))}write(e,t,i,s,o){return this._proxy.$write(this._handle,e,t,ze.wrap(i).slice(s,s+o))}}const fW=class fW extends ${constructor(e,t,i,s){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=s,this.watcherDisposables=this._register(new Dn),this.requests=void 0,this.restartsPerRequestError=new Map,this.restartsPerUnknownError=0}init(){const e=new Z;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){if(this.options.restartOnError&&this.requests?.length)if(t){const i=this.restartsPerRequestError.get(t.path)??0;is.path!==t.path)))}else this.restartsPerUnknownError{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,w,b,C,y){if(b?.isUndoing)return;const S=new ai(y),M=setTimeout(()=>S.cancel(),C),k=await o.withProgress({location:ch.Notification,title:this._progressLabel(w),cancellable:!0,delay:Math.min(C/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(w,v,C,S.token);return dw(z,S.token)},()=>{S.cancel()}).finally(()=>{S.dispose(),clearTimeout(M)});if(!k||k.edit.edits.length===0)return;const F=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let N=a.getBoolean(RX.MementoKeyAdditionalEdits,ke.PROFILE);if(l.extensionTestsLocationURI&&(N=!1),N===void 0){let z;if(k.extensionNames.length===1?w===Li.CREATE?z=g(Rd,0,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):w===Li.COPY?z=g(Rd,1,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):w===Li.MOVE?z=g(Rd,2,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(Rd,3,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):w===Li.CREATE?z=g(Rd,4,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):w===Li.COPY?z=g(Rd,5,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):w===Li.MOVE?z=g(Rd,6,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(Rd,7,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),F){const{confirmed:U}=await r.confirm({type:nt.Info,message:z,primaryButton:g(Rd,8,"Show &&Preview"),cancelButton:g(Rd,9,"Skip Changes")});if(N=!0,!U)return}else{let U;(function(re){re[re.OK=0]="OK",re[re.Preview=1]="Preview",re[re.Cancel=2]="Cancel"})(U||(U={}));const{result:J,checkboxChecked:j}=await r.prompt({type:nt.Info,message:z,buttons:[{label:g(Rd,10,"&&OK"),run:()=>U.OK},{label:g(Rd,8,"Show &&Preview"),run:()=>U.Preview}],cancelButton:{label:g(Rd,9,"Skip Changes"),run:()=>U.Cancel},checkbox:{label:g(Rd,11,"Do not ask me again")}});if(J===U.Cancel)return;N=J===U.Preview,j&&a.store(RX.MementoKeyAdditionalEdits,N,ke.PROFILE,ln.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await s.apply(AS(k.edit,d),{undoRedoGroupId:b?.undoRedoGroupId,showPreview:N})}_progressLabel(v){switch(v){case Li.CREATE:return g(Rd,12,"Running 'File Create' participants...");case Li.MOVE:return g(Rd,13,"Running 'File Rename' participants...");case Li.COPY:return g(Rd,14,"Running 'File Copy' participants...");case Li.DELETE:return g(Rd,15,"Running 'File Delete' participants...");case Li.WRITE:return g(Rd,16,"Running 'File Write' participants...")}}};this._listener.add(i.addFileOperationParticipant(m)),this._listener.add(i.onDidRunWorkingCopyFileOperation(v=>this._proxy.$onDidRunFileOperation(v.operation,v.files)))}async $watch(e,t,i,s,o){const r=P.revive(i),a={...s};if(a.recursive)try{(await this._fileService.stat(r)).isDirectory||(a.recursive=!1)}catch{}if(o){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(r,a));c.add(l.onDidChange(d=>{this._proxy.$onFileEvent({session:t,created:d.rawAdded,changed:d.rawUpdated,deleted:d.rawDeleted})})),this._watches.set(t,c)}else{this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(r);if(a.recursive&&a.excludes.length===0){const d=this._configurationService.getValue();if(d.files?.watcherExclude)for(const h in d.files.watcherExclude)h&&d.files.watcherExclude[h]===!0&&a.excludes.push(h)}else if(!a.recursive&&c){const d=this._configurationService.getValue();if(d.files?.watcherExclude){for(const h in d.files.watcherExclude)if(h&&d.files.watcherExclude[h]===!0){a.includes||(a.includes=[]);const u=`${IS(h,"/")}/${mR}`;a.includes.push(Xjt(c.uri.fsPath,u))}}if(!a.includes||a.includes.length===0){this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(r,a);this._watches.set(t,l)}}$unwatch(e){this._watches.has(e)&&(this._logService.trace(`MainThreadFileSystemEventService#$unwatch(): request to stop watching (session: ${e})`),this._watches.deleteAndDispose(e))}dispose(){this._listener.dispose(),this._watches.dispose()}},RX=VP,VP.MementoKeyAdditionalEdits="file.particpants.additionalEdits",VP);qke=RX=D([Zi(Ue.MainThreadFileSystemEventService),_(1,ci),_(2,fC),_(3,vO),_(4,Cf),_(5,To),_(6,sn),_(7,Ze),_(8,Il),_(9,_o),_(10,Ti),_(11,Ze),_(12,Re)],qke);At(class extends pi{constructor(){super({id:"files.participants.resetChoice",title:{value:g(Rd,17,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get(sn).remove(qke.MementoKeyAdditionalEdits,ke.PROFILE)}});const Bf=Symbol("unset");class qse{constructor(){this.root=new Jpe,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||fi.empty()}insert(e,t,i){this.opNode(e,s=>s._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===Bf?void 0:i._value))}mutatePath(e,t){this.opNode(e,()=>{},i=>t(i))}delete(e){const t=this.getPathToKey(e);if(!t)return;let i=t.length-1;const s=t[i].node._value;if(s!==Bf){for(this._size--,t[i].node._value=Bf;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==Bf)break;t[i-1].node.children.delete(r)}return s}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let s=t.length-1;s>0;s--){const o=t[s-1];if(o.node.children.delete(t[s].part),o.node.children.size>0||o.node._value!==Bf)break}for(const s of b8e(i))s._value!==Bf&&(this._size--,yield s._value)}find(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return;t=s}return t._value===Bf?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;if(s._value!==Bf)return!0;t=s}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return!0}hasKey(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return t._value!==Bf}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const s of e){const o=t[i].node.children?.get(s);if(!o)return;t.push({part:s,node:o}),i++}return t}opNode(e,t,i){let s=this.root;for(const a of e){if(s.children)if(s.children.has(a))s=s.children.get(a);else{const c=new Jpe;s.children.set(a,c),s=c}else{const c=new Jpe;s.children=new Map([[a,c]]),s=c}i?.(s)}const o=s._value===Bf?0:1;t(s);const r=s._value===Bf?0:1;this._size+=r-o}*values(){for(const{_value:e}of b8e(this.root))e!==Bf&&(yield e)}}function*b8e(n){const e=[n];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Jpe=class{constructor(){this._value=Bf}get value(){return this._value===Bf?void 0:this._value}set value(e){this._value=e===void 0?Bf:e}};var qf;(function(n){n.Delimiter="\0"})(qf||(qf={}));var lb;(function(n){n[n.IsSame=0]="IsSame",n[n.Disconnected=1]="Disconnected",n[n.IsChild=2]="IsChild",n[n.IsParent=3]="IsParent"})(lb||(lb={}));class bn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new bn([t]);const s=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)s.push(o.id);return s.push(t),new bn(s.reverse())}static isRoot(e){return!e.includes(qf.Delimiter)}static root(e){const t=e.indexOf(qf.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new bn(e.split(qf.Delimiter))}static join(e,t){return new bn([...e.path,t])}static joinToString(e,t){return e.toString()+qf.Delimiter+t}static parentId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?e:e.slice(t+qf.Delimiter.length)}static isChild(e,t){return t.startsWith(e)&&t[e.length]===qf.Delimiter}static compare(e,t){return e===t?lb.IsSame:bn.isChild(e,t)?lb.IsChild:bn.isChild(t,e)?lb.IsParent:lb.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new bn(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 e=1;e<=this.viewEnd;e++)yield new bn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new bn(this.path,e)}compare(e){if(typeof e=="string")return bn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?lb.IsChild:e.viewEnd"runId"in n;var A4;(function(n){n.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({range:O.lift(t.range),uri:e.asCanonicalUri(P.revive(t.uri))})})(A4||(A4={}));var dC;(function(n){n[n.Error=0]="Error",n[n.Output=1]="Output"})(dC||(dC={}));var Qse;(function(n){n.serialize=e=>({message:e.message,type:dC.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&A4.deserialize(e,t.location)})})(Qse||(Qse={}));const eKt=(n,e)=>`${e?"s":"e"}${n}`;var jse;(function(n){n.serialize=e=>({message:e.message,type:dC.Output,offset:e.offset,length:e.length,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Output,offset:t.offset,length:t.length,location:t.location&&A4.deserialize(e,t.location)})})(jse||(jse={}));var yG;(function(n){n.serialize=e=>e.type===dC.Error?Qse.serialize(e):jse.serialize(e),n.deserialize=(e,t)=>t.type===dC.Error?Qse.deserialize(e,t):jse.deserialize(e,t)})(yG||(yG={}));var b8;(function(n){n.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),n.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(yG.serialize)}),n.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>yG.deserialize(e,i))})})(b8||(b8={}));const irt="\0",MX=(n,e)=>n+irt+e,nrt=n=>{const e=n.indexOf(irt);return{ctrlId:n.slice(0,e),tagId:n.slice(e+1)}};var SG;(function(n){n.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),n.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(P.revive(t.uri)):void 0,range:t.range?O.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(SG||(SG={}));var Eh;(function(n){n[n.NotExpandable=0]="NotExpandable",n[n.Expandable=1]="Expandable",n[n.BusyExpanding=2]="BusyExpanding",n[n.Expanded=3]="Expanded"})(Eh||(Eh={}));var QI;(function(n){n.serialize=e=>({expand:e.expand,item:SG.serialize(e.item)}),n.deserialize=(e,t)=>({controllerId:bn.root(t.item.extId),expand:t.expand,item:SG.deserialize(e,t.item)})})(QI||(QI={}));var AG;(function(n){n.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},n.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?O.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(AG||(AG={}));const Qke=(n,e)=>{e.expand!==void 0&&(n.expand=e.expand),e.item!==void 0&&(n.item=n.item?Object.assign(n.item,e.item):e.item)};var Kse;(function(n){n.serializeWithoutMessages=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serializeWithoutMessages)}),n.serialize=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serialize)}),n.deserialize=(e,t)=>({...QI.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>b8.deserialize(e,i)),retired:!0})})(Kse||(Kse={}));var jke;(function(n){n.empty=()=>({covered:0,total:0}),n.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(jke||(jke={}));var Yse;(function(n){n.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testId:e.testId?.toString(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testId:t.testId?bn.fromString(t.testId):void 0,uri:e.asCanonicalUri(P.revive(t.uri))}),n.empty=(e,t)=>({id:e,uri:t,testId:void 0,statement:jke.empty()})})(Yse||(Yse={}));function kOe(n){return{...n,location:n.location?.toJSON()}}function IOe(n){return n.location=n.location?oe.isIPosition(n.location)?oe.lift(n.location):O.lift(n.location):void 0,n}var E4;(function(n){n[n.Declaration=0]="Declaration",n[n.Statement=1]="Statement",n[n.Branch=2]="Branch"})(E4||(E4={}));var Kke;(function(n){n.serialize=e=>e.type===E4.Declaration?Xse.serialize(e):Zse.serialize(e),n.deserialize=e=>e.type===E4.Declaration?Xse.deserialize(e):Zse.deserialize(e)})(Kke||(Kke={}));var Jse;(function(n){n.serialize=kOe,n.deserialize=IOe})(Jse||(Jse={}));var Xse;(function(n){n.serialize=kOe,n.deserialize=IOe})(Xse||(Xse={}));var Zse;(function(n){n.serialize=e=>({...kOe(e),branches:e.branches?.map(Jse.serialize)}),n.deserialize=e=>({...IOe(e),branches:e.branches?.map(Jse.deserialize)})})(Zse||(Zse={}));var Wa;(function(n){n[n.Add=0]="Add",n[n.Update=1]="Update",n[n.DocumentSynced=2]="DocumentSynced",n[n.Remove=3]="Remove",n[n.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",n[n.Retire=5]="Retire",n[n.AddTag=6]="AddTag",n[n.RemoveTag=7]="RemoveTag"})(Wa||(Wa={}));var x4;(function(n){n.deserialize=(e,t)=>t.op===Wa.Add?{op:t.op,item:QI.deserialize(e,t.item)}:t.op===Wa.Update?{op:t.op,item:AG.deserialize(t.item)}:t.op===Wa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(P.revive(t.uri)),docv:t.docv}:t,n.serialize=e=>e.op===Wa.Add?{op:e.op,item:QI.serialize(e.item)}:e.op===Wa.Update?{op:e.op,item:AG.serialize(e.item)}:e})(x4||(x4={}));class tKt{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){const t=this.createChangeCollector();for(const i of e)switch(i.op){case Wa.Add:this.add(QI.deserialize(this.uriIdentity,i.item),t);break;case Wa.Update:this.update(AG.deserialize(i.item),t);break;case Wa.Remove:this.remove(i.itemId,t);break;case Wa.Retire:this.retireTest(i.itemId);break;case Wa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case Wa.AddTag:this._tags.set(i.tag.id,i.tag);break;case Wa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=bn.parentId(e.item.extId)?.toString();let s;if(!i)s=this.createItem(e),this.roots.add(s),this.items.set(e.item.extId,s);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),s=this.createItem(e,o),this.items.set(e.item.extId,s)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(s),e.expand===Eh.BusyExpanding&&this.busyControllerCount++,s}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Eh.BusyExpanding&&this.busyControllerCount--,e.expand===Eh.BusyExpanding&&this.busyControllerCount++),Qke(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const s=bn.parentId(i.item.extId)?.toString();s?this.items.get(s).children.delete(i.item.extId):this.roots.delete(i);const o=[[e]];for(;o.length;)for(const r of o.pop()){const a=this.items.get(r);a&&(o.push(a.children),this.items.delete(r),t.remove?.(a,a!==i),a.expand===Eh.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Mh;(function(n){n[n.Upsert=0]="Upsert",n[n.SetTags=1]="SetTags",n[n.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",n[n.RemoveChild=3]="RemoveChild",n[n.SetProp=4]="SetProp",n[n.Bulk=5]="Bulk",n[n.DocumentSynced=6]="DocumentSynced"})(Mh||(Mh={}));const W5=(n,e)=>n===e,iKt={range:(n,e)=>n===e?!0:!n||!e?!1:n.equalsRange(e),busy:W5,label:W5,description:W5,error:W5,sortText:W5,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.includes(t)))},nKt=Object.entries(iKt),sKt=(n,e)=>{let t;for(const[i,s]of nKt)s(n[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class oKt extends ${get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new yn(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new I),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(const t of this.tree.values())this.updateExpandability(t)}get resolveHandler(){return this._resolveHandler}collectDiff(){const e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case Wa.DocumentSynced:{for(const t of this.diff)if(t.op===Wa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case Wa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===Wa.Update&&t.item.extId===e.item.extId){Qke(t.item,e.item);return}if(t.op===Wa.Add&&t.item.item.extId===e.item.extId){Qke(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){const i=this.tree.get(e);if(i){if((i.expandLevels===void 0||t>i.expandLevels)&&(i.expandLevels=t),i.expand===Eh.Expandable){const s=this.resolveChildren(i);return s.isOpen()?this.expandChildren(i,t-1):s.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Eh.Expanded)return i.resolveBarrier?.isOpen()===!1?i.resolveBarrier.wait().then(()=>this.expandChildren(i,t-1)):this.expandChildren(i,t-1)}}dispose(){for(const e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case Mh.RemoveChild:this.removeItem(bn.joinToString(e.fullId,t.id));break;case Mh.Upsert:this.upsertItem(t.item,e);break;case Mh.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Mh.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Mh.UpdateCanResolveChildren:this.updateExpandability(e);break;case Mh.SetProp:this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Mh.DocumentSynced:this.documentSynced(e.actual.uri);break;default:oQ()}}documentSynced(e){e&&this.pushDiff({op:Wa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=bn.fromExtHostTestItem(e,this.root.id,t?.actual),s=this.options.getApiFor(e);s.parent&&s.parent!==t?.actual&&this.options.getChildren(s.parent).delete(e.id);let o=this.tree.get(i.toString());if(!o){o={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Eh.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:Wa.Add,item:{controllerId:this.options.controllerId,expand:o.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,o,t);return}if(o.actual===e){this.connectItem(e,o,t);return}if(o.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const r=this.options.getChildren(o.actual),a=o.actual,c=sKt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Eh.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Mh.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(bn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Eh.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const s=new Set(t.map(o=>o.id));for(const o of e)s.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:Wa.Update,item:{extId:i,item:{tags:e.map(o=>MX(this.options.controllerId,o.id))}}}),s.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){const t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:Wa.AddTag,tag:{id:MX(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:Wa.RemoveTag,id:MX(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,i){this.setItemParent(e,i);const s=this.options.getApiFor(e);s.parent=i?.actual,s.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[s,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Eh.Expanded:Eh.BusyExpanding:t=e.actual.canResolveChildren?Eh.Expandable:Eh.NotExpandable:t=Eh.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Eh.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[s,o]of this.options.getChildren(e.actual)){const r=this.expand(bn.joinToString(e.fullId,o.id),t);NS(r)&&i.push(r)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const o=new Uh;return o.open(),o}e.expand=Eh.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new Uh,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let s;try{s=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return NS(s)?s.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){const t=this.tree.get(e);if(!t)throw new Error("attempting to remove non-existent child");this.pushDiff({op:Wa.Remove,itemId:e});const i=[t];for(;i.length;){const s=i.pop();if(s){this.options.getApiFor(s.actual).listener=void 0;for(const o of s.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(s.fullId.toString());for(const[o,r]of this.options.getChildren(s.actual))i.push(this.tree.get(bn.joinToString(s.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class rKt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class eoe extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class aKt extends Error{constructor(e,t,i){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${i}".`)}}const cKt=(n,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(s,o){for(const r of i.values())s.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(s){const o=new Map,r=new Set(i.keys()),a={op:Mh.Bulk,ops:[]};for(const c of s){if(!(c instanceof t))throw new eoe(c.id);const l=e(c).controllerId;if(l!==n.controllerId)throw new aKt(c.id,l,n.controllerId);if(o.has(c.id))throw new rKt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Mh.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Mh.RemoveChild,id:c});n.listener?.(a),i=o},add(s){if(!(s instanceof t))throw new eoe(s.id);i.set(s.id,s),n.listener?.({op:Mh.Upsert,item:s})},delete(s){i.delete(s)&&n.listener?.({op:Mh.RemoveChild,id:s})},get(s){return i.get(s)},toJSON(){return Array.from(i.values())}}},srt=new WeakMap,lKt=(n,e)=>{const t={controllerId:e};return srt.set(n,t),t},oue=n=>{const e=srt.get(n);if(!e)throw new eoe(n?.id||"");return e},S2="vs/workbench/contrib/chat/common/languageModels";var sk;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.Assistant=2]="Assistant"})(sk||(sk={}));const y8e={type:"object",properties:{vendor:{type:"string",description:g(S2,0,"A globally unique vendor of language models.")}}},dKt=Ap.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(S2,1,"Contribute language models of a specific vendor."),oneOf:[y8e,{type:"array",items:y8e}]},activationEventsGenerator:(n,e)=>{for(const t of n)e.push(`onLanguageModelChat:${t.vendor}`)}});let S8e=class{constructor(e,t){this._extensionService=e,this._logService=t,this._store=new Z,this._providers=new Map,this._vendors=new Set,this._onDidChangeProviders=this._store.add(new I),this.onDidChangeLanguageModels=this._onDidChangeProviders.event,this._store.add(dKt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!Cd(o.description,"chatProvider")){o.collector.error(g(S2,2,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of fi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(S2,3,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(Xv(r.vendor)){o.collector.error(g(S2,4,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(S2,5,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const s=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),s.push(o));s.length>0&&this._onDidChangeProviders.fire({removed:s})}))}dispose(){this._store.dispose(),this._providers.clear()}getLanguageModelIds(){return Array.from(this._providers.keys())}lookupLanguageModel(e){return this._providers.get(e)?.metadata}async selectLanguageModels(e){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`);else{const i=Array.from(this._vendors).map(s=>this._extensionService.activateByEvent(`onLanguageModelChat:${s}`));await Promise.all(i)}const t=[];for(const[i,s]of this._providers)(e.vendor===void 0||s.metadata.vendor===e.vendor)&&(e.family===void 0||s.metadata.family===e.family)&&(e.version===void 0||s.metadata.version===e.version)&&(e.identifier===void 0||s.metadata.id===e.identifier)&&(!s.metadata.targetExtensions||s.metadata.targetExtensions.some(o=>Cn.equals(o,e.extension)))&&t.push(i);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelChat(e,t){if(this._logService.trace("[LM] registering language model chat",e,t.metadata),!this._vendors.has(t.metadata.vendor))throw new Error(`Chat response provider uses UNKNOWN vendor ${t.metadata.vendor}.`);if(this._providers.has(e))throw new Error(`Chat response provider with identifier ${e} is already registered.`);return this._providers.set(e,t),this._onDidChangeProviders.fire({added:[{identifier:e,metadata:t.metadata}]}),Ee(()=>{this._providers.delete(e)&&(this._onDidChangeProviders.fire({removed:[e]}),this._logService.trace("[LM] UNregistered language model chat",e,t.metadata))})}makeLanguageModelChatRequest(e,t,i,s,o,r){const a=this._providers.get(e);if(!a)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return a.provideChatResponse(i,t,s,o,r)}computeTokenLength(e,t,i){const s=this._providers.get(e);if(!s)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return s.provideTokenCount(t,i)}};S8e=D([_(0,ho),_(1,Ze)],S8e);var ZS;(function(n){function e(i){const{selectionStartLineNumber:s,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new Ps(s-1,o-1),l=new Ps(r-1,a-1);return new XS(c,l)}n.to=e;function t(i){const{anchor:s,active:o}=i;return{selectionStartLineNumber:s.line+1,selectionStartColumn:s.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}n.from=t})(ZS||(ZS={}));var at;(function(n){function e(i){if(!i)return;const{start:s,end:o}=i;return{startLineNumber:s.line+1,startColumn:s.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}n.from=e;function t(i){if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=i;return new rs(s-1,o-1,r-1,a-1)}n.to=t})(at||(at={}));var yx;(function(n){function e(i){return{uri:i.uri,range:at.from(i.range)}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(yx||(yx={}));var Yke;(function(n){function e(t){switch(t){case Ar.Comment:return UE.Comment;case Ar.Other:return UE.Other;case Ar.RegEx:return UE.RegEx;case Ar.String:return UE.String}}n.to=e})(Yke||(Yke={}));var Wr;(function(n){function e(i){return new Ps(i.lineNumber-1,i.column-1)}n.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}n.from=t})(Wr||(Wr={}));var D4;(function(n){function e(s,o,r){return Ui(Kb(s).map(a=>t(a,o,r)))}n.from=e;function t(s,o,r){if(typeof s=="string")return{$serialized:!0,language:s,isBuiltin:r?.isBuiltin};if(s)return{$serialized:!0,language:s.language,scheme:i(s.scheme,o),pattern:Zp.from(s.pattern)??void 0,exclusive:s.exclusive,notebookType:s.notebookType,isBuiltin:r?.isBuiltin}}function i(s,o){return o&&typeof s=="string"?o.transformOutgoingScheme(s):s}})(D4||(D4={}));var toe;(function(n){function e(i){switch(i){case mI.Unnecessary:return Ev.Unnecessary;case mI.Deprecated:return Ev.Deprecated}}n.from=e;function t(i){switch(i){case Ev.Unnecessary:return mI.Unnecessary;case Ev.Deprecated:return mI.Deprecated;default:return}}n.to=t})(toe||(toe={}));var k4;(function(n){function e(i){let s;return i.code&&(zt(i.code)||jc(i.code)?s=String(i.code):s={value:String(i.code.value),target:i.code.target}),{...at.from(i.range),message:i.message,source:i.source,code:s,severity:noe.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(ioe.from),tags:Array.isArray(i.tags)?Ui(i.tags.map(toe.from)):void 0}}n.from=e;function t(i){const s=new R6(at.to(i),i.message,noe.to(i.severity));return s.source=i.source,s.code=zt(i.code)?i.code:i.code?.value,s.relatedInformation=i.relatedInformation&&i.relatedInformation.map(ioe.to),s.tags=i.tags&&Ui(i.tags.map(toe.to)),s}n.to=t})(k4||(k4={}));var ioe;(function(n){function e(i){return{...at.from(i.location.range),message:i.message,resource:i.location.uri}}n.from=e;function t(i){return new e4(new _p(i.resource,at.to(i)),i.message)}n.to=t})(ioe||(ioe={}));var noe;(function(n){function e(i){switch(i){case Th.Error:return Ys.Error;case Th.Warning:return Ys.Warning;case Th.Information:return Ys.Info;case Th.Hint:return Ys.Hint}return Ys.Error}n.from=e;function t(i){switch(i){case Ys.Info:return Th.Information;case Ys.Warning:return Th.Warning;case Ys.Error:return Th.Error;case Ys.Hint:return Th.Hint;default:return Th.Error}}n.to=t})(noe||(noe={}));var yd;(function(n){function e(i){return typeof i=="number"&&i>=c4.One?i-1:i===c4.Beside?Cw:wx}n.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}n.to=t})(yd||(yd={}));function hKt(n){return typeof n.range<"u"}function ort(n){return n.length===0?!0:!!hKt(n[0])}var Qs;(function(n){function e(a){return a.map(n.from)}n.fromMany=e;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function i(a){let c;if(t(a)){const{language:u,value:f}=a;c={value:"```"+u+` -`+f+"\n```\n"}}else vp.isMarkdownString(a)?c={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?c={value:a}:c={value:""};const l=Object.create(null);c.uris=l;const d=u=>{try{let f=P.parse(u,!0);f=f.with({query:s(f.query,l)}),l[u]=f}catch{}return""},h=new Xg.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(eJe(u).href):"",Xg(c.value,{renderer:h}),c}n.from=i;function s(a,c){if(!a)return a;let l;try{l=JU(a)}catch{}if(!l)return a;let d=!1;return l=AU(l,h=>{if(P.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return c[u]=h,d=!0,u}else return}),d?JSON.stringify(l):a}function o(a){const c=new vp(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?P.from(a.baseUri):void 0,c}n.to=o;function r(a){if(a)return typeof a=="string"?a:n.from(a)}n.fromStrict=r})(Qs||(Qs={}));function uKt(n){return ort(n)?n.map(e=>({range:at.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Qs.fromMany(e.hoverMessage):e.hoverMessage?Qs.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:at.from(e)}))}function rue(n){return typeof n>"u"?n:typeof n=="string"?P.file(n):n}var I4;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?rue(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}n.from=e})(I4||(I4={}));var soe;(function(n){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(soe||(soe={}));var Jke;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case _I.OpenOpen:return gi.AlwaysGrowsWhenTypingAtEdges;case _I.ClosedClosed:return gi.NeverGrowsWhenTypingAtEdges;case _I.OpenClosed:return gi.GrowsOnlyWhenTypingBefore;case _I.ClosedOpen:return gi.GrowsOnlyWhenTypingAfter}}n.from=e})(Jke||(Jke={}));var Xke;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?Jke.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?soe.from(t.light):void 0,dark:t.dark?soe.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(Xke||(Xke={}));var nh;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&R4.from(i.newEol),range:at.from(i.range)}}n.from=e;function t(i){const s=new qx(at.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:R4.to(i.eol),s}n.to=t})(nh||(nh={}));var lf;(function(n){function e(i,s){const o={edits:[]};if(i instanceof q1){const r=new o1;for(const a of i._allEntries())a._type===sl.File&&P.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===sl.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:fMe(ze.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),o.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===sl.Text?o.edits.push({resource:a.uri,textEdit:nh.from(a.edit),versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Snippet?o.edits.push({resource:a.uri,textEdit:{range:at.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===sl.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:G1.Replace,index:a.index,count:a.count,cells:a.cells.map(IG.from)}})}return o}n.from=e;function t(i){const s=new q1,o=new wi;for(const r of i.edits)if(r.textEdit){const a=r,c=P.revive(a.resource),l=at.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=zhe.replace(l,new Q1(d)):u=qx.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else s.renameFile(P.revive(r.oldResource),P.revive(r.newResource),r.options);for(const[r,a]of o)s.set(r,a);return s}n.to=t})(lf||(lf={}));var Sw;(function(n){const e=Object.create(null);e[Gr.File]=_t.File,e[Gr.Module]=_t.Module,e[Gr.Namespace]=_t.Namespace,e[Gr.Package]=_t.Package,e[Gr.Class]=_t.Class,e[Gr.Method]=_t.Method,e[Gr.Property]=_t.Property,e[Gr.Field]=_t.Field,e[Gr.Constructor]=_t.Constructor,e[Gr.Enum]=_t.Enum,e[Gr.Interface]=_t.Interface,e[Gr.Function]=_t.Function,e[Gr.Variable]=_t.Variable,e[Gr.Constant]=_t.Constant,e[Gr.String]=_t.String,e[Gr.Number]=_t.Number,e[Gr.Boolean]=_t.Boolean,e[Gr.Array]=_t.Array,e[Gr.Object]=_t.Object,e[Gr.Key]=_t.Key,e[Gr.Null]=_t.Null,e[Gr.EnumMember]=_t.EnumMember,e[Gr.Struct]=_t.Struct,e[Gr.Event]=_t.Event,e[Gr.Operator]=_t.Operator,e[Gr.TypeParameter]=_t.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:_t.Property}n.from=t;function i(s){for(const o in e)if(e[o]===s)return Number(o);return Gr.Property}n.to=i})(Sw||(Sw={}));var Qx;(function(n){function e(i){switch(i){case i4.Deprecated:return k9.Deprecated}}n.from=e;function t(i){switch(i){case k9.Deprecated:return i4.Deprecated}}n.to=t})(Qx||(Qx={}));var EG;(function(n){function e(i){return{name:i.name,kind:Sw.from(i.kind),tags:i.tags&&i.tags.map(Qx.from),containerName:i.containerName,location:P_.from(i.location)}}n.from=e;function t(i){const s=new n4(i.name,Sw.to(i.kind),i.containerName,P_.to(i.location));return s.tags=i.tags&&i.tags.map(Qx.to),s}n.to=t})(EG||(EG={}));var Zke;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:at.from(i.range),selectionRange:at.from(i.selectionRange),kind:Sw.from(i.kind),tags:i.tags?.map(Qx.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new s4(i.name,i.detail,Sw.to(i.kind),at.to(i.range),at.to(i.selectionRange));return mo(i.tags)&&(s.tags=i.tags.map(Qx.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(Zke||(Zke={}));var KF;(function(n){function e(i){const s=new $he(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,name:i.name,detail:i.detail,kind:Sw.from(i.kind),uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})(KF||(KF={}));var eIe;(function(n){function e(t){return new gOe(KF.to(t.from),t.fromRanges.map(i=>at.to(i)))}n.to=e})(eIe||(eIe={}));var tIe;(function(n){function e(t){return new fOe(KF.to(t.to),t.fromRanges.map(i=>at.to(i)))}n.to=e})(tIe||(tIe={}));var P_;(function(n){function e(i){return{range:i.range&&at.from(i.range),uri:i.uri}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(P_||(P_={}));var xG;(function(n){function e(i){const s=i,o=i;return{originSelectionRange:s.originSelectionRange?at.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:o.uri,range:at.from(s.targetRange?s.targetRange:o.range),targetSelectionRange:s.targetSelectionRange?at.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:P.revive(i.uri),targetRange:at.to(i.range),targetSelectionRange:i.targetSelectionRange?at.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?at.to(i.originSelectionRange):void 0}}n.to=t})(xG||(xG={}));var ooe;(function(n){function e(i){return{range:at.from(i.range),contents:Qs.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Qs.to),o=at.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new ise(s,o,r,a)}n.to=t})(ooe||(ooe={}));var iIe;(function(n){function e(i){return{range:at.from(i.range),expression:i.expression}}n.from=e;function t(i){return new J6(at.to(i.range),i.expression)}n.to=t})(iIe||(iIe={}));var roe;(function(n){function e(i){if(i instanceof X6)return{type:"text",range:at.from(i.range),text:i.text};if(i instanceof Z6)return{type:"variable",range:at.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof eG)return{type:"expression",range:at.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}n.from=e;function t(i){switch(i.type){case"text":return{range:at.to(i.range),text:i.text};case"variable":return{range:at.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:at.to(i.range),expression:i.expression}}}n.to=t})(roe||(roe={}));var aoe;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:at.from(i.stoppedLocation)}}n.from=e;function t(i){return new uke(i.frameId,at.to(i.stoppedLocation))}n.to=t})(aoe||(aoe={}));var L4;(function(n){function e(i){return{range:at.from(i.range),kind:i.kind}}n.from=e;function t(i){return new N6(at.to(i.range),i.kind)}n.to=t})(L4||(L4={}));var nIe;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(L4.from)}}n.from=e;function t(i){return new P6(P.revive(i.uri),i.highlights.map(L4.to))}n.to=t})(nIe||(nIe={}));var sIe;(function(n){function e(t){switch(t){case tf.TriggerCharacter:return RM.TriggerCharacter;case tf.TriggerForIncompleteCompletions:return RM.TriggerForIncompleteCompletions;case tf.Invoke:default:return RM.Invoke}}n.to=e})(sIe||(sIe={}));var oIe;(function(n){function e(t){return{triggerKind:sIe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(oIe||(oIe={}));var coe;(function(n){function e(i){switch(i){case a4.Deprecated:return TU.Deprecated}}n.from=e;function t(i){switch(i){case TU.Deprecated:return a4.Deprecated}}n.to=t})(coe||(coe={}));var loe;(function(n){const e=new Map([[en.Method,Ne.Method],[en.Function,Ne.Function],[en.Constructor,Ne.Constructor],[en.Field,Ne.Field],[en.Variable,Ne.Variable],[en.Class,Ne.Class],[en.Interface,Ne.Interface],[en.Struct,Ne.Struct],[en.Module,Ne.Module],[en.Property,Ne.Property],[en.Unit,Ne.Unit],[en.Value,Ne.Value],[en.Constant,Ne.Constant],[en.Enum,Ne.Enum],[en.EnumMember,Ne.EnumMember],[en.Keyword,Ne.Keyword],[en.Snippet,Ne.Snippet],[en.Text,Ne.Text],[en.Color,Ne.Color],[en.File,Ne.File],[en.Reference,Ne.Reference],[en.Folder,Ne.Folder],[en.Event,Ne.Event],[en.Operator,Ne.Operator],[en.TypeParameter,Ne.TypeParameter],[en.Issue,Ne.Issue],[en.User,Ne.User]]);function t(o){return e.get(o)??Ne.Property}n.from=t;const i=new Map([[Ne.Method,en.Method],[Ne.Function,en.Function],[Ne.Constructor,en.Constructor],[Ne.Field,en.Field],[Ne.Variable,en.Variable],[Ne.Class,en.Class],[Ne.Interface,en.Interface],[Ne.Struct,en.Struct],[Ne.Module,en.Module],[Ne.Property,en.Property],[Ne.Unit,en.Unit],[Ne.Value,en.Value],[Ne.Constant,en.Constant],[Ne.Enum,en.Enum],[Ne.EnumMember,en.EnumMember],[Ne.Keyword,en.Keyword],[Ne.Snippet,en.Snippet],[Ne.Text,en.Text],[Ne.Color,en.Color],[Ne.File,en.File],[Ne.Reference,en.Reference],[Ne.Folder,en.Folder],[Ne.Event,en.Event],[Ne.Operator,en.Operator],[Ne.TypeParameter,en.TypeParameter],[Ne.User,en.User],[Ne.Issue,en.Issue]]);function s(o){return i.get(o)??en.Property}n.to=s})(loe||(loe={}));var rIe;(function(n){function e(t,i){const s=new H6(t.label);return s.insertText=t.insertText,s.kind=loe.to(t.kind),s.tags=t.tags?.map(coe.to),s.detail=t.detail,s.documentation=ah(t.documentation)?Qs.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,O.isIRange(t.range)?s.range=at.to(t.range):typeof t.range=="object"&&(s.range={inserting:at.to(t.range.insert),replacing:at.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&cp.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&cp.InsertAsSnippet?s.insertText=new Q1(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof rs?new qx(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(o=>nh.to(o))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(rIe||(rIe={}));var doe;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Qs.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation}}n.to=t})(doe||(doe={}));var hoe;(function(n){function e(i){return{label:i.label,documentation:Qs.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(doe.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(doe.to):[],activeParameter:i.activeParameter}}n.to=t})(hoe||(hoe={}));var DG;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.to):[]}}n.to=t})(DG||(DG={}));var aIe;(function(n){function e(t,i){const s=new W6(Wr.to(i.position),typeof i.label=="string"?i.label:i.label.map(cIe.to.bind(void 0,t)),i.kind&&uoe.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(nh.to),s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(aIe||(aIe={}));var cIe;(function(n){function e(t,i){const s=new B6(i.label);return s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,uZ.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=P_.to(i.location)),s}n.to=e})(cIe||(cIe={}));var uoe;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(uoe||(uoe={}));var zM;(function(n){function e(i){return{range:at.from(i.range),url:i.target,tooltip:i.tooltip}}n.from=e;function t(i){let s;if(i.url)try{s=typeof i.url=="string"?P.parse(i.url,!0):P.revive(i.url)}catch{}return new V6(at.to(i.range),s)}n.to=t})(zM||(zM={}));var goe;(function(n){function e(i){const s=new $6(i.label);return i.textEdit&&(s.textEdit=nh.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(o=>nh.to(o))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?nh.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>nh.from(s)):void 0}}n.from=t})(goe||(goe={}));var T4;(function(n){function e(i){return new VF(i[0],i[1],i[2],i[3])}n.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}n.from=t})(T4||(T4={}));var lIe;(function(n){function e(i){return{range:at.from(i.range)}}n.from=e;function t(i){return new r4(at.to(i.range))}n.to=t})(lIe||(lIe={}));var foe;(function(n){function e(t){switch(t){case Ln.AUTO:return MM.AfterDelay;case Ln.EXPLICIT:return MM.Manual;case Ln.FOCUS_CHANGE:case Ln.WINDOW_CHANGE:return MM.FocusOut}}n.to=e})(foe||(foe={}));var oH;(function(n){function e(i){switch(i){case wv.Off:return Qr.Off;case wv.Relative:return Qr.Relative;case wv.Interval:return Qr.Interval;case wv.On:default:return Qr.On}}n.from=e;function t(i){switch(i){case Qr.Off:return wv.Off;case Qr.Relative:return wv.Relative;case Qr.Interval:return wv.Interval;case Qr.On:default:return wv.On}}n.to=t})(oH||(oH={}));var R4;(function(n){function e(i){if(i===jv.CRLF)return bu.CRLF;if(i===jv.LF)return bu.LF}n.from=e;function t(i){if(i===bu.CRLF)return jv.CRLF;if(i===bu.LF)return jv.LF}n.to=t})(R4||(R4={}));var dIe;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case VI.SourceControl:return ch.Scm;case VI.Window:return ch.Window;case VI.Notification:return ch.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(dIe||(dIe={}));var poe;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=moe.from(i.kind)),s}n.from=e;function t(i){const s={start:i.start-1,end:i.end-1};return i.kind&&(s.kind=moe.to(i.kind)),s}n.to=t})(poe||(poe={}));var moe;(function(n){function e(i){if(i)switch(i){case vy.Comment:return yv.Comment;case vy.Imports:return yv.Imports;case vy.Region:return yv.Region}}n.from=e;function t(i){if(i)switch(i.value){case yv.Comment.value:return vy.Comment;case yv.Imports.value:return vy.Imports;case yv.Region.value:return vy.Region}}n.to=t})(moe||(moe={}));var C8;(function(n){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,override:typeof t.override=="boolean"?A_.id:void 0}}n.from=e})(C8||(C8={}));var Zp;(function(n){function e(o){return o instanceof FM?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new FM(o.baseUri??o.base,o.pattern).toJSON():o}n.from=e;function t(o){const r=o;return r?P.isUri(r.baseUri)&&typeof r.pattern=="string":!1}function i(o){const r=o;return r?typeof r.base=="string"&&typeof r.pattern=="string":!1}function s(o){return typeof o=="string"?o:new FM(P.revive(o.baseUri),o.pattern)}n.to=s})(Zp||(Zp={}));var hIe;(function(n){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Zp.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(hIe||(hIe={}));var _oe;(function(n){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(s=>Array.isArray(s)&&s.every(o=>o&&typeof o=="object"&&"uri"in o&&P.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof rs)))}n.is=e;function t(i){return{documents:i.documents.map(s=>s.map(o=>({uri:P.from(o.uri),version:o.version,ranges:o.ranges.map(r=>at.from(r))})))}}n.from=t})(_oe||(_oe={}));var ES;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new rS(i.start,i.end)}n.to=t})(ES||(ES={}));var M4;(function(n){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}n.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}n.from=t})(M4||(M4={}));var uIe;(function(n){function e(t){if(t===p8.Unconfirmed)return qF.Pending;if(t===p8.Pending)return;if(t===p8.Executing)return qF.Executing;throw new Error(`Unknown state: ${t}`)}n.to=e})(uIe||(uIe={}));var kG;(function(n){function e(i){switch(i){case bI.Markup:return w2.Markup;case bI.Code:default:return w2.Code}}n.from=e;function t(i){switch(i){case w2.Markup:return bI.Markup;case w2.Code:default:return bI.Code}}n.to=t})(kG||(kG={}));var ok;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)ej.validate(o),s.cells.push(IG.from(o));return s}n.from=e;function t(i){const s=new mOe(i.cells.map(IG.to));return n1(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(ok||(ok={}));var IG;(function(n){function e(i){return{cellKind:kG.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:M4.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(Y1.from):[]}}n.from=e;function t(i){return new ej(kG.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(Y1.to):void 0,i.metadata,i.internalMetadata?M4.to(i.internalMetadata):void 0)}n.to=t})(IG||(IG={}));var N4;(function(n){function e(i){return{mime:i.mime,valueBytes:ze.wrap(i.data)}}n.from=e;function t(i){return new _Oe(i.valueBytes.buffer,i.mime)}n.to=t})(N4||(N4={}));var Y1;(function(n){function e(i){return{outputId:i.id,items:i.items.map(N4.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(N4.to);return new oG(s,i.outputId,i.metadata)}n.to=t})(Y1||(Y1={}));var voe;(function(n){function e(s){return i(s)?{include:Zp.from(s.include)??void 0,exclude:Zp.from(s.exclude)??void 0}:Zp.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:Zp.to(s.include),exclude:Zp.to(s.exclude)}:Zp.to(s)}n.to=t;function i(s){const o=s;return o?!dc(o.include)&&!dc(o.exclude):!1}})(voe||(voe={}));var gIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===rG.Left?ese.Left:ese.Right,command:i.toInternal(o,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(gIe||(gIe={}));var fIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,s),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}n.from=e})(fIe||(fIe={}));var pIe;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(pIe||(pIe={}));var woe;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new vOe(P.revive(i.uri),i.provides)}n.to=t})(woe||(woe={}));var P4;(function(n){function e(i){return{message:Qs.fromStrict(i.message)||"",type:dC.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:at.from(i.location.range),uri:i.location.uri}}}n.from=e;function t(i){const s=new b4(typeof i.message=="string"?i.message:Qs.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?P_.to(i.location):void 0,s}n.to=t})(P4||(P4={}));var hC;(function(n){n.namespace=MX,n.denamespace=nrt})(hC||(hC={}));var J1;(function(n){function e(i){const s=oue(i).controllerId;return{extId:bn.fromExtHostTestItem(i,s).toString(),label:i.label,uri:P.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>hC.namespace(s,o.id)),range:O.lift(at.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Qs.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:bn.fromString(i.extId).localId,label:i.label,uri:P.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:o}=hC.denamespace(s);return new C4(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:at.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(J1||(J1={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new C4(i.id)}n.to=t})(hC||(hC={}));var mIe;(function(n){const e=(i,s)=>{const o=i.value;if(!o)return;const r={...J1.toPlain(o.item),parent:s,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===dC.Error).map(P4.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,r);c&&r.children.push(c)}return r};function t(i){const s=new qse;for(const a of i.items)s.insert(bn.fromString(a.item.extId).path,a);const o=[s.nodes],r=[];for(;o.length;)for(const a of o.pop())a.value?r.push(a):a.children&&o.push(a.children.values());return{completedAt:i.completedAt,results:r.map(a=>e(a)).filter(yl)}}n.to=t})(mIe||(mIe={}));var boe;(function(n){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Wr.from(o):at.from(o)}function i(o){if(typeof o.executed=="number"&&o.executed<0)throw new Error(`Invalid coverage count ${o.executed}`);return"branches"in o?{count:o.executed,location:t(o.location),type:E4.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:E4.Declaration,name:o.name,count:o.executed,location:t(o.location)}}n.fromDetails=i;function s(o,r,a){return IX(a.statementCoverage),IX(a.branchCoverage),IX(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testId:a instanceof uG&&a.testItem?bn.fromExtHostTestItem(a.testItem,o).toString():void 0}}n.fromFile=s})(boe||(boe={}));var _Ie;(function(n){function e(t){switch(t){case wu.Invoke:return o4.Invoke;case wu.Auto:return o4.Automatic}}n.to=e})(_Ie||(_Ie={}));var $M;(function(n){function e(i){const s=new qhe(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,kind:Sw.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})($M||($M={}));var Coe;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(Coe||(Coe={}));var yoe;(function(n){function e(o,r,a){const c=r.fileData;return c?new A7t(new E7t(c.name,P.revive(c.uri),c.id,cw(()=>a(c.id)))):o===Js.uriList&&r.uriListData?new mse(s(r.uriListData)):new mse(r.asString)}n.to=e;async function t(o,r){const a=await r.asString();if(o===Js.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=r.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}n.from=t;function i(o){return R1.split(o).map(r=>{if(r.startsWith("#"))return r;try{return P.parse(r)}catch{}return r})}function s(o){return R1.create(o.map(r=>typeof r=="string"?r:P.revive(r)))}})(yoe||(yoe={}));var rw;(function(n){function e(i,s){const o=i.items.map(([r,a])=>[r,yoe.to(r,a,s)]);return new h4(o)}n.toDataTransfer=e;async function t(i){const s={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{s.items.push([r,await yoe.from(r,a)])})());return await Promise.all(o),s}n.from=t})(rw||(rw={}));var LG;(function(n){function e(i,s){return{kind:"reply",agentId:i.participant??s?.agentId??"",subCommand:i.command??s?.command,message:i.prompt,title:i.label}}n.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}n.to=t})(LG||(LG={}));var y8;(function(n){function e(i){switch(i.role){case sk.System:return new v8(Iv.System,i.content);case sk.User:return new v8(Iv.User,i.content);case sk.Assistant:return new v8(Iv.Assistant,i.content)}}n.to=e;function t(i){switch(i.role){case Iv.System:return{role:sk.System,content:i.content};case Iv.User:return{role:sk.User,content:i.content};case Iv.Assistant:return{role:sk.Assistant,content:i.content}}}n.from=t})(y8||(y8={}));var TG;(function(n){function e(i){return{kind:"markdownContent",content:Qs.from(i.value)}}n.from=e;function t(i){return new Jhe(Qs.to(i.content))}n.to=t})(TG||(TG={}));var Soe;(function(n){function e(i){return{kind:"markdownVuln",content:Qs.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new fG(Qs.to(i.content),i.vulnerabilities)}n.to=t})(Soe||(Soe={}));var Aoe;(function(n){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}n.from=e;function t(i){return new pG(i.agentId,i.command)}n.to=t})(Aoe||(Aoe={}));var vIe;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data}}n.from=e})(vIe||(vIe={}));var RG;(function(n){function e(i){const{value:s,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=P.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:ui(o),uri:o,children:r(s,o)}}}n.from=e;function t(i){const s=Or(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=s.uri,a=s.children?o(s.children):[];return new Xhe(a,r)}n.to=t})(RG||(RG={}));var MG;(function(n){function e(i){const s=o=>P.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:yx.from(i.value)}}n.from=e;function t(i){const s=Or(i);return new Zhe(P.isUri(s.inlineReference)?s.inlineReference:yx.to(s.inlineReference),i.name)}n.to=t})(MG||(MG={}));var F4;(function(n){function e(i){return{kind:"progressMessage",content:Qs.from(i.value)}}n.from=e;function t(i){return new mG(i.content.value)}n.to=t})(F4||(F4={}));var NG;(function(n){function e(i){return{kind:"warning",content:Qs.from(i.value)}}n.from=e;function t(i){return new _G(i.content.value)}n.to=t})(NG||(NG={}));var wIe;(function(n){function e(t){return{kind:"progressTask",content:Qs.from(t.value)}}n.from=e})(wIe||(wIe={}));var bIe;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Qs.from(t):void 0}}n.from=e})(bIe||(bIe={}));var PG;(function(n){function e(i,s,o){return{kind:"command",command:s.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}n.from=e;function t(i,s){return new eue(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(PG||(PG={}));var Eoe;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>nh.from(s))}}n.from=e;function t(i){return new vG(P.revive(i.uri),i.edits.map(s=>nh.to(s)))}n.to=t})(Eoe||(Eoe={}));var Sx;(function(n){function e(i){const s=$e.isThemeIcon(i.iconPath)?i.iconPath:P.isUri(i.iconPath)?{light:P.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&P.isUri(i.iconPath.light)&&P.isUri(i.iconPath.dark)?{light:P.revive(i.iconPath.light),dark:P.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:P.isUri(i.value.value)||!i.value.value?i.value.value:yx.from(i.value.value)},iconPath:s}:{kind:"reference",reference:P.isUri(i.value)?i.value:yx.from(i.value),iconPath:s}}n.from=e;function t(i){const s=Or(i),o=r=>P.isUri(r)?r:yx.to(r);return new GI("variableName"in s.reference?{variableName:s.reference.variableName,value:s.reference.value&&o(s.reference.value)}:o(s.reference))}n.to=t})(Sx||(Sx={}));var xoe;(function(n){function e(s,o,r){return s instanceof Jhe?TG.from(s):s instanceof Zhe?MG.from(s):s instanceof GI?Sx.from(s):s instanceof mG?F4.from(s):s instanceof Xhe?RG.from(s):s instanceof eue?PG.from(s,o,r):s instanceof vG?Eoe.from(s):s instanceof fG?Soe.from(s):s instanceof pG?Aoe.from(s):s instanceof _G?NG.from(s):{kind:"markdownContent",content:Qs.from("")}}n.from=e;function t(s,o){switch(s.kind){case"reference":return Sx.to(s);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(s,o)}}n.to=t;function i(s,o){switch(s.kind){case"markdownContent":return TG.to(s);case"inlineReference":return MG.to(s);case"progressMessage":return;case"treeData":return RG.to(s);case"command":return PG.to(s,o)}}n.toContent=i})(xoe||(xoe={}));var CIe;(function(n){function e(t){return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:t.variables.variables.map(Doe.to),location:O4.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData}}n.to=e})(CIe||(CIe={}));var O4;(function(n){function e(i){switch(i){case cc.Notebook:return cb.Notebook;case cc.Terminal:return cb.Terminal;case cc.Panel:return cb.Panel;case cc.Editor:return cb.Editor}}n.to=e;function t(i){switch(i){case cb.Notebook:return cc.Notebook;case cb.Terminal:return cc.Terminal;case cb.Panel:return cc.Panel;case cb.Editor:return cc.Editor}}n.from=t})(O4||(O4={}));var Doe;(function(n){function e(t){const i=t.value;if(!i)throw new Error("Invalid value reference");return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:lZ(i)?P.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&lZ(i.uri)?yx.to(Or(i)):i,modelDescription:t.modelDescription}}n.to=e})(Doe||(Doe={}));var yIe;(function(n){function e(t,i,s){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,s)}}n.from=e})(yIe||(yIe={}));var rH;(function(n){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}n.to=e})(rH||(rH={}));var SIe;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const o=rH.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:s.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:LG.to(i.action.followup)},result:o}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:o}:{action:i.action,result:o}}n.to=e})(SIe||(SIe={}));var koe;(function(n){function e(t,i,s){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,s)}n.from=e})(koe||(koe={}));var AIe;(function(n){function e(t){return{kind:EIe.to(t.kind)}}n.to=e})(AIe||(AIe={}));var EIe;(function(n){function e(t){switch(t){case DI.Word:return IR.Word;case DI.Line:return IR.Line;case DI.Suggest:return IR.Suggest;default:return IR.Unknown}}n.to=e})(EIe||(EIe={}));var xIe;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||nDe.None,contextValue:t.contextValue}}n.from=e})(xIe||(xIe={}));class LOe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Ui(Array.from(e,([,i])=>i.asFile()))),{id:t,dispose:()=>{this.dataTransferFiles.delete(t)}}}async resolveFileData(e,t){const i=this.dataTransferFiles.get(e);if(!i)throw new Error("No data transfer found");const s=i.find(o=>o.id===t);if(!s)throw new Error("No matching file found in data transfer");return ze.wrap(await s.data())}dispose(){this.dataTransferFiles.clear()}}var A8e;(function(n){n.CallsTo="incomingCalls",n.CallsFrom="outgoingCalls"})(A8e||(A8e={}));const rrt=new Po;class Ioe{static async create(e,t,i){const[s]=rrt.ordered(e);if(!s)return;const o=await s.prepareCallHierarchy(e,t,i);if(o)return new Ioe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new $Re(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Ioe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const S8=new Map;yt.registerCommand("_executePrepareCallHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Ioe.create(o,i,qe.None);return a?(S8.set(a.id,a),S8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),S8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function art(n){return!0}yt.registerCommand("_executeProvideIncomingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,qe.None)});yt.registerCommand("_executeProvideOutgoingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,qe.None)});var DIe;(function(n){const e=[];function t(s){let o=s;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}n.register=t;function i(){return e.slice(0)}n.all=i})(DIe||(DIe={}));var kIe;(function(n){n[n.Idle=0]="Idle",n[n.Searching=1]="Searching",n[n.SlowSearch=2]="SlowSearch"})(kIe||(kIe={}));new Y("searchState",kIe.Idle);var E8e;(function(n){n.Subtypes="subtypes",n.Supertypes="supertypes"})(E8e||(E8e={}));const crt=new Po;class Loe{static async create(e,t,i){const[s]=crt.ordered(e);if(!s)return;const o=await s.prepareTypeHierarchy(e,t,i);if(o)return new Loe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new $Re(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Loe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const A8=new Map;yt.registerCommand("_executePrepareTypeHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Loe.create(o,i,qe.None);return a?(A8.set(a.id,a),A8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),A8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function lrt(n){const e=n;return typeof n=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&P.isUri(e.uri)&&O.isIRange(e.range)&&O.isIRange(e.selectionRange)}yt.registerCommand("_executeProvideSupertypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSupertypes(t,qe.None)});yt.registerCommand("_executeProvideSubtypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSubtypes(t,qe.None)});var $o;let x8e=$o=class extends ${constructor(e,t,i,s,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=s,this._uriIdentService=o,this._registrations=this._register(new Zo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(et.ExtHostLanguageFeatures),this._languageService){const r=()=>{const a=[];for(const c of t.getRegisteredLanguageIds()){const l=this._languageConfigurationService.getLanguageConfiguration(c).getWordDefinition();a.push({languageId:c,regexSource:l.source,regexFlags:l.flags})}this._proxy.$setWordDefinitions(a)};this._register(this._languageConfigurationService.onDidChange(a=>{if(!a.languageId)r();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),r()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationLinkDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach($o._reviveWorkspaceSymbolDto),e):(e.location=$o._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>AS(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=P.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(s,o)=>this._proxy.$provideDocumentSymbols(e,s.uri,o)}))}$registerCodeLensSupport(e,t,i){const s={provideCodeLenses:async(o,r)=>{const a=await this._proxy.$provideCodeLenses(e,o.uri,r);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(o,r,a)=>{const c=await this._proxy.$resolveCodeLens(e,r,a);if(c)return{...c,range:o.validateRange(c.range)}}};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,s))}$emitCodeLensEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.definitionProvider.register(t,{provideDefinition:(i,s,o)=>this._proxy.$provideDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,s,o)=>this._proxy.$provideDeclaration(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,s,o)=>this._proxy.$provideImplementation(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,s,o)=>this._proxy.$provideTypeDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,s,o,r)=>{const a={verbosityRequest:r?.verbosityRequest?{verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:{id:r.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,s,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,s,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,s,o)}))}$registerInlineValuesProvider(e,t,i){const s={provideInlineValues:(o,r,a,c)=>this._proxy.$provideInlineValues(e,o.uri,r,a,c)};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,s))}$emitInlineValuesEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.documentHighlightProvider.register(t,{provideDocumentHighlights:(i,s,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,s,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,s,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,s,o.map(a=>a.uri),r).then(a=>{if(iO(a))return;const c=new wi;return a?.forEach(l=>{const d=P.revive(l.uri);c.has(d)?c.get(d).push(...l.highlights):c.set(d,l.highlights)}),c})}))}$registerLinkedEditingRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.linkedEditingRangeProvider.register(t,{provideLinkedEditingRanges:async(i,s,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,s,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?$o._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,s,o,r)=>this._proxy.$provideReferences(e,i.uri,s,o,r).then($o._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,s,o,r){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:$o._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:s,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=AS(d.edit,this._uriIdentService)),d.command&&(c.command=d.command),c}),this._registrations.set(e,this._languageFeaturesService.codeActionProvider.register(t,a))}$registerPasteEditProvider(e,t,i){const s=new IIe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentPasteEditProvider.register(t,s),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const s=this._pasteEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,s,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentRangeFormattingEdits:(r,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,r.uri,a,c,l),provideDocumentRangesFormattingEdits:o?(r,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,r.uri,a,c,l):void 0}))}$registerOnTypeFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:s,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const s={provideWorkspaceSymbols:async(o,r)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,o,r);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,$o._reviveWorkspaceSymbolDto(a.symbols)}};t&&(s.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&$o._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,DIe.register(s))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(s,o,r,a)=>this._proxy.$provideRenameEdits(e,s.uri,o,r,a).then(c=>AS(c,this._uriIdentService)),resolveRenameLocation:i?(s,o,r)=>this._proxy.$resolveRenameLocation(e,s.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,s,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,s,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,s){let o;if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new gKt(this._proxy,e,i,o)))}$emitDocumentSemanticTokensEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentRangeSemanticTokensProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentRangeSemanticTokensProvider.register(t,new fKt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const s=t[Fi.label],o=t[Fi.commandId],r=t[Fi.commandIdent],a=t[Fi.commitCharacters];return{label:s,extensionId:i,kind:t[Fi.kind]??Ne.Property,tags:t[Fi.kindModifier],detail:t[Fi.detail],documentation:t[Fi.documentation],sortText:t[Fi.sortText],filterText:t[Fi.filterText],preselect:t[Fi.preselect],insertText:t[Fi.insertText]??(typeof s=="string"?s:s.label),range:t[Fi.range]??e,insertTextRules:t[Fi.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Fi.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Fi.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,s,o){const r={triggerCharacters:i,_debugDisplayName:`${o.value}(${i.join("")})`,provideCompletionItems:async(a,c,l,d)=>{const h=await this._proxy.$provideCompletionItems(e,a.uri,c,l,d);return h&&{suggestions:h[aS.completions].map(u=>$o._inflateSuggestDto(h[aS.defaultRanges],u,o)),incomplete:h[aS.isIncomplete]||!1,duration:h[aS.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};s&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=$o._inflateSuggestDto(a.range,l,o);return ym(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,s,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),handleItemDidShow:async(a,c,l)=>{i&&await this._proxy.$handleInlineCompletionDidShow(e,a.pid,c.idx,l)},handlePartialAccept:async(a,c,l,d)=>{i&&await this._proxy.$handleInlineCompletionPartialAccept(e,a.pid,c.idx,l,d)},freeInlineCompletions:a=>{this._proxy.$freeInlineCompletionsList(e,a.pid)},groupId:s,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${s})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const s={provideInlineEdit:async(o,r,a)=>this._proxy.$provideInlineEdit(e,o.uri,r,a),freeInlineEdit:o=>{this._proxy.$freeInlineEdit(e,o.pid)}};this._registrations.set(e,this._languageFeaturesService.inlineEditProvider.register(t,s))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(s,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,s.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,s,o){const r={displayName:o,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Or(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(r.resolveInlayHint=async(a,c)=>{const l=a;if(!l.cacheId)return a;const d=await this._proxy.$resolveInlayHint(e,l.cacheId,c);if(c.isCancellationRequested)throw new Tc;return d?{...a,tooltip:d.tooltip,label:Or(d.label),textEdits:d.textEdits}:a}),typeof s=="number"){const a=new I;this._registrations.set(s,a),r.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,r))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const s={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map($o._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(s.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&$o._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,s))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(s,o)=>i.$provideDocumentColors(e,s.uri,o).then(r=>r.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(s,o,r)=>i.$provideColorPresentations(e,s.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,s){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o.onDidChange=r.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,o))}$emitFoldingRangeEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerSelectionRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.selectionRangeProvider.register(t,{provideSelectionRanges:(i,s,o)=>this._proxy.$provideSelectionRanges(e,i.uri,s,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,rrt.register(t,{prepareCallHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,s,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map($o._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.to=$o._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.from=$o._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:$o._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:$o._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?$o._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?$o._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:$o._reviveRegExp(e.beforeText),afterText:e.afterText?$o._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?$o._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map($o._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const s={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?$o._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?$o._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?$o._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?s.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(s.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(s.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,s,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,crt.register(t,{prepareTypeHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,s,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map($o._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const s=new LIe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentDropEditProvider.register(t,s),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const s=this._documentOnDropEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t){const i=new pKt(e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,i))}};x8e=$o=D([Zi(Ue.MainThreadLanguageFeatures),_(1,Di),_(2,lo),_(3,ht),_(4,_o)],x8e);let IIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new LOe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new bs(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await rw.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new fhe;for(const[u,f]of d.items)h.replace(u,HQ(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await rw.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,o.uri,r,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new bs(f.kind.value):new bs(""),yieldTo:f.yieldTo?.map(p=>({kind:new bs(p)})),additionalEdit:f.additionalEdit?AS(f.additionalEdit,this._uriIdentService,p=>this.resolveFileData(d.id,p)):void 0})),dispose:()=>{this._proxy.$releasePasteEdits(this._handle,d.id)}}:void 0}finally{d.dispose()}}),i.supportsResolve&&(this.resolveDocumentPasteEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};IIe=D([_(3,_o)],IIe);let LIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new LOe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,s){const o=this.dataTransfers.add(i);try{const r=await rw.from(i);if(s.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,s);return a?a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new bs(l)})),kind:c.kind?new bs(c.kind):void 0,additionalEdit:AS(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})):void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};LIe=D([_(3,_o)],LIe);class gKt{constructor(e,t,i,s){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=s}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const s=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,s,i);if(!o||i.isCancellationRequested)return null;const r=Iie(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class fKt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const s=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!s||i.isCancellationRequested)return null;const o=Iie(s);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class pKt{constructor(e,t,i){this._handle=e,this._proxy=t,this._uriService=i}async provideMappedEdits(e,t,i,s){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,s);return o?AS(o,this._uriService):null}}let D8e=class{constructor(e,t,i,s,o){this._languageService=t,this._modelService=i,this._resolverService=s,this._languageStatusService=o,this._disposables=new Z,this._status=new Zo,this._proxy=e.getProxy(et.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(r=>{this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds())}))}dispose(){this._disposables.dispose(),this._status.dispose()}async $changeLanguage(e,t){if(!this._languageService.isRegisteredLanguageId(t))return Promise.reject(new Error(`Unknown language id: ${t}`));const i=P.revive(e),s=await this._resolverService.createModelReference(i);try{s.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{s.dispose()}}async $tokensAtPosition(e,t){const i=P.revive(e),s=this._modelService.getModel(i);if(!s)return;s.tokenization.tokenizeIfCheap(t.lineNumber);const o=s.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new O(t.lineNumber,1+o.getStartOffset(r),t.lineNumber,1+o.getEndOffset(r))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};D8e=D([Zi(Ue.MainThreadLanguages),_(1,Di),_(2,Ai),_(3,Rn),_(4,OPe)],D8e);let k8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(et.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(s=>{kYe(s)?i.$setLogLevel(s):i.$setLogLevel(s[1],s[0])}))}$log(e,t){const i=this.loggerService.getLogger(P.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[s,o]of t)see(i,s,o)}async $createLogger(e,t){this.loggerService.createLogger(P.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:P.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(P.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(P.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(P.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};k8e=D([Zi(Ue.MainThreadLogger),_(1,wp)],k8e);yt.registerCommand("_extensionTests.setLogLevel",function(n,e){const t=n.get(wp),i=n.get(Il);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const s=TYe(e);s!==void 0&&t.setLogLevel(s)}});yt.registerCommand("_extensionTests.getLogLevel",function(n){const e=n.get(Ze);return c7(e.getLevel())});const oY="vs/workbench/api/browser/mainThreadMessageService";let I8e=class{constructor(e,t,i,s,o){this._notificationService=t,this._commandService=i,this._dialogService=s,this.extensionsListener=o.onDidChangeExtensions(r=>{for(const a of r.removed)this._notificationService.removeFilter(a.identifier.value)})}dispose(){this.extensionsListener.dispose()}$showMessage(e,t,i,s){return i.modal?this._showModalMessage(e,t,i.detail,s,i.useCustom):this._showMessage(e,t,s,i)}_showMessage(e,t,i,s){return new Promise(o=>{const r=i.map(d=>_l({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;s.source&&(a={label:s.source.label,id:s.source.identifier.value}),a||(a=g(oY,0,"Extension"));const c=[];s.source&&c.push(_l({id:s.source.identifier.value,label:g(oY,1,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",s.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});T.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,s,o){const r=[];let a;for(const l of s){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(oY,2,"Cancel"),run:()=>{}}:a={label:g(oY,3,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};I8e=D([Zi(Ue.MainThreadMessageService),_(1,Pi),_(2,Qi),_(3,To),_(4,ho)],I8e);const mKt=(n,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const s=fMe(ze.wrap(i));return[`GET ws://localhost${n}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${s}`].join(`\r +`+g(sY,2,"Closing will terminate the running processes in the terminals."):g(sY,3,"Closing will terminate the running processes in this terminal.")});return t?Ku.DONT_SAVE:Ku.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,s,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=s,this._instantiationService=o,this._configurationService=r,this._lifecycleService=a,this._contextKeyService=c,this._dialogService=l,this.closeHandler=this,this._isDetached=!1,this._isShuttingDown=!1,this._isReverted=!1,this._onDidRequestAttach=this._register(new I),this.onDidRequestAttach=this._onDidRequestAttach.event,this._terminalEditorFocusContextKey=$ke.editorFocus.bindTo(c),t&&this._setupInstanceListeners()}_setupInstanceListeners(){const e=this._terminalInstance;if(!e)return;const t=e.onDidFocus(()=>this._terminalEditorFocusContextKey.set(!0)),i=e.onDidBlur(()=>this._terminalEditorFocusContextKey.reset());this._register(Ee(()=>{!this._isDetached&&!this._isShuttingDown&&e.dispose(vM.User),St([t,i])}));const s=[e.onExit(o=>{e.waitOnExit||this.dispose()}),e.onDisposed(()=>this.dispose()),e.onTitleChanged(()=>this._onDidChangeLabel.fire()),e.onIconChanged(()=>this._onDidChangeLabel.fire()),t,i,e.statusList.onDidChangePrimaryStatus(()=>this._onDidChangeLabel.fire())];this._lifecycleService.onWillShutdown(o=>{this._isShuttingDown=!0,St(s),this._configurationService.getValue(_y.EnablePersistentSessions)&&o.reason===PI.RELOAD?e.detachProcessAndDispose(vM.Shutdown):e.dispose(vM.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!$e.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=Vjt(this._terminalInstance);t&&e.push(t);const i=zjt(this._terminalInstance,this._themeService.getColorTheme().type);return i&&e.push(...i),e}detachInstance(){this._isShuttingDown||(this._terminalInstance?.detachFromElement(),this._terminalInstance?.setParentContextKeyService(this._contextKeyService),this._isDetached=!0)}getDescription(){return this._terminalInstance?.description}toUntyped(){return{resource:this.resource,options:{override:d8e,pinned:!0,forceReload:!0}}}},TX=UP,UP.ID="workbench.editors.terminal",UP);Gke=TX=D([_(2,pn),_(3,eet),_(4,be),_(5,Re),_(6,mg),_(7,Pe),_(8,To)],Gke);let p8e=class{constructor(e,t,i,s,o){this._editorGroupsService=t,this._configurationService=i,this._logService=s,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new Zo,this._proxy=e.getProxy(et.ExtHostEditorTabs),this._dispoables.add(o.onDidEditorsChange(r=>{try{this._updateTabsModel(r)}catch{this._logService.error("Failed to update model, rebuilding"),this._createTabsModel()}})),this._dispoables.add(this._multiDiffEditorInputListeners),this._dispoables.add(this._editorGroupsService.onDidAddGroup(()=>this._createTabsModel())),this._dispoables.add(this._editorGroupsService.onDidRemoveGroup(()=>this._createTabsModel())),this._editorGroupsService.whenReady.then(()=>this._createTabsModel())}dispose(){this._groupLookup.clear(),this._tabInfoLookup.clear(),this._dispoables.dispose()}_buildTabObject(e,t,i){const s=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:s,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof Vke)return{kind:Fa.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof Ib)return{kind:Fa.TextInput,uri:e.resource};if(e instanceof mm&&!(e instanceof op)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof Ib&&e.secondary instanceof Ib&&_n(t,i)&&t&&i?{kind:Fa.TextInput,uri:t}:{kind:Fa.UnknownInput}}if(e instanceof VM)return{kind:Fa.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof nH)return{kind:Fa.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Qg)return{kind:Fa.WebviewEditorInput,viewType:e.viewType};if(e instanceof Gke)return{kind:Fa.TerminalEditorInput};if(e instanceof op){if(e.modified instanceof Ib&&e.original instanceof Ib)return{kind:Fa.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof VM&&e.original instanceof VM)return{kind:Fa.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof Nke)return{kind:Fa.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof uEe)return{kind:Fa.ChatEditorInput};if(e instanceof sH){const t=[];for(const i of e?.resources.get()??[])i.original&&i.modified&&t.push({kind:Fa.TextDiffInput,original:i.original,modified:i.modified});return{kind:Fa.MultiDiffEditorInput,diffEditors:t}}return{kind:Fa.UnknownInput}}_generateTabId(e,t){let i;const s=jc.getCanonicalUri(e,{supportSideBySide:go.BOTH});return s instanceof P?i=s.toString():i=`${s?.primary?.toString()}-${s?.secondary?.toString()}`,`${t}~${e.editorId}-${e.typeId}-${i} `}_onDidGroupActivate(){const e=this._editorGroupsService.activeGroup.id,t=this._groupLookup.get(e);t&&(t.isActive=!0,this._proxy.$acceptTabGroupUpdate(t))}_onDidTabLabelChange(e,t,i){const s=this._generateTabId(t,e),o=this._tabInfoLookup.get(s);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:gu.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const s=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!s||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(s,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:s,editorInput:t,tab:a}),t instanceof sH&&this._multiDiffEditorInputListeners.set(t,T.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(s,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:gu.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:gu.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),s=this._groupLookup.get(e)?.tabs;if(!i||!s){this._createTabsModel();return}const o=s.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof sH&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:gu.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const s=i[t];s.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:s,kind:gu.TAB_UPDATE})}_onDidTabDirty(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s);if(!o){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}o.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o.tab,kind:gu.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=r.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:gu.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const s=this._generateTabId(i,e),o=this._tabInfoLookup.get(s),r=o?.group,a=o?.tab;if(!r||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!r.isPinned(t),this._proxy.$acceptTabOperation({kind:gu.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,s){const o=this._groupLookup.get(e)?.tabs;if(!o){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const r=o.splice(i,1);r.length!==0&&(o.splice(t,0,r[0]),this._proxy.$acceptTabOperation({kind:gu.TAB_MOVE,groupId:e,tabDto:r[0],index:t,oldIndex:i}))}_createTabsModel(){if(this._editorGroupsService.groups.length===0)return;this._tabGroupModel=[],this._groupLookup.clear(),this._tabInfoLookup.clear();let e=[];for(const t of this._editorGroupsService.groups){const i={groupId:t.id,isActive:t.id===this._editorGroupsService.activeGroup.id,viewColumn:U1(this._editorGroupsService,t),tabs:[]};t.editors.forEach((s,o)=>{const r=this._buildTabObject(t,s,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(s,t.id),{group:t,tab:r,editorInput:s})}),i.tabs=e,this._tabGroupModel.push(i),this._groupLookup.set(t.id,i),e=[]}this._proxy.$acceptEditorTabModel(this._tabGroupModel)}_updateTabsModel(e){const t=e.event,i=e.groupId;switch(t.kind){case qo.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case qo.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case qo.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case qo.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case qo.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case qo.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case qo.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case qo.EDITOR_TRANSIENT:break;case qo.EDITOR_MOVE:if(pjt(t)&&t.editor&&t.editorIndex!==void 0&&t.oldEditorIndex!==void 0){this._onDidTabMove(i,t.editorIndex,t.oldEditorIndex,t.editor);break}default:this._createTabsModel()}}$moveTab(e,t,i,s){const o=ane(this._editorGroupsService,this._configurationService,i),r=this._tabInfoLookup.get(e);if(!r?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(r.group.id);if(!l)return;if(this._groupLookup.get(o)===void 0){let h=v6.RIGHT;i===Cw&&(h=w6(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(o);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=r?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:s})}async $closeTab(e,t){const i=new Map;for(const o of e){const r=this._tabInfoLookup.get(o),a=r?.tab,c=r?.group,l=r?.editorInput;if(!c||!a||!r||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const s=[];for(const[o,r]of i)s.push(await o.closeEditors(r,{preserveFocus:t}));return s.every(o=>o)}async $closeGroup(e,t){const i=[];for(const s of e){const o=this._editorGroupsService.getGroup(s);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(s=>s)}};p8e=D([en(Ue.MainThreadEditorTabs),_(1,ur),_(2,Re),_(3,Ze),_(4,_i)],p8e);let m8e=class{dispose(){}$onUnexpectedError(e){if(e&&e.$isError){const{name:t,message:i,stack:s}=e;e=e.noTelemetry?new uc:new Error,e.message=i,e.name=t,e.stack=s}bt(e)}};m8e=D([en(Ue.MainThreadErrors)],m8e);const Uw="vs/workbench/api/browser/mainThreadExtensionService";let _8e=class{constructor(e,t,i,s,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=s,this._hostService=o,this._extensionEnablementService=r,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new jjt(e.getProxy(et.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Ue).map(h=>Ue[h]))}dispose(){}$getExtension(e){return this._extensionService.getExtension(e)}$activateExtension(e,t){return this._internalExtensionService._activateById(e,t)}async $onWillActivateExtension(e){this._internalExtensionService._onWillActivateExtension(e)}$onDidActivateExtension(e,t,i,s,o){this._internalExtensionService._onDidActivateExtension(e,t,i,s,o)}$onExtensionRuntimeError(e,t){const i=new Error;i.name=t.name,i.message=t.message,i.stack=t.stack,this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const s=new Error;if(s.name=t.name,s.message=t.message,s.stack=t.stack,this._internalExtensionService._onDidActivateExtensionError(e,s),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>gc(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(r,c.local);return}else{await this._handleMissingNotInstalledDependency(r,i.dependency);return}}}if(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment){this._notificationService.error(s);return}console.error(s.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:nt.Error,message:g(Uw,0,"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("reload",g(Uw,1,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const s=this._extensionEnablementService.getEnablementState(t);s===ga.DisabledByVirtualWorkspace?this._notificationService.notify({severity:nt.Error,message:g(Uw,2,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",i,t.manifest.displayName||t.manifest.name)}):s===ga.DisabledByTrustRequirement?this._notificationService.notify({severity:nt.Error,message:g(Uw,3,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("manageWorkspaceTrust",g(Uw,4,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:nt.Error,message:g(Uw,5,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",i,t.manifest.displayName||t.manifest.name),actions:{primary:[new xn("enable",g(Uw,6,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],s===ga.DisabledGlobally?ga.EnabledGlobally:ga.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:nt.Error,message:g(Uw,7,"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",i,t.manifest.displayName||t.manifest.name)})}}async _handleMissingNotInstalledDependency(e,t){const i=e.displayName||e.name;let s=null;try{s=(await this._extensionsWorkbenchService.getExtensions([{id:t}],qe.None))[0]}catch{}s?this._notificationService.notify({severity:nt.Error,message:g(Uw,8,"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",i,s.displayName,s.publisherDisplayName),actions:{primary:[new xn("install",g(Uw,9,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(s).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(Uw,10,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===Ao.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===Ao.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return lp.uriToBrowserUri(P.revive(e))}async $getAllStaticBrowserUris(){return Array.from(lp.getRegisteredBrowserUris(),e=>[e,lp.uriToBrowserUri(e)])}};_8e=D([en(Ue.MainThreadExtensionService),_(1,ho),_(2,Pi),_(3,pr),_(4,Id),_(5,Kh),_(6,Det),_(7,ji),_(8,Za)],_8e);class jjt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Kjt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&P.revive(i)}startExtensionHost(e){return this._actual.$startExtensionHost(e)}extensionTestsExecute(){return this._actual.$extensionTestsExecute()}activateByEvent(e,t){return this._actual.$activateByEvent(e,t)}activate(e,t){return this._actual.$activate(e,t)}setRemoteEnvironment(e){return this._actual.$setRemoteEnvironment(e)}updateRemoteConnectionData(e){return this._actual.$updateRemoteConnectionData(e)}deltaExtensions(e){return this._actual.$deltaExtensions(e)}test_latency(e){return this._actual.$test_latency(e)}test_up(e){return this._actual.$test_up(e)}test_down(e){return this._actual.$test_down(e)}}function Kjt(n){return n.type==="ok"?{type:"ok",value:{...n.value,authority:Yjt(n.value.authority)}}:n}function Yjt(n){return{...n,connectTo:Jjt(n.connectTo)}}function Jjt(n){return n.type===KV.WebSocket?new Vst(n.host,n.port):new Ust(n.id)}var Z_;let v8e=Z_=class{constructor(e,t){this._fileService=t,this._fileProvider=new Zo,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostFileSystem);const i=e.getProxy(et.ExtHostFileSystemInfo);for(const s of t.listCapabilities())i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(s=>i.$acceptProviderInfos(P.from({scheme:s.scheme,path:"/dummy"}),s.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,s){this._fileProvider.set(e,new DOe(this._fileService,t,i,s,e,this._proxy))}$unregisterProvider(e){this._fileProvider.deleteAndDispose(e)}$onFileSystemChange(e,t){const i=this._fileProvider.get(e);if(!i)throw new Error("Unknown file provider");i.$onFileSystemChange(t)}$stat(e){return this._fileService.stat(P.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?vm.Readonly:void 0,type:Z_._asFileType(t)})).catch(Z_._handleError)}$readdir(e){return this._fileService.resolve(P.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=rt.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Z_._asFileType(i)]):[]}).catch(Z_._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=an.File:e.isDirectory&&(t+=an.Directory),e.isSymbolicLink&&(t+=an.SymbolicLink),t}$readFile(e){return this._fileService.readFile(P.revive(e)).then(t=>t.value).catch(Z_._handleError)}$writeFile(e,t){return this._fileService.writeFile(P.revive(e),t).then(()=>{}).catch(Z_._handleError)}$rename(e,t,i){return this._fileService.move(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$copy(e,t,i){return this._fileService.copy(P.revive(e),P.revive(t),i.overwrite).then(()=>{}).catch(Z_._handleError)}$mkdir(e){return this._fileService.createFolder(P.revive(e)).then(()=>{}).catch(Z_._handleError)}$delete(e,t){return this._fileService.del(P.revive(e),t).catch(Z_._handleError)}static _handleError(e){if(e instanceof Ah)switch(e.fileOperationResult){case Zi.FILE_NOT_FOUND:e.name=rt.FileNotFound;break;case Zi.FILE_IS_DIRECTORY:e.name=rt.FileIsADirectory;break;case Zi.FILE_PERMISSION_DENIED:e.name=rt.NoPermissions;break;case Zi.FILE_MOVE_CONFLICT:e.name=rt.FileExists;break}else if(e instanceof Error){const t=w1(e);t!==rt.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};v8e=Z_=D([en(Ue.MainThreadFileSystem),_(1,ci)],v8e);class DOe{constructor(e,t,i,s,o,r){this.readOnlyMessage=s,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=T.None,this.capabilities=i,this._registration=e.registerProvider(t,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(e,t){const i=Math.random();return this._proxy.$watch(this._handle,i,e,t),Ee(()=>{this._proxy.$unwatch(this._handle,i)})}$onFileSystemChange(e){this._onDidChange.fire(e.map(DOe._createFileChange))}static _createFileChange(e){return{resource:P.revive(e.resource),type:e.type}}stat(e){return this._proxy.$stat(this._handle,e).then(void 0,t=>{throw t})}readFile(e){return this._proxy.$readFile(this._handle,e).then(t=>t.buffer)}writeFile(e,t,i){return this._proxy.$writeFile(this._handle,e,ze.wrap(t),i)}delete(e,t){return this._proxy.$delete(this._handle,e,t)}mkdir(e){return this._proxy.$mkdir(this._handle,e)}readdir(e){return this._proxy.$readdir(this._handle,e)}rename(e,t,i){return this._proxy.$rename(this._handle,e,t,i)}copy(e,t,i){return this._proxy.$copy(this._handle,e,t,i)}open(e,t){return this._proxy.$open(this._handle,e,t)}close(e){return this._proxy.$close(this._handle,e)}read(e,t,i,s,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,s),r.byteLength))}write(e,t,i,s,o){return this._proxy.$write(this._handle,e,t,ze.wrap(i).slice(s,s+o))}}const fW=class fW extends ${constructor(e,t,i,s){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=s,this.watcherDisposables=this._register(new Dn),this.requests=void 0,this.restartsPerRequestError=new Map,this.restartsPerUnknownError=0}init(){const e=new Z;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){if(this.options.restartOnError&&this.requests?.length)if(t){const i=this.restartsPerRequestError.get(t.path)??0;is.path!==t.path)))}else this.restartsPerUnknownError{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,w,b,C,y){if(b?.isUndoing)return;const S=new ai(y),M=setTimeout(()=>S.cancel(),C),k=await o.withProgress({location:ch.Notification,title:this._progressLabel(w),cancellable:!0,delay:Math.min(C/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(w,v,C,S.token);return dw(z,S.token)},()=>{S.cancel()}).finally(()=>{S.dispose(),clearTimeout(M)});if(!k||k.edit.edits.length===0)return;const F=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let N=a.getBoolean(RX.MementoKeyAdditionalEdits,ke.PROFILE);if(l.extensionTestsLocationURI&&(N=!1),N===void 0){let z;if(k.extensionNames.length===1?w===Li.CREATE?z=g(Rd,0,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):w===Li.COPY?z=g(Rd,1,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):w===Li.MOVE?z=g(Rd,2,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(Rd,3,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):w===Li.CREATE?z=g(Rd,4,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):w===Li.COPY?z=g(Rd,5,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):w===Li.MOVE?z=g(Rd,6,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(Rd,7,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),F){const{confirmed:U}=await r.confirm({type:nt.Info,message:z,primaryButton:g(Rd,8,"Show &&Preview"),cancelButton:g(Rd,9,"Skip Changes")});if(N=!0,!U)return}else{let U;(function(re){re[re.OK=0]="OK",re[re.Preview=1]="Preview",re[re.Cancel=2]="Cancel"})(U||(U={}));const{result:J,checkboxChecked:j}=await r.prompt({type:nt.Info,message:z,buttons:[{label:g(Rd,10,"&&OK"),run:()=>U.OK},{label:g(Rd,8,"Show &&Preview"),run:()=>U.Preview}],cancelButton:{label:g(Rd,9,"Skip Changes"),run:()=>U.Cancel},checkbox:{label:g(Rd,11,"Do not ask me again")}});if(J===U.Cancel)return;N=J===U.Preview,j&&a.store(RX.MementoKeyAdditionalEdits,N,ke.PROFILE,ln.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await s.apply(AS(k.edit,d),{undoRedoGroupId:b?.undoRedoGroupId,showPreview:N})}_progressLabel(v){switch(v){case Li.CREATE:return g(Rd,12,"Running 'File Create' participants...");case Li.MOVE:return g(Rd,13,"Running 'File Rename' participants...");case Li.COPY:return g(Rd,14,"Running 'File Copy' participants...");case Li.DELETE:return g(Rd,15,"Running 'File Delete' participants...");case Li.WRITE:return g(Rd,16,"Running 'File Write' participants...")}}};this._listener.add(i.addFileOperationParticipant(m)),this._listener.add(i.onDidRunWorkingCopyFileOperation(v=>this._proxy.$onDidRunFileOperation(v.operation,v.files)))}async $watch(e,t,i,s,o){const r=P.revive(i),a={...s};if(a.recursive)try{(await this._fileService.stat(r)).isDirectory||(a.recursive=!1)}catch{}if(o){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(r,a));c.add(l.onDidChange(d=>{this._proxy.$onFileEvent({session:t,created:d.rawAdded,changed:d.rawUpdated,deleted:d.rawDeleted})})),this._watches.set(t,c)}else{this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching uncorrelated (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(r);if(a.recursive&&a.excludes.length===0){const d=this._configurationService.getValue();if(d.files?.watcherExclude)for(const h in d.files.watcherExclude)h&&d.files.watcherExclude[h]===!0&&a.excludes.push(h)}else if(!a.recursive&&c){const d=this._configurationService.getValue();if(d.files?.watcherExclude){for(const h in d.files.watcherExclude)if(h&&d.files.watcherExclude[h]===!0){a.includes||(a.includes=[]);const u=`${IS(h,"/")}/${mR}`;a.includes.push(Xjt(c.uri.fsPath,u))}}if(!a.includes||a.includes.length===0){this._logService.trace(`MainThreadFileSystemEventService#$watch(): ignoring request to start watching because path is inside workspace and no excludes are configured (extension: ${e}, path: ${r.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(r,a);this._watches.set(t,l)}}$unwatch(e){this._watches.has(e)&&(this._logService.trace(`MainThreadFileSystemEventService#$unwatch(): request to stop watching (session: ${e})`),this._watches.deleteAndDispose(e))}dispose(){this._listener.dispose(),this._watches.dispose()}},RX=VP,VP.MementoKeyAdditionalEdits="file.particpants.additionalEdits",VP);qke=RX=D([en(Ue.MainThreadFileSystemEventService),_(1,ci),_(2,fC),_(3,vO),_(4,Cf),_(5,To),_(6,on),_(7,Ze),_(8,Il),_(9,_o),_(10,Ti),_(11,Ze),_(12,Re)],qke);At(class extends pi{constructor(){super({id:"files.participants.resetChoice",title:{value:g(Rd,17,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get(on).remove(qke.MementoKeyAdditionalEdits,ke.PROFILE)}});const Bf=Symbol("unset");class qse{constructor(){this.root=new Jpe,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||fi.empty()}insert(e,t,i){this.opNode(e,s=>s._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===Bf?void 0:i._value))}mutatePath(e,t){this.opNode(e,()=>{},i=>t(i))}delete(e){const t=this.getPathToKey(e);if(!t)return;let i=t.length-1;const s=t[i].node._value;if(s!==Bf){for(this._size--,t[i].node._value=Bf;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==Bf)break;t[i-1].node.children.delete(r)}return s}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let s=t.length-1;s>0;s--){const o=t[s-1];if(o.node.children.delete(t[s].part),o.node.children.size>0||o.node._value!==Bf)break}for(const s of b8e(i))s._value!==Bf&&(this._size--,yield s._value)}find(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return;t=s}return t._value===Bf?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;if(s._value!==Bf)return!0;t=s}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return!0}hasKey(e){let t=this.root;for(const i of e){const s=t.children?.get(i);if(!s)return!1;t=s}return t._value!==Bf}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const s of e){const o=t[i].node.children?.get(s);if(!o)return;t.push({part:s,node:o}),i++}return t}opNode(e,t,i){let s=this.root;for(const a of e){if(s.children)if(s.children.has(a))s=s.children.get(a);else{const c=new Jpe;s.children.set(a,c),s=c}else{const c=new Jpe;s.children=new Map([[a,c]]),s=c}i?.(s)}const o=s._value===Bf?0:1;t(s);const r=s._value===Bf?0:1;this._size+=r-o}*values(){for(const{_value:e}of b8e(this.root))e!==Bf&&(yield e)}}function*b8e(n){const e=[n];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Jpe=class{constructor(){this._value=Bf}get value(){return this._value===Bf?void 0:this._value}set value(e){this._value=e===void 0?Bf:e}};var qf;(function(n){n.Delimiter="\0"})(qf||(qf={}));var lb;(function(n){n[n.IsSame=0]="IsSame",n[n.Disconnected=1]="Disconnected",n[n.IsChild=2]="IsChild",n[n.IsParent=3]="IsParent"})(lb||(lb={}));class bn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new bn([t]);const s=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)s.push(o.id);return s.push(t),new bn(s.reverse())}static isRoot(e){return!e.includes(qf.Delimiter)}static root(e){const t=e.indexOf(qf.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new bn(e.split(qf.Delimiter))}static join(e,t){return new bn([...e.path,t])}static joinToString(e,t){return e.toString()+qf.Delimiter+t}static parentId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(qf.Delimiter);return t===-1?e:e.slice(t+qf.Delimiter.length)}static isChild(e,t){return t.startsWith(e)&&t[e.length]===qf.Delimiter}static compare(e,t){return e===t?lb.IsSame:bn.isChild(e,t)?lb.IsChild:bn.isChild(t,e)?lb.IsParent:lb.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new bn(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 e=1;e<=this.viewEnd;e++)yield new bn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new bn(this.path,e)}compare(e){if(typeof e=="string")return bn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?lb.IsChild:e.viewEnd"runId"in n;var A4;(function(n){n.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({range:O.lift(t.range),uri:e.asCanonicalUri(P.revive(t.uri))})})(A4||(A4={}));var dC;(function(n){n[n.Error=0]="Error",n[n.Output=1]="Output"})(dC||(dC={}));var Qse;(function(n){n.serialize=e=>({message:e.message,type:dC.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&A4.deserialize(e,t.location)})})(Qse||(Qse={}));const eKt=(n,e)=>`${e?"s":"e"}${n}`;var jse;(function(n){n.serialize=e=>({message:e.message,type:dC.Output,offset:e.offset,length:e.length,location:e.location&&A4.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:dC.Output,offset:t.offset,length:t.length,location:t.location&&A4.deserialize(e,t.location)})})(jse||(jse={}));var yG;(function(n){n.serialize=e=>e.type===dC.Error?Qse.serialize(e):jse.serialize(e),n.deserialize=(e,t)=>t.type===dC.Error?Qse.deserialize(e,t):jse.deserialize(e,t)})(yG||(yG={}));var b8;(function(n){n.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),n.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(yG.serialize)}),n.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>yG.deserialize(e,i))})})(b8||(b8={}));const irt="\0",MX=(n,e)=>n+irt+e,nrt=n=>{const e=n.indexOf(irt);return{ctrlId:n.slice(0,e),tagId:n.slice(e+1)}};var SG;(function(n){n.serialize=e=>({extId:e.extId,label:e.label,tags:e.tags,busy:e.busy,children:void 0,uri:e.uri?.toJSON(),range:e.range?.toJSON()||null,description:e.description,error:e.error,sortText:e.sortText}),n.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(P.revive(t.uri)):void 0,range:t.range?O.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(SG||(SG={}));var Eh;(function(n){n[n.NotExpandable=0]="NotExpandable",n[n.Expandable=1]="Expandable",n[n.BusyExpanding=2]="BusyExpanding",n[n.Expanded=3]="Expanded"})(Eh||(Eh={}));var QI;(function(n){n.serialize=e=>({expand:e.expand,item:SG.serialize(e.item)}),n.deserialize=(e,t)=>({controllerId:bn.root(t.item.extId),expand:t.expand,item:SG.deserialize(e,t.item)})})(QI||(QI={}));var AG;(function(n){n.serialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.uri!==void 0&&(t.uri=e.item.uri?.toJSON()),e.item.range!==void 0&&(t.range=e.item.range?.toJSON()),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}},n.deserialize=e=>{let t;return e.item&&(t={},e.item.label!==void 0&&(t.label=e.item.label),e.item.tags!==void 0&&(t.tags=e.item.tags),e.item.busy!==void 0&&(t.busy=e.item.busy),e.item.range!==void 0&&(t.range=e.item.range?O.lift(e.item.range):null),e.item.description!==void 0&&(t.description=e.item.description),e.item.error!==void 0&&(t.error=e.item.error),e.item.sortText!==void 0&&(t.sortText=e.item.sortText)),{extId:e.extId,expand:e.expand,item:t}}})(AG||(AG={}));const Qke=(n,e)=>{e.expand!==void 0&&(n.expand=e.expand),e.item!==void 0&&(n.item=n.item?Object.assign(n.item,e.item):e.item)};var Kse;(function(n){n.serializeWithoutMessages=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serializeWithoutMessages)}),n.serialize=e=>({...QI.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(b8.serialize)}),n.deserialize=(e,t)=>({...QI.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>b8.deserialize(e,i)),retired:!0})})(Kse||(Kse={}));var jke;(function(n){n.empty=()=>({covered:0,total:0}),n.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(jke||(jke={}));var Yse;(function(n){n.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testId:e.testId?.toString(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testId:t.testId?bn.fromString(t.testId):void 0,uri:e.asCanonicalUri(P.revive(t.uri))}),n.empty=(e,t)=>({id:e,uri:t,testId:void 0,statement:jke.empty()})})(Yse||(Yse={}));function kOe(n){return{...n,location:n.location?.toJSON()}}function IOe(n){return n.location=n.location?oe.isIPosition(n.location)?oe.lift(n.location):O.lift(n.location):void 0,n}var E4;(function(n){n[n.Declaration=0]="Declaration",n[n.Statement=1]="Statement",n[n.Branch=2]="Branch"})(E4||(E4={}));var Kke;(function(n){n.serialize=e=>e.type===E4.Declaration?Xse.serialize(e):Zse.serialize(e),n.deserialize=e=>e.type===E4.Declaration?Xse.deserialize(e):Zse.deserialize(e)})(Kke||(Kke={}));var Jse;(function(n){n.serialize=kOe,n.deserialize=IOe})(Jse||(Jse={}));var Xse;(function(n){n.serialize=kOe,n.deserialize=IOe})(Xse||(Xse={}));var Zse;(function(n){n.serialize=e=>({...kOe(e),branches:e.branches?.map(Jse.serialize)}),n.deserialize=e=>({...IOe(e),branches:e.branches?.map(Jse.deserialize)})})(Zse||(Zse={}));var Wa;(function(n){n[n.Add=0]="Add",n[n.Update=1]="Update",n[n.DocumentSynced=2]="DocumentSynced",n[n.Remove=3]="Remove",n[n.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",n[n.Retire=5]="Retire",n[n.AddTag=6]="AddTag",n[n.RemoveTag=7]="RemoveTag"})(Wa||(Wa={}));var x4;(function(n){n.deserialize=(e,t)=>t.op===Wa.Add?{op:t.op,item:QI.deserialize(e,t.item)}:t.op===Wa.Update?{op:t.op,item:AG.deserialize(t.item)}:t.op===Wa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(P.revive(t.uri)),docv:t.docv}:t,n.serialize=e=>e.op===Wa.Add?{op:e.op,item:QI.serialize(e.item)}:e.op===Wa.Update?{op:e.op,item:AG.serialize(e.item)}:e})(x4||(x4={}));class tKt{constructor(e){this.uriIdentity=e,this._tags=new Map,this.items=new Map,this.roots=new Set,this.busyControllerCount=0,this.pendingRootCount=0,this.tags=this._tags}apply(e){const t=this.createChangeCollector();for(const i of e)switch(i.op){case Wa.Add:this.add(QI.deserialize(this.uriIdentity,i.item),t);break;case Wa.Update:this.update(AG.deserialize(i.item),t);break;case Wa.Remove:this.remove(i.itemId,t);break;case Wa.Retire:this.retireTest(i.itemId);break;case Wa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case Wa.AddTag:this._tags.set(i.tag.id,i.tag);break;case Wa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=bn.parentId(e.item.extId)?.toString();let s;if(!i)s=this.createItem(e),this.roots.add(s),this.items.set(e.item.extId,s);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),s=this.createItem(e,o),this.items.set(e.item.extId,s)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(s),e.expand===Eh.BusyExpanding&&this.busyControllerCount++,s}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Eh.BusyExpanding&&this.busyControllerCount--,e.expand===Eh.BusyExpanding&&this.busyControllerCount++),Qke(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const s=bn.parentId(i.item.extId)?.toString();s?this.items.get(s).children.delete(i.item.extId):this.roots.delete(i);const o=[[e]];for(;o.length;)for(const r of o.pop()){const a=this.items.get(r);a&&(o.push(a.children),this.items.delete(r),t.remove?.(a,a!==i),a.expand===Eh.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Mh;(function(n){n[n.Upsert=0]="Upsert",n[n.SetTags=1]="SetTags",n[n.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",n[n.RemoveChild=3]="RemoveChild",n[n.SetProp=4]="SetProp",n[n.Bulk=5]="Bulk",n[n.DocumentSynced=6]="DocumentSynced"})(Mh||(Mh={}));const W5=(n,e)=>n===e,iKt={range:(n,e)=>n===e?!0:!n||!e?!1:n.equalsRange(e),busy:W5,label:W5,description:W5,error:W5,sortText:W5,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.includes(t)))},nKt=Object.entries(iKt),sKt=(n,e)=>{let t;for(const[i,s]of nKt)s(n[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class oKt extends ${get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new yn(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new I),this.tree=new Map,this.tags=new Map,this.diff=[],this.onDidGenerateDiff=this.diffOpEmitter.event,this.root.canResolveChildren=!0,this.upsertItem(this.root,void 0)}set resolveHandler(e){this._resolveHandler=e;for(const t of this.tree.values())this.updateExpandability(t)}get resolveHandler(){return this._resolveHandler}collectDiff(){const e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case Wa.DocumentSynced:{for(const t of this.diff)if(t.op===Wa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case Wa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===Wa.Update&&t.item.extId===e.item.extId){Qke(t.item,e.item);return}if(t.op===Wa.Add&&t.item.item.extId===e.item.extId){Qke(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){const i=this.tree.get(e);if(i){if((i.expandLevels===void 0||t>i.expandLevels)&&(i.expandLevels=t),i.expand===Eh.Expandable){const s=this.resolveChildren(i);return s.isOpen()?this.expandChildren(i,t-1):s.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Eh.Expanded)return i.resolveBarrier?.isOpen()===!1?i.resolveBarrier.wait().then(()=>this.expandChildren(i,t-1)):this.expandChildren(i,t-1)}}dispose(){for(const e of this.tree.values())this.options.getApiFor(e.actual).listener=void 0;this.tree.clear(),this.diff=[],super.dispose()}onTestItemEvent(e,t){switch(t.op){case Mh.RemoveChild:this.removeItem(bn.joinToString(e.fullId,t.id));break;case Mh.Upsert:this.upsertItem(t.item,e);break;case Mh.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Mh.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Mh.UpdateCanResolveChildren:this.updateExpandability(e);break;case Mh.SetProp:this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Mh.DocumentSynced:this.documentSynced(e.actual.uri);break;default:oQ()}}documentSynced(e){e&&this.pushDiff({op:Wa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=bn.fromExtHostTestItem(e,this.root.id,t?.actual),s=this.options.getApiFor(e);s.parent&&s.parent!==t?.actual&&this.options.getChildren(s.parent).delete(e.id);let o=this.tree.get(i.toString());if(!o){o={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Eh.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:Wa.Add,item:{controllerId:this.options.controllerId,expand:o.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,o,t);return}if(o.actual===e){this.connectItem(e,o,t);return}if(o.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const r=this.options.getChildren(o.actual),a=o.actual,c=sKt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Eh.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Mh.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(bn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Eh.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const s=new Set(t.map(o=>o.id));for(const o of e)s.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:Wa.Update,item:{extId:i,item:{tags:e.map(o=>MX(this.options.controllerId,o.id))}}}),s.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){const t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:Wa.AddTag,tag:{id:MX(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:Wa.RemoveTag,id:MX(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,i){this.setItemParent(e,i);const s=this.options.getApiFor(e);s.parent=i?.actual,s.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[s,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Eh.Expanded:Eh.BusyExpanding:t=e.actual.canResolveChildren?Eh.Expandable:Eh.NotExpandable:t=Eh.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Eh.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[s,o]of this.options.getChildren(e.actual)){const r=this.expand(bn.joinToString(e.fullId,o.id),t);NS(r)&&i.push(r)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const o=new Uh;return o.open(),o}e.expand=Eh.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new Uh,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let s;try{s=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return NS(s)?s.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:Wa.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){const t=this.tree.get(e);if(!t)throw new Error("attempting to remove non-existent child");this.pushDiff({op:Wa.Remove,itemId:e});const i=[t];for(;i.length;){const s=i.pop();if(s){this.options.getApiFor(s.actual).listener=void 0;for(const o of s.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(s.fullId.toString());for(const[o,r]of this.options.getChildren(s.actual))i.push(this.tree.get(bn.joinToString(s.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class rKt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class eoe extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class aKt extends Error{constructor(e,t,i){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${i}".`)}}const cKt=(n,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(s,o){for(const r of i.values())s.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(s){const o=new Map,r=new Set(i.keys()),a={op:Mh.Bulk,ops:[]};for(const c of s){if(!(c instanceof t))throw new eoe(c.id);const l=e(c).controllerId;if(l!==n.controllerId)throw new aKt(c.id,l,n.controllerId);if(o.has(c.id))throw new rKt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Mh.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Mh.RemoveChild,id:c});n.listener?.(a),i=o},add(s){if(!(s instanceof t))throw new eoe(s.id);i.set(s.id,s),n.listener?.({op:Mh.Upsert,item:s})},delete(s){i.delete(s)&&n.listener?.({op:Mh.RemoveChild,id:s})},get(s){return i.get(s)},toJSON(){return Array.from(i.values())}}},srt=new WeakMap,lKt=(n,e)=>{const t={controllerId:e};return srt.set(n,t),t},oue=n=>{const e=srt.get(n);if(!e)throw new eoe(n?.id||"");return e},S2="vs/workbench/contrib/chat/common/languageModels";var sk;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.Assistant=2]="Assistant"})(sk||(sk={}));const y8e={type:"object",properties:{vendor:{type:"string",description:g(S2,0,"A globally unique vendor of language models.")}}},dKt=Ap.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(S2,1,"Contribute language models of a specific vendor."),oneOf:[y8e,{type:"array",items:y8e}]},activationEventsGenerator:(n,e)=>{for(const t of n)e.push(`onLanguageModelChat:${t.vendor}`)}});let S8e=class{constructor(e,t){this._extensionService=e,this._logService=t,this._store=new Z,this._providers=new Map,this._vendors=new Set,this._onDidChangeProviders=this._store.add(new I),this.onDidChangeLanguageModels=this._onDidChangeProviders.event,this._store.add(dKt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!Cd(o.description,"chatProvider")){o.collector.error(g(S2,2,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of fi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(S2,3,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(Xv(r.vendor)){o.collector.error(g(S2,4,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(S2,5,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const s=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),s.push(o));s.length>0&&this._onDidChangeProviders.fire({removed:s})}))}dispose(){this._store.dispose(),this._providers.clear()}getLanguageModelIds(){return Array.from(this._providers.keys())}lookupLanguageModel(e){return this._providers.get(e)?.metadata}async selectLanguageModels(e){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`);else{const i=Array.from(this._vendors).map(s=>this._extensionService.activateByEvent(`onLanguageModelChat:${s}`));await Promise.all(i)}const t=[];for(const[i,s]of this._providers)(e.vendor===void 0||s.metadata.vendor===e.vendor)&&(e.family===void 0||s.metadata.family===e.family)&&(e.version===void 0||s.metadata.version===e.version)&&(e.identifier===void 0||s.metadata.id===e.identifier)&&(!s.metadata.targetExtensions||s.metadata.targetExtensions.some(o=>Cn.equals(o,e.extension)))&&t.push(i);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelChat(e,t){if(this._logService.trace("[LM] registering language model chat",e,t.metadata),!this._vendors.has(t.metadata.vendor))throw new Error(`Chat response provider uses UNKNOWN vendor ${t.metadata.vendor}.`);if(this._providers.has(e))throw new Error(`Chat response provider with identifier ${e} is already registered.`);return this._providers.set(e,t),this._onDidChangeProviders.fire({added:[{identifier:e,metadata:t.metadata}]}),Ee(()=>{this._providers.delete(e)&&(this._onDidChangeProviders.fire({removed:[e]}),this._logService.trace("[LM] UNregistered language model chat",e,t.metadata))})}makeLanguageModelChatRequest(e,t,i,s,o,r){const a=this._providers.get(e);if(!a)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return a.provideChatResponse(i,t,s,o,r)}computeTokenLength(e,t,i){const s=this._providers.get(e);if(!s)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return s.provideTokenCount(t,i)}};S8e=D([_(0,ho),_(1,Ze)],S8e);var ZS;(function(n){function e(i){const{selectionStartLineNumber:s,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new Ps(s-1,o-1),l=new Ps(r-1,a-1);return new XS(c,l)}n.to=e;function t(i){const{anchor:s,active:o}=i;return{selectionStartLineNumber:s.line+1,selectionStartColumn:s.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}n.from=t})(ZS||(ZS={}));var at;(function(n){function e(i){if(!i)return;const{start:s,end:o}=i;return{startLineNumber:s.line+1,startColumn:s.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}n.from=e;function t(i){if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=i;return new rs(s-1,o-1,r-1,a-1)}n.to=t})(at||(at={}));var yx;(function(n){function e(i){return{uri:i.uri,range:at.from(i.range)}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(yx||(yx={}));var Yke;(function(n){function e(t){switch(t){case Ar.Comment:return UE.Comment;case Ar.Other:return UE.Other;case Ar.RegEx:return UE.RegEx;case Ar.String:return UE.String}}n.to=e})(Yke||(Yke={}));var Wr;(function(n){function e(i){return new Ps(i.lineNumber-1,i.column-1)}n.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}n.from=t})(Wr||(Wr={}));var D4;(function(n){function e(s,o,r){return Ui(Kb(s).map(a=>t(a,o,r)))}n.from=e;function t(s,o,r){if(typeof s=="string")return{$serialized:!0,language:s,isBuiltin:r?.isBuiltin};if(s)return{$serialized:!0,language:s.language,scheme:i(s.scheme,o),pattern:Zp.from(s.pattern)??void 0,exclusive:s.exclusive,notebookType:s.notebookType,isBuiltin:r?.isBuiltin}}function i(s,o){return o&&typeof s=="string"?o.transformOutgoingScheme(s):s}})(D4||(D4={}));var toe;(function(n){function e(i){switch(i){case mI.Unnecessary:return Ev.Unnecessary;case mI.Deprecated:return Ev.Deprecated}}n.from=e;function t(i){switch(i){case Ev.Unnecessary:return mI.Unnecessary;case Ev.Deprecated:return mI.Deprecated;default:return}}n.to=t})(toe||(toe={}));var k4;(function(n){function e(i){let s;return i.code&&(zt(i.code)||Kc(i.code)?s=String(i.code):s={value:String(i.code.value),target:i.code.target}),{...at.from(i.range),message:i.message,source:i.source,code:s,severity:noe.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(ioe.from),tags:Array.isArray(i.tags)?Ui(i.tags.map(toe.from)):void 0}}n.from=e;function t(i){const s=new R6(at.to(i),i.message,noe.to(i.severity));return s.source=i.source,s.code=zt(i.code)?i.code:i.code?.value,s.relatedInformation=i.relatedInformation&&i.relatedInformation.map(ioe.to),s.tags=i.tags&&Ui(i.tags.map(toe.to)),s}n.to=t})(k4||(k4={}));var ioe;(function(n){function e(i){return{...at.from(i.location.range),message:i.message,resource:i.location.uri}}n.from=e;function t(i){return new e4(new _p(i.resource,at.to(i)),i.message)}n.to=t})(ioe||(ioe={}));var noe;(function(n){function e(i){switch(i){case Th.Error:return Ys.Error;case Th.Warning:return Ys.Warning;case Th.Information:return Ys.Info;case Th.Hint:return Ys.Hint}return Ys.Error}n.from=e;function t(i){switch(i){case Ys.Info:return Th.Information;case Ys.Warning:return Th.Warning;case Ys.Error:return Th.Error;case Ys.Hint:return Th.Hint;default:return Th.Error}}n.to=t})(noe||(noe={}));var yd;(function(n){function e(i){return typeof i=="number"&&i>=c4.One?i-1:i===c4.Beside?Cw:wx}n.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}n.to=t})(yd||(yd={}));function hKt(n){return typeof n.range<"u"}function ort(n){return n.length===0?!0:!!hKt(n[0])}var Qs;(function(n){function e(a){return a.map(n.from)}n.fromMany=e;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function i(a){let c;if(t(a)){const{language:u,value:f}=a;c={value:"```"+u+` +`+f+"\n```\n"}}else vp.isMarkdownString(a)?c={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,baseUri:a.baseUri}:typeof a=="string"?c={value:a}:c={value:""};const l=Object.create(null);c.uris=l;const d=u=>{try{let f=P.parse(u,!0);f=f.with({query:s(f.query,l)}),l[u]=f}catch{}return""},h=new Xg.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(eJe(u).href):"",Xg(c.value,{renderer:h}),c}n.from=i;function s(a,c){if(!a)return a;let l;try{l=JU(a)}catch{}if(!l)return a;let d=!1;return l=AU(l,h=>{if(P.isUri(h)){const u=`__uri_${Math.random().toString(16).slice(2,8)}`;return c[u]=h,d=!0,u}else return}),d?JSON.stringify(l):a}function o(a){const c=new vp(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?P.from(a.baseUri):void 0,c}n.to=o;function r(a){if(a)return typeof a=="string"?a:n.from(a)}n.fromStrict=r})(Qs||(Qs={}));function uKt(n){return ort(n)?n.map(e=>({range:at.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Qs.fromMany(e.hoverMessage):e.hoverMessage?Qs.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:at.from(e)}))}function rue(n){return typeof n>"u"?n:typeof n=="string"?P.file(n):n}var I4;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?rue(t.contentIconPath):void 0,border:t.border,borderColor:t.borderColor,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,color:t.color,backgroundColor:t.backgroundColor,margin:t.margin,width:t.width,height:t.height}}n.from=e})(I4||(I4={}));var soe;(function(n){function e(t){return typeof t>"u"?t:{backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(soe||(soe={}));var Jke;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case _I.OpenOpen:return gi.AlwaysGrowsWhenTypingAtEdges;case _I.ClosedClosed:return gi.NeverGrowsWhenTypingAtEdges;case _I.OpenClosed:return gi.GrowsOnlyWhenTypingBefore;case _I.ClosedOpen:return gi.GrowsOnlyWhenTypingAfter}}n.from=e})(Jke||(Jke={}));var Xke;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?Jke.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?soe.from(t.light):void 0,dark:t.dark?soe.from(t.dark):void 0,backgroundColor:t.backgroundColor,outline:t.outline,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,outlineWidth:t.outlineWidth,border:t.border,borderColor:t.borderColor,borderRadius:t.borderRadius,borderSpacing:t.borderSpacing,borderStyle:t.borderStyle,borderWidth:t.borderWidth,fontStyle:t.fontStyle,fontWeight:t.fontWeight,textDecoration:t.textDecoration,cursor:t.cursor,color:t.color,opacity:t.opacity,letterSpacing:t.letterSpacing,gutterIconPath:t.gutterIconPath?rue(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?I4.from(t.before):void 0,after:t.after?I4.from(t.after):void 0}}n.from=e})(Xke||(Xke={}));var nh;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&R4.from(i.newEol),range:at.from(i.range)}}n.from=e;function t(i){const s=new qx(at.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:R4.to(i.eol),s}n.to=t})(nh||(nh={}));var lf;(function(n){function e(i,s){const o={edits:[]};if(i instanceof q1){const r=new o1;for(const a of i._allEntries())a._type===sl.File&&P.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===sl.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:fMe(ze.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),o.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===sl.Text?o.edits.push({resource:a.uri,textEdit:nh.from(a.edit),versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Snippet?o.edits.push({resource:a.uri,textEdit:{range:at.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===sl.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===sl.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:G1.Replace,index:a.index,count:a.count,cells:a.cells.map(IG.from)}})}return o}n.from=e;function t(i){const s=new q1,o=new wi;for(const r of i.edits)if(r.textEdit){const a=r,c=P.revive(a.resource),l=at.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=zhe.replace(l,new Q1(d)):u=qx.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else s.renameFile(P.revive(r.oldResource),P.revive(r.newResource),r.options);for(const[r,a]of o)s.set(r,a);return s}n.to=t})(lf||(lf={}));var Sw;(function(n){const e=Object.create(null);e[Gr.File]=_t.File,e[Gr.Module]=_t.Module,e[Gr.Namespace]=_t.Namespace,e[Gr.Package]=_t.Package,e[Gr.Class]=_t.Class,e[Gr.Method]=_t.Method,e[Gr.Property]=_t.Property,e[Gr.Field]=_t.Field,e[Gr.Constructor]=_t.Constructor,e[Gr.Enum]=_t.Enum,e[Gr.Interface]=_t.Interface,e[Gr.Function]=_t.Function,e[Gr.Variable]=_t.Variable,e[Gr.Constant]=_t.Constant,e[Gr.String]=_t.String,e[Gr.Number]=_t.Number,e[Gr.Boolean]=_t.Boolean,e[Gr.Array]=_t.Array,e[Gr.Object]=_t.Object,e[Gr.Key]=_t.Key,e[Gr.Null]=_t.Null,e[Gr.EnumMember]=_t.EnumMember,e[Gr.Struct]=_t.Struct,e[Gr.Event]=_t.Event,e[Gr.Operator]=_t.Operator,e[Gr.TypeParameter]=_t.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:_t.Property}n.from=t;function i(s){for(const o in e)if(e[o]===s)return Number(o);return Gr.Property}n.to=i})(Sw||(Sw={}));var Qx;(function(n){function e(i){switch(i){case i4.Deprecated:return k9.Deprecated}}n.from=e;function t(i){switch(i){case k9.Deprecated:return i4.Deprecated}}n.to=t})(Qx||(Qx={}));var EG;(function(n){function e(i){return{name:i.name,kind:Sw.from(i.kind),tags:i.tags&&i.tags.map(Qx.from),containerName:i.containerName,location:P_.from(i.location)}}n.from=e;function t(i){const s=new n4(i.name,Sw.to(i.kind),i.containerName,P_.to(i.location));return s.tags=i.tags&&i.tags.map(Qx.to),s}n.to=t})(EG||(EG={}));var Zke;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:at.from(i.range),selectionRange:at.from(i.selectionRange),kind:Sw.from(i.kind),tags:i.tags?.map(Qx.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new s4(i.name,i.detail,Sw.to(i.kind),at.to(i.range),at.to(i.selectionRange));return mo(i.tags)&&(s.tags=i.tags.map(Qx.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(Zke||(Zke={}));var KF;(function(n){function e(i){const s=new $he(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,name:i.name,detail:i.detail,kind:Sw.from(i.kind),uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})(KF||(KF={}));var eIe;(function(n){function e(t){return new gOe(KF.to(t.from),t.fromRanges.map(i=>at.to(i)))}n.to=e})(eIe||(eIe={}));var tIe;(function(n){function e(t){return new fOe(KF.to(t.to),t.fromRanges.map(i=>at.to(i)))}n.to=e})(tIe||(tIe={}));var P_;(function(n){function e(i){return{range:i.range&&at.from(i.range),uri:i.uri}}n.from=e;function t(i){return new _p(P.revive(i.uri),at.to(i.range))}n.to=t})(P_||(P_={}));var xG;(function(n){function e(i){const s=i,o=i;return{originSelectionRange:s.originSelectionRange?at.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:o.uri,range:at.from(s.targetRange?s.targetRange:o.range),targetSelectionRange:s.targetSelectionRange?at.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:P.revive(i.uri),targetRange:at.to(i.range),targetSelectionRange:i.targetSelectionRange?at.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?at.to(i.originSelectionRange):void 0}}n.to=t})(xG||(xG={}));var ooe;(function(n){function e(i){return{range:at.from(i.range),contents:Qs.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Qs.to),o=at.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new ise(s,o,r,a)}n.to=t})(ooe||(ooe={}));var iIe;(function(n){function e(i){return{range:at.from(i.range),expression:i.expression}}n.from=e;function t(i){return new J6(at.to(i.range),i.expression)}n.to=t})(iIe||(iIe={}));var roe;(function(n){function e(i){if(i instanceof X6)return{type:"text",range:at.from(i.range),text:i.text};if(i instanceof Z6)return{type:"variable",range:at.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof eG)return{type:"expression",range:at.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}n.from=e;function t(i){switch(i.type){case"text":return{range:at.to(i.range),text:i.text};case"variable":return{range:at.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:at.to(i.range),expression:i.expression}}}n.to=t})(roe||(roe={}));var aoe;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:at.from(i.stoppedLocation)}}n.from=e;function t(i){return new uke(i.frameId,at.to(i.stoppedLocation))}n.to=t})(aoe||(aoe={}));var L4;(function(n){function e(i){return{range:at.from(i.range),kind:i.kind}}n.from=e;function t(i){return new N6(at.to(i.range),i.kind)}n.to=t})(L4||(L4={}));var nIe;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(L4.from)}}n.from=e;function t(i){return new P6(P.revive(i.uri),i.highlights.map(L4.to))}n.to=t})(nIe||(nIe={}));var sIe;(function(n){function e(t){switch(t){case tf.TriggerCharacter:return RM.TriggerCharacter;case tf.TriggerForIncompleteCompletions:return RM.TriggerForIncompleteCompletions;case tf.Invoke:default:return RM.Invoke}}n.to=e})(sIe||(sIe={}));var oIe;(function(n){function e(t){return{triggerKind:sIe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(oIe||(oIe={}));var coe;(function(n){function e(i){switch(i){case a4.Deprecated:return TU.Deprecated}}n.from=e;function t(i){switch(i){case TU.Deprecated:return a4.Deprecated}}n.to=t})(coe||(coe={}));var loe;(function(n){const e=new Map([[nn.Method,Ne.Method],[nn.Function,Ne.Function],[nn.Constructor,Ne.Constructor],[nn.Field,Ne.Field],[nn.Variable,Ne.Variable],[nn.Class,Ne.Class],[nn.Interface,Ne.Interface],[nn.Struct,Ne.Struct],[nn.Module,Ne.Module],[nn.Property,Ne.Property],[nn.Unit,Ne.Unit],[nn.Value,Ne.Value],[nn.Constant,Ne.Constant],[nn.Enum,Ne.Enum],[nn.EnumMember,Ne.EnumMember],[nn.Keyword,Ne.Keyword],[nn.Snippet,Ne.Snippet],[nn.Text,Ne.Text],[nn.Color,Ne.Color],[nn.File,Ne.File],[nn.Reference,Ne.Reference],[nn.Folder,Ne.Folder],[nn.Event,Ne.Event],[nn.Operator,Ne.Operator],[nn.TypeParameter,Ne.TypeParameter],[nn.Issue,Ne.Issue],[nn.User,Ne.User]]);function t(o){return e.get(o)??Ne.Property}n.from=t;const i=new Map([[Ne.Method,nn.Method],[Ne.Function,nn.Function],[Ne.Constructor,nn.Constructor],[Ne.Field,nn.Field],[Ne.Variable,nn.Variable],[Ne.Class,nn.Class],[Ne.Interface,nn.Interface],[Ne.Struct,nn.Struct],[Ne.Module,nn.Module],[Ne.Property,nn.Property],[Ne.Unit,nn.Unit],[Ne.Value,nn.Value],[Ne.Constant,nn.Constant],[Ne.Enum,nn.Enum],[Ne.EnumMember,nn.EnumMember],[Ne.Keyword,nn.Keyword],[Ne.Snippet,nn.Snippet],[Ne.Text,nn.Text],[Ne.Color,nn.Color],[Ne.File,nn.File],[Ne.Reference,nn.Reference],[Ne.Folder,nn.Folder],[Ne.Event,nn.Event],[Ne.Operator,nn.Operator],[Ne.TypeParameter,nn.TypeParameter],[Ne.User,nn.User],[Ne.Issue,nn.Issue]]);function s(o){return i.get(o)??nn.Property}n.to=s})(loe||(loe={}));var rIe;(function(n){function e(t,i){const s=new H6(t.label);return s.insertText=t.insertText,s.kind=loe.to(t.kind),s.tags=t.tags?.map(coe.to),s.detail=t.detail,s.documentation=ah(t.documentation)?Qs.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,O.isIRange(t.range)?s.range=at.to(t.range):typeof t.range=="object"&&(s.range={inserting:at.to(t.range.insert),replacing:at.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&cp.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&cp.InsertAsSnippet?s.insertText=new Q1(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof rs?new qx(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(o=>nh.to(o))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(rIe||(rIe={}));var doe;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Qs.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation}}n.to=t})(doe||(doe={}));var hoe;(function(n){function e(i){return{label:i.label,documentation:Qs.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(doe.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:ah(i.documentation)?Qs.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(doe.to):[],activeParameter:i.activeParameter}}n.to=t})(hoe||(hoe={}));var DG;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(hoe.to):[]}}n.to=t})(DG||(DG={}));var aIe;(function(n){function e(t,i){const s=new W6(Wr.to(i.position),typeof i.label=="string"?i.label:i.label.map(cIe.to.bind(void 0,t)),i.kind&&uoe.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(nh.to),s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(aIe||(aIe={}));var cIe;(function(n){function e(t,i){const s=new B6(i.label);return s.tooltip=ah(i.tooltip)?Qs.to(i.tooltip):i.tooltip,uZ.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=P_.to(i.location)),s}n.to=e})(cIe||(cIe={}));var uoe;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(uoe||(uoe={}));var zM;(function(n){function e(i){return{range:at.from(i.range),url:i.target,tooltip:i.tooltip}}n.from=e;function t(i){let s;if(i.url)try{s=typeof i.url=="string"?P.parse(i.url,!0):P.revive(i.url)}catch{}return new V6(at.to(i.range),s)}n.to=t})(zM||(zM={}));var goe;(function(n){function e(i){const s=new $6(i.label);return i.textEdit&&(s.textEdit=nh.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(o=>nh.to(o))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?nh.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>nh.from(s)):void 0}}n.from=t})(goe||(goe={}));var T4;(function(n){function e(i){return new VF(i[0],i[1],i[2],i[3])}n.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}n.from=t})(T4||(T4={}));var lIe;(function(n){function e(i){return{range:at.from(i.range)}}n.from=e;function t(i){return new r4(at.to(i.range))}n.to=t})(lIe||(lIe={}));var foe;(function(n){function e(t){switch(t){case Ln.AUTO:return MM.AfterDelay;case Ln.EXPLICIT:return MM.Manual;case Ln.FOCUS_CHANGE:case Ln.WINDOW_CHANGE:return MM.FocusOut}}n.to=e})(foe||(foe={}));var oH;(function(n){function e(i){switch(i){case wv.Off:return Qr.Off;case wv.Relative:return Qr.Relative;case wv.Interval:return Qr.Interval;case wv.On:default:return Qr.On}}n.from=e;function t(i){switch(i){case Qr.Off:return wv.Off;case Qr.Relative:return wv.Relative;case Qr.Interval:return wv.Interval;case Qr.On:default:return wv.On}}n.to=t})(oH||(oH={}));var R4;(function(n){function e(i){if(i===jv.CRLF)return bu.CRLF;if(i===jv.LF)return bu.LF}n.from=e;function t(i){if(i===bu.CRLF)return jv.CRLF;if(i===bu.LF)return jv.LF}n.to=t})(R4||(R4={}));var dIe;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case VI.SourceControl:return ch.Scm;case VI.Window:return ch.Window;case VI.Notification:return ch.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(dIe||(dIe={}));var poe;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=moe.from(i.kind)),s}n.from=e;function t(i){const s={start:i.start-1,end:i.end-1};return i.kind&&(s.kind=moe.to(i.kind)),s}n.to=t})(poe||(poe={}));var moe;(function(n){function e(i){if(i)switch(i){case vy.Comment:return yv.Comment;case vy.Imports:return yv.Imports;case vy.Region:return yv.Region}}n.from=e;function t(i){if(i)switch(i.value){case yv.Comment.value:return vy.Comment;case yv.Imports.value:return vy.Imports;case yv.Region.value:return vy.Region}}n.to=t})(moe||(moe={}));var C8;(function(n){function e(t){if(t)return{pinned:typeof t.preview=="boolean"?!t.preview:void 0,inactive:t.background,preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,override:typeof t.override=="boolean"?A_.id:void 0}}n.from=e})(C8||(C8={}));var Zp;(function(n){function e(o){return o instanceof FM?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new FM(o.baseUri??o.base,o.pattern).toJSON():o}n.from=e;function t(o){const r=o;return r?P.isUri(r.baseUri)&&typeof r.pattern=="string":!1}function i(o){const r=o;return r?typeof r.base=="string"&&typeof r.pattern=="string":!1}function s(o){return typeof o=="string"?o:new FM(P.revive(o.baseUri),o.pattern)}n.to=s})(Zp||(Zp={}));var hIe;(function(n){function e(t){if(t){if(Array.isArray(t))return t.map(e);if(typeof t=="string")return t;{const i=t;return{language:i.language,scheme:i.scheme,pattern:Zp.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(hIe||(hIe={}));var _oe;(function(n){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(s=>Array.isArray(s)&&s.every(o=>o&&typeof o=="object"&&"uri"in o&&P.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof rs)))}n.is=e;function t(i){return{documents:i.documents.map(s=>s.map(o=>({uri:P.from(o.uri),version:o.version,ranges:o.ranges.map(r=>at.from(r))})))}}n.from=t})(_oe||(_oe={}));var ES;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new rS(i.start,i.end)}n.to=t})(ES||(ES={}));var M4;(function(n){function e(i){return{timing:typeof i.runStartTime=="number"&&typeof i.runEndTime=="number"?{startTime:i.runStartTime,endTime:i.runEndTime}:void 0,executionOrder:i.executionOrder,success:i.lastRunSuccess}}n.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}n.from=t})(M4||(M4={}));var uIe;(function(n){function e(t){if(t===p8.Unconfirmed)return qF.Pending;if(t===p8.Pending)return;if(t===p8.Executing)return qF.Executing;throw new Error(`Unknown state: ${t}`)}n.to=e})(uIe||(uIe={}));var kG;(function(n){function e(i){switch(i){case bI.Markup:return w2.Markup;case bI.Code:default:return w2.Code}}n.from=e;function t(i){switch(i){case w2.Markup:return bI.Markup;case w2.Code:default:return bI.Code}}n.to=t})(kG||(kG={}));var ok;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)ej.validate(o),s.cells.push(IG.from(o));return s}n.from=e;function t(i){const s=new mOe(i.cells.map(IG.to));return n1(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(ok||(ok={}));var IG;(function(n){function e(i){return{cellKind:kG.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:M4.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(Y1.from):[]}}n.from=e;function t(i){return new ej(kG.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(Y1.to):void 0,i.metadata,i.internalMetadata?M4.to(i.internalMetadata):void 0)}n.to=t})(IG||(IG={}));var N4;(function(n){function e(i){return{mime:i.mime,valueBytes:ze.wrap(i.data)}}n.from=e;function t(i){return new _Oe(i.valueBytes.buffer,i.mime)}n.to=t})(N4||(N4={}));var Y1;(function(n){function e(i){return{outputId:i.id,items:i.items.map(N4.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(N4.to);return new oG(s,i.outputId,i.metadata)}n.to=t})(Y1||(Y1={}));var voe;(function(n){function e(s){return i(s)?{include:Zp.from(s.include)??void 0,exclude:Zp.from(s.exclude)??void 0}:Zp.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:Zp.to(s.include),exclude:Zp.to(s.exclude)}:Zp.to(s)}n.to=t;function i(s){const o=s;return o?!hc(o.include)&&!hc(o.exclude):!1}})(voe||(voe={}));var gIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===rG.Left?ese.Left:ese.Right,command:i.toInternal(o,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(gIe||(gIe={}));var fIe;(function(n){function e(t,i,s){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,s),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}n.from=e})(fIe||(fIe={}));var pIe;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(pIe||(pIe={}));var woe;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new vOe(P.revive(i.uri),i.provides)}n.to=t})(woe||(woe={}));var P4;(function(n){function e(i){return{message:Qs.fromStrict(i.message)||"",type:dC.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:at.from(i.location.range),uri:i.location.uri}}}n.from=e;function t(i){const s=new b4(typeof i.message=="string"?i.message:Qs.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?P_.to(i.location):void 0,s}n.to=t})(P4||(P4={}));var hC;(function(n){n.namespace=MX,n.denamespace=nrt})(hC||(hC={}));var J1;(function(n){function e(i){const s=oue(i).controllerId;return{extId:bn.fromExtHostTestItem(i,s).toString(),label:i.label,uri:P.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>hC.namespace(s,o.id)),range:O.lift(at.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Qs.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:bn.fromString(i.extId).localId,label:i.label,uri:P.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:o}=hC.denamespace(s);return new C4(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:at.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(J1||(J1={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new C4(i.id)}n.to=t})(hC||(hC={}));var mIe;(function(n){const e=(i,s)=>{const o=i.value;if(!o)return;const r={...J1.toPlain(o.item),parent:s,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===dC.Error).map(P4.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,r);c&&r.children.push(c)}return r};function t(i){const s=new qse;for(const a of i.items)s.insert(bn.fromString(a.item.extId).path,a);const o=[s.nodes],r=[];for(;o.length;)for(const a of o.pop())a.value?r.push(a):a.children&&o.push(a.children.values());return{completedAt:i.completedAt,results:r.map(a=>e(a)).filter(yl)}}n.to=t})(mIe||(mIe={}));var boe;(function(n){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Wr.from(o):at.from(o)}function i(o){if(typeof o.executed=="number"&&o.executed<0)throw new Error(`Invalid coverage count ${o.executed}`);return"branches"in o?{count:o.executed,location:t(o.location),type:E4.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:E4.Declaration,name:o.name,count:o.executed,location:t(o.location)}}n.fromDetails=i;function s(o,r,a){return IX(a.statementCoverage),IX(a.branchCoverage),IX(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testId:a instanceof uG&&a.testItem?bn.fromExtHostTestItem(a.testItem,o).toString():void 0}}n.fromFile=s})(boe||(boe={}));var _Ie;(function(n){function e(t){switch(t){case wu.Invoke:return o4.Invoke;case wu.Auto:return o4.Automatic}}n.to=e})(_Ie||(_Ie={}));var $M;(function(n){function e(i){const s=new qhe(Sw.to(i.kind),i.name,i.detail||"",P.revive(i.uri),at.to(i.range),at.to(i.selectionRange));return s._sessionId=i._sessionId,s._itemId=i._itemId,s}n.to=e;function t(i,s,o){if(s=s??i._sessionId,o=o??i._itemId,s===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:s,_itemId:o,kind:Sw.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:at.from(i.range),selectionRange:at.from(i.selectionRange),tags:i.tags?.map(Qx.from)}}n.from=t})($M||($M={}));var Coe;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(Coe||(Coe={}));var yoe;(function(n){function e(o,r,a){const c=r.fileData;return c?new A7t(new E7t(c.name,P.revive(c.uri),c.id,cw(()=>a(c.id)))):o===Js.uriList&&r.uriListData?new mse(s(r.uriListData)):new mse(r.asString)}n.to=e;async function t(o,r){const a=await r.asString();if(o===Js.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=r.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}n.from=t;function i(o){return R1.split(o).map(r=>{if(r.startsWith("#"))return r;try{return P.parse(r)}catch{}return r})}function s(o){return R1.create(o.map(r=>typeof r=="string"?r:P.revive(r)))}})(yoe||(yoe={}));var rw;(function(n){function e(i,s){const o=i.items.map(([r,a])=>[r,yoe.to(r,a,s)]);return new h4(o)}n.toDataTransfer=e;async function t(i){const s={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{s.items.push([r,await yoe.from(r,a)])})());return await Promise.all(o),s}n.from=t})(rw||(rw={}));var LG;(function(n){function e(i,s){return{kind:"reply",agentId:i.participant??s?.agentId??"",subCommand:i.command??s?.command,message:i.prompt,title:i.label}}n.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}n.to=t})(LG||(LG={}));var y8;(function(n){function e(i){switch(i.role){case sk.System:return new v8(Iv.System,i.content);case sk.User:return new v8(Iv.User,i.content);case sk.Assistant:return new v8(Iv.Assistant,i.content)}}n.to=e;function t(i){switch(i.role){case Iv.System:return{role:sk.System,content:i.content};case Iv.User:return{role:sk.User,content:i.content};case Iv.Assistant:return{role:sk.Assistant,content:i.content}}}n.from=t})(y8||(y8={}));var TG;(function(n){function e(i){return{kind:"markdownContent",content:Qs.from(i.value)}}n.from=e;function t(i){return new Jhe(Qs.to(i.content))}n.to=t})(TG||(TG={}));var Soe;(function(n){function e(i){return{kind:"markdownVuln",content:Qs.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new fG(Qs.to(i.content),i.vulnerabilities)}n.to=t})(Soe||(Soe={}));var Aoe;(function(n){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}n.from=e;function t(i){return new pG(i.agentId,i.command)}n.to=t})(Aoe||(Aoe={}));var vIe;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data}}n.from=e})(vIe||(vIe={}));var RG;(function(n){function e(i){const{value:s,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=P.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:ui(o),uri:o,children:r(s,o)}}}n.from=e;function t(i){const s=Or(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=s.uri,a=s.children?o(s.children):[];return new Xhe(a,r)}n.to=t})(RG||(RG={}));var MG;(function(n){function e(i){const s=o=>P.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:yx.from(i.value)}}n.from=e;function t(i){const s=Or(i);return new Zhe(P.isUri(s.inlineReference)?s.inlineReference:yx.to(s.inlineReference),i.name)}n.to=t})(MG||(MG={}));var F4;(function(n){function e(i){return{kind:"progressMessage",content:Qs.from(i.value)}}n.from=e;function t(i){return new mG(i.content.value)}n.to=t})(F4||(F4={}));var NG;(function(n){function e(i){return{kind:"warning",content:Qs.from(i.value)}}n.from=e;function t(i){return new _G(i.content.value)}n.to=t})(NG||(NG={}));var wIe;(function(n){function e(t){return{kind:"progressTask",content:Qs.from(t.value)}}n.from=e})(wIe||(wIe={}));var bIe;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Qs.from(t):void 0}}n.from=e})(bIe||(bIe={}));var PG;(function(n){function e(i,s,o){return{kind:"command",command:s.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}n.from=e;function t(i,s){return new eue(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(PG||(PG={}));var Eoe;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>nh.from(s))}}n.from=e;function t(i){return new vG(P.revive(i.uri),i.edits.map(s=>nh.to(s)))}n.to=t})(Eoe||(Eoe={}));var Sx;(function(n){function e(i){const s=$e.isThemeIcon(i.iconPath)?i.iconPath:P.isUri(i.iconPath)?{light:P.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&P.isUri(i.iconPath.light)&&P.isUri(i.iconPath.dark)?{light:P.revive(i.iconPath.light),dark:P.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:P.isUri(i.value.value)||!i.value.value?i.value.value:yx.from(i.value.value)},iconPath:s}:{kind:"reference",reference:P.isUri(i.value)?i.value:yx.from(i.value),iconPath:s}}n.from=e;function t(i){const s=Or(i),o=r=>P.isUri(r)?r:yx.to(r);return new GI("variableName"in s.reference?{variableName:s.reference.variableName,value:s.reference.value&&o(s.reference.value)}:o(s.reference))}n.to=t})(Sx||(Sx={}));var xoe;(function(n){function e(s,o,r){return s instanceof Jhe?TG.from(s):s instanceof Zhe?MG.from(s):s instanceof GI?Sx.from(s):s instanceof mG?F4.from(s):s instanceof Xhe?RG.from(s):s instanceof eue?PG.from(s,o,r):s instanceof vG?Eoe.from(s):s instanceof fG?Soe.from(s):s instanceof pG?Aoe.from(s):s instanceof _G?NG.from(s):{kind:"markdownContent",content:Qs.from("")}}n.from=e;function t(s,o){switch(s.kind){case"reference":return Sx.to(s);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(s,o)}}n.to=t;function i(s,o){switch(s.kind){case"markdownContent":return TG.to(s);case"inlineReference":return MG.to(s);case"progressMessage":return;case"treeData":return RG.to(s);case"command":return PG.to(s,o)}}n.toContent=i})(xoe||(xoe={}));var CIe;(function(n){function e(t){return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:t.variables.variables.map(Doe.to),location:O4.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData}}n.to=e})(CIe||(CIe={}));var O4;(function(n){function e(i){switch(i){case lc.Notebook:return cb.Notebook;case lc.Terminal:return cb.Terminal;case lc.Panel:return cb.Panel;case lc.Editor:return cb.Editor}}n.to=e;function t(i){switch(i){case cb.Notebook:return lc.Notebook;case cb.Terminal:return lc.Terminal;case cb.Panel:return lc.Panel;case cb.Editor:return lc.Editor}}n.from=t})(O4||(O4={}));var Doe;(function(n){function e(t){const i=t.value;if(!i)throw new Error("Invalid value reference");return{id:t.id,name:t.name,range:t.range&&[t.range.start,t.range.endExclusive],value:lZ(i)?P.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&lZ(i.uri)?yx.to(Or(i)):i,modelDescription:t.modelDescription}}n.to=e})(Doe||(Doe={}));var yIe;(function(n){function e(t,i,s){return{id:t.id,label:t.label,fullName:t.fullName,icon:t.icon?.id,value:t.values[0].value,insertText:t.insertText,detail:t.detail,documentation:t.documentation,command:i.toInternal(t.command,s)}}n.from=e})(yIe||(yIe={}));var rH;(function(n){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}n.to=e})(rH||(rH={}));var SIe;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const o=rH.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:s.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:LG.to(i.action.followup)},result:o}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:o}:{action:i.action,result:o}}n.to=e})(SIe||(SIe={}));var koe;(function(n){function e(t,i,s){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,s)}n.from=e})(koe||(koe={}));var AIe;(function(n){function e(t){return{kind:EIe.to(t.kind)}}n.to=e})(AIe||(AIe={}));var EIe;(function(n){function e(t){switch(t){case DI.Word:return IR.Word;case DI.Line:return IR.Line;case DI.Suggest:return IR.Suggest;default:return IR.Unknown}}n.to=e})(EIe||(EIe={}));var xIe;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||nDe.None,contextValue:t.contextValue}}n.from=e})(xIe||(xIe={}));class LOe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Ui(Array.from(e,([,i])=>i.asFile()))),{id:t,dispose:()=>{this.dataTransferFiles.delete(t)}}}async resolveFileData(e,t){const i=this.dataTransferFiles.get(e);if(!i)throw new Error("No data transfer found");const s=i.find(o=>o.id===t);if(!s)throw new Error("No matching file found in data transfer");return ze.wrap(await s.data())}dispose(){this.dataTransferFiles.clear()}}var A8e;(function(n){n.CallsTo="incomingCalls",n.CallsFrom="outgoingCalls"})(A8e||(A8e={}));const rrt=new Po;class Ioe{static async create(e,t,i){const[s]=rrt.ordered(e);if(!s)return;const o=await s.prepareCallHierarchy(e,t,i);if(o)return new Ioe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new $Re(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Ioe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const S8=new Map;yt.registerCommand("_executePrepareCallHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Ioe.create(o,i,qe.None);return a?(S8.set(a.id,a),S8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),S8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function art(n){return!0}yt.registerCommand("_executeProvideIncomingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,qe.None)});yt.registerCommand("_executeProvideOutgoingCalls",async(n,...e)=>{const[t]=e;Bt(art());const i=S8.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,qe.None)});var DIe;(function(n){const e=[];function t(s){let o=s;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}n.register=t;function i(){return e.slice(0)}n.all=i})(DIe||(DIe={}));var kIe;(function(n){n[n.Idle=0]="Idle",n[n.Searching=1]="Searching",n[n.SlowSearch=2]="SlowSearch"})(kIe||(kIe={}));new Y("searchState",kIe.Idle);var E8e;(function(n){n.Subtypes="subtypes",n.Supertypes="supertypes"})(E8e||(E8e={}));const crt=new Po;class Loe{static async create(e,t,i){const[s]=crt.ordered(e);if(!s)return;const o=await s.prepareTypeHierarchy(e,t,i);if(o)return new Loe(o.roots.reduce((r,a)=>r+a._sessionId,""),s,o.roots,new $Re(o))}constructor(e,t,i,s){this.id=e,this.provider=t,this.roots=i,this.ref=s,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends Loe{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(mo(i))return i}catch(i){er(i)}return[]}}const A8=new Map;yt.registerCommand("_executePrepareTypeHierarchy",async(n,...e)=>{const[t,i]=e;Bt(P.isUri(t)),Bt(oe.isIPosition(i));let o=n.get(Ai).getModel(t),r;if(!o){const c=await n.get(Rn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await Loe.create(o,i,qe.None);return a?(A8.set(a.id,a),A8.forEach((c,l,d)=>{d.size>10&&(c.dispose(),A8.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function lrt(n){const e=n;return typeof n=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&P.isUri(e.uri)&&O.isIRange(e.range)&&O.isIRange(e.selectionRange)}yt.registerCommand("_executeProvideSupertypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSupertypes(t,qe.None)});yt.registerCommand("_executeProvideSubtypes",async(n,...e)=>{const[t]=e;Bt(lrt(t));const i=A8.get(t._sessionId);if(i)return i.provideSubtypes(t,qe.None)});var $o;let x8e=$o=class extends ${constructor(e,t,i,s,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=s,this._uriIdentService=o,this._registrations=this._register(new Zo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(et.ExtHostLanguageFeatures),this._languageService){const r=()=>{const a=[];for(const c of t.getRegisteredLanguageIds()){const l=this._languageConfigurationService.getLanguageConfiguration(c).getWordDefinition();a.push({languageId:c,regexSource:l.source,regexFlags:l.flags})}this._proxy.$setWordDefinitions(a)};this._register(this._languageConfigurationService.onDidChange(a=>{if(!a.languageId)r();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),r()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>$o._reviveLocationLinkDto(t)),e):(e.uri=P.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach($o._reviveWorkspaceSymbolDto),e):(e.location=$o._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>AS(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=P.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=P.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(s,o)=>this._proxy.$provideDocumentSymbols(e,s.uri,o)}))}$registerCodeLensSupport(e,t,i){const s={provideCodeLenses:async(o,r)=>{const a=await this._proxy.$provideCodeLenses(e,o.uri,r);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(o,r,a)=>{const c=await this._proxy.$resolveCodeLens(e,r,a);if(c)return{...c,range:o.validateRange(c.range)}}};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,s))}$emitCodeLensEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.definitionProvider.register(t,{provideDefinition:(i,s,o)=>this._proxy.$provideDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,s,o)=>this._proxy.$provideDeclaration(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,s,o)=>this._proxy.$provideImplementation(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,s,o)=>this._proxy.$provideTypeDefinition(e,i.uri,s,o).then($o._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,s,o,r)=>{const a={verbosityRequest:r?.verbosityRequest?{verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:{id:r.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,s,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,s,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,s,o)}))}$registerInlineValuesProvider(e,t,i){const s={provideInlineValues:(o,r,a,c)=>this._proxy.$provideInlineValues(e,o.uri,r,a,c)};if(typeof i=="number"){const o=new I;this._registrations.set(i,o),s.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,s))}$emitInlineValuesEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.documentHighlightProvider.register(t,{provideDocumentHighlights:(i,s,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,s,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,s,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,s,o.map(a=>a.uri),r).then(a=>{if(iO(a))return;const c=new wi;return a?.forEach(l=>{const d=P.revive(l.uri);c.has(d)?c.get(d).push(...l.highlights):c.set(d,l.highlights)}),c})}))}$registerLinkedEditingRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.linkedEditingRangeProvider.register(t,{provideLinkedEditingRanges:async(i,s,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,s,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?$o._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,s,o,r)=>this._proxy.$provideReferences(e,i.uri,s,o,r).then($o._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,s,o,r){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:$o._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:s,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=AS(d.edit,this._uriIdentService)),d.command&&(c.command=d.command),c}),this._registrations.set(e,this._languageFeaturesService.codeActionProvider.register(t,a))}$registerPasteEditProvider(e,t,i){const s=new IIe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentPasteEditProvider.register(t,s),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const s=this._pasteEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,s,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:s,provideDocumentRangeFormattingEdits:(r,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,r.uri,a,c,l),provideDocumentRangesFormattingEdits:o?(r,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,r.uri,a,c,l):void 0}))}$registerOnTypeFormattingSupport(e,t,i,s){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:s,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const s={provideWorkspaceSymbols:async(o,r)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,o,r);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,$o._reviveWorkspaceSymbolDto(a.symbols)}};t&&(s.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&$o._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,DIe.register(s))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(s,o,r,a)=>this._proxy.$provideRenameEdits(e,s.uri,o,r,a).then(c=>AS(c,this._uriIdentService)),resolveRenameLocation:i?(s,o,r)=>this._proxy.$resolveRenameLocation(e,s.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,s,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,s,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,s){let o;if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new gKt(this._proxy,e,i,o)))}$emitDocumentSemanticTokensEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentRangeSemanticTokensProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentRangeSemanticTokensProvider.register(t,new fKt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const s=t[Fi.label],o=t[Fi.commandId],r=t[Fi.commandIdent],a=t[Fi.commitCharacters];return{label:s,extensionId:i,kind:t[Fi.kind]??Ne.Property,tags:t[Fi.kindModifier],detail:t[Fi.detail],documentation:t[Fi.documentation],sortText:t[Fi.sortText],filterText:t[Fi.filterText],preselect:t[Fi.preselect],insertText:t[Fi.insertText]??(typeof s=="string"?s:s.label),range:t[Fi.range]??e,insertTextRules:t[Fi.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Fi.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Fi.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,s,o){const r={triggerCharacters:i,_debugDisplayName:`${o.value}(${i.join("")})`,provideCompletionItems:async(a,c,l,d)=>{const h=await this._proxy.$provideCompletionItems(e,a.uri,c,l,d);return h&&{suggestions:h[aS.completions].map(u=>$o._inflateSuggestDto(h[aS.defaultRanges],u,o)),incomplete:h[aS.isIncomplete]||!1,duration:h[aS.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};s&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=$o._inflateSuggestDto(a.range,l,o);return ym(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,s,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),handleItemDidShow:async(a,c,l)=>{i&&await this._proxy.$handleInlineCompletionDidShow(e,a.pid,c.idx,l)},handlePartialAccept:async(a,c,l,d)=>{i&&await this._proxy.$handleInlineCompletionPartialAccept(e,a.pid,c.idx,l,d)},freeInlineCompletions:a=>{this._proxy.$freeInlineCompletionsList(e,a.pid)},groupId:s,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${s})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const s={provideInlineEdit:async(o,r,a)=>this._proxy.$provideInlineEdit(e,o.uri,r,a),freeInlineEdit:o=>{this._proxy.$freeInlineEdit(e,o.pid)}};this._registrations.set(e,this._languageFeaturesService.inlineEditProvider.register(t,s))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(s,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,s.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,s,o){const r={displayName:o,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Or(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(r.resolveInlayHint=async(a,c)=>{const l=a;if(!l.cacheId)return a;const d=await this._proxy.$resolveInlayHint(e,l.cacheId,c);if(c.isCancellationRequested)throw new Tc;return d?{...a,tooltip:d.tooltip,label:Or(d.label),textEdits:d.textEdits}:a}),typeof s=="number"){const a=new I;this._registrations.set(s,a),r.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,r))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const s={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map($o._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(s.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&$o._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,s))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(s,o)=>i.$provideDocumentColors(e,s.uri,o).then(r=>r.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(s,o,r)=>i.$provideColorPresentations(e,s.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,s){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof s=="number"){const r=new I;this._registrations.set(s,r),o.onDidChange=r.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,o))}$emitFoldingRangeEvent(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$registerSelectionRangeProvider(e,t){this._registrations.set(e,this._languageFeaturesService.selectionRangeProvider.register(t,{provideSelectionRanges:(i,s,o)=>this._proxy.$provideSelectionRanges(e,i.uri,s,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,rrt.register(t,{prepareCallHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,s,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map($o._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.to=$o._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,s)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,s);return o&&(o.forEach(r=>{r.from=$o._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:$o._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:$o._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?$o._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?$o._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:$o._reviveRegExp(e.beforeText),afterText:e.afterText?$o._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?$o._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map($o._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const s={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?$o._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?$o._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?$o._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?s.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(s.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(s.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,s,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,crt.register(t,{prepareTypeHierarchy:async(i,s,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,s,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map($o._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,s)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,s);return o&&o.map($o._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const s=new LIe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,s),this._registrations.set(e,pa(this._languageFeaturesService.documentDropEditProvider.register(t,s),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const s=this._documentOnDropEditProviders.get(e);if(!s)throw new Error("Could not find provider");return s.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t){const i=new pKt(e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,i))}};x8e=$o=D([en(Ue.MainThreadLanguageFeatures),_(1,Di),_(2,lo),_(3,ht),_(4,_o)],x8e);let IIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new LOe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new bs(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await rw.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new fhe;for(const[u,f]of d.items)h.replace(u,HQ(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await rw.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,o.uri,r,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new bs(f.kind.value):new bs(""),yieldTo:f.yieldTo?.map(p=>({kind:new bs(p)})),additionalEdit:f.additionalEdit?AS(f.additionalEdit,this._uriIdentService,p=>this.resolveFileData(d.id,p)):void 0})),dispose:()=>{this._proxy.$releasePasteEdits(this._handle,d.id)}}:void 0}finally{d.dispose()}}),i.supportsResolve&&(this.resolveDocumentPasteEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};IIe=D([_(3,_o)],IIe);let LIe=class{constructor(e,t,i,s){this._handle=e,this._proxy=t,this._uriIdentService=s,this.dataTransfers=new LOe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(o,r)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,o._cacheId,r);return a.additionalEdit&&(o.additionalEdit=AS(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,s){const o=this.dataTransfers.add(i);try{const r=await rw.from(i);if(s.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,s);return a?a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new bs(l)})),kind:c.kind?new bs(c.kind):void 0,additionalEdit:AS(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})):void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};LIe=D([_(3,_o)],LIe);class gKt{constructor(e,t,i,s){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=s}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const s=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,s,i);if(!o||i.isCancellationRequested)return null;const r=Iie(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class fKt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const s=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!s||i.isCancellationRequested)return null;const o=Iie(s);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class pKt{constructor(e,t,i){this._handle=e,this._proxy=t,this._uriService=i}async provideMappedEdits(e,t,i,s){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,s);return o?AS(o,this._uriService):null}}let D8e=class{constructor(e,t,i,s,o){this._languageService=t,this._modelService=i,this._resolverService=s,this._languageStatusService=o,this._disposables=new Z,this._status=new Zo,this._proxy=e.getProxy(et.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(r=>{this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds())}))}dispose(){this._disposables.dispose(),this._status.dispose()}async $changeLanguage(e,t){if(!this._languageService.isRegisteredLanguageId(t))return Promise.reject(new Error(`Unknown language id: ${t}`));const i=P.revive(e),s=await this._resolverService.createModelReference(i);try{s.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{s.dispose()}}async $tokensAtPosition(e,t){const i=P.revive(e),s=this._modelService.getModel(i);if(!s)return;s.tokenization.tokenizeIfCheap(t.lineNumber);const o=s.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new O(t.lineNumber,1+o.getStartOffset(r),t.lineNumber,1+o.getEndOffset(r))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};D8e=D([en(Ue.MainThreadLanguages),_(1,Di),_(2,Ai),_(3,Rn),_(4,OPe)],D8e);let k8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(et.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(s=>{kYe(s)?i.$setLogLevel(s):i.$setLogLevel(s[1],s[0])}))}$log(e,t){const i=this.loggerService.getLogger(P.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[s,o]of t)see(i,s,o)}async $createLogger(e,t){this.loggerService.createLogger(P.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:P.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(P.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(P.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(P.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};k8e=D([en(Ue.MainThreadLogger),_(1,wp)],k8e);yt.registerCommand("_extensionTests.setLogLevel",function(n,e){const t=n.get(wp),i=n.get(Il);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const s=TYe(e);s!==void 0&&t.setLogLevel(s)}});yt.registerCommand("_extensionTests.getLogLevel",function(n){const e=n.get(Ze);return c7(e.getLevel())});const oY="vs/workbench/api/browser/mainThreadMessageService";let I8e=class{constructor(e,t,i,s,o){this._notificationService=t,this._commandService=i,this._dialogService=s,this.extensionsListener=o.onDidChangeExtensions(r=>{for(const a of r.removed)this._notificationService.removeFilter(a.identifier.value)})}dispose(){this.extensionsListener.dispose()}$showMessage(e,t,i,s){return i.modal?this._showModalMessage(e,t,i.detail,s,i.useCustom):this._showMessage(e,t,s,i)}_showMessage(e,t,i,s){return new Promise(o=>{const r=i.map(d=>_l({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;s.source&&(a={label:s.source.label,id:s.source.identifier.value}),a||(a=g(oY,0,"Extension"));const c=[];s.source&&c.push(_l({id:s.source.identifier.value,label:g(oY,1,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",s.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});T.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,s,o){const r=[];let a;for(const l of s){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(oY,2,"Cancel"),run:()=>{}}:a={label:g(oY,3,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};I8e=D([en(Ue.MainThreadMessageService),_(1,Pi),_(2,ji),_(3,To),_(4,ho)],I8e);const mKt=(n,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const s=fMe(ze.wrap(i));return[`GET ws://localhost${n}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${s}`].join(`\r `)+`\r \r `},L8e=ze.fromString(`\r \r -`);async function _Kt(n,e,t,i,s){n.write(ze.fromString(mKt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(n.onData(l=>{c?c=ze.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(L8e);if(d===-1)return;r(n),n.pauseData();const h=c.slice(d+L8e.byteLength);h.byteLength&&s.onData.fire(h)})),o.add(n.onClose(l=>a(l??new Error("socket closed")))),o.add(n.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw n.dispose(),r}finally{o.dispose()}}let vKt=class extends ${constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new r1),this.onData=(...i)=>(this.pausableDataEmitter.isPaused&&queueMicrotask(()=>this.pausableDataEmitter.resume()),this.pausableDataEmitter.event(...i)),this.didDisposeEmitter=this._register(new I),this.onDidDispose=this.didDisposeEmitter.event,this.ended=!1,this._register(t.onData),this._register(t.onData.event(i=>this.pausableDataEmitter.fire(i))),this.onClose=this._register(t.onClose).event,this.onEnd=this._register(t.onEnd).event}pauseData(){this.pausableDataEmitter.pause()}drain(){return Promise.resolve()}end(){this.ended=!0,this.closeRemote()}traceSocketEvent(e,t){BDe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},T8e=class extends ${constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(et.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(s){return s.id===e}connect(s,o,r,a){return new Promise((c,l)=>{if(s.id!==e)return l(new Error("Invalid connectTo"));const d=s.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),TOe.connect(h,t._proxy,o,r,a,u).then(f=>{f.onDidDispose(()=>t._remoteSockets.delete(h)),c(f)},f=>{t._remoteSockets.delete(h),l(f)})}).catch(l)})}};this._registrations.set(e,this._remoteSocketFactoryService.register(KV.Managed,i))}async $unregisterSocketFactory(e){this._registrations.get(e)?.dispose()}$onDidManagedSocketHaveData(e,t){this._remoteSockets.get(e)?.onData.fire(t)}$onDidManagedSocketClose(e,t){this._remoteSockets.get(e)?.onClose.fire({type:qne.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};T8e=D([Zi(Ue.MainThreadManagedSockets),_(1,CPe)],T8e);class TOe extends vKt{static connect(e,t,i,s,o,r){const a=new TOe(e,t,o,r);return _Kt(a,i,s,o,r)}constructor(e,t,i,s){super(i,s),this.socketId=e,this.proxy=t}write(e){this.proxy.$remoteSocketWrite(this.socketId,e)}closeRemote(){this.proxy.$remoteSocketEnd(this.socketId)}drain(){return this.proxy.$remoteSocketDrain(this.socketId)}}const rY="workbench.panel.output";new Y("inOutput",!1);new Y("activeLogOutput",!1);new Y("activeLogOutput.levelSettable",!1);new Y("activeLogOutput.level","");new Y("activeLogOutput.levelIsDefault",!1);new Y("outputView.scrollLock",!1);var aH;(function(n){n[n.Append=1]="Append",n[n.Replace=2]="Replace",n[n.Clear=3]="Clear"})(aH||(aH={}));const drt={OutputChannels:"workbench.contributions.outputChannels"};class wKt{constructor(){this.channels=new Map,this._onDidRegisterChannel=new I,this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=new I,this.onDidRemoveChannel=this._onDidRemoveChannel.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){const e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}removeChannel(e){this.channels.delete(e),this._onDidRemoveChannel.fire(e)}}it.add(drt.OutputChannels,new wKt);new Y("activeOutputChannel","");var NX,zP;let R8e=(zP=class extends ${constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(et.ExtHostOutputService);const s=()=>{const o=this._viewsService.isViewVisible(rY)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(T.any(this._outputService.onActiveOutputChannel,T.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===rY))(()=>s())),s()}async $register(e,t,i,s){const o=(NX._extensionIdPool.get(s)||0)+1;NX._extensionIdPool.set(s,o);const r=`extension-output-${s}-#${o}-${e}`,a=P.revive(t);return it.as(drt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:s}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const s=this._getChannel(e);s&&(t===aH.Append?s.update(t):jc(i)&&s.update(t,i))}async $reveal(e,t){const i=this._getChannel(e);i&&this._outputService.showChannel(i.id,t)}async $close(e){if(this._viewsService.isViewVisible(rY)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(rY)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},NX=zP,zP._extensionIdPool=new Map,zP);R8e=NX=D([Zi(Ue.MainThreadOutputService),_(1,nhe),_(2,q_)],R8e);const bKt="vs/workbench/api/browser/mainThreadProgress";class CKt extends xn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let M8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(et.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const s=this._createTask(e);t.location===ch.Notification&&i&&(t={...t,location:ch.Notification,secondaryActions:[new CKt(i,g(bKt,0,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,s,()=>this._proxy.$acceptProgressCanceled(e))}$progressReport(e,t){this._progress.get(e)?.progress.report(t)}$progressEnd(e){const t=this._progress.get(e);t&&(t.resolve(),this._progress.delete(e))}_createTask(e){return t=>new Promise(i=>{this._progress.set(e,{resolve:i,progress:t})})}};M8e=D([Zi(Ue.MainThreadProgress),_(1,Cf),_(2,Qi)],M8e);let N8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new Zo,this.proxy=e.getProxy(et.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,s){const o={label:i,rootUri:P.revive(s),selector:t,isSCM:!1,getOriginalResource:async a=>P.revive(await this.proxy.$provideOriginalResource(e,a,qe.None))},r=this.quickDiffService.addQuickDiffProvider(o);this.providerDisposables.set(e,r)}async $unregisterQuickDiffProvider(e){this.providerDisposables.has(e)&&this.providerDisposables.deleteAndDispose(e)}dispose(){this.providerDisposables.dispose()}};N8e=D([Zi(Ue.MainThreadQuickDiff),_(1,DQ)],N8e);function P8e(n){n.dark=P.revive(n.dark),n.light&&(n.light=P.revive(n.light))}let F8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(et.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const s=new Promise((o,r)=>{this._items[e]={resolve:o,reject:r}});return t={...t,onDidFocus:o=>{o&&this._proxy.$onItemSelected(o.handle)}},t.canPickMany?this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.handle})}$setItems(e,t){return this._items[e]&&(this._items[e].resolve(t),delete this._items[e]),Promise.resolve()}$setError(e,t){return this._items[e]&&(this._items[e].reject(t),delete this._items[e]),Promise.resolve()}$input(e,t,i){const s=Object.create(null);return e&&(s.title=e.title,s.password=e.password,s.placeHolder=e.placeHolder,s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.value=e.value,s.ignoreFocusLost=e.ignoreFocusOut),t&&(s.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(s,i)}$createOrUpdate(e){const t=e.id;let i=this.sessions.get(t);if(!i){const r=e.type==="quickPick"?this._quickInputService.createQuickPick():this._quickInputService.createInputBox();if(r.onDidAccept(()=>{this._proxy.$onDidAccept(t)}),r.onDidTriggerButton(a=>{this._proxy.$onDidTriggerButton(t,a.handle)}),r.onDidChangeValue(a=>{this._proxy.$onDidChangeValue(t,a)}),r.onDidHide(()=>{this._proxy.$onDidHide(t)}),e.type==="quickPick"){const a=r;a.onDidChangeActive(c=>{this._proxy.$onDidChangeActive(t,c.map(l=>l.handle))}),a.onDidChangeSelection(c=>{this._proxy.$onDidChangeSelection(t,c.map(l=>l.handle))}),a.onDidTriggerItemButton(c=>{this._proxy.$onDidTriggerItemButton(t,c.item.handle,c.button.handle)})}i={input:r,handlesToItems:new Map},this.sessions.set(t,i)}const{input:s,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?s.show():s.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&P8e(c.iconPath),c))),o.set(a.handle,a))}),s[r]=e[r]):r==="activeItems"||r==="selectedItems"?s[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?s[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&P8e(a.iconPath),a)):s[r]=e[r]);return Promise.resolve(void 0)}$dispose(e){const t=this.sessions.get(e);return t&&(t.input.dispose(),this.sessions.delete(e)),Promise.resolve(void 0)}};F8e=D([Zi(Ue.MainThreadQuickOpen),_(1,On)],F8e);let O8e=class extends ${constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(et.ExtHostExtensionService);const s=this._environmentService.remoteAuthority;s&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(s);o&&this._proxy.$updateRemoteConnectionData(o)}))}};O8e=D([TO,_(1,Za),_(2,rA)],O8e);const yKt="vs/workbench/api/browser/mainThreadSaveParticipant";class SKt{constructor(e){this._proxy=e.getProxy(et.ExtHostDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.textEditorModel||!gS(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(yKt,0,"Aborted onWillSaveTextDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason).then(c=>{if(!c.every(l=>l))return Promise.reject(new Error("listener failed"))}).then(r,a)});return qle(o,s)}}let B8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(SKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};B8e=D([TO,_(1,be),_(2,tr)],B8e);let W8e=class{constructor(e,t,i){this.speechService=t,this.logService=i,this.providerRegistrations=new Map,this.speechToTextSessions=new Map,this.textToSpeechSessions=new Map,this.keywordRecognitionSessions=new Map,this.proxy=e.getProxy(et.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const s=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None};const a=new Z,c=Math.random();this.proxy.$createSpeechToTextSession(e,c,r?.language);const l=a.add(new I);return this.speechToTextSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelSpeechToTextSession(c),this.speechToTextSessions.delete(c),a.dispose()})),{onDidChange:l.event}},createTextToSpeechSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None,synthesize:async()=>{}};const a=new Z,c=Math.random();this.proxy.$createTextToSpeechSession(e,c,r?.language);const l=a.add(new I);return this.textToSpeechSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelTextToSpeechSession(c),this.textToSpeechSessions.delete(c),a.dispose()})),{onDidChange:l.event,synthesize:async d=>{await this.proxy.$synthesizeSpeech(c,d),await dw(T.toPromise(T.filter(l.event,h=>h.status===cye.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:T.None};const r=new Z,a=Math.random();this.proxy.$createKeywordRecognitionSession(e,a);const c=r.add(new I);return this.keywordRecognitionSessions.set(a,{onDidChange:c}),r.add(o.onCancellationRequested(()=>{this.proxy.$cancelKeywordRecognitionSession(a),this.keywordRecognitionSessions.delete(a),r.dispose()})),{onDidChange:c.event}}});this.providerRegistrations.set(e,{dispose:()=>{s.dispose()}})}$unregisterProvider(e){const t=this.providerRegistrations.get(e);t&&(t.dispose(),this.providerRegistrations.delete(e))}$emitSpeechToTextEvent(e,t){this.speechToTextSessions.get(e)?.onDidChange.fire(t)}$emitTextToSpeechEvent(e,t){this.textToSpeechSessions.get(e)?.onDidChange.fire(t)}$emitKeywordRecognitionEvent(e,t){this.keywordRecognitionSessions.get(e)?.onDidChange.fire(t)}dispose(){this.providerRegistrations.forEach(e=>e.dispose()),this.providerRegistrations.clear(),this.speechToTextSessions.forEach(e=>e.onDidChange.dispose()),this.speechToTextSessions.clear(),this.textToSpeechSessions.forEach(e=>e.onDidChange.dispose()),this.textToSpeechSessions.clear(),this.keywordRecognitionSessions.forEach(e=>e.onDidChange.dispose()),this.keywordRecognitionSessions.clear()}};W8e=D([Zi(Ue.MainThreadSpeech),_(1,Xde),_(2,Ze)],W8e);const AKt="vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant";class EKt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(et.ExtHostWorkspace)}async participate(e,t){const i=new Promise((s,o)=>{setTimeout(()=>o(new Error(g(AKt,0,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(s,o)});return qle(i,t)}}let H8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(EKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};H8e=D([TO,_(1,be),_(2,APe)],H8e);let E8=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return qi.basename(this.relativePath)}constructor(e,t,i,s=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=s,this.parent=o,this._children=new Map}get(e){return this._children.get(e)}set(e,t){this._children.set(e,t)}delete(e){this._children.delete(e)}clear(){this._children.clear()}};E8.__decorator=D([ii],E8.prototype,"name",null);function hrt(n,e){typeof n.element<"u"&&e.push(n.element);for(const t of n.children)hrt(t,e);return e}class xKt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return hrt(e,[])}static isResourceNode(e){return e instanceof E8}constructor(e,t=P.file("/"),i=Fn){this.extUri=i,this.root=new E8(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,s=new N$(!1).reset(i);let o=this.root,r="";for(;;){const a=s.value();r=r+"/"+a;let c=o.get(a);if(c?s.hasNext()||(c.element=t):(c=new E8(this.extUri.joinPath(this.root.uri,r),r,this.root.context,s.hasNext()?void 0:t,o),o.set(a,c)),o=c,!s.hasNext())return;s.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),s=e.get(i);if(s){if(t.hasNext()){const o=this._delete(s,t.next());return typeof o<"u"&&s.childrenCount===0&&e.delete(i),o}return e.delete(i),s.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);let s=this.root;for(;;){const o=i.value(),r=s.get(o);if(!r||!i.hasNext())return r;s=r,i.next()}}}function U8e(n){if(n!==void 0){if(P.isUri(n))return P.revive(n);if($e.isThemeIcon(n))return n;{const e=n;return{light:P.revive(e.light),dark:P.revive(e.dark)}}}}class DKt extends ${constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(_e.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class kKt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??P.file("/");this._resourceTree=new xKt(this,e,this._uriIdentService.extUri);for(const t of this.resources)this._resourceTree.add(t.sourceUri,t)}return this._resourceTree}get hideWhenEmpty(){return!!this.features.hideWhenEmpty}constructor(e,t,i,s,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=s,this.label=o,this.id=r,this.multiDiffEditorEnableViewChanges=a,this._uriIdentService=c,this.resources=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event}toJSON(){return{$mid:Fs.ScmResourceGroup,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(e,t,i){this.resources.splice(e,t,...i),this._resourceTree=void 0,this._onDidChangeResources.fire()}$updateGroup(e){this.features={...this.features,...e},this._onDidChange.fire()}$updateGroupLabel(e){this.label=e,this._onDidChange.fire()}}class IKt{constructor(e,t,i,s,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=s,this.sourceUri=o,this.resourceGroup=r,this.decorations=a,this.contextValue=c,this.command=l,this.multiDiffEditorOriginalUri=d,this.multiDiffEditorModifiedUri=h}open(e){return this.proxy.$executeResourceCommand(this.sourceControlHandle,this.groupHandle,this.handle,e)}toJSON(){return{$mid:Fs.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class LKt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}set currentHistoryItemGroup(e){this._currentHistoryItemGroup=e,this._onDidChangeCurrentHistoryItemGroup.fire()}constructor(e,t){this.proxy=e,this.handle=t,this._onDidChangeCurrentHistoryItemGroup=new I,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,qe.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,qe.None))?.map(s=>({...s,icon:U8e(s.icon)}))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,qe.None);return i?{...i,icon:U8e(i.icon)}:void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,qe.None))?.map(s=>({uri:P.revive(s.uri),originalUri:s.originalUri&&P.revive(s.originalUri),modifiedUri:s.modifiedUri&&P.revive(s.modifiedUri),renameUri:s.renameUri&&P.revive(s.renameUri)}))}}const ole=class ole{get id(){return this._id}get handle(){return this._handle}get label(){return this._label}get rootUri(){return this._rootUri}get inputBoxTextModel(){return this._inputBoxTextModel}get contextValue(){return this._providerId}get commitTemplate(){return this.features.commitTemplate||""}get historyProvider(){return this._historyProvider}get acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get statusBarCommands(){return this.features.statusBarCommands}get count(){return this.features.count}get name(){return this._name??this._label}get onDidChangeStatusBarCommands(){return this._onDidChangeStatusBarCommands.event}constructor(e,t,i,s,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=s,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${ole.ID_HANDLE++}`,this.groups=[],this._onDidChangeResourceGroups=new I,this.onDidChangeResourceGroups=this._onDidChangeResourceGroups.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event,this._groupsByHandle=Object.create(null),this.features={},this._onDidChangeCommitTemplate=new I,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new I,this._onDidChangeHistoryProvider=new I,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=ui(o))}}$updateSourceControl(e){this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._onDidChangeCommitTemplate.fire(this.commitTemplate),typeof e.statusBarCommands<"u"&&this._onDidChangeStatusBarCommands.fire(this.statusBarCommands),e.hasQuickDiffProvider&&!this._quickDiff?this._quickDiff=this._quickDiffService.addQuickDiffProvider({label:e.quickDiffLabel??this.label,rootUri:this.rootUri,isSCM:this.isSCM,getOriginalResource:t=>this.getOriginalResource(t)}):e.hasQuickDiffProvider===!1&&this._quickDiff&&(this._quickDiff.dispose(),this._quickDiff=void 0),e.hasHistoryProvider&&!this._historyProvider?(this._historyProvider=new LKt(this.proxy,this.handle),this._onDidChangeHistoryProvider.fire()):e.hasHistoryProvider===!1&&this._historyProvider&&(this._historyProvider=void 0,this._onDidChangeHistoryProvider.fire())}$registerGroups(e){const t=e.map(([i,s,o,r,a])=>{const c=new kKt(this.handle,i,this,r,o,s,a,this._uriIdentService);return this._groupsByHandle[i]=c,c});this.groups.splice(this.groups.length,0,...t),this._onDidChangeResourceGroups.fire()}$updateGroup(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroup(t)}$updateGroupLabel(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroupLabel(t)}$spliceGroupResourceStates(e){for(const[t,i]of e){const s=this._groupsByHandle[t];if(!s){console.warn(`SCM group ${t} not found in provider ${this.label}`);continue}i.reverse();for(const[o,r,a]of i){const c=a.map(l=>{const[d,h,u,f,p,m,v,w,b,C]=l,[y,S]=u,M=$e.isThemeIcon(y)?y:P.revive(y),k=($e.isThemeIcon(S)?S:P.revive(S))||M,F={icon:M,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new IKt(this.proxy,this.handle,t,d,P.revive(h),s,F,v||void 0,w,P.revive(b),P.revive(C))});s.splice(o,r,c)}}this._onDidChangeResources.fire()}$unregisterGroup(e){const t=this._groupsByHandle[e];t&&(delete this._groupsByHandle[e],this.groups.splice(this.groups.indexOf(t),1),this._onDidChangeResourceGroups.fire())}async getOriginalResource(e){if(!this.features.hasQuickDiffProvider)return null;const t=await this.proxy.$provideOriginalResource(this.handle,e,qe.None);return t&&P.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this._historyProvider&&(this._historyProvider.currentHistoryItemGroup=e??void 0)}toJSON(){return{$mid:Fs.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};ole.ID_HANDLE=0;let TIe=ole,V8e=class{constructor(e,t,i,s,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=s,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostSCM),this._disposables.add(new DKt(this.textModelService,this.modelService,this.languageService))}dispose(){St(this._repositories.values()),this._repositories.clear(),St(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,s,o){const r=await this.textModelService.createModelReference(P.revive(o)),a=new TIe(this._proxy,e,t,i,s?P.revive(s):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=pa(r,T.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryDisposables.set(e,l)}$updateSourceControl(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}$unregisterSourceControl(e){const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}$registerGroups(e,t,i){const s=this._repositories.get(e);if(!s)return;const o=s.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}$updateGroup(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroup(t,i)}$updateGroupLabel(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroupLabel(t,i)}$spliceResourceStates(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}$unregisterGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}$setInputBoxValue(e,t){const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}$setInputBoxPlaceholder(e,t){const i=this._repositories.get(e);i&&(i.input.placeholder=t)}$setInputBoxEnablement(e,t){const i=this._repositories.get(e);i&&(i.input.enabled=t)}$setInputBoxVisibility(e,t){const i=this._repositories.get(e);i&&(i.input.visible=t)}$showValidationMessage(e,t,i){const s=this._repositories.get(e);s&&s.input.showValidationMessage(t,i)}$setValidationProviderIsEnabled(e,t){const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(s,o)=>{const r=await this._proxy.$validateInput(e,s,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};V8e=D([Zi(Ue.MainThreadSCM),_(1,RPe),_(2,YZe),_(3,Di),_(4,Ai),_(5,Rn),_(6,DQ),_(7,_o),_(8,Ti)],V8e);var z8e;(function(n){n.FindInFilesActionId="workbench.action.findInFiles",n.FocusActiveEditorCommandId="search.action.focusActiveEditor",n.FocusSearchFromResults="search.action.focusSearchFromResults",n.OpenMatch="search.action.openResult",n.OpenMatchToSide="search.action.openResultToSide",n.RemoveActionId="search.action.remove",n.CopyPathCommandId="search.action.copyPath",n.CopyMatchCommandId="search.action.copyMatch",n.CopyAllCommandId="search.action.copyAll",n.OpenInEditorCommandId="search.action.openInEditor",n.ClearSearchHistoryCommandId="search.action.clearHistory",n.FocusSearchListCommandID="search.action.focusSearchList",n.ReplaceActionId="search.action.replace",n.ReplaceAllInFileActionId="search.action.replaceAllInFile",n.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",n.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",n.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",n.ToggleWholeWordCommandId="toggleSearchWholeWord",n.ToggleRegexCommandId="toggleSearchRegex",n.TogglePreserveCaseId="toggleSearchPreserveCase",n.AddCursorsAtSearchResults="addCursorsAtSearchResults",n.RevealInSideBarForSearchResults="search.action.revealInSideBar",n.ReplaceInFilesActionId="workbench.action.replaceInFiles",n.ShowAllSymbolsActionId="workbench.action.showAllSymbols",n.QuickTextSearchActionId="workbench.action.quickTextSearch",n.CancelSearchActionId="search.action.cancel",n.RefreshSearchResultsActionId="search.action.refreshSearchResults",n.FocusNextSearchResultActionId="search.action.focusNextSearchResult",n.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",n.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",n.CollapseSearchResultsActionId="search.action.collapseSearchResults",n.ExpandSearchResultsActionId="search.action.expandSearchResults",n.ExpandRecursivelyCommandId="search.action.expandRecursively",n.ClearSearchResultsActionId="search.action.clearSearchResults",n.ViewAsTreeActionId="search.action.viewAsTree",n.ViewAsListActionId="search.action.viewAsList",n.ShowAIResultsActionId="search.action.showAIResults",n.HideAIResultsActionId="search.action.hideAIResults",n.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",n.ExcludeFolderFromSearchId="search.action.excludeFromSearch",n.FocusNextInputActionId="search.focus.nextInputBox",n.FocusPreviousInputActionId="search.focus.previousInputBox",n.RestrictSearchToFolderId="search.action.restrictSearchToFolder",n.FindInFolderId="filesExplorer.findInFolder",n.FindInWorkspaceId="filesExplorer.findInWorkspace"})(z8e||(z8e={}));const TKt={SearchViewVisibleKey:new Y("searchViewletVisible",!0),SearchViewFocusedKey:new Y("searchViewletFocus",!1),InputBoxFocusedKey:new Y("inputBoxFocus",!1),SearchInputBoxFocusedKey:new Y("searchInputBoxFocus",!1),ReplaceInputBoxFocusedKey:new Y("replaceInputBoxFocus",!1),PatternIncludesFocusedKey:new Y("patternIncludesInputBoxFocus",!1),PatternExcludesFocusedKey:new Y("patternExcludesInputBoxFocus",!1),ReplaceActiveKey:new Y("replaceActive",!1),HasSearchResults:new Y("hasSearchResult",!1),FirstMatchFocusKey:new Y("firstMatchFocus",!1),FileMatchOrMatchFocusKey:new Y("fileMatchOrMatchFocus",!1),FileMatchOrFolderMatchFocusKey:new Y("fileMatchOrFolderMatchFocus",!1),FileMatchOrFolderMatchWithResourceFocusKey:new Y("fileMatchOrFolderMatchWithResourceFocus",!1),FileFocusKey:new Y("fileMatchFocus",!1),FolderFocusKey:new Y("folderMatchFocus",!1),ResourceFolderFocusKey:new Y("folderMatchWithResourceFocus",!1),IsEditableItemKey:new Y("isEditableItem",!0),MatchFocusKey:new Y("matchFocus",!1),ViewHasSearchPatternKey:new Y("viewHasSearchPattern",!1),ViewHasReplacePatternKey:new Y("viewHasReplacePattern",!1),ViewHasFilePatternKey:new Y("viewHasFilePattern",!1),ViewHasSomeCollapsibleKey:new Y("viewHasSomeCollapsibleResult",!1),InTreeViewKey:new Y("inTreeView",!1),AIResultsVisibleKey:new Y("AIResultsVisibleKey",!1),hasAIResultProvider:new Y("hasAIResultProviderKey",!1)};let $8e=class{constructor(e,t,i,s,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(et.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new Xpe(this._searchService,h8.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){TKt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new Xpe(this._searchService,h8.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new Xpe(this._searchService,h8.file,t,e,this._proxy))}$unregisterProvider(e){St(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};$8e=D([Zi(Ue.MainThreadSearch),_(1,ohe),_(2,on),_(3,Re),_(4,Pe)],$8e);const rle=class rle{constructor(e,t=++rle._idPool,i=new Map){this.progress=e,this.id=t,this.matches=i}addMatch(e){const t=this.matches.get(e.resource.toString());t?t.results&&e.results&&t.results.push(...e.results):this.matches.set(e.resource.toString(),e),this.progress?.(e)}};rle._idPool=0;let RIe=rle;class Xpe{constructor(e,t,i,s,o){this._scheme=i,this._handle=s,this._proxy=o,this._registrations=new Z,this._searches=new Map,this._registrations.add(e.registerSearchResultProvider(this._scheme,t,this))}dispose(){this._registrations.dispose()}fileSearch(e,t=qe.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=qe.None){return this.doSearch(e,t,i)}doSearch(e,t,i=qe.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const s=new RIe(t);this._searches.set(s.id,s);const o=this._provideSearchResults(e,s.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(s.id),{results:Array.from(s.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(s.id),Promise.reject(r)))}clearCache(e){return Promise.resolve(this._proxy.$clearCache(e))}handleFindMatch(e,t){const i=this._searches.get(e);i&&t.forEach(s=>{s.results?i.addMatch(Or(s)):i.addMatch({resource:P.revive(s)})})}_provideSearchResults(e,t,i){switch(e.type){case z1.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case z1.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let G8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(et.ExtHostStatusBar),s=[];for(const[r,a]of t.getEntries())s.push(o(r,a));i.$acceptStaticEntries(s),this._store.add(t.onDidChange(r=>{r.added&&i.$acceptStaticEntries([o(r.added[0],r.added[1])])}));function o(r,a){return{entryId:r,name:a.entry.name,text:a.entry.text,tooltip:a.entry.tooltip,command:typeof a.entry.command=="string"?a.entry.command:typeof a.entry.command=="object"?a.entry.command.id:void 0,priority:a.priority,alignLeft:a.alignment===W7.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,s,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u)===H7.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};G8e=D([Zi(Ue.MainThreadStatusBar),_(1,xPe)],G8e);async function RKt(n,e,t,i){return i.invokeFunction(async s=>{const o=s.get(Il),r=s.get(V_),a=s.get(B7),c=s.get(sn),l=s.get(_o),d=s.get(ci),h=s.get(Ti),u=s.get(Ze),f=`extensionStorage.migrate.${n}-${e}`,p=n.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${n.toLowerCase()}`:void 0;if(n===e)return;const m=(w,b)=>b?l.extUri.joinPath(r.defaultProfile.globalStorageHome,w.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,w),v=t?ke.PROFILE:ke.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${n} to ${e}...`);const w=a.getExtensionState(n,t);w&&(a.setExtensionState(e,w,t),a.setExtensionState(n,void 0,t));const b=m(n,t),C=m(e,t);if(!l.extUri.isEqual(b,C))try{await d.move(b,C,!0)}catch(y){y.code!==rt.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${n}' to '${e}'`,lg(y))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${n} to ${e}`),c.store(f,!0,v,ln.MACHINE)}})}let q8e=class{constructor(e,t,i,s,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=s,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(et.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(ke.PROFILE,void 0,this._storageListener)(r=>{if(this._sharedStorageKeysToWatch.has(r.key)){const a=this._extensionStorageService.getExtensionStateRaw(r.key,!0);typeof a=="string"&&this._proxy.$acceptValue(!0,r.key,a)}}))}dispose(){this._storageListener.dispose()}async $initializeExtensionStorage(e,t){return await this.checkAndMigrateExtensionStorage(t,e),e&&this._sharedStorageKeysToWatch.set(t,!0),this._extensionStorageService.getExtensionStateRaw(t,e)}async $setValue(e,t,i){this._extensionStorageService.setExtensionState(t,i,e)}$registerExtensionStorageKeysToSync(e,t){this._extensionStorageService.setKeysForSync(e,t)}async checkAndMigrateExtensionStorage(e,t){try{let i=this._extensionStorageService.getSourceExtensionToMigrate(e);!i&&Jn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Jn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await RKt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};q8e=D([Zi(Ue.MainThreadStorage),_(1,B7),_(2,sn),_(3,be),_(4,Ze)],q8e);var MIe,$P;let Q8e=($P=class extends ${constructor(e,t,i,s,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=s,this._productService=o,this._proxy=e.getProxy(et.ExtHostTelemetry),EJ(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(xJe)||r.affectsConfiguration(DJe))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,EJ(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return EJ(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:sp.NONE}$publicLog(e,t=Object.create(null)){t[MIe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},MIe=$P,$P._name="pluginHostTelemetry",$P);Q8e=MIe=D([Zi(Ue.MainThreadTelemetry),_(1,on),_(2,Re),_(3,Il),_(4,Ja)],Q8e);class urt{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(const e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,i=5){const s=t(o=>{const r=typeof o=="string"?o:o.data;let a=this._terminalBufferMap.get(e);if(a){a.data.push(r);return}const c=setTimeout(()=>this.flushBuffer(e),i);a={data:[r],timeoutId:c,dispose:()=>{clearTimeout(c),this.flushBuffer(e),s.dispose()}},this._terminalBufferMap.set(e,a)});return s}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){const t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}}let NIe=class extends ${get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,s){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=s,this.id=0,this.shouldPersist=!1,this._onProcessData=this._register(new I),this.onProcessData=this._onProcessData.event,this._onProcessReady=this._register(new I),this._onStart=this._register(new I),this.onStart=this._onStart.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onAcknowledgeDataEvent=this._register(new I),this.onAcknowledgeDataEvent=this._onAcknowledgeDataEvent.event,this._onShutdown=this._register(new I),this.onShutdown=this._onShutdown.event,this._onRequestInitialCwd=this._register(new I),this.onRequestInitialCwd=this._onRequestInitialCwd.event,this._onRequestCwd=this._register(new I),this.onRequestCwd=this._onRequestCwd.event,this._onDidChangeProperty=this._register(new I),this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=this._register(new I),this.onProcessExit=this._onProcessExit.event,this._pendingInitialCwdRequests=[],this._pendingCwdRequests=[]}emitData(e){this._onProcessData.fire(e)}emitTitle(e){this._onDidChangeProperty.fire({type:jf.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case jf.Cwd:this.emitCwd(t);break;case jf.InitialCwd:this.emitInitialCwd(t);break;case jf.Title:this.emitTitle(t);break;case jf.OverrideDimensions:this.emitOverrideDimensions(t);break;case jf.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:jf.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:jf.ResolvedShellLaunchConfig,value:e})}emitInitialCwd(e){for(;this._pendingInitialCwdRequests.length>0;)this._pendingInitialCwdRequests.pop()(e)}emitCwd(e){for(;this._pendingCwdRequests.length>0;)this._pendingCwdRequests.pop()(e)}async start(){return this._terminalService.requestStartExtensionTerminal(this,this._cols,this._rows)}shutdown(e){this._onShutdown.fire(e)}input(e){this._onInput.fire(e)}resize(e,t){this._onResize.fire({cols:e,rows:t})}clearBuffer(){}acknowledgeDataEvent(){}async setUnicodeVersion(e){}async processBinary(e){this._onBinary.fire(e)}getInitialCwd(){return new Promise(e=>{this._onRequestInitialCwd.fire(),this._pendingInitialCwdRequests.push(e)})}getCwd(){return new Promise(e=>{this._onRequestCwd.fire(),this._pendingCwdRequests.push(e)})}async refreshProperty(e){}async updateProperty(e,t){}};NIe=D([_(3,Nz)],NIe);function grt(n){return[...n.entries()]}function MKt(n){return n?[...n.entries()]:[]}function NKt(n){return new Map(n)}function PKt(n){return new Map(n??[])}var x8;(function(n){n[n.TerminalCommand=0]="TerminalCommand",n[n.Opener=1]="Opener",n[n.Port=2]="Port",n[n.VscodeCommand=3]="VscodeCommand"})(x8||(x8={}));var TR;(function(n){n[n.CwdDetection=0]="CwdDetection",n[n.NaiveCwdDetection=1]="NaiveCwdDetection",n[n.CommandDetection=2]="CommandDetection",n[n.PartialCommandDetection=3]="PartialCommandDetection",n[n.BufferMarkDetection=4]="BufferMarkDetection"})(TR||(TR={}));var j8e;(function(n){n.Windows="windows",n.NoProblemsReported="noProblemsReported"})(j8e||(j8e={}));let K8e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=s,this._instantiationService=o,this._environmentVariableService=r,this._logService=a,this._terminalProfileResolverService=c,this._terminalGroupService=d,this._terminalEditorService=h,this._terminalProfileService=u,this._store=new Z,this._extHostTerminals=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._dataEventTracker=new Dn,this._sendCommandEventListener=new Dn,this._linkProvider=this._store.add(new Dn),this._os=zc,this._proxy=e.getProxy(et.ExtHostTerminalService),this._store.add(t.onDidCreateInstance(p=>{this._onTerminalOpened(p),this._onInstanceDimensionsChanged(p)})),this._store.add(t.onDidDisposeInstance(p=>this._onTerminalDisposed(p))),this._store.add(t.onAnyInstanceProcessIdReady(p=>this._onTerminalProcessIdReady(p))),this._store.add(t.onDidChangeInstanceDimensions(p=>this._onInstanceDimensionsChanged(p))),this._store.add(t.onAnyInstanceMaximumDimensionsChange(p=>this._onInstanceMaximumDimensionsChanged(p))),this._store.add(t.onDidRequestStartExtensionTerminal(p=>this._onRequestStartExtensionTerminal(p))),this._store.add(t.onDidChangeActiveInstance(p=>this._onActiveTerminalChanged(p?p.instanceId:null))),this._store.add(t.onAnyInstanceTitleChange(p=>p&&this._onTitleChanged(p.instanceId,p.title))),this._store.add(t.onAnyInstanceDataInput(p=>this._proxy.$acceptTerminalInteraction(p.instanceId))),this._store.add(t.onAnyInstanceSelectionChange(p=>this._proxy.$acceptTerminalSelection(p.instanceId,p.selection)));for(const p of this._terminalService.instances)this._onTerminalOpened(p),p.processReady.then(()=>this._onTerminalProcessIdReady(p));const f=this._terminalService.activeInstance;if(f&&this._proxy.$acceptActiveTerminalChanged(f.instanceId),this._environmentVariableService.collections.size>0){const m=[...this._environmentVariableService.collections.entries()].map(v=>[v[0],grt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||zc,this._updateDefaultProfile()}),this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(()=>this._updateDefaultProfile()))}dispose(){this._store.dispose();for(const e of this._profileProviders.values())e.dispose();for(const e of this._quickFixProviders.values())e.dispose()}async _updateDefaultProfile(){const e=this._extHostContext.remoteAuthority??void 0,t=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os}),i=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os,allowAutomationShell:!0});this._proxy.$acceptDefaultProfile(...await Promise.all([t,i]))}async _getTerminalInstance(e){return typeof e=="string"?this._extHostTerminals.get(e):this._terminalService.getInstanceFromId(e)}async $createTerminal(e,t){const i={name:t.name,executable:t.shellPath,args:t.shellArgs,cwd:typeof t.cwd=="string"?t.cwd:P.revive(t.cwd),icon:t.icon,color:t.color,initialText:t.initialText,waitOnExit:t.waitOnExit,ignoreConfigurationCwd:!0,env:t.env,strictEnv:t.strictEnv,hideFromUser:t.hideFromUser,customPtyImplementation:t.isExtensionCustomPtyTerminal?(r,a,c)=>new NIe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},s=ko.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,s);const o=await s;this._store.add(o.onDisposed(()=>{this._extHostTerminals.delete(e)}))}async _deserializeParentTerminal(e){if(typeof e=="object"&&"parentTerminal"in e){const t=await this._extHostTerminals.get(e.parentTerminal.toString());return t?{parentTerminal:t}:void 0}return e}async $show(e,t){const i=await this._getTerminalInstance(e);i&&(this._terminalService.setActiveInstance(i),i.target===fV.Editor?await this._terminalEditorService.revealActiveEditor(t):await this._terminalGroupService.showPanel(!t))}async $hide(e){const t=await this._getTerminalInstance(e),i=this._terminalService.activeInstance;i&&i.instanceId===t?.instanceId&&i.target!==fV.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(vM.Extension)}async $sendText(e,t,i){await(await this._getTerminalInstance(e))?.sendText(t,i)}$sendProcessExit(e,t){this._terminalProcessProxies.get(e)?.emitExit(t)}$startSendingDataEvents(){if(!this._dataEventTracker.value){this._dataEventTracker.value=this._instantiationService.createInstance(PIe,(e,t)=>{this._onTerminalData(e,t)});for(const e of this._terminalService.instances)for(const t of e.initialDataEvents||[])this._onTerminalData(e.instanceId,t)}}$stopSendingDataEvents(){this._dataEventTracker.clear()}$startSendingCommandEvents(){if(this._sendCommandEventListener.value)return;const e=this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,i=>i.onCommandFinished),t=e.event(i=>{this._onDidExecuteCommand(i.instance.instanceId,{commandLine:i.data.command,cwd:i.data.cwd,exitCode:i.data.exitCode,output:i.data.getOutput()})});this._sendCommandEventListener.value=pa(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new FKt(this._proxy))}$stopLinkProvider(){this._linkProvider.clear()}$registerProcessSupport(e){this._terminalService.registerProcessSupport(e)}$registerProfileProvider(e,t){this._profileProviders.set(e,this._terminalProfileService.registerTerminalProfileProvider(t,e,{createContributedTerminalProfile:async i=>this._proxy.$createContributedProfileTerminal(e,i)}))}$unregisterProfileProvider(e){this._profileProviders.get(e)?.dispose(),this._profileProviders.delete(e)}async $registerQuickFixProvider(e,t){this._quickFixProviders.set(e,this._terminalQuickFixService.registerQuickFixProvider(e,{provideTerminalQuickFixes:async(i,s,o,r)=>{if(r.isCancellationRequested)return;o.outputMatcher?.length&&o.outputMatcher.length>40&&(o.outputMatcher.length=40,this._logService.warn("Cannot exceed output matcher length of 40"));const a=i.command.match(o.commandLineMatcher);if(!a||!s)return;const c=o.outputMatcher;let l;if(c&&(l=OKt(s,c)),!l)return;const d={commandLineMatch:a,outputMatch:l,commandLine:i.command};if(d){const h=await this._proxy.$provideTerminalQuickFixes(e,d,r);if(h&&Array.isArray(h))return h.map(u=>Y8e(e,t,u));if(h)return Y8e(e,t,h)}}}))}$unregisterQuickFixProvider(e){this._quickFixProviders.get(e)?.dispose(),this._quickFixProviders.delete(e)}_onActiveTerminalChanged(e){this._proxy.$acceptActiveTerminalChanged(e)}_onTerminalData(e,t){this._proxy.$acceptTerminalProcessData(e,t)}_onDidExecuteCommand(e,t){this._proxy.$acceptDidExecuteCommand(e,t)}_onTitleChanged(e,t){this._proxy.$acceptTerminalTitleChange(e,t)}_onTerminalDisposed(e){this._proxy.$acceptTerminalClosed(e.instanceId,e.exitCode,e.exitReason??vM.Unknown)}_onTerminalOpened(e){const t=e.shellLaunchConfig.extHostTerminalId,i={name:e.shellLaunchConfig.name,executable:e.shellLaunchConfig.executable,args:e.shellLaunchConfig.args,cwd:e.shellLaunchConfig.cwd,env:e.shellLaunchConfig.env,hideFromUser:e.shellLaunchConfig.hideFromUser};this._proxy.$acceptTerminalOpened(e.instanceId,t,e.title,i)}_onTerminalProcessIdReady(e){e.processId!==void 0&&this._proxy.$acceptTerminalProcessId(e.instanceId,e.processId)}_onInstanceDimensionsChanged(e){this._proxy.$acceptTerminalDimensions(e.instanceId,e.cols,e.rows)}_onInstanceMaximumDimensionsChanged(e){this._proxy.$acceptTerminalMaximumDimensions(e.instanceId,e.maxCols,e.maxRows)}_onRequestStartExtensionTerminal(e){const t=e.proxy;this._terminalProcessProxies.set(t.instanceId,t);const i=e.cols&&e.rows?{columns:e.cols,rows:e.rows}:void 0;this._proxy.$startExtensionTerminal(t.instanceId,i).then(e.callback),t.onInput(s=>this._proxy.$acceptProcessInput(t.instanceId,s)),t.onShutdown(s=>this._proxy.$acceptProcessShutdown(t.instanceId,s)),t.onRequestCwd(()=>this._proxy.$acceptProcessRequestCwd(t.instanceId)),t.onRequestInitialCwd(()=>this._proxy.$acceptProcessRequestInitialCwd(t.instanceId))}$sendProcessData(e,t){this._terminalProcessProxies.get(e)?.emitData(t)}$sendProcessReady(e,t,i,s){this._terminalProcessProxies.get(e)?.emitReady(t,i,s)}$sendProcessProperty(e,t){t.type===jf.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,s){if(i){const o={persistent:t,map:NKt(i),descriptionMap:PKt(s)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};K8e=D([Zi(Ue.MainThreadTerminalService),_(1,Nz),_(2,set),_(3,oet),_(4,be),_(5,tet),_(6,Ze),_(7,iet),_(8,Sf),_(9,MPe),_(10,ZZe),_(11,net)],K8e);let PIe=class extends ${constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new urt(this._callback));for(const i of this._terminalService.instances)this._registerInstance(i);this._register(this._terminalService.onDidCreateInstance(i=>this._registerInstance(i))),this._register(this._terminalService.onDidDisposeInstance(i=>this._bufferer.stopBuffering(i.instanceId)))}_registerInstance(e){this._register(this._bufferer.startBuffering(e.instanceId,e.onData))}};PIe=D([_(1,Nz)],PIe);class FKt{constructor(e){this._proxy=e}async provideLinks(e,t){const i=this._proxy;return(await i.$provideLinks(e.instanceId,t)).map(o=>({id:o.id,startIndex:o.startIndex,length:o.length,label:o.label,activate:()=>i.$activateLink(e.instanceId,o.id)}))}}function OKt(n,e){const t=n.join(` -`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:n}:void 0}function Y8e(n,e,t){let i=x8.TerminalCommand;return"uri"in t?(t.uri=P.revive(t.uri),i=x8.Opener):"id"in t&&(i=x8.VscodeCommand),{id:n,type:i,source:e,...t}}let J8e=class extends ${constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(et.ExtHostTerminalShellIntegration);const s=new Map;this._register(Ee(()=>{for(const d of s.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>T.map(T.filter(d.capabilities.onDidAddCapabilityType,h=>h===TR.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandExecuted));let a;this._store.add(r.event(d=>{if(d.data===a)return;a=d.data;const h=d.instance.instanceId;this._proxy.$shellExecutionStart(h,d.data.command,X8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),s.get(h)?.dispose(),s.set(h,T.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;s.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,X8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CwdDetection,d=>d.onDidChangeCwd));this._store.add(l.event(d=>{this._proxy.$cwdChange(d.instance.instanceId,this._convertCwdToUri(d.data))})),this._store.add(this._terminalService.onDidDisposeInstance(d=>this._proxy.$closeTerminal(d.instanceId)))}$executeCommand(e,t){this._terminalService.getInstanceFromId(e)?.runCommand(t,!0)}_convertCwdToUri(e){return e?P.file(e):void 0}};J8e=D([Zi(Ue.MainThreadTerminalShellIntegration),_(1,Nz),_(2,Za)],J8e);function X8e(n){switch(n.commandLineConfidence){case"high":return NM.High;case"medium":return NM.Medium;case"low":default:return NM.Low}}let Z8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(et.ExtHostTheming),this._themeChangeListener=this._themeService.onDidColorThemeChange(i=>{this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}),this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}dispose(){this._themeChangeListener.dispose()}};Z8e=D([Zi(Ue.MainThreadTheming),_(1,pn)],Z8e);let e9e=class extends ${constructor(e,t,i,s,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=s,this.logService=o,this._dataProviders=this._register(new Zo),this._dndControllers=new Map,this._proxy=e.getProxy(et.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new WKt(e,this._proxy,this.notificationService),s=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>s.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new BKt(e,t.dropMimeTypes,t.dragMimeTypes,t.hasHandleDrag,this._proxy):void 0,r=this.getTreeView(e);r?(r.showCollapseAllAction=t.showCollapseAll,r.canSelectMany=t.canSelectMany,r.manuallyManageCheckboxes=t.manuallyManageCheckboxes,r.dragAndDropController=o,o&&this._dndControllers.set(e,o),r.dataProvider=i,this.registerListeners(e,r,s),this._proxy.$setVisible(e,r.visible)):this.notificationService.error("No view is registered with id: "+e)})}$reveal(e,t,i){return this.logService.trace("MainThreadTreeViews#$reveal",e,t?.item,t?.parentChain,i),this.viewsService.openView(e,i.focus).then(()=>{const s=this.getTreeView(e);if(s&&t)return this.reveal(s,this._dataProviders.get(e).dataProvider,t.item,t.parentChain,i)})}$refresh(e,t){this.logService.trace("MainThreadTreeViews#$refresh",e,t);const i=this.getTreeView(e),s=this._dataProviders.get(e);if(i&&s){const o=s.dataProvider.getItemsToRefresh(t);return i.refresh(o.length?o:void 0)}return Promise.resolve()}$setMessage(e,t){this.logService.trace("MainThreadTreeViews#$setMessage",e,t.toString());const i=this.getTreeView(e);i&&(i.message=t)}$setTitle(e,t,i){this.logService.trace("MainThreadTreeViews#$setTitle",e,t,i);const s=this.getTreeView(e);s&&(s.title=t,s.description=i)}$setBadge(e,t){this.logService.trace("MainThreadTreeViews#$setBadge",e,t?.value,t?.tooltip);const i=this.getTreeView(e);i&&(i.badge=t)}$resolveDropFileData(e,t,i){const s=this._dndControllers.get(e);if(!s)throw new Error("Unknown tree");return s.resolveDropFileData(t,i)}async $disposeTree(e){const t=this.getTreeView(e);t&&(t.dataProvider=void 0),this._dataProviders.deleteAndDispose(e)}async reveal(e,t,i,s,o){o=o||{select:!1,focus:!1};const r=dc(o.select)?!1:o.select,a=dc(o.focus)?!1:o.focus;let c=Math.min(jc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of s){const h=t.getItem(d.handle);h&&await e.expand(h)}const l=t.getItem(i.handle);if(l){await e.reveal(l),r&&e.setSelection([l]),a===!1?e.setFocus():a&&e.setFocus(l);let d=[l];for(;d.length>0&&c>0;c--)await e.expand(d),d=d.reduce((h,u)=>{const f=t.getItem(u.handle);return f&&f.children&&f.children.length&&h.push(...f.children),h},[])}}registerListeners(e,t,i){i.add(t.onDidExpandItem(s=>this._proxy.$setExpanded(e,s.handle,!0))),i.add(t.onDidCollapseItem(s=>this._proxy.$setExpanded(e,s.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(s=>this._proxy.$setSelectionAndFocus(e,s.selection.map(({handle:o})=>o),s.focus.handle))),i.add(t.onDidChangeVisibility(s=>this._proxy.$setVisible(e,s))),i.add(t.onDidChangeCheckboxState(s=>{this._proxy.$changeCheckboxState(e,s.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=it.as(M1.ViewsRegistry).getView(e);return t?t.treeView:null}dispose(){for(const e of this._dataProviders){const t=this.getTreeView(e[0]);t&&(t.dataProvider=void 0)}this._dataProviders.dispose(),this._dndControllers.clear(),super.dispose()}};e9e=D([Zi(Ue.MainThreadTreeViews),_(1,q_),_(2,Pi),_(3,ho),_(4,Ze)],e9e);class BKt{constructor(e,t,i,s,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=s,this._proxy=o,this.dataTransfersCache=new LOe}async handleDrop(e,t,i,s,o,r){const a=this.dataTransfersCache.add(e);try{const c=await rw.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,s,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const s=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!s)return;const o=new fhe;return s.items.forEach(([r,a])=>{o.replace(r,HQ(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class WKt{constructor(e,t,i){this.treeViewId=e,this._proxy=t,this.notificationService=i,this.itemsMap=new Map,this.hasResolve=this._proxy.$hasResolve(this.treeViewId)}getChildren(e){return e||this.itemsMap.clear(),this._proxy.$getChildren(this.treeViewId,e?e.handle:void 0).then(t=>this.postGetChildren(t),t=>(kC.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const s=this.getItem(i);if(s){const o=e[i];if(this.updateTreeItem(s,o),i===o.handle)t.push(s);else{this.itemsMap.delete(i),this.itemsMap.set(s.handle,s);const r=o.parentHandle?this.itemsMap.get(o.parentHandle):null;r&&t.push(r)}}}return t}getItem(e){return this.itemsMap.get(e)}isEmpty(){return this.itemsMap.size===0}async postGetChildren(e){if(e===void 0)return;const t=[],i=await this.hasResolve;if(e)for(const s of e){const o=new fpe(s,i?r=>this._proxy.$resolve(this.treeViewId,s.handle,r):void 0);this.itemsMap.set(s.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=Lc([...Object.keys(e instanceof fpe?e.asTreeItem():e),...Object.keys(t)]);for(const s of i)e[s]=t[s];e instanceof fpe&&e.resetResolve()}}}let t9e=class extends ${constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(P.revive(e),P.revive(t))}};t9e=D([Zi(Ue.MainThreadDownloadService),_(1,wPe)],t9e);class HKt{constructor(e,t,i,s){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=s}handleURL(e,t){return Cn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let i9e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(et.ExtHostUrls)}$registerUriHandler(e,t,i){const s=new HKt(this.proxy,e,t,i),o=this.urlService.registerHandler(s);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,s),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:s}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),s.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};i9e=D([Zi(Ue.MainThreadUrls),_(1,jde),_(2,Cet)],i9e);const aY="vs/workbench/contrib/externalUriOpener/common/configuration",frt="default",UKt="workbench.externalUriOpeners",FIe={type:"string",enum:[]},n9e="\n- `https://microsoft.com`: Matches this specific domain using https\n- `https://microsoft.com:8080`: Matches this specific domain on this port using https\n- `https://microsoft.com:*`: Matches this specific domain on any port using https\n- `https://microsoft.com/foo`: Matches `https://microsoft.com/foo` and `https://microsoft.com/foo/bar`, but not `https://microsoft.com/foobar` or `https://microsoft.com/bar`\n- `https://*.microsoft.com`: Match all domains ending in `microsoft.com` using https\n- `microsoft.com`: Match this specific domain using either http or https\n- `*.microsoft.com`: Match all domains ending in `microsoft.com` using either http or https\n- `http://192.168.0.1`: Matches this specific IP using http\n- `http://192.168.0.*`: Matches all IP's with this prefix using http\n- `*`: Match all domains using either http or https",VKt={...PQ,properties:{[UKt]:{type:"object",markdownDescription:g(aY,0,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(aY,1,`Map URI pattern to an opener id. +`);async function _Kt(n,e,t,i,s){n.write(ze.fromString(mKt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(n.onData(l=>{c?c=ze.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(L8e);if(d===-1)return;r(n),n.pauseData();const h=c.slice(d+L8e.byteLength);h.byteLength&&s.onData.fire(h)})),o.add(n.onClose(l=>a(l??new Error("socket closed")))),o.add(n.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw n.dispose(),r}finally{o.dispose()}}let vKt=class extends ${constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new r1),this.onData=(...i)=>(this.pausableDataEmitter.isPaused&&queueMicrotask(()=>this.pausableDataEmitter.resume()),this.pausableDataEmitter.event(...i)),this.didDisposeEmitter=this._register(new I),this.onDidDispose=this.didDisposeEmitter.event,this.ended=!1,this._register(t.onData),this._register(t.onData.event(i=>this.pausableDataEmitter.fire(i))),this.onClose=this._register(t.onClose).event,this.onEnd=this._register(t.onEnd).event}pauseData(){this.pausableDataEmitter.pause()}drain(){return Promise.resolve()}end(){this.ended=!0,this.closeRemote()}traceSocketEvent(e,t){BDe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},T8e=class extends ${constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(et.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(s){return s.id===e}connect(s,o,r,a){return new Promise((c,l)=>{if(s.id!==e)return l(new Error("Invalid connectTo"));const d=s.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),TOe.connect(h,t._proxy,o,r,a,u).then(f=>{f.onDidDispose(()=>t._remoteSockets.delete(h)),c(f)},f=>{t._remoteSockets.delete(h),l(f)})}).catch(l)})}};this._registrations.set(e,this._remoteSocketFactoryService.register(KV.Managed,i))}async $unregisterSocketFactory(e){this._registrations.get(e)?.dispose()}$onDidManagedSocketHaveData(e,t){this._remoteSockets.get(e)?.onData.fire(t)}$onDidManagedSocketClose(e,t){this._remoteSockets.get(e)?.onClose.fire({type:qne.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};T8e=D([en(Ue.MainThreadManagedSockets),_(1,CPe)],T8e);class TOe extends vKt{static connect(e,t,i,s,o,r){const a=new TOe(e,t,o,r);return _Kt(a,i,s,o,r)}constructor(e,t,i,s){super(i,s),this.socketId=e,this.proxy=t}write(e){this.proxy.$remoteSocketWrite(this.socketId,e)}closeRemote(){this.proxy.$remoteSocketEnd(this.socketId)}drain(){return this.proxy.$remoteSocketDrain(this.socketId)}}const rY="workbench.panel.output";new Y("inOutput",!1);new Y("activeLogOutput",!1);new Y("activeLogOutput.levelSettable",!1);new Y("activeLogOutput.level","");new Y("activeLogOutput.levelIsDefault",!1);new Y("outputView.scrollLock",!1);var aH;(function(n){n[n.Append=1]="Append",n[n.Replace=2]="Replace",n[n.Clear=3]="Clear"})(aH||(aH={}));const drt={OutputChannels:"workbench.contributions.outputChannels"};class wKt{constructor(){this.channels=new Map,this._onDidRegisterChannel=new I,this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=new I,this.onDidRemoveChannel=this._onDidRemoveChannel.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){const e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}removeChannel(e){this.channels.delete(e),this._onDidRemoveChannel.fire(e)}}it.add(drt.OutputChannels,new wKt);new Y("activeOutputChannel","");var NX,zP;let R8e=(zP=class extends ${constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(et.ExtHostOutputService);const s=()=>{const o=this._viewsService.isViewVisible(rY)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(T.any(this._outputService.onActiveOutputChannel,T.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===rY))(()=>s())),s()}async $register(e,t,i,s){const o=(NX._extensionIdPool.get(s)||0)+1;NX._extensionIdPool.set(s,o);const r=`extension-output-${s}-#${o}-${e}`,a=P.revive(t);return it.as(drt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:s}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const s=this._getChannel(e);s&&(t===aH.Append?s.update(t):Kc(i)&&s.update(t,i))}async $reveal(e,t){const i=this._getChannel(e);i&&this._outputService.showChannel(i.id,t)}async $close(e){if(this._viewsService.isViewVisible(rY)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(rY)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},NX=zP,zP._extensionIdPool=new Map,zP);R8e=NX=D([en(Ue.MainThreadOutputService),_(1,nhe),_(2,q_)],R8e);const bKt="vs/workbench/api/browser/mainThreadProgress";class CKt extends xn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let M8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(et.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const s=this._createTask(e);t.location===ch.Notification&&i&&(t={...t,location:ch.Notification,secondaryActions:[new CKt(i,g(bKt,0,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,s,()=>this._proxy.$acceptProgressCanceled(e))}$progressReport(e,t){this._progress.get(e)?.progress.report(t)}$progressEnd(e){const t=this._progress.get(e);t&&(t.resolve(),this._progress.delete(e))}_createTask(e){return t=>new Promise(i=>{this._progress.set(e,{resolve:i,progress:t})})}};M8e=D([en(Ue.MainThreadProgress),_(1,Cf),_(2,ji)],M8e);let N8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new Zo,this.proxy=e.getProxy(et.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,s){const o={label:i,rootUri:P.revive(s),selector:t,isSCM:!1,getOriginalResource:async a=>P.revive(await this.proxy.$provideOriginalResource(e,a,qe.None))},r=this.quickDiffService.addQuickDiffProvider(o);this.providerDisposables.set(e,r)}async $unregisterQuickDiffProvider(e){this.providerDisposables.has(e)&&this.providerDisposables.deleteAndDispose(e)}dispose(){this.providerDisposables.dispose()}};N8e=D([en(Ue.MainThreadQuickDiff),_(1,DQ)],N8e);function P8e(n){n.dark=P.revive(n.dark),n.light&&(n.light=P.revive(n.light))}let F8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(et.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const s=new Promise((o,r)=>{this._items[e]={resolve:o,reject:r}});return t={...t,onDidFocus:o=>{o&&this._proxy.$onItemSelected(o.handle)}},t.canPickMany?this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(s,t,i).then(o=>{if(o)return o.handle})}$setItems(e,t){return this._items[e]&&(this._items[e].resolve(t),delete this._items[e]),Promise.resolve()}$setError(e,t){return this._items[e]&&(this._items[e].reject(t),delete this._items[e]),Promise.resolve()}$input(e,t,i){const s=Object.create(null);return e&&(s.title=e.title,s.password=e.password,s.placeHolder=e.placeHolder,s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.value=e.value,s.ignoreFocusLost=e.ignoreFocusOut),t&&(s.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(s,i)}$createOrUpdate(e){const t=e.id;let i=this.sessions.get(t);if(!i){const r=e.type==="quickPick"?this._quickInputService.createQuickPick():this._quickInputService.createInputBox();if(r.onDidAccept(()=>{this._proxy.$onDidAccept(t)}),r.onDidTriggerButton(a=>{this._proxy.$onDidTriggerButton(t,a.handle)}),r.onDidChangeValue(a=>{this._proxy.$onDidChangeValue(t,a)}),r.onDidHide(()=>{this._proxy.$onDidHide(t)}),e.type==="quickPick"){const a=r;a.onDidChangeActive(c=>{this._proxy.$onDidChangeActive(t,c.map(l=>l.handle))}),a.onDidChangeSelection(c=>{this._proxy.$onDidChangeSelection(t,c.map(l=>l.handle))}),a.onDidTriggerItemButton(c=>{this._proxy.$onDidTriggerItemButton(t,c.item.handle,c.button.handle)})}i={input:r,handlesToItems:new Map},this.sessions.set(t,i)}const{input:s,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?s.show():s.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&P8e(c.iconPath),c))),o.set(a.handle,a))}),s[r]=e[r]):r==="activeItems"||r==="selectedItems"?s[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?s[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&P8e(a.iconPath),a)):s[r]=e[r]);return Promise.resolve(void 0)}$dispose(e){const t=this.sessions.get(e);return t&&(t.input.dispose(),this.sessions.delete(e)),Promise.resolve(void 0)}};F8e=D([en(Ue.MainThreadQuickOpen),_(1,On)],F8e);let O8e=class extends ${constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(et.ExtHostExtensionService);const s=this._environmentService.remoteAuthority;s&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(s);o&&this._proxy.$updateRemoteConnectionData(o)}))}};O8e=D([TO,_(1,Za),_(2,rA)],O8e);const yKt="vs/workbench/api/browser/mainThreadSaveParticipant";class SKt{constructor(e){this._proxy=e.getProxy(et.ExtHostDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.textEditorModel||!gS(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(yKt,0,"Aborted onWillSaveTextDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason).then(c=>{if(!c.every(l=>l))return Promise.reject(new Error("listener failed"))}).then(r,a)});return qle(o,s)}}let B8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(SKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};B8e=D([TO,_(1,be),_(2,tr)],B8e);let W8e=class{constructor(e,t,i){this.speechService=t,this.logService=i,this.providerRegistrations=new Map,this.speechToTextSessions=new Map,this.textToSpeechSessions=new Map,this.keywordRecognitionSessions=new Map,this.proxy=e.getProxy(et.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const s=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None};const a=new Z,c=Math.random();this.proxy.$createSpeechToTextSession(e,c,r?.language);const l=a.add(new I);return this.speechToTextSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelSpeechToTextSession(c),this.speechToTextSessions.delete(c),a.dispose()})),{onDidChange:l.event}},createTextToSpeechSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:T.None,synthesize:async()=>{}};const a=new Z,c=Math.random();this.proxy.$createTextToSpeechSession(e,c,r?.language);const l=a.add(new I);return this.textToSpeechSessions.set(c,{onDidChange:l}),a.add(o.onCancellationRequested(()=>{this.proxy.$cancelTextToSpeechSession(c),this.textToSpeechSessions.delete(c),a.dispose()})),{onDidChange:l.event,synthesize:async d=>{await this.proxy.$synthesizeSpeech(c,d),await dw(T.toPromise(T.filter(l.event,h=>h.status===cye.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:T.None};const r=new Z,a=Math.random();this.proxy.$createKeywordRecognitionSession(e,a);const c=r.add(new I);return this.keywordRecognitionSessions.set(a,{onDidChange:c}),r.add(o.onCancellationRequested(()=>{this.proxy.$cancelKeywordRecognitionSession(a),this.keywordRecognitionSessions.delete(a),r.dispose()})),{onDidChange:c.event}}});this.providerRegistrations.set(e,{dispose:()=>{s.dispose()}})}$unregisterProvider(e){const t=this.providerRegistrations.get(e);t&&(t.dispose(),this.providerRegistrations.delete(e))}$emitSpeechToTextEvent(e,t){this.speechToTextSessions.get(e)?.onDidChange.fire(t)}$emitTextToSpeechEvent(e,t){this.textToSpeechSessions.get(e)?.onDidChange.fire(t)}$emitKeywordRecognitionEvent(e,t){this.keywordRecognitionSessions.get(e)?.onDidChange.fire(t)}dispose(){this.providerRegistrations.forEach(e=>e.dispose()),this.providerRegistrations.clear(),this.speechToTextSessions.forEach(e=>e.onDidChange.dispose()),this.speechToTextSessions.clear(),this.textToSpeechSessions.forEach(e=>e.onDidChange.dispose()),this.textToSpeechSessions.clear(),this.keywordRecognitionSessions.forEach(e=>e.onDidChange.dispose()),this.keywordRecognitionSessions.clear()}};W8e=D([en(Ue.MainThreadSpeech),_(1,Xde),_(2,Ze)],W8e);const AKt="vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant";class EKt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(et.ExtHostWorkspace)}async participate(e,t){const i=new Promise((s,o)=>{setTimeout(()=>o(new Error(g(AKt,0,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(s,o)});return qle(i,t)}}let H8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(EKt,e))}dispose(){this._saveParticipantDisposable.dispose()}};H8e=D([TO,_(1,be),_(2,APe)],H8e);let E8=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return Qi.basename(this.relativePath)}constructor(e,t,i,s=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=s,this.parent=o,this._children=new Map}get(e){return this._children.get(e)}set(e,t){this._children.set(e,t)}delete(e){this._children.delete(e)}clear(){this._children.clear()}};E8.__decorator=D([ii],E8.prototype,"name",null);function hrt(n,e){typeof n.element<"u"&&e.push(n.element);for(const t of n.children)hrt(t,e);return e}class xKt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return hrt(e,[])}static isResourceNode(e){return e instanceof E8}constructor(e,t=P.file("/"),i=Fn){this.extUri=i,this.root=new E8(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,s=new N$(!1).reset(i);let o=this.root,r="";for(;;){const a=s.value();r=r+"/"+a;let c=o.get(a);if(c?s.hasNext()||(c.element=t):(c=new E8(this.extUri.joinPath(this.root.uri,r),r,this.root.context,s.hasNext()?void 0:t,o),o.set(a,c)),o=c,!s.hasNext())return;s.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),s=e.get(i);if(s){if(t.hasNext()){const o=this._delete(s,t.next());return typeof o<"u"&&s.childrenCount===0&&e.delete(i),o}return e.delete(i),s.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new N$(!1).reset(t);let s=this.root;for(;;){const o=i.value(),r=s.get(o);if(!r||!i.hasNext())return r;s=r,i.next()}}}function U8e(n){if(n!==void 0){if(P.isUri(n))return P.revive(n);if($e.isThemeIcon(n))return n;{const e=n;return{light:P.revive(e.light),dark:P.revive(e.dark)}}}}class DKt extends ${constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(_e.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class kKt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??P.file("/");this._resourceTree=new xKt(this,e,this._uriIdentService.extUri);for(const t of this.resources)this._resourceTree.add(t.sourceUri,t)}return this._resourceTree}get hideWhenEmpty(){return!!this.features.hideWhenEmpty}constructor(e,t,i,s,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=s,this.label=o,this.id=r,this.multiDiffEditorEnableViewChanges=a,this._uriIdentService=c,this.resources=[],this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event}toJSON(){return{$mid:Fs.ScmResourceGroup,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(e,t,i){this.resources.splice(e,t,...i),this._resourceTree=void 0,this._onDidChangeResources.fire()}$updateGroup(e){this.features={...this.features,...e},this._onDidChange.fire()}$updateGroupLabel(e){this.label=e,this._onDidChange.fire()}}class IKt{constructor(e,t,i,s,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=s,this.sourceUri=o,this.resourceGroup=r,this.decorations=a,this.contextValue=c,this.command=l,this.multiDiffEditorOriginalUri=d,this.multiDiffEditorModifiedUri=h}open(e){return this.proxy.$executeResourceCommand(this.sourceControlHandle,this.groupHandle,this.handle,e)}toJSON(){return{$mid:Fs.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class LKt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}set currentHistoryItemGroup(e){this._currentHistoryItemGroup=e,this._onDidChangeCurrentHistoryItemGroup.fire()}constructor(e,t){this.proxy=e,this.handle=t,this._onDidChangeCurrentHistoryItemGroup=new I,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,qe.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,qe.None))?.map(s=>({...s,icon:U8e(s.icon)}))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,qe.None);return i?{...i,icon:U8e(i.icon)}:void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,qe.None))?.map(s=>({uri:P.revive(s.uri),originalUri:s.originalUri&&P.revive(s.originalUri),modifiedUri:s.modifiedUri&&P.revive(s.modifiedUri),renameUri:s.renameUri&&P.revive(s.renameUri)}))}}const ole=class ole{get id(){return this._id}get handle(){return this._handle}get label(){return this._label}get rootUri(){return this._rootUri}get inputBoxTextModel(){return this._inputBoxTextModel}get contextValue(){return this._providerId}get commitTemplate(){return this.features.commitTemplate||""}get historyProvider(){return this._historyProvider}get acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get statusBarCommands(){return this.features.statusBarCommands}get count(){return this.features.count}get name(){return this._name??this._label}get onDidChangeStatusBarCommands(){return this._onDidChangeStatusBarCommands.event}constructor(e,t,i,s,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=s,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${ole.ID_HANDLE++}`,this.groups=[],this._onDidChangeResourceGroups=new I,this.onDidChangeResourceGroups=this._onDidChangeResourceGroups.event,this._onDidChangeResources=new I,this.onDidChangeResources=this._onDidChangeResources.event,this._groupsByHandle=Object.create(null),this.features={},this._onDidChangeCommitTemplate=new I,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new I,this._onDidChangeHistoryProvider=new I,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=ui(o))}}$updateSourceControl(e){this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._onDidChangeCommitTemplate.fire(this.commitTemplate),typeof e.statusBarCommands<"u"&&this._onDidChangeStatusBarCommands.fire(this.statusBarCommands),e.hasQuickDiffProvider&&!this._quickDiff?this._quickDiff=this._quickDiffService.addQuickDiffProvider({label:e.quickDiffLabel??this.label,rootUri:this.rootUri,isSCM:this.isSCM,getOriginalResource:t=>this.getOriginalResource(t)}):e.hasQuickDiffProvider===!1&&this._quickDiff&&(this._quickDiff.dispose(),this._quickDiff=void 0),e.hasHistoryProvider&&!this._historyProvider?(this._historyProvider=new LKt(this.proxy,this.handle),this._onDidChangeHistoryProvider.fire()):e.hasHistoryProvider===!1&&this._historyProvider&&(this._historyProvider=void 0,this._onDidChangeHistoryProvider.fire())}$registerGroups(e){const t=e.map(([i,s,o,r,a])=>{const c=new kKt(this.handle,i,this,r,o,s,a,this._uriIdentService);return this._groupsByHandle[i]=c,c});this.groups.splice(this.groups.length,0,...t),this._onDidChangeResourceGroups.fire()}$updateGroup(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroup(t)}$updateGroupLabel(e,t){const i=this._groupsByHandle[e];i&&i.$updateGroupLabel(t)}$spliceGroupResourceStates(e){for(const[t,i]of e){const s=this._groupsByHandle[t];if(!s){console.warn(`SCM group ${t} not found in provider ${this.label}`);continue}i.reverse();for(const[o,r,a]of i){const c=a.map(l=>{const[d,h,u,f,p,m,v,w,b,C]=l,[y,S]=u,M=$e.isThemeIcon(y)?y:P.revive(y),k=($e.isThemeIcon(S)?S:P.revive(S))||M,F={icon:M,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new IKt(this.proxy,this.handle,t,d,P.revive(h),s,F,v||void 0,w,P.revive(b),P.revive(C))});s.splice(o,r,c)}}this._onDidChangeResources.fire()}$unregisterGroup(e){const t=this._groupsByHandle[e];t&&(delete this._groupsByHandle[e],this.groups.splice(this.groups.indexOf(t),1),this._onDidChangeResourceGroups.fire())}async getOriginalResource(e){if(!this.features.hasQuickDiffProvider)return null;const t=await this.proxy.$provideOriginalResource(this.handle,e,qe.None);return t&&P.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this._historyProvider&&(this._historyProvider.currentHistoryItemGroup=e??void 0)}toJSON(){return{$mid:Fs.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};ole.ID_HANDLE=0;let TIe=ole,V8e=class{constructor(e,t,i,s,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=s,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostSCM),this._disposables.add(new DKt(this.textModelService,this.modelService,this.languageService))}dispose(){St(this._repositories.values()),this._repositories.clear(),St(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,s,o){const r=await this.textModelService.createModelReference(P.revive(o)),a=new TIe(this._proxy,e,t,i,s?P.revive(s):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=pa(r,T.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryDisposables.set(e,l)}$updateSourceControl(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}$unregisterSourceControl(e){const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}$registerGroups(e,t,i){const s=this._repositories.get(e);if(!s)return;const o=s.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}$updateGroup(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroup(t,i)}$updateGroupLabel(e,t,i){const s=this._repositories.get(e);if(!s)return;s.provider.$updateGroupLabel(t,i)}$spliceResourceStates(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}$unregisterGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}$setInputBoxValue(e,t){const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}$setInputBoxPlaceholder(e,t){const i=this._repositories.get(e);i&&(i.input.placeholder=t)}$setInputBoxEnablement(e,t){const i=this._repositories.get(e);i&&(i.input.enabled=t)}$setInputBoxVisibility(e,t){const i=this._repositories.get(e);i&&(i.input.visible=t)}$showValidationMessage(e,t,i){const s=this._repositories.get(e);s&&s.input.showValidationMessage(t,i)}$setValidationProviderIsEnabled(e,t){const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(s,o)=>{const r=await this._proxy.$validateInput(e,s,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};V8e=D([en(Ue.MainThreadSCM),_(1,RPe),_(2,YZe),_(3,Di),_(4,Ai),_(5,Rn),_(6,DQ),_(7,_o),_(8,Ti)],V8e);var z8e;(function(n){n.FindInFilesActionId="workbench.action.findInFiles",n.FocusActiveEditorCommandId="search.action.focusActiveEditor",n.FocusSearchFromResults="search.action.focusSearchFromResults",n.OpenMatch="search.action.openResult",n.OpenMatchToSide="search.action.openResultToSide",n.RemoveActionId="search.action.remove",n.CopyPathCommandId="search.action.copyPath",n.CopyMatchCommandId="search.action.copyMatch",n.CopyAllCommandId="search.action.copyAll",n.OpenInEditorCommandId="search.action.openInEditor",n.ClearSearchHistoryCommandId="search.action.clearHistory",n.FocusSearchListCommandID="search.action.focusSearchList",n.ReplaceActionId="search.action.replace",n.ReplaceAllInFileActionId="search.action.replaceAllInFile",n.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",n.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",n.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",n.ToggleWholeWordCommandId="toggleSearchWholeWord",n.ToggleRegexCommandId="toggleSearchRegex",n.TogglePreserveCaseId="toggleSearchPreserveCase",n.AddCursorsAtSearchResults="addCursorsAtSearchResults",n.RevealInSideBarForSearchResults="search.action.revealInSideBar",n.ReplaceInFilesActionId="workbench.action.replaceInFiles",n.ShowAllSymbolsActionId="workbench.action.showAllSymbols",n.QuickTextSearchActionId="workbench.action.quickTextSearch",n.CancelSearchActionId="search.action.cancel",n.RefreshSearchResultsActionId="search.action.refreshSearchResults",n.FocusNextSearchResultActionId="search.action.focusNextSearchResult",n.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",n.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",n.CollapseSearchResultsActionId="search.action.collapseSearchResults",n.ExpandSearchResultsActionId="search.action.expandSearchResults",n.ExpandRecursivelyCommandId="search.action.expandRecursively",n.ClearSearchResultsActionId="search.action.clearSearchResults",n.ViewAsTreeActionId="search.action.viewAsTree",n.ViewAsListActionId="search.action.viewAsList",n.ShowAIResultsActionId="search.action.showAIResults",n.HideAIResultsActionId="search.action.hideAIResults",n.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",n.ExcludeFolderFromSearchId="search.action.excludeFromSearch",n.FocusNextInputActionId="search.focus.nextInputBox",n.FocusPreviousInputActionId="search.focus.previousInputBox",n.RestrictSearchToFolderId="search.action.restrictSearchToFolder",n.FindInFolderId="filesExplorer.findInFolder",n.FindInWorkspaceId="filesExplorer.findInWorkspace"})(z8e||(z8e={}));const TKt={SearchViewVisibleKey:new Y("searchViewletVisible",!0),SearchViewFocusedKey:new Y("searchViewletFocus",!1),InputBoxFocusedKey:new Y("inputBoxFocus",!1),SearchInputBoxFocusedKey:new Y("searchInputBoxFocus",!1),ReplaceInputBoxFocusedKey:new Y("replaceInputBoxFocus",!1),PatternIncludesFocusedKey:new Y("patternIncludesInputBoxFocus",!1),PatternExcludesFocusedKey:new Y("patternExcludesInputBoxFocus",!1),ReplaceActiveKey:new Y("replaceActive",!1),HasSearchResults:new Y("hasSearchResult",!1),FirstMatchFocusKey:new Y("firstMatchFocus",!1),FileMatchOrMatchFocusKey:new Y("fileMatchOrMatchFocus",!1),FileMatchOrFolderMatchFocusKey:new Y("fileMatchOrFolderMatchFocus",!1),FileMatchOrFolderMatchWithResourceFocusKey:new Y("fileMatchOrFolderMatchWithResourceFocus",!1),FileFocusKey:new Y("fileMatchFocus",!1),FolderFocusKey:new Y("folderMatchFocus",!1),ResourceFolderFocusKey:new Y("folderMatchWithResourceFocus",!1),IsEditableItemKey:new Y("isEditableItem",!0),MatchFocusKey:new Y("matchFocus",!1),ViewHasSearchPatternKey:new Y("viewHasSearchPattern",!1),ViewHasReplacePatternKey:new Y("viewHasReplacePattern",!1),ViewHasFilePatternKey:new Y("viewHasFilePattern",!1),ViewHasSomeCollapsibleKey:new Y("viewHasSomeCollapsibleResult",!1),InTreeViewKey:new Y("inTreeView",!1),AIResultsVisibleKey:new Y("AIResultsVisibleKey",!1),hasAIResultProvider:new Y("hasAIResultProviderKey",!1)};let $8e=class{constructor(e,t,i,s,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(et.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new Xpe(this._searchService,h8.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){TKt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new Xpe(this._searchService,h8.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new Xpe(this._searchService,h8.file,t,e,this._proxy))}$unregisterProvider(e){St(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const s=this._searchProvider.get(e);if(!s)throw new Error("Got result for unknown provider");s.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};$8e=D([en(Ue.MainThreadSearch),_(1,ohe),_(2,rn),_(3,Re),_(4,Pe)],$8e);const rle=class rle{constructor(e,t=++rle._idPool,i=new Map){this.progress=e,this.id=t,this.matches=i}addMatch(e){const t=this.matches.get(e.resource.toString());t?t.results&&e.results&&t.results.push(...e.results):this.matches.set(e.resource.toString(),e),this.progress?.(e)}};rle._idPool=0;let RIe=rle;class Xpe{constructor(e,t,i,s,o){this._scheme=i,this._handle=s,this._proxy=o,this._registrations=new Z,this._searches=new Map,this._registrations.add(e.registerSearchResultProvider(this._scheme,t,this))}dispose(){this._registrations.dispose()}fileSearch(e,t=qe.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=qe.None){return this.doSearch(e,t,i)}doSearch(e,t,i=qe.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const s=new RIe(t);this._searches.set(s.id,s);const o=this._provideSearchResults(e,s.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(s.id),{results:Array.from(s.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(s.id),Promise.reject(r)))}clearCache(e){return Promise.resolve(this._proxy.$clearCache(e))}handleFindMatch(e,t){const i=this._searches.get(e);i&&t.forEach(s=>{s.results?i.addMatch(Or(s)):i.addMatch({resource:P.revive(s)})})}_provideSearchResults(e,t,i){switch(e.type){case z1.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case z1.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let G8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(et.ExtHostStatusBar),s=[];for(const[r,a]of t.getEntries())s.push(o(r,a));i.$acceptStaticEntries(s),this._store.add(t.onDidChange(r=>{r.added&&i.$acceptStaticEntries([o(r.added[0],r.added[1])])}));function o(r,a){return{entryId:r,name:a.entry.name,text:a.entry.text,tooltip:a.entry.tooltip,command:typeof a.entry.command=="string"?a.entry.command:typeof a.entry.command=="object"?a.entry.command.id:void 0,priority:a.priority,alignLeft:a.alignment===W7.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,s,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,s,o,r,a,c,l,d,h,u)===H7.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};G8e=D([en(Ue.MainThreadStatusBar),_(1,xPe)],G8e);async function RKt(n,e,t,i){return i.invokeFunction(async s=>{const o=s.get(Il),r=s.get(V_),a=s.get(B7),c=s.get(on),l=s.get(_o),d=s.get(ci),h=s.get(Ti),u=s.get(Ze),f=`extensionStorage.migrate.${n}-${e}`,p=n.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${n.toLowerCase()}`:void 0;if(n===e)return;const m=(w,b)=>b?l.extUri.joinPath(r.defaultProfile.globalStorageHome,w.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,w),v=t?ke.PROFILE:ke.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${n} to ${e}...`);const w=a.getExtensionState(n,t);w&&(a.setExtensionState(e,w,t),a.setExtensionState(n,void 0,t));const b=m(n,t),C=m(e,t);if(!l.extUri.isEqual(b,C))try{await d.move(b,C,!0)}catch(y){y.code!==rt.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${n}' to '${e}'`,lg(y))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${n} to ${e}`),c.store(f,!0,v,ln.MACHINE)}})}let q8e=class{constructor(e,t,i,s,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=s,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(et.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(ke.PROFILE,void 0,this._storageListener)(r=>{if(this._sharedStorageKeysToWatch.has(r.key)){const a=this._extensionStorageService.getExtensionStateRaw(r.key,!0);typeof a=="string"&&this._proxy.$acceptValue(!0,r.key,a)}}))}dispose(){this._storageListener.dispose()}async $initializeExtensionStorage(e,t){return await this.checkAndMigrateExtensionStorage(t,e),e&&this._sharedStorageKeysToWatch.set(t,!0),this._extensionStorageService.getExtensionStateRaw(t,e)}async $setValue(e,t,i){this._extensionStorageService.setExtensionState(t,i,e)}$registerExtensionStorageKeysToSync(e,t){this._extensionStorageService.setKeysForSync(e,t)}async checkAndMigrateExtensionStorage(e,t){try{let i=this._extensionStorageService.getSourceExtensionToMigrate(e);!i&&Jn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Jn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await RKt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};q8e=D([en(Ue.MainThreadStorage),_(1,B7),_(2,on),_(3,be),_(4,Ze)],q8e);var MIe,$P;let Q8e=($P=class extends ${constructor(e,t,i,s,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=s,this._productService=o,this._proxy=e.getProxy(et.ExtHostTelemetry),EJ(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(xJe)||r.affectsConfiguration(DJe))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,EJ(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return EJ(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:sp.NONE}$publicLog(e,t=Object.create(null)){t[MIe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},MIe=$P,$P._name="pluginHostTelemetry",$P);Q8e=MIe=D([en(Ue.MainThreadTelemetry),_(1,rn),_(2,Re),_(3,Il),_(4,Ja)],Q8e);class urt{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(const e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,i=5){const s=t(o=>{const r=typeof o=="string"?o:o.data;let a=this._terminalBufferMap.get(e);if(a){a.data.push(r);return}const c=setTimeout(()=>this.flushBuffer(e),i);a={data:[r],timeoutId:c,dispose:()=>{clearTimeout(c),this.flushBuffer(e),s.dispose()}},this._terminalBufferMap.set(e,a)});return s}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){const t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join("")))}}let NIe=class extends ${get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,s){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=s,this.id=0,this.shouldPersist=!1,this._onProcessData=this._register(new I),this.onProcessData=this._onProcessData.event,this._onProcessReady=this._register(new I),this._onStart=this._register(new I),this.onStart=this._onStart.event,this._onInput=this._register(new I),this.onInput=this._onInput.event,this._onBinary=this._register(new I),this.onBinary=this._onBinary.event,this._onResize=this._register(new I),this.onResize=this._onResize.event,this._onAcknowledgeDataEvent=this._register(new I),this.onAcknowledgeDataEvent=this._onAcknowledgeDataEvent.event,this._onShutdown=this._register(new I),this.onShutdown=this._onShutdown.event,this._onRequestInitialCwd=this._register(new I),this.onRequestInitialCwd=this._onRequestInitialCwd.event,this._onRequestCwd=this._register(new I),this.onRequestCwd=this._onRequestCwd.event,this._onDidChangeProperty=this._register(new I),this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=this._register(new I),this.onProcessExit=this._onProcessExit.event,this._pendingInitialCwdRequests=[],this._pendingCwdRequests=[]}emitData(e){this._onProcessData.fire(e)}emitTitle(e){this._onDidChangeProperty.fire({type:jf.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case jf.Cwd:this.emitCwd(t);break;case jf.InitialCwd:this.emitInitialCwd(t);break;case jf.Title:this.emitTitle(t);break;case jf.OverrideDimensions:this.emitOverrideDimensions(t);break;case jf.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:jf.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:jf.ResolvedShellLaunchConfig,value:e})}emitInitialCwd(e){for(;this._pendingInitialCwdRequests.length>0;)this._pendingInitialCwdRequests.pop()(e)}emitCwd(e){for(;this._pendingCwdRequests.length>0;)this._pendingCwdRequests.pop()(e)}async start(){return this._terminalService.requestStartExtensionTerminal(this,this._cols,this._rows)}shutdown(e){this._onShutdown.fire(e)}input(e){this._onInput.fire(e)}resize(e,t){this._onResize.fire({cols:e,rows:t})}clearBuffer(){}acknowledgeDataEvent(){}async setUnicodeVersion(e){}async processBinary(e){this._onBinary.fire(e)}getInitialCwd(){return new Promise(e=>{this._onRequestInitialCwd.fire(),this._pendingInitialCwdRequests.push(e)})}getCwd(){return new Promise(e=>{this._onRequestCwd.fire(),this._pendingCwdRequests.push(e)})}async refreshProperty(e){}async updateProperty(e,t){}};NIe=D([_(3,Nz)],NIe);function grt(n){return[...n.entries()]}function MKt(n){return n?[...n.entries()]:[]}function NKt(n){return new Map(n)}function PKt(n){return new Map(n??[])}var x8;(function(n){n[n.TerminalCommand=0]="TerminalCommand",n[n.Opener=1]="Opener",n[n.Port=2]="Port",n[n.VscodeCommand=3]="VscodeCommand"})(x8||(x8={}));var TR;(function(n){n[n.CwdDetection=0]="CwdDetection",n[n.NaiveCwdDetection=1]="NaiveCwdDetection",n[n.CommandDetection=2]="CommandDetection",n[n.PartialCommandDetection=3]="PartialCommandDetection",n[n.BufferMarkDetection=4]="BufferMarkDetection"})(TR||(TR={}));var j8e;(function(n){n.Windows="windows",n.NoProblemsReported="noProblemsReported"})(j8e||(j8e={}));let K8e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=s,this._instantiationService=o,this._environmentVariableService=r,this._logService=a,this._terminalProfileResolverService=c,this._terminalGroupService=d,this._terminalEditorService=h,this._terminalProfileService=u,this._store=new Z,this._extHostTerminals=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this._quickFixProviders=new Map,this._dataEventTracker=new Dn,this._sendCommandEventListener=new Dn,this._linkProvider=this._store.add(new Dn),this._os=$c,this._proxy=e.getProxy(et.ExtHostTerminalService),this._store.add(t.onDidCreateInstance(p=>{this._onTerminalOpened(p),this._onInstanceDimensionsChanged(p)})),this._store.add(t.onDidDisposeInstance(p=>this._onTerminalDisposed(p))),this._store.add(t.onAnyInstanceProcessIdReady(p=>this._onTerminalProcessIdReady(p))),this._store.add(t.onDidChangeInstanceDimensions(p=>this._onInstanceDimensionsChanged(p))),this._store.add(t.onAnyInstanceMaximumDimensionsChange(p=>this._onInstanceMaximumDimensionsChanged(p))),this._store.add(t.onDidRequestStartExtensionTerminal(p=>this._onRequestStartExtensionTerminal(p))),this._store.add(t.onDidChangeActiveInstance(p=>this._onActiveTerminalChanged(p?p.instanceId:null))),this._store.add(t.onAnyInstanceTitleChange(p=>p&&this._onTitleChanged(p.instanceId,p.title))),this._store.add(t.onAnyInstanceDataInput(p=>this._proxy.$acceptTerminalInteraction(p.instanceId))),this._store.add(t.onAnyInstanceSelectionChange(p=>this._proxy.$acceptTerminalSelection(p.instanceId,p.selection)));for(const p of this._terminalService.instances)this._onTerminalOpened(p),p.processReady.then(()=>this._onTerminalProcessIdReady(p));const f=this._terminalService.activeInstance;if(f&&this._proxy.$acceptActiveTerminalChanged(f.instanceId),this._environmentVariableService.collections.size>0){const m=[...this._environmentVariableService.collections.entries()].map(v=>[v[0],grt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||$c,this._updateDefaultProfile()}),this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(()=>this._updateDefaultProfile()))}dispose(){this._store.dispose();for(const e of this._profileProviders.values())e.dispose();for(const e of this._quickFixProviders.values())e.dispose()}async _updateDefaultProfile(){const e=this._extHostContext.remoteAuthority??void 0,t=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os}),i=this._terminalProfileResolverService.getDefaultProfile({remoteAuthority:e,os:this._os,allowAutomationShell:!0});this._proxy.$acceptDefaultProfile(...await Promise.all([t,i]))}async _getTerminalInstance(e){return typeof e=="string"?this._extHostTerminals.get(e):this._terminalService.getInstanceFromId(e)}async $createTerminal(e,t){const i={name:t.name,executable:t.shellPath,args:t.shellArgs,cwd:typeof t.cwd=="string"?t.cwd:P.revive(t.cwd),icon:t.icon,color:t.color,initialText:t.initialText,waitOnExit:t.waitOnExit,ignoreConfigurationCwd:!0,env:t.env,strictEnv:t.strictEnv,hideFromUser:t.hideFromUser,customPtyImplementation:t.isExtensionCustomPtyTerminal?(r,a,c)=>new NIe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},s=ko.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,s);const o=await s;this._store.add(o.onDisposed(()=>{this._extHostTerminals.delete(e)}))}async _deserializeParentTerminal(e){if(typeof e=="object"&&"parentTerminal"in e){const t=await this._extHostTerminals.get(e.parentTerminal.toString());return t?{parentTerminal:t}:void 0}return e}async $show(e,t){const i=await this._getTerminalInstance(e);i&&(this._terminalService.setActiveInstance(i),i.target===fV.Editor?await this._terminalEditorService.revealActiveEditor(t):await this._terminalGroupService.showPanel(!t))}async $hide(e){const t=await this._getTerminalInstance(e),i=this._terminalService.activeInstance;i&&i.instanceId===t?.instanceId&&i.target!==fV.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(vM.Extension)}async $sendText(e,t,i){await(await this._getTerminalInstance(e))?.sendText(t,i)}$sendProcessExit(e,t){this._terminalProcessProxies.get(e)?.emitExit(t)}$startSendingDataEvents(){if(!this._dataEventTracker.value){this._dataEventTracker.value=this._instantiationService.createInstance(PIe,(e,t)=>{this._onTerminalData(e,t)});for(const e of this._terminalService.instances)for(const t of e.initialDataEvents||[])this._onTerminalData(e.instanceId,t)}}$stopSendingDataEvents(){this._dataEventTracker.clear()}$startSendingCommandEvents(){if(this._sendCommandEventListener.value)return;const e=this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,i=>i.onCommandFinished),t=e.event(i=>{this._onDidExecuteCommand(i.instance.instanceId,{commandLine:i.data.command,cwd:i.data.cwd,exitCode:i.data.exitCode,output:i.data.getOutput()})});this._sendCommandEventListener.value=pa(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new FKt(this._proxy))}$stopLinkProvider(){this._linkProvider.clear()}$registerProcessSupport(e){this._terminalService.registerProcessSupport(e)}$registerProfileProvider(e,t){this._profileProviders.set(e,this._terminalProfileService.registerTerminalProfileProvider(t,e,{createContributedTerminalProfile:async i=>this._proxy.$createContributedProfileTerminal(e,i)}))}$unregisterProfileProvider(e){this._profileProviders.get(e)?.dispose(),this._profileProviders.delete(e)}async $registerQuickFixProvider(e,t){this._quickFixProviders.set(e,this._terminalQuickFixService.registerQuickFixProvider(e,{provideTerminalQuickFixes:async(i,s,o,r)=>{if(r.isCancellationRequested)return;o.outputMatcher?.length&&o.outputMatcher.length>40&&(o.outputMatcher.length=40,this._logService.warn("Cannot exceed output matcher length of 40"));const a=i.command.match(o.commandLineMatcher);if(!a||!s)return;const c=o.outputMatcher;let l;if(c&&(l=OKt(s,c)),!l)return;const d={commandLineMatch:a,outputMatch:l,commandLine:i.command};if(d){const h=await this._proxy.$provideTerminalQuickFixes(e,d,r);if(h&&Array.isArray(h))return h.map(u=>Y8e(e,t,u));if(h)return Y8e(e,t,h)}}}))}$unregisterQuickFixProvider(e){this._quickFixProviders.get(e)?.dispose(),this._quickFixProviders.delete(e)}_onActiveTerminalChanged(e){this._proxy.$acceptActiveTerminalChanged(e)}_onTerminalData(e,t){this._proxy.$acceptTerminalProcessData(e,t)}_onDidExecuteCommand(e,t){this._proxy.$acceptDidExecuteCommand(e,t)}_onTitleChanged(e,t){this._proxy.$acceptTerminalTitleChange(e,t)}_onTerminalDisposed(e){this._proxy.$acceptTerminalClosed(e.instanceId,e.exitCode,e.exitReason??vM.Unknown)}_onTerminalOpened(e){const t=e.shellLaunchConfig.extHostTerminalId,i={name:e.shellLaunchConfig.name,executable:e.shellLaunchConfig.executable,args:e.shellLaunchConfig.args,cwd:e.shellLaunchConfig.cwd,env:e.shellLaunchConfig.env,hideFromUser:e.shellLaunchConfig.hideFromUser};this._proxy.$acceptTerminalOpened(e.instanceId,t,e.title,i)}_onTerminalProcessIdReady(e){e.processId!==void 0&&this._proxy.$acceptTerminalProcessId(e.instanceId,e.processId)}_onInstanceDimensionsChanged(e){this._proxy.$acceptTerminalDimensions(e.instanceId,e.cols,e.rows)}_onInstanceMaximumDimensionsChanged(e){this._proxy.$acceptTerminalMaximumDimensions(e.instanceId,e.maxCols,e.maxRows)}_onRequestStartExtensionTerminal(e){const t=e.proxy;this._terminalProcessProxies.set(t.instanceId,t);const i=e.cols&&e.rows?{columns:e.cols,rows:e.rows}:void 0;this._proxy.$startExtensionTerminal(t.instanceId,i).then(e.callback),t.onInput(s=>this._proxy.$acceptProcessInput(t.instanceId,s)),t.onShutdown(s=>this._proxy.$acceptProcessShutdown(t.instanceId,s)),t.onRequestCwd(()=>this._proxy.$acceptProcessRequestCwd(t.instanceId)),t.onRequestInitialCwd(()=>this._proxy.$acceptProcessRequestInitialCwd(t.instanceId))}$sendProcessData(e,t){this._terminalProcessProxies.get(e)?.emitData(t)}$sendProcessReady(e,t,i,s){this._terminalProcessProxies.get(e)?.emitReady(t,i,s)}$sendProcessProperty(e,t){t.type===jf.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,s){if(i){const o={persistent:t,map:NKt(i),descriptionMap:PKt(s)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};K8e=D([en(Ue.MainThreadTerminalService),_(1,Nz),_(2,set),_(3,oet),_(4,be),_(5,tet),_(6,Ze),_(7,iet),_(8,Sf),_(9,MPe),_(10,ZZe),_(11,net)],K8e);let PIe=class extends ${constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new urt(this._callback));for(const i of this._terminalService.instances)this._registerInstance(i);this._register(this._terminalService.onDidCreateInstance(i=>this._registerInstance(i))),this._register(this._terminalService.onDidDisposeInstance(i=>this._bufferer.stopBuffering(i.instanceId)))}_registerInstance(e){this._register(this._bufferer.startBuffering(e.instanceId,e.onData))}};PIe=D([_(1,Nz)],PIe);class FKt{constructor(e){this._proxy=e}async provideLinks(e,t){const i=this._proxy;return(await i.$provideLinks(e.instanceId,t)).map(o=>({id:o.id,startIndex:o.startIndex,length:o.length,label:o.label,activate:()=>i.$activateLink(e.instanceId,o.id)}))}}function OKt(n,e){const t=n.join(` +`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:n}:void 0}function Y8e(n,e,t){let i=x8.TerminalCommand;return"uri"in t?(t.uri=P.revive(t.uri),i=x8.Opener):"id"in t&&(i=x8.VscodeCommand),{id:n,type:i,source:e,...t}}let J8e=class extends ${constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(et.ExtHostTerminalShellIntegration);const s=new Map;this._register(Ee(()=>{for(const d of s.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>T.map(T.filter(d.capabilities.onDidAddCapabilityType,h=>h===TR.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandExecuted));let a;this._store.add(r.event(d=>{if(d.data===a)return;a=d.data;const h=d.instance.instanceId;this._proxy.$shellExecutionStart(h,d.data.command,X8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),s.get(h)?.dispose(),s.set(h,T.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;s.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,X8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TR.CwdDetection,d=>d.onDidChangeCwd));this._store.add(l.event(d=>{this._proxy.$cwdChange(d.instance.instanceId,this._convertCwdToUri(d.data))})),this._store.add(this._terminalService.onDidDisposeInstance(d=>this._proxy.$closeTerminal(d.instanceId)))}$executeCommand(e,t){this._terminalService.getInstanceFromId(e)?.runCommand(t,!0)}_convertCwdToUri(e){return e?P.file(e):void 0}};J8e=D([en(Ue.MainThreadTerminalShellIntegration),_(1,Nz),_(2,Za)],J8e);function X8e(n){switch(n.commandLineConfidence){case"high":return NM.High;case"medium":return NM.Medium;case"low":default:return NM.Low}}let Z8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(et.ExtHostTheming),this._themeChangeListener=this._themeService.onDidColorThemeChange(i=>{this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}),this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type)}dispose(){this._themeChangeListener.dispose()}};Z8e=D([en(Ue.MainThreadTheming),_(1,pn)],Z8e);let e9e=class extends ${constructor(e,t,i,s,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=s,this.logService=o,this._dataProviders=this._register(new Zo),this._dndControllers=new Map,this._proxy=e.getProxy(et.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new WKt(e,this._proxy,this.notificationService),s=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>s.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new BKt(e,t.dropMimeTypes,t.dragMimeTypes,t.hasHandleDrag,this._proxy):void 0,r=this.getTreeView(e);r?(r.showCollapseAllAction=t.showCollapseAll,r.canSelectMany=t.canSelectMany,r.manuallyManageCheckboxes=t.manuallyManageCheckboxes,r.dragAndDropController=o,o&&this._dndControllers.set(e,o),r.dataProvider=i,this.registerListeners(e,r,s),this._proxy.$setVisible(e,r.visible)):this.notificationService.error("No view is registered with id: "+e)})}$reveal(e,t,i){return this.logService.trace("MainThreadTreeViews#$reveal",e,t?.item,t?.parentChain,i),this.viewsService.openView(e,i.focus).then(()=>{const s=this.getTreeView(e);if(s&&t)return this.reveal(s,this._dataProviders.get(e).dataProvider,t.item,t.parentChain,i)})}$refresh(e,t){this.logService.trace("MainThreadTreeViews#$refresh",e,t);const i=this.getTreeView(e),s=this._dataProviders.get(e);if(i&&s){const o=s.dataProvider.getItemsToRefresh(t);return i.refresh(o.length?o:void 0)}return Promise.resolve()}$setMessage(e,t){this.logService.trace("MainThreadTreeViews#$setMessage",e,t.toString());const i=this.getTreeView(e);i&&(i.message=t)}$setTitle(e,t,i){this.logService.trace("MainThreadTreeViews#$setTitle",e,t,i);const s=this.getTreeView(e);s&&(s.title=t,s.description=i)}$setBadge(e,t){this.logService.trace("MainThreadTreeViews#$setBadge",e,t?.value,t?.tooltip);const i=this.getTreeView(e);i&&(i.badge=t)}$resolveDropFileData(e,t,i){const s=this._dndControllers.get(e);if(!s)throw new Error("Unknown tree");return s.resolveDropFileData(t,i)}async $disposeTree(e){const t=this.getTreeView(e);t&&(t.dataProvider=void 0),this._dataProviders.deleteAndDispose(e)}async reveal(e,t,i,s,o){o=o||{select:!1,focus:!1};const r=hc(o.select)?!1:o.select,a=hc(o.focus)?!1:o.focus;let c=Math.min(Kc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of s){const h=t.getItem(d.handle);h&&await e.expand(h)}const l=t.getItem(i.handle);if(l){await e.reveal(l),r&&e.setSelection([l]),a===!1?e.setFocus():a&&e.setFocus(l);let d=[l];for(;d.length>0&&c>0;c--)await e.expand(d),d=d.reduce((h,u)=>{const f=t.getItem(u.handle);return f&&f.children&&f.children.length&&h.push(...f.children),h},[])}}registerListeners(e,t,i){i.add(t.onDidExpandItem(s=>this._proxy.$setExpanded(e,s.handle,!0))),i.add(t.onDidCollapseItem(s=>this._proxy.$setExpanded(e,s.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(s=>this._proxy.$setSelectionAndFocus(e,s.selection.map(({handle:o})=>o),s.focus.handle))),i.add(t.onDidChangeVisibility(s=>this._proxy.$setVisible(e,s))),i.add(t.onDidChangeCheckboxState(s=>{this._proxy.$changeCheckboxState(e,s.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=it.as(M1.ViewsRegistry).getView(e);return t?t.treeView:null}dispose(){for(const e of this._dataProviders){const t=this.getTreeView(e[0]);t&&(t.dataProvider=void 0)}this._dataProviders.dispose(),this._dndControllers.clear(),super.dispose()}};e9e=D([en(Ue.MainThreadTreeViews),_(1,q_),_(2,Pi),_(3,ho),_(4,Ze)],e9e);class BKt{constructor(e,t,i,s,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=s,this._proxy=o,this.dataTransfersCache=new LOe}async handleDrop(e,t,i,s,o,r){const a=this.dataTransfersCache.add(e);try{const c=await rw.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,s,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const s=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!s)return;const o=new fhe;return s.items.forEach(([r,a])=>{o.replace(r,HQ(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class WKt{constructor(e,t,i){this.treeViewId=e,this._proxy=t,this.notificationService=i,this.itemsMap=new Map,this.hasResolve=this._proxy.$hasResolve(this.treeViewId)}getChildren(e){return e||this.itemsMap.clear(),this._proxy.$getChildren(this.treeViewId,e?e.handle:void 0).then(t=>this.postGetChildren(t),t=>(kC.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const s=this.getItem(i);if(s){const o=e[i];if(this.updateTreeItem(s,o),i===o.handle)t.push(s);else{this.itemsMap.delete(i),this.itemsMap.set(s.handle,s);const r=o.parentHandle?this.itemsMap.get(o.parentHandle):null;r&&t.push(r)}}}return t}getItem(e){return this.itemsMap.get(e)}isEmpty(){return this.itemsMap.size===0}async postGetChildren(e){if(e===void 0)return;const t=[],i=await this.hasResolve;if(e)for(const s of e){const o=new fpe(s,i?r=>this._proxy.$resolve(this.treeViewId,s.handle,r):void 0);this.itemsMap.set(s.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=Lc([...Object.keys(e instanceof fpe?e.asTreeItem():e),...Object.keys(t)]);for(const s of i)e[s]=t[s];e instanceof fpe&&e.resetResolve()}}}let t9e=class extends ${constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(P.revive(e),P.revive(t))}};t9e=D([en(Ue.MainThreadDownloadService),_(1,wPe)],t9e);class HKt{constructor(e,t,i,s){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=s}handleURL(e,t){return Cn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let i9e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(et.ExtHostUrls)}$registerUriHandler(e,t,i){const s=new HKt(this.proxy,e,t,i),o=this.urlService.registerHandler(s);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,s),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:s}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),s.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};i9e=D([en(Ue.MainThreadUrls),_(1,jde),_(2,Cet)],i9e);const aY="vs/workbench/contrib/externalUriOpener/common/configuration",frt="default",UKt="workbench.externalUriOpeners",FIe={type:"string",enum:[]},n9e="\n- `https://microsoft.com`: Matches this specific domain using https\n- `https://microsoft.com:8080`: Matches this specific domain on this port using https\n- `https://microsoft.com:*`: Matches this specific domain on any port using https\n- `https://microsoft.com/foo`: Matches `https://microsoft.com/foo` and `https://microsoft.com/foo/bar`, but not `https://microsoft.com/foobar` or `https://microsoft.com/bar`\n- `https://*.microsoft.com`: Match all domains ending in `microsoft.com` using https\n- `microsoft.com`: Match this specific domain using either http or https\n- `*.microsoft.com`: Match all domains ending in `microsoft.com` using either http or https\n- `http://192.168.0.1`: Matches this specific IP using http\n- `http://192.168.0.*`: Matches all IP's with this prefix using http\n- `*`: Match all domains using either http or https",VKt={...PQ,properties:{[UKt]:{type:"object",markdownDescription:g(aY,0,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(aY,1,`Map URI pattern to an opener id. Example patterns: {0}`,n9e)},{type:"string",markdownDescription:g(aY,1,`Map URI pattern to an opener id. Example patterns: -{0}`,n9e),enum:[frt],enumDescriptions:[g(aY,2,"Open using VS Code's standard opener.")]},FIe]}}}};function zKt(n,e){FIe.enum=n,FIe.enumDescriptions=e,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(VKt)}var OIe,GP;let BIe=(GP=class extends ${constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new W1(OIe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(ke.PROFILE,ln.MACHINE);for(const[i,s]of Object.entries(this._mementoObject||{}))this.add(i,s.extensionId,{isCurrentlyRegistered:!1});this.invalidateOpenersOnExtensionsChanged(),this._register(this._extensionService.onDidChangeExtensions(()=>this.invalidateOpenersOnExtensionsChanged())),this._register(this._extensionService.onDidChangeExtensionsStatus(()=>this.invalidateOpenersOnExtensionsChanged()))}didRegisterOpener(e,t){this.add(e,t,{isCurrentlyRegistered:!0})}add(e,t,i){const s=this._openers.get(e);if(s){s.isCurrentlyRegistered=s.isCurrentlyRegistered||i.isCurrentlyRegistered;return}const o={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,o),this._mementoObject[e]=o,this._memento.saveMemento(),this.updateSchema()}delete(e){this._openers.delete(e),delete this._mementoObject[e],this._memento.saveMemento(),this.updateSchema()}async invalidateOpenersOnExtensionsChanged(){await this._extensionService.whenInstalledExtensionsRegistered();const e=this._extensionService.extensions;for(const[t,i]of this._openers){const s=e.find(o=>o.identifier.value===i.extensionId);s?this._extensionService.canRemoveExtension(s)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,s]of this._openers)e.push(i),t.push(s.extensionId);zKt(e,t)}},OIe=GP,GP.STORAGE_ID="externalUriOpeners",GP);BIe=OIe=D([_(0,sn),_(1,ho)],BIe);const s9e="vs/workbench/api/browser/mainThreadUriOpeners";let o9e=class extends ${constructor(e,t,i,s,o,r){super(),this.extensionService=s,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(et.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new BIe(t,s))}async*getOpeners(e){if(!(e.scheme!==_e.http&&e.scheme!==_e.https)){await this.extensionService.activateByEvent(`onOpenExternalUri:${e.scheme}`);for(const[t,i]of this._registeredOpeners)i.schemes.has(e.scheme)&&(yield this.createOpener(t,i))}}createOpener(e,t){return{id:e,label:t.label,canOpen:(i,s)=>this.proxy.$canOpenUri(e,i,s),openExternalUri:async(i,s,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:s.sourceUri},o)}catch(r){if(!Na(r)){const a=new xn("default",g(s9e,0,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:frt})});a.tooltip=i.toString(),this.notificationService.notify({severity:nt.Error,message:g(s9e,1,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,s){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:s,extensionId:i}),this._contributedExternalUriOpenersStore.didRegisterOpener(e,i.value)}async $unregisterUriOpener(e){this._registeredOpeners.delete(e),this._contributedExternalUriOpenersStore.delete(e)}dispose(){super.dispose(),this._registeredOpeners.clear()}};o9e=D([Zi(Ue.MainThreadUriOpeners),_(1,sn),_(2,VZe),_(3,ho),_(4,fr),_(5,Pi)],o9e);let r9e=class{constructor(e,t,i,s){this.hostService=t,this.openerService=i,this.userActivityService=s,this.disposables=new Z,this.proxy=e.getProxy(et.ExtHostWindow),T.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),s.onDidChangeIsActive(this.proxy.$onDidChangeWindowActive,this.proxy,this.disposables)}dispose(){this.disposables.dispose()}$getInitialState(){return Promise.resolve({isFocused:this.hostService.hasFocus,isActive:this.userActivityService.isActive})}async $openUri(e,t,i){const s=P.from(e);let o;return t&&P.parse(t).toString()===s.toString()?o=t:o=s,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(P.revive(e),t)).resolved}};r9e=D([Zi(Ue.MainThreadWindow),_(1,Id),_(2,fr),_(3,BPe)],r9e);var WIe;let HIe=WIe=class extends ${static async create(e,t,i){return e.invokeFunction(async s=>{const r=await s.get(Rn).createModelReference(i);return e.createInstance(WIe,t,i,r)})}constructor(e,t,i,s){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=s,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._register(i),this._textFileModel=this.textFileService.files.get(t),this._textFileModel&&(this._register(this._textFileModel.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._register(this._textFileModel.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._register(this.textFileService.files.onDidChangeDirty(o=>{_n(this.resource,o.resource)&&(this._onDidChangeDirty.fire(),this._onDidChangeContent.fire())}))}get resource(){return this._resource}isReadonly(){return this._model.object.isReadonly()}get backupId(){}get canHotExit(){return!0}isDirty(){return this.textFileService.isDirty(this.resource)}isOrphaned(){return!!this._textFileModel?.hasState(uu.ORPHAN)}async revert(e){return this.textFileService.revert(this.resource,e)}saveCustomEditor(e){return this.textFileService.save(this.resource,e)}async saveCustomEditorAs(e,t,i){return!!await this.textFileService.saveAs(e,t,i)}};HIe=WIe=D([_(3,tr)],HIe);new Y("webviewFindWidgetVisible",!1);new Y("webviewFindWidgetFocused",!1);new Y("webviewFindWidgetEnabled",!1);var a9e;(function(n){n.NotebookRenderer="notebookRenderer",n.CustomEditor="customEditor",n.WebviewView="webviewView"})(a9e||(a9e={}));let UIe=class{constructor(e,t){this._memento=new W1(e,t),this._state=this._memento.getMemento(ke.APPLICATION,ln.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),s=this._state[i];if(s&&typeof s=="string")return s;const o=Dr();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};UIe=D([_(1,sn)],UIe);let Toe=class{constructor(e,t){this._store=new UIe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};Toe=D([_(1,sn)],Toe);let Roe=class extends ${constructor(e,t){super(),this.resource=e,this.fileService=t,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.orphaned=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._register(this.fileService.onDidFilesChange(i=>this.onDidFilesChange(i)))}isOrphaned(){return this.orphaned}async onDidFilesChange(e){let t=!1,i;if(this.orphaned?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.orphaned!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.orphaned!==e&&(this.orphaned=e,this._onDidChangeOrphaned.fire())}isDisposed(){return this._store.isDisposed}dispose(){this.orphaned=!1,this._onWillDispose.fire(),super.dispose()}isModified(){return this.isDirty()}};Roe=D([_(1,ci)],Roe);var PX;const c9e="vs/workbench/api/browser/mainThreadCustomEditors";var A2;(function(n){n[n.Custom=0]="Custom",n[n.Text=1]="Text"})(A2||(A2={}));let VIe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.mainThreadWebview=t,this.mainThreadWebviewPanels=i,this._customEditorService=c,this._editorGroupService=l,this._editorService=d,this._instantiationService=h,this._webviewWorkbenchService=u,this._editorProviders=this._register(new Zo),this._editorRenameBackups=new Map,this._webviewOriginStore=new Toe("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(et.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof E2&&MS(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof nH&&s.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Text,Wse(e),t,i,s,!0,o)}$registerCustomEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Custom,Wse(e),t,i,{},s,o)}registerEditorProvider(e,t,i,s,o,r,a){if(this._editorProviders.has(i))throw new Error(`Provider for ${i} already registered`);const c=new Z;c.add(this._customEditorService.registerCustomEditorCapabilities(i,{supportsMultipleEditorsPerDocument:r})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof nH&&l.viewType===i,resolveWebview:async(l,d)=>{const h=Dr(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=s,l.webview.extension=t;let f=l.backupId;l.oldResource&&!l.backupId&&(f=this._editorRenameBackups.get(l.oldResource.toString())?.backupId,this._editorRenameBackups.delete(l.oldResource.toString()));let p;try{p=await this.getOrCreateCustomEditorModel(e,u,i,{backupId:f},d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i));return}if(d.isCancellationRequested){p.dispose();return}l.webview.onDidDispose(()=>{if(p.object.isDirty()){const m=p.object.onDidChangeDirty(()=>{p.object.isDirty()||(m.dispose(),p.dispose())});return}p.dispose()}),o.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},qe.None),this._proxyCustomEditors.$onMoveCustomEditor(h,m,i),v.dispose()});try{await this._proxyCustomEditors.$resolveCustomEditor(u,h,i,{title:l.getTitle(),contentOptions:l.webview.contentOptions,options:l.webview.options,active:l===this._editorService.activeEditor},U1(this._editorGroupService,l.group||0),d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i)),p.dispose();return}}})),this._editorProviders.set(i,c)}$unregisterEditorProvider(e){if(!this._editorProviders.has(e))throw new Error(`No provider for ${e} registered`);this._editorProviders.deleteAndDispose(e),this._customEditorService.models.disposeAllModelsForView(e)}async getOrCreateCustomEditorModel(e,t,i,s,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case A2.Text:{const a=HIe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case A2.Custom:{const a=E2.create(this._instantiationService,this._proxyCustomEditors,i,t,s,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof nH&&_n(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,s){(await this.getCustomEditorModel(e,t)).pushEdit(i,s)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=P.revive(e),s=await this._customEditorService.models.get(i,t);if(!s||!(s instanceof E2))throw new Error("Could not find model for webview editor");return s}async onWillRunWorkingCopyFileOperation(e){e.operation===Li.MOVE&&e.waitUntil((async()=>{const t=[];for(const i of e.files)i.source&&t.push(...await this._customEditorService.models.getAllModels(i.source));for(const i of t)if(i instanceof E2&&i.isDirty()){const s=await i.backup(qe.None);s.meta&&this._editorRenameBackups.set(i.editorResource.toString(),s.meta)}})())}};VIe=D([_(3,ho),_(4,sn),_(5,Pw),_(6,fC),_(7,kPe),_(8,ur),_(9,_i),_(10,be),_(11,kQ)],VIe);var IA;(function(n){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Allowed=Object.freeze({type:e.Allowed}),n.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(s){this.operation=s,this.type=e.Pending}}n.Pending=t})(IA||(IA={}));let E2=PX=class extends Roe{static async create(e,t,i,s,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(s,i,o.backupId,l,a);return e.createInstance(PX,t,i,s,!!o.backupId,d,!!l,r)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(PX.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=o,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=IA.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=oOe,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this.onDidChangeReadonly=T.None,this._fromBackup=s,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(c9e,0,"Custom editor '{0}' could not be saved.",this.name))}))),r&&(this._isDirtyFromContentChange=!0)}get editorResource(){return this._editorResource}dispose(){this._editable&&this._undoService.removeElements(this._editorResource),this._proxy.$disposeCustomDocument(this._editorResource,this._viewType),super.dispose()}static toWorkingCopyResource(e,t){const i=e.replace(/[^a-z0-9\-_]/gi,"-"),s=`/${O9(t.with({query:null,fragment:null}).toString(!0))}`;return P.from({scheme:_e.vscodeCustomEditor,authority:i,path:s,query:JSON.stringify(t.toJSON())})}get name(){return yr(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?JS.Untitled:JS.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===_e.untitled}isReadonly(){return!this._editable}get viewType(){return this._viewType}get backupId(){return this._backupId}pushEdit(e,t){if(!this._editable)throw new Error("Document is not editable");this.change(()=>{this.spliceEdits(e),this._currentEditIndex=this._edits.length-1}),this._undoService.pushElement({type:wd.Resource,resource:this._editorResource,label:t??g(c9e,1,"Edit"),code:"undoredo.customEditorEdit",undo:()=>this.undo(),redo:()=>this.redo()})}changeContent(){this.change(()=>{this._isDirtyFromContentChange=!0})}async undo(){if(!this._editable||this._currentEditIndex<0)return;const e=this._edits[this._currentEditIndex];this.change(()=>{--this._currentEditIndex}),await this._proxy.$undo(this._editorResource,this.viewType,e,this.isDirty())}async redo(){if(!this._editable||this._currentEditIndex>=this._edits.length-1)return;const e=this._edits[this._currentEditIndex+1];this.change(()=>{++this._currentEditIndex}),await this._proxy.$redo(this._editorResource,this.viewType,e,this.isDirty())}spliceEdits(e){const t=this._currentEditIndex+1,i=this._edits.length-this._currentEditIndex,s=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);s.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,s)}change(e){const t=this.isDirty();e(),this._onDidChangeContent.fire(),this.isDirty()!==t&&this._onDidChangeDirty.fire()}async revert(e){this._editable&&(this._currentEditIndex===this._savePoint&&!this._isDirtyFromContentChange&&!this._fromBackup||(e?.soft||this._proxy.$revert(this._editorResource,this.viewType,qe.None),this.change(()=>{this._isDirtyFromContentChange=!1,this._fromBackup=!1,this._currentEditIndex=this._savePoint,this.spliceEdits()})))}async save(e){const t=!!await this.saveCustomEditor(e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),t}async saveCustomEditor(e){if(!this._editable)return;if(this.isUntitled()){const i=await this.suggestUntitledSavePath(e);return i?(await this.saveCustomEditorAs(this._editorResource,i,e),i):void 0}const t=na(i=>this._proxy.$onSave(this._editorResource,this.viewType,i));this._ongoingSave?.cancel(),this._ongoingSave=t;try{await t,this._ongoingSave===t&&this.change(()=>{this._isDirtyFromContentChange=!1,this._savePoint=this._currentEditIndex,this._fromBackup=!1})}finally{this._ongoingSave===t&&(this._ongoingSave=void 0)}return this._editorResource}suggestUntitledSavePath(e){if(!this.isUntitled())throw new Error("Resource is not untitled");const t=this._environmentService.remoteAuthority,i=R9(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await na(s=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,s)),this.change(()=>{this._savePoint=this._currentEditIndex}),!0):(await this.fileService.copy(e,t,!1),!0)}get canHotExit(){return typeof this._backupId=="string"&&this._hotExitState.type===IA.Type.Allowed}async backup(e){const t=this._getEditors();if(!t.length)throw new Error("No editors found for resource, cannot back up");const i=t[0],o={meta:{viewType:this.viewType,editorResource:this._editorResource,backupId:"",extension:i.extension?{id:i.extension.id.value,location:i.extension.location}:void 0,webview:{origin:i.webview.origin,options:i.webview.options,state:i.webview.state}}};if(!this._editable)return o;this._hotExitState.type===IA.Type.Pending&&this._hotExitState.operation.cancel();const r=new IA.Pending(na(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=r,e.onCancellationRequested(()=>{r.operation.cancel()});let a="";try{const c=await r.operation;this._hotExitState===r&&(this._hotExitState=IA.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Na(c))throw c;this._hotExitState===r&&(this._hotExitState=IA.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===IA.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};E2=PX=D([_(7,bf),_(8,ci),_(9,eo),_(10,pO),_(11,Za),_(12,Pw),_(13,Lm),_(14,ho)],E2);class $Kt{constructor(){this._handlesToInputs=new Map,this._inputsToHandles=new Map}add(e,t){this._handlesToInputs.set(e,t),this._inputsToHandles.set(t,e)}getHandleForInput(e){return this._inputsToHandles.get(e)}getInputForHandle(e){return this._handlesToInputs.get(e)}delete(e){const t=this.getInputForHandle(e);this._handlesToInputs.delete(e),t&&this._inputsToHandles.delete(t)}get size(){return this._handlesToInputs.size}[Symbol.iterator](){return this._handlesToInputs.values()}}class GKt{constructor(e){this.prefix=e}fromExternal(e){return this.prefix+e}toExternal(e){return e.startsWith(this.prefix)?e.substr(this.prefix.length):void 0}}let zIe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=s,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new GKt("mainThreadWebview-"),this._webviewInputs=new $Kt,this._revivers=this._register(new Zo),this.webviewOriginStore=new Toe("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(et.ExtHostWebviewPanels),this._register(T.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,s.onDidAddGroup,s.onDidRemoveGroup,s.onDidMoveGroup)(()=>{this.updateWebviewViewStates(this._editorService.activeEditor)})),this._register(l.onDidChangeActiveWebviewEditor(d=>{this.updateWebviewViewStates(d)})),this._register(l.registerResolver({canResolve:d=>{const h=this.webviewPanelViewType.toExternal(d.viewType);return typeof h=="string"&&r.activateByEvent(`onWebviewPanel:${h}`),!1},resolveWebview:()=>{throw new Error("not implemented")}}))}get webviewInputs(){return this._webviewInputs}addWebviewInput(e,t,i){this._webviewInputs.add(e,t),this._mainThreadWebviews.addWebview(e,t.webview,i),t.webview.onDidDispose(()=>{this._proxy.$onDidDisposeWebviewPanel(e).finally(()=>{this._webviewInputs.delete(e)})})}$createWebviewPanel(e,t,i,s,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=Wse(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:s.title,options:QKt(s.panelOptions),contentOptions:Hse(s.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),s.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:s.serializeBuffersForPostMessage});const h={extensionId:c.id.value,viewType:i};this._telemetryService.publicLog2("webviews:createWebviewPanel",h)}$disposeWebview(e){const t=this.tryGetWebviewInput(e);t&&t.dispose()}$setTitle(e,t){this.tryGetWebviewInput(e)?.setName(t)}$setIconPath(e,t){const i=this.tryGetWebviewInput(e);i&&(i.iconPath=qKt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const s=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,s,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===wx||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return wx;if(e.viewColumn===Cw)return Cw;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(gg.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:_Ee.LAST});if(i){const s=w6(this._configurationService);return this._editorGroupService.addGroup(i,s)}}return wx}$registerSerializer(e,t){if(this._revivers.has(e))throw new Error(`Reviver for ${e} already registered`);this._revivers.set(e,this._webviewWorkbenchService.registerResolver({canResolve:i=>i.viewType===this.webviewPanelViewType.fromExternal(e),resolveWebview:async i=>{const s=this.webviewPanelViewType.toExternal(i.viewType);if(!s){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=Dr();this.addWebviewInput(o,i,t);let r;if(i.webview.state)try{r=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(o,s,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},U1(this._editorGroupService,i.group||0))}catch(a){bt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(s))}}}))}$unregisterSerializer(e){if(!this._revivers.has(e))throw new Error(`No reviver for ${e} registered`);this._revivers.deleteAndDispose(e)}updateWebviewViewStates(e){if(!this._webviewInputs.size)return;const t={},i=(s,o,r)=>{if(!(r instanceof Qg))return;r.updateGroup(s.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===s.activeEditor,active:r===e,position:U1(this._editorGroupService,s.id)})};for(const s of this._editorGroupService.groups)for(const o of s.editors)o instanceof op?(i(s,o,o.primary),i(s,o,o.secondary)):i(s,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};zIe=D([_(2,Re),_(3,ur),_(4,_i),_(5,ho),_(6,sn),_(7,on),_(8,kQ)],zIe);function qKt(n){if(n)return{light:P.revive(n.light),dark:P.revive(n.dark)}}function QKt(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}let $Ie=class extends ${constructor(e,t,i,s){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=s,this._webviewViews=this._register(new Zo),this._webviewViewProviders=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostWebviewViews)}$setWebviewViewTitle(e,t){const i=this.getWebviewView(e);i.title=t}$setWebviewViewDescription(e,t){const i=this.getWebviewView(e);i.description=t}$setWebviewViewBadge(e,t){const i=this.getWebviewView(e);i.badge=t}$show(e,t){this.getWebviewView(e).show(t)}$registerWebviewViewProvider(e,t,i){if(this._webviewViewProviders.has(t))throw new Error(`View provider for ${t} already registered`);const s=Wse(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=Dr();this._webviewViews.set(c,r),this.mainThreadWebviews.addWebview(c,r.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(r.webview.state)try{l=JSON.parse(r.webview.state)}catch(d){console.error("Could not load webview state",d,r.webview.state)}r.webview.extension=s,i&&(r.webview.options=i),r.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),r.onDispose(()=>{this._proxy.$disposeWebviewView(c),this._webviewViews.deleteAndDispose(c)}),this._telemetryService.publicLog2("webviews:createWebviewView",{extensionId:s.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){bt(d),r.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,o)}$unregisterWebviewViewProvider(e){if(!this._webviewViewProviders.has(e))throw new Error(`No view provider for ${e} registered`);this._webviewViewProviders.deleteAndDispose(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("unknown webview view");return t}};$Ie=D([_(2,on),_(3,het)],$Ie);let l9e=class extends ${constructor(e,t){super();const i=this._register(t.createInstance(Ake,e));e.set(Ue.MainThreadWebviews,i);const s=this._register(t.createInstance(zIe,e,i));e.set(Ue.MainThreadWebviewPanels,s);const o=this._register(t.createInstance(VIe,e,i,s));e.set(Ue.MainThreadCustomEditors,o);const r=this._register(t.createInstance($Ie,e,i));e.set(Ue.MainThreadWebviewViews,r)}};l9e=D([TO,_(1,be)],l9e);const H5="vs/workbench/api/browser/mainThreadWorkspace";let d9e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=s,this._canonicalUriService=o,this._editorService=r,this._workspaceEditingService=a,this._notificationService=c,this._requestService=l,this._instantiationService=d,this._labelService=h,this._environmentService=u,this._workspaceTrustManagementService=p,this._workspaceTrustRequestService=m,this._toDispose=new Z,this._activeCancelTokens=Object.create(null),this._queryBuilder=this._instantiationService.createInstance(Gne),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(et.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!rf&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(w=>this._proxy.$initializeWorkspace(this.getWorkspaceData(w),this.isWorkspaceTrusted())),this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace,this,this._toDispose),this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace,this,this._toDispose),this._workspaceTrustManagementService.onDidChangeTrust(this._onDidGrantWorkspaceTrust,this,this._toDispose)}dispose(){this._toDispose.dispose();for(const e in this._activeCancelTokens)this._activeCancelTokens[e].cancel()}$updateWorkspaceFolders(e,t,i,s){const o=s.map(r=>({uri:P.revive(r.uri),name:r.name}));return this._notificationService.status(this.getStatusMessage(e,o.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,o,!0)}getStatusMessage(e,t,i){let s;const o=t>0,r=i>0;return o&&!r?t===1?s=g(H5,0,"Extension '{0}' added 1 folder to the workspace",e):s=g(H5,1,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?s=g(H5,2,"Extension '{0}' removed 1 folder from the workspace",e):s=g(H5,3,"Extension '{0}' removed {1} folders from the workspace",e,i):s=g(H5,4,"Extension '{0}' changed folders of the workspace",e),s}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?p7(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const s=P.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(s?[s]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Na(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,s,o){const r=P.revive(t),a=this._contextService.getWorkspace(),c=r?[r]:a.folders.map(u=>u.uri),l=this._queryBuilder.text(e,c,i);l._reason="startTextSearch";const d=u=>{u.results&&this._proxy.$handleTextSearchResult(u,s)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Na(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(s=>eot(s,e,t,i))}async $save(e,t){const i=P.revive(e),s=[...this._editorService.findEditors(i,{supportSideBySide:go.PRIMARY})],o=await this._editorService.save(s,{reason:Ln.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return k_(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Ui(e.editors.map(t=>Qc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$loadCertificates(){return this._requestService.loadCertificates()}$requestWorkspaceTrust(e){return this._workspaceTrustRequestService.requestWorkspaceTrust(e)}isWorkspaceTrusted(){return this._workspaceTrustManagementService.isWorkspaceTrusted()}_onDidGrantWorkspaceTrust(){this._proxy.$onDidGrantWorkspaceTrust()}$registerEditSessionIdentityProvider(e,t){const i=this._editSessionIdentityService.registerEditSessionIdentityProvider({scheme:t,getEditSessionIdentifier:async(s,o)=>this._proxy.$getEditSessionIdentifier(s.uri,o),provideEditSessionIdentityMatch:async(s,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(s.uri,o,r,a)});this.registeredEditSessionProviders.set(e,i),this._toDispose.add(i)}$unregisterEditSessionIdentityProvider(e){this.registeredEditSessionProviders.get(e)?.dispose(),this.registeredEditSessionProviders.delete(e)}$registerCanonicalUriProvider(e,t){const i=this._canonicalUriService.registerCanonicalUriProvider({scheme:t,provideCanonicalUri:async(s,o,r)=>{const a=await this._proxy.$provideCanonicalUri(s,o,r);return a&&P.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};d9e=D([Zi(Ue.MainThreadWorkspace),_(1,ohe),_(2,Ti),_(3,APe),_(4,SPe),_(5,_i),_(6,$S),_(7,Pi),_(8,EQ),_(9,be),_(10,eo),_(11,Il),_(12,ci),_(13,oA),_(14,Ade)],d9e);var jKt=".comments-panel .comments-panel-container{height:100%}.comments-panel .comments-panel-container .hidden{display:none}.comments-panel .comments-panel-container .tree-container{height:100%}.comments-panel .comments-panel-container .tree-container.hidden{display:none;visibility:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container{display:block}.comments-panel .comments-panel-container .tree-container .comment-thread-container div{overflow:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container,.comments-panel .comments-panel-container .tree-container .resource-container{display:flex;overflow:hidden;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata{display:flex;flex:1}.comments-panel .count,.comments-panel .user{padding-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .icon{min-width:fit-content;padding-right:5px;padding-top:4px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .user,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .count{min-width:fit-content}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance{background-color:var(--vscode-badge-background);border-radius:2px;color:var(--vscode-badge-foreground);font-size:.9em;line-height:14px;margin-bottom:3px;margin-right:4px;margin-top:4px;padding:0 4px 1px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text{display:flex;flex:1;min-width:0}.comments-panel .comments-panel-container .tree-container .comment-thread-container .reply-detail,.comments-panel .comments-panel-container .tree-container .comment-thread-container .timestamp,.comments-panel .comments-panel-container .tree-container .resource-container .owner{display:block;font-size:.9em;opacity:.8;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .text *{margin:0;max-width:500px;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .range{opacity:.8}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text code{font-family:var(--monaco-monospace-font)}.comments-panel .comments-panel-container .tree-container .monaco-icon-label{padding-right:5px}.comments-panel .comments-panel-container .tree-container .separator{opacity:.8;padding-right:5px}.comments-panel .comments-panel-container .message-box-container{height:inherit;line-height:22px;padding-left:20px}.comments-panel .comments-panel-container .tree-container .count-badge-wrapper{margin-left:10px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{line-height:22px;margin-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{padding-left:16px}.comments-panel .hide{display:none}.comments-panel .comments-panel-container .text a{color:var(--vscode-textLink-foreground)}.comments-panel .comments-panel-container .text a:hover,.comments-panel .comments-panel-container a:active{color:var(--vscode-textLink-activeForeground)}.comments-panel .comments-panel-container .text a:focus{outline-color:var(--vscode-focusBorder)}.comments-panel .comments-panel-container .text code{color:var(--vscode-textPreformat-foreground)}.comments-panel .comments-panel-container .actions{display:none}.comments-panel .comments-panel-container .actions .action-label{padding:2px}.comments-panel .monaco-list .monaco-list-row.focused .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row.selected .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row:hover .comment-metadata-container .actions{display:block}";Ct(jKt,{});let Ly=class{constructor(e,t,i,s,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=s,this.thread=o,this.isRoot=!1,this.replies=[],this.threadId=o.threadId,this.range=o.range,this.threadState=o.state,this.threadRelevance=o.applicability,this.contextValue=o.contextValue,this.controllerHandle=o.controllerHandle,this.threadHandle=o.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class lm{constructor(e,t,i,s){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=s.filter(o=>o.comments&&o.comments.length).map(o=>lm.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,s){const{comments:o}=s,r=o.map(a=>new Ly(e,t,i,a,s));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const aue="comments";class GIe extends ${constructor(e,t,i,s){super(),this.configurationService=e,this._date=he(i,we("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupUpdatableHover(va("mouse"),this._date,"")),this.setTimestamp(s)}get useRelativeTimeSetting(){return this.configurationService.getValue(aue).useRelativeTime}async setTimestamp(e){(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime)&&this.updateDate(e),this._timestamp=e,this._useRelativeTime=this.useRelativeTimeSetting}updateDate(e){if(!e)this._date.textContent="",this._date.style.display="none";else if(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime){this._date.style.display="";let t,i;this.useRelativeTimeSetting?(t=this.getRelative(e),i=this.getDateString(e)):t=this.getDateString(e),this._date.textContent=t,this.hover.update(i??"")}}getRelative(e){return WFe(e,!0,!0)}getDateString(e){return e.toLocaleString(Gd)}}const RO="vs/workbench/contrib/comments/browser/commentColors",qIe=B("commentsView.resolvedIcon",{dark:aWe,light:aWe,hcDark:ft,hcLight:ft},g(RO,0,"Icon color for resolved comments.")),QIe=B("commentsView.unresolvedIcon",{dark:nwe,light:nwe,hcDark:ft,hcLight:ft},g(RO,1,"Icon color for unresolved comments."));B("editorCommentsWidget.replyInputBackground",{dark:SR,light:SR,hcDark:SR,hcLight:SR},g(RO,2,"Background color for comment reply input box."));const KKt=B("editorCommentsWidget.resolvedBorder",{dark:qIe,light:qIe,hcDark:ft,hcLight:ft},g(RO,3,"Color of borders and arrow for resolved comments.")),VE=B("editorCommentsWidget.unresolvedBorder",{dark:QIe,light:QIe,hcDark:ft,hcLight:ft},g(RO,4,"Color of borders and arrow for unresolved comments."));B("editorCommentsWidget.rangeBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,5,"Color of background for comment ranges."));B("editorCommentsWidget.rangeActiveBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,6,"Color of background for currently selected or hovered comment range."));const YKt=new Map([[hg.Unresolved,VE],[hg.Resolved,KKt]]),JKt=new Map([[hg.Unresolved,QIe],[hg.Resolved,qIe]]),prt="--comment-thread-state-color",h9e="--comment-view-thread-state-color",mrt="--comment-thread-state-background-color";function _rt(n,e,t){const i=n!==void 0?t.get(n):void 0;return i!==void 0?e.getColor(i):void 0}function XKt(n,e){return _rt(n,e,YKt)}function ZKt(n,e){return _rt(n,e,JKt)}const ale=class ale{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const s=e.startsWith("!");this.textFilter={text:(s?lz(e,"!"):e).trim(),negate:s}}};ale._filter=KYe,ale._messageFilter=dee;let gE=ale;const eYt="vs/workbench/contrib/comments/browser/commentsModel";class cue extends ${get resourceCommentThreads(){return this._resourceCommentThreads}constructor(){super(),this._resourceCommentThreads=[],this.commentThreadsMap=new Map}updateResourceCommentThreads(){const e=this.commentThreadsMap.size>1;this._resourceCommentThreads=[...this.commentThreadsMap.values()].map(t=>t.resourceWithCommentThreads.map(i=>(i.ownerLabel=e?t.ownerLabel:void 0,i)).flat()).flat(),this._resourceCommentThreads.sort((t,i)=>t.resource.toString()>i.resource.toString()?1:-1)}setCommentThreads(e,t,i,s){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,s)}),this.updateResourceCommentThreads()}deleteCommentsByOwner(e){if(e){const t=this.commentThreadsMap.get(e);this.commentThreadsMap.set(e,{ownerLabel:t?.ownerLabel,resourceWithCommentThreads:[]})}else this.commentThreadsMap.clear();this.updateResourceCommentThreads()}updateCommentThreads(e){const{uniqueOwner:t,owner:i,ownerLabel:s,removed:o,changed:r,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return o.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0,u=h?.commentThreads.findIndex(f=>f.threadId===l.threadId)??0;u>=0&&h?.commentThreads.splice(u,1),h?.commentThreads.length===0&&c.splice(d,1)}),r.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0;if(!h)return;const u=h.commentThreads.findIndex(f=>f.threadId===l.threadId);u>=0?h.commentThreads[u]=lm.createCommentNode(t,i,P.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(lm.createCommentNode(t,i,P.parse(h.id),l))}),a.forEach(l=>{const d=c.filter(h=>h.resource.toString()===l.resource);if(d.length){const h=d[0];l.comments&&l.comments.length&&h.commentThreads.push(lm.createCommentNode(t,i,h.resource,l))}else c.push(new lm(t,i,P.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:s,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(eYt,0,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const s=[],o=new Map;for(const r of yU(i,cue._compareURIs))o.set(r[0].resource,new lm(e,t,P.parse(r[0].resource),r));return o.forEach((r,a,c)=>{s.push(r)}),s}static _compareURIs(e,t){const i=e.resource.toString(),s=t.resource.toString();return is?1:0}}const MC="vs/workbench/contrib/comments/browser/commentsTreeViewer",Qd="workbench.panel.comments",tYt="Comments",jIe=Be(MC,0,"Comments"),pW=class pW{getHeight(e){return e instanceof Ly&&e.hasReply()?44:22}getTemplateId(e){return e instanceof lm?pW.RESOURCE_ID:e instanceof Ly?pW.COMMENT_ID:""}};pW.RESOURCE_ID="resource-with-comments",pW.COMMENT_ID="comment-node";let KIe=pW;class iYt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=he(e,we(".resource-container")),i=this.labels.create(t),s=he(t,we(".separator")),o=t.appendChild(we(".owner"));return{resourceLabel:i,owner:o,separator:s}}renderElement(e,t,i,s){i.resourceLabel.setFile(e.element.resource),i.separator.innerText="·",e.element.ownerLabel?(i.owner.innerText=e.element.ownerLabel,i.separator.style.display="inline"):(i.owner.innerText="",i.separator.style.display="none")}disposeTemplate(e){e.resourceLabel.dispose()}}let YIe=class{constructor(e){this.menuService=e}getResourceActions(e){const t=this.getActions(Te.CommentsViewThreadActions,e);return{menu:t.menu,actions:t.primary}}getResourceContextActions(e){return this.getActions(Te.CommentsViewThreadActions,e).secondary}setContextKeyService(e){this.contextKeyService=e}getActions(e,t){if(!this.contextKeyService)return{primary:[],secondary:[]};const i=[["commentController",t.owner],["resourceScheme",t.resource.scheme],["commentThread",t.contextValue],["canReply",t.thread.canReply]],s=this.contextKeyService.createOverlay(i),o=this.menuService.createMenu(e,s),c={primary:[],secondary:[],menu:o};return nXe(o,{shouldForwardArgs:!0},c,"inline"),o.dispose(),c}dispose(){this.contextKeyService=void 0}};YIe=D([_(0,mc)],YIe);let JIe=class{constructor(e,t,i,s,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=s,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=he(e,we(".comment-thread-container")),i=he(t,we(".comment-metadata-container")),s=he(i,we(".comment-metadata")),o={icon:he(s,we(".icon")),userNames:he(s,we(".user")),timestamp:new GIe(this.configurationService,this.hoverService,he(s,we(".timestamp-container"))),relevance:he(s,we(".relevance")),separator:he(s,we(".separator")),commentPreview:he(s,we(".text")),range:he(s,we(".range"))};o.separator.innerText="·";const r=he(i,we(".actions")),a=new Qh(r,{actionViewItemProvider:this.actionViewItemProvider}),c=he(t,we(".comment-snippet-container")),l={container:c,icon:he(c,we(".icon")),count:he(c,we(".count")),lastReplyDetail:he(c,we(".reply-detail")),separator:he(c,we(".separator")),timestamp:new GIe(this.configurationService,this.hoverService,he(c,we(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...$e.asClassNameArray(Ce.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(MC,1,"{0} replies",e-1):e===2?g(MC,2,"1 reply"):g(MC,3,"1 comment")}getRenderedComment(e,t){const i=mQ(e,{inline:!0,actionHandler:{callback:o=>vde(this.openerService,o,e.isTrusted),disposables:t}}),s=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...$e.asClassNameArray(this.getIcon(e.element.threadState))),e.element.threadState!==void 0){const l=this.getCommentThreadWidgetStateColor(e.element.threadState,this.themeService.getColorTheme());i.threadMetadata.icon.style.setProperty(h9e,`${l}`),i.threadMetadata.icon.style.color=`var(${h9e})`}i.threadMetadata.userNames.textContent=e.element.comment.userName,i.threadMetadata.timestamp.setTimestamp(e.element.comment.timestamp?new Date(e.element.comment.timestamp):void 0);const r=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof r.comment.body=="string")i.threadMetadata.commentPreview.innerText=r.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(r.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupUpdatableHover(va("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(MC,7,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(MC,8,"[Ln {0}-{1}]",e.element.range.startLineNumber,e.element.range.endLineNumber));const a=this.menus.getResourceActions(e.element);if(i.actionBar.push(a.actions,{icon:!0,label:!1}),i.actionBar.context={commentControlHandle:e.element.controllerHandle,commentThreadHandle:e.element.threadHandle,$mid:Fs.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(o);const c=e.element.replies[e.element.replies.length-1].comment;i.repliesMetadata.lastReplyDetail.textContent=g(MC,9,"Last reply from {0}",c.userName),i.repliesMetadata.timestamp.setTimestamp(c.timestamp?new Date(c.timestamp):void 0)}getCommentThreadWidgetStateColor(e,t){return e!==void 0?ZKt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};JIe=D([_(2,fr),_(3,Re),_(4,Zc),_(5,pn)],JIe);var Moe;(function(n){n[n.Resource=0]="Resource",n[n.Comment=1]="Comment"})(Moe||(Moe={}));class nYt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?so.Visible:e instanceof lm?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=gE._filter(this.options.textFilter.text,ui(e.resource));if(t)return{visibility:!0,data:{type:Moe.Resource,uriMatches:t||[]}}}return so.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&hg.Resolved===e.threadState||this.options.showUnresolved&&hg.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const s=gE._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||gE._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>gE._messageFilter(this.options.textFilter.text,o.comment.userName)||gE._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return s.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:Moe.Comment,textMatches:s}}:s.length&&this.options.textFilter.negate&&t===so.Recurse?!1:s.length===0&&this.options.textFilter.negate&&t===so.Recurse?!0:t}}let XIe=class extends L7{constructor(e,t,i,s,o,r,a,c,l){const d=new KIe,h=yO.bind(void 0,r),u=r.createInstance(YIe);u.setContextKeyService(s);const f=[r.createInstance(iYt,e),r.createInstance(JIe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof cue?"root":p instanceof lm?`${p.uniqueOwner}-${p.id}`:p instanceof Ly?`${p.uniqueOwner}-${p.resource.toString()}-${p.threadId}-${p.comment.uniqueIdInThread}`+(p.isRoot?"-root":""):""},expandOnlyOnTwistieClick:!0,collapseByDefault:!1,overrideStyles:i.overrideStyles,filter:i.filter,findWidgetEnabled:!1,multipleSelectionSupport:!1},r,s,o,a),this.contextMenuService=c,this.keybindingService=l,this.menus=u,this.disposables.add(this.onContextMenu(p=>this.commentsOnContextMenu(p)))}commentsOnContextMenu(e){const t=e.element;if(!(t instanceof Ly))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const s=this.menus.getResourceContextActions(t);s.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>s,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new WS(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:Fs.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const s of i.children)s.visible&&i.visible&&e++;return e}};XIe=D([_(3,Pe),_(4,yf),_(5,be),_(6,Re),_(7,Vr),_(8,ti)],XIe);const ROe=new Y("commentsFilterFocus",!1),Ax="vs/workbench/contrib/comments/browser/commentsViewActions",vrt=new Y("commentsView.showResolvedFilter",!0),wrt=new Y("commentsView.showUnResolvedFilter",!0);class sYt extends ${constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=wrt.bindTo(this.contextKeyService),this._showResolved=vrt.bindTo(this.contextKeyService),this._showResolved.set(e.showResolved),this._showUnresolved.set(e.showUnresolved)}get showUnresolved(){return!!this._showUnresolved.get()}set showUnresolved(e){this._showUnresolved.get()!==e&&(this._showUnresolved.set(e),this._onDidChange.fire({showUnresolved:!0}))}get showResolved(){return!!this._showResolved.get()}set showResolved(e){this._showResolved.get()!==e&&(this._showResolved.set(e),this._onDidChange.fire({showResolved:!0}))}}At(class extends XQ{constructor(){super({id:"commentsFocusViewFromFilter",title:g(Ax,0,"Focus Comments view"),keybinding:{when:ROe,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.DownArrow},viewId:Qd})}async runInView(n,e){e.focus()}});At(class extends XQ{constructor(){super({id:"commentsClearFilterText",title:g(Ax,1,"Clear filter text"),keybinding:{when:ROe,weight:ye.WorkbenchContrib,primary:E.Escape},viewId:Qd})}async runInView(n,e){e.clearFilterText()}});At(class extends XQ{constructor(){super({id:"commentsFocusFilter",title:g(Ax,2,"Focus comments filter"),keybinding:{when:Tz.isEqualTo(Qd),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyF},viewId:Qd})}async runInView(n,e){e.focusFilter()}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleUnResolvedComments`,title:g(Ax,3,"Show Unresolved"),category:g(Ax,4,"Comments"),toggled:{condition:wrt,title:g(Ax,5,"Show Unresolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleResolvedComments`,title:g(Ax,6,"Show Resolved"),category:g(Ax,4,"Comments"),toggled:{condition:vrt,title:g(Ax,7,"Show Resolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showResolved=!e.filters.showResolved}});var oYt=".review-widget{position:absolute;width:100%}.monaco-editor .review-widget{background-color:var(--vscode-peekViewResult-background)}.review-widget .hidden{display:none!important}.review-widget .body{overflow:hidden}.review-widget .body .review-comment{display:flex;padding:8px 16px 8px 20px}@keyframes monaco-review-widget-focus{0%{background:var(--vscode-peekViewResult-selectionBackground)}to{background:transparent}}.review-widget .body .review-comment.focus{animation:monaco-review-widget-focus 3s ease 0s}.review-widget .body .review-comment .comment-actions{margin-left:auto}.review-widget .body .review-comment .comment-actions .monaco-toolbar{height:22px}.review-widget .body .review-comment .comment-title .comment-header-info{overflow:hidden;text-overflow:ellipsis}.review-widget .body .review-comment .comment-title{display:flex;width:100%}.review-widget .body .review-comment .comment-title .action-label.codicon{line-height:18px}.review-widget .body .review-comment .comment-title .monaco-dropdown .toolbar-toggle-more{height:18px;line-height:18px;vertical-align:middle;width:16px}.review-widget .body .comment-body blockquote{border-left-style:solid;border-left-width:5px;margin:0 7px 0 5px;padding:0 16px 0 10px}.review-widget .body .review-comment .avatar-container{margin-top:4px!important}.review-widget .body .review-comment .avatar-container img.avatar{border-radius:3px;border-style:none;display:inline-block;height:28px;line-height:1;overflow:hidden;vertical-align:middle;width:28px}.review-widget .body .comment-reactions .monaco-text-button{background-color:transparent;border:1px solid grey;border-radius:3px;margin:0 7px 0 0;width:30px}.review-widget .body .review-comment .review-comment-contents{overflow:hidden;padding-left:20px;user-select:text;-webkit-user-select:text;width:100%}.review-widget .body pre{word-wrap:normal;overflow:auto;white-space:pre}.review-widget .body .review-comment .review-comment-contents .author{line-height:22px}.review-widget .body .review-comment .review-comment-contents .isPending{font-style:italic;line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .timestamp{line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .comment-body .comment-body-plainstring{white-space:pre-wrap}.review-widget .body .review-comment .review-comment-contents .comment-body{padding-top:4px}.review-widget .body .review-comment .review-comment-contents .comment-body-max-height{max-height:20em}.review-widget .body .review-comment .review-comment-contents .comment-reactions{margin-top:8px;min-height:25px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label{display:flex;font-size:12px;padding:1px 4px;text-align:center;white-space:pre}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-icon{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:14px;display:inline-block;margin-right:4px;width:14px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-label{line-height:20px;margin-right:4px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions{background-position:50%;background-repeat:no-repeat;background-size:16px;border:none;display:none;font-size:16px;height:16px;margin-top:3px;width:26px}.review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions{background-size:16px;display:inline-block}.review-widget .body .review-comment .comment-title .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block;height:16px;line-height:16px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label{border:1px solid}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.disabled{opacity:.6}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.active:hover{background-color:var(--vscode-statusBarItem-hoverBackground)}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active{background-color:var(--vscode-statusBarItem-activeBackground);border:1px solid transparent}.review-widget .body .review-comment .review-comment-contents a{cursor:pointer}.review-widget .body .comment-body p,.review-widget .body .comment-body ul{margin:8px 0}.review-widget .body .comment-body p:first-child,.review-widget .body .comment-body ul:first-child{margin-top:0}.review-widget .body .comment-body p:last-child,.review-widget .body.comment-body ul:last-child{margin-bottom:0}.review-widget .body .comment-body ul{padding-left:20px}.review-widget .body .comment-body li>p{margin-bottom:0}.review-widget .body .comment-body li>ul{margin-top:0}.review-widget .body .comment-body code{border-radius:3px;padding:0 .4em}.review-widget .body .comment-body span{white-space:pre}.review-widget .body .comment-body img{max-width:100%}.review-widget .body .comment-form{margin:8px 20px}.review-widget .validation-error{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-left:-1px;margin-top:-1px;min-height:34px;overflow:hidden;padding:.4em;text-align:left;width:100%}.review-widget .body .comment-additional-actions{margin:10px 20px}.review-widget .body .comment-additional-actions .section-separator{border-top:1px solid var(--vscode-menu-separatorBackground);margin:10px 0 14px}.review-widget .body .comment-additional-actions .button-bar{display:flex;white-space:nowrap}.review-widget .body .comment-additional-actions .monaco-button,.review-widget .body .comment-additional-actions .monaco-button-dropdown,.review-widget .body .comment-additional-actions .monaco-text-button{display:flex;width:auto}.review-widget .body .comment-additional-actions .button-bar>.monaco-button-dropdown,.review-widget .body .comment-additional-actions .button-bar>.monaco-text-button{margin:0 10px 0 0}.review-widget .body .comment-additional-actions .button-bar .monaco-text-button{padding:4px 10px}.review-widget .body .comment-additional-actions .codicon-drop-down-button{align-items:center}.review-widget .body .monaco-editor{color:var(--vscode-editor-foreground)}.review-widget .body .comment-form.expand .review-thread-reply-button{display:none}.review-widget .body .comment-form.expand .form-actions,.review-widget .body .comment-form.expand .monaco-editor{box-sizing:content-box;display:block}.review-widget .body .comment-form .review-thread-reply-button{background-color:var(--vscode-editorCommentsWidget-replyInputBackground);border:0;border-radius:0;box-sizing:border-box;color:var(--vscode-editor-foreground);display:block;font-family:var(--monaco-monospace-font);font-size:inherit;font-weight:600;line-height:20px;outline:1px solid transparent;padding:6px 12px;resize:vertical;text-align:left;white-space:nowrap;width:100%}.review-widget .body .comment-form .review-thread-reply-button:focus{outline-style:solid;outline-width:1px}.review-widget .body .comment-form .monaco-editor,.review-widget .body .comment-form .monaco-editor .monaco-editor-background,.review-widget .body .edit-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-editorCommentsWidget-replyInputBackground)}.review-widget .body .comment-form .monaco-editor,.review-widget .body .edit-container .monaco-editor{border:0;border-radius:3px;box-sizing:content-box;max-height:500px;min-height:90px;padding:6px 0 6px 12px;width:100%}.review-widget .body .comment-form .form-actions,.review-widget .body .comment-form .monaco-editor{display:none}.review-widget .body .comment-form .form-actions,.review-widget .body .edit-container .form-actions{margin:10px 0;overflow:auto}.review-widget .body .edit-container .form-actions{padding-top:10px}.review-widget .body .edit-textarea{margin:5px 12px 10px 0}.review-widget .body .comment-form .form-actions .monaco-text-button,.review-widget .body .edit-container .monaco-text-button{margin-left:5px;padding:4px 10px;width:auto}.review-widget .body .form-actions .monaco-text-button{float:right}.review-widget .head{box-sizing:border-box;display:flex;height:100%}.review-widget .head .review-title{cursor:default;display:inline-block;font-size:13px;margin-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-widget .head .review-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.review-widget .head .review-actions{flex:1;padding-right:2px;text-align:right}.review-widget .head .review-actions>.monaco-action-bar{display:inline-block}.review-widget .head .review-actions>.monaco-action-bar,.review-widget .head .review-actions>.monaco-action-bar>.actions-container{height:100%}.review-widget .action-item{margin-left:4px;min-height:20px;min-width:18px}.review-widget .head .review-actions>.monaco-action-bar .action-label{background-position:50%;background-repeat:no-repeat;line-height:inherit;margin:0}.review-widget .head .review-actions>.monaco-action-bar .action-label.codicon{margin:0}.review-widget>.body{border-top:1px solid;position:relative}.monaco-editor .comment-range-glyph{cursor:pointer;margin-left:10px;width:4px!important;z-index:10}div.preview.inline .monaco-editor .comment-range-glyph{display:none!important}.monaco-editor .comment-diff-added{border-left-style:solid;border-left-width:3px}.monaco-editor .comment-diff-added,.monaco-editor .comment-range-glyph.multiline-add{border-left-color:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-diff-added:before,.monaco-editor .comment-range-glyph.line-hover:before,.monaco-editor .comment-thread-unresolved:before,.monaco-editor .comment-thread:before{background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-thread-range{background-color:var(--vscode-editorCommentsWidget-rangeBackground)}.monaco-editor .comment-thread-range-current{background-color:var(--vscode-editorCommentsWidget-rangeActiveBackground)}.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread,.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread-unresolved,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover{margin-left:13px}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{align-items:center;color:var(--vscode-editorGutter-commentGlyphForeground);display:flex;flex-direction:row;height:100%;justify-content:center;left:-6px;position:absolute;text-align:center;width:9px;z-index:10}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{color:var(--vscode-editorGutter-commentUnresolvedGlyphForeground)}.monaco-editor .margin-view-overlays .comment-range-glyph.multiline-add{border-left-style:dotted;border-left-width:3px;height:16px;margin-top:2px}.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{border-radius:3px;content:var(--vscode-icon-plus-content);font-family:var(--vscode-icon-plus-font-family);font-family:codicon;margin-left:-5px;padding-left:1px;width:18px!important}.monaco-editor .comment-range-glyph.comment-thread,.monaco-editor .comment-range-glyph.comment-thread-unresolved{z-index:20}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before{border-radius:3px;font-family:codicon;font-size:13px;line-height:100%;margin-left:-5px;padding-left:1px;padding-top:1px;width:18px!important;z-index:20}.monaco-editor .comment-range-glyph.comment-thread:before{content:var(--vscode-icon-comment-add-content);font-family:var(--vscode-icon-comment-add-font-family)}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{content:var(--vscode-icon-comment-unresolved-content);font-family:var(--vscode-icon-comment-unresolved-font-family)}.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-collapsed,.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded{margin-left:11px}.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph{margin-left:25px}";Ct(oYt,{});const nj="vs/workbench/contrib/comments/browser/commentGlyphWidget",cY=B("editorGutter.commentRangeForeground",{dark:sWe(swe,us),light:Am(sWe(swe,us),.05),hcDark:fe.white,hcLight:fe.black},g(nj,0,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),G3=B("editorOverviewRuler.commentForeground",{dark:cY,light:cY,hcDark:cY,hcLight:cY},g(nj,1,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),rYt=B("editorOverviewRuler.commentUnresolvedForeground",{dark:G3,light:G3,hcDark:G3,hcLight:G3},g(nj,2,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),lY=B("editorGutter.commentGlyphForeground",{dark:Mc,light:Mc,hcDark:fe.black,hcLight:fe.white},g(nj,3,"Editor gutter decoration color for commenting glyphs."));B("editorGutter.commentUnresolvedGlyphForeground",{dark:lY,light:lY,hcDark:lY,hcLight:lY},g(nj,4,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const cle=class cle{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===hg.Unresolved,t={description:cle.description,isWholeLine:!0,overviewRuler:{color:Nr(e?rYt:G3),position:oh.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return jt.createDynamic(t)}setThreadState(e){this._threadState!==e&&(this._threadState=e,this._commentsOptions=this.createDecorationOptions(),this._updateDecorations())}_updateDecorations(){const e=[{range:{startLineNumber:this._lineNumber,startColumn:1,endLineNumber:this._lineNumber,endColumn:1},options:this._commentsOptions}];this._commentsDecorations.set(e)}setLineNumber(e){this._lineNumber=e,this._updateDecorations()}getPosition(){const e=this._commentsDecorations.length>0?this._commentsDecorations.getRange(0):null;return{position:{lineNumber:e?e.endLineNumber:this._lineNumber,column:1},preference:[hs.EXACT]}}dispose(){this._commentsDecorations.clear()}};cle.description="comment-glyph-widget";let FG=cle;class OG{constructor(e,t,i,s,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=s,this.maxActions=o,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(o=>o.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let s=!t;for(const o of i){const[,r]=o;this._actions=r;for(const a of r){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&s&&(c=this.keybindingService.lookupKeybinding($A.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Tu(this.container,{secondary:!s,title:l,...yQ});if(s=!1,this._buttonElements.push(d.element),this._toDispose.add(d),this._toDispose.add(d.onDidClick(()=>this.actionHandler(a))),d.enabled=a.enabled,d.label=a.label,this.maxActions!==void 0&&this._buttonElements.length>=this.maxActions){console.warn("An extension has contributed more than the allowable number of actions to a comments menu.");return}}}}triggerDefaultAction(){if(this._actions.length){const e=this._actions[0];if(e.enabled)return this.actionHandler(e)}}dispose(){this._toDispose.dispose()}}const dY="vs/workbench/contrib/comments/browser/commentReply";let aYt=0;const brt="commenteditordecoration";let ZIe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=s,this._scopedInstatiationService=o,this._contextKeyService=r,this._commentMenus=a,this._commentOptions=c,this._pendingComment=l,this._parentThread=d,this._actionRunDelegate=u,this.commentService=f,this.themeService=p,this.keybindingService=v,this.hoverService=w,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=J$,this.form=he(t,we(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(EV,this.form,EV.getEditorOptions(m),r,this._parentThread)),this.commentEditorIsEmpty=Qv.commentIsEmpty.bindTo(this._contextKeyService),this.commentEditorIsEmpty.set(!this._pendingComment),this.initialize(h)}async initialize(e){const t=this._commentThread.comments&&this._commentThread.comments.length>0,i=Dr()+"-"+(t?this._commentThread.threadId:++aYt),s=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=P.from({scheme:_e.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${s}`});const r=this.commentService.getCommentController(this.owner);r&&(o=o.with({authority:r.id}));const a=await this.textModelService.createModelReference(o);a.object.textEditorModel.setValue(this._pendingComment||""),this._register(a),this.commentEditor.setModel(a.object.textEditorModel),this.calculateEditorHeight(),this._register(a.object.textEditorModel.onDidChangeContent(()=>{this.setCommentEditorDecorations(),this.commentEditorIsEmpty?.set(!this.commentEditor.getValue()),this.calculateEditorHeight()&&(this.commentEditor.layout({height:this._editorHeight,width:this.commentEditor.getLayoutInfo().width}),this.commentEditor.render(!0))})),this.createTextModelListener(this.commentEditor,this.form),this.setCommentEditorDecorations(),this._pendingComment?this.expandReplyArea():t?this.createReplyButton(this.commentEditor,this.form):e&&this._commentThread.comments&&this._commentThread.comments.length===0&&this.expandReplyArea(),this._error=he(this.form,we(".validation-error.hidden"));const c=he(this.form,we(".form-actions"));this._formActions=he(c,we(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=he(c,we(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=oit(this._parentEditor,this.commentEditor,this._editorHeight);return e!==this._editorHeight?(this._editorHeight=e,!0):!1}updateCommentThread(e){const t=this.commentEditor.hasTextFocus(),i=!this._commentThread.comments?.length&&!e.comments?.length;this._reviewThreadReplyButton||this.createReplyButton(this.commentEditor,this.form),this._commentThread.comments&&this._commentThread.comments.length===0&&!i&&this.expandReplyArea(),t&&this.commentEditor.focus()}getPendingComment(){const e=this.commentEditor.getModel();if(e&&e.getValueLength()>0)return e.getValue()}setPendingComment(e){this._pendingComment=e,this.expandReplyArea(),this.commentEditor.setValue(e)}layout(e){this.commentEditor.layout({height:this._editorHeight,width:e-54})}focusIfNeeded(){!this._commentThread.comments||!this._commentThread.comments.length?this.commentEditor.focus():(this.commentEditor.getModel()?.getValueLength()??0)>0&&this.expandReplyArea()}focusCommentEditor(){this.commentEditor.focus()}expandReplyAreaAndFocusCommentEditor(){this.expandReplyArea(),this.commentEditor.focus()}isCommentEditorFocused(){return this.commentEditor.hasWidgetFocus()}updateCanReply(){this._commentThread.canReply?this.form.style.display="block":this.form.style.display="none"}async submitComment(){await this._commentFormActions?.triggerDefaultAction(),this._pendingComment=void 0}setCommentEditorDecorations(){const e=this.commentEditor.getModel();if(e){const t=e.getValueLength(),i=this._commentThread.comments&&this._commentThread.comments.length>0,s=t>0?"":i?this._commentOptions?.placeHolder||g(dY,0,"Reply..."):this._commentOptions?.placeHolder||g(dY,1,"Type a new comment"),o=[{range:{startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:1},renderOptions:{after:{contentText:s,color:`${iv(Mc,this.themeService.getColorTheme())?.transparent(.4)}`}}}];this.commentEditor.setDecorationsByType("review-zone-widget",brt,o)}}createTextModelListener(e,t){this._commentThreadDisposables.push(e.onDidFocusEditorWidget(()=>{this._commentThread.input={uri:e.getModel().uri,value:e.getValue()},this.commentService.setActiveEditingCommentThread(this._commentThread),this.commentService.setActiveCommentAndThread(this.owner,{thread:this._commentThread})})),this._commentThreadDisposables.push(e.getModel().onDidChangeContent(()=>{const i=e.getValue();if(this._commentThread.input&&this._commentThread.input.uri===e.getModel().uri&&this._commentThread.input.value!==i){const s=this._commentThread.input;s.value=i,this._commentThread.input=s}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const s=this._commentThread,o=e.getModel();s.input&&o&&s.input.uri!==o.uri||i&&e.getValue()!==i.value&&(e.setValue(i.value),i.value===""&&(this._pendingComment="",t.classList.remove("expand"),e.getDomNode().style.outline="",this._error.textContent="",this._error.classList.add("hidden")))}))}createCommentWidgetFormActions(e,t){const i=this._commentMenus.getCommentThreadActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{await this._actionRunDelegate?.(),await s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.hideReplyArea()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e,t){const i=this._commentMenus.getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{this._actionRunDelegate?.(),s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.focusCommentEditor()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}get isReplyExpanded(){return this.form.classList.contains("expand")}expandReplyArea(){this.isReplyExpanded||(this.form.classList.add("expand"),this.commentEditor.focus(),this.commentEditor.layout())}clearAndExpandReplyArea(){this.isReplyExpanded||(this.commentEditor.setValue(""),this.expandReplyArea())}hideReplyArea(){const e=this.commentEditor.getDomNode();e&&(e.style.outline=""),this.commentEditor.setValue(""),this._pendingComment="",this.form.classList.remove("expand"),this._error.textContent="",this._error.classList.add("hidden")}createReplyButton(e,t){this._reviewThreadReplyButton=he(t,we(`button.review-thread-reply-button.${lx}`)),this._register(this.hoverService.setupUpdatableHover(va("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(dY,0,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(dY,0,"Reply..."),this._register(pe(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(pe(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),St(this._commentThreadDisposables)}};ZIe=D([_(12,sD),_(13,pn),_(14,Re),_(15,ti),_(16,Zc),_(17,Rn)],ZIe);const hT="vs/workbench/contrib/comments/browser/reactionsAction",lle=class lle extends xn{constructor(e,t){super(lle.ID,t||g(hT,0,"Pick Reactions..."),"toggle-reactions",!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return this.toggleDropdownMenu(),Promise.resolve(!0)}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};lle.ID="toolbar.toggle.pickReactions";let WT=lle;class cYt extends WS{constructor(e){super(null,e,{})}updateLabel(){if(!this.label)return;const e=this.action;if(e.class&&this.label.classList.add(e.class),e.icon){const t=he(this.label,we(".reaction-icon")),i=P.revive(e.icon);t.style.backgroundImage=uf(i)}else{const t=he(this.label,we("span.reaction-label"));t.innerText=e.label}if(e.count){const t=he(this.label,we("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(hT,1,"Toggle reaction, "):"";if(e.count===void 0)return g(hT,2,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(hT,3,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(hT,4,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(hT,5,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(hT,6,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const dle=class dle extends xn{constructor(e,t="",i="",s=!0,o,r,a,c){super(dle.ID,t,i,s,o),this.reactors=r,this.icon=a,this.count=c}};dle.ID="toolbar.toggle.reaction";let e0e=dle;const Zpe="vs/workbench/contrib/comments/browser/commentNode";class u9e extends gw{async runAction(e,t){await e.run(...t)}}let t0e=class extends ${get domNode(){return this._domNode}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=s,this.owner=o,this.resource=r,this.parentThread=a,this.markdownRenderer=c,this.instantiationService=l,this.commentService=d,this.notificationService=h,this.contextMenuService=u,this.configurationService=p,this.hoverService=m,this.accessibilityService=v,this.keybindingService=w,this.textModelService=b,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=J$,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=we("div.review-comment"),this._contextKeyService=f.createScoped(this._domNode),this._commentContextValue=Qv.commentContext.bindTo(this._contextKeyService),this.comment.contextValue&&this._commentContextValue.set(this.comment.contextValue),this._commentMenus=this.commentService.getCommentMenus(this.owner),this._domNode.tabIndex=-1,this._avatar=he(this._domNode,we("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=he(this._domNode,we(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",lx),p.getValue(aue)?.maxHeight!==!1&&this._body.classList.add("comment-body-max-height"),this.createScroll(this._commentDetailsContainer,this._body),this.updateCommentBody(this.comment.body),this.comment.commentReactions&&this.comment.commentReactions.length&&this.comment.commentReactions.filter(C=>!!C.count).length&&this.createReactionsContainer(this._commentDetailsContainer),this._domNode.setAttribute("aria-label",`${i.userName}, ${this.commentBodyValue}`),this._domNode.setAttribute("role","treeitem"),this._clearTimeout=null,this._register(pe(this._domNode,xe.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(pe(this._domNode,xe.CONTEXT_MENU,C=>this.onContextMenu(C))),s&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(pe(this._domNode,xe.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)}),this._scrollableElement=this._register(new hQ(t,{horizontal:zo.Visible,vertical:zo.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(s=>{s.scrollLeftChanged&&(t.scrollLeft=s.scrollLeft),s.scrollTopChanged&&(t.scrollTop=s.scrollTop)}));const i=this._register(new oi(t,"scroll")).event;this._register(i(s=>{const o=this._scrollableElement.getScrollPosition(),r=Math.abs(t.scrollLeft-o.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-o.scrollTop)<=1?void 0:t.scrollTop;(r!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),e.appendChild(this._scrollableElement.getDomNode())}updateCommentBody(e){this._body.innerText="",this._md=void 0,this._plainText=void 0,typeof e=="string"?(this._plainText=he(this._body,we(".comment-body-plainstring")),this._plainText.innerText=e):(this._md=this.markdownRenderer.render(e).element,this._body.appendChild(this._md))}updateCommentUserIcon(e){if(this._avatar.textContent="",e){const t=he(this._avatar,we("img.avatar"));t.src=lp.uriToBrowserUri(P.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=he(e,we("span.timestamp-container")),this.updateTimestamp(this.comment.timestamp)}updateTimestamp(e){if(!this._timestamp)return;const t=e!==void 0?new Date(e):void 0;t?this._timestampWidget?this._timestampWidget.setTimestamp(t):(this._timestampWidget=new GIe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=he(e,we(`div.comment-title.${lx}`)),i=he(t,we("comment-header-info")),s=he(i,we("strong.author"));s.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=he(i,we("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=he(t,we(".comment-actions")),this.toggleToolbarHidden(!0),this.createActionsToolbar()}toggleToolbarHidden(e){e&&!this.accessibilityService.isScreenReaderOptimized()?this._actionsToolbarContainer.classList.add("hidden"):this._actionsToolbarContainer.classList.remove("hidden")}getToolbarActions(e){const t=e.getActions({shouldForwardArgs:!0}),o={primary:[],secondary:[]};return lYt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:Fs.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:Fs.CommentThread}]}createToolbar(){this.toolbar=new cZe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===WT.ID?new gx(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,s)=>this.actionViewItemProvider(i,s),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(e,t),orientation:Qb.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new u9e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const r=this.createReactionPicker(this.comment.commentReactions||[]);e.push(r)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(r=>{const{primary:a,secondary:c}=this.getToolbarActions(i);!this.toolbar&&(a.length||c.length)&&this.createToolbar(),this.toolbar.setActions(a,c)}));const{primary:s,secondary:o}=this.getToolbarActions(i);e.push(...s),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===WT.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===e0e.ID?new cYt(e):e instanceof id?this.instantiationService.createInstance(eC,e,{hoverDelegate:t.hoverDelegate}):e instanceof uS?this.instantiationService.createInstance(b7,e,t):new WS({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new WT(()=>{s?.show()},g(Zpe,0,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new xn(`reaction.command.${o.label}`,`${o.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,o)}catch(r){const a=r.message?g(Zpe,1,"Toggling the comment reaction failed: {0}.",r.message):g(Zpe,2,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const s=new gx(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===WT.ID?s:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>Ob.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=he(e,we("div.comment-reactions")),this._reactionsActionBar=new Qh(this._reactionActionsContainer,{actionViewItemProvider:(i,s)=>i.id===WT.ID?new gx(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(i,s)}),this._register(this._reactionsActionBar),this.commentService.hasReactionHandler(this.owner)){const i=this.createReactionPicker(this.comment.commentReactions||[]);this._reactionsActionBar.push(i,{label:!1,icon:!0})}}get commentBodyValue(){return typeof this.comment.body=="string"?this.comment.body:this.comment.body.value}async createCommentEditor(e){const t=he(e,we(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(EV,t,EV.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=P.from({scheme:_e.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),s=await this.textModelService.createModelReference(i);this._commentEditorModel=s,this._commentEditor.setModel(this._commentEditorModel.object.textEditorModel),this._commentEditor.setValue(this.pendingEdit??this.commentBodyValue),this.pendingEdit=void 0,this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus(),xd(gt(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const o=this._commentEditorModel.object.textEditorModel.getLineCount(),r=this._commentEditorModel.object.textEditorModel.getLineLength(o)+1;this._commentEditor.setSelection(new mt(o,r,o,r));const a=this.commentThread;a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment}),this._commentEditorDisposables.push(this._commentEditor.onDidFocusEditorWidget(()=>{a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})})),this._commentEditorDisposables.push(this._commentEditor.onDidChangeModelContent(c=>{if(a.input&&this._commentEditor&&this._commentEditor.getModel().uri===a.input.uri){const l=this._commentEditor.getValue();if(l!==a.input.value){const d=a.input;d.value=l,a.input=d,this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})}}})),this.calculateEditorHeight(),this._register(this._commentEditorModel.object.textEditorModel.onDidChangeContent(()=>{this._commentEditor&&this.calculateEditorHeight()&&(this._commentEditor.layout({height:this._editorHeight,width:this._commentEditor.getLayoutInfo().width}),this._commentEditor.render(!0))})),this._register(this._commentEditor),this._register(this._commentEditorModel)}calculateEditorHeight(){if(this._commentEditor){const e=oit(this.parentEditor,this._commentEditor,this._editorHeight);if(e!==this._editorHeight)return this._editorHeight=e,!0}return!1}getPendingEdit(){const e=this._commentEditor?.getModel();if(e&&e.getValueLength()>0)return e.getValue()}removeCommentEditor(){this.isEditing=!1,this._editAction&&(this._editAction.enabled=!0),this._body.classList.remove("hidden"),this._commentEditorModel?.dispose(),St(this._commentEditorDisposables),this._commentEditorDisposables=[],this._commentEditor?.dispose(),this._commentEditor=null,this._commentEditContainer.remove()}layout(e){const t=e!==void 0?e-72:this._commentEditor?.getLayoutInfo().width??0;this._commentEditor?.layout({width:t,height:this._editorHeight});const i=this._body.scrollWidth,s=h$(this._body),o=this._body.scrollHeight,r=aMe(this._body)+4;this._scrollableElement.setScrollDimensions({width:s,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=he(this._commentDetailsContainer,we(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=he(this._commentEditContainer,we(".form-actions")),t=he(e,we(".other-actions"));this.createCommentWidgetFormActions(t);const i=he(e,we(".editor-actions"));this.createCommentWidgetEditorActions(i)}createCommentWidgetFormActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions?.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this.removeCommentEditor()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions?.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this._commentEditor?.focus()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}setFocus(e,t=!1){e?(this._domNode.focus(),this.toggleToolbarHidden(!1),this._actionsToolbarContainer.classList.add("tabfocused"),this._domNode.tabIndex=0,this.comment.mode===RU.Editing&&this._commentEditor?.focus()):(this._actionsToolbarContainer.classList.contains("tabfocused")&&!this._actionsToolbarContainer.classList.contains("mouseover")&&(this.toggleToolbarHidden(!0),this._domNode.tabIndex=-1),this._actionsToolbarContainer.classList.remove("tabfocused"))}registerActionBarListeners(e){this._register(pe(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(pe(this._domNode,"mouseleave",()=>{e.classList.contains("mouseover")&&!e.classList.contains("tabfocused")&&this.toggleToolbarHidden(!0),e.classList.remove("mouseover")}))}async update(e){e.body!==this.comment.body&&this.updateCommentBody(e.body),this.comment.userIconPath&&e.userIconPath&&P.from(this.comment.userIconPath).toString()!==P.from(e.userIconPath).toString()&&this.updateCommentUserIcon(e.userIconPath);const t=e.mode!==void 0&&e.mode!==this.comment.mode;this.comment=e,t&&(e.mode===RU.Editing?await this.switchToEditMode():this.removeCommentEditor()),e.label?this._isPendingLabel.innerText=e.label:this._isPendingLabel.innerText="",this._reactionActionsContainer?.remove(),this._reactionsActionBar?.clear(),this.comment.commentReactions&&this.comment.commentReactions.some(i=>!!i.count)&&this.createReactionsContainer(this._commentDetailsContainer),this.comment.contextValue?this._commentContextValue.set(this.comment.contextValue):this._commentContextValue.reset(),this.comment.timestamp&&this.updateTimestamp(this.comment.timestamp)}onContextMenu(e){const t=new yu(gt(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:Te.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new u9e,getActionsContext:()=>this.commentNodeContext})}focus(){this.domNode.focus(),this._clearTimeout||(this.domNode.classList.add("focus"),this._clearTimeout=setTimeout(()=>{this.domNode.classList.remove("focus")},3e3))}dispose(){super.dispose(),St(this._commentEditorDisposables)}};t0e=D([_(8,be),_(9,sD),_(10,Pi),_(11,Vr),_(12,Pe),_(13,Re),_(14,Zc),_(15,Ur),_(16,ti),_(17,Rn)],t0e);function lYt(n,e,t,i=s=>s==="navigation"){for(const s of n){let[o,r]=s;if(i(o))(Array.isArray(e)?e:e.primary).unshift(...r);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Kr),a.push(...r)}}}const eme="vs/workbench/contrib/comments/browser/commentThreadBody";let i0e=class extends ${get length(){return this._commentThread.comments?this._commentThread.comments.length:0}get activeComment(){return this._commentElements.filter(e=>e.isEditing)[0]}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=s,this._options=o,this._commentThread=r,this._pendingEdits=a,this._scopedInstatiationService=c,this._parentCommentThreadWidget=l,this.commentService=d,this.openerService=h,this.languageService=u,this._commentElements=[],this._focusedComment=void 0,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._commentDisposable=new Map,this._register(pe(s,xe.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new vw(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}async display(){if(this._commentsElement=he(this.container,we("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(pe(this._commentsElement,xe.KEY_DOWN,e=>{const t=new os(e);if((t.equals(E.UpArrow)||t.equals(E.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=s=>{if(this._focusedComment===void 0&&s>=0)return 0;if(this._focusedComment===void 0&&s<0)return this._commentElements.length-1;const o=this._focusedComment+s;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(E.UpArrow)?i(-1):i(1))}})),this._commentElements=[],this._commentThread.comments)for(const e of this._commentThread.comments){const t=this.createNewCommentNode(e);this._commentElements.push(t),this._commentsElement.appendChild(t.domNode),e.mode===RU.Editing&&await t.switchToEditMode()}this._resizeObserver=new MutationObserver(this._refresh.bind(this)),this._resizeObserver.observe(this.container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}_refresh(){const e=uw(this.container);this._onDidResize.fire(e)}getDimensions(){return uw(this.container)}layout(e){this._commentElements.forEach(t=>{t.layout(e)})}getPendingEdits(){const e={};return this._commentElements.forEach(t=>{if(t.isEditing){const i=t.getPendingEdit();i&&(e[t.comment.uniqueIdInThread]=i)}}),e}getCommentCoords(e){const t=this._commentElements.filter(i=>i.comment.uniqueIdInThread===e);if(t&&t.length){const i=ia(this._commentElements[0].domNode),s=ia(t[0].domNode);return{thread:i,comment:s}}}async updateCommentThread(e,t){const i=this._commentElements.length,s=e.comments?e.comments.length:0,o=[],r=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(r.push(d),o.push(this._commentElements[d]))}for(let d=o.length-1;d>=0;d--){const h=o[d];this._commentDisposable.get(h)?.dispose(),this._commentDisposable.delete(h),this._commentElements.splice(r[d],1),this._commentsElement.removeChild(h.domNode)}let a=null;const c=[],l=[];for(let d=s-1;d>=0;d--){const h=e.comments[d],u=this._commentElements.filter(f=>f.comment.uniqueIdInThread===h.uniqueIdInThread);if(u.length)a=u[0].domNode,c.unshift(u[0]);else{const f=this.createNewCommentNode(h);c.unshift(f),a?(this._commentsElement.insertBefore(f.domNode,a),a=f.domNode):(this._commentsElement.appendChild(f.domNode),a=f.domNode),h.mode===RU.Editing&&(await f.switchToEditMode(),l.push(f))}}if(this._commentThread=e,this._commentElements=c,l.length){const d=this._commentElements.indexOf(l[l.length-1]);this._focusedComment=d}this._updateAriaLabel(),t||this._setFocusedComment(this._focusedComment)}_updateAriaLabel(){this._commentThread.isDocumentCommentThread()?this._commentThread.range?this._commentsElement.ariaLabel=g(eme,0,"Comment thread with {0} comments on lines {1} through {2}. {3}.",this._commentThread.comments?.length,this._commentThread.range.startLineNumber,this._commentThread.range.endLineNumber,this._commentThread.label):this._commentsElement.ariaLabel=g(eme,1,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(eme,2,"Comment thread with {0} comments. {1}.",this._commentThread.comments?.length,this._commentThread.label)}_setFocusedComment(e){this._focusedComment!==void 0&&this._commentElements[this._focusedComment]?.setFocus(!1),this._commentElements.length===0||e===void 0?this._focusedComment=void 0:(this._focusedComment=Math.min(e,this._commentElements.length-1),this._commentElements[this._focusedComment].setFocus(!0))}createNewCommentNode(e){const t=this._scopedInstatiationService.createInstance(t0e,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer);return this._register(t),this._commentDisposable.set(t,t.onDidClick(i=>this._setFocusedComment(this._commentElements.findIndex(s=>s.comment.uniqueIdInThread===i.comment.uniqueIdInThread)))),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.forEach(e=>e.dispose())}};i0e=D([_(9,sD),_(10,fr),_(11,Di)],i0e);const n0e="vs/workbench/contrib/comments/browser/commentThreadHeader",dYt=ji("review-comment-collapse",Ce.chevronUp,g(n0e,0,"Icon to collapse a review comment.")),hYt="expand-review-action "+$e.asClassName(dYt);class uYt extends ${constructor(e,t,i,s,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=s,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=we(".head"),e.appendChild(this._headElement),this._fillHead()}_fillHead(){const e=he(this._headElement,we(".review-title"));this._headingLabel=he(e,we("span.filename")),this.createThreadLabel();const t=he(this._headElement,we(".review-actions"));this._actionbarWidget=new Qh(t,{actionViewItemProvider:yO.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new xn("review.expand",g(n0e,1,"Collapse"),hYt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(s=>{this.setActionBarActions(i)})),this._register(pe(this._headElement,xe.CONTEXT_MENU,s=>this.onContextMenu(s))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,s])=>[...i,...s],[]);this._actionbarWidget.clear(),this._actionbarWidget.push([...t,this._collapseAction],{label:!1,icon:!0})}updateCommentThread(e){this._commentThread=e,this._actionbarWidget.context=this._commentThread,this.createThreadLabel()}createThreadLabel(){let e;e=this._commentThread.label,e===void 0&&(this._commentThread.comments&&this._commentThread.comments.length||(e=g(n0e,2,"Start discussion"))),e&&(this._headingLabel.textContent=rM(e),this._headingLabel.setAttribute("aria-label",e))}updateHeight(e){this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height}onContextMenu(e){const t=this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({shouldForwardArgs:!0}).map(s=>s[1]).flat();if(!t.length)return;const i=new yu(gt(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new gw,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:Fs.CommentThread})})}}let s0e=class extends ${constructor(e,t,i,s,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=s,this._actionRunDelegate=o,this._keybindingService=r,this._container=he(e,we(".comment-additional-actions")),he(this._container,we(".section-separator")),this._buttonBar=he(this._container,we(".button-bar")),this._createAdditionalActions(this._buttonBar)}_showMenu(){this._container?.classList.remove("hidden")}_hideMenu(){this._container?.classList.add("hidden")}_enableDisableMenu(e){const t=e.getActions({shouldForwardArgs:!0});for(const i of t){const[,s]=i;for(const o of s){if(o.enabled){this._showMenu();return}for(const r of o.actions??[])if(r.enabled){this._showMenu();return}}}this._hideMenu()}_createAdditionalActions(e){const t=this._commentMenus.getCommentThreadAdditionalActions(this._contextKeyService);this._register(t),this._register(t.onDidChange(()=>{this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)})),this._commentFormActions=new OG(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:Fs.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};s0e=D([_(5,ti)],s0e);var FX;function gYt(n,e,t){const i=new Set;return pa(...n.map((s,o)=>pa(s.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),s.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const MOe=new Y("navigableContainerFocused",!1);var qP;let YF=(qP=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=MOe.bindTo(e),FX.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),FX.INSTANCE=void 0}get debugEnabled(){return this.configurationService.getValue("workbench.navigibleContainer.enableDebug")}log(e,...t){this.debugEnabled&&this.logService.debug(e,...t)}static register(e){const t=this.INSTANCE;return t?(t.containers.add(e),t.log("NavigableContainerManager.register",e.name),pa(gYt(e.focusNotifiers,i=>{i?(t.log("NavigableContainerManager.focus",e.name),t.focused.set(!0),t.lastContainer=e):(t.log("NavigableContainerManager.blur",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0))},(i,s)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,s)}),Ee(()=>{t.containers.delete(e),t.log("NavigableContainerManager.unregister",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0)}))):$.None}static getActive(){return this.INSTANCE?.lastContainer}},FX=qP,qP.ID="workbench.contrib.navigableContainerManager",qP);YF=FX=D([_(0,Pe),_(1,Ze),_(2,Re)],YF);function Crt(n){return YF.register(n)}gp(YF.ID,YF,Sl.BlockStartup);xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:ye.WorkbenchContrib,when:ge.and(MOe,ge.or(Rde?.negate(),LIt)),primary:V.CtrlCmd|E.UpArrow,handler:()=>{YF.getActive()?.focusPreviousWidget()}});xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:ye.WorkbenchContrib,when:ge.and(MOe,ge.or(Rde?.negate(),TIt)),primary:V.CtrlCmd|E.DownArrow,handler:()=>{YF.getActive()?.focusNextWidget()}});const tme="vs/workbench/contrib/comments/browser/commentThreadWidget";let o0e=class extends ${get commentThread(){return this._commentThread}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=s,this._contextKeyService=o,this._scopedInstantiationService=r,this._commentThread=a,this._pendingComment=c,this._pendingEdits=l,this._markdownOptions=d,this._commentOptions=h,this._containerDelegate=u,this.commentService=f,this.configurationService=m,this._keybindingService=v,this._commentThreadDisposables=[],this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._threadIsEmpty=Qv.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=Qv.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new uYt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const w=we(".body");e.appendChild(w);const b=this._register(Dd(w));this._register(Crt({name:"commentThreadWidget",focusNotifiers:[b],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(b.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(b.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(i0e,this._parentEditor,this._owner,this._parentResourceUri,w,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=od(this.container),this._commentThreadContextValue=Qv.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const C=Qv.commentControllerContext.bindTo(this._contextKeyService),y=this.commentService.getCommentController(this._owner);y?.contextValue&&C.set(y.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(tme,0,"Comment"),t;this.configurationService.getValue(ua.Comments)&&(t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(tme,1,"{0}, use ({1}) for accessibility help",e,t):e=g(tme,2,"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",e),this._body.container.ariaLabel=e}updateCurrentThread(e,t){e||t?this.commentService.setCurrentCommentThread(this.commentThread):this.commentService.setCurrentCommentThread(void 0)}currentThreadListeners(){let e=!1,t=!1;this._register(pe(this.container,xe.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(pe(this.container,xe.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===zl.Expanded&&this._commentThreadState===hg.Unresolved&&e.state===hg.Resolved;this._commentThreadState=e.state,this._commentThread=e,St(this._commentThreadDisposables),this._commentThreadDisposables=[],this._bindCommentThreadListeners(),await this._body.updateCommentThread(e,this._commentReply?.isCommentEditorFocused()??!1),this._threadIsEmpty.set(!this._body.length),this._header.updateCommentThread(e),this._commentReply?.updateCommentThread(e),this._commentThread.contextValue?this._commentThreadContextValue.set(this._commentThread.contextValue):this._commentThreadContextValue.reset(),t&&this.configurationService.getValue(aue).collapseOnResolve&&this.collapse()}async display(e,t){const i=Math.max(23,Math.ceil(e*1.2));this._header.updateHeight(i),await this._body.display(),this._commentThread.canReply&&this._createCommentForm(t),this._createAdditionalActions(),this._register(this._body.onDidResize(s=>{this._refresh(s)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),St(this._commentThreadDisposables),this.updateCurrentThread(!1,!1)}_bindCommentThreadListeners(){this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(()=>{this._commentReply?this._commentReply.updateCanReply():this._commentThread.canReply&&this._createCommentForm(!1)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.updateCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(e=>{this._header.createThreadLabel()}))}_createCommentForm(e){this._commentReply=this._scopedInstantiationService.createInstance(ZIe,this._owner,this._body.container,this._parentEditor,this._commentThread,this._scopedInstantiationService,this._contextKeyService,this._commentMenus,this._commentOptions,this._pendingComment,this,e,this._containerDelegate.actionRunner),this._register(this._commentReply)}_createAdditionalActions(){this._additionalActions=this._scopedInstantiationService.createInstance(s0e,this._body.container,this._commentThread,this._contextKeyService,this._commentMenus,this._containerDelegate.actionRunner),this._register(this._additionalActions)}getCommentCoords(e){return this._body.getCommentCoords(e)}getPendingEdits(){return this._body.getPendingEdits()}getPendingComment(){if(this._commentReply)return this._commentReply.getPendingComment()}setPendingComment(e){this._pendingComment=e,this._commentReply?.setPendingComment(e)}getDimensions(){return this._body.getDimensions()}layout(e){this._body.layout(e),e!==void 0&&this._commentReply?.layout(e)}focusCommentEditor(){this._commentReply?.expandReplyAreaAndFocusCommentEditor()}focus(){this._body.focus()}async submitComment(){const e=this._body.activeComment;if(e)return e.submitComment();if((this._commentReply?.getPendingComment()?.length??0)>0)return this._commentReply?.submitComment()}collapse(){this._containerDelegate.collapse()}applyTheme(e,t){const i=[];i.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${prt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${mrt}) }`);const s=e.getColor(GB);s&&i.push(`.review-widget .body .comment-body a { color: ${s} }`);const o=e.getColor(_mt);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(Zd);r&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${r}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${r}; }`));const a=e.getColor(vmt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(wmt);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(TE);l&&i.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${l}; }`);const d=e.getColor(ft);d&&(i.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${d}; }`),i.push(`.review-widget .body .monaco-editor { outline: 1px solid ${d}; }`));const h=e.getColor(yKe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(bKe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(CKe);f&&i.push(`.review-widget .body .comment-form .validation-error { color: ${f}; }`);const p="--comment-thread-editor-font-family",m="--comment-thread-editor-font-size",v="--comment-thread-editor-font-weight";this.container?.style.setProperty(p,t.fontFamily),this.container?.style.setProperty(m,`${t.fontSize}px`),this.container?.style.setProperty(v,t.fontWeight),i.push(`.review-widget .body code { +{0}`,n9e),enum:[frt],enumDescriptions:[g(aY,2,"Open using VS Code's standard opener.")]},FIe]}}}};function zKt(n,e){FIe.enum=n,FIe.enumDescriptions=e,it.as(Cs.Configuration).notifyConfigurationSchemaUpdated(VKt)}var OIe,GP;let BIe=(GP=class extends ${constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new W1(OIe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(ke.PROFILE,ln.MACHINE);for(const[i,s]of Object.entries(this._mementoObject||{}))this.add(i,s.extensionId,{isCurrentlyRegistered:!1});this.invalidateOpenersOnExtensionsChanged(),this._register(this._extensionService.onDidChangeExtensions(()=>this.invalidateOpenersOnExtensionsChanged())),this._register(this._extensionService.onDidChangeExtensionsStatus(()=>this.invalidateOpenersOnExtensionsChanged()))}didRegisterOpener(e,t){this.add(e,t,{isCurrentlyRegistered:!0})}add(e,t,i){const s=this._openers.get(e);if(s){s.isCurrentlyRegistered=s.isCurrentlyRegistered||i.isCurrentlyRegistered;return}const o={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,o),this._mementoObject[e]=o,this._memento.saveMemento(),this.updateSchema()}delete(e){this._openers.delete(e),delete this._mementoObject[e],this._memento.saveMemento(),this.updateSchema()}async invalidateOpenersOnExtensionsChanged(){await this._extensionService.whenInstalledExtensionsRegistered();const e=this._extensionService.extensions;for(const[t,i]of this._openers){const s=e.find(o=>o.identifier.value===i.extensionId);s?this._extensionService.canRemoveExtension(s)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,s]of this._openers)e.push(i),t.push(s.extensionId);zKt(e,t)}},OIe=GP,GP.STORAGE_ID="externalUriOpeners",GP);BIe=OIe=D([_(0,on),_(1,ho)],BIe);const s9e="vs/workbench/api/browser/mainThreadUriOpeners";let o9e=class extends ${constructor(e,t,i,s,o,r){super(),this.extensionService=s,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(et.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new BIe(t,s))}async*getOpeners(e){if(!(e.scheme!==_e.http&&e.scheme!==_e.https)){await this.extensionService.activateByEvent(`onOpenExternalUri:${e.scheme}`);for(const[t,i]of this._registeredOpeners)i.schemes.has(e.scheme)&&(yield this.createOpener(t,i))}}createOpener(e,t){return{id:e,label:t.label,canOpen:(i,s)=>this.proxy.$canOpenUri(e,i,s),openExternalUri:async(i,s,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:s.sourceUri},o)}catch(r){if(!Na(r)){const a=new xn("default",g(s9e,0,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:frt})});a.tooltip=i.toString(),this.notificationService.notify({severity:nt.Error,message:g(s9e,1,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,s){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:s,extensionId:i}),this._contributedExternalUriOpenersStore.didRegisterOpener(e,i.value)}async $unregisterUriOpener(e){this._registeredOpeners.delete(e),this._contributedExternalUriOpenersStore.delete(e)}dispose(){super.dispose(),this._registeredOpeners.clear()}};o9e=D([en(Ue.MainThreadUriOpeners),_(1,on),_(2,VZe),_(3,ho),_(4,fr),_(5,Pi)],o9e);let r9e=class{constructor(e,t,i,s){this.hostService=t,this.openerService=i,this.userActivityService=s,this.disposables=new Z,this.proxy=e.getProxy(et.ExtHostWindow),T.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),s.onDidChangeIsActive(this.proxy.$onDidChangeWindowActive,this.proxy,this.disposables)}dispose(){this.disposables.dispose()}$getInitialState(){return Promise.resolve({isFocused:this.hostService.hasFocus,isActive:this.userActivityService.isActive})}async $openUri(e,t,i){const s=P.from(e);let o;return t&&P.parse(t).toString()===s.toString()?o=t:o=s,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(P.revive(e),t)).resolved}};r9e=D([en(Ue.MainThreadWindow),_(1,Id),_(2,fr),_(3,BPe)],r9e);var WIe;let HIe=WIe=class extends ${static async create(e,t,i){return e.invokeFunction(async s=>{const r=await s.get(Rn).createModelReference(i);return e.createInstance(WIe,t,i,r)})}constructor(e,t,i,s){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=s,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._register(i),this._textFileModel=this.textFileService.files.get(t),this._textFileModel&&(this._register(this._textFileModel.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._register(this._textFileModel.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._register(this.textFileService.files.onDidChangeDirty(o=>{_n(this.resource,o.resource)&&(this._onDidChangeDirty.fire(),this._onDidChangeContent.fire())}))}get resource(){return this._resource}isReadonly(){return this._model.object.isReadonly()}get backupId(){}get canHotExit(){return!0}isDirty(){return this.textFileService.isDirty(this.resource)}isOrphaned(){return!!this._textFileModel?.hasState(uu.ORPHAN)}async revert(e){return this.textFileService.revert(this.resource,e)}saveCustomEditor(e){return this.textFileService.save(this.resource,e)}async saveCustomEditorAs(e,t,i){return!!await this.textFileService.saveAs(e,t,i)}};HIe=WIe=D([_(3,tr)],HIe);new Y("webviewFindWidgetVisible",!1);new Y("webviewFindWidgetFocused",!1);new Y("webviewFindWidgetEnabled",!1);var a9e;(function(n){n.NotebookRenderer="notebookRenderer",n.CustomEditor="customEditor",n.WebviewView="webviewView"})(a9e||(a9e={}));let UIe=class{constructor(e,t){this._memento=new W1(e,t),this._state=this._memento.getMemento(ke.APPLICATION,ln.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),s=this._state[i];if(s&&typeof s=="string")return s;const o=Dr();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};UIe=D([_(1,on)],UIe);let Toe=class{constructor(e,t){this._store=new UIe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};Toe=D([_(1,on)],Toe);let Roe=class extends ${constructor(e,t){super(),this.resource=e,this.fileService=t,this._onDidChangeOrphaned=this._register(new I),this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.orphaned=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._register(this.fileService.onDidFilesChange(i=>this.onDidFilesChange(i)))}isOrphaned(){return this.orphaned}async onDidFilesChange(e){let t=!1,i;if(this.orphaned?e.contains(this.resource,Ko.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Ko.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let s=!1;i&&(await Ta(100,qe.None),this.isDisposed()?s=!0:s=!await this.fileService.exists(this.resource)),this.orphaned!==s&&!this.isDisposed()&&this.setOrphaned(s)}}setOrphaned(e){this.orphaned!==e&&(this.orphaned=e,this._onDidChangeOrphaned.fire())}isDisposed(){return this._store.isDisposed}dispose(){this.orphaned=!1,this._onWillDispose.fire(),super.dispose()}isModified(){return this.isDirty()}};Roe=D([_(1,ci)],Roe);var PX;const c9e="vs/workbench/api/browser/mainThreadCustomEditors";var A2;(function(n){n[n.Custom=0]="Custom",n[n.Text=1]="Text"})(A2||(A2={}));let VIe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.mainThreadWebview=t,this.mainThreadWebviewPanels=i,this._customEditorService=c,this._editorGroupService=l,this._editorService=d,this._instantiationService=h,this._webviewWorkbenchService=u,this._editorProviders=this._register(new Zo),this._editorRenameBackups=new Map,this._webviewOriginStore=new Toe("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(et.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof E2&&MS(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof nH&&s.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Text,Wse(e),t,i,s,!0,o)}$registerCustomEditorProvider(e,t,i,s,o){this.registerEditorProvider(A2.Custom,Wse(e),t,i,{},s,o)}registerEditorProvider(e,t,i,s,o,r,a){if(this._editorProviders.has(i))throw new Error(`Provider for ${i} already registered`);const c=new Z;c.add(this._customEditorService.registerCustomEditorCapabilities(i,{supportsMultipleEditorsPerDocument:r})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof nH&&l.viewType===i,resolveWebview:async(l,d)=>{const h=Dr(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=s,l.webview.extension=t;let f=l.backupId;l.oldResource&&!l.backupId&&(f=this._editorRenameBackups.get(l.oldResource.toString())?.backupId,this._editorRenameBackups.delete(l.oldResource.toString()));let p;try{p=await this.getOrCreateCustomEditorModel(e,u,i,{backupId:f},d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i));return}if(d.isCancellationRequested){p.dispose();return}l.webview.onDidDispose(()=>{if(p.object.isDirty()){const m=p.object.onDidChangeDirty(()=>{p.object.isDirty()||(m.dispose(),p.dispose())});return}p.dispose()}),o.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},qe.None),this._proxyCustomEditors.$onMoveCustomEditor(h,m,i),v.dispose()});try{await this._proxyCustomEditors.$resolveCustomEditor(u,h,i,{title:l.getTitle(),contentOptions:l.webview.contentOptions,options:l.webview.options,active:l===this._editorService.activeEditor},U1(this._editorGroupService,l.group||0),d)}catch(m){bt(m),l.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(i)),p.dispose();return}}})),this._editorProviders.set(i,c)}$unregisterEditorProvider(e){if(!this._editorProviders.has(e))throw new Error(`No provider for ${e} registered`);this._editorProviders.deleteAndDispose(e),this._customEditorService.models.disposeAllModelsForView(e)}async getOrCreateCustomEditorModel(e,t,i,s,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case A2.Text:{const a=HIe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case A2.Custom:{const a=E2.create(this._instantiationService,this._proxyCustomEditors,i,t,s,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof nH&&_n(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,s){(await this.getCustomEditorModel(e,t)).pushEdit(i,s)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=P.revive(e),s=await this._customEditorService.models.get(i,t);if(!s||!(s instanceof E2))throw new Error("Could not find model for webview editor");return s}async onWillRunWorkingCopyFileOperation(e){e.operation===Li.MOVE&&e.waitUntil((async()=>{const t=[];for(const i of e.files)i.source&&t.push(...await this._customEditorService.models.getAllModels(i.source));for(const i of t)if(i instanceof E2&&i.isDirty()){const s=await i.backup(qe.None);s.meta&&this._editorRenameBackups.set(i.editorResource.toString(),s.meta)}})())}};VIe=D([_(3,ho),_(4,on),_(5,Pw),_(6,fC),_(7,kPe),_(8,ur),_(9,_i),_(10,be),_(11,kQ)],VIe);var IA;(function(n){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=n.Type||(n.Type={})),n.Allowed=Object.freeze({type:e.Allowed}),n.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(s){this.operation=s,this.type=e.Pending}}n.Pending=t})(IA||(IA={}));let E2=PX=class extends Roe{static async create(e,t,i,s,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(s,i,o.backupId,l,a);return e.createInstance(PX,t,i,s,!!o.backupId,d,!!l,r)}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(PX.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=o,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=IA.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=oOe,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this.onDidChangeReadonly=T.None,this._fromBackup=s,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(c9e,0,"Custom editor '{0}' could not be saved.",this.name))}))),r&&(this._isDirtyFromContentChange=!0)}get editorResource(){return this._editorResource}dispose(){this._editable&&this._undoService.removeElements(this._editorResource),this._proxy.$disposeCustomDocument(this._editorResource,this._viewType),super.dispose()}static toWorkingCopyResource(e,t){const i=e.replace(/[^a-z0-9\-_]/gi,"-"),s=`/${O9(t.with({query:null,fragment:null}).toString(!0))}`;return P.from({scheme:_e.vscodeCustomEditor,authority:i,path:s,query:JSON.stringify(t.toJSON())})}get name(){return yr(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?JS.Untitled:JS.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===_e.untitled}isReadonly(){return!this._editable}get viewType(){return this._viewType}get backupId(){return this._backupId}pushEdit(e,t){if(!this._editable)throw new Error("Document is not editable");this.change(()=>{this.spliceEdits(e),this._currentEditIndex=this._edits.length-1}),this._undoService.pushElement({type:wd.Resource,resource:this._editorResource,label:t??g(c9e,1,"Edit"),code:"undoredo.customEditorEdit",undo:()=>this.undo(),redo:()=>this.redo()})}changeContent(){this.change(()=>{this._isDirtyFromContentChange=!0})}async undo(){if(!this._editable||this._currentEditIndex<0)return;const e=this._edits[this._currentEditIndex];this.change(()=>{--this._currentEditIndex}),await this._proxy.$undo(this._editorResource,this.viewType,e,this.isDirty())}async redo(){if(!this._editable||this._currentEditIndex>=this._edits.length-1)return;const e=this._edits[this._currentEditIndex+1];this.change(()=>{++this._currentEditIndex}),await this._proxy.$redo(this._editorResource,this.viewType,e,this.isDirty())}spliceEdits(e){const t=this._currentEditIndex+1,i=this._edits.length-this._currentEditIndex,s=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);s.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,s)}change(e){const t=this.isDirty();e(),this._onDidChangeContent.fire(),this.isDirty()!==t&&this._onDidChangeDirty.fire()}async revert(e){this._editable&&(this._currentEditIndex===this._savePoint&&!this._isDirtyFromContentChange&&!this._fromBackup||(e?.soft||this._proxy.$revert(this._editorResource,this.viewType,qe.None),this.change(()=>{this._isDirtyFromContentChange=!1,this._fromBackup=!1,this._currentEditIndex=this._savePoint,this.spliceEdits()})))}async save(e){const t=!!await this.saveCustomEditor(e);return t&&this._onDidSave.fire({reason:e?.reason,source:e?.source}),t}async saveCustomEditor(e){if(!this._editable)return;if(this.isUntitled()){const i=await this.suggestUntitledSavePath(e);return i?(await this.saveCustomEditorAs(this._editorResource,i,e),i):void 0}const t=na(i=>this._proxy.$onSave(this._editorResource,this.viewType,i));this._ongoingSave?.cancel(),this._ongoingSave=t;try{await t,this._ongoingSave===t&&this.change(()=>{this._isDirtyFromContentChange=!1,this._savePoint=this._currentEditIndex,this._fromBackup=!1})}finally{this._ongoingSave===t&&(this._ongoingSave=void 0)}return this._editorResource}suggestUntitledSavePath(e){if(!this.isUntitled())throw new Error("Resource is not untitled");const t=this._environmentService.remoteAuthority,i=R9(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await na(s=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,s)),this.change(()=>{this._savePoint=this._currentEditIndex}),!0):(await this.fileService.copy(e,t,!1),!0)}get canHotExit(){return typeof this._backupId=="string"&&this._hotExitState.type===IA.Type.Allowed}async backup(e){const t=this._getEditors();if(!t.length)throw new Error("No editors found for resource, cannot back up");const i=t[0],o={meta:{viewType:this.viewType,editorResource:this._editorResource,backupId:"",extension:i.extension?{id:i.extension.id.value,location:i.extension.location}:void 0,webview:{origin:i.webview.origin,options:i.webview.options,state:i.webview.state}}};if(!this._editable)return o;this._hotExitState.type===IA.Type.Pending&&this._hotExitState.operation.cancel();const r=new IA.Pending(na(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=r,e.onCancellationRequested(()=>{r.operation.cancel()});let a="";try{const c=await r.operation;this._hotExitState===r&&(this._hotExitState=IA.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Na(c))throw c;this._hotExitState===r&&(this._hotExitState=IA.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===IA.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};E2=PX=D([_(7,bf),_(8,ci),_(9,eo),_(10,pO),_(11,Za),_(12,Pw),_(13,Lm),_(14,ho)],E2);class $Kt{constructor(){this._handlesToInputs=new Map,this._inputsToHandles=new Map}add(e,t){this._handlesToInputs.set(e,t),this._inputsToHandles.set(t,e)}getHandleForInput(e){return this._inputsToHandles.get(e)}getInputForHandle(e){return this._handlesToInputs.get(e)}delete(e){const t=this.getInputForHandle(e);this._handlesToInputs.delete(e),t&&this._inputsToHandles.delete(t)}get size(){return this._handlesToInputs.size}[Symbol.iterator](){return this._handlesToInputs.values()}}class GKt{constructor(e){this.prefix=e}fromExternal(e){return this.prefix+e}toExternal(e){return e.startsWith(this.prefix)?e.substr(this.prefix.length):void 0}}let zIe=class extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=s,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new GKt("mainThreadWebview-"),this._webviewInputs=new $Kt,this._revivers=this._register(new Zo),this.webviewOriginStore=new Toe("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(et.ExtHostWebviewPanels),this._register(T.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,s.onDidAddGroup,s.onDidRemoveGroup,s.onDidMoveGroup)(()=>{this.updateWebviewViewStates(this._editorService.activeEditor)})),this._register(l.onDidChangeActiveWebviewEditor(d=>{this.updateWebviewViewStates(d)})),this._register(l.registerResolver({canResolve:d=>{const h=this.webviewPanelViewType.toExternal(d.viewType);return typeof h=="string"&&r.activateByEvent(`onWebviewPanel:${h}`),!1},resolveWebview:()=>{throw new Error("not implemented")}}))}get webviewInputs(){return this._webviewInputs}addWebviewInput(e,t,i){this._webviewInputs.add(e,t),this._mainThreadWebviews.addWebview(e,t.webview,i),t.webview.onDidDispose(()=>{this._proxy.$onDidDisposeWebviewPanel(e).finally(()=>{this._webviewInputs.delete(e)})})}$createWebviewPanel(e,t,i,s,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=Wse(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:s.title,options:QKt(s.panelOptions),contentOptions:Hse(s.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),s.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:s.serializeBuffersForPostMessage});const h={extensionId:c.id.value,viewType:i};this._telemetryService.publicLog2("webviews:createWebviewPanel",h)}$disposeWebview(e){const t=this.tryGetWebviewInput(e);t&&t.dispose()}$setTitle(e,t){this.tryGetWebviewInput(e)?.setName(t)}$setIconPath(e,t){const i=this.tryGetWebviewInput(e);i&&(i.iconPath=qKt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const s=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,s,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===wx||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return wx;if(e.viewColumn===Cw)return Cw;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(gg.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:_Ee.LAST});if(i){const s=w6(this._configurationService);return this._editorGroupService.addGroup(i,s)}}return wx}$registerSerializer(e,t){if(this._revivers.has(e))throw new Error(`Reviver for ${e} already registered`);this._revivers.set(e,this._webviewWorkbenchService.registerResolver({canResolve:i=>i.viewType===this.webviewPanelViewType.fromExternal(e),resolveWebview:async i=>{const s=this.webviewPanelViewType.toExternal(i.viewType);if(!s){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=Dr();this.addWebviewInput(o,i,t);let r;if(i.webview.state)try{r=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(o,s,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},U1(this._editorGroupService,i.group||0))}catch(a){bt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(s))}}}))}$unregisterSerializer(e){if(!this._revivers.has(e))throw new Error(`No reviver for ${e} registered`);this._revivers.deleteAndDispose(e)}updateWebviewViewStates(e){if(!this._webviewInputs.size)return;const t={},i=(s,o,r)=>{if(!(r instanceof Qg))return;r.updateGroup(s.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===s.activeEditor,active:r===e,position:U1(this._editorGroupService,s.id)})};for(const s of this._editorGroupService.groups)for(const o of s.editors)o instanceof op?(i(s,o,o.primary),i(s,o,o.secondary)):i(s,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};zIe=D([_(2,Re),_(3,ur),_(4,_i),_(5,ho),_(6,on),_(7,rn),_(8,kQ)],zIe);function qKt(n){if(n)return{light:P.revive(n.light),dark:P.revive(n.dark)}}function QKt(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}let $Ie=class extends ${constructor(e,t,i,s){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=s,this._webviewViews=this._register(new Zo),this._webviewViewProviders=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostWebviewViews)}$setWebviewViewTitle(e,t){const i=this.getWebviewView(e);i.title=t}$setWebviewViewDescription(e,t){const i=this.getWebviewView(e);i.description=t}$setWebviewViewBadge(e,t){const i=this.getWebviewView(e);i.badge=t}$show(e,t){this.getWebviewView(e).show(t)}$registerWebviewViewProvider(e,t,i){if(this._webviewViewProviders.has(t))throw new Error(`View provider for ${t} already registered`);const s=Wse(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=Dr();this._webviewViews.set(c,r),this.mainThreadWebviews.addWebview(c,r.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(r.webview.state)try{l=JSON.parse(r.webview.state)}catch(d){console.error("Could not load webview state",d,r.webview.state)}r.webview.extension=s,i&&(r.webview.options=i),r.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),r.onDispose(()=>{this._proxy.$disposeWebviewView(c),this._webviewViews.deleteAndDispose(c)}),this._telemetryService.publicLog2("webviews:createWebviewView",{extensionId:s.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){bt(d),r.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,o)}$unregisterWebviewViewProvider(e){if(!this._webviewViewProviders.has(e))throw new Error(`No view provider for ${e} registered`);this._webviewViewProviders.deleteAndDispose(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("unknown webview view");return t}};$Ie=D([_(2,rn),_(3,het)],$Ie);let l9e=class extends ${constructor(e,t){super();const i=this._register(t.createInstance(Ake,e));e.set(Ue.MainThreadWebviews,i);const s=this._register(t.createInstance(zIe,e,i));e.set(Ue.MainThreadWebviewPanels,s);const o=this._register(t.createInstance(VIe,e,i,s));e.set(Ue.MainThreadCustomEditors,o);const r=this._register(t.createInstance($Ie,e,i));e.set(Ue.MainThreadWebviewViews,r)}};l9e=D([TO,_(1,be)],l9e);const H5="vs/workbench/api/browser/mainThreadWorkspace";let d9e=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=s,this._canonicalUriService=o,this._editorService=r,this._workspaceEditingService=a,this._notificationService=c,this._requestService=l,this._instantiationService=d,this._labelService=h,this._environmentService=u,this._workspaceTrustManagementService=p,this._workspaceTrustRequestService=m,this._toDispose=new Z,this._activeCancelTokens=Object.create(null),this._queryBuilder=this._instantiationService.createInstance(Gne),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(et.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!rf&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(w=>this._proxy.$initializeWorkspace(this.getWorkspaceData(w),this.isWorkspaceTrusted())),this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace,this,this._toDispose),this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace,this,this._toDispose),this._workspaceTrustManagementService.onDidChangeTrust(this._onDidGrantWorkspaceTrust,this,this._toDispose)}dispose(){this._toDispose.dispose();for(const e in this._activeCancelTokens)this._activeCancelTokens[e].cancel()}$updateWorkspaceFolders(e,t,i,s){const o=s.map(r=>({uri:P.revive(r.uri),name:r.name}));return this._notificationService.status(this.getStatusMessage(e,o.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,o,!0)}getStatusMessage(e,t,i){let s;const o=t>0,r=i>0;return o&&!r?t===1?s=g(H5,0,"Extension '{0}' added 1 folder to the workspace",e):s=g(H5,1,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?s=g(H5,2,"Extension '{0}' removed 1 folder from the workspace",e):s=g(H5,3,"Extension '{0}' removed {1} folders from the workspace",e,i):s=g(H5,4,"Extension '{0}' changed folders of the workspace",e),s}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===Nn.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?p7(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const s=P.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(s?[s]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Na(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,s,o){const r=P.revive(t),a=this._contextService.getWorkspace(),c=r?[r]:a.folders.map(u=>u.uri),l=this._queryBuilder.text(e,c,i);l._reason="startTextSearch";const d=u=>{u.results&&this._proxy.$handleTextSearchResult(u,s)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Na(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(s=>eot(s,e,t,i))}async $save(e,t){const i=P.revive(e),s=[...this._editorService.findEditors(i,{supportSideBySide:go.PRIMARY})],o=await this._editorService.save(s,{reason:Ln.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return k_(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Ui(e.editors.map(t=>jc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$loadCertificates(){return this._requestService.loadCertificates()}$requestWorkspaceTrust(e){return this._workspaceTrustRequestService.requestWorkspaceTrust(e)}isWorkspaceTrusted(){return this._workspaceTrustManagementService.isWorkspaceTrusted()}_onDidGrantWorkspaceTrust(){this._proxy.$onDidGrantWorkspaceTrust()}$registerEditSessionIdentityProvider(e,t){const i=this._editSessionIdentityService.registerEditSessionIdentityProvider({scheme:t,getEditSessionIdentifier:async(s,o)=>this._proxy.$getEditSessionIdentifier(s.uri,o),provideEditSessionIdentityMatch:async(s,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(s.uri,o,r,a)});this.registeredEditSessionProviders.set(e,i),this._toDispose.add(i)}$unregisterEditSessionIdentityProvider(e){this.registeredEditSessionProviders.get(e)?.dispose(),this.registeredEditSessionProviders.delete(e)}$registerCanonicalUriProvider(e,t){const i=this._canonicalUriService.registerCanonicalUriProvider({scheme:t,provideCanonicalUri:async(s,o,r)=>{const a=await this._proxy.$provideCanonicalUri(s,o,r);return a&&P.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};d9e=D([en(Ue.MainThreadWorkspace),_(1,ohe),_(2,Ti),_(3,APe),_(4,SPe),_(5,_i),_(6,$S),_(7,Pi),_(8,EQ),_(9,be),_(10,eo),_(11,Il),_(12,ci),_(13,oA),_(14,Ade)],d9e);var jKt=".comments-panel .comments-panel-container{height:100%}.comments-panel .comments-panel-container .hidden{display:none}.comments-panel .comments-panel-container .tree-container{height:100%}.comments-panel .comments-panel-container .tree-container.hidden{display:none;visibility:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container{display:block}.comments-panel .comments-panel-container .tree-container .comment-thread-container div{overflow:hidden}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container,.comments-panel .comments-panel-container .tree-container .resource-container{display:flex;overflow:hidden;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata{display:flex;flex:1}.comments-panel .count,.comments-panel .user{padding-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .icon{min-width:fit-content;padding-right:5px;padding-top:4px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .user,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .count{min-width:fit-content}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container .relevance{background-color:var(--vscode-badge-background);border-radius:2px;color:var(--vscode-badge-foreground);font-size:.9em;line-height:14px;margin-bottom:3px;margin-right:4px;margin-top:4px;padding:0 4px 1px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text{display:flex;flex:1;min-width:0}.comments-panel .comments-panel-container .tree-container .comment-thread-container .reply-detail,.comments-panel .comments-panel-container .tree-container .comment-thread-container .timestamp,.comments-panel .comments-panel-container .tree-container .resource-container .owner{display:block;font-size:.9em;opacity:.8;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .text *{margin:0;max-width:500px;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .range{opacity:.8}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container .text code{font-family:var(--monaco-monospace-font)}.comments-panel .comments-panel-container .tree-container .monaco-icon-label{padding-right:5px}.comments-panel .comments-panel-container .tree-container .separator{opacity:.8;padding-right:5px}.comments-panel .comments-panel-container .message-box-container{height:inherit;line-height:22px;padding-left:20px}.comments-panel .comments-panel-container .tree-container .count-badge-wrapper{margin-left:10px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata-container,.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{line-height:22px;margin-right:5px}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-snippet-container{padding-left:16px}.comments-panel .hide{display:none}.comments-panel .comments-panel-container .text a{color:var(--vscode-textLink-foreground)}.comments-panel .comments-panel-container .text a:hover,.comments-panel .comments-panel-container a:active{color:var(--vscode-textLink-activeForeground)}.comments-panel .comments-panel-container .text a:focus{outline-color:var(--vscode-focusBorder)}.comments-panel .comments-panel-container .text code{color:var(--vscode-textPreformat-foreground)}.comments-panel .comments-panel-container .actions{display:none}.comments-panel .comments-panel-container .actions .action-label{padding:2px}.comments-panel .monaco-list .monaco-list-row.focused .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row.selected .comment-metadata-container .actions,.comments-panel .monaco-list .monaco-list-row:hover .comment-metadata-container .actions{display:block}";Ct(jKt,{});let Ly=class{constructor(e,t,i,s,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=s,this.thread=o,this.isRoot=!1,this.replies=[],this.threadId=o.threadId,this.range=o.range,this.threadState=o.state,this.threadRelevance=o.applicability,this.contextValue=o.contextValue,this.controllerHandle=o.controllerHandle,this.threadHandle=o.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class lm{constructor(e,t,i,s){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=s.filter(o=>o.comments&&o.comments.length).map(o=>lm.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,s){const{comments:o}=s,r=o.map(a=>new Ly(e,t,i,a,s));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const aue="comments";class GIe extends ${constructor(e,t,i,s){super(),this.configurationService=e,this._date=he(i,we("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupUpdatableHover(va("mouse"),this._date,"")),this.setTimestamp(s)}get useRelativeTimeSetting(){return this.configurationService.getValue(aue).useRelativeTime}async setTimestamp(e){(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime)&&this.updateDate(e),this._timestamp=e,this._useRelativeTime=this.useRelativeTimeSetting}updateDate(e){if(!e)this._date.textContent="",this._date.style.display="none";else if(e!==this._timestamp||this.useRelativeTimeSetting!==this._useRelativeTime){this._date.style.display="";let t,i;this.useRelativeTimeSetting?(t=this.getRelative(e),i=this.getDateString(e)):t=this.getDateString(e),this._date.textContent=t,this.hover.update(i??"")}}getRelative(e){return WFe(e,!0,!0)}getDateString(e){return e.toLocaleString(Gd)}}const RO="vs/workbench/contrib/comments/browser/commentColors",qIe=B("commentsView.resolvedIcon",{dark:aWe,light:aWe,hcDark:ft,hcLight:ft},g(RO,0,"Icon color for resolved comments.")),QIe=B("commentsView.unresolvedIcon",{dark:nwe,light:nwe,hcDark:ft,hcLight:ft},g(RO,1,"Icon color for unresolved comments."));B("editorCommentsWidget.replyInputBackground",{dark:SR,light:SR,hcDark:SR,hcLight:SR},g(RO,2,"Background color for comment reply input box."));const KKt=B("editorCommentsWidget.resolvedBorder",{dark:qIe,light:qIe,hcDark:ft,hcLight:ft},g(RO,3,"Color of borders and arrow for resolved comments.")),VE=B("editorCommentsWidget.unresolvedBorder",{dark:QIe,light:QIe,hcDark:ft,hcLight:ft},g(RO,4,"Color of borders and arrow for unresolved comments."));B("editorCommentsWidget.rangeBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,5,"Color of background for comment ranges."));B("editorCommentsWidget.rangeActiveBackground",{dark:Ie(VE,.1),light:Ie(VE,.1),hcDark:Ie(VE,.1),hcLight:Ie(VE,.1)},g(RO,6,"Color of background for currently selected or hovered comment range."));const YKt=new Map([[hg.Unresolved,VE],[hg.Resolved,KKt]]),JKt=new Map([[hg.Unresolved,QIe],[hg.Resolved,qIe]]),prt="--comment-thread-state-color",h9e="--comment-view-thread-state-color",mrt="--comment-thread-state-background-color";function _rt(n,e,t){const i=n!==void 0?t.get(n):void 0;return i!==void 0?e.getColor(i):void 0}function XKt(n,e){return _rt(n,e,YKt)}function ZKt(n,e){return _rt(n,e,JKt)}const ale=class ale{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const s=e.startsWith("!");this.textFilter={text:(s?lz(e,"!"):e).trim(),negate:s}}};ale._filter=KYe,ale._messageFilter=dee;let gE=ale;const eYt="vs/workbench/contrib/comments/browser/commentsModel";class cue extends ${get resourceCommentThreads(){return this._resourceCommentThreads}constructor(){super(),this._resourceCommentThreads=[],this.commentThreadsMap=new Map}updateResourceCommentThreads(){const e=this.commentThreadsMap.size>1;this._resourceCommentThreads=[...this.commentThreadsMap.values()].map(t=>t.resourceWithCommentThreads.map(i=>(i.ownerLabel=e?t.ownerLabel:void 0,i)).flat()).flat(),this._resourceCommentThreads.sort((t,i)=>t.resource.toString()>i.resource.toString()?1:-1)}setCommentThreads(e,t,i,s){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,s)}),this.updateResourceCommentThreads()}deleteCommentsByOwner(e){if(e){const t=this.commentThreadsMap.get(e);this.commentThreadsMap.set(e,{ownerLabel:t?.ownerLabel,resourceWithCommentThreads:[]})}else this.commentThreadsMap.clear();this.updateResourceCommentThreads()}updateCommentThreads(e){const{uniqueOwner:t,owner:i,ownerLabel:s,removed:o,changed:r,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return o.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0,u=h?.commentThreads.findIndex(f=>f.threadId===l.threadId)??0;u>=0&&h?.commentThreads.splice(u,1),h?.commentThreads.length===0&&c.splice(d,1)}),r.forEach(l=>{const d=c.findIndex(f=>f.id===l.resource),h=d>=0?c[d]:void 0;if(!h)return;const u=h.commentThreads.findIndex(f=>f.threadId===l.threadId);u>=0?h.commentThreads[u]=lm.createCommentNode(t,i,P.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(lm.createCommentNode(t,i,P.parse(h.id),l))}),a.forEach(l=>{const d=c.filter(h=>h.resource.toString()===l.resource);if(d.length){const h=d[0];l.comments&&l.comments.length&&h.commentThreads.push(lm.createCommentNode(t,i,h.resource,l))}else c.push(new lm(t,i,P.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:s,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(eYt,0,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const s=[],o=new Map;for(const r of yU(i,cue._compareURIs))o.set(r[0].resource,new lm(e,t,P.parse(r[0].resource),r));return o.forEach((r,a,c)=>{s.push(r)}),s}static _compareURIs(e,t){const i=e.resource.toString(),s=t.resource.toString();return is?1:0}}const MC="vs/workbench/contrib/comments/browser/commentsTreeViewer",Qd="workbench.panel.comments",tYt="Comments",jIe=Be(MC,0,"Comments"),pW=class pW{getHeight(e){return e instanceof Ly&&e.hasReply()?44:22}getTemplateId(e){return e instanceof lm?pW.RESOURCE_ID:e instanceof Ly?pW.COMMENT_ID:""}};pW.RESOURCE_ID="resource-with-comments",pW.COMMENT_ID="comment-node";let KIe=pW;class iYt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=he(e,we(".resource-container")),i=this.labels.create(t),s=he(t,we(".separator")),o=t.appendChild(we(".owner"));return{resourceLabel:i,owner:o,separator:s}}renderElement(e,t,i,s){i.resourceLabel.setFile(e.element.resource),i.separator.innerText="·",e.element.ownerLabel?(i.owner.innerText=e.element.ownerLabel,i.separator.style.display="inline"):(i.owner.innerText="",i.separator.style.display="none")}disposeTemplate(e){e.resourceLabel.dispose()}}let YIe=class{constructor(e){this.menuService=e}getResourceActions(e){const t=this.getActions(Te.CommentsViewThreadActions,e);return{menu:t.menu,actions:t.primary}}getResourceContextActions(e){return this.getActions(Te.CommentsViewThreadActions,e).secondary}setContextKeyService(e){this.contextKeyService=e}getActions(e,t){if(!this.contextKeyService)return{primary:[],secondary:[]};const i=[["commentController",t.owner],["resourceScheme",t.resource.scheme],["commentThread",t.contextValue],["canReply",t.thread.canReply]],s=this.contextKeyService.createOverlay(i),o=this.menuService.createMenu(e,s),c={primary:[],secondary:[],menu:o};return nXe(o,{shouldForwardArgs:!0},c,"inline"),o.dispose(),c}dispose(){this.contextKeyService=void 0}};YIe=D([_(0,_c)],YIe);let JIe=class{constructor(e,t,i,s,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=s,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=he(e,we(".comment-thread-container")),i=he(t,we(".comment-metadata-container")),s=he(i,we(".comment-metadata")),o={icon:he(s,we(".icon")),userNames:he(s,we(".user")),timestamp:new GIe(this.configurationService,this.hoverService,he(s,we(".timestamp-container"))),relevance:he(s,we(".relevance")),separator:he(s,we(".separator")),commentPreview:he(s,we(".text")),range:he(s,we(".range"))};o.separator.innerText="·";const r=he(i,we(".actions")),a=new Qh(r,{actionViewItemProvider:this.actionViewItemProvider}),c=he(t,we(".comment-snippet-container")),l={container:c,icon:he(c,we(".icon")),count:he(c,we(".count")),lastReplyDetail:he(c,we(".reply-detail")),separator:he(c,we(".separator")),timestamp:new GIe(this.configurationService,this.hoverService,he(c,we(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...$e.asClassNameArray(Ce.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(MC,1,"{0} replies",e-1):e===2?g(MC,2,"1 reply"):g(MC,3,"1 comment")}getRenderedComment(e,t){const i=mQ(e,{inline:!0,actionHandler:{callback:o=>vde(this.openerService,o,e.isTrusted),disposables:t}}),s=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...$e.asClassNameArray(this.getIcon(e.element.threadState))),e.element.threadState!==void 0){const l=this.getCommentThreadWidgetStateColor(e.element.threadState,this.themeService.getColorTheme());i.threadMetadata.icon.style.setProperty(h9e,`${l}`),i.threadMetadata.icon.style.color=`var(${h9e})`}i.threadMetadata.userNames.textContent=e.element.comment.userName,i.threadMetadata.timestamp.setTimestamp(e.element.comment.timestamp?new Date(e.element.comment.timestamp):void 0);const r=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof r.comment.body=="string")i.threadMetadata.commentPreview.innerText=r.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(r.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupUpdatableHover(va("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(MC,7,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(MC,8,"[Ln {0}-{1}]",e.element.range.startLineNumber,e.element.range.endLineNumber));const a=this.menus.getResourceActions(e.element);if(i.actionBar.push(a.actions,{icon:!0,label:!1}),i.actionBar.context={commentControlHandle:e.element.controllerHandle,commentThreadHandle:e.element.threadHandle,$mid:Fs.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(o);const c=e.element.replies[e.element.replies.length-1].comment;i.repliesMetadata.lastReplyDetail.textContent=g(MC,9,"Last reply from {0}",c.userName),i.repliesMetadata.timestamp.setTimestamp(c.timestamp?new Date(c.timestamp):void 0)}getCommentThreadWidgetStateColor(e,t){return e!==void 0?ZKt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};JIe=D([_(2,fr),_(3,Re),_(4,el),_(5,pn)],JIe);var Moe;(function(n){n[n.Resource=0]="Resource",n[n.Comment=1]="Comment"})(Moe||(Moe={}));class nYt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?so.Visible:e instanceof lm?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=gE._filter(this.options.textFilter.text,ui(e.resource));if(t)return{visibility:!0,data:{type:Moe.Resource,uriMatches:t||[]}}}return so.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&hg.Resolved===e.threadState||this.options.showUnresolved&&hg.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const s=gE._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||gE._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>gE._messageFilter(this.options.textFilter.text,o.comment.userName)||gE._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return s.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:Moe.Comment,textMatches:s}}:s.length&&this.options.textFilter.negate&&t===so.Recurse?!1:s.length===0&&this.options.textFilter.negate&&t===so.Recurse?!0:t}}let XIe=class extends L7{constructor(e,t,i,s,o,r,a,c,l){const d=new KIe,h=yO.bind(void 0,r),u=r.createInstance(YIe);u.setContextKeyService(s);const f=[r.createInstance(iYt,e),r.createInstance(JIe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof cue?"root":p instanceof lm?`${p.uniqueOwner}-${p.id}`:p instanceof Ly?`${p.uniqueOwner}-${p.resource.toString()}-${p.threadId}-${p.comment.uniqueIdInThread}`+(p.isRoot?"-root":""):""},expandOnlyOnTwistieClick:!0,collapseByDefault:!1,overrideStyles:i.overrideStyles,filter:i.filter,findWidgetEnabled:!1,multipleSelectionSupport:!1},r,s,o,a),this.contextMenuService=c,this.keybindingService=l,this.menus=u,this.disposables.add(this.onContextMenu(p=>this.commentsOnContextMenu(p)))}commentsOnContextMenu(e){const t=e.element;if(!(t instanceof Ly))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const s=this.menus.getResourceContextActions(t);s.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>s,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new WS(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:Fs.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const s of i.children)s.visible&&i.visible&&e++;return e}};XIe=D([_(3,Pe),_(4,yf),_(5,be),_(6,Re),_(7,Vr),_(8,ti)],XIe);const ROe=new Y("commentsFilterFocus",!1),Ax="vs/workbench/contrib/comments/browser/commentsViewActions",vrt=new Y("commentsView.showResolvedFilter",!0),wrt=new Y("commentsView.showUnResolvedFilter",!0);class sYt extends ${constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=wrt.bindTo(this.contextKeyService),this._showResolved=vrt.bindTo(this.contextKeyService),this._showResolved.set(e.showResolved),this._showUnresolved.set(e.showUnresolved)}get showUnresolved(){return!!this._showUnresolved.get()}set showUnresolved(e){this._showUnresolved.get()!==e&&(this._showUnresolved.set(e),this._onDidChange.fire({showUnresolved:!0}))}get showResolved(){return!!this._showResolved.get()}set showResolved(e){this._showResolved.get()!==e&&(this._showResolved.set(e),this._onDidChange.fire({showResolved:!0}))}}At(class extends XQ{constructor(){super({id:"commentsFocusViewFromFilter",title:g(Ax,0,"Focus Comments view"),keybinding:{when:ROe,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.DownArrow},viewId:Qd})}async runInView(n,e){e.focus()}});At(class extends XQ{constructor(){super({id:"commentsClearFilterText",title:g(Ax,1,"Clear filter text"),keybinding:{when:ROe,weight:ye.WorkbenchContrib,primary:E.Escape},viewId:Qd})}async runInView(n,e){e.clearFilterText()}});At(class extends XQ{constructor(){super({id:"commentsFocusFilter",title:g(Ax,2,"Focus comments filter"),keybinding:{when:Tz.isEqualTo(Qd),weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyF},viewId:Qd})}async runInView(n,e){e.focusFilter()}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleUnResolvedComments`,title:g(Ax,3,"Show Unresolved"),category:g(Ax,4,"Comments"),toggled:{condition:wrt,title:g(Ax,5,"Show Unresolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends XQ{constructor(){super({id:`workbench.actions.${Qd}.toggleResolvedComments`,title:g(Ax,6,"Show Resolved"),category:g(Ax,4,"Comments"),toggled:{condition:vrt,title:g(Ax,7,"Show Resolved")},menu:{id:Mhe,group:"1_filter",when:ge.equals("view",Qd),order:1},viewId:Qd})}async runInView(n,e){e.filters.showResolved=!e.filters.showResolved}});var oYt=".review-widget{position:absolute;width:100%}.monaco-editor .review-widget{background-color:var(--vscode-peekViewResult-background)}.review-widget .hidden{display:none!important}.review-widget .body{overflow:hidden}.review-widget .body .review-comment{display:flex;padding:8px 16px 8px 20px}@keyframes monaco-review-widget-focus{0%{background:var(--vscode-peekViewResult-selectionBackground)}to{background:transparent}}.review-widget .body .review-comment.focus{animation:monaco-review-widget-focus 3s ease 0s}.review-widget .body .review-comment .comment-actions{margin-left:auto}.review-widget .body .review-comment .comment-actions .monaco-toolbar{height:22px}.review-widget .body .review-comment .comment-title .comment-header-info{overflow:hidden;text-overflow:ellipsis}.review-widget .body .review-comment .comment-title{display:flex;width:100%}.review-widget .body .review-comment .comment-title .action-label.codicon{line-height:18px}.review-widget .body .review-comment .comment-title .monaco-dropdown .toolbar-toggle-more{height:18px;line-height:18px;vertical-align:middle;width:16px}.review-widget .body .comment-body blockquote{border-left-style:solid;border-left-width:5px;margin:0 7px 0 5px;padding:0 16px 0 10px}.review-widget .body .review-comment .avatar-container{margin-top:4px!important}.review-widget .body .review-comment .avatar-container img.avatar{border-radius:3px;border-style:none;display:inline-block;height:28px;line-height:1;overflow:hidden;vertical-align:middle;width:28px}.review-widget .body .comment-reactions .monaco-text-button{background-color:transparent;border:1px solid grey;border-radius:3px;margin:0 7px 0 0;width:30px}.review-widget .body .review-comment .review-comment-contents{overflow:hidden;padding-left:20px;user-select:text;-webkit-user-select:text;width:100%}.review-widget .body pre{word-wrap:normal;overflow:auto;white-space:pre}.review-widget .body .review-comment .review-comment-contents .author{line-height:22px}.review-widget .body .review-comment .review-comment-contents .isPending{font-style:italic;line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .timestamp{line-height:22px;margin:0 5px;padding:0 2px}.review-widget .body .review-comment .review-comment-contents .comment-body .comment-body-plainstring{white-space:pre-wrap}.review-widget .body .review-comment .review-comment-contents .comment-body{padding-top:4px}.review-widget .body .review-comment .review-comment-contents .comment-body-max-height{max-height:20em}.review-widget .body .review-comment .review-comment-contents .comment-reactions{margin-top:8px;min-height:25px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label{display:flex;font-size:12px;padding:1px 4px;text-align:center;white-space:pre}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-icon{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-position:0;background-repeat:no-repeat;background-size:14px;display:inline-block;margin-right:4px;width:14px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label .reaction-label{line-height:20px;margin-right:4px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions{background-position:50%;background-repeat:no-repeat;background-size:16px;border:none;display:none;font-size:16px;height:16px;margin-top:3px;width:26px}.review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions{background-size:16px;display:inline-block}.review-widget .body .review-comment .comment-title .action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block;height:16px;line-height:16px}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label{border:1px solid}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.disabled{opacity:.6}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.active:hover{background-color:var(--vscode-statusBarItem-hoverBackground)}.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label:active{background-color:var(--vscode-statusBarItem-activeBackground);border:1px solid transparent}.review-widget .body .review-comment .review-comment-contents a{cursor:pointer}.review-widget .body .comment-body p,.review-widget .body .comment-body ul{margin:8px 0}.review-widget .body .comment-body p:first-child,.review-widget .body .comment-body ul:first-child{margin-top:0}.review-widget .body .comment-body p:last-child,.review-widget .body.comment-body ul:last-child{margin-bottom:0}.review-widget .body .comment-body ul{padding-left:20px}.review-widget .body .comment-body li>p{margin-bottom:0}.review-widget .body .comment-body li>ul{margin-top:0}.review-widget .body .comment-body code{border-radius:3px;padding:0 .4em}.review-widget .body .comment-body span{white-space:pre}.review-widget .body .comment-body img{max-width:100%}.review-widget .body .comment-form{margin:8px 20px}.review-widget .validation-error{word-wrap:break-word;box-sizing:border-box;display:inline-block;font-size:12px;line-height:17px;margin-left:-1px;margin-top:-1px;min-height:34px;overflow:hidden;padding:.4em;text-align:left;width:100%}.review-widget .body .comment-additional-actions{margin:10px 20px}.review-widget .body .comment-additional-actions .section-separator{border-top:1px solid var(--vscode-menu-separatorBackground);margin:10px 0 14px}.review-widget .body .comment-additional-actions .button-bar{display:flex;white-space:nowrap}.review-widget .body .comment-additional-actions .monaco-button,.review-widget .body .comment-additional-actions .monaco-button-dropdown,.review-widget .body .comment-additional-actions .monaco-text-button{display:flex;width:auto}.review-widget .body .comment-additional-actions .button-bar>.monaco-button-dropdown,.review-widget .body .comment-additional-actions .button-bar>.monaco-text-button{margin:0 10px 0 0}.review-widget .body .comment-additional-actions .button-bar .monaco-text-button{padding:4px 10px}.review-widget .body .comment-additional-actions .codicon-drop-down-button{align-items:center}.review-widget .body .monaco-editor{color:var(--vscode-editor-foreground)}.review-widget .body .comment-form.expand .review-thread-reply-button{display:none}.review-widget .body .comment-form.expand .form-actions,.review-widget .body .comment-form.expand .monaco-editor{box-sizing:content-box;display:block}.review-widget .body .comment-form .review-thread-reply-button{background-color:var(--vscode-editorCommentsWidget-replyInputBackground);border:0;border-radius:0;box-sizing:border-box;color:var(--vscode-editor-foreground);display:block;font-family:var(--monaco-monospace-font);font-size:inherit;font-weight:600;line-height:20px;outline:1px solid transparent;padding:6px 12px;resize:vertical;text-align:left;white-space:nowrap;width:100%}.review-widget .body .comment-form .review-thread-reply-button:focus{outline-style:solid;outline-width:1px}.review-widget .body .comment-form .monaco-editor,.review-widget .body .comment-form .monaco-editor .monaco-editor-background,.review-widget .body .edit-container .monaco-editor .monaco-editor-background{background-color:var(--vscode-editorCommentsWidget-replyInputBackground)}.review-widget .body .comment-form .monaco-editor,.review-widget .body .edit-container .monaco-editor{border:0;border-radius:3px;box-sizing:content-box;max-height:500px;min-height:90px;padding:6px 0 6px 12px;width:100%}.review-widget .body .comment-form .form-actions,.review-widget .body .comment-form .monaco-editor{display:none}.review-widget .body .comment-form .form-actions,.review-widget .body .edit-container .form-actions{margin:10px 0;overflow:auto}.review-widget .body .edit-container .form-actions{padding-top:10px}.review-widget .body .edit-textarea{margin:5px 12px 10px 0}.review-widget .body .comment-form .form-actions .monaco-text-button,.review-widget .body .edit-container .monaco-text-button{margin-left:5px;padding:4px 10px;width:auto}.review-widget .body .form-actions .monaco-text-button{float:right}.review-widget .head{box-sizing:border-box;display:flex;height:100%}.review-widget .head .review-title{cursor:default;display:inline-block;font-size:13px;margin-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-widget .head .review-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.review-widget .head .review-actions{flex:1;padding-right:2px;text-align:right}.review-widget .head .review-actions>.monaco-action-bar{display:inline-block}.review-widget .head .review-actions>.monaco-action-bar,.review-widget .head .review-actions>.monaco-action-bar>.actions-container{height:100%}.review-widget .action-item{margin-left:4px;min-height:20px;min-width:18px}.review-widget .head .review-actions>.monaco-action-bar .action-label{background-position:50%;background-repeat:no-repeat;line-height:inherit;margin:0}.review-widget .head .review-actions>.monaco-action-bar .action-label.codicon{margin:0}.review-widget>.body{border-top:1px solid;position:relative}.monaco-editor .comment-range-glyph{cursor:pointer;margin-left:10px;width:4px!important;z-index:10}div.preview.inline .monaco-editor .comment-range-glyph{display:none!important}.monaco-editor .comment-diff-added{border-left-style:solid;border-left-width:3px}.monaco-editor .comment-diff-added,.monaco-editor .comment-range-glyph.multiline-add{border-left-color:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-diff-added:before,.monaco-editor .comment-range-glyph.line-hover:before,.monaco-editor .comment-thread-unresolved:before,.monaco-editor .comment-thread:before{background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-editor .comment-thread-range{background-color:var(--vscode-editorCommentsWidget-rangeBackground)}.monaco-editor .comment-thread-range-current{background-color:var(--vscode-editorCommentsWidget-rangeActiveBackground)}.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread,.monaco-editor .margin-view-overlays .comment-range-glyph.comment-thread-unresolved,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover{margin-left:13px}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before,.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{align-items:center;color:var(--vscode-editorGutter-commentGlyphForeground);display:flex;flex-direction:row;height:100%;justify-content:center;left:-6px;position:absolute;text-align:center;width:9px;z-index:10}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{color:var(--vscode-editorGutter-commentUnresolvedGlyphForeground)}.monaco-editor .margin-view-overlays .comment-range-glyph.multiline-add{border-left-style:dotted;border-left-width:3px;height:16px;margin-top:2px}.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before,.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before{border-radius:3px;content:var(--vscode-icon-plus-content);font-family:var(--vscode-icon-plus-font-family);font-family:codicon;margin-left:-5px;padding-left:1px;width:18px!important}.monaco-editor .comment-range-glyph.comment-thread,.monaco-editor .comment-range-glyph.comment-thread-unresolved{z-index:20}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before,.monaco-editor .comment-range-glyph.comment-thread:before{border-radius:3px;font-family:codicon;font-size:13px;line-height:100%;margin-left:-5px;padding-left:1px;padding-top:1px;width:18px!important;z-index:20}.monaco-editor .comment-range-glyph.comment-thread:before{content:var(--vscode-icon-comment-add-content);font-family:var(--vscode-icon-comment-add-font-family)}.monaco-editor .comment-range-glyph.comment-thread-unresolved:before{content:var(--vscode-icon-comment-unresolved-content);font-family:var(--vscode-icon-comment-unresolved-font-family)}.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-collapsed,.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded{margin-left:11px}.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph{margin-left:25px}";Ct(oYt,{});const nj="vs/workbench/contrib/comments/browser/commentGlyphWidget",cY=B("editorGutter.commentRangeForeground",{dark:sWe(swe,us),light:Am(sWe(swe,us),.05),hcDark:fe.white,hcLight:fe.black},g(nj,0,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),G3=B("editorOverviewRuler.commentForeground",{dark:cY,light:cY,hcDark:cY,hcLight:cY},g(nj,1,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),rYt=B("editorOverviewRuler.commentUnresolvedForeground",{dark:G3,light:G3,hcDark:G3,hcLight:G3},g(nj,2,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),lY=B("editorGutter.commentGlyphForeground",{dark:Mc,light:Mc,hcDark:fe.black,hcLight:fe.white},g(nj,3,"Editor gutter decoration color for commenting glyphs."));B("editorGutter.commentUnresolvedGlyphForeground",{dark:lY,light:lY,hcDark:lY,hcLight:lY},g(nj,4,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const cle=class cle{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===hg.Unresolved,t={description:cle.description,isWholeLine:!0,overviewRuler:{color:Nr(e?rYt:G3),position:oh.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return Kt.createDynamic(t)}setThreadState(e){this._threadState!==e&&(this._threadState=e,this._commentsOptions=this.createDecorationOptions(),this._updateDecorations())}_updateDecorations(){const e=[{range:{startLineNumber:this._lineNumber,startColumn:1,endLineNumber:this._lineNumber,endColumn:1},options:this._commentsOptions}];this._commentsDecorations.set(e)}setLineNumber(e){this._lineNumber=e,this._updateDecorations()}getPosition(){const e=this._commentsDecorations.length>0?this._commentsDecorations.getRange(0):null;return{position:{lineNumber:e?e.endLineNumber:this._lineNumber,column:1},preference:[hs.EXACT]}}dispose(){this._commentsDecorations.clear()}};cle.description="comment-glyph-widget";let FG=cle;class OG{constructor(e,t,i,s,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=s,this.maxActions=o,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(o=>o.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let s=!t;for(const o of i){const[,r]=o;this._actions=r;for(const a of r){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&s&&(c=this.keybindingService.lookupKeybinding($A.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Tu(this.container,{secondary:!s,title:l,...yQ});if(s=!1,this._buttonElements.push(d.element),this._toDispose.add(d),this._toDispose.add(d.onDidClick(()=>this.actionHandler(a))),d.enabled=a.enabled,d.label=a.label,this.maxActions!==void 0&&this._buttonElements.length>=this.maxActions){console.warn("An extension has contributed more than the allowable number of actions to a comments menu.");return}}}}triggerDefaultAction(){if(this._actions.length){const e=this._actions[0];if(e.enabled)return this.actionHandler(e)}}dispose(){this._toDispose.dispose()}}const dY="vs/workbench/contrib/comments/browser/commentReply";let aYt=0;const brt="commenteditordecoration";let ZIe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=s,this._scopedInstatiationService=o,this._contextKeyService=r,this._commentMenus=a,this._commentOptions=c,this._pendingComment=l,this._parentThread=d,this._actionRunDelegate=u,this.commentService=f,this.themeService=p,this.keybindingService=v,this.hoverService=w,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=J$,this.form=he(t,we(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(EV,this.form,EV.getEditorOptions(m),r,this._parentThread)),this.commentEditorIsEmpty=Qv.commentIsEmpty.bindTo(this._contextKeyService),this.commentEditorIsEmpty.set(!this._pendingComment),this.initialize(h)}async initialize(e){const t=this._commentThread.comments&&this._commentThread.comments.length>0,i=Dr()+"-"+(t?this._commentThread.threadId:++aYt),s=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=P.from({scheme:_e.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${s}`});const r=this.commentService.getCommentController(this.owner);r&&(o=o.with({authority:r.id}));const a=await this.textModelService.createModelReference(o);a.object.textEditorModel.setValue(this._pendingComment||""),this._register(a),this.commentEditor.setModel(a.object.textEditorModel),this.calculateEditorHeight(),this._register(a.object.textEditorModel.onDidChangeContent(()=>{this.setCommentEditorDecorations(),this.commentEditorIsEmpty?.set(!this.commentEditor.getValue()),this.calculateEditorHeight()&&(this.commentEditor.layout({height:this._editorHeight,width:this.commentEditor.getLayoutInfo().width}),this.commentEditor.render(!0))})),this.createTextModelListener(this.commentEditor,this.form),this.setCommentEditorDecorations(),this._pendingComment?this.expandReplyArea():t?this.createReplyButton(this.commentEditor,this.form):e&&this._commentThread.comments&&this._commentThread.comments.length===0&&this.expandReplyArea(),this._error=he(this.form,we(".validation-error.hidden"));const c=he(this.form,we(".form-actions"));this._formActions=he(c,we(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=he(c,we(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=oit(this._parentEditor,this.commentEditor,this._editorHeight);return e!==this._editorHeight?(this._editorHeight=e,!0):!1}updateCommentThread(e){const t=this.commentEditor.hasTextFocus(),i=!this._commentThread.comments?.length&&!e.comments?.length;this._reviewThreadReplyButton||this.createReplyButton(this.commentEditor,this.form),this._commentThread.comments&&this._commentThread.comments.length===0&&!i&&this.expandReplyArea(),t&&this.commentEditor.focus()}getPendingComment(){const e=this.commentEditor.getModel();if(e&&e.getValueLength()>0)return e.getValue()}setPendingComment(e){this._pendingComment=e,this.expandReplyArea(),this.commentEditor.setValue(e)}layout(e){this.commentEditor.layout({height:this._editorHeight,width:e-54})}focusIfNeeded(){!this._commentThread.comments||!this._commentThread.comments.length?this.commentEditor.focus():(this.commentEditor.getModel()?.getValueLength()??0)>0&&this.expandReplyArea()}focusCommentEditor(){this.commentEditor.focus()}expandReplyAreaAndFocusCommentEditor(){this.expandReplyArea(),this.commentEditor.focus()}isCommentEditorFocused(){return this.commentEditor.hasWidgetFocus()}updateCanReply(){this._commentThread.canReply?this.form.style.display="block":this.form.style.display="none"}async submitComment(){await this._commentFormActions?.triggerDefaultAction(),this._pendingComment=void 0}setCommentEditorDecorations(){const e=this.commentEditor.getModel();if(e){const t=e.getValueLength(),i=this._commentThread.comments&&this._commentThread.comments.length>0,s=t>0?"":i?this._commentOptions?.placeHolder||g(dY,0,"Reply..."):this._commentOptions?.placeHolder||g(dY,1,"Type a new comment"),o=[{range:{startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:1},renderOptions:{after:{contentText:s,color:`${iv(Mc,this.themeService.getColorTheme())?.transparent(.4)}`}}}];this.commentEditor.setDecorationsByType("review-zone-widget",brt,o)}}createTextModelListener(e,t){this._commentThreadDisposables.push(e.onDidFocusEditorWidget(()=>{this._commentThread.input={uri:e.getModel().uri,value:e.getValue()},this.commentService.setActiveEditingCommentThread(this._commentThread),this.commentService.setActiveCommentAndThread(this.owner,{thread:this._commentThread})})),this._commentThreadDisposables.push(e.getModel().onDidChangeContent(()=>{const i=e.getValue();if(this._commentThread.input&&this._commentThread.input.uri===e.getModel().uri&&this._commentThread.input.value!==i){const s=this._commentThread.input;s.value=i,this._commentThread.input=s}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const s=this._commentThread,o=e.getModel();s.input&&o&&s.input.uri!==o.uri||i&&e.getValue()!==i.value&&(e.setValue(i.value),i.value===""&&(this._pendingComment="",t.classList.remove("expand"),e.getDomNode().style.outline="",this._error.textContent="",this._error.classList.add("hidden")))}))}createCommentWidgetFormActions(e,t){const i=this._commentMenus.getCommentThreadActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{await this._actionRunDelegate?.(),await s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.hideReplyArea()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e,t){const i=this._commentMenus.getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,async s=>{this._actionRunDelegate?.(),s.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:Fs.CommentThreadReply}),this.focusCommentEditor()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}get isReplyExpanded(){return this.form.classList.contains("expand")}expandReplyArea(){this.isReplyExpanded||(this.form.classList.add("expand"),this.commentEditor.focus(),this.commentEditor.layout())}clearAndExpandReplyArea(){this.isReplyExpanded||(this.commentEditor.setValue(""),this.expandReplyArea())}hideReplyArea(){const e=this.commentEditor.getDomNode();e&&(e.style.outline=""),this.commentEditor.setValue(""),this._pendingComment="",this.form.classList.remove("expand"),this._error.textContent="",this._error.classList.add("hidden")}createReplyButton(e,t){this._reviewThreadReplyButton=he(t,we(`button.review-thread-reply-button.${lx}`)),this._register(this.hoverService.setupUpdatableHover(va("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(dY,0,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(dY,0,"Reply..."),this._register(pe(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(pe(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),St(this._commentThreadDisposables)}};ZIe=D([_(12,sD),_(13,pn),_(14,Re),_(15,ti),_(16,el),_(17,Rn)],ZIe);const hT="vs/workbench/contrib/comments/browser/reactionsAction",lle=class lle extends xn{constructor(e,t){super(lle.ID,t||g(hT,0,"Pick Reactions..."),"toggle-reactions",!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return this.toggleDropdownMenu(),Promise.resolve(!0)}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};lle.ID="toolbar.toggle.pickReactions";let WT=lle;class cYt extends WS{constructor(e){super(null,e,{})}updateLabel(){if(!this.label)return;const e=this.action;if(e.class&&this.label.classList.add(e.class),e.icon){const t=he(this.label,we(".reaction-icon")),i=P.revive(e.icon);t.style.backgroundImage=uf(i)}else{const t=he(this.label,we("span.reaction-label"));t.innerText=e.label}if(e.count){const t=he(this.label,we("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(hT,1,"Toggle reaction, "):"";if(e.count===void 0)return g(hT,2,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(hT,3,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(hT,4,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(hT,5,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(hT,6,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const dle=class dle extends xn{constructor(e,t="",i="",s=!0,o,r,a,c){super(dle.ID,t,i,s,o),this.reactors=r,this.icon=a,this.count=c}};dle.ID="toolbar.toggle.reaction";let e0e=dle;const Zpe="vs/workbench/contrib/comments/browser/commentNode";class u9e extends gw{async runAction(e,t){await e.run(...t)}}let t0e=class extends ${get domNode(){return this._domNode}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=s,this.owner=o,this.resource=r,this.parentThread=a,this.markdownRenderer=c,this.instantiationService=l,this.commentService=d,this.notificationService=h,this.contextMenuService=u,this.configurationService=p,this.hoverService=m,this.accessibilityService=v,this.keybindingService=w,this.textModelService=b,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=J$,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=we("div.review-comment"),this._contextKeyService=f.createScoped(this._domNode),this._commentContextValue=Qv.commentContext.bindTo(this._contextKeyService),this.comment.contextValue&&this._commentContextValue.set(this.comment.contextValue),this._commentMenus=this.commentService.getCommentMenus(this.owner),this._domNode.tabIndex=-1,this._avatar=he(this._domNode,we("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=he(this._domNode,we(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",lx),p.getValue(aue)?.maxHeight!==!1&&this._body.classList.add("comment-body-max-height"),this.createScroll(this._commentDetailsContainer,this._body),this.updateCommentBody(this.comment.body),this.comment.commentReactions&&this.comment.commentReactions.length&&this.comment.commentReactions.filter(C=>!!C.count).length&&this.createReactionsContainer(this._commentDetailsContainer),this._domNode.setAttribute("aria-label",`${i.userName}, ${this.commentBodyValue}`),this._domNode.setAttribute("role","treeitem"),this._clearTimeout=null,this._register(pe(this._domNode,xe.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(pe(this._domNode,xe.CONTEXT_MENU,C=>this.onContextMenu(C))),s&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(pe(this._domNode,xe.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new nO({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>xd(gt(e),s)}),this._scrollableElement=this._register(new hQ(t,{horizontal:zo.Visible,vertical:zo.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(s=>{s.scrollLeftChanged&&(t.scrollLeft=s.scrollLeft),s.scrollTopChanged&&(t.scrollTop=s.scrollTop)}));const i=this._register(new oi(t,"scroll")).event;this._register(i(s=>{const o=this._scrollableElement.getScrollPosition(),r=Math.abs(t.scrollLeft-o.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-o.scrollTop)<=1?void 0:t.scrollTop;(r!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),e.appendChild(this._scrollableElement.getDomNode())}updateCommentBody(e){this._body.innerText="",this._md=void 0,this._plainText=void 0,typeof e=="string"?(this._plainText=he(this._body,we(".comment-body-plainstring")),this._plainText.innerText=e):(this._md=this.markdownRenderer.render(e).element,this._body.appendChild(this._md))}updateCommentUserIcon(e){if(this._avatar.textContent="",e){const t=he(this._avatar,we("img.avatar"));t.src=lp.uriToBrowserUri(P.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=he(e,we("span.timestamp-container")),this.updateTimestamp(this.comment.timestamp)}updateTimestamp(e){if(!this._timestamp)return;const t=e!==void 0?new Date(e):void 0;t?this._timestampWidget?this._timestampWidget.setTimestamp(t):(this._timestampWidget=new GIe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=he(e,we(`div.comment-title.${lx}`)),i=he(t,we("comment-header-info")),s=he(i,we("strong.author"));s.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=he(i,we("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=he(t,we(".comment-actions")),this.toggleToolbarHidden(!0),this.createActionsToolbar()}toggleToolbarHidden(e){e&&!this.accessibilityService.isScreenReaderOptimized()?this._actionsToolbarContainer.classList.add("hidden"):this._actionsToolbarContainer.classList.remove("hidden")}getToolbarActions(e){const t=e.getActions({shouldForwardArgs:!0}),o={primary:[],secondary:[]};return lYt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:Fs.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:Fs.CommentThread}]}createToolbar(){this.toolbar=new cZe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===WT.ID?new gx(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,s)=>this.actionViewItemProvider(i,s),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(e,t),orientation:Qb.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new u9e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const r=this.createReactionPicker(this.comment.commentReactions||[]);e.push(r)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(r=>{const{primary:a,secondary:c}=this.getToolbarActions(i);!this.toolbar&&(a.length||c.length)&&this.createToolbar(),this.toolbar.setActions(a,c)}));const{primary:s,secondary:o}=this.getToolbarActions(i);e.push(...s),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===WT.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===e0e.ID?new cYt(e):e instanceof id?this.instantiationService.createInstance(eC,e,{hoverDelegate:t.hoverDelegate}):e instanceof uS?this.instantiationService.createInstance(b7,e,t):new WS({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new WT(()=>{s?.show()},g(Zpe,0,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new xn(`reaction.command.${o.label}`,`${o.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,o)}catch(r){const a=r.message?g(Zpe,1,"Toggling the comment reaction failed: {0}.",r.message):g(Zpe,2,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const s=new gx(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===WT.ID?s:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>Ob.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=he(e,we("div.comment-reactions")),this._reactionsActionBar=new Qh(this._reactionActionsContainer,{actionViewItemProvider:(i,s)=>i.id===WT.ID?new gx(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...$e.asClassNameArray(Ce.reactions)],anchorAlignmentProvider:()=>Ob.RIGHT}):this.actionViewItemProvider(i,s)}),this._register(this._reactionsActionBar),this.commentService.hasReactionHandler(this.owner)){const i=this.createReactionPicker(this.comment.commentReactions||[]);this._reactionsActionBar.push(i,{label:!1,icon:!0})}}get commentBodyValue(){return typeof this.comment.body=="string"?this.comment.body:this.comment.body.value}async createCommentEditor(e){const t=he(e,we(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(EV,t,EV.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=P.from({scheme:_e.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),s=await this.textModelService.createModelReference(i);this._commentEditorModel=s,this._commentEditor.setModel(this._commentEditorModel.object.textEditorModel),this._commentEditor.setValue(this.pendingEdit??this.commentBodyValue),this.pendingEdit=void 0,this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus(),xd(gt(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const o=this._commentEditorModel.object.textEditorModel.getLineCount(),r=this._commentEditorModel.object.textEditorModel.getLineLength(o)+1;this._commentEditor.setSelection(new mt(o,r,o,r));const a=this.commentThread;a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment}),this._commentEditorDisposables.push(this._commentEditor.onDidFocusEditorWidget(()=>{a.input={uri:this._commentEditor.getModel().uri,value:this.commentBodyValue},this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})})),this._commentEditorDisposables.push(this._commentEditor.onDidChangeModelContent(c=>{if(a.input&&this._commentEditor&&this._commentEditor.getModel().uri===a.input.uri){const l=this._commentEditor.getValue();if(l!==a.input.value){const d=a.input;d.value=l,a.input=d,this.commentService.setActiveEditingCommentThread(a),this.commentService.setActiveCommentAndThread(this.owner,{thread:a,comment:this.comment})}}})),this.calculateEditorHeight(),this._register(this._commentEditorModel.object.textEditorModel.onDidChangeContent(()=>{this._commentEditor&&this.calculateEditorHeight()&&(this._commentEditor.layout({height:this._editorHeight,width:this._commentEditor.getLayoutInfo().width}),this._commentEditor.render(!0))})),this._register(this._commentEditor),this._register(this._commentEditorModel)}calculateEditorHeight(){if(this._commentEditor){const e=oit(this.parentEditor,this._commentEditor,this._editorHeight);if(e!==this._editorHeight)return this._editorHeight=e,!0}return!1}getPendingEdit(){const e=this._commentEditor?.getModel();if(e&&e.getValueLength()>0)return e.getValue()}removeCommentEditor(){this.isEditing=!1,this._editAction&&(this._editAction.enabled=!0),this._body.classList.remove("hidden"),this._commentEditorModel?.dispose(),St(this._commentEditorDisposables),this._commentEditorDisposables=[],this._commentEditor?.dispose(),this._commentEditor=null,this._commentEditContainer.remove()}layout(e){const t=e!==void 0?e-72:this._commentEditor?.getLayoutInfo().width??0;this._commentEditor?.layout({width:t,height:this._editorHeight});const i=this._body.scrollWidth,s=h$(this._body),o=this._body.scrollHeight,r=aMe(this._body)+4;this._scrollableElement.setScrollDimensions({width:s,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=he(this._commentDetailsContainer,we(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=he(this._commentEditContainer,we(".form-actions")),t=he(e,we(".other-actions"));this.createCommentWidgetFormActions(t);const i=he(e,we(".editor-actions"));this.createCommentWidgetEditorActions(i)}createCommentWidgetFormActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentFormActions?.setActions(i)})),this._commentFormActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this.removeCommentEditor()}),this._register(this._commentFormActions),this._commentFormActions.setActions(i)}createCommentWidgetEditorActions(e){const i=this.commentService.getCommentMenus(this.owner).getCommentEditorActions(this._contextKeyService);this._register(i),this._register(i.onDidChange(()=>{this._commentEditorActions?.setActions(i)})),this._commentEditorActions=new OG(this.keybindingService,this._contextKeyService,e,s=>{const o=this._commentEditor.getValue();s.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:Fs.CommentThreadNode}),this._commentEditor?.focus()}),this._register(this._commentEditorActions),this._commentEditorActions.setActions(i,!0)}setFocus(e,t=!1){e?(this._domNode.focus(),this.toggleToolbarHidden(!1),this._actionsToolbarContainer.classList.add("tabfocused"),this._domNode.tabIndex=0,this.comment.mode===RU.Editing&&this._commentEditor?.focus()):(this._actionsToolbarContainer.classList.contains("tabfocused")&&!this._actionsToolbarContainer.classList.contains("mouseover")&&(this.toggleToolbarHidden(!0),this._domNode.tabIndex=-1),this._actionsToolbarContainer.classList.remove("tabfocused"))}registerActionBarListeners(e){this._register(pe(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(pe(this._domNode,"mouseleave",()=>{e.classList.contains("mouseover")&&!e.classList.contains("tabfocused")&&this.toggleToolbarHidden(!0),e.classList.remove("mouseover")}))}async update(e){e.body!==this.comment.body&&this.updateCommentBody(e.body),this.comment.userIconPath&&e.userIconPath&&P.from(this.comment.userIconPath).toString()!==P.from(e.userIconPath).toString()&&this.updateCommentUserIcon(e.userIconPath);const t=e.mode!==void 0&&e.mode!==this.comment.mode;this.comment=e,t&&(e.mode===RU.Editing?await this.switchToEditMode():this.removeCommentEditor()),e.label?this._isPendingLabel.innerText=e.label:this._isPendingLabel.innerText="",this._reactionActionsContainer?.remove(),this._reactionsActionBar?.clear(),this.comment.commentReactions&&this.comment.commentReactions.some(i=>!!i.count)&&this.createReactionsContainer(this._commentDetailsContainer),this.comment.contextValue?this._commentContextValue.set(this.comment.contextValue):this._commentContextValue.reset(),this.comment.timestamp&&this.updateTimestamp(this.comment.timestamp)}onContextMenu(e){const t=new yu(gt(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:Te.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new u9e,getActionsContext:()=>this.commentNodeContext})}focus(){this.domNode.focus(),this._clearTimeout||(this.domNode.classList.add("focus"),this._clearTimeout=setTimeout(()=>{this.domNode.classList.remove("focus")},3e3))}dispose(){super.dispose(),St(this._commentEditorDisposables)}};t0e=D([_(8,be),_(9,sD),_(10,Pi),_(11,Vr),_(12,Pe),_(13,Re),_(14,el),_(15,Ur),_(16,ti),_(17,Rn)],t0e);function lYt(n,e,t,i=s=>s==="navigation"){for(const s of n){let[o,r]=s;if(i(o))(Array.isArray(e)?e:e.primary).unshift(...r);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Kr),a.push(...r)}}}const eme="vs/workbench/contrib/comments/browser/commentThreadBody";let i0e=class extends ${get length(){return this._commentThread.comments?this._commentThread.comments.length:0}get activeComment(){return this._commentElements.filter(e=>e.isEditing)[0]}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=s,this._options=o,this._commentThread=r,this._pendingEdits=a,this._scopedInstatiationService=c,this._parentCommentThreadWidget=l,this.commentService=d,this.openerService=h,this.languageService=u,this._commentElements=[],this._focusedComment=void 0,this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._commentDisposable=new Map,this._register(pe(s,xe.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new vw(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}async display(){if(this._commentsElement=he(this.container,we("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(pe(this._commentsElement,xe.KEY_DOWN,e=>{const t=new os(e);if((t.equals(E.UpArrow)||t.equals(E.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=s=>{if(this._focusedComment===void 0&&s>=0)return 0;if(this._focusedComment===void 0&&s<0)return this._commentElements.length-1;const o=this._focusedComment+s;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(E.UpArrow)?i(-1):i(1))}})),this._commentElements=[],this._commentThread.comments)for(const e of this._commentThread.comments){const t=this.createNewCommentNode(e);this._commentElements.push(t),this._commentsElement.appendChild(t.domNode),e.mode===RU.Editing&&await t.switchToEditMode()}this._resizeObserver=new MutationObserver(this._refresh.bind(this)),this._resizeObserver.observe(this.container,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}_refresh(){const e=uw(this.container);this._onDidResize.fire(e)}getDimensions(){return uw(this.container)}layout(e){this._commentElements.forEach(t=>{t.layout(e)})}getPendingEdits(){const e={};return this._commentElements.forEach(t=>{if(t.isEditing){const i=t.getPendingEdit();i&&(e[t.comment.uniqueIdInThread]=i)}}),e}getCommentCoords(e){const t=this._commentElements.filter(i=>i.comment.uniqueIdInThread===e);if(t&&t.length){const i=ia(this._commentElements[0].domNode),s=ia(t[0].domNode);return{thread:i,comment:s}}}async updateCommentThread(e,t){const i=this._commentElements.length,s=e.comments?e.comments.length:0,o=[],r=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(r.push(d),o.push(this._commentElements[d]))}for(let d=o.length-1;d>=0;d--){const h=o[d];this._commentDisposable.get(h)?.dispose(),this._commentDisposable.delete(h),this._commentElements.splice(r[d],1),this._commentsElement.removeChild(h.domNode)}let a=null;const c=[],l=[];for(let d=s-1;d>=0;d--){const h=e.comments[d],u=this._commentElements.filter(f=>f.comment.uniqueIdInThread===h.uniqueIdInThread);if(u.length)a=u[0].domNode,c.unshift(u[0]);else{const f=this.createNewCommentNode(h);c.unshift(f),a?(this._commentsElement.insertBefore(f.domNode,a),a=f.domNode):(this._commentsElement.appendChild(f.domNode),a=f.domNode),h.mode===RU.Editing&&(await f.switchToEditMode(),l.push(f))}}if(this._commentThread=e,this._commentElements=c,l.length){const d=this._commentElements.indexOf(l[l.length-1]);this._focusedComment=d}this._updateAriaLabel(),t||this._setFocusedComment(this._focusedComment)}_updateAriaLabel(){this._commentThread.isDocumentCommentThread()?this._commentThread.range?this._commentsElement.ariaLabel=g(eme,0,"Comment thread with {0} comments on lines {1} through {2}. {3}.",this._commentThread.comments?.length,this._commentThread.range.startLineNumber,this._commentThread.range.endLineNumber,this._commentThread.label):this._commentsElement.ariaLabel=g(eme,1,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(eme,2,"Comment thread with {0} comments. {1}.",this._commentThread.comments?.length,this._commentThread.label)}_setFocusedComment(e){this._focusedComment!==void 0&&this._commentElements[this._focusedComment]?.setFocus(!1),this._commentElements.length===0||e===void 0?this._focusedComment=void 0:(this._focusedComment=Math.min(e,this._commentElements.length-1),this._commentElements[this._focusedComment].setFocus(!0))}createNewCommentNode(e){const t=this._scopedInstatiationService.createInstance(t0e,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer);return this._register(t),this._commentDisposable.set(t,t.onDidClick(i=>this._setFocusedComment(this._commentElements.findIndex(s=>s.comment.uniqueIdInThread===i.comment.uniqueIdInThread)))),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.forEach(e=>e.dispose())}};i0e=D([_(9,sD),_(10,fr),_(11,Di)],i0e);const n0e="vs/workbench/contrib/comments/browser/commentThreadHeader",dYt=Ki("review-comment-collapse",Ce.chevronUp,g(n0e,0,"Icon to collapse a review comment.")),hYt="expand-review-action "+$e.asClassName(dYt);class uYt extends ${constructor(e,t,i,s,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=s,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=we(".head"),e.appendChild(this._headElement),this._fillHead()}_fillHead(){const e=he(this._headElement,we(".review-title"));this._headingLabel=he(e,we("span.filename")),this.createThreadLabel();const t=he(this._headElement,we(".review-actions"));this._actionbarWidget=new Qh(t,{actionViewItemProvider:yO.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new xn("review.expand",g(n0e,1,"Collapse"),hYt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(s=>{this.setActionBarActions(i)})),this._register(pe(this._headElement,xe.CONTEXT_MENU,s=>this.onContextMenu(s))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,s])=>[...i,...s],[]);this._actionbarWidget.clear(),this._actionbarWidget.push([...t,this._collapseAction],{label:!1,icon:!0})}updateCommentThread(e){this._commentThread=e,this._actionbarWidget.context=this._commentThread,this.createThreadLabel()}createThreadLabel(){let e;e=this._commentThread.label,e===void 0&&(this._commentThread.comments&&this._commentThread.comments.length||(e=g(n0e,2,"Start discussion"))),e&&(this._headingLabel.textContent=rM(e),this._headingLabel.setAttribute("aria-label",e))}updateHeight(e){this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height}onContextMenu(e){const t=this._commentMenus.getCommentThreadTitleContextActions(this._contextKeyService).getActions({shouldForwardArgs:!0}).map(s=>s[1]).flat();if(!t.length)return;const i=new yu(gt(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new gw,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:Fs.CommentThread})})}}let s0e=class extends ${constructor(e,t,i,s,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=s,this._actionRunDelegate=o,this._keybindingService=r,this._container=he(e,we(".comment-additional-actions")),he(this._container,we(".section-separator")),this._buttonBar=he(this._container,we(".button-bar")),this._createAdditionalActions(this._buttonBar)}_showMenu(){this._container?.classList.remove("hidden")}_hideMenu(){this._container?.classList.add("hidden")}_enableDisableMenu(e){const t=e.getActions({shouldForwardArgs:!0});for(const i of t){const[,s]=i;for(const o of s){if(o.enabled){this._showMenu();return}for(const r of o.actions??[])if(r.enabled){this._showMenu();return}}}this._hideMenu()}_createAdditionalActions(e){const t=this._commentMenus.getCommentThreadAdditionalActions(this._contextKeyService);this._register(t),this._register(t.onDidChange(()=>{this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)})),this._commentFormActions=new OG(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:Fs.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};s0e=D([_(5,ti)],s0e);var FX;function gYt(n,e,t){const i=new Set;return pa(...n.map((s,o)=>pa(s.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),s.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const MOe=new Y("navigableContainerFocused",!1);var qP;let YF=(qP=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=MOe.bindTo(e),FX.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),FX.INSTANCE=void 0}get debugEnabled(){return this.configurationService.getValue("workbench.navigibleContainer.enableDebug")}log(e,...t){this.debugEnabled&&this.logService.debug(e,...t)}static register(e){const t=this.INSTANCE;return t?(t.containers.add(e),t.log("NavigableContainerManager.register",e.name),pa(gYt(e.focusNotifiers,i=>{i?(t.log("NavigableContainerManager.focus",e.name),t.focused.set(!0),t.lastContainer=e):(t.log("NavigableContainerManager.blur",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0))},(i,s)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,s)}),Ee(()=>{t.containers.delete(e),t.log("NavigableContainerManager.unregister",e.name,t.lastContainer?.name),t.lastContainer===e&&(t.focused.set(!1),t.lastContainer=void 0)}))):$.None}static getActive(){return this.INSTANCE?.lastContainer}},FX=qP,qP.ID="workbench.contrib.navigableContainerManager",qP);YF=FX=D([_(0,Pe),_(1,Ze),_(2,Re)],YF);function Crt(n){return YF.register(n)}gp(YF.ID,YF,Sl.BlockStartup);xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:ye.WorkbenchContrib,when:ge.and(MOe,ge.or(Rde?.negate(),LIt)),primary:V.CtrlCmd|E.UpArrow,handler:()=>{YF.getActive()?.focusPreviousWidget()}});xr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:ye.WorkbenchContrib,when:ge.and(MOe,ge.or(Rde?.negate(),TIt)),primary:V.CtrlCmd|E.DownArrow,handler:()=>{YF.getActive()?.focusNextWidget()}});const tme="vs/workbench/contrib/comments/browser/commentThreadWidget";let o0e=class extends ${get commentThread(){return this._commentThread}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=s,this._contextKeyService=o,this._scopedInstantiationService=r,this._commentThread=a,this._pendingComment=c,this._pendingEdits=l,this._markdownOptions=d,this._commentOptions=h,this._containerDelegate=u,this.commentService=f,this.configurationService=m,this._keybindingService=v,this._commentThreadDisposables=[],this._onDidResize=new I,this.onDidResize=this._onDidResize.event,this._threadIsEmpty=Qv.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=Qv.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new uYt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const w=we(".body");e.appendChild(w);const b=this._register(Dd(w));this._register(Crt({name:"commentThreadWidget",focusNotifiers:[b],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(b.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(b.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(S=>{S.affectsConfiguration(ua.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(i0e,this._parentEditor,this._owner,this._parentResourceUri,w,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=od(this.container),this._commentThreadContextValue=Qv.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const C=Qv.commentControllerContext.bindTo(this._contextKeyService),y=this.commentService.getCommentController(this._owner);y?.contextValue&&C.set(y.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(tme,0,"Comment"),t;this.configurationService.getValue(ua.Comments)&&(t=this._keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(tme,1,"{0}, use ({1}) for accessibility help",e,t):e=g(tme,2,"{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",e),this._body.container.ariaLabel=e}updateCurrentThread(e,t){e||t?this.commentService.setCurrentCommentThread(this.commentThread):this.commentService.setCurrentCommentThread(void 0)}currentThreadListeners(){let e=!1,t=!1;this._register(pe(this.container,xe.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(pe(this.container,xe.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(pe(this.container,xe.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===zl.Expanded&&this._commentThreadState===hg.Unresolved&&e.state===hg.Resolved;this._commentThreadState=e.state,this._commentThread=e,St(this._commentThreadDisposables),this._commentThreadDisposables=[],this._bindCommentThreadListeners(),await this._body.updateCommentThread(e,this._commentReply?.isCommentEditorFocused()??!1),this._threadIsEmpty.set(!this._body.length),this._header.updateCommentThread(e),this._commentReply?.updateCommentThread(e),this._commentThread.contextValue?this._commentThreadContextValue.set(this._commentThread.contextValue):this._commentThreadContextValue.reset(),t&&this.configurationService.getValue(aue).collapseOnResolve&&this.collapse()}async display(e,t){const i=Math.max(23,Math.ceil(e*1.2));this._header.updateHeight(i),await this._body.display(),this._commentThread.canReply&&this._createCommentForm(t),this._createAdditionalActions(),this._register(this._body.onDidResize(s=>{this._refresh(s)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),St(this._commentThreadDisposables),this.updateCurrentThread(!1,!1)}_bindCommentThreadListeners(){this._commentThreadDisposables.push(this._commentThread.onDidChangeCanReply(()=>{this._commentReply?this._commentReply.updateCanReply():this._commentThread.canReply&&this._createCommentForm(!1)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.updateCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeLabel(e=>{this._header.createThreadLabel()}))}_createCommentForm(e){this._commentReply=this._scopedInstantiationService.createInstance(ZIe,this._owner,this._body.container,this._parentEditor,this._commentThread,this._scopedInstantiationService,this._contextKeyService,this._commentMenus,this._commentOptions,this._pendingComment,this,e,this._containerDelegate.actionRunner),this._register(this._commentReply)}_createAdditionalActions(){this._additionalActions=this._scopedInstantiationService.createInstance(s0e,this._body.container,this._commentThread,this._contextKeyService,this._commentMenus,this._containerDelegate.actionRunner),this._register(this._additionalActions)}getCommentCoords(e){return this._body.getCommentCoords(e)}getPendingEdits(){return this._body.getPendingEdits()}getPendingComment(){if(this._commentReply)return this._commentReply.getPendingComment()}setPendingComment(e){this._pendingComment=e,this._commentReply?.setPendingComment(e)}getDimensions(){return this._body.getDimensions()}layout(e){this._body.layout(e),e!==void 0&&this._commentReply?.layout(e)}focusCommentEditor(){this._commentReply?.expandReplyAreaAndFocusCommentEditor()}focus(){this._body.focus()}async submitComment(){const e=this._body.activeComment;if(e)return e.submitComment();if((this._commentReply?.getPendingComment()?.length??0)>0)return this._commentReply?.submitComment()}collapse(){this._containerDelegate.collapse()}applyTheme(e,t){const i=[];i.push(`.monaco-editor .review-widget > .body { border-top: 1px solid var(${prt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${mrt}) }`);const s=e.getColor(GB);s&&i.push(`.review-widget .body .comment-body a { color: ${s} }`);const o=e.getColor(_mt);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(Zd);r&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${r}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${r}; }`));const a=e.getColor(vmt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(wmt);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(TE);l&&i.push(`.review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label { border-color: ${l}; }`);const d=e.getColor(ft);d&&(i.push(`.review-widget .body .comment-form .review-thread-reply-button { outline-color: ${d}; }`),i.push(`.review-widget .body .monaco-editor { outline: 1px solid ${d}; }`));const h=e.getColor(yKe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(bKe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(CKe);f&&i.push(`.review-widget .body .comment-form .validation-error { color: ${f}; }`);const p="--comment-thread-editor-font-family",m="--comment-thread-editor-font-size",v="--comment-thread-editor-font-weight";this.container?.style.setProperty(p,t.fontFamily),this.container?.style.setProperty(m,`${t.fontSize}px`),this.container?.style.setProperty(v,t.fontWeight),i.push(`.review-widget .body code { font-family: var(${p}); font-weight: var(${v}); }`),this._styleElement.textContent=i.join(` -`),this._commentReply?.setCommentEditorDecorations()}};o0e=D([_(12,sD),_(13,Vr),_(14,Re),_(15,ti)],o0e);function g9e(n,e){return XKt(n,e)??e.getColor($Pe)}var Ty;(function(n){n[n.None=0]="None",n[n.Widget=1]="Widget",n[n.Editor=2]="Editor"})(Ty||(Ty={}));function fYt(n){const e=n.target.range;if(!e||!n.event.leftButton||n.target.type!==Mt.GUTTER_LINE_DECORATIONS)return null;const t=n.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function pYt(n,e){if(!n)return null;const{lineNumber:t}=n;return e.target.range?t:null}let r0e=class extends UPe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,s,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=s,this._pendingEdits=o,this.themeService=a,this.commentService=c,this.configurationService=d,this._onDidClose=new I,this._onDidCreateThread=new I,this._globalToDispose=new Z,this._commentThreadDisposables=[],this._contextKeyService=l.createScoped(this.domNode),this._scopedInstantiationService=r.createChild(new Dl([Pe,this._contextKeyService]));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=s?zl.Expanded:i.initialCollapsibleState,i.initialCollapsibleState=this._initialCollapsibleState,this._commentThreadDisposables=[],this.create(),this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme,this)),this._globalToDispose.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.fontInfo)&&this._applyTheme(this.themeService.getColorTheme())})),this._applyTheme(this.themeService.getColorTheme())}get onDidClose(){return this._onDidClose.event}get onDidCreateThread(){return this._onDidCreateThread.event}getPosition(){if(this.position)return this.position;if(this._commentGlyph)return this._commentGlyph.getPosition().position??void 0}revealRange(){}reveal(e,t=Ty.None){if(this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2),e!==void 0){const s=this.editor.getLayoutInfo().height,o=this._commentThreadWidget.getCommentCoords(e);if(o){let r=1;if(this._commentThread.range){const a=o.thread,c=o.comment;r=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-s/2+c.top-a.top}this.editor.setScrollTop(r),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor();return}}const i=this._commentThread.range?new O(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new O(1,1,1,1);this.editor.revealRangeInCenter(i),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor()}getPendingComments(){return{newComment:this._commentThreadWidget.getPendingComment(),edits:this._commentThreadWidget.getPendingEdits()}}setPendingComment(e){this._pendingComment=e,this.expand(),this._commentThreadWidget.setPendingComment(e)}_fillContainer(e){this.setCssClass("review-widget"),this._commentThreadWidget=this._scopedInstantiationService.createInstance(o0e,e,this.editor,this._uniqueOwner,this.editor.getModel().uri,this._contextKeyService,this._scopedInstantiationService,this._commentThread,this._pendingComment,this._pendingEdits,{editor:this.editor,codeBlockFontSize:"",codeBlockFontFamily:this.configurationService.getValue("editor").fontFamily||Gh.fontFamily},this._commentOptions,{actionRunner:async()=>{if(!this._commentThread.comments||!this._commentThread.comments.length){const t=this.getPosition();if(t){const i=this._commentThread.range;if(!i)return;let s;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;s=new O(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else s=new O(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,s)}}},collapse:()=>{this.collapse()}}),this._disposables.add(this._commentThreadWidget)}arrowPosition(e){if(e)return{lineNumber:e.endLineNumber,column:e.endLineNumber===e.startLineNumber?(e.startColumn+e.endColumn+1)/2:1}}deleteCommentThread(){this.dispose(),this.commentService.disposeCommentThread(this.uniqueOwner,this._commentThread.threadId)}collapse(){this._commentThread.collapsibleState=zl.Collapsed}expand(){this._commentThread.collapsibleState=zl.Expanded}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=zl.Collapsed:this._commentThread.collapsibleState=zl.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(s=>s.dispose()),this._commentThread=e,this._commentThreadDisposables=[],this.bindCommentThreadListeners()),await this._commentThreadWidget.updateCommentThread(e);const t=this._commentThread.range?.endLineNumber??1;let i=!1;this._commentGlyph&&(this._commentGlyph.setThreadState(e.state),this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t))),i&&this._isExpanded||this._commentThread.collapsibleState===zl.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==zl.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new FG(this.editor,e?.endLineNumber??-1),this._commentGlyph.setThreadState(this._commentThread.state)),await this._commentThreadWidget.display(this.editor.getOption(x.lineHeight),t),this._disposables.add(this._commentThreadWidget.onDidResize(i=>{this._refresh(i)})),(this._commentThread.collapsibleState===zl.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.reveal(),this.bindCommentThreadListeners()}bindCommentThreadListeners(){if(this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.update(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(e=>{const t=this._commentThread.range?.startLineNumber??1;let i=!1;this._commentGlyph&&this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t)),i&&this._isExpanded&&this.show(this.arrowPosition(this._commentThread.range),2)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(e=>{if(e===zl.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2);return}if(e===zl.Collapsed&&this._isExpanded){this.hide();return}})),this._initialCollapsibleState===void 0){const e=this._commentThread.onDidChangeInitialCollapsibleState(t=>{this._initialCollapsibleState=t,this._commentThread.collapsibleState=this._initialCollapsibleState,e.dispose()});this._commentThreadDisposables.push(e)}this._commentThreadDisposables.push(this._commentThread.onDidChangeState(()=>{const e=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(prt,`${e}`),this.container?.style.setProperty(mrt,`${e.transparent(.1)}`)}))}async submitComment(){return this._commentThreadWidget.submitComment()}_refresh(e){if(this._isExpanded===void 0&&e.height===0&&e.width===0){this.commentThread.collapsibleState=zl.Collapsed;return}if(this._isExpanded){this._commentThreadWidget.layout();const t=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),i=this.editor.getOption(x.lineHeight),s=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+s+o+8)/i);if(this._viewZone?.heightInLines===r)return;const a=this.getPosition();this._viewZone&&a&&a.lineNumber!==this._viewZone.afterLineNumber&&this._viewZone.afterLineNumber!==0&&(this._viewZone.afterLineNumber=a.lineNumber);const c=M_.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({arrowColor:t,frameColor:t});const i=this.editor.getOption(x.fontInfo);this._commentThreadWidget.applyTheme(e,i)}show(e,t){const i=this._commentGlyph?.getPosition();let s=O.isIRange(e)?e:e?O.fromPositions(e):void 0;if(i?.position&&s&&i.position.lineNumber!==s.endLineNumber){const o=i.position.lineNumber-s.endLineNumber;s=new O(s.startLineNumber+o,s.startColumn,s.endLineNumber+o,s.endColumn)}this._isExpanded=!0,super.show(s??new O(0,0,0,0),t),this._commentThread.collapsibleState=zl.Expanded,this._refresh(this._commentThreadWidget.getDimensions())}hide(){this._isExpanded&&(this._isExpanded=!1,this.editor.hasWidgetFocus()&&this.editor.focus(),(!this._commentThread.comments||!this._commentThread.comments.length)&&this.deleteCommentThread()),super.hide()}dispose(){super.dispose(),this._commentGlyph&&(this._commentGlyph.dispose(),this._commentGlyph=void 0),this._globalToDispose.dispose(),this._commentThreadDisposables.forEach(e=>e.dispose()),this._onDidClose.fire(void 0)}};r0e=D([_(5,be),_(6,pn),_(7,sD),_(8,Pe),_(9,Re)],r0e);class f9e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const c9=class c9 extends ${constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=jt.createDynamic(t);const i={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=jt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(s=>{this.updateCurrent(s)})),this._register(e.onDidUpdateCommentThreads(()=>{this.updateCurrent(void 0)}))}updateCurrent(e){if(!this.editor||e?.resource&&e.resource?.toString()!==this.editor.getModel()?.uri.toString())return;this.currentThreadCollapseStateListener?.dispose();const t=[];if(e){const i=e.range;i&&!(i.startLineNumber===i.endLineNumber&&i.startColumn===i.endColumn)&&e.collapsibleState===zl.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(s=>{s===zl.Collapsed&&this.updateCurrent(void 0)}),t.push(new f9e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((s,o)=>s.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;St(this.threadCollapseStateListeners),this.editor=e;const s=[];for(const o of t)o.threads.forEach(r=>{if(r.isDisposed)return;const a=r.range;!a||a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn||(this.threadCollapseStateListeners.push(r.onDidChangeCollapsibleState(()=>{this.update(e,t)})),r.collapsibleState!==zl.Collapsed&&s.push(new f9e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,s),s.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){St(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};c9.description="comment-thread-range-decorator";let a0e=c9;const rB="vs/workbench/contrib/comments/browser/commentsController",mYt="editor.contrib.review";class CD{get id(){return this._decorationId}set id(e){this._decorationId=e}get range(){return{startLineNumber:this._startLineNumber,startColumn:1,endLineNumber:this._endLineNumber,endColumn:1}}constructor(e,t,i,s,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=s,this._range=o,this.options=r,this.commentingRangesInfo=a,this.isHover=c,this._startLineNumber=o.startLineNumber,this._endLineNumber=o.endLineNumber}getCommentAction(){return{extensionId:this._extensionId,label:this._label,ownerId:this._ownerId,commentingRangesInfo:this.commentingRangesInfo}}getOriginalRange(){return this._range}getActiveRange(){return this.id?this._editor.getModel().getDecorationRange(this.id):void 0}}const mW=class mW{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=jt.createDynamic(e);const t={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=jt.createDynamic(t);const i={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=jt.createDynamic(i)}updateHover(e){this._editor&&this._infos&&e!==this._lastHover&&this._doUpdate(this._editor,this._infos,e),this._lastHover=e??-1}updateSelection(e,t=new O(0,0,0,0)){this._lastSelection=t.isEmpty()?void 0:t,this._lastSelectionCursor=t.isEmpty()?void 0:e,this._editor&&this._infos&&this._doUpdate(this._editor,this._infos,e,t)}update(e,t,i,s){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,s))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===FG.description)}_doUpdate(e,t,i=-1,s=this._lastSelection){if(!e.getModel())return;i=this._lastSelectionCursor??i;const r=[];for(const c of t)c.commentingRanges.ranges.forEach(l=>{const d=new O(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=s?d.intersectRanges(s):void 0;if(s&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new O(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new O(h.endLineNumber,1,h.endLineNumber,1),h=new O(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,u,this.hoverDecorationOptions,c.commentingRanges,!0));const f=Math.min(u.startLineNumber,h.startLineNumber)-1,p=d.startLineNumber<=f,m=Math.max(u.endLineNumber,h.endLineNumber)+1,v=d.endLineNumber>=m;if(p){const w=new O(l.startLineNumber,1,f,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}if(v){const w=new O(m,1,l.endLineNumber,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}}else if(d.startLineNumber<=i&&i<=d.endLineNumber){if(d.startLineNumber{this.decorationIds=c.deltaDecorations(this.decorationIds,r),r.forEach((l,d)=>l.id=this.decorationIds[d])});const a=this.commentingRangeDecorations.length-r.length;this.commentingRangeDecorations=r,a&&this._onDidChangeDecorationsCount.fire(this.commentingRangeDecorations.length)}areRangesIntersectingOrTouchingByLine(e,t){return!(e.endLineNumbero.commentingRanges.fileComments);return s?s.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const s of this.commentingRangeDecorations){const o=s.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=s.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new O(o.startLineNumbera.range.endLineNumber?o.endLineNumber:a.range.endLineNumber,o.endColumn>a.range.endColumn?o.endColumn:a.range.endColumn);t.set(r.ownerId,{range:c,action:r})}else t.set(r.ownerId,{range:o,action:r})}}const i=new Set;return Array.from(t.values()).filter(s=>i.has(s.action.ownerId)?!1:(i.add(s.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,s;if(t){s=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)s.push(this.commentingRangeDecorations[o])}else s=this.commentingRangeDecorations;for(const o of s){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=O.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new O(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return s.length>0?s[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};mW.description="commenting-range-decorator";let Noe=mW;function _Yt(n,e,t,i,s,o,r,a,c){if(!i.resource)return;n.isCommentingEnabled||n.enableCommenting(!0);const l=i.range,d=a?Ty.None:Ty.Widget,h=e.activeTextEditorControl,u=ew(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=s?.uniqueIdInThread,m=P.parse(i.resource);for(const v of u){const w=v.getModel();if(w instanceof QU&&t.extUri.isEqual(m,w.uri)){f&&ja(v)&&Poe.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new O(1,1,1,1)}},c?Cw:wx).then(v=>{if(v){const w=v.getControl();f&&ja(w)&&Poe.get(w)?.revealCommentThread(f,p,!0,d)}})}let Poe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=s,this.contextMenuService=o,this.quickInputService=r,this.viewsService=a,this.configurationService=c,this.editorService=d,this.keybindingService=h,this.accessibilityService=u,this.globalToDispose=new Z,this.localToDispose=new Z,this.mouseDownInfo=null,this._commentingRangeSpaceReserved=!1,this._commentingRangeAmountReserved=0,this._emptyThreadsToAddQueue=[],this._inProcessContinueOnComments=new Map,this._editorDisposables=[],this._hasRespondedToEditorChange=!1,this._commentInfos=[],this._commentWidgets=[],this._pendingNewCommentCache={},this._pendingEditsCache={},this._computePromise=null,this._activeCursorHasCommentingRange=Qv.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=Qv.activeEditorHasCommentingRange.bindTo(l),!(e instanceof oC)&&(this.editor=e,this._commentingRangeDecorator=new Noe,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new a0e(this.commentService)),this.globalToDispose.add(this.commentService.onDidDeleteDataProvider(f=>{f?(delete this._pendingNewCommentCache[f],delete this._pendingEditsCache[f]):(this._pendingNewCommentCache={},this._pendingEditsCache={}),this.beginCompute()})),this.globalToDispose.add(this.commentService.onDidSetDataProvider(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidUpdateCommentingRanges(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidSetResourceCommentInfos(async f=>{const p=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;p&&p.toString()===f.resource.toString()&&await this.setComments(f.commentInfos.filter(m=>m!==null))})),this.globalToDispose.add(this.commentService.onDidChangeCommentingEnabled(f=>{f?(this.registerEditorListeners(),this.beginCompute()):(this.tryUpdateReservedSpace(),this.clearEditorListeners(),this._commentingRangeDecorator.update(this.editor,[]),this._commentThreadRangeDecorator.update(this.editor,[]),St(this._commentWidgets),this._commentWidgets=[])})),this.globalToDispose.add(this.editor.onWillChangeModel(f=>this.onWillChangeModel(f))),this.globalToDispose.add(this.editor.onDidChangeModel(f=>this.onModelChanged())),this.globalToDispose.add(this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("diffEditor.renderSideBySide")&&this.beginCompute()})),this.onModelChanged(),this.codeEditorService.registerDecorationType("comment-controller",brt,{}),this.globalToDispose.add(this.commentService.registerContinueOnCommentProvider({provideContinueOnComments:()=>{const f=[];if(this._commentWidgets)for(const p of this._commentWidgets){const v=p.getPendingComments().newComment;if(!v)continue;let w;if(p.commentThread.comments&&p.commentThread.comments.length){const b=p.commentThread.comments[p.commentThread.comments.length-1];typeof b.body=="string"?w=b.body:w=b.body.value}v!==w&&f.push({uniqueOwner:p.uniqueOwner,uri:p.editor.getModel().uri,range:p.commentThread.range,body:v,isReply:p.commentThread.comments!==void 0&&p.commentThread.comments.length>0})}return f}})))}registerEditorListeners(){this._editorDisposables=[],this.editor&&(this._editorDisposables.push(this.editor.onMouseMove(e=>this.onEditorMouseMove(e))),this._editorDisposables.push(this.editor.onMouseLeave(()=>this.onEditorMouseLeave())),this._editorDisposables.push(this.editor.onDidChangeCursorPosition(e=>this.onEditorChangeCursorPosition(e.position))),this._editorDisposables.push(this.editor.onDidFocusEditorWidget(()=>this.onEditorChangeCursorPosition(this.editor?.getPosition()??null))),this._editorDisposables.push(this.editor.onDidChangeCursorSelection(e=>this.onEditorChangeCursorSelection(e))),this._editorDisposables.push(this.editor.onDidBlurEditorWidget(()=>this.onEditorChangeCursorSelection())))}clearEditorListeners(){St(this._editorDisposables),this._editorDisposables=[]}onEditorMouseLeave(){this._commentingRangeDecorator.updateHover()}onEditorMouseMove(e){const t=e.target.position?.lineNumber;e.event.leftButton.valueOf()&&t&&this.mouseDownInfo?this._commentingRangeDecorator.updateSelection(t,new O(this.mouseDownInfo.lineNumber,1,t,1)):this._commentingRangeDecorator.updateHover(t)}onEditorChangeCursorSelection(e){const t=this.editor?.getPosition()?.lineNumber;t&&this._commentingRangeDecorator.updateSelection(t,e?.selection)}onEditorChangeCursorPosition(e){const t=e?this.editor?.getDecorationsInRange(O.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const s of t)if(s.options.description===FG.description){i=!1;break}else s.options.description===Noe.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===mz.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=na(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computePromise.then(async e=>{await this.setComments(Ui(e)),this._computePromise=null},e=>console.log(e))}beginComputeCommentingRanges(){this._computeCommentingRangeScheduler&&(this._computeCommentingRangePromise&&(this._computeCommentingRangePromise.cancel(),this._computeCommentingRangePromise=null),this._computeCommentingRangeScheduler.trigger(()=>{const e=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return e?this.commentService.getDocumentComments(e):Promise.resolve([])}).then(e=>{if(this.commentService.isCommentingEnabled){const t=Ui(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(bt(e),null)))}static get(e){return e.getContribution(mYt)}revealCommentThread(e,t,i,s){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,s):i&&(this._computePromise?this._computePromise.then(r=>{this.revealCommentThread(e,t,!1,s)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,s)}))}collapseAll(){for(const e of this._commentWidgets)e.collapse()}expandAll(){for(const e of this._commentWidgets)e.expand()}expandUnresolved(){for(const e of this._commentWidgets)e.commentThread.state===hg.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentWidgets.sort((r,a)=>{if(e){const c=r;r=a,a=c}return r.commentThread.range===void 0?-1:a.commentThread.range===void 0?1:r.commentThread.range.startLineNumbera.commentThread.range.startLineNumber?1:r.commentThread.range.startColumna.commentThread.range.startColumn?1:0}),s=bU(i,r=>{const a=e?t.lineNumber:r.commentThread.range?.startLineNumber??0,c=e?r.commentThread.range?.startLineNumber??0:t.lineNumber,l=e?t.column:r.commentThread.range?.startColumn??0,d=e?r.commentThread.range?.startColumn??0:t.column;return a>c?!0:ad});let o;s===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[s],this.editor.setSelection(o.commentThread.range??new O(1,1,1,1)),o.reveal(void 0,Ty.Widget)}previousCommentThread(){this._findNearestCommentThread(!0)}_findNearestCommentingRange(e){if(!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentingRangeDecorator.getNearestCommentingRange(t,e);if(i){const s=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(s),this.editor.revealLineInCenterIfOutsideViewport(s.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const s=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;s&&o&&Cu(s===o?g(rB,0,"Line {0}",s):g(rB,1,"Lines {0} to {1}",s,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),St(this._editorDisposables),St(this._commentWidgets),this.editor=null}onWillChangeModel(e){e.newModelUrl&&this.tryUpdateReservedSpace(e.newModelUrl)}async handleCommentAdded(e,t,i){if(this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.threadId===i.threadId).length)return;const o=this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.commentThreadHandle===-1&&O.equalsRange(h.commentThread.range,i.range));if(o.length){o[0].update(i);return}const r=this._inProcessContinueOnComments.get(t)?.findIndex(h=>h.range===void 0?i.range===void 0:O.lift(h.range).equalsRange(i.range));let a;r!==void 0&&r>=0&&(a=this._inProcessContinueOnComments.get(t)?.splice(r,1)[0].body);const c=(this._pendingNewCommentCache[t]&&this._pendingNewCommentCache[t][i.threadId])??a,l=this._pendingEditsCache[t]&&this._pendingEditsCache[t][i.threadId],d=i.canReply&&i.isTemplate&&(!i.comments||i.comments.length===0)&&(!i.editorId||i.editorId===e);await this.displayCommentThread(t,i,d,c,l),this._commentInfos.filter(h=>h.uniqueOwner===t)[0].threads.push(i),this.tryUpdateReservedSpace()}onModelChanged(){this.localToDispose.clear(),this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache(),this.editor&&(this._hasRespondedToEditorChange=!1,this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this._editorDisposables.length&&(this.clearEditorListeners(),this.registerEditorListeners()),this._computeCommentingRangeScheduler=new Lu(200),this.localToDispose.add({dispose:()=>{this._computeCommentingRangeScheduler?.cancel(),this._computeCommentingRangeScheduler=null}}),this.localToDispose.add(this.editor.onDidChangeModelContent(async()=>{this.beginComputeCommentingRanges()})),this.localToDispose.add(this.commentService.onDidUpdateCommentThreads(async e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;if(!t||!this.commentService.isCommentingEnabled)return;this._computePromise&&await this._computePromise;const i=this._commentInfos.filter(l=>l.uniqueOwner===e.uniqueOwner);if(!i||!i.length)return;const s=e.added.filter(l=>l.resource&&l.resource===t.toString()),o=e.removed.filter(l=>l.resource&&l.resource===t.toString()),r=e.changed.filter(l=>l.resource&&l.resource===t.toString()),a=e.pending.filter(l=>l.uri.toString()===t.toString());o.forEach(l=>{const d=this._commentWidgets.filter(u=>u.uniqueOwner===e.uniqueOwner&&u.commentThread.threadId===l.threadId&&u.commentThread.threadId!=="");if(d.length){const u=d[0],f=this._commentWidgets.indexOf(u);this._commentWidgets.splice(f,1),u.dispose()}const h=this._commentInfos.filter(u=>u.uniqueOwner===e.uniqueOwner)[0].threads;for(let u=0;uh.uniqueOwner===e.uniqueOwner&&h.commentThread.threadId===l.threadId);d.length&&(d[0].update(l),this.openCommentsView(l))}const c=this.editor?.getId();for(const l of s)await this.handleCommentAdded(c,e.uniqueOwner,l);for(const l of a)await this.resumePendingComment(t,l);this._commentThreadRangeDecorator.update(this.editor,i)})),this.beginComputeAndHandleEditorChange())}async resumePendingComment(e,t){const i=this._commentWidgets.filter(s=>s.uniqueOwner===t.uniqueOwner&&O.lift(s.commentThread.range)?.equalsRange(t.range));if(t.isReply&&i.length)this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!0}),i[0].setPendingComment(t.body);else if(i.length){this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1});const s=i[0].getPendingComments().newComment;let o;!s||t.body.includes(s)?o=t.body:s.includes(t.body)?o=s:o=`${s} -${t.body}`,i[0].setPendingComment(o)}else if(!t.isReply){if(!this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1}))return;this._inProcessContinueOnComments.has(t.uniqueOwner)||this._inProcessContinueOnComments.set(t.uniqueOwner,[]),this._inProcessContinueOnComments.get(t.uniqueOwner)?.push(t),await this.commentService.createCommentThreadTemplate(t.uniqueOwner,t.uri,t.range?O.lift(t.range):void 0)}}beginComputeAndHandleEditorChange(){this.beginCompute().then(()=>{if(!this._hasRespondedToEditorChange&&this._commentInfos.some(e=>e.commentingRanges.ranges.length>0||e.commentingRanges.fileComments))if(this._hasRespondedToEditorChange=!0,this.configurationService.getValue(ua.Comments)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getAriaLabel();Cu(t?g(rB,2,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(rB,3,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Cu(g(rB,4,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(aue).openView;if(t==="file")return this.viewsService.openView(Qd);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===hg.Unresolved)&&!this.viewsService.getViewWithId(Qd)?.hasRendered)return this.viewsService.openView(Qd)}}async displayCommentThread(e,t,i,s,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!s&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(r0e,this.editor,e,t,s??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=fYt(e)}onEditorMouseUp(e){const t=pYt(this.mouseDownInfo,e);if(this.mouseDownInfo=null,!this.editor||t===null||!e.target.element)return;const i=e.target.element.className.indexOf("comment-range-glyph")>=0,s=e.target.position.lineNumber;let o,r;t!==s?t>s?r=new O(t,this.editor.getModel().getLineLength(t)+1,s,1):r=new O(t,1,s,this.editor.getModel().getLineLength(s)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=s&&s<=r.endLineNumber?(o=r,this.editor.setSelection(new O(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new O(s,1,s,1)),o&&this.addOrToggleCommentAtLine(o,e)}async addOrToggleCommentAtLine(e,t){if(this._addInProgress)this._emptyThreadsToAddQueue.push([e,t]);else{this._addInProgress=!0;const i=this._commentWidgets.filter(s=>s.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const s=i.every(o=>o.expanded);i.forEach(s?o=>o.collapse():o=>o.expand()),this.processNextThreadToAdd();return}else this.addCommentAtLine(e,t)}}processNextThreadToAdd(){this._addInProgress=!1;const e=this._emptyThreadsToAddQueue.shift();e&&this.addOrToggleCommentAtLine(e[0],e[1])}clipUserRangeToCommentRange(e,t){return e.startLineNumbert.endLineNumber&&(e=new O(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)),e}addCommentAtLine(e,t){const i=this._commentingRangeDecorator.getMatchedCommentAction(e);if(!i.length||!this.editor?.hasModel()){if(this._addInProgress=!1,!i.length)throw new Error(`There are no commenting ranges at the current position (${e?"with range":"without range"}).`);return Promise.resolve()}if(i.length>1){if(t&&e)return this.contextMenuService.showContextMenu({getAnchor:()=>t.event,getActions:()=>this.getContextMenuActions(i,e),getActionsContext:()=>i.length?i[0]:void 0,onHide:()=>{this._addInProgress=!1}}),Promise.resolve();{const s=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(s,{placeHolder:g(rB,5,"Select Comment Provider"),matchOnDescription:!0}).then(o=>{if(!o)return;const r=i.filter(a=>a.action.ownerId===o.id);if(r.length){const{ownerId:a}=r[0].action,c=e&&r[0].range?this.clipUserRangeToCommentRange(e,r[0].range):e;this.addCommentAtLine2(c,a)}}).then(()=>{this._addInProgress=!1})}}else{const{ownerId:s}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,s)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:s,extensionId:o,label:r}=i.action;return{label:r??o??s,id:s}})}getContextMenuActions(e,t){const i=[];return e.forEach(s=>{const{ownerId:o,extensionId:r,label:a}=s.action;i.push(new xn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=s.range?this.clipUserRangeToCommentRange(t,s.range):t;return this.addCommentAtLine2(c,o),Promise.resolve()}))}),i}addCommentAtLine2(e,t){this.editor&&(this.commentService.createCommentThreadTemplate(t,this.editor.getModel().uri,e,this.editor.getId()),this.processNextThreadToAdd())}getExistingCommentEditorOptions(e){const t=e.getOption(x.lineDecorationsWidth);let i=[];const s=e.getRawOptions().extraEditorClassName;return s&&(i=s.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let s=i;const o=t.findIndex(a=>a==="inline-comment");o>=0&&t.splice(o,1);const r=e.getOptions();return r.get(x.folding)&&r.get(x.showFoldingControls)!=="never"&&(s+=11),s-=24,{extraEditorClassName:t,lineDecorationsWidth:s}}getWithCommentsLineDecorationWidth(e,t){let i=t;const s=e.getOptions();return s.get(x.folding)&&s.get(x.showFoldingControls)!=="never"&&(i-=11),i+=24,this._commentingRangeAmountReserved=i,this._commentingRangeAmountReserved}getWithCommentsEditorOptions(e,t,i){return t.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,i),extraEditorClassName:t}}updateEditorLayoutOptions(e,t,i){e.updateOptions({extraEditorClassName:t.join(" "),lineDecorationsWidth:i})}ensureCommentingRangeReservedAmount(e){const t=this.getExistingCommentEditorOptions(e);t.lineDecorationsWidth!==this._commentingRangeAmountReserved&&e.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,t.lineDecorationsWidth)})}tryUpdateReservedSpace(e){if(!this.editor)return;const t=this._commentInfos.some(o=>!!(o.commentingRanges&&(Array.isArray(o.commentingRanges)?o.commentingRanges:o.commentingRanges.ranges).length)||o.threads.length>0);e=e??this.editor.getModel()?.uri;const i=e?this.commentService.resourceHasCommentingRanges(e):!1,s=t||i;if(s&&this.commentService.isCommentingEnabled)if(this._commentingRangeSpaceReserved)this.ensureCommentingRangeReservedAmount(this.editor);else{this._commentingRangeSpaceReserved=!0;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}else if((!s||!this.commentService.isCommentingEnabled)&&this._commentingRangeSpaceReserved){this._commentingRangeSpaceReserved=!1;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithoutCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}}async setComments(e){if(!this.editor||!this.commentService.isCommentingEnabled)return;this._commentInfos=e,this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache();let t=!1;for(const i of this._commentInfos){!t&&(i.commentingRanges.ranges.length>0||i.commentingRanges.fileComments)&&(t=!0);const s=this._pendingNewCommentCache[i.uniqueOwner],o=this._pendingEditsCache[i.uniqueOwner];i.threads=i.threads.filter(r=>!r.isDisposed);for(const r of i.threads){let a;s&&(a=s[r.threadId]);let c;o&&(c=o[r.threadId]),await this.displayCommentThread(i.uniqueOwner,r,!1,a,c)}for(const r of i.pendingCommentThreads??[])this.resumePendingComment(this.editor.getModel().uri,r)}this._commentingRangeDecorator.update(this.editor,this._commentInfos),this._commentThreadRangeDecorator.update(this.editor,this._commentInfos),t?this._activeEditorHasCommentingRange.set(!0):this._activeEditorHasCommentingRange.set(!1)}closeWidget(){this._commentWidgets?.forEach(e=>e.hide()),this.editor&&(this.editor.focus(),this.editor.revealRangeInCenter(this.editor.getSelection()))}removeCommentWidgetsAndStoreCache(){this._commentWidgets&&this._commentWidgets.forEach(e=>{const t=e.getPendingComments(),i=t.newComment,s=this._pendingNewCommentCache[e.uniqueOwner];let o;if(e.commentThread.comments&&e.commentThread.comments.length){const c=e.commentThread.comments[e.commentThread.comments.length-1];typeof c.body=="string"?o=c.body:o=c.body.value}i&&i!==o?(s||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):s&&delete s[e.commentThread.threadId];const r=t.edits,a=this._pendingEditsCache[e.uniqueOwner];Object.keys(r).length>0?(a||(this._pendingEditsCache[e.uniqueOwner]={}),this._pendingEditsCache[e.uniqueOwner][e.commentThread.threadId]=r):a&&delete a[e.commentThread.threadId],e.dispose()}),this._commentWidgets=[]}};Poe=D([_(1,sD),_(2,be),_(3,Qt),_(4,Vr),_(5,On),_(6,q_),_(7,Re),_(8,Pe),_(9,_i),_(10,ti),_(11,Ur)],Poe);const Bm="vs/workbench/contrib/comments/browser/commentsView",vYt=new Y("commentsView.hasComments",!1),wYt=new Y("commentsView.someCommentsExpanded",!1),bYt="commentsViewState";function p9e(n){return fi.map(n.resourceCommentThreads,e=>{const t=fi.from(e.commentThreads),i=fi.map(t,s=>({element:s}));return{element:e,children:i}})}let c0e=class extends hEe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Ly)return e[0]}get focusedCommentInfo(){if(this.focusedCommentNode)return this.getScreenReaderInfoForNode(this.focusedCommentNode)}focusNextNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).next();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).next();t&&this.tree.setFocus([t])}focusPreviousNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).previous();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){const v=new W1(bYt,m),w=v.getMemento(ke.WORKSPACE,ln.MACHINE);super({...e,filterOptions:{placeholder:g(Bm,0,"Filter (e.g. text, author)"),ariaLabel:g(Bm,1,"Filter comments"),history:w.filterHistory||[],text:w.filter||"",focusContextKey:ROe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=s,this.commentService=h,this.uriIdentityService=p,this.totalComments=0,this.currentHeight=0,this.currentWidth=0,this.cachedFilterStats=void 0,this.onDidChangeVisibility=this.onDidChangeBodyVisibility,this.hasCommentsContextKey=vYt.bindTo(r),this.someCommentsExpandedContextKey=wYt.bindTo(r),this.stateMemento=v,this.viewState=w,this.filters=this._register(new sYt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new nYt(new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(b=>{(b.showResolved||b.showUnresolved)&&this.updateFilter()})),this._register(this.filterWidget.onDidChangeFilterText(()=>this.updateFilter()))}saveState(){this.viewState.filter=this.filterWidget.getFilterText(),this.viewState.filterHistory=this.filterWidget.getHistory(),this.viewState.showResolved=this.filters.showResolved,this.viewState.showUnresolved=this.filters.showUnresolved,this.stateMemento.saveMemento(),super.saveState()}render(){super.render(),this._register(Crt({name:"commentsView",focusNotifiers:[this,this.filterWidget],focusNextWidget:()=>{this.filterWidget.hasFocus()&&this.focus()},focusPreviousWidget:()=>{this.filterWidget.hasFocus()||this.focusFilter()}}))}focusFilter(){this.filterWidget.focus()}clearFilterText(){this.filterWidget.setFilterText("")}getFilterStats(){return this.cachedFilterStats||(this.cachedFilterStats={total:this.totalComments,filtered:this.tree?.getVisibleItemCount()??0}),this.cachedFilterStats}updateFilter(){this.filter.options=new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved),this.tree?.filterComments(),this.cachedFilterStats=void 0;const{total:e,filtered:t}=this.getFilterStats();this.filterWidget.updateBadge(e===t||e===0?void 0:g(Bm,2,"Showing {0} of {1}",t,e)),this.filterWidget.checkMoreFilters(!this.filters.showResolved||!this.filters.showUnresolved)}renderBody(e){super.renderBody(e),e.classList.add("comments-panel");const t=he(e,we(".comments-panel-container"));this.treeContainer=he(t,we(".tree-container")),this.treeContainer.classList.add("file-icon-themable-tree","show-file-icons"),this.cachedFilterStats=void 0,this.createTree(),this.createMessageBox(t),this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged,this)),this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated,this)),this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted,this)),this._register(this.onDidChangeBodyVisibility(i=>{i&&this.refresh()})),this.renderComments()}focus(){super.focus();const e=this.tree?.getHTMLElement();e&&kw(e)||(!this.commentService.commentsModel.hasCommentThreads()&&this.messageBoxContainer?this.messageBoxContainer.focus():this.tree&&this.tree.domFocus())}async renderComments(){this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.renderMessage(),await this.tree?.setChildren(null,p9e(this.commentService.commentsModel))}collapseAll(){this.tree&&(this.tree.collapseAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}expandAll(){this.tree&&(this.tree.expandAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}get hasRendered(){return!!this.tree}layoutBodyContent(e=this.currentHeight,t=this.currentWidth){this.messageBoxContainer&&(this.messageBoxContainer.style.height=`${e}px`),this.tree?.layout(e,t),this.currentHeight=e,this.currentWidth=t}createMessageBox(e){this.messageBoxContainer=he(e,we(".message-box-container")),this.messageBoxContainer.setAttribute("tabIndex","0")}renderMessage(){this.messageBoxContainer.textContent=this.commentService.commentsModel.getMessage(),this.messageBoxContainer.classList.toggle("hidden",this.commentService.commentsModel.hasCommentThreads())}getScreenReaderInfoForNode(e,t){let i="";if(t&&this.configurationService.getValue(ua.Comments)){const r=this.keybindingService.lookupKeybinding(HPt.id)?.getAriaLabel();i=r?g(Bm,3,`Inspect this in the accessible view ({0}). +`),this._commentReply?.setCommentEditorDecorations()}};o0e=D([_(12,sD),_(13,Vr),_(14,Re),_(15,ti)],o0e);function g9e(n,e){return XKt(n,e)??e.getColor($Pe)}var Ty;(function(n){n[n.None=0]="None",n[n.Widget=1]="Widget",n[n.Editor=2]="Editor"})(Ty||(Ty={}));function fYt(n){const e=n.target.range;if(!e||!n.event.leftButton||n.target.type!==Mt.GUTTER_LINE_DECORATIONS)return null;const t=n.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function pYt(n,e){if(!n)return null;const{lineNumber:t}=n;return e.target.range?t:null}let r0e=class extends UPe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,s,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=s,this._pendingEdits=o,this.themeService=a,this.commentService=c,this.configurationService=d,this._onDidClose=new I,this._onDidCreateThread=new I,this._globalToDispose=new Z,this._commentThreadDisposables=[],this._contextKeyService=l.createScoped(this.domNode),this._scopedInstantiationService=r.createChild(new Dl([Pe,this._contextKeyService]));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=s?zl.Expanded:i.initialCollapsibleState,i.initialCollapsibleState=this._initialCollapsibleState,this._commentThreadDisposables=[],this.create(),this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme,this)),this._globalToDispose.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(x.fontInfo)&&this._applyTheme(this.themeService.getColorTheme())})),this._applyTheme(this.themeService.getColorTheme())}get onDidClose(){return this._onDidClose.event}get onDidCreateThread(){return this._onDidCreateThread.event}getPosition(){if(this.position)return this.position;if(this._commentGlyph)return this._commentGlyph.getPosition().position??void 0}revealRange(){}reveal(e,t=Ty.None){if(this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2),e!==void 0){const s=this.editor.getLayoutInfo().height,o=this._commentThreadWidget.getCommentCoords(e);if(o){let r=1;if(this._commentThread.range){const a=o.thread,c=o.comment;r=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-s/2+c.top-a.top}this.editor.setScrollTop(r),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor();return}}const i=this._commentThread.range?new O(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new O(1,1,1,1);this.editor.revealRangeInCenter(i),t===Ty.Widget?this._commentThreadWidget.focus():t===Ty.Editor&&this._commentThreadWidget.focusCommentEditor()}getPendingComments(){return{newComment:this._commentThreadWidget.getPendingComment(),edits:this._commentThreadWidget.getPendingEdits()}}setPendingComment(e){this._pendingComment=e,this.expand(),this._commentThreadWidget.setPendingComment(e)}_fillContainer(e){this.setCssClass("review-widget"),this._commentThreadWidget=this._scopedInstantiationService.createInstance(o0e,e,this.editor,this._uniqueOwner,this.editor.getModel().uri,this._contextKeyService,this._scopedInstantiationService,this._commentThread,this._pendingComment,this._pendingEdits,{editor:this.editor,codeBlockFontSize:"",codeBlockFontFamily:this.configurationService.getValue("editor").fontFamily||Gh.fontFamily},this._commentOptions,{actionRunner:async()=>{if(!this._commentThread.comments||!this._commentThread.comments.length){const t=this.getPosition();if(t){const i=this._commentThread.range;if(!i)return;let s;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;s=new O(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else s=new O(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,s)}}},collapse:()=>{this.collapse()}}),this._disposables.add(this._commentThreadWidget)}arrowPosition(e){if(e)return{lineNumber:e.endLineNumber,column:e.endLineNumber===e.startLineNumber?(e.startColumn+e.endColumn+1)/2:1}}deleteCommentThread(){this.dispose(),this.commentService.disposeCommentThread(this.uniqueOwner,this._commentThread.threadId)}collapse(){this._commentThread.collapsibleState=zl.Collapsed}expand(){this._commentThread.collapsibleState=zl.Expanded}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=zl.Collapsed:this._commentThread.collapsibleState=zl.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(s=>s.dispose()),this._commentThread=e,this._commentThreadDisposables=[],this.bindCommentThreadListeners()),await this._commentThreadWidget.updateCommentThread(e);const t=this._commentThread.range?.endLineNumber??1;let i=!1;this._commentGlyph&&(this._commentGlyph.setThreadState(e.state),this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t))),i&&this._isExpanded||this._commentThread.collapsibleState===zl.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==zl.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new FG(this.editor,e?.endLineNumber??-1),this._commentGlyph.setThreadState(this._commentThread.state)),await this._commentThreadWidget.display(this.editor.getOption(x.lineHeight),t),this._disposables.add(this._commentThreadWidget.onDidResize(i=>{this._refresh(i)})),(this._commentThread.collapsibleState===zl.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.reveal(),this.bindCommentThreadListeners()}bindCommentThreadListeners(){if(this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async e=>{await this.update(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(e=>{const t=this._commentThread.range?.startLineNumber??1;let i=!1;this._commentGlyph&&this._commentGlyph.getPosition().position.lineNumber!==t&&(i=!0,this._commentGlyph.setLineNumber(t)),i&&this._isExpanded&&this.show(this.arrowPosition(this._commentThread.range),2)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(e=>{if(e===zl.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2);return}if(e===zl.Collapsed&&this._isExpanded){this.hide();return}})),this._initialCollapsibleState===void 0){const e=this._commentThread.onDidChangeInitialCollapsibleState(t=>{this._initialCollapsibleState=t,this._commentThread.collapsibleState=this._initialCollapsibleState,e.dispose()});this._commentThreadDisposables.push(e)}this._commentThreadDisposables.push(this._commentThread.onDidChangeState(()=>{const e=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(prt,`${e}`),this.container?.style.setProperty(mrt,`${e.transparent(.1)}`)}))}async submitComment(){return this._commentThreadWidget.submitComment()}_refresh(e){if(this._isExpanded===void 0&&e.height===0&&e.width===0){this.commentThread.collapsibleState=zl.Collapsed;return}if(this._isExpanded){this._commentThreadWidget.layout();const t=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),i=this.editor.getOption(x.lineHeight),s=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+s+o+8)/i);if(this._viewZone?.heightInLines===r)return;const a=this.getPosition();this._viewZone&&a&&a.lineNumber!==this._viewZone.afterLineNumber&&this._viewZone.afterLineNumber!==0&&(this._viewZone.afterLineNumber=a.lineNumber);const c=M_.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=g9e(this._commentThread.state,this.themeService.getColorTheme())||fe.transparent;this.style({arrowColor:t,frameColor:t});const i=this.editor.getOption(x.fontInfo);this._commentThreadWidget.applyTheme(e,i)}show(e,t){const i=this._commentGlyph?.getPosition();let s=O.isIRange(e)?e:e?O.fromPositions(e):void 0;if(i?.position&&s&&i.position.lineNumber!==s.endLineNumber){const o=i.position.lineNumber-s.endLineNumber;s=new O(s.startLineNumber+o,s.startColumn,s.endLineNumber+o,s.endColumn)}this._isExpanded=!0,super.show(s??new O(0,0,0,0),t),this._commentThread.collapsibleState=zl.Expanded,this._refresh(this._commentThreadWidget.getDimensions())}hide(){this._isExpanded&&(this._isExpanded=!1,this.editor.hasWidgetFocus()&&this.editor.focus(),(!this._commentThread.comments||!this._commentThread.comments.length)&&this.deleteCommentThread()),super.hide()}dispose(){super.dispose(),this._commentGlyph&&(this._commentGlyph.dispose(),this._commentGlyph=void 0),this._globalToDispose.dispose(),this._commentThreadDisposables.forEach(e=>e.dispose()),this._onDidClose.fire(void 0)}};r0e=D([_(5,be),_(6,pn),_(7,sD),_(8,Pe),_(9,Re)],r0e);class f9e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const c9=class c9 extends ${constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=Kt.createDynamic(t);const i={description:c9.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=Kt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(s=>{this.updateCurrent(s)})),this._register(e.onDidUpdateCommentThreads(()=>{this.updateCurrent(void 0)}))}updateCurrent(e){if(!this.editor||e?.resource&&e.resource?.toString()!==this.editor.getModel()?.uri.toString())return;this.currentThreadCollapseStateListener?.dispose();const t=[];if(e){const i=e.range;i&&!(i.startLineNumber===i.endLineNumber&&i.startColumn===i.endColumn)&&e.collapsibleState===zl.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(s=>{s===zl.Collapsed&&this.updateCurrent(void 0)}),t.push(new f9e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((s,o)=>s.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;St(this.threadCollapseStateListeners),this.editor=e;const s=[];for(const o of t)o.threads.forEach(r=>{if(r.isDisposed)return;const a=r.range;!a||a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn||(this.threadCollapseStateListeners.push(r.onDidChangeCollapsibleState(()=>{this.update(e,t)})),r.collapsibleState!==zl.Collapsed&&s.push(new f9e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,s),s.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){St(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};c9.description="comment-thread-range-decorator";let a0e=c9;const rB="vs/workbench/contrib/comments/browser/commentsController",mYt="editor.contrib.review";class CD{get id(){return this._decorationId}set id(e){this._decorationId=e}get range(){return{startLineNumber:this._startLineNumber,startColumn:1,endLineNumber:this._endLineNumber,endColumn:1}}constructor(e,t,i,s,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=s,this._range=o,this.options=r,this.commentingRangesInfo=a,this.isHover=c,this._startLineNumber=o.startLineNumber,this._endLineNumber=o.endLineNumber}getCommentAction(){return{extensionId:this._extensionId,label:this._label,ownerId:this._ownerId,commentingRangesInfo:this.commentingRangesInfo}}getOriginalRange(){return this._range}getActiveRange(){return this.id?this._editor.getModel().getDecorationRange(this.id):void 0}}const mW=class mW{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=Kt.createDynamic(e);const t={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=Kt.createDynamic(t);const i={description:mW.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=Kt.createDynamic(i)}updateHover(e){this._editor&&this._infos&&e!==this._lastHover&&this._doUpdate(this._editor,this._infos,e),this._lastHover=e??-1}updateSelection(e,t=new O(0,0,0,0)){this._lastSelection=t.isEmpty()?void 0:t,this._lastSelectionCursor=t.isEmpty()?void 0:e,this._editor&&this._infos&&this._doUpdate(this._editor,this._infos,e,t)}update(e,t,i,s){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,s))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===FG.description)}_doUpdate(e,t,i=-1,s=this._lastSelection){if(!e.getModel())return;i=this._lastSelectionCursor??i;const r=[];for(const c of t)c.commentingRanges.ranges.forEach(l=>{const d=new O(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=s?d.intersectRanges(s):void 0;if(s&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new O(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new O(h.endLineNumber,1,h.endLineNumber,1),h=new O(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,u,this.hoverDecorationOptions,c.commentingRanges,!0));const f=Math.min(u.startLineNumber,h.startLineNumber)-1,p=d.startLineNumber<=f,m=Math.max(u.endLineNumber,h.endLineNumber)+1,v=d.endLineNumber>=m;if(p){const w=new O(l.startLineNumber,1,f,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}if(v){const w=new O(m,1,l.endLineNumber,1);r.push(new CD(e,c.uniqueOwner,c.extensionId,c.label,w,this.decorationOptions,c.commentingRanges,!0))}}else if(d.startLineNumber<=i&&i<=d.endLineNumber){if(d.startLineNumber{this.decorationIds=c.deltaDecorations(this.decorationIds,r),r.forEach((l,d)=>l.id=this.decorationIds[d])});const a=this.commentingRangeDecorations.length-r.length;this.commentingRangeDecorations=r,a&&this._onDidChangeDecorationsCount.fire(this.commentingRangeDecorations.length)}areRangesIntersectingOrTouchingByLine(e,t){return!(e.endLineNumbero.commentingRanges.fileComments);return s?s.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const s of this.commentingRangeDecorations){const o=s.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=s.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new O(o.startLineNumbera.range.endLineNumber?o.endLineNumber:a.range.endLineNumber,o.endColumn>a.range.endColumn?o.endColumn:a.range.endColumn);t.set(r.ownerId,{range:c,action:r})}else t.set(r.ownerId,{range:o,action:r})}}const i=new Set;return Array.from(t.values()).filter(s=>i.has(s.action.ownerId)?!1:(i.add(s.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,s;if(t){s=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)s.push(this.commentingRangeDecorations[o])}else s=this.commentingRangeDecorations;for(const o of s){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=O.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new O(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return s.length>0?s[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};mW.description="commenting-range-decorator";let Noe=mW;function _Yt(n,e,t,i,s,o,r,a,c){if(!i.resource)return;n.isCommentingEnabled||n.enableCommenting(!0);const l=i.range,d=a?Ty.None:Ty.Widget,h=e.activeTextEditorControl,u=ew(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=s?.uniqueIdInThread,m=P.parse(i.resource);for(const v of u){const w=v.getModel();if(w instanceof QU&&t.extUri.isEqual(m,w.uri)){f&&ja(v)&&Poe.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new O(1,1,1,1)}},c?Cw:wx).then(v=>{if(v){const w=v.getControl();f&&ja(w)&&Poe.get(w)?.revealCommentThread(f,p,!0,d)}})}let Poe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=s,this.contextMenuService=o,this.quickInputService=r,this.viewsService=a,this.configurationService=c,this.editorService=d,this.keybindingService=h,this.accessibilityService=u,this.globalToDispose=new Z,this.localToDispose=new Z,this.mouseDownInfo=null,this._commentingRangeSpaceReserved=!1,this._commentingRangeAmountReserved=0,this._emptyThreadsToAddQueue=[],this._inProcessContinueOnComments=new Map,this._editorDisposables=[],this._hasRespondedToEditorChange=!1,this._commentInfos=[],this._commentWidgets=[],this._pendingNewCommentCache={},this._pendingEditsCache={},this._computePromise=null,this._activeCursorHasCommentingRange=Qv.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=Qv.activeEditorHasCommentingRange.bindTo(l),!(e instanceof oC)&&(this.editor=e,this._commentingRangeDecorator=new Noe,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new a0e(this.commentService)),this.globalToDispose.add(this.commentService.onDidDeleteDataProvider(f=>{f?(delete this._pendingNewCommentCache[f],delete this._pendingEditsCache[f]):(this._pendingNewCommentCache={},this._pendingEditsCache={}),this.beginCompute()})),this.globalToDispose.add(this.commentService.onDidSetDataProvider(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidUpdateCommentingRanges(f=>this.beginComputeAndHandleEditorChange())),this.globalToDispose.add(this.commentService.onDidSetResourceCommentInfos(async f=>{const p=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;p&&p.toString()===f.resource.toString()&&await this.setComments(f.commentInfos.filter(m=>m!==null))})),this.globalToDispose.add(this.commentService.onDidChangeCommentingEnabled(f=>{f?(this.registerEditorListeners(),this.beginCompute()):(this.tryUpdateReservedSpace(),this.clearEditorListeners(),this._commentingRangeDecorator.update(this.editor,[]),this._commentThreadRangeDecorator.update(this.editor,[]),St(this._commentWidgets),this._commentWidgets=[])})),this.globalToDispose.add(this.editor.onWillChangeModel(f=>this.onWillChangeModel(f))),this.globalToDispose.add(this.editor.onDidChangeModel(f=>this.onModelChanged())),this.globalToDispose.add(this.configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("diffEditor.renderSideBySide")&&this.beginCompute()})),this.onModelChanged(),this.codeEditorService.registerDecorationType("comment-controller",brt,{}),this.globalToDispose.add(this.commentService.registerContinueOnCommentProvider({provideContinueOnComments:()=>{const f=[];if(this._commentWidgets)for(const p of this._commentWidgets){const v=p.getPendingComments().newComment;if(!v)continue;let w;if(p.commentThread.comments&&p.commentThread.comments.length){const b=p.commentThread.comments[p.commentThread.comments.length-1];typeof b.body=="string"?w=b.body:w=b.body.value}v!==w&&f.push({uniqueOwner:p.uniqueOwner,uri:p.editor.getModel().uri,range:p.commentThread.range,body:v,isReply:p.commentThread.comments!==void 0&&p.commentThread.comments.length>0})}return f}})))}registerEditorListeners(){this._editorDisposables=[],this.editor&&(this._editorDisposables.push(this.editor.onMouseMove(e=>this.onEditorMouseMove(e))),this._editorDisposables.push(this.editor.onMouseLeave(()=>this.onEditorMouseLeave())),this._editorDisposables.push(this.editor.onDidChangeCursorPosition(e=>this.onEditorChangeCursorPosition(e.position))),this._editorDisposables.push(this.editor.onDidFocusEditorWidget(()=>this.onEditorChangeCursorPosition(this.editor?.getPosition()??null))),this._editorDisposables.push(this.editor.onDidChangeCursorSelection(e=>this.onEditorChangeCursorSelection(e))),this._editorDisposables.push(this.editor.onDidBlurEditorWidget(()=>this.onEditorChangeCursorSelection())))}clearEditorListeners(){St(this._editorDisposables),this._editorDisposables=[]}onEditorMouseLeave(){this._commentingRangeDecorator.updateHover()}onEditorMouseMove(e){const t=e.target.position?.lineNumber;e.event.leftButton.valueOf()&&t&&this.mouseDownInfo?this._commentingRangeDecorator.updateSelection(t,new O(this.mouseDownInfo.lineNumber,1,t,1)):this._commentingRangeDecorator.updateHover(t)}onEditorChangeCursorSelection(e){const t=this.editor?.getPosition()?.lineNumber;t&&this._commentingRangeDecorator.updateSelection(t,e?.selection)}onEditorChangeCursorPosition(e){const t=e?this.editor?.getDecorationsInRange(O.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const s of t)if(s.options.description===FG.description){i=!1;break}else s.options.description===Noe.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===mz.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=na(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computePromise.then(async e=>{await this.setComments(Ui(e)),this._computePromise=null},e=>console.log(e))}beginComputeCommentingRanges(){this._computeCommentingRangeScheduler&&(this._computeCommentingRangePromise&&(this._computeCommentingRangePromise.cancel(),this._computeCommentingRangePromise=null),this._computeCommentingRangeScheduler.trigger(()=>{const e=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return e?this.commentService.getDocumentComments(e):Promise.resolve([])}).then(e=>{if(this.commentService.isCommentingEnabled){const t=Ui(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(bt(e),null)))}static get(e){return e.getContribution(mYt)}revealCommentThread(e,t,i,s){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,s):i&&(this._computePromise?this._computePromise.then(r=>{this.revealCommentThread(e,t,!1,s)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,s)}))}collapseAll(){for(const e of this._commentWidgets)e.collapse()}expandAll(){for(const e of this._commentWidgets)e.expand()}expandUnresolved(){for(const e of this._commentWidgets)e.commentThread.state===hg.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentWidgets.sort((r,a)=>{if(e){const c=r;r=a,a=c}return r.commentThread.range===void 0?-1:a.commentThread.range===void 0?1:r.commentThread.range.startLineNumbera.commentThread.range.startLineNumber?1:r.commentThread.range.startColumna.commentThread.range.startColumn?1:0}),s=bU(i,r=>{const a=e?t.lineNumber:r.commentThread.range?.startLineNumber??0,c=e?r.commentThread.range?.startLineNumber??0:t.lineNumber,l=e?t.column:r.commentThread.range?.startColumn??0,d=e?r.commentThread.range?.startColumn??0:t.column;return a>c?!0:ad});let o;s===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[s],this.editor.setSelection(o.commentThread.range??new O(1,1,1,1)),o.reveal(void 0,Ty.Widget)}previousCommentThread(){this._findNearestCommentThread(!0)}_findNearestCommentingRange(e){if(!this.editor?.hasModel())return;const t=this.editor.getSelection().getEndPosition(),i=this._commentingRangeDecorator.getNearestCommentingRange(t,e);if(i){const s=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(s),this.editor.revealLineInCenterIfOutsideViewport(s.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const s=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;s&&o&&Cu(s===o?g(rB,0,"Line {0}",s):g(rB,1,"Lines {0} to {1}",s,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),St(this._editorDisposables),St(this._commentWidgets),this.editor=null}onWillChangeModel(e){e.newModelUrl&&this.tryUpdateReservedSpace(e.newModelUrl)}async handleCommentAdded(e,t,i){if(this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.threadId===i.threadId).length)return;const o=this._commentWidgets.filter(h=>h.uniqueOwner===t&&h.commentThread.commentThreadHandle===-1&&O.equalsRange(h.commentThread.range,i.range));if(o.length){o[0].update(i);return}const r=this._inProcessContinueOnComments.get(t)?.findIndex(h=>h.range===void 0?i.range===void 0:O.lift(h.range).equalsRange(i.range));let a;r!==void 0&&r>=0&&(a=this._inProcessContinueOnComments.get(t)?.splice(r,1)[0].body);const c=(this._pendingNewCommentCache[t]&&this._pendingNewCommentCache[t][i.threadId])??a,l=this._pendingEditsCache[t]&&this._pendingEditsCache[t][i.threadId],d=i.canReply&&i.isTemplate&&(!i.comments||i.comments.length===0)&&(!i.editorId||i.editorId===e);await this.displayCommentThread(t,i,d,c,l),this._commentInfos.filter(h=>h.uniqueOwner===t)[0].threads.push(i),this.tryUpdateReservedSpace()}onModelChanged(){this.localToDispose.clear(),this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache(),this.editor&&(this._hasRespondedToEditorChange=!1,this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this._editorDisposables.length&&(this.clearEditorListeners(),this.registerEditorListeners()),this._computeCommentingRangeScheduler=new Lu(200),this.localToDispose.add({dispose:()=>{this._computeCommentingRangeScheduler?.cancel(),this._computeCommentingRangeScheduler=null}}),this.localToDispose.add(this.editor.onDidChangeModelContent(async()=>{this.beginComputeCommentingRanges()})),this.localToDispose.add(this.commentService.onDidUpdateCommentThreads(async e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;if(!t||!this.commentService.isCommentingEnabled)return;this._computePromise&&await this._computePromise;const i=this._commentInfos.filter(l=>l.uniqueOwner===e.uniqueOwner);if(!i||!i.length)return;const s=e.added.filter(l=>l.resource&&l.resource===t.toString()),o=e.removed.filter(l=>l.resource&&l.resource===t.toString()),r=e.changed.filter(l=>l.resource&&l.resource===t.toString()),a=e.pending.filter(l=>l.uri.toString()===t.toString());o.forEach(l=>{const d=this._commentWidgets.filter(u=>u.uniqueOwner===e.uniqueOwner&&u.commentThread.threadId===l.threadId&&u.commentThread.threadId!=="");if(d.length){const u=d[0],f=this._commentWidgets.indexOf(u);this._commentWidgets.splice(f,1),u.dispose()}const h=this._commentInfos.filter(u=>u.uniqueOwner===e.uniqueOwner)[0].threads;for(let u=0;uh.uniqueOwner===e.uniqueOwner&&h.commentThread.threadId===l.threadId);d.length&&(d[0].update(l),this.openCommentsView(l))}const c=this.editor?.getId();for(const l of s)await this.handleCommentAdded(c,e.uniqueOwner,l);for(const l of a)await this.resumePendingComment(t,l);this._commentThreadRangeDecorator.update(this.editor,i)})),this.beginComputeAndHandleEditorChange())}async resumePendingComment(e,t){const i=this._commentWidgets.filter(s=>s.uniqueOwner===t.uniqueOwner&&O.lift(s.commentThread.range)?.equalsRange(t.range));if(t.isReply&&i.length)this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!0}),i[0].setPendingComment(t.body);else if(i.length){this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1});const s=i[0].getPendingComments().newComment;let o;!s||t.body.includes(s)?o=t.body:s.includes(t.body)?o=s:o=`${s} +${t.body}`,i[0].setPendingComment(o)}else if(!t.isReply){if(!this.commentService.removeContinueOnComment({uniqueOwner:t.uniqueOwner,uri:e,range:t.range,isReply:!1}))return;this._inProcessContinueOnComments.has(t.uniqueOwner)||this._inProcessContinueOnComments.set(t.uniqueOwner,[]),this._inProcessContinueOnComments.get(t.uniqueOwner)?.push(t),await this.commentService.createCommentThreadTemplate(t.uniqueOwner,t.uri,t.range?O.lift(t.range):void 0)}}beginComputeAndHandleEditorChange(){this.beginCompute().then(()=>{if(!this._hasRespondedToEditorChange&&this._commentInfos.some(e=>e.commentingRanges.ranges.length>0||e.commentingRanges.fileComments))if(this._hasRespondedToEditorChange=!0,this.configurationService.getValue(ua.Comments)){const t=this.keybindingService.lookupKeybinding(Ru.OpenAccessibilityHelp)?.getAriaLabel();Cu(t?g(rB,2,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(rB,3,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Cu(g(rB,4,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(aue).openView;if(t==="file")return this.viewsService.openView(Qd);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===hg.Unresolved)&&!this.viewsService.getViewWithId(Qd)?.hasRendered)return this.viewsService.openView(Qd)}}async displayCommentThread(e,t,i,s,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!s&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(r0e,this.editor,e,t,s??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=fYt(e)}onEditorMouseUp(e){const t=pYt(this.mouseDownInfo,e);if(this.mouseDownInfo=null,!this.editor||t===null||!e.target.element)return;const i=e.target.element.className.indexOf("comment-range-glyph")>=0,s=e.target.position.lineNumber;let o,r;t!==s?t>s?r=new O(t,this.editor.getModel().getLineLength(t)+1,s,1):r=new O(t,1,s,this.editor.getModel().getLineLength(s)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=s&&s<=r.endLineNumber?(o=r,this.editor.setSelection(new O(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new O(s,1,s,1)),o&&this.addOrToggleCommentAtLine(o,e)}async addOrToggleCommentAtLine(e,t){if(this._addInProgress)this._emptyThreadsToAddQueue.push([e,t]);else{this._addInProgress=!0;const i=this._commentWidgets.filter(s=>s.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const s=i.every(o=>o.expanded);i.forEach(s?o=>o.collapse():o=>o.expand()),this.processNextThreadToAdd();return}else this.addCommentAtLine(e,t)}}processNextThreadToAdd(){this._addInProgress=!1;const e=this._emptyThreadsToAddQueue.shift();e&&this.addOrToggleCommentAtLine(e[0],e[1])}clipUserRangeToCommentRange(e,t){return e.startLineNumbert.endLineNumber&&(e=new O(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)),e}addCommentAtLine(e,t){const i=this._commentingRangeDecorator.getMatchedCommentAction(e);if(!i.length||!this.editor?.hasModel()){if(this._addInProgress=!1,!i.length)throw new Error(`There are no commenting ranges at the current position (${e?"with range":"without range"}).`);return Promise.resolve()}if(i.length>1){if(t&&e)return this.contextMenuService.showContextMenu({getAnchor:()=>t.event,getActions:()=>this.getContextMenuActions(i,e),getActionsContext:()=>i.length?i[0]:void 0,onHide:()=>{this._addInProgress=!1}}),Promise.resolve();{const s=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(s,{placeHolder:g(rB,5,"Select Comment Provider"),matchOnDescription:!0}).then(o=>{if(!o)return;const r=i.filter(a=>a.action.ownerId===o.id);if(r.length){const{ownerId:a}=r[0].action,c=e&&r[0].range?this.clipUserRangeToCommentRange(e,r[0].range):e;this.addCommentAtLine2(c,a)}}).then(()=>{this._addInProgress=!1})}}else{const{ownerId:s}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,s)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:s,extensionId:o,label:r}=i.action;return{label:r??o??s,id:s}})}getContextMenuActions(e,t){const i=[];return e.forEach(s=>{const{ownerId:o,extensionId:r,label:a}=s.action;i.push(new xn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=s.range?this.clipUserRangeToCommentRange(t,s.range):t;return this.addCommentAtLine2(c,o),Promise.resolve()}))}),i}addCommentAtLine2(e,t){this.editor&&(this.commentService.createCommentThreadTemplate(t,this.editor.getModel().uri,e,this.editor.getId()),this.processNextThreadToAdd())}getExistingCommentEditorOptions(e){const t=e.getOption(x.lineDecorationsWidth);let i=[];const s=e.getRawOptions().extraEditorClassName;return s&&(i=s.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let s=i;const o=t.findIndex(a=>a==="inline-comment");o>=0&&t.splice(o,1);const r=e.getOptions();return r.get(x.folding)&&r.get(x.showFoldingControls)!=="never"&&(s+=11),s-=24,{extraEditorClassName:t,lineDecorationsWidth:s}}getWithCommentsLineDecorationWidth(e,t){let i=t;const s=e.getOptions();return s.get(x.folding)&&s.get(x.showFoldingControls)!=="never"&&(i-=11),i+=24,this._commentingRangeAmountReserved=i,this._commentingRangeAmountReserved}getWithCommentsEditorOptions(e,t,i){return t.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,i),extraEditorClassName:t}}updateEditorLayoutOptions(e,t,i){e.updateOptions({extraEditorClassName:t.join(" "),lineDecorationsWidth:i})}ensureCommentingRangeReservedAmount(e){const t=this.getExistingCommentEditorOptions(e);t.lineDecorationsWidth!==this._commentingRangeAmountReserved&&e.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(e,t.lineDecorationsWidth)})}tryUpdateReservedSpace(e){if(!this.editor)return;const t=this._commentInfos.some(o=>!!(o.commentingRanges&&(Array.isArray(o.commentingRanges)?o.commentingRanges:o.commentingRanges.ranges).length)||o.threads.length>0);e=e??this.editor.getModel()?.uri;const i=e?this.commentService.resourceHasCommentingRanges(e):!1,s=t||i;if(s&&this.commentService.isCommentingEnabled)if(this._commentingRangeSpaceReserved)this.ensureCommentingRangeReservedAmount(this.editor);else{this._commentingRangeSpaceReserved=!0;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}else if((!s||!this.commentService.isCommentingEnabled)&&this._commentingRangeSpaceReserved){this._commentingRangeSpaceReserved=!1;const{lineDecorationsWidth:o,extraEditorClassName:r}=this.getExistingCommentEditorOptions(this.editor),a=this.getWithoutCommentsEditorOptions(this.editor,r,o);this.updateEditorLayoutOptions(this.editor,a.extraEditorClassName,a.lineDecorationsWidth)}}async setComments(e){if(!this.editor||!this.commentService.isCommentingEnabled)return;this._commentInfos=e,this.tryUpdateReservedSpace(),this.removeCommentWidgetsAndStoreCache();let t=!1;for(const i of this._commentInfos){!t&&(i.commentingRanges.ranges.length>0||i.commentingRanges.fileComments)&&(t=!0);const s=this._pendingNewCommentCache[i.uniqueOwner],o=this._pendingEditsCache[i.uniqueOwner];i.threads=i.threads.filter(r=>!r.isDisposed);for(const r of i.threads){let a;s&&(a=s[r.threadId]);let c;o&&(c=o[r.threadId]),await this.displayCommentThread(i.uniqueOwner,r,!1,a,c)}for(const r of i.pendingCommentThreads??[])this.resumePendingComment(this.editor.getModel().uri,r)}this._commentingRangeDecorator.update(this.editor,this._commentInfos),this._commentThreadRangeDecorator.update(this.editor,this._commentInfos),t?this._activeEditorHasCommentingRange.set(!0):this._activeEditorHasCommentingRange.set(!1)}closeWidget(){this._commentWidgets?.forEach(e=>e.hide()),this.editor&&(this.editor.focus(),this.editor.revealRangeInCenter(this.editor.getSelection()))}removeCommentWidgetsAndStoreCache(){this._commentWidgets&&this._commentWidgets.forEach(e=>{const t=e.getPendingComments(),i=t.newComment,s=this._pendingNewCommentCache[e.uniqueOwner];let o;if(e.commentThread.comments&&e.commentThread.comments.length){const c=e.commentThread.comments[e.commentThread.comments.length-1];typeof c.body=="string"?o=c.body:o=c.body.value}i&&i!==o?(s||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):s&&delete s[e.commentThread.threadId];const r=t.edits,a=this._pendingEditsCache[e.uniqueOwner];Object.keys(r).length>0?(a||(this._pendingEditsCache[e.uniqueOwner]={}),this._pendingEditsCache[e.uniqueOwner][e.commentThread.threadId]=r):a&&delete a[e.commentThread.threadId],e.dispose()}),this._commentWidgets=[]}};Poe=D([_(1,sD),_(2,be),_(3,jt),_(4,Vr),_(5,On),_(6,q_),_(7,Re),_(8,Pe),_(9,_i),_(10,ti),_(11,Ur)],Poe);const Bm="vs/workbench/contrib/comments/browser/commentsView",vYt=new Y("commentsView.hasComments",!1),wYt=new Y("commentsView.someCommentsExpanded",!1),bYt="commentsViewState";function p9e(n){return fi.map(n.resourceCommentThreads,e=>{const t=fi.from(e.commentThreads),i=fi.map(t,s=>({element:s}));return{element:e,children:i}})}let c0e=class extends hEe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Ly)return e[0]}get focusedCommentInfo(){if(this.focusedCommentNode)return this.getScreenReaderInfoForNode(this.focusedCommentNode)}focusNextNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).next();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).next();t&&this.tree.setFocus([t])}focusPreviousNode(){if(!this.tree)return;const e=this.tree.getFocus()?.[0];if(!e)return;let t=this.tree.navigate(e).previous();for(;t&&!(t instanceof Ly);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){const v=new W1(bYt,m),w=v.getMemento(ke.WORKSPACE,ln.MACHINE);super({...e,filterOptions:{placeholder:g(Bm,0,"Filter (e.g. text, author)"),ariaLabel:g(Bm,1,"Filter comments"),history:w.filterHistory||[],text:w.filter||"",focusContextKey:ROe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=s,this.commentService=h,this.uriIdentityService=p,this.totalComments=0,this.currentHeight=0,this.currentWidth=0,this.cachedFilterStats=void 0,this.onDidChangeVisibility=this.onDidChangeBodyVisibility,this.hasCommentsContextKey=vYt.bindTo(r),this.someCommentsExpandedContextKey=wYt.bindTo(r),this.stateMemento=v,this.viewState=w,this.filters=this._register(new sYt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new nYt(new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(b=>{(b.showResolved||b.showUnresolved)&&this.updateFilter()})),this._register(this.filterWidget.onDidChangeFilterText(()=>this.updateFilter()))}saveState(){this.viewState.filter=this.filterWidget.getFilterText(),this.viewState.filterHistory=this.filterWidget.getHistory(),this.viewState.showResolved=this.filters.showResolved,this.viewState.showUnresolved=this.filters.showUnresolved,this.stateMemento.saveMemento(),super.saveState()}render(){super.render(),this._register(Crt({name:"commentsView",focusNotifiers:[this,this.filterWidget],focusNextWidget:()=>{this.filterWidget.hasFocus()&&this.focus()},focusPreviousWidget:()=>{this.filterWidget.hasFocus()||this.focusFilter()}}))}focusFilter(){this.filterWidget.focus()}clearFilterText(){this.filterWidget.setFilterText("")}getFilterStats(){return this.cachedFilterStats||(this.cachedFilterStats={total:this.totalComments,filtered:this.tree?.getVisibleItemCount()??0}),this.cachedFilterStats}updateFilter(){this.filter.options=new gE(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved),this.tree?.filterComments(),this.cachedFilterStats=void 0;const{total:e,filtered:t}=this.getFilterStats();this.filterWidget.updateBadge(e===t||e===0?void 0:g(Bm,2,"Showing {0} of {1}",t,e)),this.filterWidget.checkMoreFilters(!this.filters.showResolved||!this.filters.showUnresolved)}renderBody(e){super.renderBody(e),e.classList.add("comments-panel");const t=he(e,we(".comments-panel-container"));this.treeContainer=he(t,we(".tree-container")),this.treeContainer.classList.add("file-icon-themable-tree","show-file-icons"),this.cachedFilterStats=void 0,this.createTree(),this.createMessageBox(t),this._register(this.commentService.onDidSetAllCommentThreads(this.onAllCommentsChanged,this)),this._register(this.commentService.onDidUpdateCommentThreads(this.onCommentsUpdated,this)),this._register(this.commentService.onDidDeleteDataProvider(this.onDataProviderDeleted,this)),this._register(this.onDidChangeBodyVisibility(i=>{i&&this.refresh()})),this.renderComments()}focus(){super.focus();const e=this.tree?.getHTMLElement();e&&kw(e)||(!this.commentService.commentsModel.hasCommentThreads()&&this.messageBoxContainer?this.messageBoxContainer.focus():this.tree&&this.tree.domFocus())}async renderComments(){this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.renderMessage(),await this.tree?.setChildren(null,p9e(this.commentService.commentsModel))}collapseAll(){this.tree&&(this.tree.collapseAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}expandAll(){this.tree&&(this.tree.expandAll(),this.tree.setSelection([]),this.tree.setFocus([]),this.tree.domFocus(),this.tree.focusFirst())}get hasRendered(){return!!this.tree}layoutBodyContent(e=this.currentHeight,t=this.currentWidth){this.messageBoxContainer&&(this.messageBoxContainer.style.height=`${e}px`),this.tree?.layout(e,t),this.currentHeight=e,this.currentWidth=t}createMessageBox(e){this.messageBoxContainer=he(e,we(".message-box-container")),this.messageBoxContainer.setAttribute("tabIndex","0")}renderMessage(){this.messageBoxContainer.textContent=this.commentService.commentsModel.getMessage(),this.messageBoxContainer.classList.toggle("hidden",this.commentService.commentsModel.hasCommentThreads())}getScreenReaderInfoForNode(e,t){let i="";if(t&&this.configurationService.getValue(ua.Comments)){const r=this.keybindingService.lookupKeybinding(HPt.id)?.getAriaLabel();i=r?g(Bm,3,`Inspect this in the accessible view ({0}). `,r):g(Bm,4,`Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding. `)}const s=this.getReplyCountAsString(e,t),o=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===kI.Outdated?i+g(Bm,5,"Outdated from {0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(Bm,6,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:e.threadRelevance===kI.Outdated?i+g(Bm,7,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(Bm,8,"{0} in {1},{2} comment: {3}",e.comment.userName,ui(e.resource),s,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o}getRepliesAsString(e,t){return!e.replies.length||t?"":` `+e.replies.map(i=>g(Bm,9,"{0} {1}",i.comment.userName,typeof i.comment.body=="string"?i.comment.body:i.comment.body.value)).join(` -`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(Bm,10," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(B1,this)),this.tree=this._register(this.instantiationService.createInstance(XIe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof cue?g(Bm,11,"Comments for current workspace"):e instanceof lm?g(Bm,12,"Comments in {0}, full path {1}",ui(e.resource),e.resource.fsPath):e instanceof Ly?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return jIe.value}}})),this._register(this.tree.onDidOpen(e=>{this.openFile(e.element,e.editorOptions.pinned,e.editorOptions.preserveFocus,e.sideBySide)})),this._register(this.tree.onDidChangeModel(()=>{this.updateSomeCommentsExpanded()})),this._register(this.tree.onDidChangeCollapseState(()=>{this.updateSomeCommentsExpanded()}))}openFile(e,t,i,s){if(!e||!(e instanceof lm||e instanceof Ly))return;const o=e instanceof lm?e.commentThreads[0].thread:e.thread,r=e instanceof lm?e.commentThreads[0].comment:void 0;return _Yt(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,s)}async refresh(){if(this.tree&&this.isVisible()&&(this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads()),this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.cachedFilterStats=void 0,this.renderMessage(),this.tree?.setChildren(null,p9e(this.commentService.commentsModel)),this.tree.getSelection().length===0&&this.commentService.commentsModel.hasCommentThreads())){const e=this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];e&&(this.tree.setFocus([e]),this.tree.setSelection([e]))}}onAllCommentsChanged(e){this.cachedFilterStats=void 0,this.totalComments+=e.commentThreads.length;for(const t of e.commentThreads);this.refresh()}onCommentsUpdated(e){this.cachedFilterStats=void 0,this.totalComments+=e.added.length,this.totalComments-=e.removed.length;for(const t of this.commentService.commentsModel.resourceCommentThreads)for(const i of t.commentThreads);this.refresh()}onDataProviderDeleted(e){this.cachedFilterStats=void 0,this.totalComments=0,this.refresh()}updateSomeCommentsExpanded(){this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded())}areAllCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(this.tree.isCollapsed(e.current()))return!1;return!0}isSomeCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(!this.tree.isCollapsed(e.current()))return!0;return!1}};c0e=D([_(1,be),_(2,z_),_(3,_i),_(4,Re),_(5,Pe),_(6,Vr),_(7,ti),_(8,fr),_(9,pn),_(10,sD),_(11,on),_(12,Zc),_(13,_o),_(14,sn)],c0e);const jz="vs/workbench/browser/parts/views/viewPaneContainer",CYt=new Te("Views");Xs.appendMenuItem(Te.ViewContainerTitle,{submenu:CYt,title:g(jz,0,"Views"),order:1});var cu;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(cu||(cu={}));const hle=class hle extends VMe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,s,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=s,this.cleanupOverlayScheduler=this._register(new yn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=hle.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.paneElement.removeChild(this.container),this.paneElement.classList.remove("dragged-over")})),this.overlay=document.createElement("div"),this.overlay.classList.add("pane-overlay-indicator"),this.container.appendChild(this.overlay),this.registerListeners(),this.updateStyles()}updateStyles(){this.overlay.style.backgroundColor=this.getColor(this.location===Sr.Panel?FZe:OZe)||"";const e=this.getColor(co);this.overlay.style.outlineColor=e||"",this.overlay.style.outlineOffset=e?"-2px":"",this.overlay.style.outlineStyle=e?"dashed":"",this.overlay.style.outlineWidth=e?"2px":"",this.overlay.style.borderColor=e||"",this.overlay.style.borderStyle="solid",this.overlay.style.borderWidth="0px"}registerListeners(){this._register(new yZ(this.container,{onDragOver:e=>{this.positionOverlay(e.offsetX,e.offsetY),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:e=>this.dispose(),onDragEnd:e=>this.dispose(),onDrop:e=>{this.dispose()}})),this._register(pe(this.container,xe.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,s=this.paneElement.clientHeight,o=i/2,r=s/2;let a;switch(this.orientation===vi.VERTICAL?t=r&&(a=cu.DOWN):this.orientation===vi.HORIZONTAL&&(e=o&&(a=cu.RIGHT)),a){case cu.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case cu.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case cu.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case cu.RIGHT:this.doPositionOverlay({top:"0",right:"0",width:"50%",height:"100%"});break;default:{let c="0",l="0",d="100%",h="100%";if(this.bounds){const u=this.container.getBoundingClientRect();c=`${this.bounds.top-u.top}px`,l=`${this.bounds.left-u.left}px`,h=`${this.bounds.bottom-this.bounds.top}px`,d=`${this.bounds.right-this.bounds.left}px`}this.doPositionOverlay({top:c,left:l,width:d,height:h})}}this.orientation===vi.VERTICAL&&s<=25||this.orientation===vi.HORIZONTAL&&i<=25?this.doUpdateOverlayBorder(a):this.doUpdateOverlayBorder(void 0),this.overlay.style.opacity="1",setTimeout(()=>this.overlay.classList.add("overlay-move-transition"),0),this._currentDropOperation=a}doUpdateOverlayBorder(e){this.overlay.style.borderTopWidth=e===cu.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===cu.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===cu.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===cu.RIGHT?"2px":"0px"}doPositionOverlay(e){this.container.style.height="100%",this.overlay.style.top=e.top||"",this.overlay.style.left=e.left||"",this.overlay.style.bottom=e.bottom||"",this.overlay.style.right=e.right||"",this.overlay.style.width=e.width,this.overlay.style.height=e.height}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}};hle.OVERLAY_ID="monaco-pane-drop-overlay";let x2=hle,l0e=class extends Oie{constructor(e,t,i,s,o){const r=s.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",aie(i.getViewContainerLocation(t)));super(Te.ViewContainerTitle,Te.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(T.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(aie(i.getViewContainerLocation(t)))))}};l0e=D([_(2,z_),_(3,Pe),_(4,mc)],l0e);let d0e=class extends wst{get onDidSashChange(){return ws(this.paneview).onDidSashChange}get panes(){return this.paneItems.map(e=>e.pane)}get views(){return this.panes}get length(){return this.paneItems.length}get menuActions(){return this._menuActions}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=s,this.layoutService=o,this.contextMenuService=r,this.telemetryService=a,this.extensionService=c,this.storageService=d,this.contextService=h,this.viewDescriptorService=u,this.paneItems=[],this.visible=!1,this.areExtensionsReady=!1,this.didLayout=!1,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidAddViews=this._register(new I),this.onDidAddViews=this._onDidAddViews.event,this._onDidRemoveViews=this._register(new I),this.onDidRemoveViews=this._onDidRemoveViews.event,this._onDidChangeViewVisibility=this._register(new I),this.onDidChangeViewVisibility=this._onDidChangeViewVisibility.event,this._onDidFocusView=this._register(new I),this.onDidFocusView=this._onDidFocusView.event,this._onDidBlurView=this._register(new I),this.onDidBlurView=this._onDidBlurView.event;const f=this.viewDescriptorService.getViewContainerById(e);if(!f)throw new Error("Could not find container");this.viewContainer=f,this.visibleViewsStorageId=`${e}.numberOfVisibleViews`,this.visibleViewsCountFromCache=this.storageService.getNumber(this.visibleViewsStorageId,ke.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new j4t(e,this.options)),this._boundarySashes&&this.paneview.setBoundarySashes(this._boundarySashes),this._register(this.paneview.onDidDrop(({from:c,to:l})=>this.movePane(c,l))),this._register(this.paneview.onDidScroll(c=>this.onDidScrollPane())),this._register(this.paneview.onDidSashReset(c=>this.onDidSashReset(c))),this._register(pe(e,xe.CONTEXT_MENU,c=>this.showContextMenu(new yu(gt(e),c)))),this._register(dh.addTarget(e)),this._register(pe(e,Eo.Contextmenu,c=>this.showContextMenu(new yu(gt(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(l0e,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const s=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===vi.VERTICAL?l.bottom:c.top,h=this.orientation===vi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},o=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let r;this._register(lE.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=s(),i&&i.disposed&&(i=void 0),!i&&o(r,c.eventData)){const l=c.dragAndDropData.getData();if(l.type==="view"){const d=this.viewDescriptorService.getViewContainerByViewId(l.id),h=this.viewDescriptorService.getViewDescriptorById(l.id);if(d!==this.viewContainer&&(!h||!h.canMoveView||this.viewContainer.rejectAddedViews))return;i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(l.type==="composite"&&l.id!==this.viewContainer.id){const d=this.viewDescriptorService.getViewContainerById(l.id),h=this.viewDescriptorService.getViewContainerModel(d).allViewDescriptors;!h.some(u=>!u.canMoveView)&&h.length>0&&(i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!o(r,c.eventData)&&(i.dispose(),i=void 0),o(r,c.eventData)&&r3e(c.eventData.dataTransfer,"move",i!==void 0)},onDragLeave:c=>{i?.dispose(),i=void 0},onDrop:c=>{if(i){const l=c.dragAndDropData.getData(),d=[];if(l.type==="composite"&&l.id!==this.viewContainer.id){const u=this.viewDescriptorService.getViewContainerById(l.id),f=this.viewDescriptorService.getViewContainerModel(u).allViewDescriptors;f.some(p=>!p.canMoveView)||d.push(...f)}else if(l.type==="view"){const u=this.viewDescriptorService.getViewContainerByViewId(l.id),f=this.viewDescriptorService.getViewDescriptorById(l.id);u!==this.viewContainer&&f&&f.canMoveView&&this.viewDescriptorService.moveViewsToContainer([f],this.viewContainer,void 0,"dnd")}const h=this.panes.length;if(d.length>0&&this.viewDescriptorService.moveViewsToContainer(d,this.viewContainer,void 0,"dnd"),h>0)for(const u of d){const f=this.panes.find(p=>p.id===u.id);f&&this.movePane(f,this.panes[this.panes.length-1])}}i?.dispose(),i=void 0}})),this._register(this.onDidSashChange(()=>this.saveViewSizes())),this._register(this.viewContainerModel.onDidAddVisibleViewDescriptors(c=>this.onDidAddViewDescriptors(c))),this._register(this.viewContainerModel.onDidRemoveVisibleViewDescriptors(c=>this.onDidRemoveViewDescriptors(c)));const a=this.viewContainerModel.visibleViewDescriptors.map((c,l)=>{const d=this.viewContainerModel.getSize(c.id),h=this.viewContainerModel.isCollapsed(c.id);return{viewDescriptor:c,index:l,size:d,collapsed:h}});a.length&&this.onDidAddViewDescriptors(a),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.areExtensionsReady=!0,this.panes.length&&(this.updateTitleArea(),this.updateViewHeaders()),this._register(this.configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(u_.ACTIVITY_BAR_LOCATION)&&this.updateViewHeaders()}))}),this._register(this.viewContainerModel.onDidChangeActiveViewDescriptors(()=>this._onTitleAreaUpdate.fire()))}getTitle(){const e=this.viewContainerModel.title;if(this.isViewMergedWithContainer()){const t=this.paneItems[0].pane.singleViewPaneContainerTitle;if(t)return t;const i=this.paneItems[0].pane.title;return e===i?i:i?`${e}: ${i}`:e}return e}showContextMenu(e){for(const t of this.paneItems)if(al(e.target,t.pane.element))return;e.stopPropagation(),e.preventDefault(),this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>this.menuActions?.getContextMenuActions()??[]})}getActionsContext(){}getActionViewItem(e,t){return this.isViewMergedWithContainer()?this.paneItems[0].pane.getActionViewItem(e,t):yO(this.instantiationService,e,t)}focus(){let e;if(this.lastFocusedPane)e=this.lastFocusedPane;else if(this.paneItems.length>0){for(const{pane:t}of this.paneItems)if(t.isExpanded()){e=t;break}}e&&e.focus()}get orientation(){switch(this.viewDescriptorService.getViewContainerLocation(this.viewContainer)){case Sr.Sidebar:case Sr.AuxiliaryBar:return vi.VERTICAL;case Sr.Panel:return this.layoutService.getPanelPosition()===kv.BOTTOM?vi.HORIZONTAL:vi.VERTICAL}return vi.VERTICAL}layout(e){this.paneview&&(this.paneview.orientation!==this.orientation&&this.paneview.flipOrientation(e.height,e.width),this.paneview.layout(e.height,e.width)),this.dimension=e,this.didLayout?this.saveViewSizes():(this.didLayout=!0,this.restoreViewSizes())}setBoundarySashes(e){this._boundarySashes=e,this.paneview?.setBoundarySashes(e)}getOptimalWidth(){return Math.max(...this.panes.map(i=>i.getOptimalWidth()||0))+16}addPanes(e){const t=this.isViewMergedWithContainer();for(const{pane:i,size:s,index:o,disposable:r}of e)this.addPane(i,s,r,o);this.updateViewHeaders(),this.isViewMergedWithContainer()!==t&&this.updateTitleArea(),this._onDidAddViews.fire(e.map(({pane:i})=>i))}setVisible(e){this.visible!==!!e&&(this.visible=e,this._onDidChangeVisibility.fire(e)),this.panes.filter(t=>t.isVisible()!==e).forEach(t=>t.setVisible(e))}isVisible(){return this.visible}updateTitleArea(){this._onTitleAreaUpdate.fire()}createView(e,t){return this.instantiationService.createInstance(e.ctorDescriptor.ctor,...e.ctorDescriptor.staticArguments||[],t)}getView(e){return this.panes.filter(t=>t.id===e)[0]}saveViewSizes(){this.didLayout&&this.viewContainerModel.setSizes(this.panes.map(e=>({id:e.id,size:this.getPaneSize(e)})))}restoreViewSizes(){if(this.didLayout){let e;for(let t=0;ti+(s||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===vi.VERTICAL?e.set(i.id,this.dimension.height*(i.weight||20)/t):e.set(i.id,this.dimension.width*(i.weight||20)/t)}return e}saveState(){this.panes.forEach(e=>e.saveState()),this.storageService.store(this.visibleViewsStorageId,this.length,ke.WORKSPACE,ln.MACHINE)}onContextMenu(e,t){e.stopPropagation(),e.preventDefault();const i=t.menuActions.getContextMenuActions();this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i})}openView(e,t){let i=this.getView(e);return i||this.toggleViewVisibility(e),i=this.getView(e),i&&(i.setExpanded(!0),t&&i.focus()),i}onDidAddViewDescriptors(e){const t=[];for(const{viewDescriptor:s,collapsed:o,index:r,size:a}of e){const c=this.createView(s,{id:s.id,title:s.name.value,fromExtensionId:s.extensionId,expanded:!o,singleViewPaneContainerTitle:s.singleViewPaneContainerTitle});c.render();const l=pe(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new yu(gt(c.draggableElement),h),c)}),d=T.latch(T.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(s.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:pa(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:s}of t)s.setVisible(this.isVisible()),i.push(s);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,s)=>s.index-i.index);const t=[];for(const{index:i}of e)this.paneItems[i]&&t.push(this.paneItems[i].pane);if(t.length){this.removePanes(t);for(const i of t)i.setVisible(!1)}}toggleViewVisibility(e){if(this.viewContainerModel.activeViewDescriptors.some(t=>t.id===e)){const t=!this.viewContainerModel.isVisible(e);this.viewContainerModel.setVisible(e,t)}}addPane(e,t,i,s=this.paneItems.length-1){const o=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),r=e.onDidBlur(()=>this._onDidBlurView.fire(e)),a=e.onDidChangeTitleArea(()=>{this.isViewMergedWithContainer()&&this.updateTitleArea()}),c=e.onDidChangeBodyVisibility(()=>this._onDidChangeViewVisibility.fire(e)),l=e.onDidChange(()=>{e===this.lastFocusedPane&&!e.isExpanded()&&(this.lastFocusedPane=void 0)}),d=this.viewDescriptorService.getViewContainerLocation(this.viewContainer)===Sr.Panel;e.style({headerForeground:Ye(d?VTt:YTt),headerBackground:Ye(d?UTt:KTt),headerBorder:Ye(d?zTt:x3),dropBackground:Ye(d?FZe:OZe),leftBorder:d?Ye($Tt):void 0});const h=new Z;h.add(i),h.add(pa(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(s,0,u),ws(this.paneview).addPane(e,t,s);let f;h.add(lE.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(lE.INSTANCE.registerTarget(e.dropTargetElement,{onDragEnter:p=>{if(!f){const m=p.dragAndDropData.getData();if(m.type==="view"&&m.id!==e.id){const v=this.viewDescriptorService.getViewContainerByViewId(m.id),w=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!w||!w.canMoveView||this.viewContainer.rejectAddedViews))return;f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const v=this.viewDescriptorService.getViewContainerById(m.id),w=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!w.some(b=>!b.canMoveView)&&w.length>0&&(f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{r3e(p.eventData.dataTransfer,"move",f!==void 0)},onDragLeave:p=>{f?.dispose(),f=void 0},onDrop:p=>{if(f){const m=p.dragAndDropData.getData(),v=[];let w;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const b=this.viewDescriptorService.getViewContainerById(m.id),C=this.viewDescriptorService.getViewContainerModel(b).allViewDescriptors;C.length>0&&!C.some(y=>!y.canMoveView)&&(v.push(...C),w=C[0])}else if(m.type==="view"){const b=this.viewDescriptorService.getViewContainerByViewId(m.id),C=this.viewDescriptorService.getViewDescriptorById(m.id);b!==this.viewContainer&&C&&C.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(C),C&&(w=C)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),w){if(f.currentDropOperation===cu.DOWN||f.currentDropOperation===cu.RIGHT){const b=this.panes.findIndex(y=>y.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b>C&&C++,Cy.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b=0&&C!==b&&this.movePane(this.panes[b],this.panes[C]))}v.length>1&&v.slice(1).forEach(b=>{let C=this.panes.findIndex(S=>S.id===w.id);const y=this.panes.findIndex(S=>S.id===b.id);y>=0&&C>=0&&(y>C&&C++,Cthis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),ws(this.paneview).removePane(e);const[i]=this.paneItems.splice(t,1);i.disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(c=>c.pane===e),s=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[s];if(i<0||i>=this.paneItems.length||s<0||s>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,a),ws(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){ws(this.paneview).resizePane(e,t)}getPaneSize(e){return ws(this.paneview).getPaneSize(e)}updateViewHeaders(){this.isViewMergedWithContainer()?(this.paneItems[0].pane.isExpanded()?this.lastMergedCollapsedPane=void 0:(this.lastMergedCollapsedPane=this.paneItems[0].pane,this.paneItems[0].pane.setExpanded(!0)),this.paneItems[0].pane.headerVisible=!1,this.paneItems[0].pane.collapsible=!0):(this.paneItems.length===1?(this.paneItems[0].pane.headerVisible=!0,this.paneItems[0].pane===this.lastMergedCollapsedPane&&this.paneItems[0].pane.setExpanded(!1),this.paneItems[0].pane.collapsible=!1):this.paneItems.forEach(e=>{e.pane.headerVisible=!0,e.pane.collapsible=!0,e.pane===this.lastMergedCollapsedPane&&e.pane.setExpanded(!1)}),this.lastMergedCollapsedPane=void 0)}isViewMergedWithContainer(){return this.options.mergeViewWithContainerWhenSingleView&&this.paneItems.length===1?this.areExtensionsReady?!0:this.visibleViewsCountFromCache===void 0?this.paneItems[0].pane.isExpanded():this.visibleViewsCountFromCache===1:!1}onDidScrollPane(){for(const e of this.panes)e.onDidScrollRoot()}onDidSashReset(e){let t,i;for(let s=e;s>=0;s--)if(this.paneItems[s].pane?.isVisible()&&this.paneItems[s]?.pane.isExpanded()){t=this.paneItems[s].pane;break}for(let s=e+1;so?(this.resizePane(t,r),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,r))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};d0e=D([_(2,be),_(3,Re),_(4,kO),_(5,Vr),_(6,on),_(7,ho),_(8,pn),_(9,sn),_(10,Ti),_(11,z_)],d0e);class lue extends pi{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(z_),i=e.get(Pe),s=Tz.getValue(i);if(s===void 0)return;const o=t.getViewContainerByViewId(s),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===s),c=r.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=r.visibleViewDescriptors.length)return;const l=r.visibleViewDescriptors[c+this.offset];r.move(a.id,l.id)}}At(class extends lue{constructor(){super({id:"views.moveViewUp",title:g(jz,1,"Move View Up"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.UpArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewLeft",title:g(jz,2,"Move View Left"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.LeftArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewDown",title:g(jz,3,"Move View Down"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.DownArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends lue{constructor(){super({id:"views.moveViewRight",title:g(jz,4,"Move View Right"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.RightArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends pi{constructor(){super({id:"vscode.moveViews",title:g(jz,5,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(z_),s=i.getViewContainerById(t.destinationId);if(s){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],s,ESe.Default,this.desc.id)}await e.get(q_).openViewContainer(s.id,!0)}}});const yYt="vs/workbench/api/browser/mainThreadComments";class SYt{get input(){return this._input}set input(e){this._input=e,this._onDidChangeInput.fire(e)}get onDidChangeInput(){return this._onDidChangeInput.event}get label(){return this._label}set label(e){this._label=e,this._onDidChangeLabel.fire(this._label)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e}get comments(){return this._comments}set comments(e){this._comments=e,this._onDidChangeComments.fire(this._comments)}get onDidChangeComments(){return this._onDidChangeComments.event}set range(e){this._range=e,this._onDidChangeRange.fire(this._range)}get range(){return this._range}get onDidChangeCanReply(){return this._onDidChangeCanReply.event}set canReply(e){this._canReply=e,this._onDidChangeCanReply.fire(this._canReply)}get canReply(){return this._canReply}get collapsibleState(){return this._collapsibleState}set collapsibleState(e){e!==this._collapsibleState&&(this._collapsibleState=e,this._onDidChangeCollapsibleState.fire(this._collapsibleState))}get initialCollapsibleState(){return this._initialCollapsibleState}set initialCollapsibleState(e){this._initialCollapsibleState=e,this.collapsibleState===void 0&&(this.collapsibleState=this.initialCollapsibleState),this._onDidChangeInitialCollapsibleState.fire(e)}get isDisposed(){return this._isDisposed}isDocumentCommentThread(){return this._range===void 0||O.isIRange(this._range)}get state(){return this._state}set state(e){this._state=e,this._onDidChangeState.fire(this._state)}get applicability(){return this._applicability}set applicability(e){this._applicability=e,this._onDidChangeApplicability.fire(e)}get isTemplate(){return this._isTemplate}constructor(e,t,i,s,o,r,a,c,l){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=s,this.resource=o,this._range=r,this._canReply=a,this._isTemplate=c,this.editorId=l,this._onDidChangeInput=new I,this._onDidChangeLabel=new I,this.onDidChangeLabel=this._onDidChangeLabel.event,this._onDidChangeComments=new I,this._onDidChangeCanReply=new I,this._onDidChangeRange=new I,this.onDidChangeRange=this._onDidChangeRange.event,this._onDidChangeCollapsibleState=new I,this.onDidChangeCollapsibleState=this._onDidChangeCollapsibleState.event,this._onDidChangeInitialCollapsibleState=new I,this.onDidChangeInitialCollapsibleState=this._onDidChangeInitialCollapsibleState.event,this._onDidChangeApplicability=new I,this.onDidChangeApplicability=this._onDidChangeApplicability.event,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._isDisposed=!1,c&&(this.comments=[])}batchUpdate(e){const t=i=>Object.prototype.hasOwnProperty.call(e,i);t("range")&&(this._range=e.range),t("label")&&(this._label=e.label),t("contextValue")&&(this._contextValue=e.contextValue===null?void 0:e.contextValue),t("comments")&&(this._comments=e.comments),t("collapseState")&&(this.initialCollapsibleState=e.collapseState),t("canReply")&&(this.canReply=e.canReply),t("state")&&(this.state=e.state),t("applicability")&&(this.applicability=e.applicability),t("isTemplate")&&(this._isTemplate=e.isTemplate)}dispose(){this._isDisposed=!0,this._onDidChangeCollapsibleState.dispose(),this._onDidChangeComments.dispose(),this._onDidChangeInput.dispose(),this._onDidChangeLabel.dispose(),this._onDidChangeRange.dispose(),this._onDidChangeState.dispose()}toJSON(){return{$mid:Fs.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class AYt{get handle(){return this._handle}get id(){return this._id}get contextValue(){return this._id}get proxy(){return this._proxy}get label(){return this._label}get reactions(){return this._reactions}set reactions(e){this._reactions=e}get options(){return this._features.options}get features(){return this._features}get owner(){return this._id}constructor(e,t,i,s,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=s,this._id=o,this._label=r,this._features=a,this._threads=new Map}async setActiveCommentAndThread(e){return this._proxy.$setActiveComment(this._handle,e?{commentThreadHandle:e.thread.commentThreadHandle,uniqueIdInThread:e.comment?.uniqueIdInThread}:void 0)}updateFeatures(e){this._features=e}createCommentThread(e,t,i,s,o,r,a){const c=new SYt(t,this.handle,e,i,P.revive(s).toString(),o,!0,r,a);return this._threads.set(t,c),c.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}),c}updateCommentThread(e,t,i,s){const o=this.getKnownThread(e);o.batchUpdate(s),o.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]})}deleteCommentThread(e){const t=this.getKnownThread(e);this._threads.delete(e),t.dispose(),t.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]})}deleteCommentThreadMain(e){this._threads.forEach(t=>{t.threadId===e&&this._proxy.$deleteCommentThread(this._handle,t.commentThreadHandle)})}updateInput(e){const t=this.activeEditingCommentThread;if(t&&t.input){const i=t.input;i.value=e,t.input=i}}updateCommentingRanges(e){this._commentService.updateCommentingRanges(this._uniqueId,e)}getKnownThread(e){const t=this._threads.get(e);if(!t)throw new Error("unknown thread");return t}async getDocumentComments(e,t){if(e.scheme===_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[],commentingRanges:{resource:e,ranges:[],fileComments:!1}};const i=[];for(const o of[...this._threads.keys()]){const r=this._threads.get(o);r.resource===e.toString()&&r.isDocumentCommentThread()&&i.push(r)}const s=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:s?.ranges||[],fileComments:!!s?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const s of[...this._threads.keys()]){const o=this._threads.get(s);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,s,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,s)}getAllComments(){const e=[];for(const t of[...this._threads.keys()])e.push(this._threads.get(t));return e}createCommentThreadTemplate(e,t,i){return this._proxy.$createCommentThreadTemplate(this.handle,e,t,i)}async updateCommentThreadTemplate(e,t){await this._proxy.$updateCommentThreadTemplate(this.handle,e,t)}toJSON(){return{$mid:Fs.CommentController,handle:this.handle}}}const m9e=ji("comments-view-icon",Ce.commentDiscussion,g(yYt,0,"View icon of the comments view."));let _9e=class extends ${constructor(e,t,i,s){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=s,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(et.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async o=>{const r=o.controllerHandle,a=this._commentControllers.get(r);a&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=o,a.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,s){const o=`${t}-${s}`;this._handlers.set(e,o);const r=new AYt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(Qd);a||this.registerView(a),this.registerViewListeners(a),this._commentService.setWorkspaceComments(String(e),[])}$unregisterCommentController(e){const t=this._handlers.get(e);this._handlers.delete(e),this._commentControllers.delete(e),typeof t=="string"&&this._commentService.unregisterCommentController(t)}$updateCommentControllerFeatures(e,t){const i=this._commentControllers.get(e);i&&i.updateFeatures(t)}$createCommentThread(e,t,i,s,o,r,a,c){const l=this._commentControllers.get(e);if(l)return l.createCommentThread(r.value,t,i,s,o,a,c)}$updateCommentThread(e,t,i,s,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,s,o)}$deleteCommentThread(e,t){const i=this._commentControllers.get(e);if(i)return i.deleteCommentThread(t)}$updateCommentingRanges(e,t){const i=this._commentControllers.get(e);i&&i.updateCommentingRanges(t)}registerView(e){if(!e){const t=it.as(M1.ViewContainersRegistry).registerViewContainer({id:Qd,title:jIe,ctorDescriptor:new $i(d0e,[Qd,{mergeViewWithContainerWhenSingleView:!0}]),storageId:tYt,hideIfEmpty:!0,icon:m9e,order:10},Sr.Panel);it.as(M1.ViewsRegistry).registerViews([{id:Qd,name:jIe,canToggleVisibility:!1,ctorDescriptor:new $i(c0e),canMoveView:!0,containerIcon:m9e,focusCommand:{id:"workbench.action.focusCommentsPanel"}}],t)}}setComments(){[...this._commentControllers.keys()].forEach(e=>{const t=this._commentControllers.get(e).getAllComments();if(t.length){const i=this.getHandler(e);this._commentService.setWorkspaceComments(i,t)}})}registerViewOpenedListener(){this._openViewListener||(this._openViewListener=this._viewsService.onDidChangeViewVisibility(e=>{e.id===Qd&&e.visible&&(this.setComments(),this._openViewListener&&(this._openViewListener.dispose(),this._openViewListener=null))}))}registerViewListeners(e){e||this.registerViewOpenedListener(),this._register(this._viewDescriptorService.onDidChangeContainer(t=>{t.views.find(i=>i.id===Qd)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(Qd);t.viewContainer.id===i?.id&&(this.setComments(),this.registerViewOpenedListener())}))}getHandler(e){if(!this._handlers.has(e))throw new Error("Unknown handler");return this._handlers.get(e)}};_9e=D([Zi(Ue.MainThreadComments),_(1,sD),_(2,q_),_(3,z_)],_9e);var CI;(function(n){n[n.Output=1]="Output",n[n.OutputItems=2]="OutputItems",n[n.ExecutionState=3]="ExecutionState"})(CI||(CI={}));var _m;(function(n){function e(f){return{mime:f.mime,valueBytes:f.data}}n.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}n.toNotebookOutputDto=t;function i(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,internalMetadata:f.internalMetadata,metadata:f.metadata,outputs:f.outputs.map(t)}}n.toNotebookCellDataDto=i;function s(f){return{metadata:f.metadata,cells:f.cells.map(i)}}n.toNotebookDataDto=s;function o(f){return{mime:f.mime,data:f.valueBytes}}n.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}n.fromNotebookOutputDto=r;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(r),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}n.fromNotebookDataDto=c;function l(f){return{handle:f.handle,uri:f.uri,source:f.textBuffer.getLinesContent(),eol:f.textBuffer.getEOL(),language:f.language,cellKind:f.cellKind,outputs:f.outputs.map(t),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.toNotebookCellDto=l;function d(f){return f.editType===CI.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===CI.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}n.fromCellExecuteUpdateDto=d;function h(f){return f}n.fromCellExecuteCompleteDto=h;function u(f){return f.editType===G1.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}n.fromCellEditOperationDto=u})(_m||(_m={}));let v9e=class{constructor(e,t,i,s){this._notebookService=t,this._cellStatusBarService=i,this._logService=s,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(et.ExtHostNotebook)}dispose(){this._disposables.dispose(),St(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,s,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:s,dataToNotebook:async a=>{const c=new ao;let l;if(a.byteLength===0&&i==="interactive")l=_m.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,qe.None);l=_m.fromNotebookDataDto(d.value)}return this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${c.elapsed()}ms`,{viewType:i,extensionId:t.id.value}),l},notebookToData:a=>{const c=new ao,l=this._proxy.$notebookToData(e,new $h(_m.toNotebookDataDto(a)),qe.None);return this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${c.elapsed()}`,{viewType:i,extensionId:t.id.value}),l},save:async(a,c,l,d)=>({...await this._proxy.$saveNotebook(e,a,c,l,d),children:void 0,resource:a}),searchInNotebooks:async(a,c,l)=>{const d=this._notebookService.getContributedNotebookType(i);if(!d)return{results:[],limitHit:!1};const u=d.selectors.map(w=>(w.include||w).toString());if(!u.length)return{results:[],limitHit:!1};const f=Ui([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(w=>w!==i?l.get(w)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(w=>({resource:P.revive(w.resource),cellResults:w.cellResults.map(C=>Or(C))})),limitHit:m.limitHit}}})),o&&r.add(this._notebookService.registerContributedNotebookType(i,o)),this._notebookSerializer.set(e,r),this._logService.trace("[NotebookSerializer] registered notebook serializer",{viewType:i,extensionId:t.id.value})}$unregisterNotebookSerializer(e){this._notebookSerializer.get(e)?.dispose(),this._notebookSerializer.delete(e)}$emitCellStatusBarEvent(e){const t=this._notebookCellStatusBarRegistrations.get(e);t instanceof I&&t.fire(void 0)}async $registerNotebookCellStatusBarItemProvider(e,t,i){const s=this,o={async provideCellStatusBarItems(a,c,l){const d=await s._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&s._proxy.$releaseNotebookCellStatusBarItems(d.cacheId)}}},viewType:i};if(typeof t=="number"){const a=new I;this._notebookCellStatusBarRegistrations.set(t,a),o.onDidChangeStatusBarItems=a.event}const r=this._cellStatusBarService.registerCellStatusBarItemProvider(o);this._notebookCellStatusBarRegistrations.set(e,r)}async $unregisterNotebookCellStatusBarItemProvider(e,t){const i=s=>{this._notebookCellStatusBarRegistrations.get(s)&&(this._notebookCellStatusBarRegistrations.get(s)?.dispose(),this._notebookCellStatusBarRegistrations.delete(s))};i(e),typeof t=="number"&&i(t)}};v9e=D([Zi(Ue.MainThreadNotebook),_(1,oD),_(2,qZe),_(3,Ze)],v9e);yt.registerCommand("_executeDataToNotebook",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(i instanceof ze,"VSBuffer");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=await o.serializer.dataToNotebook(i);return new $h(_m.toNotebookDataDto(r))});yt.registerCommand("_executeNotebookToData",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(typeof i=="object");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=_m.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var h0e;(function(n){n[n.cell=0]="cell",n[n.notebook=1]="notebook"})(h0e||(h0e={}));class EYt{get preloadUris(){return this.preloads.map(e=>e.uri)}get preloadProvides(){return this.preloads.flatMap(e=>e.provides)}constructor(e,t){this._languageService=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.id=e.id,this.viewType=e.notebookType,this.extension=e.extensionId,this.implementsInterrupt=e.supportsInterrupt??!1,this.label=e.label,this.description=e.description,this.detail=e.detail,this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=P.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:P.revive(i.uri),provides:i.provides}))??[]}update(e){const t=Object.create(null);e.label!==void 0&&(this.label=e.label,t.label=!0),e.description!==void 0&&(this.description=e.description,t.description=!0),e.detail!==void 0&&(this.detail=e.detail,t.detail=!0),e.supportedLanguages!==void 0&&(this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:this._languageService.getRegisteredLanguageIds(),t.supportedLanguages=!0),e.supportsExecutionOrder!==void 0&&(this.implementsExecutionOrder=e.supportsExecutionOrder,t.hasExecutionOrder=!0),e.supportsInterrupt!==void 0&&(this.implementsInterrupt=e.supportsInterrupt,t.hasInterruptHandler=!0),e.hasVariableProvider!==void 0&&(this.hasVariableProvider=e.hasVariableProvider,t.hasVariableProvider=!0),this._onDidChange.fire(t)}}class xYt{constructor(e){this.notebookType=e}}let w9e=class{constructor(e,t,i,s,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=s,this._notebookService=o,this._editors=new Zo,this._disposables=new Z,this._kernels=new Map,this._kernelDetectionTasks=new Map,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProvidersEventRegistrations=new Map,this._executions=new Map,this._notebookExecutions=new Map,this.variableRequestIndex=0,this.variableRequestMap=new Map,this._proxy=e.getProxy(et.ExtHostNotebookKernels),r.listNotebookEditors().forEach(this._onEditorAdd,this),r.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),r.onDidRemoveNotebookEditor(this._onEditorRemove,this,this._disposables),this._disposables.add(Ee(()=>{this._executions.forEach(a=>{a.complete({})}),this._notebookExecutions.forEach(a=>a.complete())})),this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(a=>{a.type===h0e.cell&&this._proxy.$cellExecutionChanged(a.notebook,a.cellHandle,a.changed?.state)}))}dispose(){this._disposables.dispose();for(const[,e]of this._kernels.values())e.dispose();for(const[,e]of this._kernelDetectionTasks.values())e.dispose();for(const[,e]of this._kernelSourceActionProviders.values())e.dispose();this._editors.dispose()}_onEditorAdd(e){const t=e.onDidReceiveMessage(i=>{if(!e.hasModel())return;const{selected:s}=this._notebookKernelService.getMatchingKernel(e.textModel);if(s){for(const[o,r]of this._kernels)if(r[0]===s){this._proxy.$acceptKernelMessageFromRenderer(o,e.getId(),i.message);break}}});this._editors.set(e,t)}_onEditorRemove(e){this._editors.deleteAndDispose(e)}async $postMessage(e,t,i){const s=this._kernels.get(e);if(!s)throw new Error("kernel already disposed");const[o]=s;let r=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===o){if(t===void 0)a.postMessage(i),r=!0;else if(a.getId()===t){a.postMessage(i),r=!0;break}}return r}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,s=new class extends EYt{async executeNotebookCellsRequest(a,c){await i._proxy.$executeCells(e,a,c)}async cancelNotebookCellExecution(a,c){await i._proxy.$cancelCells(e,a,c)}provideVariables(a,c,l,d,h){const u=`${e}variables${i.variableRequestIndex++}`;if(i.variableRequestMap.has(u))return i.variableRequestMap.get(u).asyncIterable;const f=new M9;return i.variableRequestMap.set(u,f),i._proxy.$provideVariables(e,u,a,c,l,d,h).then(()=>{f.resolve(),i.variableRequestMap.delete(u)}).catch(p=>{f.reject(p),i.variableRequestMap.delete(u)}),f.asyncIterable}}(t,this._languageService),o=this._notebookKernelService.onDidChangeSelectedNotebooks(a=>{a.oldKernel===s.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===s.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(s);this._kernels.set(e,[s,pa(o,r)])}$updateKernel(e,t){const i=this._kernels.get(e);i&&i[0].update(t)}$removeKernel(e){const t=this._kernels.get(e);t&&(t[1].dispose(),this._kernels.delete(e))}$updateNotebookPriority(e,t,i){const s=this._kernels.get(e);s&&this._notebookKernelService.updateKernelNotebookAffinity(s[0],P.revive(t),i)}$createExecution(e,t,i,s){const o=P.revive(i),r=this._notebookService.getNotebookTextModel(o);if(!r)throw new Error(`Notebook not found: ${o.toString()}`);const a=this._notebookKernelService.getMatchingKernel(r);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(o,s);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(_m.fromCellExecuteUpdateDto))}catch(s){bt(s)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(_m.fromCellExecuteCompleteDto(t.value))}catch(i){bt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const s=P.revive(i),o=this._notebookService.getNotebookTextModel(s);if(!o)throw new Error(`Notebook not found: ${s.toString()}`);const r=this._notebookKernelService.getMatchingKernel(o);if(!r.selected||r.selected.id!==t)throw new Error(`Kernel is not selected: ${r.selected?.id} !== ${t}`);const a=this._notebookExecutionStateService.createExecution(s);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){bt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){bt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new xYt(t),s=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,s])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const s={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,qe.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=P.revive(a.documentation)),{label:a.label,command:a.command,description:a.description,detail:a.detail,documentation:c}})};if(typeof t=="number"){const r=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,r),s.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,s);this._kernelSourceActionProviders.set(e,[s,o])}$removeKernelSourceActionProvider(e,t){const i=this._kernelSourceActionProviders.get(e);i&&(i[1].dispose(),this._kernelSourceActionProviders.delete(e)),typeof t=="number"&&this._kernelSourceActionProvidersEventRegistrations.delete(t)}$emitNotebookKernelSourceActionsChangeEvent(e){const t=this._kernelSourceActionProvidersEventRegistrations.get(e);t instanceof I&&t.fire(void 0)}$variablesUpdated(e){this._notebookKernelService.notifyVariablesChange(P.revive(e))}};w9e=D([Zi(Ue.MainThreadNotebookKernels),_(1,Di),_(2,jZe),_(3,QZe),_(4,oD),_(5,xQ)],w9e);let u0e=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new wi,this._proxy=e.getProxy(et.ExtHostNotebookDocuments),this._modelReferenceCollection=new Zot(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(s=>this._proxy.$acceptDirtyStateChanged(s.resource,s.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(s=>this._proxy.$acceptModelSaved(s))),this._disposables.add(t.onWillFailWithConflict(s=>{this._modelReferenceCollection.remove(s.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),St(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(s=>{const o={versionId:s.versionId,rawEvents:[]};for(const a of s.rawEvents)switch(a.kind){case vd.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>_m.toNotebookCellDto(l))])});break;case vd.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case vd.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(_m.toNotebookOutputDto)});break;case vd.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(_m.toNotebookOutputItemDto),append:a.append});break;case vd.ChangeCellLanguage:case vd.ChangeCellContent:case vd.ChangeCellMetadata:case vd.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=s.rawEvents.find(a=>a.kind===vd.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new $h(o),this._notebookEditorModelResolverService.isDirty(t.uri),r?t.metadata:void 0)})),this._documentEventListenersMapping.set(t.uri,i)}}handleNotebooksRemoved(e){for(const t of e)this._documentEventListenersMapping.get(t)?.dispose(),this._documentEventListenersMapping.delete(t)}async $tryCreateNotebook(e){const t=await this._notebookEditorModelResolverService.resolve({untitledResource:void 0},e.viewType);if(t.object.notebook.onWillDispose(()=>{t.dispose()}),this._proxy.$acceptDirtyStateChanged(t.object.resource,!0),e.content){const i=_m.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),s=await i.object.save();return i.dispose(),s}};u0e=D([_(1,Jde),_(2,_o)],u0e);class DYt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let g0e=class{constructor(e,t,i,s,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=s,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(et.ExtHostNotebookEditors),this._editorService.onDidActiveEditorChange(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidRemoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidMoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables)}dispose(){this._disposables.dispose(),St(this._mainThreadEditors.values())}handleEditorsAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeVisibleRanges(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{visibleRanges:{ranges:t.visibleRanges}})})),i.add(t.onDidChangeSelection(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{selections:{selections:t.getSelections()}})}));const s=new DYt(t,i);this._mainThreadEditors.set(t.getId(),s)}}handleEditorsRemoved(e){for(const t of e)this._mainThreadEditors.get(t)?.dispose(),this._mainThreadEditors.delete(t)}_updateEditorViewColumns(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=tH(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=U1(this._editorGroupService,t.group))}Io(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const s={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?y1.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:P.revive(e),options:s},ane(this._editorGroupService,this._configurationService,i.position)),r=tH(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const s=this._notebookEditorService.getNotebookEditor(e);if(!s)return;const o=s;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case C2.Default:return o.revealCellRangeInView(t);case C2.InCenter:return o.revealInCenter(r);case C2.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case C2.AtTop:return o.revealInViewAtTop(r)}}$trySetSelections(e,t){const i=this._notebookEditorService.getNotebookEditor(e);i&&(i.setSelections(t),t.length&&i.setFocus({start:t[0].start,end:t[0].start+1}))}};g0e=D([_(1,_i),_(2,xQ),_(3,ur),_(4,Re)],g0e);var OX;class b9e{static delta(e,t){if(!e)return{addedDocuments:[...t.documents],removedDocuments:[],addedEditors:[...t.textEditors.values()],removedEditors:[],visibleEditors:[...t.visibleEditors].map(a=>a[0])};const i=Ple(e.documents,t.documents),s=p_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=p_e(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:s.added,removedEditors:s.removed.map(a=>a.getId()),newActiveEditor:o,visibleEditors:r.added.length===0&&r.removed.length===0?void 0:[...t.visibleEditors].map(a=>a[0])}}constructor(e,t,i,s){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=s}}let C9e=OX=class{constructor(e,t,i,s,o,r,a){this._notebookService=i,this._notebookEditorService=s,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new Zo,this._proxy=e.getProxy(et.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(u0e,e),this._mainThreadEditors=t.createInstance(g0e,e),e.set(Ue.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Ue.MainThreadNotebookEditors,this._mainThreadEditors),this._notebookService.onWillAddNotebookDocument(()=>this._updateState(),this,this._disposables),this._notebookService.onDidRemoveNotebookDocument(()=>this._updateState(),this,this._disposables),this._editorService.onDidActiveEditorChange(()=>this._updateState(),this,this._disposables),this._editorService.onDidVisibleEditorsChange(()=>this._updateState(),this,this._disposables),this._notebookEditorService.onDidAddNotebookEditor(this._handleEditorAdd,this,this._disposables),this._notebookEditorService.onDidRemoveNotebookEditor(this._handleEditorRemove,this,this._disposables),this._updateState()}dispose(){this._mainThreadNotebooks.dispose(),this._mainThreadEditors.dispose(),this._disposables.dispose(),this._editorListeners.dispose()}_handleEditorAdd(e){this._editorListeners.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusWidget(()=>this._updateState(e)))),this._updateState()}_handleEditorRemove(e){this._editorListeners.deleteAndDispose(e.getId()),this._updateState()}_updateState(e){const t=new Map,i=new Map;for(const a of this._notebookEditorService.listNotebookEditors())a.hasModel()&&t.set(a.getId(),a);const s=tH(this._editorService.activeEditorPane);let o=null;s?o=s.getId():e?.textModel&&(o=e.getId()),o&&!t.has(o)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",o,t.keys()),o=null);for(const a of this._editorService.visibleEditorPanes){const c=tH(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new b9e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(b9e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(OX._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(OX._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new $h(t)),this._mainThreadEditors.handleEditorsRemoved(e.removedEditors),this._mainThreadNotebooks.handleNotebooksRemoved(e.removedDocuments),this._mainThreadNotebooks.handleNotebooksAdded(e.addedDocuments),this._mainThreadEditors.handleEditorsAdded(e.addedEditors)}static _isDeltaEmpty(e){return!(e.addedDocuments!==void 0&&e.addedDocuments.length>0||e.removedDocuments!==void 0&&e.removedDocuments.length>0||e.addedEditors!==void 0&&e.addedEditors.length>0||e.removedEditors!==void 0&&e.removedEditors.length>0||e.visibleEditors!==void 0&&e.visibleEditors.length>0||e.newActiveEditor!==void 0)}static _asModelAddData(e){return{viewType:e.viewType,uri:e.uri,metadata:e.metadata,versionId:e.versionId,cells:e.cells.map(_m.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>tH(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&U1(this._editorGroupService,t.group)}}};C9e=OX=D([TO,_(1,be),_(2,oD),_(3,xQ),_(4,_i),_(5,ur),_(6,Ze)],C9e);let y9e=class extends ${constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(et.ExtHostNotebookRenderers),this._register(t.onShouldPostMessage(i=>{this.proxy.$postRendererMessage(i.editorId,i.rendererId,i.message)}))}$postMessage(e,t,i){return this.messaging.receiveMessage(e,t,i)}};y9e=D([Zi(Ue.MainThreadNotebookRenderers),_(1,KZe)],y9e);var BG;(function(n){n[n.Save=1]="Save",n[n.Backup=2]="Backup"})(BG||(BG={}));var BX;const Wu="vs/workbench/services/workingCopy/common/storedFileWorkingCopy";var Xm;(function(n){n[n.SAVED=0]="SAVED",n[n.DIRTY=1]="DIRTY",n[n.PENDING_SAVE=2]="PENDING_SAVE",n[n.CONFLICT=3]="CONFLICT",n[n.ORPHAN=4]="ORPHAN",n[n.ERROR=5]="ERROR"})(Xm||(Xm={}));var QP;let S9e=(QP=class extends Roe{get model(){return this._model}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(t,r),this.typeId=e,this.name=i,this.modelFactory=s,this.externalResolver=o,this.logService=a,this.workingCopyFileService=c,this.filesConfigurationService=l,this.workingCopyBackupService=d,this.notificationService=u,this.workingCopyEditorService=f,this.editorService=p,this.elevatedFileService=m,this.capabilities=JS.None,this._model=void 0,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.dirty=!1,this.ignoreDirtyOnModelContentChange=!1,this.versionId=0,this.lastContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.ignoreSaveFromSaveParticipants=!1,this.inConflictMode=!1,this.inErrorMode=!1,this._register(h.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}isDirty(){return this.dirty}markModified(){this.setDirty(!0)}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.savedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.isResolved()&&(this.savedVersionId=this.model.versionId)),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.savedVersionId=o}}isResolved(){return!!this.model}async resolve(e){if(this.trace("resolve() - enter"),this.isDisposed()){this.trace("resolve() - exit - without resolving because file working copy is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because file working copy is dirty or being saved");return}return this.doResolve(e)}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents);if(!(!this.isResolved()&&await this.resolveFromBackup()))return this.resolveFromFile(e)}async resolveFromBuffer(e){this.trace("resolveFromBuffer()");let t,i,s,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,s=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),s=0,o=zv,this.setOrphaned(r.fileOperationResult===Xi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:s,etag:o,value:e,readonly:!1,locked:!1},!0)}async resolveFromBackup(){const e=await this.workingCopyBackupService.resolve(this);return this.isResolved()?(this.trace("resolveFromBackup() - exit - withoutresolving because previously new file working copy got created meanwhile"),!0):e?(await this.doResolveFromBackup(e),!0):!1}async doResolveFromBackup(e){this.trace("doResolveFromBackup()"),await this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:e.value,readonly:!1,locked:!1},!0),e.meta&&e.meta.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile;let i;t?i=zv:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const s=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),s!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because file working copy content changed");return}await this.resolveFromContent(o,!1)}catch(o){const r=o.fileOperationResult;if(this.setOrphaned(r===Xi.FILE_NOT_FOUND),this.isResolved()&&r===Xi.FILE_NOT_MODIFIED_SINCE){o instanceof P$&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Xi.FILE_NOT_FOUND&&!t)return;throw o}}async resolveFromContent(e,t){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because working copy is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0}),this.isResolved()?await this.doUpdateModel(e.value):await this.doCreateModel(e.value),this.setDirty(!!t),this._onDidResolve.fire()}async doCreateModel(e){this.trace("doCreateModel()"),this._model=this._register(await this.modelFactory.createModel(this.resource,e,qe.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,qe.None)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onWillDispose(()=>this.dispose()))}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.versionId===this.savedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire()}async forceResolveFromFile(){this.isDisposed()||await this.externalResolver({forceReadFromFile:!0})}get backupDelay(){return this.model?.configuration?.backupDelay}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.isOrphaned()});let i;return this.isResolved()&&(i=await dw(this.model.snapshot(BG.Backup,e),e)),{meta:t,content:i}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(Xm.CONFLICT)||this.hasState(Xm.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for file working copy that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(Xm.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.model.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastContentChangeFromUndoRedo;r{try{const r={mtime:s.mtime,etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource)?zv:s.etag,unlock:e.writeUnlock};let a;if(typeof o.model.save=="function")try{a=await o.model.save(r,i.token)}catch(c){if(i.token.isCancellationRequested)return;throw c}else{const c=await dw(o.model.snapshot(BG.Save,i.token),i.token);if(i.token.isCancellationRequested)return;i.dispose(),e?.writeElevated&&this.elevatedFileService.isSupported(s.resource)?a=await this.elevatedFileService.writeFileElevated(s.resource,ws(c),r):a=await this.fileService.writeFile(s.resource,ws(c),r)}this.handleSaveSuccess(a,t,e)}catch(r){this.handleSaveError(r,t,e)}})(),()=>i.cancel())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[stored file working copy] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString(),this.typeId]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Xi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,s=[];let o;if(i.fileOperationResult===Xi.FILE_MODIFIED_SINCE)o=g(Wu,0,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),s.push(_l({id:"fileWorkingCopy.overwrite",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Xi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Xi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);fSt(e)&&s.push(...e.actions),h&&(d||l)?s.push(_l({id:"fileWorkingCopy.saveElevated",label:l?Is?g(Wu,3,"Overwrite as Admin..."):g(Wu,4,"Overwrite as Sudo..."):Is?g(Wu,5,"Retry as Admin..."):g(Wu,6,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Ln.EXPLICIT})}})):c?s.push(_l({id:"fileWorkingCopy.unlock",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Ln.EXPLICIT})})):s.push(_l({id:"fileWorkingCopy.retry",label:g(Wu,7,"Retry"),run:()=>this.save({...t,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.saveAs",label:g(Wu,8,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Ln.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()})),c?l&&h?o=Is?g(Wu,9,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(Wu,10,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(Wu,11,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Is?g(Wu,12,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(Wu,13,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(Wu,14,"Failed to save '{0}': {1}",this.name,Ma(e,!1))}const r=this.notificationService.notify({id:`${Ed(this.resource.toString())}`,severity:nt.Error,message:o,actions:{primary:s}}),a=this._register(T.once(T.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(T.once(r.onDidClose)(()=>a.dispose()))}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}async revert(e){if(!this.isResolved()||!this.dirty&&!e?.force)return;this.trace("revert()");const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Xi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Xm.CONFLICT:return this.inConflictMode;case Xm.DIRTY:return this.dirty;case Xm.ERROR:return this.inErrorMode;case Xm.ORPHAN:return this.isOrphaned();case Xm.PENDING_SAVE:return this.saveSequentializer.isRunning();case Xm.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}trace(e){this.logService.trace(`[stored file working copy] ${e}`,this.resource.toString(),this.typeId)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inErrorMode=!1,this._model=void 0,super.dispose()}},BX=QP,QP.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,QP);S9e=BX=D([_(5,ci),_(6,Ze),_(7,fC),_(8,hh),_(9,MQ),_(10,Pw),_(11,Pi),_(12,Iet),_(13,_i),_(14,IQ)],S9e);var FB;let A9e=FB=class extends pL{constructor(e,t,i,s,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=s,this._filesConfigurationService=r,this._onDidChangeDirty=this._register(new I),this._onDidSave=this._register(new I),this._onDidChangeOrphaned=this._register(new I),this._onDidChangeReadonly=this._register(new I),this._onDidRevertUntitled=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidSave=this._onDidSave.event,this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.onDidRevertUntitled=this._onDidRevertUntitled.event,this._workingCopyListeners=this._register(new Z),this.scratchPad=o}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return FB._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Xm.ORPHAN)}hasAssociatedFilePath(){return!FB._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Xm.ERROR):!1}revert(e){return Bt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Bt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===_e.untitled?(this._hasAssociatedFilePath?this._workingCopy=await this._workingCopyManager.resolve({associatedResource:this.resource}):this._workingCopy=await this._workingCopyManager.resolve({untitledResource:this.resource,isScratchpad:this.scratchPad}),this._workingCopy.onDidRevert(()=>this._onDidRevertUntitled.fire())):(this._workingCopy=await this._workingCopyManager.resolve(this.resource,{limits:e?.limits,reload:e?.forceReadFromFile?{async:!1,force:!0}:void 0}),this._workingCopyListeners.add(this._workingCopy.onDidSave(t=>this._onDidSave.fire(t))),this._workingCopyListeners.add(this._workingCopy.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._workingCopyListeners.add(this._workingCopy.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(()=>this._onDidChangeDirty.fire(),void 0)),this._workingCopyListeners.add(this._workingCopy.onWillDispose(()=>{this._workingCopyListeners.clear(),this._workingCopy?.model?.dispose()}))):await this._workingCopyManager.resolve(this.resource,{reload:{async:!e?.forceReadFromFile,force:e?.forceReadFromFile},limits:e?.limits}),Bt(this.isResolved()),this}async saveAs(e){const t=await this._workingCopyManager.saveAs(this.resource,e);if(t)return{resource:t.resource}}static _isStoredFileWorkingCopy(e){return!(e&&e.capabilities&JS.Untitled)}};A9e=FB=D([_(5,hh)],A9e);class yrt extends ${constructor(e,t,i,s){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.configuration=void 0,this.onWillDispose=e.onWillDispose.bind(e),this._register(e.onDidChangeContent(r=>{for(const a of r.rawEvents)if(a.kind!==vd.Initialize&&!a.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const o=this._configurationService.getValue(tke.remoteSaving);(o||e.uri.scheme===_e.vscodeRemote)&&(this.configuration={backupDelay:1e4}),o&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){const e=await this.getNotebookSerializer();this.save=async(t,i)=>{if(i.isCancellationRequested)throw new Tc;try{return await e.save(this._notebookModel.uri,this._notebookModel.versionId,t,i)}catch(s){throw i.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===_e.vscodeRemote,error:s}),s}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),s={metadata:YX(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let o=0;for(const a of this._notebookModel.cells){const c={cellKind:a.cellKind,language:a.language,mime:a.mime,source:a.getValue(),outputs:[],internalMetadata:a.internalMetadata},l=this._configurationService.getValue(tke.outputBackupSizeLimit)*1024;if(e===BG.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{o+=h.data.byteLength})}),o>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=YX(a.metadata,d=>!i.options.transientCellMetadata[d]),s.cells.push(c)}const r=await i.notebookToData(s);if(t.isCancellationRequested)throw new Tc;return aQ(r)}async update(e,t){const i=await this.getNotebookSerializer(),s=await II(e),o=await i.dataToNotebook(s);if(t.isCancellationRequested)throw new Tc;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof tj))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let E9e=class{constructor(e,t,i,s){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s}async createModel(e,t,i){const s=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(s instanceof tj))throw new Error("CANNOT open file notebook with this provider");const o=await II(t),r=await s.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Tc;const a=this._notebookService.createNotebookTextModel(s.viewType,e,r,s.serializer.options);return new yrt(a,this._notebookService,this._configurationService,this._telemetryService)}};E9e=D([_(1,oD),_(2,Re),_(3,on)],E9e);const kYt="vs/workbench/api/browser/mainThreadNotebookSaveParticipant";let IYt=class{constructor(e){this._proxy=e.getProxy(et.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.model||!(e.model instanceof yrt))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(kYt,0,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,s).then(l=>{clearTimeout(o)}).then(a,c)});return qle(r,s)}},x9e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(IYt,e))}dispose(){this._saveParticipantDisposable.dispose()}};x9e=D([TO,_(1,be),_(2,fC)],x9e);let D9e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` -`,Kc,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};D9e=D([Zi(Ue.MainThreadInteractive),_(1,TPe)],D9e);const D8="vs/workbench/contrib/tasks/common/taskDefinitionRegistry",LYt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(D8,0,"The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:g(D8,1,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(D8,2,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:""}}};var f0e;(function(n){function e(t,i,s){if(!t)return;const o=zt(t.type)?t.type:void 0;if(!o||o.length===0){s.error(g(D8,3,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)zt(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?Vs(t.properties):{},when:t.when?ge.deserialize(t.when):void 0}}n.from=e})(f0e||(f0e={}));const TYt=Ap.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(n,e)=>{for(const t of n)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(D8,4,"Contributes task kinds"),type:"array",items:LYt}});class RYt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{TYt.setHandler((i,s)=>{this._schema=void 0;try{for(const o of s.removed){const r=o.value;for(const a of r)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const o of s.added){const r=o.value;for(const a of r){const c=f0e.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(s.removed.length>0||s.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){const e=[];for(const t of this.all()){const i={type:"object",additionalProperties:!1};t.required.length>0&&(i.required=t.required.slice(0)),t.properties!==void 0?i.properties=Vs(t.properties):i.properties=Object.create(null),i.properties.type={type:"string",enum:[t.taskType]},e.push(i)}this._schema={oneOf:e}}return this._schema}}const MYt=new RYt,NOe="vs/workbench/contrib/tasks/common/tasks",Srt="settings";new Y("taskRunning",!1,g(NOe,0,"Whether a task is currently running."));Be(NOe,1,"Tasks");var Foe;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(Foe||(Foe={}));const Art="$customized";(function(n){function e(t){if(!t)return n.Strong;switch(t.toLowerCase()){case"escape":return n.Escape;case"strong":return n.Strong;case"weak":return n.Weak;default:return n.Strong}}n.from=e})(Foe||(Foe={}));var WG;(function(n){n.defaults={cwd:"${workspaceFolder}"}})(WG||(WG={}));var HG;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(HG||(HG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"silent":return n.Silent;case"never":return n.Never;default:return n.Always}}n.fromString=e})(HG||(HG={}));var UG;(function(n){n[n.Never=1]="Never",n[n.OnProblem=2]="OnProblem",n[n.Always=3]="Always"})(UG||(UG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"never":return n.Never;case"onproblem":return n.OnProblem;default:return n.OnProblem}}n.fromString=e})(UG||(UG={}));var VG;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(VG||(VG={}));(function(n){function e(t){switch(t.toLowerCase()){case"shared":return n.Shared;case"dedicated":return n.Dedicated;case"new":return n.New;default:return n.Shared}}n.fromString=e})(VG||(VG={}));var Ooe;(function(n){n.defaults={echo:!0,reveal:HG.Always,revealProblems:UG.Never,focus:!1,panel:VG.Shared,showReuseMessage:!0,clear:!1}})(Ooe||(Ooe={}));var x_;(function(n){n[n.Shell=1]="Shell",n[n.Process=2]="Process",n[n.CustomExecution=3]="CustomExecution"})(x_||(x_={}));(function(n){function e(i){switch(i.toLowerCase()){case"shell":return n.Shell;case"process":return n.Process;case"customExecution":return n.CustomExecution;default:return n.Process}}n.fromString=e;function t(i){switch(i){case n.Shell:return"shell";case n.Process:return"process";case n.CustomExecution:return"customExecution";default:return"process"}}n.toString=t})(x_||(x_={}));var k9e;(function(n){function e(t){return zt(t)?t:t.value}n.value=e})(k9e||(k9e={}));var I9e;(function(n){n.Clean={_id:"clean",isDefault:!1},n.Build={_id:"build",isDefault:!1},n.Rebuild={_id:"rebuild",isDefault:!1},n.Test={_id:"test",isDefault:!1};function e(i){return i===n.Clean._id||i===n.Build._id||i===n.Rebuild._id||i===n.Test._id}n.is=e;function t(i){if(i!==void 0)return zt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}n.from=t})(I9e||(I9e={}));var Ek;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.Folder=3]="Folder"})(Ek||(Ek={}));var Ex;(function(n){n.Workspace="workspace",n.Extension="extension",n.InMemory="inMemory",n.WorkspaceFile="workspaceFile",n.User="user";function e(t){switch(t){case n.User:return Ot.USER;case n.WorkspaceFile:return Ot.WORKSPACE;default:return Ot.WORKSPACE_FOLDER}}n.toConfigurationTarget=e})(Ex||(Ex={}));var L9e;(function(n){n.parallel="parallel",n.sequence="sequence"})(L9e||(L9e={}));var p0e;(function(n){n[n.default=1]="default",n[n.folderOpen=2]="folderOpen"})(p0e||(p0e={}));var Boe;(function(n){n.defaults={reevaluateOnRerun:!0,runOn:p0e.default,instanceLimit:1}})(Boe||(Boe={}));class POe{constructor(e,t,i,s,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=s,this.configurationProperties=o,this._source=r}getDefinition(e){}getMapKey(){return this._id}getKey(){}getCommonTaskId(){const e={folder:this.getFolderId(),id:this._id};return JSON.stringify(e)}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(e,t=!1){if(e===void 0)return!1;if(zt(e))return e===this._label||e===this.configurationProperties.identifier||t&&e===this._id;const i=this.getDefinition(!0);return i!==void 0&&i._key===e._key}getQualifiedLabel(){const e=this.getWorkspaceFolder();return e?`${this._label} (${e.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(e){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),e&&(this._taskLoadMessages=this._taskLoadMessages.concat(e))}get taskLoadMessages(){return this._taskLoadMessages}}class k8 extends POe{constructor(e,t,i,s,o,r,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=r,o&&(this.command=o)}clone(){return new k8(this._id,this._source,this._label,this.type,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(e=!1){if(e&&this._source.customizes!==void 0)return this._source.customizes;{let t;switch(this.command?this.command.runtime:void 0){case x_.Shell:t="shell";break;case x_.Process:t="process";break;case x_.CustomExecution:t="customExecution";break;case void 0:t="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:t,_key:this._id,id:this._id}}}static is(e){return e instanceof k8}getMapKey(){const e=this._source.config.workspaceFolder;return e?`${e.uri.toString()}|${this._id}|${this.instance}`:`${this._id}|${this.instance}`}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getCommonTaskId(){return this._source.customizes?super.getCommonTaskId():this.getKey()??super.getCommonTaskId()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new k8(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class I8 extends POe{constructor(e,t,i,s,o,r,a){super(e,i,s,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof I8}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}}class GM extends POe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,s,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new GM(this._id,this._source,this._label,this.type,this.defines,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}getDefinition(){return this.defines}static is(e){return e instanceof GM}getMapKey(){const e=this._source.workspaceFolder;return e?`${this._source.scope.toString()}|${e.uri.toString()}|${this._id}|${this.instance}`:`${this._source.scope.toString()}|${this._id}|${this.instance}`}getFolderId(){if(this._source.scope===Ek.Folder&&this._source.workspaceFolder)return this._source.workspaceFolder.uri.toString()}getKey(){const e={type:"contributed",scope:this._source.scope,id:this._id};return e.folder=this.getFolderId(),JSON.stringify(e)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(e){return new GM(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var Woe;(function(n){n[n.Process=1]="Process",n[n.Terminal=2]="Terminal"})(Woe||(Woe={}));(function(n){n._default=n.Terminal})(Woe||(Woe={}));var T9e;(function(n){n[n.V0_1_0=1]="V0_1_0",n[n.V2_0_0=2]="V2_0_0"})(T9e||(T9e={}));var Nv;(function(n){n.DependsOnStarted="dependsOnStarted",n.AcquiredInput="acquiredInput",n.Start="start",n.ProcessStarted="processStarted",n.Active="active",n.Inactive="inactive",n.Changed="changed",n.Terminated="terminated",n.ProcessEnded="processEnded",n.End="end"})(Nv||(Nv={}));var Hoe;(function(n){n.SingleRun="singleRun",n.Background="background"})(Hoe||(Hoe={}));var R9e;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.FolderOpen=2]="FolderOpen",n[n.ConfigurationChange=3]="ConfigurationChange",n[n.Reconnect=4]="Reconnect"})(R9e||(R9e={}));var M9e;(function(n){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Hoe.Background:Hoe.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:Nv.Start,terminalId:l,resolvedVariables:d}}n.start=t;function i(c,l,d){return{...e(c),kind:Nv.ProcessStarted,terminalId:l,processId:d}}n.processStarted=i;function s(c,l,d){return{...e(c),kind:Nv.ProcessEnded,terminalId:l,exitCode:d}}n.processEnded=s;function o(c,l,d){return{...e(c),kind:Nv.Terminated,exitReason:d,terminalId:l}}n.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}n.general=r;function a(){return{kind:Nv.Changed}}n.changed=a})(M9e||(M9e={}));var Uoe;(function(n){function e(i){const s=Object.keys(i).sort();let o="";for(const r of s){let a=i[r];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),o+=r+","+a+","}return o}function t(i){const o={_key:e(i),type:i.taskType};return Object.assign(o,i),o}n.create=t})(Uoe||(Uoe={}));var N9e;(function(n){n.AutoDetect="task.autoDetect",n.SaveBeforeRun="task.saveBeforeRun",n.ShowDecorations="task.showDecorations",n.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",n.SlowProviderWarning="task.slowProviderWarning",n.QuickOpenHistory="task.quickOpen.history",n.QuickOpenDetail="task.quickOpen.detail",n.QuickOpenSkip="task.quickOpen.skip",n.QuickOpenShowAll="task.quickOpen.showAll",n.AllowAutomaticTasks="task.allowAutomaticTasks",n.Reconnection="task.reconnection",n.VerboseLogging="task.verboseLogging"})(N9e||(N9e={}));var P9e;(function(n){n.Tasks="tasks",n.SuppressTaskName="tasks.suppressTaskName",n.Windows="tasks.windows",n.Osx="tasks.osx",n.Linux="tasks.linux",n.ShowOutput="tasks.showOutput",n.IsShellCommand="tasks.isShellCommand",n.ServiceTestSetting="tasks.service.testSetting"})(P9e||(P9e={}));var m0e;(function(n){function e(t,i){const s=MYt.get(t.type);if(s===void 0){const c=Vs(t);return delete c._key,Uoe.create(c)}const o=Object.create(null);o.type=s.taskType;const r=new Set;s.required.forEach(c=>r.add(c));const a=s.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)o[c]=l;else if(r.has(c)){const d=a[c];if(d.default!==void 0)o[c]=Vs(d.default);else switch(d.type){case"boolean":o[c]=!1;break;case"number":case"integer":o[c]=0;break;case"string":o[c]="";break;default:i.error(g(NOe,2,"Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.",JSON.stringify(t,void 0,0),c));return}}}return Uoe.create(o)}n.createTaskIdentifier=e})(m0e||(m0e={}));const NYt="vs/workbench/api/browser/mainThreadTask";var Voe;(function(n){function e(t){return{id:t.id,task:Pp.from(t.task)}}n.from=e})(Voe||(Voe={}));var _0e;(function(n){function e(t,i){return{id:t.id,processId:i}}n.from=e})(_0e||(_0e={}));var v0e;(function(n){function e(t,i){return{id:t.id,exitCode:i}}n.from=e})(v0e||(v0e={}));var zoe;(function(n){function e(i){const s=Object.assign(Object.create(null),i);return delete s._key,s}n.from=e;function t(i,s){let o=m0e.createTaskIdentifier(i,console);return o===void 0&&s&&(o={_key:Dr(),type:"$executeOnly"}),o}n.to=t})(zoe||(zoe={}));var $oe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Ooe.defaults:Object.assign(Object.create(null),Ooe.defaults,i)}n.to=t})($oe||($oe={}));var Goe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Boe.defaults:Object.assign(Object.create(null),Boe.defaults,i)}n.to=t})(Goe||(Goe={}));var qoe;(function(n){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}n.from=e;function t(i){return i==null?WG.defaults:{cwd:i.cwd||WG.defaults.cwd,env:i.env}}n.to=t})(qoe||(qoe={}));var L8;(function(n){function e(s){const o=s;return o&&!!o.process}n.is=e;function t(s){const o=zt(s.name)?s.name:s.name.value,r=s.args?s.args.map(c=>zt(c)?c:c.value):[],a={process:o,args:r};return s.options&&(a.options=qoe.from(s.options)),a}n.from=t;function i(s){const o={runtime:x_.Process,name:s.process,args:s.args,presentation:void 0};return o.options=qoe.to(s.options),o}n.to=i})(L8||(L8={}));var Qoe;(function(n){function e(i){if(i==null)return;const s={cwd:i.cwd||WG.defaults.cwd,env:i.env};return i.shell&&(s.executable=i.shell.executable,s.shellArgs=i.shell.args,s.shellQuoting=i.shell.quoting),s}n.from=e;function t(i){if(i==null)return;const s={cwd:i.cwd,env:i.env};return i.executable&&(s.shell={executable:i.executable},i.shellArgs&&(s.shell.args=i.shellArgs),i.shellQuoting&&(s.shell.quoting=i.shellQuoting)),s}n.to=t})(Qoe||(Qoe={}));var T8;(function(n){function e(s){const o=s;return o&&(!!o.commandLine||!!o.command)}n.is=e;function t(s){const o={};return s.name&&zt(s.name)&&(s.args===void 0||s.args===null||s.args.length===0)?o.commandLine=s.name:(o.command=s.name,o.args=s.args),s.options&&(o.options=Qoe.from(s.options)),o}n.from=t;function i(s){const o={runtime:x_.Shell,name:s.commandLine?s.commandLine:s.command,args:s.args,presentation:void 0};return s.options&&(o.options=Qoe.to(s.options)),o}n.to=i})(T8||(T8={}));var RR;(function(n){function e(s){const o=s;return o&&o.customExecution==="customExecution"}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s){return{runtime:x_.CustomExecution,presentation:void 0}}n.to=i})(RR||(RR={}));var joe;(function(n){function e(i){const s={label:i.label};return i.kind===Ex.Extension?(s.extensionId=i.extension,i.workspaceFolder?s.scope=i.workspaceFolder.uri:s.scope=i.scope):i.kind===Ex.Workspace&&(s.extensionId="$core",s.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:Ek.Global),s}n.from=e;function t(i,s){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==Ek.Global?s.getWorkspace().folders.length===0?(o=Ek.Global,r=void 0):(o=Ek.Folder,r=s.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=Ek.Folder,r=s.getWorkspaceFolder(P.revive(i.scope))??void 0),{kind:Ex.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}n.to=t})(joe||(joe={}));var Koe;(function(n){function e(t){const i=t;return i&&zt(i.id)&&!!i.workspaceFolder}n.is=e})(Koe||(Koe={}));var Pp;(function(n){function e(i){if(i==null||!k8.is(i)&&!GM.is(i)&&!I8.is(i))return;const s={_id:i._id,name:i.configurationProperties.name,definition:zoe.from(i.getDefinition(!0)),source:joe.from(i._source),execution:void 0,presentationOptions:!I8.is(i)&&i.command?$oe.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:GM.is(i)?i.hasDefinedMatchers:!1,runOptions:Goe.from(i.runOptions)};if(s.group=w0e.from(i.configurationProperties.group),i.configurationProperties.detail&&(s.detail=i.configurationProperties.detail),!I8.is(i)&&i.command)switch(i.command.runtime){case x_.Process:s.execution=L8.from(i.command);break;case x_.Shell:s.execution=T8.from(i.command);break;case x_.CustomExecution:s.execution=RR.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)zt(o)&&s.problemMatchers.push(o);return s}n.from=e;function t(i,s,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(T8.is(i.execution)?c=T8.to(i.execution):L8.is(i.execution)?c=L8.to(i.execution):RR.is(i.execution)&&(c=RR.to(i.execution))),!c)return;c.presentation=$oe.to(i.presentationOptions);const l=joe.to(i.source,s),d=g(NYt,0,"{0}: {1}",l.label,i.name),h=zoe.to(i.definition,o),u=RR.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new GM(u,l,d,h.type,h,c,i.hasDefinedMatchers,Goe.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:r,hide:a})}n.to=t})(Pp||(Pp={}));var w0e;(function(n){function e(t){if(t!==void 0)return{_id:typeof t=="string"?t:t._id,isDefault:typeof t=="string"||typeof t.isDefault=="string"?!1:t.isDefault}}n.from=e})(w0e||(w0e={}));var b0e;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(b0e||(b0e={}));let F9e=class extends ${constructor(e,t,i,s){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=s,this._proxy=e.getProxy(et.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===Nv.Changed)return;const r=o.__task;if(o.kind===Nv.Start){const a=Voe.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&RR.is(a.task.execution)&&o.resolvedVariables){const l={};for(const[d,h]of o.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(r.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,o.terminalId,c)}else o.kind===Nv.ProcessStarted?this._proxy.$onDidStartTaskProcess(_0e.from(r.getTaskExecution(),o.processId)):o.kind===Nv.ProcessEnded?this._proxy.$onDidEndTaskProcess(v0e.from(r.getTaskExecution(),o.exitCode)):o.kind===Nv.End&&this._proxy.$OnDidEndTask(Voe.from(r.getTaskExecution()))}))}dispose(){for(const e of this._providers.values())e.disposable.dispose();this._providers.clear(),super.dispose()}$createTaskId(e){return new Promise((t,i)=>{const s=Pp.to(e,this._workspaceContextServer,!0);s?t(s._id):i(new Error("Task could not be created from DTO"))})}$registerTaskProvider(e,t){const i={provideTasks:o=>Promise.resolve(this._proxy.$provideTasks(e,o)).then(r=>{const a=[];for(const c of r.tasks){const l=Pp.to(c,this._workspaceContextServer,!0);l?a.push(l):console.error(`Task System: can not convert task: ${JSON.stringify(c.definition,void 0,0)}. Task will be dropped`)}return{tasks:a,extension:r.extension}}),resolveTask:o=>{const r=Pp.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Pp.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},s=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:s,provider:i}),Promise.resolve(void 0)}$unregisterTaskProvider(e){const t=this._providers.get(e);return t&&(t.disposable.dispose(),this._providers.delete(e)),Promise.resolve(void 0)}$fetchTasks(e){return this._taskService.tasks(b0e.to(e)).then(t=>{const i=[];for(const s of t){const o=Pp.from(s);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),s=P.revive(e);i.configuration?.toString()===s.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(s)}return t}async $getTaskExecution(e){if(Koe.is(e)){const t=this.getWorkspace(e.workspaceFolder);if(t){const i=await this._taskService.getTask(t,e.id,!0);if(i)return{id:i._id,task:Pp.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Pp.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Pp.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Koe.is(e)){const s=this.getWorkspace(e.workspaceFolder);s?this._taskService.getTask(s,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Pp.from(o)};this._taskService.run(o).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(r)},a=>{}),t(r)}},o=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const s=Pp.to(e,this._workspaceContextServer,!0);this._taskService.run(s).then(void 0,r=>{});const o={id:s._id,task:Pp.from(s)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,s)=>{this._taskService.getActiveTasks().then(o=>{for(const r of o)if(e===r._id){this._taskService.extensionCallbackTaskComplete(r,t).then(a=>{i(void 0)},a=>{s(a)});return}s(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(s=>{for(const o of s)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new hc("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Hh.Web;break;case"win32":i=Hh.Windows;break;case"darwin":i=Hh.Mac;break;case"linux":i=Hh.Linux;break;default:i=oQe}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:s=>P.from({scheme:t.scheme,authority:t.authority,path:s}),context:this._extHostContext,resolveVariables:(s,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(s.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(s,l,"tasks",void 0,r).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(s,o,r)=>this._proxy.$findExecutable(s,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};F9e=D([Zi(Ue.MainThreadTask),_(1,XZe),_(2,Ti),_(3,_et)],F9e);let O9e=class extends ${constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new Zo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};O9e=D([Zi(Ue.MainThreadLabelService),_(1,eo)],O9e);var jm;(function(n){n.Http="http",n.Https="https"})(jm||(jm={}));var zE;(function(n){n.ConstantPrivate="constantPrivate",n.Private="private",n.Public="public"})(zE||(zE={}));var rk;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(rk||(rk={}));function PYt(n){if(n.scheme!=="http"&&n.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(n.authority);if(e)return{address:e[1],port:+e[2]}}const zG=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function $G(n){return zG.indexOf(n)>=0}const Yoe=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function GG(n){return Yoe.indexOf(n)>=0}class FYt{constructor(e,t,i){this.remoteAddress=e,this.localAddress=t,this._dispose=i,this._onDispose=new I,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}let B9e=class{constructor(e,t){this.logService=e,this.configurationService=t,this._onTunnelOpened=new I,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new I,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new I,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],t=Array.from(this._tunnels.values());for(const i of t){const s=Array.from(i.values());for(const o of s){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){for(const e of this._tunnels.values()){for(const{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,s,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:s,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(GG(e)||$G(e))&&(e=zG[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,s,o,r=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${o}.`);const l=this._tunnelProvider??e;if(!l)return;if(t||(t="localhost"),s||(s=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const d=this.retainOrCreateTunnel(l,t,i,s,o,r,a,c);return d?d.then(h=>{if(h){if(typeof h=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),h}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const u=this.makeTunnel(h);return(h.tunnelRemoteHost!==t||h.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&h.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(u),u}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),d)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const t=this._tunnels.get(e.tunnelRemoteHost);if(t){const i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);const s=i.value.then(async o=>{o&&typeof o!="string"&&(await o.dispose(!0),this._onTunnelClosed.fire({host:o.tunnelRemoteHost,port:o.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),s}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);const i=this._tunnels.get(e);if(i&&i.has(t)){const s=i.get(t);s.refcount=0,await this.tryDisposeTunnel(e,t,s)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){const i=this._tunnels.get(e);if(i){const s=i.get(t),o=s?await s.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];$G(e)?(i.push(...zG),i.push(...Yoe)):GG(e)&&i.push(...Yoe);const s=i.map(o=>this._tunnels.get(o));for(const o of s){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!PYt(e)}createWithProvider(e,t,i,s,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${s}.`);const c=i;this._factoryInProgress.add(c);const l=s===void 0?i:s,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:s,privacy:r,public:r?r!==zE.Private:void 0,protocol:a},u=e.forwardPort(h,d);return u?(this.addTunnelToMap(t,i,u),u.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),u}};B9e=D([_(0,Ze),_(1,Re)],B9e);const Sg=ae("IExtHostInitDataService"),gr=ae("IExtHostRpcService");class OYt{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}const W9e="vs/workbench/api/common/extHostTunnelService";class BYt extends FYt{}var Joe;(function(n){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?zE.Public:zE.Private),protocol:i.protocol}}n.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==zE.ConstantPrivate&&i.privacy!==zE.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}n.fromServiceTunnel=t})(Joe||(Joe={}));const FOe=ae("IExtHostTunnelService");let C0e=class extends ${constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new I,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);const i=await this._proxy.$openTunnel(t,e.displayName);if(i){const s=new BYt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(s),s}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");const i=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(i,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,i),new oo(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,s,o){const r=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];r.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:s},o)}catch{h=await l.provider.providePortAttributes(d,i,s,o)}return{providedAttributes:h,port:d}})))}const a=r.filter(c=>!!c.providedAttributes);return a.length>0?a.map(c=>({autoForwardAction:c.providedAttributes.autoForwardAction,port:c.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(s,o)=>await e.provideTunnel(s,o,qe.None)??void 0;const i=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(i),Promise.resolve(Ee(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0)}))}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());const i=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(i){this._forwardPortProvider=i;let s=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&s.length===0&&(s=[{id:"private",label:g(W9e,0,"Private"),themeIcon:"lock"},{id:"public",label:g(W9e,1,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:s,protocol:!0}:void 0;this._proxy.$setTunnelProvider(o)}}else this._forwardPortProvider=void 0;return Ee(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){const i=this._extensionTunnels.get(e.host);i.has(e.port)&&(t&&i.get(e.port).disposeListener.dispose(),await i.get(e.port).tunnel.dispose(),i.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");const i=this._forwardPortProvider(e,t);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),i!==void 0){const s=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),s===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);const o=this._register(s.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(s.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:s,disposeListener:o}),Joe.fromApiTunnel(s)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(i){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),i instanceof Error)return i.message}}async $applyCandidateFilter(e){const t=await Promise.all(e.map(s=>this._showCandidatePort(s.host,s.port,s.detail??""))),i=e.filter((s,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(s=>s.port).join(", ")} to ${i.map(s=>s.port).join(", ")}`),i}};C0e=D([_(0,gr),_(1,Sg),_(2,Ze)],C0e);const qG="vs/workbench/services/remote/common/tunnelModel",WYt=10*1e3,hY="remote.tunnels.toRestore",ime="remote.tunnels.toRestoreExpiration",HYt=1e3*60*60*24*14,H9e="onTunnel",Ert=new Y("forwardedPortsViewEnabled",!1,g(qG,0,"Whether the Ports view is enabled."));function UYt(n){const e=n.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);if(e)return{host:e[1]?.substring(0,e[1].length-1)||"localhost",port:Number(e[2])}}var qM;(function(n){n.Other="Other",n.User="User",n.AutoForwardEnd="AutoForwardEnd"})(qM||(qM={}));var Tb;(function(n){n[n.User=0]="User",n[n.Auto=1]="Auto",n[n.Extension=2]="Extension"})(Tb||(Tb={}));const nme={source:Tb.User,description:g(qG,1,"User Forwarded")};Tb.Auto,g(qG,2,"Auto Forwarded");function U9e(n,e,t){const i=n.get(Hf(e,t));if(i)return i;if($G(e))for(const s of zG){const o=Hf(s,t);if(n.has(o))return n.get(o)}else if(GG(e))for(const s of Yoe){const o=Hf(s,t);if(n.has(o))return n.get(o)}}function kf(n,e,t){const i=U9e(n,e,t);if(i)return i;const s=GG(e)?"localhost":$G(e)?"0.0.0.0":void 0;if(s)return U9e(n,s,t)}function Hf(n,e){return n+":"+e}var ak;(function(n){n.Notify="notify",n.OpenBrowser="openBrowser",n.OpenBrowserOnce="openBrowserOnce",n.OpenPreview="openPreview",n.Silent="silent",n.Ignore="ignore"})(ak||(ak={}));function VYt(n){return n&&"host"in n&&typeof n.host=="string"&&"port"in n&&typeof n.port=="number"&&(!("detail"in n)||typeof n.detail=="string")&&(!("pid"in n)||typeof n.pid=="string")}const Ig=class Ig extends ${constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(Ig.SETTING)||t.affectsConfiguration(Ig.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let s=this.findNextIndex(e,t,i,this.portsAttributes,0);const o={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;s>=0;){const r=this.portsAttributes[s];r.key===e?(o.onAutoForward=r.onAutoForward??o.onAutoForward,o.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,o.label=r.label??o.label,o.requireLocalPort=r.requireLocalPort,o.protocol=r.protocol):(o.onAutoForward=o.onAutoForward??r.onAutoForward,o.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,o.label=o.label??r.label,o.requireLocalPort=o.requireLocalPort!==void 0?o.requireLocalPort:void 0,o.protocol=o.protocol??r.protocol),s=this.findNextIndex(e,t,i,this.portsAttributes,s+1)}return o.onAutoForward!==void 0||o.elevateIfNeeded!==void 0||o.label!==void 0||o.requireLocalPort!==void 0||o.protocol!==void 0?o:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&zt(e.host)&&jc(e.port)}findNextIndex(e,t,i,s,o){if(o>=s.length)return-1;const r=!$G(t)&&!GG(t),c=s.slice(o).findIndex(l=>jc(l.key)?r?!1:l.key===e:this.hasStartEnd(l.key)?r?!1:e>=l.key.start&&e<=l.key.end:this.hasHostAndPort(l.key)?e===l.key.port&&t===l.key.host:i?l.key.test(i):!1);return c>=0?c+o:-1}readSetting(){const e=this.configurationService.getValue(Ig.SETTING);if(!e||!fo(e))return[];const t=[];for(const s in e){if(s===void 0)continue;const o=e[s];let r;if(Number(s))r=Number(s);else if(zt(s))if(Ig.RANGE.test(s)){const a=s.match(Ig.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(Ig.HOST_AND_PORT.test(s)){const a=s.match(Ig.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(s)}catch{}a&&(r=a)}r&&t.push({key:r,elevateIfNeeded:o.elevateIfNeeded,onAutoForward:o.onAutoForward,label:o.label,requireLocalPort:o.requireLocalPort,protocol:o.protocol})}const i=this.configurationService.getValue(Ig.DEFAULTS);return i&&(this.defaultPortAttributes={elevateIfNeeded:i.elevateIfNeeded,label:i.label,onAutoForward:i.onAutoForward,requireLocalPort:i.requireLocalPort,protocol:i.protocol}),this.sortAttributes(t)}sortAttributes(e){function t(i,s){return jc(i.key)?i.key:s.hasStartEnd(i.key)?i.key.start:s.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,s)=>t(i,this)-t(s,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case rk.Notify:return ak.Notify;case rk.OpenBrowser:return ak.OpenBrowser;case rk.OpenBrowserOnce:return ak.OpenBrowserOnce;case rk.OpenPreview:return ak.OpenPreview;case rk.Silent:return ak.Silent;case rk.Ignore:return ak.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(Ig.SETTING).userRemoteValue;let r;!o||!fo(o)?r={}:r=Vs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(Ig.SETTING,r,i)}};Ig.SETTING="remote.portsAttributes",Ig.DEFAULTS="remote.otherPortsAttributes",Ig.RANGE=/^(\d+)\-(\d+)$/,Ig.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Xoe=Ig,QG=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=s,this.remoteAuthorityResolverService=o,this.workspaceContextService=r,this.logService=a,this.dialogService=c,this.extensionService=l,this.contextKeyService=d,this.inProgress=new Map,this._onForwardPort=new I,this.onForwardPort=this._onForwardPort.event,this._onClosePort=new I,this.onClosePort=this._onClosePort.event,this._onPortName=new I,this.onPortName=this._onPortName.event,this._onCandidatesChanged=new I,this.onCandidatesChanged=this._onCandidatesChanged.event,this._onEnvironmentTunnelsSet=new I,this.onEnvironmentTunnelsSet=this._onEnvironmentTunnelsSet.event,this._environmentTunnelsSet=!1,this.restoreListener=void 0,this.restoreComplete=!1,this.onRestoreComplete=new I,this.unrestoredExtensionTunnels=new Map,this.sessionCachedProperties=new Map,this.portAttributesProviders=[],this.mismatchCooldown=new Date,this.configPortsAttributes=new Xoe(i),this.tunnelRestoreValue=this.getTunnelRestoreValue(),this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes,this)),this.forwarded=new Map,this.remoteTunnels=new Map,this.tunnelService.tunnels.then(async h=>{const u=await this.getAttributes(h.map(f=>({port:f.tunnelRemotePort,host:f.tunnelRemoteHost})));for(const f of h)if(f.localAddress){const p=Hf(f.tunnelRemoteHost,f.tunnelRemotePort),m=kf(this._candidates??new Map,f.tunnelRemoteHost,f.tunnelRemotePort);this.forwarded.set(p,{remotePort:f.tunnelRemotePort,remoteHost:f.tunnelRemoteHost,localAddress:f.localAddress,protocol:u?.get(f.tunnelRemotePort)?.protocol??jm.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:nme}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Hf(h.tunnelRemoteHost,h.tunnelRemotePort);if(!kf(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=kf(this._candidates??new Map,h.tunnelRemoteHost,h.tunnelRemotePort),p=(await this.getAttributes([{port:h.tunnelRemotePort,host:h.tunnelRemoteHost}]))?.get(h.tunnelRemotePort);this.forwarded.set(u,{remoteHost:h.tunnelRemoteHost,remotePort:h.tunnelRemotePort,localAddress:h.localAddress,protocol:p?.protocol??jm.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:nme})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,qM.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(H9e))?(this.contextKeyService.createKey(Ert.key,!0),!0):!1}checkExtensionActivationEvents(){if(this.extensionHasActivationEvent())return;const e=this._register(this.extensionService.onDidRegisterExtensions(()=>{this.extensionHasActivationEvent()&&e.dispose()}))}async onTunnelClosed(e,t){const i=Hf(e.host,e.port);this.forwarded.has(i)&&(this.forwarded.delete(i),await this.storeForwarded(),this._onClosePort.fire(e))}makeLocalUri(e,t){if(e.startsWith("http"))return P.parse(e);const i=t?.protocol??"http";return P.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Ed(t.configuration.path):t.folders.length>0?Ed(t.folders[0].uri.path):void 0;if(i===void 0){this.logService.debug("Could not get workspace hash for forwarded ports storage key.");return}return`${e}.${this.environmentService.remoteAuthority}.${i}`}async getTunnelRestoreStorageKey(){return this.addStorageKeyPostfix(hY)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(ime)}async getTunnelRestoreValue(){const e=this.storageService.get(hY,ke.WORKSPACE);if(e)return this.storageService.remove(hY,ke.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,ke.PROFILE)}async restoreForwarded(){if(this.cleanupExpiredTunnelsForRestore(),this.configurationService.getValue("remote.restoreForwardedPorts")){const e=await this.tunnelRestoreValue;if(e&&e!==this.knownPortsRestoreValue){const t=JSON.parse(e)??[];this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${t.map(i=>i.remotePort).join(", ")}`);for(const i of t){const s=kf(this.detected,i.remoteHost,i.remotePort);i.source.source!==Tb.Extension&&!s||i.source.source===Tb.Extension&&s?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===Tb.Extension&&!s&&this.unrestoredExtensionTunnels.set(Hf(i.remoteHost,i.remotePort),i)}}}if(this.restoreComplete=!0,this.onRestoreComplete.fire(),!this.restoreListener){const e=await this.getTunnelRestoreStorageKey();this.restoreListener=this._register(new Z),this.restoreListener.add(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,ke.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(ke.PROFILE,ln.USER).filter(t=>t.startsWith(ime));for(const t of e){const i=this.storageService.getNumber(t,ke.PROFILE);if(i&&i({remoteHost:r.remoteHost,remotePort:r.remotePort,localPort:r.localPort,name:r.name,localAddress:r.localAddress,localUri:r.localUri,protocol:r.protocol,source:r.source}));let i;e.length>0&&(i=JSON.stringify(t));const s=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&s&&o?(this.storageService.remove(s,ke.PROFILE),this.storageService.remove(o,ke.PROFILE)):i!==this.knownPortsRestoreValue&&s&&o&&(this.storageService.store(s,i,ke.PROFILE,ln.USER),this.storageService.store(o,Date.now()+HYt,ke.PROFILE,ln.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const s=new Date;if(this.mismatchCooldown.getTime()+WYt>s.getTime())return;this.mismatchCooldown=s;const o=g(qG,3,`Local port {0} could not be used for forwarding to remote port {1}. +`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(Bm,10," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(B1,this)),this.tree=this._register(this.instantiationService.createInstance(XIe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof cue?g(Bm,11,"Comments for current workspace"):e instanceof lm?g(Bm,12,"Comments in {0}, full path {1}",ui(e.resource),e.resource.fsPath):e instanceof Ly?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return jIe.value}}})),this._register(this.tree.onDidOpen(e=>{this.openFile(e.element,e.editorOptions.pinned,e.editorOptions.preserveFocus,e.sideBySide)})),this._register(this.tree.onDidChangeModel(()=>{this.updateSomeCommentsExpanded()})),this._register(this.tree.onDidChangeCollapseState(()=>{this.updateSomeCommentsExpanded()}))}openFile(e,t,i,s){if(!e||!(e instanceof lm||e instanceof Ly))return;const o=e instanceof lm?e.commentThreads[0].thread:e.thread,r=e instanceof lm?e.commentThreads[0].comment:void 0;return _Yt(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,s)}async refresh(){if(this.tree&&this.isVisible()&&(this.hasCommentsContextKey.set(this.commentService.commentsModel.hasCommentThreads()),this.treeContainer.classList.toggle("hidden",!this.commentService.commentsModel.hasCommentThreads()),this.cachedFilterStats=void 0,this.renderMessage(),this.tree?.setChildren(null,p9e(this.commentService.commentsModel)),this.tree.getSelection().length===0&&this.commentService.commentsModel.hasCommentThreads())){const e=this.commentService.commentsModel.resourceCommentThreads[0].commentThreads[0];e&&(this.tree.setFocus([e]),this.tree.setSelection([e]))}}onAllCommentsChanged(e){this.cachedFilterStats=void 0,this.totalComments+=e.commentThreads.length;for(const t of e.commentThreads);this.refresh()}onCommentsUpdated(e){this.cachedFilterStats=void 0,this.totalComments+=e.added.length,this.totalComments-=e.removed.length;for(const t of this.commentService.commentsModel.resourceCommentThreads)for(const i of t.commentThreads);this.refresh()}onDataProviderDeleted(e){this.cachedFilterStats=void 0,this.totalComments=0,this.refresh()}updateSomeCommentsExpanded(){this.someCommentsExpandedContextKey.set(this.isSomeCommentsExpanded())}areAllCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(this.tree.isCollapsed(e.current()))return!1;return!0}isSomeCommentsExpanded(){if(!this.tree)return!1;const e=this.tree.navigate();for(;e.next();)if(!this.tree.isCollapsed(e.current()))return!0;return!1}};c0e=D([_(1,be),_(2,z_),_(3,_i),_(4,Re),_(5,Pe),_(6,Vr),_(7,ti),_(8,fr),_(9,pn),_(10,sD),_(11,rn),_(12,el),_(13,_o),_(14,on)],c0e);const jz="vs/workbench/browser/parts/views/viewPaneContainer",CYt=new Te("Views");Xs.appendMenuItem(Te.ViewContainerTitle,{submenu:CYt,title:g(jz,0,"Views"),order:1});var cu;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(cu||(cu={}));const hle=class hle extends VMe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,s,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=s,this.cleanupOverlayScheduler=this._register(new yn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=hle.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.paneElement.removeChild(this.container),this.paneElement.classList.remove("dragged-over")})),this.overlay=document.createElement("div"),this.overlay.classList.add("pane-overlay-indicator"),this.container.appendChild(this.overlay),this.registerListeners(),this.updateStyles()}updateStyles(){this.overlay.style.backgroundColor=this.getColor(this.location===Sr.Panel?FZe:OZe)||"";const e=this.getColor(co);this.overlay.style.outlineColor=e||"",this.overlay.style.outlineOffset=e?"-2px":"",this.overlay.style.outlineStyle=e?"dashed":"",this.overlay.style.outlineWidth=e?"2px":"",this.overlay.style.borderColor=e||"",this.overlay.style.borderStyle="solid",this.overlay.style.borderWidth="0px"}registerListeners(){this._register(new yZ(this.container,{onDragOver:e=>{this.positionOverlay(e.offsetX,e.offsetY),this.cleanupOverlayScheduler.isScheduled()&&this.cleanupOverlayScheduler.cancel()},onDragLeave:e=>this.dispose(),onDragEnd:e=>this.dispose(),onDrop:e=>{this.dispose()}})),this._register(pe(this.container,xe.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,s=this.paneElement.clientHeight,o=i/2,r=s/2;let a;switch(this.orientation===vi.VERTICAL?t=r&&(a=cu.DOWN):this.orientation===vi.HORIZONTAL&&(e=o&&(a=cu.RIGHT)),a){case cu.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case cu.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case cu.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case cu.RIGHT:this.doPositionOverlay({top:"0",right:"0",width:"50%",height:"100%"});break;default:{let c="0",l="0",d="100%",h="100%";if(this.bounds){const u=this.container.getBoundingClientRect();c=`${this.bounds.top-u.top}px`,l=`${this.bounds.left-u.left}px`,h=`${this.bounds.bottom-this.bounds.top}px`,d=`${this.bounds.right-this.bounds.left}px`}this.doPositionOverlay({top:c,left:l,width:d,height:h})}}this.orientation===vi.VERTICAL&&s<=25||this.orientation===vi.HORIZONTAL&&i<=25?this.doUpdateOverlayBorder(a):this.doUpdateOverlayBorder(void 0),this.overlay.style.opacity="1",setTimeout(()=>this.overlay.classList.add("overlay-move-transition"),0),this._currentDropOperation=a}doUpdateOverlayBorder(e){this.overlay.style.borderTopWidth=e===cu.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===cu.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===cu.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===cu.RIGHT?"2px":"0px"}doPositionOverlay(e){this.container.style.height="100%",this.overlay.style.top=e.top||"",this.overlay.style.left=e.left||"",this.overlay.style.bottom=e.bottom||"",this.overlay.style.right=e.right||"",this.overlay.style.width=e.width,this.overlay.style.height=e.height}contains(e){return e===this.container||e===this.overlay}dispose(){super.dispose(),this._disposed=!0}};hle.OVERLAY_ID="monaco-pane-drop-overlay";let x2=hle,l0e=class extends Oie{constructor(e,t,i,s,o){const r=s.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",aie(i.getViewContainerLocation(t)));super(Te.ViewContainerTitle,Te.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(T.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(aie(i.getViewContainerLocation(t)))))}};l0e=D([_(2,z_),_(3,Pe),_(4,_c)],l0e);let d0e=class extends wst{get onDidSashChange(){return ws(this.paneview).onDidSashChange}get panes(){return this.paneItems.map(e=>e.pane)}get views(){return this.panes}get length(){return this.paneItems.length}get menuActions(){return this._menuActions}constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=s,this.layoutService=o,this.contextMenuService=r,this.telemetryService=a,this.extensionService=c,this.storageService=d,this.contextService=h,this.viewDescriptorService=u,this.paneItems=[],this.visible=!1,this.areExtensionsReady=!1,this.didLayout=!1,this._onTitleAreaUpdate=this._register(new I),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidAddViews=this._register(new I),this.onDidAddViews=this._onDidAddViews.event,this._onDidRemoveViews=this._register(new I),this.onDidRemoveViews=this._onDidRemoveViews.event,this._onDidChangeViewVisibility=this._register(new I),this.onDidChangeViewVisibility=this._onDidChangeViewVisibility.event,this._onDidFocusView=this._register(new I),this.onDidFocusView=this._onDidFocusView.event,this._onDidBlurView=this._register(new I),this.onDidBlurView=this._onDidBlurView.event;const f=this.viewDescriptorService.getViewContainerById(e);if(!f)throw new Error("Could not find container");this.viewContainer=f,this.visibleViewsStorageId=`${e}.numberOfVisibleViews`,this.visibleViewsCountFromCache=this.storageService.getNumber(this.visibleViewsStorageId,ke.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new j4t(e,this.options)),this._boundarySashes&&this.paneview.setBoundarySashes(this._boundarySashes),this._register(this.paneview.onDidDrop(({from:c,to:l})=>this.movePane(c,l))),this._register(this.paneview.onDidScroll(c=>this.onDidScrollPane())),this._register(this.paneview.onDidSashReset(c=>this.onDidSashReset(c))),this._register(pe(e,xe.CONTEXT_MENU,c=>this.showContextMenu(new yu(gt(e),c)))),this._register(dh.addTarget(e)),this._register(pe(e,Eo.Contextmenu,c=>this.showContextMenu(new yu(gt(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(l0e,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const s=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===vi.VERTICAL?l.bottom:c.top,h=this.orientation===vi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},o=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let r;this._register(lE.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=s(),i&&i.disposed&&(i=void 0),!i&&o(r,c.eventData)){const l=c.dragAndDropData.getData();if(l.type==="view"){const d=this.viewDescriptorService.getViewContainerByViewId(l.id),h=this.viewDescriptorService.getViewDescriptorById(l.id);if(d!==this.viewContainer&&(!h||!h.canMoveView||this.viewContainer.rejectAddedViews))return;i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(l.type==="composite"&&l.id!==this.viewContainer.id){const d=this.viewDescriptorService.getViewContainerById(l.id),h=this.viewDescriptorService.getViewContainerModel(d).allViewDescriptors;!h.some(u=>!u.canMoveView)&&h.length>0&&(i=new x2(e,void 0,r,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!o(r,c.eventData)&&(i.dispose(),i=void 0),o(r,c.eventData)&&r3e(c.eventData.dataTransfer,"move",i!==void 0)},onDragLeave:c=>{i?.dispose(),i=void 0},onDrop:c=>{if(i){const l=c.dragAndDropData.getData(),d=[];if(l.type==="composite"&&l.id!==this.viewContainer.id){const u=this.viewDescriptorService.getViewContainerById(l.id),f=this.viewDescriptorService.getViewContainerModel(u).allViewDescriptors;f.some(p=>!p.canMoveView)||d.push(...f)}else if(l.type==="view"){const u=this.viewDescriptorService.getViewContainerByViewId(l.id),f=this.viewDescriptorService.getViewDescriptorById(l.id);u!==this.viewContainer&&f&&f.canMoveView&&this.viewDescriptorService.moveViewsToContainer([f],this.viewContainer,void 0,"dnd")}const h=this.panes.length;if(d.length>0&&this.viewDescriptorService.moveViewsToContainer(d,this.viewContainer,void 0,"dnd"),h>0)for(const u of d){const f=this.panes.find(p=>p.id===u.id);f&&this.movePane(f,this.panes[this.panes.length-1])}}i?.dispose(),i=void 0}})),this._register(this.onDidSashChange(()=>this.saveViewSizes())),this._register(this.viewContainerModel.onDidAddVisibleViewDescriptors(c=>this.onDidAddViewDescriptors(c))),this._register(this.viewContainerModel.onDidRemoveVisibleViewDescriptors(c=>this.onDidRemoveViewDescriptors(c)));const a=this.viewContainerModel.visibleViewDescriptors.map((c,l)=>{const d=this.viewContainerModel.getSize(c.id),h=this.viewContainerModel.isCollapsed(c.id);return{viewDescriptor:c,index:l,size:d,collapsed:h}});a.length&&this.onDidAddViewDescriptors(a),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.areExtensionsReady=!0,this.panes.length&&(this.updateTitleArea(),this.updateViewHeaders()),this._register(this.configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(u_.ACTIVITY_BAR_LOCATION)&&this.updateViewHeaders()}))}),this._register(this.viewContainerModel.onDidChangeActiveViewDescriptors(()=>this._onTitleAreaUpdate.fire()))}getTitle(){const e=this.viewContainerModel.title;if(this.isViewMergedWithContainer()){const t=this.paneItems[0].pane.singleViewPaneContainerTitle;if(t)return t;const i=this.paneItems[0].pane.title;return e===i?i:i?`${e}: ${i}`:e}return e}showContextMenu(e){for(const t of this.paneItems)if(al(e.target,t.pane.element))return;e.stopPropagation(),e.preventDefault(),this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>this.menuActions?.getContextMenuActions()??[]})}getActionsContext(){}getActionViewItem(e,t){return this.isViewMergedWithContainer()?this.paneItems[0].pane.getActionViewItem(e,t):yO(this.instantiationService,e,t)}focus(){let e;if(this.lastFocusedPane)e=this.lastFocusedPane;else if(this.paneItems.length>0){for(const{pane:t}of this.paneItems)if(t.isExpanded()){e=t;break}}e&&e.focus()}get orientation(){switch(this.viewDescriptorService.getViewContainerLocation(this.viewContainer)){case Sr.Sidebar:case Sr.AuxiliaryBar:return vi.VERTICAL;case Sr.Panel:return this.layoutService.getPanelPosition()===kv.BOTTOM?vi.HORIZONTAL:vi.VERTICAL}return vi.VERTICAL}layout(e){this.paneview&&(this.paneview.orientation!==this.orientation&&this.paneview.flipOrientation(e.height,e.width),this.paneview.layout(e.height,e.width)),this.dimension=e,this.didLayout?this.saveViewSizes():(this.didLayout=!0,this.restoreViewSizes())}setBoundarySashes(e){this._boundarySashes=e,this.paneview?.setBoundarySashes(e)}getOptimalWidth(){return Math.max(...this.panes.map(i=>i.getOptimalWidth()||0))+16}addPanes(e){const t=this.isViewMergedWithContainer();for(const{pane:i,size:s,index:o,disposable:r}of e)this.addPane(i,s,r,o);this.updateViewHeaders(),this.isViewMergedWithContainer()!==t&&this.updateTitleArea(),this._onDidAddViews.fire(e.map(({pane:i})=>i))}setVisible(e){this.visible!==!!e&&(this.visible=e,this._onDidChangeVisibility.fire(e)),this.panes.filter(t=>t.isVisible()!==e).forEach(t=>t.setVisible(e))}isVisible(){return this.visible}updateTitleArea(){this._onTitleAreaUpdate.fire()}createView(e,t){return this.instantiationService.createInstance(e.ctorDescriptor.ctor,...e.ctorDescriptor.staticArguments||[],t)}getView(e){return this.panes.filter(t=>t.id===e)[0]}saveViewSizes(){this.didLayout&&this.viewContainerModel.setSizes(this.panes.map(e=>({id:e.id,size:this.getPaneSize(e)})))}restoreViewSizes(){if(this.didLayout){let e;for(let t=0;ti+(s||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===vi.VERTICAL?e.set(i.id,this.dimension.height*(i.weight||20)/t):e.set(i.id,this.dimension.width*(i.weight||20)/t)}return e}saveState(){this.panes.forEach(e=>e.saveState()),this.storageService.store(this.visibleViewsStorageId,this.length,ke.WORKSPACE,ln.MACHINE)}onContextMenu(e,t){e.stopPropagation(),e.preventDefault();const i=t.menuActions.getContextMenuActions();this.contextMenuService.showContextMenu({getAnchor:()=>e,getActions:()=>i})}openView(e,t){let i=this.getView(e);return i||this.toggleViewVisibility(e),i=this.getView(e),i&&(i.setExpanded(!0),t&&i.focus()),i}onDidAddViewDescriptors(e){const t=[];for(const{viewDescriptor:s,collapsed:o,index:r,size:a}of e){const c=this.createView(s,{id:s.id,title:s.name.value,fromExtensionId:s.extensionId,expanded:!o,singleViewPaneContainerTitle:s.singleViewPaneContainerTitle});c.render();const l=pe(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new yu(gt(c.draggableElement),h),c)}),d=T.latch(T.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(s.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:pa(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:s}of t)s.setVisible(this.isVisible()),i.push(s);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,s)=>s.index-i.index);const t=[];for(const{index:i}of e)this.paneItems[i]&&t.push(this.paneItems[i].pane);if(t.length){this.removePanes(t);for(const i of t)i.setVisible(!1)}}toggleViewVisibility(e){if(this.viewContainerModel.activeViewDescriptors.some(t=>t.id===e)){const t=!this.viewContainerModel.isVisible(e);this.viewContainerModel.setVisible(e,t)}}addPane(e,t,i,s=this.paneItems.length-1){const o=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),r=e.onDidBlur(()=>this._onDidBlurView.fire(e)),a=e.onDidChangeTitleArea(()=>{this.isViewMergedWithContainer()&&this.updateTitleArea()}),c=e.onDidChangeBodyVisibility(()=>this._onDidChangeViewVisibility.fire(e)),l=e.onDidChange(()=>{e===this.lastFocusedPane&&!e.isExpanded()&&(this.lastFocusedPane=void 0)}),d=this.viewDescriptorService.getViewContainerLocation(this.viewContainer)===Sr.Panel;e.style({headerForeground:Ye(d?VTt:YTt),headerBackground:Ye(d?UTt:KTt),headerBorder:Ye(d?zTt:x3),dropBackground:Ye(d?FZe:OZe),leftBorder:d?Ye($Tt):void 0});const h=new Z;h.add(i),h.add(pa(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(s,0,u),ws(this.paneview).addPane(e,t,s);let f;h.add(lE.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(lE.INSTANCE.registerTarget(e.dropTargetElement,{onDragEnter:p=>{if(!f){const m=p.dragAndDropData.getData();if(m.type==="view"&&m.id!==e.id){const v=this.viewDescriptorService.getViewContainerByViewId(m.id),w=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!w||!w.canMoveView||this.viewContainer.rejectAddedViews))return;f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService)}if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const v=this.viewDescriptorService.getViewContainerById(m.id),w=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!w.some(b=>!b.canMoveView)&&w.length>0&&(f=new x2(e.dropTargetElement,this.orientation??vi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{r3e(p.eventData.dataTransfer,"move",f!==void 0)},onDragLeave:p=>{f?.dispose(),f=void 0},onDrop:p=>{if(f){const m=p.dragAndDropData.getData(),v=[];let w;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const b=this.viewDescriptorService.getViewContainerById(m.id),C=this.viewDescriptorService.getViewContainerModel(b).allViewDescriptors;C.length>0&&!C.some(y=>!y.canMoveView)&&(v.push(...C),w=C[0])}else if(m.type==="view"){const b=this.viewDescriptorService.getViewContainerByViewId(m.id),C=this.viewDescriptorService.getViewDescriptorById(m.id);b!==this.viewContainer&&C&&C.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(C),C&&(w=C)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),w){if(f.currentDropOperation===cu.DOWN||f.currentDropOperation===cu.RIGHT){const b=this.panes.findIndex(y=>y.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b>C&&C++,Cy.id===w.id);let C=this.panes.findIndex(y=>y.id===e.id);b>=0&&C>=0&&(b=0&&C!==b&&this.movePane(this.panes[b],this.panes[C]))}v.length>1&&v.slice(1).forEach(b=>{let C=this.panes.findIndex(S=>S.id===w.id);const y=this.panes.findIndex(S=>S.id===b.id);y>=0&&C>=0&&(y>C&&C++,Cthis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(s=>s.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),ws(this.paneview).removePane(e);const[i]=this.paneItems.splice(t,1);i.disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(c=>c.pane===e),s=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[s];if(i<0||i>=this.paneItems.length||s<0||s>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(s,0,a),ws(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){ws(this.paneview).resizePane(e,t)}getPaneSize(e){return ws(this.paneview).getPaneSize(e)}updateViewHeaders(){this.isViewMergedWithContainer()?(this.paneItems[0].pane.isExpanded()?this.lastMergedCollapsedPane=void 0:(this.lastMergedCollapsedPane=this.paneItems[0].pane,this.paneItems[0].pane.setExpanded(!0)),this.paneItems[0].pane.headerVisible=!1,this.paneItems[0].pane.collapsible=!0):(this.paneItems.length===1?(this.paneItems[0].pane.headerVisible=!0,this.paneItems[0].pane===this.lastMergedCollapsedPane&&this.paneItems[0].pane.setExpanded(!1),this.paneItems[0].pane.collapsible=!1):this.paneItems.forEach(e=>{e.pane.headerVisible=!0,e.pane.collapsible=!0,e.pane===this.lastMergedCollapsedPane&&e.pane.setExpanded(!1)}),this.lastMergedCollapsedPane=void 0)}isViewMergedWithContainer(){return this.options.mergeViewWithContainerWhenSingleView&&this.paneItems.length===1?this.areExtensionsReady?!0:this.visibleViewsCountFromCache===void 0?this.paneItems[0].pane.isExpanded():this.visibleViewsCountFromCache===1:!1}onDidScrollPane(){for(const e of this.panes)e.onDidScrollRoot()}onDidSashReset(e){let t,i;for(let s=e;s>=0;s--)if(this.paneItems[s].pane?.isVisible()&&this.paneItems[s]?.pane.isExpanded()){t=this.paneItems[s].pane;break}for(let s=e+1;so?(this.resizePane(t,r),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,r))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};d0e=D([_(2,be),_(3,Re),_(4,kO),_(5,Vr),_(6,rn),_(7,ho),_(8,pn),_(9,on),_(10,Ti),_(11,z_)],d0e);class lue extends pi{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(z_),i=e.get(Pe),s=Tz.getValue(i);if(s===void 0)return;const o=t.getViewContainerByViewId(s),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===s),c=r.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=r.visibleViewDescriptors.length)return;const l=r.visibleViewDescriptors[c+this.offset];r.move(a.id,l.id)}}At(class extends lue{constructor(){super({id:"views.moveViewUp",title:g(jz,1,"Move View Up"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.UpArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewLeft",title:g(jz,2,"Move View Left"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.LeftArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},-1)}});At(class extends lue{constructor(){super({id:"views.moveViewDown",title:g(jz,3,"Move View Down"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.DownArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends lue{constructor(){super({id:"views.moveViewRight",title:g(jz,4,"Move View Right"),keybinding:{primary:Br(V.CtrlCmd+E.KeyK,E.RightArrow),weight:ye.WorkbenchContrib+1,when:Tz.notEqualsTo("")}},1)}});At(class extends pi{constructor(){super({id:"vscode.moveViews",title:g(jz,5,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(z_),s=i.getViewContainerById(t.destinationId);if(s){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],s,ESe.Default,this.desc.id)}await e.get(q_).openViewContainer(s.id,!0)}}});const yYt="vs/workbench/api/browser/mainThreadComments";class SYt{get input(){return this._input}set input(e){this._input=e,this._onDidChangeInput.fire(e)}get onDidChangeInput(){return this._onDidChangeInput.event}get label(){return this._label}set label(e){this._label=e,this._onDidChangeLabel.fire(this._label)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e}get comments(){return this._comments}set comments(e){this._comments=e,this._onDidChangeComments.fire(this._comments)}get onDidChangeComments(){return this._onDidChangeComments.event}set range(e){this._range=e,this._onDidChangeRange.fire(this._range)}get range(){return this._range}get onDidChangeCanReply(){return this._onDidChangeCanReply.event}set canReply(e){this._canReply=e,this._onDidChangeCanReply.fire(this._canReply)}get canReply(){return this._canReply}get collapsibleState(){return this._collapsibleState}set collapsibleState(e){e!==this._collapsibleState&&(this._collapsibleState=e,this._onDidChangeCollapsibleState.fire(this._collapsibleState))}get initialCollapsibleState(){return this._initialCollapsibleState}set initialCollapsibleState(e){this._initialCollapsibleState=e,this.collapsibleState===void 0&&(this.collapsibleState=this.initialCollapsibleState),this._onDidChangeInitialCollapsibleState.fire(e)}get isDisposed(){return this._isDisposed}isDocumentCommentThread(){return this._range===void 0||O.isIRange(this._range)}get state(){return this._state}set state(e){this._state=e,this._onDidChangeState.fire(this._state)}get applicability(){return this._applicability}set applicability(e){this._applicability=e,this._onDidChangeApplicability.fire(e)}get isTemplate(){return this._isTemplate}constructor(e,t,i,s,o,r,a,c,l){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=s,this.resource=o,this._range=r,this._canReply=a,this._isTemplate=c,this.editorId=l,this._onDidChangeInput=new I,this._onDidChangeLabel=new I,this.onDidChangeLabel=this._onDidChangeLabel.event,this._onDidChangeComments=new I,this._onDidChangeCanReply=new I,this._onDidChangeRange=new I,this.onDidChangeRange=this._onDidChangeRange.event,this._onDidChangeCollapsibleState=new I,this.onDidChangeCollapsibleState=this._onDidChangeCollapsibleState.event,this._onDidChangeInitialCollapsibleState=new I,this.onDidChangeInitialCollapsibleState=this._onDidChangeInitialCollapsibleState.event,this._onDidChangeApplicability=new I,this.onDidChangeApplicability=this._onDidChangeApplicability.event,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._isDisposed=!1,c&&(this.comments=[])}batchUpdate(e){const t=i=>Object.prototype.hasOwnProperty.call(e,i);t("range")&&(this._range=e.range),t("label")&&(this._label=e.label),t("contextValue")&&(this._contextValue=e.contextValue===null?void 0:e.contextValue),t("comments")&&(this._comments=e.comments),t("collapseState")&&(this.initialCollapsibleState=e.collapseState),t("canReply")&&(this.canReply=e.canReply),t("state")&&(this.state=e.state),t("applicability")&&(this.applicability=e.applicability),t("isTemplate")&&(this._isTemplate=e.isTemplate)}dispose(){this._isDisposed=!0,this._onDidChangeCollapsibleState.dispose(),this._onDidChangeComments.dispose(),this._onDidChangeInput.dispose(),this._onDidChangeLabel.dispose(),this._onDidChangeRange.dispose(),this._onDidChangeState.dispose()}toJSON(){return{$mid:Fs.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class AYt{get handle(){return this._handle}get id(){return this._id}get contextValue(){return this._id}get proxy(){return this._proxy}get label(){return this._label}get reactions(){return this._reactions}set reactions(e){this._reactions=e}get options(){return this._features.options}get features(){return this._features}get owner(){return this._id}constructor(e,t,i,s,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=s,this._id=o,this._label=r,this._features=a,this._threads=new Map}async setActiveCommentAndThread(e){return this._proxy.$setActiveComment(this._handle,e?{commentThreadHandle:e.thread.commentThreadHandle,uniqueIdInThread:e.comment?.uniqueIdInThread}:void 0)}updateFeatures(e){this._features=e}createCommentThread(e,t,i,s,o,r,a){const c=new SYt(t,this.handle,e,i,P.revive(s).toString(),o,!0,r,a);return this._threads.set(t,c),c.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[c],removed:[],changed:[],pending:[]}),c}updateCommentThread(e,t,i,s){const o=this.getKnownThread(e);o.batchUpdate(s),o.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[o],pending:[]})}deleteCommentThread(e){const t=this.getKnownThread(e);this._threads.delete(e),t.dispose(),t.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[t],changed:[],pending:[]})}deleteCommentThreadMain(e){this._threads.forEach(t=>{t.threadId===e&&this._proxy.$deleteCommentThread(this._handle,t.commentThreadHandle)})}updateInput(e){const t=this.activeEditingCommentThread;if(t&&t.input){const i=t.input;i.value=e,t.input=i}}updateCommentingRanges(e){this._commentService.updateCommentingRanges(this._uniqueId,e)}getKnownThread(e){const t=this._threads.get(e);if(!t)throw new Error("unknown thread");return t}async getDocumentComments(e,t){if(e.scheme===_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[],commentingRanges:{resource:e,ranges:[],fileComments:!1}};const i=[];for(const o of[...this._threads.keys()]){const r=this._threads.get(o);r.resource===e.toString()&&r.isDocumentCommentThread()&&i.push(r)}const s=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:s?.ranges||[],fileComments:!!s?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==_e.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const s of[...this._threads.keys()]){const o=this._threads.get(s);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,s,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,s)}getAllComments(){const e=[];for(const t of[...this._threads.keys()])e.push(this._threads.get(t));return e}createCommentThreadTemplate(e,t,i){return this._proxy.$createCommentThreadTemplate(this.handle,e,t,i)}async updateCommentThreadTemplate(e,t){await this._proxy.$updateCommentThreadTemplate(this.handle,e,t)}toJSON(){return{$mid:Fs.CommentController,handle:this.handle}}}const m9e=Ki("comments-view-icon",Ce.commentDiscussion,g(yYt,0,"View icon of the comments view."));let _9e=class extends ${constructor(e,t,i,s){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=s,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(et.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async o=>{const r=o.controllerHandle,a=this._commentControllers.get(r);a&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=o,a.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,s){const o=`${t}-${s}`;this._handlers.set(e,o);const r=new AYt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(Qd);a||this.registerView(a),this.registerViewListeners(a),this._commentService.setWorkspaceComments(String(e),[])}$unregisterCommentController(e){const t=this._handlers.get(e);this._handlers.delete(e),this._commentControllers.delete(e),typeof t=="string"&&this._commentService.unregisterCommentController(t)}$updateCommentControllerFeatures(e,t){const i=this._commentControllers.get(e);i&&i.updateFeatures(t)}$createCommentThread(e,t,i,s,o,r,a,c){const l=this._commentControllers.get(e);if(l)return l.createCommentThread(r.value,t,i,s,o,a,c)}$updateCommentThread(e,t,i,s,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,s,o)}$deleteCommentThread(e,t){const i=this._commentControllers.get(e);if(i)return i.deleteCommentThread(t)}$updateCommentingRanges(e,t){const i=this._commentControllers.get(e);i&&i.updateCommentingRanges(t)}registerView(e){if(!e){const t=it.as(M1.ViewContainersRegistry).registerViewContainer({id:Qd,title:jIe,ctorDescriptor:new Gi(d0e,[Qd,{mergeViewWithContainerWhenSingleView:!0}]),storageId:tYt,hideIfEmpty:!0,icon:m9e,order:10},Sr.Panel);it.as(M1.ViewsRegistry).registerViews([{id:Qd,name:jIe,canToggleVisibility:!1,ctorDescriptor:new Gi(c0e),canMoveView:!0,containerIcon:m9e,focusCommand:{id:"workbench.action.focusCommentsPanel"}}],t)}}setComments(){[...this._commentControllers.keys()].forEach(e=>{const t=this._commentControllers.get(e).getAllComments();if(t.length){const i=this.getHandler(e);this._commentService.setWorkspaceComments(i,t)}})}registerViewOpenedListener(){this._openViewListener||(this._openViewListener=this._viewsService.onDidChangeViewVisibility(e=>{e.id===Qd&&e.visible&&(this.setComments(),this._openViewListener&&(this._openViewListener.dispose(),this._openViewListener=null))}))}registerViewListeners(e){e||this.registerViewOpenedListener(),this._register(this._viewDescriptorService.onDidChangeContainer(t=>{t.views.find(i=>i.id===Qd)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(Qd);t.viewContainer.id===i?.id&&(this.setComments(),this.registerViewOpenedListener())}))}getHandler(e){if(!this._handlers.has(e))throw new Error("Unknown handler");return this._handlers.get(e)}};_9e=D([en(Ue.MainThreadComments),_(1,sD),_(2,q_),_(3,z_)],_9e);var CI;(function(n){n[n.Output=1]="Output",n[n.OutputItems=2]="OutputItems",n[n.ExecutionState=3]="ExecutionState"})(CI||(CI={}));var _m;(function(n){function e(f){return{mime:f.mime,valueBytes:f.data}}n.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}n.toNotebookOutputDto=t;function i(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,internalMetadata:f.internalMetadata,metadata:f.metadata,outputs:f.outputs.map(t)}}n.toNotebookCellDataDto=i;function s(f){return{metadata:f.metadata,cells:f.cells.map(i)}}n.toNotebookDataDto=s;function o(f){return{mime:f.mime,data:f.valueBytes}}n.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}n.fromNotebookOutputDto=r;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(r),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}n.fromNotebookDataDto=c;function l(f){return{handle:f.handle,uri:f.uri,source:f.textBuffer.getLinesContent(),eol:f.textBuffer.getEOL(),language:f.language,cellKind:f.cellKind,outputs:f.outputs.map(t),metadata:f.metadata,internalMetadata:f.internalMetadata}}n.toNotebookCellDto=l;function d(f){return f.editType===CI.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===CI.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}n.fromCellExecuteUpdateDto=d;function h(f){return f}n.fromCellExecuteCompleteDto=h;function u(f){return f.editType===G1.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}n.fromCellEditOperationDto=u})(_m||(_m={}));let v9e=class{constructor(e,t,i,s){this._notebookService=t,this._cellStatusBarService=i,this._logService=s,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(et.ExtHostNotebook)}dispose(){this._disposables.dispose(),St(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,s,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:s,dataToNotebook:async a=>{const c=new ao;let l;if(a.byteLength===0&&i==="interactive")l=_m.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,qe.None);l=_m.fromNotebookDataDto(d.value)}return this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${c.elapsed()}ms`,{viewType:i,extensionId:t.id.value}),l},notebookToData:a=>{const c=new ao,l=this._proxy.$notebookToData(e,new $h(_m.toNotebookDataDto(a)),qe.None);return this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${c.elapsed()}`,{viewType:i,extensionId:t.id.value}),l},save:async(a,c,l,d)=>({...await this._proxy.$saveNotebook(e,a,c,l,d),children:void 0,resource:a}),searchInNotebooks:async(a,c,l)=>{const d=this._notebookService.getContributedNotebookType(i);if(!d)return{results:[],limitHit:!1};const u=d.selectors.map(w=>(w.include||w).toString());if(!u.length)return{results:[],limitHit:!1};const f=Ui([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(w=>w!==i?l.get(w)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(w=>({resource:P.revive(w.resource),cellResults:w.cellResults.map(C=>Or(C))})),limitHit:m.limitHit}}})),o&&r.add(this._notebookService.registerContributedNotebookType(i,o)),this._notebookSerializer.set(e,r),this._logService.trace("[NotebookSerializer] registered notebook serializer",{viewType:i,extensionId:t.id.value})}$unregisterNotebookSerializer(e){this._notebookSerializer.get(e)?.dispose(),this._notebookSerializer.delete(e)}$emitCellStatusBarEvent(e){const t=this._notebookCellStatusBarRegistrations.get(e);t instanceof I&&t.fire(void 0)}async $registerNotebookCellStatusBarItemProvider(e,t,i){const s=this,o={async provideCellStatusBarItems(a,c,l){const d=await s._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&s._proxy.$releaseNotebookCellStatusBarItems(d.cacheId)}}},viewType:i};if(typeof t=="number"){const a=new I;this._notebookCellStatusBarRegistrations.set(t,a),o.onDidChangeStatusBarItems=a.event}const r=this._cellStatusBarService.registerCellStatusBarItemProvider(o);this._notebookCellStatusBarRegistrations.set(e,r)}async $unregisterNotebookCellStatusBarItemProvider(e,t){const i=s=>{this._notebookCellStatusBarRegistrations.get(s)&&(this._notebookCellStatusBarRegistrations.get(s)?.dispose(),this._notebookCellStatusBarRegistrations.delete(s))};i(e),typeof t=="number"&&i(t)}};v9e=D([en(Ue.MainThreadNotebook),_(1,oD),_(2,qZe),_(3,Ze)],v9e);yt.registerCommand("_executeDataToNotebook",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(i instanceof ze,"VSBuffer");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=await o.serializer.dataToNotebook(i);return new $h(_m.toNotebookDataDto(r))});yt.registerCommand("_executeNotebookToData",async(n,...e)=>{const[t,i]=e;Bt(typeof t=="string","string"),Bt(typeof i=="object");const o=await n.get(oD).withNotebookDataProvider(t);if(!(o instanceof tj))return;const r=_m.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var h0e;(function(n){n[n.cell=0]="cell",n[n.notebook=1]="notebook"})(h0e||(h0e={}));class EYt{get preloadUris(){return this.preloads.map(e=>e.uri)}get preloadProvides(){return this.preloads.flatMap(e=>e.provides)}constructor(e,t){this._languageService=t,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.id=e.id,this.viewType=e.notebookType,this.extension=e.extensionId,this.implementsInterrupt=e.supportsInterrupt??!1,this.label=e.label,this.description=e.description,this.detail=e.detail,this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=P.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:P.revive(i.uri),provides:i.provides}))??[]}update(e){const t=Object.create(null);e.label!==void 0&&(this.label=e.label,t.label=!0),e.description!==void 0&&(this.description=e.description,t.description=!0),e.detail!==void 0&&(this.detail=e.detail,t.detail=!0),e.supportedLanguages!==void 0&&(this.supportedLanguages=mo(e.supportedLanguages)?e.supportedLanguages:this._languageService.getRegisteredLanguageIds(),t.supportedLanguages=!0),e.supportsExecutionOrder!==void 0&&(this.implementsExecutionOrder=e.supportsExecutionOrder,t.hasExecutionOrder=!0),e.supportsInterrupt!==void 0&&(this.implementsInterrupt=e.supportsInterrupt,t.hasInterruptHandler=!0),e.hasVariableProvider!==void 0&&(this.hasVariableProvider=e.hasVariableProvider,t.hasVariableProvider=!0),this._onDidChange.fire(t)}}class xYt{constructor(e){this.notebookType=e}}let w9e=class{constructor(e,t,i,s,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=s,this._notebookService=o,this._editors=new Zo,this._disposables=new Z,this._kernels=new Map,this._kernelDetectionTasks=new Map,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProvidersEventRegistrations=new Map,this._executions=new Map,this._notebookExecutions=new Map,this.variableRequestIndex=0,this.variableRequestMap=new Map,this._proxy=e.getProxy(et.ExtHostNotebookKernels),r.listNotebookEditors().forEach(this._onEditorAdd,this),r.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),r.onDidRemoveNotebookEditor(this._onEditorRemove,this,this._disposables),this._disposables.add(Ee(()=>{this._executions.forEach(a=>{a.complete({})}),this._notebookExecutions.forEach(a=>a.complete())})),this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(a=>{a.type===h0e.cell&&this._proxy.$cellExecutionChanged(a.notebook,a.cellHandle,a.changed?.state)}))}dispose(){this._disposables.dispose();for(const[,e]of this._kernels.values())e.dispose();for(const[,e]of this._kernelDetectionTasks.values())e.dispose();for(const[,e]of this._kernelSourceActionProviders.values())e.dispose();this._editors.dispose()}_onEditorAdd(e){const t=e.onDidReceiveMessage(i=>{if(!e.hasModel())return;const{selected:s}=this._notebookKernelService.getMatchingKernel(e.textModel);if(s){for(const[o,r]of this._kernels)if(r[0]===s){this._proxy.$acceptKernelMessageFromRenderer(o,e.getId(),i.message);break}}});this._editors.set(e,t)}_onEditorRemove(e){this._editors.deleteAndDispose(e)}async $postMessage(e,t,i){const s=this._kernels.get(e);if(!s)throw new Error("kernel already disposed");const[o]=s;let r=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===o){if(t===void 0)a.postMessage(i),r=!0;else if(a.getId()===t){a.postMessage(i),r=!0;break}}return r}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,s=new class extends EYt{async executeNotebookCellsRequest(a,c){await i._proxy.$executeCells(e,a,c)}async cancelNotebookCellExecution(a,c){await i._proxy.$cancelCells(e,a,c)}provideVariables(a,c,l,d,h){const u=`${e}variables${i.variableRequestIndex++}`;if(i.variableRequestMap.has(u))return i.variableRequestMap.get(u).asyncIterable;const f=new M9;return i.variableRequestMap.set(u,f),i._proxy.$provideVariables(e,u,a,c,l,d,h).then(()=>{f.resolve(),i.variableRequestMap.delete(u)}).catch(p=>{f.reject(p),i.variableRequestMap.delete(u)}),f.asyncIterable}}(t,this._languageService),o=this._notebookKernelService.onDidChangeSelectedNotebooks(a=>{a.oldKernel===s.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===s.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(s);this._kernels.set(e,[s,pa(o,r)])}$updateKernel(e,t){const i=this._kernels.get(e);i&&i[0].update(t)}$removeKernel(e){const t=this._kernels.get(e);t&&(t[1].dispose(),this._kernels.delete(e))}$updateNotebookPriority(e,t,i){const s=this._kernels.get(e);s&&this._notebookKernelService.updateKernelNotebookAffinity(s[0],P.revive(t),i)}$createExecution(e,t,i,s){const o=P.revive(i),r=this._notebookService.getNotebookTextModel(o);if(!r)throw new Error(`Notebook not found: ${o.toString()}`);const a=this._notebookKernelService.getMatchingKernel(r);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(o,s);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(_m.fromCellExecuteUpdateDto))}catch(s){bt(s)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(_m.fromCellExecuteCompleteDto(t.value))}catch(i){bt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const s=P.revive(i),o=this._notebookService.getNotebookTextModel(s);if(!o)throw new Error(`Notebook not found: ${s.toString()}`);const r=this._notebookKernelService.getMatchingKernel(o);if(!r.selected||r.selected.id!==t)throw new Error(`Kernel is not selected: ${r.selected?.id} !== ${t}`);const a=this._notebookExecutionStateService.createExecution(s);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){bt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){bt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new xYt(t),s=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,s])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const s={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,qe.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=P.revive(a.documentation)),{label:a.label,command:a.command,description:a.description,detail:a.detail,documentation:c}})};if(typeof t=="number"){const r=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,r),s.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,s);this._kernelSourceActionProviders.set(e,[s,o])}$removeKernelSourceActionProvider(e,t){const i=this._kernelSourceActionProviders.get(e);i&&(i[1].dispose(),this._kernelSourceActionProviders.delete(e)),typeof t=="number"&&this._kernelSourceActionProvidersEventRegistrations.delete(t)}$emitNotebookKernelSourceActionsChangeEvent(e){const t=this._kernelSourceActionProvidersEventRegistrations.get(e);t instanceof I&&t.fire(void 0)}$variablesUpdated(e){this._notebookKernelService.notifyVariablesChange(P.revive(e))}};w9e=D([en(Ue.MainThreadNotebookKernels),_(1,Di),_(2,jZe),_(3,QZe),_(4,oD),_(5,xQ)],w9e);let u0e=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new wi,this._proxy=e.getProxy(et.ExtHostNotebookDocuments),this._modelReferenceCollection=new Zot(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(s=>this._proxy.$acceptDirtyStateChanged(s.resource,s.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(s=>this._proxy.$acceptModelSaved(s))),this._disposables.add(t.onWillFailWithConflict(s=>{this._modelReferenceCollection.remove(s.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),St(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(s=>{const o={versionId:s.versionId,rawEvents:[]};for(const a of s.rawEvents)switch(a.kind){case vd.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>_m.toNotebookCellDto(l))])});break;case vd.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case vd.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(_m.toNotebookOutputDto)});break;case vd.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(_m.toNotebookOutputItemDto),append:a.append});break;case vd.ChangeCellLanguage:case vd.ChangeCellContent:case vd.ChangeCellMetadata:case vd.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=s.rawEvents.find(a=>a.kind===vd.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new $h(o),this._notebookEditorModelResolverService.isDirty(t.uri),r?t.metadata:void 0)})),this._documentEventListenersMapping.set(t.uri,i)}}handleNotebooksRemoved(e){for(const t of e)this._documentEventListenersMapping.get(t)?.dispose(),this._documentEventListenersMapping.delete(t)}async $tryCreateNotebook(e){const t=await this._notebookEditorModelResolverService.resolve({untitledResource:void 0},e.viewType);if(t.object.notebook.onWillDispose(()=>{t.dispose()}),this._proxy.$acceptDirtyStateChanged(t.object.resource,!0),e.content){const i=_m.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=P.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),s=await i.object.save();return i.dispose(),s}};u0e=D([_(1,Jde),_(2,_o)],u0e);class DYt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let g0e=class{constructor(e,t,i,s,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=s,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(et.ExtHostNotebookEditors),this._editorService.onDidActiveEditorChange(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidRemoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables),this._editorGroupService.onDidMoveGroup(()=>this._updateEditorViewColumns(),this,this._disposables)}dispose(){this._disposables.dispose(),St(this._mainThreadEditors.values())}handleEditorsAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeVisibleRanges(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{visibleRanges:{ranges:t.visibleRanges}})})),i.add(t.onDidChangeSelection(()=>{this._proxy.$acceptEditorPropertiesChanged(t.getId(),{selections:{selections:t.getSelections()}})}));const s=new DYt(t,i);this._mainThreadEditors.set(t.getId(),s)}}handleEditorsRemoved(e){for(const t of e)this._mainThreadEditors.get(t)?.dispose(),this._mainThreadEditors.delete(t)}_updateEditorViewColumns(){const e=Object.create(null);for(const t of this._editorService.visibleEditorPanes){const i=tH(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=U1(this._editorGroupService,t.group))}Io(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const s={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?y1.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:P.revive(e),options:s},ane(this._editorGroupService,this._configurationService,i.position)),r=tH(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const s=this._notebookEditorService.getNotebookEditor(e);if(!s)return;const o=s;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case C2.Default:return o.revealCellRangeInView(t);case C2.InCenter:return o.revealInCenter(r);case C2.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case C2.AtTop:return o.revealInViewAtTop(r)}}$trySetSelections(e,t){const i=this._notebookEditorService.getNotebookEditor(e);i&&(i.setSelections(t),t.length&&i.setFocus({start:t[0].start,end:t[0].start+1}))}};g0e=D([_(1,_i),_(2,xQ),_(3,ur),_(4,Re)],g0e);var OX;class b9e{static delta(e,t){if(!e)return{addedDocuments:[...t.documents],removedDocuments:[],addedEditors:[...t.textEditors.values()],removedEditors:[],visibleEditors:[...t.visibleEditors].map(a=>a[0])};const i=Ple(e.documents,t.documents),s=p_e(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=p_e(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:s.added,removedEditors:s.removed.map(a=>a.getId()),newActiveEditor:o,visibleEditors:r.added.length===0&&r.removed.length===0?void 0:[...t.visibleEditors].map(a=>a[0])}}constructor(e,t,i,s){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=s}}let C9e=OX=class{constructor(e,t,i,s,o,r,a){this._notebookService=i,this._notebookEditorService=s,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new Zo,this._proxy=e.getProxy(et.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(u0e,e),this._mainThreadEditors=t.createInstance(g0e,e),e.set(Ue.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Ue.MainThreadNotebookEditors,this._mainThreadEditors),this._notebookService.onWillAddNotebookDocument(()=>this._updateState(),this,this._disposables),this._notebookService.onDidRemoveNotebookDocument(()=>this._updateState(),this,this._disposables),this._editorService.onDidActiveEditorChange(()=>this._updateState(),this,this._disposables),this._editorService.onDidVisibleEditorsChange(()=>this._updateState(),this,this._disposables),this._notebookEditorService.onDidAddNotebookEditor(this._handleEditorAdd,this,this._disposables),this._notebookEditorService.onDidRemoveNotebookEditor(this._handleEditorRemove,this,this._disposables),this._updateState()}dispose(){this._mainThreadNotebooks.dispose(),this._mainThreadEditors.dispose(),this._disposables.dispose(),this._editorListeners.dispose()}_handleEditorAdd(e){this._editorListeners.set(e.getId(),pa(e.onDidChangeModel(()=>this._updateState()),e.onDidFocusWidget(()=>this._updateState(e)))),this._updateState()}_handleEditorRemove(e){this._editorListeners.deleteAndDispose(e.getId()),this._updateState()}_updateState(e){const t=new Map,i=new Map;for(const a of this._notebookEditorService.listNotebookEditors())a.hasModel()&&t.set(a.getId(),a);const s=tH(this._editorService.activeEditorPane);let o=null;s?o=s.getId():e?.textModel&&(o=e.getId()),o&&!t.has(o)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",o,t.keys()),o=null);for(const a of this._editorService.visibleEditorPanes){const c=tH(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new b9e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(b9e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(OX._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(OX._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new $h(t)),this._mainThreadEditors.handleEditorsRemoved(e.removedEditors),this._mainThreadNotebooks.handleNotebooksRemoved(e.removedDocuments),this._mainThreadNotebooks.handleNotebooksAdded(e.addedDocuments),this._mainThreadEditors.handleEditorsAdded(e.addedEditors)}static _isDeltaEmpty(e){return!(e.addedDocuments!==void 0&&e.addedDocuments.length>0||e.removedDocuments!==void 0&&e.removedDocuments.length>0||e.addedEditors!==void 0&&e.addedEditors.length>0||e.removedEditors!==void 0&&e.removedEditors.length>0||e.visibleEditors!==void 0&&e.visibleEditors.length>0||e.newActiveEditor!==void 0)}static _asModelAddData(e){return{viewType:e.viewType,uri:e.uri,metadata:e.metadata,versionId:e.versionId,cells:e.cells.map(_m.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>tH(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&U1(this._editorGroupService,t.group)}}};C9e=OX=D([TO,_(1,be),_(2,oD),_(3,xQ),_(4,_i),_(5,ur),_(6,Ze)],C9e);let y9e=class extends ${constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(et.ExtHostNotebookRenderers),this._register(t.onShouldPostMessage(i=>{this.proxy.$postRendererMessage(i.editorId,i.rendererId,i.message)}))}$postMessage(e,t,i){return this.messaging.receiveMessage(e,t,i)}};y9e=D([en(Ue.MainThreadNotebookRenderers),_(1,KZe)],y9e);var BG;(function(n){n[n.Save=1]="Save",n[n.Backup=2]="Backup"})(BG||(BG={}));var BX;const Wu="vs/workbench/services/workingCopy/common/storedFileWorkingCopy";var Xm;(function(n){n[n.SAVED=0]="SAVED",n[n.DIRTY=1]="DIRTY",n[n.PENDING_SAVE=2]="PENDING_SAVE",n[n.CONFLICT=3]="CONFLICT",n[n.ORPHAN=4]="ORPHAN",n[n.ERROR=5]="ERROR"})(Xm||(Xm={}));var QP;let S9e=(QP=class extends Roe{get model(){return this._model}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m){super(t,r),this.typeId=e,this.name=i,this.modelFactory=s,this.externalResolver=o,this.logService=a,this.workingCopyFileService=c,this.filesConfigurationService=l,this.workingCopyBackupService=d,this.notificationService=u,this.workingCopyEditorService=f,this.editorService=p,this.elevatedFileService=m,this.capabilities=JS.None,this._model=void 0,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidResolve=this._register(new I),this.onDidResolve=this._onDidResolve.event,this._onDidChangeDirty=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this._onDidSaveError=this._register(new I),this.onDidSaveError=this._onDidSaveError.event,this._onDidSave=this._register(new I),this.onDidSave=this._onDidSave.event,this._onDidRevert=this._register(new I),this.onDidRevert=this._onDidRevert.event,this._onDidChangeReadonly=this._register(new I),this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.dirty=!1,this.ignoreDirtyOnModelContentChange=!1,this.versionId=0,this.lastContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eje,this.ignoreSaveFromSaveParticipants=!1,this.inConflictMode=!1,this.inErrorMode=!1,this._register(h.registerWorkingCopy(this)),this.registerListeners()}registerListeners(){this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))}isDirty(){return this.dirty}markModified(){this.setDirty(!0)}setDirty(e){if(!this.isResolved())return;const t=this.dirty;this.doSetDirty(e),e!==t&&this._onDidChangeDirty.fire()}doSetDirty(e){const t=this.dirty,i=this.inConflictMode,s=this.inErrorMode,o=this.savedVersionId;return e?this.dirty=!0:(this.dirty=!1,this.inConflictMode=!1,this.inErrorMode=!1,this.isResolved()&&(this.savedVersionId=this.model.versionId)),()=>{this.dirty=t,this.inConflictMode=i,this.inErrorMode=s,this.savedVersionId=o}}isResolved(){return!!this.model}async resolve(e){if(this.trace("resolve() - enter"),this.isDisposed()){this.trace("resolve() - exit - without resolving because file working copy is disposed");return}if(!e?.contents&&(this.dirty||this.saveSequentializer.isRunning())){this.trace("resolve() - exit - without resolving because file working copy is dirty or being saved");return}return this.doResolve(e)}async doResolve(e){if(e?.contents)return this.resolveFromBuffer(e.contents);if(!(!this.isResolved()&&await this.resolveFromBackup()))return this.resolveFromFile(e)}async resolveFromBuffer(e){this.trace("resolveFromBuffer()");let t,i,s,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,s=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),s=0,o=zv,this.setOrphaned(r.fileOperationResult===Zi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:s,etag:o,value:e,readonly:!1,locked:!1},!0)}async resolveFromBackup(){const e=await this.workingCopyBackupService.resolve(this);return this.isResolved()?(this.trace("resolveFromBackup() - exit - withoutresolving because previously new file working copy got created meanwhile"),!0):e?(await this.doResolveFromBackup(e),!0):!1}async doResolveFromBackup(e){this.trace("doResolveFromBackup()"),await this.resolveFromContent({resource:this.resource,name:this.name,mtime:e.meta?e.meta.mtime:Date.now(),ctime:e.meta?e.meta.ctime:Date.now(),size:e.meta?e.meta.size:0,etag:e.meta?e.meta.etag:zv,value:e.value,readonly:!1,locked:!1},!0),e.meta&&e.meta.orphaned&&this.setOrphaned(!0)}async resolveFromFile(e){this.trace("resolveFromFile()");const t=e?.forceReadFromFile;let i;t?i=zv:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const s=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),s!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because file working copy content changed");return}await this.resolveFromContent(o,!1)}catch(o){const r=o.fileOperationResult;if(this.setOrphaned(r===Zi.FILE_NOT_FOUND),this.isResolved()&&r===Zi.FILE_NOT_MODIFIED_SINCE){o instanceof P$&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Zi.FILE_NOT_FOUND&&!t)return;throw o}}async resolveFromContent(e,t){if(this.trace("resolveFromContent() - enter"),this.isDisposed()){this.trace("resolveFromContent() - exit - because working copy is disposed");return}this.updateLastResolvedFileStat({resource:this.resource,name:e.name,mtime:e.mtime,ctime:e.ctime,size:e.size,etag:e.etag,readonly:e.readonly,locked:e.locked,isFile:!0,isDirectory:!1,isSymbolicLink:!1,children:void 0}),this.isResolved()?await this.doUpdateModel(e.value):await this.doCreateModel(e.value),this.setDirty(!!t),this._onDidResolve.fire()}async doCreateModel(e){this.trace("doCreateModel()"),this._model=this._register(await this.modelFactory.createModel(this.resource,e,qe.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,qe.None)}finally{this.ignoreDirtyOnModelContentChange=!1}}installModelListeners(e){this._register(e.onDidChangeContent(t=>this.onModelContentChanged(e,t.isUndoing||t.isRedoing))),this._register(e.onWillDispose(()=>this.dispose()))}onModelContentChanged(e,t){if(this.trace("onModelContentChanged() - enter"),this.versionId++,this.trace(`onModelContentChanged() - new versionId ${this.versionId}`),t&&(this.lastContentChangeFromUndoRedo=Date.now()),!this.ignoreDirtyOnModelContentChange&&!this.isReadonly())if(e.versionId===this.savedVersionId){this.trace("onModelContentChanged() - model content changed back to last saved version");const i=this.dirty;this.setDirty(!1),i&&this._onDidRevert.fire()}else this.trace("onModelContentChanged() - model content changed and marked as dirty"),this.setDirty(!0);this._onDidChangeContent.fire()}async forceResolveFromFile(){this.isDisposed()||await this.externalResolver({forceReadFromFile:!0})}get backupDelay(){return this.model?.configuration?.backupDelay}async backup(e){let t;this.lastResolvedFileStat&&(t={mtime:this.lastResolvedFileStat.mtime,ctime:this.lastResolvedFileStat.ctime,size:this.lastResolvedFileStat.size,etag:this.lastResolvedFileStat.etag,orphaned:this.isOrphaned()});let i;return this.isResolved()&&(i=await dw(this.model.snapshot(BG.Backup,e),e)),{meta:t,content:i}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(Xm.CONFLICT)||this.hasState(Xm.ERROR))&&(e.reason===Ln.AUTO||e.reason===Ln.FOCUS_CHANGE||e.reason===Ln.WINDOW_CHANGE)?(this.trace("save() - ignoring auto save request for file working copy that is in conflict or error"),!1):(this.trace("save() - enter"),await this.doSave(e),this.trace("save() - exit"),this.hasState(Xm.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Ln.EXPLICIT);let t=this.versionId;if(this.trace(`doSave(${t}) - enter with versionId ${t}`),this.ignoreSaveFromSaveParticipants){this.trace(`doSave(${t}) - exit - refusing to save() recursively from save participant`);return}if(this.saveSequentializer.isRunning(t))return this.trace(`doSave(${t}) - exit - found a running save for versionId ${t}`),this.saveSequentializer.running;if(!e.force&&!this.dirty){this.trace(`doSave(${t}) - exit - because not dirty and/or versionId is different (this.isDirty: ${this.dirty}, this.versionId: ${this.versionId})`);return}if(this.saveSequentializer.isRunning())return this.trace(`doSave(${t}) - exit - because busy saving`),this.saveSequentializer.cancelRunning(),this.saveSequentializer.queue(()=>this.doSave(e));this.isResolved()&&this.model.pushStackElement();const i=new ai;return this.saveSequentializer.run(t,(async()=>{if(this.isResolved()&&!e.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(e.reason===Ln.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const r=Date.now()-this.lastContentChangeFromUndoRedo;r{try{const r={mtime:s.mtime,etag:e.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(s.resource)?zv:s.etag,unlock:e.writeUnlock};let a;if(typeof o.model.save=="function")try{a=await o.model.save(r,i.token)}catch(c){if(i.token.isCancellationRequested)return;throw c}else{const c=await dw(o.model.snapshot(BG.Save,i.token),i.token);if(i.token.isCancellationRequested)return;i.dispose(),e?.writeElevated&&this.elevatedFileService.isSupported(s.resource)?a=await this.elevatedFileService.writeFileElevated(s.resource,ws(c),r):a=await this.fileService.writeFile(s.resource,ws(c),r)}this.handleSaveSuccess(a,t,e)}catch(r){this.handleSaveError(r,t,e)}})(),()=>i.cancel())})(),()=>i.cancel())}handleSaveSuccess(e,t,i){this.updateLastResolvedFileStat(e),t===this.versionId?(this.trace(`handleSaveSuccess(${t}) - setting dirty to false because versionId did not change`),this.setDirty(!1)):this.trace(`handleSaveSuccess(${t}) - not setting dirty to false because versionId did change meanwhile`),this.setOrphaned(!1),this._onDidSave.fire({reason:i.reason,stat:e,source:i.source})}handleSaveError(e,t,i){if((i.ignoreErrorHandler?this.logService.trace:this.logService.error).apply(this.logService,[`[stored file working copy] handleSaveError(${t}) - exit - resulted in a save error: ${e.toString()}`,this.resource.toString(),this.typeId]),i.ignoreErrorHandler)throw e;this.setDirty(!0),this.inErrorMode=!0,e.fileOperationResult===Zi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,s=[];let o;if(i.fileOperationResult===Zi.FILE_MODIFIED_SINCE)o=g(Wu,0,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),s.push(_l({id:"fileWorkingCopy.overwrite",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Zi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Zi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);fSt(e)&&s.push(...e.actions),h&&(d||l)?s.push(_l({id:"fileWorkingCopy.saveElevated",label:l?Is?g(Wu,3,"Overwrite as Admin..."):g(Wu,4,"Overwrite as Sudo..."):Is?g(Wu,5,"Retry as Admin..."):g(Wu,6,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Ln.EXPLICIT})}})):c?s.push(_l({id:"fileWorkingCopy.unlock",label:g(Wu,1,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Ln.EXPLICIT})})):s.push(_l({id:"fileWorkingCopy.retry",label:g(Wu,7,"Retry"),run:()=>this.save({...t,reason:Ln.EXPLICIT})})),s.push(_l({id:"fileWorkingCopy.saveAs",label:g(Wu,8,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Ln.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),s.push(_l({id:"fileWorkingCopy.revert",label:g(Wu,2,"Discard"),run:()=>this.revert()})),c?l&&h?o=Is?g(Wu,9,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(Wu,10,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(Wu,11,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Is?g(Wu,12,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(Wu,13,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(Wu,14,"Failed to save '{0}': {1}",this.name,Ma(e,!1))}const r=this.notificationService.notify({id:`${Ed(this.resource.toString())}`,severity:nt.Error,message:o,actions:{primary:s}}),a=this._register(T.once(T.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(T.once(r.onDidClose)(()=>a.dispose()))}updateLastResolvedFileStat(e){const t=this.isReadonly();this.lastResolvedFileStat?this.lastResolvedFileStat.mtime<=e.mtime&&(this.lastResolvedFileStat=e):this.lastResolvedFileStat=e,this.isReadonly()!==t&&this._onDidChangeReadonly.fire()}async revert(e){if(!this.isResolved()||!this.dirty&&!e?.force)return;this.trace("revert()");const t=this.dirty,i=this.doSetDirty(!1);if(!e?.soft)try{await this.forceResolveFromFile()}catch(o){if(o.fileOperationResult!==Zi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Xm.CONFLICT:return this.inConflictMode;case Xm.DIRTY:return this.dirty;case Xm.ERROR:return this.inErrorMode;case Xm.ORPHAN:return this.isOrphaned();case Xm.PENDING_SAVE:return this.saveSequentializer.isRunning();case Xm.SAVED:return!this.dirty}}async joinState(e){return this.saveSequentializer.running}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource,this.lastResolvedFileStat)}trace(e){this.logService.trace(`[stored file working copy] ${e}`,this.resource.toString(),this.typeId)}dispose(){this.trace("dispose()"),this.inConflictMode=!1,this.inErrorMode=!1,this._model=void 0,super.dispose()}},BX=QP,QP.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,QP);S9e=BX=D([_(5,ci),_(6,Ze),_(7,fC),_(8,hh),_(9,MQ),_(10,Pw),_(11,Pi),_(12,Iet),_(13,_i),_(14,IQ)],S9e);var FB;let A9e=FB=class extends pL{constructor(e,t,i,s,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=s,this._filesConfigurationService=r,this._onDidChangeDirty=this._register(new I),this._onDidSave=this._register(new I),this._onDidChangeOrphaned=this._register(new I),this._onDidChangeReadonly=this._register(new I),this._onDidRevertUntitled=this._register(new I),this.onDidChangeDirty=this._onDidChangeDirty.event,this.onDidSave=this._onDidSave.event,this.onDidChangeOrphaned=this._onDidChangeOrphaned.event,this.onDidChangeReadonly=this._onDidChangeReadonly.event,this.onDidRevertUntitled=this._onDidRevertUntitled.event,this._workingCopyListeners=this._register(new Z),this.scratchPad=o}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return FB._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Xm.ORPHAN)}hasAssociatedFilePath(){return!FB._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return FB._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Xm.ERROR):!1}revert(e){return Bt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Bt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===_e.untitled?(this._hasAssociatedFilePath?this._workingCopy=await this._workingCopyManager.resolve({associatedResource:this.resource}):this._workingCopy=await this._workingCopyManager.resolve({untitledResource:this.resource,isScratchpad:this.scratchPad}),this._workingCopy.onDidRevert(()=>this._onDidRevertUntitled.fire())):(this._workingCopy=await this._workingCopyManager.resolve(this.resource,{limits:e?.limits,reload:e?.forceReadFromFile?{async:!1,force:!0}:void 0}),this._workingCopyListeners.add(this._workingCopy.onDidSave(t=>this._onDidSave.fire(t))),this._workingCopyListeners.add(this._workingCopy.onDidChangeOrphaned(()=>this._onDidChangeOrphaned.fire())),this._workingCopyListeners.add(this._workingCopy.onDidChangeReadonly(()=>this._onDidChangeReadonly.fire()))),this._workingCopyListeners.add(this._workingCopy.onDidChangeDirty(()=>this._onDidChangeDirty.fire(),void 0)),this._workingCopyListeners.add(this._workingCopy.onWillDispose(()=>{this._workingCopyListeners.clear(),this._workingCopy?.model?.dispose()}))):await this._workingCopyManager.resolve(this.resource,{reload:{async:!e?.forceReadFromFile,force:e?.forceReadFromFile},limits:e?.limits}),Bt(this.isResolved()),this}async saveAs(e){const t=await this._workingCopyManager.saveAs(this.resource,e);if(t)return{resource:t.resource}}static _isStoredFileWorkingCopy(e){return!(e&&e.capabilities&JS.Untitled)}};A9e=FB=D([_(5,hh)],A9e);class yrt extends ${constructor(e,t,i,s){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.configuration=void 0,this.onWillDispose=e.onWillDispose.bind(e),this._register(e.onDidChangeContent(r=>{for(const a of r.rawEvents)if(a.kind!==vd.Initialize&&!a.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const o=this._configurationService.getValue(tke.remoteSaving);(o||e.uri.scheme===_e.vscodeRemote)&&(this.configuration={backupDelay:1e4}),o&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){const e=await this.getNotebookSerializer();this.save=async(t,i)=>{if(i.isCancellationRequested)throw new Tc;try{return await e.save(this._notebookModel.uri,this._notebookModel.versionId,t,i)}catch(s){throw i.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===_e.vscodeRemote,error:s}),s}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),s={metadata:YX(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let o=0;for(const a of this._notebookModel.cells){const c={cellKind:a.cellKind,language:a.language,mime:a.mime,source:a.getValue(),outputs:[],internalMetadata:a.internalMetadata},l=this._configurationService.getValue(tke.outputBackupSizeLimit)*1024;if(e===BG.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{o+=h.data.byteLength})}),o>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=YX(a.metadata,d=>!i.options.transientCellMetadata[d]),s.cells.push(c)}const r=await i.notebookToData(s);if(t.isCancellationRequested)throw new Tc;return aQ(r)}async update(e,t){const i=await this.getNotebookSerializer(),s=await II(e),o=await i.dataToNotebook(s);if(t.isCancellationRequested)throw new Tc;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof tj))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let E9e=class{constructor(e,t,i,s){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=s}async createModel(e,t,i){const s=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(s instanceof tj))throw new Error("CANNOT open file notebook with this provider");const o=await II(t),r=await s.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Tc;const a=this._notebookService.createNotebookTextModel(s.viewType,e,r,s.serializer.options);return new yrt(a,this._notebookService,this._configurationService,this._telemetryService)}};E9e=D([_(1,oD),_(2,Re),_(3,rn)],E9e);const kYt="vs/workbench/api/browser/mainThreadNotebookSaveParticipant";let IYt=class{constructor(e){this._proxy=e.getProxy(et.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,s){if(!e.model||!(e.model instanceof yrt))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(kYt,0,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,s).then(l=>{clearTimeout(o)}).then(a,c)});return qle(r,s)}},x9e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(IYt,e))}dispose(){this._saveParticipantDisposable.dispose()}};x9e=D([TO,_(1,be),_(2,fC)],x9e);let D9e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(et.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` +`,Yc,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};D9e=D([en(Ue.MainThreadInteractive),_(1,TPe)],D9e);const D8="vs/workbench/contrib/tasks/common/taskDefinitionRegistry",LYt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(D8,0,"The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:g(D8,1,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(D8,2,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:""}}};var f0e;(function(n){function e(t,i,s){if(!t)return;const o=zt(t.type)?t.type:void 0;if(!o||o.length===0){s.error(g(D8,3,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)zt(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?Vs(t.properties):{},when:t.when?ge.deserialize(t.when):void 0}}n.from=e})(f0e||(f0e={}));const TYt=Ap.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(n,e)=>{for(const t of n)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(D8,4,"Contributes task kinds"),type:"array",items:LYt}});class RYt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{TYt.setHandler((i,s)=>{this._schema=void 0;try{for(const o of s.removed){const r=o.value;for(const a of r)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const o of s.added){const r=o.value;for(const a of r){const c=f0e.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(s.removed.length>0||s.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){const e=[];for(const t of this.all()){const i={type:"object",additionalProperties:!1};t.required.length>0&&(i.required=t.required.slice(0)),t.properties!==void 0?i.properties=Vs(t.properties):i.properties=Object.create(null),i.properties.type={type:"string",enum:[t.taskType]},e.push(i)}this._schema={oneOf:e}}return this._schema}}const MYt=new RYt,NOe="vs/workbench/contrib/tasks/common/tasks",Srt="settings";new Y("taskRunning",!1,g(NOe,0,"Whether a task is currently running."));Be(NOe,1,"Tasks");var Foe;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(Foe||(Foe={}));const Art="$customized";(function(n){function e(t){if(!t)return n.Strong;switch(t.toLowerCase()){case"escape":return n.Escape;case"strong":return n.Strong;case"weak":return n.Weak;default:return n.Strong}}n.from=e})(Foe||(Foe={}));var WG;(function(n){n.defaults={cwd:"${workspaceFolder}"}})(WG||(WG={}));var HG;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(HG||(HG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"silent":return n.Silent;case"never":return n.Never;default:return n.Always}}n.fromString=e})(HG||(HG={}));var UG;(function(n){n[n.Never=1]="Never",n[n.OnProblem=2]="OnProblem",n[n.Always=3]="Always"})(UG||(UG={}));(function(n){function e(t){switch(t.toLowerCase()){case"always":return n.Always;case"never":return n.Never;case"onproblem":return n.OnProblem;default:return n.OnProblem}}n.fromString=e})(UG||(UG={}));var VG;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(VG||(VG={}));(function(n){function e(t){switch(t.toLowerCase()){case"shared":return n.Shared;case"dedicated":return n.Dedicated;case"new":return n.New;default:return n.Shared}}n.fromString=e})(VG||(VG={}));var Ooe;(function(n){n.defaults={echo:!0,reveal:HG.Always,revealProblems:UG.Never,focus:!1,panel:VG.Shared,showReuseMessage:!0,clear:!1}})(Ooe||(Ooe={}));var x_;(function(n){n[n.Shell=1]="Shell",n[n.Process=2]="Process",n[n.CustomExecution=3]="CustomExecution"})(x_||(x_={}));(function(n){function e(i){switch(i.toLowerCase()){case"shell":return n.Shell;case"process":return n.Process;case"customExecution":return n.CustomExecution;default:return n.Process}}n.fromString=e;function t(i){switch(i){case n.Shell:return"shell";case n.Process:return"process";case n.CustomExecution:return"customExecution";default:return"process"}}n.toString=t})(x_||(x_={}));var k9e;(function(n){function e(t){return zt(t)?t:t.value}n.value=e})(k9e||(k9e={}));var I9e;(function(n){n.Clean={_id:"clean",isDefault:!1},n.Build={_id:"build",isDefault:!1},n.Rebuild={_id:"rebuild",isDefault:!1},n.Test={_id:"test",isDefault:!1};function e(i){return i===n.Clean._id||i===n.Build._id||i===n.Rebuild._id||i===n.Test._id}n.is=e;function t(i){if(i!==void 0)return zt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}n.from=t})(I9e||(I9e={}));var Ek;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.Folder=3]="Folder"})(Ek||(Ek={}));var Ex;(function(n){n.Workspace="workspace",n.Extension="extension",n.InMemory="inMemory",n.WorkspaceFile="workspaceFile",n.User="user";function e(t){switch(t){case n.User:return Ot.USER;case n.WorkspaceFile:return Ot.WORKSPACE;default:return Ot.WORKSPACE_FOLDER}}n.toConfigurationTarget=e})(Ex||(Ex={}));var L9e;(function(n){n.parallel="parallel",n.sequence="sequence"})(L9e||(L9e={}));var p0e;(function(n){n[n.default=1]="default",n[n.folderOpen=2]="folderOpen"})(p0e||(p0e={}));var Boe;(function(n){n.defaults={reevaluateOnRerun:!0,runOn:p0e.default,instanceLimit:1}})(Boe||(Boe={}));class POe{constructor(e,t,i,s,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=s,this.configurationProperties=o,this._source=r}getDefinition(e){}getMapKey(){return this._id}getKey(){}getCommonTaskId(){const e={folder:this.getFolderId(),id:this._id};return JSON.stringify(e)}clone(){return this.fromObject(Object.assign({},this))}getWorkspaceFolder(){}getWorkspaceFileName(){}getTelemetryKind(){return"unknown"}matches(e,t=!1){if(e===void 0)return!1;if(zt(e))return e===this._label||e===this.configurationProperties.identifier||t&&e===this._id;const i=this.getDefinition(!0);return i!==void 0&&i._key===e._key}getQualifiedLabel(){const e=this.getWorkspaceFolder();return e?`${this._label} (${e.name})`:this._label}getTaskExecution(){return{id:this._id,task:this}}addTaskLoadMessages(e){this._taskLoadMessages===void 0&&(this._taskLoadMessages=[]),e&&(this._taskLoadMessages=this._taskLoadMessages.concat(e))}get taskLoadMessages(){return this._taskLoadMessages}}class k8 extends POe{constructor(e,t,i,s,o,r,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=r,o&&(this.command=o)}clone(){return new k8(this._id,this._source,this._label,this.type,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}customizes(){if(this._source&&this._source.customizes)return this._source.customizes}getDefinition(e=!1){if(e&&this._source.customizes!==void 0)return this._source.customizes;{let t;switch(this.command?this.command.runtime:void 0){case x_.Shell:t="shell";break;case x_.Process:t="process";break;case x_.CustomExecution:t="customExecution";break;case void 0:t="$composite";break;default:throw new Error("Unexpected task runtime")}return{type:t,_key:this._id,id:this._id}}}static is(e){return e instanceof k8}getMapKey(){const e=this._source.config.workspaceFolder;return e?`${e.uri.toString()}|${this._id}|${this.instance}`:`${this._id}|${this.instance}`}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getCommonTaskId(){return this._source.customizes?super.getCommonTaskId():this.getKey()??super.getCommonTaskId()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new k8(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class I8 extends POe{constructor(e,t,i,s,o,r,a){super(e,i,s,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof I8}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?ui(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===Ex.User?Srt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==Ex.Workspace&&(t+=this._source.kind),JSON.stringify({type:Art,folder:e,id:t})}}class GM extends POe{constructor(e,t,i,s,o,r,a,c,l){super(e,i,s,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new GM(this._id,this._source,this._label,this.type,this.defines,this.command,this.hasDefinedMatchers,this.runOptions,this.configurationProperties)}getDefinition(){return this.defines}static is(e){return e instanceof GM}getMapKey(){const e=this._source.workspaceFolder;return e?`${this._source.scope.toString()}|${e.uri.toString()}|${this._id}|${this.instance}`:`${this._source.scope.toString()}|${this._id}|${this.instance}`}getFolderId(){if(this._source.scope===Ek.Folder&&this._source.workspaceFolder)return this._source.workspaceFolder.uri.toString()}getKey(){const e={type:"contributed",scope:this._source.scope,id:this._id};return e.folder=this.getFolderId(),JSON.stringify(e)}getWorkspaceFolder(){return this._source.workspaceFolder}getTelemetryKind(){return"extension"}fromObject(e){return new GM(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var Woe;(function(n){n[n.Process=1]="Process",n[n.Terminal=2]="Terminal"})(Woe||(Woe={}));(function(n){n._default=n.Terminal})(Woe||(Woe={}));var T9e;(function(n){n[n.V0_1_0=1]="V0_1_0",n[n.V2_0_0=2]="V2_0_0"})(T9e||(T9e={}));var Nv;(function(n){n.DependsOnStarted="dependsOnStarted",n.AcquiredInput="acquiredInput",n.Start="start",n.ProcessStarted="processStarted",n.Active="active",n.Inactive="inactive",n.Changed="changed",n.Terminated="terminated",n.ProcessEnded="processEnded",n.End="end"})(Nv||(Nv={}));var Hoe;(function(n){n.SingleRun="singleRun",n.Background="background"})(Hoe||(Hoe={}));var R9e;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.FolderOpen=2]="FolderOpen",n[n.ConfigurationChange=3]="ConfigurationChange",n[n.Reconnect=4]="Reconnect"})(R9e||(R9e={}));var M9e;(function(n){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Hoe.Background:Hoe.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:Nv.Start,terminalId:l,resolvedVariables:d}}n.start=t;function i(c,l,d){return{...e(c),kind:Nv.ProcessStarted,terminalId:l,processId:d}}n.processStarted=i;function s(c,l,d){return{...e(c),kind:Nv.ProcessEnded,terminalId:l,exitCode:d}}n.processEnded=s;function o(c,l,d){return{...e(c),kind:Nv.Terminated,exitReason:d,terminalId:l}}n.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}n.general=r;function a(){return{kind:Nv.Changed}}n.changed=a})(M9e||(M9e={}));var Uoe;(function(n){function e(i){const s=Object.keys(i).sort();let o="";for(const r of s){let a=i[r];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),o+=r+","+a+","}return o}function t(i){const o={_key:e(i),type:i.taskType};return Object.assign(o,i),o}n.create=t})(Uoe||(Uoe={}));var N9e;(function(n){n.AutoDetect="task.autoDetect",n.SaveBeforeRun="task.saveBeforeRun",n.ShowDecorations="task.showDecorations",n.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",n.SlowProviderWarning="task.slowProviderWarning",n.QuickOpenHistory="task.quickOpen.history",n.QuickOpenDetail="task.quickOpen.detail",n.QuickOpenSkip="task.quickOpen.skip",n.QuickOpenShowAll="task.quickOpen.showAll",n.AllowAutomaticTasks="task.allowAutomaticTasks",n.Reconnection="task.reconnection",n.VerboseLogging="task.verboseLogging"})(N9e||(N9e={}));var P9e;(function(n){n.Tasks="tasks",n.SuppressTaskName="tasks.suppressTaskName",n.Windows="tasks.windows",n.Osx="tasks.osx",n.Linux="tasks.linux",n.ShowOutput="tasks.showOutput",n.IsShellCommand="tasks.isShellCommand",n.ServiceTestSetting="tasks.service.testSetting"})(P9e||(P9e={}));var m0e;(function(n){function e(t,i){const s=MYt.get(t.type);if(s===void 0){const c=Vs(t);return delete c._key,Uoe.create(c)}const o=Object.create(null);o.type=s.taskType;const r=new Set;s.required.forEach(c=>r.add(c));const a=s.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)o[c]=l;else if(r.has(c)){const d=a[c];if(d.default!==void 0)o[c]=Vs(d.default);else switch(d.type){case"boolean":o[c]=!1;break;case"number":case"integer":o[c]=0;break;case"string":o[c]="";break;default:i.error(g(NOe,2,"Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.",JSON.stringify(t,void 0,0),c));return}}}return Uoe.create(o)}n.createTaskIdentifier=e})(m0e||(m0e={}));const NYt="vs/workbench/api/browser/mainThreadTask";var Voe;(function(n){function e(t){return{id:t.id,task:Pp.from(t.task)}}n.from=e})(Voe||(Voe={}));var _0e;(function(n){function e(t,i){return{id:t.id,processId:i}}n.from=e})(_0e||(_0e={}));var v0e;(function(n){function e(t,i){return{id:t.id,exitCode:i}}n.from=e})(v0e||(v0e={}));var zoe;(function(n){function e(i){const s=Object.assign(Object.create(null),i);return delete s._key,s}n.from=e;function t(i,s){let o=m0e.createTaskIdentifier(i,console);return o===void 0&&s&&(o={_key:Dr(),type:"$executeOnly"}),o}n.to=t})(zoe||(zoe={}));var $oe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Ooe.defaults:Object.assign(Object.create(null),Ooe.defaults,i)}n.to=t})($oe||($oe={}));var Goe;(function(n){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}n.from=e;function t(i){return i==null?Boe.defaults:Object.assign(Object.create(null),Boe.defaults,i)}n.to=t})(Goe||(Goe={}));var qoe;(function(n){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}n.from=e;function t(i){return i==null?WG.defaults:{cwd:i.cwd||WG.defaults.cwd,env:i.env}}n.to=t})(qoe||(qoe={}));var L8;(function(n){function e(s){const o=s;return o&&!!o.process}n.is=e;function t(s){const o=zt(s.name)?s.name:s.name.value,r=s.args?s.args.map(c=>zt(c)?c:c.value):[],a={process:o,args:r};return s.options&&(a.options=qoe.from(s.options)),a}n.from=t;function i(s){const o={runtime:x_.Process,name:s.process,args:s.args,presentation:void 0};return o.options=qoe.to(s.options),o}n.to=i})(L8||(L8={}));var Qoe;(function(n){function e(i){if(i==null)return;const s={cwd:i.cwd||WG.defaults.cwd,env:i.env};return i.shell&&(s.executable=i.shell.executable,s.shellArgs=i.shell.args,s.shellQuoting=i.shell.quoting),s}n.from=e;function t(i){if(i==null)return;const s={cwd:i.cwd,env:i.env};return i.executable&&(s.shell={executable:i.executable},i.shellArgs&&(s.shell.args=i.shellArgs),i.shellQuoting&&(s.shell.quoting=i.shellQuoting)),s}n.to=t})(Qoe||(Qoe={}));var T8;(function(n){function e(s){const o=s;return o&&(!!o.commandLine||!!o.command)}n.is=e;function t(s){const o={};return s.name&&zt(s.name)&&(s.args===void 0||s.args===null||s.args.length===0)?o.commandLine=s.name:(o.command=s.name,o.args=s.args),s.options&&(o.options=Qoe.from(s.options)),o}n.from=t;function i(s){const o={runtime:x_.Shell,name:s.commandLine?s.commandLine:s.command,args:s.args,presentation:void 0};return s.options&&(o.options=Qoe.to(s.options)),o}n.to=i})(T8||(T8={}));var RR;(function(n){function e(s){const o=s;return o&&o.customExecution==="customExecution"}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s){return{runtime:x_.CustomExecution,presentation:void 0}}n.to=i})(RR||(RR={}));var joe;(function(n){function e(i){const s={label:i.label};return i.kind===Ex.Extension?(s.extensionId=i.extension,i.workspaceFolder?s.scope=i.workspaceFolder.uri:s.scope=i.scope):i.kind===Ex.Workspace&&(s.extensionId="$core",s.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:Ek.Global),s}n.from=e;function t(i,s){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==Ek.Global?s.getWorkspace().folders.length===0?(o=Ek.Global,r=void 0):(o=Ek.Folder,r=s.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=Ek.Folder,r=s.getWorkspaceFolder(P.revive(i.scope))??void 0),{kind:Ex.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}n.to=t})(joe||(joe={}));var Koe;(function(n){function e(t){const i=t;return i&&zt(i.id)&&!!i.workspaceFolder}n.is=e})(Koe||(Koe={}));var Pp;(function(n){function e(i){if(i==null||!k8.is(i)&&!GM.is(i)&&!I8.is(i))return;const s={_id:i._id,name:i.configurationProperties.name,definition:zoe.from(i.getDefinition(!0)),source:joe.from(i._source),execution:void 0,presentationOptions:!I8.is(i)&&i.command?$oe.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:GM.is(i)?i.hasDefinedMatchers:!1,runOptions:Goe.from(i.runOptions)};if(s.group=w0e.from(i.configurationProperties.group),i.configurationProperties.detail&&(s.detail=i.configurationProperties.detail),!I8.is(i)&&i.command)switch(i.command.runtime){case x_.Process:s.execution=L8.from(i.command);break;case x_.Shell:s.execution=T8.from(i.command);break;case x_.CustomExecution:s.execution=RR.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)zt(o)&&s.problemMatchers.push(o);return s}n.from=e;function t(i,s,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(T8.is(i.execution)?c=T8.to(i.execution):L8.is(i.execution)?c=L8.to(i.execution):RR.is(i.execution)&&(c=RR.to(i.execution))),!c)return;c.presentation=$oe.to(i.presentationOptions);const l=joe.to(i.source,s),d=g(NYt,0,"{0}: {1}",l.label,i.name),h=zoe.to(i.definition,o),u=RR.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new GM(u,l,d,h.type,h,c,i.hasDefinedMatchers,Goe.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:r,hide:a})}n.to=t})(Pp||(Pp={}));var w0e;(function(n){function e(t){if(t!==void 0)return{_id:typeof t=="string"?t:t._id,isDefault:typeof t=="string"||typeof t.isDefault=="string"?!1:t.isDefault}}n.from=e})(w0e||(w0e={}));var b0e;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(b0e||(b0e={}));let F9e=class extends ${constructor(e,t,i,s){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=s,this._proxy=e.getProxy(et.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===Nv.Changed)return;const r=o.__task;if(o.kind===Nv.Start){const a=Voe.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&RR.is(a.task.execution)&&o.resolvedVariables){const l={};for(const[d,h]of o.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(r.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,o.terminalId,c)}else o.kind===Nv.ProcessStarted?this._proxy.$onDidStartTaskProcess(_0e.from(r.getTaskExecution(),o.processId)):o.kind===Nv.ProcessEnded?this._proxy.$onDidEndTaskProcess(v0e.from(r.getTaskExecution(),o.exitCode)):o.kind===Nv.End&&this._proxy.$OnDidEndTask(Voe.from(r.getTaskExecution()))}))}dispose(){for(const e of this._providers.values())e.disposable.dispose();this._providers.clear(),super.dispose()}$createTaskId(e){return new Promise((t,i)=>{const s=Pp.to(e,this._workspaceContextServer,!0);s?t(s._id):i(new Error("Task could not be created from DTO"))})}$registerTaskProvider(e,t){const i={provideTasks:o=>Promise.resolve(this._proxy.$provideTasks(e,o)).then(r=>{const a=[];for(const c of r.tasks){const l=Pp.to(c,this._workspaceContextServer,!0);l?a.push(l):console.error(`Task System: can not convert task: ${JSON.stringify(c.definition,void 0,0)}. Task will be dropped`)}return{tasks:a,extension:r.extension}}),resolveTask:o=>{const r=Pp.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Pp.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},s=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:s,provider:i}),Promise.resolve(void 0)}$unregisterTaskProvider(e){const t=this._providers.get(e);return t&&(t.disposable.dispose(),this._providers.delete(e)),Promise.resolve(void 0)}$fetchTasks(e){return this._taskService.tasks(b0e.to(e)).then(t=>{const i=[];for(const s of t){const o=Pp.from(s);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),s=P.revive(e);i.configuration?.toString()===s.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(s)}return t}async $getTaskExecution(e){if(Koe.is(e)){const t=this.getWorkspace(e.workspaceFolder);if(t){const i=await this._taskService.getTask(t,e.id,!0);if(i)return{id:i._id,task:Pp.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Pp.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Pp.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Koe.is(e)){const s=this.getWorkspace(e.workspaceFolder);s?this._taskService.getTask(s,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Pp.from(o)};this._taskService.run(o).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(r)},a=>{}),t(r)}},o=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const s=Pp.to(e,this._workspaceContextServer,!0);this._taskService.run(s).then(void 0,r=>{});const o={id:s._id,task:Pp.from(s)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,s)=>{this._taskService.getActiveTasks().then(o=>{for(const r of o)if(e===r._id){this._taskService.extensionCallbackTaskComplete(r,t).then(a=>{i(void 0)},a=>{s(a)});return}s(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(s=>{for(const o of s)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new uc("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Hh.Web;break;case"win32":i=Hh.Windows;break;case"darwin":i=Hh.Mac;break;case"linux":i=Hh.Linux;break;default:i=oQe}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:s=>P.from({scheme:t.scheme,authority:t.authority,path:s}),context:this._extHostContext,resolveVariables:(s,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(s.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(s,l,"tasks",void 0,r).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(s,o,r)=>this._proxy.$findExecutable(s,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};F9e=D([en(Ue.MainThreadTask),_(1,XZe),_(2,Ti),_(3,_et)],F9e);let O9e=class extends ${constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new Zo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};O9e=D([en(Ue.MainThreadLabelService),_(1,eo)],O9e);var jm;(function(n){n.Http="http",n.Https="https"})(jm||(jm={}));var zE;(function(n){n.ConstantPrivate="constantPrivate",n.Private="private",n.Public="public"})(zE||(zE={}));var rk;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(rk||(rk={}));function PYt(n){if(n.scheme!=="http"&&n.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(n.authority);if(e)return{address:e[1],port:+e[2]}}const zG=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function $G(n){return zG.indexOf(n)>=0}const Yoe=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function GG(n){return Yoe.indexOf(n)>=0}class FYt{constructor(e,t,i){this.remoteAddress=e,this.localAddress=t,this._dispose=i,this._onDispose=new I,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}let B9e=class{constructor(e,t){this.logService=e,this.configurationService=t,this._onTunnelOpened=new I,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new I,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new I,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],t=Array.from(this._tunnels.values());for(const i of t){const s=Array.from(i.values());for(const o of s){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){for(const e of this._tunnels.values()){for(const{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,s,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:s,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(GG(e)||$G(e))&&(e=zG[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,s,o,r=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${o}.`);const l=this._tunnelProvider??e;if(!l)return;if(t||(t="localhost"),s||(s=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const d=this.retainOrCreateTunnel(l,t,i,s,o,r,a,c);return d?d.then(h=>{if(h){if(typeof h=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),h}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const u=this.makeTunnel(h);return(h.tunnelRemoteHost!==t||h.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&h.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(u),u}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),d)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const t=this._tunnels.get(e.tunnelRemoteHost);if(t){const i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);const s=i.value.then(async o=>{o&&typeof o!="string"&&(await o.dispose(!0),this._onTunnelClosed.fire({host:o.tunnelRemoteHost,port:o.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),s}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);const i=this._tunnels.get(e);if(i&&i.has(t)){const s=i.get(t);s.refcount=0,await this.tryDisposeTunnel(e,t,s)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){const i=this._tunnels.get(e);if(i){const s=i.get(t),o=s?await s.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];$G(e)?(i.push(...zG),i.push(...Yoe)):GG(e)&&i.push(...Yoe);const s=i.map(o=>this._tunnels.get(o));for(const o of s){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!PYt(e)}createWithProvider(e,t,i,s,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${s}.`);const c=i;this._factoryInProgress.add(c);const l=s===void 0?i:s,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:s,privacy:r,public:r?r!==zE.Private:void 0,protocol:a},u=e.forwardPort(h,d);return u?(this.addTunnelToMap(t,i,u),u.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),u}};B9e=D([_(0,Ze),_(1,Re)],B9e);const Sg=ae("IExtHostInitDataService"),gr=ae("IExtHostRpcService");class OYt{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}const W9e="vs/workbench/api/common/extHostTunnelService";class BYt extends FYt{}var Joe;(function(n){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?zE.Public:zE.Private),protocol:i.protocol}}n.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==zE.ConstantPrivate&&i.privacy!==zE.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}n.fromServiceTunnel=t})(Joe||(Joe={}));const FOe=ae("IExtHostTunnelService");let C0e=class extends ${constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new I,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);const i=await this._proxy.$openTunnel(t,e.displayName);if(i){const s=new BYt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(s),s}}async getTunnels(){return this._proxy.$getTunnels()}nextPortAttributesProviderHandle(){return this._providerHandleCounter++}registerPortsAttributesProvider(e,t){e.portRange===void 0&&e.commandPattern===void 0&&this.logService.error("PortAttributesProvider must specify either a portRange or a commandPattern");const i=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(i,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,i),new oo(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,s,o){const r=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];r.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:s},o)}catch{h=await l.provider.providePortAttributes(d,i,s,o)}return{providedAttributes:h,port:d}})))}const a=r.filter(c=>!!c.providedAttributes);return a.length>0?a.map(c=>({autoForwardAction:c.providedAttributes.autoForwardAction,port:c.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw new Error("A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.");this._forwardPortProvider=async(s,o)=>await e.provideTunnel(s,o,qe.None)??void 0;const i=t.tunnelFeatures?{elevation:!!t.tunnelFeatures?.elevation,privacyOptions:t.tunnelFeatures?.privacyOptions,protocol:t.tunnelFeatures.protocol===void 0?!0:t.tunnelFeatures.protocol}:void 0;return this._proxy.$setTunnelProvider(i),Promise.resolve(Ee(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0)}))}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());const i=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(i){this._forwardPortProvider=i;let s=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&s.length===0&&(s=[{id:"private",label:g(W9e,0,"Private"),themeIcon:"lock"},{id:"public",label:g(W9e,1,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:s,protocol:!0}:void 0;this._proxy.$setTunnelProvider(o)}}else this._forwardPortProvider=void 0;return Ee(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){const i=this._extensionTunnels.get(e.host);i.has(e.port)&&(t&&i.get(e.port).disposeListener.dispose(),await i.get(e.port).tunnel.dispose(),i.delete(e.port))}}async $onDidTunnelsChange(){this._onDidChangeTunnels.fire()}async $forwardPort(e,t){if(this._forwardPortProvider)try{this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Getting tunnel from provider.");const i=this._forwardPortProvider(e,t);if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider."),i!==void 0){const s=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),s===void 0){this.logService.error("ForwardedPorts: (ExtHostTunnelService) Resolved tunnel is undefined");return}this._extensionTunnels.has(e.remoteAddress.host)||this._extensionTunnels.set(e.remoteAddress.host,new Map);const o=this._register(s.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(s.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:s,disposeListener:o}),Joe.fromApiTunnel(s)}else this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined")}catch(i){if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) tunnel provider error"),i instanceof Error)return i.message}}async $applyCandidateFilter(e){const t=await Promise.all(e.map(s=>this._showCandidatePort(s.host,s.port,s.detail??""))),i=e.filter((s,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(s=>s.port).join(", ")} to ${i.map(s=>s.port).join(", ")}`),i}};C0e=D([_(0,gr),_(1,Sg),_(2,Ze)],C0e);const qG="vs/workbench/services/remote/common/tunnelModel",WYt=10*1e3,hY="remote.tunnels.toRestore",ime="remote.tunnels.toRestoreExpiration",HYt=1e3*60*60*24*14,H9e="onTunnel",Ert=new Y("forwardedPortsViewEnabled",!1,g(qG,0,"Whether the Ports view is enabled."));function UYt(n){const e=n.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);if(e)return{host:e[1]?.substring(0,e[1].length-1)||"localhost",port:Number(e[2])}}var qM;(function(n){n.Other="Other",n.User="User",n.AutoForwardEnd="AutoForwardEnd"})(qM||(qM={}));var Tb;(function(n){n[n.User=0]="User",n[n.Auto=1]="Auto",n[n.Extension=2]="Extension"})(Tb||(Tb={}));const nme={source:Tb.User,description:g(qG,1,"User Forwarded")};Tb.Auto,g(qG,2,"Auto Forwarded");function U9e(n,e,t){const i=n.get(Hf(e,t));if(i)return i;if($G(e))for(const s of zG){const o=Hf(s,t);if(n.has(o))return n.get(o)}else if(GG(e))for(const s of Yoe){const o=Hf(s,t);if(n.has(o))return n.get(o)}}function kf(n,e,t){const i=U9e(n,e,t);if(i)return i;const s=GG(e)?"localhost":$G(e)?"0.0.0.0":void 0;if(s)return U9e(n,s,t)}function Hf(n,e){return n+":"+e}var ak;(function(n){n.Notify="notify",n.OpenBrowser="openBrowser",n.OpenBrowserOnce="openBrowserOnce",n.OpenPreview="openPreview",n.Silent="silent",n.Ignore="ignore"})(ak||(ak={}));function VYt(n){return n&&"host"in n&&typeof n.host=="string"&&"port"in n&&typeof n.port=="number"&&(!("detail"in n)||typeof n.detail=="string")&&(!("pid"in n)||typeof n.pid=="string")}const Ig=class Ig extends ${constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(Ig.SETTING)||t.affectsConfiguration(Ig.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let s=this.findNextIndex(e,t,i,this.portsAttributes,0);const o={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;s>=0;){const r=this.portsAttributes[s];r.key===e?(o.onAutoForward=r.onAutoForward??o.onAutoForward,o.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,o.label=r.label??o.label,o.requireLocalPort=r.requireLocalPort,o.protocol=r.protocol):(o.onAutoForward=o.onAutoForward??r.onAutoForward,o.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,o.label=o.label??r.label,o.requireLocalPort=o.requireLocalPort!==void 0?o.requireLocalPort:void 0,o.protocol=o.protocol??r.protocol),s=this.findNextIndex(e,t,i,this.portsAttributes,s+1)}return o.onAutoForward!==void 0||o.elevateIfNeeded!==void 0||o.label!==void 0||o.requireLocalPort!==void 0||o.protocol!==void 0?o:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&zt(e.host)&&Kc(e.port)}findNextIndex(e,t,i,s,o){if(o>=s.length)return-1;const r=!$G(t)&&!GG(t),c=s.slice(o).findIndex(l=>Kc(l.key)?r?!1:l.key===e:this.hasStartEnd(l.key)?r?!1:e>=l.key.start&&e<=l.key.end:this.hasHostAndPort(l.key)?e===l.key.port&&t===l.key.host:i?l.key.test(i):!1);return c>=0?c+o:-1}readSetting(){const e=this.configurationService.getValue(Ig.SETTING);if(!e||!fo(e))return[];const t=[];for(const s in e){if(s===void 0)continue;const o=e[s];let r;if(Number(s))r=Number(s);else if(zt(s))if(Ig.RANGE.test(s)){const a=s.match(Ig.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(Ig.HOST_AND_PORT.test(s)){const a=s.match(Ig.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(s)}catch{}a&&(r=a)}r&&t.push({key:r,elevateIfNeeded:o.elevateIfNeeded,onAutoForward:o.onAutoForward,label:o.label,requireLocalPort:o.requireLocalPort,protocol:o.protocol})}const i=this.configurationService.getValue(Ig.DEFAULTS);return i&&(this.defaultPortAttributes={elevateIfNeeded:i.elevateIfNeeded,label:i.label,onAutoForward:i.onAutoForward,requireLocalPort:i.requireLocalPort,protocol:i.protocol}),this.sortAttributes(t)}sortAttributes(e){function t(i,s){return Kc(i.key)?i.key:s.hasStartEnd(i.key)?i.key.start:s.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,s)=>t(i,this)-t(s,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case rk.Notify:return ak.Notify;case rk.OpenBrowser:return ak.OpenBrowser;case rk.OpenBrowserOnce:return ak.OpenBrowserOnce;case rk.OpenPreview:return ak.OpenPreview;case rk.Silent:return ak.Silent;case rk.Ignore:return ak.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(Ig.SETTING).userRemoteValue;let r;!o||!fo(o)?r={}:r=Vs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(Ig.SETTING,r,i)}};Ig.SETTING="remote.portsAttributes",Ig.DEFAULTS="remote.otherPortsAttributes",Ig.RANGE=/^(\d+)\-(\d+)$/,Ig.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Xoe=Ig,QG=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=s,this.remoteAuthorityResolverService=o,this.workspaceContextService=r,this.logService=a,this.dialogService=c,this.extensionService=l,this.contextKeyService=d,this.inProgress=new Map,this._onForwardPort=new I,this.onForwardPort=this._onForwardPort.event,this._onClosePort=new I,this.onClosePort=this._onClosePort.event,this._onPortName=new I,this.onPortName=this._onPortName.event,this._onCandidatesChanged=new I,this.onCandidatesChanged=this._onCandidatesChanged.event,this._onEnvironmentTunnelsSet=new I,this.onEnvironmentTunnelsSet=this._onEnvironmentTunnelsSet.event,this._environmentTunnelsSet=!1,this.restoreListener=void 0,this.restoreComplete=!1,this.onRestoreComplete=new I,this.unrestoredExtensionTunnels=new Map,this.sessionCachedProperties=new Map,this.portAttributesProviders=[],this.mismatchCooldown=new Date,this.configPortsAttributes=new Xoe(i),this.tunnelRestoreValue=this.getTunnelRestoreValue(),this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes,this)),this.forwarded=new Map,this.remoteTunnels=new Map,this.tunnelService.tunnels.then(async h=>{const u=await this.getAttributes(h.map(f=>({port:f.tunnelRemotePort,host:f.tunnelRemoteHost})));for(const f of h)if(f.localAddress){const p=Hf(f.tunnelRemoteHost,f.tunnelRemotePort),m=kf(this._candidates??new Map,f.tunnelRemoteHost,f.tunnelRemotePort);this.forwarded.set(p,{remotePort:f.tunnelRemotePort,remoteHost:f.tunnelRemoteHost,localAddress:f.localAddress,protocol:u?.get(f.tunnelRemotePort)?.protocol??jm.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:nme}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Hf(h.tunnelRemoteHost,h.tunnelRemotePort);if(!kf(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!kf(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=kf(this._candidates??new Map,h.tunnelRemoteHost,h.tunnelRemotePort),p=(await this.getAttributes([{port:h.tunnelRemotePort,host:h.tunnelRemoteHost}]))?.get(h.tunnelRemotePort);this.forwarded.set(u,{remoteHost:h.tunnelRemoteHost,remotePort:h.tunnelRemotePort,localAddress:h.localAddress,protocol:p?.protocol??jm.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:nme})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,qM.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(H9e))?(this.contextKeyService.createKey(Ert.key,!0),!0):!1}checkExtensionActivationEvents(){if(this.extensionHasActivationEvent())return;const e=this._register(this.extensionService.onDidRegisterExtensions(()=>{this.extensionHasActivationEvent()&&e.dispose()}))}async onTunnelClosed(e,t){const i=Hf(e.host,e.port);this.forwarded.has(i)&&(this.forwarded.delete(i),await this.storeForwarded(),this._onClosePort.fire(e))}makeLocalUri(e,t){if(e.startsWith("http"))return P.parse(e);const i=t?.protocol??"http";return P.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Ed(t.configuration.path):t.folders.length>0?Ed(t.folders[0].uri.path):void 0;if(i===void 0){this.logService.debug("Could not get workspace hash for forwarded ports storage key.");return}return`${e}.${this.environmentService.remoteAuthority}.${i}`}async getTunnelRestoreStorageKey(){return this.addStorageKeyPostfix(hY)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(ime)}async getTunnelRestoreValue(){const e=this.storageService.get(hY,ke.WORKSPACE);if(e)return this.storageService.remove(hY,ke.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,ke.PROFILE)}async restoreForwarded(){if(this.cleanupExpiredTunnelsForRestore(),this.configurationService.getValue("remote.restoreForwardedPorts")){const e=await this.tunnelRestoreValue;if(e&&e!==this.knownPortsRestoreValue){const t=JSON.parse(e)??[];this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${t.map(i=>i.remotePort).join(", ")}`);for(const i of t){const s=kf(this.detected,i.remoteHost,i.remotePort);i.source.source!==Tb.Extension&&!s||i.source.source===Tb.Extension&&s?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===Tb.Extension&&!s&&this.unrestoredExtensionTunnels.set(Hf(i.remoteHost,i.remotePort),i)}}}if(this.restoreComplete=!0,this.onRestoreComplete.fire(),!this.restoreListener){const e=await this.getTunnelRestoreStorageKey();this.restoreListener=this._register(new Z),this.restoreListener.add(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,ke.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(ke.PROFILE,ln.USER).filter(t=>t.startsWith(ime));for(const t of e){const i=this.storageService.getNumber(t,ke.PROFILE);if(i&&i({remoteHost:r.remoteHost,remotePort:r.remotePort,localPort:r.localPort,name:r.name,localAddress:r.localAddress,localUri:r.localUri,protocol:r.protocol,source:r.source}));let i;e.length>0&&(i=JSON.stringify(t));const s=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&s&&o?(this.storageService.remove(s,ke.PROFILE),this.storageService.remove(o,ke.PROFILE)):i!==this.knownPortsRestoreValue&&s&&o&&(this.storageService.store(s,i,ke.PROFILE,ln.USER),this.storageService.store(o,Date.now()+HYt,ke.PROFILE,ln.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const s=new Date;if(this.mismatchCooldown.getTime()+WYt>s.getTime())return;this.mismatchCooldown=s;const o=g(qG,3,`Local port {0} could not be used for forwarding to remote port {1}. This usually happens when there is already another process using local port {0}. -Port number {2} has been used instead.`,t,e.tunnelRemotePort,e.tunnelLocalPort);return this.dialogService.info(o)}async forward(e,t){return!this.restoreComplete&&this.environmentService.remoteAuthority&&await T.toPromise(this.onRestoreComplete.event),this.doForward(e,t)}async doForward(e,t){await this.extensionService.activateByEvent(H9e);const i=kf(this.forwarded,e.remote.host,e.remote.port);t=t??(t!==null?(await this.getAttributes([e.remote]))?.get(e.remote.port):void 0);const s=e.local!==void 0?e.local:e.remote.port;let o;if(i)return this.mergeAttributesIntoExistingTunnel(i,e,t);{const r=this.environmentService.remoteAuthority,a=r?{getAddress:async()=>(await this.remoteAuthorityResolverService.resolveAuthority(r)).authority}:void 0,c=Hf(e.remote.host,e.remote.port);this.inProgress.set(c,!0),e=this.mergeCachedAndUnrestoredProperties(c,e);const l=await this.tunnelService.openTunnel(a,e.remote.host,e.remote.port,void 0,s,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=kf(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===jm.Https?jm.Https:jm.Http:t?.protocol??jm.Http,u={remoteHost:l.tunnelRemoteHost,remotePort:l.tunnelRemotePort,localPort:l.tunnelLocalPort,name:t?.label??e.name,closeable:!0,localAddress:l.localAddress,protocol:h,localUri:await this.makeLocalUri(l.localAddress,t),runningProcess:d?.detail,hasRunningProcess:!!d,pid:d?.pid,source:e.source??nme,privacy:l.privacy};return this.forwarded.set(c,u),this.remoteTunnels.set(c,l),this.inProgress.delete(c),await this.storeForwarded(),await this.showPortMismatchModalIfNeeded(l,s,t),this._onForwardPort.fire(u),l}this.inProgress.delete(c)}return o}mergeCachedAndUnrestoredProperties(e,t){const i=this.unrestoredExtensionTunnels.has(e)?this.unrestoredExtensionTunnels:this.sessionCachedProperties.has(e)?this.sessionCachedProperties:void 0;if(i){const s=i.get(e);i.delete(e),s&&(t.name=s.name??t.name,t.local=("local"in s?s.local:"localPort"in s?s.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const s=i?.label??t.name;let o;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(o||(o={}));let r=o.None;switch(s!==e.name&&(e.name=s,r=o.Fire),(i?.protocol||e.protocol!==jm.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,r=o.Reopen),t.privacy&&e.privacy!==t.privacy&&(r=o.Reopen),r){case o.Fire:{this._onForwardPort.fire();break}case o.Reopen:await this.close(e.remoteHost,e.remotePort,qM.User),await this.doForward(t,i)}return kf(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const s=kf(this.forwarded,e,t),o=Hf(e,t);if(s){s.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(o)&&(this.detected.get(o).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const s=Hf(e,t),o=this.forwarded.get(s);return i===qM.AutoForwardEnd&&o&&o.source.source===Tb.Auto&&this.sessionCachedProperties.set(s,{local:o.localPort,name:o.name,privacy:o.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Hf(e,t);return(this.forwarded.get(i)||this.detected.get(i))?.localAddress}get environmentTunnelsSet(){return this._environmentTunnelsSet}addEnvironmentTunnels(e){if(e)for(const t of e){const i=kf(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),s=typeof t.localAddress=="string"?t.localAddress:Hf(t.localAddress.host,t.localAddress.port);this.detected.set(Hf(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:s,protocol:jm.Http,localUri:this.makeLocalUri(s),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:zE.ConstantPrivate,source:{source:Tb.Extension,description:g(qG,4,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,s,zE.ConstantPrivate,jm.Http)}this._environmentTunnelsSet=!0,this._onEnvironmentTunnelsSet.fire(),this._onForwardPort.fire()}setCandidateFilter(e){this._candidateFilter=e}async setCandidates(e){let t=e;this._candidateFilter&&(t=await this._candidateFilter(e));const i=this.updateInResponseToCandidates(t);this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${Array.from(i.values()).map(s=>s.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(s=>{const o=Hf(s.host,s.port);i.set(o,{host:s.host,port:s.port,detail:s.detail,pid:s.pid}),t.has(o)&&t.delete(o);const r=kf(this.forwarded,s.host,s.port);r&&(r.runningProcess=s.detail,r.hasRunningProcess=!0,r.pid=s.pid)}),t.forEach((s,o)=>{const r=UYt(o);if(!r)return;const a=kf(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=kf(this.detected,r.host,r.port);c&&(c.runningProcess=void 0,c.hasRunningProcess=!1,c.pid=void 0)}),t}get candidates(){return this._candidates?Array.from(this._candidates.values()):[]}get candidatesOrUndefined(){return this._candidates?this.candidates:void 0}async updateAttributes(){const e=Array.from(this.forwarded.values()),t=await this.getAttributes(e.map(i=>({port:i.remotePort,host:i.remoteHost})),!1);if(t)for(const i of e){const s=t.get(i.remotePort);(s?.protocol||i.protocol!==jm.Http)&&s?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},s),s&&s.label&&s.label!==i.name&&await this.name(i.remoteHost,i.remotePort,s.label)}}async getAttributes(e,t=!0){const i=new Map,s=new Map;e.forEach(l=>{const d=kf(this._candidates??new Map,zG[0],l.port)??l;if(d){i.set(l.port,d);const h=VYt(d)?d.pid:void 0;s.has(h)||s.set(h,[]),s.get(h)?.push(l.port)}});const o=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&o.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return o.size>0?o:void 0;const r=await Promise.all(this.portAttributesProviders.flatMap(l=>Array.from(s.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,qe.None)}))),a=new Map;if(r.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!o&&!a)return;const c=new Map;return e.forEach(l=>{const d=o.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??Xoe.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};QG.__decorator=D([kNe(1e3)],QG.prototype,"storeForwarded",null);QG=D([_(0,Qde),_(1,sn),_(2,Re),_(3,Za),_(4,rA),_(5,Ti),_(6,Ze),_(7,To),_(8,ho),_(9,Pe)],QG);const QD="vs/workbench/services/remote/common/remoteExplorerService",V9e="remote.explorerType",z9e="remote.autoForwardPorts",$9e="remote.autoForwardPortsSource",G9e="output",zYt="hybrid";var q9e;(function(n){n.Candidate="Candidate",n.Detected="Detected",n.Forwarded="Forwarded",n.Add="Add"})(q9e||(q9e={}));var Q9e;(function(n){n[n.None=0]="None",n[n.New=1]="New",n[n.Label=2]="Label",n[n.LocalPort=3]="LocalPort"})(Q9e||(Q9e={}));const $Yt={type:"object",required:["id"],properties:{id:{description:g(QD,0,"The ID of a Get Started walkthrough to open."),type:"string"}}},GYt=Ap.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(QD,1,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(QD,2,"The url, or a command that returns the url, to your project's Getting Started page, or a walkthrough ID contributed by your project's extension"),oneOf:[{type:"string"},$Yt]},documentation:{description:g(QD,3,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(QD,4,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(QD,5,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(QD,6,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(QD,7,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let j9e=class{constructor(e,t,i){this.storageService=e,this.tunnelService=t,this._targetType=[],this._onDidChangeTargetType=new I,this.onDidChangeTargetType=this._onDidChangeTargetType.event,this._onDidChangeHelpInformation=new I,this.onDidChangeHelpInformation=this._onDidChangeHelpInformation.event,this._helpInformation=[],this._onDidChangeEditable=new I,this.onDidChangeEditable=this._onDidChangeEditable.event,this._onEnabledPortsFeatures=new I,this.onEnabledPortsFeatures=this._onEnabledPortsFeatures.event,this._portsFeaturesEnabled=!1,this.namedProcesses=new Map,this._tunnelModel=i.createInstance(QG),GYt.setHandler(s=>{this._helpInformation.push(...s),this._onDidChangeHelpInformation.fire(s)})}get helpInformation(){return this._helpInformation}set targetType(e){const t=this._targetType.length>0?this._targetType[0]:"",i=e.length>0?e[0]:"";t!==i&&(this._targetType=e,this.storageService.store(V9e,this._targetType.toString(),ke.WORKSPACE,ln.MACHINE),this.storageService.store(V9e,this._targetType.toString(),ke.PROFILE,ln.USER),this._onDidChangeTargetType.fire(this._targetType))}get targetType(){return this._targetType}get tunnelModel(){return this._tunnelModel}forward(e,t){return this.tunnelModel.forward(e,t)}close(e,t){return this.tunnelModel.close(e.host,e.port,t)}setTunnelInformation(e){e?.features&&this.tunnelService.setTunnelFeatures(e.features),this.tunnelModel.addEnvironmentTunnels(e?.environmentTunnels)}setEditable(e,t,i){i?this._editable={tunnelItem:e,data:i,editId:t}:this._editable=void 0,this._onDidChangeEditable.fire(e?{tunnel:e,editId:t}:void 0)}getEditableData(e,t){return this._editable&&(!e&&e===this._editable.tunnelItem||e&&this._editable.tunnelItem?.remotePort===e.remotePort&&this._editable.tunnelItem.remoteHost===e.remoteHost&&this._editable.editId===t)?this._editable.data:void 0}setCandidateFilter(e){return e?(this.tunnelModel.setCandidateFilter(e),{dispose:()=>{this.tunnelModel.setCandidateFilter(void 0)}}):{dispose:()=>{}}}onFoundNewCandidates(e){this.tunnelModel.setCandidates(e)}restore(){return this.tunnelModel.restoreForwarded()}enablePortsFeatures(){this._portsFeaturesEnabled=!0,this._onEnabledPortsFeatures.fire()}get portsFeaturesEnabled(){return this._portsFeaturesEnabled}};j9e=D([_(0,sn),_(1,Qde),_(2,be)],j9e);const K9e="vs/workbench/api/browser/mainThreadTunnelService";let Y9e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=s,this.configurationService=o,this.logService=r,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(et.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(z9e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue($9e)!==G9e}async $setRemoteTunnelService(e){this.remoteExplorerService.namedProcesses.set(e,"Code Extension Host"),this.remoteExplorerService.portsFeaturesEnabled?this._proxy.$registerCandidateFinder(this.processFindingEnabled()):this._register(this.remoteExplorerService.onEnabledPortsFeatures(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled()))),this._register(this.configurationService.onDidChangeConfiguration(async t=>{if(t.affectsConfiguration(z9e)||t.affectsConfiguration($9e))return this._proxy.$registerCandidateFinder(this.processFindingEnabled())})),this._register(this.tunnelService.onAddedTunnelProvider(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled())))}async $registerPortsAttributesProvider(e,t){this.portsAttributesProviders.set(t,e),this._alreadyRegistered||(this.remoteExplorerService.tunnelModel.addAttributesProvider(this),this._alreadyRegistered=!0)}async $unregisterPortsAttributesProvider(e){this.portsAttributesProviders.delete(e)}async providePortAttributes(e,t,i,s){if(this.portsAttributesProviders.size===0)return[];const o=Array.from(this.portsAttributesProviders.entries()).filter(r=>{const a=r[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&hr[0]);return o.length===0?[]:this._proxy.$providePortAttributes(o,e,t,i,s)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:t},elevateIfNeeded:!1});if(!(!i||typeof i=="string"))return!this.elevateionRetry&&e.localAddressPort!==void 0&&i.tunnelLocalPort!==void 0&&this.tunnelService.isPortPrivileged(e.localAddressPort)&&i.tunnelLocalPort!==e.localAddressPort&&this.tunnelService.canElevate&&this.elevationPrompt(e,i,t),Joe.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(nt.Info,g(K9e,0,"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",i,e.remoteAddress.port,e.localAddressPort),[{label:g(K9e,1,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},qM.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,qM.Other)}async $getTunnels(){return(await this.tunnelService.tunnels).map(e=>({remoteAddress:{port:e.tunnelRemotePort,host:e.tunnelRemoteHost},localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol}))}async $onFoundNewCandidates(e){this.remoteExplorerService.onFoundNewCandidates(e)}async $setTunnelProvider(e){const t={forwardPort:(i,s)=>this._proxy.$forwardPort(i,s).then(r=>{if(r){if(typeof r=="string")return r}else return;const a=r;return this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) New tunnel established by tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),{tunnelRemotePort:a.remoteAddress.port,tunnelRemoteHost:a.remoteAddress.host,localAddress:typeof a.localAddress=="string"?a.localAddress:Hf(a.localAddress.host,a.localAddress.port),tunnelLocalPort:typeof a.localAddress!="string"?a.localAddress.port:void 0,public:a.public,privacy:a.privacy,protocol:a.protocol??jm.Http,dispose:async c=>(this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) Closing tunnel from tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),this._proxy.$closeTunnel({host:a.remoteAddress.host,port:a.remoteAddress.port},c))}})};e&&this.tunnelService.setTunnelFeatures(e),this.tunnelService.setTunnelProvider(t),this.contextKeyService.createKey(Ert.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case UM.None:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case UM.Output:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":G9e}}]);break}case UM.Hybrid:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":zYt}}]);break}}}).catch(()=>{})}};Y9e=D([Zi(Ue.MainThreadTunnelService),_(1,she),_(2,Qde),_(3,Pi),_(4,Re),_(5,Ze),_(6,Sf),_(7,Pe)],Y9e);const sme="vs/workbench/services/authentication/browser/authenticationService";function xrt(n){return`onAuthenticationRequest:${n}`}let J9e=class extends ${constructor(e,t,i){super(),this._extensionService=e,this._environmentService=i,this._onDidRegisterAuthenticationProvider=this._register(new I),this.onDidRegisterAuthenticationProvider=this._onDidRegisterAuthenticationProvider.event,this._onDidUnregisterAuthenticationProvider=this._register(new I),this.onDidUnregisterAuthenticationProvider=this._onDidUnregisterAuthenticationProvider.event,this._onDidChangeSessions=this._register(new I),this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeDeclaredProviders=this._register(new I),this.onDidChangeDeclaredProviders=this._onDidChangeDeclaredProviders.event,this._authenticationProviders=new Map,this._authenticationProviderDisposables=this._register(new Zo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(s=>{this._onDidChangeSessions.fire({providerId:s.providerId,label:s.accountName,event:{added:[],changed:[],removed:[]}})})),this._registerEnvContributedAuthenticationProviders()}get declaredProviders(){return this._declaredProviders}_registerEnvContributedAuthenticationProviders(){if(this._environmentService.options?.authenticationProviders?.length)for(const e of this._environmentService.options.authenticationProviders)this.registerAuthenticationProvider(e.id,e)}registerDeclaredAuthenticationProvider(e){if(Xv(e.id))throw new Error(g(sme,0,"An authentication contribution must specify an id."));if(Xv(e.label))throw new Error(g(sme,1,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(sme,2,"This authentication id '{0}' has already been registered",e.id));this._declaredProviders.push(e),this._onDidChangeDeclaredProviders.fire()}unregisterDeclaredAuthenticationProvider(e){const t=this.declaredProviders.findIndex(i=>i.id===e);t>-1&&this.declaredProviders.splice(t,1),this._onDidChangeDeclaredProviders.fire()}isAuthenticationProviderRegistered(e){return this._authenticationProviders.has(e)}registerAuthenticationProvider(e,t){this._authenticationProviders.set(e,t);const i=new Z;i.add(t.onDidChangeSessions(s=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:s}))),cz(t)&&i.add(t),this._authenticationProviderDisposables.set(e,i),this._onDidRegisterAuthenticationProvider.fire({id:e,label:t.label})}unregisterAuthenticationProvider(e){const t=this._authenticationProviders.get(e);t&&(this._authenticationProviders.delete(e),this._onDidUnregisterAuthenticationProvider.fire({id:e,label:t.label})),this._authenticationProviderDisposables.deleteAndDispose(e)}getProviderIds(){const e=[];return this._authenticationProviders.forEach(t=>{e.push(t.id)}),e}getProvider(e){if(this._authenticationProviders.has(e))return this._authenticationProviders.get(e);throw new Error(`No authentication provider '${e}' is currently registered.`)}async getSessions(e,t,i=!1){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,i);if(s)return await s.getSessions(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(s)return await s.createSession(t,{sessionToRecreate:i?.sessionToRecreate});throw new Error(`No authentication provider '${e}' is currently registered.`)}async removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return i.removeSession(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async tryActivateProvider(e,t){await this._extensionService.activateByEvent(xrt(e),t?sC.Immediate:sC.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const s=new Z,o=new Promise((a,c)=>{s.add(T.once(this.onDidRegisterAuthenticationProvider)(l=>{if(l.id===e)if(i=this._authenticationProviders.get(e),i)a(i);else throw new Error(`No authentication provider '${e}' is currently registered.`)}))}),r=new Promise((a,c)=>{const l=setTimeout(()=>{c("Timed out waiting for authentication provider to register")},5e3);s.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>s.dispose())}};J9e=D([_(0,ho),_(1,ehe),_(2,Ow)],J9e);const OB="vs/workbench/api/browser/mainThreadAuthentication";class qYt extends ${constructor(e,t,i,s,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=s,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e){return this._proxy.$getSessions(this.id,e)}createSession(e,t){return this._proxy.$createSession(this.id,e,t)}async removeSession(e){await this._proxy.$removeSession(this.id,e),this.notificationService.info(g(OB,0,"Successfully signed out."))}}let X9e=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=s,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const s=new I;this._registrations.set(e,s);const o=new qYt(this._proxy,e,t,i,this.notificationService,s);this.authenticationService.registerAuthenticationProvider(e,o)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(xrt(e),sC.Immediate)}$sendDidChangeSessions(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$removeSession(e,t){return this.authenticationService.removeSession(e,t)}async loginPrompt(e,t,i,s){let o;e.id.startsWith(tue)?o=g(OB,1,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(OB,2,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(OB,3,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(OB,4,"&&Allow"),run(){return!0}}];s?.learnMore&&r.push({label:g(OB,5,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,s);return await this.openerService.open(P.revive(s.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:nt.Info,message:o,buttons:r,detail:s?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,s,o){const r=await this.authenticationService.getSessions(e,t,!0),a=this.authenticationService.getProvider(e);if(o.forceNewSession&&o.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(o.forceNewSession&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(o.createIfNone&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts)if(o.clearSessionPreference)this.authenticationExtensionsService.removeSessionPreference(e,i,t);else{const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=r.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,r[0].account.label,i))return r[0]}if(o.createIfNone||o.forceNewSession){let l;typeof o.forceNewSession=="object"&&(l=o.forceNewSession);const d=!!(o.forceNewSession&&r.length);if(!await this.loginPrompt(a,s,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts?await this.authenticationExtensionsService.selectSession(e,i,s,t,r):r[0];else{let f;if(typeof o.forceNewSession=="object"&&o.forceNewSession.sessionToRecreate)f=o.forceNewSession.sessionToRecreate;else{const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p):void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,sessionToRecreate:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:s,allowed:!0}]),this.authenticationExtensionsService.updateSessionPreference(e,i,u),u}const c=r.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;o.silent||(r.length?this.authenticationExtensionsService.requestSessionAccess(e,i,s,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,s))}async $getSession(e,t,i,s,o){const r=await this.doGetSession(e,t,i,s,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,s)),r}async $getSessions(e,t,i,s){const r=(await this.authenticationService.getSessions(e,[...t],!0)).filter(a=>this.authenticationAccessService.isAccessAllowed(e,a.account.label,i));if(r.length){this.sendProviderUsageTelemetry(i,e);for(const a of r)this.authenticationUsageService.addAccountUsage(e,a.account.label,i,s)}return r}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};X9e=D([Zi(Ue.MainThreadAuthentication),_(1,PPe),_(2,pet),_(3,ehe),_(4,fet),_(5,To),_(6,Pi),_(7,ho),_(8,on),_(9,fr)],X9e);let Z9e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(et.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let s=i.get(e.id);s===void 0&&(s=new I,i.set(e.id,s)),this._timelineService.registerTimelineProvider({...e,onDidChange:s.event,async provideTimeline(o,r,a){return Or(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),s?.dispose()}})}$unregisterTimelineProvider(e){this.logService.trace(`MainThreadTimeline#unregisterTimelineProvider: id=${e}`),this._timelineService.unregisterTimelineProvider(e)}$emitTimelineChangeEvent(e){this.logService.trace(`MainThreadTimeline#emitChangeEvent: id=${e.id}, uri=${e.uri?.toString(!0)}`),this._providerEmitters.get(e.id)?.fire(e)}dispose(){}};Z9e=D([Zi(Ue.MainThreadTimeline),_(1,Ze),_(2,det)],Z9e);class Zoe extends ${get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this.changeEmitter.fire(e))}static stored(e,t){const i=new Zoe(e.get(t));return i._register(e),i._register(i.onDidChange(s=>e.store(s))),i}constructor(e){super(),this._value=e,this.changeEmitter=this._register(new I),this.onDidChange=this.changeEmitter.event}}let y0e=0;class QYt{constructor(e,t,i,s){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=s,this.fileCoverage=new wi,this.didAddCoverage=oL(this),this.tree=new qse,this.associatedData=new Map,this.perTestCoverageIDs=new Set}append(e,t){const i=this.getComputedForUri(e.uri),s=this.result,o=(l,d)=>{d[l]?(d[l].covered+=(e[l]?.covered||0)-(i?.[l]?.covered||0),d[l].total+=(e[l]?.total||0)-(i?.[l]?.total||0)):e[l]&&(d[l]={...e[l]})},r=[...this.treePathForUri(e.uri,!0)],a=[],c=!!e.testId;e.testId&&this.perTestCoverageIDs.add(e.testId.toString()),this.tree.mutatePath(this.treePathForUri(e.uri,!1),l=>{if(a.push(l),a.length===r.length)if(c){const d=l.value??=new U5(Yse.empty(String(y0e++),e.uri),s,this.accessor);Agt(d instanceof U5,"coverage is unexpectedly computed"),d.perTestData??=new Map;const h=new U5(e,s,this.accessor);h.isForTest={id:e.testId,parent:d},d.perTestData.set(e.testId.toString(),h),this.fileCoverage.set(e.uri,d)}else if(l.value){const d=l.value;d.id=e.id,d.statement=e.statement,d.branch=e.branch,d.declaration=e.declaration}else{const d=l.value=new U5(e,s,this.accessor);this.fileCoverage.set(e.uri,d)}else if(!c)if(l.value)o("statement",l.value),o("branch",l.value),o("declaration",l.value),l.value.didChange.trigger(t);else{const d=Vs(e);d.id=String(y0e++),d.uri=this.treePathToUri(r.slice(0,a.length)),l.value=new krt(d,s)}}),a&&!c&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new qse;for(const i of this.tree.values())if(i instanceof U5){const s=i.perTestData?.get(e.toString());if(!s)continue;const o=[...this.treePathForUri(s.uri,!0)],r=[];t.mutatePath(this.treePathForUri(s.uri,!1),a=>{r.push(a),r.length===o.length?a.value=s:a.value??=new KYt(this.treePathToUri(o.slice(0,r.length)),s.fromResult)})}return t}getAllFiles(){return this.fileCoverage}getUri(e){return this.fileCoverage.get(e)}getComputedForUri(e){return this.tree.find(this.treePathForUri(e,!1))}*treePathForUri(e,t){yield e.scheme,yield e.authority,yield*(!t&&this.uriIdentityService.extUri.ignorePathCasing(e)?e.path.toLowerCase():e.path).split("/")}treePathToUri(e){return P.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const jYt=(n,e,t)=>{let i=n.covered,s=n.total;return e&&(i+=e.covered,s+=e.total),t&&(i+=t.covered,s+=t.total),s===0?1:i/s};class Drt{get tpc(){return jYt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=oL(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class krt extends Drt{}class KYt extends krt{constructor(e,t){super({id:String(y0e++),uri:e,statement:{covered:0,total:0}},t)}}class U5 extends Drt{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async details(e=qe.None){this._details??=this.accessor.getCoverageDetails(this.id,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const Kv={[Xn.Running]:6,[Xn.Errored]:5,[Xn.Failed]:4,[Xn.Queued]:3,[Xn.Passed]:2,[Xn.Unset]:0,[Xn.Skipped]:1};Gct(Kv,(n,e)=>({statusNode:!0,state:Number(e),priority:n}));const YYt=(n,e)=>Kv[e]-Kv[n],Irt=(...n)=>{switch(n.length){case 0:return Xn.Unset;case 1:return n[0];case 2:return Kv[n[0]]>Kv[n[1]]?n[0]:n[1];default:{let e=n[0];for(let t=1;tNumber(n)).sort(YYt),e7e={[Xn.Passed]:0,[Xn.Skipped]:1,[Xn.Failed]:2,[Xn.Errored]:3},Lrt=()=>new Uint32Array(JYt.length),XYt=n=>"getOwnDuration"in n,S0e=(n,e,t=!1)=>{let i=n.getCurrentComputedState(e);if(i===void 0||t){i=n.getOwnState(e)??Xn.Unset;let s=0;const o=Lrt();for(const r of n.getChildren(e)){const a=S0e(n,r);s++,o[a]++,i=a===Xn.Skipped&&i===Xn.Unset?Xn.Skipped:Irt(i,a)}s>ZYt&&Rrt.set(e,o),n.setComputedState(e,i)}return i},Trt=(n,e,t=!1)=>{let i=n.getCurrentComputedDuration(e);if(i===void 0||t){const s=n.getOwnDuration(e);if(s!==void 0)i=s;else{i=void 0;for(const o of n.getChildren(e)){const r=Trt(n,o);r!==void 0&&(i=(i||0)+r)}}n.setComputedDuration(e,i)}return i},ZYt=64,Rrt=new WeakMap,eJt=(n,e,t,i=!0)=>{const s=n.getCurrentComputedState(e),o=Kv[s],r=S0e(n,e,!0),a=Kv[r],c=new Set;if(a!==o){n.setComputedState(e,r),c.add(e);let l=s,d=r;for(const h of n.getParents(e)){const u=Rrt.get(h);u&&(u[l]--,u[d]++);const f=n.getCurrentComputedState(h);if(a>o){if(f!==void 0&&Kv[f]>=a||u&&u[d]>1)break;n.setComputedState(h,r),c.add(h)}else{if(f===void 0||Kv[f]>o||u&&u[l]>0)break;d=S0e(n,h,!0),n.setComputedState(h,d),c.add(h)}l=f}}if(XYt(n)&&i)for(const l of fi.concat(fi.single(e),n.getParents(e))){const d=n.getCurrentComputedDuration(l),h=Trt(n,l,!0);if(d===h)break;n.setComputedDuration(l,h),c.add(l)}return c},tJt="vs/workbench/contrib/testing/common/testResult";T.None,Promise.resolve();class iJt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new sd,this.offset=0,this.onDidWriteData=this.writeDataEmitter.event,this.endPromise=this.endDeferred.p,this.buffers=[]}get length(){return this.offset}getRange(e,t){const i=ze.alloc(t);let s=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,s),s+=o.byteLength;return s0;c--){const l=e.buffer[c-1];if(l!==o.CR&&l!==o.LF)break}return this.push(e.slice(0,c)),this.push(a),this.push(e.slice(c)),{offset:i,length:s}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const t7e=(n,e)=>`\x1B]633;SetMark;Id=${eKt(n,e)};Hidden\x07`,nJt=(n,e,t)=>({controllerId:n,expand:Eh.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Xn.Unset,computedState:Xn.Unset});var HT;(function(n){n[n.ComputedStateChange=0]="ComputedStateChange",n[n.OwnStateChange=1]="OwnStateChange",n[n.NewMessage=2]="NewMessage"})(HT||(HT={}));let D2=class extends ${get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,s){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=s,this.completeEmitter=this._register(new I),this.newTaskEmitter=this._register(new I),this.endTaskEmitter=this._register(new I),this.changeEmitter=this._register(new I),this.testById=new Map,this.testMarkerCounter=0,this.startedAt=Date.now(),this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.onNewTask=this.newTaskEmitter.event,this.onEndTask=this.endTaskEmitter.event,this.tasks=[],this.name=g(tJt,0,"Test run at {0}",new Date().toLocaleString(Gd)),this.counts=Lrt(),this.computedStateAccessor={getOwnState:o=>o.ownComputedState,getCurrentComputedState:o=>o.computedState,setComputedState:(o,r)=>o.computedState=r,getChildren:o=>o.children,getParents:o=>{const{testById:r}=this;return function*(){const a=bn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new Ka(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serializeWithoutMessages)})),this.doSerializeWithMessages=new Ka(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,s){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(s||i)&&(r=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,r),h={location:i,message:o,offset:l,length:d,marker:r,type:dC.Output},u=s&&this.testById.get(s);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:HT.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:xi(this,void 0),otherMessages:[],output:new iJt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Xn.Unset});this.newTaskEmitter.fire(this.tasks.length-1)}addTestChainToRun(e,t){let i=this.testById.get(t[0].extId);i||(i=this.addTestToRun(e,t[0],null));for(let s=1;ss.state===Xn.Queued||s.state===Xn.Running),this.endTaskEmitter.fire(t)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const e of this.tasks)e.running&&this.markTaskComplete(e.id);this._completedAt=Date.now(),this.completeEmitter.fire(),this.telemetry.publicLog2("test.outcomes",{failures:this.counts[Xn.Errored]+this.counts[Xn.Failed],passes:this.counts[Xn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(bn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:HT.ComputedStateChange,item:i,result:this}))}toJSON(){return this.completedAt&&this.persist?this.doSerialize.value:void 0}toJSONWithMessages(){return this.completedAt&&this.persist?this.doSerializeWithMessages.value:void 0}setAllToState(e,t,i){const s=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[s],o)&&this.fireUpdateAndRefresh(o,s,e)}fireUpdateAndRefresh(e,t,i,s){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:HT.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,s!==void 0&&(e.tasks[t].duration=s,e.ownDuration=Math.max(e.ownDuration||0,s));const c=Irt(...e.tasks.map(l=>l.state));if(c===o){s!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,eJt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:HT.ComputedStateChange}))}addTestToRun(e,t,i){const s=nJt(e,t);if(this.testById.set(t.extId,s),this.counts[Xn.Unset]++,i&&this.testById.get(i)?.children.push(s),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};D2=D([_(3,on)],D2);let i7e=class extends ${constructor(e,t,i,s,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=s,this.resultService=o,this.diffListener=this._register(new Dn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(et.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(r,a)=>this.proxy.$provideTestFollowups(r,a),executeTestFollowup:r=>this.proxy.$executeTestFollowup(r),disposeTestFollowups:r=>this.proxy.$disposeTestFollowups(r)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(T.debounce(s.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Yu.Run,Yu.Debug,Yu.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))r[c.controllerId]??=[],r[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(r)})),this._register(o.onResultsChanged(r=>{if("completed"in r){const a=r.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in r&&r.removed.forEach(a=>{a instanceof D2&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new qse;for(const i of e)t.insert(bn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof D2&&i.markRetired(t)}$publishTestRunProfile(e){const t=this.testProviderRegistrations.get(e.controllerId);t&&this.testProfiles.addProfile(t.instance,e)}$updateTestRunConfig(e,t,i){this.testProfiles.updateProfile(e,t,i)}$removeTestProfile(e,t){this.testProfiles.removeProfile(e,t)}$addTestsToRun(e,t,i){this.withLiveRun(t,s=>s.addTestChainToRun(e,i.map(o=>SG.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,s=>{const o=s.tasks.find(a=>a.id===t);if(!o)return;const r=Yse.deserialize(this.uriIdentityService,i);En(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new QYt(s,t,this.uriIdentityService,{getCoverageDetails:(l,d)=>this.proxy.$getCoverageDetails(l,d).then(h=>h.map(Kke.deserialize))}),c.append(r,a),o.coverage.set(c,a))})})}$startedExtensionTestRun(e){this.resultService.createLiveResult(e)}$startedTestRunTask(e,t){this.withLiveRun(e,i=>i.addTask(t))}$finishedTestRunTask(e,t){this.withLiveRun(e,i=>i.markTaskComplete(t))}$finishedExtensionTestRun(e){this.withLiveRun(e,t=>t.markComplete())}$updateTestStateInRun(e,t,i,s,o){this.withLiveRun(e,r=>r.updateState(i,t,s,o))}$appendOutputToRun(e,t,i,s,o){const r=s&&{uri:P.revive(s.uri),range:O.lift(s.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,s){const o=this.resultService.getResult(e);if(o&&o instanceof D2)for(const r of s)o.appendMessage(i,t,yG.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const s=new Z,o=s.add(new Zoe(t)),r=s.add(new Zoe(i)),a={id:e,label:o,canRefresh:r,syncTests:()=>this.proxy.$syncTests(),refreshTests:c=>this.proxy.$refreshTests(e,c),configureRunProfile:c=>this.proxy.$configureRunProfile(e,c),runTests:(c,l)=>this.proxy.$runControllerTests(c,l),startContinuousRun:(c,l)=>this.proxy.$startContinuousRun(c,l),expandTest:(c,l)=>this.proxy.$expandTest(c,isFinite(l)?l:-1)};s.add(Ee(()=>this.testProfiles.removeProfile(e))),s.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,canRefresh:r,disposable:s})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&(t.label!==void 0&&(i.label.value=t.label),t.canRefresh!==void 0&&(i.canRefresh.value=t.canRefresh))}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(x4.serialize)),this.diffListener.value=this.testService.onDidProcessDiff(this.proxy.$acceptDiff,this.proxy)}$unsubscribeFromDiffs(){this.diffListener.clear()}$publishDiff(e,t){this.testService.publishDiff(e,t.map(i=>x4.deserialize(this.uriIdentityService,i)))}async $runTests(e,t){return(await this.testService.runResolvedTests(e,t)).id}dispose(){super.dispose();for(const e of this.testProviderRegistrations.values())e.disposable.dispose();this.testProviderRegistrations.clear()}withLiveRun(e,t){const i=this.resultService.getResult(e);return i&&i instanceof D2?t(i):void 0}};i7e=D([Zi(Ue.MainThreadTesting),_(1,_o),_(2,cet),_(3,ret),_(4,aet)],i7e);let n7e=class extends ${constructor(e,t,i,s){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Jht,this._proxy=e.getProxy(et.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(o=>{try{const{extensionId:r,key:a}=this.parseKey(o);r&&a&&this._proxy.$onDidChangePassword({extensionId:r,key:a})}catch{}}))}$getPassword(e,t){return this.logService.trace(`[mainThreadSecretState] Getting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doGetPassword(e,t))}async doGetPassword(e,t){const i=this.getKey(e,t),s=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${s?"P":"No p"}assword found for: `,e,t),s}$setPassword(e,t,i){return this.logService.trace(`[mainThreadSecretState] Setting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doSetPassword(e,t,i))}async doSetPassword(e,t,i){const s=this.getKey(e,t);await this.secretStorageService.set(s,i),this.logService.trace("[mainThreadSecretState] Password set for: ",e,t)}$deletePassword(e,t){return this.logService.trace(`[mainThreadSecretState] Deleting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doDeletePassword(e,t))}async doDeletePassword(e,t){const i=this.getKey(e,t);await this.secretStorageService.delete(i),this.logService.trace("[mainThreadSecretState] Password deleted for: ",e,t)}getKey(e,t){return JSON.stringify({extensionId:e,key:t})}parseKey(e){return JSON.parse(e)}};n7e=D([Zi(Ue.MainThreadSecretState),_(1,RZe),_(2,Ze),_(3,Ow)],n7e);let s7e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(et.ExtHostShare)}$registerShareProvider(e,t,i,s,o){const r={id:i,label:s,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,qe.None);return typeof l=="string"?l:P.revive(l)}};this.providers.set(e,r);const a=this.shareService.registerShareProvider(r);this.providerDisposables.set(e,a)}$unregisterShareProvider(e){this.providers.has(e)&&this.providers.delete(e),this.providerDisposables.has(e)&&this.providerDisposables.delete(e)}dispose(){this.providers.clear(),St(this.providerDisposables.values()),this.providerDisposables.clear()}};s7e=D([Zi(Ue.MainThreadShare),_(1,JZe)],s7e);let o7e=class extends ${constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new Zo),this.proxy=e.getProxy(et.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,s){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:s,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Or(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};o7e=D([Zi(Ue.MainThreadProfileContentHandlers),_(1,ket)],o7e);let r7e=class extends ${constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,qe.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(s,o)=>this._proxy.$provideAiRelatedInformation(e,s,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};r7e=D([Zi(Ue.MainThreadAiRelatedInformation),_(1,NPe)],r7e);let a7e=class extends ${constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(s,o)=>this._proxy.$provideAiEmbeddingVector(t,s,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};a7e=D([Zi(Ue.MainThreadAiEmbeddingVector),_(1,uet)],a7e);let A0e=class extends Kne{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(t,i,s,o,r,a,c,l,d,h,u,f,p),this.workerConfig=e}async _getWebWorkerExtensionHostIframeSrc(){const e=new URL(await super._getWebWorkerExtensionHostIframeSrc(),window.location.href);return e.searchParams.set("vscodeExtHostWorkerSrc",this.workerConfig.url),this.workerConfig.options!=null&&e.searchParams.set("vscodeExtHostWorkerOptions",JSON.stringify(this.workerConfig.options)),e.searchParams.set("parentOrigin",window.origin),e.toString()}};A0e=D([_(4,on),_(5,Ti),_(6,eo),_(7,Ze),_(8,wp),_(9,Ow),_(10,V_),_(11,Ja),_(12,bg),_(13,sn)],A0e);let E0e;function sJt(n){E0e=n}let x0e=class extends GDe{constructor(e,t,i,s,o,r,a,c,l){super(t,i,s,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return E0e==null?null:this._instantiationService.createInstance(E0e,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const s=i?2:1;return this._instantiationService.createInstance(A0e,this.workerConfig,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};x0e=D([_(4,be),_(5,Sf),_(6,rA),_(7,Kh),_(8,Ze)],x0e);let D0e=class extends qDe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,s,o){const r=PQt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,s,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};D0e=D([_(1,Ze)],D0e);let k0e=class extends $De{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k){const F=t.createInstance(PDe),N=new x0e(e,F,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,b,r,p);super(F,N,new D0e(e!=null?[2,1,3]:[1,3],p),t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new rT(e,t))}async _scanSingleExtension(e){return e.location.scheme===k6.extensionFile?ME(e):super._scanSingleExtension(e)}};k0e=D([_(1,be),_(2,Pi),_(3,Ow),_(4,on),_(5,Kh),_(6,ci),_(7,Ja),_(8,the),_(9,Ti),_(10,Re),_(11,G_),_(12,FPe),_(13,Ze),_(14,Sf),_(15,Gde),_(16,mg),_(17,rA),_(18,ahe),_(19,Tm),_(20,oA),_(21,she),_(22,To)],k0e);class oJt extends QDe{async readExtensionResource(e){return e.scheme===k6.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}Z9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>X9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function rJt(n,e){return{[ho.toString()]:new $i(k0e,[void 0],!1),[G_.toString()]:new $i(NDe,[],!0),[bPe.toString()]:new $i(oJt,[],!0),[Fz.toString()]:new $i(KDe,[],!0)}}const c7e=/^([^.]+\..+)[:=](.+)$/;class Yt{get remoteAuthority(){return this.options.remoteAuthority}get expectsResolverExtension(){return!!this.options.remoteAuthority?.includes("+")&&!this.options.webSocketFactory}get isBuilt(){return!!this.productService.commit}get logLevel(){const e=this.payload?.get("logLevel");return e?e.split(",").find(t=>!c7e.test(t)):this.options.developmentOptions?.logLevel!==void 0?c7(this.options.developmentOptions?.logLevel):void 0}get extensionLogLevel(){const e=this.payload?.get("logLevel");if(e){const t=[];for(const i of e.split(",")){const s=c7e.exec(i);s&&s[1]&&s[2]&&t.push([s[1],s[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,c7(i)]):void 0}get profDurationMarkers(){const e=this.payload?.get("profDurationMarkers");if(e){const t=[];for(const i of e.split(","))t.push(i);return t.length===2?t:void 0}}get windowLogsPath(){return this.logsHome}get logFile(){return qt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return P.file("/User").with({scheme:_e.vscodeUserData})}get argvResource(){return qt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return qt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return qt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return qt(this.userRoamingDataHome,"History")}get stateResource(){return qt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return qt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return qt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return qt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return qt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return qt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return qt(this.extHostLogsPath,"extensionTelemetry.log")}get debugExtensionHost(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.params}get isExtensionDevelopment(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.isExtensionDevelopment}get extensionDevelopmentLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentLocationURI}get extensionDevelopmentLocationKind(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentKind}get extensionTestsLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionTestsLocationURI}get extensionEnabledProposedApi(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionEnabledProposedApi}get debugRenderer(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.debugRenderer}get enableSmokeTestDriver(){return this.options.developmentOptions?.enableSmokeTestDriver}get disableExtensions(){return this.payload?.get("disableExtensions")==="true"}get enableExtensions(){return this.options.enabledExtensions}get webviewExternalEndpoint(){const e=this.options.webviewEndpoint||this.productService.webviewContentExternalBaseUrlTemplate||"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/",t=this.payload?.get("webviewExternalEndpointCommit");return e.replace("{{commit}}",t??this.productService.commit??"ef65ac1ba57f57f2a3961bfe94aa20481caca4c6").replace("{{quality}}",(t?"insider":this.productService.quality)??"insider")}get extensionTelemetryLogResource(){return qt(this.logsHome,"extensionTelemetry.log")}get disableTelemetry(){return!1}get verbose(){return this.payload?.get("verbose")==="true"}get logExtensionHostCommunication(){return this.payload?.get("logExtensionHostCommunication")==="true"}get skipReleaseNotes(){return this.payload?.get("skipReleaseNotes")==="true"}get skipWelcome(){return this.payload?.get("skipWelcome")==="true"}get disableWorkspaceTrust(){return!this.options.enableWorkspaceTrust}get lastActiveProfile(){return this.payload?.get("lastActiveProfile")}constructor(e,t,i,s){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=s,this.extensionHostDebugEnvironment=void 0,this.editSessionId=this.options.editSessionId,i.workspaceProvider&&Array.isArray(i.workspaceProvider.payload))try{this.payload=new Map(i.workspaceProvider.payload)}catch(o){bt(o)}}resolveExtensionHostDebugEnvironment(){const e={params:{port:null,break:!1},debugRenderer:!1,isExtensionDevelopment:!1,extensionDevelopmentLocationURI:void 0,extensionDevelopmentKind:void 0};if(this.payload)for(const[i,s]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(P.parse(s)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[s];break;case"extensionTestsPath":e.extensionTestsLocationURI=P.parse(s);break;case"debugRenderer":e.debugRenderer=s==="true";break;case"debugId":e.params.debugId=s;break;case"inspect-brk-extensions":e.params.port=parseInt(s),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(s);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>P.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=P.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=P.parse(e);if(this.payload.has("gotoLineMode")){const i=qQe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:ll(i.line)?void 0:{startLineNumber:i.line,startColumn:i.column||1}}}]}return[{fileUri:t}]}}}get filesToDiff(){if(this.payload){const e=this.payload.get("diffFilePrimary"),t=this.payload.get("diffFileSecondary");if(e&&t)return[{fileUri:P.parse(t)},{fileUri:P.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),s=this.payload.get("mergeFileResult");if(e&&t&&i&&s)return[{fileUri:P.parse(e)},{fileUri:P.parse(t)},{fileUri:P.parse(i)},{fileUri:P.parse(s)}]}}}Yt.__decorator=D([ii],Yt.prototype,"remoteAuthority",null);Yt.__decorator=D([ii],Yt.prototype,"expectsResolverExtension",null);Yt.__decorator=D([ii],Yt.prototype,"isBuilt",null);Yt.__decorator=D([ii],Yt.prototype,"logLevel",null);Yt.__decorator=D([ii],Yt.prototype,"windowLogsPath",null);Yt.__decorator=D([ii],Yt.prototype,"logFile",null);Yt.__decorator=D([ii],Yt.prototype,"userRoamingDataHome",null);Yt.__decorator=D([ii],Yt.prototype,"argvResource",null);Yt.__decorator=D([ii],Yt.prototype,"cacheHome",null);Yt.__decorator=D([ii],Yt.prototype,"workspaceStorageHome",null);Yt.__decorator=D([ii],Yt.prototype,"localHistoryHome",null);Yt.__decorator=D([ii],Yt.prototype,"stateResource",null);Yt.__decorator=D([ii],Yt.prototype,"userDataSyncHome",null);Yt.__decorator=D([ii],Yt.prototype,"sync",null);Yt.__decorator=D([ii],Yt.prototype,"keyboardLayoutResource",null);Yt.__decorator=D([ii],Yt.prototype,"untitledWorkspacesHome",null);Yt.__decorator=D([ii],Yt.prototype,"serviceMachineIdResource",null);Yt.__decorator=D([ii],Yt.prototype,"extHostLogsPath",null);Yt.__decorator=D([ii],Yt.prototype,"extHostTelemetryLogFile",null);Yt.__decorator=D([ii],Yt.prototype,"debugExtensionHost",null);Yt.__decorator=D([ii],Yt.prototype,"isExtensionDevelopment",null);Yt.__decorator=D([ii],Yt.prototype,"extensionDevelopmentLocationURI",null);Yt.__decorator=D([ii],Yt.prototype,"extensionDevelopmentLocationKind",null);Yt.__decorator=D([ii],Yt.prototype,"extensionTestsLocationURI",null);Yt.__decorator=D([ii],Yt.prototype,"extensionEnabledProposedApi",null);Yt.__decorator=D([ii],Yt.prototype,"debugRenderer",null);Yt.__decorator=D([ii],Yt.prototype,"enableSmokeTestDriver",null);Yt.__decorator=D([ii],Yt.prototype,"disableExtensions",null);Yt.__decorator=D([ii],Yt.prototype,"enableExtensions",null);Yt.__decorator=D([ii],Yt.prototype,"webviewExternalEndpoint",null);Yt.__decorator=D([ii],Yt.prototype,"extensionTelemetryLogResource",null);Yt.__decorator=D([ii],Yt.prototype,"disableTelemetry",null);Yt.__decorator=D([ii],Yt.prototype,"verbose",null);Yt.__decorator=D([ii],Yt.prototype,"logExtensionHostCommunication",null);Yt.__decorator=D([ii],Yt.prototype,"skipReleaseNotes",null);Yt.__decorator=D([ii],Yt.prototype,"skipWelcome",null);Yt.__decorator=D([ii],Yt.prototype,"disableWorkspaceTrust",null);Yt.__decorator=D([ii],Yt.prototype,"lastActiveProfile",null);Yt.__decorator=D([ii],Yt.prototype,"filesToOpenOrCreate",null);Yt.__decorator=D([ii],Yt.prototype,"filesToDiff",null);Yt.__decorator=D([ii],Yt.prototype,"filesToMerge",null);let I0e=class extends Yt{constructor(e=HFe().id,t=L4t(),i){super(e,Pnt,t,i)}};I0e=D([_(2,Ja)],I0e);function aJt(n){return{[Il.toString()]:new $i(I0e,[void 0,n],!0)}}class Mrt extends ${constructor(e=I4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=T.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidRemoveContainer=this._register(new I),this.onDidRemoveContainer=this._onDidRemoveContainer.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0},this.onDidChangeFullscreen=T.None,this.onDidChangeZenMode=T.None,this.onDidChangeWindowMaximized=T.None,this.onDidChangeCenteredLayout=T.None,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangeSideBarPosition=this._register(new I),this.onDidChangeSideBarPosition=this._onDidChangeSideBarPosition.event,this.onDidChangePanelAlignment=T.None,this.onDidChangeNotificationsVisibility=T.None,this.openedDefaultEditors=!1,this.whenRestored=Promise.resolve(),this.parts=new Map,this.hiddenParts=new Set,this._onDidChangePartVisibility=new I,this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this.offset={top:0,quickPickTop:0},this._onDidLayout=new I,this.onDidLayout=this._onDidLayout.event,window.addEventListener("resize",()=>this.layout()),this.layout();const t=Is?"windows":jr?"linux":"mac",i=Ui(["monaco-workbench",t,"web",VRe?"chromium":rQe?"firefox":aQe?"safari":void 0]);e.classList.add(...i),document.body.classList.add(t),document.body.classList.add("web")}whenContainerStylesLoaded(){}hasMainWindowBorder(){return!1}getMainWindowBorderRadius(){}isMainEditorLayoutCentered(){return!1}centerMainEditorLayout(){}get activeContainer(){return this.getContainerFromDocument(Kg())}get containers(){const e=[];for(const{window:t}of N9())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}init(e){this.editorGroupService=e.get(ur),this.paneCompositeService=e.get(Nw),this.statusBarService=e.get(EPe),this.viewDescriptorService=e.get(z_),this.configurationService=e.get(Re),this.auxiliaryWindowService=e.get(met),this.hostService=e.get(Id),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("workbench.activityBar.location")&&this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),t.affectsConfiguration("workbench.statusBar.visible")&&this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),t.affectsConfiguration("workbench.sideBar.location")&&this.setSideBarPosition(ZK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"))})),this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),this.sideBarPosition=ZK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:t,disposables:i})=>{this._onDidAddContainer.fire({container:t.container,disposables:new Z}),i.add(t.onDidLayout(s=>this.handleContainerDidLayout(t.container,s))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),jut(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return gt(e).vscodeWindowId}onActiveWindowChanged(){const e=this.getActiveContainerId();this.activeContainerId!==e&&(this.activeContainerId=e,this._onDidChangeActiveContainer.fire())}isActivityBarHidden(){const e=this.configurationService.getValue("workbench.activityBar.visible");return e!==void 0?!e:this.configurationService.getValue("workbench.activityBar.location")!=="default"}focusPart(e){switch(e){case"workbench.parts.editor":this.editorGroupService.activeGroup.focus();break;case"workbench.parts.panel":{this.paneCompositeService.getActivePaneComposite(1)?.focus();break}case"workbench.parts.sidebar":{this.paneCompositeService.getActivePaneComposite(0)?.focus();break}case"workbench.parts.activitybar":this.getPart("workbench.parts.activitybar").focus();break;case"workbench.parts.statusbar":this.statusBarService.focus();break;default:this.getContainer(e)?.focus()}}getDimension(e){return this.getPart(e)?.dimension}toggleMaximizedPanel(){}toggleMenuBar(){let e=x4t(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=knt(this.configurationService)==="native"?"toggle":"compact":t="classic",this.configurationService.updateValue("window.menuBarVisibility",t)}setPanelPosition(e){this.panelPosition=e,this.getPart("workbench.parts.panel")?.updateStyles(),this._onDidChangePanelPosition.fire(l8(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new Tn(1/0,1/0)}isPanelMaximized(){return!1}getPanelPosition(){return this.panelPosition}hasFocus(e){const t=document.activeElement;if(t==null)return!1;const i=this.getContainer(e);return i!=null&&qut(t,i)}getContainer(e){return typeof e=="string"?this.parts.get(e)==null?void 0:this.getPart(e)?.getContainer():e.document===this.mainContainer.ownerDocument?this.mainContainer:e.document.body.getElementsByClassName("monaco-workbench")[0]}getPart(e){return this.parts.get(e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(t==null)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i==null?!1:i.activeViewDescriptors.length>=1}setPartHidden(e,t){e?this.hiddenParts.add(t):this.hiddenParts.delete(t),this._onDidChangePartVisibility.fire();const i={"workbench.parts.sidebar":0,"workbench.parts.auxiliarybar":2,"workbench.parts.panel":1}[t];if(i!=null){const s=this.paneCompositeService.getActivePaneComposite(i);if(s!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(s==null&&!e){let o=this.paneCompositeService.getLastActivePaneCompositeId(i);(o==null||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(i).find(r=>this.hasViews(r.id))?.id),o!=null&&this.paneCompositeService.openPaneComposite(o,i,!0)}}this.getPart(t)?.setVisible(!e)}isVisible(e){return!this.hiddenParts.has(e)}getSideBarPosition(){return this.sideBarPosition}setSideBarPosition(e){this.sideBarPosition=e;const t=this.getPart("workbench.parts.activitybar"),i=this.getPart("workbench.parts.sidebar"),s=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),s?.updateStyles(),this._onDidChangeSideBarPosition.fire(l8(e))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ee(()=>this.parts.delete(t))}isRestored(){return!0}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){const e=this.activeContainer;return e===this.mainContainer?this.mainContainerDimension:uw(e)}layout(){this._mainContainerDimension=uw(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Lt.get(Qt).getFocusedCodeEditor();t instanceof k1?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}N4t(n=>{const e=n.get(bg);e instanceof Mrt&&e.init(n)});function cJt(n){return{[bg.toString()]:new $i(Mrt,[n],!0)}}const l7e="vs/workbench/services/host/browser/browserHostService";var av;(function(n){n[n.Unknown=1]="Unknown",n[n.Keyboard=2]="Keyboard",n[n.Api=3]="Api"})(av||(av={}));let jx=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=s,this.environmentService=o,this.instantiationService=r,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=av.Unknown,o.options?.workspaceProvider?this.workspaceProvider=o.options.workspaceProvider:this.workspaceProvider=new class{constructor(){this.workspace=void 0,this.trusted=void 0}async open(){return!0}},this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>this.onBeforeShutdown(e))),this._register(Nb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case av.Unknown:case av.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===av.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=av.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==av.Api&&(Nb.getInstance().isModifierPressed?this.shutdownReason=av.Keyboard:this.shutdownReason=av.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=i.add(Dd(t)),o=i.add(new oi(t.document,"visibilitychange"));T.any(T.map(s.onDidFocus,()=>this.hasFocus,i),T.map(s.onDidBlur,()=>this.hasFocus,i),T.map(o.event,()=>this.hasFocus,i),T.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get hasFocus(){return Kg().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=i.add(Dd(t));i.add(o.onDidFocus(()=>e.fire(s))),Eht(t)&&i.add(Put(t,()=>{const r=t.document.hasFocus();return r&&e.fire(s),r},100,20))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=I_&&t.visualViewport?t.visualViewport:t,r=()=>{const a=lgt(t);return a!==null&&!a.guess};for(const a of[xe.FULLSCREEN_CHANGE,xe.WK_FULLSCREEN_CHANGE])i.add(pe(t.document,a,()=>e.fire({windowId:s,fullscreen:r()})));i.add(Wut(o,xe.RESIZE,()=>e.fire({windowId:s,fullscreen:r()}),void 0,ei?2e3:800))},{window:yi,disposables:this._store})),e.event}openWindow(e,t){return Array.isArray(e)?this.doOpenWindow(e,t):this.doOpenEmptyWindow(e)}async doOpenWindow(e,t){const i=this.preservePayload(!1),s=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),GJ(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):tEe(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):E4t(r)&&s.push(r);o.length>0&&this.withServices(r=>{r.get($S).addFolders(o)}),s.length>0&&this.withServices(async r=>{const a=r.get(_i);if(t?.mergeMode&&s.length===4){const l=Ui(await Zfe(s,this.fileService,this.logService));if(l.length!==4||!wb(l[0])||!wb(l[1])||!wb(l[2])||!wb(l[3]))return;if(this.shouldReuse(t,!0))a.openEditor({input1:{resource:l[0].resource},input2:{resource:l[1].resource},base:{resource:l[2].resource},result:{resource:l[3].resource},options:{pinned:!0}});else{const d=new Map;d.set("mergeFile1",l[0].resource.toString()),d.set("mergeFile2",l[1].resource.toString()),d.set("mergeFileBase",l[2].resource.toString()),d.set("mergeFileResult",l[3].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else if(t?.diffMode&&s.length===2){const l=Ui(await Zfe(s,this.fileService,this.logService));if(l.length!==2||!wb(l[0])||!wb(l[1]))return;if(this.shouldReuse(t,!0))a.openEditor({original:{resource:l[0].resource},modified:{resource:l[1].resource},options:{pinned:!0}});else{const d=new Map;d.set("diffFileSecondary",l[0].resource.toString()),d.set("diffFilePrimary",l[1].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else for(const l of s)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=qQe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:ll(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Ui(await Zfe(d,this.fileService,this.logService)),void 0,{validateTrust:!0})}else{const d=new Map;d.set("openFile",l.fileUri.toString()),t?.gotoLineMode&&d.set("gotoLineMode","true"),this.doOpen(void 0,{payload:Array.from(d.entries())})}const c=t?.waitMarkerFileURI;c&&(async()=>(await this.instantiationService.invokeFunction(l=>t3t(l,s.map(d=>d.fileUri))),await this.fileService.del(c)))()})}withServices(e){this.instantiationService.invokeFunction(t=>e(t))}preservePayload(e){const t=new Array;!e&&this.environmentService.extensionDevelopmentLocationURI&&(t.push(["extensionDevelopmentPath",this.environmentService.extensionDevelopmentLocationURI.toString()]),this.environmentService.debugExtensionHost.debugId&&t.push(["debugId",this.environmentService.debugExtensionHost.debugId]),this.environmentService.debugExtensionHost.port&&t.push(["inspect-brk-extensions",String(this.environmentService.debugExtensionHost.port)]));const i=this.configurationService.getValue("window"),s=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return s.isDefault||t.push(["lastActiveProfile",s.id]),t.length?t:void 0}getRecentLabel(e){return GJ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:e_.LONG}):tEe(e)?this.labelService.getWorkspaceLabel(BFe(e.workspaceUri),{verbose:e_.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),s=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(s==="on"||s==="off")&&(o=s==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&GJ(e)&&e.folderUri.scheme===_e.file&&hx(this.contextService.getWorkspace())){this.withServices(async s=>{await s.get($S).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(PI.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:s}=await this.dialogService.confirm({type:nt.Warning,message:g(l7e,0,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(l7e,1,"&&Open")});s&&await this.workspaceProvider.open(e,t)}}async toggleFullScreen(e){const t=this.layoutService.getContainer(e);if(e.document.fullscreen!==void 0)if(e.document.fullscreen)try{return await e.document.exitFullscreen()}catch{this.logService.warn("toggleFullScreen(): exitFullscreen failed")}else try{return await t.requestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen failed")}if(e.document.webkitIsFullScreen!==void 0)try{e.document.webkitIsFullScreen?e.document.webkitExitFullscreen():t.webkitRequestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen/exitFullscreen failed")}}async moveTop(e){}async getCursorScreenPoint(){}async restart(){this.reload()}async reload(){await this.handleExpectedShutdown(PI.RELOAD),yi.location.reload()}async close(){await this.handleExpectedShutdown(PI.CLOSE),yi.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=av.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=av.Api,this.lifecycleService.withExpectedShutdown(e)}};jx.__decorator=D([ii],jx.prototype,"onDidChangeFocus",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeActiveWindow",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeFullScreen",null);jx=D([_(0,bg),_(1,Re),_(2,ci),_(3,eo),_(4,Ow),_(5,be),_(6,mg),_(7,Ze),_(8,To),_(9,Ti),_(10,Tm),_(11,V_)],jx);class lJt extends ${constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){pZ(yi,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),pZ(yi,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return yi.matchMedia("(prefers-color-scheme: light)").matches?!1:!!yi.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!yi.matchMedia("(forced-colors: active)").matches}}function dJt(){return{[Id.toString()]:new $i(jx,[],!0),[xet.toString()]:new $i(lJt,[],!0)}}function hJt(n,e,t){let i,s,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!ere(n,o-1);)o--;let C=a;for(;Cr&&n.substring(y,S)!==C&&v.push({offset:y,length:S-y,content:C})}let b=m();if(b!==xt.EOF){const C=u.getTokenOffset()+o,y=ome(h,i);w(y,o,C)}for(;b!==xt.EOF;){let C=u.getTokenOffset()+u.getTokenLength()+o,y=m(),S="";for(;!l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia);){const k=u.getTokenOffset()+o;w(" ",C,k),C=u.getTokenOffset()+u.getTokenLength()+o,S=y===xt.LineCommentTrivia?p():"",y=m()}if(y===xt.CloseBraceToken)b!==xt.OpenBraceToken&&(d--,S=p());else if(y===xt.CloseBracketToken)b!==xt.OpenBracketToken&&(d--,S=p());else{switch(b){case xt.OpenBracketToken:case xt.OpenBraceToken:d++,S=p();break;case xt.CommaToken:case xt.LineCommentTrivia:S=p();break;case xt.BlockCommentTrivia:l?S=p():S=" ";break;case xt.ColonToken:S=" ";break;case xt.StringLiteral:if(y===xt.ColonToken){S="";break}case xt.NullKeyword:case xt.TrueKeyword:case xt.FalseKeyword:case xt.NumericLiteral:case xt.CloseBraceToken:case xt.CloseBracketToken:y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia?S=" ":y!==xt.CommaToken&&y!==xt.EOF&&(f=!0);break;case xt.Unknown:f=!0;break}l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia)&&(S=p())}const M=u.getTokenOffset()+o;w(S,C,M),b=y}return v}function ome(n,e){let t="";for(let i=0;i(await this.remoteAuthorityResolverService.resolveAuthority(r)).authority}:void 0,c=Hf(e.remote.host,e.remote.port);this.inProgress.set(c,!0),e=this.mergeCachedAndUnrestoredProperties(c,e);const l=await this.tunnelService.openTunnel(a,e.remote.host,e.remote.port,void 0,s,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=kf(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===jm.Https?jm.Https:jm.Http:t?.protocol??jm.Http,u={remoteHost:l.tunnelRemoteHost,remotePort:l.tunnelRemotePort,localPort:l.tunnelLocalPort,name:t?.label??e.name,closeable:!0,localAddress:l.localAddress,protocol:h,localUri:await this.makeLocalUri(l.localAddress,t),runningProcess:d?.detail,hasRunningProcess:!!d,pid:d?.pid,source:e.source??nme,privacy:l.privacy};return this.forwarded.set(c,u),this.remoteTunnels.set(c,l),this.inProgress.delete(c),await this.storeForwarded(),await this.showPortMismatchModalIfNeeded(l,s,t),this._onForwardPort.fire(u),l}this.inProgress.delete(c)}return o}mergeCachedAndUnrestoredProperties(e,t){const i=this.unrestoredExtensionTunnels.has(e)?this.unrestoredExtensionTunnels:this.sessionCachedProperties.has(e)?this.sessionCachedProperties:void 0;if(i){const s=i.get(e);i.delete(e),s&&(t.name=s.name??t.name,t.local=("local"in s?s.local:"localPort"in s?s.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const s=i?.label??t.name;let o;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(o||(o={}));let r=o.None;switch(s!==e.name&&(e.name=s,r=o.Fire),(i?.protocol||e.protocol!==jm.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,r=o.Reopen),t.privacy&&e.privacy!==t.privacy&&(r=o.Reopen),r){case o.Fire:{this._onForwardPort.fire();break}case o.Reopen:await this.close(e.remoteHost,e.remotePort,qM.User),await this.doForward(t,i)}return kf(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const s=kf(this.forwarded,e,t),o=Hf(e,t);if(s){s.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(o)&&(this.detected.get(o).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const s=Hf(e,t),o=this.forwarded.get(s);return i===qM.AutoForwardEnd&&o&&o.source.source===Tb.Auto&&this.sessionCachedProperties.set(s,{local:o.localPort,name:o.name,privacy:o.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Hf(e,t);return(this.forwarded.get(i)||this.detected.get(i))?.localAddress}get environmentTunnelsSet(){return this._environmentTunnelsSet}addEnvironmentTunnels(e){if(e)for(const t of e){const i=kf(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),s=typeof t.localAddress=="string"?t.localAddress:Hf(t.localAddress.host,t.localAddress.port);this.detected.set(Hf(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:s,protocol:jm.Http,localUri:this.makeLocalUri(s),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:zE.ConstantPrivate,source:{source:Tb.Extension,description:g(qG,4,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,s,zE.ConstantPrivate,jm.Http)}this._environmentTunnelsSet=!0,this._onEnvironmentTunnelsSet.fire(),this._onForwardPort.fire()}setCandidateFilter(e){this._candidateFilter=e}async setCandidates(e){let t=e;this._candidateFilter&&(t=await this._candidateFilter(e));const i=this.updateInResponseToCandidates(t);this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${Array.from(i.values()).map(s=>s.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(s=>{const o=Hf(s.host,s.port);i.set(o,{host:s.host,port:s.port,detail:s.detail,pid:s.pid}),t.has(o)&&t.delete(o);const r=kf(this.forwarded,s.host,s.port);r&&(r.runningProcess=s.detail,r.hasRunningProcess=!0,r.pid=s.pid)}),t.forEach((s,o)=>{const r=UYt(o);if(!r)return;const a=kf(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=kf(this.detected,r.host,r.port);c&&(c.runningProcess=void 0,c.hasRunningProcess=!1,c.pid=void 0)}),t}get candidates(){return this._candidates?Array.from(this._candidates.values()):[]}get candidatesOrUndefined(){return this._candidates?this.candidates:void 0}async updateAttributes(){const e=Array.from(this.forwarded.values()),t=await this.getAttributes(e.map(i=>({port:i.remotePort,host:i.remoteHost})),!1);if(t)for(const i of e){const s=t.get(i.remotePort);(s?.protocol||i.protocol!==jm.Http)&&s?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},s),s&&s.label&&s.label!==i.name&&await this.name(i.remoteHost,i.remotePort,s.label)}}async getAttributes(e,t=!0){const i=new Map,s=new Map;e.forEach(l=>{const d=kf(this._candidates??new Map,zG[0],l.port)??l;if(d){i.set(l.port,d);const h=VYt(d)?d.pid:void 0;s.has(h)||s.set(h,[]),s.get(h)?.push(l.port)}});const o=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&o.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return o.size>0?o:void 0;const r=await Promise.all(this.portAttributesProviders.flatMap(l=>Array.from(s.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,qe.None)}))),a=new Map;if(r.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!o&&!a)return;const c=new Map;return e.forEach(l=>{const d=o.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??Xoe.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};QG.__decorator=D([kNe(1e3)],QG.prototype,"storeForwarded",null);QG=D([_(0,Qde),_(1,on),_(2,Re),_(3,Za),_(4,rA),_(5,Ti),_(6,Ze),_(7,To),_(8,ho),_(9,Pe)],QG);const QD="vs/workbench/services/remote/common/remoteExplorerService",V9e="remote.explorerType",z9e="remote.autoForwardPorts",$9e="remote.autoForwardPortsSource",G9e="output",zYt="hybrid";var q9e;(function(n){n.Candidate="Candidate",n.Detected="Detected",n.Forwarded="Forwarded",n.Add="Add"})(q9e||(q9e={}));var Q9e;(function(n){n[n.None=0]="None",n[n.New=1]="New",n[n.Label=2]="Label",n[n.LocalPort=3]="LocalPort"})(Q9e||(Q9e={}));const $Yt={type:"object",required:["id"],properties:{id:{description:g(QD,0,"The ID of a Get Started walkthrough to open."),type:"string"}}},GYt=Ap.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(QD,1,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(QD,2,"The url, or a command that returns the url, to your project's Getting Started page, or a walkthrough ID contributed by your project's extension"),oneOf:[{type:"string"},$Yt]},documentation:{description:g(QD,3,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(QD,4,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(QD,5,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(QD,6,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(QD,7,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let j9e=class{constructor(e,t,i){this.storageService=e,this.tunnelService=t,this._targetType=[],this._onDidChangeTargetType=new I,this.onDidChangeTargetType=this._onDidChangeTargetType.event,this._onDidChangeHelpInformation=new I,this.onDidChangeHelpInformation=this._onDidChangeHelpInformation.event,this._helpInformation=[],this._onDidChangeEditable=new I,this.onDidChangeEditable=this._onDidChangeEditable.event,this._onEnabledPortsFeatures=new I,this.onEnabledPortsFeatures=this._onEnabledPortsFeatures.event,this._portsFeaturesEnabled=!1,this.namedProcesses=new Map,this._tunnelModel=i.createInstance(QG),GYt.setHandler(s=>{this._helpInformation.push(...s),this._onDidChangeHelpInformation.fire(s)})}get helpInformation(){return this._helpInformation}set targetType(e){const t=this._targetType.length>0?this._targetType[0]:"",i=e.length>0?e[0]:"";t!==i&&(this._targetType=e,this.storageService.store(V9e,this._targetType.toString(),ke.WORKSPACE,ln.MACHINE),this.storageService.store(V9e,this._targetType.toString(),ke.PROFILE,ln.USER),this._onDidChangeTargetType.fire(this._targetType))}get targetType(){return this._targetType}get tunnelModel(){return this._tunnelModel}forward(e,t){return this.tunnelModel.forward(e,t)}close(e,t){return this.tunnelModel.close(e.host,e.port,t)}setTunnelInformation(e){e?.features&&this.tunnelService.setTunnelFeatures(e.features),this.tunnelModel.addEnvironmentTunnels(e?.environmentTunnels)}setEditable(e,t,i){i?this._editable={tunnelItem:e,data:i,editId:t}:this._editable=void 0,this._onDidChangeEditable.fire(e?{tunnel:e,editId:t}:void 0)}getEditableData(e,t){return this._editable&&(!e&&e===this._editable.tunnelItem||e&&this._editable.tunnelItem?.remotePort===e.remotePort&&this._editable.tunnelItem.remoteHost===e.remoteHost&&this._editable.editId===t)?this._editable.data:void 0}setCandidateFilter(e){return e?(this.tunnelModel.setCandidateFilter(e),{dispose:()=>{this.tunnelModel.setCandidateFilter(void 0)}}):{dispose:()=>{}}}onFoundNewCandidates(e){this.tunnelModel.setCandidates(e)}restore(){return this.tunnelModel.restoreForwarded()}enablePortsFeatures(){this._portsFeaturesEnabled=!0,this._onEnabledPortsFeatures.fire()}get portsFeaturesEnabled(){return this._portsFeaturesEnabled}};j9e=D([_(0,on),_(1,Qde),_(2,be)],j9e);const K9e="vs/workbench/api/browser/mainThreadTunnelService";let Y9e=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=s,this.configurationService=o,this.logService=r,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(et.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(z9e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue($9e)!==G9e}async $setRemoteTunnelService(e){this.remoteExplorerService.namedProcesses.set(e,"Code Extension Host"),this.remoteExplorerService.portsFeaturesEnabled?this._proxy.$registerCandidateFinder(this.processFindingEnabled()):this._register(this.remoteExplorerService.onEnabledPortsFeatures(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled()))),this._register(this.configurationService.onDidChangeConfiguration(async t=>{if(t.affectsConfiguration(z9e)||t.affectsConfiguration($9e))return this._proxy.$registerCandidateFinder(this.processFindingEnabled())})),this._register(this.tunnelService.onAddedTunnelProvider(()=>this._proxy.$registerCandidateFinder(this.processFindingEnabled())))}async $registerPortsAttributesProvider(e,t){this.portsAttributesProviders.set(t,e),this._alreadyRegistered||(this.remoteExplorerService.tunnelModel.addAttributesProvider(this),this._alreadyRegistered=!0)}async $unregisterPortsAttributesProvider(e){this.portsAttributesProviders.delete(e)}async providePortAttributes(e,t,i,s){if(this.portsAttributesProviders.size===0)return[];const o=Array.from(this.portsAttributesProviders.entries()).filter(r=>{const a=r[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&hr[0]);return o.length===0?[]:this._proxy.$providePortAttributes(o,e,t,i,s)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:t},elevateIfNeeded:!1});if(!(!i||typeof i=="string"))return!this.elevateionRetry&&e.localAddressPort!==void 0&&i.tunnelLocalPort!==void 0&&this.tunnelService.isPortPrivileged(e.localAddressPort)&&i.tunnelLocalPort!==e.localAddressPort&&this.tunnelService.canElevate&&this.elevationPrompt(e,i,t),Joe.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(nt.Info,g(K9e,0,"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",i,e.remoteAddress.port,e.localAddressPort),[{label:g(K9e,1,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},qM.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:Tb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,qM.Other)}async $getTunnels(){return(await this.tunnelService.tunnels).map(e=>({remoteAddress:{port:e.tunnelRemotePort,host:e.tunnelRemoteHost},localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol}))}async $onFoundNewCandidates(e){this.remoteExplorerService.onFoundNewCandidates(e)}async $setTunnelProvider(e){const t={forwardPort:(i,s)=>this._proxy.$forwardPort(i,s).then(r=>{if(r){if(typeof r=="string")return r}else return;const a=r;return this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) New tunnel established by tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),{tunnelRemotePort:a.remoteAddress.port,tunnelRemoteHost:a.remoteAddress.host,localAddress:typeof a.localAddress=="string"?a.localAddress:Hf(a.localAddress.host,a.localAddress.port),tunnelLocalPort:typeof a.localAddress!="string"?a.localAddress.port:void 0,public:a.public,privacy:a.privacy,protocol:a.protocol??jm.Http,dispose:async c=>(this.logService.trace(`ForwardedPorts: (MainThreadTunnelService) Closing tunnel from tunnel provider: ${a?.remoteAddress.host}:${a?.remoteAddress.port}`),this._proxy.$closeTunnel({host:a.remoteAddress.host,port:a.remoteAddress.port},c))}})};e&&this.tunnelService.setTunnelFeatures(e),this.tunnelService.setTunnelProvider(t),this.contextKeyService.createKey(Ert.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case UM.None:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case UM.Output:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":G9e}}]);break}case UM.Hybrid:{it.as(Cs.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":zYt}}]);break}}}).catch(()=>{})}};Y9e=D([en(Ue.MainThreadTunnelService),_(1,she),_(2,Qde),_(3,Pi),_(4,Re),_(5,Ze),_(6,Sf),_(7,Pe)],Y9e);const sme="vs/workbench/services/authentication/browser/authenticationService";function xrt(n){return`onAuthenticationRequest:${n}`}let J9e=class extends ${constructor(e,t,i){super(),this._extensionService=e,this._environmentService=i,this._onDidRegisterAuthenticationProvider=this._register(new I),this.onDidRegisterAuthenticationProvider=this._onDidRegisterAuthenticationProvider.event,this._onDidUnregisterAuthenticationProvider=this._register(new I),this.onDidUnregisterAuthenticationProvider=this._onDidUnregisterAuthenticationProvider.event,this._onDidChangeSessions=this._register(new I),this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeDeclaredProviders=this._register(new I),this.onDidChangeDeclaredProviders=this._onDidChangeDeclaredProviders.event,this._authenticationProviders=new Map,this._authenticationProviderDisposables=this._register(new Zo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(s=>{this._onDidChangeSessions.fire({providerId:s.providerId,label:s.accountName,event:{added:[],changed:[],removed:[]}})})),this._registerEnvContributedAuthenticationProviders()}get declaredProviders(){return this._declaredProviders}_registerEnvContributedAuthenticationProviders(){if(this._environmentService.options?.authenticationProviders?.length)for(const e of this._environmentService.options.authenticationProviders)this.registerAuthenticationProvider(e.id,e)}registerDeclaredAuthenticationProvider(e){if(Xv(e.id))throw new Error(g(sme,0,"An authentication contribution must specify an id."));if(Xv(e.label))throw new Error(g(sme,1,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(sme,2,"This authentication id '{0}' has already been registered",e.id));this._declaredProviders.push(e),this._onDidChangeDeclaredProviders.fire()}unregisterDeclaredAuthenticationProvider(e){const t=this.declaredProviders.findIndex(i=>i.id===e);t>-1&&this.declaredProviders.splice(t,1),this._onDidChangeDeclaredProviders.fire()}isAuthenticationProviderRegistered(e){return this._authenticationProviders.has(e)}registerAuthenticationProvider(e,t){this._authenticationProviders.set(e,t);const i=new Z;i.add(t.onDidChangeSessions(s=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:s}))),cz(t)&&i.add(t),this._authenticationProviderDisposables.set(e,i),this._onDidRegisterAuthenticationProvider.fire({id:e,label:t.label})}unregisterAuthenticationProvider(e){const t=this._authenticationProviders.get(e);t&&(this._authenticationProviders.delete(e),this._onDidUnregisterAuthenticationProvider.fire({id:e,label:t.label})),this._authenticationProviderDisposables.deleteAndDispose(e)}getProviderIds(){const e=[];return this._authenticationProviders.forEach(t=>{e.push(t.id)}),e}getProvider(e){if(this._authenticationProviders.has(e))return this._authenticationProviders.get(e);throw new Error(`No authentication provider '${e}' is currently registered.`)}async getSessions(e,t,i=!1){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,i);if(s)return await s.getSessions(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const s=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(s)return await s.createSession(t,{sessionToRecreate:i?.sessionToRecreate});throw new Error(`No authentication provider '${e}' is currently registered.`)}async removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return i.removeSession(t);throw new Error(`No authentication provider '${e}' is currently registered.`)}async tryActivateProvider(e,t){await this._extensionService.activateByEvent(xrt(e),t?sC.Immediate:sC.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const s=new Z,o=new Promise((a,c)=>{s.add(T.once(this.onDidRegisterAuthenticationProvider)(l=>{if(l.id===e)if(i=this._authenticationProviders.get(e),i)a(i);else throw new Error(`No authentication provider '${e}' is currently registered.`)}))}),r=new Promise((a,c)=>{const l=setTimeout(()=>{c("Timed out waiting for authentication provider to register")},5e3);s.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>s.dispose())}};J9e=D([_(0,ho),_(1,ehe),_(2,Ow)],J9e);const OB="vs/workbench/api/browser/mainThreadAuthentication";class qYt extends ${constructor(e,t,i,s,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=s,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e){return this._proxy.$getSessions(this.id,e)}createSession(e,t){return this._proxy.$createSession(this.id,e,t)}async removeSession(e){await this._proxy.$removeSession(this.id,e),this.notificationService.info(g(OB,0,"Successfully signed out."))}}let X9e=class extends ${constructor(e,t,i,s,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=s,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const s=new I;this._registrations.set(e,s);const o=new qYt(this._proxy,e,t,i,this.notificationService,s);this.authenticationService.registerAuthenticationProvider(e,o)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(xrt(e),sC.Immediate)}$sendDidChangeSessions(e,t){const i=this._registrations.get(e);i instanceof I&&i.fire(t)}$removeSession(e,t){return this.authenticationService.removeSession(e,t)}async loginPrompt(e,t,i,s){let o;e.id.startsWith(tue)?o=g(OB,1,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(OB,2,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(OB,3,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(OB,4,"&&Allow"),run(){return!0}}];s?.learnMore&&r.push({label:g(OB,5,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,s);return await this.openerService.open(P.revive(s.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:nt.Info,message:o,buttons:r,detail:s?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,s,o){const r=await this.authenticationService.getSessions(e,t,!0),a=this.authenticationService.getProvider(e);if(o.forceNewSession&&o.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(o.forceNewSession&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(o.createIfNone&&o.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts)if(o.clearSessionPreference)this.authenticationExtensionsService.removeSessionPreference(e,i,t);else{const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=r.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,r[0].account.label,i))return r[0]}if(o.createIfNone||o.forceNewSession){let l;typeof o.forceNewSession=="object"&&(l=o.forceNewSession);const d=!!(o.forceNewSession&&r.length);if(!await this.loginPrompt(a,s,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts?await this.authenticationExtensionsService.selectSession(e,i,s,t,r):r[0];else{let f;if(typeof o.forceNewSession=="object"&&o.forceNewSession.sessionToRecreate)f=o.forceNewSession.sessionToRecreate;else{const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p):void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,sessionToRecreate:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:s,allowed:!0}]),this.authenticationExtensionsService.updateSessionPreference(e,i,u),u}const c=r.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;o.silent||(r.length?this.authenticationExtensionsService.requestSessionAccess(e,i,s,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,s))}async $getSession(e,t,i,s,o){const r=await this.doGetSession(e,t,i,s,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,s)),r}async $getSessions(e,t,i,s){const r=(await this.authenticationService.getSessions(e,[...t],!0)).filter(a=>this.authenticationAccessService.isAccessAllowed(e,a.account.label,i));if(r.length){this.sendProviderUsageTelemetry(i,e);for(const a of r)this.authenticationUsageService.addAccountUsage(e,a.account.label,i,s)}return r}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};X9e=D([en(Ue.MainThreadAuthentication),_(1,PPe),_(2,pet),_(3,ehe),_(4,fet),_(5,To),_(6,Pi),_(7,ho),_(8,rn),_(9,fr)],X9e);let Z9e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(et.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let s=i.get(e.id);s===void 0&&(s=new I,i.set(e.id,s)),this._timelineService.registerTimelineProvider({...e,onDidChange:s.event,async provideTimeline(o,r,a){return Or(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),s?.dispose()}})}$unregisterTimelineProvider(e){this.logService.trace(`MainThreadTimeline#unregisterTimelineProvider: id=${e}`),this._timelineService.unregisterTimelineProvider(e)}$emitTimelineChangeEvent(e){this.logService.trace(`MainThreadTimeline#emitChangeEvent: id=${e.id}, uri=${e.uri?.toString(!0)}`),this._providerEmitters.get(e.id)?.fire(e)}dispose(){}};Z9e=D([en(Ue.MainThreadTimeline),_(1,Ze),_(2,det)],Z9e);class Zoe extends ${get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this.changeEmitter.fire(e))}static stored(e,t){const i=new Zoe(e.get(t));return i._register(e),i._register(i.onDidChange(s=>e.store(s))),i}constructor(e){super(),this._value=e,this.changeEmitter=this._register(new I),this.onDidChange=this.changeEmitter.event}}let y0e=0;class QYt{constructor(e,t,i,s){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=s,this.fileCoverage=new wi,this.didAddCoverage=oL(this),this.tree=new qse,this.associatedData=new Map,this.perTestCoverageIDs=new Set}append(e,t){const i=this.getComputedForUri(e.uri),s=this.result,o=(l,d)=>{d[l]?(d[l].covered+=(e[l]?.covered||0)-(i?.[l]?.covered||0),d[l].total+=(e[l]?.total||0)-(i?.[l]?.total||0)):e[l]&&(d[l]={...e[l]})},r=[...this.treePathForUri(e.uri,!0)],a=[],c=!!e.testId;e.testId&&this.perTestCoverageIDs.add(e.testId.toString()),this.tree.mutatePath(this.treePathForUri(e.uri,!1),l=>{if(a.push(l),a.length===r.length)if(c){const d=l.value??=new U5(Yse.empty(String(y0e++),e.uri),s,this.accessor);Agt(d instanceof U5,"coverage is unexpectedly computed"),d.perTestData??=new Map;const h=new U5(e,s,this.accessor);h.isForTest={id:e.testId,parent:d},d.perTestData.set(e.testId.toString(),h),this.fileCoverage.set(e.uri,d)}else if(l.value){const d=l.value;d.id=e.id,d.statement=e.statement,d.branch=e.branch,d.declaration=e.declaration}else{const d=l.value=new U5(e,s,this.accessor);this.fileCoverage.set(e.uri,d)}else if(!c)if(l.value)o("statement",l.value),o("branch",l.value),o("declaration",l.value),l.value.didChange.trigger(t);else{const d=Vs(e);d.id=String(y0e++),d.uri=this.treePathToUri(r.slice(0,a.length)),l.value=new krt(d,s)}}),a&&!c&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new qse;for(const i of this.tree.values())if(i instanceof U5){const s=i.perTestData?.get(e.toString());if(!s)continue;const o=[...this.treePathForUri(s.uri,!0)],r=[];t.mutatePath(this.treePathForUri(s.uri,!1),a=>{r.push(a),r.length===o.length?a.value=s:a.value??=new KYt(this.treePathToUri(o.slice(0,r.length)),s.fromResult)})}return t}getAllFiles(){return this.fileCoverage}getUri(e){return this.fileCoverage.get(e)}getComputedForUri(e){return this.tree.find(this.treePathForUri(e,!1))}*treePathForUri(e,t){yield e.scheme,yield e.authority,yield*(!t&&this.uriIdentityService.extUri.ignorePathCasing(e)?e.path.toLowerCase():e.path).split("/")}treePathToUri(e){return P.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const jYt=(n,e,t)=>{let i=n.covered,s=n.total;return e&&(i+=e.covered,s+=e.total),t&&(i+=t.covered,s+=t.total),s===0?1:i/s};class Drt{get tpc(){return jYt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=oL(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class krt extends Drt{}class KYt extends krt{constructor(e,t){super({id:String(y0e++),uri:e,statement:{covered:0,total:0}},t)}}class U5 extends Drt{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async details(e=qe.None){this._details??=this.accessor.getCoverageDetails(this.id,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const Kv={[Xn.Running]:6,[Xn.Errored]:5,[Xn.Failed]:4,[Xn.Queued]:3,[Xn.Passed]:2,[Xn.Unset]:0,[Xn.Skipped]:1};Gct(Kv,(n,e)=>({statusNode:!0,state:Number(e),priority:n}));const YYt=(n,e)=>Kv[e]-Kv[n],Irt=(...n)=>{switch(n.length){case 0:return Xn.Unset;case 1:return n[0];case 2:return Kv[n[0]]>Kv[n[1]]?n[0]:n[1];default:{let e=n[0];for(let t=1;tNumber(n)).sort(YYt),e7e={[Xn.Passed]:0,[Xn.Skipped]:1,[Xn.Failed]:2,[Xn.Errored]:3},Lrt=()=>new Uint32Array(JYt.length),XYt=n=>"getOwnDuration"in n,S0e=(n,e,t=!1)=>{let i=n.getCurrentComputedState(e);if(i===void 0||t){i=n.getOwnState(e)??Xn.Unset;let s=0;const o=Lrt();for(const r of n.getChildren(e)){const a=S0e(n,r);s++,o[a]++,i=a===Xn.Skipped&&i===Xn.Unset?Xn.Skipped:Irt(i,a)}s>ZYt&&Rrt.set(e,o),n.setComputedState(e,i)}return i},Trt=(n,e,t=!1)=>{let i=n.getCurrentComputedDuration(e);if(i===void 0||t){const s=n.getOwnDuration(e);if(s!==void 0)i=s;else{i=void 0;for(const o of n.getChildren(e)){const r=Trt(n,o);r!==void 0&&(i=(i||0)+r)}}n.setComputedDuration(e,i)}return i},ZYt=64,Rrt=new WeakMap,eJt=(n,e,t,i=!0)=>{const s=n.getCurrentComputedState(e),o=Kv[s],r=S0e(n,e,!0),a=Kv[r],c=new Set;if(a!==o){n.setComputedState(e,r),c.add(e);let l=s,d=r;for(const h of n.getParents(e)){const u=Rrt.get(h);u&&(u[l]--,u[d]++);const f=n.getCurrentComputedState(h);if(a>o){if(f!==void 0&&Kv[f]>=a||u&&u[d]>1)break;n.setComputedState(h,r),c.add(h)}else{if(f===void 0||Kv[f]>o||u&&u[l]>0)break;d=S0e(n,h,!0),n.setComputedState(h,d),c.add(h)}l=f}}if(XYt(n)&&i)for(const l of fi.concat(fi.single(e),n.getParents(e))){const d=n.getCurrentComputedDuration(l),h=Trt(n,l,!0);if(d===h)break;n.setComputedDuration(l,h),c.add(l)}return c},tJt="vs/workbench/contrib/testing/common/testResult";T.None,Promise.resolve();class iJt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new sd,this.offset=0,this.onDidWriteData=this.writeDataEmitter.event,this.endPromise=this.endDeferred.p,this.buffers=[]}get length(){return this.offset}getRange(e,t){const i=ze.alloc(t);let s=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,s),s+=o.byteLength;return s0;c--){const l=e.buffer[c-1];if(l!==o.CR&&l!==o.LF)break}return this.push(e.slice(0,c)),this.push(a),this.push(e.slice(c)),{offset:i,length:s}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const t7e=(n,e)=>`\x1B]633;SetMark;Id=${eKt(n,e)};Hidden\x07`,nJt=(n,e,t)=>({controllerId:n,expand:Eh.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Xn.Unset,computedState:Xn.Unset});var HT;(function(n){n[n.ComputedStateChange=0]="ComputedStateChange",n[n.OwnStateChange=1]="OwnStateChange",n[n.NewMessage=2]="NewMessage"})(HT||(HT={}));let D2=class extends ${get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,s){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=s,this.completeEmitter=this._register(new I),this.newTaskEmitter=this._register(new I),this.endTaskEmitter=this._register(new I),this.changeEmitter=this._register(new I),this.testById=new Map,this.testMarkerCounter=0,this.startedAt=Date.now(),this.onChange=this.changeEmitter.event,this.onComplete=this.completeEmitter.event,this.onNewTask=this.newTaskEmitter.event,this.onEndTask=this.endTaskEmitter.event,this.tasks=[],this.name=g(tJt,0,"Test run at {0}",new Date().toLocaleString(Gd)),this.counts=Lrt(),this.computedStateAccessor={getOwnState:o=>o.ownComputedState,getCurrentComputedState:o=>o.computedState,setComputedState:(o,r)=>o.computedState=r,getChildren:o=>o.children,getParents:o=>{const{testById:r}=this;return function*(){const a=bn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new Ka(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serializeWithoutMessages)})),this.doSerializeWithMessages=new Ka(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name})),name:this.name,request:this.request,items:[...this.testById.values()].map(Kse.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,s){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(s||i)&&(r=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,r),h={location:i,message:o,offset:l,length:d,marker:r,type:dC.Output},u=s&&this.testById.get(s);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:HT.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:xi(this,void 0),otherMessages:[],output:new iJt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Xn.Unset});this.newTaskEmitter.fire(this.tasks.length-1)}addTestChainToRun(e,t){let i=this.testById.get(t[0].extId);i||(i=this.addTestToRun(e,t[0],null));for(let s=1;ss.state===Xn.Queued||s.state===Xn.Running),this.endTaskEmitter.fire(t)}markComplete(){if(this._completedAt!==void 0)throw new Error("cannot complete a test result multiple times");for(const e of this.tasks)e.running&&this.markTaskComplete(e.id);this._completedAt=Date.now(),this.completeEmitter.fire(),this.telemetry.publicLog2("test.outcomes",{failures:this.counts[Xn.Errored]+this.counts[Xn.Failed],passes:this.counts[Xn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(bn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:HT.ComputedStateChange,item:i,result:this}))}toJSON(){return this.completedAt&&this.persist?this.doSerialize.value:void 0}toJSONWithMessages(){return this.completedAt&&this.persist?this.doSerializeWithMessages.value:void 0}setAllToState(e,t,i){const s=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[s],o)&&this.fireUpdateAndRefresh(o,s,e)}fireUpdateAndRefresh(e,t,i,s){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:HT.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,s!==void 0&&(e.tasks[t].duration=s,e.ownDuration=Math.max(e.ownDuration||0,s));const c=Irt(...e.tasks.map(l=>l.state));if(c===o){s!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,eJt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:HT.ComputedStateChange}))}addTestToRun(e,t,i){const s=nJt(e,t);if(this.testById.set(t.extId,s),this.counts[Xn.Unset]++,i&&this.testById.get(i)?.children.push(s),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};D2=D([_(3,rn)],D2);let i7e=class extends ${constructor(e,t,i,s,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=s,this.resultService=o,this.diffListener=this._register(new Dn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(et.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(r,a)=>this.proxy.$provideTestFollowups(r,a),executeTestFollowup:r=>this.proxy.$executeTestFollowup(r),disposeTestFollowups:r=>this.proxy.$disposeTestFollowups(r)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(T.debounce(s.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Yu.Run,Yu.Debug,Yu.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))r[c.controllerId]??=[],r[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(r)})),this._register(o.onResultsChanged(r=>{if("completed"in r){const a=r.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in r&&r.removed.forEach(a=>{a instanceof D2&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new qse;for(const i of e)t.insert(bn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof D2&&i.markRetired(t)}$publishTestRunProfile(e){const t=this.testProviderRegistrations.get(e.controllerId);t&&this.testProfiles.addProfile(t.instance,e)}$updateTestRunConfig(e,t,i){this.testProfiles.updateProfile(e,t,i)}$removeTestProfile(e,t){this.testProfiles.removeProfile(e,t)}$addTestsToRun(e,t,i){this.withLiveRun(t,s=>s.addTestChainToRun(e,i.map(o=>SG.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,s=>{const o=s.tasks.find(a=>a.id===t);if(!o)return;const r=Yse.deserialize(this.uriIdentityService,i);En(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new QYt(s,t,this.uriIdentityService,{getCoverageDetails:(l,d)=>this.proxy.$getCoverageDetails(l,d).then(h=>h.map(Kke.deserialize))}),c.append(r,a),o.coverage.set(c,a))})})}$startedExtensionTestRun(e){this.resultService.createLiveResult(e)}$startedTestRunTask(e,t){this.withLiveRun(e,i=>i.addTask(t))}$finishedTestRunTask(e,t){this.withLiveRun(e,i=>i.markTaskComplete(t))}$finishedExtensionTestRun(e){this.withLiveRun(e,t=>t.markComplete())}$updateTestStateInRun(e,t,i,s,o){this.withLiveRun(e,r=>r.updateState(i,t,s,o))}$appendOutputToRun(e,t,i,s,o){const r=s&&{uri:P.revive(s.uri),range:O.lift(s.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,s){const o=this.resultService.getResult(e);if(o&&o instanceof D2)for(const r of s)o.appendMessage(i,t,yG.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const s=new Z,o=s.add(new Zoe(t)),r=s.add(new Zoe(i)),a={id:e,label:o,canRefresh:r,syncTests:()=>this.proxy.$syncTests(),refreshTests:c=>this.proxy.$refreshTests(e,c),configureRunProfile:c=>this.proxy.$configureRunProfile(e,c),runTests:(c,l)=>this.proxy.$runControllerTests(c,l),startContinuousRun:(c,l)=>this.proxy.$startContinuousRun(c,l),expandTest:(c,l)=>this.proxy.$expandTest(c,isFinite(l)?l:-1)};s.add(Ee(()=>this.testProfiles.removeProfile(e))),s.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,canRefresh:r,disposable:s})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&(t.label!==void 0&&(i.label.value=t.label),t.canRefresh!==void 0&&(i.canRefresh.value=t.canRefresh))}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(x4.serialize)),this.diffListener.value=this.testService.onDidProcessDiff(this.proxy.$acceptDiff,this.proxy)}$unsubscribeFromDiffs(){this.diffListener.clear()}$publishDiff(e,t){this.testService.publishDiff(e,t.map(i=>x4.deserialize(this.uriIdentityService,i)))}async $runTests(e,t){return(await this.testService.runResolvedTests(e,t)).id}dispose(){super.dispose();for(const e of this.testProviderRegistrations.values())e.disposable.dispose();this.testProviderRegistrations.clear()}withLiveRun(e,t){const i=this.resultService.getResult(e);return i&&i instanceof D2?t(i):void 0}};i7e=D([en(Ue.MainThreadTesting),_(1,_o),_(2,cet),_(3,ret),_(4,aet)],i7e);let n7e=class extends ${constructor(e,t,i,s){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Jht,this._proxy=e.getProxy(et.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(o=>{try{const{extensionId:r,key:a}=this.parseKey(o);r&&a&&this._proxy.$onDidChangePassword({extensionId:r,key:a})}catch{}}))}$getPassword(e,t){return this.logService.trace(`[mainThreadSecretState] Getting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doGetPassword(e,t))}async doGetPassword(e,t){const i=this.getKey(e,t),s=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${s?"P":"No p"}assword found for: `,e,t),s}$setPassword(e,t,i){return this.logService.trace(`[mainThreadSecretState] Setting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doSetPassword(e,t,i))}async doSetPassword(e,t,i){const s=this.getKey(e,t);await this.secretStorageService.set(s,i),this.logService.trace("[mainThreadSecretState] Password set for: ",e,t)}$deletePassword(e,t){return this.logService.trace(`[mainThreadSecretState] Deleting password for ${e} extension: `,t),this._sequencer.queue(e,()=>this.doDeletePassword(e,t))}async doDeletePassword(e,t){const i=this.getKey(e,t);await this.secretStorageService.delete(i),this.logService.trace("[mainThreadSecretState] Password deleted for: ",e,t)}getKey(e,t){return JSON.stringify({extensionId:e,key:t})}parseKey(e){return JSON.parse(e)}};n7e=D([en(Ue.MainThreadSecretState),_(1,RZe),_(2,Ze),_(3,Ow)],n7e);let s7e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(et.ExtHostShare)}$registerShareProvider(e,t,i,s,o){const r={id:i,label:s,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,qe.None);return typeof l=="string"?l:P.revive(l)}};this.providers.set(e,r);const a=this.shareService.registerShareProvider(r);this.providerDisposables.set(e,a)}$unregisterShareProvider(e){this.providers.has(e)&&this.providers.delete(e),this.providerDisposables.has(e)&&this.providerDisposables.delete(e)}dispose(){this.providers.clear(),St(this.providerDisposables.values()),this.providerDisposables.clear()}};s7e=D([en(Ue.MainThreadShare),_(1,JZe)],s7e);let o7e=class extends ${constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new Zo),this.proxy=e.getProxy(et.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,s){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:s,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Or(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};o7e=D([en(Ue.MainThreadProfileContentHandlers),_(1,ket)],o7e);let r7e=class extends ${constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,qe.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(s,o)=>this._proxy.$provideAiRelatedInformation(e,s,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};r7e=D([en(Ue.MainThreadAiRelatedInformation),_(1,NPe)],r7e);let a7e=class extends ${constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new Zo),this._proxy=e.getProxy(et.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(s,o)=>this._proxy.$provideAiEmbeddingVector(t,s,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};a7e=D([en(Ue.MainThreadAiEmbeddingVector),_(1,uet)],a7e);let A0e=class extends Kne{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p){super(t,i,s,o,r,a,c,l,d,h,u,f,p),this.workerConfig=e}async _getWebWorkerExtensionHostIframeSrc(){const e=new URL(await super._getWebWorkerExtensionHostIframeSrc(),window.location.href);return e.searchParams.set("vscodeExtHostWorkerSrc",this.workerConfig.url),this.workerConfig.options!=null&&e.searchParams.set("vscodeExtHostWorkerOptions",JSON.stringify(this.workerConfig.options)),e.searchParams.set("parentOrigin",window.origin),e.toString()}};A0e=D([_(4,rn),_(5,Ti),_(6,eo),_(7,Ze),_(8,wp),_(9,Ow),_(10,V_),_(11,Ja),_(12,bg),_(13,on)],A0e);let E0e;function sJt(n){E0e=n}let x0e=class extends GDe{constructor(e,t,i,s,o,r,a,c,l){super(t,i,s,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return E0e==null?null:this._instantiationService.createInstance(E0e,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const s=i?2:1;return this._instantiationService.createInstance(A0e,this.workerConfig,t,s,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};x0e=D([_(4,be),_(5,Sf),_(6,rA),_(7,Kh),_(8,Ze)],x0e);let D0e=class extends qDe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,s,o){const r=PQt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,s,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};D0e=D([_(1,Ze)],D0e);let k0e=class extends $De{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k){const F=t.createInstance(PDe),N=new x0e(e,F,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,b,r,p);super(F,N,new D0e(e!=null?[2,1,3]:[1,3],p),t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w,b,C,y,S,M,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new rT(e,t))}async _scanSingleExtension(e){return e.location.scheme===k6.extensionFile?ME(e):super._scanSingleExtension(e)}};k0e=D([_(1,be),_(2,Pi),_(3,Ow),_(4,rn),_(5,Kh),_(6,ci),_(7,Ja),_(8,the),_(9,Ti),_(10,Re),_(11,G_),_(12,FPe),_(13,Ze),_(14,Sf),_(15,Gde),_(16,mg),_(17,rA),_(18,ahe),_(19,Tm),_(20,oA),_(21,she),_(22,To)],k0e);class oJt extends QDe{async readExtensionResource(e){return e.scheme===k6.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}Z9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>X9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function rJt(n,e){return{[ho.toString()]:new Gi(k0e,[void 0],!1),[G_.toString()]:new Gi(NDe,[],!0),[bPe.toString()]:new Gi(oJt,[],!0),[Fz.toString()]:new Gi(KDe,[],!0)}}const c7e=/^([^.]+\..+)[:=](.+)$/;class Jt{get remoteAuthority(){return this.options.remoteAuthority}get expectsResolverExtension(){return!!this.options.remoteAuthority?.includes("+")&&!this.options.webSocketFactory}get isBuilt(){return!!this.productService.commit}get logLevel(){const e=this.payload?.get("logLevel");return e?e.split(",").find(t=>!c7e.test(t)):this.options.developmentOptions?.logLevel!==void 0?c7(this.options.developmentOptions?.logLevel):void 0}get extensionLogLevel(){const e=this.payload?.get("logLevel");if(e){const t=[];for(const i of e.split(",")){const s=c7e.exec(i);s&&s[1]&&s[2]&&t.push([s[1],s[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,c7(i)]):void 0}get profDurationMarkers(){const e=this.payload?.get("profDurationMarkers");if(e){const t=[];for(const i of e.split(","))t.push(i);return t.length===2?t:void 0}}get windowLogsPath(){return this.logsHome}get logFile(){return Qt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return P.file("/User").with({scheme:_e.vscodeUserData})}get argvResource(){return Qt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Qt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Qt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Qt(this.userRoamingDataHome,"History")}get stateResource(){return Qt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Qt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Qt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Qt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Qt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Qt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Qt(this.extHostLogsPath,"extensionTelemetry.log")}get debugExtensionHost(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.params}get isExtensionDevelopment(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.isExtensionDevelopment}get extensionDevelopmentLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentLocationURI}get extensionDevelopmentLocationKind(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionDevelopmentKind}get extensionTestsLocationURI(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionTestsLocationURI}get extensionEnabledProposedApi(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.extensionEnabledProposedApi}get debugRenderer(){return this.extensionHostDebugEnvironment||(this.extensionHostDebugEnvironment=this.resolveExtensionHostDebugEnvironment()),this.extensionHostDebugEnvironment.debugRenderer}get enableSmokeTestDriver(){return this.options.developmentOptions?.enableSmokeTestDriver}get disableExtensions(){return this.payload?.get("disableExtensions")==="true"}get enableExtensions(){return this.options.enabledExtensions}get webviewExternalEndpoint(){const e=this.options.webviewEndpoint||this.productService.webviewContentExternalBaseUrlTemplate||"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/",t=this.payload?.get("webviewExternalEndpointCommit");return e.replace("{{commit}}",t??this.productService.commit??"ef65ac1ba57f57f2a3961bfe94aa20481caca4c6").replace("{{quality}}",(t?"insider":this.productService.quality)??"insider")}get extensionTelemetryLogResource(){return Qt(this.logsHome,"extensionTelemetry.log")}get disableTelemetry(){return!1}get verbose(){return this.payload?.get("verbose")==="true"}get logExtensionHostCommunication(){return this.payload?.get("logExtensionHostCommunication")==="true"}get skipReleaseNotes(){return this.payload?.get("skipReleaseNotes")==="true"}get skipWelcome(){return this.payload?.get("skipWelcome")==="true"}get disableWorkspaceTrust(){return!this.options.enableWorkspaceTrust}get lastActiveProfile(){return this.payload?.get("lastActiveProfile")}constructor(e,t,i,s){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=s,this.extensionHostDebugEnvironment=void 0,this.editSessionId=this.options.editSessionId,i.workspaceProvider&&Array.isArray(i.workspaceProvider.payload))try{this.payload=new Map(i.workspaceProvider.payload)}catch(o){bt(o)}}resolveExtensionHostDebugEnvironment(){const e={params:{port:null,break:!1},debugRenderer:!1,isExtensionDevelopment:!1,extensionDevelopmentLocationURI:void 0,extensionDevelopmentKind:void 0};if(this.payload)for(const[i,s]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(P.parse(s)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[s];break;case"extensionTestsPath":e.extensionTestsLocationURI=P.parse(s);break;case"debugRenderer":e.debugRenderer=s==="true";break;case"debugId":e.params.debugId=s;break;case"inspect-brk-extensions":e.params.port=parseInt(s),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(s);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>P.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=P.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=P.parse(e);if(this.payload.has("gotoLineMode")){const i=qQe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:ll(i.line)?void 0:{startLineNumber:i.line,startColumn:i.column||1}}}]}return[{fileUri:t}]}}}get filesToDiff(){if(this.payload){const e=this.payload.get("diffFilePrimary"),t=this.payload.get("diffFileSecondary");if(e&&t)return[{fileUri:P.parse(t)},{fileUri:P.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),s=this.payload.get("mergeFileResult");if(e&&t&&i&&s)return[{fileUri:P.parse(e)},{fileUri:P.parse(t)},{fileUri:P.parse(i)},{fileUri:P.parse(s)}]}}}Jt.__decorator=D([ii],Jt.prototype,"remoteAuthority",null);Jt.__decorator=D([ii],Jt.prototype,"expectsResolverExtension",null);Jt.__decorator=D([ii],Jt.prototype,"isBuilt",null);Jt.__decorator=D([ii],Jt.prototype,"logLevel",null);Jt.__decorator=D([ii],Jt.prototype,"windowLogsPath",null);Jt.__decorator=D([ii],Jt.prototype,"logFile",null);Jt.__decorator=D([ii],Jt.prototype,"userRoamingDataHome",null);Jt.__decorator=D([ii],Jt.prototype,"argvResource",null);Jt.__decorator=D([ii],Jt.prototype,"cacheHome",null);Jt.__decorator=D([ii],Jt.prototype,"workspaceStorageHome",null);Jt.__decorator=D([ii],Jt.prototype,"localHistoryHome",null);Jt.__decorator=D([ii],Jt.prototype,"stateResource",null);Jt.__decorator=D([ii],Jt.prototype,"userDataSyncHome",null);Jt.__decorator=D([ii],Jt.prototype,"sync",null);Jt.__decorator=D([ii],Jt.prototype,"keyboardLayoutResource",null);Jt.__decorator=D([ii],Jt.prototype,"untitledWorkspacesHome",null);Jt.__decorator=D([ii],Jt.prototype,"serviceMachineIdResource",null);Jt.__decorator=D([ii],Jt.prototype,"extHostLogsPath",null);Jt.__decorator=D([ii],Jt.prototype,"extHostTelemetryLogFile",null);Jt.__decorator=D([ii],Jt.prototype,"debugExtensionHost",null);Jt.__decorator=D([ii],Jt.prototype,"isExtensionDevelopment",null);Jt.__decorator=D([ii],Jt.prototype,"extensionDevelopmentLocationURI",null);Jt.__decorator=D([ii],Jt.prototype,"extensionDevelopmentLocationKind",null);Jt.__decorator=D([ii],Jt.prototype,"extensionTestsLocationURI",null);Jt.__decorator=D([ii],Jt.prototype,"extensionEnabledProposedApi",null);Jt.__decorator=D([ii],Jt.prototype,"debugRenderer",null);Jt.__decorator=D([ii],Jt.prototype,"enableSmokeTestDriver",null);Jt.__decorator=D([ii],Jt.prototype,"disableExtensions",null);Jt.__decorator=D([ii],Jt.prototype,"enableExtensions",null);Jt.__decorator=D([ii],Jt.prototype,"webviewExternalEndpoint",null);Jt.__decorator=D([ii],Jt.prototype,"extensionTelemetryLogResource",null);Jt.__decorator=D([ii],Jt.prototype,"disableTelemetry",null);Jt.__decorator=D([ii],Jt.prototype,"verbose",null);Jt.__decorator=D([ii],Jt.prototype,"logExtensionHostCommunication",null);Jt.__decorator=D([ii],Jt.prototype,"skipReleaseNotes",null);Jt.__decorator=D([ii],Jt.prototype,"skipWelcome",null);Jt.__decorator=D([ii],Jt.prototype,"disableWorkspaceTrust",null);Jt.__decorator=D([ii],Jt.prototype,"lastActiveProfile",null);Jt.__decorator=D([ii],Jt.prototype,"filesToOpenOrCreate",null);Jt.__decorator=D([ii],Jt.prototype,"filesToDiff",null);Jt.__decorator=D([ii],Jt.prototype,"filesToMerge",null);let I0e=class extends Jt{constructor(e=HFe().id,t=L4t(),i){super(e,Pnt,t,i)}};I0e=D([_(2,Ja)],I0e);function aJt(n){return{[Il.toString()]:new Gi(I0e,[void 0,n],!0)}}class Mrt extends ${constructor(e=I4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=T.None,this.whenActiveContainerStylesLoaded=Promise.resolve(),this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidRemoveContainer=this._register(new I),this.onDidRemoveContainer=this._onDidRemoveContainer.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0},this.onDidChangeFullscreen=T.None,this.onDidChangeZenMode=T.None,this.onDidChangeWindowMaximized=T.None,this.onDidChangeCenteredLayout=T.None,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangeSideBarPosition=this._register(new I),this.onDidChangeSideBarPosition=this._onDidChangeSideBarPosition.event,this.onDidChangePanelAlignment=T.None,this.onDidChangeNotificationsVisibility=T.None,this.openedDefaultEditors=!1,this.whenRestored=Promise.resolve(),this.parts=new Map,this.hiddenParts=new Set,this._onDidChangePartVisibility=new I,this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this.offset={top:0,quickPickTop:0},this._onDidLayout=new I,this.onDidLayout=this._onDidLayout.event,window.addEventListener("resize",()=>this.layout()),this.layout();const t=Is?"windows":jr?"linux":"mac",i=Ui(["monaco-workbench",t,"web",VRe?"chromium":rQe?"firefox":aQe?"safari":void 0]);e.classList.add(...i),document.body.classList.add(t),document.body.classList.add("web")}whenContainerStylesLoaded(){}hasMainWindowBorder(){return!1}getMainWindowBorderRadius(){}isMainEditorLayoutCentered(){return!1}centerMainEditorLayout(){}get activeContainer(){return this.getContainerFromDocument(Kg())}get containers(){const e=[];for(const{window:t}of N9())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}init(e){this.editorGroupService=e.get(ur),this.paneCompositeService=e.get(Nw),this.statusBarService=e.get(EPe),this.viewDescriptorService=e.get(z_),this.configurationService=e.get(Re),this.auxiliaryWindowService=e.get(met),this.hostService=e.get(Id),this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("workbench.activityBar.location")&&this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),t.affectsConfiguration("workbench.statusBar.visible")&&this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),t.affectsConfiguration("workbench.sideBar.location")&&this.setSideBarPosition(ZK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"))})),this.setPartHidden(this.isActivityBarHidden(),"workbench.parts.activitybar"),this.setPartHidden(!this.configurationService.getValue("workbench.statusBar.visible"),"workbench.parts.statusbar"),this.sideBarPosition=ZK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=ZK(this.configurationService.getValue("workbench.panel.defaultLocation")??"bottom"),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:t,disposables:i})=>{this._onDidAddContainer.fire({container:t.container,disposables:new Z}),i.add(t.onDidLayout(s=>this.handleContainerDidLayout(t.container,s))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),jut(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return gt(e).vscodeWindowId}onActiveWindowChanged(){const e=this.getActiveContainerId();this.activeContainerId!==e&&(this.activeContainerId=e,this._onDidChangeActiveContainer.fire())}isActivityBarHidden(){const e=this.configurationService.getValue("workbench.activityBar.visible");return e!==void 0?!e:this.configurationService.getValue("workbench.activityBar.location")!=="default"}focusPart(e){switch(e){case"workbench.parts.editor":this.editorGroupService.activeGroup.focus();break;case"workbench.parts.panel":{this.paneCompositeService.getActivePaneComposite(1)?.focus();break}case"workbench.parts.sidebar":{this.paneCompositeService.getActivePaneComposite(0)?.focus();break}case"workbench.parts.activitybar":this.getPart("workbench.parts.activitybar").focus();break;case"workbench.parts.statusbar":this.statusBarService.focus();break;default:this.getContainer(e)?.focus()}}getDimension(e){return this.getPart(e)?.dimension}toggleMaximizedPanel(){}toggleMenuBar(){let e=x4t(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=knt(this.configurationService)==="native"?"toggle":"compact":t="classic",this.configurationService.updateValue("window.menuBarVisibility",t)}setPanelPosition(e){this.panelPosition=e,this.getPart("workbench.parts.panel")?.updateStyles(),this._onDidChangePanelPosition.fire(l8(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new Tn(1/0,1/0)}isPanelMaximized(){return!1}getPanelPosition(){return this.panelPosition}hasFocus(e){const t=document.activeElement;if(t==null)return!1;const i=this.getContainer(e);return i!=null&&qut(t,i)}getContainer(e){return typeof e=="string"?this.parts.get(e)==null?void 0:this.getPart(e)?.getContainer():e.document===this.mainContainer.ownerDocument?this.mainContainer:e.document.body.getElementsByClassName("monaco-workbench")[0]}getPart(e){return this.parts.get(e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(t==null)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i==null?!1:i.activeViewDescriptors.length>=1}setPartHidden(e,t){e?this.hiddenParts.add(t):this.hiddenParts.delete(t),this._onDidChangePartVisibility.fire();const i={"workbench.parts.sidebar":0,"workbench.parts.auxiliarybar":2,"workbench.parts.panel":1}[t];if(i!=null){const s=this.paneCompositeService.getActivePaneComposite(i);if(s!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(s==null&&!e){let o=this.paneCompositeService.getLastActivePaneCompositeId(i);(o==null||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(i).find(r=>this.hasViews(r.id))?.id),o!=null&&this.paneCompositeService.openPaneComposite(o,i,!0)}}this.getPart(t)?.setVisible(!e)}isVisible(e){return!this.hiddenParts.has(e)}getSideBarPosition(){return this.sideBarPosition}setSideBarPosition(e){this.sideBarPosition=e;const t=this.getPart("workbench.parts.activitybar"),i=this.getPart("workbench.parts.sidebar"),s=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),s?.updateStyles(),this._onDidChangeSideBarPosition.fire(l8(e))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ee(()=>this.parts.delete(t))}isRestored(){return!0}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){const e=this.activeContainer;return e===this.mainContainer?this.mainContainerDimension:uw(e)}layout(){this._mainContainerDimension=uw(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Lt.get(jt).getFocusedCodeEditor();t instanceof k1?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}N4t(n=>{const e=n.get(bg);e instanceof Mrt&&e.init(n)});function cJt(n){return{[bg.toString()]:new Gi(Mrt,[n],!0)}}const l7e="vs/workbench/services/host/browser/browserHostService";var av;(function(n){n[n.Unknown=1]="Unknown",n[n.Keyboard=2]="Keyboard",n[n.Api=3]="Api"})(av||(av={}));let jx=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=s,this.environmentService=o,this.instantiationService=r,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=av.Unknown,o.options?.workspaceProvider?this.workspaceProvider=o.options.workspaceProvider:this.workspaceProvider=new class{constructor(){this.workspace=void 0,this.trusted=void 0}async open(){return!0}},this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>this.onBeforeShutdown(e))),this._register(Nb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case av.Unknown:case av.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===av.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=av.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==av.Api&&(Nb.getInstance().isModifierPressed?this.shutdownReason=av.Keyboard:this.shutdownReason=av.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=i.add(Dd(t)),o=i.add(new oi(t.document,"visibilitychange"));T.any(T.map(s.onDidFocus,()=>this.hasFocus,i),T.map(s.onDidBlur,()=>this.hasFocus,i),T.map(o.event,()=>this.hasFocus,i),T.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get hasFocus(){return Kg().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=i.add(Dd(t));i.add(o.onDidFocus(()=>e.fire(s))),Eht(t)&&i.add(Put(t,()=>{const r=t.document.hasFocus();return r&&e.fire(s),r},100,20))},{window:yi,disposables:this._store})),T.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(T.runAndSubscribe(Vb,({window:t,disposables:i})=>{const s=FU(t),o=I_&&t.visualViewport?t.visualViewport:t,r=()=>{const a=lgt(t);return a!==null&&!a.guess};for(const a of[xe.FULLSCREEN_CHANGE,xe.WK_FULLSCREEN_CHANGE])i.add(pe(t.document,a,()=>e.fire({windowId:s,fullscreen:r()})));i.add(Wut(o,xe.RESIZE,()=>e.fire({windowId:s,fullscreen:r()}),void 0,ei?2e3:800))},{window:yi,disposables:this._store})),e.event}openWindow(e,t){return Array.isArray(e)?this.doOpenWindow(e,t):this.doOpenEmptyWindow(e)}async doOpenWindow(e,t){const i=this.preservePayload(!1),s=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),GJ(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):tEe(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):E4t(r)&&s.push(r);o.length>0&&this.withServices(r=>{r.get($S).addFolders(o)}),s.length>0&&this.withServices(async r=>{const a=r.get(_i);if(t?.mergeMode&&s.length===4){const l=Ui(await Zfe(s,this.fileService,this.logService));if(l.length!==4||!wb(l[0])||!wb(l[1])||!wb(l[2])||!wb(l[3]))return;if(this.shouldReuse(t,!0))a.openEditor({input1:{resource:l[0].resource},input2:{resource:l[1].resource},base:{resource:l[2].resource},result:{resource:l[3].resource},options:{pinned:!0}});else{const d=new Map;d.set("mergeFile1",l[0].resource.toString()),d.set("mergeFile2",l[1].resource.toString()),d.set("mergeFileBase",l[2].resource.toString()),d.set("mergeFileResult",l[3].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else if(t?.diffMode&&s.length===2){const l=Ui(await Zfe(s,this.fileService,this.logService));if(l.length!==2||!wb(l[0])||!wb(l[1]))return;if(this.shouldReuse(t,!0))a.openEditor({original:{resource:l[0].resource},modified:{resource:l[1].resource},options:{pinned:!0}});else{const d=new Map;d.set("diffFileSecondary",l[0].resource.toString()),d.set("diffFilePrimary",l[1].resource.toString()),this.doOpen(void 0,{payload:Array.from(d.entries())})}}else for(const l of s)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=qQe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:ll(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Ui(await Zfe(d,this.fileService,this.logService)),void 0,{validateTrust:!0})}else{const d=new Map;d.set("openFile",l.fileUri.toString()),t?.gotoLineMode&&d.set("gotoLineMode","true"),this.doOpen(void 0,{payload:Array.from(d.entries())})}const c=t?.waitMarkerFileURI;c&&(async()=>(await this.instantiationService.invokeFunction(l=>t3t(l,s.map(d=>d.fileUri))),await this.fileService.del(c)))()})}withServices(e){this.instantiationService.invokeFunction(t=>e(t))}preservePayload(e){const t=new Array;!e&&this.environmentService.extensionDevelopmentLocationURI&&(t.push(["extensionDevelopmentPath",this.environmentService.extensionDevelopmentLocationURI.toString()]),this.environmentService.debugExtensionHost.debugId&&t.push(["debugId",this.environmentService.debugExtensionHost.debugId]),this.environmentService.debugExtensionHost.port&&t.push(["inspect-brk-extensions",String(this.environmentService.debugExtensionHost.port)]));const i=this.configurationService.getValue("window"),s=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return s.isDefault||t.push(["lastActiveProfile",s.id]),t.length?t:void 0}getRecentLabel(e){return GJ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:e_.LONG}):tEe(e)?this.labelService.getWorkspaceLabel(BFe(e.workspaceUri),{verbose:e_.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),s=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(s==="on"||s==="off")&&(o=s==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&GJ(e)&&e.folderUri.scheme===_e.file&&hx(this.contextService.getWorkspace())){this.withServices(async s=>{await s.get($S).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(PI.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:s}=await this.dialogService.confirm({type:nt.Warning,message:g(l7e,0,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(l7e,1,"&&Open")});s&&await this.workspaceProvider.open(e,t)}}async toggleFullScreen(e){const t=this.layoutService.getContainer(e);if(e.document.fullscreen!==void 0)if(e.document.fullscreen)try{return await e.document.exitFullscreen()}catch{this.logService.warn("toggleFullScreen(): exitFullscreen failed")}else try{return await t.requestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen failed")}if(e.document.webkitIsFullScreen!==void 0)try{e.document.webkitIsFullScreen?e.document.webkitExitFullscreen():t.webkitRequestFullscreen()}catch{this.logService.warn("toggleFullScreen(): requestFullscreen/exitFullscreen failed")}}async moveTop(e){}async getCursorScreenPoint(){}async restart(){this.reload()}async reload(){await this.handleExpectedShutdown(PI.RELOAD),yi.location.reload()}async close(){await this.handleExpectedShutdown(PI.CLOSE),yi.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=av.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=av.Api,this.lifecycleService.withExpectedShutdown(e)}};jx.__decorator=D([ii],jx.prototype,"onDidChangeFocus",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeActiveWindow",null);jx.__decorator=D([ii],jx.prototype,"onDidChangeFullScreen",null);jx=D([_(0,bg),_(1,Re),_(2,ci),_(3,eo),_(4,Ow),_(5,be),_(6,mg),_(7,Ze),_(8,To),_(9,Ti),_(10,Tm),_(11,V_)],jx);class lJt extends ${constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){pZ(yi,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),pZ(yi,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return yi.matchMedia("(prefers-color-scheme: light)").matches?!1:!!yi.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!yi.matchMedia("(forced-colors: active)").matches}}function dJt(){return{[Id.toString()]:new Gi(jx,[],!0),[xet.toString()]:new Gi(lJt,[],!0)}}function hJt(n,e,t){let i,s,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!ere(n,o-1);)o--;let C=a;for(;Cr&&n.substring(y,S)!==C&&v.push({offset:y,length:S-y,content:C})}let b=m();if(b!==xt.EOF){const C=u.getTokenOffset()+o,y=ome(h,i);w(y,o,C)}for(;b!==xt.EOF;){let C=u.getTokenOffset()+u.getTokenLength()+o,y=m(),S="";for(;!l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia);){const k=u.getTokenOffset()+o;w(" ",C,k),C=u.getTokenOffset()+u.getTokenLength()+o,S=y===xt.LineCommentTrivia?p():"",y=m()}if(y===xt.CloseBraceToken)b!==xt.OpenBraceToken&&(d--,S=p());else if(y===xt.CloseBracketToken)b!==xt.OpenBracketToken&&(d--,S=p());else{switch(b){case xt.OpenBracketToken:case xt.OpenBraceToken:d++,S=p();break;case xt.CommaToken:case xt.LineCommentTrivia:S=p();break;case xt.BlockCommentTrivia:l?S=p():S=" ";break;case xt.ColonToken:S=" ";break;case xt.StringLiteral:if(y===xt.ColonToken){S="";break}case xt.NullKeyword:case xt.TrueKeyword:case xt.FalseKeyword:case xt.NumericLiteral:case xt.CloseBraceToken:case xt.CloseBracketToken:y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia?S=" ":y!==xt.CommaToken&&y!==xt.EOF&&(f=!0);break;case xt.Unknown:f=!0;break}l&&(y===xt.LineCommentTrivia||y===xt.BlockCommentTrivia)&&(S=p())}const M=u.getTokenOffset()+o;w(S,C,M),b=y}return v}function ome(n,e){let t="";for(let i=0;i(h.weight||0)-(d.weight||0));const i=tre.keyOf(e);let s=this._decorationRules.get(i);s||(s=new tre(this._themeService,e,i),this._decorationRules.set(i,s),s.appendCSSRules(this._styleElement)),s.acquire();const o=s.itemColorClassName;let r=s.itemBadgeClassName;const a=s.iconBadgeClassName;let c=Lc(e.filter(d=>!Xv(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(r=s.bubbleBadgeClassName,c=g(_Jt,0,"Contains emphasized items")),{labelClassName:o,badgeClassName:r,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{s?.release()&&(this._decorationRules.delete(i),s.removeCSSRules(this._styleElement),s=void 0)}}}}class wJt{constructor(e){this._data=Su.forUris(t=>!0),this._data.fill(!0,Kb(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class uY{constructor(e,t){this.source=e,this.thenable=t}}function NL(n){return n?Ye(n):"inherit"}let R0e=class{constructor(e,t){this._onDidChangeDecorationsDelayed=new Fle({merge:i=>i.flat()}),this._onDidChangeDecorations=new I,this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new td,this._decorationStyles=new vJt(t),this._data=Su.forUris(i=>e.extUri.ignorePathCasing(i)),this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new wJt(i))})}dispose(){this._onDidChangeDecorations.dispose(),this._onDidChangeDecorationsDelayed.dispose(),this._data.clear()}registerDecorationsProvider(e){const t=this._provider.unshift(e);this._onDidChangeDecorations.fire({affectsResource(){return!0}});const i=()=>{const o=[];for(const[r,a]of this._data)a.delete(e)&&o.push(r);o.length>0&&this._onDidChangeDecorationsDelayed.fire(o)},s=e.onDidChange(o=>{if(!o)i();else for(const r of o){const a=this._ensureEntry(r);this._fetchData(a,r,e)}});return Ee(()=>{t(),s.dispose(),i()})}_ensureEntry(e){let t=this._data.get(e);return t||(t=new Map,this._data.set(e,t)),t}getDecoration(e,t){const i=[];let s=!1;const o=this._ensureEntry(e);for(const r of this._provider){let a=o.get(r);a===void 0&&(a=this._fetchData(o,e,r)),a&&!(a instanceof uY)&&i.push(a)}if(t){const r=this._data.findSuperstr(e);if(r)for(const a of r)for(const c of a[1].values())c&&!(c instanceof uY)&&c.bubble&&(i.push(c),s=!0)}return i.length===0?void 0:this._decorationStyles.asDecoration(i,s)}_fetchData(e,t,i){const s=e.get(i);s instanceof uY&&(s.source.cancel(),e.delete(i));const o=new ai,r=i.provideDecorations(t,o.token);if(NS(r)){const a=new uY(o,Promise.resolve(r).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Na(c)&&e.get(i)===a&&e.delete(i)}).finally(()=>{o.dispose()}));return e.set(i,a),null}else return o.dispose(),this._keepItem(e,i,t,r)}_keepItem(e,t,i,s){const o=s||null,r=e.get(t);return e.set(t,o),(o||r)&&this._onDidChangeDecorationsDelayed.fire(i),o}};R0e=D([_(0,_o),_(1,pn)],R0e);class bJt{constructor(e){this.channel=e}async request(e,t){const[i,s]=await this.channel.call("request",[e],t);return{res:i,stream:aQ(s)}}async resolveProxy(e){return this.channel.call("resolveProxy",[e])}async loadCertificates(){return this.channel.call("loadCertificates")}}const CJt="Offline";class yJt extends Error{constructor(){super(CJt),this.name=this.message}}function SJt(n,e){n.proxyAuthorization&&(n.headers={...n.headers||{},"Proxy-Authorization":n.proxyAuthorization});const t=new XMLHttpRequest;return new Promise((i,s)=>{t.open(n.type||"GET",n.url||"",!0,n.user,n.password),AJt(t,n),t.responseType="arraybuffer",t.onerror=o=>s(navigator.onLine?new Error(t.statusText&&"XHR failed: "+t.statusText||"XHR failed"):new yJt),t.onload=o=>{i({res:{statusCode:t.status,headers:EJt(t)},stream:aQ(ze.wrap(new Uint8Array(t.response)))})},t.ontimeout=o=>s(new Error(`XHR timeout: ${n.timeout}ms`)),n.timeout&&(t.timeout=n.timeout),t.send(n.data),e.onCancellationRequested(()=>{t.abort(),s(rx())})})}function AJt(n,e){if(e.headers)e:for(const t in e.headers){switch(t){case"User-Agent":case"Accept-Encoding":case"Content-Length":continue e}n.setRequestHeader(t,e.headers[t])}}function EJt(n){const e=Object.create(null);for(const t of n.getAllResponseHeaders().split(/\r\n|\n|\r/g))if(t){const i=t.indexOf(":");e[t.substr(0,i).trim().toLowerCase()]=t.substr(i+1).trim()}return e}let M0e=class extends lzt{constructor(e,t){super(t),this.configurationService=e}async request(e,t){return e.proxyAuthorization||(e.proxyAuthorization=this.configurationService.getValue("http.proxyAuthorization")),this.logAndRequest("browser",e,()=>SJt(e,t))}async resolveProxy(e){}async loadCertificates(){return[]}};M0e=D([_(0,Re),_(1,wp)],M0e);let N0e=class extends M0e{constructor(e,t,i){super(t,i),this.remoteAgentService=e}async request(e,t){try{const i=await super.request(e,t),s=this.remoteAgentService.getConnection();return s&&i.res.statusCode===405?this._makeRemoteRequest(s,e,t):i}catch(i){const s=this.remoteAgentService.getConnection();if(s)return this._makeRemoteRequest(s,e,t);throw i}}_makeRemoteRequest(e,t,i){return e.withChannel("request",s=>new bJt(s).request(t,i))}};N0e=D([_(0,Sf),_(1,Re),_(2,wp)],N0e);yt.registerCommand("_workbench.fetchJSON",async function(n,e,t){const i=await fetch(e,{method:t,headers:{Accept:"application/json"}});if(i.ok)return i.json();throw new Error(i.statusText)});class xJt extends ${constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return Qle(i.map(s=>()=>s.handleURL(e,t)),void 0,!1).then(s=>s||!1)}registerHandler(e){return this.handlers.add(e),Ee(()=>this.handlers.delete(e))}}class DJt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!Rx(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=P.parse(e)),this.urlService.open(e,{trusted:!0}))}}let P0e=class extends xJt{constructor(e,t,i){super(),this.provider=e.options?.urlCallbackProvider,this.provider&&this._register(this.provider.onCallback(s=>this.open(s,{trusted:!0}))),this._register(t.registerOpener(new DJt(this,i)))}create(e){return this.provider?this.provider.create(e):P.parse("unsupported://")}};P0e=D([_(0,Ow),_(1,fr),_(2,Ja)],P0e);class kJt{constructor(){this._providers=new Map}registerCanonicalUriProvider(e){return this._providers.set(e.scheme,e),{dispose:()=>this._providers.delete(e.scheme)}}async provideCanonicalUri(e,t,i){const s=this._providers.get(e.scheme);if(s)return s.provideCanonicalUri(e,t,i)}}let F0e=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=qe.None){if(e.scheme===_e.file||e.scheme===_e.vscodeRemote){await this.fileService.copy(e,t);return}const s={type:"GET",url:e.toString(!0)},o=await this.requestService.request(s,i);if(o.res.statusCode===200)await this.fileService.writeFile(t,o.stream);else{const r=await hzt(o);throw new Error(`Expected 200, got back ${o.res.statusCode} instead. -${r}`)}}};F0e=D([_(0,EQ),_(1,ci)],F0e);var O0e;let ire=O0e=class{constructor(e,t,i,s){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=s,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||zc)(),this.resolveUserHome=(async()=>{const o=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=o?.userHome??e})()}hasValidBasename(e,t,i){return typeof t=="string"||typeof t>"u"?this.resolveOS.then(s=>this.doHasValidBasename(e,s,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===_e.file||e.scheme===_e.vscodeRemote?VQe(i??ui(e),t===Pr.Windows):!0}get defaultUriScheme(){return O0e.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return _e.vscodeRemote;const i=v5t(t.getWorkspace());if(i)return i;const s=t.getWorkspace().folders[0];if(s)return s.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:_e.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Pr.Windows?$c:qi)}async fileURI(e){let t="";if(await this.resolveOS===Pr.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const s=e.indexOf("/",2);s===-1?(t=e.substring(2),e="/"):(t=e.substring(2,s),e=e.substring(s)||"/")}return P.from({scheme:_e.file,authority:t,path:e,query:"",fragment:""})}};ire=O0e=D([_(1,Sf),_(2,Za),_(3,Ti)],ire);function IJt(n,e){const t=e.getWorkspace(),i=k_(t.folders);return i?i.uri:t.configuration?ma(t.configuration):P.from({scheme:ire.findDefaultUriScheme(n,e),authority:n.remoteAuthority,path:"/"})}class LJt{constructor(){this.todo=[],this.add=e=>{this.todo.push(e)}}take(e,t){this.add=i=>t.createInstance(i,e),this.todo.forEach(this.add),this.todo=[]}}const TJt=new LJt;let B0e=class extends ${constructor(e){super(),this.markInactive=this._register(new yn(()=>{this.isActive=!1,this.changeEmitter.fire(!1)},1e4)),this.changeEmitter=this._register(new I),this.active=0,this.isActive=!0,this.onDidChangeIsActive=this.changeEmitter.event,this._register(PU(()=>TJt.take(this,e)))}markActive(){return++this.active===1&&(this.isActive=!0,this.changeEmitter.fire(!0),this.markInactive.cancel()),Ee(()=>{--this.active===0&&this.markInactive.schedule()})}};B0e=D([_(0,be)],B0e);let W0e=class extends ${constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new td}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,s){const o=this.configurationService.getValue("files.participants.timeout");if(!(typeof o!="number"||o<=0))for(const r of this.participants)try{await r.participate(e,t,i,o,s)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};W0e=D([_(0,Ze),_(1,Re)],W0e);const RJt="vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant";let H0e=class extends ${get length(){return this.saveParticipants.length}constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=FRe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(RJt,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.model?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||e.isDisposed())break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.warn(a)}}e.model?.pushStackElement(),s.dispose()},()=>{s.dispose(!0)})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};H0e=D([_(0,Cf),_(1,Ze)],H0e);let U0e=class extends ${constructor(e,t,i,s){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=s,this._onWillRunWorkingCopyFileOperation=this._register(new EI),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new EI),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new EI),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(W0e)),this.saveParticipants=this._register(this.instantiationService.createInstance(H0e)),this.workingCopyProviders=[],this._register(this.registerWorkingCopyProvider(o=>this.workingCopyService.workingCopies.filter(r=>this.fileService.hasProvider(o)?this.uriIdentityService.extUri.isEqualOrParent(r.resource,o):this.uriIdentityService.extUri.isEqual(r.resource,o))))}create(e,t,i){return this.doCreateFileOrFolder(e,!0,t,i)}createFolder(e,t,i){return this.doCreateFileOrFolder(e,!1,t,i)}async doCreateFileOrFolder(e,t,i,s){if(e.length===0)return[];if(t){const l=(await ko.settled(e.map(d=>this.fileService.canCreateFile(d.resource,{overwrite:d.overwrite})))).find(d=>d instanceof Error);if(l instanceof Error)throw l}const o=e.map(c=>({target:c.resource}));await this.runFileOperationParticipants(o,Li.CREATE,s,i);const r={correlationId:this.correlationIds++,operation:Li.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,qe.None);let a;try{t?a=await ko.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await ko.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,qe.None),a}async move(e,t,i){return this.doMoveOrCopy(e,!0,t,i)}async copy(e,t,i){return this.doMoveOrCopy(e,!1,t,i)}async doMoveOrCopy(e,t,i,s){const o=[];for(const{file:{source:c,target:l},overwrite:d}of e){const h=await(t?this.fileService.canMove(c,l,d):this.fileService.canCopy(c,l,d));if(h instanceof Error)throw h}const r=e.map(c=>c.file);await this.runFileOperationParticipants(r,t?Li.MOVE:Li.COPY,s,i);const a={correlationId:this.correlationIds++,operation:t?Li.MOVE:Li.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,qe.None);try{for(const{file:{source:c,target:l},overwrite:d}of e){if(!this.uriIdentityService.extUri.isEqual(c,l)){const h=t?[...this.getDirty(c),...this.getDirty(l)]:this.getDirty(l);await ko.settled(h.map(u=>u.revert({soft:!0})))}t?o.push(await this.fileService.move(c,l,d)):o.push(await this.fileService.copy(c,l,d))}}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(a,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,qe.None),o}async delete(e,t,i){for(const r of e){const a=await this.fileService.canDelete(r.resource,{recursive:r.recursive,useTrash:r.useTrash});if(a instanceof Error)throw a}const s=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(s,Li.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Li.DELETE,files:s};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,qe.None);for(const r of e){const a=this.getDirty(r.resource);await ko.settled(a.map(c=>c.revert({soft:!0})))}try{for(const r of e)await this.fileService.del(r.resource,{recursive:r.recursive,useTrash:r.useTrash})}catch(r){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(o,qe.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,qe.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,s){return this.fileOperationParticipants.participate(e,t,i,s)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}registerWorkingCopyProvider(e){const t=FRe(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const s of i(e))s.isDirty()&&t.add(s);return Array.from(t)}};U0e=D([_(0,ci),_(1,Pw),_(2,be),_(3,_o)],U0e);let V0e=class extends ire{constructor(e,t,i){super(T4t().userHome??IJt(t,i),e,t,i)}};V0e=D([_(0,Sf),_(1,Za),_(2,Ti)],V0e);function MJt(){return{[EQ.toString()]:new $i(N0e,[],!0),[wPe.toString()]:new $i(F0e,[],!0),[rD.toString()]:new $i(R0e,[],!0),[dL.toString()]:new $i(T0e,[],!0),[zde.toString()]:new $i(vPe,[],!0),[jde.toString()]:new $i(P0e,[],!0),[SPe.toString()]:new $i(kJt,[],!1),[BPe.toString()]:new $i(B0e,[],!0),[fC.toString()]:new $i(U0e,[],!1),[Lm.toString()]:new $i(V0e,[],!0),[lhe.toString()]:new $i(cDe,[],!0)}}var h7e;(function(n){n[n.NONE=0]="NONE",n[n.EDITS=1]="EDITS",n[n.NAVIGATION=2]="NAVIGATION"})(h7e||(h7e={}));var u7e;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.EDITOR_GROUP=1]="EDITOR_GROUP",n[n.EDITOR=2]="EDITOR"})(u7e||(u7e={}));async function NJt(n,e=document.body,t={},i){B4t(),M4t(e,t,i);const s=Lt.initialize({[Ja.toString()]:ym({version:"1.90.2",quality:"stable",commit:"5437499feb04f7a586f677b155b039bc2b3669eb",nameShort:"Code - OSS",nameLong:"Code - OSS",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",serverApplicationName:"code-server-oss"},t.productConfiguration??{}),...cJt(),...aJt(),...rJt(),...lOe(),...P$t(),...dJt(),...MJt(),...n});await O4t(s)}async function Nrt(n){return await znt(),Lt.get(n)}function Prt(n){if(UFe.isOpen())return Lt.get(be).invokeFunction(n);const e=new Z,t=e.add(Bnt.event(()=>{t.dispose(),e.add(Lt.get(be).invokeFunction(n))}));return e}function z0e(n,e){const t=fo(n.editor)?Vs(n.editor):Object.create(null);return Object.assign(t,Vs(e)),t}function g7e(n,e){const t=z0e(n);if(fo(n.diffEditor)){const i=Vs(n.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=n.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,Vs(e)),t}function Frt(n){let e=class extends n{constructor(i,s={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=s,w=z0e(r.getValue(s.model?.uri),v);super(o,i,{...w,overflowWidgetsDomNode:p,dimension:m,theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f}),this.textResourceConfigurationService=r,this.optionsOverrides={},this.lastAppliedEditorOptions=w,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(y=>{const S=this.getModel()?.uri;S!=null&&y.affectsConfiguration(S,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const b=o.createChild(new Dl([Pe,this._contextKeyService])),C=this._register(b.createInstance(O7));this.onDidChangeModel(y=>{C.set(y.newModelUrl)}),C.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,s=this.textResourceConfigurationService.getValue(i);if(s==null)return;const o=z0e(s,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=f9(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),oE.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,be),_(3,dl)],e),e}const PJt=Frt(_Pe(k1)),FJt=Frt(_Pe(mF));let $0e=class extends _Pe(Zee){constructor(e,t={},i,s){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=g7e(s.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=s,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(s.onDidChangeConfiguration(f=>{const p=this._targetEditor.getModel()?.uri;p!=null&&(f.affectsConfiguration(p,"editor")||f.affectsConfiguration(p,"diffEditor")||f.affectsConfiguration(p,"accessibility.verbosity.diffEditor"))&&this.updateEditorConfiguration()})),this._register(this._targetEditor.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration()}updateEditorConfiguration(){if(this.getModel()==null||this.textResourceConfigurationService==null)return;const e=this._targetEditor.getModel()?.uri,t=this.textResourceConfigurationService.getValue(e);if(t==null)return;const i=g7e(t,this.optionsOverrides);let s=i;this.lastAppliedEditorOptions!=null&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(s))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(PJt,t,i)}};$0e=D([_(2,be),_(3,dl)],$0e);async function Ort(n,e){await(await Nrt(ci)).writeFile(n,ze.fromString(e))}async function OJt(n,e){return e!=null&&await Ort(n,e),await(await Nrt(Rn)).createModelReference(n)}function BJt(n){return n.registerKeybindingProvider!=null}let G0e=class extends x1{constructor(e,t,i,s,o,r,a){super(t,i,s,o,r,a),this.delegate=e,this._register(e.registerKeybindingProvider({provideKeybindings:()=>this.getUserKeybindingItems(),onDidChangeKeybindings:this.onDidUpdateKeybindings}))}_getResolver(){return this.delegate._getResolver()}resolveKeyboardEvent(e){return this.delegate.resolveKeyboardEvent(e)}resolveKeybinding(e){return this.delegate.resolveKeybinding(e)}resolveUserBinding(e){return this.delegate.resolveUserBinding(e)}_dumpDebugInfo(){return this.delegate._dumpDebugInfo()}_dumpDebugInfoJSON(){return this.delegate._dumpDebugInfoJSON()}registerSchemaContribution(e){return this.delegate.registerSchemaContribution(e)}enableKeybindingHoldMode(e){return this.delegate.enableKeybindingHoldMode(e)}};G0e=D([_(1,Pe),_(2,Qi),_(3,on),_(4,Pi),_(5,Ze),_(6,Qt)],G0e);let rme=null;function Brt(n){if(rme==null){const e=new Dl;e.set(On,new $i(R7,void 0,!0));const t=n.get(ti);!(t instanceof x1)&&BJt(t)&&e.set(ti,new $i(G0e,[t],!0)),rme=n.get(be).createChild(e)}return rme}const Wrt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance(FJt,n,e),WJt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance($0e,n,e);var HJt='.monaco-editor.standalone{--monaco-monospace-font:"SF Mono",Monaco,Menlo,Consolas,"Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;top:0;width:1px}.monaco-diff-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone [tabindex="-1"]:focus,.monaco-diff-editor.standalone [tabindex="0"]:focus,.monaco-diff-editor.standalone button:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone select:focus,.monaco-diff-editor.standalone textarea:focus,.monaco-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex="-1"]:focus,.monaco-editor.standalone [tabindex="0"]:focus,.monaco-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-editor.standalone textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}';Ct(HJt,{});var B4;(function(n){n[n.None=0]="None",n[n.Open=1]="Open",n[n.Close=-1]="Close"})(B4||(B4={}));function UJt(n){return Array.isArray(n)}function VJt(n){return!UJt(n)}function Hrt(n){return typeof n=="string"}function f7e(n){return!Hrt(n)}function UT(n){return!n}function xx(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function p7e(n){return n.replace(/[&<>'"_]/g,"-")}function zJt(n,e){console.log(`${n.languageId}: ${e}`)}function wr(n,e){return new Error(`${n.languageId}: ${e}`)}function xk(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,c,l,d,h,u,f,p,m){return UT(l)?UT(d)?!UT(h)&&h0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function GJt(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var q0e;const Urt=5,ule=class ule{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new cH(e,t);let i=cH.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new cH(e,t),this._entries[i]=s,s)}};ule._INSTANCE=new ule(Urt);let KG=ule;class cH{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return cH._equals(this,e)}push(e){return KG.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return KG.create(this.parent,e)}}class k2{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new k2(this.languageId,this.state)}}const gle=class gle{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new R8(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new R8(e,t);const i=cH.getStackElementId(e);let s=this._entries[i];return s||(s=new R8(e,null),this._entries[i]=s,s)}};gle._INSTANCE=new gle(Urt);let Dk=gle;class R8{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Dk.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof R8)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class qJt{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new A9(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=lc.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const c=a.tokenize(e,t,r);if(s!==0)for(const l of c.tokens)this._tokens.push(new A9(l.offset+s,l.type,l.language));else this._tokens=this._tokens.concat(c.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new tMe(this._tokens,e)}}class nre{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=lM.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|zi.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let c=0;c{if(r)return;let c=!1;for(let l=0,d=a.changedLanguages.length;l{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=lc.get(t);if(i){if(i instanceof q0e){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}lc.isResolved(t)||e.push(lc.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=KG.create(null,this._lexer.start);return Dk.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return aKe(this._languageId,i);const s=new qJt,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return yMe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new nre(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=gY(this._lexer,t.stack.state),!i))throw wr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!f7e(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const c=a.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(c.substr(4,c.length-5),d)}const l=e.search(a);l===-1||l!==0&&r.matchOnlyAtLineStart||(s===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const c=e.substring(r);return this._myTokenize(c,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` -`:e,c=a.length;let l=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h=c)break;f=!1;let N=this._lexer.tokenizer[w];if(!N&&(N=gY(this._lexer,w),!N))throw wr(this._lexer,"tokenizer state is not defined: "+w);const z=a.substr(h);for(const U of N)if((h===0||!U.matchOnlyAtLineStart)&&(b=z.match(U.resolveRegex(w)),b)){C=b[0],y=U.action;break}}if(b||(b=[""],C=""),y||(h=this._lexer.maxStack)throw wr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(w)}else if(y.next==="@pop"){if(d.depth<=1)throw wr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(y.next==="@popall")d=d.popall();else{let N=xk(this._lexer,y.next,C,b,w);if(N[0]==="@"&&(N=N.substr(1)),gY(this._lexer,N))d=d.push(N);else throw wr(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}y.log&&typeof y.log=="string"&&zJt(this._lexer,this._lexer.languageId+": "+xk(this._lexer,y.log,C,b,w))}if(k===null)throw wr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const F=N=>{const z=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,U=this._getNestedEmbeddedLanguageData(z);if(h0)throw wr(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==k.length+1)throw wr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let z=1;zn});class OOe{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const l=d=>{const h=jJt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,s).then(l,d=>console.error(d))}static async colorize(e,t,i,s){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),XRe(t)&&(t=t.substr(1));const a=xw(t);if(!e.isRegisteredLanguageId(i))return m7e(a,r,o);const c=await lc.getOrCreate(i);return c?KJt(a,r,c,o):m7e(a,r,o)}static colorizeLine(e,t,i,s,o=4){const r=Sm.isBasicASCII(e,t),a=Sm.containsRTL(e,r,i);return ede(new tL(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function KJt(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=YJt(n,e,t,i);if(t instanceof YG){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}s(a)};r()})}function m7e(n,e,t){let i=[];const s=(ar.None<>>0,o=new Uint32Array(2);o[0]=0,o[1]=s;for(let r=0,a=n.length;r")}return i.join("")}function YJt(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=l.endState}return s.join("")}function JJt(n,e,t){return Lt.initialize(t||{}).createInstance(mF,n,e)}function XJt(n){return Lt.get(Qt).onCodeEditorAdd(t=>{n(t)})}function ZJt(n){return Lt.get(Qt).onDiffEditorAdd(t=>{n(t)})}function eXt(){return Lt.get(Qt).listCodeEditors()}function tXt(){return Lt.get(Qt).listDiffEditors()}function iXt(n,e,t){return Lt.initialize(t||{}).createInstance(Zee,n,e)}function nXt(n,e){const t=Lt.initialize(e||{});return new FCe(n,{},t)}function sXt(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return yt.registerCommand(n.id,n.run)}function oXt(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=ge.deserialize(n.precondition),t=(s,...o)=>Yc.runEditorCommand(s,o,e,(r,a,c)=>Promise.resolve(n.run(a,...c))),i=new Z;if(i.add(yt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Xs.appendMenuItem(Te.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Lt.get(ti);if(!(s instanceof x1))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ge.and(e,ge.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function rXt(n){return Vrt([n])}function Vrt(n){const e=Lt.get(ti);return e instanceof x1?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ge.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None)}function aXt(n,e,t){const i=Lt.get(Di),s=i.getLanguageIdByMimeType(e)||e;return lZe(Lt.get(Ai),i,n,s,t)}function cXt(n,e){const t=Lt.get(Di),i=t.getLanguageIdByMimeType(e)||e||Kc;n.setLanguage(t.createById(i))}function lXt(n,e,t){n&&Lt.get(U_).changeOne(e,n.uri,t)}function dXt(n){Lt.get(U_).changeAll(n,[])}function hXt(n){return Lt.get(U_).read(n)}function uXt(n){return Lt.get(U_).onMarkerChanged(n)}function gXt(n){return Lt.get(Ai).getModel(n)}function fXt(){return Lt.get(Ai).getModels()}function pXt(n){return Lt.get(Ai).onModelAdded(n)}function mXt(n){return Lt.get(Ai).onModelRemoved(n)}function _Xt(n){return Lt.get(Ai).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function vXt(n){return Wpt(Lt.get(Ai),Lt.get(lo),n)}function wXt(n,e){const t=Lt.get(Di),i=Lt.get(Iw);return OOe.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function bXt(n,e,t){const i=Lt.get(Di);return Lt.get(Iw).registerEditorContainer(yi.document.body),OOe.colorize(i,n,e,t)}function CXt(n,e,t=4){return Lt.get(Iw).registerEditorContainer(yi.document.body),OOe.colorizeModelLine(n,e,t)}function yXt(n){const e=lc.get(n);return e||{getInitialState:()=>G9,tokenize:(t,i,s)=>aKe(n,s)}}function SXt(n,e){lc.getOrCreate(e);const t=yXt(e),i=xw(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const o=t.options?.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await n.openCodeEditor(i,t.resource,r)?i:null})}function LXt(){return{create:JJt,getEditors:eXt,getDiffEditors:tXt,onDidCreateEditor:XJt,onDidCreateDiffEditor:ZJt,createDiffEditor:iXt,addCommand:sXt,addEditorAction:oXt,addKeybindingRule:rXt,addKeybindingRules:Vrt,createModel:aXt,setModelLanguage:cXt,setModelMarkers:lXt,getModelMarkers:hXt,removeAllMarkers:dXt,onDidChangeMarkers:uXt,getModels:fXt,getModel:gXt,onDidCreateModel:pXt,onWillDisposeModel:mXt,onDidChangeModelLanguage:_Xt,createWebWorker:vXt,colorizeElement:wXt,colorize:bXt,colorizeModelLine:CXt,tokenize:SXt,defineTheme:AXt,setTheme:EXt,remeasureFonts:xXt,registerCommand:DXt,registerLinkOpener:kXt,registerEditorOpener:IXt,AccessibilitySupport:T_e,ContentWidgetPositionPreference:O_e,CursorChangeReason:B_e,DefaultEndOfLine:W_e,EditorAutoIndentStrategy:U_e,EditorOption:V_e,EndOfLinePreference:z_e,EndOfLineSequence:$_e,MinimapPosition:tve,MinimapSectionHeaderStyle:ive,MouseTargetType:nve,OverlayWidgetPositionPreference:rve,OverviewRulerLane:ave,GlyphMarginLane:G_e,RenderLineNumbersType:dve,RenderMinimap:hve,ScrollbarVisibility:gve,ScrollType:uve,TextEditorCursorBlinkingStyle:wve,TextEditorCursorStyle:bve,TrackedRangeStickiness:Cve,WrappingIndent:yve,InjectedTextCursorStops:j_e,PositionAffinity:lve,ShowLightbulbIconMode:pve,ConfigurationChangedEvent:kQe,BareFontInfo:Wk,FontInfo:QY,TextModelResolvedOptions:YY,FindMatch:z9,ApplyUpdateResult:a$,EditorZoom:l_,createMultiFileDiffEditor:nXt,EditorType:mz,EditorOptions:_u}}function TXt(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function fY(n,e){return typeof n=="boolean"?n:e}function _7e(n,e){return typeof n=="string"?n:e}function RXt(n){const e={};for(const t of n)e[t]=!0;return e}function v7e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=RXt(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function Q0e(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(r,a){s=!0;let c="";if(typeof n[a]=="string")c=n[a];else if(n[a]&&n[a]instanceof RegExp)c=n[a].source;else throw n[a]===void 0?wr(n,"language definition does not contain attribute '"+a+"', used at: "+e):wr(n,"attribute reference '"+a+"' must be a string, used at: "+e);return UT(c)?"":"(?:"+c+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const o=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,c=null;return l=>(c&&a===l||(a=l,c=new RegExp($Jt(n,e,l),o)),c)}return new RegExp(e,o)}function MXt(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=B4.Open;else if(t.bracket==="@close")i.bracket=B4.Close;else throw wr(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw wr(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!GJt(n,xk(n,s,"",[],""))))throw wr(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=Q0e(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=j0e(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function zrt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=fY(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=fY(e.ignoreCase,!1),t.unicode=fY(e.unicode,!1),t.tokenPostfix=_7e(e.tokenPostfix,"."+t.languageId),t.defaultToken=_7e(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw wr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw wr(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const h=new PXt(r);if(Array.isArray(l)&&l.length>=1&&l.length<=3)if(h.setRegex(i,l[0]),l.length>=3)if(typeof l[1]=="string")h.setAction(i,{token:l[1],next:l[2]});else if(typeof l[1]=="object"){const u=l[1];u.next=l[2],h.setAction(i,u)}else throw wr(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,l[1]);else{if(!l.regex)throw wr(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=fY(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw wr(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw wr(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw wr(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:xx(t,a.open),close:xx(t,a.close)});else throw wr(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function FXt(n){hM.registerLanguage(n)}function OXt(){let n=[];return n=n.concat(hM.getLanguages()),n}function BXt(n){return Lt.get(Di).languageIdCodec.encodeLanguageId(n)}function WXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function HXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function UXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Lt.get(lo).register(n,e,100)}class VXt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return JG.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new $le(s.tokens,s.endState)}}class JG{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;l===0?f=0:f{const i=await Promise.resolve(e.create());return i?zXt(i)?Grt(n,i):new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re)):null});return lc.registerFactory(n,t)}function qXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return $rt(e)?BOe(n,{create:()=>e}):lc.register(n,Grt(n,e))}function QXt(n,e){const t=i=>new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re));return $rt(e)?BOe(n,{create:()=>e}):lc.register(n,t(e))}function jXt(n,e){return Lt.get(ht).referenceProvider.register(n,e)}function KXt(n,e){return Lt.get(ht).renameProvider.register(n,e)}function YXt(n,e){return Lt.get(ht).newSymbolNamesProvider.register(n,e)}function JXt(n,e){return Lt.get(ht).signatureHelpProvider.register(n,e)}function XXt(n,e){return Lt.get(ht).hoverProvider.register(n,{provideHover:async(i,s,o,r)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new O(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),c.range||(c.range=new O(s.lineNumber,s.column,s.lineNumber,s.column)),c})}})}function ZXt(n,e){return Lt.get(ht).documentSymbolProvider.register(n,e)}function eZt(n,e){return Lt.get(ht).documentHighlightProvider.register(n,e)}function tZt(n,e){return Lt.get(ht).linkedEditingRangeProvider.register(n,e)}function iZt(n,e){return Lt.get(ht).definitionProvider.register(n,e)}function nZt(n,e){return Lt.get(ht).implementationProvider.register(n,e)}function sZt(n,e){return Lt.get(ht).typeDefinitionProvider.register(n,e)}function oZt(n,e){return Lt.get(ht).codeLensProvider.register(n,e)}function rZt(n,e,t){return Lt.get(ht).codeActionProvider.register(n,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(s,o,r,a)=>{const l=Lt.get(U_).read({resource:s.uri}).filter(d=>O.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function aZt(n,e){return Lt.get(ht).documentFormattingEditProvider.register(n,e)}function cZt(n,e){return Lt.get(ht).documentRangeFormattingEditProvider.register(n,e)}function lZt(n,e){return Lt.get(ht).onTypeFormattingEditProvider.register(n,e)}function dZt(n,e){return Lt.get(ht).linkProvider.register(n,e)}function hZt(n,e){return Lt.get(ht).completionProvider.register(n,e)}function uZt(n,e){return Lt.get(ht).colorProvider.register(n,e)}function gZt(n,e){return Lt.get(ht).foldingRangeProvider.register(n,e)}function fZt(n,e){return Lt.get(ht).declarationProvider.register(n,e)}function pZt(n,e){return Lt.get(ht).selectionRangeProvider.register(n,e)}function mZt(n,e){return Lt.get(ht).documentSemanticTokensProvider.register(n,e)}function _Zt(n,e){return Lt.get(ht).documentRangeSemanticTokensProvider.register(n,e)}function vZt(n,e){return Lt.get(ht).inlineCompletionsProvider.register(n,e)}function wZt(n,e){return Lt.get(ht).inlineEditProvider.register(n,e)}function bZt(n,e){return Lt.get(ht).inlayHintsProvider.register(n,e)}function CZt(){return{register:FXt,getLanguages:OXt,onLanguage:WXt,onLanguageEncountered:HXt,getEncodedLanguageId:BXt,setLanguageConfiguration:UXt,setColorMap:GXt,registerTokensProviderFactory:BOe,setTokensProvider:qXt,setMonarchTokensProvider:QXt,registerReferenceProvider:jXt,registerRenameProvider:KXt,registerNewSymbolNameProvider:YXt,registerCompletionItemProvider:hZt,registerSignatureHelpProvider:JXt,registerHoverProvider:XXt,registerDocumentSymbolProvider:ZXt,registerDocumentHighlightProvider:eZt,registerLinkedEditingRangeProvider:tZt,registerDefinitionProvider:iZt,registerImplementationProvider:nZt,registerTypeDefinitionProvider:sZt,registerCodeLensProvider:oZt,registerCodeActionProvider:rZt,registerDocumentFormattingEditProvider:aZt,registerDocumentRangeFormattingEditProvider:cZt,registerOnTypeFormattingEditProvider:lZt,registerLinkProvider:dZt,registerColorProvider:uZt,registerFoldingRangeProvider:gZt,registerDeclarationProvider:fZt,registerSelectionRangeProvider:pZt,registerDocumentSemanticTokensProvider:mZt,registerDocumentRangeSemanticTokensProvider:_Zt,registerInlineCompletionsProvider:vZt,registerInlineEditProvider:wZt,registerInlayHintsProvider:bZt,DocumentHighlightKind:H_e,CompletionItemKind:N_e,CompletionItemTag:P_e,CompletionItemInsertTextRule:M_e,SymbolKind:_ve,SymbolTag:vve,IndentAction:Q_e,CompletionTriggerKind:F_e,SignatureHelpTriggerKind:mve,InlayHintKind:K_e,InlineCompletionTriggerKind:Y_e,InlineEditTriggerKind:J_e,CodeActionTriggerType:R_e,NewSymbolNameTag:sve,NewSymbolNameTriggerKind:ove,PartialAcceptTriggerKind:cve,HoverVerbosityAction:q_e,FoldingRangeKind:yv,SelectedSuggestionInfo:OQe}}_u.wrappingIndent.defaultValue=Vg.None;_u.glyphMargin.defaultValue=!1;_u.autoIndent.defaultValue=ed.Advanced;_u.overviewRulerLanes.defaultValue=2;gV.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Ag=WQe();Ag.editor=LXt();Ag.languages=CZt();Ag.CancellationTokenSource;Ag.Emitter;Ag.KeyCode;Ag.KeyMod;const qrt=Ag.Position;Ag.Range;Ag.Selection;Ag.SelectionDirection;Ag.MarkerSeverity;Ag.MarkerTag;const Pv=Ag.Uri;Ag.Token;const pd=Ag.editor,QM=Ag.languages,yZt=globalThis.MonacoEnvironment;(yZt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ag);const SZt=QM.onLanguage;QM.onLanguage=(n,e)=>Prt(()=>SZt(n,e));const AZt=QM.onLanguage;QM.onLanguageEncountered=(n,e)=>Prt(()=>AZt(n,e));pd.create=Wrt;pd.createDiffEditor=WJt;pd.createModelReference=OJt;pd.writeFile=Ort;const EZt={defaultToken:"invalid",root_keywords:["import","from","export","global","component","struct","inherits"],inner_keywords:["property","callback","animate","states","transitions","if","for","in","out","in-out","private","function","pure","public"],lang_keywords:["root","parent","this","if"],type_keywords:["int","string","float","length","physical_length","duration","color","brush"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,symbols:/[#!%&*+\-./:;<=>@^|_?,()]+/,tokenizer:{root:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@root_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@inner"],[/@symbols/,""]],inner:[[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:=/,"variable.parameter"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:\s*\{/,"variable.parameter","@binding_1"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:/,"variable.parameter","@binding_0"],[/[a-zA-Z_][a-zA-Z0-9_-]*/,{cases:{"@inner_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/:=/,""],[/<=>/,"","@binding_0"],[/=>\s*{/,"","@binding_1"],[//,"","@pop"],[/@symbols/,""]],binding_0:[{include:"@whitespace"},[/\{/,"","@binding_1"],[/;/,"","@pop"],[/\}/,"","@pop"],[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@numbers"},[/"/,"string","@string"],[/@symbols/,""]],binding_1:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/\[/,"","@push"],[/\]/,"","@pop"],[/@symbols/,""]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],numbers:[[/\d+(\.\d+)?\w*/,{token:"number"}],[/#[0-9a-fA-F]+/,{token:"number"}]]}};var K0e;(function(n){function e(t){return typeof t=="string"}n.is=e})(K0e||(K0e={}));var sre;(function(n){function e(t){return typeof t=="string"}n.is=e})(sre||(sre={}));var Y0e;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Y0e||(Y0e={}));var XG;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(XG||(XG={}));var Lv;(function(n){function e(i,s){return i===Number.MAX_VALUE&&(i=XG.MAX_VALUE),s===Number.MAX_VALUE&&(s=XG.MAX_VALUE),{line:i,character:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&We.uinteger(s.line)&&We.uinteger(s.character)}n.is=t})(Lv||(Lv={}));var nd;(function(n){function e(i,s,o,r){if(We.uinteger(i)&&We.uinteger(s)&&We.uinteger(o)&&We.uinteger(r))return{start:Lv.create(i,s),end:Lv.create(o,r)};if(Lv.is(i)&&Lv.is(s))return{start:i,end:s};throw new Error(`Range#create called with invalid arguments[${i}, ${s}, ${o}, ${r}]`)}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&Lv.is(s.start)&&Lv.is(s.end)}n.is=t})(nd||(nd={}));var ZG;(function(n){function e(i,s){return{uri:i,range:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(We.string(s.uri)||We.undefined(s.uri))}n.is=t})(ZG||(ZG={}));var J0e;(function(n){function e(i,s,o,r){return{targetUri:i,targetRange:s,targetSelectionRange:o,originSelectionRange:r}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.targetRange)&&We.string(s.targetUri)&&nd.is(s.targetSelectionRange)&&(nd.is(s.originSelectionRange)||We.undefined(s.originSelectionRange))}n.is=t})(J0e||(J0e={}));var ore;(function(n){function e(i,s,o,r){return{red:i,green:s,blue:o,alpha:r}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.numberRange(s.red,0,1)&&We.numberRange(s.green,0,1)&&We.numberRange(s.blue,0,1)&&We.numberRange(s.alpha,0,1)}n.is=t})(ore||(ore={}));var X0e;(function(n){function e(i,s){return{range:i,color:s}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&nd.is(s.range)&&ore.is(s.color)}n.is=t})(X0e||(X0e={}));var Z0e;(function(n){function e(i,s,o){return{label:i,textEdit:s,additionalTextEdits:o}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.undefined(s.textEdit)||xS.is(s))&&(We.undefined(s.additionalTextEdits)||We.typedArray(s.additionalTextEdits,xS.is))}n.is=t})(Z0e||(Z0e={}));var e1e;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(e1e||(e1e={}));var t1e;(function(n){function e(i,s,o,r,a,c){const l={startLine:i,endLine:s};return We.defined(o)&&(l.startCharacter=o),We.defined(r)&&(l.endCharacter=r),We.defined(a)&&(l.kind=a),We.defined(c)&&(l.collapsedText=c),l}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.uinteger(s.startLine)&&We.uinteger(s.startLine)&&(We.undefined(s.startCharacter)||We.uinteger(s.startCharacter))&&(We.undefined(s.endCharacter)||We.uinteger(s.endCharacter))&&(We.undefined(s.kind)||We.string(s.kind))}n.is=t})(t1e||(t1e={}));var rre;(function(n){function e(i,s){return{location:i,message:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&ZG.is(s.location)&&We.string(s.message)}n.is=t})(rre||(rre={}));var i1e;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(i1e||(i1e={}));var n1e;(function(n){n.Unnecessary=1,n.Deprecated=2})(n1e||(n1e={}));var s1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&We.string(i.href)}n.is=e})(s1e||(s1e={}));var eq;(function(n){function e(i,s,o,r,a,c){let l={range:i,message:s};return We.defined(o)&&(l.severity=o),We.defined(r)&&(l.code=r),We.defined(a)&&(l.source=a),We.defined(c)&&(l.relatedInformation=c),l}n.create=e;function t(i){var s;let o=i;return We.defined(o)&&nd.is(o.range)&&We.string(o.message)&&(We.number(o.severity)||We.undefined(o.severity))&&(We.integer(o.code)||We.string(o.code)||We.undefined(o.code))&&(We.undefined(o.codeDescription)||We.string((s=o.codeDescription)===null||s===void 0?void 0:s.href))&&(We.string(o.source)||We.undefined(o.source))&&(We.undefined(o.relatedInformation)||We.typedArray(o.relatedInformation,rre.is))}n.is=t})(eq||(eq={}));var JF;(function(n){function e(i,s,...o){let r={title:i,command:s};return We.defined(o)&&o.length>0&&(r.arguments=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.title)&&We.string(s.command)}n.is=t})(JF||(JF={}));var xS;(function(n){function e(o,r){return{range:o,newText:r}}n.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}n.insert=t;function i(o){return{range:o,newText:""}}n.del=i;function s(o){const r=o;return We.objectLiteral(r)&&We.string(r.newText)&&nd.is(r.range)}n.is=s})(xS||(xS={}));var jM;(function(n){function e(i,s,o){const r={label:i};return s!==void 0&&(r.needsConfirmation=s),o!==void 0&&(r.description=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(We.string(s.description)||s.description===void 0)}n.is=t})(jM||(jM={}));var Ju;(function(n){function e(t){const i=t;return We.string(i)}n.is=e})(Ju||(Ju={}));var qA;(function(n){function e(o,r,a){return{range:o,newText:r,annotationId:a}}n.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}n.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}n.del=i;function s(o){const r=o;return xS.is(r)&&(jM.is(r.annotationId)||Ju.is(r.annotationId))}n.is=s})(qA||(qA={}));var tq;(function(n){function e(i,s){return{textDocument:i,edits:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&iq.is(s.textDocument)&&Array.isArray(s.edits)}n.is=t})(tq||(tq={}));var W4;(function(n){function e(i,s,o){let r={kind:"create",uri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="create"&&We.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(W4||(W4={}));var H4;(function(n){function e(i,s,o,r){let a={kind:"rename",oldUri:i,newUri:s};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}n.create=e;function t(i){let s=i;return s&&s.kind==="rename"&&We.string(s.oldUri)&&We.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(H4||(H4={}));var U4;(function(n){function e(i,s,o){let r={kind:"delete",uri:i};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="delete"&&We.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||We.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||We.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(U4||(U4={}));var are;(function(n){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(s=>We.string(s.kind)?W4.is(s)||H4.is(s)||U4.is(s):tq.is(s)))}n.is=e})(are||(are={}));class pY{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let s,o;if(i===void 0?s=xS.insert(e,t):Ju.is(i)?(o=i,s=qA.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.insert(e,t,o)),this.edits.push(s),o!==void 0)return o}replace(e,t,i){let s,o;if(i===void 0?s=xS.replace(e,t):Ju.is(i)?(o=i,s=qA.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.replace(e,t,o)),this.edits.push(s),o!==void 0)return o}delete(e,t){let i,s;if(t===void 0?i=xS.del(e):Ju.is(t)?(s=t,i=qA.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(t),i=qA.del(e,s)),this.edits.push(i),s!==void 0)return s}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class w7e{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let i;if(Ju.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error(`Id ${i} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${i}`);return this._annotations[i]=t,this._size++,i}nextId(){return this._counter++,this._counter.toString()}}class xZt{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new w7e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(tq.is(t)){const i=new pY(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new pY(e.changes[t]);this._textEditChanges[t]=i})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(iq.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let i=this._textEditChanges[t.uri];if(!i){const s=[],o={textDocument:t,edits:s};this._workspaceEdit.documentChanges.push(o),i=new pY(s,this._changeAnnotations),this._textEditChanges[t.uri]=i}return i}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let i=[];this._workspaceEdit.changes[e]=i,t=new pY(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new w7e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=W4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=W4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;jM.is(i)||Ju.is(i)?o=i:s=i;let r,a;if(o===void 0?r=H4.create(e,t,s):(a=Ju.is(o)?o:this._changeAnnotations.manage(o),r=H4.create(e,t,s,a)),this._workspaceEdit.documentChanges.push(r),a!==void 0)return a}deleteFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=U4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=U4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var o1e;(function(n){function e(i){return{uri:i}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)}n.is=t})(o1e||(o1e={}));var r1e;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.integer(s.version)}n.is=t})(r1e||(r1e={}));var iq;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&(s.version===null||We.integer(s.version))}n.is=t})(iq||(iq={}));var a1e;(function(n){function e(i,s,o,r){return{uri:i,languageId:s,version:o,text:r}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.string(s.languageId)&&We.integer(s.version)&&We.string(s.text)}n.is=t})(a1e||(a1e={}));var cre;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const i=t;return i===n.PlainText||i===n.Markdown}n.is=e})(cre||(cre={}));var V4;(function(n){function e(t){const i=t;return We.objectLiteral(t)&&cre.is(i.kind)&&We.string(i.value)}n.is=e})(V4||(V4={}));var c1e;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(c1e||(c1e={}));var l1e;(function(n){n.PlainText=1,n.Snippet=2})(l1e||(l1e={}));var d1e;(function(n){n.Deprecated=1})(d1e||(d1e={}));var h1e;(function(n){function e(i,s,o){return{newText:i,insert:s,replace:o}}n.create=e;function t(i){const s=i;return s&&We.string(s.newText)&&nd.is(s.insert)&&nd.is(s.replace)}n.is=t})(h1e||(h1e={}));var u1e;(function(n){n.asIs=1,n.adjustIndentation=2})(u1e||(u1e={}));var g1e;(function(n){function e(t){const i=t;return i&&(We.string(i.detail)||i.detail===void 0)&&(We.string(i.description)||i.description===void 0)}n.is=e})(g1e||(g1e={}));var f1e;(function(n){function e(t){return{label:t}}n.create=e})(f1e||(f1e={}));var p1e;(function(n){function e(t,i){return{items:t||[],isIncomplete:!!i}}n.create=e})(p1e||(p1e={}));var nq;(function(n){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(i){const s=i;return We.string(s)||We.objectLiteral(s)&&We.string(s.language)&&We.string(s.value)}n.is=t})(nq||(nq={}));var m1e;(function(n){function e(t){let i=t;return!!i&&We.objectLiteral(i)&&(V4.is(i.contents)||nq.is(i.contents)||We.typedArray(i.contents,nq.is))&&(t.range===void 0||nd.is(t.range))}n.is=e})(m1e||(m1e={}));var _1e;(function(n){function e(t,i){return i?{label:t,documentation:i}:{label:t}}n.create=e})(_1e||(_1e={}));var v1e;(function(n){function e(t,i,...s){let o={label:t};return We.defined(i)&&(o.documentation=i),We.defined(s)?o.parameters=s:o.parameters=[],o}n.create=e})(v1e||(v1e={}));var w1e;(function(n){n.Text=1,n.Read=2,n.Write=3})(w1e||(w1e={}));var b1e;(function(n){function e(t,i){let s={range:t};return We.number(i)&&(s.kind=i),s}n.create=e})(b1e||(b1e={}));var C1e;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(C1e||(C1e={}));var y1e;(function(n){n.Deprecated=1})(y1e||(y1e={}));var S1e;(function(n){function e(t,i,s,o,r){let a={name:t,kind:i,location:{uri:o,range:s}};return r&&(a.containerName=r),a}n.create=e})(S1e||(S1e={}));var A1e;(function(n){function e(t,i,s,o){return o!==void 0?{name:t,kind:i,location:{uri:s,range:o}}:{name:t,kind:i,location:{uri:s}}}n.create=e})(A1e||(A1e={}));var E1e;(function(n){function e(i,s,o,r,a,c){let l={name:i,detail:s,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}n.create=e;function t(i){let s=i;return s&&We.string(s.name)&&We.number(s.kind)&&nd.is(s.range)&&nd.is(s.selectionRange)&&(s.detail===void 0||We.string(s.detail))&&(s.deprecated===void 0||We.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}n.is=t})(E1e||(E1e={}));var x1e;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(x1e||(x1e={}));var sq;(function(n){n.Invoked=1,n.Automatic=2})(sq||(sq={}));var D1e;(function(n){function e(i,s,o){let r={diagnostics:i};return s!=null&&(r.only=s),o!=null&&(r.triggerKind=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.typedArray(s.diagnostics,eq.is)&&(s.only===void 0||We.typedArray(s.only,We.string))&&(s.triggerKind===void 0||s.triggerKind===sq.Invoked||s.triggerKind===sq.Automatic)}n.is=t})(D1e||(D1e={}));var k1e;(function(n){function e(i,s,o){let r={title:i},a=!0;return typeof s=="string"?(a=!1,r.kind=s):JF.is(s)?r.command=s:r.edit=s,a&&o!==void 0&&(r.kind=o),r}n.create=e;function t(i){let s=i;return s&&We.string(s.title)&&(s.diagnostics===void 0||We.typedArray(s.diagnostics,eq.is))&&(s.kind===void 0||We.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||JF.is(s.command))&&(s.isPreferred===void 0||We.boolean(s.isPreferred))&&(s.edit===void 0||are.is(s.edit))}n.is=t})(k1e||(k1e={}));var I1e;(function(n){function e(i,s){let o={range:i};return We.defined(s)&&(o.data=s),o}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.command)||JF.is(s.command))}n.is=t})(I1e||(I1e={}));var L1e;(function(n){function e(i,s){return{tabSize:i,insertSpaces:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.uinteger(s.tabSize)&&We.boolean(s.insertSpaces)}n.is=t})(L1e||(L1e={}));var T1e;(function(n){function e(i,s,o){return{range:i,target:s,data:o}}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.target)||We.string(s.target))}n.is=t})(T1e||(T1e={}));var R1e;(function(n){function e(i,s){return{range:i,parent:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(s.parent===void 0||n.is(s.parent))}n.is=t})(R1e||(R1e={}));var M1e;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(M1e||(M1e={}));var N1e;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(N1e||(N1e={}));var P1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}n.is=e})(P1e||(P1e={}));var F1e;(function(n){function e(i,s){return{range:i,text:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.string(s.text)}n.is=t})(F1e||(F1e={}));var O1e;(function(n){function e(i,s,o){return{range:i,variableName:s,caseSensitiveLookup:o}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.boolean(s.caseSensitiveLookup)&&(We.string(s.variableName)||s.variableName===void 0)}n.is=t})(O1e||(O1e={}));var B1e;(function(n){function e(i,s){return{range:i,expression:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&(We.string(s.expression)||s.expression===void 0)}n.is=t})(B1e||(B1e={}));var W1e;(function(n){function e(i,s){return{frameId:i,stoppedLocation:s}}n.create=e;function t(i){const s=i;return We.defined(s)&&nd.is(i.stoppedLocation)}n.is=t})(W1e||(W1e={}));var lre;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(lre||(lre={}));var dre;(function(n){function e(i){return{value:i}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.location===void 0||ZG.is(s.location))&&(s.command===void 0||JF.is(s.command))}n.is=t})(dre||(dre={}));var H1e;(function(n){function e(i,s,o){const r={position:i,label:s};return o!==void 0&&(r.kind=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&Lv.is(s.position)&&(We.string(s.label)||We.typedArray(s.label,dre.is))&&(s.kind===void 0||lre.is(s.kind))&&s.textEdits===void 0||We.typedArray(s.textEdits,xS.is)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.paddingLeft===void 0||We.boolean(s.paddingLeft))&&(s.paddingRight===void 0||We.boolean(s.paddingRight))}n.is=t})(H1e||(H1e={}));var U1e;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(U1e||(U1e={}));var V1e;(function(n){function e(t,i,s,o){return{insertText:t,filterText:i,range:s,command:o}}n.create=e})(V1e||(V1e={}));var z1e;(function(n){function e(t){return{items:t}}n.create=e})(z1e||(z1e={}));var $1e;(function(n){n.Invoked=0,n.Automatic=1})($1e||($1e={}));var G1e;(function(n){function e(t,i){return{range:t,text:i}}n.create=e})(G1e||(G1e={}));var q1e;(function(n){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}n.create=e})(q1e||(q1e={}));var Q1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&sre.is(i.uri)&&We.string(i.name)}n.is=e})(Q1e||(Q1e={}));const DZt=[` +${r}`)}}};F0e=D([_(0,EQ),_(1,ci)],F0e);var O0e;let ire=O0e=class{constructor(e,t,i,s){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=s,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||$c)(),this.resolveUserHome=(async()=>{const o=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=o?.userHome??e})()}hasValidBasename(e,t,i){return typeof t=="string"||typeof t>"u"?this.resolveOS.then(s=>this.doHasValidBasename(e,s,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===_e.file||e.scheme===_e.vscodeRemote?VQe(i??ui(e),t===Pr.Windows):!0}get defaultUriScheme(){return O0e.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return _e.vscodeRemote;const i=v5t(t.getWorkspace());if(i)return i;const s=t.getWorkspace().folders[0];if(s)return s.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:_e.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Pr.Windows?Gc:Qi)}async fileURI(e){let t="";if(await this.resolveOS===Pr.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const s=e.indexOf("/",2);s===-1?(t=e.substring(2),e="/"):(t=e.substring(2,s),e=e.substring(s)||"/")}return P.from({scheme:_e.file,authority:t,path:e,query:"",fragment:""})}};ire=O0e=D([_(1,Sf),_(2,Za),_(3,Ti)],ire);function IJt(n,e){const t=e.getWorkspace(),i=k_(t.folders);return i?i.uri:t.configuration?ma(t.configuration):P.from({scheme:ire.findDefaultUriScheme(n,e),authority:n.remoteAuthority,path:"/"})}class LJt{constructor(){this.todo=[],this.add=e=>{this.todo.push(e)}}take(e,t){this.add=i=>t.createInstance(i,e),this.todo.forEach(this.add),this.todo=[]}}const TJt=new LJt;let B0e=class extends ${constructor(e){super(),this.markInactive=this._register(new yn(()=>{this.isActive=!1,this.changeEmitter.fire(!1)},1e4)),this.changeEmitter=this._register(new I),this.active=0,this.isActive=!0,this.onDidChangeIsActive=this.changeEmitter.event,this._register(PU(()=>TJt.take(this,e)))}markActive(){return++this.active===1&&(this.isActive=!0,this.changeEmitter.fire(!0),this.markInactive.cancel()),Ee(()=>{--this.active===0&&this.markInactive.schedule()})}};B0e=D([_(0,be)],B0e);let W0e=class extends ${constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new td}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,s){const o=this.configurationService.getValue("files.participants.timeout");if(!(typeof o!="number"||o<=0))for(const r of this.participants)try{await r.participate(e,t,i,o,s)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};W0e=D([_(0,Ze),_(1,Re)],W0e);const RJt="vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant";let H0e=class extends ${get length(){return this.saveParticipants.length}constructor(e,t){super(),this.progressService=e,this.logService=t,this.saveParticipants=[]}addSaveParticipant(e){const t=FRe(this.saveParticipants,e);return Ee(()=>t())}participate(e,t,i){const s=new ai(i);return this.progressService.withProgress({title:g(RJt,0,"Saving '{0}'",e.name),location:ch.Notification,cancellable:!0,delay:e.isDirty()?3e3:5e3},async o=>{e.model?.pushStackElement();for(const r of this.saveParticipants){if(s.token.isCancellationRequested||e.isDisposed())break;try{const a=r.participate(e,t,o,s.token);await dw(a,s.token)}catch(a){this.logService.warn(a)}}e.model?.pushStackElement(),s.dispose()},()=>{s.dispose(!0)})}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};H0e=D([_(0,Cf),_(1,Ze)],H0e);let U0e=class extends ${constructor(e,t,i,s){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=s,this._onWillRunWorkingCopyFileOperation=this._register(new EI),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new EI),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new EI),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(W0e)),this.saveParticipants=this._register(this.instantiationService.createInstance(H0e)),this.workingCopyProviders=[],this._register(this.registerWorkingCopyProvider(o=>this.workingCopyService.workingCopies.filter(r=>this.fileService.hasProvider(o)?this.uriIdentityService.extUri.isEqualOrParent(r.resource,o):this.uriIdentityService.extUri.isEqual(r.resource,o))))}create(e,t,i){return this.doCreateFileOrFolder(e,!0,t,i)}createFolder(e,t,i){return this.doCreateFileOrFolder(e,!1,t,i)}async doCreateFileOrFolder(e,t,i,s){if(e.length===0)return[];if(t){const l=(await ko.settled(e.map(d=>this.fileService.canCreateFile(d.resource,{overwrite:d.overwrite})))).find(d=>d instanceof Error);if(l instanceof Error)throw l}const o=e.map(c=>({target:c.resource}));await this.runFileOperationParticipants(o,Li.CREATE,s,i);const r={correlationId:this.correlationIds++,operation:Li.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,qe.None);let a;try{t?a=await ko.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await ko.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,qe.None),a}async move(e,t,i){return this.doMoveOrCopy(e,!0,t,i)}async copy(e,t,i){return this.doMoveOrCopy(e,!1,t,i)}async doMoveOrCopy(e,t,i,s){const o=[];for(const{file:{source:c,target:l},overwrite:d}of e){const h=await(t?this.fileService.canMove(c,l,d):this.fileService.canCopy(c,l,d));if(h instanceof Error)throw h}const r=e.map(c=>c.file);await this.runFileOperationParticipants(r,t?Li.MOVE:Li.COPY,s,i);const a={correlationId:this.correlationIds++,operation:t?Li.MOVE:Li.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,qe.None);try{for(const{file:{source:c,target:l},overwrite:d}of e){if(!this.uriIdentityService.extUri.isEqual(c,l)){const h=t?[...this.getDirty(c),...this.getDirty(l)]:this.getDirty(l);await ko.settled(h.map(u=>u.revert({soft:!0})))}t?o.push(await this.fileService.move(c,l,d)):o.push(await this.fileService.copy(c,l,d))}}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(a,qe.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,qe.None),o}async delete(e,t,i){for(const r of e){const a=await this.fileService.canDelete(r.resource,{recursive:r.recursive,useTrash:r.useTrash});if(a instanceof Error)throw a}const s=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(s,Li.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Li.DELETE,files:s};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,qe.None);for(const r of e){const a=this.getDirty(r.resource);await ko.settled(a.map(c=>c.revert({soft:!0})))}try{for(const r of e)await this.fileService.del(r.resource,{recursive:r.recursive,useTrash:r.useTrash})}catch(r){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(o,qe.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,qe.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,s){return this.fileOperationParticipants.participate(e,t,i,s)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i){return this.saveParticipants.participate(e,t,i)}registerWorkingCopyProvider(e){const t=FRe(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const s of i(e))s.isDirty()&&t.add(s);return Array.from(t)}};U0e=D([_(0,ci),_(1,Pw),_(2,be),_(3,_o)],U0e);let V0e=class extends ire{constructor(e,t,i){super(T4t().userHome??IJt(t,i),e,t,i)}};V0e=D([_(0,Sf),_(1,Za),_(2,Ti)],V0e);function MJt(){return{[EQ.toString()]:new Gi(N0e,[],!0),[wPe.toString()]:new Gi(F0e,[],!0),[rD.toString()]:new Gi(R0e,[],!0),[dL.toString()]:new Gi(T0e,[],!0),[zde.toString()]:new Gi(vPe,[],!0),[jde.toString()]:new Gi(P0e,[],!0),[SPe.toString()]:new Gi(kJt,[],!1),[BPe.toString()]:new Gi(B0e,[],!0),[fC.toString()]:new Gi(U0e,[],!1),[Lm.toString()]:new Gi(V0e,[],!0),[lhe.toString()]:new Gi(cDe,[],!0)}}var h7e;(function(n){n[n.NONE=0]="NONE",n[n.EDITS=1]="EDITS",n[n.NAVIGATION=2]="NAVIGATION"})(h7e||(h7e={}));var u7e;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.EDITOR_GROUP=1]="EDITOR_GROUP",n[n.EDITOR=2]="EDITOR"})(u7e||(u7e={}));async function NJt(n,e=document.body,t={},i){B4t(),M4t(e,t,i);const s=Lt.initialize({[Ja.toString()]:ym({version:"1.90.2",quality:"stable",commit:"5437499feb04f7a586f677b155b039bc2b3669eb",nameShort:"Code - OSS",nameLong:"Code - OSS",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",serverApplicationName:"code-server-oss"},t.productConfiguration??{}),...cJt(),...aJt(),...rJt(),...lOe(),...P$t(),...dJt(),...MJt(),...n});await O4t(s)}async function Nrt(n){return await znt(),Lt.get(n)}function Prt(n){if(UFe.isOpen())return Lt.get(be).invokeFunction(n);const e=new Z,t=e.add(Bnt.event(()=>{t.dispose(),e.add(Lt.get(be).invokeFunction(n))}));return e}function z0e(n,e){const t=fo(n.editor)?Vs(n.editor):Object.create(null);return Object.assign(t,Vs(e)),t}function g7e(n,e){const t=z0e(n);if(fo(n.diffEditor)){const i=Vs(n.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=n.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,Vs(e)),t}function Frt(n){let e=class extends n{constructor(i,s={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=s,w=z0e(r.getValue(s.model?.uri),v);super(o,i,{...w,overflowWidgetsDomNode:p,dimension:m,theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f}),this.textResourceConfigurationService=r,this.optionsOverrides={},this.lastAppliedEditorOptions=w,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(y=>{const S=this.getModel()?.uri;S!=null&&y.affectsConfiguration(S,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const b=o.createChild(new Dl([Pe,this._contextKeyService])),C=this._register(b.createInstance(O7));this.onDidChangeModel(y=>{C.set(y.newModelUrl)}),C.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,s=this.textResourceConfigurationService.getValue(i);if(s==null)return;const o=z0e(s,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=f9(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),oE.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,be),_(3,dl)],e),e}const PJt=Frt(_Pe(k1)),FJt=Frt(_Pe(mF));let $0e=class extends _Pe(Zee){constructor(e,t={},i,s){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=g7e(s.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=s,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(s.onDidChangeConfiguration(f=>{const p=this._targetEditor.getModel()?.uri;p!=null&&(f.affectsConfiguration(p,"editor")||f.affectsConfiguration(p,"diffEditor")||f.affectsConfiguration(p,"accessibility.verbosity.diffEditor"))&&this.updateEditorConfiguration()})),this._register(this._targetEditor.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration()}updateEditorConfiguration(){if(this.getModel()==null||this.textResourceConfigurationService==null)return;const e=this._targetEditor.getModel()?.uri,t=this.textResourceConfigurationService.getValue(e);if(t==null)return;const i=g7e(t,this.optionsOverrides);let s=i;this.lastAppliedEditorOptions!=null&&(s=f9(this.lastAppliedEditorOptions,s)),Object.keys(s).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(s))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(PJt,t,i)}};$0e=D([_(2,be),_(3,dl)],$0e);async function Ort(n,e){await(await Nrt(ci)).writeFile(n,ze.fromString(e))}async function OJt(n,e){return e!=null&&await Ort(n,e),await(await Nrt(Rn)).createModelReference(n)}function BJt(n){return n.registerKeybindingProvider!=null}let G0e=class extends x1{constructor(e,t,i,s,o,r,a){super(t,i,s,o,r,a),this.delegate=e,this._register(e.registerKeybindingProvider({provideKeybindings:()=>this.getUserKeybindingItems(),onDidChangeKeybindings:this.onDidUpdateKeybindings}))}_getResolver(){return this.delegate._getResolver()}resolveKeyboardEvent(e){return this.delegate.resolveKeyboardEvent(e)}resolveKeybinding(e){return this.delegate.resolveKeybinding(e)}resolveUserBinding(e){return this.delegate.resolveUserBinding(e)}_dumpDebugInfo(){return this.delegate._dumpDebugInfo()}_dumpDebugInfoJSON(){return this.delegate._dumpDebugInfoJSON()}registerSchemaContribution(e){return this.delegate.registerSchemaContribution(e)}enableKeybindingHoldMode(e){return this.delegate.enableKeybindingHoldMode(e)}};G0e=D([_(1,Pe),_(2,ji),_(3,rn),_(4,Pi),_(5,Ze),_(6,jt)],G0e);let rme=null;function Brt(n){if(rme==null){const e=new Dl;e.set(On,new Gi(R7,void 0,!0));const t=n.get(ti);!(t instanceof x1)&&BJt(t)&&e.set(ti,new Gi(G0e,[t],!0)),rme=n.get(be).createChild(e)}return rme}const Wrt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance(FJt,n,e),WJt=(n,e,t)=>Lt.initialize(t??{}).invokeFunction(Brt).createInstance($0e,n,e);var HJt='.monaco-editor.standalone{--monaco-monospace-font:"SF Mono",Monaco,Menlo,Consolas,"Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;top:0;width:1px}.monaco-diff-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone [tabindex="-1"]:focus,.monaco-diff-editor.standalone [tabindex="0"]:focus,.monaco-diff-editor.standalone button:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone select:focus,.monaco-diff-editor.standalone textarea:focus,.monaco-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex="-1"]:focus,.monaco-editor.standalone [tabindex="0"]:focus,.monaco-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-editor.standalone textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}';Ct(HJt,{});var B4;(function(n){n[n.None=0]="None",n[n.Open=1]="Open",n[n.Close=-1]="Close"})(B4||(B4={}));function UJt(n){return Array.isArray(n)}function VJt(n){return!UJt(n)}function Hrt(n){return typeof n=="string"}function f7e(n){return!Hrt(n)}function UT(n){return!n}function xx(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function p7e(n){return n.replace(/[&<>'"_]/g,"-")}function zJt(n,e){console.log(`${n.languageId}: ${e}`)}function wr(n,e){return new Error(`${n.languageId}: ${e}`)}function xk(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,c,l,d,h,u,f,p,m){return UT(l)?UT(d)?!UT(h)&&h0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function GJt(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var q0e;const Urt=5,ule=class ule{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new cH(e,t);let i=cH.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new cH(e,t),this._entries[i]=s,s)}};ule._INSTANCE=new ule(Urt);let KG=ule;class cH{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return cH._equals(this,e)}push(e){return KG.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return KG.create(this.parent,e)}}class k2{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new k2(this.languageId,this.state)}}const gle=class gle{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new R8(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new R8(e,t);const i=cH.getStackElementId(e);let s=this._entries[i];return s||(s=new R8(e,null),this._entries[i]=s,s)}};gle._INSTANCE=new gle(Urt);let Dk=gle;class R8{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Dk.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof R8)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class qJt{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new A9(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=dc.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const c=a.tokenize(e,t,r);if(s!==0)for(const l of c.tokens)this._tokens.push(new A9(l.offset+s,l.type,l.language));else this._tokens=this._tokens.concat(c.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new tMe(this._tokens,e)}}class nre{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=lM.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|$i.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let c=0;c{if(r)return;let c=!1;for(let l=0,d=a.changedLanguages.length;l{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=dc.get(t);if(i){if(i instanceof q0e){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}dc.isResolved(t)||e.push(dc.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=KG.create(null,this._lexer.start);return Dk.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return aKe(this._languageId,i);const s=new qJt,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return yMe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new nre(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=gY(this._lexer,t.stack.state),!i))throw wr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!f7e(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const c=a.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(c.substr(4,c.length-5),d)}const l=e.search(a);l===-1||l!==0&&r.matchOnlyAtLineStart||(s===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const c=e.substring(r);return this._myTokenize(c,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,c=a.length;let l=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h=c)break;f=!1;let N=this._lexer.tokenizer[w];if(!N&&(N=gY(this._lexer,w),!N))throw wr(this._lexer,"tokenizer state is not defined: "+w);const z=a.substr(h);for(const U of N)if((h===0||!U.matchOnlyAtLineStart)&&(b=z.match(U.resolveRegex(w)),b)){C=b[0],y=U.action;break}}if(b||(b=[""],C=""),y||(h=this._lexer.maxStack)throw wr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(w)}else if(y.next==="@pop"){if(d.depth<=1)throw wr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(y.next==="@popall")d=d.popall();else{let N=xk(this._lexer,y.next,C,b,w);if(N[0]==="@"&&(N=N.substr(1)),gY(this._lexer,N))d=d.push(N);else throw wr(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}y.log&&typeof y.log=="string"&&zJt(this._lexer,this._lexer.languageId+": "+xk(this._lexer,y.log,C,b,w))}if(k===null)throw wr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const F=N=>{const z=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,U=this._getNestedEmbeddedLanguageData(z);if(h0)throw wr(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==k.length+1)throw wr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let z=1;zn});class OOe{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const l=d=>{const h=jJt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,s).then(l,d=>console.error(d))}static async colorize(e,t,i,s){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),XRe(t)&&(t=t.substr(1));const a=xw(t);if(!e.isRegisteredLanguageId(i))return m7e(a,r,o);const c=await dc.getOrCreate(i);return c?KJt(a,r,c,o):m7e(a,r,o)}static colorizeLine(e,t,i,s,o=4){const r=Sm.isBasicASCII(e,t),a=Sm.containsRTL(e,r,i);return ede(new tL(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function KJt(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=YJt(n,e,t,i);if(t instanceof YG){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}s(a)};r()})}function m7e(n,e,t){let i=[];const s=(ar.None<<$i.FONT_STYLE_OFFSET|Ad.DefaultForeground<<$i.FOREGROUND_OFFSET|Ad.DefaultBackground<<$i.BACKGROUND_OFFSET)>>>0,o=new Uint32Array(2);o[0]=0,o[1]=s;for(let r=0,a=n.length;r")}return i.join("")}function YJt(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=l.endState}return s.join("")}function JJt(n,e,t){return Lt.initialize(t||{}).createInstance(mF,n,e)}function XJt(n){return Lt.get(jt).onCodeEditorAdd(t=>{n(t)})}function ZJt(n){return Lt.get(jt).onDiffEditorAdd(t=>{n(t)})}function eXt(){return Lt.get(jt).listCodeEditors()}function tXt(){return Lt.get(jt).listDiffEditors()}function iXt(n,e,t){return Lt.initialize(t||{}).createInstance(Zee,n,e)}function nXt(n,e){const t=Lt.initialize(e||{});return new FCe(n,{},t)}function sXt(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return yt.registerCommand(n.id,n.run)}function oXt(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=ge.deserialize(n.precondition),t=(s,...o)=>Jc.runEditorCommand(s,o,e,(r,a,c)=>Promise.resolve(n.run(a,...c))),i=new Z;if(i.add(yt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Xs.appendMenuItem(Te.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Lt.get(ti);if(!(s instanceof x1))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ge.and(e,ge.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function rXt(n){return Vrt([n])}function Vrt(n){const e=Lt.get(ti);return e instanceof x1?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ge.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),$.None)}function aXt(n,e,t){const i=Lt.get(Di),s=i.getLanguageIdByMimeType(e)||e;return lZe(Lt.get(Ai),i,n,s,t)}function cXt(n,e){const t=Lt.get(Di),i=t.getLanguageIdByMimeType(e)||e||Yc;n.setLanguage(t.createById(i))}function lXt(n,e,t){n&&Lt.get(U_).changeOne(e,n.uri,t)}function dXt(n){Lt.get(U_).changeAll(n,[])}function hXt(n){return Lt.get(U_).read(n)}function uXt(n){return Lt.get(U_).onMarkerChanged(n)}function gXt(n){return Lt.get(Ai).getModel(n)}function fXt(){return Lt.get(Ai).getModels()}function pXt(n){return Lt.get(Ai).onModelAdded(n)}function mXt(n){return Lt.get(Ai).onModelRemoved(n)}function _Xt(n){return Lt.get(Ai).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function vXt(n){return Wpt(Lt.get(Ai),Lt.get(lo),n)}function wXt(n,e){const t=Lt.get(Di),i=Lt.get(Iw);return OOe.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function bXt(n,e,t){const i=Lt.get(Di);return Lt.get(Iw).registerEditorContainer(yi.document.body),OOe.colorize(i,n,e,t)}function CXt(n,e,t=4){return Lt.get(Iw).registerEditorContainer(yi.document.body),OOe.colorizeModelLine(n,e,t)}function yXt(n){const e=dc.get(n);return e||{getInitialState:()=>G9,tokenize:(t,i,s)=>aKe(n,s)}}function SXt(n,e){dc.getOrCreate(e);const t=yXt(e),i=xw(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const o=t.options?.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await n.openCodeEditor(i,t.resource,r)?i:null})}function LXt(){return{create:JJt,getEditors:eXt,getDiffEditors:tXt,onDidCreateEditor:XJt,onDidCreateDiffEditor:ZJt,createDiffEditor:iXt,addCommand:sXt,addEditorAction:oXt,addKeybindingRule:rXt,addKeybindingRules:Vrt,createModel:aXt,setModelLanguage:cXt,setModelMarkers:lXt,getModelMarkers:hXt,removeAllMarkers:dXt,onDidChangeMarkers:uXt,getModels:fXt,getModel:gXt,onDidCreateModel:pXt,onWillDisposeModel:mXt,onDidChangeModelLanguage:_Xt,createWebWorker:vXt,colorizeElement:wXt,colorize:bXt,colorizeModelLine:CXt,tokenize:SXt,defineTheme:AXt,setTheme:EXt,remeasureFonts:xXt,registerCommand:DXt,registerLinkOpener:kXt,registerEditorOpener:IXt,AccessibilitySupport:T_e,ContentWidgetPositionPreference:O_e,CursorChangeReason:B_e,DefaultEndOfLine:W_e,EditorAutoIndentStrategy:U_e,EditorOption:V_e,EndOfLinePreference:z_e,EndOfLineSequence:$_e,MinimapPosition:tve,MinimapSectionHeaderStyle:ive,MouseTargetType:nve,OverlayWidgetPositionPreference:rve,OverviewRulerLane:ave,GlyphMarginLane:G_e,RenderLineNumbersType:dve,RenderMinimap:hve,ScrollbarVisibility:gve,ScrollType:uve,TextEditorCursorBlinkingStyle:wve,TextEditorCursorStyle:bve,TrackedRangeStickiness:Cve,WrappingIndent:yve,InjectedTextCursorStops:j_e,PositionAffinity:lve,ShowLightbulbIconMode:pve,ConfigurationChangedEvent:kQe,BareFontInfo:Wk,FontInfo:QY,TextModelResolvedOptions:YY,FindMatch:z9,ApplyUpdateResult:a$,EditorZoom:l_,createMultiFileDiffEditor:nXt,EditorType:mz,EditorOptions:_u}}function TXt(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function fY(n,e){return typeof n=="boolean"?n:e}function _7e(n,e){return typeof n=="string"?n:e}function RXt(n){const e={};for(const t of n)e[t]=!0;return e}function v7e(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=RXt(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function Q0e(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(r,a){s=!0;let c="";if(typeof n[a]=="string")c=n[a];else if(n[a]&&n[a]instanceof RegExp)c=n[a].source;else throw n[a]===void 0?wr(n,"language definition does not contain attribute '"+a+"', used at: "+e):wr(n,"attribute reference '"+a+"' must be a string, used at: "+e);return UT(c)?"":"(?:"+c+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const o=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,c=null;return l=>(c&&a===l||(a=l,c=new RegExp($Jt(n,e,l),o)),c)}return new RegExp(e,o)}function MXt(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=B4.Open;else if(t.bracket==="@close")i.bracket=B4.Close;else throw wr(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw wr(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!GJt(n,xk(n,s,"",[],""))))throw wr(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=Q0e(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=j0e(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function zrt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=fY(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=fY(e.ignoreCase,!1),t.unicode=fY(e.unicode,!1),t.tokenPostfix=_7e(e.tokenPostfix,"."+t.languageId),t.defaultToken=_7e(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw wr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw wr(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const h=new PXt(r);if(Array.isArray(l)&&l.length>=1&&l.length<=3)if(h.setRegex(i,l[0]),l.length>=3)if(typeof l[1]=="string")h.setAction(i,{token:l[1],next:l[2]});else if(typeof l[1]=="object"){const u=l[1];u.next=l[2],h.setAction(i,u)}else throw wr(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,l[1]);else{if(!l.regex)throw wr(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=fY(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw wr(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw wr(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw wr(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:xx(t,a.open),close:xx(t,a.close)});else throw wr(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function FXt(n){hM.registerLanguage(n)}function OXt(){let n=[];return n=n.concat(hM.getLanguages()),n}function BXt(n){return Lt.get(Di).languageIdCodec.encodeLanguageId(n)}function WXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function HXt(n,e){return Lt.withServices(()=>{const i=Lt.get(Di).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function UXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Lt.get(lo).register(n,e,100)}class VXt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return JG.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new $le(s.tokens,s.endState)}}class JG{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;l===0?f=0:f{const i=await Promise.resolve(e.create());return i?zXt(i)?Grt(n,i):new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re)):null});return dc.registerFactory(n,t)}function qXt(n,e){if(!Lt.get(Di).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return $rt(e)?BOe(n,{create:()=>e}):dc.register(n,Grt(n,e))}function QXt(n,e){const t=i=>new YG(Lt.get(Di),Lt.get(Iw),n,zrt(n,i),Lt.get(Re));return $rt(e)?BOe(n,{create:()=>e}):dc.register(n,t(e))}function jXt(n,e){return Lt.get(ht).referenceProvider.register(n,e)}function KXt(n,e){return Lt.get(ht).renameProvider.register(n,e)}function YXt(n,e){return Lt.get(ht).newSymbolNamesProvider.register(n,e)}function JXt(n,e){return Lt.get(ht).signatureHelpProvider.register(n,e)}function XXt(n,e){return Lt.get(ht).hoverProvider.register(n,{provideHover:async(i,s,o,r)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new O(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),c.range||(c.range=new O(s.lineNumber,s.column,s.lineNumber,s.column)),c})}})}function ZXt(n,e){return Lt.get(ht).documentSymbolProvider.register(n,e)}function eZt(n,e){return Lt.get(ht).documentHighlightProvider.register(n,e)}function tZt(n,e){return Lt.get(ht).linkedEditingRangeProvider.register(n,e)}function iZt(n,e){return Lt.get(ht).definitionProvider.register(n,e)}function nZt(n,e){return Lt.get(ht).implementationProvider.register(n,e)}function sZt(n,e){return Lt.get(ht).typeDefinitionProvider.register(n,e)}function oZt(n,e){return Lt.get(ht).codeLensProvider.register(n,e)}function rZt(n,e,t){return Lt.get(ht).codeActionProvider.register(n,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(s,o,r,a)=>{const l=Lt.get(U_).read({resource:s.uri}).filter(d=>O.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function aZt(n,e){return Lt.get(ht).documentFormattingEditProvider.register(n,e)}function cZt(n,e){return Lt.get(ht).documentRangeFormattingEditProvider.register(n,e)}function lZt(n,e){return Lt.get(ht).onTypeFormattingEditProvider.register(n,e)}function dZt(n,e){return Lt.get(ht).linkProvider.register(n,e)}function hZt(n,e){return Lt.get(ht).completionProvider.register(n,e)}function uZt(n,e){return Lt.get(ht).colorProvider.register(n,e)}function gZt(n,e){return Lt.get(ht).foldingRangeProvider.register(n,e)}function fZt(n,e){return Lt.get(ht).declarationProvider.register(n,e)}function pZt(n,e){return Lt.get(ht).selectionRangeProvider.register(n,e)}function mZt(n,e){return Lt.get(ht).documentSemanticTokensProvider.register(n,e)}function _Zt(n,e){return Lt.get(ht).documentRangeSemanticTokensProvider.register(n,e)}function vZt(n,e){return Lt.get(ht).inlineCompletionsProvider.register(n,e)}function wZt(n,e){return Lt.get(ht).inlineEditProvider.register(n,e)}function bZt(n,e){return Lt.get(ht).inlayHintsProvider.register(n,e)}function CZt(){return{register:FXt,getLanguages:OXt,onLanguage:WXt,onLanguageEncountered:HXt,getEncodedLanguageId:BXt,setLanguageConfiguration:UXt,setColorMap:GXt,registerTokensProviderFactory:BOe,setTokensProvider:qXt,setMonarchTokensProvider:QXt,registerReferenceProvider:jXt,registerRenameProvider:KXt,registerNewSymbolNameProvider:YXt,registerCompletionItemProvider:hZt,registerSignatureHelpProvider:JXt,registerHoverProvider:XXt,registerDocumentSymbolProvider:ZXt,registerDocumentHighlightProvider:eZt,registerLinkedEditingRangeProvider:tZt,registerDefinitionProvider:iZt,registerImplementationProvider:nZt,registerTypeDefinitionProvider:sZt,registerCodeLensProvider:oZt,registerCodeActionProvider:rZt,registerDocumentFormattingEditProvider:aZt,registerDocumentRangeFormattingEditProvider:cZt,registerOnTypeFormattingEditProvider:lZt,registerLinkProvider:dZt,registerColorProvider:uZt,registerFoldingRangeProvider:gZt,registerDeclarationProvider:fZt,registerSelectionRangeProvider:pZt,registerDocumentSemanticTokensProvider:mZt,registerDocumentRangeSemanticTokensProvider:_Zt,registerInlineCompletionsProvider:vZt,registerInlineEditProvider:wZt,registerInlayHintsProvider:bZt,DocumentHighlightKind:H_e,CompletionItemKind:N_e,CompletionItemTag:P_e,CompletionItemInsertTextRule:M_e,SymbolKind:_ve,SymbolTag:vve,IndentAction:Q_e,CompletionTriggerKind:F_e,SignatureHelpTriggerKind:mve,InlayHintKind:K_e,InlineCompletionTriggerKind:Y_e,InlineEditTriggerKind:J_e,CodeActionTriggerType:R_e,NewSymbolNameTag:sve,NewSymbolNameTriggerKind:ove,PartialAcceptTriggerKind:cve,HoverVerbosityAction:q_e,FoldingRangeKind:yv,SelectedSuggestionInfo:OQe}}_u.wrappingIndent.defaultValue=Vg.None;_u.glyphMargin.defaultValue=!1;_u.autoIndent.defaultValue=ed.Advanced;_u.overviewRulerLanes.defaultValue=2;gV.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Ag=WQe();Ag.editor=LXt();Ag.languages=CZt();Ag.CancellationTokenSource;Ag.Emitter;Ag.KeyCode;Ag.KeyMod;const qrt=Ag.Position;Ag.Range;Ag.Selection;Ag.SelectionDirection;Ag.MarkerSeverity;Ag.MarkerTag;const Pv=Ag.Uri;Ag.Token;const pd=Ag.editor,QM=Ag.languages,yZt=globalThis.MonacoEnvironment;(yZt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ag);const SZt=QM.onLanguage;QM.onLanguage=(n,e)=>Prt(()=>SZt(n,e));const AZt=QM.onLanguage;QM.onLanguageEncountered=(n,e)=>Prt(()=>AZt(n,e));pd.create=Wrt;pd.createDiffEditor=WJt;pd.createModelReference=OJt;pd.writeFile=Ort;const EZt={defaultToken:"invalid",root_keywords:["import","from","export","global","component","struct","inherits"],inner_keywords:["property","callback","animate","states","transitions","if","for","in","out","in-out","private","function","pure","public"],lang_keywords:["root","parent","this","if"],type_keywords:["int","string","float","length","physical_length","duration","color","brush"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,symbols:/[#!%&*+\-./:;<=>@^|_?,()]+/,tokenizer:{root:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@root_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@inner"],[/@symbols/,""]],inner:[[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:=/,"variable.parameter"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:\s*\{/,"variable.parameter","@binding_1"],[/[a-zA-Z_][a-zA-Z0-9_-]*\s*:/,"variable.parameter","@binding_0"],[/[a-zA-Z_][a-zA-Z0-9_-]*/,{cases:{"@inner_keywords":{token:"keyword"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/:=/,""],[/<=>/,"","@binding_0"],[/=>\s*{/,"","@binding_1"],[//,"","@pop"],[/@symbols/,""]],binding_0:[{include:"@whitespace"},[/\{/,"","@binding_1"],[/;/,"","@pop"],[/\}/,"","@pop"],[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@numbers"},[/"/,"string","@string"],[/@symbols/,""]],binding_1:[[/[a-zA-Z_][a-zA-Z0-9_]*/,{cases:{"@lang_keywords":{token:"keyword.type"},"@default":"identifier"}}],{include:"@whitespace"},{include:"@numbers"},[/"/,"string","@string"],[/\{/,"","@push"],[/\}/,"","@pop"],[/\[/,"","@push"],[/\]/,"","@pop"],[/@symbols/,""]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],numbers:[[/\d+(\.\d+)?\w*/,{token:"number"}],[/#[0-9a-fA-F]+/,{token:"number"}]]}};var K0e;(function(n){function e(t){return typeof t=="string"}n.is=e})(K0e||(K0e={}));var sre;(function(n){function e(t){return typeof t=="string"}n.is=e})(sre||(sre={}));var Y0e;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Y0e||(Y0e={}));var XG;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(XG||(XG={}));var Lv;(function(n){function e(i,s){return i===Number.MAX_VALUE&&(i=XG.MAX_VALUE),s===Number.MAX_VALUE&&(s=XG.MAX_VALUE),{line:i,character:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&We.uinteger(s.line)&&We.uinteger(s.character)}n.is=t})(Lv||(Lv={}));var nd;(function(n){function e(i,s,o,r){if(We.uinteger(i)&&We.uinteger(s)&&We.uinteger(o)&&We.uinteger(r))return{start:Lv.create(i,s),end:Lv.create(o,r)};if(Lv.is(i)&&Lv.is(s))return{start:i,end:s};throw new Error(`Range#create called with invalid arguments[${i}, ${s}, ${o}, ${r}]`)}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&Lv.is(s.start)&&Lv.is(s.end)}n.is=t})(nd||(nd={}));var ZG;(function(n){function e(i,s){return{uri:i,range:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(We.string(s.uri)||We.undefined(s.uri))}n.is=t})(ZG||(ZG={}));var J0e;(function(n){function e(i,s,o,r){return{targetUri:i,targetRange:s,targetSelectionRange:o,originSelectionRange:r}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.targetRange)&&We.string(s.targetUri)&&nd.is(s.targetSelectionRange)&&(nd.is(s.originSelectionRange)||We.undefined(s.originSelectionRange))}n.is=t})(J0e||(J0e={}));var ore;(function(n){function e(i,s,o,r){return{red:i,green:s,blue:o,alpha:r}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.numberRange(s.red,0,1)&&We.numberRange(s.green,0,1)&&We.numberRange(s.blue,0,1)&&We.numberRange(s.alpha,0,1)}n.is=t})(ore||(ore={}));var X0e;(function(n){function e(i,s){return{range:i,color:s}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&nd.is(s.range)&&ore.is(s.color)}n.is=t})(X0e||(X0e={}));var Z0e;(function(n){function e(i,s,o){return{label:i,textEdit:s,additionalTextEdits:o}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.undefined(s.textEdit)||xS.is(s))&&(We.undefined(s.additionalTextEdits)||We.typedArray(s.additionalTextEdits,xS.is))}n.is=t})(Z0e||(Z0e={}));var e1e;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(e1e||(e1e={}));var t1e;(function(n){function e(i,s,o,r,a,c){const l={startLine:i,endLine:s};return We.defined(o)&&(l.startCharacter=o),We.defined(r)&&(l.endCharacter=r),We.defined(a)&&(l.kind=a),We.defined(c)&&(l.collapsedText=c),l}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.uinteger(s.startLine)&&We.uinteger(s.startLine)&&(We.undefined(s.startCharacter)||We.uinteger(s.startCharacter))&&(We.undefined(s.endCharacter)||We.uinteger(s.endCharacter))&&(We.undefined(s.kind)||We.string(s.kind))}n.is=t})(t1e||(t1e={}));var rre;(function(n){function e(i,s){return{location:i,message:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&ZG.is(s.location)&&We.string(s.message)}n.is=t})(rre||(rre={}));var i1e;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(i1e||(i1e={}));var n1e;(function(n){n.Unnecessary=1,n.Deprecated=2})(n1e||(n1e={}));var s1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&We.string(i.href)}n.is=e})(s1e||(s1e={}));var eq;(function(n){function e(i,s,o,r,a,c){let l={range:i,message:s};return We.defined(o)&&(l.severity=o),We.defined(r)&&(l.code=r),We.defined(a)&&(l.source=a),We.defined(c)&&(l.relatedInformation=c),l}n.create=e;function t(i){var s;let o=i;return We.defined(o)&&nd.is(o.range)&&We.string(o.message)&&(We.number(o.severity)||We.undefined(o.severity))&&(We.integer(o.code)||We.string(o.code)||We.undefined(o.code))&&(We.undefined(o.codeDescription)||We.string((s=o.codeDescription)===null||s===void 0?void 0:s.href))&&(We.string(o.source)||We.undefined(o.source))&&(We.undefined(o.relatedInformation)||We.typedArray(o.relatedInformation,rre.is))}n.is=t})(eq||(eq={}));var JF;(function(n){function e(i,s,...o){let r={title:i,command:s};return We.defined(o)&&o.length>0&&(r.arguments=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.title)&&We.string(s.command)}n.is=t})(JF||(JF={}));var xS;(function(n){function e(o,r){return{range:o,newText:r}}n.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}n.insert=t;function i(o){return{range:o,newText:""}}n.del=i;function s(o){const r=o;return We.objectLiteral(r)&&We.string(r.newText)&&nd.is(r.range)}n.is=s})(xS||(xS={}));var jM;(function(n){function e(i,s,o){const r={label:i};return s!==void 0&&(r.needsConfirmation=s),o!==void 0&&(r.description=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&We.string(s.label)&&(We.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(We.string(s.description)||s.description===void 0)}n.is=t})(jM||(jM={}));var Ju;(function(n){function e(t){const i=t;return We.string(i)}n.is=e})(Ju||(Ju={}));var qA;(function(n){function e(o,r,a){return{range:o,newText:r,annotationId:a}}n.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}n.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}n.del=i;function s(o){const r=o;return xS.is(r)&&(jM.is(r.annotationId)||Ju.is(r.annotationId))}n.is=s})(qA||(qA={}));var tq;(function(n){function e(i,s){return{textDocument:i,edits:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&iq.is(s.textDocument)&&Array.isArray(s.edits)}n.is=t})(tq||(tq={}));var W4;(function(n){function e(i,s,o){let r={kind:"create",uri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="create"&&We.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(W4||(W4={}));var H4;(function(n){function e(i,s,o,r){let a={kind:"rename",oldUri:i,newUri:s};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}n.create=e;function t(i){let s=i;return s&&s.kind==="rename"&&We.string(s.oldUri)&&We.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||We.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||We.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(H4||(H4={}));var U4;(function(n){function e(i,s,o){let r={kind:"delete",uri:i};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(r.options=s),o!==void 0&&(r.annotationId=o),r}n.create=e;function t(i){let s=i;return s&&s.kind==="delete"&&We.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||We.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||We.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Ju.is(s.annotationId))}n.is=t})(U4||(U4={}));var are;(function(n){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(s=>We.string(s.kind)?W4.is(s)||H4.is(s)||U4.is(s):tq.is(s)))}n.is=e})(are||(are={}));class pY{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let s,o;if(i===void 0?s=xS.insert(e,t):Ju.is(i)?(o=i,s=qA.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.insert(e,t,o)),this.edits.push(s),o!==void 0)return o}replace(e,t,i){let s,o;if(i===void 0?s=xS.replace(e,t):Ju.is(i)?(o=i,s=qA.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),s=qA.replace(e,t,o)),this.edits.push(s),o!==void 0)return o}delete(e,t){let i,s;if(t===void 0?i=xS.del(e):Ju.is(t)?(s=t,i=qA.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(t),i=qA.del(e,s)),this.edits.push(i),s!==void 0)return s}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class w7e{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let i;if(Ju.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error(`Id ${i} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${i}`);return this._annotations[i]=t,this._size++,i}nextId(){return this._counter++,this._counter.toString()}}class xZt{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new w7e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(tq.is(t)){const i=new pY(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new pY(e.changes[t]);this._textEditChanges[t]=i})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(iq.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let i=this._textEditChanges[t.uri];if(!i){const s=[],o={textDocument:t,edits:s};this._workspaceEdit.documentChanges.push(o),i=new pY(s,this._changeAnnotations),this._textEditChanges[t.uri]=i}return i}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let i=[];this._workspaceEdit.changes[e]=i,t=new pY(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new w7e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=W4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=W4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;jM.is(i)||Ju.is(i)?o=i:s=i;let r,a;if(o===void 0?r=H4.create(e,t,s):(a=Ju.is(o)?o:this._changeAnnotations.manage(o),r=H4.create(e,t,s,a)),this._workspaceEdit.documentChanges.push(r),a!==void 0)return a}deleteFile(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;jM.is(t)||Ju.is(t)?s=t:i=t;let o,r;if(s===void 0?o=U4.create(e,i):(r=Ju.is(s)?s:this._changeAnnotations.manage(s),o=U4.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var o1e;(function(n){function e(i){return{uri:i}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)}n.is=t})(o1e||(o1e={}));var r1e;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.integer(s.version)}n.is=t})(r1e||(r1e={}));var iq;(function(n){function e(i,s){return{uri:i,version:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&(s.version===null||We.integer(s.version))}n.is=t})(iq||(iq={}));var a1e;(function(n){function e(i,s,o,r){return{uri:i,languageId:s,version:o,text:r}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.string(s.uri)&&We.string(s.languageId)&&We.integer(s.version)&&We.string(s.text)}n.is=t})(a1e||(a1e={}));var cre;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const i=t;return i===n.PlainText||i===n.Markdown}n.is=e})(cre||(cre={}));var V4;(function(n){function e(t){const i=t;return We.objectLiteral(t)&&cre.is(i.kind)&&We.string(i.value)}n.is=e})(V4||(V4={}));var c1e;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(c1e||(c1e={}));var l1e;(function(n){n.PlainText=1,n.Snippet=2})(l1e||(l1e={}));var d1e;(function(n){n.Deprecated=1})(d1e||(d1e={}));var h1e;(function(n){function e(i,s,o){return{newText:i,insert:s,replace:o}}n.create=e;function t(i){const s=i;return s&&We.string(s.newText)&&nd.is(s.insert)&&nd.is(s.replace)}n.is=t})(h1e||(h1e={}));var u1e;(function(n){n.asIs=1,n.adjustIndentation=2})(u1e||(u1e={}));var g1e;(function(n){function e(t){const i=t;return i&&(We.string(i.detail)||i.detail===void 0)&&(We.string(i.description)||i.description===void 0)}n.is=e})(g1e||(g1e={}));var f1e;(function(n){function e(t){return{label:t}}n.create=e})(f1e||(f1e={}));var p1e;(function(n){function e(t,i){return{items:t||[],isIncomplete:!!i}}n.create=e})(p1e||(p1e={}));var nq;(function(n){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(i){const s=i;return We.string(s)||We.objectLiteral(s)&&We.string(s.language)&&We.string(s.value)}n.is=t})(nq||(nq={}));var m1e;(function(n){function e(t){let i=t;return!!i&&We.objectLiteral(i)&&(V4.is(i.contents)||nq.is(i.contents)||We.typedArray(i.contents,nq.is))&&(t.range===void 0||nd.is(t.range))}n.is=e})(m1e||(m1e={}));var _1e;(function(n){function e(t,i){return i?{label:t,documentation:i}:{label:t}}n.create=e})(_1e||(_1e={}));var v1e;(function(n){function e(t,i,...s){let o={label:t};return We.defined(i)&&(o.documentation=i),We.defined(s)?o.parameters=s:o.parameters=[],o}n.create=e})(v1e||(v1e={}));var w1e;(function(n){n.Text=1,n.Read=2,n.Write=3})(w1e||(w1e={}));var b1e;(function(n){function e(t,i){let s={range:t};return We.number(i)&&(s.kind=i),s}n.create=e})(b1e||(b1e={}));var C1e;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(C1e||(C1e={}));var y1e;(function(n){n.Deprecated=1})(y1e||(y1e={}));var S1e;(function(n){function e(t,i,s,o,r){let a={name:t,kind:i,location:{uri:o,range:s}};return r&&(a.containerName=r),a}n.create=e})(S1e||(S1e={}));var A1e;(function(n){function e(t,i,s,o){return o!==void 0?{name:t,kind:i,location:{uri:s,range:o}}:{name:t,kind:i,location:{uri:s}}}n.create=e})(A1e||(A1e={}));var E1e;(function(n){function e(i,s,o,r,a,c){let l={name:i,detail:s,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}n.create=e;function t(i){let s=i;return s&&We.string(s.name)&&We.number(s.kind)&&nd.is(s.range)&&nd.is(s.selectionRange)&&(s.detail===void 0||We.string(s.detail))&&(s.deprecated===void 0||We.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}n.is=t})(E1e||(E1e={}));var x1e;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(x1e||(x1e={}));var sq;(function(n){n.Invoked=1,n.Automatic=2})(sq||(sq={}));var D1e;(function(n){function e(i,s,o){let r={diagnostics:i};return s!=null&&(r.only=s),o!=null&&(r.triggerKind=o),r}n.create=e;function t(i){let s=i;return We.defined(s)&&We.typedArray(s.diagnostics,eq.is)&&(s.only===void 0||We.typedArray(s.only,We.string))&&(s.triggerKind===void 0||s.triggerKind===sq.Invoked||s.triggerKind===sq.Automatic)}n.is=t})(D1e||(D1e={}));var k1e;(function(n){function e(i,s,o){let r={title:i},a=!0;return typeof s=="string"?(a=!1,r.kind=s):JF.is(s)?r.command=s:r.edit=s,a&&o!==void 0&&(r.kind=o),r}n.create=e;function t(i){let s=i;return s&&We.string(s.title)&&(s.diagnostics===void 0||We.typedArray(s.diagnostics,eq.is))&&(s.kind===void 0||We.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||JF.is(s.command))&&(s.isPreferred===void 0||We.boolean(s.isPreferred))&&(s.edit===void 0||are.is(s.edit))}n.is=t})(k1e||(k1e={}));var I1e;(function(n){function e(i,s){let o={range:i};return We.defined(s)&&(o.data=s),o}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.command)||JF.is(s.command))}n.is=t})(I1e||(I1e={}));var L1e;(function(n){function e(i,s){return{tabSize:i,insertSpaces:s}}n.create=e;function t(i){let s=i;return We.defined(s)&&We.uinteger(s.tabSize)&&We.boolean(s.insertSpaces)}n.is=t})(L1e||(L1e={}));var T1e;(function(n){function e(i,s,o){return{range:i,target:s,data:o}}n.create=e;function t(i){let s=i;return We.defined(s)&&nd.is(s.range)&&(We.undefined(s.target)||We.string(s.target))}n.is=t})(T1e||(T1e={}));var R1e;(function(n){function e(i,s){return{range:i,parent:s}}n.create=e;function t(i){let s=i;return We.objectLiteral(s)&&nd.is(s.range)&&(s.parent===void 0||n.is(s.parent))}n.is=t})(R1e||(R1e={}));var M1e;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(M1e||(M1e={}));var N1e;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(N1e||(N1e={}));var P1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}n.is=e})(P1e||(P1e={}));var F1e;(function(n){function e(i,s){return{range:i,text:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.string(s.text)}n.is=t})(F1e||(F1e={}));var O1e;(function(n){function e(i,s,o){return{range:i,variableName:s,caseSensitiveLookup:o}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&We.boolean(s.caseSensitiveLookup)&&(We.string(s.variableName)||s.variableName===void 0)}n.is=t})(O1e||(O1e={}));var B1e;(function(n){function e(i,s){return{range:i,expression:s}}n.create=e;function t(i){const s=i;return s!=null&&nd.is(s.range)&&(We.string(s.expression)||s.expression===void 0)}n.is=t})(B1e||(B1e={}));var W1e;(function(n){function e(i,s){return{frameId:i,stoppedLocation:s}}n.create=e;function t(i){const s=i;return We.defined(s)&&nd.is(i.stoppedLocation)}n.is=t})(W1e||(W1e={}));var lre;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(lre||(lre={}));var dre;(function(n){function e(i){return{value:i}}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.location===void 0||ZG.is(s.location))&&(s.command===void 0||JF.is(s.command))}n.is=t})(dre||(dre={}));var H1e;(function(n){function e(i,s,o){const r={position:i,label:s};return o!==void 0&&(r.kind=o),r}n.create=e;function t(i){const s=i;return We.objectLiteral(s)&&Lv.is(s.position)&&(We.string(s.label)||We.typedArray(s.label,dre.is))&&(s.kind===void 0||lre.is(s.kind))&&s.textEdits===void 0||We.typedArray(s.textEdits,xS.is)&&(s.tooltip===void 0||We.string(s.tooltip)||V4.is(s.tooltip))&&(s.paddingLeft===void 0||We.boolean(s.paddingLeft))&&(s.paddingRight===void 0||We.boolean(s.paddingRight))}n.is=t})(H1e||(H1e={}));var U1e;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(U1e||(U1e={}));var V1e;(function(n){function e(t,i,s,o){return{insertText:t,filterText:i,range:s,command:o}}n.create=e})(V1e||(V1e={}));var z1e;(function(n){function e(t){return{items:t}}n.create=e})(z1e||(z1e={}));var $1e;(function(n){n.Invoked=0,n.Automatic=1})($1e||($1e={}));var G1e;(function(n){function e(t,i){return{range:t,text:i}}n.create=e})(G1e||(G1e={}));var q1e;(function(n){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}n.create=e})(q1e||(q1e={}));var Q1e;(function(n){function e(t){const i=t;return We.objectLiteral(i)&&sre.is(i.uri)&&We.string(i.name)}n.is=e})(Q1e||(Q1e={}));const DZt=[` `,`\r `,"\r"];var j1e;(function(n){function e(o,r,a,c){return new kZt(o,r,a,c)}n.create=e;function t(o){let r=o;return!!(We.defined(r)&&We.string(r.uri)&&(We.undefined(r.languageId)||We.string(r.languageId))&&We.uinteger(r.lineCount)&&We.func(r.getText)&&We.func(r.positionAt)&&We.func(r.offsetAt))}n.is=t;function i(o,r){let a=o.getText(),c=s(r,(d,h)=>{let u=d.range.start.line-h.range.start.line;return u===0?d.range.start.character-h.range.start.character:u}),l=a.length;for(let d=c.length-1;d>=0;d--){let h=c[d],u=o.offsetAt(h.range.start),f=o.offsetAt(h.range.end);if(f<=l)a=a.substring(0,u)+h.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=u}return a}n.applyEdits=i;function s(o,r){if(o.length<=1)return o;const a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);s(c,r),s(l,r);let d=0,h=0,u=0;for(;d{c["/"+y]=S})}else{const b=w.raw_url;d==null&&(d=v,h=b),c["/"+v]=b}const u=new zni(n,c);if(a.errors)return Promise.reject(`Failed to read gist: `+a.errors.join(` `));const f=a.description.match(/main file is: "(.+)"/i)?.[1];let p=l??f??"main.slint",m=c["/"+p];return m==null&&(p=d,m=h),Promise.resolve([m,"/"+p,u])}catch(s){return Promise.reject(`Failed to retrieve information on Gist: -`+s)}}return Promise.resolve([e.toString(),null,null])}async function BZt(n,e){const t=e.pathname.split("/");return t[3]==="blob"?(t.splice(3,1),Promise.resolve([e.protocol+"//raw.githubusercontent.com"+t.join("/"),null,null])):Promise.resolve([e.toString(),null,null])}async function WZt(n,e){try{const t=new URL(e);if(t.hostname==="gist.github.com")return OZt(n,t);if(t.hostname==="github.com")return BZt(n,t)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Wt;(function(n){function e(k,F,N=0,z=-1){let U=k.length;if(U===0)return-1;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;z0;){let me=re>>1,De=j+me;N(k[De],F)<0?(j=De+1,re-=me+1):re=me}return j}n.lowerBound=a;function c(k,F,N,z=0,U=-1){let J=k.length;if(J===0)return 0;z<0?z=Math.max(0,z+J):z=Math.min(z,J-1),U<0?U=Math.max(0,U+J):U=Math.min(U,J-1);let j=z,re=U-z+1;for(;re>0;){let me=re>>1,De=j+me;N(k[De],F)>0?re=me:(j=De+1,re-=me+1)}return j}n.upperBound=c;function l(k,F,N){if(k===F)return!0;if(k.length!==F.length)return!1;for(let z=0,U=k.length;z=J&&(N=U<0?J-1:J),z===void 0?z=U<0?-1:J:z<0?z=Math.max(z+J,U<0?-1:0):z>=J&&(z=U<0?J-1:J);let j;U<0&&z>=N||U>0&&N>=z?j=0:U<0?j=Math.floor((z-N+1)/U+1):j=Math.floor((z-N-1)/U+1);let re=[];for(let me=0;me=z))return;let J=z-N+1;if(F>0?F=F%J:F<0&&(F=(F%J+J)%J),F===0)return;let j=N+F;u(k,N,j-1),u(k,j,z),u(k,N,z)}n.rotate=f;function p(k,F,N=0,z=-1){let U=k.length;if(U===0)return;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;zF;--U)k[U]=k[U-1];k[F]=N}n.insert=m;function v(k,F){let N=k.length;if(F<0&&(F+=N),F<0||F>=N)return;let z=k[F];for(let U=F+1;U=N&&j<=z&&k[j]===F||z=N)&&k[j]===F?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllOf=C;function y(k,F,N=0,z=-1){let U,J=i(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeFirstWhere=y;function S(k,F,N=-1,z=0){let U,J=s(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeLastWhere=S;function M(k,F,N=0,z=-1){let U=k.length;if(U===0)return 0;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J=0;for(let j=0;j=N&&j<=z&&F(k[j],j)||z=N)&&F(k[j],j)?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllWhere=M})(Wt||(Wt={}));function*V5(){}function Y1e(n,e){let t=0;for(const i of n)if(e(i,t++))return i}function HZt(n,e){let t=0;for(const i of n)if(e(i,t++)===!1)return!1;return!0}function UZt(n,e){let t=0;for(const i of n)if(e(i,t++))return!0;return!1}var y7e;(function(n){function e(t,i,s){return s===0?1/0:t>i&&s>0||t-1;e--)yield n[e]}function zZt(n){let e=[],t=new Set,i=new Map;for(const r of n)s(r);for(const[r]of i)o(r);return e;function s(r){let[a,c]=r,l=i.get(c);l?l.push(a):i.set(c,[a])}function o(r){if(t.has(r))return;t.add(r);let a=i.get(r);if(a)for(const c of a)o(c);e.push(r)}}var oq;(function(n){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}n.cmp=o})(oq||(oq={}));var Hl;(function(n){n.emptyObject=Object.freeze({}),n.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}n.isPrimitive=e;function t(d){return Array.isArray(d)}n.isArray=t;function i(d){return!e(d)&&!t(d)}n.isObject=i;function s(d,h){if(d===h)return!0;if(e(d)||e(h))return!1;let u=t(d),f=t(h);return u!==f?!1:u&&f?r(d,h):a(d,h)}n.deepEqual=s;function o(d){return e(d)?d:t(d)?c(d):l(d)}n.deepCopy=o;function r(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===r.provides)return!0;const f=c.get(u);if(!f)return!1;const p=a.get(f),m=[...p.requires,...p.optional];return m.length===0?!1:(h.push(f),m.some(d)?!0:(h.pop(),!1))};if(!r.provides||l.length===0)return;const h=[r.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}n.ensureNoCycle=i;function s(r,a,c){const l=new Array,d=m=>{const v=a.get(m),w=[...v.requires,...v.optional];l.push(...w.reduce((b,C)=>{const y=c.get(C);return y&&b.push([m,y]),b},[]))};for(const m of a.keys())d(m);const h=l.filter(m=>m[1]===r);let u=0;for(;h.length>u;){const m=h.length,v=new Set(h.map(w=>w[0]));for(const w of v)l.filter(b=>b[1]===w).forEach(b=>{h.includes(b)||h.push(b)});u=m}const f=zZt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}n.findDependents=s;function o(r,a){const c=new Set;for(const l of r.keys())r.get(l).autoStart===!0&&c.add(l);if(a.startPlugins)for(const l of a.startPlugins)c.add(l);if(a.ignorePlugins)for(const l of a.ignorePlugins)c.delete(l);return Array.from(c)}n.collectStartupPlugins=o})(S7e||(S7e={}));function GZt(n){let e=0;for(let t=0,i=n.length;t>>0),n[t]=e&255,e>>>=8}var J1e;(function(n){n.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:GZt})()})(J1e||(J1e={}));function qZt(n){const e=new Uint8Array(16),t=new Array(256);for(let i=0;i<16;++i)t[i]="0"+i.toString(16);for(let i=16;i<256;++i)t[i]=i.toString(16);return function(){return n(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+"-"+t[e[4]]+t[e[5]]+"-"+t[e[6]]+t[e[7]]+"-"+t[e[8]]+t[e[9]]+"-"+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}}var X1e;(function(n){n.uuid4=qZt(J1e.getRandomValues)})(X1e||(X1e={}));var A7e;(function(n){function e(t){const i=document.body,s=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",s,!0)};i.addEventListener("copy",s,!0),document.execCommand("copy")}n.copyText=e})(A7e||(A7e={}));var fc;(function(n){function e(o){let r=window.getComputedStyle(o),a=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderLeftWidth)||0,l=parseFloat(r.borderRightWidth)||0,d=parseFloat(r.borderBottomWidth)||0,h=parseFloat(r.paddingTop)||0,u=parseFloat(r.paddingLeft)||0,f=parseFloat(r.paddingRight)||0,p=parseFloat(r.paddingBottom)||0,m=c+u+f+l,v=a+h+p+d;return{borderTop:a,borderLeft:c,borderRight:l,borderBottom:d,paddingTop:h,paddingLeft:u,paddingRight:f,paddingBottom:p,horizontalSum:m,verticalSum:v}}n.boxSizing=e;function t(o){let r=window.getComputedStyle(o),a=parseFloat(r.minWidth)||0,c=parseFloat(r.minHeight)||0,l=parseFloat(r.maxWidth)||1/0,d=parseFloat(r.maxHeight)||1/0;return l=Math.max(a,l),d=Math.max(c,d),{minWidth:a,minHeight:c,maxWidth:l,maxHeight:d}}n.sizeLimits=t;function i(o,r,a){let c=o.getBoundingClientRect();return r>=c.left&&r=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){o.scrollTop-=a.top-c.top;return}if(c.topa.height){o.scrollTop-=a.bottom-c.bottom;return}if(c.bottom>a.bottom&&c.height{let d=Element.prototype;return d.matches||d.matchesSelector||d.mozMatchesSelector||d.msMatchesSelector||d.oMatchesSelector||d.webkitMatchesSelector||function(h){let u=this,f=u.ownerDocument?u.ownerDocument.querySelectorAll(h):[];return Array.prototype.indexOf.call(f,u)!==-1}})();function e(d){d=d.split(",",1)[0];let h=0,u=0,f=0;function p(m){let v=d.match(m);return v===null?!1:(d=d.slice(v[0].length),!0)}for(d=d.replace(l," $1 ");d.length>0;){if(p(t)){h++;continue}if(p(i)){u++;continue}if(p(s)){u++;continue}if(p(r)){f++;continue}if(p(a)){u++;continue}if(p(o)){f++;continue}if(!p(c))return 0}return h=Math.min(h,255),u=Math.min(u,255),f=Math.min(f,255),h<<16|u<<8|f}n.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,s=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(ob||(ob={}));class Z1e{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new LA.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new LA.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.prev;return i.next=s,i.prev=o,s.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.next;return i.next=o,i.prev=s,s.next=i,o.prev=i,this._size++,i}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof LA.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}(function(n){function e(t){let i=new n;return i.assign(t),i}n.from=e})(Z1e||(Z1e={}));var LA;(function(n){class e{constructor(i,s){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=s}}n.LinkedListNode=e})(LA||(LA={}));let ev=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class q3 extends ev{get isConflatable(){return!0}conflate(e){return!0}}var Gt;(function(n){let e=null;const t=(F=>N=>{let z=!1;return F.then(()=>!z&&N()),()=>{z=!0}})(Promise.resolve());function i(F,N){let z=u.get(F);if(!z||z.length===0){w(F,N);return}HZt(VZt(z),J=>J?v(J,F,N):!0)&&w(F,N)}n.sendMessage=i;function s(F,N){if(!N.isConflatable){b(F,N);return}UZt(h,U=>U.handler!==F||!U.msg||U.msg.type!==N.type||!U.msg.isConflatable?!1:U.msg.conflate(N))||b(F,N)}n.postMessage=s;function o(F,N){let z=u.get(F);z&&z.indexOf(N)!==-1||(z?z.push(N):u.set(F,[N]))}n.installMessageHook=o;function r(F,N){let z=u.get(F);if(!z)return;let U=z.indexOf(N);U!==-1&&(z[U]=null,y(z))}n.removeMessageHook=r;function a(F){let N=u.get(F);N&&N.length>0&&(Wt.fill(N,null),y(N));for(const z of h)z.handler===F&&(z.handler=null,z.msg=null)}n.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,C(),m=!1)}n.flush=c;function l(){return p}n.getExceptionHandler=l;function d(F){let N=p;return p=F,N}n.setExceptionHandler=d;const h=new Z1e,u=new WeakMap,f=new Set;let p=F=>{console.error(F)},m=!1;function v(F,N,z){let U=!0;try{typeof F=="function"?U=F(N,z):U=F.messageHook(N,z)}catch(J){p(J)}return U}function w(F,N){try{F.processMessage(N)}catch(z){p(z)}}function b(F,N){h.addLast({handler:F,msg:N}),e===null&&(e=t(C))}function C(){if(e=null,h.isEmpty)return;let F={handler:null,msg:null};for(h.addLast(F);;){let N=h.removeFirst();if(N===F)return;N.handler&&N.msg&&i(N.handler,N.msg)}}function y(F){f.size===0&&t(S),f.add(F)}function S(){f.forEach(M),f.clear()}function M(F){Wt.removeAllWhere(F,k)}function k(F){return F===null}})(Gt||(Gt={}));class Aw{constructor(e){this._pid=MR.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,i=MR.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,s=MR.ensureMap(e);this._pid in s?i=s[this._pid]:i=s[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,s[this._pid]=o)}coerce(e){let t,i=MR.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=s)}_createValue(e){let t=this._create;return t(e)}_coerceValue(e,t){let i=this._coerce;return i?i(e,t):t}_compareValue(e,t){let i=this._compare;return i?i(e,t):e===t}_maybeNotify(e,t,i){let s=this._changed;s&&!this._compareValue(t,i)&&s(e,t,i)}}(function(n){function e(t){MR.ownerData.delete(t)}n.clearData=e})(Aw||(Aw={}));var MR;(function(n){n.ownerData=new WeakMap,n.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=n.ownerData.get(t);return i||(i=Object.create(null),n.ownerData.set(t,i),i)}n.ensureMap=e})(MR||(MR={}));class rl{constructor(e){this.sender=e}connect(e,t){return i_.connect(this,e,t)}disconnect(e,t){return i_.disconnect(this,e,t)}emit(e){i_.emit(this,e)}}(function(n){function e(c,l){i_.disconnectBetween(c,l)}n.disconnectBetween=e;function t(c){i_.disconnectSender(c)}n.disconnectSender=t;function i(c){i_.disconnectReceiver(c)}n.disconnectReceiver=i;function s(c){i_.disconnectAll(c)}n.disconnectAll=s;function o(c){i_.disconnectAll(c)}n.clearData=o;function r(){return i_.exceptionHandler}n.getExceptionHandler=r;function a(c){let l=i_.exceptionHandler;return i_.exceptionHandler=c,l}n.setExceptionHandler=a})(rl||(rl={}));var i_;(function(n){n.exceptionHandler=b=>{console.error(b)};function e(b,C,y){y=y||void 0;let S=c.get(b.sender);if(S||(S=[],c.set(b.sender,S)),u(S,b,C,y))return!1;let M=y||C,k=l.get(M);k||(k=[],l.set(M,k));let F={signal:b,slot:C,thisArg:y};return S.push(F),k.push(F),!0}n.connect=e;function t(b,C,y){y=y||void 0;let S=c.get(b.sender);if(!S||S.length===0)return!1;let M=u(S,b,C,y);if(!M)return!1;let k=y||C,F=l.get(k);return M.signal=null,p(S),p(F),!0}n.disconnect=t;function i(b,C){let y=c.get(b);if(!y||y.length===0)return;let S=l.get(C);if(!(!S||S.length===0)){for(const M of S)M.signal&&M.signal.sender===b&&(M.signal=null);p(y),p(S)}}n.disconnectBetween=i;function s(b){let C=c.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.thisArg||y.slot;y.signal=null,p(l.get(S))}p(C)}}n.disconnectSender=s;function o(b){let C=l.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.signal.sender;y.signal=null,p(c.get(S))}p(C)}}n.disconnectReceiver=o;function r(b){s(b),o(b)}n.disconnectAll=r;function a(b,C){let y=c.get(b.sender);if(!(!y||y.length===0))for(let S=0,M=y.length;SM.signal===C&&M.slot===y&&M.thisArg===S)}function f(b,C){let{signal:y,slot:S,thisArg:M}=b;try{S.call(M,y.sender,C)}catch(k){n.exceptionHandler(k)}}function p(b){d.size===0&&h(m),d.add(b)}function m(){d.forEach(v),d.clear()}function v(b){Wt.removeAllWhere(b,w)}function w(b){return b.signal===null}})(i_||(i_={}));class eLe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class tLe{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(tLe||(tLe={}));class E7e extends tLe{constructor(){super(...arguments),this._disposed=new rl(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),rl.clearData(this))}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(E7e||(E7e={}));class Xu{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:s}=this._scrollTarget,o=Rg.SCROLL_EDGE_SIZE-s,r=Math.pow(o/Rg.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Rg.SCROLL_EDGE_SIZE));switch(i){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});Rg.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(s=>{this._resolve=s});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(i),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage)return;let i=this.dragImage.style;i.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),e.button!==0)return;if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Rg.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Rg.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=Rg.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,s=this._currentElement,o=Rg.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==s&&o!==i&&Rg.dispatchDragExit(this,i,o,e),o!==s&&o!==i&&(i=Rg.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Rg.dispatchDragLeave(this,t,i,e));let r=Rg.dispatchDragOver(this,i,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=Rg.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=Xu.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=Xu.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=Xu.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=Xu.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}(function(n){class e extends DragEvent{constructor(s,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:s.altKey,button:s.button,clientX:s.clientX,clientY:s.clientY,ctrlKey:s.ctrlKey,detail:0,metaKey:s.metaKey,relatedTarget:o.related,screenX:s.screenX,screenY:s.screenY,shiftKey:s.shiftKey,view:window});const{drag:r}=o;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}n.Event=e;function t(i,s=document){return Rg.overrideCursor(i,s)}n.overrideCursor=t})(Xu||(Xu={}));var Rg;(function(n){n.SCROLL_EDGE_SIZE=20;function e(y,S){return h[y]&u[S]?y:"none"}n.validateAction=e;function t(y,S=document){if(y){if(i&&y==i.event)return i.element;n.cursorBackdrop.style.zIndex="-1000";const M=S.elementFromPoint(y.clientX,y.clientY);return n.cursorBackdrop.style.zIndex="",i={event:y,element:M},M}else{const M=n.cursorBackdrop.style.transform;if(s&&M===s.transform)return s.element;const k=n.cursorBackdrop.getBoundingClientRect();n.cursorBackdrop.style.zIndex="-1000";const F=S.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return n.cursorBackdrop.style.zIndex="",s={transform:M,element:F},F}}n.findElementBehindBackdrop=t;let i=null,s=null;function o(y){let S=y.clientX,M=y.clientY,k=t(y);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let F=0,N=0;k===document.body&&(F=window.pageXOffset,N=window.pageYOffset);let z=k.getBoundingClientRect(),U=z.top+N,J=z.left+F,j=J+z.width,re=U+z.height;if(S=j||M=re)continue;let me=S-J+1,De=M-U+1,Qe=j-S,Tt=re-M,Oe=Math.min(me,De,Qe,Tt);if(Oe>n.SCROLL_EDGE_SIZE)continue;let wt;switch(Oe){case Tt:wt="bottom";break;case De:wt="top";break;case Qe:wt="right";break;case me:wt="left";break;default:throw"unreachable"}let Nt=k.scrollWidth-k.clientWidth,Yi=k.scrollHeight-k.clientHeight,Vi;switch(wt){case"top":Vi=Yi>0&&k.scrollTop>0;break;case"left":Vi=Nt>0&&k.scrollLeft>0;break;case"right":Vi=Nt>0&&k.scrollLeft0&&k.scrollTop{M===C&&n.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),n.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(n.cursorBackdrop))})}n.overrideCursor=f;function p(y){n.cursorBackdrop&&(n.cursorBackdrop.style.transform=`translate(${y.clientX}px, ${y.clientY}px)`)}function m(y){if(!n.cursorBackdrop)return;let S=t();if(!S)return;const M=S.closest("[data-lm-dragscroll]");M&&(M.scrollTop+=n.cursorBackdrop.scrollTop-w,M.scrollLeft+=n.cursorBackdrop.scrollLeft-w,v())}function v(){n.cursorBackdrop.scrollTop=w,n.cursorBackdrop.scrollLeft=w}const w=500;function b(){const y=document.createElement("div");return y.classList.add("lm-cursor-backdrop"),y}let C=0;n.cursorBackdrop=b()})(Rg||(Rg={}));function hre(){return iLe.keyboardLayout}class z4{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=z4.extractKeys(t),this._modifierKeys=z4.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}(function(n){function e(i){let s=Object.create(null);for(let o in i)s[i[o]]=!0;return s}n.extractKeys=e;function t(i){let s=Object(null);for(let o=0,r=i.length;o{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(e!==void 0&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return Promise.resolve((i=s?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return(i=s?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Hl.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Hl.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let s;try{s=i.execute.call(void 0,t)}catch(r){s=Promise.reject(r)}let o=Promise.resolve(s);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=db.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new eLe(()=>{Wt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=eA.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(eA.isModifierKeyPressed(e)){let{exact:r}=db.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:s}=db.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=s.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||s.some(r=>r.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!o){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},db.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},db.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(db.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const o=[...this._keydownEvents],r=(await Promise.race([Promise.all(o.map(async a=>{var c;return(c=this._holdKeyBindingPromises.get(a))!==null&&c!==void 0?c:Promise.resolve(!0)})),new Promise(a=>{setTimeout(()=>a([!1]),db.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,s={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,s)){let o=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${o}.`;console.warn(`${a} ${c}`);return}await this.execute(t,s)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}(function(n){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?jp.IS_MAC?d=!0:h=!0:f==="Alt"?l=!0:f==="Cmd"?d=!0:f==="Ctrl"?h=!0:f==="Shift"?u=!0:f.length>0&&(c=f);return{cmd:d,ctrl:h,alt:l,shift:u,key:c}}n.parseKeystroke=e;function t(a){let c="",l=e(a);return l.ctrl&&(c+="Ctrl "),l.alt&&(c+="Alt "),l.shift&&(c+="Shift "),l.cmd&&jp.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}n.normalizeKeystroke=t;function i(a){let c;return jp.IS_WIN?c=a.winKeys||a.keys:jp.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}n.normalizeKeys=i;function s(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=jp.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),jp.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(db.formatKey).join(h)}}n.formatKeystroke=s;function o(a){let c=hre(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}n.isModifierKeyPressed=o;function r(a){let c=hre(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&jp.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}n.keystrokeForKeydownEvent=r})(eA||(eA={}));var db;(function(n){n.CHORD_TIMEOUT=1e3,n.KEYBINDING_HOLD_TIMEOUT=1e3,n.modifierkeyTimeOut=500;function e(C){return{execute:C.execute,describedBy:p(typeof C.describedBy=="function"?C.describedBy:{args:null,...C.describedBy},()=>({args:null})),label:p(C.label,c),mnemonic:p(C.mnemonic,l),icon:p(C.icon,f),iconClass:p(C.iconClass,c),iconLabel:p(C.iconLabel,c),caption:p(C.caption,c),usage:p(C.usage,c),className:p(C.className,c),dataset:p(C.dataset,u),isEnabled:C.isEnabled||d,isToggled:C.isToggled||h,isToggleable:C.isToggleable||!!C.isToggled,isVisible:C.isVisible||d}}n.createCommand=e;function t(C){var y;return{keys:eA.normalizeKeys(C),selector:m(C),command:C.command,args:C.args||Hl.emptyObject,preventDefault:(y=C.preventDefault)!==null&&y!==void 0?y:!0}}n.createKeyBinding=t;function i(C,y,S){let M=null,k=[],F=1/0,N=0;for(let z=0,U=C.length;zF)continue;let me=$E.calculateSpecificity(J.selector);(!M||re=N)&&(M=J,F=re,N=me)}return{exact:M,partial:k}}n.matchKeyBinding=i;function s(C){C.target.dispatchEvent(b(C))}n.replayKeyEvent=s;function o(C){return jp.IS_MAC?r.hasOwnProperty(C)?r[C]:C:a.hasOwnProperty(C)?a[C]:C}n.formatKey=o;const r={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},a={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},c=()=>"",l=()=>-1,d=()=>!0,h=()=>!1,u=()=>({}),f=()=>{};function p(C,y){return C===void 0?y:typeof C=="function"?C:()=>C}function m(C){if(C.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${C.selector}`);if(!$E.isValid(C.selector))throw new Error(`Invalid selector: ${C.selector}`);return C.selector}function v(C,y){if(C.lengthy.length?2:1}function w(C,y){let S=y.target,M=y.currentTarget;for(let k=0;S!==null;S=S.parentElement,++k){if(S.hasAttribute("data-lm-suppress-shortcuts"))return-1;if($E.matches(S,C))return k;if(S===M)return-1}return-1}function b(C){let y=document.createEvent("Event"),S=C.bubbles||!0,M=C.cancelable||!0;return y.initEvent(C.type||"keydown",S,M),y.key=C.key||"",y.keyCode=C.keyCode||0,y.which=C.keyCode||0,y.ctrlKey=C.ctrlKey||!1,y.altKey=C.altKey||!1,y.shiftKey=C.shiftKey||!1,y.metaKey=C.metaKey||!1,y.view=C.view||window,y}})(db||(db={}));class mY{constructor(e){this.type="text",this.content=e}}class ame{constructor(e,t,i,s){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=s}}function za(n){let e={},t,i=[];for(let o=1,r=arguments.length;o=w.length){t(m[y],f);continue}let S=w[y],M=m[y];if(S===M){b=b.nextSibling;continue}if(S.type==="text"&&M.type==="text"){b.textContent!==M.content&&(b.textContent=M.content),b=b.nextSibling;continue}if(S.type==="text"||M.type==="text"){Wt.insert(w,y,M),t(M,f,b);continue}if(!S.renderer!=!M.renderer){Wt.insert(w,y,M),t(M,f,b);continue}let k=M.attrs.key;if(k&&k in v){let N=v[k];N.vNode!==S&&(Wt.move(w,w.indexOf(N.vNode,y+1),y),f.insertBefore(N.element,b),S=N.vNode,b=N.element)}if(S===M){b=b.nextSibling;continue}let F=S.attrs.key;if(F&&F!==k){Wt.insert(w,y,M),t(M,f,b);continue}if(S.tag!==M.tag){Wt.insert(w,y,M),t(M,f,b);continue}a(b,S.attrs,M.attrs),M.renderer?M.renderer.render(b,{attrs:M.attrs,children:M.children}):i(b,S.children,M.children),b=b.nextSibling}s(f,w,C,!0)}n.updateContent=i;function s(f,p,m,v){for(let w=p.length-1;w>=m;--w){const b=p[w],C=v?f.lastChild:f.childNodes[w];b.type==="text"||(b.renderer&&b.renderer.unrender?b.renderer.unrender(C,{attrs:b.attrs,children:b.children}):s(C,b.children,0,!1)),v&&f.removeChild(C)}}const o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(f,p){for(let m in p)m in o||(m.substr(0,2)==="on"?f[m]=p[m]:f.setAttribute(m,p[m]));p.className!==void 0&&f.setAttribute("class",p.className),p.htmlFor!==void 0&&f.setAttribute("for",p.htmlFor),p.dataset&&c(f,p.dataset),p.style&&d(f,p.style)}function a(f,p,m){if(p===m)return;let v;for(v in p)v in o||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in o||p[v]===m[v]||(v.substr(0,2)==="on"?f[v]=m[v]:f.setAttribute(v,m[v]));p.className!==m.className&&(m.className!==void 0?f.setAttribute("class",m.className):f.removeAttribute("class")),p.htmlFor!==m.htmlFor&&(m.htmlFor!==void 0?f.setAttribute("for",m.htmlFor):f.removeAttribute("for")),p.dataset!==m.dataset&&l(f,p.dataset||{},m.dataset||{}),p.style!==m.style&&h(f,p.style||{},m.style||{})}function c(f,p){for(let m in p)f.setAttribute(`data-${m}`,p[m])}function l(f,p,m){for(let v in p)v in m||f.removeAttribute(`data-${v}`);for(let v in m)p[v]!==m[v]&&f.setAttribute(`data-${v}`,m[v])}function d(f,p){let m=f.style,v;for(v in p)m[v]=p[v]}function h(f,p,m){let v=f.style,w;for(w in p)w in m||(v[w]="");for(w in m)p[w]!==m[w]&&(v[w]=m[w])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let w of p)w.type==="element"&&w.attrs.key&&(v[w.attrs.key]={vNode:w,element:m}),m=m.nextSibling;return v}})(VT||(VT={}));class KI{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var w_;(function(n){function e(o,r){let a=o.length;if(a===0)return r;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(r===d)return 0;if(r<=c){for(let m=0;m=l){for(let m=0;m0&&m>f;){let v=m,w=h;for(let b=0;b0&&m>f;){let v=m/p;for(let w=0;w0&&m>f;){let v=m,w=h;for(let b=0;b=C.maxSize?(m-=C.maxSize-C.size,h-=C.stretch,C.size=C.maxSize,C.done=!0,p--,u--):(m-=y,C.size+=y)}}for(;p>0&&m>f;){let v=m/p;for(let w=0;w=b.maxSize?(m-=b.maxSize-b.size,b.size=b.maxSize,b.done=!0,p--):(m-=v,b.size+=v))}}}return 0}n.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):s(o,r,-a))}n.adjust=t;function i(o,r,a){let c=0;for(let u=0;u<=r;++u){let f=o[u];c+=f.maxSize-f.size}let l=0;for(let u=r+1,f=o.length;u=0&&d>0;--u){let f=o[u],p=f.maxSize-f.size;p>=d?(f.sizeHint=f.size+d,d=0):(f.sizeHint=f.size+p,d-=p)}let h=a;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function s(o,r,a){let c=0;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.maxSize-p.size;m>=d?(p.sizeHint=p.size+d,d=0):(p.sizeHint=p.size+m,d-=m)}let h=a;for(let u=r;u>=0&&h>0;--u){let f=o[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(w_||(w_={}));class nLe{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new rl(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0&&(this._icon=e.icon),e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,rl.clearData(this))}}class ot{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new rl(this),this._hiddenMode=ot.HiddenMode.Display,this.node=ure.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(ot.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&ot.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),rl.clearData(this),Gt.clearData(this),Aw.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(ot.Flag.IsDisposed)}get isAttached(){return this.testFlag(ot.Flag.IsAttached)}get isHidden(){return this.testFlag(ot.Flag.IsHidden)}get isVisible(){return this.testFlag(ot.Flag.IsVisible)}get title(){return ure.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==ot.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-removed",this);Gt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-added",this);Gt.sendMessage(this._parent,t)}this.isDisposed||Gt.sendMessage(this,ot.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(ot.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return t===!0?(this.node.classList.add(e),!0):t===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){Gt.postMessage(this,ot.Msg.UpdateRequest)}fit(){Gt.postMessage(this,ot.Msg.FitRequest)}activate(){Gt.postMessage(this,ot.Msg.ActivateRequest)}close(){Gt.sendMessage(this,ot.Msg.CloseRequest)}show(){if(this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.BeforeShow),this.clearFlag(ot.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.AfterShow),this.parent)){let e=new ot.ChildMessage("child-shown",this);Gt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.BeforeHide),this.setFlag(ot.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.AfterHide),this.parent)){let e=new ot.ChildMessage("child-hidden",this);Gt.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(ot.Flag.IsVisible),this.setFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(ot.Flag.IsVisible),this.clearFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&ot.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case ot.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case ot.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(n){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(n.HiddenMode||(n.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(n.Flag||(n.Flag={})),function(o){o.BeforeShow=new ev("before-show"),o.AfterShow=new ev("after-show"),o.BeforeHide=new ev("before-hide"),o.AfterHide=new ev("after-hide"),o.BeforeAttach=new ev("before-attach"),o.AfterAttach=new ev("after-attach"),o.BeforeDetach=new ev("before-detach"),o.AfterDetach=new ev("after-detach"),o.ParentChanged=new ev("parent-changed"),o.UpdateRequest=new q3("update-request"),o.FitRequest=new q3("fit-request"),o.ActivateRequest=new q3("activate-request"),o.CloseRequest=new q3("close-request")}(n.Msg||(n.Msg={}));class e extends ev{constructor(r,a){super(r),this.child=a}}n.ChildMessage=e;class t extends ev{constructor(r,a){super("resize"),this.width=r,this.height=a}}n.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=n.ResizeMessage||(n.ResizeMessage={}));function i(o,r,a=null){if(o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");Gt.sendMessage(o,n.Msg.BeforeAttach),r.insertBefore(o.node,a),Gt.sendMessage(o,n.Msg.AfterAttach)}n.attach=i;function s(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");Gt.sendMessage(o,n.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),Gt.sendMessage(o,n.Msg.AfterDetach)}n.detach=s})(ot||(ot={}));var ure;(function(n){n.titleProperty=new Aw({name:"title",create:t=>new nLe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}n.createNode=e})(ure||(ure={}));class XF{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,rl.clearData(this),Aw.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const t of this)Gt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)Gt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)Gt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)Gt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)Gt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)Gt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(n){function e(o){return I2.horizontalAlignmentProperty.get(o)}n.getHorizontalAlignment=e;function t(o,r){I2.horizontalAlignmentProperty.set(o,r)}n.setHorizontalAlignment=t;function i(o){return I2.verticalAlignmentProperty.get(o)}n.getVerticalAlignment=i;function s(o,r){I2.verticalAlignmentProperty.set(o,r)}n.setVerticalAlignment=s})(XF||(XF={}));class sj{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=fc.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,s){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(s,this._maxHeight));if(o"center",changed:e}),n.verticalAlignmentProperty=new Aw({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(I2||(I2={}));class hue extends XF{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let i=this._widgets.indexOf(t),s=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Wt.insert(this._widgets,s,t),this.parent&&this.attachWidget(s,t);return}s===this._widgets.length&&s--,i!==s&&(Wt.move(this._widgets,i,s),this.parent&&this.moveWidget(i,s,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Wt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let i=this.parent.node.children[e];this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.AfterDetach);let s=this.parent.node.children[t];this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,s),this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach)}}var rq;(function(n){function e(t){return Math.max(0,Math.floor(t))}n.clampDimension=e})(rq||(rq={}));var aq=rq;class Kx extends hue{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,e.orientation!==void 0&&(this._orientation=e.orientation),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=rq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=rq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return fE.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,s=e.slice(0,i);for(;s.length0&&(o.sizeHint=o.size);w_.adjust(this._sizers,e,s),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let i=new sj(t),s=fE.createHandle(this.renderer),o=fE.averageSize(this._sizers),r=fE.createSizer(o);Wt.insert(this._items,e,i),Wt.insert(this._sizers,e,r),Wt.insert(this._handles,e,s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),Wt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Wt.removeAt(this._items,e),s=Wt.removeAt(this._handles,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,i,s,o,r,a){const c=this._items[e];if(c.isHidden)return;let l=this._handles[e].style;t?(i+=this.widgetOffset,c.update(i,s,a,o),i+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(s+=this.widgetOffset,c.update(i,s,r,a),s+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let c=0,l=this._items.length;c0&&(h.sizeHint=h.size),d.isHidden){h.minSize=0,h.maxSize=0;continue}d.fit(),h.stretch=Kx.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,s+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,s=Math.max(s,d.minWidth))}let r=this._box=fc.boxSizing(this.parent.node);s+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${s}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&Gt.sendMessage(this.parent.parent,ot.Msg.FitRequest),this._dirty&&Gt.sendMessage(this.parent,ot.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,u=this._items.length;h0){let h;if(d?h=Math.max(0,r-this._fixed):h=Math.max(0,a-this._fixed),this._hasNormedSizes){for(let f of this._sizers)f.sizeHint*=h;this._hasNormedSizes=!1}let u=w_.calc(this._sizers,h);if(u>0)switch(this._alignment){case"start":break;case"center":c=0,l=u/2;break;case"end":c=0,l=u;break;case"justify":c=u/i,l=0;break;default:throw"unreachable"}}for(let h=0,u=this._items.length;h0,coerce:(r,a)=>Math.max(0,Math.floor(a)),changed:o});function e(r){let a=new KI;return a.sizeHint=Math.floor(r),a}n.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}n.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}n.averageSize=i;function s(r){let a=r.length;if(a===0)return[];let c=r.reduce((l,d)=>l+Math.abs(d),0);return c===0?r.map(l=>1/a):r.map(l=>l/c)}n.normalize=s;function o(r){r.parent&&r.parent.layout instanceof Kx&&r.parent.fit()}})(fE||(fE={}));class jZt extends Kx{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=aq.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const i=this._titles[e],s=i.classList.contains("lm-mod-expanded"),o=gre.createTitle(this.renderer,t.title,s);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${X1e.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=gre.createTitle(this.renderer,t.title);Wt.insert(this._titles,e,i),this.parent.node.appendChild(i),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",i.id),super.attachWidget(e,t)}moveWidget(e,t,i){Wt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Wt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,s,o,r,a){const c=this._titles[e].style;c.top=`${s}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,s,o,r,a)}}var gre;(function(n){function e(t,i,s=!0){const o=t.createSectionTitle(i);return o.style.position="absolute",o.style.contain="strict",o.setAttribute("aria-label",`${i.label} Section`),o.setAttribute("aria-expanded",s?"true":"false"),o.setAttribute("aria-controls",i.owner.id),s&&o.classList.add("lm-mod-expanded"),o}n.createTitle=e})(gre||(gre={}));class Krt extends ot{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=sLe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var sLe;(function(n){function e(t){return t.layout||new hue}n.createLayout=e})(sLe||(sLe={}));class $4 extends Krt{constructor(e={}){super({layout:oLe.createLayout(e)}),this._handleMoved=new rl(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=Wt.findFirstIndex(t.handles,l=>l.contains(e.target));if(i===-1)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?s=e.clientX-r.left:s=e.clientY-r.top;let a=window.getComputedStyle(o),c=Xu.overrideCursor(a.cursor);this._pressData={index:i,delta:s,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,s=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-s.left-this._pressData.delta:t=e.clientY-s.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}(function(n){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}n.Renderer=e,n.defaultRenderer=new e;function t(s){return Kx.getStretch(s)}n.getStretch=t;function i(s,o){Kx.setStretch(s,o)}n.setStretch=i})($4||($4={}));var oLe;(function(n){function e(t){return t.layout||new Kx({renderer:t.renderer||$4.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}n.createLayout=e})(oLe||(oLe={}));class rLe extends $4{constructor(e={}){super({...e,layout:aLe.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new rl(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=Wt.findFirstIndex(this.widgets,i=>i.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,i=t.widgets[e];if(!i)return;const s=i.isHidden,o=t.absoluteSizes(),r=(s?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(s){const l=this._widgetSizesCache.get(i);if(!l)return;c[e]+=l;const d=c.map(h=>h-l>0).lastIndexOf(!0);d===-1?c.forEach((h,u)=>{u!==e&&(c[u]-=o[u]/a*(l-r))}):c[d]-=l-r}else{const l=o[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=o[d]+l+r}return c.map(l=>l/(a+r))}_evtClick(e){const t=e.target;if(t){const i=Wt.findFirstIndex(this.titles,s=>s.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let i=!1;if(t){const s=Wt.findFirstIndex(this.titles,o=>o.contains(t));if(s>=0){const o=e.keyCode.toString();if(e.key.match(/Space|Enter/)||o.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||o.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||o.match(/38|40/)){const r=e.key.match(/ArrowLeft|ArrowUp/)||o.match(/37|38/)?-1:1,a=this.titles.length,c=(s+a+r)%a;this.titles[c].focus(),i=!0}else e.key==="End"||o==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||o==="36")&&(this.titles[0].focus(),i=!0)}i&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],i=this.layout.widgets[e],s=this._computeWidgetSize(e);s&&this.setRelativeSizes(s,!1),i.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),i.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),i.hide()),this._expansionToggled.emit(e)}}(function(n){class e extends $4.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(i){return document.createElement("span")}createSectionTitle(i){const s=document.createElement("h3");s.setAttribute("tabindex","0"),s.id=this.createTitleKey(i),s.className=this.titleClassName;for(const a in i.dataset)s.dataset[a]=i.dataset[a];const o=s.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=s.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,s}createTitleKey(i){let s=this._titleKeys.get(i);return s===void 0&&(s=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,s)),s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e})(rLe||(rLe={}));var aLe;(function(n){function e(t){return t.layout||new jZt({renderer:t.renderer||rLe.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}n.createLayout=e})(aLe||(aLe={}));class Yv extends hue{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",e.direction!==void 0&&(this._direction=e.direction),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){Wt.insert(this._items,e,new sj(t)),Wt.insert(this._sizers,e,new KI),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let a=0,c=this._items.length;a0)switch(this._alignment){case"start":break;case"center":l=0,d=c/2;break;case"end":l=0,d=c;break;case"justify":l=c/i,d=0;break;default:throw"unreachable"}for(let h=0,u=this._items.length;h0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i}),n.sizeBasisProperty=new Aw({name:"sizeBasis",create:()=>0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i});function e(s){return s==="left-to-right"||s==="right-to-left"}n.isHorizontal=e;function t(s){return Math.max(0,Math.floor(s))}n.clampSpacing=t;function i(s){s.parent&&s.parent.layout instanceof Yv&&s.parent.fit()}})(NR||(NR={}));class x7e extends Krt{constructor(e={}){super({layout:cLe.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}(function(n){function e(o){return Yv.getStretch(o)}n.getStretch=e;function t(o,r){Yv.setStretch(o,r)}n.setStretch=t;function i(o){return Yv.getSizeBasis(o)}n.getSizeBasis=i;function s(o,r){Yv.setSizeBasis(o,r)}n.setSizeBasis=s})(x7e||(x7e={}));var cLe;(function(n){function e(t){return t.layout||new Yv(t)}n.createLayout=e})(cLe||(cLe={}));class fre extends ot{constructor(e){super({node:TA.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||fre.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=TA.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>TA.createItem(this.commands,i));return t.forEach(i=>this._items.push(i)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){Wt.removeAt(this._items,e)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,i=this.contentNode,s=this._results;if(s||(s=this._results=TA.search(this._items,t),this._activeIndex=t?Wt.findFirstIndex(s,TA.canActivate):-1),!t&&s.length===0){jI.render(null,i);return}if(t&&s.length===0){let c=this.renderer.renderEmptyMessage({query:t});jI.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(s.length);for(let c=0,l=s.length;c=s.length)i.scrollTop=0;else{let c=i.children[r];fc.scrollIntoViewIfNeeded(i,c)}}_evtClick(e){if(e.button!==0)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=Wt.findFirstIndex(this.contentNode.children,i=>i.contains(e.target));t!==-1&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,i=eF-N),M=b.slice(0,S),k=b.slice(S);for(let F=0,N=k.length;Fm.command===f&&Hl.deepEqual(m.args,p))||null}}})(TA||(TA={}));class aw extends ot{constructor(e){super({node:Nf.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new rl(this),this._menuRequested=new rl(this),this.addClass("lm-Menu"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||aw.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),e!==-1&&!Nf.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,i=t{this.activeIndex=a}})}jI.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(t===38){this.activatePreviousItem();return}if(t===39){let r=this.activeItem;r&&r.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=hre().keyForKeydownEvent(e);if(!i)return;let s=this._activeIndex+1,o=Nf.findMnemonic(this._items,i,s);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.triggerActiveItem()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>fc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;!i||i.type!=="submenu"||!i.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:i}=e;if(fc.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Nf.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let i=t.submenu;if(i===this._childMenu)return;aw.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,Gt.sendMessage(this,ot.Msg.UpdateRequest);let s=this.contentNode.children[this._activeIndex];Nf.openSubmenu(i,s),e&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},Nf.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Nf.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Nf.saveWindowData()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return za.li({className:s,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let s=this.createIconClass(i);return za.div({className:s},i.item.icon,i.item.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return za.div({className:"lm-Menu-itemLabel"},s)}renderShortcut(i){let s=this.formatShortcut(i);return za.div({className:"lm-Menu-itemShortcut"},s)}renderSubmenu(i){return za.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let s="lm-Menu-item";i.item.isEnabled||(s+=" lm-mod-disabled"),i.item.isToggled&&(s+=" lm-mod-toggled"),i.item.isVisible||(s+=" lm-mod-hidden"),i.active&&(s+=" lm-mod-active"),i.collapsed&&(s+=" lm-mod-collapsed");let o=i.item.className;return o&&(s+=` ${o}`),s}createItemDataset(i){let s,{type:o,command:r,dataset:a}=i.item;return o==="command"?s={...a,type:o,command:r}:s={...a,type:o},s}createIconClass(i){let s="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${s} ${o}`:s}createItemARIA(i){let s={};switch(i.item.type){case"separator":s.role="presentation";break;case"submenu":s["aria-haspopup"]="true",i.item.isEnabled||(s["aria-disabled"]="true");break;default:i.item.isEnabled||(s["aria-disabled"]="true"),s.role="menuitem"}return s}formatLabel(i){let{label:s,mnemonic:o}=i.item;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=za.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let s=i.item.keyBinding;return s?eA.formatKeystroke(s.keys):null}}n.Renderer=e,n.defaultRenderer=new e})(aw||(aw={}));var Nf;(function(n){n.TIMER_DELAY=300,n.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function s(){e=d(),t++}n.saveWindowData=s;function o(){let m=document.createElement("div"),v=document.createElement("ul");return v.className="lm-Menu-content",m.appendChild(v),v.setAttribute("role","menu"),m.tabIndex=0,m}n.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}n.canActivate=r;function a(m,v){return new p(m.commands,v)}n.createItem=a;function c(m,v,w){for(let b=m;b;b=b.childMenu)if(fc.hitTest(b.node,v,w))return!0;return!1}n.hitTestMenus=c;function l(m){let v=new Array(m.length);Wt.fill(v,!1);let w=0,b=m.length;for(;w=0;--C){let S=m[C];if(S.isVisible){if(S.type!=="separator")break;v[C]=!0}}let y=!1;for(;++wk+N&&(v=k+N-re),!C&&w+me>F+z&&(w>F+z?w=F+z-me:w=w-me),j.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,w)}px`,j.opacity="1"}n.openRootMenu=h;function u(m,v){const w=i();let b=w.pageXOffset,C=w.pageYOffset,y=w.clientWidth,S=w.clientHeight;Gt.sendMessage(m,ot.Msg.UpdateRequest);let M=S,k=m.node,F=k.style;F.opacity="0",F.maxHeight=`${M}px`,ot.attach(m,document.body);let{width:N,height:z}=k.getBoundingClientRect(),U=fc.boxSizing(m.node),J=v.getBoundingClientRect(),j=J.right-n.SUBMENU_OVERLAP;j+N>b+y&&(j=J.left+n.SUBMENU_OVERLAP-N);let re=J.top-U.borderTop-U.paddingTop;re+z>C+S&&(re=J.bottom+U.borderBottom+U.paddingBottom-z),F.transform=`translate(${Math.max(0,j)}px, ${Math.max(0,re)}px`,F.opacity="1"}n.openSubmenu=u;function f(m,v,w){let b=-1,C=-1,y=!1,S=v.toUpperCase();for(let M=0,k=m.length;M=0&&Ub.command===v&&Hl.deepEqual(b.args,w))||null}return null}}})(Nf||(Nf={}));var D7e;(function(n){function e(r,a){let c=i(r.selector),l=r.rank!==void 0?r.rank:1/0;return{...r,selector:c,rank:l,id:a}}n.createItem=e;function t(r,a,c,l){let d=a.target;if(!d)return null;let h=a.currentTarget;if(!h||!h.contains(d)&&(d=document.elementFromPoint(a.clientX,a.clientY),!d||!h.contains(d)))return null;let u=[],f=r.slice();for(;d!==null;){let p=[];for(let m=0,v=f.length;m=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,i=this._titles[t]||null,s=e,o=this._titles[s]||null;this._currentIndex=s,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:s,currentTitle:o})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let i=cv.asTitle(t),s=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return s===-1?(Wt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,s===o||(Wt.move(this._titles,s,o),this.update(),this._adjustCurrentForMove(s,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Wt.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let i of this._titles)i.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),e!==-1&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let i=this._titles,s=this.renderer,o=this.currentTitle,r=new Array(i.length);const a=(t=this._getCurrentTabindex())!==null&&t!==void 0?t:this._currentIndex>-1?this._currentIndex:0;for(let c=0,l=i.length;cfc.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let s=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=s.label||"",a=o.innerHTML;o.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=r,o.appendChild(c);let l=()=>{c.removeEventListener("blur",l),o.innerHTML=a,this.node.addEventListener("keydown",this)};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(s.label=s.caption=c.value),l()):d.key==="Escape"&&l()}),this.node.removeEventListener("keydown",this),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),e.key==="Escape"&&this._releaseMouse())}_evtKeyDown(e){var t,i,s;if(!(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE)){if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){const o=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(o))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const r=Wt.findFirstIndex(this.contentNode.children,a=>a.contains(o));r>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=r)}}else if(KZt.includes(e.key)){const o=[...this.contentNode.children];if(this.addButtonEnabled&&o.push(this.addButtonNode),o.length<=1)return;e.preventDefault(),e.stopPropagation();let r=o.indexOf(document.activeElement);r===-1&&(r=this._currentIndex);let a;e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"?a=(t=o[r+1])!==null&&t!==void 0?t:o[0]:e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"?a=(i=o[r-1])!==null&&i!==void 0?i:o[o.length-1]:e.key==="Home"?a=o[0]:e.key==="End"&&(a=o[o.length-1]),a&&((s=o[r])===null||s===void 0||s.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,s=Wt.findFirstIndex(i,r=>fc.hitTest(r,e.clientX,e.clientY));if(s===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[s],index:s,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),e.button===1||t))return;let o=i[s].querySelector(this.renderer.closeIconSelector);o&&o.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===s?this.currentIndex=-1:this.currentIndex=s,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let i=this.contentNode.children;if(!(!t.dragActive&&!cv.dragExceeded(t,e))){if(!t.dragActive){let s=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=s.width,t.tabPressPos=t.pressX-s.left):(t.tabPos=t.tab.offsetTop,t.tabSize=s.height,t.tabPressPos=t.pressY-s.top),t.tabPressOffset={x:t.pressX-s.left,y:t.pressY-s.top},t.tabLayout=cv.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=Xu.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&cv.detachExceeded(t,e)){t.detachRequested=!0;let s=t.index,o=e.clientX,r=e.clientY,a=i[s],c=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:c,tab:a,clientX:o,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}cv.layoutTabs(i,t,e,this._orientation)}}_evtPointerUp(e){if(e.button!==0&&e.button!==1)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}let o=this.contentNode.children,r=Wt.findFirstIndex(o,l=>fc.hitTest(l,e.clientX,e.clientY));if(r!==t.index)return;let a=this._titles[r];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:r,title:a});return}let c=o[r].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:r,title:a});return}return}if(e.button!==0)return;cv.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=cv.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,cv.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let s=t.index,o=t.targetIndex;o===-1||s===o||(Wt.move(this._titles,s,o),this._adjustCurrentForMove(s,o),this._tabMoved.emit({fromIndex:s,toIndex:o,title:this._titles[o]}),Gt.sendMessage(this,ot.Msg.UpdateRequest))},i)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(cv.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let i=this.currentTitle,s=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&s===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:s,previousTitle:i,currentIndex:e,currentTitle:t});return}s>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let i=this._currentIndex,s=this.removeBehavior;if(i!==e){i>e&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(s==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-tab-before"){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}}(function(n){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let s=i.title.caption,o=this.createTabKey(i),r=o,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?za.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):za.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:s}=i;let o=this.createIconClass(i);return za.div({className:o},s.icon,s.iconLabel)}renderLabel(i){return za.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return za.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let s=this._tabKeys.get(i.title);return s===void 0&&(s=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,s)),s}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let s="lm-TabBar-tab";return i.title.className&&(s+=` ${i.title.className}`),i.title.closable&&(s+=" lm-mod-closable"),i.current&&(s+=" lm-mod-current"),s}createTabDataset(i){return i.title.dataset}createTabARIA(i){var s;return{role:"tab","aria-selected":i.current.toString(),tabindex:`${(s=i.tabIndex)!==null&&s!==void 0?s:"-1"}`}}createIconClass(i){let s="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e,n.addButtonSelector=".lm-TabBar-addButton"})(ZF||(ZF={}));var cv;(function(n){n.DRAG_THRESHOLD=5,n.DETACH_THRESHOLD=20;function e(){let d=document.createElement("div"),h=document.createElement("ul");h.setAttribute("role","tablist"),h.className="lm-TabBar-content",d.appendChild(h);let u=document.createElement("div");return u.className="lm-TabBar-addButton lm-mod-hidden",u.setAttribute("tabindex","-1"),u.setAttribute("role","button"),d.appendChild(u),d}n.createNode=e;function t(d){return d instanceof nLe?d:new nLe(d)}n.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}n.parseTransitionDuration=i;function s(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=n.DRAG_THRESHOLD||f>=n.DRAG_THRESHOLD}n.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+n.DETACH_THRESHOLD||h.clientY=u.bottom+n.DETACH_THRESHOLD}n.detachExceeded=r;function a(d,h,u,f){let p,m,v,w;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,w=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,w=h.contentRect.height);let b=h.index,C=m-h.tabPressPos,y=C+h.tabSize;for(let S=0,M=d.length;S>1);if(Sh.index&&y>N)k=`${-h.tabSize-F.margin}px`,b=Math.max(b,S);else if(S===h.index){let z=v-p,U=w-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,U))}px`}else k="";f==="horizontal"?d[S].style.left=k:d[S].style.top=k}h.targetIndex=b}n.layoutTabs=a;function c(d,h){let u;h==="horizontal"?u=d.contentRect.width:u=d.contentRect.height;let f;if(d.targetIndex===d.index)f=0;else if(d.targetIndex>d.index){let v=d.tabLayout[d.targetIndex];f=v.pos+v.size-d.tabSize-d.tabPos}else f=d.tabLayout[d.targetIndex].pos-d.tabPos;let p=u-(d.tabPos+d.tabSize),m=Math.max(-d.tabPos,Math.min(f,p));h==="horizontal"?d.tab.style.left=`${m}px`:d.tab.style.top=`${m}px`}n.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}n.resetTabPositions=l})(cv||(cv={}));class YZt extends XF{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:ot.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const t of this.tabBars())if(t.titles.length>1)for(const i of t.titles)i.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():V5()}widgets(){return this._root?this._root.iterUserWidgets():V5()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():V5()}tabBars(){return this._root?this._root.iterTabBars():V5()}handles(){return this._root?this._root.iterHandles():V5()}moveHandle(e,t,i){let s=e.classList.contains("lm-mod-hidden");if(!this._root||s)return;let o=this._root.findSplitNode(e);if(!o)return;let r;o.node.orientation==="horizontal"?r=t-e.offsetLeft:r=i-e.offsetTop,r!==0&&(o.node.holdSizes(),w_.adjust(o.node.sizers,o.index,r),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,i;e.main?i=hd.normalizeAreaConfig(e.main,t):i=null;let s=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of s)t.has(a)||(a.parent=null);for(const a of o)a.dispose();for(const a of r)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=hd.realizeAreaConfig(i,{createTabBar:a=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(a=>{this.attachWidget(a)}),this.parent.fit())}addWidget(e,t={}){let i=t.ref||null,s=t.mode||"tab-after",o=null;if(this._root&&i&&(o=this._root.findTabNode(i)),i&&!o)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,s){case"tab-after":this._insertTab(e,i,o,!0);break;case"tab-before":this._insertTab(e,i,o,!1);break;case"split-top":this._insertSplit(e,i,o,"vertical",!1);break;case"split-left":this._insertSplit(e,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,o,"vertical",!0);break;case"merge-top":this._insertSplit(e,i,o,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,i,o,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,i,o,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,i,o,"vertical",!0,!0);break}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=fc.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),s=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(s,o);if(!r)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=r,u=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=i.width-u-(l+d),m=i.height-f-(c+h);return{tabBar:a,x:s,y:o,top:c,left:l,right:p,bottom:m,width:d,height:h}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new sj(e)),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(hd.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===ot.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=ot.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let i=t.parent;t.parent=null;let s=Wt.removeFirstOf(i.children,t),o=Wt.removeAt(i.handles,s);if(Wt.removeAt(i.sizers,s),o.parentNode&&o.parentNode.removeChild(o),i.children.length>1){i.syncHandles();return}let r=i.parent;i.parent=null;let a=i.children[0],c=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,c.parentNode&&c.parentNode.removeChild(c),this._root===i){a.parent=null,this._root=a;return}let l=r,d=l.children.indexOf(i);if(a instanceof hd.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Wt.removeAt(l.handles,d);Wt.removeAt(l.children,d),Wt.removeAt(l.sizers,d),h.parentNode&&h.parentNode.removeChild(h);for(let u=0,f=a.children.length;u=this._left+this._width||p=this._top+this._height?null:this}createConfig(){let f=this.tabBar.titles.map(m=>m.owner),p=this.tabBar.currentIndex;return{type:"tab-area",widgets:f,currentIndex:p}}holdAllSizes(){}fit(f,p){let m=0,v=0,w=1/0,b=1/0,C=p.get(this.tabBar),y=this.tabBar.currentTitle,S=y?p.get(y.owner):void 0,[M,k]=this.sizers;return C&&C.fit(),S&&S.fit(),C&&!C.isHidden?(m=Math.max(m,C.minWidth),v+=C.minHeight,M.minSize=C.minHeight,M.maxSize=C.maxHeight):(M.minSize=0,M.maxSize=0),S&&!S.isHidden?(m=Math.max(m,S.minWidth),v+=S.minHeight,k.minSize=S.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b}}update(f,p,m,v,w,b){this._top=p,this._left=f,this._width=m,this._height=v;let C=b.get(this.tabBar),y=this.tabBar.currentTitle,S=y?b.get(y.owner):void 0;if(w_.calc(this.sizers,v),C&&!C.isHidden){let M=this.sizers[0].size;C.update(f,p,m,M),p+=M}if(S&&!S.isHidden){let M=this.sizers[1].size;S.update(f,p,m,M)}}}n.TabLayoutNode=s;class o{constructor(f){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=f}*iterAllWidgets(){for(const f of this.children)yield*f.iterAllWidgets()}*iterUserWidgets(){for(const f of this.children)yield*f.iterUserWidgets()}*iterSelectedWidgets(){for(const f of this.children)yield*f.iterSelectedWidgets()}*iterTabBars(){for(const f of this.children)yield*f.iterTabBars()}*iterHandles(){yield*this.handles;for(const f of this.children)yield*f.iterHandles()}findTabNode(f){for(let p=0,m=this.children.length;pv.createConfig());return{type:"split-area",orientation:f,children:m,sizes:p}}syncHandles(){this.handles.forEach((f,p)=>{f.setAttribute("data-orientation",this.orientation),p===this.handles.length-1?f.classList.add("lm-mod-hidden"):f.classList.remove("lm-mod-hidden")})}holdSizes(){for(const f of this.sizers)f.sizeHint=f.size}holdAllSizes(){for(const f of this.children)f.holdAllSizes();this.holdSizes()}normalizeSizes(){let f=this.sizers.length;if(f===0)return;this.holdSizes();let p=this.sizers.reduce((m,v)=>m+v.sizeHint,0);if(p===0)for(const m of this.sizers)m.size=m.sizeHint=1/f;else for(const m of this.sizers)m.size=m.sizeHint/=p;this.normalized=!0}createNormalizedSizes(){let f=this.sizers.length;if(f===0)return[];let p=this.sizers.map(v=>v.size),m=p.reduce((v,w)=>v+w,0);if(m===0)for(let v=p.length-1;v>-1;v--)p[v]=1/f;else for(let v=p.length-1;v>-1;v--)p[v]/=m;return p}fit(f,p){let m=this.orientation==="horizontal",v=Math.max(0,this.children.length-1)*f,w=m?v:0,b=m?0:v,C=1/0,y=1/0;for(let S=0,M=this.children.length;S=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let w=0,b=u.children.length;w{let b=i(v,f,p),C=e(u.sizes[w]),y=f.createHandle();m.children.push(b),m.handles.push(y),m.sizers.push(C),b.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(hd||(hd={}));class cq extends ot{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new rl(this),this._addRequested=new rl(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||cq.defaultRenderer,this._edges=e.edges||Fl.DEFAULT_EDGES,e.tabsMovable!==void 0&&(this._tabsMovable=e.tabsMovable),e.tabsConstrained!==void 0&&(this._tabsConstrained=e.tabsConstrained),e.addButtonEnabled!==void 0&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new YZt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new cq.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const i of t.tabBars())i.show();break;case"single-document":t.restoreLayout(Fl.createSingleDocumentConfig(this));break;default:throw"unreachable"}Gt.postMessage(this,Fl.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=Y1e(this.tabBars(),i=>i.titles.indexOf(e.title)!==-1);if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(jp.IS_EDGE||jp.IS_IE)&&Gt.flush(),Gt.postMessage(this,Fl.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),Gt.postMessage(this,Fl.LayoutModified)}processMessage(e){e.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){Fl.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Fl.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),Gt.postMessage(this,Fl.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),!(this._tabsConstrained&&e.source!==this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:i}=e,{zone:s,target:o}=Fl.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||s==="invalid"){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof a!="function"){e.dropAction="none";return}let c=a();if(!(c instanceof ot)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?Fl.getDropRef(o.tabBar):null;switch(s){case"root-all":this.addWidget(c);break;case"root-top":this.addWidget(c,{mode:"split-top"});break;case"root-left":this.addWidget(c,{mode:"split-left"});break;case"root-right":this.addWidget(c,{mode:"split-right"});break;case"root-bottom":this.addWidget(c,{mode:"split-bottom"});break;case"widget-all":this.addWidget(c,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(c,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(c,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(c,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(c,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(c,{mode:"tab-after",ref:l});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(c)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&(this._releaseMouse(),Gt.postMessage(this,Fl.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,s=Y1e(t.handles(),d=>d.contains(i));if(!s)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let o=s.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(s),l=Xu.overrideCursor(c.cursor,this._document);this._pressData={handle:s,deltaX:r,deltaY:a,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,s=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,s)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),Gt.postMessage(this,Fl.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:i,target:s}=Fl.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=fc.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=d.height*Fl.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*Fl.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*Fl.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*Fl.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=s.top,r=s.left,a=s.right,c=s.bottom;break;case"widget-top":o=s.top,r=s.left,a=s.right,c=s.bottom+s.height/2;break;case"widget-left":o=s.top,r=s.left,a=s.right+s.width/2,c=s.bottom;break;case"widget-right":o=s.top,r=s.left+s.width/2,a=s.right,c=s.bottom;break;case"widget-bottom":o=s.top+s.height/2,r=s.left,a=s.right,c=s.bottom;break;case"widget-tab":{const h=s.tabBar.node.getBoundingClientRect().height;o=s.top,r=s.left,a=s.right,c=s.bottom+s.height-h;break}default:throw"unreachable"}return this.overlay.show({top:o,left:r,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return Fl.isGeneratedTabBarProperty.set(e,!0),this._mode==="single-document"&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){Gt.postMessage(this,Fl.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:s}=t;i&&i.owner.hide(),s&&s.owner.show(),(jp.IS_EDGE||jp.IS_IE)&&Gt.flush(),Gt.postMessage(this,Fl.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:i,tab:s,clientX:o,clientY:r,offset:a}=t,c=new $Zt,l=()=>i.owner;c.setData("application/vnd.lumino.widget-factory",l);let d=s.cloneNode(!0);a&&(d.style.top=`-${a.y}px`,d.style.left=`-${a.x}px`),this._drag=new Xu({document:this._document,mimeData:c,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden");let h=()=>{this._drag=null,s.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(h)}}(function(n){class e{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(s){let o=this.node.style;o.top=`${s.top}px`,o.left=`${s.left}px`,o.right=`${s.right}px`,o.bottom=`${s.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(s){if(!this._hidden){if(s<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},s))}}}n.Overlay=e;class t{createTabBar(s){let o=new ZF({document:s});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let s=document.createElement("div");return s.className="lm-DockPanel-handle",s}}n.Renderer=t,n.defaultRenderer=new t})(cq||(cq={}));var Fl;(function(n){n.GOLDEN_RATIO=.618,n.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},n.LayoutModified=new q3("layout-modified"),n.isGeneratedTabBarProperty=new Aw({name:"isGeneratedTabBar",create:()=>!1});function e(s){if(s.isEmpty)return{main:null};let o=Array.from(s.widgets()),r=s.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}n.createSingleDocumentConfig=e;function t(s,o,r,a){if(!fc.hitTest(s.node,o,r))return{zone:"invalid",target:null};let c=s.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(s.mode==="multiple-document"){let C=s.node.getBoundingClientRect(),y=o-C.left+1,S=r-C.top+1,M=C.right-o,k=C.bottom-r;switch(Math.min(S,M,k,y)){case S:if(Sm&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let w=Math.min(d,h,u,f),b;switch(w){case d:b="widget-left";break;case h:b="widget-top";break;case u:b="widget-right";break;case f:b="widget-bottom";break;default:throw"unreachable"}return{zone:b,target:l}}n.findDropTarget=t;function i(s){return s.titles.length===0?null:s.currentTitle?s.currentTitle.owner:s.titles[s.titles.length-1].owner}n.getDropRef=i})(Fl||(Fl={}));class KM extends XF{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new KI],this._columnSizers=[new KI],this._box=null,e.rowCount!==void 0&&yh.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&yh.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=yh.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=yh.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(yh.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(yh.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=yh.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=yh.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let i=this._rowSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let i=this._columnSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){Wt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new sj(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Wt.findFirstIndex(this._items,s=>s.widget===e);if(t===-1)return;let i=Wt.removeAt(this._items,t);this.parent&&this.detachWidget(e),i.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let c=0,l=this.rowCount;c!c.isHidden);for(let c=0,l=e.length;c({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function e(c){let l=Math.max(0,Math.floor(c.row||0)),d=Math.max(0,Math.floor(c.column||0)),h=Math.max(1,Math.floor(c.rowSpan||0)),u=Math.max(1,Math.floor(c.columnSpan||0));return{row:l,column:d,rowSpan:h,columnSpan:u}}n.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}n.clampValue=t;function i(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}n.rowSpanCmp=i;function s(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}n.columnSpanCmp=s;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}n.reallocSizers=o;function r(c,l,d,h){if(d=h)return;let f=(h-u)/(d-l+1);for(let p=l;p<=d;++p)c[p].minSize+=f}n.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof KM&&c.parent.fit()}})(yh||(yh={}));class lq extends ot{constructor(e={}){super({node:pre.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(ot.Flag.DisallowLayout),this.renderer=e.renderer||lq.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&this._menus[e].items.length===0&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,i=!0){this._closeChildMenu();let s=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(s===-1){Wt.insert(this._menus,o,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),i&&this.update();return}o===this._menus.length&&o--,s!==o&&(Wt.move(this._menus,s,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Wt.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,s=this.renderer,o=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:i.length,c=0,l=!1;a=this._overflowMenu!==null?a-1:a;let d=new Array(a);for(let h=0;h{this._tabFocusIndex=h,this.activeIndex=h}}),c+=this._menuItemSizes[h],i[h].title.label===this._overflowMenuOptions.title&&(l=!0,a--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(this._overflowMenu===null){const h=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new aw({commands:new eA}),this._overflowMenu.title.label=h,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let h=i.length-2;h>=a;h--){const u=this.menus[h];u.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:u}),this.removeMenu(u,!1)}d[a]=s.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}else if(this._overflowMenu!==null){let h=this._overflowMenu.items,u=this.node.offsetWidth,f=this._overflowMenu.items.length;for(let p=0;pthis._menuItemSizes[m]){let v=h[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,v,!1),d[a]=s.renderItem({title:v.title,active:!1,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}jI.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,s=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&s===-1&&(s=r)}else for(let r=0;rt){s=r;break}this._overflowIndex=s}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),t===13||t===32||t===38||t===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(t===37||t===39){let r=t===37?-1:1,a=this._tabFocusIndex+r,c=this._menus.length;for(let l=0;lfc.hitTest(i,e.clientX,e.clientY));if(t===-1){this._closeChildMenu();return}if(e.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const i=this._positionForMenu(t);aw.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>fc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;aw.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:s}=t.getBoundingClientRect();return{top:s,left:i}}_evtFocusOut(e){!this._childMenu&&!this.node.contains(e.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let i=this._childMenu;if(i===t)return;this._childMenu=t,i?i.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,Gt.sendMessage(this,ot.Msg.UpdateRequest);let{left:s,top:o}=e;(typeof s>"u"||typeof o>"u")&&({left:s,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(s,o,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let i=this._activeIndex,s=this._menus.length;switch(t){case"next":this.activeIndex=i===s-1?0:i+1;break;case"previous":this.activeIndex=i===0?s-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return za.li({className:s,dataset:o,...i.disabled?{}:{tabindex:i.tabbable?"0":"-1"},onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let s=this.createIconClass(i);return za.div({className:s},i.title.icon,i.title.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return za.div({className:"lm-MenuBar-itemLabel"},s)}createItemClass(i){let s="lm-MenuBar-item";return i.title.className&&(s+=` ${i.title.className}`),i.active&&!i.disabled&&(s+=" lm-mod-active"),s}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true","aria-disabled":i.disabled?"true":"false"}}createIconClass(i){let s="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}formatLabel(i){let{label:s,mnemonic:o}=i.title;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=za.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}n.Renderer=e,n.defaultRenderer=new e})(lq||(lq={}));var pre;(function(n){function e(){let i=document.createElement("div"),s=document.createElement("ul");return s.className="lm-MenuBar-content",i.appendChild(s),s.setAttribute("role","menubar"),i}n.createNode=e;function t(i,s,o){let r=-1,a=-1,c=!1,l=s.toUpperCase();for(let d=0,h=i.length;d=0&&p1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===ot.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=ot.HiddenMode.Scale),t.hiddenMode=ot.HiddenMode.Scale):t.hiddenMode=ot.HiddenMode.Display,Wt.insert(this._items,e,new sj(t)),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===ot.HiddenMode.Scale&&(t.hiddenMode=ot.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=ot.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let o=0,r=this._items.length;othis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(s))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,oe.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,s){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});s===void 0&&(s=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},s)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return Ot.MEMORY;if(e.workspaceFolder?.override!==void 0)return Ot.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return Ot.WORKSPACE;if(e.userRemote?.override!==void 0)return Ot.USER_REMOTE;if(e.userLocal?.override!==void 0)return Ot.USER_LOCAL}return e.memory?.value!==void 0?Ot.MEMORY:e.workspaceFolder?.value!==void 0?Ot.WORKSPACE_FOLDER:e.workspace?.value!==void 0?Ot.WORKSPACE:e.userRemote?.value!==void 0?Ot.USER_REMOTE:Ot.USER_LOCAL}_getValue(e,t,i){const s=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:s})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}toResourceConfigurationChangeEvent(e){return{affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>{const s=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:s})}}}};lLe=D([_(0,Re),_(1,Ai),_(2,Di)],lLe);const uue=".vscode",mre="settings",XZt=`${uue}/${mre}.json`,ZZt="vscode://schemas/settings/default",eei="vscode://schemas/settings/user",tei="vscode://schemas/settings/profile",iei="vscode://schemas/settings/machine",Yrt="vscode://schemas/settings/workspace",nei="vscode://schemas/settings/folder",sei="vscode://schemas/launch",oei="vscode://schemas/tasks";ut.APPLICATION;const rei=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Jrt=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],aei=[ut.APPLICATION,...Jrt],cme=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],WX=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Xrt=[ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],$p="tasks",kk="launch",VOe=Object.create(null);VOe[$p]=`${uue}/${$p}.json`;VOe[kk]=`${uue}/${kk}.json`;const Zrt=Object.create(null);Zrt[$p]=`${$p}.json`;const cei=`{ +`+s)}}return Promise.resolve([e.toString(),null,null])}async function BZt(n,e){const t=e.pathname.split("/");return t[3]==="blob"?(t.splice(3,1),Promise.resolve([e.protocol+"//raw.githubusercontent.com"+t.join("/"),null,null])):Promise.resolve([e.toString(),null,null])}async function WZt(n,e){try{const t=new URL(e);if(t.hostname==="gist.github.com")return OZt(n,t);if(t.hostname==="github.com")return BZt(n,t)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Wt;(function(n){function e(k,F,N=0,z=-1){let U=k.length;if(U===0)return-1;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;z0;){let me=re>>1,De=j+me;N(k[De],F)<0?(j=De+1,re-=me+1):re=me}return j}n.lowerBound=a;function c(k,F,N,z=0,U=-1){let J=k.length;if(J===0)return 0;z<0?z=Math.max(0,z+J):z=Math.min(z,J-1),U<0?U=Math.max(0,U+J):U=Math.min(U,J-1);let j=z,re=U-z+1;for(;re>0;){let me=re>>1,De=j+me;N(k[De],F)>0?re=me:(j=De+1,re-=me+1)}return j}n.upperBound=c;function l(k,F,N){if(k===F)return!0;if(k.length!==F.length)return!1;for(let z=0,U=k.length;z=J&&(N=U<0?J-1:J),z===void 0?z=U<0?-1:J:z<0?z=Math.max(z+J,U<0?-1:0):z>=J&&(z=U<0?J-1:J);let j;U<0&&z>=N||U>0&&N>=z?j=0:U<0?j=Math.floor((z-N+1)/U+1):j=Math.floor((z-N-1)/U+1);let re=[];for(let me=0;me=z))return;let J=z-N+1;if(F>0?F=F%J:F<0&&(F=(F%J+J)%J),F===0)return;let j=N+F;u(k,N,j-1),u(k,j,z),u(k,N,z)}n.rotate=f;function p(k,F,N=0,z=-1){let U=k.length;if(U===0)return;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J;zF;--U)k[U]=k[U-1];k[F]=N}n.insert=m;function v(k,F){let N=k.length;if(F<0&&(F+=N),F<0||F>=N)return;let z=k[F];for(let U=F+1;U=N&&j<=z&&k[j]===F||z=N)&&k[j]===F?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllOf=C;function y(k,F,N=0,z=-1){let U,J=i(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeFirstWhere=y;function S(k,F,N=-1,z=0){let U,J=s(k,F,N,z);return J!==-1&&(U=v(k,J)),{index:J,value:U}}n.removeLastWhere=S;function M(k,F,N=0,z=-1){let U=k.length;if(U===0)return 0;N<0?N=Math.max(0,N+U):N=Math.min(N,U-1),z<0?z=Math.max(0,z+U):z=Math.min(z,U-1);let J=0;for(let j=0;j=N&&j<=z&&F(k[j],j)||z=N)&&F(k[j],j)?J++:J>0&&(k[j-J]=k[j]);return J>0&&(k.length=U-J),J}n.removeAllWhere=M})(Wt||(Wt={}));function*V5(){}function Y1e(n,e){let t=0;for(const i of n)if(e(i,t++))return i}function HZt(n,e){let t=0;for(const i of n)if(e(i,t++)===!1)return!1;return!0}function UZt(n,e){let t=0;for(const i of n)if(e(i,t++))return!0;return!1}var y7e;(function(n){function e(t,i,s){return s===0?1/0:t>i&&s>0||t-1;e--)yield n[e]}function zZt(n){let e=[],t=new Set,i=new Map;for(const r of n)s(r);for(const[r]of i)o(r);return e;function s(r){let[a,c]=r,l=i.get(c);l?l.push(a):i.set(c,[a])}function o(r){if(t.has(r))return;t.add(r);let a=i.get(r);if(a)for(const c of a)o(c);e.push(r)}}var oq;(function(n){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}n.cmp=o})(oq||(oq={}));var Hl;(function(n){n.emptyObject=Object.freeze({}),n.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}n.isPrimitive=e;function t(d){return Array.isArray(d)}n.isArray=t;function i(d){return!e(d)&&!t(d)}n.isObject=i;function s(d,h){if(d===h)return!0;if(e(d)||e(h))return!1;let u=t(d),f=t(h);return u!==f?!1:u&&f?r(d,h):a(d,h)}n.deepEqual=s;function o(d){return e(d)?d:t(d)?c(d):l(d)}n.deepCopy=o;function r(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===r.provides)return!0;const f=c.get(u);if(!f)return!1;const p=a.get(f),m=[...p.requires,...p.optional];return m.length===0?!1:(h.push(f),m.some(d)?!0:(h.pop(),!1))};if(!r.provides||l.length===0)return;const h=[r.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}n.ensureNoCycle=i;function s(r,a,c){const l=new Array,d=m=>{const v=a.get(m),w=[...v.requires,...v.optional];l.push(...w.reduce((b,C)=>{const y=c.get(C);return y&&b.push([m,y]),b},[]))};for(const m of a.keys())d(m);const h=l.filter(m=>m[1]===r);let u=0;for(;h.length>u;){const m=h.length,v=new Set(h.map(w=>w[0]));for(const w of v)l.filter(b=>b[1]===w).forEach(b=>{h.includes(b)||h.push(b)});u=m}const f=zZt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}n.findDependents=s;function o(r,a){const c=new Set;for(const l of r.keys())r.get(l).autoStart===!0&&c.add(l);if(a.startPlugins)for(const l of a.startPlugins)c.add(l);if(a.ignorePlugins)for(const l of a.ignorePlugins)c.delete(l);return Array.from(c)}n.collectStartupPlugins=o})(S7e||(S7e={}));function GZt(n){let e=0;for(let t=0,i=n.length;t>>0),n[t]=e&255,e>>>=8}var J1e;(function(n){n.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:GZt})()})(J1e||(J1e={}));function qZt(n){const e=new Uint8Array(16),t=new Array(256);for(let i=0;i<16;++i)t[i]="0"+i.toString(16);for(let i=16;i<256;++i)t[i]=i.toString(16);return function(){return n(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+"-"+t[e[4]]+t[e[5]]+"-"+t[e[6]]+t[e[7]]+"-"+t[e[8]]+t[e[9]]+"-"+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}}var X1e;(function(n){n.uuid4=qZt(J1e.getRandomValues)})(X1e||(X1e={}));var A7e;(function(n){function e(t){const i=document.body,s=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",s,!0)};i.addEventListener("copy",s,!0),document.execCommand("copy")}n.copyText=e})(A7e||(A7e={}));var pc;(function(n){function e(o){let r=window.getComputedStyle(o),a=parseFloat(r.borderTopWidth)||0,c=parseFloat(r.borderLeftWidth)||0,l=parseFloat(r.borderRightWidth)||0,d=parseFloat(r.borderBottomWidth)||0,h=parseFloat(r.paddingTop)||0,u=parseFloat(r.paddingLeft)||0,f=parseFloat(r.paddingRight)||0,p=parseFloat(r.paddingBottom)||0,m=c+u+f+l,v=a+h+p+d;return{borderTop:a,borderLeft:c,borderRight:l,borderBottom:d,paddingTop:h,paddingLeft:u,paddingRight:f,paddingBottom:p,horizontalSum:m,verticalSum:v}}n.boxSizing=e;function t(o){let r=window.getComputedStyle(o),a=parseFloat(r.minWidth)||0,c=parseFloat(r.minHeight)||0,l=parseFloat(r.maxWidth)||1/0,d=parseFloat(r.maxHeight)||1/0;return l=Math.max(a,l),d=Math.max(c,d),{minWidth:a,minHeight:c,maxWidth:l,maxHeight:d}}n.sizeLimits=t;function i(o,r,a){let c=o.getBoundingClientRect();return r>=c.left&&r=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){o.scrollTop-=a.top-c.top;return}if(c.topa.height){o.scrollTop-=a.bottom-c.bottom;return}if(c.bottom>a.bottom&&c.height{let d=Element.prototype;return d.matches||d.matchesSelector||d.mozMatchesSelector||d.msMatchesSelector||d.oMatchesSelector||d.webkitMatchesSelector||function(h){let u=this,f=u.ownerDocument?u.ownerDocument.querySelectorAll(h):[];return Array.prototype.indexOf.call(f,u)!==-1}})();function e(d){d=d.split(",",1)[0];let h=0,u=0,f=0;function p(m){let v=d.match(m);return v===null?!1:(d=d.slice(v[0].length),!0)}for(d=d.replace(l," $1 ");d.length>0;){if(p(t)){h++;continue}if(p(i)){u++;continue}if(p(s)){u++;continue}if(p(r)){f++;continue}if(p(a)){u++;continue}if(p(o)){f++;continue}if(!p(c))return 0}return h=Math.min(h,255),u=Math.min(u,255),f=Math.min(f,255),h<<16|u<<8|f}n.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,s=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(ob||(ob={}));class Z1e{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new LA.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new LA.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.prev;return i.next=s,i.prev=o,s.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof LA.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new LA.LinkedListNode(this,e),s=t,o=s.next;return i.next=o,i.prev=s,s.next=i,o.prev=i,this._size++,i}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof LA.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}(function(n){function e(t){let i=new n;return i.assign(t),i}n.from=e})(Z1e||(Z1e={}));var LA;(function(n){class e{constructor(i,s){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=s}}n.LinkedListNode=e})(LA||(LA={}));let ev=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class q3 extends ev{get isConflatable(){return!0}conflate(e){return!0}}var Gt;(function(n){let e=null;const t=(F=>N=>{let z=!1;return F.then(()=>!z&&N()),()=>{z=!0}})(Promise.resolve());function i(F,N){let z=u.get(F);if(!z||z.length===0){w(F,N);return}HZt(VZt(z),J=>J?v(J,F,N):!0)&&w(F,N)}n.sendMessage=i;function s(F,N){if(!N.isConflatable){b(F,N);return}UZt(h,U=>U.handler!==F||!U.msg||U.msg.type!==N.type||!U.msg.isConflatable?!1:U.msg.conflate(N))||b(F,N)}n.postMessage=s;function o(F,N){let z=u.get(F);z&&z.indexOf(N)!==-1||(z?z.push(N):u.set(F,[N]))}n.installMessageHook=o;function r(F,N){let z=u.get(F);if(!z)return;let U=z.indexOf(N);U!==-1&&(z[U]=null,y(z))}n.removeMessageHook=r;function a(F){let N=u.get(F);N&&N.length>0&&(Wt.fill(N,null),y(N));for(const z of h)z.handler===F&&(z.handler=null,z.msg=null)}n.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,C(),m=!1)}n.flush=c;function l(){return p}n.getExceptionHandler=l;function d(F){let N=p;return p=F,N}n.setExceptionHandler=d;const h=new Z1e,u=new WeakMap,f=new Set;let p=F=>{console.error(F)},m=!1;function v(F,N,z){let U=!0;try{typeof F=="function"?U=F(N,z):U=F.messageHook(N,z)}catch(J){p(J)}return U}function w(F,N){try{F.processMessage(N)}catch(z){p(z)}}function b(F,N){h.addLast({handler:F,msg:N}),e===null&&(e=t(C))}function C(){if(e=null,h.isEmpty)return;let F={handler:null,msg:null};for(h.addLast(F);;){let N=h.removeFirst();if(N===F)return;N.handler&&N.msg&&i(N.handler,N.msg)}}function y(F){f.size===0&&t(S),f.add(F)}function S(){f.forEach(M),f.clear()}function M(F){Wt.removeAllWhere(F,k)}function k(F){return F===null}})(Gt||(Gt={}));class Aw{constructor(e){this._pid=MR.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,i=MR.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,s=MR.ensureMap(e);this._pid in s?i=s[this._pid]:i=s[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,s[this._pid]=o)}coerce(e){let t,i=MR.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=s)}_createValue(e){let t=this._create;return t(e)}_coerceValue(e,t){let i=this._coerce;return i?i(e,t):t}_compareValue(e,t){let i=this._compare;return i?i(e,t):e===t}_maybeNotify(e,t,i){let s=this._changed;s&&!this._compareValue(t,i)&&s(e,t,i)}}(function(n){function e(t){MR.ownerData.delete(t)}n.clearData=e})(Aw||(Aw={}));var MR;(function(n){n.ownerData=new WeakMap,n.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=n.ownerData.get(t);return i||(i=Object.create(null),n.ownerData.set(t,i),i)}n.ensureMap=e})(MR||(MR={}));class rl{constructor(e){this.sender=e}connect(e,t){return i_.connect(this,e,t)}disconnect(e,t){return i_.disconnect(this,e,t)}emit(e){i_.emit(this,e)}}(function(n){function e(c,l){i_.disconnectBetween(c,l)}n.disconnectBetween=e;function t(c){i_.disconnectSender(c)}n.disconnectSender=t;function i(c){i_.disconnectReceiver(c)}n.disconnectReceiver=i;function s(c){i_.disconnectAll(c)}n.disconnectAll=s;function o(c){i_.disconnectAll(c)}n.clearData=o;function r(){return i_.exceptionHandler}n.getExceptionHandler=r;function a(c){let l=i_.exceptionHandler;return i_.exceptionHandler=c,l}n.setExceptionHandler=a})(rl||(rl={}));var i_;(function(n){n.exceptionHandler=b=>{console.error(b)};function e(b,C,y){y=y||void 0;let S=c.get(b.sender);if(S||(S=[],c.set(b.sender,S)),u(S,b,C,y))return!1;let M=y||C,k=l.get(M);k||(k=[],l.set(M,k));let F={signal:b,slot:C,thisArg:y};return S.push(F),k.push(F),!0}n.connect=e;function t(b,C,y){y=y||void 0;let S=c.get(b.sender);if(!S||S.length===0)return!1;let M=u(S,b,C,y);if(!M)return!1;let k=y||C,F=l.get(k);return M.signal=null,p(S),p(F),!0}n.disconnect=t;function i(b,C){let y=c.get(b);if(!y||y.length===0)return;let S=l.get(C);if(!(!S||S.length===0)){for(const M of S)M.signal&&M.signal.sender===b&&(M.signal=null);p(y),p(S)}}n.disconnectBetween=i;function s(b){let C=c.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.thisArg||y.slot;y.signal=null,p(l.get(S))}p(C)}}n.disconnectSender=s;function o(b){let C=l.get(b);if(!(!C||C.length===0)){for(const y of C){if(!y.signal)continue;let S=y.signal.sender;y.signal=null,p(c.get(S))}p(C)}}n.disconnectReceiver=o;function r(b){s(b),o(b)}n.disconnectAll=r;function a(b,C){let y=c.get(b.sender);if(!(!y||y.length===0))for(let S=0,M=y.length;SM.signal===C&&M.slot===y&&M.thisArg===S)}function f(b,C){let{signal:y,slot:S,thisArg:M}=b;try{S.call(M,y.sender,C)}catch(k){n.exceptionHandler(k)}}function p(b){d.size===0&&h(m),d.add(b)}function m(){d.forEach(v),d.clear()}function v(b){Wt.removeAllWhere(b,w)}function w(b){return b.signal===null}})(i_||(i_={}));class eLe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class tLe{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(tLe||(tLe={}));class E7e extends tLe{constructor(){super(...arguments),this._disposed=new rl(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),rl.clearData(this))}}(function(n){function e(t){let i=new n;for(const s of t)i.add(s);return i}n.from=e})(E7e||(E7e={}));class Xu{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:s}=this._scrollTarget,o=Rg.SCROLL_EDGE_SIZE-s,r=Math.pow(o/Rg.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Rg.SCROLL_EDGE_SIZE));switch(i){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});Rg.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(s=>{this._resolve=s});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(i),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage)return;let i=this.dragImage.style;i.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),e.button!==0)return;if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Rg.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Rg.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=Rg.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,s=this._currentElement,o=Rg.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==s&&o!==i&&Rg.dispatchDragExit(this,i,o,e),o!==s&&o!==i&&(i=Rg.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Rg.dispatchDragLeave(this,t,i,e));let r=Rg.dispatchDragOver(this,i,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=Rg.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=Xu.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=Xu.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=Xu.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=Xu.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}(function(n){class e extends DragEvent{constructor(s,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:s.altKey,button:s.button,clientX:s.clientX,clientY:s.clientY,ctrlKey:s.ctrlKey,detail:0,metaKey:s.metaKey,relatedTarget:o.related,screenX:s.screenX,screenY:s.screenY,shiftKey:s.shiftKey,view:window});const{drag:r}=o;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}n.Event=e;function t(i,s=document){return Rg.overrideCursor(i,s)}n.overrideCursor=t})(Xu||(Xu={}));var Rg;(function(n){n.SCROLL_EDGE_SIZE=20;function e(y,S){return h[y]&u[S]?y:"none"}n.validateAction=e;function t(y,S=document){if(y){if(i&&y==i.event)return i.element;n.cursorBackdrop.style.zIndex="-1000";const M=S.elementFromPoint(y.clientX,y.clientY);return n.cursorBackdrop.style.zIndex="",i={event:y,element:M},M}else{const M=n.cursorBackdrop.style.transform;if(s&&M===s.transform)return s.element;const k=n.cursorBackdrop.getBoundingClientRect();n.cursorBackdrop.style.zIndex="-1000";const F=S.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return n.cursorBackdrop.style.zIndex="",s={transform:M,element:F},F}}n.findElementBehindBackdrop=t;let i=null,s=null;function o(y){let S=y.clientX,M=y.clientY,k=t(y);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let F=0,N=0;k===document.body&&(F=window.pageXOffset,N=window.pageYOffset);let z=k.getBoundingClientRect(),U=z.top+N,J=z.left+F,j=J+z.width,re=U+z.height;if(S=j||M=re)continue;let me=S-J+1,De=M-U+1,Qe=j-S,Tt=re-M,Oe=Math.min(me,De,Qe,Tt);if(Oe>n.SCROLL_EDGE_SIZE)continue;let wt;switch(Oe){case Tt:wt="bottom";break;case De:wt="top";break;case Qe:wt="right";break;case me:wt="left";break;default:throw"unreachable"}let Nt=k.scrollWidth-k.clientWidth,Ji=k.scrollHeight-k.clientHeight,Vi;switch(wt){case"top":Vi=Ji>0&&k.scrollTop>0;break;case"left":Vi=Nt>0&&k.scrollLeft>0;break;case"right":Vi=Nt>0&&k.scrollLeft0&&k.scrollTop{M===C&&n.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),n.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(n.cursorBackdrop))})}n.overrideCursor=f;function p(y){n.cursorBackdrop&&(n.cursorBackdrop.style.transform=`translate(${y.clientX}px, ${y.clientY}px)`)}function m(y){if(!n.cursorBackdrop)return;let S=t();if(!S)return;const M=S.closest("[data-lm-dragscroll]");M&&(M.scrollTop+=n.cursorBackdrop.scrollTop-w,M.scrollLeft+=n.cursorBackdrop.scrollLeft-w,v())}function v(){n.cursorBackdrop.scrollTop=w,n.cursorBackdrop.scrollLeft=w}const w=500;function b(){const y=document.createElement("div");return y.classList.add("lm-cursor-backdrop"),y}let C=0;n.cursorBackdrop=b()})(Rg||(Rg={}));function hre(){return iLe.keyboardLayout}class z4{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=z4.extractKeys(t),this._modifierKeys=z4.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}(function(n){function e(i){let s=Object.create(null);for(let o in i)s[i[o]]=!0;return s}n.extractKeys=e;function t(i){let s=Object(null);for(let o=0,r=i.length;o{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(e!==void 0&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return Promise.resolve((i=s?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Hl.emptyObject){var i;let s=this._commands.get(e);return(i=s?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Hl.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Hl.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Hl.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let s;try{s=i.execute.call(void 0,t)}catch(r){s=Promise.reject(r)}let o=Promise.resolve(s);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=db.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new eLe(()=>{Wt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=eA.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(eA.isModifierKeyPressed(e)){let{exact:r}=db.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:s}=db.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=s.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||s.some(r=>r.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!o){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},db.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},db.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(db.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const o=[...this._keydownEvents],r=(await Promise.race([Promise.all(o.map(async a=>{var c;return(c=this._holdKeyBindingPromises.get(a))!==null&&c!==void 0?c:Promise.resolve(!0)})),new Promise(a=>{setTimeout(()=>a([!1]),db.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,s={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,s)){let o=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${o}.`;console.warn(`${a} ${c}`);return}await this.execute(t,s)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}(function(n){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?jp.IS_MAC?d=!0:h=!0:f==="Alt"?l=!0:f==="Cmd"?d=!0:f==="Ctrl"?h=!0:f==="Shift"?u=!0:f.length>0&&(c=f);return{cmd:d,ctrl:h,alt:l,shift:u,key:c}}n.parseKeystroke=e;function t(a){let c="",l=e(a);return l.ctrl&&(c+="Ctrl "),l.alt&&(c+="Alt "),l.shift&&(c+="Shift "),l.cmd&&jp.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}n.normalizeKeystroke=t;function i(a){let c;return jp.IS_WIN?c=a.winKeys||a.keys:jp.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}n.normalizeKeys=i;function s(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=jp.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),jp.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(db.formatKey).join(h)}}n.formatKeystroke=s;function o(a){let c=hre(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}n.isModifierKeyPressed=o;function r(a){let c=hre(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&jp.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}n.keystrokeForKeydownEvent=r})(eA||(eA={}));var db;(function(n){n.CHORD_TIMEOUT=1e3,n.KEYBINDING_HOLD_TIMEOUT=1e3,n.modifierkeyTimeOut=500;function e(C){return{execute:C.execute,describedBy:p(typeof C.describedBy=="function"?C.describedBy:{args:null,...C.describedBy},()=>({args:null})),label:p(C.label,c),mnemonic:p(C.mnemonic,l),icon:p(C.icon,f),iconClass:p(C.iconClass,c),iconLabel:p(C.iconLabel,c),caption:p(C.caption,c),usage:p(C.usage,c),className:p(C.className,c),dataset:p(C.dataset,u),isEnabled:C.isEnabled||d,isToggled:C.isToggled||h,isToggleable:C.isToggleable||!!C.isToggled,isVisible:C.isVisible||d}}n.createCommand=e;function t(C){var y;return{keys:eA.normalizeKeys(C),selector:m(C),command:C.command,args:C.args||Hl.emptyObject,preventDefault:(y=C.preventDefault)!==null&&y!==void 0?y:!0}}n.createKeyBinding=t;function i(C,y,S){let M=null,k=[],F=1/0,N=0;for(let z=0,U=C.length;zF)continue;let me=$E.calculateSpecificity(J.selector);(!M||re=N)&&(M=J,F=re,N=me)}return{exact:M,partial:k}}n.matchKeyBinding=i;function s(C){C.target.dispatchEvent(b(C))}n.replayKeyEvent=s;function o(C){return jp.IS_MAC?r.hasOwnProperty(C)?r[C]:C:a.hasOwnProperty(C)?a[C]:C}n.formatKey=o;const r={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},a={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},c=()=>"",l=()=>-1,d=()=>!0,h=()=>!1,u=()=>({}),f=()=>{};function p(C,y){return C===void 0?y:typeof C=="function"?C:()=>C}function m(C){if(C.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${C.selector}`);if(!$E.isValid(C.selector))throw new Error(`Invalid selector: ${C.selector}`);return C.selector}function v(C,y){if(C.lengthy.length?2:1}function w(C,y){let S=y.target,M=y.currentTarget;for(let k=0;S!==null;S=S.parentElement,++k){if(S.hasAttribute("data-lm-suppress-shortcuts"))return-1;if($E.matches(S,C))return k;if(S===M)return-1}return-1}function b(C){let y=document.createEvent("Event"),S=C.bubbles||!0,M=C.cancelable||!0;return y.initEvent(C.type||"keydown",S,M),y.key=C.key||"",y.keyCode=C.keyCode||0,y.which=C.keyCode||0,y.ctrlKey=C.ctrlKey||!1,y.altKey=C.altKey||!1,y.shiftKey=C.shiftKey||!1,y.metaKey=C.metaKey||!1,y.view=C.view||window,y}})(db||(db={}));class mY{constructor(e){this.type="text",this.content=e}}class ame{constructor(e,t,i,s){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=s}}function za(n){let e={},t,i=[];for(let o=1,r=arguments.length;o=w.length){t(m[y],f);continue}let S=w[y],M=m[y];if(S===M){b=b.nextSibling;continue}if(S.type==="text"&&M.type==="text"){b.textContent!==M.content&&(b.textContent=M.content),b=b.nextSibling;continue}if(S.type==="text"||M.type==="text"){Wt.insert(w,y,M),t(M,f,b);continue}if(!S.renderer!=!M.renderer){Wt.insert(w,y,M),t(M,f,b);continue}let k=M.attrs.key;if(k&&k in v){let N=v[k];N.vNode!==S&&(Wt.move(w,w.indexOf(N.vNode,y+1),y),f.insertBefore(N.element,b),S=N.vNode,b=N.element)}if(S===M){b=b.nextSibling;continue}let F=S.attrs.key;if(F&&F!==k){Wt.insert(w,y,M),t(M,f,b);continue}if(S.tag!==M.tag){Wt.insert(w,y,M),t(M,f,b);continue}a(b,S.attrs,M.attrs),M.renderer?M.renderer.render(b,{attrs:M.attrs,children:M.children}):i(b,S.children,M.children),b=b.nextSibling}s(f,w,C,!0)}n.updateContent=i;function s(f,p,m,v){for(let w=p.length-1;w>=m;--w){const b=p[w],C=v?f.lastChild:f.childNodes[w];b.type==="text"||(b.renderer&&b.renderer.unrender?b.renderer.unrender(C,{attrs:b.attrs,children:b.children}):s(C,b.children,0,!1)),v&&f.removeChild(C)}}const o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function r(f,p){for(let m in p)m in o||(m.substr(0,2)==="on"?f[m]=p[m]:f.setAttribute(m,p[m]));p.className!==void 0&&f.setAttribute("class",p.className),p.htmlFor!==void 0&&f.setAttribute("for",p.htmlFor),p.dataset&&c(f,p.dataset),p.style&&d(f,p.style)}function a(f,p,m){if(p===m)return;let v;for(v in p)v in o||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in o||p[v]===m[v]||(v.substr(0,2)==="on"?f[v]=m[v]:f.setAttribute(v,m[v]));p.className!==m.className&&(m.className!==void 0?f.setAttribute("class",m.className):f.removeAttribute("class")),p.htmlFor!==m.htmlFor&&(m.htmlFor!==void 0?f.setAttribute("for",m.htmlFor):f.removeAttribute("for")),p.dataset!==m.dataset&&l(f,p.dataset||{},m.dataset||{}),p.style!==m.style&&h(f,p.style||{},m.style||{})}function c(f,p){for(let m in p)f.setAttribute(`data-${m}`,p[m])}function l(f,p,m){for(let v in p)v in m||f.removeAttribute(`data-${v}`);for(let v in m)p[v]!==m[v]&&f.setAttribute(`data-${v}`,m[v])}function d(f,p){let m=f.style,v;for(v in p)m[v]=p[v]}function h(f,p,m){let v=f.style,w;for(w in p)w in m||(v[w]="");for(w in m)p[w]!==m[w]&&(v[w]=m[w])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let w of p)w.type==="element"&&w.attrs.key&&(v[w.attrs.key]={vNode:w,element:m}),m=m.nextSibling;return v}})(VT||(VT={}));class KI{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var w_;(function(n){function e(o,r){let a=o.length;if(a===0)return r;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(r===d)return 0;if(r<=c){for(let m=0;m=l){for(let m=0;m0&&m>f;){let v=m,w=h;for(let b=0;b0&&m>f;){let v=m/p;for(let w=0;w0&&m>f;){let v=m,w=h;for(let b=0;b=C.maxSize?(m-=C.maxSize-C.size,h-=C.stretch,C.size=C.maxSize,C.done=!0,p--,u--):(m-=y,C.size+=y)}}for(;p>0&&m>f;){let v=m/p;for(let w=0;w=b.maxSize?(m-=b.maxSize-b.size,b.size=b.maxSize,b.done=!0,p--):(m-=v,b.size+=v))}}}return 0}n.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):s(o,r,-a))}n.adjust=t;function i(o,r,a){let c=0;for(let u=0;u<=r;++u){let f=o[u];c+=f.maxSize-f.size}let l=0;for(let u=r+1,f=o.length;u=0&&d>0;--u){let f=o[u],p=f.maxSize-f.size;p>=d?(f.sizeHint=f.size+d,d=0):(f.sizeHint=f.size+p,d-=p)}let h=a;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function s(o,r,a){let c=0;for(let u=r+1,f=o.length;u0;++u){let p=o[u],m=p.maxSize-p.size;m>=d?(p.sizeHint=p.size+d,d=0):(p.sizeHint=p.size+m,d-=m)}let h=a;for(let u=r;u>=0&&h>0;--u){let f=o[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(w_||(w_={}));class nLe{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new rl(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0&&(this._icon=e.icon),e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,rl.clearData(this))}}class ot{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new rl(this),this._hiddenMode=ot.HiddenMode.Display,this.node=ure.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(ot.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&ot.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),rl.clearData(this),Gt.clearData(this),Aw.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(ot.Flag.IsDisposed)}get isAttached(){return this.testFlag(ot.Flag.IsAttached)}get isHidden(){return this.testFlag(ot.Flag.IsHidden)}get isVisible(){return this.testFlag(ot.Flag.IsVisible)}get title(){return ure.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==ot.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-removed",this);Gt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new ot.ChildMessage("child-added",this);Gt.sendMessage(this._parent,t)}this.isDisposed||Gt.sendMessage(this,ot.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(ot.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return t===!0?(this.node.classList.add(e),!0):t===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){Gt.postMessage(this,ot.Msg.UpdateRequest)}fit(){Gt.postMessage(this,ot.Msg.FitRequest)}activate(){Gt.postMessage(this,ot.Msg.ActivateRequest)}close(){Gt.sendMessage(this,ot.Msg.CloseRequest)}show(){if(this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.BeforeShow),this.clearFlag(ot.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.AfterShow),this.parent)){let e=new ot.ChildMessage("child-shown",this);Gt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(ot.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.BeforeHide),this.setFlag(ot.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&Gt.sendMessage(this,ot.Msg.AfterHide),this.parent)){let e=new ot.ChildMessage("child-hidden",this);Gt.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(ot.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(ot.Flag.IsVisible),this.setFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(ot.Flag.IsVisible),this.clearFlag(ot.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&ot.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case ot.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case ot.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case ot.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case ot.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(n){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(n.HiddenMode||(n.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(n.Flag||(n.Flag={})),function(o){o.BeforeShow=new ev("before-show"),o.AfterShow=new ev("after-show"),o.BeforeHide=new ev("before-hide"),o.AfterHide=new ev("after-hide"),o.BeforeAttach=new ev("before-attach"),o.AfterAttach=new ev("after-attach"),o.BeforeDetach=new ev("before-detach"),o.AfterDetach=new ev("after-detach"),o.ParentChanged=new ev("parent-changed"),o.UpdateRequest=new q3("update-request"),o.FitRequest=new q3("fit-request"),o.ActivateRequest=new q3("activate-request"),o.CloseRequest=new q3("close-request")}(n.Msg||(n.Msg={}));class e extends ev{constructor(r,a){super(r),this.child=a}}n.ChildMessage=e;class t extends ev{constructor(r,a){super("resize"),this.width=r,this.height=a}}n.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=n.ResizeMessage||(n.ResizeMessage={}));function i(o,r,a=null){if(o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");Gt.sendMessage(o,n.Msg.BeforeAttach),r.insertBefore(o.node,a),Gt.sendMessage(o,n.Msg.AfterAttach)}n.attach=i;function s(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");Gt.sendMessage(o,n.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),Gt.sendMessage(o,n.Msg.AfterDetach)}n.detach=s})(ot||(ot={}));var ure;(function(n){n.titleProperty=new Aw({name:"title",create:t=>new nLe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}n.createNode=e})(ure||(ure={}));class XF{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,rl.clearData(this),Aw.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const t of this)Gt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)Gt.sendMessage(t,ot.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)Gt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)Gt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)Gt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)Gt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||Gt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(n){function e(o){return I2.horizontalAlignmentProperty.get(o)}n.getHorizontalAlignment=e;function t(o,r){I2.horizontalAlignmentProperty.set(o,r)}n.setHorizontalAlignment=t;function i(o){return I2.verticalAlignmentProperty.get(o)}n.getVerticalAlignment=i;function s(o,r){I2.verticalAlignmentProperty.set(o,r)}n.setVerticalAlignment=s})(XF||(XF={}));class sj{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=pc.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,s){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(s,this._maxHeight));if(o"center",changed:e}),n.verticalAlignmentProperty=new Aw({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(I2||(I2={}));class hue extends XF{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let i=this._widgets.indexOf(t),s=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Wt.insert(this._widgets,s,t),this.parent&&this.attachWidget(s,t);return}s===this._widgets.length&&s--,i!==s&&(Wt.move(this._widgets,i,s),this.parent&&this.moveWidget(i,s,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Wt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let i=this.parent.node.children[e];this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.AfterDetach);let s=this.parent.node.children[t];this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,s),this.parent.isAttached&&Gt.sendMessage(i,ot.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach)}}var rq;(function(n){function e(t){return Math.max(0,Math.floor(t))}n.clampDimension=e})(rq||(rq={}));var aq=rq;class Kx extends hue{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,e.orientation!==void 0&&(this._orientation=e.orientation),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=rq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=rq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return fE.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,s=e.slice(0,i);for(;s.length0&&(o.sizeHint=o.size);w_.adjust(this._sizers,e,s),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let i=new sj(t),s=fE.createHandle(this.renderer),o=fE.averageSize(this._sizers),r=fE.createSizer(o);Wt.insert(this._items,e,i),Wt.insert(this._sizers,e,r),Wt.insert(this._handles,e,s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),Wt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Wt.removeAt(this._items,e),s=Wt.removeAt(this._handles,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(s),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,i,s,o,r,a){const c=this._items[e];if(c.isHidden)return;let l=this._handles[e].style;t?(i+=this.widgetOffset,c.update(i,s,a,o),i+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(s+=this.widgetOffset,c.update(i,s,r,a),s+=a,l.top=`${s}px`,l.left=`${i}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let c=0,l=this._items.length;c0&&(h.sizeHint=h.size),d.isHidden){h.minSize=0,h.maxSize=0;continue}d.fit(),h.stretch=Kx.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,s+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,s=Math.max(s,d.minWidth))}let r=this._box=pc.boxSizing(this.parent.node);s+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${s}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&Gt.sendMessage(this.parent.parent,ot.Msg.FitRequest),this._dirty&&Gt.sendMessage(this.parent,ot.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,u=this._items.length;h0){let h;if(d?h=Math.max(0,r-this._fixed):h=Math.max(0,a-this._fixed),this._hasNormedSizes){for(let f of this._sizers)f.sizeHint*=h;this._hasNormedSizes=!1}let u=w_.calc(this._sizers,h);if(u>0)switch(this._alignment){case"start":break;case"center":c=0,l=u/2;break;case"end":c=0,l=u;break;case"justify":c=u/i,l=0;break;default:throw"unreachable"}}for(let h=0,u=this._items.length;h0,coerce:(r,a)=>Math.max(0,Math.floor(a)),changed:o});function e(r){let a=new KI;return a.sizeHint=Math.floor(r),a}n.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}n.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}n.averageSize=i;function s(r){let a=r.length;if(a===0)return[];let c=r.reduce((l,d)=>l+Math.abs(d),0);return c===0?r.map(l=>1/a):r.map(l=>l/c)}n.normalize=s;function o(r){r.parent&&r.parent.layout instanceof Kx&&r.parent.fit()}})(fE||(fE={}));class jZt extends Kx{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=aq.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const i=this._titles[e],s=i.classList.contains("lm-mod-expanded"),o=gre.createTitle(this.renderer,t.title,s);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${X1e.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=gre.createTitle(this.renderer,t.title);Wt.insert(this._titles,e,i),this.parent.node.appendChild(i),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",i.id),super.attachWidget(e,t)}moveWidget(e,t,i){Wt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Wt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,s,o,r,a){const c=this._titles[e].style;c.top=`${s}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,s,o,r,a)}}var gre;(function(n){function e(t,i,s=!0){const o=t.createSectionTitle(i);return o.style.position="absolute",o.style.contain="strict",o.setAttribute("aria-label",`${i.label} Section`),o.setAttribute("aria-expanded",s?"true":"false"),o.setAttribute("aria-controls",i.owner.id),s&&o.classList.add("lm-mod-expanded"),o}n.createTitle=e})(gre||(gre={}));class Krt extends ot{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=sLe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var sLe;(function(n){function e(t){return t.layout||new hue}n.createLayout=e})(sLe||(sLe={}));class $4 extends Krt{constructor(e={}){super({layout:oLe.createLayout(e)}),this._handleMoved=new rl(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=Wt.findFirstIndex(t.handles,l=>l.contains(e.target));if(i===-1)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?s=e.clientX-r.left:s=e.clientY-r.top;let a=window.getComputedStyle(o),c=Xu.overrideCursor(a.cursor);this._pressData={index:i,delta:s,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,s=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-s.left-this._pressData.delta:t=e.clientY-s.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}(function(n){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}n.Renderer=e,n.defaultRenderer=new e;function t(s){return Kx.getStretch(s)}n.getStretch=t;function i(s,o){Kx.setStretch(s,o)}n.setStretch=i})($4||($4={}));var oLe;(function(n){function e(t){return t.layout||new Kx({renderer:t.renderer||$4.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}n.createLayout=e})(oLe||(oLe={}));class rLe extends $4{constructor(e={}){super({...e,layout:aLe.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new rl(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=Wt.findFirstIndex(this.widgets,i=>i.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,i=t.widgets[e];if(!i)return;const s=i.isHidden,o=t.absoluteSizes(),r=(s?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(s){const l=this._widgetSizesCache.get(i);if(!l)return;c[e]+=l;const d=c.map(h=>h-l>0).lastIndexOf(!0);d===-1?c.forEach((h,u)=>{u!==e&&(c[u]-=o[u]/a*(l-r))}):c[d]-=l-r}else{const l=o[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=o[d]+l+r}return c.map(l=>l/(a+r))}_evtClick(e){const t=e.target;if(t){const i=Wt.findFirstIndex(this.titles,s=>s.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let i=!1;if(t){const s=Wt.findFirstIndex(this.titles,o=>o.contains(t));if(s>=0){const o=e.keyCode.toString();if(e.key.match(/Space|Enter/)||o.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||o.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||o.match(/38|40/)){const r=e.key.match(/ArrowLeft|ArrowUp/)||o.match(/37|38/)?-1:1,a=this.titles.length,c=(s+a+r)%a;this.titles[c].focus(),i=!0}else e.key==="End"||o==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||o==="36")&&(this.titles[0].focus(),i=!0)}i&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],i=this.layout.widgets[e],s=this._computeWidgetSize(e);s&&this.setRelativeSizes(s,!1),i.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),i.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),i.hide()),this._expansionToggled.emit(e)}}(function(n){class e extends $4.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(i){return document.createElement("span")}createSectionTitle(i){const s=document.createElement("h3");s.setAttribute("tabindex","0"),s.id=this.createTitleKey(i),s.className=this.titleClassName;for(const a in i.dataset)s.dataset[a]=i.dataset[a];const o=s.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=s.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,s}createTitleKey(i){let s=this._titleKeys.get(i);return s===void 0&&(s=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,s)),s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e})(rLe||(rLe={}));var aLe;(function(n){function e(t){return t.layout||new jZt({renderer:t.renderer||rLe.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}n.createLayout=e})(aLe||(aLe={}));class Yv extends hue{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",e.direction!==void 0&&(this._direction=e.direction),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){Wt.insert(this._items,e,new sj(t)),Wt.insert(this._sizers,e,new KI),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),Wt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);Wt.removeAt(this._sizers,e),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let a=0,c=this._items.length;a0)switch(this._alignment){case"start":break;case"center":l=0,d=c/2;break;case"end":l=0,d=c;break;case"justify":l=c/i,d=0;break;default:throw"unreachable"}for(let h=0,u=this._items.length;h0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i}),n.sizeBasisProperty=new Aw({name:"sizeBasis",create:()=>0,coerce:(s,o)=>Math.max(0,Math.floor(o)),changed:i});function e(s){return s==="left-to-right"||s==="right-to-left"}n.isHorizontal=e;function t(s){return Math.max(0,Math.floor(s))}n.clampSpacing=t;function i(s){s.parent&&s.parent.layout instanceof Yv&&s.parent.fit()}})(NR||(NR={}));class x7e extends Krt{constructor(e={}){super({layout:cLe.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}(function(n){function e(o){return Yv.getStretch(o)}n.getStretch=e;function t(o,r){Yv.setStretch(o,r)}n.setStretch=t;function i(o){return Yv.getSizeBasis(o)}n.getSizeBasis=i;function s(o,r){Yv.setSizeBasis(o,r)}n.setSizeBasis=s})(x7e||(x7e={}));var cLe;(function(n){function e(t){return t.layout||new Yv(t)}n.createLayout=e})(cLe||(cLe={}));class fre extends ot{constructor(e){super({node:TA.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||fre.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=TA.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>TA.createItem(this.commands,i));return t.forEach(i=>this._items.push(i)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){Wt.removeAt(this._items,e)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,i=this.contentNode,s=this._results;if(s||(s=this._results=TA.search(this._items,t),this._activeIndex=t?Wt.findFirstIndex(s,TA.canActivate):-1),!t&&s.length===0){jI.render(null,i);return}if(t&&s.length===0){let c=this.renderer.renderEmptyMessage({query:t});jI.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(s.length);for(let c=0,l=s.length;c=s.length)i.scrollTop=0;else{let c=i.children[r];pc.scrollIntoViewIfNeeded(i,c)}}_evtClick(e){if(e.button!==0)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=Wt.findFirstIndex(this.contentNode.children,i=>i.contains(e.target));t!==-1&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,i=eF-N),M=b.slice(0,S),k=b.slice(S);for(let F=0,N=k.length;Fm.command===f&&Hl.deepEqual(m.args,p))||null}}})(TA||(TA={}));class aw extends ot{constructor(e){super({node:Nf.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new rl(this),this._menuRequested=new rl(this),this.addClass("lm-Menu"),this.setFlag(ot.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||aw.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),e!==-1&&!Nf.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,i=t{this.activeIndex=a}})}jI.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(t===38){this.activatePreviousItem();return}if(t===39){let r=this.activeItem;r&&r.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=hre().keyForKeydownEvent(e);if(!i)return;let s=this._activeIndex+1,o=Nf.findMnemonic(this._items,i,s);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.triggerActiveItem()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>pc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;!i||i.type!=="submenu"||!i.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:i}=e;if(pc.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Nf.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let i=t.submenu;if(i===this._childMenu)return;aw.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,Gt.sendMessage(this,ot.Msg.UpdateRequest);let s=this.contentNode.children[this._activeIndex];Nf.openSubmenu(i,s),e&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},Nf.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Nf.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Nf.saveWindowData()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return za.li({className:s,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let s=this.createIconClass(i);return za.div({className:s},i.item.icon,i.item.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return za.div({className:"lm-Menu-itemLabel"},s)}renderShortcut(i){let s=this.formatShortcut(i);return za.div({className:"lm-Menu-itemShortcut"},s)}renderSubmenu(i){return za.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let s="lm-Menu-item";i.item.isEnabled||(s+=" lm-mod-disabled"),i.item.isToggled&&(s+=" lm-mod-toggled"),i.item.isVisible||(s+=" lm-mod-hidden"),i.active&&(s+=" lm-mod-active"),i.collapsed&&(s+=" lm-mod-collapsed");let o=i.item.className;return o&&(s+=` ${o}`),s}createItemDataset(i){let s,{type:o,command:r,dataset:a}=i.item;return o==="command"?s={...a,type:o,command:r}:s={...a,type:o},s}createIconClass(i){let s="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${s} ${o}`:s}createItemARIA(i){let s={};switch(i.item.type){case"separator":s.role="presentation";break;case"submenu":s["aria-haspopup"]="true",i.item.isEnabled||(s["aria-disabled"]="true");break;default:i.item.isEnabled||(s["aria-disabled"]="true"),s.role="menuitem"}return s}formatLabel(i){let{label:s,mnemonic:o}=i.item;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=za.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let s=i.item.keyBinding;return s?eA.formatKeystroke(s.keys):null}}n.Renderer=e,n.defaultRenderer=new e})(aw||(aw={}));var Nf;(function(n){n.TIMER_DELAY=300,n.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function s(){e=d(),t++}n.saveWindowData=s;function o(){let m=document.createElement("div"),v=document.createElement("ul");return v.className="lm-Menu-content",m.appendChild(v),v.setAttribute("role","menu"),m.tabIndex=0,m}n.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}n.canActivate=r;function a(m,v){return new p(m.commands,v)}n.createItem=a;function c(m,v,w){for(let b=m;b;b=b.childMenu)if(pc.hitTest(b.node,v,w))return!0;return!1}n.hitTestMenus=c;function l(m){let v=new Array(m.length);Wt.fill(v,!1);let w=0,b=m.length;for(;w=0;--C){let S=m[C];if(S.isVisible){if(S.type!=="separator")break;v[C]=!0}}let y=!1;for(;++wk+N&&(v=k+N-re),!C&&w+me>F+z&&(w>F+z?w=F+z-me:w=w-me),j.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,w)}px`,j.opacity="1"}n.openRootMenu=h;function u(m,v){const w=i();let b=w.pageXOffset,C=w.pageYOffset,y=w.clientWidth,S=w.clientHeight;Gt.sendMessage(m,ot.Msg.UpdateRequest);let M=S,k=m.node,F=k.style;F.opacity="0",F.maxHeight=`${M}px`,ot.attach(m,document.body);let{width:N,height:z}=k.getBoundingClientRect(),U=pc.boxSizing(m.node),J=v.getBoundingClientRect(),j=J.right-n.SUBMENU_OVERLAP;j+N>b+y&&(j=J.left+n.SUBMENU_OVERLAP-N);let re=J.top-U.borderTop-U.paddingTop;re+z>C+S&&(re=J.bottom+U.borderBottom+U.paddingBottom-z),F.transform=`translate(${Math.max(0,j)}px, ${Math.max(0,re)}px`,F.opacity="1"}n.openSubmenu=u;function f(m,v,w){let b=-1,C=-1,y=!1,S=v.toUpperCase();for(let M=0,k=m.length;M=0&&Ub.command===v&&Hl.deepEqual(b.args,w))||null}return null}}})(Nf||(Nf={}));var D7e;(function(n){function e(r,a){let c=i(r.selector),l=r.rank!==void 0?r.rank:1/0;return{...r,selector:c,rank:l,id:a}}n.createItem=e;function t(r,a,c,l){let d=a.target;if(!d)return null;let h=a.currentTarget;if(!h||!h.contains(d)&&(d=document.elementFromPoint(a.clientX,a.clientY),!d||!h.contains(d)))return null;let u=[],f=r.slice();for(;d!==null;){let p=[];for(let m=0,v=f.length;m=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,i=this._titles[t]||null,s=e,o=this._titles[s]||null;this._currentIndex=s,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:s,currentTitle:o})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let i=cv.asTitle(t),s=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return s===-1?(Wt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,s===o||(Wt.move(this._titles,s,o),this.update(),this._adjustCurrentForMove(s,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Wt.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let i of this._titles)i.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),e!==-1&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let i=this._titles,s=this.renderer,o=this.currentTitle,r=new Array(i.length);const a=(t=this._getCurrentTabindex())!==null&&t!==void 0?t:this._currentIndex>-1?this._currentIndex:0;for(let c=0,l=i.length;cpc.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let s=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=s.label||"",a=o.innerHTML;o.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=r,o.appendChild(c);let l=()=>{c.removeEventListener("blur",l),o.innerHTML=a,this.node.addEventListener("keydown",this)};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(s.label=s.caption=c.value),l()):d.key==="Escape"&&l()}),this.node.removeEventListener("keydown",this),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),e.key==="Escape"&&this._releaseMouse())}_evtKeyDown(e){var t,i,s;if(!(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE)){if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){const o=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(o))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const r=Wt.findFirstIndex(this.contentNode.children,a=>a.contains(o));r>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=r)}}else if(KZt.includes(e.key)){const o=[...this.contentNode.children];if(this.addButtonEnabled&&o.push(this.addButtonNode),o.length<=1)return;e.preventDefault(),e.stopPropagation();let r=o.indexOf(document.activeElement);r===-1&&(r=this._currentIndex);let a;e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"?a=(t=o[r+1])!==null&&t!==void 0?t:o[0]:e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"?a=(i=o[r-1])!==null&&i!==void 0?i:o[o.length-1]:e.key==="Home"?a=o[0]:e.key==="End"&&(a=o[o.length-1]),a&&((s=o[r])===null||s===void 0||s.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,s=Wt.findFirstIndex(i,r=>pc.hitTest(r,e.clientX,e.clientY));if(s===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[s],index:s,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),e.button===1||t))return;let o=i[s].querySelector(this.renderer.closeIconSelector);o&&o.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===s?this.currentIndex=-1:this.currentIndex=s,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let i=this.contentNode.children;if(!(!t.dragActive&&!cv.dragExceeded(t,e))){if(!t.dragActive){let s=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=s.width,t.tabPressPos=t.pressX-s.left):(t.tabPos=t.tab.offsetTop,t.tabSize=s.height,t.tabPressPos=t.pressY-s.top),t.tabPressOffset={x:t.pressX-s.left,y:t.pressY-s.top},t.tabLayout=cv.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=Xu.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&cv.detachExceeded(t,e)){t.detachRequested=!0;let s=t.index,o=e.clientX,r=e.clientY,a=i[s],c=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:c,tab:a,clientX:o,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}cv.layoutTabs(i,t,e,this._orientation)}}_evtPointerUp(e){if(e.button!==0&&e.button!==1)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}let o=this.contentNode.children,r=Wt.findFirstIndex(o,l=>pc.hitTest(l,e.clientX,e.clientY));if(r!==t.index)return;let a=this._titles[r];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:r,title:a});return}let c=o[r].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:r,title:a});return}return}if(e.button!==0)return;cv.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=cv.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,cv.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let s=t.index,o=t.targetIndex;o===-1||s===o||(Wt.move(this._titles,s,o),this._adjustCurrentForMove(s,o),this._tabMoved.emit({fromIndex:s,toIndex:o,title:this._titles[o]}),Gt.sendMessage(this,ot.Msg.UpdateRequest))},i)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(cv.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let i=this.currentTitle,s=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&s===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:s,previousTitle:i,currentIndex:e,currentTitle:t});return}s>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let i=this._currentIndex,s=this.removeBehavior;if(i!==e){i>e&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(s==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-tab-before"){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(s==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}}(function(n){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let s=i.title.caption,o=this.createTabKey(i),r=o,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?za.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):za.li({id:r,key:o,className:c,title:s,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:s}=i;let o=this.createIconClass(i);return za.div({className:o},s.icon,s.iconLabel)}renderLabel(i){return za.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return za.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let s=this._tabKeys.get(i.title);return s===void 0&&(s=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,s)),s}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let s="lm-TabBar-tab";return i.title.className&&(s+=` ${i.title.className}`),i.title.closable&&(s+=" lm-mod-closable"),i.current&&(s+=" lm-mod-current"),s}createTabDataset(i){return i.title.dataset}createTabARIA(i){var s;return{role:"tab","aria-selected":i.current.toString(),tabindex:`${(s=i.tabIndex)!==null&&s!==void 0?s:"-1"}`}}createIconClass(i){let s="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}}e._nInstance=0,n.Renderer=e,n.defaultRenderer=new e,n.addButtonSelector=".lm-TabBar-addButton"})(ZF||(ZF={}));var cv;(function(n){n.DRAG_THRESHOLD=5,n.DETACH_THRESHOLD=20;function e(){let d=document.createElement("div"),h=document.createElement("ul");h.setAttribute("role","tablist"),h.className="lm-TabBar-content",d.appendChild(h);let u=document.createElement("div");return u.className="lm-TabBar-addButton lm-mod-hidden",u.setAttribute("tabindex","-1"),u.setAttribute("role","button"),d.appendChild(u),d}n.createNode=e;function t(d){return d instanceof nLe?d:new nLe(d)}n.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}n.parseTransitionDuration=i;function s(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=n.DRAG_THRESHOLD||f>=n.DRAG_THRESHOLD}n.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+n.DETACH_THRESHOLD||h.clientY=u.bottom+n.DETACH_THRESHOLD}n.detachExceeded=r;function a(d,h,u,f){let p,m,v,w;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,w=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,w=h.contentRect.height);let b=h.index,C=m-h.tabPressPos,y=C+h.tabSize;for(let S=0,M=d.length;S>1);if(Sh.index&&y>N)k=`${-h.tabSize-F.margin}px`,b=Math.max(b,S);else if(S===h.index){let z=v-p,U=w-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,U))}px`}else k="";f==="horizontal"?d[S].style.left=k:d[S].style.top=k}h.targetIndex=b}n.layoutTabs=a;function c(d,h){let u;h==="horizontal"?u=d.contentRect.width:u=d.contentRect.height;let f;if(d.targetIndex===d.index)f=0;else if(d.targetIndex>d.index){let v=d.tabLayout[d.targetIndex];f=v.pos+v.size-d.tabSize-d.tabPos}else f=d.tabLayout[d.targetIndex].pos-d.tabPos;let p=u-(d.tabPos+d.tabSize),m=Math.max(-d.tabPos,Math.min(f,p));h==="horizontal"?d.tab.style.left=`${m}px`:d.tab.style.top=`${m}px`}n.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}n.resetTabPositions=l})(cv||(cv={}));class YZt extends XF{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,e.spacing!==void 0&&(this._spacing=aq.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:ot.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const t of this.tabBars())if(t.titles.length>1)for(const i of t.titles)i.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=aq.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():V5()}widgets(){return this._root?this._root.iterUserWidgets():V5()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():V5()}tabBars(){return this._root?this._root.iterTabBars():V5()}handles(){return this._root?this._root.iterHandles():V5()}moveHandle(e,t,i){let s=e.classList.contains("lm-mod-hidden");if(!this._root||s)return;let o=this._root.findSplitNode(e);if(!o)return;let r;o.node.orientation==="horizontal"?r=t-e.offsetLeft:r=i-e.offsetTop,r!==0&&(o.node.holdSizes(),w_.adjust(o.node.sizers,o.index,r),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,i;e.main?i=hd.normalizeAreaConfig(e.main,t):i=null;let s=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of s)t.has(a)||(a.parent=null);for(const a of o)a.dispose();for(const a of r)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=hd.realizeAreaConfig(i,{createTabBar:a=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(a=>{this.attachWidget(a)}),this.parent.fit())}addWidget(e,t={}){let i=t.ref||null,s=t.mode||"tab-after",o=null;if(this._root&&i&&(o=this._root.findTabNode(i)),i&&!o)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,s){case"tab-after":this._insertTab(e,i,o,!0);break;case"tab-before":this._insertTab(e,i,o,!1);break;case"split-top":this._insertSplit(e,i,o,"vertical",!1);break;case"split-left":this._insertSplit(e,i,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,o,"vertical",!0);break;case"merge-top":this._insertSplit(e,i,o,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,i,o,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,i,o,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,i,o,"vertical",!0,!0);break}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=pc.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),s=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(s,o);if(!r)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=r,u=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=i.width-u-(l+d),m=i.height-f-(c+h);return{tabBar:a,x:s,y:o,top:c,left:l,right:p,bottom:m,width:d,height:h}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new sj(e)),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(hd.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===ot.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=ot.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let i=t.parent;t.parent=null;let s=Wt.removeFirstOf(i.children,t),o=Wt.removeAt(i.handles,s);if(Wt.removeAt(i.sizers,s),o.parentNode&&o.parentNode.removeChild(o),i.children.length>1){i.syncHandles();return}let r=i.parent;i.parent=null;let a=i.children[0],c=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,c.parentNode&&c.parentNode.removeChild(c),this._root===i){a.parent=null,this._root=a;return}let l=r,d=l.children.indexOf(i);if(a instanceof hd.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Wt.removeAt(l.handles,d);Wt.removeAt(l.children,d),Wt.removeAt(l.sizers,d),h.parentNode&&h.parentNode.removeChild(h);for(let u=0,f=a.children.length;u=this._left+this._width||p=this._top+this._height?null:this}createConfig(){let f=this.tabBar.titles.map(m=>m.owner),p=this.tabBar.currentIndex;return{type:"tab-area",widgets:f,currentIndex:p}}holdAllSizes(){}fit(f,p){let m=0,v=0,w=1/0,b=1/0,C=p.get(this.tabBar),y=this.tabBar.currentTitle,S=y?p.get(y.owner):void 0,[M,k]=this.sizers;return C&&C.fit(),S&&S.fit(),C&&!C.isHidden?(m=Math.max(m,C.minWidth),v+=C.minHeight,M.minSize=C.minHeight,M.maxSize=C.maxHeight):(M.minSize=0,M.maxSize=0),S&&!S.isHidden?(m=Math.max(m,S.minWidth),v+=S.minHeight,k.minSize=S.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b}}update(f,p,m,v,w,b){this._top=p,this._left=f,this._width=m,this._height=v;let C=b.get(this.tabBar),y=this.tabBar.currentTitle,S=y?b.get(y.owner):void 0;if(w_.calc(this.sizers,v),C&&!C.isHidden){let M=this.sizers[0].size;C.update(f,p,m,M),p+=M}if(S&&!S.isHidden){let M=this.sizers[1].size;S.update(f,p,m,M)}}}n.TabLayoutNode=s;class o{constructor(f){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=f}*iterAllWidgets(){for(const f of this.children)yield*f.iterAllWidgets()}*iterUserWidgets(){for(const f of this.children)yield*f.iterUserWidgets()}*iterSelectedWidgets(){for(const f of this.children)yield*f.iterSelectedWidgets()}*iterTabBars(){for(const f of this.children)yield*f.iterTabBars()}*iterHandles(){yield*this.handles;for(const f of this.children)yield*f.iterHandles()}findTabNode(f){for(let p=0,m=this.children.length;pv.createConfig());return{type:"split-area",orientation:f,children:m,sizes:p}}syncHandles(){this.handles.forEach((f,p)=>{f.setAttribute("data-orientation",this.orientation),p===this.handles.length-1?f.classList.add("lm-mod-hidden"):f.classList.remove("lm-mod-hidden")})}holdSizes(){for(const f of this.sizers)f.sizeHint=f.size}holdAllSizes(){for(const f of this.children)f.holdAllSizes();this.holdSizes()}normalizeSizes(){let f=this.sizers.length;if(f===0)return;this.holdSizes();let p=this.sizers.reduce((m,v)=>m+v.sizeHint,0);if(p===0)for(const m of this.sizers)m.size=m.sizeHint=1/f;else for(const m of this.sizers)m.size=m.sizeHint/=p;this.normalized=!0}createNormalizedSizes(){let f=this.sizers.length;if(f===0)return[];let p=this.sizers.map(v=>v.size),m=p.reduce((v,w)=>v+w,0);if(m===0)for(let v=p.length-1;v>-1;v--)p[v]=1/f;else for(let v=p.length-1;v>-1;v--)p[v]/=m;return p}fit(f,p){let m=this.orientation==="horizontal",v=Math.max(0,this.children.length-1)*f,w=m?v:0,b=m?0:v,C=1/0,y=1/0;for(let S=0,M=this.children.length;S=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let w=0,b=u.children.length;w{let b=i(v,f,p),C=e(u.sizes[w]),y=f.createHandle();m.children.push(b),m.handles.push(y),m.sizers.push(C),b.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(hd||(hd={}));class cq extends ot{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new rl(this),this._addRequested=new rl(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||cq.defaultRenderer,this._edges=e.edges||Fl.DEFAULT_EDGES,e.tabsMovable!==void 0&&(this._tabsMovable=e.tabsMovable),e.tabsConstrained!==void 0&&(this._tabsConstrained=e.tabsConstrained),e.addButtonEnabled!==void 0&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new YZt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new cq.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const i of t.tabBars())i.show();break;case"single-document":t.restoreLayout(Fl.createSingleDocumentConfig(this));break;default:throw"unreachable"}Gt.postMessage(this,Fl.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=Y1e(this.tabBars(),i=>i.titles.indexOf(e.title)!==-1);if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(jp.IS_EDGE||jp.IS_IE)&&Gt.flush(),Gt.postMessage(this,Fl.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),Gt.postMessage(this,Fl.LayoutModified)}processMessage(e){e.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){Fl.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Fl.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),Gt.postMessage(this,Fl.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),!(this._tabsConstrained&&e.source!==this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:i}=e,{zone:s,target:o}=Fl.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||s==="invalid"){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof a!="function"){e.dropAction="none";return}let c=a();if(!(c instanceof ot)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?Fl.getDropRef(o.tabBar):null;switch(s){case"root-all":this.addWidget(c);break;case"root-top":this.addWidget(c,{mode:"split-top"});break;case"root-left":this.addWidget(c,{mode:"split-left"});break;case"root-right":this.addWidget(c,{mode:"split-right"});break;case"root-bottom":this.addWidget(c,{mode:"split-bottom"});break;case"widget-all":this.addWidget(c,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(c,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(c,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(c,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(c,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(c,{mode:"tab-after",ref:l});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(c)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&(this._releaseMouse(),Gt.postMessage(this,Fl.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,s=Y1e(t.handles(),d=>d.contains(i));if(!s)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let o=s.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(s),l=Xu.overrideCursor(c.cursor,this._document);this._pressData={handle:s,deltaX:r,deltaY:a,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,s=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,s)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),Gt.postMessage(this,Fl.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:i,target:s}=Fl.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=pc.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":o=l.paddingTop,r=l.paddingLeft,a=l.paddingRight,c=d.height*Fl.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*Fl.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*Fl.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*Fl.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=s.top,r=s.left,a=s.right,c=s.bottom;break;case"widget-top":o=s.top,r=s.left,a=s.right,c=s.bottom+s.height/2;break;case"widget-left":o=s.top,r=s.left,a=s.right+s.width/2,c=s.bottom;break;case"widget-right":o=s.top,r=s.left+s.width/2,a=s.right,c=s.bottom;break;case"widget-bottom":o=s.top+s.height/2,r=s.left,a=s.right,c=s.bottom;break;case"widget-tab":{const h=s.tabBar.node.getBoundingClientRect().height;o=s.top,r=s.left,a=s.right,c=s.bottom+s.height-h;break}default:throw"unreachable"}return this.overlay.show({top:o,left:r,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return Fl.isGeneratedTabBarProperty.set(e,!0),this._mode==="single-document"&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){Gt.postMessage(this,Fl.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:s}=t;i&&i.owner.hide(),s&&s.owner.show(),(jp.IS_EDGE||jp.IS_IE)&&Gt.flush(),Gt.postMessage(this,Fl.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:i,tab:s,clientX:o,clientY:r,offset:a}=t,c=new $Zt,l=()=>i.owner;c.setData("application/vnd.lumino.widget-factory",l);let d=s.cloneNode(!0);a&&(d.style.top=`-${a.y}px`,d.style.left=`-${a.x}px`),this._drag=new Xu({document:this._document,mimeData:c,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden");let h=()=>{this._drag=null,s.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(h)}}(function(n){class e{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(s){let o=this.node.style;o.top=`${s.top}px`,o.left=`${s.left}px`,o.right=`${s.right}px`,o.bottom=`${s.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(s){if(!this._hidden){if(s<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},s))}}}n.Overlay=e;class t{createTabBar(s){let o=new ZF({document:s});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let s=document.createElement("div");return s.className="lm-DockPanel-handle",s}}n.Renderer=t,n.defaultRenderer=new t})(cq||(cq={}));var Fl;(function(n){n.GOLDEN_RATIO=.618,n.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},n.LayoutModified=new q3("layout-modified"),n.isGeneratedTabBarProperty=new Aw({name:"isGeneratedTabBar",create:()=>!1});function e(s){if(s.isEmpty)return{main:null};let o=Array.from(s.widgets()),r=s.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}n.createSingleDocumentConfig=e;function t(s,o,r,a){if(!pc.hitTest(s.node,o,r))return{zone:"invalid",target:null};let c=s.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(s.mode==="multiple-document"){let C=s.node.getBoundingClientRect(),y=o-C.left+1,S=r-C.top+1,M=C.right-o,k=C.bottom-r;switch(Math.min(S,M,k,y)){case S:if(Sm&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let w=Math.min(d,h,u,f),b;switch(w){case d:b="widget-left";break;case h:b="widget-top";break;case u:b="widget-right";break;case f:b="widget-bottom";break;default:throw"unreachable"}return{zone:b,target:l}}n.findDropTarget=t;function i(s){return s.titles.length===0?null:s.currentTitle?s.currentTitle.owner:s.titles[s.titles.length-1].owner}n.getDropRef=i})(Fl||(Fl={}));class KM extends XF{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new KI],this._columnSizers=[new KI],this._box=null,e.rowCount!==void 0&&yh.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&yh.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=yh.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=yh.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(yh.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(yh.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=yh.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=yh.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let i=this._rowSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let i=this._columnSizers[e];i&&(t=yh.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){Wt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new sj(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Wt.findFirstIndex(this._items,s=>s.widget===e);if(t===-1)return;let i=Wt.removeAt(this._items,t);this.parent&&this.detachWidget(e),i.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&Gt.sendMessage(e,ot.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let c=0,l=this.rowCount;c!c.isHidden);for(let c=0,l=e.length;c({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function e(c){let l=Math.max(0,Math.floor(c.row||0)),d=Math.max(0,Math.floor(c.column||0)),h=Math.max(1,Math.floor(c.rowSpan||0)),u=Math.max(1,Math.floor(c.columnSpan||0));return{row:l,column:d,rowSpan:h,columnSpan:u}}n.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}n.clampValue=t;function i(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}n.rowSpanCmp=i;function s(c,l){let d=n.cellConfigProperty.get(c.widget),h=n.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}n.columnSpanCmp=s;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}n.reallocSizers=o;function r(c,l,d,h){if(d=h)return;let f=(h-u)/(d-l+1);for(let p=l;p<=d;++p)c[p].minSize+=f}n.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof KM&&c.parent.fit()}})(yh||(yh={}));class lq extends ot{constructor(e={}){super({node:pre.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(ot.Flag.DisallowLayout),this.renderer=e.renderer||lq.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&this._menus[e].items.length===0&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,i=!0){this._closeChildMenu();let s=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(s===-1){Wt.insert(this._menus,o,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),i&&this.update();return}o===this._menus.length&&o--,s!==o&&(Wt.move(this._menus,s,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Wt.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,s=this.renderer,o=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:i.length,c=0,l=!1;a=this._overflowMenu!==null?a-1:a;let d=new Array(a);for(let h=0;h{this._tabFocusIndex=h,this.activeIndex=h}}),c+=this._menuItemSizes[h],i[h].title.label===this._overflowMenuOptions.title&&(l=!0,a--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(this._overflowMenu===null){const h=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new aw({commands:new eA}),this._overflowMenu.title.label=h,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let h=i.length-2;h>=a;h--){const u=this.menus[h];u.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:u}),this.removeMenu(u,!1)}d[a]=s.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}else if(this._overflowMenu!==null){let h=this._overflowMenu.items,u=this.node.offsetWidth,f=this._overflowMenu.items.length;for(let p=0;pthis._menuItemSizes[m]){let v=h[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,v,!1),d[a]=s.renderItem({title:v.title,active:!1,tabbable:a===r,disabled:i[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}jI.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,s=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&s===-1&&(s=r)}else for(let r=0;rt){s=r;break}this._overflowIndex=s}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),t===13||t===32||t===38||t===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(t===37||t===39){let r=t===37?-1:1,a=this._tabFocusIndex+r,c=this._menus.length;for(let l=0;lpc.hitTest(i,e.clientX,e.clientY));if(t===-1){this._closeChildMenu();return}if(e.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const i=this._positionForMenu(t);aw.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Wt.findFirstIndex(this.contentNode.children,s=>pc.hitTest(s,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;aw.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:s}=t.getBoundingClientRect();return{top:s,left:i}}_evtFocusOut(e){!this._childMenu&&!this.node.contains(e.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let i=this._childMenu;if(i===t)return;this._childMenu=t,i?i.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,Gt.sendMessage(this,ot.Msg.UpdateRequest);let{left:s,top:o}=e;(typeof s>"u"||typeof o>"u")&&({left:s,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(s,o,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let i=this._activeIndex,s=this._menus.length;switch(t){case"next":this.activeIndex=i===s-1?0:i+1;break;case"previous":this.activeIndex=i===0?s-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(n){class e{renderItem(i){let s=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return za.li({className:s,dataset:o,...i.disabled?{}:{tabindex:i.tabbable?"0":"-1"},onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let s=this.createIconClass(i);return za.div({className:s},i.title.icon,i.title.iconLabel)}renderLabel(i){let s=this.formatLabel(i);return za.div({className:"lm-MenuBar-itemLabel"},s)}createItemClass(i){let s="lm-MenuBar-item";return i.title.className&&(s+=` ${i.title.className}`),i.active&&!i.disabled&&(s+=" lm-mod-active"),s}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true","aria-disabled":i.disabled?"true":"false"}}createIconClass(i){let s="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${s} ${o}`:s}formatLabel(i){let{label:s,mnemonic:o}=i.title;if(o<0||o>=s.length)return s;let r=s.slice(0,o),a=s.slice(o+1),c=s[o],l=za.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}n.Renderer=e,n.defaultRenderer=new e})(lq||(lq={}));var pre;(function(n){function e(){let i=document.createElement("div"),s=document.createElement("ul");return s.className="lm-MenuBar-content",i.appendChild(s),s.setAttribute("role","menubar"),i}n.createNode=e;function t(i,s,o){let r=-1,a=-1,c=!1,l=s.toUpperCase();for(let d=0,h=i.length;d=0&&p1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===ot.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=ot.HiddenMode.Scale),t.hiddenMode=ot.HiddenMode.Scale):t.hiddenMode=ot.HiddenMode.Display,Wt.insert(this._items,e,new sj(t)),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Wt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Wt.removeAt(this._items,e);this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&Gt.sendMessage(t,ot.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===ot.HiddenMode.Scale&&(t.hiddenMode=ot.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=ot.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let o=0,r=this._items.length;othis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(s))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,oe.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,s){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});s===void 0&&(s=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},s)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return Ot.MEMORY;if(e.workspaceFolder?.override!==void 0)return Ot.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return Ot.WORKSPACE;if(e.userRemote?.override!==void 0)return Ot.USER_REMOTE;if(e.userLocal?.override!==void 0)return Ot.USER_LOCAL}return e.memory?.value!==void 0?Ot.MEMORY:e.workspaceFolder?.value!==void 0?Ot.WORKSPACE_FOLDER:e.workspace?.value!==void 0?Ot.WORKSPACE:e.userRemote?.value!==void 0?Ot.USER_REMOTE:Ot.USER_LOCAL}_getValue(e,t,i){const s=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:s})}inspect(e,t,i){const s=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}toResourceConfigurationChangeEvent(e){return{affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>{const s=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:s})}}}};lLe=D([_(0,Re),_(1,Ai),_(2,Di)],lLe);const uue=".vscode",mre="settings",XZt=`${uue}/${mre}.json`,ZZt="vscode://schemas/settings/default",eei="vscode://schemas/settings/user",tei="vscode://schemas/settings/profile",iei="vscode://schemas/settings/machine",Yrt="vscode://schemas/settings/workspace",nei="vscode://schemas/settings/folder",sei="vscode://schemas/launch",oei="vscode://schemas/tasks";ut.APPLICATION;const rei=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Jrt=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],aei=[ut.APPLICATION,...Jrt],cme=[ut.MACHINE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],WX=[ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],Xrt=[ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE,ut.MACHINE_OVERRIDABLE],$p="tasks",kk="launch",VOe=Object.create(null);VOe[$p]=`${uue}/${$p}.json`;VOe[kk]=`${uue}/${kk}.json`;const Zrt=Object.create(null);Zrt[$p]=`${$p}.json`;const cei=`{ "version": "2.0.0", "tasks": [] -}`,RA="workbench.settings.applyToAllProfiles",ms="vs/workbench/api/common/configurationExtensionPoint",lei=it.as(eL.JSONContribution),HX=it.as(Cs.Configuration),T7e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(ms,0,"A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading."),type:"string"},order:{description:g(ms,1,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(ms,2,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(ms,3,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(ms,4,"Schema of the configuration property."),$ref:"http://json-schema.org/draft-07/schema#"},{type:"object",properties:{scope:{type:"string",enum:["application","machine","window","resource","language-overridable","machine-overridable"],default:"window",enumDescriptions:[g(ms,5,"Configuration that can be configured only in the user settings."),g(ms,6,"Configuration that can be configured only in the user settings or only in the remote settings."),g(ms,7,"Configuration that can be configured in the user, remote or workspace settings."),g(ms,8,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(ms,9,"Resource configuration that can be configured in language specific settings."),g(ms,10,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(ms,11,"Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`.")},enumDescriptions:{type:"array",items:{type:"string"},description:g(ms,12,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(ms,13,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(ms,14,"Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.","`enum`")},markdownDescription:{type:"string",description:g(ms,15,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(ms,16,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(ms,17,"If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.")},editPresentation:{type:"string",enum:["singlelineText","multilineText"],enumDescriptions:[g(ms,18,"The value will be shown in an inputbox."),g(ms,19,"The value will be shown in a textarea.")],default:"singlelineText",description:g(ms,20,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(ms,21,"When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.")},ignoreSync:{type:"boolean",description:g(ms,22,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let n_;const eat=Ap.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:Hje}});eat.setHandler((n,{added:e,removed:t})=>{n_&&HX.deltaConfiguration(n_);const i=n_={};if(queueMicrotask(()=>{n_===i&&(HX.deltaConfiguration(n_),n_=void 0)}),t.length){const s=t.map(o=>({overrides:Vs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));n_.removedDefaults=s}if(e.length){const s=HX.getConfigurationProperties(),o=[ut.MACHINE_OVERRIDABLE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=Vs(a.value);for(const l of Object.keys(c))if(!dp.test(l)){const d=s[l];d?.scope&&!o.includes(d.scope)&&(a.collector.warn(g(ms,23,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l])}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});n_.addedDefaults=r}});const dei=Ap.registerExtensionPoint({extensionPoint:"configuration",deps:[eat],jsonSchema:{description:g(ms,24,"Contributes configuration settings."),oneOf:[T7e,{type:"array",items:T7e}]}}),lme=new $a;dei.setHandler((n,{added:e,removed:t})=>{if(n_??={},t.length){const r=[];for(const a of t)r.push(...lme.get(a.description.identifier)||[]),lme.delete(a.description.identifier);n_.removedConfigurations=r}const i=new Set;function s(r,a){const c=[],l=Vs(r);return l.title&&typeof l.title!="string"&&a.collector.error(g(ms,25,"'configuration.title' must be a string")),o(l,a),l.id=r.id||a.description.identifier.value,l.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},l.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,l.title=l.title||a.description.displayName||a.description.identifier.value,c.push(l),c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(ms,26,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=$je(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(ms,27,"Cannot register '{0}'. This property is already registered.",d));continue}if(!fo(h)){delete c[d],a.collector.error(g(ms,28,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope?h.scope.toString()==="application"?h.scope=ut.APPLICATION:h.scope.toString()==="machine"?h.scope=ut.MACHINE:h.scope.toString()==="resource"?h.scope=ut.RESOURCE:h.scope.toString()==="machine-overridable"?h.scope=ut.MACHINE_OVERRIDABLE:h.scope.toString()==="language-overridable"?h.scope=ut.LANGUAGE_OVERRIDABLE:h.scope=ut.WINDOW:h.scope=ut.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(ms,29,"'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."));for(const d of l)o(d,a)}}if(e.length){const r=[];for(const a of e){const c=[],l=a.value;Array.isArray(l)?l.forEach(d=>c.push(...s(d,a))):c.push(...s(l,a)),lme.set(a.description.identifier,c),r.push(...c)}n_.addedConfigurations=r}HX.deltaConfiguration(n_),n_=void 0});lei.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(ms,30,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(ms,31,"A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file.")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(ms,33,"URI of the folder")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(ms,34,"Workspace settings"),$ref:Yrt},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(ms,35,"Workspace launch configurations"),$ref:sei},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(ms,36,"Workspace task configurations"),$ref:oei},extensions:{type:"object",default:{},description:g(ms,37,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(ms,38,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(ms,39,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(ms,40,"Unknown workspace configuration property")});class hei extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration;let i={};Array.isArray(t)?t.forEach(a=>{i={...i,...a.properties}}):t&&(i=t.properties);const s=i?Object.keys(i):[],o=[g(ms,41,"ID"),g(ms,42,"Description"),g(ms,43,"Default")],r=s.sort((a,c)=>a.localeCompare(c)).map(a=>[new Xt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Xt(i[a].markdownDescription,!1):i[a].description??"",new Xt().appendCodeblock("json",JSON.stringify(ll(i[a].default)?zje(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(ms,44,"Settings"),access:{canToggle:!1},renderer:new $i(hei)});const zT="vs/workbench/contrib/workspaces/browser/workspaces.contribution";let dLe=class extends ${constructor(e,t,i,s,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=s,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==Nn.FOLDER||ost(this.contextService.getWorkspace()))return;const t=(await this.fileService.resolve(e.uri)).children?.map(i=>i.name);if(Array.isArray(t)){const i=t.filter(yde);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:Owe.WORKSPACE,isSecondary:!0};if(t.length===1){const s=t[0];this.notificationService.prompt(nt.Info,g(zT,0,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",s,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,1,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:qt(e,s)}])}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}else t.length>1&&this.notificationService.prompt(nt.Info,g(zT,2,"This folder contains multiple workspace files. Do you want to open one? [Learn more]({0}) about workspace files.","https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,3,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(s=>({label:s})),{placeHolder:g(zT,4,"Select a workspace to open")}).then(s=>{s&&this.hostService.openWindow([{workspaceUri:qt(e,s.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}};dLe=D([_(0,Ti),_(1,Pi),_(2,ci),_(3,On),_(4,Id),_(5,sn)],dLe);it.as(pf.Workbench).registerWorkbenchContribution(dLe,Us.Eventually);At(class extends pi{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Be(zT,1,"Open Workspace"),f1:!1,menu:{id:Te.EditorContent,when:ge.and(O7.Extension.isEqualTo(IJe),DZe.isEqualTo(ust),nTt.toNegated())}})}async run(n,e){const t=n.get(Id),i=n.get(Ti),s=n.get(Pi);if(i.getWorkbenchState()===Nn.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&_n(o,e)){s.info(g(zT,5,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class _re extends Px{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new Px(e,t),this._launchModel=_s.createEmptyModel(t),this._tasksModel=_s.createEmptyModel(t)}get folders(){return this._folders}get transient(){return this._transient}get settingsModel(){return this._settingsModelParser.configurationModel}get launchModel(){return this._launchModel}get tasksModel(){return this._tasksModel}reparseWorkspaceSettings(e){this._settingsModelParser.reparse(e)}getRestrictedWorkspaceSettings(){return this._settingsModelParser.restrictedConfigurations}doParseRaw(e,t){return this._folders=e.folders||[],this._transient=g9(e.transient)&&e.transient,this._settingsModelParser.parseRaw(e.settings,t),this._launchModel=this.createConfigurationModelFrom(e,"launch"),this._tasksModel=this.createConfigurationModelFrom(e,"tasks"),super.doParseRaw(e,t)}createConfigurationModelFrom(e,t){const i=e[t];if(i){const s=W9(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=s;const r=Object.keys(i).map(a=>`${t}.${a}`);return new _s(o,r,[],void 0,this.logService)}return _s.createEmptyModel(this.logService)}}class tat extends Px{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=W9(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),s=Object.create(null);s[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:s,keys:o,overrides:[]}}}class R7e extends f7{constructor(e,t,i,s,o,r,a,c,l,d,h){super(e,t,i,s,o,r,a,c,l,h),this._workspace=d}getValue(e,t={}){return super.getValue(e,t,this._workspace)}inspect(e,t={}){return super.inspect(e,t,this._workspace)}keys(){return super.keys(this._workspace)}compareAndDeleteFolderConfiguration(e){return this._workspace&&this._workspace.folders.length>0&&this._workspace.folders[0].uri.toString()===e.toString()?{keys:[],overrides:[]}:super.compareAndDeleteFolderConfiguration(e)}compare(e){const t=(r,a,c)=>{const l=[];return l.push(...a.filter(d=>r.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1?!1:Io(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Io(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),s=[],o=Lc([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&s.push([r,a])}return{keys:i,overrides:s}}}function uei(n){return n.hasOwnProperty("workspace")}function UX(n){return n.hasOwnProperty("folderUri")}function gei(n){return n.hasOwnProperty("fileUri")}function iat(n){return vre(n)||nat(n)}function vre(n){const e=n;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function nat(n){const e=n;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function zOe(n,e,t,i,s){if(n.scheme!==i.scheme)return{name:t,uri:n.toString(!0)};let o=e?void 0:s.relativePath(i,n);if(o!==void 0)o.length===0?o=".":Is&&(o=M7e(o));else if(n.scheme===_e.file)o=n.fsPath,Is&&(o=M7e(o));else if(s.isEqualAuthority(n.authority,i.authority))o=n.path;else return{name:t,uri:n.toString(!0)};return{name:t,path:o}}function M7e(n){return n=Ay(n),Wht(n)||(n=I9(n)),n}function dme(n,e,t){const i=[],s=new Set,o=t.dirname(e);for(const r of n){let a;if(vre(r))r.path&&(a=t.resolvePath(o,r.path));else if(nat(r))try{a=P.parse(r.uri),a.path[0]!==qi.sep&&(a=a.with({path:qi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!s.has(c)){s.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new Cde({uri:a,name:l,index:i.length},r))}}}return i}function N7e(n,e,t,i,s){const o=fei(e,n),r=s.dirname(e),a=s.dirname(i),c=[];for(const u of o.folders){const f=vre(u)?s.resolvePath(r,u.path):P.parse(u.uri);let p;t?p=!1:p=!vre(u)||oF(u.path),c.push(zOe(f,p,u.name,a,s))}const l={insertSpaces:!1,tabSize:4,eol:jr||ei?` +}`,RA="workbench.settings.applyToAllProfiles",ms="vs/workbench/api/common/configurationExtensionPoint",lei=it.as(eL.JSONContribution),HX=it.as(Cs.Configuration),T7e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(ms,0,"A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading."),type:"string"},order:{description:g(ms,1,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(ms,2,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(ms,3,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(ms,4,"Schema of the configuration property."),$ref:"http://json-schema.org/draft-07/schema#"},{type:"object",properties:{scope:{type:"string",enum:["application","machine","window","resource","language-overridable","machine-overridable"],default:"window",enumDescriptions:[g(ms,5,"Configuration that can be configured only in the user settings."),g(ms,6,"Configuration that can be configured only in the user settings or only in the remote settings."),g(ms,7,"Configuration that can be configured in the user, remote or workspace settings."),g(ms,8,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(ms,9,"Resource configuration that can be configured in language specific settings."),g(ms,10,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(ms,11,"Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`.")},enumDescriptions:{type:"array",items:{type:"string"},description:g(ms,12,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(ms,13,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(ms,14,"Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.","`enum`")},markdownDescription:{type:"string",description:g(ms,15,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(ms,16,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(ms,17,"If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.")},editPresentation:{type:"string",enum:["singlelineText","multilineText"],enumDescriptions:[g(ms,18,"The value will be shown in an inputbox."),g(ms,19,"The value will be shown in a textarea.")],default:"singlelineText",description:g(ms,20,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(ms,21,"When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.")},ignoreSync:{type:"boolean",description:g(ms,22,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let n_;const eat=Ap.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:Hje}});eat.setHandler((n,{added:e,removed:t})=>{n_&&HX.deltaConfiguration(n_);const i=n_={};if(queueMicrotask(()=>{n_===i&&(HX.deltaConfiguration(n_),n_=void 0)}),t.length){const s=t.map(o=>({overrides:Vs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));n_.removedDefaults=s}if(e.length){const s=HX.getConfigurationProperties(),o=[ut.MACHINE_OVERRIDABLE,ut.WINDOW,ut.RESOURCE,ut.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=Vs(a.value);for(const l of Object.keys(c))if(!dp.test(l)){const d=s[l];d?.scope&&!o.includes(d.scope)&&(a.collector.warn(g(ms,23,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l])}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});n_.addedDefaults=r}});const dei=Ap.registerExtensionPoint({extensionPoint:"configuration",deps:[eat],jsonSchema:{description:g(ms,24,"Contributes configuration settings."),oneOf:[T7e,{type:"array",items:T7e}]}}),lme=new $a;dei.setHandler((n,{added:e,removed:t})=>{if(n_??={},t.length){const r=[];for(const a of t)r.push(...lme.get(a.description.identifier)||[]),lme.delete(a.description.identifier);n_.removedConfigurations=r}const i=new Set;function s(r,a){const c=[],l=Vs(r);return l.title&&typeof l.title!="string"&&a.collector.error(g(ms,25,"'configuration.title' must be a string")),o(l,a),l.id=r.id||a.description.identifier.value,l.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},l.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,l.title=l.title||a.description.displayName||a.description.identifier.value,c.push(l),c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(ms,26,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=$je(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(ms,27,"Cannot register '{0}'. This property is already registered.",d));continue}if(!fo(h)){delete c[d],a.collector.error(g(ms,28,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope?h.scope.toString()==="application"?h.scope=ut.APPLICATION:h.scope.toString()==="machine"?h.scope=ut.MACHINE:h.scope.toString()==="resource"?h.scope=ut.RESOURCE:h.scope.toString()==="machine-overridable"?h.scope=ut.MACHINE_OVERRIDABLE:h.scope.toString()==="language-overridable"?h.scope=ut.LANGUAGE_OVERRIDABLE:h.scope=ut.WINDOW:h.scope=ut.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(ms,29,"'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."));for(const d of l)o(d,a)}}if(e.length){const r=[];for(const a of e){const c=[],l=a.value;Array.isArray(l)?l.forEach(d=>c.push(...s(d,a))):c.push(...s(l,a)),lme.set(a.description.identifier,c),r.push(...c)}n_.addedConfigurations=r}HX.deltaConfiguration(n_),n_=void 0});lei.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(ms,30,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(ms,31,"A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file.")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(ms,33,"URI of the folder")},name:{type:"string",description:g(ms,32,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(ms,34,"Workspace settings"),$ref:Yrt},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(ms,35,"Workspace launch configurations"),$ref:sei},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(ms,36,"Workspace task configurations"),$ref:oei},extensions:{type:"object",default:{},description:g(ms,37,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(ms,38,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(ms,39,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(ms,40,"Unknown workspace configuration property")});class hei extends ${constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration;let i={};Array.isArray(t)?t.forEach(a=>{i={...i,...a.properties}}):t&&(i=t.properties);const s=i?Object.keys(i):[],o=[g(ms,41,"ID"),g(ms,42,"Description"),g(ms,43,"Default")],r=s.sort((a,c)=>a.localeCompare(c)).map(a=>[new Xt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Xt(i[a].markdownDescription,!1):i[a].description??"",new Xt().appendCodeblock("json",JSON.stringify(ll(i[a].default)?zje(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}it.as(GS.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(ms,44,"Settings"),access:{canToggle:!1},renderer:new Gi(hei)});const zT="vs/workbench/contrib/workspaces/browser/workspaces.contribution";let dLe=class extends ${constructor(e,t,i,s,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=s,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==Nn.FOLDER||ost(this.contextService.getWorkspace()))return;const t=(await this.fileService.resolve(e.uri)).children?.map(i=>i.name);if(Array.isArray(t)){const i=t.filter(yde);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:Owe.WORKSPACE,isSecondary:!0};if(t.length===1){const s=t[0];this.notificationService.prompt(nt.Info,g(zT,0,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",s,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,1,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:Qt(e,s)}])}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}else t.length>1&&this.notificationService.prompt(nt.Info,g(zT,2,"This folder contains multiple workspace files. Do you want to open one? [Learn more]({0}) about workspace files.","https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(zT,3,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(s=>({label:s})),{placeHolder:g(zT,4,"Select a workspace to open")}).then(s=>{s&&this.hostService.openWindow([{workspaceUri:Qt(e,s.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(ke.WORKSPACE)?void 0:jU.SILENT})}};dLe=D([_(0,Ti),_(1,Pi),_(2,ci),_(3,On),_(4,Id),_(5,on)],dLe);it.as(pf.Workbench).registerWorkbenchContribution(dLe,Us.Eventually);At(class extends pi{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Be(zT,1,"Open Workspace"),f1:!1,menu:{id:Te.EditorContent,when:ge.and(O7.Extension.isEqualTo(IJe),DZe.isEqualTo(ust),nTt.toNegated())}})}async run(n,e){const t=n.get(Id),i=n.get(Ti),s=n.get(Pi);if(i.getWorkbenchState()===Nn.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&_n(o,e)){s.info(g(zT,5,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class _re extends Px{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new Px(e,t),this._launchModel=_s.createEmptyModel(t),this._tasksModel=_s.createEmptyModel(t)}get folders(){return this._folders}get transient(){return this._transient}get settingsModel(){return this._settingsModelParser.configurationModel}get launchModel(){return this._launchModel}get tasksModel(){return this._tasksModel}reparseWorkspaceSettings(e){this._settingsModelParser.reparse(e)}getRestrictedWorkspaceSettings(){return this._settingsModelParser.restrictedConfigurations}doParseRaw(e,t){return this._folders=e.folders||[],this._transient=g9(e.transient)&&e.transient,this._settingsModelParser.parseRaw(e.settings,t),this._launchModel=this.createConfigurationModelFrom(e,"launch"),this._tasksModel=this.createConfigurationModelFrom(e,"tasks"),super.doParseRaw(e,t)}createConfigurationModelFrom(e,t){const i=e[t];if(i){const s=W9(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=s;const r=Object.keys(i).map(a=>`${t}.${a}`);return new _s(o,r,[],void 0,this.logService)}return _s.createEmptyModel(this.logService)}}class tat extends Px{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=W9(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),s=Object.create(null);s[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:s,keys:o,overrides:[]}}}class R7e extends f7{constructor(e,t,i,s,o,r,a,c,l,d,h){super(e,t,i,s,o,r,a,c,l,h),this._workspace=d}getValue(e,t={}){return super.getValue(e,t,this._workspace)}inspect(e,t={}){return super.inspect(e,t,this._workspace)}keys(){return super.keys(this._workspace)}compareAndDeleteFolderConfiguration(e){return this._workspace&&this._workspace.folders.length>0&&this._workspace.folders[0].uri.toString()===e.toString()?{keys:[],overrides:[]}:super.compareAndDeleteFolderConfiguration(e)}compare(e){const t=(r,a,c)=>{const l=[];return l.push(...a.filter(d=>r.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1)),l.push(...r.filter(d=>a.indexOf(d)===-1?!1:Io(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Io(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),s=[],o=Lc([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&s.push([r,a])}return{keys:i,overrides:s}}}function uei(n){return n.hasOwnProperty("workspace")}function UX(n){return n.hasOwnProperty("folderUri")}function gei(n){return n.hasOwnProperty("fileUri")}function iat(n){return vre(n)||nat(n)}function vre(n){const e=n;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function nat(n){const e=n;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function zOe(n,e,t,i,s){if(n.scheme!==i.scheme)return{name:t,uri:n.toString(!0)};let o=e?void 0:s.relativePath(i,n);if(o!==void 0)o.length===0?o=".":Is&&(o=M7e(o));else if(n.scheme===_e.file)o=n.fsPath,Is&&(o=M7e(o));else if(s.isEqualAuthority(n.authority,i.authority))o=n.path;else return{name:t,uri:n.toString(!0)};return{name:t,path:o}}function M7e(n){return n=Ay(n),Wht(n)||(n=I9(n)),n}function dme(n,e,t){const i=[],s=new Set,o=t.dirname(e);for(const r of n){let a;if(vre(r))r.path&&(a=t.resolvePath(o,r.path));else if(nat(r))try{a=P.parse(r.uri),a.path[0]!==Qi.sep&&(a=a.with({path:Qi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!s.has(c)){s.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new Cde({uri:a,name:l,index:i.length},r))}}}return i}function N7e(n,e,t,i,s){const o=fei(e,n),r=s.dirname(e),a=s.dirname(i),c=[];for(const u of o.folders){const f=vre(u)?s.resolvePath(r,u.path):P.parse(u.uri);let p;t?p=!1:p=!vre(u)||oF(u.path),c.push(zOe(f,p,u.name,a,s))}const l={insertSpaces:!1,tabSize:4,eol:jr||ei?` `:`\r -`},d=due(n,["folders"],c,l);let h=d7e(n,d);return _Z(o.remoteAuthority,uZe(i))&&(h=d7e(h,fJt(h,["remoteAuthority"],l))),h}function fei(n,e){const t=ow(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>iat(i));else throw new Error(`${n} looks like an invalid workspace file.`);return t}function pei(n){return n.workspace&&typeof n.workspace=="object"&&typeof n.workspace.id=="string"&&typeof n.workspace.configPath=="string"}function mei(n){return typeof n.folderUri=="string"}function _ei(n){return typeof n.fileUri=="string"}function vei(n,e){const t={workspaces:[],files:[]};if(n){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;pei(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:P.parse(o.workspace.configPath)}}):mei(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:P.parse(o.folderUri)}):_ei(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:P.parse(o.fileUri)})})}return t}function wei(n){const e={entries:[]};for(const t of n.workspaces)UX(t)?e.entries.push({folderUri:t.folderUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority}):e.entries.push({workspace:{id:t.workspace.id,configPath:t.workspace.configPath.toString()},label:t.label,remoteAuthority:t.remoteAuthority});for(const t of n.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const sat=Re,zs="vs/workbench/services/configuration/common/configurationEditing";var Tr;(function(n){n[n.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",n[n.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",n[n.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",n[n.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",n[n.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",n[n.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",n[n.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",n[n.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",n[n.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",n[n.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",n[n.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",n[n.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(Tr||(Tr={}));class P7e extends hc{constructor(e,t){super(e),this.code=t}}var Mn;(function(n){n[n.USER_LOCAL=1]="USER_LOCAL",n[n.USER_REMOTE=2]="USER_REMOTE",n[n.WORKSPACE=3]="WORKSPACE",n[n.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(Mn||(Mn={}));let hLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new dO}async writeConfiguration(e,t,i={}){const s=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(s,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,s,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,s=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(s.object.textEditorModel);await this.updateConfiguration(e,s.object.textEditorModel,o,t)}finally{s.dispose()}}async updateConfiguration(e,t,i,s){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&s.handleDirtyFile)switch(s.handleDirtyFile){case"save":await this.save(t,e);break;case"revert":await this.textFileService.revert(t.uri);break}const o=this.getEdits(e,t.getValue(),i)[0];o&&this.applyEditsToBuffer(o,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===Xi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new P7e(g(zs,0,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),Tr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),s=t.getPositionAt(e.offset+e.length),o=new O(i.lineNumber,i.column,s.lineNumber,s.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?ds.replace(o,e.content):ds.insert(i,e.content);return t.pushEditOperations([new mt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,s){return t.length?due(i,t,e,s):[{content:JSON.stringify(e,null,s.insertSpaces&&s.tabSize?" ".repeat(s.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),s=e.getEOL();return{insertSpaces:t,tabSize:i,eol:s}}async onError(e,t,i){switch(e.code){case Tr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case Tr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:return this.doWriteConfiguration(t,{scopes:i,handleDirtyFile:"revert"});default:this.notificationService.error(e.message)}}onInvalidConfigurationError(e,t){const i=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;i?this.notificationService.prompt(nt.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const s=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;s?this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>{const o=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:o,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:s,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case Mn.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case Mn.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case Mn.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case Mn.WORKSPACE_FOLDER:if(e.resource){const i=this.contextService.getWorkspaceFolder(e.resource);i&&this.preferencesService.openFolderSettings({folderUri:i.uri,jsonEditor:!0})}break}}openFile(e){this.editorService.openEditor({resource:e,options:{pinned:!0}})}toConfigurationEditingError(e,t,i){const s=this.toErrorMessage(e,t,i);return new P7e(s,e)}toErrorMessage(e,t,i){switch(e){case Tr.ERROR_POLICY_CONFIGURATION:return g(zs,5,"Unable to write {0} because it is configured in system policy.",i.key);case Tr.ERROR_UNKNOWN_KEY:return g(zs,6,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(zs,7,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(zs,8,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(zs,9,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case Tr.ERROR_INVALID_USER_TARGET:return g(zs,10,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case Tr.ERROR_INVALID_WORKSPACE_TARGET:return g(zs,11,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case Tr.ERROR_INVALID_FOLDER_TARGET:return g(zs,12,"Unable to write to Folder Settings because no resource is provided.");case Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(zs,13,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case Tr.ERROR_NO_WORKSPACE_OPENED:return g(zs,14,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case Tr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,15,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,16,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case Mn.USER_LOCAL:return g(zs,17,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case Mn.USER_REMOTE:return g(zs,18,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case Mn.WORKSPACE:return g(zs,19,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,20,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,21,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,22,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case Mn.USER_LOCAL:return g(zs,23,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case Mn.USER_REMOTE:return g(zs,24,"Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again.");case Mn.WORKSPACE:return g(zs,25,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,26,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,27,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,28,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case Mn.USER_LOCAL:return g(zs,29,"Unable to write into user settings because the content of the file is newer.");case Mn.USER_REMOTE:return g(zs,30,"Unable to write into remote user settings because the content of the file is newer.");case Mn.WORKSPACE:return g(zs,31,"Unable to write into workspace settings because the content of the file is newer.");case Mn.WORKSPACE_FOLDER:return g(zs,32,"Unable to write into folder settings because the content of the file is newer.")}case Tr.ERROR_INTERNAL:return g(zs,33,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case Mn.USER_LOCAL:return g(zs,34,"User Settings");case Mn.USER_REMOTE:return g(zs,35,"Remote User Settings");case Mn.WORKSPACE:return g(zs,36,"Workspace Settings");case Mn.WORKSPACE_FOLDER:return g(zs,37,"Folder Settings");default:return""}}defaultResourceValue(e){const t=this.uriIdentityService.extUri.basename(e);switch(t.substr(0,t.length-this.uriIdentityService.extUri.extname(e).length)){case $p:return cei;default:return"{}"}}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,this.defaultResourceValue(e),{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e,t){if(t.workspaceStandAloneConfigurationKey&&!t.key)return!1;const i=[];return ow(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,s){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_POLICY_CONFIGURATION,e,t);const r=it.as(Cs.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!dp.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==$p&&(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_USER_TARGET,e,t);if((e===Mn.WORKSPACE||e===Mn.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===Nn.EMPTY)throw this.toConfigurationEditingError(Tr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===Mn.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)){if(r===ut.APPLICATION)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===ut.MACHINE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===Mn.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)&&r!==void 0&&!Xrt.includes(r))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(s.overrideIdentifiers?.length&&r!==ut.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===Mn.USER_LOCAL?Zrt:VOe,d=Object.keys(l);for(const h of d){const u=this.getConfigurationFileResource(e,h,l[h],i.resource,void 0);if(t.key===h){const p=this.isWorkspaceConfigurationResource(u)?[h]:[];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}const f=`${h}.`;if(t.key.indexOf(f)===0){const p=this.isWorkspaceConfigurationResource(u)?[h,t.key.substr(f.length)]:[t.key.substr(f.length)];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}}}const s=t.key,r=it.as(Cs.Configuration).getConfigurationProperties()[s]?.scope;let a=i.overrideIdentifiers?.length?[Vje(i.overrideIdentifiers),s]:[s];if(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE)return{key:s,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,s,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,s,XZt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:s,jsonPath:a,value:t.value,resource:c??void 0,target:e}}isWorkspaceConfigurationResource(e){const t=this.contextService.getWorkspace();return!!(t.configuration&&e&&t.configuration.fsPath===e.fsPath)}getConfigurationFileResource(e,t,i,s,o){if(e===Mn.USER_LOCAL)return t===$p?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===Mn.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==Nn.EMPTY){const a=this.contextService.getWorkspace();if(e===Mn.WORKSPACE){if(r===Nn.WORKSPACE)return a.configuration??null;if(r===Nn.FOLDER)return a.folders[0].toResource(i)}if(e===Mn.WORKSPACE_FOLDER&&s){const c=this.contextService.getWorkspaceFolder(s);if(c)return c.toResource(i)}}return null}};hLe=D([_(1,sat),_(2,Ti),_(3,Tm),_(4,V_),_(5,ci),_(6,Rn),_(7,tr),_(8,Pi),_(9,TQ),_(10,_i),_(11,_o)],hLe);const _W=class _W extends KXe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=it.as(Cs.Configuration),this.cachedConfigurationDefaultsOverrides={},this.cacheKey={type:"defaults",key:"configurationDefaultsOverrides"},this.updateCache=!1,t.options?.configurationDefaults&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t.options.configurationDefaults}])}getConfigurationDefaultOverrides(){return this.cachedConfigurationDefaultsOverrides}async initialize(){return await this.initializeCachedConfigurationDefaultsOverrides(),super.initialize()}reload(){return this.updateCache=!0,this.cachedConfigurationDefaultsOverrides={},this.updateCachedConfigurationDefaultsOverrides(),super.reload()}hasCachedConfigurationDefaultsOverrides(){return!n1(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=fo(this.cachedConfigurationDefaultsOverrides)?this.cachedConfigurationDefaultsOverrides:{}})()),this.initiaizeCachedConfigurationDefaultsOverridesPromise}onDidUpdateConfiguration(e,t){super.onDidUpdateConfiguration(e,t),t&&this.updateCachedConfigurationDefaultsOverrides()}async updateCachedConfigurationDefaultsOverrides(){if(!this.updateCache)return;const e={},t=this.configurationRegistry.getConfigurationDefaultsOverrides();for(const[i,s]of t)!dp.test(i)&&s.value!==void 0&&(e[i]=s.value);try{Object.keys(e).length?(localStorage.setItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let uLe=_W;class bei extends yJe{constructor(e,t,i,s){super(e.defaultProfile.settingsResource,{scopes:[ut.APPLICATION]},i.extUri,t,s),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(RA),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class Cei extends ${get hasTasksLoaded(){return this.userConfiguration.value instanceof wre}constructor(e,t,i,s,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=s,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new Dn),this.userConfigurationChangeDisposable=this._register(new Dn),this.userConfiguration.value=new yJe(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new yn(()=>this.userConfiguration.value.loadConfiguration().then(a=>this._onDidChangeConfiguration.fire(a)),50))}async reset(e,t,i){return this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.doReset()}async doReset(e){const t=this.uriIdentityService.extUri.dirname(this.settingsResource),i=this.tasksResource?[[$p,this.tasksResource]]:[],s=new wre(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await s.loadConfiguration(e);return this.userConfiguration.value=s,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),o}async initialize(){return this.userConfiguration.value.loadConfiguration()}async reload(e){return this.hasTasksLoaded?this.userConfiguration.value.loadConfiguration():this.doReset(e)}reparse(e){return this.configurationParseOptions={...this.configurationParseOptions,...e},this.userConfiguration.value.reparse(this.configurationParseOptions)}getRestrictedSettings(){return this.userConfiguration.value.getRestrictedSettings()}}class wre extends ${constructor(e,t,i,s,o,r,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=o,this.uriIdentityService=r,this.logService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.allResources=[this.settingsResource,...this.standAloneConfigurationResources.map(([,c])=>c)],this._register(pa(...this.allResources.map(c=>pa(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new Px(e,a),this._folderSettingsParseOptions=s,this._standAloneConfigurations=[],this._cache=_s.createEmptyModel(this.logService),this._register(T.debounce(T.any(T.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),T.filter(this.fileService.onDidRunOperation,c=>this.handleFileOperationEvent(c))),()=>{},100)(()=>this._onDidChange.fire()))}async resolveContents(e){const t=async o=>Promise.all(o.map(async r=>{try{return(await this.fileService.readFile(r,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${r.toString()}': ${lg(a)}`),a.fileOperationResult!==Xi.FILE_NOT_FOUND&&a.fileOperationResult!==Xi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],s]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,s.map((o,r)=>[this.standAloneConfigurationResources[r][0],o])]}async loadConfiguration(e){const[t,i]=await this.resolveContents(!!e);this._standAloneConfigurations=[],this._folderSettingsModelParser.parse("",this._folderSettingsParseOptions),t!==void 0&&this._folderSettingsModelParser.parse(t,this._folderSettingsParseOptions);for(let s=0;se.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),Ko.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Li.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class yei extends ${constructor(e,t,i,s,o,r){super(),this._userConfigurationInitializationPromise=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidInitialize=this._register(new I),this.onDidInitialize=this._onDidInitialize.event,this._fileService=i,this._userConfiguration=this._cachedConfiguration=new Sei(e,t,{scopes:cme},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new hme(a.settingsPath,{scopes:cme},this._fileService,s,r));this._register(c.onDidChangeConfiguration(d=>this.onDidUserConfigurationChange(d))),this._userConfigurationInitializationPromise=c.initialize();const l=await this._userConfigurationInitializationPromise;this._userConfiguration.dispose(),this._userConfiguration=c,this.onDidUserConfigurationChange(l),this._onDidInitialize.fire(l)}})}async initialize(){if(this._userConfiguration instanceof hme)return this._userConfiguration.initialize();let e=await this._userConfiguration.initialize();return this._userConfigurationInitializationPromise&&(e=await this._userConfigurationInitializationPromise,this._userConfigurationInitializationPromise=null),e}reload(){return this._userConfiguration.reload()}reparse(){return this._userConfiguration.reparse({scopes:cme})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof hme){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Xi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class hme extends ${constructor(e,t,i,s,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=s,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new Dn),this.directoryWatcherDisposable=this._register(new Dn),this.parser=new Px(this.configurationResource.toString(),o),this.parseOptions=t,this._register(i.onDidFilesChange(r=>this.handleFileChangesEvent(r))),this._register(i.onDidRunOperation(r=>this.handleFileOperationEvent(r))),this.reloadConfigurationScheduler=this._register(new yn(()=>this.reload().then(r=>this._onDidChangeConfiguration.fire(r)),50)),this._register(Ee(()=>{this.stopWatchingResource(),this.stopWatchingDirectory()}))}watchResource(){this.fileWatcherDisposable.value=this.fileService.watch(this.configurationResource)}stopWatchingResource(){this.fileWatcherDisposable.value=void 0}watchDirectory(){const e=this.uriIdentityService.extUri.dirname(this.configurationResource);this.directoryWatcherDisposable.value=this.fileService.watch(e)}stopWatchingDirectory(){this.directoryWatcherDisposable.value=void 0}async initialize(){const e=await this.fileService.exists(this.configurationResource);return this.onResourceExists(e),this.reload()}async resolveContent(){return(await this.fileService.readFile(this.configurationResource,{atomic:!0})).value.toString()}async reload(){try{const e=await this.resolveContent();return this.parser.parse(e,this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}handleFileChangesEvent(e){let t=e.contains(this.configurationResource,Ko.UPDATED);e.contains(this.configurationResource,Ko.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,Ko.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class Sei extends ${constructor(e,t,i,s){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new Px("CachedRemoteUserConfiguration",s),this.parseOptions=i,this.configurationModel=_s.createEmptyModel(s)}getConfigurationModel(){return this.configurationModel}initialize(){return this.reload()}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.configurationModel=this.parser.configurationModel,this.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}async reload(){try{const e=await this.configurationCache.read(this.key),t=JSON.parse(e);t.content&&(this.parser.parse(t.content,this.parseOptions),this.configurationModel=this.parser.configurationModel)}catch{}return this.configurationModel}async updateConfiguration(e){return e?this.configurationCache.write(this.key,JSON.stringify({content:e})):this.configurationCache.remove(this.key)}}class Aei extends ${get initialized(){return this._initialized}constructor(e,t,i,s){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=s,this._workspaceConfigurationDisposables=this._register(new Z),this._workspaceIdentifier=null,this._isWorkspaceTrusted=!1,this._onDidUpdateConfiguration=this._register(new I),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this._initialized=!1,this.fileService=t,this._workspaceConfiguration=this._cachedConfiguration=new Eei(e,s)}async initialize(e,t){this._workspaceIdentifier=e,this._isWorkspaceTrusted=t,this._initialized||(this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)?(this._workspaceConfiguration=this._cachedConfiguration,this.waitAndInitialize(this._workspaceIdentifier)):this.doInitialize(new _Y(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:WX,skipRestricted:this.isUntrusted()})}getFolders(){return this._workspaceConfiguration.getFolders()}setFolders(e,t){return this._workspaceIdentifier?t.write(this._workspaceIdentifier.configPath,[{path:["folders"],value:e}],!0).then(()=>this.reload()):Promise.resolve()}isTransient(){return this._workspaceConfiguration.isTransient()}getConfiguration(){return this._workspaceConfiguration.getWorkspaceSettings()}updateWorkspaceTrust(e){return this._isWorkspaceTrusted=e,this.reparseWorkspaceSettings()}reparseWorkspaceSettings(){return this._workspaceConfiguration.reparseWorkspaceSettings({scopes:WX,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await CJe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof _Y)){const t=this._register(new _Y(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:WX,skipRestricted:this.isUntrusted()}),this.doInitialize(t),this.onDidWorkspaceConfigurationChange(!1,!0)}}doInitialize(e){this._workspaceConfigurationDisposables.clear(),this._workspaceConfiguration=this._workspaceConfigurationDisposables.add(e),this._workspaceConfigurationDisposables.add(this._workspaceConfiguration.onDidChange(t=>this.onDidWorkspaceConfigurationChange(!0,!1))),this._initialized=!0}isUntrusted(){return!this._isWorkspaceTrusted}async onDidWorkspaceConfigurationChange(e,t){e&&await this.reload(),this.updateCache(),this._onDidUpdateConfiguration.fire(t)}async updateCache(){if(this._workspaceIdentifier&&this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)&&this._workspaceConfiguration instanceof _Y){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class _Y extends ${constructor(e,t,i){super(),this.fileService=e,this.logService=i,this._workspaceIdentifier=null,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.workspaceConfigurationModelParser=new _re("",i),this.workspaceSettings=_s.createEmptyModel(i),this._register(T.any(T.filter(this.fileService.onDidFilesChange,s=>!!this._workspaceIdentifier&&s.contains(this._workspaceIdentifier.configPath)),T.filter(this.fileService.onDidRunOperation,s=>!!this._workspaceIdentifier&&(s.isOperation(Li.CREATE)||s.isOperation(Li.COPY)||s.isOperation(Li.DELETE)||s.isOperation(Li.WRITE))&&t.extUri.isEqual(s.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this._onDidChange.fire(),50)),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile())}get workspaceIdentifier(){return this._workspaceIdentifier}async resolveContent(e){return(await this.fileService.readFile(e.configPath,{atomic:!0})).value.toString()}async load(e,t){(!this._workspaceIdentifier||this._workspaceIdentifier.id!==e.id)&&(this._workspaceIdentifier=e,this.workspaceConfigurationModelParser=new _re(this._workspaceIdentifier.id,this.logService),St(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(s){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(s)}this.workspaceConfigurationModelParser.parse(i,t),this.consolidate()}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}watchWorkspaceConfigurationFile(){return this._workspaceIdentifier?this.fileService.watch(this._workspaceIdentifier.configPath):$.None}}class Eei{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=T.None,this.workspaceConfigurationModelParser=new _re("",t),this.workspaceSettings=_s.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),s=await this.configurationCache.read(i),o=JSON.parse(s);o.content&&(this.workspaceConfigurationModelParser=new _re(i.key,this.logService),this.workspaceConfigurationModelParser.parse(o.content,t),this.consolidate())}catch{}}get workspaceIdentifier(){return null}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}async updateWorkspace(e,t){try{const i=this.getKey(e);t?await this.configurationCache.write(i,JSON.stringify({content:t})):await this.configurationCache.remove(i)}catch{}}getKey(e){return{type:"workspaces",key:e.id}}}class xei{constructor(e,t,i,s,o){this.configurationCache=s,this.logService=o,this.onDidChange=T.None,this.key={type:"folder",key:Ed(qt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new Px("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=_s.createEmptyModel(o)}async loadConfiguration(){try{const e=await this.configurationCache.read(this.key),{content:t}=JSON.parse(e.toString());if(t)for(const i of Object.keys(t))if(i===mre)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const s=new tat(i,i,this.logService);s.parse(t[i]),this._standAloneConfigurations.push(s.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[mre]=e),t.forEach(([s,o])=>{o&&(i[s]=o)}),Object.keys(i).length?await this.configurationCache.write(this.key,JSON.stringify({content:i})):await this.configurationCache.remove(this.key)}getRestrictedSettings(){return this._folderSettingsModelParser.restrictedConfigurations}reparse(e){return this._folderSettingsParseOptions=e,this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions),this.consolidate(),this.configurationModel}consolidate(){this.configurationModel=this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations)}getUnsupportedKeys(){return[]}}class Dei extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=s,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=Nn.WORKSPACE===this.workbenchState?Xrt:WX,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new xei(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,CJe(t.uri,r).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())))}loadConfiguration(){return this.folderConfiguration.loadConfiguration()}updateWorkspaceTrust(e){return this.workspaceTrusted=e,this.reparse()}reparse(){const e=this.folderConfiguration.reparse({scopes:this.scopes,skipRestricted:this.isUntrusted()});return this.updateCache(),e}getRestrictedSettings(){return this.folderConfiguration.getRestrictedSettings()}isUntrusted(){return!this.workspaceTrusted}onDidFolderConfigurationChange(){this.updateCache(),this._onDidChange.fire()}createFileServiceBasedConfiguration(e,t,i){const s=t.extUri.joinPath(this.configurationFolder,`${mre}.json`),o=[$p,kk].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new wre(this.configurationFolder.toString(),s,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof wre){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}const $Oe="vs/workbench/services/configuration/browser/configurationService";function F7e(n,e){return n.isDefault||n.useDefaultFlags?.settings?e?aei:void 0:e?Jrt:rei}class ume extends kJe{constructor(){super(...arguments),this.initialized=!1}}class kei extends ${get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,s,o,r,a,c,l,d){if(super(),this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.remoteAgentService=a,this.uriIdentityService=c,this.logService=l,this.initialized=!1,this.applicationConfiguration=null,this.remoteUserConfiguration=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeWorkspaceFolders=this._register(new I),this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=this._register(new I),this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkspaceName=this._register(new I),this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onDidChangeWorkbenchState=this._register(new I),this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event,this.isWorkspaceTrusted=!0,this._restrictedSettings={default:[]},this._onDidChangeRestrictedSettings=this._register(new I),this.onDidChangeRestrictedSettings=this._onDidChangeRestrictedSettings.event,this.configurationRegistry=it.as(Cs.Configuration),this.initRemoteUserConfigurationBarrier=new Uh,this.completeWorkspaceBarrier=new Uh,this.defaultConfiguration=this._register(new uLe(t,i,l)),this.policyConfiguration=d instanceof TZe?new G0t:this._register(new lCe(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),new wi,_s.createEmptyModel(l),new wi,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new Cei(s.currentProfile.settingsResource,s.currentProfile.tasksResource,{scopes:F7e(s.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new wi,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new yei(e,t,r,c,a,l));this._register(h.onDidInitialize(u=>{this._register(h.onDidChangeConfiguration(f=>this.onRemoteUserConfigurationChanged(f))),this.onRemoteUserConfigurationChanged(u),this.initRemoteUserConfigurationBarrier.open()}))}else this.initRemoteUserConfigurationBarrier.open();this.workspaceConfiguration=this._register(new Aei(t,r,c,l)),this._register(this.workspaceConfiguration.onDidUpdateConfiguration(h=>{this.onWorkspaceConfigurationChanged(h).then(()=>{this.workspace.initialized=this.workspaceConfiguration.initialized,this.checkAndMarkWorkspaceComplete(h)})})),this._register(this.defaultConfiguration.onDidChangeConfiguration(({properties:h,defaults:u})=>this.onDefaultConfigurationChanged(u,h))),this._register(this.policyConfiguration.onDidChangeConfiguration(h=>this.onPolicyConfigurationChanged(h))),this._register(s.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new dO}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new bei(this.userDataProfilesService,this.fileService,this.uriIdentityService,this.logService))),this.applicationConfigurationDisposables.add(this.applicationConfiguration.onDidChangeConfiguration(e=>this.onApplicationConfigurationChanged(e))))}async getCompleteWorkspace(){return await this.completeWorkspaceBarrier.wait(),this.getWorkspace()}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace.configuration?Nn.WORKSPACE:this.workspace.folders.length===1?Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return this.workspace.getFolder(e)}addFolders(e,t){return this.updateFolders(e,[],t)}removeFolders(e){return this.updateFolders([],e)}async updateFolders(e,t,i){return this.workspaceEditingQueue.queue(()=>this.doUpdateFolders(e,t,i))}isInsideWorkspace(e){return!!this.getWorkspaceFolder(e)}isCurrentWorkspace(e){switch(this.getWorkbenchState()){case Nn.FOLDER:{let t;return P.isUri(e)?t=e:BS(e)&&(t=e.uri),P.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case Nn.WORKSPACE:return hF(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==Nn.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let s=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>iat(a)?!this.contains(t,o[c].uri):!0);if(s=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=dme(r,a,this.uriIdentityService.extUri);const l=o.map(h=>h.uri),d=[];for(const h of e){const u=h.uri;if(!this.contains(l,u)){try{if(!(await this.fileService.stat(u)).isDirectory)continue}catch{}d.push(zOe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(s=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(dL))),this.onWorkspaceConfigurationChanged(!1)}contains(e,t){return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t))}getConfigurationData(){return this._configuration.toData()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=zge(e)?e:zge(t)?t:void 0;return this._configuration.getValue(i,s)}async updateValue(e,t,i,s,o){const r=yft(i)?i:zge(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?s:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=Lc(r.overrideIdentifiers),r.overrideIdentifiers=r.overrideIdentifiers.length?r.overrideIdentifiers:void 0),!c.length){if(r?.overrideIdentifiers&&r.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:r?.resource,overrideIdentifier:r?.overrideIdentifiers?r.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Io(t,l.defaultValue)&&c.length===1&&(c[0]===Ot.USER||c[0]===Ot.USER_LOCAL)&&(t=void 0)}await ko.settled(c.map(l=>this.writeConfigurationValue(e,t,l,r,o)))}async reloadConfiguration(e){if(e===void 0){this.reloadDefaultConfiguration();const t=await this.reloadApplicationConfiguration(!0),{local:i,remote:s}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,s,!0);return}if(sxt(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case Ot.DEFAULT:this.reloadDefaultConfiguration();return;case Ot.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case Ot.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case Ot.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case Ot.WORKSPACE:case Ot.WORKSPACE_FOLDER:await this.reloadWorkspaceConfiguration();return}}hasCachedConfigurationDefaultsOverrides(){return this.defaultConfiguration.hasCachedConfigurationDefaultsOverrides()}inspect(e,t){return this._configuration.inspect(e,t)}keys(){return this._configuration.keys()}async whenRemoteConfigurationLoaded(){await this.initRemoteUserConfigurationBarrier.wait()}async initialize(e){vs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),vs("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);let a;r&&(a=r.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(o.uri,a)),i.push(a)}this.getWorkbenchState()===Nn.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let s=[];this.restrictedSettings.userLocal&&s.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&s.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&s.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>s.push(...o)),s=Lc(s),s.length&&this.triggerConfigurationChange({keys:s,overrides:[]},{data:t,workspace:this.workspace},Ot.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===ut.APPLICATION)return!0;const t=this.getValue(RA)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return hF(e)?this.createMultiFolderWorkspace(e):BS(e)?this.createSingleFolderWorkspace(e):this.createEmptyWorkspace(e)}async createMultiFolderWorkspace(e){await this.workspaceConfiguration.initialize({id:e.id,configPath:e.configPath},this.isWorkspaceTrusted);const t=e.configPath,i=dme(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),s=e.id,o=new ume(s,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new ume(e.id,[wee(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new ume(e.id,[],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,Promise.resolve(t)}checkAndMarkWorkspaceComplete(e){!this.completeWorkspaceBarrier.isOpen()&&this.workspace.initialized&&(this.completeWorkspaceBarrier.open(),this.validateWorkspaceFoldersAndReload(e))}async updateWorkspaceAndInitializeConfiguration(e,t){const i=!!this.workspace;let s,o,r=[];if(i?(s=this.getWorkbenchState(),o=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,r=this.workspace.folders,this.workspace.update(e)):this.workspace=e,await this.initializeConfiguration(t),i){const a=this.getWorkbenchState();s&&a!==s&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==s)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(r,this.workspace.folders);l&&(l.added.length||l.removed.length||l.changed.length)&&(await this.handleWillChangeWorkspaceFolders(l,!1),this._onDidChangeWorkspaceFolders.fire(l))}this.localUserConfiguration.hasTasksLoaded||this._register(UB(yi,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(s=>!e.some(o=>s.uri.toString()===o.uri.toString()));for(let s=0;s{vs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(_s.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(RA)})}return vs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,s()]);vs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),vs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return _s.createEmptyModel(this.logService);const t=await this.applicationConfiguration.loadConfiguration();return e||this.onApplicationConfigurationChanged(t),t}async reloadUserConfiguration(){const[e,t]=await Promise.all([this.reloadLocalUserConfiguration(!0),this.reloadRemoteUserConfiguration(!0)]);return{local:e,remote:t}}async reloadLocalUserConfiguration(e,t){const i=await this.localUserConfiguration.reload(t);return e||this.onLocalUserConfigurationChanged(i),i}async reloadRemoteUserConfiguration(e){if(this.remoteUserConfiguration){const t=await this.remoteUserConfiguration.reload();return e||this.onRemoteUserConfigurationChanged(t),t}return _s.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===Nn.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===Nn.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,s){this.cachedFolderConfigs=new wi;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new wi;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,_s.createEmptyModel(this.logService),new wi,this.workspace,this.logService),this.initialized=!0,s){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},Ot.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case Nn.FOLDER:return e[0];case Nn.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return _s.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:F7e(e.profile,!!this.remoteUserConfiguration)})),(e.previous.isDefault!==e.profile.isDefault||!!e.previous.useDefaultFlags?.settings!=!!e.profile.useDefaultFlags?.settings)&&(this.createApplicationConfiguration(),this.applicationConfiguration&&t.push(this.reloadApplicationConfiguration(!0)));let[i,s]=await Promise.all(t);s=s??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:s.getValue(RA)})),await this.loadConfiguration(s,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),s=this._configuration.compareAndUpdateDefaultConfiguration(e,t);if(this.applicationConfiguration&&this._configuration.updateApplicationConfiguration(this.applicationConfiguration.reparse()),this.remoteUserConfiguration&&(this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse()),this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse())),this.getWorkbenchState()===Nn.FOLDER){const o=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);o&&(this._configuration.updateWorkspaceConfiguration(o.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,o.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);r&&this._configuration.updateFolderConfiguration(o.uri,r.reparse())}}this.triggerConfigurationChange(s,{data:i,workspace:this.workspace},Ot.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,Ot.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(RA)??[],s=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(RA)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of s.keys)if(r[c]?.scope===ut.APPLICATION){if(a.push(c),c===RA){for(const l of i)o.includes(l)||a.push(l);for(const l of o)i.includes(l)||a.push(l)}}else o.includes(c)&&a.push(c);s.keys=a,s.keys.includes(RA)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(s,t,Ot.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=dme(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:s,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||s.length||o.length?t=await this.toValidWorkspaceFolders(t):t=this.workspace.folders}await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}}updateRestrictedSettings(){const e=[],t=this.configurationRegistry.getConfigurationProperties(),i=Object.keys(t).filter(p=>t[p].restricted).sort((p,m)=>p.localeCompare(m)),s=UL(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...s.added,...s.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=UL(o,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...r.added,...r.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=UL(a,this._restrictedSettings.userLocal||[],(p,m)=>p.localeCompare(m));e.push(...c.added,...c.removed);const l=(this.remoteUserConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),d=UL(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new wi;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((C,y)=>C.localeCompare(y));v.length&&h.set(p.uri,v);const w=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],b=UL(v,w,(C,y)=>C.localeCompare(y));e.push(...b.added,...b.removed)}const u=this.getWorkbenchState()===Nn.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=UL(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:o.length?o:void 0,userLocal:a.length?a:void 0,userRemote:l.length?l:void 0,workspace:u.length?u:void 0,workspaceFolder:h.size?h:void 0},this._onDidChangeRestrictedSettings.fire(this.restrictedSettings))}async updateWorkspaceConfiguration(e,t,i){const s={data:this._configuration.toData(),workspace:this.workspace},o=this._configuration.compareAndUpdateWorkspaceConfiguration(t),r=this.compareFolders(this.workspace.folders,e);if(r.added.length||r.removed.length||r.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(r,i),this.triggerConfigurationChange(a,s,Ot.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,s,Ot.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(s){i.push(s)},changes:e,fromCache:t});try{await ko.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},s=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===Nn.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(YHe(s,o),i,Ot.WORKSPACE)}else this.triggerConfigurationChange(s,i,Ot.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(s=>s.uri.toString()===i.toString())[0]||(this.cachedFolderConfigs.get(i).dispose(),this.cachedFolderConfigs.delete(i),e.push(this._configuration.compareAndDeleteFolderConfiguration(i)));const t=this.workspace.folders.filter(i=>!this.cachedFolderConfigs.has(i.uri));return t.length&&(await this.loadFolderConfigurations(t)).forEach((s,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,s))}),YHe(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new Dei(!this.initialized,t,uue,this.getWorkbenchState(),this.isWorkspaceTrusted,this.fileService,this.uriIdentityService,this.logService,this.configurationCache),this._register(i.onDidChange(()=>this.onWorkspaceFolderConfigurationChanged(t))),this.cachedFolderConfigs.set(t.uri,this._register(i))),i.loadConfiguration()})])}async validateWorkspaceFoldersAndReload(e){const t=await this.toValidWorkspaceFolders(this.workspace.folders),{removed:i}=this.compareFolders(this.workspace.folders,t);i.length&&await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}async toValidWorkspaceFolders(e){const t=[];for(const i of e){try{if(!(await this.fileService.stat(i.uri)).isDirectory)continue}catch(s){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Ma(s)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,s,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===Ot.DEFAULT)throw new Error("Invalid configuration target");if(i===Ot.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,s),this.triggerConfigurationChange({keys:s?.overrideIdentifiers?.length?[Vje(s.overrideIdentifiers),e]:[e],overrides:s?.overrideIdentifiers?.length?s.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===Mn.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(s?.overrideIdentifiers?.length&&s.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,s.resource);if(a){const c=s.overrideIdentifiers.sort(),l=a.overrides.find(d=>Ls([...d.identifiers].sort(),c));l&&(s.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:s,...o}),r){case Mn.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case Mn.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case Mn.WORKSPACE:return this.reloadWorkspaceConfiguration();case Mn.WORKSPACE_FOLDER:{const a=s&&s.resource?this.workspace.getFolder(s.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance(hLe,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case Mn.USER_LOCAL:return this._configuration.localUserConfiguration;case Mn.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Mn.WORKSPACE:return this._configuration.workspaceConfiguration;case Mn.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case Ot.USER_LOCAL:return this._configuration.localUserConfiguration;case Ot.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Ot.WORKSPACE:return this._configuration.workspaceConfiguration;case Ot.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Io(t,i.value))return[];const s=[];return i.workspaceFolderValue!==void 0&&s.push(Ot.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&s.push(Ot.WORKSPACE),i.userRemoteValue!==void 0&&s.push(Ot.USER_REMOTE),i.userLocalValue!==void 0&&s.push(Ot.USER_LOCAL),i.applicationValue!==void 0&&s.push(Ot.APPLICATION),t===void 0?s:[s[0]||Ot.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==Ot.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Sft(i)} target`,...e.keys);const s=new ANe(e,t,this._configuration,this.workspace,this.logService);s.source=i,this._onDidChangeConfiguration.fire(s)}}toEditableConfigurationTarget(e,t){if(e===Ot.APPLICATION)return Mn.USER_LOCAL;if(e===Ot.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===ut.MACHINE||i===ut.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return Mn.USER_REMOTE}return Mn.USER_LOCAL}return e===Ot.USER_LOCAL?Mn.USER_LOCAL:e===Ot.USER_REMOTE?Mn.USER_REMOTE:e===Ot.WORKSPACE?Mn.WORKSPACE:e===Ot.WORKSPACE_FOLDER?Mn.WORKSPACE_FOLDER:null}}let gLe=class extends ${constructor(e,t,i,s,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,s.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=it.as(Cs.Configuration),a=this._register(new Lu(50));this._register(T.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Us.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Wf.properties,patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},l3.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},s={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(sE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Wf.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.properties[d]),l),{}),patternProperties:Object.keys(Wf.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=Nn.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g($Oe,0,"Contribute defaults for configurations"),properties:Object.assign({},nE.properties,sE.properties,vb.properties),patternProperties:{[KD]:{type:"object",default:{},$ref:ED}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:s,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=it.as(eL.JSONContribution);t.registerSchema(ZZt,e.defaultSettingsSchema),t.registerSchema(eei,e.userSettingsSchema),t.registerSchema(tei,e.profileSettingsSchema),t.registerSchema(iei,e.machineSettingsSchema),t.registerSchema(Yrt,e.workspaceSettingsSchema),t.registerSchema(nei,e.folderSettingsSchema),t.registerSchema(Hje,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,s])=>{s.restricted||(t[i]=s)}),t}};gLe=D([_(0,Ti),_(1,Za),_(2,oA),_(3,ho),_(4,mg)],gLe);let fLe=class extends ${constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(Ot.DEFAULT))}};fLe=D([_(0,Re),_(1,ho)],fLe);var QH;let bre=(QH=class extends ${constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=it.as(Cs.Configuration),this.processExperimentalSettings(Object.keys(this.configurationRegistry.getConfigurationProperties())),this._register(this.configurationRegistry.onDidUpdateConfiguration(({properties:t})=>this.processExperimentalSettings(t)))}async processExperimentalSettings(e){const t={},i=this.configurationRegistry.getConfigurationProperties();for(const s of e){const o=i[s];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(s)){this.processedExperimentalSettings.add(s);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${s}`);!ll(r)&&!Io(r,o.default)&&(t[s]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t,source:g($Oe,1,"Experiments")}])}},QH.ID="workbench.contrib.updateExperimentalSettingsDefaults",QH);bre=D([_(0,get)],bre);const oat=it.as(pf.Workbench);oat.registerWorkbenchContribution(gLe,Us.Restored);oat.registerWorkbenchContribution(fLe,Us.Eventually);gp(bre.ID,bre,Sl.BlockRestore);const Iei=it.as(Cs.Configuration);Iei.registerConfiguration({...PQ,properties:{[RA]:{type:"array",description:g($Oe,2,"Configure settings to be applied for all profiles."),default:[],scope:ut.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class Lei{constructor(e,t,i){this.donotCacheResourcesWithSchemes=e,this.fileService=i,this.cachedConfigurations=new Map,this.cacheHome=t.cacheHome}needsCaching(e){return!this.donotCacheResourcesWithSchemes.includes(e.scheme)}read(e){return this.getCachedConfiguration(e).read()}write(e,t){return this.getCachedConfiguration(e).save(t)}remove(e){return this.getCachedConfiguration(e).remove()}getCachedConfiguration({type:e,key:t}){const i=`${e}:${t}`;let s=this.cachedConfigurations.get(i);return s||(s=new Tei({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,s)),s}}class Tei{constructor({type:e,key:t},i,s){this.fileService=s,this.cachedConfigurationFolderResource=qt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=qt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new dO}async read(){try{return(await this.fileService.readFile(this.cachedConfigurationFileResource)).value.toString()}catch{return""}}async save(e){await this.createCachedFolder()&&await this.queue.queue(async()=>{await this.fileService.writeFile(this.cachedConfigurationFileResource,ze.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Xi.FILE_NOT_FOUND)throw e}}async createCachedFolder(){if(await this.fileService.exists(this.cachedConfigurationFolderResource))return!0;try{return await this.fileService.createFolder(this.cachedConfigurationFolderResource),!0}catch{return!1}}}const Zm="vs/workbench/services/label/common/labelService",Rei=Ap.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(Zm,0,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(Zm,1,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(Zm,2,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(Zm,3,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(Zm,4,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(Zm,5,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(Zm,6,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(Zm,7,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(Zm,8,"Suffix appended to the workspace label.")}}}}}}}),O7e=/\//g,Mei=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function Nei(n){return!!(n&&n[2]===":")}let pLe=class{constructor(e){this.formattersDisposables=new Map,Rei.setHandler((t,i)=>{for(const s of i.added)for(const o of s.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=dg),!Cd(s.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const s of i.removed)for(const o of s.value)St(this.formattersDisposables.get(o))})}};pLe=D([_(0,eo)],pLe);it.as(pf.Workbench).registerWorkbenchContribution(pLe,Us.Restored);const B7e=50;let mLe=class extends ${constructor(e,t,i,s,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=s,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=zc,this.userHome=i.defaultUriScheme===_e.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new W1("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(ke.PROFILE,ln.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??zc,this.userHome=await this.pathService.userHome()}findFormatting(e){let t;for(const i of this.formatters)if(i.scheme===e.scheme){if(!i.authority&&(!t||i.priority)){t=i;continue}if(!i.authority)continue;WW(i.authority.toLowerCase(),e.authority.toLowerCase())&&(!t||!t.authority||i.authority.length>t.authority.length||i.authority.length===t.authority.length&&i.priority)&&(t=i)}return t?t.formatting:void 0}getUriLabel(e,t={}){let i=this.findFormatting(e);i&&t.separator&&(i={...i,separator:t.separator});const s=this.doGetUriLabel(e,i,t);return!i&&t.separator?s.replace(O7e,t.separator):s}doGetUriLabel(e,t,i={}){if(!t)return nPt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:s=>this.contextService.getWorkspaceFolder(s)}:void 0});if(i.relative&&this.contextService){let s=this.contextService.getWorkspaceFolder(e);if(!s){const o=this.contextService.getWorkspace(),r=k_(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(qi.sep)&&(s=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(s){const o=this.formatUri(s.uri,t,i.noPrefix);let r=this.formatUri(e,t,i.noPrefix),a=0;for(;r[a]&&r[a]===o[a];)a++;if(!r[a]||r[a]===t.separator?r=r.substring(1+a):a===o.length&&s.uri.path===qi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=s?.name??Mx(s.uri);r=r?`${l} • ${r}`:l}return r}}return this.formatUri(e,t,i.noPrefix)}getUriBasenameLabel(e){const t=this.findFormatting(e),i=this.doGetUriLabel(e,t);let s;return t?.separator===$c.sep?s=$c:t?.separator===qi.sep?s=qi:s=this.os===Pr.Windows?$c:qi,s.basename(i)}getWorkspaceLabel(e,t){if(cbe(e)){const i=UW(e);return BS(i)||hF(i)?this.getWorkspaceLabel(i,t):""}return P.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):BS(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):hF(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(p7(e,this.environmentService))return g(Zm,9,"Untitled (Workspace)");if(hx(e))return g(Zm,10,"Workspace");let i=ui(e);i.endsWith(qb)&&(i=i.substr(0,i.length-qb.length-1));let s;switch(t?.verbose){case e_.SHORT:s=i;break;case e_.LONG:s=g(Zm,11,"{0} (Workspace)",this.getUriLabel(qt(ma(e),i)));break;case e_.MEDIUM:default:s=g(Zm,12,"{0} (Workspace)",i);break}return t?.verbose===e_.SHORT?s:this.appendWorkspaceSuffix(s,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case e_.LONG:i=this.getUriLabel(e);break;case e_.SHORT:case e_.MEDIUM:default:i=ui(e)||qi.sep;break}return t?.verbose===e_.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.separator||qi.sep}getHostLabel(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(s=>s.scheme===e.scheme&&s.authority===e.authority);if(i===-1&&t.length>=B7e&&(i=B7e-1),i===-1)t.unshift(e);else{for(let s=i;s>0;s--)t[s]=t[s-1];t[0]=e}return this.storedFormattersMemento.saveMemento(),this.registerFormatter(e)}registerFormatter(e){return this.formatters.push(e),this._onDidChangeFormatters.fire({scheme:e.scheme}),{dispose:()=>{this.formatters=this.formatters.filter(t=>t!==e),this._onDidChangeFormatters.fire({scheme:e.scheme})}}}formatUri(e,t,i){let s=t.label.replace(Mei,(o,r,a,c)=>{switch(r){case"scheme":return e.scheme;case"authority":return e.authority;case"authoritySuffix":{const l=e.authority.indexOf("+");return l===-1?e.authority:e.authority.slice(l+1)}case"path":return t.stripPathStartingSeparator?e.path.slice(e.path[0]===t.separator?1:0):e.path;default:{if(a==="query"){const{query:l}=e;if(l&&l[0]==="{"&&l[l.length-1]==="}")try{return JSON.parse(l)[c]||""}catch{}}return""}}});return t.normalizeDriveLetter&&Nei(s)&&(s=s.charAt(1).toUpperCase()+s.substr(2)),t.tildify&&!i&&this.userHome&&(s=rtt(s,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(s=t.authorityPrefix+s),s.replace(O7e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),s=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return s?`${e} [${s}]`:e}};mLe=D([_(0,Za),_(1,Ti),_(2,Lm),_(3,Sf),_(4,sn),_(5,mg)],mLe);let _Le=class{constructor(e,t,i,s){this.configurationService=e,this.environmentService=i,this.storageService=s,this.remoteEnvironment=null,t.getEnvironment().then(o=>this.remoteEnvironment=o)}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});if(i&&typeof i=="string"&&i!=="auto")return i;const s=this.getOS(e);return s===Pr.Linux||s===Pr.Macintosh?` +`},d=due(n,["folders"],c,l);let h=d7e(n,d);return _Z(o.remoteAuthority,uZe(i))&&(h=d7e(h,fJt(h,["remoteAuthority"],l))),h}function fei(n,e){const t=ow(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>iat(i));else throw new Error(`${n} looks like an invalid workspace file.`);return t}function pei(n){return n.workspace&&typeof n.workspace=="object"&&typeof n.workspace.id=="string"&&typeof n.workspace.configPath=="string"}function mei(n){return typeof n.folderUri=="string"}function _ei(n){return typeof n.fileUri=="string"}function vei(n,e){const t={workspaces:[],files:[]};if(n){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;pei(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:P.parse(o.workspace.configPath)}}):mei(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:P.parse(o.folderUri)}):_ei(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:P.parse(o.fileUri)})})}return t}function wei(n){const e={entries:[]};for(const t of n.workspaces)UX(t)?e.entries.push({folderUri:t.folderUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority}):e.entries.push({workspace:{id:t.workspace.id,configPath:t.workspace.configPath.toString()},label:t.label,remoteAuthority:t.remoteAuthority});for(const t of n.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const sat=Re,zs="vs/workbench/services/configuration/common/configurationEditing";var Tr;(function(n){n[n.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",n[n.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",n[n.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",n[n.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",n[n.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",n[n.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",n[n.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",n[n.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",n[n.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",n[n.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",n[n.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",n[n.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",n[n.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(Tr||(Tr={}));class P7e extends uc{constructor(e,t){super(e),this.code=t}}var Mn;(function(n){n[n.USER_LOCAL=1]="USER_LOCAL",n[n.USER_REMOTE=2]="USER_REMOTE",n[n.WORKSPACE=3]="WORKSPACE",n[n.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(Mn||(Mn={}));let hLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new dO}async writeConfiguration(e,t,i={}){const s=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(s,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,s,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,s=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(s.object.textEditorModel);await this.updateConfiguration(e,s.object.textEditorModel,o,t)}finally{s.dispose()}}async updateConfiguration(e,t,i,s){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&s.handleDirtyFile)switch(s.handleDirtyFile){case"save":await this.save(t,e);break;case"revert":await this.textFileService.revert(t.uri);break}const o=this.getEdits(e,t.getValue(),i)[0];o&&this.applyEditsToBuffer(o,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===Zi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new P7e(g(zs,0,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),Tr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),s=t.getPositionAt(e.offset+e.length),o=new O(i.lineNumber,i.column,s.lineNumber,s.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?ds.replace(o,e.content):ds.insert(i,e.content);return t.pushEditOperations([new mt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,s){return t.length?due(i,t,e,s):[{content:JSON.stringify(e,null,s.insertSpaces&&s.tabSize?" ".repeat(s.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),s=e.getEOL();return{insertSpaces:t,tabSize:i,eol:s}}async onError(e,t,i){switch(e.code){case Tr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case Tr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:return this.doWriteConfiguration(t,{scopes:i,handleDirtyFile:"revert"});default:this.notificationService.error(e.message)}}onInvalidConfigurationError(e,t){const i=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;i?this.notificationService.prompt(nt.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const s=t.workspaceStandAloneConfigurationKey===$p?g(zs,1,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===kk?g(zs,2,"Open Launch Configuration"):null;s?this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>{const o=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:o,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:s,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(nt.Error,e.message,[{label:g(zs,4,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(zs,3,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case Mn.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case Mn.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case Mn.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case Mn.WORKSPACE_FOLDER:if(e.resource){const i=this.contextService.getWorkspaceFolder(e.resource);i&&this.preferencesService.openFolderSettings({folderUri:i.uri,jsonEditor:!0})}break}}openFile(e){this.editorService.openEditor({resource:e,options:{pinned:!0}})}toConfigurationEditingError(e,t,i){const s=this.toErrorMessage(e,t,i);return new P7e(s,e)}toErrorMessage(e,t,i){switch(e){case Tr.ERROR_POLICY_CONFIGURATION:return g(zs,5,"Unable to write {0} because it is configured in system policy.",i.key);case Tr.ERROR_UNKNOWN_KEY:return g(zs,6,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(zs,7,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(zs,8,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case Tr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(zs,9,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case Tr.ERROR_INVALID_USER_TARGET:return g(zs,10,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case Tr.ERROR_INVALID_WORKSPACE_TARGET:return g(zs,11,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case Tr.ERROR_INVALID_FOLDER_TARGET:return g(zs,12,"Unable to write to Folder Settings because no resource is provided.");case Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(zs,13,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case Tr.ERROR_NO_WORKSPACE_OPENED:return g(zs,14,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case Tr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,15,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,16,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case Mn.USER_LOCAL:return g(zs,17,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case Mn.USER_REMOTE:return g(zs,18,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case Mn.WORKSPACE:return g(zs,19,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,20,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,21,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,22,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case Mn.USER_LOCAL:return g(zs,23,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case Mn.USER_REMOTE:return g(zs,24,"Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again.");case Mn.WORKSPACE:return g(zs,25,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case Mn.WORKSPACE_FOLDER:{let s="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(s=o.name)}return g(zs,26,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",s)}default:return""}}case Tr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===$p)return g(zs,27,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===kk)return g(zs,28,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case Mn.USER_LOCAL:return g(zs,29,"Unable to write into user settings because the content of the file is newer.");case Mn.USER_REMOTE:return g(zs,30,"Unable to write into remote user settings because the content of the file is newer.");case Mn.WORKSPACE:return g(zs,31,"Unable to write into workspace settings because the content of the file is newer.");case Mn.WORKSPACE_FOLDER:return g(zs,32,"Unable to write into folder settings because the content of the file is newer.")}case Tr.ERROR_INTERNAL:return g(zs,33,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case Mn.USER_LOCAL:return g(zs,34,"User Settings");case Mn.USER_REMOTE:return g(zs,35,"Remote User Settings");case Mn.WORKSPACE:return g(zs,36,"Workspace Settings");case Mn.WORKSPACE_FOLDER:return g(zs,37,"Folder Settings");default:return""}}defaultResourceValue(e){const t=this.uriIdentityService.extUri.basename(e);switch(t.substr(0,t.length-this.uriIdentityService.extUri.extname(e).length)){case $p:return cei;default:return"{}"}}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,this.defaultResourceValue(e),{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e,t){if(t.workspaceStandAloneConfigurationKey&&!t.key)return!1;const i=[];return ow(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,s){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_POLICY_CONFIGURATION,e,t);const r=it.as(Cs.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!dp.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(Tr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==$p&&(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_USER_TARGET,e,t);if((e===Mn.WORKSPACE||e===Mn.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===Nn.EMPTY)throw this.toConfigurationEditingError(Tr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===Mn.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)){if(r===ut.APPLICATION)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===ut.MACHINE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===Mn.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!dp.test(t.key)&&r!==void 0&&!Xrt.includes(r))throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(s.overrideIdentifiers?.length&&r!==ut.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(Tr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(Tr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===Mn.USER_LOCAL?Zrt:VOe,d=Object.keys(l);for(const h of d){const u=this.getConfigurationFileResource(e,h,l[h],i.resource,void 0);if(t.key===h){const p=this.isWorkspaceConfigurationResource(u)?[h]:[];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}const f=`${h}.`;if(t.key.indexOf(f)===0){const p=this.isWorkspaceConfigurationResource(u)?[h,t.key.substr(f.length)]:[t.key.substr(f.length)];return{key:p[p.length-1],jsonPath:p,value:t.value,resource:u??void 0,workspaceStandAloneConfigurationKey:h,target:e}}}}const s=t.key,r=it.as(Cs.Configuration).getConfigurationProperties()[s]?.scope;let a=i.overrideIdentifiers?.length?[Vje(i.overrideIdentifiers),s]:[s];if(e===Mn.USER_LOCAL||e===Mn.USER_REMOTE)return{key:s,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,s,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,s,XZt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:s,jsonPath:a,value:t.value,resource:c??void 0,target:e}}isWorkspaceConfigurationResource(e){const t=this.contextService.getWorkspace();return!!(t.configuration&&e&&t.configuration.fsPath===e.fsPath)}getConfigurationFileResource(e,t,i,s,o){if(e===Mn.USER_LOCAL)return t===$p?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===Mn.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==Nn.EMPTY){const a=this.contextService.getWorkspace();if(e===Mn.WORKSPACE){if(r===Nn.WORKSPACE)return a.configuration??null;if(r===Nn.FOLDER)return a.folders[0].toResource(i)}if(e===Mn.WORKSPACE_FOLDER&&s){const c=this.contextService.getWorkspaceFolder(s);if(c)return c.toResource(i)}}return null}};hLe=D([_(1,sat),_(2,Ti),_(3,Tm),_(4,V_),_(5,ci),_(6,Rn),_(7,tr),_(8,Pi),_(9,TQ),_(10,_i),_(11,_o)],hLe);const _W=class _W extends KXe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=it.as(Cs.Configuration),this.cachedConfigurationDefaultsOverrides={},this.cacheKey={type:"defaults",key:"configurationDefaultsOverrides"},this.updateCache=!1,t.options?.configurationDefaults&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t.options.configurationDefaults}])}getConfigurationDefaultOverrides(){return this.cachedConfigurationDefaultsOverrides}async initialize(){return await this.initializeCachedConfigurationDefaultsOverrides(),super.initialize()}reload(){return this.updateCache=!0,this.cachedConfigurationDefaultsOverrides={},this.updateCachedConfigurationDefaultsOverrides(),super.reload()}hasCachedConfigurationDefaultsOverrides(){return!n1(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=fo(this.cachedConfigurationDefaultsOverrides)?this.cachedConfigurationDefaultsOverrides:{}})()),this.initiaizeCachedConfigurationDefaultsOverridesPromise}onDidUpdateConfiguration(e,t){super.onDidUpdateConfiguration(e,t),t&&this.updateCachedConfigurationDefaultsOverrides()}async updateCachedConfigurationDefaultsOverrides(){if(!this.updateCache)return;const e={},t=this.configurationRegistry.getConfigurationDefaultsOverrides();for(const[i,s]of t)!dp.test(i)&&s.value!==void 0&&(e[i]=s.value);try{Object.keys(e).length?(localStorage.setItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};_W.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let uLe=_W;class bei extends yJe{constructor(e,t,i,s){super(e.defaultProfile.settingsResource,{scopes:[ut.APPLICATION]},i.extUri,t,s),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(RA),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class Cei extends ${get hasTasksLoaded(){return this.userConfiguration.value instanceof wre}constructor(e,t,i,s,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=s,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new Dn),this.userConfigurationChangeDisposable=this._register(new Dn),this.userConfiguration.value=new yJe(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new yn(()=>this.userConfiguration.value.loadConfiguration().then(a=>this._onDidChangeConfiguration.fire(a)),50))}async reset(e,t,i){return this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.doReset()}async doReset(e){const t=this.uriIdentityService.extUri.dirname(this.settingsResource),i=this.tasksResource?[[$p,this.tasksResource]]:[],s=new wre(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await s.loadConfiguration(e);return this.userConfiguration.value=s,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),o}async initialize(){return this.userConfiguration.value.loadConfiguration()}async reload(e){return this.hasTasksLoaded?this.userConfiguration.value.loadConfiguration():this.doReset(e)}reparse(e){return this.configurationParseOptions={...this.configurationParseOptions,...e},this.userConfiguration.value.reparse(this.configurationParseOptions)}getRestrictedSettings(){return this.userConfiguration.value.getRestrictedSettings()}}class wre extends ${constructor(e,t,i,s,o,r,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=o,this.uriIdentityService=r,this.logService=a,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.allResources=[this.settingsResource,...this.standAloneConfigurationResources.map(([,c])=>c)],this._register(pa(...this.allResources.map(c=>pa(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new Px(e,a),this._folderSettingsParseOptions=s,this._standAloneConfigurations=[],this._cache=_s.createEmptyModel(this.logService),this._register(T.debounce(T.any(T.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),T.filter(this.fileService.onDidRunOperation,c=>this.handleFileOperationEvent(c))),()=>{},100)(()=>this._onDidChange.fire()))}async resolveContents(e){const t=async o=>Promise.all(o.map(async r=>{try{return(await this.fileService.readFile(r,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${r.toString()}': ${lg(a)}`),a.fileOperationResult!==Zi.FILE_NOT_FOUND&&a.fileOperationResult!==Zi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],s]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,s.map((o,r)=>[this.standAloneConfigurationResources[r][0],o])]}async loadConfiguration(e){const[t,i]=await this.resolveContents(!!e);this._standAloneConfigurations=[],this._folderSettingsModelParser.parse("",this._folderSettingsParseOptions),t!==void 0&&this._folderSettingsModelParser.parse(t,this._folderSettingsParseOptions);for(let s=0;se.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),Ko.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Li.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class yei extends ${constructor(e,t,i,s,o,r){super(),this._userConfigurationInitializationPromise=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidInitialize=this._register(new I),this.onDidInitialize=this._onDidInitialize.event,this._fileService=i,this._userConfiguration=this._cachedConfiguration=new Sei(e,t,{scopes:cme},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new hme(a.settingsPath,{scopes:cme},this._fileService,s,r));this._register(c.onDidChangeConfiguration(d=>this.onDidUserConfigurationChange(d))),this._userConfigurationInitializationPromise=c.initialize();const l=await this._userConfigurationInitializationPromise;this._userConfiguration.dispose(),this._userConfiguration=c,this.onDidUserConfigurationChange(l),this._onDidInitialize.fire(l)}})}async initialize(){if(this._userConfiguration instanceof hme)return this._userConfiguration.initialize();let e=await this._userConfiguration.initialize();return this._userConfigurationInitializationPromise&&(e=await this._userConfigurationInitializationPromise,this._userConfigurationInitializationPromise=null),e}reload(){return this._userConfiguration.reload()}reparse(){return this._userConfiguration.reparse({scopes:cme})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof hme){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Zi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class hme extends ${constructor(e,t,i,s,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=s,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new Dn),this.directoryWatcherDisposable=this._register(new Dn),this.parser=new Px(this.configurationResource.toString(),o),this.parseOptions=t,this._register(i.onDidFilesChange(r=>this.handleFileChangesEvent(r))),this._register(i.onDidRunOperation(r=>this.handleFileOperationEvent(r))),this.reloadConfigurationScheduler=this._register(new yn(()=>this.reload().then(r=>this._onDidChangeConfiguration.fire(r)),50)),this._register(Ee(()=>{this.stopWatchingResource(),this.stopWatchingDirectory()}))}watchResource(){this.fileWatcherDisposable.value=this.fileService.watch(this.configurationResource)}stopWatchingResource(){this.fileWatcherDisposable.value=void 0}watchDirectory(){const e=this.uriIdentityService.extUri.dirname(this.configurationResource);this.directoryWatcherDisposable.value=this.fileService.watch(e)}stopWatchingDirectory(){this.directoryWatcherDisposable.value=void 0}async initialize(){const e=await this.fileService.exists(this.configurationResource);return this.onResourceExists(e),this.reload()}async resolveContent(){return(await this.fileService.readFile(this.configurationResource,{atomic:!0})).value.toString()}async reload(){try{const e=await this.resolveContent();return this.parser.parse(e,this.parseOptions),this.parser.configurationModel}catch{return _s.createEmptyModel(this.logService)}}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}handleFileChangesEvent(e){let t=e.contains(this.configurationResource,Ko.UPDATED);e.contains(this.configurationResource,Ko.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,Ko.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Li.CREATE)||e.isOperation(Li.COPY)||e.isOperation(Li.DELETE)||e.isOperation(Li.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class Sei extends ${constructor(e,t,i,s){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new Px("CachedRemoteUserConfiguration",s),this.parseOptions=i,this.configurationModel=_s.createEmptyModel(s)}getConfigurationModel(){return this.configurationModel}initialize(){return this.reload()}reparse(e){return this.parseOptions=e,this.parser.reparse(this.parseOptions),this.configurationModel=this.parser.configurationModel,this.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}async reload(){try{const e=await this.configurationCache.read(this.key),t=JSON.parse(e);t.content&&(this.parser.parse(t.content,this.parseOptions),this.configurationModel=this.parser.configurationModel)}catch{}return this.configurationModel}async updateConfiguration(e){return e?this.configurationCache.write(this.key,JSON.stringify({content:e})):this.configurationCache.remove(this.key)}}class Aei extends ${get initialized(){return this._initialized}constructor(e,t,i,s){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=s,this._workspaceConfigurationDisposables=this._register(new Z),this._workspaceIdentifier=null,this._isWorkspaceTrusted=!1,this._onDidUpdateConfiguration=this._register(new I),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this._initialized=!1,this.fileService=t,this._workspaceConfiguration=this._cachedConfiguration=new Eei(e,s)}async initialize(e,t){this._workspaceIdentifier=e,this._isWorkspaceTrusted=t,this._initialized||(this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)?(this._workspaceConfiguration=this._cachedConfiguration,this.waitAndInitialize(this._workspaceIdentifier)):this.doInitialize(new _Y(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:WX,skipRestricted:this.isUntrusted()})}getFolders(){return this._workspaceConfiguration.getFolders()}setFolders(e,t){return this._workspaceIdentifier?t.write(this._workspaceIdentifier.configPath,[{path:["folders"],value:e}],!0).then(()=>this.reload()):Promise.resolve()}isTransient(){return this._workspaceConfiguration.isTransient()}getConfiguration(){return this._workspaceConfiguration.getWorkspaceSettings()}updateWorkspaceTrust(e){return this._isWorkspaceTrusted=e,this.reparseWorkspaceSettings()}reparseWorkspaceSettings(){return this._workspaceConfiguration.reparseWorkspaceSettings({scopes:WX,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await CJe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof _Y)){const t=this._register(new _Y(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:WX,skipRestricted:this.isUntrusted()}),this.doInitialize(t),this.onDidWorkspaceConfigurationChange(!1,!0)}}doInitialize(e){this._workspaceConfigurationDisposables.clear(),this._workspaceConfiguration=this._workspaceConfigurationDisposables.add(e),this._workspaceConfigurationDisposables.add(this._workspaceConfiguration.onDidChange(t=>this.onDidWorkspaceConfigurationChange(!0,!1))),this._initialized=!0}isUntrusted(){return!this._isWorkspaceTrusted}async onDidWorkspaceConfigurationChange(e,t){e&&await this.reload(),this.updateCache(),this._onDidUpdateConfiguration.fire(t)}async updateCache(){if(this._workspaceIdentifier&&this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)&&this._workspaceConfiguration instanceof _Y){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class _Y extends ${constructor(e,t,i){super(),this.fileService=e,this.logService=i,this._workspaceIdentifier=null,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.workspaceConfigurationModelParser=new _re("",i),this.workspaceSettings=_s.createEmptyModel(i),this._register(T.any(T.filter(this.fileService.onDidFilesChange,s=>!!this._workspaceIdentifier&&s.contains(this._workspaceIdentifier.configPath)),T.filter(this.fileService.onDidRunOperation,s=>!!this._workspaceIdentifier&&(s.isOperation(Li.CREATE)||s.isOperation(Li.COPY)||s.isOperation(Li.DELETE)||s.isOperation(Li.WRITE))&&t.extUri.isEqual(s.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new yn(()=>this._onDidChange.fire(),50)),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile())}get workspaceIdentifier(){return this._workspaceIdentifier}async resolveContent(e){return(await this.fileService.readFile(e.configPath,{atomic:!0})).value.toString()}async load(e,t){(!this._workspaceIdentifier||this._workspaceIdentifier.id!==e.id)&&(this._workspaceIdentifier=e,this.workspaceConfigurationModelParser=new _re(this._workspaceIdentifier.id,this.logService),St(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(s){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(s)}this.workspaceConfigurationModelParser.parse(i,t),this.consolidate()}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}watchWorkspaceConfigurationFile(){return this._workspaceIdentifier?this.fileService.watch(this._workspaceIdentifier.configPath):$.None}}class Eei{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=T.None,this.workspaceConfigurationModelParser=new _re("",t),this.workspaceSettings=_s.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),s=await this.configurationCache.read(i),o=JSON.parse(s);o.content&&(this.workspaceConfigurationModelParser=new _re(i.key,this.logService),this.workspaceConfigurationModelParser.parse(o.content,t),this.consolidate())}catch{}}get workspaceIdentifier(){return null}getConfigurationModel(){return this.workspaceConfigurationModelParser.configurationModel}getFolders(){return this.workspaceConfigurationModelParser.folders}isTransient(){return this.workspaceConfigurationModelParser.transient}getWorkspaceSettings(){return this.workspaceSettings}reparseWorkspaceSettings(e){return this.workspaceConfigurationModelParser.reparseWorkspaceSettings(e),this.consolidate(),this.getWorkspaceSettings()}getRestrictedSettings(){return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings()}consolidate(){this.workspaceSettings=this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel,this.workspaceConfigurationModelParser.tasksModel)}async updateWorkspace(e,t){try{const i=this.getKey(e);t?await this.configurationCache.write(i,JSON.stringify({content:t})):await this.configurationCache.remove(i)}catch{}}getKey(e){return{type:"workspaces",key:e.id}}}class xei{constructor(e,t,i,s,o){this.configurationCache=s,this.logService=o,this.onDidChange=T.None,this.key={type:"folder",key:Ed(Qt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new Px("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=_s.createEmptyModel(o)}async loadConfiguration(){try{const e=await this.configurationCache.read(this.key),{content:t}=JSON.parse(e.toString());if(t)for(const i of Object.keys(t))if(i===mre)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const s=new tat(i,i,this.logService);s.parse(t[i]),this._standAloneConfigurations.push(s.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[mre]=e),t.forEach(([s,o])=>{o&&(i[s]=o)}),Object.keys(i).length?await this.configurationCache.write(this.key,JSON.stringify({content:i})):await this.configurationCache.remove(this.key)}getRestrictedSettings(){return this._folderSettingsModelParser.restrictedConfigurations}reparse(e){return this._folderSettingsParseOptions=e,this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions),this.consolidate(),this.configurationModel}consolidate(){this.configurationModel=this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations)}getUnsupportedKeys(){return[]}}class Dei extends ${constructor(e,t,i,s,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=s,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=Nn.WORKSPACE===this.workbenchState?Xrt:WX,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new xei(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,CJe(t.uri,r).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(r,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())))}loadConfiguration(){return this.folderConfiguration.loadConfiguration()}updateWorkspaceTrust(e){return this.workspaceTrusted=e,this.reparse()}reparse(){const e=this.folderConfiguration.reparse({scopes:this.scopes,skipRestricted:this.isUntrusted()});return this.updateCache(),e}getRestrictedSettings(){return this.folderConfiguration.getRestrictedSettings()}isUntrusted(){return!this.workspaceTrusted}onDidFolderConfigurationChange(){this.updateCache(),this._onDidChange.fire()}createFileServiceBasedConfiguration(e,t,i){const s=t.extUri.joinPath(this.configurationFolder,`${mre}.json`),o=[$p,kk].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new wre(this.configurationFolder.toString(),s,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof wre){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}const $Oe="vs/workbench/services/configuration/browser/configurationService";function F7e(n,e){return n.isDefault||n.useDefaultFlags?.settings?e?aei:void 0:e?Jrt:rei}class ume extends kJe{constructor(){super(...arguments),this.initialized=!1}}class kei extends ${get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,s,o,r,a,c,l,d){if(super(),this.userDataProfileService=s,this.userDataProfilesService=o,this.fileService=r,this.remoteAgentService=a,this.uriIdentityService=c,this.logService=l,this.initialized=!1,this.applicationConfiguration=null,this.remoteUserConfiguration=null,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeWorkspaceFolders=this._register(new I),this.onWillChangeWorkspaceFolders=this._onWillChangeWorkspaceFolders.event,this._onDidChangeWorkspaceFolders=this._register(new I),this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event,this._onDidChangeWorkspaceName=this._register(new I),this.onDidChangeWorkspaceName=this._onDidChangeWorkspaceName.event,this._onDidChangeWorkbenchState=this._register(new I),this.onDidChangeWorkbenchState=this._onDidChangeWorkbenchState.event,this.isWorkspaceTrusted=!0,this._restrictedSettings={default:[]},this._onDidChangeRestrictedSettings=this._register(new I),this.onDidChangeRestrictedSettings=this._onDidChangeRestrictedSettings.event,this.configurationRegistry=it.as(Cs.Configuration),this.initRemoteUserConfigurationBarrier=new Uh,this.completeWorkspaceBarrier=new Uh,this.defaultConfiguration=this._register(new uLe(t,i,l)),this.policyConfiguration=d instanceof TZe?new G0t:this._register(new lCe(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),_s.createEmptyModel(l),new wi,_s.createEmptyModel(l),new wi,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new Cei(s.currentProfile.settingsResource,s.currentProfile.tasksResource,{scopes:F7e(s.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new wi,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new yei(e,t,r,c,a,l));this._register(h.onDidInitialize(u=>{this._register(h.onDidChangeConfiguration(f=>this.onRemoteUserConfigurationChanged(f))),this.onRemoteUserConfigurationChanged(u),this.initRemoteUserConfigurationBarrier.open()}))}else this.initRemoteUserConfigurationBarrier.open();this.workspaceConfiguration=this._register(new Aei(t,r,c,l)),this._register(this.workspaceConfiguration.onDidUpdateConfiguration(h=>{this.onWorkspaceConfigurationChanged(h).then(()=>{this.workspace.initialized=this.workspaceConfiguration.initialized,this.checkAndMarkWorkspaceComplete(h)})})),this._register(this.defaultConfiguration.onDidChangeConfiguration(({properties:h,defaults:u})=>this.onDefaultConfigurationChanged(u,h))),this._register(this.policyConfiguration.onDidChangeConfiguration(h=>this.onPolicyConfigurationChanged(h))),this._register(s.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new dO}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new bei(this.userDataProfilesService,this.fileService,this.uriIdentityService,this.logService))),this.applicationConfigurationDisposables.add(this.applicationConfiguration.onDidChangeConfiguration(e=>this.onApplicationConfigurationChanged(e))))}async getCompleteWorkspace(){return await this.completeWorkspaceBarrier.wait(),this.getWorkspace()}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace.configuration?Nn.WORKSPACE:this.workspace.folders.length===1?Nn.FOLDER:Nn.EMPTY}getWorkspaceFolder(e){return this.workspace.getFolder(e)}addFolders(e,t){return this.updateFolders(e,[],t)}removeFolders(e){return this.updateFolders([],e)}async updateFolders(e,t,i){return this.workspaceEditingQueue.queue(()=>this.doUpdateFolders(e,t,i))}isInsideWorkspace(e){return!!this.getWorkspaceFolder(e)}isCurrentWorkspace(e){switch(this.getWorkbenchState()){case Nn.FOLDER:{let t;return P.isUri(e)?t=e:BS(e)&&(t=e.uri),P.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case Nn.WORKSPACE:return hF(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==Nn.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let s=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>iat(a)?!this.contains(t,o[c].uri):!0);if(s=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=dme(r,a,this.uriIdentityService.extUri);const l=o.map(h=>h.uri),d=[];for(const h of e){const u=h.uri;if(!this.contains(l,u)){try{if(!(await this.fileService.stat(u)).isDirectory)continue}catch{}d.push(zOe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(s=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(dL))),this.onWorkspaceConfigurationChanged(!1)}contains(e,t){return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t))}getConfigurationData(){return this._configuration.toData()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=zge(e)?e:zge(t)?t:void 0;return this._configuration.getValue(i,s)}async updateValue(e,t,i,s,o){const r=yft(i)?i:zge(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?s:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=Lc(r.overrideIdentifiers),r.overrideIdentifiers=r.overrideIdentifiers.length?r.overrideIdentifiers:void 0),!c.length){if(r?.overrideIdentifiers&&r.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:r?.resource,overrideIdentifier:r?.overrideIdentifiers?r.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Io(t,l.defaultValue)&&c.length===1&&(c[0]===Ot.USER||c[0]===Ot.USER_LOCAL)&&(t=void 0)}await ko.settled(c.map(l=>this.writeConfigurationValue(e,t,l,r,o)))}async reloadConfiguration(e){if(e===void 0){this.reloadDefaultConfiguration();const t=await this.reloadApplicationConfiguration(!0),{local:i,remote:s}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,s,!0);return}if(sxt(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case Ot.DEFAULT:this.reloadDefaultConfiguration();return;case Ot.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case Ot.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case Ot.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case Ot.WORKSPACE:case Ot.WORKSPACE_FOLDER:await this.reloadWorkspaceConfiguration();return}}hasCachedConfigurationDefaultsOverrides(){return this.defaultConfiguration.hasCachedConfigurationDefaultsOverrides()}inspect(e,t){return this._configuration.inspect(e,t)}keys(){return this._configuration.keys()}async whenRemoteConfigurationLoaded(){await this.initRemoteUserConfigurationBarrier.wait()}async initialize(e){vs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),vs("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);let a;r&&(a=r.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(o.uri,a)),i.push(a)}this.getWorkbenchState()===Nn.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let s=[];this.restrictedSettings.userLocal&&s.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&s.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&s.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>s.push(...o)),s=Lc(s),s.length&&this.triggerConfigurationChange({keys:s,overrides:[]},{data:t,workspace:this.workspace},Ot.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===ut.APPLICATION)return!0;const t=this.getValue(RA)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return hF(e)?this.createMultiFolderWorkspace(e):BS(e)?this.createSingleFolderWorkspace(e):this.createEmptyWorkspace(e)}async createMultiFolderWorkspace(e){await this.workspaceConfiguration.initialize({id:e.id,configPath:e.configPath},this.isWorkspaceTrusted);const t=e.configPath,i=dme(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),s=e.id,o=new ume(s,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new ume(e.id,[wee(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new ume(e.id,[],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,Promise.resolve(t)}checkAndMarkWorkspaceComplete(e){!this.completeWorkspaceBarrier.isOpen()&&this.workspace.initialized&&(this.completeWorkspaceBarrier.open(),this.validateWorkspaceFoldersAndReload(e))}async updateWorkspaceAndInitializeConfiguration(e,t){const i=!!this.workspace;let s,o,r=[];if(i?(s=this.getWorkbenchState(),o=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,r=this.workspace.folders,this.workspace.update(e)):this.workspace=e,await this.initializeConfiguration(t),i){const a=this.getWorkbenchState();s&&a!==s&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==s)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(r,this.workspace.folders);l&&(l.added.length||l.removed.length||l.changed.length)&&(await this.handleWillChangeWorkspaceFolders(l,!1),this._onDidChangeWorkspaceFolders.fire(l))}this.localUserConfiguration.hasTasksLoaded||this._register(UB(yi,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(s=>!e.some(o=>s.uri.toString()===o.uri.toString()));for(let s=0;s{vs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(_s.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(RA)})}return vs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,s()]);vs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),vs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return _s.createEmptyModel(this.logService);const t=await this.applicationConfiguration.loadConfiguration();return e||this.onApplicationConfigurationChanged(t),t}async reloadUserConfiguration(){const[e,t]=await Promise.all([this.reloadLocalUserConfiguration(!0),this.reloadRemoteUserConfiguration(!0)]);return{local:e,remote:t}}async reloadLocalUserConfiguration(e,t){const i=await this.localUserConfiguration.reload(t);return e||this.onLocalUserConfigurationChanged(i),i}async reloadRemoteUserConfiguration(e){if(this.remoteUserConfiguration){const t=await this.remoteUserConfiguration.reload();return e||this.onRemoteUserConfigurationChanged(t),t}return _s.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===Nn.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===Nn.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,s){this.cachedFolderConfigs=new wi;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new wi;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new R7e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,_s.createEmptyModel(this.logService),new wi,this.workspace,this.logService),this.initialized=!0,s){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},Ot.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case Nn.FOLDER:return e[0];case Nn.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return _s.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:F7e(e.profile,!!this.remoteUserConfiguration)})),(e.previous.isDefault!==e.profile.isDefault||!!e.previous.useDefaultFlags?.settings!=!!e.profile.useDefaultFlags?.settings)&&(this.createApplicationConfiguration(),this.applicationConfiguration&&t.push(this.reloadApplicationConfiguration(!0)));let[i,s]=await Promise.all(t);s=s??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:s.getValue(RA)})),await this.loadConfiguration(s,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),s=this._configuration.compareAndUpdateDefaultConfiguration(e,t);if(this.applicationConfiguration&&this._configuration.updateApplicationConfiguration(this.applicationConfiguration.reparse()),this.remoteUserConfiguration&&(this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse()),this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse())),this.getWorkbenchState()===Nn.FOLDER){const o=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);o&&(this._configuration.updateWorkspaceConfiguration(o.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,o.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const o of this.workspace.folders){const r=this.cachedFolderConfigs.get(o.uri);r&&this._configuration.updateFolderConfiguration(o.uri,r.reparse())}}this.triggerConfigurationChange(s,{data:i,workspace:this.workspace},Ot.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,Ot.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(RA)??[],s=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(RA)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of s.keys)if(r[c]?.scope===ut.APPLICATION){if(a.push(c),c===RA){for(const l of i)o.includes(l)||a.push(l);for(const l of o)i.includes(l)||a.push(l)}}else o.includes(c)&&a.push(c);s.keys=a,s.keys.includes(RA)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(s,t,Ot.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,Ot.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=dme(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:s,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||s.length||o.length?t=await this.toValidWorkspaceFolders(t):t=this.workspace.folders}await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}}updateRestrictedSettings(){const e=[],t=this.configurationRegistry.getConfigurationProperties(),i=Object.keys(t).filter(p=>t[p].restricted).sort((p,m)=>p.localeCompare(m)),s=UL(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...s.added,...s.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=UL(o,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...r.added,...r.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=UL(a,this._restrictedSettings.userLocal||[],(p,m)=>p.localeCompare(m));e.push(...c.added,...c.removed);const l=(this.remoteUserConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),d=UL(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new wi;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((C,y)=>C.localeCompare(y));v.length&&h.set(p.uri,v);const w=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],b=UL(v,w,(C,y)=>C.localeCompare(y));e.push(...b.added,...b.removed)}const u=this.getWorkbenchState()===Nn.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=UL(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:o.length?o:void 0,userLocal:a.length?a:void 0,userRemote:l.length?l:void 0,workspace:u.length?u:void 0,workspaceFolder:h.size?h:void 0},this._onDidChangeRestrictedSettings.fire(this.restrictedSettings))}async updateWorkspaceConfiguration(e,t,i){const s={data:this._configuration.toData(),workspace:this.workspace},o=this._configuration.compareAndUpdateWorkspaceConfiguration(t),r=this.compareFolders(this.workspace.folders,e);if(r.added.length||r.removed.length||r.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(r,i),this.triggerConfigurationChange(a,s,Ot.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,s,Ot.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(s){i.push(s)},changes:e,fromCache:t});try{await ko.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},s=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===Nn.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(YHe(s,o),i,Ot.WORKSPACE)}else this.triggerConfigurationChange(s,i,Ot.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(s=>s.uri.toString()===i.toString())[0]||(this.cachedFolderConfigs.get(i).dispose(),this.cachedFolderConfigs.delete(i),e.push(this._configuration.compareAndDeleteFolderConfiguration(i)));const t=this.workspace.folders.filter(i=>!this.cachedFolderConfigs.has(i.uri));return t.length&&(await this.loadFolderConfigurations(t)).forEach((s,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,s))}),YHe(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new Dei(!this.initialized,t,uue,this.getWorkbenchState(),this.isWorkspaceTrusted,this.fileService,this.uriIdentityService,this.logService,this.configurationCache),this._register(i.onDidChange(()=>this.onWorkspaceFolderConfigurationChanged(t))),this.cachedFolderConfigs.set(t.uri,this._register(i))),i.loadConfiguration()})])}async validateWorkspaceFoldersAndReload(e){const t=await this.toValidWorkspaceFolders(this.workspace.folders),{removed:i}=this.compareFolders(this.workspace.folders,t);i.length&&await this.updateWorkspaceConfiguration(t,this.workspaceConfiguration.getConfiguration(),e)}async toValidWorkspaceFolders(e){const t=[];for(const i of e){try{if(!(await this.fileService.stat(i.uri)).isDirectory)continue}catch(s){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Ma(s)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,s,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===Ot.DEFAULT)throw new Error("Invalid configuration target");if(i===Ot.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,s),this.triggerConfigurationChange({keys:s?.overrideIdentifiers?.length?[Vje(s.overrideIdentifiers),e]:[e],overrides:s?.overrideIdentifiers?.length?s.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===Mn.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(s?.overrideIdentifiers?.length&&s.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,s.resource);if(a){const c=s.overrideIdentifiers.sort(),l=a.overrides.find(d=>Ls([...d.identifiers].sort(),c));l&&(s.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:s,...o}),r){case Mn.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case Mn.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case Mn.WORKSPACE:return this.reloadWorkspaceConfiguration();case Mn.WORKSPACE_FOLDER:{const a=s&&s.resource?this.workspace.getFolder(s.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance(hLe,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case Mn.USER_LOCAL:return this._configuration.localUserConfiguration;case Mn.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Mn.WORKSPACE:return this._configuration.workspaceConfiguration;case Mn.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case Ot.USER_LOCAL:return this._configuration.localUserConfiguration;case Ot.USER_REMOTE:return this._configuration.remoteUserConfiguration;case Ot.WORKSPACE:return this._configuration.workspaceConfiguration;case Ot.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Io(t,i.value))return[];const s=[];return i.workspaceFolderValue!==void 0&&s.push(Ot.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&s.push(Ot.WORKSPACE),i.userRemoteValue!==void 0&&s.push(Ot.USER_REMOTE),i.userLocalValue!==void 0&&s.push(Ot.USER_LOCAL),i.applicationValue!==void 0&&s.push(Ot.APPLICATION),t===void 0?s:[s[0]||Ot.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==Ot.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Sft(i)} target`,...e.keys);const s=new ANe(e,t,this._configuration,this.workspace,this.logService);s.source=i,this._onDidChangeConfiguration.fire(s)}}toEditableConfigurationTarget(e,t){if(e===Ot.APPLICATION)return Mn.USER_LOCAL;if(e===Ot.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===ut.MACHINE||i===ut.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return Mn.USER_REMOTE}return Mn.USER_LOCAL}return e===Ot.USER_LOCAL?Mn.USER_LOCAL:e===Ot.USER_REMOTE?Mn.USER_REMOTE:e===Ot.WORKSPACE?Mn.WORKSPACE:e===Ot.WORKSPACE_FOLDER?Mn.WORKSPACE_FOLDER:null}}let gLe=class extends ${constructor(e,t,i,s,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,s.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=it.as(Cs.Configuration),a=this._register(new Lu(50));this._register(T.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Us.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Wf.properties,patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},l3.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},s={properties:Object.assign({},zB.properties,nE.properties,sE.properties,vb.properties),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(sE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Wf.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.properties[d]),l),{}),patternProperties:Object.keys(Wf.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Wf.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=Nn.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(nE.properties),this.checkAndFilterPropertiesRequiringTrust(vb.properties)),patternProperties:Wf.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g($Oe,0,"Contribute defaults for configurations"),properties:Object.assign({},nE.properties,sE.properties,vb.properties),patternProperties:{[KD]:{type:"object",default:{},$ref:ED}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:s,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=it.as(eL.JSONContribution);t.registerSchema(ZZt,e.defaultSettingsSchema),t.registerSchema(eei,e.userSettingsSchema),t.registerSchema(tei,e.profileSettingsSchema),t.registerSchema(iei,e.machineSettingsSchema),t.registerSchema(Yrt,e.workspaceSettingsSchema),t.registerSchema(nei,e.folderSettingsSchema),t.registerSchema(Hje,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,s])=>{s.restricted||(t[i]=s)}),t}};gLe=D([_(0,Ti),_(1,Za),_(2,oA),_(3,ho),_(4,mg)],gLe);let fLe=class extends ${constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(Ot.DEFAULT))}};fLe=D([_(0,Re),_(1,ho)],fLe);var QH;let bre=(QH=class extends ${constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=it.as(Cs.Configuration),this.processExperimentalSettings(Object.keys(this.configurationRegistry.getConfigurationProperties())),this._register(this.configurationRegistry.onDidUpdateConfiguration(({properties:t})=>this.processExperimentalSettings(t)))}async processExperimentalSettings(e){const t={},i=this.configurationRegistry.getConfigurationProperties();for(const s of e){const o=i[s];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(s)){this.processedExperimentalSettings.add(s);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${s}`);!ll(r)&&!Io(r,o.default)&&(t[s]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t,source:g($Oe,1,"Experiments")}])}},QH.ID="workbench.contrib.updateExperimentalSettingsDefaults",QH);bre=D([_(0,get)],bre);const oat=it.as(pf.Workbench);oat.registerWorkbenchContribution(gLe,Us.Restored);oat.registerWorkbenchContribution(fLe,Us.Eventually);gp(bre.ID,bre,Sl.BlockRestore);const Iei=it.as(Cs.Configuration);Iei.registerConfiguration({...PQ,properties:{[RA]:{type:"array",description:g($Oe,2,"Configure settings to be applied for all profiles."),default:[],scope:ut.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class Lei{constructor(e,t,i){this.donotCacheResourcesWithSchemes=e,this.fileService=i,this.cachedConfigurations=new Map,this.cacheHome=t.cacheHome}needsCaching(e){return!this.donotCacheResourcesWithSchemes.includes(e.scheme)}read(e){return this.getCachedConfiguration(e).read()}write(e,t){return this.getCachedConfiguration(e).save(t)}remove(e){return this.getCachedConfiguration(e).remove()}getCachedConfiguration({type:e,key:t}){const i=`${e}:${t}`;let s=this.cachedConfigurations.get(i);return s||(s=new Tei({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,s)),s}}class Tei{constructor({type:e,key:t},i,s){this.fileService=s,this.cachedConfigurationFolderResource=Qt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Qt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new dO}async read(){try{return(await this.fileService.readFile(this.cachedConfigurationFileResource)).value.toString()}catch{return""}}async save(e){await this.createCachedFolder()&&await this.queue.queue(async()=>{await this.fileService.writeFile(this.cachedConfigurationFileResource,ze.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Zi.FILE_NOT_FOUND)throw e}}async createCachedFolder(){if(await this.fileService.exists(this.cachedConfigurationFolderResource))return!0;try{return await this.fileService.createFolder(this.cachedConfigurationFolderResource),!0}catch{return!1}}}const Zm="vs/workbench/services/label/common/labelService",Rei=Ap.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(Zm,0,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(Zm,1,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(Zm,2,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(Zm,3,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(Zm,4,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(Zm,5,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(Zm,6,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(Zm,7,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(Zm,8,"Suffix appended to the workspace label.")}}}}}}}),O7e=/\//g,Mei=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function Nei(n){return!!(n&&n[2]===":")}let pLe=class{constructor(e){this.formattersDisposables=new Map,Rei.setHandler((t,i)=>{for(const s of i.added)for(const o of s.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=dg),!Cd(s.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const s of i.removed)for(const o of s.value)St(this.formattersDisposables.get(o))})}};pLe=D([_(0,eo)],pLe);it.as(pf.Workbench).registerWorkbenchContribution(pLe,Us.Restored);const B7e=50;let mLe=class extends ${constructor(e,t,i,s,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=s,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=$c,this.userHome=i.defaultUriScheme===_e.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new W1("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(ke.PROFILE,ln.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??$c,this.userHome=await this.pathService.userHome()}findFormatting(e){let t;for(const i of this.formatters)if(i.scheme===e.scheme){if(!i.authority&&(!t||i.priority)){t=i;continue}if(!i.authority)continue;WW(i.authority.toLowerCase(),e.authority.toLowerCase())&&(!t||!t.authority||i.authority.length>t.authority.length||i.authority.length===t.authority.length&&i.priority)&&(t=i)}return t?t.formatting:void 0}getUriLabel(e,t={}){let i=this.findFormatting(e);i&&t.separator&&(i={...i,separator:t.separator});const s=this.doGetUriLabel(e,i,t);return!i&&t.separator?s.replace(O7e,t.separator):s}doGetUriLabel(e,t,i={}){if(!t)return nPt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:s=>this.contextService.getWorkspaceFolder(s)}:void 0});if(i.relative&&this.contextService){let s=this.contextService.getWorkspaceFolder(e);if(!s){const o=this.contextService.getWorkspace(),r=k_(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(Qi.sep)&&(s=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(s){const o=this.formatUri(s.uri,t,i.noPrefix);let r=this.formatUri(e,t,i.noPrefix),a=0;for(;r[a]&&r[a]===o[a];)a++;if(!r[a]||r[a]===t.separator?r=r.substring(1+a):a===o.length&&s.uri.path===Qi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=s?.name??Mx(s.uri);r=r?`${l} • ${r}`:l}return r}}return this.formatUri(e,t,i.noPrefix)}getUriBasenameLabel(e){const t=this.findFormatting(e),i=this.doGetUriLabel(e,t);let s;return t?.separator===Gc.sep?s=Gc:t?.separator===Qi.sep?s=Qi:s=this.os===Pr.Windows?Gc:Qi,s.basename(i)}getWorkspaceLabel(e,t){if(cbe(e)){const i=UW(e);return BS(i)||hF(i)?this.getWorkspaceLabel(i,t):""}return P.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):BS(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):hF(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(p7(e,this.environmentService))return g(Zm,9,"Untitled (Workspace)");if(hx(e))return g(Zm,10,"Workspace");let i=ui(e);i.endsWith(qb)&&(i=i.substr(0,i.length-qb.length-1));let s;switch(t?.verbose){case e_.SHORT:s=i;break;case e_.LONG:s=g(Zm,11,"{0} (Workspace)",this.getUriLabel(Qt(ma(e),i)));break;case e_.MEDIUM:default:s=g(Zm,12,"{0} (Workspace)",i);break}return t?.verbose===e_.SHORT?s:this.appendWorkspaceSuffix(s,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case e_.LONG:i=this.getUriLabel(e);break;case e_.SHORT:case e_.MEDIUM:default:i=ui(e)||Qi.sep;break}return t?.verbose===e_.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.separator||Qi.sep}getHostLabel(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(P.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(s=>s.scheme===e.scheme&&s.authority===e.authority);if(i===-1&&t.length>=B7e&&(i=B7e-1),i===-1)t.unshift(e);else{for(let s=i;s>0;s--)t[s]=t[s-1];t[0]=e}return this.storedFormattersMemento.saveMemento(),this.registerFormatter(e)}registerFormatter(e){return this.formatters.push(e),this._onDidChangeFormatters.fire({scheme:e.scheme}),{dispose:()=>{this.formatters=this.formatters.filter(t=>t!==e),this._onDidChangeFormatters.fire({scheme:e.scheme})}}}formatUri(e,t,i){let s=t.label.replace(Mei,(o,r,a,c)=>{switch(r){case"scheme":return e.scheme;case"authority":return e.authority;case"authoritySuffix":{const l=e.authority.indexOf("+");return l===-1?e.authority:e.authority.slice(l+1)}case"path":return t.stripPathStartingSeparator?e.path.slice(e.path[0]===t.separator?1:0):e.path;default:{if(a==="query"){const{query:l}=e;if(l&&l[0]==="{"&&l[l.length-1]==="}")try{return JSON.parse(l)[c]||""}catch{}}return""}}});return t.normalizeDriveLetter&&Nei(s)&&(s=s.charAt(1).toUpperCase()+s.substr(2)),t.tildify&&!i&&this.userHome&&(s=rtt(s,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(s=t.authorityPrefix+s),s.replace(O7e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),s=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return s?`${e} [${s}]`:e}};mLe=D([_(0,Za),_(1,Ti),_(2,Lm),_(3,Sf),_(4,on),_(5,mg)],mLe);let _Le=class{constructor(e,t,i,s){this.configurationService=e,this.environmentService=i,this.storageService=s,this.remoteEnvironment=null,t.getEnvironment().then(o=>this.remoteEnvironment=o)}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});if(i&&typeof i=="string"&&i!=="auto")return i;const s=this.getOS(e);return s===Pr.Linux||s===Pr.Macintosh?` `:`\r -`}getOS(e){let t=zc;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==_e.file){const s=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(s,ke.WORKSPACE,zc),this.storageService.store(s,t,ke.WORKSPACE,ln.MACHINE)}return t}};_Le=D([_(0,Re),_(1,Sf),_(2,Za),_(3,sn)],_Le);const vY="vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService";let vLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=s,this.commandService=o,this.fileService=r,this.textFileService=a,this.workspacesService=c,this.environmentService=l,this.fileDialogService=d,this.dialogService=h,this.hostService=u,this.uriIdentityService=f,this.workspaceTrustManagementService=p,this.userDataProfilesService=m,this.userDataProfileService=v}async pickNewWorkspacePath(){const e=[_e.file];this.environmentService.remoteAuthority&&e.unshift(_e.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:YPe(g(vY,0,"Save")),title:g(vY,1,"Save Workspace"),filters:oxt,defaultUri:qt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return yde(t)||(t=t.with({path:`${t.path}.${qb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&lbe(e,this.environmentService))return ui(e);const t=k_(this.contextService.getWorkspace().folders);return t?`${ui(t.uri)}.${qb}`:`workspace.${qb}`}async updateFolders(e,t,i,s){const o=this.contextService.getWorkspace().folders;let r=[];typeof t=="number"&&(r=o.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:c2e(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,s):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==Nn.WORKSPACE?this.doAddFolders(a,e,s):this.doUpdateFolders(a,r,e,s)}async doUpdateFolders(e,t,i,s=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(s)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(s=>({uri:c2e(s.uri),name:s.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const s=this.contextService.getWorkbenchState();if(s!==Nn.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=Lc(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),s===Nn.EMPTY&&o.length===0||s===Nn.FOLDER&&o.length===1?void 0:this.createAndEnterWorkspace(o)}try{await this.contextService.addFolders(e,t)}catch(o){if(i)throw o;this.handleWorkspaceConfigurationEditingError(o)}}async removeFolders(e,t=!1){if(this.includesSingleFolderWorkspace(e))return this.createAndEnterWorkspace([]);try{await this.contextService.removeFolders(e)}catch(i){if(t)throw i;this.handleWorkspaceConfigurationEditingError(i)}}includesSingleFolderWorkspace(e){if(this.contextService.getWorkbenchState()===Nn.FOLDER){const t=this.contextService.getWorkspace().folders[0];return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t.uri))}return!1}async createAndEnterWorkspace(e,t){if(t&&!await this.isValidTargetWorkspacePath(t))return;const i=this.environmentService.remoteAuthority,s=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(s,t)}finally{await this.workspacesService.deleteUntitledWorkspace(s)}else t=s.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(s,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(_n(t.configPath,e))return this.saveWorkspace(t);if(await this.isValidTargetWorkspacePath(e))return await this.saveWorkspaceAs(t,e),this.enterWorkspace(e)}}async isValidTargetWorkspacePath(e){return!0}async saveWorkspaceAs(e,t){const i=e.configPath;if(!p7(t,this.environmentService)&&!this.userDataProfileService.currentProfile.isDefault){const c=await this.workspacesService.getWorkspaceIdentifier(t);await this.userDataProfilesService.setProfileForWorkspace(c,this.userDataProfileService.currentProfile)}if(this.uriIdentityService.extUri.isEqual(i,t))return;const o=p7(i,this.environmentService),r=await this.fileService.readFile(i),a=N7e(r.value.toString(),i,o,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:a,options:{overwrite:!0}}]),await this.trustWorkspaceConfiguration(t)}async saveWorkspace(e){const t=e.configPath,i=this.textFileService.files.get(t);if(i){await i.save({force:!0,reason:Ln.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=N7e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case jG.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(vY,2,"Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again.");this.askToOpenWorkspaceConfigurationFile(e)}askToOpenWorkspaceConfigurationFile(e){this.notificationService.prompt(nt.Error,e,[{label:g(vY,3,"Open Workspace Configuration"),run:()=>this.commandService.executeCommand("workbench.action.openWorkspaceConfigFile")}])}async doEnterWorkspace(e){if(this.environmentService.extensionTestsLocationURI)throw new Error("Entering a new workspace is not possible in tests.");const t=await this.workspacesService.getWorkspaceIdentifier(e);return this.contextService.getWorkbenchState()===Nn.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===ut.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;s[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:s}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==Nn.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=UW(this.contextService.getWorkspace());if(hF(e))return e}};vLe=D([_(0,dL),_(1,Ti),_(2,sat),_(3,Pi),_(4,Qi),_(5,ci),_(6,tr),_(7,cL),_(8,Za),_(9,bf),_(10,To),_(11,Id),_(12,_o),_(13,oA),_(14,V_),_(15,Tm)],vLe);var BB,jP;let wLe=(jP=class extends ${constructor(e,t,i,s,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=s,this.environmentService=o,this.uriIdentityService=r,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(ke.APPLICATION,BB.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(hx(this.contextService.getWorkspace()))for(const t of e.added)this.addRecentlyOpened([{folderUri:t.uri}])}addWorkspaceToRecentlyOpened(){const e=this.contextService.getWorkspace(),t=this.environmentService.remoteAuthority;switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case Nn.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get(BB.RECENTLY_OPENED_KEY,ke.APPLICATION);if(e){const t=vei(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(UX(i)&&i.folderUri.scheme===_e.file&&!hx(this.contextService.getWorkspace())||uei(i)&&hx(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)gei(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):UX(i)?(this.doRemoveRecentlyOpened(t,[i.folderUri]),t.workspaces.unshift(i)):(this.doRemoveRecentlyOpened(t,[i.workspace.configPath]),t.workspaces.unshift(i));return this.saveRecentlyOpened(t)}async removeRecentlyOpened(e){const t=await this.getRecentlyOpened();return this.doRemoveRecentlyOpened(t,e),this.saveRecentlyOpened(t)}doRemoveRecentlyOpened(e,t){e.files=e.files.filter(i=>!t.some(s=>s.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(s=>s.toString()===(UX(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(BB.RECENTLY_OPENED_KEY,JSON.stringify(wei(e)),ke.APPLICATION,ln.USER)}async clearRecentlyOpened(){this.storageService.remove(BB.RECENTLY_OPENED_KEY,ke.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),s=qt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${qb}`),o=[];if(e)for(const a of e)o.push(zOe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(s,ze.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(s)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Xi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return BFe(e)}async getDirtyWorkspaces(){return[]}},BB=jP,jP.RECENTLY_OPENED_KEY="recently.opened",jP);wLe=BB=D([_(0,sn),_(1,Ti),_(2,Ze),_(3,ci),_(4,Za),_(5,_o)],wLe);function Pei(){throw new Error("unsupported")}function Fei(n){let e=null;return(...t)=>(e==null&&(e=n(...t)),e)}function Oei(n){return new Proxy(n,{construct:Fei((e,t)=>Reflect.construct(n,t))})}P.from({scheme:_e.vscodeUserData,path:"/User/settings.json"});it.as(Cs.Configuration);let bLe=class extends kei{constructor(e,t,i,s,o,r,a,c){const l=new Lei([_e.file,_e.vscodeUserData,_e.tmp],e,s);super({configurationCache:l},e,t,i,s,o,r,a,c)}};bLe=D([_(0,Za),_(1,Tm),_(2,V_),_(3,ci),_(4,Sf),_(5,_o),_(6,Ze),_(7,sPe)],bLe);class Bei extends vLe{constructor(){super(...arguments),this.enterWorkspace=Pei}}let rat;VFe(async n=>{const e=n.get(Ti);e.acquireInstantiationService(n.get(be));const t=rat??HFe();if(P.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const s=n.get(ci);await s.createFolder(t),await s.writeFile(i,ze.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:Dr(),configPath:i})}else await e.initialize(t)});const W7e=Oei(bLe);function Wei(n){return rat=n,{...lOe(),[eo.toString()]:new $i(mLe,void 0,!0),[Re.toString()]:new $i(W7e,[],!0),[Ti.toString()]:new $i(W7e,[],!0),[dl.toString()]:new $i(lLe,[],!0),[$S.toString()]:new $i(Bei,[],!0),[cL.toString()]:new $i(wLe,void 0,!0),[bMe.toString()]:new $i(_Le,void 0,!0)}}let CLe=class extends ZZ{constructor(e,t,i){super(t),this.editorService=e,this.configurationService=i,this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditor.bind(this))),this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditorFromDiff.bind(this)))}getActiveCodeEditor(){const e=this.editorService.activeTextEditorControl;if(ja(e))return e;if(ew(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return HU(t)&&ja(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const s=this.editorService.activeTextEditorControl;if(!i&&ew(s)&&e.options&&e.resource&&t===s.getModifiedEditor()&&s.getModel()&&_n(e.resource,s.getModel()?.modified.uri)){const o=s.getModifiedEditor();return rne(e.options,o,vt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!_n(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(_z(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?Cw:wx);if(o){const r=o.getControl();if(ja(r))return r;if(HU(r)&&ja(r.activeCodeEditor))return r.activeCodeEditor}return null}};CLe=D([_(0,_i),_(1,pn),_(2,Re)],CLe);let yLe=class extends ${constructor(e,t,i,s,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=s,this.editorResolverService=o,this.editorInputCache=new wi,this.fileEditorFactory=it.as(zS.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createEditorInput:e=>({editor:this.createTextEditor(e)}),createUntitledEditorInput:e=>({editor:this.createTextEditor(e)}),createDiffEditorInput:e=>({editor:this.createTextEditor(e)})}))}async resolveTextEditor(e){return this.createTextEditor(e)}createTextEditor(e){if(Wb(e))return this.createTextEditor(e.result);if(Gv(e)){const s=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance(op,e.label,e.description,s,o,void 0)}if(LE(e)){const s=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(mm,e.label,e.description,o,s)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===_e.untitled){const s={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===_e.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...s}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...s}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(E6,o))}const i=e;if(i.resource instanceof P){const s=i.label||ui(i.resource),o=i.resource,r=this.uriIdentityService.asCanonicalUri(o);return this.createOrGetCached(r,()=>i.forceFile||this.fileService.hasProvider(r)?this.fileEditorFactory.createFileEditor(r,o,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(AM,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof E6||(a instanceof AM?(s&&a.setName(s),i.description&&a.setDescription(i.description),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)):(a.setPreferredResource(o),i.label&&a.setPreferredName(i.label),i.description&&a.setPreferredDescription(i.description),i.encoding&&a.setPreferredEncoding(i.encoding),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)))})}throw new Error(`ITextEditorService: Unable to create texteditor from ${JSON.stringify(e)}`)}createOrGetCached(e,t,i){let s=this.editorInputCache.get(e);return s?(i?.(s),s):(s=t(),this.editorInputCache.set(e,s),T.once(s.onWillDispose)(()=>this.editorInputCache.delete(e)),s)}};yLe=D([_(0,RQ),_(1,be),_(2,_o),_(3,ci),_(4,Pz)],yLe);var Q3,KP;let SLe=(KP=class extends ${get count(){return this.mostRecentEditorsMap.size}get editors(){return[...this.mostRecentEditorsMap.values()]}hasEditor(e){return this.editorsPerResourceCounter.get(e.resource)?.has(this.toIdentifier(e))??!1}hasEditors(e){return this.editorsPerResourceCounter.has(e)}toIdentifier(e,t){return typeof e!="string"?this.toIdentifier(e.typeId,e.editorId):t?`${e}/${t}`:e}constructor(e,t,i){super(),this.editorGroupService=t,this.storageService=i,this.keyMap=new Map,this.mostRecentEditorsMap=new lQe,this.editorsPerResourceCounter=new wi,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.editorGroupsContainer=e??t,this.isScoped=!!e,this.registerListeners(),this.loadState()}registerListeners(){this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.onGroupAdded(e))),this._register(this.editorGroupService.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.storageService.onWillSaveState(()=>this.saveState()))}onGroupAdded(e){const t=e.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--)this.addMostRecentEditor(e,t[i],!1,!0);this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1),this.registerGroupListeners(e)}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{switch(i.kind){case qo.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case qo.EDITOR_OPEN:{i.editor&&(this.addMostRecentEditor(e,i.editor,!1,!0),this.ensureOpenedEditorsLimit({groupId:e.id,editor:i.editor},e.id));break}}})),t.add(e.onDidCloseEditor(i=>{this.removeMostRecentEditor(e,i.editor)})),t.add(e.onDidActiveEditorChange(i=>{i.editor&&this.addMostRecentEditor(e,i.editor,this.editorGroupsContainer.activeGroup===e,!1)})),T.once(e.onWillDispose)(()=>St(t))}onDidChangeEditorPartOptions(e){if(!Io(e.newPartOptions.limit,e.oldPartOptions.limit)){const t=this.editorGroupsContainer.activeGroup;let i;t.activeEditor&&(i={editor:t.activeEditor,groupId:t.id}),this.ensureOpenedEditorsLimit(i)}}addMostRecentEditor(e,t,i,s){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?Vd.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,Vd.AsOld),this.mostRecentEditorsMap.set(r,r,Vd.AsOld)),s&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,s,o;if(e instanceof mm?(i=e.primary.resource,s=e.primary.typeId,o=e.primary.editorId):(i=e.resource,s=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(s,o);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(r,(a.get(r)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(r)??0;c>1?a.set(r,c-1):(a.delete(r),a.size===0&&this.editorsPerResourceCounter.delete(i))}}}removeMostRecentEditor(e,t){this.updateEditorResourcesMap(t,!1);const i=this.findKey(e,t);if(i){this.mostRecentEditorsMap.delete(i);const s=this.keyMap.get(e.id);s&&s.delete(i.editor)&&s.size===0&&this.keyMap.delete(e.id),this._onDidMostRecentlyActiveEditorsChange.fire()}}findKey(e,t){const i=this.keyMap.get(e.id);if(i)return i.get(t)}ensureKey(e,t){let i=this.keyMap.get(e.id);i||(i=new Map,this.keyMap.set(e.id,i));let s=i.get(t);return s||(s={groupId:e.id,editor:t},i.set(t,s)),s}async ensureOpenedEditorsLimit(e,t){if(!this.editorGroupService.partOptions.limit?.enabled||typeof this.editorGroupService.partOptions.limit.value!="number"||this.editorGroupService.partOptions.limit.value<=0)return;const i=this.editorGroupService.partOptions.limit.value;if(this.editorGroupService.partOptions.limit?.perEditorGroup)if(typeof t=="number"){const s=this.editorGroupsContainer.getGroup(t);s&&await this.doEnsureOpenedEditorsLimit(i,s.getEditors(eg.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const s of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,s.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let s;if(this.editorGroupService.partOptions.limit?.excludeDirty?s=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad))):s=t,e>=s.length)return;const o=s.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=s.length-e;const a=new Map;for(const{groupId:c,editor:l}of o){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),r--,r===0)break}for(const[c,l]of a){const d=this.editorGroupsContainer.getGroup(c);d&&await d.closeEditors(l,{preserveFocus:!0})}}saveState(){this.isScoped||(this.mostRecentEditorsMap.isEmpty()?this.storageService.remove(Q3.STORAGE_KEY,ke.WORKSPACE):this.storageService.store(Q3.STORAGE_KEY,JSON.stringify(this.serialize()),ke.WORKSPACE,ln.MACHINE))}serialize(){const e=it.as(zS.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Ui(t.map(({editor:s,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(eg.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(s);if(c!==-1)return{groupId:o,index:c}}))}}async loadState(){(this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService)&&await this.editorGroupService.whenReady;let e=!1;if(!this.isScoped){const t=this.storageService.get(Q3.STORAGE_KEY,ke.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const s=t[i],o=s.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(s,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:s}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(s);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},Q3=KP,KP.STORAGE_KEY="editors.mru",KP);SLe=Q3=D([_(1,ur),_(2,sn)],SLe);function H7e(n,e,t){const i=n.get(ur),s=n.get(Re),o=Hei(e,t,i,s);return o instanceof Promise?o.then(r=>U7e(r,e,t,i)):U7e(o,e,t,i)}function U7e(n,e,t,i){let s;return i.activeGroup!==n&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==Cw&&(s=y1.ACTIVATE),[n,s]}function Hei(n,e,t,i){let s;const o=z$(n)?n.editor:n,r=n.options;if(e&&typeof e!="number")s=e;else if(typeof e=="number"&&e>=0)s=t.getGroup(e);else if(e===Cw){const a=w6(i);let c=t.findGroup({direction:a});(!c||wY(c,o))&&(c=t.addGroup(t.activeGroup,a)),s=c}else if(e===Ezt)s=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(gg.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(Uei(c,o)){s=c;break}}if(!s&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||Qa(o)&&o.hasCapability(Mi.Singleton))){let c,l;for(const d of a)if(aat(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;s=c||l}}if(!s){let a=t.activeGroup;if(wY(a,o)){for(const c of t.getGroups(gg.MOST_RECENTLY_ACTIVE))if(!wY(c,o)){a=c;break}wY(a,o)?s=t.addGroup(a,w6(i)):s=a}else s=a}return s}function wY(n,e){return!(!n.isLocked||aat(n,e))}function Uei(n,e){return n.activeEditor?n.activeEditor.matches(e):!1}function aat(n,e){for(const t of n.editors)if(t.matches(e))return!0;return!1}var ALe;let ELe=ALe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=s,this.configurationService=o,this.contextService=r,this.uriIdentityService=a,this.editorResolverService=c,this.workspaceTrustRequestService=l,this.hostService=d,this.textEditorService=h,this._onDidActiveEditorChange=this._register(new I),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidVisibleEditorsChange=this._register(new I),this.onDidVisibleEditorsChange=this._onDidVisibleEditorsChange.event,this._onDidEditorsChange=this._register(new I),this.onDidEditorsChange=this._onDidEditorsChange.event,this._onWillOpenEditor=this._register(new I),this.onWillOpenEditor=this._onWillOpenEditor.event,this._onDidCloseEditor=this._register(new I),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onDidOpenEditorFail=this._register(new I),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.lastActiveEditor=void 0,this.activeOutOfWorkspaceWatchers=new wi,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(SLe,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new ALe(e==="main"?this.editorGroupService.mainPart:e,this.editorGroupService,this.instantiationService,this.fileService,this.configurationService,this.contextService,this.uriIdentityService,this.editorResolverService,this.workspaceTrustRequestService,this.hostService,this.textEditorService))}registerListeners(){this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService?this.editorGroupService.whenReady.then(()=>this.onEditorGroupsReady()):this.onEditorGroupsReady(),this._register(this.editorGroupsContainer.onDidChangeActiveGroup(e=>this.handleActiveEditorChange(e))),this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.registerGroupListeners(e))),this._register(this.editorsObserver.onDidMostRecentlyActiveEditorsChange(()=>this._onDidMostRecentlyActiveEditorsChange.fire())),this._register(this.onDidVisibleEditorsChange(()=>this.handleVisibleEditorsChange())),this._register(this.fileService.onDidRunOperation(e=>this.onDidRunFileOperation(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onEditorGroupsReady(){for(const e of this.editorGroupsContainer.groups)this.registerGroupListeners(e);this.activeEditor&&(this.doHandleActiveEditorChangeEvent(),this._onDidVisibleEditorsChange.fire())}handleActiveEditorChange(e){e===this.editorGroupsContainer.activeGroup&&(!this.lastActiveEditor&&!e.activeEditor||this.doHandleActiveEditorChangeEvent())}doHandleActiveEditorChangeEvent(){const e=this.editorGroupsContainer.activeGroup;this.lastActiveEditor=e.activeEditor??void 0,this._onDidActiveEditorChange.fire()}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{this._onDidEditorsChange.fire({groupId:e.id,event:i})})),t.add(e.onDidActiveEditorChange(()=>{this.handleActiveEditorChange(e),this._onDidVisibleEditorsChange.fire()})),t.add(e.onWillOpenEditor(i=>{this._onWillOpenEditor.fire(i)})),t.add(e.onDidCloseEditor(i=>{this._onDidCloseEditor.fire(i)})),t.add(e.onDidOpenEditorFail(i=>{this._onDidOpenEditorFail.fire({editor:i,groupId:e.id})})),T.once(e.onWillDispose)(()=>{St(t)})}handleVisibleEditorsChange(){const e=new o1;for(const t of this.visibleEditors){const i=Lc(Ui([Qc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}),Qc.getCanonicalUri(t,{supportSideBySide:go.SECONDARY})]),s=>s.toString());for(const s of i)this.fileService.hasProvider(s)&&!this.contextService.isInsideWorkspace(s)&&e.add(s)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(St(this.activeOutOfWorkspaceWatchers.get(t)),this.activeOutOfWorkspaceWatchers.delete(t));for(const t of e.keys())if(!this.activeOutOfWorkspaceWatchers.get(t)){const i=this.fileService.watch(t);this.activeOutOfWorkspaceWatchers.set(t,i)}}async onDidRunFileOperation(e){e.isOperation(Li.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Li.DELETE)||e.isOperation(Li.MOVE))&&this.handleDeletedFile(e.resource,!1,e.target?e.target.resource:void 0)}onDidFilesChange(e){e.gotDeleted()&&this.handleDeletedFile(e,!0)}async handleMovedFile(e,t){for(const i of this.editorGroupsContainer.groups){const s=[];for(const o of i.editors){const r=o.resource;if(!r||!this.uriIdentityService.extUri.isEqualOrParent(r,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,r))a=t;else{const d=GQe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=qt(t,r.path.substr(d+e.path.length+1))}const c=await o.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(o),sticky:i.isSticky(o),index:i.getIndexOfEditor(o),inactive:!i.isActive(o)};Qa(c.editor)?s.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):s.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}s.length&&this.replaceEditors(s,i)}}onConfigurationUpdated(e){if(e&&!e.affectsConfiguration("workbench.editor.closeOnFileDelete"))return;const t=this.configurationService.getValue();typeof t.workbench?.editor?.closeOnFileDelete=="boolean"?this.closeOnFileDelete=t.workbench.editor.closeOnFileDelete:this.closeOnFileDelete=!1}handleDeletedFile(e,t,i){for(const s of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=s.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof mee?r=e.contains(o,Ko.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Ta(100),a=await this.fileService.exists(o)),!a&&!s.isDisposed()&&s.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(s){s.hasCapability(Mi.Untitled)&&!e.includeUntitled||s.isDirty()||t.push(s)}for(const s of this.editors)e.supportSideBySide&&s instanceof mm?(i(s.primary),i(s.secondary)):i(s);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(ja(t)||ew(t))return t;if(HU(t)&&ja(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return ew(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(eg.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case eg.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:s})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(s)):this.editorsObserver.editors;case eg.SEQUENTIAL:{const i=[];for(const s of this.editorGroupsContainer.getGroups(gg.GRID_APPEARANCE))i.push(...s.getEditors(eg.SEQUENTIAL,t).map(o=>({editor:o,groupId:s.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Ui(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof uxe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const s of i)(ja(s)||ew(s))&&e.push(s)}return e}get visibleEditors(){return Ui(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let s,o=Qa(e)?t:e.options,r;if(est(t)&&(i=t),!Qa(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===w8.ABORT)return;Xfe(a)&&(s=a.editor,o=a.options,r=a.group)}if(s||(s=Qa(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(H7e,{editor:s,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(s,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const s=new Map;for(const r of e){let a,c;if(!z$(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===w8.ABORT)continue;Xfe(d)&&(a=d,c=d.group)}if(a||(a=z$(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(H7e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=s.get(c);l||(l=[],s.set(c,l)),l.push(a)}const o=[];for(const[r,a]of s)o.push(r.openEditors(a));return Ui(await ko.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:s}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case t_.Open:return!0;case t_.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:s}),!1;case t_.Cancel:return!1}}extractEditorResources(e){const t=new o1;let i=!1,s=!1;for(const o of e)if(z$(o)){const r=Qc.getOriginalUri(o.editor,{supportSideBySide:go.BOTH});P.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof op)}else Wb(o)&&(P.isUri(o.input1)&&t.add(o.input1.resource),P.isUri(o.input2)&&t.add(o.input2.resource),P.isUri(o.base)&&t.add(o.base.resource),P.isUri(o.result)&&t.add(o.result.resource),s=!0),Gv(o)?(P.isUri(o.original.resource)&&t.add(o.original.resource),P.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):wb(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:s}}isOpened(e){return this.editorsObserver.hasEditor({resource:this.uriIdentityService.asCanonicalUri(e.resource),typeId:e.typeId,editorId:e.editorId})}isVisible(e){for(const t of this.editorGroupsContainer.groups)if(t.activeEditor?.matches(e))return!0;return!1}async closeEditor({editor:e,groupId:t},i){await this.editorGroupsContainer.getGroup(t)?.closeEditor(e,i)}async closeEditors(e,t){const i=new Map;for(const{editor:s,groupId:o}of e){const r=this.editorGroupsContainer.getGroup(o);if(!r)continue;let a=i.get(r);a||(a=[],i.set(r,a)),a.push(s)}for(const[s,o]of i)await s.closeEditors(o,t)}findEditors(e,t,i){const s=P.isUri(e)?e:e.resource,o=P.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==go.ANY&&t?.supportSideBySide!==go.SECONDARY&&!this.editorsObserver.hasEditors(s))return P.isUri(e)||ll(i)?[]:void 0;if(ll(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE)){const c=[];if(P.isUri(e))c.push(...this.findEditors(e,t,a));else{const l=this.findEditors(e,t,a);l&&c.push(l)}r.push(...c.map(l=>({editor:l,groupId:a.id})))}return r}else{const r=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(P.isUri(e))return r?r.findEditors(s,t):[];{if(!r)return;const a=r.findEditors(s,t);for(const c of a)if(c.typeId===o)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,s=[];for(const o of e){let r;if(!Qa(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===w8.ABORT)continue;Xfe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:Vze(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:Vze(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),s.push(r)}return i?.replaceEditors(s)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),s=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Mi.Untitled)?o.push({groupId:a,editor:c}):s.push({groupId:a,editor:c});const r=await ko.settled(s.map(({groupId:a,editor:c})=>(t?.reason===Ln.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of o){if(c.isDisposed())continue;const d={pinned:!0,viewState:(await this.openEditor(c,a))?.getViewState()},h=t?.saveAs?await c.saveAs(a,t):await c.save(a,t);if(r.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(Mi.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof cC?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:r.every(a=>!!a),editors:Ui(r)}}saveAll(e){return this.save(this.getAllModifiedEditors(e),e)}async revert(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e);return await ko.settled(i.map(async({groupId:s,editor:o})=>(this.editorGroupsContainer.getGroup(s)?.pinEditor(o),o.revert(s,t)))),!i.some(({editor:s})=>s.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE))for(const s of i.getEditors(eg.MOST_RECENTLY_ACTIVE))s.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&s.hasCapability(Mi.Scratchpad)||!e?.includeUntitled&&s.hasCapability(Mi.Untitled)||e?.excludeSticky&&i.isSticky(s)||t.push({groupId:i.id,editor:s}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:s}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:s});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>St(e)),this.activeOutOfWorkspaceWatchers.clear()}};ELe=ALe=D([_(1,ur),_(2,be),_(3,ci),_(4,Re),_(5,Ti),_(6,_o),_(7,Pz),_(8,Ade),_(9,Id),_(10,rhe)],ELe);function Rt(){throw new Error("unsupported")}var xLe;class Vei{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=Rt,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=Rt,this.notifyIndexChanged=Rt,this.relayout=Rt,this.dispose=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=Rt,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=Rt,this.openEditor=Rt,this.openEditors=Rt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt}get groupsView(){return Rt()}notifyLabelChanged(){}get titleHeight(){return Rt()}get element(){return Rt()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}}const dq=new Vei;class zei{constructor(e){this.editor=e,this.onDidChangeControl=T.None,this.onDidChangeSizeConstraints=T.None,this.onDidFocus=T.None,this.onDidBlur=T.None,this.input=void 0,this.options=void 0,this.group=dq,this.scopedContextKeyService=void 0,this.getViewState=Rt,this.isVisible=Rt,this.hasFocus=Rt,this.getId=Rt,this.getTitle=Rt,this.focus=Rt}get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}getControl(){return this.editor}}function $ei(n,e,t){async function i(s,o,r){const a=Qa(s)?o:s.options;est(o)&&(r=o);const c=wb(s)||Qa(s)?s.resource:void 0;if(c==null||!n.canHandleResource(c))return e(s,o,r);let l;if(l=Lt.get(Qt).listCodeEditors().find(h=>h instanceof mF&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(s,o,r);if(h!=null)return h;const u=await n.createModelReference(c);if(l=await t?.(u,a,r===Cw),l==null){u.dispose();return}}return a!=null&&rne(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new zei(l)}return i}let DLe=class extends ELe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(void 0,i,s,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=$ei(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Lt.get(Qt).getFocusedCodeEditor();return e!=null&&e instanceof k1?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};DLe=D([_(2,ur),_(3,be),_(4,ci),_(5,Re),_(6,Ti),_(7,_o),_(8,Pz),_(9,Ade),_(10,Id),_(11,rhe),_(12,Rn)],DLe);class V7e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=T.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=T.None,this.scopedContextKeyService=void 0,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidBlur=this.editor.onDidBlurEditorWidget}getControl(){return this.editor}getViewState(){}isVisible(){return!0}hasFocus(){return this.editor.hasWidgetFocus()}getId(){return this.editor.getId()}getTitle(){}focus(){this.editor.focus()}}let Cre=xLe=class extends ${constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=Rt,this.relayout=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=this.editor.onDidLayoutChange,this.layout=()=>this.editor.layout(),this._onDidModelChange=new I,this.onDidModelChange=this._onDidModelChange.event,this.onWillDispose=this.editor.onDidDispose,this._onDidActiveEditorChange=new I,this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this.onWillCloseEditor=T.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=T.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--xLe.idCounter,this.index=-1,this.label=`standalone editor ${-this.id}`,this.ariaLabel=`standalone editor ${-this.id}`,this.previewEditor=null,this.isLocked=!0,this.stickyCount=0,this.getEditors=()=>this.editors,this.findEditors=a=>this.pane!=null&&a.toString()===this.pane.input.resource.toString()?[this.pane.input]:[],this.getEditorByIndex=a=>this.pane!=null&&a===0?this.pane.input:void 0,this.getIndexOfEditor=a=>this.pane!=null&&this.pane.input===a?0:-1,this.openEditor=async a=>{if(!a.isDisposed()&&a instanceof AM&&a.resource.toString()===this.pane?.input.resource.toString())return this.focus(),this.pane},this.openEditors=async a=>{if(a.length===1)return this.openEditor(a[0].editor)},this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>this.editor.hasWidgetFocus(),this.contains=a=>this.pane!=null&&this.pane.input===a,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt;const s=a=>{const c=t.createInstance(AM,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new V7e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},o=a=>{if(this.pane!=null&&this.pane.input.resource.toString()===a.toString()){const c=this.pane;this.pane=void 0,this._onDidModelChange.fire({kind:6,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:void 0}),this._onDidCloseEditor.fire({context:mx.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&s(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&o(a.uri)}});const r=e.getModel();if(r!=null){const a=t.createInstance(AM,r.uri,void 0,void 0,void 0,void 0);this.pane=new V7e(e,a,this)}}get groupsView(){return Rt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:T.None}}get titleHeight(){return Rt()}setActive(e){this.active=e}get element(){return this.editor.getContainerDomNode()}get activeEditorPane(){return this.pane}get activeEditor(){return this.pane?.input??null}get count(){return this.pane!=null?1:0}get isEmpty(){return this.pane==null}get editors(){return this.pane!=null?[this.pane.input]:[]}focus(){this.editor.focus(),this.editor.getContainerDomNode().scrollIntoView()}};Cre.idCounter=0;Cre=xLe=D([_(1,be),_(2,Pe)],Cre);let kLe=class extends ${constructor(e,t,i){super(),this.delegate=e,this._serviceBrand=void 0,this.additionalGroups=[],this.activeGroupOverride=void 0,this.onDidCreateAuxiliaryEditorPart=this.delegate.onDidCreateAuxiliaryEditorPart,this.onDidChangeGroupMaximized=this.delegate.onDidChangeGroupMaximized,this._onDidChangeActiveGroup=new I,this.onDidChangeActiveGroup=T.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=T.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=T.any(this._onDidRemoveGroup.event,this.delegate.onDidRemoveGroup),this.onDidMoveGroup=this.delegate.onDidMoveGroup,this.onDidActivateGroup=this.delegate.onDidActivateGroup,this.onDidChangeGroupIndex=this.delegate.onDidChangeGroupIndex,this.onDidChangeGroupLocked=this.delegate.onDidChangeGroupLocked,this.getLayout=()=>this.delegate.getLayout(),this.getGroups=s=>[...this.delegate.getGroups(s),...this.additionalGroups],this.getGroup=s=>this.delegate.getGroup(s)??this.additionalGroups.find(o=>o.id===s),this.activateGroup=(...s)=>this.delegate.activateGroup(...s),this.getSize=(...s)=>this.delegate.getSize(...s),this.setSize=(...s)=>this.delegate.setSize(...s),this.arrangeGroups=(...s)=>this.delegate.arrangeGroups(...s),this.applyLayout=(...s)=>this.delegate.applyLayout(...s),this.setGroupOrientation=(...s)=>this.delegate.setGroupOrientation(...s),this.findGroup=(...s)=>this.delegate.findGroup(...s),this.addGroup=(...s)=>this.delegate.addGroup(...s),this.removeGroup=(...s)=>this.delegate.removeGroup(...s),this.moveGroup=(...s)=>this.delegate.moveGroup(...s),this.mergeGroup=(...s)=>this.delegate.mergeGroup(...s),this.mergeAllGroups=(...s)=>this.delegate.mergeAllGroups(...s),this.copyGroup=(...s)=>this.delegate.copyGroup(...s),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const s=Lt.get(Qt),o=a=>{if(a instanceof mF){let c;const l=p=>{const m=p!=null?this.additionalGroups.find(v=>v.editor===p):void 0;this.activeGroupOverride!==m&&(this.activeGroupOverride=m,this._onDidChangeActiveGroup.fire(this.activeGroup))},d=p=>{!t&&this.activeGroupOverride===this.additionalGroups.find(m=>m.editor===p)&&l(void 0)},h=()=>{c!=null&&window.clearTimeout(c),l(a)},u=()=>{c!=null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=void 0,d(a)},100)};a.onDidDispose(()=>{d(a)}),a.onDidFocusEditorText(h),a.onDidFocusEditorWidget(h),a.onDidBlurEditorText(u),a.onDidBlurEditorWidget(u),a.hasWidgetFocus()&&h();const f=i.createInstance(Cre,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof mF){const c=this.additionalGroups.find(l=>l.editor===a);c!=null&&(c.dispose(),this.activeGroupOverride===c&&(this.activeGroupOverride=void 0,this._onDidChangeActiveGroup.fire(this.activeGroup)),this.additionalGroups=this.additionalGroups.filter(l=>l!==c),this._onDidRemoveGroup.fire(c))}};this._register(s.onCodeEditorAdd(o)),this._register(s.onCodeEditorRemove(r)),s.listCodeEditors().forEach(o)})}registerContextKeyProvider(e){return this.delegate.registerContextKeyProvider(e)}saveWorkingSet(e){return this.delegate.saveWorkingSet(e)}getWorkingSets(){return this.delegate.getWorkingSets()}applyWorkingSet(e){return this.delegate.applyWorkingSet(e)}deleteWorkingSet(e){return this.delegate.deleteWorkingSet(e)}get isReady(){return this.delegate.isReady}get whenReady(){return this.delegate.whenReady}get whenRestored(){return this.delegate.whenRestored}get hasRestorableState(){return this.delegate.hasRestorableState}get parts(){return this.delegate.parts}createAuxiliaryEditorPart(e){return this.delegate.createAuxiliaryEditorPart(e)}get mainPart(){return this.delegate.mainPart}getPart(e){return this.delegate.getPart(e)}toggleMaximizeGroup(e){return this.delegate.toggleMaximizeGroup(e)}toggleExpandGroup(e){return this.delegate.toggleExpandGroup(e)}createEditorDropTarget(e,t){return this.delegate.createEditorDropTarget(e,t)}get groups(){return[...this.additionalGroups,...this.delegate.groups]}get activeGroup(){return this.activeGroupOverride??this.delegate.activeGroup}get sideGroup(){return this.delegate.sideGroup}get count(){return this.delegate.count+this.additionalGroups.length}get orientation(){return this.delegate.orientation}get partOptions(){return this.delegate.partOptions}};kLe=D([_(2,be)],kLe);var jH;let yre=(jH=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=s,this.workingCopyService=o,this.logService=r,this.markerService=a,this.uriIdentityService=c,this.scheduledAutoSavesAfterDelay=new Map,this.lastActiveEditor=void 0,this.lastActiveGroupId=void 0,this.lastActiveEditorControlDisposable=this._register(new Z),this.waitingOnConditionAutoSaveWorkingCopies=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l));for(const l of this.workingCopyService.dirtyWorkingCopies)this.onDidRegister(l);this.registerListeners()}registerListeners(){this._register(this.hostService.onDidChangeFocus(e=>this.onWindowFocusChange(e))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChange())),this._register(this.editorService.onDidActiveEditorChange(()=>this.onDidActiveEditorChange())),this._register(this.filesConfigurationService.onDidChangeAutoSaveConfiguration(()=>this.onDidChangeAutoSaveConfiguration())),this._register(this.workingCopyService.onDidRegister(e=>this.onDidRegister(e))),this._register(this.workingCopyService.onDidUnregister(e=>this.onDidUnregister(e))),this._register(this.workingCopyService.onDidChangeDirty(e=>this.onDidChangeDirty(e))),this._register(this.workingCopyService.onDidChangeContent(e=>this.onDidChangeContent(e))),this._register(this.markerService.onMarkerChanged(e=>this.onConditionChanged(e,Kf.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Kf.DISABLED)))}onConditionChanged(e,t){for(const i of e){const s=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(s?.condition===t)s.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(s.workingCopy.resource,s.reason).mode!==Uc.OFF&&(this.discardAutoSave(s.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",s.workingCopy.resource.toString(),s.workingCopy.typeId),s.workingCopy.save({reason:s.reason}));else{const o=this.waitingOnConditionAutoSaveEditors.get(i);o?.condition===t&&!o.editor.editor.isDisposed()&&o.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(o.editor.editor,o.reason).mode!==Uc.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${o.reason}`),this.editorService.save(o.editor,{reason:o.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:this.lastActiveGroupId,editor:this.lastActiveEditor});const e=this.editorGroupService.activeGroup,t=this.lastActiveEditor=e.activeEditor??void 0;this.lastActiveGroupId=e.id,this.lastActiveEditorControlDisposable.clear();const i=this.editorService.activeEditorPane;t&&i&&this.lastActiveEditorControlDisposable.add(i.onDidBlur(()=>{this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Mi.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==Uc.OFF?(e===Ln.WINDOW_CHANGE&&(i.mode===Uc.ON_FOCUS_CHANGE||i.mode===Uc.ON_WINDOW_CHANGE)||e===Ln.FOCUS_CHANGE&&i.mode===Uc.ON_FOCUS_CHANGE)&&(this.logService.trace(`[editor auto save] triggering auto save with reason ${e}`),this.editorService.save(t,{reason:e})):t.editor.resource&&(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveEditors.set(t.editor.resource,{editor:t,reason:e,condition:i.reason})}else this.saveAllDirtyAutoSaveables(e)}onDidChangeAutoSaveConfiguration(){let e;switch(this.filesConfigurationService.getAutoSaveMode(void 0).mode){case Uc.ON_FOCUS_CHANGE:e=Ln.FOCUS_CHANGE;break;case Uc.ON_WINDOW_CHANGE:e=Ln.WINDOW_CHANGE;break;case Uc.AFTER_SHORT_DELAY:case Uc.AFTER_LONG_DELAY:e=Ln.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&JS.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==Uc.OFF?t.save({reason:e}):(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(t.resource,{workingCopy:t,reason:e,condition:i.reason})}}onDidRegister(e){e.isDirty()&&this.scheduleAutoSave(e)}onDidUnregister(e){this.discardAutoSave(e)}onDidChangeDirty(e){e.isDirty()?this.scheduleAutoSave(e):this.discardAutoSave(e)}onDidChangeContent(e){e.isDirty()&&this.scheduleAutoSave(e)}scheduleAutoSave(e){if(e.capabilities&JS.Untitled)return;const t=this.filesConfigurationService.getAutoSaveConfiguration(e.resource).autoSaveDelay;if(typeof t!="number")return;this.discardAutoSave(e),this.logService.trace(`[editor auto save] scheduling auto save after ${t}ms`,e.resource.toString(),e.typeId);const i=setTimeout(()=>{if(this.discardAutoSave(e),e.isDirty()){const s=Ln.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,s);o.mode!==Uc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:s})):(o.reason===Kf.ERRORS||o.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:s,condition:o.reason})}},t);this.scheduledAutoSavesAfterDelay.set(e,Ee(()=>{this.logService.trace("[editor auto save] clearing pending auto save",e.resource.toString(),e.typeId),clearTimeout(i)}))}discardAutoSave(e){St(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},jH.ID="workbench.contrib.editorAutoSave",jH);yre=D([_(0,hh),_(1,Id),_(2,_i),_(3,ur),_(4,Pw),_(5,Ze),_(6,U_),_(7,_o)],yre);gp(yre.ID,yre,Sl.BlockRestore);let ILe=class extends pL{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Js.binary}getName(){return this.name}getSize(){return this.size}getMime(){return this.mime}getETag(){return this.etag}async resolve(){if(this.fileService.hasProvider(this.resource)){const e=await this.fileService.stat(this.resource);this.etag=e.etag,typeof e.size=="number"&&(this.size=e.size)}return super.resolve()}};ILe=D([_(2,ci)],ILe);var LLe,ck;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Binary=2]="Binary"})(ck||(ck={}));let Sre=LLe=class extends Ib{get typeId(){return gst}get editorId(){return A_.id}get capabilities(){let e=Mi.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Mi.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(e,t,p,l,h,u,f,v,w),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=ck.None,this.model=void 0,this.cachedTextFileModelReference=void 0,this.modelListeners=this._register(new Z),this.model=this.textFileService.files.get(e),i&&this.setPreferredName(i),s&&this.setPreferredDescription(s),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(b=>this.onDidCreateTextFileModel(b))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){_n(e.resource,this.resource)&&(this.model=e,this.registerModelListeners(e))}registerModelListeners(e){this.modelListeners.clear(),this.modelListeners.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(e.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this.modelListeners.add(e.onDidSaveError(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(T.once(e.onWillDispose)(()=>{this.modelListeners.clear(),this.model=void 0}))}getName(){return this.preferredName||super.getName()}setPreferredName(e){this.allowLabelOverride()&&this.preferredName!==e&&(this.preferredName=e,this._onDidChangeLabel.fire())}allowLabelOverride(){return this.resource.scheme!==this.pathService.defaultUriScheme&&this.resource.scheme!==_e.vscodeUserData&&this.resource.scheme!==_e.file&&this.resource.scheme!==_e.vscodeRemote}getPreferredName(){return this.preferredName}isReadonly(){return this.model?this.model.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}getDescription(e){return this.preferredDescription||super.getDescription(e)}setPreferredDescription(e){this.allowLabelOverride()&&this.preferredDescription!==e&&(this.preferredDescription=e,this._onDidChangeLabel.fire())}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getEncoding(){return this.model?this.model.getEncoding():this.preferredEncoding}getPreferredEncoding(){return this.preferredEncoding}async setEncoding(e,t){return this.setPreferredEncoding(e),this.model?.setEncoding(e,t)}setPreferredEncoding(e){this.preferredEncoding=e,this.setForceOpenAsText()}getLanguageId(){return this.model?this.model.getLanguageId():this.preferredLanguageId}getPreferredLanguageId(){return this.preferredLanguageId}setLanguageId(e,t){this.setPreferredLanguageId(e),this.model?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e,this.setForceOpenAsText()}setPreferredContents(e){this.preferredContents=e,this.setForceOpenAsText()}setForceOpenAsText(){this.forceOpenAs=ck.Text}setForceOpenAsBinary(){this.forceOpenAs=ck.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(uu.SAVED)||this.model?.hasState(uu.CONFLICT)||this.model?.hasState(uu.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===ck.Binary?e.find(t=>t.typeId===P5t):e.find(t=>t.typeId===ust)}resolve(e){return this.forceOpenAs===ck.Binary?this.doResolveAsBinary():this.doResolveAsText(e)}async doResolveAsText(e){try{const t=this.preferredContents;this.preferredContents=void 0,await this.textFileService.files.resolve(this.resource,{languageId:this.preferredLanguageId,encoding:this.preferredEncoding,contents:typeof t=="string"?hde(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===ck.Text,reason:Zte.EDITOR,limits:this.ensureLimits(e)}),this.cachedTextFileModelReference||(this.cachedTextFileModelReference=await this.textModelService.createModelReference(this.resource));const i=this.cachedTextFileModelReference.object;return this.isDisposed()&&this.disposeModelReference(),i}catch(t){if(t.textFileOperationResult===xV.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(ILe,this.preferredResource,this.getName());return await e.resolve(),e}isResolved(){return!!this.model}async rename(e,t){return{editor:{resource:t,encoding:this.getEncoding(),options:{viewState:qW(this,e,this.editorService)}}}}toUntyped(e){const t={resource:this.preferredResource,forceFile:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=(()=>{const i=this.textFileService.files.get(this.resource);if(i?.isDirty()&&!i.textEditorModel.isTooLargeForHeapOperation())return i.textEditorModel.getValue()})(),t.options={...t.options,viewState:qW(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof LLe?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Sre=LLe=D([_(7,be),_(8,tr),_(9,Rn),_(10,eo),_(11,ci),_(12,hh),_(13,_i),_(14,Lm),_(15,dl),_(16,aD)],Sre);it.as(zS.EditorFactory).registerFileEditorFactory({typeId:gst,createFileEditor:(n,e,t,i,s,o,r,a)=>a.createInstance(Sre,n,e,t,i,s,o,r),isFileEditor:n=>n instanceof Sre});function Gei(n,e){const t=n.lastFocusedList,i=t?.getHTMLElement();if(i&&kw(i)&&t instanceof Pc){const s=Ui(t.getSelectedElements().filter(c=>c instanceof tne)),o=t.getFocusedElements(),r=o.length?o[0]:void 0;let a;return r instanceof tne&&(a=r),s.some(c=>c===a)?s:a?[a]:void 0}}const gme="vs/workbench/contrib/files/browser/fileCommands";async function GOe(n,e){const t=n.get(yf),i=n.get(ur),s=n.get(Qt),o=n.get(tr);let r=Gei(t);if(!r){const c=i.activeGroup;c.activeEditor&&(r=[],c.activeEditor instanceof mm&&!e?.saveAs&&!(c.activeEditor.primary.hasCapability(Mi.Untitled)||c.activeEditor.secondary.hasCapability(Mi.Untitled))&&c.activeEditor.secondary.isModified()?(r.push({groupId:c.id,editor:c.activeEditor.primary}),r.push({groupId:c.id,editor:c.activeEditor.secondary})):r.push({groupId:c.id,editor:c.activeEditor}))}if(!r||r.length===0)return;await qOe(n,r,e);const a=s.getFocusedCodeEditor();if(a instanceof oC&&!a.isSimpleWidget){const c=a.getModel()?.uri;c&&!r.some(({editor:l})=>_n(Qc.getCanonicalUri(l,{supportSideBySide:go.PRIMARY}),c))&&(o.files.get(c)?.isReadonly()||await o.save(c,e))}}function cat(n,e,t){const i=[];for(const s of e)for(const o of s.getEditors(eg.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:s.id,editor:o});return qOe(n,i,t)}async function qOe(n,e,t){const i=n.get(_i),s=n.get(Pi),o=n.get(be);try{await i.save(e,t)}catch(r){Na(r)||s.notify({id:e.map(({editor:a})=>Ed(a.resource?.toString())).join(),severity:nt.Error,message:g(gme,3,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Ma(r,!1)),actions:{primary:[_l({id:"workbench.action.files.saveEditors",label:g(gme,4,"Retry"),run:()=>o.invokeFunction(a=>qOe(a,e,t))}),_l({id:"workbench.action.files.revertEditors",label:g(gme,5,"Discard"),run:()=>i.revert(e)})]}})}}xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyS,id:FOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:Br(V.CtrlCmd|E.KeyK,E.KeyS),win:{primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|V.Shift|E.KeyS)},id:OOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0,skipSaveParticipants:!0})});xr.registerCommandAndKeybindingRule({id:POt,weight:ye.WorkbenchContrib,when:void 0,primary:V.CtrlCmd|V.Shift|E.KeyS,handler:n=>GOe(n,{reason:Ln.EXPLICIT,saveAs:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:void 0,mac:{primary:V.CtrlCmd|V.Alt|E.KeyS},win:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyS)},id:BOt,handler:n=>cat(n,n.get(ur).getGroups(gg.MOST_RECENTLY_ACTIVE),{reason:Ln.EXPLICIT})});yt.registerCommand({id:rit,handler:(n,e,t)=>{const i=n.get(ur),s=c3t(t,n.get(yf),n.get(ur));let o;return s.length?o=Ui(s.map(r=>i.getGroup(r.groupId))):o=i.getGroups(gg.MOST_RECENTLY_ACTIVE),cat(n,o,{reason:Ln.EXPLICIT})}});yt.registerCommand({id:WOt,handler:async n=>(await n.get(_i).saveAll({includeUntitled:!1,reason:Ln.EXPLICIT})).success});class qei{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=Rt,this.isLayoutCentered=Rt,this.enforcePartOptions=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.applyLayout=Rt,this.getLayout=Rt,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}class Qei{constructor(){this.registerContextKeyProvider=Rt,this.saveWorkingSet=Rt,this.getWorkingSets=Rt,this.applyWorkingSet=Rt,this.deleteWorkingSet=Rt,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new qei,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=Rt,this.createAuxiliaryEditorPart=Rt,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.partOptions=Kde,this.createEditorDropTarget=Rt,this._serviceBrand=void 0,this.getLayout=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.applyLayout=Rt,this.centerLayout=Rt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}let TLe=class extends kLe{constructor(e){super(e.createInstance(Qei),!0,e)}};TLe=D([_(0,be)],TLe);function jei(n){return{[Qt.toString()]:new $i(CLe,void 0,!0),[_i.toString()]:new $i(DLe,[n,()=>!1],!0),[rhe.toString()]:new $i(yLe,[],!1),[ur.toString()]:new $i(TLe)}}const Kei="vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions",lat={category:Be(Kei,0,"Snippets")};class dat extends pi{constructor(e){super({...lat,...e})}}class hat extends wf{constructor(e){super({...lat,...e})}}const lu="vs/workbench/contrib/snippets/browser/commands/configureSnippets";var RLe;(function(n){function e(t){return!!t&&P.isUri(t.filepath)}n.is=e})(RLe||(RLe={}));async function Yei(n,e,t,i){const s=[],o=[],r=new Set,a=new Map;for(const l of await n.getSnippetFiles())if(l.source!==Yg.Extension)if(l.isGlobalSnippets){await l.load();const d=new Set;let h;e:for(const m of l.data){h||(h=m.source);for(const v of m.scopes){const w=t.getLanguageName(v);if(w)if(d.size>=4){d.add(`${w}...`);break e}else d.add(w)}}const u={label:ui(l.location),filepath:l.location,description:d.size===0?g(lu,0,"(global)"):g(lu,1,"({0})",[...d].join(", "))};if(s.push(u),!h)continue;const f=g(lu,2,"({0}) {1}",h,i.getUriLabel(l.location,{relative:!0})),p=a.get(ui(l.location));p&&(u.detail=f,p.snippet.detail=p.detail),a.set(ui(l.location),{snippet:u,detail:f})}else{const d=ui(l.location).replace(/\.json$/,"");s.push({label:ui(l.location),description:`(${t.getLanguageName(d)})`,filepath:l.location}),r.add(d)}const c=e.currentProfile.snippetsHome;for(const l of t.getRegisteredLanguageIds()){const d=t.getLanguageName(l);d&&!r.has(l)&&o.push({label:l,description:`(${d})`,filepath:qt(c,`${l}.json`),hint:!0})}return s.sort((l,d)=>{const h=T_(l.filepath.path),u=T_(d.filepath.path);return h===u?l.label.localeCompare(d.label):h===".code-snippets"?-1:1}),o.sort((l,d)=>l.label.localeCompare(d.label)),{existing:s,future:o}}async function z7e(n,e,t,i,s,o){function r(l){const d=T_(l)!==".code-snippets"?`${l}.code-snippets`:l;return qt(e,d)}await i.createFolder(e);const a=await t.input({placeHolder:g(lu,3,"Type snippet file name"),async validateInput(l){if(!l)return g(lu,4,"Invalid file name");if(!VQe(l))return g(lu,5,"'{0}' is not a valid file name",l);if(await i.exists(r(l)))return g(lu,6,"'{0}' already exists",l)}});if(!a)return;const c=r(a);await s.write(c,["{"," // Place your "+n+" snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and "," // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope "," // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is "," // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: "," // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. "," // Placeholders with the same ids are connected."," // Example:",' // "Print to console": {',' // "scope": "javascript,typescript",',' // "prefix": "log",',' // "body": [',` // "console.log('$1');",`,' // "$2"'," // ],",' // "description": "Log output to console"'," // }","}"].join(` +`}getOS(e){let t=$c;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==_e.file){const s=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(s,ke.WORKSPACE,$c),this.storageService.store(s,t,ke.WORKSPACE,ln.MACHINE)}return t}};_Le=D([_(0,Re),_(1,Sf),_(2,Za),_(3,on)],_Le);const vY="vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService";let vLe=class{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v){this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=s,this.commandService=o,this.fileService=r,this.textFileService=a,this.workspacesService=c,this.environmentService=l,this.fileDialogService=d,this.dialogService=h,this.hostService=u,this.uriIdentityService=f,this.workspaceTrustManagementService=p,this.userDataProfilesService=m,this.userDataProfileService=v}async pickNewWorkspacePath(){const e=[_e.file];this.environmentService.remoteAuthority&&e.unshift(_e.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:YPe(g(vY,0,"Save")),title:g(vY,1,"Save Workspace"),filters:oxt,defaultUri:Qt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return yde(t)||(t=t.with({path:`${t.path}.${qb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&lbe(e,this.environmentService))return ui(e);const t=k_(this.contextService.getWorkspace().folders);return t?`${ui(t.uri)}.${qb}`:`workspace.${qb}`}async updateFolders(e,t,i,s){const o=this.contextService.getWorkspace().folders;let r=[];typeof t=="number"&&(r=o.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:c2e(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,s):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==Nn.WORKSPACE?this.doAddFolders(a,e,s):this.doUpdateFolders(a,r,e,s)}async doUpdateFolders(e,t,i,s=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(s)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(s=>({uri:c2e(s.uri),name:s.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const s=this.contextService.getWorkbenchState();if(s!==Nn.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=Lc(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),s===Nn.EMPTY&&o.length===0||s===Nn.FOLDER&&o.length===1?void 0:this.createAndEnterWorkspace(o)}try{await this.contextService.addFolders(e,t)}catch(o){if(i)throw o;this.handleWorkspaceConfigurationEditingError(o)}}async removeFolders(e,t=!1){if(this.includesSingleFolderWorkspace(e))return this.createAndEnterWorkspace([]);try{await this.contextService.removeFolders(e)}catch(i){if(t)throw i;this.handleWorkspaceConfigurationEditingError(i)}}includesSingleFolderWorkspace(e){if(this.contextService.getWorkbenchState()===Nn.FOLDER){const t=this.contextService.getWorkspace().folders[0];return e.some(i=>this.uriIdentityService.extUri.isEqual(i,t.uri))}return!1}async createAndEnterWorkspace(e,t){if(t&&!await this.isValidTargetWorkspacePath(t))return;const i=this.environmentService.remoteAuthority,s=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(s,t)}finally{await this.workspacesService.deleteUntitledWorkspace(s)}else t=s.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(s,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(_n(t.configPath,e))return this.saveWorkspace(t);if(await this.isValidTargetWorkspacePath(e))return await this.saveWorkspaceAs(t,e),this.enterWorkspace(e)}}async isValidTargetWorkspacePath(e){return!0}async saveWorkspaceAs(e,t){const i=e.configPath;if(!p7(t,this.environmentService)&&!this.userDataProfileService.currentProfile.isDefault){const c=await this.workspacesService.getWorkspaceIdentifier(t);await this.userDataProfilesService.setProfileForWorkspace(c,this.userDataProfileService.currentProfile)}if(this.uriIdentityService.extUri.isEqual(i,t))return;const o=p7(i,this.environmentService),r=await this.fileService.readFile(i),a=N7e(r.value.toString(),i,o,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:a,options:{overwrite:!0}}]),await this.trustWorkspaceConfiguration(t)}async saveWorkspace(e){const t=e.configPath,i=this.textFileService.files.get(t);if(i){await i.save({force:!0,reason:Ln.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=N7e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case jG.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(vY,2,"Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again.");this.askToOpenWorkspaceConfigurationFile(e)}askToOpenWorkspaceConfigurationFile(e){this.notificationService.prompt(nt.Error,e,[{label:g(vY,3,"Open Workspace Configuration"),run:()=>this.commandService.executeCommand("workbench.action.openWorkspaceConfigFile")}])}async doEnterWorkspace(e){if(this.environmentService.extensionTestsLocationURI)throw new Error("Entering a new workspace is not possible in tests.");const t=await this.workspacesService.getWorkspaceIdentifier(e);return this.contextService.getWorkbenchState()===Nn.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===ut.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=it.as(Cs.Configuration).getConfigurationProperties(),s={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;s[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:s}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==Nn.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=UW(this.contextService.getWorkspace());if(hF(e))return e}};vLe=D([_(0,dL),_(1,Ti),_(2,sat),_(3,Pi),_(4,ji),_(5,ci),_(6,tr),_(7,cL),_(8,Za),_(9,bf),_(10,To),_(11,Id),_(12,_o),_(13,oA),_(14,V_),_(15,Tm)],vLe);var BB,jP;let wLe=(jP=class extends ${constructor(e,t,i,s,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=s,this.environmentService=o,this.uriIdentityService=r,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(ke.APPLICATION,BB.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(hx(this.contextService.getWorkspace()))for(const t of e.added)this.addRecentlyOpened([{folderUri:t.uri}])}addWorkspaceToRecentlyOpened(){const e=this.contextService.getWorkspace(),t=this.environmentService.remoteAuthority;switch(this.contextService.getWorkbenchState()){case Nn.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case Nn.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get(BB.RECENTLY_OPENED_KEY,ke.APPLICATION);if(e){const t=vei(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(UX(i)&&i.folderUri.scheme===_e.file&&!hx(this.contextService.getWorkspace())||uei(i)&&hx(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)gei(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):UX(i)?(this.doRemoveRecentlyOpened(t,[i.folderUri]),t.workspaces.unshift(i)):(this.doRemoveRecentlyOpened(t,[i.workspace.configPath]),t.workspaces.unshift(i));return this.saveRecentlyOpened(t)}async removeRecentlyOpened(e){const t=await this.getRecentlyOpened();return this.doRemoveRecentlyOpened(t,e),this.saveRecentlyOpened(t)}doRemoveRecentlyOpened(e,t){e.files=e.files.filter(i=>!t.some(s=>s.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(s=>s.toString()===(UX(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(BB.RECENTLY_OPENED_KEY,JSON.stringify(wei(e)),ke.APPLICATION,ln.USER)}async clearRecentlyOpened(){this.storageService.remove(BB.RECENTLY_OPENED_KEY,ke.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),s=Qt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${qb}`),o=[];if(e)for(const a of e)o.push(zOe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(s,ze.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(s)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Zi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return BFe(e)}async getDirtyWorkspaces(){return[]}},BB=jP,jP.RECENTLY_OPENED_KEY="recently.opened",jP);wLe=BB=D([_(0,on),_(1,Ti),_(2,Ze),_(3,ci),_(4,Za),_(5,_o)],wLe);function Pei(){throw new Error("unsupported")}function Fei(n){let e=null;return(...t)=>(e==null&&(e=n(...t)),e)}function Oei(n){return new Proxy(n,{construct:Fei((e,t)=>Reflect.construct(n,t))})}P.from({scheme:_e.vscodeUserData,path:"/User/settings.json"});it.as(Cs.Configuration);let bLe=class extends kei{constructor(e,t,i,s,o,r,a,c){const l=new Lei([_e.file,_e.vscodeUserData,_e.tmp],e,s);super({configurationCache:l},e,t,i,s,o,r,a,c)}};bLe=D([_(0,Za),_(1,Tm),_(2,V_),_(3,ci),_(4,Sf),_(5,_o),_(6,Ze),_(7,sPe)],bLe);class Bei extends vLe{constructor(){super(...arguments),this.enterWorkspace=Pei}}let rat;VFe(async n=>{const e=n.get(Ti);e.acquireInstantiationService(n.get(be));const t=rat??HFe();if(P.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const s=n.get(ci);await s.createFolder(t),await s.writeFile(i,ze.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:Dr(),configPath:i})}else await e.initialize(t)});const W7e=Oei(bLe);function Wei(n){return rat=n,{...lOe(),[eo.toString()]:new Gi(mLe,void 0,!0),[Re.toString()]:new Gi(W7e,[],!0),[Ti.toString()]:new Gi(W7e,[],!0),[dl.toString()]:new Gi(lLe,[],!0),[$S.toString()]:new Gi(Bei,[],!0),[cL.toString()]:new Gi(wLe,void 0,!0),[bMe.toString()]:new Gi(_Le,void 0,!0)}}let CLe=class extends ZZ{constructor(e,t,i){super(t),this.editorService=e,this.configurationService=i,this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditor.bind(this))),this._register(this.registerCodeEditorOpenHandler(this.doOpenCodeEditorFromDiff.bind(this)))}getActiveCodeEditor(){const e=this.editorService.activeTextEditorControl;if(ja(e))return e;if(ew(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return HU(t)&&ja(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const s=this.editorService.activeTextEditorControl;if(!i&&ew(s)&&e.options&&e.resource&&t===s.getModifiedEditor()&&s.getModel()&&_n(e.resource,s.getModel()?.modified.uri)){const o=s.getModifiedEditor();return rne(e.options,o,vt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!_n(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(_z(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?Cw:wx);if(o){const r=o.getControl();if(ja(r))return r;if(HU(r)&&ja(r.activeCodeEditor))return r.activeCodeEditor}return null}};CLe=D([_(0,_i),_(1,pn),_(2,Re)],CLe);let yLe=class extends ${constructor(e,t,i,s,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=s,this.editorResolverService=o,this.editorInputCache=new wi,this.fileEditorFactory=it.as(zS.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:A_.id,label:A_.displayName,detail:A_.providerDisplayName,priority:Gse.builtin},{},{createEditorInput:e=>({editor:this.createTextEditor(e)}),createUntitledEditorInput:e=>({editor:this.createTextEditor(e)}),createDiffEditorInput:e=>({editor:this.createTextEditor(e)})}))}async resolveTextEditor(e){return this.createTextEditor(e)}createTextEditor(e){if(Wb(e))return this.createTextEditor(e.result);if(Gv(e)){const s=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance(op,e.label,e.description,s,o,void 0)}if(LE(e)){const s=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(mm,e.label,e.description,o,s)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===_e.untitled){const s={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===_e.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...s}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...s}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(E6,o))}const i=e;if(i.resource instanceof P){const s=i.label||ui(i.resource),o=i.resource,r=this.uriIdentityService.asCanonicalUri(o);return this.createOrGetCached(r,()=>i.forceFile||this.fileService.hasProvider(r)?this.fileEditorFactory.createFileEditor(r,o,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(AM,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof E6||(a instanceof AM?(s&&a.setName(s),i.description&&a.setDescription(i.description),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)):(a.setPreferredResource(o),i.label&&a.setPreferredName(i.label),i.description&&a.setPreferredDescription(i.description),i.encoding&&a.setPreferredEncoding(i.encoding),i.languageId&&a.setPreferredLanguageId(i.languageId),typeof i.contents=="string"&&a.setPreferredContents(i.contents)))})}throw new Error(`ITextEditorService: Unable to create texteditor from ${JSON.stringify(e)}`)}createOrGetCached(e,t,i){let s=this.editorInputCache.get(e);return s?(i?.(s),s):(s=t(),this.editorInputCache.set(e,s),T.once(s.onWillDispose)(()=>this.editorInputCache.delete(e)),s)}};yLe=D([_(0,RQ),_(1,be),_(2,_o),_(3,ci),_(4,Pz)],yLe);var Q3,KP;let SLe=(KP=class extends ${get count(){return this.mostRecentEditorsMap.size}get editors(){return[...this.mostRecentEditorsMap.values()]}hasEditor(e){return this.editorsPerResourceCounter.get(e.resource)?.has(this.toIdentifier(e))??!1}hasEditors(e){return this.editorsPerResourceCounter.has(e)}toIdentifier(e,t){return typeof e!="string"?this.toIdentifier(e.typeId,e.editorId):t?`${e}/${t}`:e}constructor(e,t,i){super(),this.editorGroupService=t,this.storageService=i,this.keyMap=new Map,this.mostRecentEditorsMap=new lQe,this.editorsPerResourceCounter=new wi,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.editorGroupsContainer=e??t,this.isScoped=!!e,this.registerListeners(),this.loadState()}registerListeners(){this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.onGroupAdded(e))),this._register(this.editorGroupService.onDidChangeEditorPartOptions(e=>this.onDidChangeEditorPartOptions(e))),this._register(this.storageService.onWillSaveState(()=>this.saveState()))}onGroupAdded(e){const t=e.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--)this.addMostRecentEditor(e,t[i],!1,!0);this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1),this.registerGroupListeners(e)}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{switch(i.kind){case qo.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case qo.EDITOR_OPEN:{i.editor&&(this.addMostRecentEditor(e,i.editor,!1,!0),this.ensureOpenedEditorsLimit({groupId:e.id,editor:i.editor},e.id));break}}})),t.add(e.onDidCloseEditor(i=>{this.removeMostRecentEditor(e,i.editor)})),t.add(e.onDidActiveEditorChange(i=>{i.editor&&this.addMostRecentEditor(e,i.editor,this.editorGroupsContainer.activeGroup===e,!1)})),T.once(e.onWillDispose)(()=>St(t))}onDidChangeEditorPartOptions(e){if(!Io(e.newPartOptions.limit,e.oldPartOptions.limit)){const t=this.editorGroupsContainer.activeGroup;let i;t.activeEditor&&(i={editor:t.activeEditor,groupId:t.id}),this.ensureOpenedEditorsLimit(i)}}addMostRecentEditor(e,t,i,s){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?Vd.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,Vd.AsOld),this.mostRecentEditorsMap.set(r,r,Vd.AsOld)),s&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,s,o;if(e instanceof mm?(i=e.primary.resource,s=e.primary.typeId,o=e.primary.editorId):(i=e.resource,s=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(s,o);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(r,(a.get(r)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(r)??0;c>1?a.set(r,c-1):(a.delete(r),a.size===0&&this.editorsPerResourceCounter.delete(i))}}}removeMostRecentEditor(e,t){this.updateEditorResourcesMap(t,!1);const i=this.findKey(e,t);if(i){this.mostRecentEditorsMap.delete(i);const s=this.keyMap.get(e.id);s&&s.delete(i.editor)&&s.size===0&&this.keyMap.delete(e.id),this._onDidMostRecentlyActiveEditorsChange.fire()}}findKey(e,t){const i=this.keyMap.get(e.id);if(i)return i.get(t)}ensureKey(e,t){let i=this.keyMap.get(e.id);i||(i=new Map,this.keyMap.set(e.id,i));let s=i.get(t);return s||(s={groupId:e.id,editor:t},i.set(t,s)),s}async ensureOpenedEditorsLimit(e,t){if(!this.editorGroupService.partOptions.limit?.enabled||typeof this.editorGroupService.partOptions.limit.value!="number"||this.editorGroupService.partOptions.limit.value<=0)return;const i=this.editorGroupService.partOptions.limit.value;if(this.editorGroupService.partOptions.limit?.perEditorGroup)if(typeof t=="number"){const s=this.editorGroupsContainer.getGroup(t);s&&await this.doEnsureOpenedEditorsLimit(i,s.getEditors(eg.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const s of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,s.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let s;if(this.editorGroupService.partOptions.limit?.excludeDirty?s=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad))):s=t,e>=s.length)return;const o=s.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Mi.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=s.length-e;const a=new Map;for(const{groupId:c,editor:l}of o){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),r--,r===0)break}for(const[c,l]of a){const d=this.editorGroupsContainer.getGroup(c);d&&await d.closeEditors(l,{preserveFocus:!0})}}saveState(){this.isScoped||(this.mostRecentEditorsMap.isEmpty()?this.storageService.remove(Q3.STORAGE_KEY,ke.WORKSPACE):this.storageService.store(Q3.STORAGE_KEY,JSON.stringify(this.serialize()),ke.WORKSPACE,ln.MACHINE))}serialize(){const e=it.as(zS.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Ui(t.map(({editor:s,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(eg.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(s);if(c!==-1)return{groupId:o,index:c}}))}}async loadState(){(this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService)&&await this.editorGroupService.whenReady;let e=!1;if(!this.isScoped){const t=this.storageService.get(Q3.STORAGE_KEY,ke.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const s=t[i],o=s.getEditors(eg.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(s,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:s}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(s);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},Q3=KP,KP.STORAGE_KEY="editors.mru",KP);SLe=Q3=D([_(1,ur),_(2,on)],SLe);function H7e(n,e,t){const i=n.get(ur),s=n.get(Re),o=Hei(e,t,i,s);return o instanceof Promise?o.then(r=>U7e(r,e,t,i)):U7e(o,e,t,i)}function U7e(n,e,t,i){let s;return i.activeGroup!==n&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==Cw&&(s=y1.ACTIVATE),[n,s]}function Hei(n,e,t,i){let s;const o=z$(n)?n.editor:n,r=n.options;if(e&&typeof e!="number")s=e;else if(typeof e=="number"&&e>=0)s=t.getGroup(e);else if(e===Cw){const a=w6(i);let c=t.findGroup({direction:a});(!c||wY(c,o))&&(c=t.addGroup(t.activeGroup,a)),s=c}else if(e===Ezt)s=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(gg.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(Uei(c,o)){s=c;break}}if(!s&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||Qa(o)&&o.hasCapability(Mi.Singleton))){let c,l;for(const d of a)if(aat(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;s=c||l}}if(!s){let a=t.activeGroup;if(wY(a,o)){for(const c of t.getGroups(gg.MOST_RECENTLY_ACTIVE))if(!wY(c,o)){a=c;break}wY(a,o)?s=t.addGroup(a,w6(i)):s=a}else s=a}return s}function wY(n,e){return!(!n.isLocked||aat(n,e))}function Uei(n,e){return n.activeEditor?n.activeEditor.matches(e):!1}function aat(n,e){for(const t of n.editors)if(t.matches(e))return!0;return!1}var ALe;let ELe=ALe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=s,this.configurationService=o,this.contextService=r,this.uriIdentityService=a,this.editorResolverService=c,this.workspaceTrustRequestService=l,this.hostService=d,this.textEditorService=h,this._onDidActiveEditorChange=this._register(new I),this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this._onDidVisibleEditorsChange=this._register(new I),this.onDidVisibleEditorsChange=this._onDidVisibleEditorsChange.event,this._onDidEditorsChange=this._register(new I),this.onDidEditorsChange=this._onDidEditorsChange.event,this._onWillOpenEditor=this._register(new I),this.onWillOpenEditor=this._onWillOpenEditor.event,this._onDidCloseEditor=this._register(new I),this.onDidCloseEditor=this._onDidCloseEditor.event,this._onDidOpenEditorFail=this._register(new I),this.onDidOpenEditorFail=this._onDidOpenEditorFail.event,this._onDidMostRecentlyActiveEditorsChange=this._register(new I),this.onDidMostRecentlyActiveEditorsChange=this._onDidMostRecentlyActiveEditorsChange.event,this.lastActiveEditor=void 0,this.activeOutOfWorkspaceWatchers=new wi,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(SLe,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new ALe(e==="main"?this.editorGroupService.mainPart:e,this.editorGroupService,this.instantiationService,this.fileService,this.configurationService,this.contextService,this.uriIdentityService,this.editorResolverService,this.workspaceTrustRequestService,this.hostService,this.textEditorService))}registerListeners(){this.editorGroupsContainer===this.editorGroupService.mainPart||this.editorGroupsContainer===this.editorGroupService?this.editorGroupService.whenReady.then(()=>this.onEditorGroupsReady()):this.onEditorGroupsReady(),this._register(this.editorGroupsContainer.onDidChangeActiveGroup(e=>this.handleActiveEditorChange(e))),this._register(this.editorGroupsContainer.onDidAddGroup(e=>this.registerGroupListeners(e))),this._register(this.editorsObserver.onDidMostRecentlyActiveEditorsChange(()=>this._onDidMostRecentlyActiveEditorsChange.fire())),this._register(this.onDidVisibleEditorsChange(()=>this.handleVisibleEditorsChange())),this._register(this.fileService.onDidRunOperation(e=>this.onDidRunFileOperation(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e))),this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onEditorGroupsReady(){for(const e of this.editorGroupsContainer.groups)this.registerGroupListeners(e);this.activeEditor&&(this.doHandleActiveEditorChangeEvent(),this._onDidVisibleEditorsChange.fire())}handleActiveEditorChange(e){e===this.editorGroupsContainer.activeGroup&&(!this.lastActiveEditor&&!e.activeEditor||this.doHandleActiveEditorChangeEvent())}doHandleActiveEditorChangeEvent(){const e=this.editorGroupsContainer.activeGroup;this.lastActiveEditor=e.activeEditor??void 0,this._onDidActiveEditorChange.fire()}registerGroupListeners(e){const t=new Z;t.add(e.onDidModelChange(i=>{this._onDidEditorsChange.fire({groupId:e.id,event:i})})),t.add(e.onDidActiveEditorChange(()=>{this.handleActiveEditorChange(e),this._onDidVisibleEditorsChange.fire()})),t.add(e.onWillOpenEditor(i=>{this._onWillOpenEditor.fire(i)})),t.add(e.onDidCloseEditor(i=>{this._onDidCloseEditor.fire(i)})),t.add(e.onDidOpenEditorFail(i=>{this._onDidOpenEditorFail.fire({editor:i,groupId:e.id})})),T.once(e.onWillDispose)(()=>{St(t)})}handleVisibleEditorsChange(){const e=new o1;for(const t of this.visibleEditors){const i=Lc(Ui([jc.getCanonicalUri(t,{supportSideBySide:go.PRIMARY}),jc.getCanonicalUri(t,{supportSideBySide:go.SECONDARY})]),s=>s.toString());for(const s of i)this.fileService.hasProvider(s)&&!this.contextService.isInsideWorkspace(s)&&e.add(s)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(St(this.activeOutOfWorkspaceWatchers.get(t)),this.activeOutOfWorkspaceWatchers.delete(t));for(const t of e.keys())if(!this.activeOutOfWorkspaceWatchers.get(t)){const i=this.fileService.watch(t);this.activeOutOfWorkspaceWatchers.set(t,i)}}async onDidRunFileOperation(e){e.isOperation(Li.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Li.DELETE)||e.isOperation(Li.MOVE))&&this.handleDeletedFile(e.resource,!1,e.target?e.target.resource:void 0)}onDidFilesChange(e){e.gotDeleted()&&this.handleDeletedFile(e,!0)}async handleMovedFile(e,t){for(const i of this.editorGroupsContainer.groups){const s=[];for(const o of i.editors){const r=o.resource;if(!r||!this.uriIdentityService.extUri.isEqualOrParent(r,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,r))a=t;else{const d=GQe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=Qt(t,r.path.substr(d+e.path.length+1))}const c=await o.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(o),sticky:i.isSticky(o),index:i.getIndexOfEditor(o),inactive:!i.isActive(o)};Qa(c.editor)?s.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):s.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}s.length&&this.replaceEditors(s,i)}}onConfigurationUpdated(e){if(e&&!e.affectsConfiguration("workbench.editor.closeOnFileDelete"))return;const t=this.configurationService.getValue();typeof t.workbench?.editor?.closeOnFileDelete=="boolean"?this.closeOnFileDelete=t.workbench.editor.closeOnFileDelete:this.closeOnFileDelete=!1}handleDeletedFile(e,t,i){for(const s of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=s.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof mee?r=e.contains(o,Ko.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Ta(100),a=await this.fileService.exists(o)),!a&&!s.isDisposed()&&s.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(s){s.hasCapability(Mi.Untitled)&&!e.includeUntitled||s.isDirty()||t.push(s)}for(const s of this.editors)e.supportSideBySide&&s instanceof mm?(i(s.primary),i(s.secondary)):i(s);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(ja(t)||ew(t))return t;if(HU(t)&&ja(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return ew(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(eg.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case eg.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:s})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(s)):this.editorsObserver.editors;case eg.SEQUENTIAL:{const i=[];for(const s of this.editorGroupsContainer.getGroups(gg.GRID_APPEARANCE))i.push(...s.getEditors(eg.SEQUENTIAL,t).map(o=>({editor:o,groupId:s.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Ui(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof uxe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const s of i)(ja(s)||ew(s))&&e.push(s)}return e}get visibleEditors(){return Ui(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let s,o=Qa(e)?t:e.options,r;if(est(t)&&(i=t),!Qa(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===w8.ABORT)return;Xfe(a)&&(s=a.editor,o=a.options,r=a.group)}if(s||(s=Qa(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(H7e,{editor:s,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(s,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const s=new Map;for(const r of e){let a,c;if(!z$(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===w8.ABORT)continue;Xfe(d)&&(a=d,c=d.group)}if(a||(a=z$(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(H7e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=s.get(c);l||(l=[],s.set(c,l)),l.push(a)}const o=[];for(const[r,a]of s)o.push(r.openEditors(a));return Ui(await ko.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:s}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case t_.Open:return!0;case t_.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:s}),!1;case t_.Cancel:return!1}}extractEditorResources(e){const t=new o1;let i=!1,s=!1;for(const o of e)if(z$(o)){const r=jc.getOriginalUri(o.editor,{supportSideBySide:go.BOTH});P.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof op)}else Wb(o)&&(P.isUri(o.input1)&&t.add(o.input1.resource),P.isUri(o.input2)&&t.add(o.input2.resource),P.isUri(o.base)&&t.add(o.base.resource),P.isUri(o.result)&&t.add(o.result.resource),s=!0),Gv(o)?(P.isUri(o.original.resource)&&t.add(o.original.resource),P.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):wb(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:s}}isOpened(e){return this.editorsObserver.hasEditor({resource:this.uriIdentityService.asCanonicalUri(e.resource),typeId:e.typeId,editorId:e.editorId})}isVisible(e){for(const t of this.editorGroupsContainer.groups)if(t.activeEditor?.matches(e))return!0;return!1}async closeEditor({editor:e,groupId:t},i){await this.editorGroupsContainer.getGroup(t)?.closeEditor(e,i)}async closeEditors(e,t){const i=new Map;for(const{editor:s,groupId:o}of e){const r=this.editorGroupsContainer.getGroup(o);if(!r)continue;let a=i.get(r);a||(a=[],i.set(r,a)),a.push(s)}for(const[s,o]of i)await s.closeEditors(o,t)}findEditors(e,t,i){const s=P.isUri(e)?e:e.resource,o=P.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==go.ANY&&t?.supportSideBySide!==go.SECONDARY&&!this.editorsObserver.hasEditors(s))return P.isUri(e)||ll(i)?[]:void 0;if(ll(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE)){const c=[];if(P.isUri(e))c.push(...this.findEditors(e,t,a));else{const l=this.findEditors(e,t,a);l&&c.push(l)}r.push(...c.map(l=>({editor:l,groupId:a.id})))}return r}else{const r=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(P.isUri(e))return r?r.findEditors(s,t):[];{if(!r)return;const a=r.findEditors(s,t);for(const c of a)if(c.typeId===o)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,s=[];for(const o of e){let r;if(!Qa(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===w8.ABORT)continue;Xfe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:Vze(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:Vze(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),s.push(r)}return i?.replaceEditors(s)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),s=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Mi.Untitled)?o.push({groupId:a,editor:c}):s.push({groupId:a,editor:c});const r=await ko.settled(s.map(({groupId:a,editor:c})=>(t?.reason===Ln.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of o){if(c.isDisposed())continue;const d={pinned:!0,viewState:(await this.openEditor(c,a))?.getViewState()},h=t?.saveAs?await c.saveAs(a,t):await c.save(a,t);if(r.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(Mi.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof cC?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:r.every(a=>!!a),editors:Ui(r)}}saveAll(e){return this.save(this.getAllModifiedEditors(e),e)}async revert(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e);return await ko.settled(i.map(async({groupId:s,editor:o})=>(this.editorGroupsContainer.getGroup(s)?.pinEditor(o),o.revert(s,t)))),!i.some(({editor:s})=>s.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(gg.MOST_RECENTLY_ACTIVE))for(const s of i.getEditors(eg.MOST_RECENTLY_ACTIVE))s.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&s.hasCapability(Mi.Scratchpad)||!e?.includeUntitled&&s.hasCapability(Mi.Untitled)||e?.excludeSticky&&i.isSticky(s)||t.push({groupId:i.id,editor:s}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:s}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:s});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>St(e)),this.activeOutOfWorkspaceWatchers.clear()}};ELe=ALe=D([_(1,ur),_(2,be),_(3,ci),_(4,Re),_(5,Ti),_(6,_o),_(7,Pz),_(8,Ade),_(9,Id),_(10,rhe)],ELe);function Rt(){throw new Error("unsupported")}var xLe;class Vei{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.createEditorActions=Rt,this.onDidFocus=T.None,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=Rt,this.notifyIndexChanged=Rt,this.relayout=Rt,this.dispose=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=T.None,this.layout=Rt,this.onDidModelChange=T.None,this.onWillDispose=T.None,this.onDidActiveEditorChange=T.None,this.onWillCloseEditor=T.None,this.onDidCloseEditor=T.None,this.onWillMoveEditor=T.None,this.onWillOpenEditor=T.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>{},this.getIndexOfEditor=Rt,this.openEditor=Rt,this.openEditors=Rt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt}get groupsView(){return Rt()}notifyLabelChanged(){}get titleHeight(){return Rt()}get element(){return Rt()}get scopedContextKeyService(){return Lt.get(Pe)}focus(){}}const dq=new Vei;class zei{constructor(e){this.editor=e,this.onDidChangeControl=T.None,this.onDidChangeSizeConstraints=T.None,this.onDidFocus=T.None,this.onDidBlur=T.None,this.input=void 0,this.options=void 0,this.group=dq,this.scopedContextKeyService=void 0,this.getViewState=Rt,this.isVisible=Rt,this.hasFocus=Rt,this.getId=Rt,this.getTitle=Rt,this.focus=Rt}get minimumWidth(){return rI.width}get maximumWidth(){return cte.width}get minimumHeight(){return rI.height}get maximumHeight(){return cte.height}getControl(){return this.editor}}function $ei(n,e,t){async function i(s,o,r){const a=Qa(s)?o:s.options;est(o)&&(r=o);const c=wb(s)||Qa(s)?s.resource:void 0;if(c==null||!n.canHandleResource(c))return e(s,o,r);let l;if(l=Lt.get(jt).listCodeEditors().find(h=>h instanceof mF&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(s,o,r);if(h!=null)return h;const u=await n.createModelReference(c);if(l=await t?.(u,a,r===Cw),l==null){u.dispose();return}}return a!=null&&rne(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new zei(l)}return i}let DLe=class extends ELe{constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(void 0,i,s,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=$ei(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Lt.get(jt).getFocusedCodeEditor();return e!=null&&e instanceof k1?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};DLe=D([_(2,ur),_(3,be),_(4,ci),_(5,Re),_(6,Ti),_(7,_o),_(8,Pz),_(9,Ade),_(10,Id),_(11,rhe),_(12,Rn)],DLe);class V7e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=T.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=T.None,this.scopedContextKeyService=void 0,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidBlur=this.editor.onDidBlurEditorWidget}getControl(){return this.editor}getViewState(){}isVisible(){return!0}hasFocus(){return this.editor.hasWidgetFocus()}getId(){return this.editor.getId()}getTitle(){}focus(){this.editor.focus()}}let Cre=xLe=class extends ${constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=Rt,this.isTransient=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=T.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=Rt,this.relayout=Rt,this.toJSON=Rt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=this.editor.onDidLayoutChange,this.layout=()=>this.editor.layout(),this._onDidModelChange=new I,this.onDidModelChange=this._onDidModelChange.event,this.onWillDispose=this.editor.onDidDispose,this._onDidActiveEditorChange=new I,this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this.onWillCloseEditor=T.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=T.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--xLe.idCounter,this.index=-1,this.label=`standalone editor ${-this.id}`,this.ariaLabel=`standalone editor ${-this.id}`,this.previewEditor=null,this.isLocked=!0,this.stickyCount=0,this.getEditors=()=>this.editors,this.findEditors=a=>this.pane!=null&&a.toString()===this.pane.input.resource.toString()?[this.pane.input]:[],this.getEditorByIndex=a=>this.pane!=null&&a===0?this.pane.input:void 0,this.getIndexOfEditor=a=>this.pane!=null&&this.pane.input===a?0:-1,this.openEditor=async a=>{if(!a.isDisposed()&&a instanceof AM&&a.resource.toString()===this.pane?.input.resource.toString())return this.focus(),this.pane},this.openEditors=async a=>{if(a.length===1)return this.openEditor(a[0].editor)},this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>this.editor.hasWidgetFocus(),this.contains=a=>this.pane!=null&&this.pane.input===a,this.moveEditor=Rt,this.moveEditors=Rt,this.copyEditor=Rt,this.copyEditors=Rt,this.closeEditor=Rt,this.closeEditors=Rt,this.closeAllEditors=Rt,this.replaceEditors=Rt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=Rt,this.isLast=Rt;const s=a=>{const c=t.createInstance(AM,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new V7e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},o=a=>{if(this.pane!=null&&this.pane.input.resource.toString()===a.toString()){const c=this.pane;this.pane=void 0,this._onDidModelChange.fire({kind:6,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:void 0}),this._onDidCloseEditor.fire({context:mx.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&s(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&o(a.uri)}});const r=e.getModel();if(r!=null){const a=t.createInstance(AM,r.uri,void 0,void 0,void 0,void 0);this.pane=new V7e(e,a,this)}}get groupsView(){return Rt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:T.None}}get titleHeight(){return Rt()}setActive(e){this.active=e}get element(){return this.editor.getContainerDomNode()}get activeEditorPane(){return this.pane}get activeEditor(){return this.pane?.input??null}get count(){return this.pane!=null?1:0}get isEmpty(){return this.pane==null}get editors(){return this.pane!=null?[this.pane.input]:[]}focus(){this.editor.focus(),this.editor.getContainerDomNode().scrollIntoView()}};Cre.idCounter=0;Cre=xLe=D([_(1,be),_(2,Pe)],Cre);let kLe=class extends ${constructor(e,t,i){super(),this.delegate=e,this._serviceBrand=void 0,this.additionalGroups=[],this.activeGroupOverride=void 0,this.onDidCreateAuxiliaryEditorPart=this.delegate.onDidCreateAuxiliaryEditorPart,this.onDidChangeGroupMaximized=this.delegate.onDidChangeGroupMaximized,this._onDidChangeActiveGroup=new I,this.onDidChangeActiveGroup=T.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=T.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=T.any(this._onDidRemoveGroup.event,this.delegate.onDidRemoveGroup),this.onDidMoveGroup=this.delegate.onDidMoveGroup,this.onDidActivateGroup=this.delegate.onDidActivateGroup,this.onDidChangeGroupIndex=this.delegate.onDidChangeGroupIndex,this.onDidChangeGroupLocked=this.delegate.onDidChangeGroupLocked,this.getLayout=()=>this.delegate.getLayout(),this.getGroups=s=>[...this.delegate.getGroups(s),...this.additionalGroups],this.getGroup=s=>this.delegate.getGroup(s)??this.additionalGroups.find(o=>o.id===s),this.activateGroup=(...s)=>this.delegate.activateGroup(...s),this.getSize=(...s)=>this.delegate.getSize(...s),this.setSize=(...s)=>this.delegate.setSize(...s),this.arrangeGroups=(...s)=>this.delegate.arrangeGroups(...s),this.applyLayout=(...s)=>this.delegate.applyLayout(...s),this.setGroupOrientation=(...s)=>this.delegate.setGroupOrientation(...s),this.findGroup=(...s)=>this.delegate.findGroup(...s),this.addGroup=(...s)=>this.delegate.addGroup(...s),this.removeGroup=(...s)=>this.delegate.removeGroup(...s),this.moveGroup=(...s)=>this.delegate.moveGroup(...s),this.mergeGroup=(...s)=>this.delegate.mergeGroup(...s),this.mergeAllGroups=(...s)=>this.delegate.mergeAllGroups(...s),this.copyGroup=(...s)=>this.delegate.copyGroup(...s),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const s=Lt.get(jt),o=a=>{if(a instanceof mF){let c;const l=p=>{const m=p!=null?this.additionalGroups.find(v=>v.editor===p):void 0;this.activeGroupOverride!==m&&(this.activeGroupOverride=m,this._onDidChangeActiveGroup.fire(this.activeGroup))},d=p=>{!t&&this.activeGroupOverride===this.additionalGroups.find(m=>m.editor===p)&&l(void 0)},h=()=>{c!=null&&window.clearTimeout(c),l(a)},u=()=>{c!=null&&window.clearTimeout(c),c=window.setTimeout(()=>{c=void 0,d(a)},100)};a.onDidDispose(()=>{d(a)}),a.onDidFocusEditorText(h),a.onDidFocusEditorWidget(h),a.onDidBlurEditorText(u),a.onDidBlurEditorWidget(u),a.hasWidgetFocus()&&h();const f=i.createInstance(Cre,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof mF){const c=this.additionalGroups.find(l=>l.editor===a);c!=null&&(c.dispose(),this.activeGroupOverride===c&&(this.activeGroupOverride=void 0,this._onDidChangeActiveGroup.fire(this.activeGroup)),this.additionalGroups=this.additionalGroups.filter(l=>l!==c),this._onDidRemoveGroup.fire(c))}};this._register(s.onCodeEditorAdd(o)),this._register(s.onCodeEditorRemove(r)),s.listCodeEditors().forEach(o)})}registerContextKeyProvider(e){return this.delegate.registerContextKeyProvider(e)}saveWorkingSet(e){return this.delegate.saveWorkingSet(e)}getWorkingSets(){return this.delegate.getWorkingSets()}applyWorkingSet(e){return this.delegate.applyWorkingSet(e)}deleteWorkingSet(e){return this.delegate.deleteWorkingSet(e)}get isReady(){return this.delegate.isReady}get whenReady(){return this.delegate.whenReady}get whenRestored(){return this.delegate.whenRestored}get hasRestorableState(){return this.delegate.hasRestorableState}get parts(){return this.delegate.parts}createAuxiliaryEditorPart(e){return this.delegate.createAuxiliaryEditorPart(e)}get mainPart(){return this.delegate.mainPart}getPart(e){return this.delegate.getPart(e)}toggleMaximizeGroup(e){return this.delegate.toggleMaximizeGroup(e)}toggleExpandGroup(e){return this.delegate.toggleExpandGroup(e)}createEditorDropTarget(e,t){return this.delegate.createEditorDropTarget(e,t)}get groups(){return[...this.additionalGroups,...this.delegate.groups]}get activeGroup(){return this.activeGroupOverride??this.delegate.activeGroup}get sideGroup(){return this.delegate.sideGroup}get count(){return this.delegate.count+this.additionalGroups.length}get orientation(){return this.delegate.orientation}get partOptions(){return this.delegate.partOptions}};kLe=D([_(2,be)],kLe);var jH;let yre=(jH=class extends ${constructor(e,t,i,s,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=s,this.workingCopyService=o,this.logService=r,this.markerService=a,this.uriIdentityService=c,this.scheduledAutoSavesAfterDelay=new Map,this.lastActiveEditor=void 0,this.lastActiveGroupId=void 0,this.lastActiveEditorControlDisposable=this._register(new Z),this.waitingOnConditionAutoSaveWorkingCopies=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new wi(l=>this.uriIdentityService.extUri.getComparisonKey(l));for(const l of this.workingCopyService.dirtyWorkingCopies)this.onDidRegister(l);this.registerListeners()}registerListeners(){this._register(this.hostService.onDidChangeFocus(e=>this.onWindowFocusChange(e))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChange())),this._register(this.editorService.onDidActiveEditorChange(()=>this.onDidActiveEditorChange())),this._register(this.filesConfigurationService.onDidChangeAutoSaveConfiguration(()=>this.onDidChangeAutoSaveConfiguration())),this._register(this.workingCopyService.onDidRegister(e=>this.onDidRegister(e))),this._register(this.workingCopyService.onDidUnregister(e=>this.onDidUnregister(e))),this._register(this.workingCopyService.onDidChangeDirty(e=>this.onDidChangeDirty(e))),this._register(this.workingCopyService.onDidChangeContent(e=>this.onDidChangeContent(e))),this._register(this.markerService.onMarkerChanged(e=>this.onConditionChanged(e,Kf.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Kf.DISABLED)))}onConditionChanged(e,t){for(const i of e){const s=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(s?.condition===t)s.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(s.workingCopy.resource,s.reason).mode!==Vc.OFF&&(this.discardAutoSave(s.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",s.workingCopy.resource.toString(),s.workingCopy.typeId),s.workingCopy.save({reason:s.reason}));else{const o=this.waitingOnConditionAutoSaveEditors.get(i);o?.condition===t&&!o.editor.editor.isDisposed()&&o.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(o.editor.editor,o.reason).mode!==Vc.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${o.reason}`),this.editorService.save(o.editor,{reason:o.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Ln.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:this.lastActiveGroupId,editor:this.lastActiveEditor});const e=this.editorGroupService.activeGroup,t=this.lastActiveEditor=e.activeEditor??void 0;this.lastActiveGroupId=e.id,this.lastActiveEditorControlDisposable.clear();const i=this.editorService.activeEditorPane;t&&i&&this.lastActiveEditorControlDisposable.add(i.onDidBlur(()=>{this.maybeTriggerAutoSave(Ln.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Mi.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==Vc.OFF?(e===Ln.WINDOW_CHANGE&&(i.mode===Vc.ON_FOCUS_CHANGE||i.mode===Vc.ON_WINDOW_CHANGE)||e===Ln.FOCUS_CHANGE&&i.mode===Vc.ON_FOCUS_CHANGE)&&(this.logService.trace(`[editor auto save] triggering auto save with reason ${e}`),this.editorService.save(t,{reason:e})):t.editor.resource&&(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveEditors.set(t.editor.resource,{editor:t,reason:e,condition:i.reason})}else this.saveAllDirtyAutoSaveables(e)}onDidChangeAutoSaveConfiguration(){let e;switch(this.filesConfigurationService.getAutoSaveMode(void 0).mode){case Vc.ON_FOCUS_CHANGE:e=Ln.FOCUS_CHANGE;break;case Vc.ON_WINDOW_CHANGE:e=Ln.WINDOW_CHANGE;break;case Vc.AFTER_SHORT_DELAY:case Vc.AFTER_LONG_DELAY:e=Ln.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&JS.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==Vc.OFF?t.save({reason:e}):(i.reason===Kf.ERRORS||i.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(t.resource,{workingCopy:t,reason:e,condition:i.reason})}}onDidRegister(e){e.isDirty()&&this.scheduleAutoSave(e)}onDidUnregister(e){this.discardAutoSave(e)}onDidChangeDirty(e){e.isDirty()?this.scheduleAutoSave(e):this.discardAutoSave(e)}onDidChangeContent(e){e.isDirty()&&this.scheduleAutoSave(e)}scheduleAutoSave(e){if(e.capabilities&JS.Untitled)return;const t=this.filesConfigurationService.getAutoSaveConfiguration(e.resource).autoSaveDelay;if(typeof t!="number")return;this.discardAutoSave(e),this.logService.trace(`[editor auto save] scheduling auto save after ${t}ms`,e.resource.toString(),e.typeId);const i=setTimeout(()=>{if(this.discardAutoSave(e),e.isDirty()){const s=Ln.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,s);o.mode!==Vc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:s})):(o.reason===Kf.ERRORS||o.reason===Kf.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:s,condition:o.reason})}},t);this.scheduledAutoSavesAfterDelay.set(e,Ee(()=>{this.logService.trace("[editor auto save] clearing pending auto save",e.resource.toString(),e.typeId),clearTimeout(i)}))}discardAutoSave(e){St(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},jH.ID="workbench.contrib.editorAutoSave",jH);yre=D([_(0,hh),_(1,Id),_(2,_i),_(3,ur),_(4,Pw),_(5,Ze),_(6,U_),_(7,_o)],yre);gp(yre.ID,yre,Sl.BlockRestore);let ILe=class extends pL{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Js.binary}getName(){return this.name}getSize(){return this.size}getMime(){return this.mime}getETag(){return this.etag}async resolve(){if(this.fileService.hasProvider(this.resource)){const e=await this.fileService.stat(this.resource);this.etag=e.etag,typeof e.size=="number"&&(this.size=e.size)}return super.resolve()}};ILe=D([_(2,ci)],ILe);var LLe,ck;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Binary=2]="Binary"})(ck||(ck={}));let Sre=LLe=class extends Ib{get typeId(){return gst}get editorId(){return A_.id}get capabilities(){let e=Mi.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Mi.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Mi.Readonly):e|=Mi.Untitled,e&Mi.Readonly||(e|=Mi.CanDropIntoEditor),e}constructor(e,t,i,s,o,r,a,c,l,d,h,u,f,p,m,v,w){super(e,t,p,l,h,u,f,v,w),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=ck.None,this.model=void 0,this.cachedTextFileModelReference=void 0,this.modelListeners=this._register(new Z),this.model=this.textFileService.files.get(e),i&&this.setPreferredName(i),s&&this.setPreferredDescription(s),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(b=>this.onDidCreateTextFileModel(b))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){_n(e.resource,this.resource)&&(this.model=e,this.registerModelListeners(e))}registerModelListeners(e){this.modelListeners.clear(),this.modelListeners.add(e.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(e.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire())),this.modelListeners.add(e.onDidSaveError(()=>this._onDidChangeDirty.fire())),this.modelListeners.add(T.once(e.onWillDispose)(()=>{this.modelListeners.clear(),this.model=void 0}))}getName(){return this.preferredName||super.getName()}setPreferredName(e){this.allowLabelOverride()&&this.preferredName!==e&&(this.preferredName=e,this._onDidChangeLabel.fire())}allowLabelOverride(){return this.resource.scheme!==this.pathService.defaultUriScheme&&this.resource.scheme!==_e.vscodeUserData&&this.resource.scheme!==_e.file&&this.resource.scheme!==_e.vscodeRemote}getPreferredName(){return this.preferredName}isReadonly(){return this.model?this.model.isReadonly():this.filesConfigurationService.isReadonly(this.resource)}getDescription(e){return this.preferredDescription||super.getDescription(e)}setPreferredDescription(e){this.allowLabelOverride()&&this.preferredDescription!==e&&(this.preferredDescription=e,this._onDidChangeLabel.fire())}getPreferredDescription(){return this.preferredDescription}getTitle(e){let t=super.getTitle(e);const i=this.getPreferredTitle();return i&&(t=`${i} (${t})`),t}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getEncoding(){return this.model?this.model.getEncoding():this.preferredEncoding}getPreferredEncoding(){return this.preferredEncoding}async setEncoding(e,t){return this.setPreferredEncoding(e),this.model?.setEncoding(e,t)}setPreferredEncoding(e){this.preferredEncoding=e,this.setForceOpenAsText()}getLanguageId(){return this.model?this.model.getLanguageId():this.preferredLanguageId}getPreferredLanguageId(){return this.preferredLanguageId}setLanguageId(e,t){this.setPreferredLanguageId(e),this.model?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e,this.setForceOpenAsText()}setPreferredContents(e){this.preferredContents=e,this.setForceOpenAsText()}setForceOpenAsText(){this.forceOpenAs=ck.Text}setForceOpenAsBinary(){this.forceOpenAs=ck.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(uu.SAVED)||this.model?.hasState(uu.CONFLICT)||this.model?.hasState(uu.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===ck.Binary?e.find(t=>t.typeId===P5t):e.find(t=>t.typeId===ust)}resolve(e){return this.forceOpenAs===ck.Binary?this.doResolveAsBinary():this.doResolveAsText(e)}async doResolveAsText(e){try{const t=this.preferredContents;this.preferredContents=void 0,await this.textFileService.files.resolve(this.resource,{languageId:this.preferredLanguageId,encoding:this.preferredEncoding,contents:typeof t=="string"?hde(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===ck.Text,reason:Zte.EDITOR,limits:this.ensureLimits(e)}),this.cachedTextFileModelReference||(this.cachedTextFileModelReference=await this.textModelService.createModelReference(this.resource));const i=this.cachedTextFileModelReference.object;return this.isDisposed()&&this.disposeModelReference(),i}catch(t){if(t.textFileOperationResult===xV.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(ILe,this.preferredResource,this.getName());return await e.resolve(),e}isResolved(){return!!this.model}async rename(e,t){return{editor:{resource:t,encoding:this.getEncoding(),options:{viewState:qW(this,e,this.editorService)}}}}toUntyped(e){const t={resource:this.preferredResource,forceFile:!0,options:{override:this.editorId}};return typeof e?.preserveViewState=="number"&&(t.encoding=this.getEncoding(),t.languageId=this.getLanguageId(),t.contents=(()=>{const i=this.textFileService.files.get(this.resource);if(i?.isDirty()&&!i.textEditorModel.isTooLargeForHeapOperation())return i.textEditorModel.getValue()})(),t.options={...t.options,viewState:qW(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof LLe?_n(e.resource,this.resource):wb(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){St(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Sre=LLe=D([_(7,be),_(8,tr),_(9,Rn),_(10,eo),_(11,ci),_(12,hh),_(13,_i),_(14,Lm),_(15,dl),_(16,aD)],Sre);it.as(zS.EditorFactory).registerFileEditorFactory({typeId:gst,createFileEditor:(n,e,t,i,s,o,r,a)=>a.createInstance(Sre,n,e,t,i,s,o,r),isFileEditor:n=>n instanceof Sre});function Gei(n,e){const t=n.lastFocusedList,i=t?.getHTMLElement();if(i&&kw(i)&&t instanceof Pc){const s=Ui(t.getSelectedElements().filter(c=>c instanceof tne)),o=t.getFocusedElements(),r=o.length?o[0]:void 0;let a;return r instanceof tne&&(a=r),s.some(c=>c===a)?s:a?[a]:void 0}}const gme="vs/workbench/contrib/files/browser/fileCommands";async function GOe(n,e){const t=n.get(yf),i=n.get(ur),s=n.get(jt),o=n.get(tr);let r=Gei(t);if(!r){const c=i.activeGroup;c.activeEditor&&(r=[],c.activeEditor instanceof mm&&!e?.saveAs&&!(c.activeEditor.primary.hasCapability(Mi.Untitled)||c.activeEditor.secondary.hasCapability(Mi.Untitled))&&c.activeEditor.secondary.isModified()?(r.push({groupId:c.id,editor:c.activeEditor.primary}),r.push({groupId:c.id,editor:c.activeEditor.secondary})):r.push({groupId:c.id,editor:c.activeEditor}))}if(!r||r.length===0)return;await qOe(n,r,e);const a=s.getFocusedCodeEditor();if(a instanceof oC&&!a.isSimpleWidget){const c=a.getModel()?.uri;c&&!r.some(({editor:l})=>_n(jc.getCanonicalUri(l,{supportSideBySide:go.PRIMARY}),c))&&(o.files.get(c)?.isReadonly()||await o.save(c,e))}}function cat(n,e,t){const i=[];for(const s of e)for(const o of s.getEditors(eg.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:s.id,editor:o});return qOe(n,i,t)}async function qOe(n,e,t){const i=n.get(_i),s=n.get(Pi),o=n.get(be);try{await i.save(e,t)}catch(r){Na(r)||s.notify({id:e.map(({editor:a})=>Ed(a.resource?.toString())).join(),severity:nt.Error,message:g(gme,3,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Ma(r,!1)),actions:{primary:[_l({id:"workbench.action.files.saveEditors",label:g(gme,4,"Retry"),run:()=>o.invokeFunction(a=>qOe(a,e,t))}),_l({id:"workbench.action.files.revertEditors",label:g(gme,5,"Discard"),run:()=>i.revert(e)})]}})}}xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:V.CtrlCmd|E.KeyS,id:FOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:Br(V.CtrlCmd|E.KeyK,E.KeyS),win:{primary:Br(V.CtrlCmd|E.KeyK,V.CtrlCmd|V.Shift|E.KeyS)},id:OOt,handler:n=>GOe(n,{reason:Ln.EXPLICIT,force:!0,skipSaveParticipants:!0})});xr.registerCommandAndKeybindingRule({id:POt,weight:ye.WorkbenchContrib,when:void 0,primary:V.CtrlCmd|V.Shift|E.KeyS,handler:n=>GOe(n,{reason:Ln.EXPLICIT,saveAs:!0})});xr.registerCommandAndKeybindingRule({when:void 0,weight:ye.WorkbenchContrib,primary:void 0,mac:{primary:V.CtrlCmd|V.Alt|E.KeyS},win:{primary:Br(V.CtrlCmd|E.KeyK,E.KeyS)},id:BOt,handler:n=>cat(n,n.get(ur).getGroups(gg.MOST_RECENTLY_ACTIVE),{reason:Ln.EXPLICIT})});yt.registerCommand({id:rit,handler:(n,e,t)=>{const i=n.get(ur),s=c3t(t,n.get(yf),n.get(ur));let o;return s.length?o=Ui(s.map(r=>i.getGroup(r.groupId))):o=i.getGroups(gg.MOST_RECENTLY_ACTIVE),cat(n,o,{reason:Ln.EXPLICIT})}});yt.registerCommand({id:WOt,handler:async n=>(await n.get(_i).saveAll({includeUntitled:!1,reason:Ln.EXPLICIT})).success});class qei{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=yi.vscodeWindowId,this.onDidLayout=T.None,this.onDidScroll=T.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=Rt,this.isLayoutCentered=Rt,this.enforcePartOptions=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.onDidChangeGroupMaximized=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.applyLayout=Rt,this.getLayout=Rt,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.partOptions=Kde,this.onDidChangeEditorPartOptions=T.None,this.createEditorDropTarget=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}class Qei{constructor(){this.registerContextKeyProvider=Rt,this.saveWorkingSet=Rt,this.getWorkingSets=Rt,this.applyWorkingSet=Rt,this.deleteWorkingSet=Rt,this.onDidCreateAuxiliaryEditorPart=T.None,this.mainPart=new qei,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=Rt,this.createAuxiliaryEditorPart=Rt,this.onDidChangeGroupMaximized=T.None,this.toggleMaximizeGroup=Rt,this.toggleExpandGroup=Rt,this.partOptions=Kde,this.createEditorDropTarget=Rt,this._serviceBrand=void 0,this.getLayout=Rt,this.onDidChangeActiveGroup=T.None,this.onDidAddGroup=T.None,this.onDidRemoveGroup=T.None,this.onDidMoveGroup=T.None,this.onDidActivateGroup=T.None,this.onDidLayout=T.None,this.onDidScroll=T.None,this.onDidChangeGroupIndex=T.None,this.onDidChangeGroupLocked=T.None,this.activeGroup=dq,this.groups=[dq],this.count=0,this.orientation=0,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=Rt,this.getSize=Rt,this.setSize=Rt,this.arrangeGroups=Rt,this.applyLayout=Rt,this.centerLayout=Rt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=Rt,this.findGroup=()=>{},this.addGroup=Rt,this.removeGroup=Rt,this.moveGroup=Rt,this.mergeGroup=Rt,this.mergeAllGroups=Rt,this.copyGroup=Rt,this.onDidChangeEditorPartOptions=T.None,this.enforcePartOptions=Rt}get contentDimension(){return Rt()}get sideGroup(){return Rt()}}let TLe=class extends kLe{constructor(e){super(e.createInstance(Qei),!0,e)}};TLe=D([_(0,be)],TLe);function jei(n){return{[jt.toString()]:new Gi(CLe,void 0,!0),[_i.toString()]:new Gi(DLe,[n,()=>!1],!0),[rhe.toString()]:new Gi(yLe,[],!1),[ur.toString()]:new Gi(TLe)}}const Kei="vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions",lat={category:Be(Kei,0,"Snippets")};class dat extends pi{constructor(e){super({...lat,...e})}}class hat extends wf{constructor(e){super({...lat,...e})}}const lu="vs/workbench/contrib/snippets/browser/commands/configureSnippets";var RLe;(function(n){function e(t){return!!t&&P.isUri(t.filepath)}n.is=e})(RLe||(RLe={}));async function Yei(n,e,t,i){const s=[],o=[],r=new Set,a=new Map;for(const l of await n.getSnippetFiles())if(l.source!==Yg.Extension)if(l.isGlobalSnippets){await l.load();const d=new Set;let h;e:for(const m of l.data){h||(h=m.source);for(const v of m.scopes){const w=t.getLanguageName(v);if(w)if(d.size>=4){d.add(`${w}...`);break e}else d.add(w)}}const u={label:ui(l.location),filepath:l.location,description:d.size===0?g(lu,0,"(global)"):g(lu,1,"({0})",[...d].join(", "))};if(s.push(u),!h)continue;const f=g(lu,2,"({0}) {1}",h,i.getUriLabel(l.location,{relative:!0})),p=a.get(ui(l.location));p&&(u.detail=f,p.snippet.detail=p.detail),a.set(ui(l.location),{snippet:u,detail:f})}else{const d=ui(l.location).replace(/\.json$/,"");s.push({label:ui(l.location),description:`(${t.getLanguageName(d)})`,filepath:l.location}),r.add(d)}const c=e.currentProfile.snippetsHome;for(const l of t.getRegisteredLanguageIds()){const d=t.getLanguageName(l);d&&!r.has(l)&&o.push({label:l,description:`(${d})`,filepath:Qt(c,`${l}.json`),hint:!0})}return s.sort((l,d)=>{const h=T_(l.filepath.path),u=T_(d.filepath.path);return h===u?l.label.localeCompare(d.label):h===".code-snippets"?-1:1}),o.sort((l,d)=>l.label.localeCompare(d.label)),{existing:s,future:o}}async function z7e(n,e,t,i,s,o){function r(l){const d=T_(l)!==".code-snippets"?`${l}.code-snippets`:l;return Qt(e,d)}await i.createFolder(e);const a=await t.input({placeHolder:g(lu,3,"Type snippet file name"),async validateInput(l){if(!l)return g(lu,4,"Invalid file name");if(!VQe(l))return g(lu,5,"'{0}' is not a valid file name",l);if(await i.exists(r(l)))return g(lu,6,"'{0}' already exists",l)}});if(!a)return;const c=r(a);await s.write(c,["{"," // Place your "+n+" snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and "," // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope "," // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is "," // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: "," // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. "," // Placeholders with the same ids are connected."," // Example:",' // "Print to console": {',' // "scope": "javascript,typescript",',' // "prefix": "log",',' // "body": [',` // "console.log('$1');",`,' // "$2"'," // ],",' // "description": "Log output to console"'," // }","}"].join(` `)),await o.open(c)}async function Jei(n,e,t){if(await e.exists(n.filepath))return;const i=["{"," // Place your snippets for "+n.label+" here. Each snippet is defined under a snippet name and has a prefix, body and "," // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:"," // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the "," // same ids are connected."," // Example:",' // "Print to console": {',' // "prefix": "log",',' // "body": [',` // "console.log('$1');",`,' // "$2"'," // ],",' // "description": "Log output to console"'," // }","}"].join(` -`);await t.write(n.filepath,i)}class Xei extends dat{constructor(){super({id:"workbench.action.openSnippets",title:Be(lu,7,"Configure User Snippets"),shortTitle:{...Be(lu,8,"User Snippets"),mnemonicTitle:g(lu,9,"User &&Snippets")},f1:!0,menu:[{id:Te.MenubarPreferencesMenu,group:"2_configuration",order:5},{id:Te.GlobalActivity,group:"2_configuration",order:5}]})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(fr),o=e.get(Di),r=e.get(Tm),a=e.get(Ti),c=e.get(ci),l=e.get(tr),d=e.get(eo),h=await Yei(t,r,o,d),u=h.existing,f=[{scope:g(lu,10,"global"),label:g(lu,11,"New Global Snippets file..."),uri:r.currentProfile.snippetsHome}],p=[];for(const v of a.getWorkspace().folders)p.push({scope:g(lu,12,"{0} workspace",v.name),label:g(lu,13,"New Snippets file for '{0}'...",v.name),uri:v.toResource(".vscode")});u.length>0?(u.unshift({type:"separator",label:g(lu,14,"Existing Snippets")}),u.push({type:"separator",label:g(lu,15,"New Snippets")})):u.push({type:"separator",label:g(lu,15,"New Snippets")});const m=await i.pick([].concat(u,f,p,h.future),{placeHolder:g(lu,16,"Select Snippets File or Create Snippets"),matchOnDescription:!0});if(f.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(p.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(RLe.is(m))return m.hint&&await Jei(m,c,l),s.open(m.filepath)}}const $7e="vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets",l9=class l9 extends dat{constructor(){super({id:l9.Id,title:Be($7e,0,"Fill File with Snippet"),f1:!0})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(_i),o=e.get(Di),r=_z(s.activeTextEditorControl);if(!r||!r.hasModel())return;const a=await t.getSnippets(void 0,{fileTemplateSnippets:!0,noRecencySort:!0,includeNoPrefixSnippets:!0});if(a.length===0)return;const c=await this._pick(i,o,a);c&&r.hasModel()&&(pc.get(r)?.apply([{range:r.getModel().getFullModelRange(),template:c.snippet.body}]),r.getModel().setLanguage(o.createById(c.langId),l9.Id),r.focus())}async _pick(e,t,i){const s=[];for(const c of i)if(iO(c.scopes))s.push({langId:"",snippet:c});else for(const l of c.scopes)s.push({langId:l,snippet:c});const o=[],r=yU(s,(c,l)=>lw(c.langId,l.langId));for(const c of r){let l=!0;for(const d of c)l&&(o.push({type:"separator",label:t.getLanguageName(d.langId)??d.langId}),l=!1),o.push({snippet:d,label:d.snippet.prefix||d.snippet.name,detail:d.snippet.description})}return(await e.pick(o,{placeHolder:g($7e,1,"Select a snippet"),matchOnDetail:!0}))?.snippet}};l9.Id="workbench.action.populateFileFromSnippet";let Are=l9;const PL="vs/workbench/contrib/snippets/browser/snippetPicker";async function uat(n,e){const t=n.get($_),i=n.get(On);let s;Array.isArray(e)?s=e:s=await t.getSnippets(e,{includeDisabledSnippets:!0,includeNoPrefixSnippets:!0}),s.sort((c,l)=>c.snippetSource-l.snippetSource);const o=()=>{const c=[];let l;for(const d of s){const h={label:d.prefix||d.name,detail:d.description||d.body,snippet:d};if(!l||l.snippetSource!==d.snippetSource||l.source!==d.source){let u="";switch(d.snippetSource){case Yg.User:u=g(PL,0,"User Snippets");break;case Yg.Extension:u=d.source;break;case Yg.Workspace:u=g(PL,1,"Workspace Snippets");break}c.push({type:"separator",label:u})}d.snippetSource===Yg.Extension&&(t.isEnabled(d)?h.buttons=[{iconClass:$e.asClassName(Ce.eyeClosed),tooltip:g(PL,2,"Hide from IntelliSense")}]:(h.description=g(PL,3,"(hidden from IntelliSense)"),h.buttons=[{iconClass:$e.asClassName(Ce.eye),tooltip:g(PL,4,"Show in IntelliSense")}])),c.push(h),l=d}return c},r=i.createQuickPick();r.placeholder=g(PL,5,"Select a snippet"),r.matchOnDetail=!0,r.ignoreFocusOut=!1,r.keepScrollPosition=!0,r.onDidTriggerItemButton(c=>{const l=t.isEnabled(c.item.snippet);t.updateEnablement(c.item.snippet,!l),r.items=o()}),r.items=o(),r.items.length||(r.validationMessage=g(PL,6,"No snippet available")),r.show(),await Promise.race([T.toPromise(r.onDidAccept),T.toPromise(r.onDidHide)]);const a=r.selectedItems[0]?.snippet;return r.dispose(),a}const Zei="vs/workbench/contrib/snippets/browser/commands/insertSnippet",vW=class vW{static fromUser(e){if(!e||typeof e!="object")return vW._empty;let{snippet:t,name:i,langId:s}=e;return typeof t!="string"&&(t=void 0),typeof i!="string"&&(i=void 0),typeof s!="string"&&(s=void 0),new vW(t,i,s)}constructor(e,t,i){this.snippet=e,this.name=t,this.langId=i}};vW._empty=new vW(void 0,void 0,void 0);let MLe=vW;class eti extends hat{constructor(){super({id:"editor.action.insertSnippet",title:Be(Zei,0,"Insert Snippet"),f1:!0,precondition:X.writable,metadata:{description:"Insert Snippet",args:[{name:"args",schema:{type:"object",properties:{snippet:{type:"string"},langId:{type:"string"},name:{type:"string"}}}}]}})}async runEditorCommand(e,t,i){const s=e.get(Di),o=e.get($_);if(!t.hasModel())return;const r=e.get(Mu),a=e.get(be),c=await new Promise((d,h)=>{const{lineNumber:u,column:f}=t.getPosition(),{snippet:p,name:m,langId:v}=MLe.fromUser(i);if(p)return d(new iFe(!1,[],"","","",p,"",Yg.User,`random/${Math.random()}`));let w;if(v){if(!s.isRegisteredLanguageId(v))return d(void 0);w=v}else t.getModel().tokenization.tokenizeIfCheap(u),w=t.getModel().getLanguageIdAtPosition(u,f),s.getLanguageName(w)||(w=t.getModel().getLanguageId());m?o.getSnippets(w,{includeNoPrefixSnippets:!0}).then(b=>b.find(C=>C.name===m)).then(d,h):d(a.invokeFunction(uat,w))});if(!c)return;let l;c.needsClipboard&&(l=await r.readText()),t.focus(),pc.get(t)?.insert(c.codeSnippet,{clipboardText:l}),o.updateUsageTimestamp(c)}}const tti="vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet";async function gat(n,e,t,i){const{lineNumber:s,column:o}=t;e.tokenization.tokenizeIfCheap(s);const r=e.getLanguageIdAtPosition(s,o);return(await n.getSnippets(r,{includeNoPrefixSnippets:!0,includeDisabledSnippets:i})).filter(c=>c.usesSelection)}const fle=class fle extends hat{constructor(){super({...fle.options,precondition:ge.and(X.writable,X.hasNonEmptySelection),f1:!0})}async runEditorCommand(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get($_),o=e.get(Mu),r=await gat(s,t.getModel(),t.getPosition(),!0);if(!r.length)return;const a=await i.invokeFunction(uat,r);if(!a)return;let c;a.needsClipboard&&(c=await o.readText()),t.focus(),pc.get(t)?.insert(a.codeSnippet,{clipboardText:c}),s.updateUsageTimestamp(a)}};fle.options={id:"editor.action.surroundWithSnippet",title:Be(tti,0,"Surround with Snippet...")};let hq=fle;var VX,zX;const Ere="vs/workbench/contrib/snippets/browser/snippetCodeActionProvider";var X0;let NLe=(X0=class{constructor(e){this._snippetService=e}async provideCodeActions(e,t){if(t.isEmpty())return;const i=mt.isISelection(t)?t.getPosition():t.getStartPosition(),s=await gat(this._snippetService,e,i,!1);if(!s.length)return;const o=[];for(const r of s){if(o.length>=VX._MAX_CODE_ACTIONS){o.push(VX._overflowCommandCodeAction);break}o.push({title:g(Ere,1,"{0}",r.name),kind:ls.SurroundWith.value,edit:fat(e,t,r)})}return{actions:o,dispose(){}}}},VX=X0,X0._MAX_CODE_ACTIONS=4,X0._overflowCommandCodeAction={kind:ls.SurroundWith.value,title:g(Ere,0,"More..."),command:{id:hq.options.id,title:hq.options.title.value}},X0);NLe=VX=D([_(0,$_)],NLe);var Z0;let PLe=(Z0=class{constructor(e){this._snippetService=e,this.providedCodeActionKinds=[ls.SurroundWith.value]}async provideCodeActions(e){if(e.getValueLength()!==0)return;const t=await this._snippetService.getSnippets(e.getLanguageId(),{fileTemplateSnippets:!0,includeNoPrefixSnippets:!0}),i=[];for(const s of t){if(i.length>=zX._MAX_CODE_ACTIONS){i.push(zX._overflowCommandCodeAction);break}i.push({title:g(Ere,3,"Start with: {0}",s.name),kind:ls.SurroundWith.value,edit:fat(e,e.getFullModelRange(),s)})}return{actions:i,dispose(){}}}},zX=Z0,Z0._MAX_CODE_ACTIONS=4,Z0._overflowCommandCodeAction={title:g(Ere,2,"Start with Snippet"),kind:ls.SurroundWith.value,command:{id:Are.Id,title:""}},Z0);PLe=zX=D([_(0,$_)],PLe);function fat(n,e,t){return{edits:[{versionId:n.getVersionId(),resource:n.uri,textEdit:{range:e,text:t.body,insertAsSnippet:!0}}]}}let FLe=class{constructor(e,t,i){this._store=new Z;const s="editor.snippets.codeActions.enabled",o=new Z,r=()=>{o.clear(),i.getValue(s)&&(o.add(t.codeActionProvider.register("*",e.createInstance(NLe))),o.add(t.codeActionProvider.register("*",e.createInstance(PLe))))};r(),this._store.add(i.onDidChangeConfiguration(a=>a.affectsConfiguration(s)&&r())),this._store.add(o)}dispose(){this._store.dispose()}};FLe=D([_(0,be),_(1,ht),_(2,Re)],FLe);const cS="vs/workbench/contrib/snippets/browser/snippets.contribution";At(eti);yt.registerCommandAlias("editor.action.showSnippets","editor.action.insertSnippet");At(hq);At(Are);At(Xei);const iti=it.as(pf.Workbench);iti.registerWorkbenchContribution(FLe,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.snippets.codeActions.enabled":{description:g(cS,0,"Controls if surround-with-snippets or file template snippets show as Code Actions."),type:"boolean",default:!0}}});const pat="vscode://schemas/snippets",mat={prefix:{description:g(cS,1,"The prefix to use when selecting the snippet in intellisense"),type:["string","array"]},isFileTemplate:{description:g(cS,2,"The snippet is meant to populate or replace a whole file"),type:"boolean"},body:{markdownDescription:g(cS,3,"The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`."),type:["string","array"],items:{type:"string"}},description:{description:g(cS,4,"The snippet description."),type:["string","array"]}},nti={id:pat,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{prefix:"${2:prefix}",body:"${3:snippet}",description:"${4:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:mat,additionalProperties:!1}},_at="vscode://schemas/global-snippets",sti={id:_at,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{scope:"${2:scope}",prefix:"${3:prefix}",body:"${4:snippet}",description:"${5:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:{...mat,scope:{description:g(cS,7,"A list of language names to which this snippet applies, e.g. 'typescript,javascript'."),type:"string"}},additionalProperties:!1}},vat=it.as(eL.JSONContribution);vat.registerSchema(pat,nti);vat.registerSchema(_at,sti);P4t(async n=>{n.get(mg).when(2).then(()=>{Lt.get($_)})});function oti(){return{...lOe(),[$_.toString()]:new $i(Oye,[],!0)}}var OLe,YP;let BLe=(YP=class extends ZU{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:OLe.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new sd,this.profileStorageProfile=this.userDataProfileService.currentProfile,this.profileStorageDisposables=this._register(new Z),this.workspaceStorageDisposables=this._register(new Z),this.registerListeners()}registerListeners(){this._register(this.userDataProfileService.onDidChangeCurrentProfile(e=>e.join(this.switchToProfile(e.profile))))}async doInitialize(){await ko.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await M8.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new fx(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.APPLICATION,t))),await this.applicationStorage.init(),this.updateIsNew(this.applicationStorage),this.applicationStoragePromise.complete({indexedDb:e,storage:this.applicationStorage})}async createProfileStorage(e){if(this.profileStorageDisposables.clear(),this.profileStorageProfile=e,bbe(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(s=>this.emitDidChangeValue(ke.PROFILE,s)))}else{const t=await M8.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new fx(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(ke.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await M8.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new fx(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(pJ);t===void 0?e.set(pJ,!0):t&&e.set(pJ,!1)}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return this.applicationStorageDatabase?.name;case ke.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=ws(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,ws(this.profileStorage),ke.PROFILE)}async switchToWorkspace(e,t){const i=ws(this.workspaceStorage),s=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(s,ws(this.workspaceStorage),ke.WORKSPACE)}shouldFlushWhenIdle(){return ax().document.hasFocus()&&!this.hasPendingUpdate}close(){TS&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE]){for(const t of[ln.USER,ln.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await ko.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return ZJe(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},OLe=YP,YP.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,YP);BLe=OLe=D([_(2,Ze)],BLe);class rti extends fJ{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Qm=class Qm extends ${static async createApplicationStorage(e){return Qm.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Qm.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Qm.create({id:e},t)}static async create(e,t){try{const i=new Qm(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Ma(i,!0)}`),new rti}}get hasPendingUpdate(){return!!this.pendingUpdate}constructor(e,t){super(),this.logService=t,this._onDidChangeItemsExternal=this._register(new I),this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event,this.pendingUpdate=void 0,this.name=`${Qm.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new iOe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{ADt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await PT.create(this.name,void 0,[Qm.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Ma(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Qm.STORAGE_OBJECT_STORE,t)}async updateItems(e){let t=!1;this.pendingUpdate=this.doUpdateItems(e);try{t=await this.pendingUpdate}finally{this.pendingUpdate=void 0}if(this.broadcastChannel&&t){const i={changed:e.insert,deleted:e.delete};this.broadcastChannel.postData(i)}}async doUpdateItems(e){const t=e.insert,i=e.delete;return!t&&!i||t?.size===0&&i?.size===0?!1:(await(await this.whenConnected).runInTransaction(Qm.STORAGE_OBJECT_STORE,"readwrite",o=>{const r=[];if(t)for(const[a,c]of t)r.push(o.put(c,a));if(i)for(const a of i)r.push(o.delete(a));return r}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(Qm.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Qm.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Qm.STORAGE_OBJECT_STORE="ItemTable";let M8=Qm;var NC;const ati=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var JP;let xre=(JP=class extends ${static toKey(e){return`extensionKeys/${lte(e.id)}@${e.version}`}static fromKey(e){const t=ati.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),s=[];for(const[o,r]of NC.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>uc(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&s.push(NC.toKey({id:o,version:c}))}for(const o of s)t.remove(o,ke.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(ke.PROFILE,ln.MACHINE);for(const s of i){const o=NC.fromKey(s);if(o){let r=t.get(o.id.toLowerCase());r||t.set(o.id.toLowerCase(),r=[]),r.push(o.version)}}return t}constructor(e,t,i){super(),this.storageService=e,this.productService=t,this.logService=i,this._onDidChangeExtensionStorageToSync=this._register(new I),this.onDidChangeExtensionStorageToSync=this._onDidChangeExtensionStorageToSync.event,this.extensionsWithKeysForSync=NC.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this._register(new Z))(s=>this.onDidChangeStorageValue(s)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=NC.fromKey(e.key);if(t){if(this.storageService.get(e.key,ke.PROFILE)===void 0)this.extensionsWithKeysForSync.delete(t.id.toLowerCase());else{let i=this.extensionsWithKeysForSync.get(t.id.toLowerCase());i||this.extensionsWithKeysForSync.set(t.id.toLowerCase(),i=[]),i.push(t.version),this._onDidChangeExtensionStorageToSync.fire()}return}}getExtensionId(e){if(zt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return _F(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),s=this.getExtensionStateRaw(e,t);if(s)try{return JSON.parse(s)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),s=this.storageService.get(i,t?ke.PROFILE:ke.WORKSPACE);return s&&s?.length>NC.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${s.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),s}setExtensionState(e,t,i){const s=this.getExtensionId(e);t===void 0?this.storageService.remove(s,i?ke.PROFILE:ke.WORKSPACE):this.storageService.store(s,JSON.stringify(t),i?ke.PROFILE:ke.WORKSPACE,ln.MACHINE)}setKeysForSync(e,t){this.storageService.store(NC.toKey(e),JSON.stringify(t),ke.PROFILE,ln.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(NC.toKey(e),ke.PROFILE),s=i?JSON.parse(i):void 0;return s&&t?Lc([...s,...t]):s||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(s=>!s.includes(e)&&!s.includes(t));i.push([e,t]),this.migrationList=i}}getSourceExtensionToMigrate(e){const t=this.migrationList.find(([,i])=>e===i);return t?t[0]:void 0}get migrationList(){const e=this.storageService.get("extensionStorage.migrationList",ke.APPLICATION,"[]");try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return[]}set migrationList(e){e.length?this.storageService.store("extensionStorage.migrationList",JSON.stringify(e),ke.APPLICATION,ln.MACHINE):this.storageService.remove("extensionStorage.migrationList",ke.APPLICATION)}},NC=JP,JP.LARGE_STATE_WARNING_THRESHOLD=512*1024,JP);xre=NC=D([_(0,sn),_(1,Ja),_(2,Ze)],xre);var N8;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(N8||(N8={}));class fme extends fx{constructor(e,t){const i=t.read(e);if(super(new cti(e,t,i)),i!=null)for(const[s,o]of i)this.items.set(s,o)}}class cti{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??T.None}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t)),await this.provider.write(this.scope,this.items)}async close(){return this.provider.close?.(this.scope)}async optimize(){return this.provider.optimize?.(this.scope)}}class lti extends ZU{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new fme(N8.APPLICATION,this.provider)),this.profileStorage=this._register(new fme(N8.PROFILE,this.provider)),this.workspaceStorage=this._register(new fme(N8.WORKSPACE,this.provider)),this._register(this.workspaceStorage.onDidChangeStorage(i=>this.emitDidChangeValue(1,i))),this._register(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(0,i))),this._register(this.applicationStorage.onDidChangeStorage(i=>this.emitDidChangeValue(-1,i)))}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"External (application)";case 0:return"External (profile)";default:return"External (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(e){return!1}get(e,t,i){return this.getStorage(t).get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t).getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t).getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t).getObject(e,this.fallbackOverride?.[e]??i)}}VFe(async n=>{const e=n.get(sn),t=n.get(Id);e instanceof ZU&&(await e.initialize(),t.onDidChangeFocus(i=>{i||e.flush()}))});let WLe=class extends BLe{constructor(e,t,i){super(HFe(),t,i),this.fallbackOverride=e}get(e,t,i){return this.getStorage(t)?.get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,this.fallbackOverride?.[e]??i)}};WLe=D([_(1,Tm),_(2,Ze)],WLe);function dti({customProvider:n,fallbackOverride:e}={}){return n!=null?{[sn.toString()]:new $i(lti,[n,e],!0),[B7.toString()]:new $i(xre,[],!0)}:{[sn.toString()]:new $i(WLe,[e],!0),[B7.toString()]:new $i(xre,[],!0)}}class hti{constructor(){this._systemSchemes=new Set(Object.keys(_e)),this._providerInfo=new Map,this.extUri=new cO(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&es.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const Kz=ae("IExtHostFileSystemInfo");var PC;let HLe=PC=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new sMe,this._proxy=e.getProxy(Ue.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(s){try{let o;const r=i._fileSystemProvider.get(s.scheme);return r?(await i._proxy.$ensureActivation(s.scheme),o=await r.impl.stat(s)):o=await i._proxy.$stat(s),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===vm.Readonly?1:void 0}}catch(o){PC._handleError(o)}},async readDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readDirectory(s)).slice()):await i._proxy.$readdir(s)}catch(o){return PC._handleError(o)}},async createDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(o.impl,o.extUri,s)):await i._proxy.$mkdir(s)}catch(o){return PC._handleError(o)}},async readFile(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readFile(s)).slice()):(await i._proxy.$readFile(s)).buffer}catch(o){return PC._handleError(o)}},async writeFile(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(s)),await i._writeQueue.queueFor(s,()=>Promise.resolve(r.impl.writeFile(s,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(s,ze.wrap(o))}catch(r){return PC._handleError(r)}},async delete(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(s.scheme),await r.impl.delete(s,{recursive:!1,...o})):await i._proxy.$delete(s,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return PC._handleError(r)}},async rename(s,o,r){try{return await i._proxy.$rename(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},async copy(s,o,r){try{return await i._proxy.$copy(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},isWritableFileSystem(s){const o=t.getCapabilities(s);if(typeof o=="number")return!(o&es.Readonly)}})}async mkdirp(e,t,i){const s=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&an.Directory))throw Wl.FileExists(`Unable to create folder '${i.scheme===_e.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(w1(o)!==rt.FileNotFound)throw o;s.push(t.basename(i)),i=t.dirname(i)}for(let o=s.length-1;o>=0;o--){i=t.joinPath(i,s[o]);try{await e.createDirectory(i)}catch(r){if(w1(r)!==rt.FileExists)throw r}}}static _handleError(e){if(e instanceof Wl)throw e;if(e instanceof Nx)switch(e.code){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}if(!(e instanceof Error))throw new Wl(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Wl.Unavailable(e.message);switch(e.name){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?Fn:Gle,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Fn}};HLe=PC=D([_(0,gr),_(1,Kz)],HLe);const gue=ae("IExtHostConsumerFileSystem");class wat extends ude{get disposed(){return this._disposed}constructor(e,t,i,s,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=s,this.extension=o,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(r=>this.setLevel(r)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+` -`)}append(e){this.info(e)}clear(){const e=this.offset;this.logger.flush(),this.proxy.$update(this.id,aH.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,aH.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e=="boolean"?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=ze.fromString(t).byteLength,see(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,aH.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class uti extends wat{appendLine(e){this.append(e)}}let ULe=class{constructor(e,t,i,s,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=s,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Ue.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${Lnt(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(const[t,i]of this.channels)i.visible=t===this.visibleChannelId}createOutputChannel(e,t,i){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");const s=typeof t=="object"&&t.log,o=zt(t)?t:void 0;if(zt(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Cn.equals(i.identifier,l))?.[1];a&&(r=TYe(a));const c=s?this.doCreateLogOutputChannel(e,r,i):this.doCreateOutputChannel(e,o,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),s?this.createExtHostLogOutputChannel(e,r??this.logService.getLevel(),c):this.createExtHostOutputChannel(e,c)}async doCreateOutputChannel(e,t,i){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));const s=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(s,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),r=this.loggerService.createLogger(o,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,o,t,i.identifier.value);return new wat(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const s=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(s,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new uti(a,e,c,this.proxy,i)}createExtensionLogDirectory(e){let t=this.extensionLogDirectoryPromise.get(e.identifier.value);if(!t){const i=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,e.identifier.value);this.extensionLogDirectoryPromise.set(e.identifier.value,t=(async()=>{try{await this.extHostFileSystem.value.createDirectory(i)}catch(s){if(w1(s)!==rt.FileExists)throw s}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const s=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){s(),t.then(r=>r.append(o))},appendLine(o){s(),t.then(r=>r.appendLine(o))},clear(){s(),t.then(o=>o.clear())},replace(o){s(),t.then(r=>r.replace(o))},show(o,r){s(),t.then(a=>a.show(o,r))},hide(){s(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const s=new Z,o=()=>{if(s.isDisposed)throw new Error("Channel has been closed")},r=s.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{s.add(c),c.logLevel!==t&&a(c.logLevel),s.add(c.onDidChangeLogLevel(l=>a(l)))}),{...this.createExtHostOutputChannel(e,i),get logLevel(){return t},onDidChangeLogLevel:r.event,trace(c,...l){o(),i.then(d=>d.trace(c,...l))},debug(c,...l){o(),i.then(d=>d.debug(c,...l))},info(c,...l){o(),i.then(d=>d.info(c,...l))},warn(c,...l){o(),i.then(d=>d.warn(c,...l))},error(c,...l){o(),i.then(d=>d.error(c,...l))},dispose(){s.dispose()}}}};ULe=D([_(0,gr),_(1,Sg),_(2,gue),_(3,Kz),_(4,wp),_(5,Ze)],ULe);const bat=ae("IExtHostOutputService"),fue=ae("IURITransformerService");class gti{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}const fti="vs/workbench/api/common/extHostWorkspace";function uq(n,e,t){return new cO(i=>QOe(i,t)).isEqual(n,e)}function pti(n,e,t){return uq(n.uri,e.uri,t)?0:lw(n.uri.toString(),e.uri.toString())}function mti(n,e,t){return n.index!==e.index?n.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return UL(s,o,(r,a)=>t(r,a,i))}function QOe(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&es.PathCaseSensitive)}class lH extends kJe{static toExtHostWorkspace(e,t,i,s){if(!e)return{workspace:null,added:[],removed:[]};const{id:o,name:r,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,w)=>{const b=P.revive(v.uri),C=lH._findFolder(i||t,b,s);C?(C.name=v.name,C.index=v.index,h.push(C)):h.push({uri:b,name:v.name,index:w})}):h.push(...a.map(({uri:v,name:w,index:b})=>({uri:P.revive(v),name:w,index:b}))),h.sort((v,w)=>v.indexQOe(v,s)),{added:p,removed:m}=Cat(u?u.workspaceFolders:[],f.workspaceFolders,pti,s);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let s=0;snew Cde(c)),s,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Su.forUris(a),i.forEach(c=>{this._workspaceFolders.push(c),this._structure.set(c.uri,c)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=ma(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let VLe=class{constructor(e,t,i,s,o){this._onDidChangeWorkspace=new I,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new I,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new EI,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new dSt,this._barrier=new Uh,this._proxy=e.getProxy(Ue.MainThreadWorkspace),this._messageService=e.getProxy(Ue.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new lH(r.id,r.name,[],!!r.transient,r.configuration?P.revive(r.configuration):null,!!r.isUntitled,a=>QOe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?P.from({scheme:_e.untitled,path:ui(ma(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...s){const o=[];if(Array.isArray(s)&&s.forEach(d=>{P.isUri(d.uri)&&!o.some(h=>uq(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||Mx(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&o.length===0)return!1;const r=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>r.length)return!1;const a=r.slice(0);a.splice(t,i,...o.map(d=>({uri:d.uri,name:d.name||Mx(d.uri),index:void 0})));for(let d=0;df!==d&&uq(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=Cat(r,a,mti,this._extHostFileSystemInfo);if(c.length===0&&l.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,o).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(nt.Error,g(fti,0,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,s="";if(typeof e=="string"?(i=P.file(e),s=e):typeof e<"u"&&(i=e,s=e.fsPath),!i)return s;const o=this.getWorkspaceFolder(i,!0);if(!o)return s;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=lO(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=lH.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:s}=lH.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:s}))}findFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${s.value}, entryPoint: findFiles`);let r="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?r=t:r=t.pattern),this._findFilesImpl(e,void 0,{exclude:r,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},o)}findFiles2(e,t={},i,s=qe.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,s)}async _findFilesImpl(e,t,i,s=qe.None){if(s&&s.isCancellationRequested)return Promise.resolve([]);const o=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,r={ignoreSymlinks:typeof i.followSymlinks=="boolean"?!i.followSymlinks:void 0,disregardIgnoreFiles:typeof i.useIgnoreFiles=="boolean"?!i.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof i.useGlobalIgnoreFiles=="boolean"?!i.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof i.useParentIgnoreFiles=="boolean"?!i.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof i.useDefaultExcludes=="boolean"?!i.useDefaultExcludes:!1,disregardSearchExcludeSettings:typeof i.useDefaultSearchExcludes=="boolean"?!i.useDefaultSearchExcludes:!1,maxResults:i.maxResults,excludePattern:o,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=pme(Zp.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=pme(Zp.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,s).then(c=>Array.isArray(c)?c.map(l=>P.revive(l)):[])}async findTextInFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${s.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=pme(Zp.from(t.include)),d=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,h={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:a,afterContext:t.afterContext,beforeContext:t.beforeContext,includePattern:c,excludePattern:d};if(this._activeSearchCallbacks[r]=u=>{const f=P.revive(u.resource);u.results.forEach(p=>{const m=Or(p);q8t(m)?i({uri:f,preview:{text:m.preview.text,matches:u9(m.preview.matches,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:u9(m.ranges,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},o.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,r,o);return delete this._activeSearchCallbacks[r],u||{}}catch(u){throw delete this._activeSearchCallbacks[r],u}}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return P.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return P.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(s,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(s)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(P.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;const o=await s.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,s){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(P.revive(e));if(!o){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",o);const r=this._editSessionIdentityProviders.get(o.uri.scheme);if(this._logService.info(`Provider for scheme ${o.uri.scheme} is defined: `,!!r),!r)return;const a=await r.provideEditSessionIdentityMatch?.(t,i,s);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,s)}}async $onWillCreateEditSessionIdentity(e,t,i){const s=await this.resolveWorkspaceFolder(P.revive(e));if(s===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:s},t,async(o,r)=>{const a=Date.now();await Promise.resolve(o),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",r.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(s,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(s)})}async provideCanonicalUri(e,t,i){const s=this._canonicalUriProviders.get(e.scheme);if(!s)return;const o=await s.provideCanonicalUri?.(P.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(P.revive(e),{targetScheme:t},i)}};VLe=D([_(0,gr),_(1,Sg),_(2,Kz),_(3,Ze),_(4,fue)],VLe);const dD=ae("IExtHostWorkspace");function pme(n){let e,t;return n&&(typeof n=="string"?e=n:(e=n.pattern,t=P.revive(n.baseUri))),{includePattern:e,folder:t}}var j3,e1;let zLe=(e1=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Ue.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=j3._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const s=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=Kb(o);if(r.length<=j3._maxEventSize){this._proxy.$onDidChange(i,r);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,r.length);const a=r.map(d=>({uri:d,rank:Tlt(d.path,"/")})),c=yU(a,(d,h)=>d.rank-h.rank||lw(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=lS(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=j3._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new oo(()=>{s?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const s=Object.create(null),{provider:o,extensionDescription:r}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(o.provideFileDecoration(P.revive(c),i));if(!d)return;try{sG.validate(d),d.badge&&typeof d.badge!="string"&&Je(r,"codiconDecoration"),s[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${r.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),s}},j3=e1,e1._handlePool=0,e1._maxEventSize=250,e1);zLe=j3=D([_(0,gr),_(1,Ze)],zLe);const yat=ae("IExtHostDecorations");function z5(n,e){if(e){const t=e.split(".");let i=n;for(let s=0;i&&sthis._actual)}$initializeConfiguration(e){this._actual=new Cti(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};$Le=D([_(0,gr),_(1,dD),_(2,Ze)],$Le);class Cti{constructor(e,t,i,s){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=f7.parse(i,s),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=f7.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=G7e(t)||{},o=this._toReadonlyValue(e?z5(this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,s,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?Ot.USER:Ot.WORKSPACE;switch(c){case PM.Global:return Ot.USER;case PM.Workspace:return Ot.WORKSPACE;case PM.WorkspaceFolder:return Ot.WORKSPACE_FOLDER}}const a={has(c){return typeof z5(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,s,i?.identifier);let d=z5(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(fo(f)){let m;const v=()=>{h=h||Vs(o),m=m||z5(h,p)};return new Proxy(f,{get:(w,b)=>{if(typeof b=="string"&&b.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||z5(h,p),m[b];const C=w[b];return typeof b=="string"?u(C,`${p}.${b}`):C},set:(w,b,C)=>(v(),m&&(m[b]=C),!0),deleteProperty:(w,b)=>(v(),m&&delete m[b],!0),defineProperty:(w,b,C)=>(v(),m&&Object.defineProperty(m,b,C),!0)})}return Array.isArray(f)?Vs(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=r(d);return l!==void 0?this._proxy.$updateConfigurationOption(u,c,l,s,h):this._proxy.$removeConfigurationOption(u,c,s,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,s,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:Vs(l.policy?.value??l.default?.value),globalValue:Vs(l.user?.value??l.application?.value),workspaceValue:Vs(l.workspace?.value),workspaceFolderValue:Vs(l.workspaceFolder?.value),defaultLanguageValue:Vs(l.default?.override),globalLanguageValue:Vs(l.user?.override??l.application?.override),workspaceLanguageValue:Vs(l.workspace?.override),workspaceFolderLanguageValue:Vs(l.workspaceFolder?.override),languageIds:Vs(l.overrideIdentifiers)}}};return typeof o=="object"&&ym(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>fo(i)?new Proxy(i,{get:(s,o)=>t(s[o]),set:(s,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(s,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(s,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:s=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const s=dp.test(e)?ut.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(ut.RESOURCE===s){typeof t?.resource>"u"&&this._logService.warn(`${o}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(ut.WINDOW===s){t?.resource&&this._logService.warn(`${o}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new ANe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,o)=>i.affectsConfiguration(s,G7e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const hD=ae("IExtHostConfiguration"),FL=(n,e,t,i)=>{let s=e;return{enumerable:!0,configurable:!1,get(){return s},set(o){if(!t(s,o)){const r=s;s=o,n.listener?.(i(o,r))}}}},cB=(n,e)=>n===e,yD={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:cB,description:cB,sortText:cB,busy:cB,error:cB,canResolveChildren:cB,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},lB=n=>e=>({op:Mh.SetProp,update:n(e)}),yti=(n,e)=>({range:(()=>{let t;const i=lB(s=>({range:O.lift(at.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:Mh.DocumentSynced}),yD.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:FL(n,e,yD.label,lB(t=>({label:t}))),description:FL(n,void 0,yD.description,lB(t=>({description:t}))),sortText:FL(n,void 0,yD.sortText,lB(t=>({sortText:t}))),canResolveChildren:FL(n,!1,yD.canResolveChildren,t=>({op:Mh.UpdateCanResolveChildren,state:t})),busy:FL(n,!1,yD.busy,lB(t=>({busy:t}))),error:FL(n,void 0,yD.error,lB(t=>({error:Qs.fromStrict(t)||null}))),tags:FL(n,[],yD.tags,(t,i)=>({op:Mh.SetTags,new:t.map(hC.from),old:i.map(hC.from)}))}),Sti=n=>{const e=bn.fromString(n.extId),t=new MO(e.controllerId,e.localId,n.label,P.revive(n.uri)||void 0);return t.range=at.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>hC.to({id:nrt(i).tagId})),t},q7e=n=>{let e;for(const t of n.tests){const i=Sti(t.item);oue(i).parent=e,e=i}return e};class MO{constructor(e,t,i,s){if(t.includes(qf.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=lKt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:s,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof jOe?void 0:o.parent}},children:{value:cKt(o,oue,MO),enumerable:!0,writable:!1},...yti(o,i)})}}class jOe extends MO{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Ati extends oKt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:oue,getChildren:s=>s.children,root:new jOe(e,t),toITestItem:J1.from})}}const Eti="vs/workbench/api/common/extHostTelemetry";let GLe=class extends ${constructor(e,t){super(),this.initData=e,this.loggerService=t,this._onDidChangeTelemetryEnabled=this._register(new I),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new I),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=sp.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=P.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:_Tt,name:g(Eti,0,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{kYe(i)&&this.updateLoggerVisibility()})),this._outputLogger.info("Below are logs for extension telemetry events sent to the telemetry output channel API once the log level is set to trace."),this._outputLogger.info("===========================================================")}updateLoggerVisibility(){this.loggerService.setVisibility(this.extHostTelemetryLogFile,this._telemetryIsSupported&&this.loggerService.getLogLevel()===Pn.Trace)}getTelemetryConfiguration(){return this._level===sp.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=sp.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=sp.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=sp.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),o=new Sat(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:s.isUsageEnabled,isErrorsEnabled:s.isErrorsEnabled}),r=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...r,o]),o.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._telemetryIsSupported=t,this._productConfig=i??{usage:!0,error:!0},this.updateLoggerVisibility()}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.isnewappinstall"]=Aat(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case yw.Web:t["common.uikind"]="web";break;case yw.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=Wde(bTt(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,s)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(s):this._telemetryLoggers.set(s,o)}),this._telemetryLoggers.forEach(i=>{for(const s of i)s.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails()),this.updateLoggerVisibility()}onExtensionError(e,t){const s=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!s)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of s)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};GLe=D([_(0,Sg),_(1,wp)],GLe);class Sat{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,s,o,r,a){this._extension=i,this._logger=s,this._inLoggingOnlyMode=o,this._commonProperties=r,this._onDidChangeEnableStates=new I,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=mVe(t,[]),this._additionalCommonProperties&&(t=ym(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=ym(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},s=mVe(i,[]),o=new Error(s.message,{cause:s.cause});o.stack=s.stack,o.name=s.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(o,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function Aat(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const pue=ae("IExtHostTelemetry");var KA,bq,Cq,zqe;let qLe=(zqe=class{constructor(e,t,i){kt(this,KA);kt(this,bq);kt(this,Cq);this._commands=new Map,this._apiCommands=new Map,st(this,KA,e.getProxy(Ue.MainThreadCommands)),this._logService=t,st(this,Cq,i),st(this,bq,e.getProxy(Ue.MainThreadTelemetry)),this.converter=new xti(this,s=>{const o=this._apiCommands.get(s);return o?.result===In.Void?o:void 0},t),this._argumentProcessors=[{processArgument(s){return Or(s)}},{processArgument(s){return AU(s,function(o){if(O.isIRange(o))return at.to(o);if(oe.isIPosition(o))return Wr.to(o);if(O.isIRange(o.range)&&P.isUri(o.uri))return P_.to(o);if(o instanceof ze)return o.buffer.buffer;if(!Array.isArray(o))return o})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const s=e.args.map((r,a)=>{if(!r.validate(i[a]))throw new Error(`Invalid argument '${r.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return r.convert(i[a])}),o=await this.executeCommand(e.internalId,...s);return e.result.convert(o,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new oo(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,s,o,r){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:s,metadata:o,extension:r}),e&&se(this,KA).$registerCommand(t),new oo(()=>{this._commands.delete(t)&&e&&se(this,KA).$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return se(this,KA).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let s=!1;const o=AU(t,function(r){if(r instanceof Ps)return Wr.from(r);if(r instanceof rs)return at.from(r);if(r instanceof _p)return P_.from(r);if(rS.isNotebookRange(r))return ES.from(r);if(r instanceof ArrayBuffer)return s=!0,ze.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return s=!0,ze.wrap(r);if(r instanceof ze)return s=!0,r;if(!Array.isArray(r))return r});try{const r=await se(this,KA).$executeCommand(e,s?new $h(o):o,i);return Or(r)}catch(r){if(r instanceof Error&&r.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw r}}}async _executeContributedCommand(e,t,i){const s=this._commands.get(e);if(!s)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=s;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),s)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),se(this,KA).$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:s}=i;s&&(e[t]=s)}return Promise.resolve(e)}},KA=new WeakMap,bq=new WeakMap,Cq=new WeakMap,zqe);qLe=D([_(0,gr),_(1,Ze),_(2,pue)],qLe);const Yz=ae("IExtHostCommands");class xti{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Dr()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const s=this._lookupApiCommand(e.command);if(s)i.id=s.internalId,i.arguments=s.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(mo(e.arguments)){const o=`${e.command} /${++this._cachIdPool}`;this._cache.set(o,e),t.add(Ee(()=>{this._cache.delete(o),this._logService.trace("CommandsConverter#DISPOSE",o)})),i.$ident=o,i.id=this.delegatingCommandId,i.arguments=[o],this._logService.trace("CommandsConverter#CREATE",e.command,o)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const Ec=class Ec{static Arr(e){return new Ec(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,s){this.name=e,this.description=t,this.validate=i,this.convert=s}optional(){return new Ec(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new Ec(e??this.name,t??this.description,this.validate,this.convert)}};Ec.Uri=new Ec("uri","Uri of a text document",e=>P.isUri(e),e=>e),Ec.Position=new Ec("position","A position in a text document",e=>Ps.isPosition(e),Wr.from),Ec.Range=new Ec("range","A range in a text document",e=>rs.isRange(e),at.from),Ec.Selection=new Ec("selection","A selection in a text document",e=>XS.isSelection(e),ZS.from),Ec.Number=new Ec("number","",e=>typeof e=="number",e=>e),Ec.String=new Ec("string","",e=>typeof e=="string",e=>e),Ec.StringArray=Ec.Arr(Ec.String),Ec.CallHierarchyItem=new Ec("item","A call hierarchy item",e=>e instanceof $he,KF.from),Ec.TypeHierarchyItem=new Ec("item","A type hierarchy item",e=>e instanceof qhe,$M.from),Ec.TestItem=new Ec("testItem","A VS Code TestItem",e=>e instanceof MO,J1.from);let Et=Ec;const ple=class ple{constructor(e,t){this.description=e,this.convert=t}};ple.Void=new ple("no result",e=>e);let In=ple;class Vn{constructor(e,t,i,s,o){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=o}}const QLe=new Map;function Dti(n,e){e?QLe.set(n,e):QLe.delete(n)}function kti(n){return QLe.get(n)}class Iti extends Yje{constructor(e,t,i,s,o,r,a){super(t,i,s,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){nm(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return Ls(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===_e.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===` +`);await t.write(n.filepath,i)}class Xei extends dat{constructor(){super({id:"workbench.action.openSnippets",title:Be(lu,7,"Configure User Snippets"),shortTitle:{...Be(lu,8,"User Snippets"),mnemonicTitle:g(lu,9,"User &&Snippets")},f1:!0,menu:[{id:Te.MenubarPreferencesMenu,group:"2_configuration",order:5},{id:Te.GlobalActivity,group:"2_configuration",order:5}]})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(fr),o=e.get(Di),r=e.get(Tm),a=e.get(Ti),c=e.get(ci),l=e.get(tr),d=e.get(eo),h=await Yei(t,r,o,d),u=h.existing,f=[{scope:g(lu,10,"global"),label:g(lu,11,"New Global Snippets file..."),uri:r.currentProfile.snippetsHome}],p=[];for(const v of a.getWorkspace().folders)p.push({scope:g(lu,12,"{0} workspace",v.name),label:g(lu,13,"New Snippets file for '{0}'...",v.name),uri:v.toResource(".vscode")});u.length>0?(u.unshift({type:"separator",label:g(lu,14,"Existing Snippets")}),u.push({type:"separator",label:g(lu,15,"New Snippets")})):u.push({type:"separator",label:g(lu,15,"New Snippets")});const m=await i.pick([].concat(u,f,p,h.future),{placeHolder:g(lu,16,"Select Snippets File or Create Snippets"),matchOnDescription:!0});if(f.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(p.indexOf(m)>=0)return z7e(m.scope,m.uri,i,c,l,s);if(RLe.is(m))return m.hint&&await Jei(m,c,l),s.open(m.filepath)}}const $7e="vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets",l9=class l9 extends dat{constructor(){super({id:l9.Id,title:Be($7e,0,"Fill File with Snippet"),f1:!0})}async run(e){const t=e.get($_),i=e.get(On),s=e.get(_i),o=e.get(Di),r=_z(s.activeTextEditorControl);if(!r||!r.hasModel())return;const a=await t.getSnippets(void 0,{fileTemplateSnippets:!0,noRecencySort:!0,includeNoPrefixSnippets:!0});if(a.length===0)return;const c=await this._pick(i,o,a);c&&r.hasModel()&&(mc.get(r)?.apply([{range:r.getModel().getFullModelRange(),template:c.snippet.body}]),r.getModel().setLanguage(o.createById(c.langId),l9.Id),r.focus())}async _pick(e,t,i){const s=[];for(const c of i)if(iO(c.scopes))s.push({langId:"",snippet:c});else for(const l of c.scopes)s.push({langId:l,snippet:c});const o=[],r=yU(s,(c,l)=>lw(c.langId,l.langId));for(const c of r){let l=!0;for(const d of c)l&&(o.push({type:"separator",label:t.getLanguageName(d.langId)??d.langId}),l=!1),o.push({snippet:d,label:d.snippet.prefix||d.snippet.name,detail:d.snippet.description})}return(await e.pick(o,{placeHolder:g($7e,1,"Select a snippet"),matchOnDetail:!0}))?.snippet}};l9.Id="workbench.action.populateFileFromSnippet";let Are=l9;const PL="vs/workbench/contrib/snippets/browser/snippetPicker";async function uat(n,e){const t=n.get($_),i=n.get(On);let s;Array.isArray(e)?s=e:s=await t.getSnippets(e,{includeDisabledSnippets:!0,includeNoPrefixSnippets:!0}),s.sort((c,l)=>c.snippetSource-l.snippetSource);const o=()=>{const c=[];let l;for(const d of s){const h={label:d.prefix||d.name,detail:d.description||d.body,snippet:d};if(!l||l.snippetSource!==d.snippetSource||l.source!==d.source){let u="";switch(d.snippetSource){case Yg.User:u=g(PL,0,"User Snippets");break;case Yg.Extension:u=d.source;break;case Yg.Workspace:u=g(PL,1,"Workspace Snippets");break}c.push({type:"separator",label:u})}d.snippetSource===Yg.Extension&&(t.isEnabled(d)?h.buttons=[{iconClass:$e.asClassName(Ce.eyeClosed),tooltip:g(PL,2,"Hide from IntelliSense")}]:(h.description=g(PL,3,"(hidden from IntelliSense)"),h.buttons=[{iconClass:$e.asClassName(Ce.eye),tooltip:g(PL,4,"Show in IntelliSense")}])),c.push(h),l=d}return c},r=i.createQuickPick();r.placeholder=g(PL,5,"Select a snippet"),r.matchOnDetail=!0,r.ignoreFocusOut=!1,r.keepScrollPosition=!0,r.onDidTriggerItemButton(c=>{const l=t.isEnabled(c.item.snippet);t.updateEnablement(c.item.snippet,!l),r.items=o()}),r.items=o(),r.items.length||(r.validationMessage=g(PL,6,"No snippet available")),r.show(),await Promise.race([T.toPromise(r.onDidAccept),T.toPromise(r.onDidHide)]);const a=r.selectedItems[0]?.snippet;return r.dispose(),a}const Zei="vs/workbench/contrib/snippets/browser/commands/insertSnippet",vW=class vW{static fromUser(e){if(!e||typeof e!="object")return vW._empty;let{snippet:t,name:i,langId:s}=e;return typeof t!="string"&&(t=void 0),typeof i!="string"&&(i=void 0),typeof s!="string"&&(s=void 0),new vW(t,i,s)}constructor(e,t,i){this.snippet=e,this.name=t,this.langId=i}};vW._empty=new vW(void 0,void 0,void 0);let MLe=vW;class eti extends hat{constructor(){super({id:"editor.action.insertSnippet",title:Be(Zei,0,"Insert Snippet"),f1:!0,precondition:X.writable,metadata:{description:"Insert Snippet",args:[{name:"args",schema:{type:"object",properties:{snippet:{type:"string"},langId:{type:"string"},name:{type:"string"}}}}]}})}async runEditorCommand(e,t,i){const s=e.get(Di),o=e.get($_);if(!t.hasModel())return;const r=e.get(Mu),a=e.get(be),c=await new Promise((d,h)=>{const{lineNumber:u,column:f}=t.getPosition(),{snippet:p,name:m,langId:v}=MLe.fromUser(i);if(p)return d(new iFe(!1,[],"","","",p,"",Yg.User,`random/${Math.random()}`));let w;if(v){if(!s.isRegisteredLanguageId(v))return d(void 0);w=v}else t.getModel().tokenization.tokenizeIfCheap(u),w=t.getModel().getLanguageIdAtPosition(u,f),s.getLanguageName(w)||(w=t.getModel().getLanguageId());m?o.getSnippets(w,{includeNoPrefixSnippets:!0}).then(b=>b.find(C=>C.name===m)).then(d,h):d(a.invokeFunction(uat,w))});if(!c)return;let l;c.needsClipboard&&(l=await r.readText()),t.focus(),mc.get(t)?.insert(c.codeSnippet,{clipboardText:l}),o.updateUsageTimestamp(c)}}const tti="vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet";async function gat(n,e,t,i){const{lineNumber:s,column:o}=t;e.tokenization.tokenizeIfCheap(s);const r=e.getLanguageIdAtPosition(s,o);return(await n.getSnippets(r,{includeNoPrefixSnippets:!0,includeDisabledSnippets:i})).filter(c=>c.usesSelection)}const fle=class fle extends hat{constructor(){super({...fle.options,precondition:ge.and(X.writable,X.hasNonEmptySelection),f1:!0})}async runEditorCommand(e,t){if(!t.hasModel())return;const i=e.get(be),s=e.get($_),o=e.get(Mu),r=await gat(s,t.getModel(),t.getPosition(),!0);if(!r.length)return;const a=await i.invokeFunction(uat,r);if(!a)return;let c;a.needsClipboard&&(c=await o.readText()),t.focus(),mc.get(t)?.insert(a.codeSnippet,{clipboardText:c}),s.updateUsageTimestamp(a)}};fle.options={id:"editor.action.surroundWithSnippet",title:Be(tti,0,"Surround with Snippet...")};let hq=fle;var VX,zX;const Ere="vs/workbench/contrib/snippets/browser/snippetCodeActionProvider";var X0;let NLe=(X0=class{constructor(e){this._snippetService=e}async provideCodeActions(e,t){if(t.isEmpty())return;const i=mt.isISelection(t)?t.getPosition():t.getStartPosition(),s=await gat(this._snippetService,e,i,!1);if(!s.length)return;const o=[];for(const r of s){if(o.length>=VX._MAX_CODE_ACTIONS){o.push(VX._overflowCommandCodeAction);break}o.push({title:g(Ere,1,"{0}",r.name),kind:ls.SurroundWith.value,edit:fat(e,t,r)})}return{actions:o,dispose(){}}}},VX=X0,X0._MAX_CODE_ACTIONS=4,X0._overflowCommandCodeAction={kind:ls.SurroundWith.value,title:g(Ere,0,"More..."),command:{id:hq.options.id,title:hq.options.title.value}},X0);NLe=VX=D([_(0,$_)],NLe);var Z0;let PLe=(Z0=class{constructor(e){this._snippetService=e,this.providedCodeActionKinds=[ls.SurroundWith.value]}async provideCodeActions(e){if(e.getValueLength()!==0)return;const t=await this._snippetService.getSnippets(e.getLanguageId(),{fileTemplateSnippets:!0,includeNoPrefixSnippets:!0}),i=[];for(const s of t){if(i.length>=zX._MAX_CODE_ACTIONS){i.push(zX._overflowCommandCodeAction);break}i.push({title:g(Ere,3,"Start with: {0}",s.name),kind:ls.SurroundWith.value,edit:fat(e,e.getFullModelRange(),s)})}return{actions:i,dispose(){}}}},zX=Z0,Z0._MAX_CODE_ACTIONS=4,Z0._overflowCommandCodeAction={title:g(Ere,2,"Start with Snippet"),kind:ls.SurroundWith.value,command:{id:Are.Id,title:""}},Z0);PLe=zX=D([_(0,$_)],PLe);function fat(n,e,t){return{edits:[{versionId:n.getVersionId(),resource:n.uri,textEdit:{range:e,text:t.body,insertAsSnippet:!0}}]}}let FLe=class{constructor(e,t,i){this._store=new Z;const s="editor.snippets.codeActions.enabled",o=new Z,r=()=>{o.clear(),i.getValue(s)&&(o.add(t.codeActionProvider.register("*",e.createInstance(NLe))),o.add(t.codeActionProvider.register("*",e.createInstance(PLe))))};r(),this._store.add(i.onDidChangeConfiguration(a=>a.affectsConfiguration(s)&&r())),this._store.add(o)}dispose(){this._store.dispose()}};FLe=D([_(0,be),_(1,ht),_(2,Re)],FLe);const cS="vs/workbench/contrib/snippets/browser/snippets.contribution";At(eti);yt.registerCommandAlias("editor.action.showSnippets","editor.action.insertSnippet");At(hq);At(Are);At(Xei);const iti=it.as(pf.Workbench);iti.registerWorkbenchContribution(FLe,Us.Restored);it.as(Cs.Configuration).registerConfiguration({...sA,properties:{"editor.snippets.codeActions.enabled":{description:g(cS,0,"Controls if surround-with-snippets or file template snippets show as Code Actions."),type:"boolean",default:!0}}});const pat="vscode://schemas/snippets",mat={prefix:{description:g(cS,1,"The prefix to use when selecting the snippet in intellisense"),type:["string","array"]},isFileTemplate:{description:g(cS,2,"The snippet is meant to populate or replace a whole file"),type:"boolean"},body:{markdownDescription:g(cS,3,"The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`."),type:["string","array"],items:{type:"string"}},description:{description:g(cS,4,"The snippet description."),type:["string","array"]}},nti={id:pat,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{prefix:"${2:prefix}",body:"${3:snippet}",description:"${4:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:mat,additionalProperties:!1}},_at="vscode://schemas/global-snippets",sti={id:_at,allowComments:!0,allowTrailingCommas:!0,defaultSnippets:[{label:g(cS,5,"Empty snippet"),body:{"${1:snippetName}":{scope:"${2:scope}",prefix:"${3:prefix}",body:"${4:snippet}",description:"${5:description}"}}}],type:"object",description:g(cS,6,"User snippet configuration"),additionalProperties:{type:"object",required:["body"],properties:{...mat,scope:{description:g(cS,7,"A list of language names to which this snippet applies, e.g. 'typescript,javascript'."),type:"string"}},additionalProperties:!1}},vat=it.as(eL.JSONContribution);vat.registerSchema(pat,nti);vat.registerSchema(_at,sti);P4t(async n=>{n.get(mg).when(2).then(()=>{Lt.get($_)})});function oti(){return{...lOe(),[$_.toString()]:new Gi(Oye,[],!0)}}var OLe,YP;let BLe=(YP=class extends ZU{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:OLe.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new sd,this.profileStorageProfile=this.userDataProfileService.currentProfile,this.profileStorageDisposables=this._register(new Z),this.workspaceStorageDisposables=this._register(new Z),this.registerListeners()}registerListeners(){this._register(this.userDataProfileService.onDidChangeCurrentProfile(e=>e.join(this.switchToProfile(e.profile))))}async doInitialize(){await ko.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await M8.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new fx(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.APPLICATION,t))),await this.applicationStorage.init(),this.updateIsNew(this.applicationStorage),this.applicationStoragePromise.complete({indexedDb:e,storage:this.applicationStorage})}async createProfileStorage(e){if(this.profileStorageDisposables.clear(),this.profileStorageProfile=e,bbe(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(s=>this.emitDidChangeValue(ke.PROFILE,s)))}else{const t=await M8.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new fx(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(ke.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await M8.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new fx(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(ke.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(pJ);t===void 0?e.set(pJ,!0):t&&e.set(pJ,!1)}getStorage(e){switch(e){case ke.APPLICATION:return this.applicationStorage;case ke.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case ke.APPLICATION:return this.applicationStorageDatabase?.name;case ke.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=ws(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,ws(this.profileStorage),ke.PROFILE)}async switchToWorkspace(e,t){const i=ws(this.workspaceStorage),s=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(s,ws(this.workspaceStorage),ke.WORKSPACE)}shouldFlushWhenIdle(){return ax().document.hasFocus()&&!this.hasPendingUpdate}close(){TS&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[ke.APPLICATION,ke.PROFILE,ke.WORKSPACE]){for(const t of[ln.USER,ln.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await ko.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return ZJe(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},OLe=YP,YP.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,YP);BLe=OLe=D([_(2,Ze)],BLe);class rti extends fJ{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Qm=class Qm extends ${static async createApplicationStorage(e){return Qm.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Qm.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Qm.create({id:e},t)}static async create(e,t){try{const i=new Qm(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Ma(i,!0)}`),new rti}}get hasPendingUpdate(){return!!this.pendingUpdate}constructor(e,t){super(),this.logService=t,this._onDidChangeItemsExternal=this._register(new I),this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event,this.pendingUpdate=void 0,this.name=`${Qm.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new iOe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{ADt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await PT.create(this.name,void 0,[Qm.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Ma(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Qm.STORAGE_OBJECT_STORE,t)}async updateItems(e){let t=!1;this.pendingUpdate=this.doUpdateItems(e);try{t=await this.pendingUpdate}finally{this.pendingUpdate=void 0}if(this.broadcastChannel&&t){const i={changed:e.insert,deleted:e.delete};this.broadcastChannel.postData(i)}}async doUpdateItems(e){const t=e.insert,i=e.delete;return!t&&!i||t?.size===0&&i?.size===0?!1:(await(await this.whenConnected).runInTransaction(Qm.STORAGE_OBJECT_STORE,"readwrite",o=>{const r=[];if(t)for(const[a,c]of t)r.push(o.put(c,a));if(i)for(const a of i)r.push(o.delete(a));return r}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(Qm.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Qm.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Qm.STORAGE_OBJECT_STORE="ItemTable";let M8=Qm;var NC;const ati=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var JP;let xre=(JP=class extends ${static toKey(e){return`extensionKeys/${lte(e.id)}@${e.version}`}static fromKey(e){const t=ati.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),s=[];for(const[o,r]of NC.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>gc(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&s.push(NC.toKey({id:o,version:c}))}for(const o of s)t.remove(o,ke.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(ke.PROFILE,ln.MACHINE);for(const s of i){const o=NC.fromKey(s);if(o){let r=t.get(o.id.toLowerCase());r||t.set(o.id.toLowerCase(),r=[]),r.push(o.version)}}return t}constructor(e,t,i){super(),this.storageService=e,this.productService=t,this.logService=i,this._onDidChangeExtensionStorageToSync=this._register(new I),this.onDidChangeExtensionStorageToSync=this._onDidChangeExtensionStorageToSync.event,this.extensionsWithKeysForSync=NC.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(ke.PROFILE,void 0,this._register(new Z))(s=>this.onDidChangeStorageValue(s)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=NC.fromKey(e.key);if(t){if(this.storageService.get(e.key,ke.PROFILE)===void 0)this.extensionsWithKeysForSync.delete(t.id.toLowerCase());else{let i=this.extensionsWithKeysForSync.get(t.id.toLowerCase());i||this.extensionsWithKeysForSync.set(t.id.toLowerCase(),i=[]),i.push(t.version),this._onDidChangeExtensionStorageToSync.fire()}return}}getExtensionId(e){if(zt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return _F(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),s=this.getExtensionStateRaw(e,t);if(s)try{return JSON.parse(s)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),s=this.storageService.get(i,t?ke.PROFILE:ke.WORKSPACE);return s&&s?.length>NC.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${s.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),s}setExtensionState(e,t,i){const s=this.getExtensionId(e);t===void 0?this.storageService.remove(s,i?ke.PROFILE:ke.WORKSPACE):this.storageService.store(s,JSON.stringify(t),i?ke.PROFILE:ke.WORKSPACE,ln.MACHINE)}setKeysForSync(e,t){this.storageService.store(NC.toKey(e),JSON.stringify(t),ke.PROFILE,ln.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(NC.toKey(e),ke.PROFILE),s=i?JSON.parse(i):void 0;return s&&t?Lc([...s,...t]):s||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(s=>!s.includes(e)&&!s.includes(t));i.push([e,t]),this.migrationList=i}}getSourceExtensionToMigrate(e){const t=this.migrationList.find(([,i])=>e===i);return t?t[0]:void 0}get migrationList(){const e=this.storageService.get("extensionStorage.migrationList",ke.APPLICATION,"[]");try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return[]}set migrationList(e){e.length?this.storageService.store("extensionStorage.migrationList",JSON.stringify(e),ke.APPLICATION,ln.MACHINE):this.storageService.remove("extensionStorage.migrationList",ke.APPLICATION)}},NC=JP,JP.LARGE_STATE_WARNING_THRESHOLD=512*1024,JP);xre=NC=D([_(0,on),_(1,Ja),_(2,Ze)],xre);var N8;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(N8||(N8={}));class fme extends fx{constructor(e,t){const i=t.read(e);if(super(new cti(e,t,i)),i!=null)for(const[s,o]of i)this.items.set(s,o)}}class cti{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??T.None}async getItems(){return this.items}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t)),await this.provider.write(this.scope,this.items)}async close(){return this.provider.close?.(this.scope)}async optimize(){return this.provider.optimize?.(this.scope)}}class lti extends ZU{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new fme(N8.APPLICATION,this.provider)),this.profileStorage=this._register(new fme(N8.PROFILE,this.provider)),this.workspaceStorage=this._register(new fme(N8.WORKSPACE,this.provider)),this._register(this.workspaceStorage.onDidChangeStorage(i=>this.emitDidChangeValue(1,i))),this._register(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(0,i))),this._register(this.applicationStorage.onDidChangeStorage(i=>this.emitDidChangeValue(-1,i)))}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"External (application)";case 0:return"External (profile)";default:return"External (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(e){return!1}get(e,t,i){return this.getStorage(t).get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t).getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t).getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t).getObject(e,this.fallbackOverride?.[e]??i)}}VFe(async n=>{const e=n.get(on),t=n.get(Id);e instanceof ZU&&(await e.initialize(),t.onDidChangeFocus(i=>{i||e.flush()}))});let WLe=class extends BLe{constructor(e,t,i){super(HFe(),t,i),this.fallbackOverride=e}get(e,t,i){return this.getStorage(t)?.get(e,this.fallbackOverride?.[e]??i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,this.fallbackOverride?.[e]??i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,this.fallbackOverride?.[e]??i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,this.fallbackOverride?.[e]??i)}};WLe=D([_(1,Tm),_(2,Ze)],WLe);function dti({customProvider:n,fallbackOverride:e}={}){return n!=null?{[on.toString()]:new Gi(lti,[n,e],!0),[B7.toString()]:new Gi(xre,[],!0)}:{[on.toString()]:new Gi(WLe,[e],!0),[B7.toString()]:new Gi(xre,[],!0)}}class hti{constructor(){this._systemSchemes=new Set(Object.keys(_e)),this._providerInfo=new Map,this.extUri=new cO(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&es.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const Kz=ae("IExtHostFileSystemInfo");var PC;let HLe=PC=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new sMe,this._proxy=e.getProxy(Ue.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(s){try{let o;const r=i._fileSystemProvider.get(s.scheme);return r?(await i._proxy.$ensureActivation(s.scheme),o=await r.impl.stat(s)):o=await i._proxy.$stat(s),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===vm.Readonly?1:void 0}}catch(o){PC._handleError(o)}},async readDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readDirectory(s)).slice()):await i._proxy.$readdir(s)}catch(o){return PC._handleError(o)}},async createDirectory(s){try{const o=i._fileSystemProvider.get(s.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(o.impl,o.extUri,s)):await i._proxy.$mkdir(s)}catch(o){return PC._handleError(o)}},async readFile(s){try{const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),(await o.impl.readFile(s)).slice()):(await i._proxy.$readFile(s)).buffer}catch(o){return PC._handleError(o)}},async writeFile(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(s)),await i._writeQueue.queueFor(s,()=>Promise.resolve(r.impl.writeFile(s,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(s,ze.wrap(o))}catch(r){return PC._handleError(r)}},async delete(s,o){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(s.scheme),await r.impl.delete(s,{recursive:!1,...o})):await i._proxy.$delete(s,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return PC._handleError(r)}},async rename(s,o,r){try{return await i._proxy.$rename(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},async copy(s,o,r){try{return await i._proxy.$copy(s,o,{overwrite:!1,...r})}catch(a){return PC._handleError(a)}},isWritableFileSystem(s){const o=t.getCapabilities(s);if(typeof o=="number")return!(o&es.Readonly)}})}async mkdirp(e,t,i){const s=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&an.Directory))throw Wl.FileExists(`Unable to create folder '${i.scheme===_e.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(w1(o)!==rt.FileNotFound)throw o;s.push(t.basename(i)),i=t.dirname(i)}for(let o=s.length-1;o>=0;o--){i=t.joinPath(i,s[o]);try{await e.createDirectory(i)}catch(r){if(w1(r)!==rt.FileExists)throw r}}}static _handleError(e){if(e instanceof Wl)throw e;if(e instanceof Nx)switch(e.code){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}if(!(e instanceof Error))throw new Wl(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Wl.Unavailable(e.message);switch(e.name){case rt.FileExists:throw Wl.FileExists(e.message);case rt.FileNotFound:throw Wl.FileNotFound(e.message);case rt.FileNotADirectory:throw Wl.FileNotADirectory(e.message);case rt.FileIsADirectory:throw Wl.FileIsADirectory(e.message);case rt.NoPermissions:throw Wl.NoPermissions(e.message);case rt.Unavailable:throw Wl.Unavailable(e.message);default:throw new Wl(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?Fn:Gle,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Fn}};HLe=PC=D([_(0,gr),_(1,Kz)],HLe);const gue=ae("IExtHostConsumerFileSystem");class wat extends ude{get disposed(){return this._disposed}constructor(e,t,i,s,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=s,this.extension=o,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(r=>this.setLevel(r)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+` +`)}append(e){this.info(e)}clear(){const e=this.offset;this.logger.flush(),this.proxy.$update(this.id,aH.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,aH.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e=="boolean"?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=ze.fromString(t).byteLength,see(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,aH.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class uti extends wat{appendLine(e){this.append(e)}}let ULe=class{constructor(e,t,i,s,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=s,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Ue.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${Lnt(new Date).replace(/-|:|\.\d+Z$/g,"")}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(const[t,i]of this.channels)i.visible=t===this.visibleChannelId}createOutputChannel(e,t,i){if(e=e.trim(),!e)throw new Error("illegal argument `name`. must not be falsy");const s=typeof t=="object"&&t.log,o=zt(t)?t:void 0;if(zt(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Cn.equals(i.identifier,l))?.[1];a&&(r=TYe(a));const c=s?this.doCreateLogOutputChannel(e,r,i):this.doCreateOutputChannel(e,o,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),s?this.createExtHostLogOutputChannel(e,r??this.logService.getLevel(),c):this.createExtHostOutputChannel(e,c)}async doCreateOutputChannel(e,t,i){this.outputDirectoryPromise||(this.outputDirectoryPromise=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation));const s=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(s,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),r=this.loggerService.createLogger(o,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,o,t,i.identifier.value);return new wat(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const s=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(s,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new uti(a,e,c,this.proxy,i)}createExtensionLogDirectory(e){let t=this.extensionLogDirectoryPromise.get(e.identifier.value);if(!t){const i=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,e.identifier.value);this.extensionLogDirectoryPromise.set(e.identifier.value,t=(async()=>{try{await this.extHostFileSystem.value.createDirectory(i)}catch(s){if(w1(s)!==rt.FileExists)throw s}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const s=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){s(),t.then(r=>r.append(o))},appendLine(o){s(),t.then(r=>r.appendLine(o))},clear(){s(),t.then(o=>o.clear())},replace(o){s(),t.then(r=>r.replace(o))},show(o,r){s(),t.then(a=>a.show(o,r))},hide(){s(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const s=new Z,o=()=>{if(s.isDisposed)throw new Error("Channel has been closed")},r=s.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{s.add(c),c.logLevel!==t&&a(c.logLevel),s.add(c.onDidChangeLogLevel(l=>a(l)))}),{...this.createExtHostOutputChannel(e,i),get logLevel(){return t},onDidChangeLogLevel:r.event,trace(c,...l){o(),i.then(d=>d.trace(c,...l))},debug(c,...l){o(),i.then(d=>d.debug(c,...l))},info(c,...l){o(),i.then(d=>d.info(c,...l))},warn(c,...l){o(),i.then(d=>d.warn(c,...l))},error(c,...l){o(),i.then(d=>d.error(c,...l))},dispose(){s.dispose()}}}};ULe=D([_(0,gr),_(1,Sg),_(2,gue),_(3,Kz),_(4,wp),_(5,Ze)],ULe);const bat=ae("IExtHostOutputService"),fue=ae("IURITransformerService");class gti{constructor(e){e?(this.transformIncoming=e.transformIncoming.bind(e),this.transformOutgoing=e.transformOutgoing.bind(e),this.transformOutgoingURI=e.transformOutgoingURI.bind(e),this.transformOutgoingScheme=e.transformOutgoingScheme.bind(e)):(this.transformIncoming=t=>t,this.transformOutgoing=t=>t,this.transformOutgoingURI=t=>t,this.transformOutgoingScheme=t=>t)}}const fti="vs/workbench/api/common/extHostWorkspace";function uq(n,e,t){return new cO(i=>QOe(i,t)).isEqual(n,e)}function pti(n,e,t){return uq(n.uri,e.uri,t)?0:lw(n.uri.toString(),e.uri.toString())}function mti(n,e,t){return n.index!==e.index?n.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return UL(s,o,(r,a)=>t(r,a,i))}function QOe(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&es.PathCaseSensitive)}class lH extends kJe{static toExtHostWorkspace(e,t,i,s){if(!e)return{workspace:null,added:[],removed:[]};const{id:o,name:r,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,w)=>{const b=P.revive(v.uri),C=lH._findFolder(i||t,b,s);C?(C.name=v.name,C.index=v.index,h.push(C)):h.push({uri:b,name:v.name,index:w})}):h.push(...a.map(({uri:v,name:w,index:b})=>({uri:P.revive(v),name:w,index:b}))),h.sort((v,w)=>v.indexQOe(v,s)),{added:p,removed:m}=Cat(u?u.workspaceFolders:[],f.workspaceFolders,pti,s);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let s=0;snew Cde(c)),s,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Su.forUris(a),i.forEach(c=>{this._workspaceFolders.push(c),this._structure.set(c.uri,c)})}get name(){return this._name}get isUntitled(){return this._isUntitled}get workspaceFolders(){return this._workspaceFolders.slice(0)}getWorkspaceFolder(e,t){return t&&this._structure.get(e)&&(e=ma(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let VLe=class{constructor(e,t,i,s,o){this._onDidChangeWorkspace=new I,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new I,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new EI,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new dSt,this._barrier=new Uh,this._proxy=e.getProxy(Ue.MainThreadWorkspace),this._messageService=e.getProxy(Ue.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new lH(r.id,r.name,[],!!r.transient,r.configuration?P.revive(r.configuration):null,!!r.isUntitled,a=>QOe(a,i)):void 0}$initializeWorkspace(e,t){this._trusted=t,this.$acceptWorkspaceData(e),this._barrier.open()}waitForInitializeCall(){return this._barrier.wait()}get workspace(){return this._actualWorkspace}get name(){return this._actualWorkspace?this._actualWorkspace.name:void 0}get workspaceFile(){if(this._actualWorkspace&&this._actualWorkspace.configuration)return this._actualWorkspace.isUntitled?P.from({scheme:_e.untitled,path:ui(ma(this._actualWorkspace.configuration))}):this._actualWorkspace.configuration}get _actualWorkspace(){return this._unconfirmedWorkspace||this._confirmedWorkspace}getWorkspaceFolders(){if(this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}async getWorkspaceFolders2(){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.workspaceFolders.slice(0)}updateWorkspaceFolders(e,t,i,...s){const o=[];if(Array.isArray(s)&&s.forEach(d=>{P.isUri(d.uri)&&!o.some(h=>uq(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||Mx(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&o.length===0)return!1;const r=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>r.length)return!1;const a=r.slice(0);a.splice(t,i,...o.map(d=>({uri:d.uri,name:d.name||Mx(d.uri),index:void 0})));for(let d=0;df!==d&&uq(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=Cat(r,a,mti,this._extHostFileSystemInfo);if(c.length===0&&l.length===0)return!1;if(this._proxy){const d=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(d,t,i,o).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(nt.Error,g(fti,0,"Extension '{0}' failed to update workspace folders: {1}",d,h.toString()),u,[])})}return this.trySetWorkspaceFolders(a),!0}getWorkspaceFolder(e,t){if(this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async getWorkspaceFolder2(e,t){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.getWorkspaceFolder(e,t)}async resolveWorkspaceFolder(e){if(await this._barrier.wait(),!!this._actualWorkspace)return this._actualWorkspace.resolveWorkspaceFolder(e)}getPath(){if(!this._actualWorkspace)return;const{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let i,s="";if(typeof e=="string"?(i=P.file(e),s=e):typeof e<"u"&&(i=e,s=e.fsPath),!i)return s;const o=this.getWorkspaceFolder(i,!0);if(!o)return s;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=lO(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=lH.toExtHostWorkspace({id:this._actualWorkspace.id,name:this._actualWorkspace.name,configuration:this._actualWorkspace.configuration,folders:e,isUntitled:this._actualWorkspace.isUntitled},this._actualWorkspace,void 0,this._extHostFileSystemInfo).workspace||void 0)}$acceptWorkspaceData(e){const{workspace:t,added:i,removed:s}=lH.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:i,removed:s}))}findFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${s.value}, entryPoint: findFiles`);let r="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?r=t:r=t.pattern),this._findFilesImpl(e,void 0,{exclude:r,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},o)}findFiles2(e,t={},i,s=qe.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,s)}async _findFilesImpl(e,t,i,s=qe.None){if(s&&s.isCancellationRequested)return Promise.resolve([]);const o=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,r={ignoreSymlinks:typeof i.followSymlinks=="boolean"?!i.followSymlinks:void 0,disregardIgnoreFiles:typeof i.useIgnoreFiles=="boolean"?!i.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof i.useGlobalIgnoreFiles=="boolean"?!i.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof i.useParentIgnoreFiles=="boolean"?!i.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof i.useDefaultExcludes=="boolean"?!i.useDefaultExcludes:!1,disregardSearchExcludeSettings:typeof i.useDefaultSearchExcludes=="boolean"?!i.useDefaultSearchExcludes:!1,maxResults:i.maxResults,excludePattern:o,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=pme(Zp.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=pme(Zp.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,s).then(c=>Array.isArray(c)?c.map(l=>P.revive(l)):[])}async findTextInFiles(e,t,i,s,o=qe.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${s.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=pme(Zp.from(t.include)),d=typeof t.exclude=="string"?t.exclude:t.exclude?t.exclude.pattern:void 0,h={ignoreSymlinks:typeof t.followSymlinks=="boolean"?!t.followSymlinks:void 0,disregardIgnoreFiles:typeof t.useIgnoreFiles=="boolean"?!t.useIgnoreFiles:void 0,disregardGlobalIgnoreFiles:typeof t.useGlobalIgnoreFiles=="boolean"?!t.useGlobalIgnoreFiles:void 0,disregardParentIgnoreFiles:typeof t.useParentIgnoreFiles=="boolean"?!t.useParentIgnoreFiles:void 0,disregardExcludeSettings:typeof t.useDefaultExcludes=="boolean"?!t.useDefaultExcludes:!0,fileEncoding:t.encoding,maxResults:t.maxResults,previewOptions:a,afterContext:t.afterContext,beforeContext:t.beforeContext,includePattern:c,excludePattern:d};if(this._activeSearchCallbacks[r]=u=>{const f=P.revive(u.resource);u.results.forEach(p=>{const m=Or(p);q8t(m)?i({uri:f,preview:{text:m.preview.text,matches:u9(m.preview.matches,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:u9(m.ranges,v=>new rs(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},o.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,r,o);return delete this._activeSearchCallbacks[r],u||{}}catch(u){throw delete this._activeSearchCallbacks[r],u}}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return P.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return P.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}loadCertificates(){return this._proxy.$loadCertificates()}get trusted(){return this._trusted}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(s,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(s)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(P.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const s=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!s),!s)return;const o=await s.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,s){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(P.revive(e));if(!o){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",o);const r=this._editSessionIdentityProviders.get(o.uri.scheme);if(this._logService.info(`Provider for scheme ${o.uri.scheme} is defined: `,!!r),!r)return;const a=await r.provideEditSessionIdentityMatch?.(t,i,s);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,s)}}async $onWillCreateEditSessionIdentity(e,t,i){const s=await this.resolveWorkspaceFolder(P.revive(e));if(s===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:s},t,async(o,r)=>{const a=Date.now();await Promise.resolve(o),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",r.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw new Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);const i=this._uriTransformerService.transformOutgoingScheme(e),s=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(s,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(s)})}async provideCanonicalUri(e,t,i){const s=this._canonicalUriProviders.get(e.scheme);if(!s)return;const o=await s.provideCanonicalUri?.(P.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(P.revive(e),{targetScheme:t},i)}};VLe=D([_(0,gr),_(1,Sg),_(2,Kz),_(3,Ze),_(4,fue)],VLe);const dD=ae("IExtHostWorkspace");function pme(n){let e,t;return n&&(typeof n=="string"?e=n:(e=n.pattern,t=P.revive(n.baseUri))),{includePattern:e,folder:t}}var j3,e1;let zLe=(e1=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Ue.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=j3._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const s=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=Kb(o);if(r.length<=j3._maxEventSize){this._proxy.$onDidChange(i,r);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,r.length);const a=r.map(d=>({uri:d,rank:Tlt(d.path,"/")})),c=yU(a,(d,h)=>d.rank-h.rank||lw(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=lS(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=j3._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new oo(()=>{s?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const s=Object.create(null),{provider:o,extensionDescription:r}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(o.provideFileDecoration(P.revive(c),i));if(!d)return;try{sG.validate(d),d.badge&&typeof d.badge!="string"&&Je(r,"codiconDecoration"),s[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${r.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),s}},j3=e1,e1._handlePool=0,e1._maxEventSize=250,e1);zLe=j3=D([_(0,gr),_(1,Ze)],zLe);const yat=ae("IExtHostDecorations");function z5(n,e){if(e){const t=e.split(".");let i=n;for(let s=0;i&&sthis._actual)}$initializeConfiguration(e){this._actual=new Cti(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};$Le=D([_(0,gr),_(1,dD),_(2,Ze)],$Le);class Cti{constructor(e,t,i,s){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=f7.parse(i,s),this._configurationScopes=this._toMap(i.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){const i={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=f7.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=G7e(t)||{},o=this._toReadonlyValue(e?z5(this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,s,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,s,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?Ot.USER:Ot.WORKSPACE;switch(c){case PM.Global:return Ot.USER;case PM.Workspace:return Ot.WORKSPACE;case PM.WorkspaceFolder:return Ot.WORKSPACE_FOLDER}}const a={has(c){return typeof z5(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,s,i?.identifier);let d=z5(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(fo(f)){let m;const v=()=>{h=h||Vs(o),m=m||z5(h,p)};return new Proxy(f,{get:(w,b)=>{if(typeof b=="string"&&b.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||z5(h,p),m[b];const C=w[b];return typeof b=="string"?u(C,`${p}.${b}`):C},set:(w,b,C)=>(v(),m&&(m[b]=C),!0),deleteProperty:(w,b)=>(v(),m&&delete m[b],!0),defineProperty:(w,b,C)=>(v(),m&&Object.defineProperty(m,b,C),!0)})}return Array.isArray(f)?Vs(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=r(d);return l!==void 0?this._proxy.$updateConfigurationOption(u,c,l,s,h):this._proxy.$removeConfigurationOption(u,c,s,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,s,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:Vs(l.policy?.value??l.default?.value),globalValue:Vs(l.user?.value??l.application?.value),workspaceValue:Vs(l.workspace?.value),workspaceFolderValue:Vs(l.workspaceFolder?.value),defaultLanguageValue:Vs(l.default?.override),globalLanguageValue:Vs(l.user?.override??l.application?.override),workspaceLanguageValue:Vs(l.workspace?.override),workspaceFolderLanguageValue:Vs(l.workspaceFolder?.override),languageIds:Vs(l.overrideIdentifiers)}}};return typeof o=="object"&&ym(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>fo(i)?new Proxy(i,{get:(s,o)=>t(s[o]),set:(s,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(s,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(s,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:s=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const s=dp.test(e)?ut.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(ut.RESOURCE===s){typeof t?.resource>"u"&&this._logService.warn(`${o}Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '${e}', provide the URI of a resource or 'null' for any resource.`);return}if(ut.WINDOW===s){t?.resource&&this._logService.warn(`${o}Accessing a window scoped configuration for a resource is not expected. To associate '${e}' to a resource, define its scope to 'resource' in configuration contributions in 'package.json'.`);return}}_toConfigurationChangeEvent(e,t){const i=new ANe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,o)=>i.affectsConfiguration(s,G7e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const hD=ae("IExtHostConfiguration"),FL=(n,e,t,i)=>{let s=e;return{enumerable:!0,configurable:!1,get(){return s},set(o){if(!t(s,o)){const r=s;s=o,n.listener?.(i(o,r))}}}},cB=(n,e)=>n===e,yD={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:cB,description:cB,sortText:cB,busy:cB,error:cB,canResolveChildren:cB,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},lB=n=>e=>({op:Mh.SetProp,update:n(e)}),yti=(n,e)=>({range:(()=>{let t;const i=lB(s=>({range:O.lift(at.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:Mh.DocumentSynced}),yD.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:FL(n,e,yD.label,lB(t=>({label:t}))),description:FL(n,void 0,yD.description,lB(t=>({description:t}))),sortText:FL(n,void 0,yD.sortText,lB(t=>({sortText:t}))),canResolveChildren:FL(n,!1,yD.canResolveChildren,t=>({op:Mh.UpdateCanResolveChildren,state:t})),busy:FL(n,!1,yD.busy,lB(t=>({busy:t}))),error:FL(n,void 0,yD.error,lB(t=>({error:Qs.fromStrict(t)||null}))),tags:FL(n,[],yD.tags,(t,i)=>({op:Mh.SetTags,new:t.map(hC.from),old:i.map(hC.from)}))}),Sti=n=>{const e=bn.fromString(n.extId),t=new MO(e.controllerId,e.localId,n.label,P.revive(n.uri)||void 0);return t.range=at.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>hC.to({id:nrt(i).tagId})),t},q7e=n=>{let e;for(const t of n.tests){const i=Sti(t.item);oue(i).parent=e,e=i}return e};class MO{constructor(e,t,i,s){if(t.includes(qf.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=lKt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:s,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof jOe?void 0:o.parent}},children:{value:cKt(o,oue,MO),enumerable:!0,writable:!1},...yti(o,i)})}}class jOe extends MO{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Ati extends oKt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:oue,getChildren:s=>s.children,root:new jOe(e,t),toITestItem:J1.from})}}const Eti="vs/workbench/api/common/extHostTelemetry";let GLe=class extends ${constructor(e,t){super(),this.initData=e,this.loggerService=t,this._onDidChangeTelemetryEnabled=this._register(new I),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new I),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=sp.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=P.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:_Tt,name:g(Eti,0,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{kYe(i)&&this.updateLoggerVisibility()})),this._outputLogger.info("Below are logs for extension telemetry events sent to the telemetry output channel API once the log level is set to trace."),this._outputLogger.info("===========================================================")}updateLoggerVisibility(){this.loggerService.setVisibility(this.extHostTelemetryLogFile,this._telemetryIsSupported&&this.loggerService.getLogLevel()===Pn.Trace)}getTelemetryConfiguration(){return this._level===sp.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=sp.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=sp.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=sp.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),o=new Sat(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:s.isUsageEnabled,isErrorsEnabled:s.isErrorsEnabled}),r=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...r,o]),o.apiTelemetryLogger}$initializeTelemetryLevel(e,t,i){this._level=e,this._telemetryIsSupported=t,this._productConfig=i??{usage:!0,error:!0},this.updateLoggerVisibility()}getBuiltInCommonProperties(e){const t=Object.create(null);switch(t["common.extname"]=`${e.publisher}.${e.name}`,t["common.extversion"]=e.version,t["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,t["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,t["common.sqmid"]=this.initData.telemetryInfo.sqmId,t["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId,t["common.vscodeversion"]=this.initData.version,t["common.isnewappinstall"]=Aat(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case yw.Web:t["common.uikind"]="web";break;case yw.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=Wde(bTt(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,s)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(s):this._telemetryLoggers.set(s,o)}),this._telemetryLoggers.forEach(i=>{for(const s of i)s.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails()),this.updateLoggerVisibility()}onExtensionError(e,t){const s=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!s)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of s)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};GLe=D([_(0,Sg),_(1,wp)],GLe);class Sat{static validateSender(e){if(typeof e!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof e.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof e.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof e.flush<"u"&&typeof e.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}constructor(e,t,i,s,o,r,a){this._extension=i,this._logger=s,this._inLoggingOnlyMode=o,this._commonProperties=r,this._onDidChangeEnableStates=new I,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t="properties"in e?e.properties??{}:e;return t=mVe(t,[]),this._additionalCommonProperties&&(t=ym(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=ym(t,this._commonProperties)),"properties"in e?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(this._extension.publisher==="vscode"?e=this._extension.name+"/"+e:e=this._extension.identifier.value+"/"+e,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(e,t),this._logger.trace(e,t))}logUsage(e,t){this._telemetryEnablements.isUsageEnabled&&this.logEvent(e,t)}logError(e,t){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof e=="string")this.logEvent(e,t);else{const i={name:e.name,message:e.message,stack:e.stack,cause:e.cause},s=mVe(i,[]),o=new Error(s.message,{cause:s.cause});o.stack=s.stack,o.name=s.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(o,t),this._logger.trace("exception",t)}}get apiTelemetryLogger(){if(!this._apiObject){const e=this,t={logUsage:e.logUsage.bind(e),get isUsageEnabled(){return e._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return e._telemetryEnablements.isErrorsEnabled},logError:e.logError.bind(e),dispose:e.dispose.bind(e),onDidChangeEnableStates:e._onDidChangeEnableStates.event.bind(e)};this._apiObject=Object.freeze(t)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let e=this._sender;this._sender=void 0,Promise.resolve(e.flush()).then(e=void 0),this._apiObject=void 0}else this._sender=void 0}}function Aat(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const pue=ae("IExtHostTelemetry");var KA,bq,Cq,zqe;let qLe=(zqe=class{constructor(e,t,i){kt(this,KA);kt(this,bq);kt(this,Cq);this._commands=new Map,this._apiCommands=new Map,st(this,KA,e.getProxy(Ue.MainThreadCommands)),this._logService=t,st(this,Cq,i),st(this,bq,e.getProxy(Ue.MainThreadTelemetry)),this.converter=new xti(this,s=>{const o=this._apiCommands.get(s);return o?.result===In.Void?o:void 0},t),this._argumentProcessors=[{processArgument(s){return Or(s)}},{processArgument(s){return AU(s,function(o){if(O.isIRange(o))return at.to(o);if(oe.isIPosition(o))return Wr.to(o);if(O.isIRange(o.range)&&P.isUri(o.uri))return P_.to(o);if(o instanceof ze)return o.buffer.buffer;if(!Array.isArray(o))return o})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const s=e.args.map((r,a)=>{if(!r.validate(i[a]))throw new Error(`Invalid argument '${r.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return r.convert(i[a])}),o=await this.executeCommand(e.internalId,...s);return e.result.convert(o,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new oo(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,s,o,r){if(this._logService.trace("ExtHostCommands#registerCommand",t),!t.trim().length)throw new Error("invalid id");if(this._commands.has(t))throw new Error(`command '${t}' already exists`);return this._commands.set(t,{callback:i,thisArg:s,metadata:o,extension:r}),e&&se(this,KA).$registerCommand(t),new oo(()=>{this._commands.delete(t)&&e&&se(this,KA).$unregisterCommand(t)})}executeCommand(e,...t){return this._logService.trace("ExtHostCommands#executeCommand",e),this._doExecuteCommand(e,t,!0)}async _doExecuteCommand(e,t,i){if(this._commands.has(e))return se(this,KA).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let s=!1;const o=AU(t,function(r){if(r instanceof Ps)return Wr.from(r);if(r instanceof rs)return at.from(r);if(r instanceof _p)return P_.from(r);if(rS.isNotebookRange(r))return ES.from(r);if(r instanceof ArrayBuffer)return s=!0,ze.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return s=!0,ze.wrap(r);if(r instanceof ze)return s=!0,r;if(!Array.isArray(r))return r});try{const r=await se(this,KA).$executeCommand(e,s?new $h(o):o,i);return Or(r)}catch(r){if(r instanceof Error&&r.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw r}}}async _executeContributedCommand(e,t,i){const s=this._commands.get(e);if(!s)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=s;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),s)),this._executeContributedCommand(e,t,!0)):Promise.reject(new Error(`Contributed command '${e}' does not exist.`))}getCommands(e=!1){return this._logService.trace("ExtHostCommands#getCommands",e),se(this,KA).$getCommands().then(t=>(e&&(t=t.filter(i=>i[0]!=="_")),t))}$getContributedCommandMetadata(){const e=Object.create(null);for(const[t,i]of this._commands){const{metadata:s}=i;s&&(e[t]=s)}return Promise.resolve(e)}},KA=new WeakMap,bq=new WeakMap,Cq=new WeakMap,zqe);qLe=D([_(0,gr),_(1,Ze),_(2,pue)],qLe);const Yz=ae("IExtHostCommands");class xti{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Dr()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;const i={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return i;const s=this._lookupApiCommand(e.command);if(s)i.id=s.internalId,i.arguments=s.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(mo(e.arguments)){const o=`${e.command} /${++this._cachIdPool}`;this._cache.set(o,e),t.add(Ee(()=>{this._cache.delete(o),this._logService.trace("CommandsConverter#DISPOSE",o)})),i.$ident=o,i.id=this.delegatingCommandId,i.arguments=[o],this._logService.trace("CommandsConverter#CREATE",e.command,o)}return i}fromInternal(e){return typeof e.$ident=="string"?this._cache.get(e.$ident):{command:e.id,title:e.title,arguments:e.arguments}}getActualCommand(...e){return this._cache.get(e[0])}_executeConvertedCommand(...e){const t=this.getActualCommand(...e);return this._logService.trace("CommandsConverter#EXECUTE",e[0],t?t.command:"MISSING"),t?this._commands.executeCommand(t.command,...t.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${e[0]}`)}}const xc=class xc{static Arr(e){return new xc(`${e.name}_array`,`Array of ${e.name}, ${e.description}`,t=>Array.isArray(t)&&t.every(i=>e.validate(i)),t=>t.map(i=>e.convert(i)))}constructor(e,t,i,s){this.name=e,this.description=t,this.validate=i,this.convert=s}optional(){return new xc(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(e,t){return new xc(e??this.name,t??this.description,this.validate,this.convert)}};xc.Uri=new xc("uri","Uri of a text document",e=>P.isUri(e),e=>e),xc.Position=new xc("position","A position in a text document",e=>Ps.isPosition(e),Wr.from),xc.Range=new xc("range","A range in a text document",e=>rs.isRange(e),at.from),xc.Selection=new xc("selection","A selection in a text document",e=>XS.isSelection(e),ZS.from),xc.Number=new xc("number","",e=>typeof e=="number",e=>e),xc.String=new xc("string","",e=>typeof e=="string",e=>e),xc.StringArray=xc.Arr(xc.String),xc.CallHierarchyItem=new xc("item","A call hierarchy item",e=>e instanceof $he,KF.from),xc.TypeHierarchyItem=new xc("item","A type hierarchy item",e=>e instanceof qhe,$M.from),xc.TestItem=new xc("testItem","A VS Code TestItem",e=>e instanceof MO,J1.from);let Et=xc;const ple=class ple{constructor(e,t){this.description=e,this.convert=t}};ple.Void=new ple("no result",e=>e);let In=ple;class Vn{constructor(e,t,i,s,o){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=o}}const QLe=new Map;function Dti(n,e){e?QLe.set(n,e):QLe.delete(n)}function kti(n){return QLe.get(n)}class Iti extends Yje{constructor(e,t,i,s,o,r,a){super(t,i,s,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){nm(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return Ls(this._lines,e)}get document(){if(!this._document){const e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===_e.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===` `?jv.LF:jv.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,i){return e._getWordRangeAtPosition(t,i)}}}return Object.freeze(this._document)}_acceptLanguageId(e){nm(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){nm(!this._isDisposed),this._isDirty=e}_save(){return this._isDisposed?Promise.reject(new Error("Document has been closed")):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){const t=this._validateRange(e);if(t.isEmpty)return"";if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);const i=this._eol,s=t.start.line,o=t.end.line,r=[];r.push(this._lines[s].substring(t.start.character));for(let a=s+1;a=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new Lti(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return new Ps(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof rs))throw new Error("Invalid argument");const t=this._validatePosition(e.start),i=this._validatePosition(e.end);return t===e.start&&i===e.end?e:new rs(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof Ps))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,s=!1;if(t<0)t=0,i=0,s=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,s=!0;else{const o=this._lines[t].length;i<0?(i=0,s=!0):i>o&&(i=o,s=!0)}return s?new Ps(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=kti(this._languageId);else if(KRe(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const s=a1(i.character+1,zq(t),this._lines[i.line],0);if(s)return new rs(i.line,s.startColumn-1,i.line,s.endColumn-1)}}class Lti{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return new rs(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new rs(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}}const mle=class mle{constructor(e,t,i){const s=mle._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,s,Xke.from(i)),this.value=Object.freeze({key:s,dispose(){e.$removeTextEditorDecorationType(s)}})}};mle._Keys=new yz("TextEditorDecorationType");let jLe=mle;class Tti{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw new Error("Edit is only valid while callback runs")}replace(e,t){this._throwIfFinalized();let i=null;if(e instanceof Ps)i=new rs(e,e);else if(e instanceof rs)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new rs(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof rs)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const s=this._document.validateRange(e);this._collectedEdits.push({range:s,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==jv.LF&&e!==jv.CRLF)throw Hi("endOfLine");this._setEndOfLine=e}}class Rti{constructor(e,t,i,s){this._proxy=e,this._id=t,this._accept(i),this._logService=s;const o=this;this.value={get tabSize(){return o._tabSize},set tabSize(r){o._setTabSize(r)},get indentSize(){return o._indentSize},set indentSize(r){o._setIndentSize(r)},get insertSpaces(){return o._insertSpaces},set insertSpaces(r){o._setInsertSpaces(r)},get cursorStyle(){return o._cursorStyle},set cursorStyle(r){o._setCursorStyle(r)},get lineNumbers(){return o._lineNumbers},set lineNumbers(r){o._setLineNumbers(r)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=oH.to(e.lineNumbers)}_validateTabSize(e){if(e==="auto")return"auto";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){const t=this._validateTabSize(e);if(t!==null){if(typeof t=="number"){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError("setTabSize",this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e==="tabSize")return"tabSize";if(typeof e=="number"){const t=Math.floor(e);return t>0?t:null}if(typeof e=="string"){const t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){const t=this._validateIndentSize(e);if(t!==null){if(typeof t=="number"){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError("setIndentSize",this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e==="auto"?"auto":e==="false"?!1:!!e}_setInsertSpaces(e){const t=this._validateInsertSpaces(e);if(typeof t=="boolean"){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError("setInsertSpaces",this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError("setCursorStyle",this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError("setLineNumbers",this._proxy.$trySetOptions(this._id,{lineNumbers:oH.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const s=this._validateTabSize(e.tabSize);s==="auto"?(i=!0,t.tabSize=s):typeof s=="number"&&this._tabSize!==s&&(this._tabSize=s,i=!0,t.tabSize=s)}if(typeof e.indentSize<"u"){const s=this._validateIndentSize(e.indentSize);s==="tabSize"?(i=!0,t.indentSize=s):typeof s=="number"&&this._originalIndentSize!==s&&(this._indentSize=s,this._originalIndentSize=s,i=!0,t.indentSize=s)}if(typeof e.insertSpaces<"u"){const s=this._validateInsertSpaces(e.insertSpaces);s==="auto"?(i=!0,t.insertSpaces=s):this._insertSpaces!==s&&(this._insertSpaces=s,i=!0,t.insertSpaces=s)}typeof e.cursorStyle<"u"&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,i=!0,t.cursorStyle=e.cursorStyle),typeof e.lineNumbers<"u"&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,i=!0,t.lineNumbers=oH.from(e.lineNumbers)),i&&this._warnOnError("setOptions",this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(i=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(i)})}}class Mti{constructor(e,t,i,s,o,r,a,c){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=o,this._options=new Rti(this._proxy,this.id,r,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return s.value},set document(d){throw new cR("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof XS))throw Hi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof XS)))throw Hi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new cR("visibleRanges")},get options(){return l._options.value},set options(d){l._disposed||l._options.assign(d)},get viewColumn(){return l._viewColumn},set viewColumn(d){throw new cR("viewColumn")},edit(d,h={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#edit not possible on closed editors"));const u=new Tti(s.value,h);return d(u),l._applyEdit(u)},insertSnippet(d,h,u={undoStopBefore:!0,undoStopAfter:!0}){if(l._disposed)return Promise.reject(new Error("TextEditor#insertSnippet not possible on closed editors"));let f;if(!h||Array.isArray(h)&&h.length===0)f=l._selections.map(p=>at.from(p));else if(h instanceof Ps){const{lineNumber:p,column:m}=Wr.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof rs)f=[at.from(h)];else{f=[];for(const p of h)if(p instanceof rs)f.push(at.from(p));else{const{lineNumber:m,column:v}=Wr.from(p);f.push({startLineNumber:m,startColumn:v,endLineNumber:m,endColumn:v})}}return t.$tryInsertSnippet(e,s.value.version,d.value,f,u)},setDecorations(d,h){const u=h.length===0;u&&!l._hasDecorationsForKey.has(d.key)||(u?l._hasDecorationsForKey.delete(d.key):l._hasDecorationsForKey.add(d.key),l._runOnProxy(()=>{if(ort(h))return t.$trySetDecorations(e,d.key,uKt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,at.from(d),h||U6.Default))},show(d){t.$tryShowEditor(e,yd.from(d))},hide(){t.$tryHideEditor(e)}})}dispose(){nm(!this._disposed),this._disposed=!0}_acceptOptions(e){nm(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){nm(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){nm(!this._disposed),this._viewColumn=e}_acceptSelections(e){nm(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(ZS.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){const t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);const i=t.edits.map(o=>o.range);i.sort((o,r)=>o.end.line===r.end.line?o.end.character===r.end.character?o.start.line===r.start.line?o.start.character-r.start.character:o.start.line-r.start.line:o.end.character-r.end.character:o.end.line-r.end.line);for(let o=0,r=i.length-1;o({range:at.from(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,s,{setEndOfLine:typeof t.setEndOfLine=="number"?R4.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn("TextEditor is closed/disposed"),Promise.resolve(void 0)):e().then(()=>this,t=>(t instanceof Error&&t.name==="DISPOSED"||this._logService.warn(t),null))}}class Nti{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let KLe=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new wi,this._onDidAddDocuments=new I,this._onDidRemoveDocuments=new I,this._onDidChangeVisibleTextEditors=new I,this._onDidChangeActiveTextEditor=new I,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){const t=[],i=[],s=[];if(e.removedDocuments)for(const o of e.removedDocuments){const r=P.revive(o),a=this._documents.get(r);a?.unref()&&(this._documents.delete(r),t.push(a.value))}if(e.addedDocuments)for(const o of e.addedDocuments){const r=P.revive(o.uri);let a=this._documents.get(r);if(a&&r.scheme!==_e.vscodeNotebookCell&&r.scheme!==_e.vscodeInteractiveInput)throw new Error(`document '${r} already exists!'`);a||(a=new Nti(new Iti(this._extHostRpc.getProxy(Ue.MainThreadDocuments),r,o.lines,o.EOL,o.versionId,o.languageId,o.isDirty)),this._documents.set(r,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const o of e.removedEditors){const r=this._editors.get(o);this._editors.delete(o),r&&s.push(r)}if(e.addedEditors)for(const o of e.addedEditors){const r=P.revive(o.documentUri);nm(this._documents.has(r),`document '${r}' does not exist`),nm(!this._editors.has(o.id),`editor '${o.id}' already exists!`);const a=this._documents.get(r).value,c=new Mti(o.id,this._extHostRpc.getProxy(Ue.MainThreadTextEditors),this._logService,new Ka(()=>a.document),o.selections.map(ZS.to),o.options,o.visibleRanges.map(l=>at.to(l)),typeof o.editorPosition=="number"?yd.to(o.editorPosition):void 0);this._editors.set(o.id,c)}e.newActiveEditor!==void 0&&(nm(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),St(t),St(s),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(o=>o.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return fi.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;const t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};KLe=D([_(0,gr),_(1,Ze)],KLe);const oj=ae("IExtHostDocumentsAndEditors"),Pti="vs/workbench/api/common/extHostTerminalService",Jz=ae("IExtHostTerminalService");class Q7e extends ${constructor(e,t,i,s){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=s,this._disposed=!1,this._state={isInteractedWith:!1},this.isOpen=!1,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(r=>this._pidPromiseComplete=r);const o=this;this.value={get name(){return o._name||""},get processId(){return o._pidPromise},get creationOptions(){return o._creationOptions},get exitStatus(){return o._exitStatus},get state(){return o._state},get selection(){return o._selection},get shellIntegration(){return o.shellIntegration},sendText(r,a=!0){o._checkDisposed(),o._proxy.$sendText(o._id,r,a)},show(r){o._checkDisposed(),o._proxy.$show(o._id,r)},hide(){o._checkDisposed(),o._proxy.$hide(o._id)},dispose(){o._disposed||(o._disposed=!0,o._proxy.$dispose(o._id))},get dimensions(){if(!(o._cols===void 0||o._rows===void 0))return{columns:o._cols,rows:o._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!="string")throw new Error("Terminal has already been created");await this._proxy.$createTerminal(this._id,{name:e.name,shellPath:e.shellPath??void 0,shellArgs:e.shellArgs??void 0,cwd:e.cwd??t?.cwd??void 0,env:e.env??void 0,icon:Eat(e.iconPath)??void 0,color:OU.isThemeColor(e.color)?e.color.id:void 0,initialText:e.message??void 0,strictEnv:e.strictEnv??void 0,hideFromUser:e.hideFromUser??void 0,forceShellIntegration:t?.forceShellIntegration??void 0,isFeatureTerminal:t?.isFeatureTerminal??void 0,isExtensionOwnedTerminal:!0,useShellEnvironment:t?.useShellEnvironment??void 0,location:t?.location||this._serializeParentTerminal(e.location,t?.resolvedExtHostIdentifier),isTransient:e.isTransient??void 0})}async createExtensionTerminal(e,t,i,s,o){if(typeof this._id!="string")throw new Error("Terminal has already been created");if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:s,color:OU.isThemeColor(o)?o.id:void 0,location:t?.location||this._serializeParentTerminal(e,i),isTransient:!0}),typeof this._id=="string")throw new Error("Terminal creation failed");return this._id}_serializeParentTerminal(e,t){return typeof e=="object"?"parentTerminal"in e&&e.parentTerminal&&t?{parentTerminal:t}:"viewColumn"in e?{viewColumn:yd.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw new Error("Terminal has already been disposed")}set name(e){this._name=e}setExitStatus(e,t){this._exitStatus=Object.freeze({code:e,reason:t})}setDimensions(e,t){return e===this._cols&&t===this._rows||e===0||t===0?!1:(this._cols=e,this._rows=t,!0)}setInteractedWith(){return this._state.isInteractedWith?!1:(this._state={isInteractedWith:!0},!0)}setSelection(e){this._selection=e}_setProcessId(e){this._pidPromiseComplete?(this._pidPromiseComplete(e),this._pidPromiseComplete=void 0):this._pidPromise.then(t=>{t!==e&&(this._pidPromise=Promise.resolve(e))})}}class mme{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new I,this.onProcessData=this._onProcessData.event,this._onProcessReady=new I,this._onDidChangeProperty=new I,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new I,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw new Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw new Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve("")}getCwd(){return Promise.resolve("")}startSendingEvents(e){this._pty.onDidWrite(t=>this._onProcessData.fire(t)),this._pty.onDidClose?.((t=void 0)=>{this._onProcessExit.fire(t===void 0?void 0:t)}),this._pty.onDidOverrideDimensions?.(t=>{t&&this._onDidChangeProperty.fire({type:jf.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:jf.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let Fti=1,YLe=class extends ${get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,i){super(),this._extHostCommands=t,this._terminals=[],this._terminalProcesses=new Map,this._terminalProcessDisposables={},this._extensionTerminalAwaitingStart={},this._getTerminalPromises={},this._environmentVariableCollections=new Map,this._lastQuickFixCommands=this._register(new Dn),this._linkProviders=new Set,this._profileProviders=new Map,this._quickFixProviders=new Map,this._terminalLinkCache=new Map,this._terminalLinkCancellationSource=new Map,this._onDidCloseTerminal=new I,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new I,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new I,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new I,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new I,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new I,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new I({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new I({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=i.getProxy(Ue.MainThreadTerminalService),this._bufferer=new urt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:s=>{const o=r=>{const a=r;return this.getTerminalById(a.instanceId)?.value};switch(s?.$mid){case Fs.TerminalContext:return o(s);default:{if(Array.isArray(s))for(let r=0;r{for(const[s,o]of this._terminalProcesses)o.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||""}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){const i=new Q7e(this._proxy,Dr(),e,e.name),s=new mme(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Eat(e.iconPath),Bti(e.color)).then(o=>{const r=this._setupExtHostProcessListeners(o,s);this._terminalProcessDisposables[o]=r}),this._terminals.push(i),i.value}_serializeParentTerminal(e,t){if(t=t||{},e.location&&typeof e.location=="object"&&"parentTerminal"in e.location){const i=e.location.parentTerminal;if(i){const s=this._terminals.find(o=>o.value===i);s&&(t.resolvedExtHostIdentifier=s._id)}}else e.location&&typeof e.location!="object"?t.location=e.location:t.location&&typeof t.location=="object"&&"splitActiveTerminal"in t.location&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw new Error(`Cannot resolve terminal with id ${e} for virtual process`);const s=new mme(t),o=this._setupExtHostProcessListeners(e,s);this._terminalProcessDisposables[e]=o}async $acceptActiveTerminalChanged(e){const t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}const i=this.getTerminalById(e);i&&(this._activeTerminal=i,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){const i=this.getTerminalById(e);i&&this._onDidWriteTerminalData.fire({terminal:i.value,data:t})}async $acceptTerminalDimensions(e,t,i){const s=this.getTerminalById(e);s&&s.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:s.value,dimensions:s.value.dimensions})}async $acceptDidExecuteCommand(e,t){const i=this.getTerminalById(e);i&&this._onDidExecuteCommand.fire({terminal:i.value,...t})}async $acceptTerminalMaximumDimensions(e,t,i){this._terminalProcesses.get(e)?.resize(t,i)}async $acceptTerminalTitleChange(e,t){const i=this.getTerminalById(e);i&&(i.name=t)}async $acceptTerminalClosed(e,t,i){const s=this._getTerminalObjectIndexById(this._terminals,e);if(s!==null){const o=this._terminals.splice(s,1)[0];o.setExitStatus(t,i),this._onDidCloseTerminal.fire(o.value)}}$acceptTerminalOpened(e,t,i,s){if(t){const a=this._getTerminalObjectIndexById(this._terminals,t);if(a!==null){this._terminals[a]._id=e,this._onDidOpenTerminal.fire(this.terminals[a]),this._terminals[a].isOpen=!0;return}}const o={name:s.name,shellPath:s.executable,shellArgs:s.args,cwd:typeof s.cwd=="string"?s.cwd:P.revive(s.cwd),env:s.env,hideFromUser:s.hideFromUser},r=new Q7e(this._proxy,e,o,i);this._terminals.push(r),this._onDidOpenTerminal.fire(r.value),r.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){const i=this.getTerminalById(e);if(!i)return{message:g(Pti,0,"Could not find the terminal with id {0} on the extension host",e)};i.isOpen||await new Promise(o=>{const r=this.onDidOpenTerminal(async a=>{a===i.value&&(r.dispose(),o())})});const s=this._terminalProcesses.get(e);s?s.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){const i=new Z;i.add(t.onProcessReady(o=>this._proxy.$sendProcessReady(e,o.pid,o.cwd,o.windowsPty))),i.add(t.onDidChangeProperty(o=>this._proxy.$sendProcessProperty(e,o))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(o=>this._onProcessExit(e,o))),this._terminalProcesses.set(e,t);const s=this._extensionTerminalAwaitingStart[e];return s&&t instanceof mme&&(t.startSendingEvents(s.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),i}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){const t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,i){try{this._terminalProcesses.get(e)?.resize(t,i)}catch(s){if(s.code!=="EPIPE"&&s.code!=="ERR_IPC_CHANNEL_CLOSED")throw s}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:jf.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:jf.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new oo(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}registerProfileProvider(e,t,i){if(this._profileProviders.has(t))throw new Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,i),this._proxy.$registerProfileProvider(t,e.identifier.value),new oo(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalQuickFixProvider(e,t,i){if(this._quickFixProviders.has(e))throw new Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,i),this._proxy.$registerQuickFixProvider(e,t),new oo(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ai().token;if(i.isCancellationRequested)return;const s=this._quickFixProviders.get(e);if(!s)return;const o=await s.provideTerminalQuickFixes(t,i);if(o===null||Array.isArray(o)&&o.length===0)return;const r=new Z;if(this._lastQuickFixCommands.value=r,!Array.isArray(o))return o?koe.from(o,this._extHostCommands.converter,r):void 0;const a=[];for(const c of o){const l=koe.from(c,this._extHostCommands.converter,r);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new ai().token;let s=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(s&&!("options"in s)&&(s={options:s}),!s||!("options"in s))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in s.options){this.createExtensionTerminal(s.options,t);return}this.createTerminalFromOptions(s.options,t)}}async $provideLinks(e,t){const i=this.getTerminalById(e);if(!i)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);const o=new ai;this._terminalLinkCancellationSource.set(e,o);const r=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(ko.withAsyncBody(async u=>{o.token.onCancellationRequested(()=>u({provider:h,links:[]}));const f=await h.provideTerminalLinks(a,o.token)||[];o.token.isCancellationRequested||u({provider:h,links:f})}));const l=await Promise.all(c);if(o.token.isCancellationRequested)return[];const d=new Map;for(const h of l)h&&h.links.length>0&&r.push(...h.links.map(u=>{const f={id:Fti++,startIndex:u.startIndex,length:u.length,label:u.tooltip};return d.set(f.id,{provider:h.provider,link:u}),f}));return this._terminalLinkCache.set(e,d),r}$activateLink(e,t){const i=this._terminalLinkCache.get(e)?.get(t);i&&i.provider.handleTerminalLink(i.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];const i=this._terminalProcessDisposables[e];i&&(i.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){const t=this._terminals.findIndex(i=>i.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){const i=this._getTerminalObjectIndexById(e,t);return i!==null?e[i]:null}_getTerminalObjectIndexById(e,t){const i=e.findIndex(s=>s._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=new j7e,this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=grt(t.map),s=MKt(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,s)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],s=new j7e(t[1]);this._setEnvironmentVariableCollection(i,s)})}$acceptDefaultProfile(e,t){const i=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,i?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)})}};YLe=D([_(1,Yz),_(2,gr)],YLe);class j7e{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=new I,this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){const t=this.getScopeKey(e);let i=this.scopedCollections.get(t);return i||(i=new Oti(this,e),this.scopedCollections.set(t,i),i.onDidChangeCollection(()=>this._onDidChangeCollection.fire())),i}replace(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Replace,options:i??{applyAtProcessCreation:!0},scope:s})}append(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Append,options:i??{applyAtProcessCreation:!0},scope:s})}prepend(e,t,i,s){this._setIfDiffers(e,{value:t,type:LM.Prepend,options:i??{applyAtProcessCreation:!0},scope:s})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw new Error("EnvironmentVariableMutatorOptions must apply at either process creation or shell integration");const i=this.getKey(e,t.scope),s=this.map.get(i),o=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!s||s.value!==t.value||s.type!==t.type||s.options?.applyAtProcessCreation!==o.applyAtProcessCreation||s.options?.applyAtShellIntegration!==o.applyAtShellIntegration||s.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const r=this.getKey(e,t.scope),a={variable:e,...t,options:o};this.map.set(r,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),s=this.map.get(i);return s?K7e(s):void 0}getKey(e,t){const i=this.getScopeKey(t);return i.length?`${e}:::${i}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??""}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){const t=new Map;for(const[i,s]of this.map)this.getScopeKey(s.scope)===this.getScopeKey(e)&&t.set(s.variable,K7e(s));return t}delete(e,t){const i=this.getKey(e,t);this.map.delete(i),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(const[t,i]of this.map)i.scope?.workspaceFolder?.index===e.workspaceFolder.index&&this.map.delete(t);this.clearDescription(e)}else this.map.clear(),this.descriptionMap.clear();this._onDidChangeCollection.fire()}setDescription(e,t){const i=this.getScopeKey(t),s=this.descriptionMap.get(i);if(!s||s.description!==e){let o;typeof e=="string"?o=e:o=e?.value.split(` -`)[0];const r={description:o,scope:t};this.descriptionMap.set(i,r),this._onDidChangeCollection.fire()}}getDescription(e){const t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){const t=this.getScopeKey(e);this.descriptionMap.delete(t)}}class Oti{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new I}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,i){this.collection.replace(e,t,i,this.scope)}append(e,t,i){this.collection.append(e,t,i,this.scope)}prepend(e,t,i){this.collection.prepend(e,t,i,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((i,s)=>e.call(t,s,i,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}}let JLe=class extends YLe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new tE}createTerminalFromOptions(e,t){throw new tE}};JLe=D([_(0,Yz),_(1,gr)],JLe);function Eat(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}function Bti(n){return OU.isThemeColor(n)?n:void 0}function K7e(n){const e={...n};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const mue=ae("IExtHostApiDeprecationService");let XLe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Ue.MainThreadTelemetry)}report(e,t,i){const s=this.getUsageKey(e,t);this._reportedUsages.has(s)||(this._reportedUsages.add(s),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${i}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};XLe=D([_(0,gr),_(1,Ze)],XLe);var Dre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(Dre||(Dre={}));var kre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(kre||(kre={}));var ZLe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(ZLe||(ZLe={}));var P8;(function(n){function e(s){if(s){const o=s;return o&&!!o.process}else return!1}n.is=e;function t(s){if(s==null)return;const o={process:s.process,args:s.args};return s.options&&(o.options=ZLe.from(s.options)),o}n.from=t;function i(s){if(s!=null)return new zF(s.process,s.args,s.options)}n.to=i})(P8||(P8={}));var eTe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(eTe||(eTe={}));var F8;(function(n){function e(s){if(s){const o=s;return o&&(!!o.commandLine||!!o.command)}else return!1}n.is=e;function t(s){if(s==null)return;const o={};return s.commandLine!==void 0?o.commandLine=s.commandLine:(o.command=s.command,o.args=s.args),s.options&&(o.options=eTe.from(s.options)),o}n.from=t;function i(s){if(!(s==null||s.command===void 0&&s.commandLine===void 0))return s.commandLine?new j1(s.commandLine,s.options):new j1(s.command,s.args?s.args:[],s.options)}n.to=i})(F8||(F8={}));var Dx;(function(n){function e(s){if(s){const o=s;return o&&o.customExecution==="customExecution"}else return!1}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s,o){return o.get(s)}n.to=i})(Dx||(Dx={}));var tTe;(function(n){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}n.from=e})(tTe||(tTe={}));var yI;(function(n){function e(s,o){if(s==null)return[];const r=[];for(const a of s){const c=t(a,o);c&&r.push(c)}return r}n.fromMany=e;function t(s,o){if(s==null)return;let r;s.execution instanceof zF?r=P8.from(s.execution):s.execution instanceof j1?r=F8.from(s.execution):s.execution&&s.execution instanceof Ghe&&(r=Dx.from(s.execution));const a=Dre.from(s.definition);let c;return s.scope?typeof s.scope=="number"?c=s.scope:c=s.scope.uri:c=K1.Workspace,!a||!c?void 0:{_id:s._id,definition:a,name:s.name,source:{extensionId:o.identifier.value,label:s.source,scope:c},execution:r,isBackground:s.isBackground,group:tTe.from(s.group),presentationOptions:kre.from(s.presentationOptions),problemMatchers:s.problemMatchers,hasDefinedMatchers:s.hasDefinedMatchers,runOptions:s.runOptions?s.runOptions:{reevaluateOnRerun:!0},detail:s.detail}}n.from=t;async function i(s,o,r){if(s==null)return;let a;P8.is(s.execution)?a=P8.to(s.execution):F8.is(s.execution)?a=F8.to(s.execution):Dx.is(s.execution)&&(a=Dx.to(s._id,r));const c=Dre.to(s.definition);let l;if(s.source&&(s.source.scope!==void 0?typeof s.source.scope=="number"?l=s.source.scope:l=await o.resolveWorkspaceFolder(P.revive(s.source.scope)):l=K1.Workspace),!c||!l)return;const d=new G6(c,l,s.name,s.source.label,a,s.problemMatchers);return s.isBackground!==void 0&&(d.isBackground=s.isBackground),s.group!==void 0&&(d.group=d4.from(s.group._id),d.group&&s.group.isDefault&&(d.group=new d4(d.group.id,d.group.label),s.group.isDefault===!0&&(d.group.isDefault=s.group.isDefault))),s.presentationOptions&&(d.presentationOptions=kre.to(s.presentationOptions)),s._id&&(d._id=s._id),s.detail&&(d.detail=s.detail),d}n.to=i})(yI||(yI={}));var iTe;(function(n){function e(i){return i}n.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}n.to=t})(iTe||(iTe={}));var yq;class _me{constructor(e,t,i){kt(this,yq);this._id=t,this._task=i,st(this,yq,e)}get task(){return this._task}terminate(){se(this,yq).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}yq=new WeakMap;let nTe=class{constructor(e,t,i,s,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Ue.MainThreadTask),this._workspaceProvider=i,this._editorService=s,this._configurationService=o,this._terminalService=r,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=c,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,i){if(!i)return new oo(()=>{});const s=this.nextHandle();return this._handlers.set(s,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(s,t),new oo(()=>{this._handlers.delete(s),this._proxy.$unregisterTaskProvider(s)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(iTe.from(e)).then(async t=>{const i=[];for(const s of t){const o=await yI.to(s,this._workspaceProvider,this._providedCustomExecutions2);o&&i.push(o)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof _me))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,i){const s=this._providedCustomExecutions2.get(e.id);s&&(this._activeCustomExecutions2.set(e.id,s),this._terminalService.attachPtyToTerminal(t,await s.callback(i))),this._lastStartedTask=e.id,this._onDidExecuteTask.fire({execution:await this.getTaskExecution(e)})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;const t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}$provideTasks(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));const s=[],o=Zu(()=>i.provider.provideTasks(qe.None)).then(r=>this.provideTasksInternal(t,s,i,r));return new Promise(r=>{o.then(a=>{Promise.all(s).then(()=>{r(a)})})})}async $resolveTask(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));if(t.definition.type!==i.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${i.type}].`);const s=await yI.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!s)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(s,qe.None);if(!o)return;this.checkDeprecation(o,i);const r=yI.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==s.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return Dx.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const s=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(s)&&(this._notProvidedCustomExecutions.add(s),this._activeCustomExecutions2.set(s,t.execution)),this._providedCustomExecutions2.set(s,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new hc("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let s;return t?s=Promise.resolve(new _me(this,e.id,t)):s=yI.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new hc("Unexpected: Task does not exist.");return new _me(this,e.id,o)}),this._taskExecutionPromises.set(e.id,s),s.then(o=>(this._taskExecutions.set(e.id,o),o))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));const i=this._notProvidedCustomExecutions.values();let s=i.next();for(;!s.done;)!this._activeCustomExecutions2.has(s.value)&&this._lastStartedTask!==s.value&&(this._providedCustomExecutions2.delete(s.value),this._notProvidedCustomExecutions.delete(s.value)),s=i.next()}};nTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,mue)],nTe);let sTe=class extends nTe{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,o,r,a,c),this.registerTaskSystem(_e.vscodeRemote,{scheme:_e.vscodeRemote,authority:"",platform:Kct(Hh.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=yI.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(Dx.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new tE;const s=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),s}provideTasksInternal(e,t,i,s){const o=[];if(s)for(const r of s){if(this.checkDeprecation(r,i),!r.definition||!e[r.definition.type]){const c=r.source?r.source:"No task source";this._logService.warn(`The task [${c}, ${r.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=yI.from(r,i.extension);a&&Dx.is(a.execution)?(o.push(a),t.push(this.addCustomExecution(a,r,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:o,extension:i.extension}}async resolveTaskInternal(e){if(Dx.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,i){}};sTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,mue)],sTe);const xat=ae("IExtHostTask"),rj=ae("IExtHostEditorTabs");class Y7e{constructor(e,t,i){this._activeTabIdGetter=i,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case Fa.TextInput:return new Qhe(P.revive(this._dto.input.uri));case Fa.TextDiffInput:return new gG(P.revive(this._dto.input.original),P.revive(this._dto.input.modified));case Fa.TextMergeInput:return new wOe(P.revive(this._dto.input.base),P.revive(this._dto.input.input1),P.revive(this._dto.input.input2),P.revive(this._dto.input.result));case Fa.CustomEditorInput:return new jhe(P.revive(this._dto.input.uri),this._dto.input.viewType);case Fa.WebviewEditorInput:return new bOe(this._dto.input.viewType);case Fa.NotebookInput:return new Khe(P.revive(this._dto.input.uri),this._dto.input.notebookType);case Fa.NotebookDiffInput:return new Yhe(P.revive(this._dto.input.original),P.revive(this._dto.input.modified),this._dto.input.notebookType);case Fa.TerminalEditorInput:return new COe;case Fa.InteractiveEditorInput:return new yOe(P.revive(this._dto.input.uri),P.revive(this._dto.input.inputBoxUri));case Fa.ChatEditorInput:return new SOe;case Fa.MultiDiffEditorInput:return new Not(this._dto.input.diffEditors.map(e=>new gG(P.revive(e.original),P.revive(e.modified))));default:return}}}class Wti{constructor(e,t){this._tabs=[],this._activeTabId="",this._dto=e,this._activeGroupIdGetter=t;for(const i of e.tabs)i.isActive&&(this._activeTabId=i.id),this._tabs.push(new Y7e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return yd.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(i=>i.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(i=>i.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===gu.TAB_OPEN){const i=new Y7e(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,i),e.tabDto.isActive&&(this._activeTabId=i.tabId),i}else if(e.kind===gu.TAB_CLOSE){const i=this._tabs.splice(e.index,1)[0];if(!i)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return i.tabId===this._activeTabId&&(this._activeTabId=""),i}else if(e.kind===gu.TAB_MOVE){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");const i=this._tabs.splice(e.oldIndex,1)[0];if(!i)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,i),i}const t=this._tabs.find(i=>i.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}}let oTe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Ue.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){const e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(i=>i.apiObject))},get activeTabGroup(){const i=e._activeGroupId;return ws(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,s)=>{const o=Array.isArray(i)?i:[i];return o.length?Hti(o[0])?this._closeGroups(o,s):this._closeTabs(o,s):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){const t=new Set(this._extHostTabGroups.map(l=>l.groupId)),i=new Set(e.map(l=>l.groupId)),s=Ple(t,i),o=this._extHostTabGroups.filter(l=>s.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new Wti(l,()=>this._activeGroupId);return s.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=ws(e.find(l=>l.isActive===!0)?.groupId);c!==void 0&&this._activeGroupId!==c&&(this._activeGroupId=c),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:o,changed:a}))}$acceptTabGroupUpdate(e){const t=this._extHostTabGroups.find(i=>i.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){const t=this._extHostTabGroups.find(s=>s.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");const i=t.acceptTabOperation(e);switch(e.kind){case gu.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case gu.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case gu.TAB_MOVE:case gu.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[i.apiObject]}));return}}_findExtHostTabFromApi(e){for(const t of this._extHostTabGroups)for(const i of t.tabs)if(i.apiObject===e)return i}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){const i=[];for(const s of e){const o=this._findExtHostTabFromApi(s);if(!o)throw new Error("Tab close: Invalid tab not found!");i.push(o.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const s of e){const o=this._findExtHostTabGroupFromApi(s);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};oTe=D([_(0,gr)],oTe);function Hti(n){return n.tabs!==void 0}const _le=class _le{constructor(e,t,i,s){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=s}};_le.NONE=new _le(!1,-1,-1,-1);let G4=_le;class J7e{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new G4(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}}class _ue{constructor(e,t,i,s,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=s,this.exports=o,this.subscriptions=r}}class Uti extends _ue{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,[])}}class Vti extends _ue{constructor(){super(!1,null,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}class Ire extends _ue{constructor(e){super(!0,e,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}let rTe=class{constructor(e,t,i,s){this._logService=s,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new $a,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(const[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){const e=[];for(const[t,i]of this._operations)e.push(i.wait());await Promise.all(e)}isActivated(e){const t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){const t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;const i=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(i.map(s=>({id:s.identifier,reason:{startup:t,extensionId:s.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){const i=this._registry.getExtensionDescription(e);if(!i)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:i.identifier,reason:t}])}async _activateExtensions(e){const t=e.filter(i=>!this.isActivated(i.id)).map(i=>this._handleActivationRequest(i));await Promise.all(t.map(i=>i.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);const t=this._registry.getExtensionDescription(e.id);if(!t){const o=new Error(`Cannot activate unknown extension '${e.id.value}'`),r=this._createAndSaveOperation(e,null,[],new Ire(o));return this._host.onExtensionActivationError(e.id,o,new UVe(e.id.value)),r}const i=[],s=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of s){if(this._isResolvedExtension(o))continue;const r=this._operations.get(o);if(r){i.push(r);continue}if(this._isHostExtension(o)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(o).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(o);if(a){if(!a.main&&!a.browser)continue;i.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}const c=t.displayName||t.identifier.value,l=new Error(`Cannot activate the '${c}' extension because it depends on unknown extension '${o}'`),d=this._createAndSaveOperation(e,t.displayName,[],new Ire(l));return this._host.onExtensionActivationError(t.identifier,l,new UVe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,s){const o=new aTe(e.id,t,e.reason,i,s,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return UI.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};rTe=D([_(3,Ze)],rTe);let aTe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,s,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=s,this._value=o,this._host=r,this._logService=a,this._barrier=new Uh,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){const t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new Ire(t),this._isDisposed&&Na(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};aTe=D([_(6,Ze)],aTe);class Dat{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Ue.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const s=await this._proxy.$initializeExtensionStorage(e,t);let o;return s&&(o=this.safeParseValue(e,t,s)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const s=this.safeParseValue(e,t,i);s&&this._onDidChangeStorage.fire({shared:e,key:t,value:s})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(s){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${s}`)}}}const KOe=ae("IExtHostStorage");class kat{constructor(e,t,i){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=i,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(s=>(this._value=s,this)),this._storageListener=this._storage.onDidChangeStorage(s=>{s.shared===this._shared&&s.key===this._id&&(this._value=s.value)}),this._scheduler=new yn(()=>{const s=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of s.values())o.complete()}catch(o){for(const r of s.values())r.error(o)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let i=this._value[e];return typeof i>"u"&&(i=t),i}update(e,t){this._value[e]=t;const i=this._deferredPromises.get(e);if(i!==void 0)return i.p;const s=new sd;return this._deferredPromises.set(e,s),this._scheduler.isScheduled()||this._scheduler.schedule(),s.p}dispose(){this._storageListener.dispose()}}class zti extends kat{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}}const YOe=ae("IExtensionStoragePaths");let cTe=class{constructor(e,t,i){this._logService=t,this._extHostFileSystem=i,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(s=>this._value=s)}async _getWorkspaceStorageURI(e){return P.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);const e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(P.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:P.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(i){this._logService.error("[ExtHostStorage]",i);return}}workspaceValue(e){if(this._value)return P.joinPath(this._value,e.identifier.value)}globalValue(e){return P.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};cTe=D([_(0,Sg),_(1,Ze),_(2,gue)],cTe);const JOe=ae("IExtHostAuthentication");let lTe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new X7e,this._getSessionsTaskSingler=new X7e,this._proxy=e.getProxy(Ue.MainThreadAuthentication)}async getSession(e,t,i,s={}){const o=Cn.toKey(e.identifier),r=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${o} ${t} ${r}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,o,a,s)})}async getSessions(e,t,i){const s=Cn.toKey(e.identifier),o=[...i].sort().join(" ");return await this._getSessionsTaskSingler.getOrCreate(`${s} ${o}`,async()=>{await this._proxy.$ensureProvider(t);const r=e.displayName||e.name;return this._proxy.$getSessions(t,i,s,r)})}async removeSession(e,t){const i=this._authenticationProviders.get(e);return i?i.provider.removeSession(t):this._proxy.$removeSession(e,t)}registerAuthenticationProvider(e,t,i,s){if(this._authenticationProviders.get(e))throw new Error(`An authentication provider with id '${e}' is already registered.`);this._authenticationProviders.set(e,{label:t,provider:i,options:s??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,s?.supportsMultipleAccounts??!1),new oo(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const s=this._authenticationProviders.get(e);if(s)return await s.provider.createSession(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $getSessions(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.getSessions(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(tue)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};lTe=D([_(0,gr)],lTe);class X7e{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const s=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,s),s}}var dTe;const $ti="vs/workbench/api/common/extHostLanguageModels",XOe=ae("IExtHostLanguageModels");class Z7e{constructor(e,t){this.option=e,this.stream=new M9,this.stream=t??new M9}}class Gti{constructor(){this._responseStreams=new Map,this._defaultStream=new M9,this._isDone=!1,this._isStreaming=!1;const e=this;this.apiObject={text:e._defaultStream.asyncIterable}}*_streams(){if(this._responseStreams.size>0)for(const[,e]of this._responseStreams)yield e.stream;else yield this._defaultStream}handleFragment(e){if(this._isDone)return;this._isStreaming=!0;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new Z7e(e.index,this._defaultStream):t=new Z7e(e.index),this._responseStreams.set(e.index,t)),t.stream.emitOne(e.part)}get isStreaming(){return this._isStreaming}reject(e){this._isDone=!0;for(const t of this._streams())t.reject(e)}resolve(){this._isDone=!0;for(const e of this._streams())e.resolve()}}var XP;let hTe=(XP=class{constructor(e,t,i){this._logService=t,this._extHostAuthentication=i,this._onDidChangeModelAccess=new I,this._onDidChangeProviders=new I,this.onDidChangeProviders=this._onDidChangeProviders.event,this._languageModels=new Map,this._allLanguageModelData=new Map,this._modelAccessList=new $a,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,s){const o=dTe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;s.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof s.auth=="object"?s.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Cn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:s.vendor??Cn.toKey(e.identifier),name:s.name??"",family:s.family??"",version:s.version,maxInputTokens:s.maxInputTokens,maxOutputTokens:s.maxOutputTokens,auth:r,targetExtensions:s.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Cn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $provideLanguageModelResponse(e,t,i,s,o,r){const a=this._languageModels.get(e);if(!a)return;const c=new cf(async l=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}this._proxy.$handleProgressChunk(t,{index:l.index,part:l.part})});return a.provider.provideLanguageModelResponse(s.map(y8.to),o,Cn.toKey(i),c,r)}$provideTokenLength(e,t,i){const s=this._languageModels.get(e);return s?Promise.resolve(s.provider.provideTokenCount(t,i)):Promise.resolve(0)}$acceptChatModelMetadata(e){if(e.added)for(const{identifier:t,metadata:i}of e.added)this._allLanguageModelData.set(t,{metadata:i,apiObjects:new $a});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,s]of this._pendingRequest)s.languageModelId===t&&(s.res.reject(new Tc),this._pendingRequest.delete(i))}e.added?.forEach(t=>this._fakeAuthPopulate(t.metadata)),this._onDidChangeProviders.fire(void 0)}async selectLanguageModels(e,t){const i=await this._proxy.$selectChatModels({...t,extension:e.identifier}),s=[],o=this;for(const r of i){const a=this._allLanguageModelData.get(r);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:r,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._computeTokenLength(r,l,d??qe.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??qe.None)}},a.apiObjects.set(e.identifier,c)),s.push(c)}return s}async _sendChatRequest(e,t,i,s,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw qg.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},s.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw qg.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);const l=Math.random()*1e6|0,d=this._proxy.$fetchResponse(a,t,l,r,s.modelOptions??{},o),h=new Uh,u=new Gti;this._pendingRequest.set(l,{languageModelId:t,res:u});let f;if(d.catch(p=>{h.isOpen()?u.reject(p):f=p}).finally(()=>{this._pendingRequest.delete(l),u.resolve(),h.open()}),await h.wait(),f)throw f.name===qg.name?f:new qg(`Language model '${t}' errored, check cause for more details`,"Unknown",f);return u.apiObject}_convertMessages(e,t){const i=[];for(const s of t)s.role===Iv.System&&Je(e,"languageModelSystem"),i.push(y8.from(s));return i}async $handleResponseFragment(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async _getAuthAccess(e,t,i,s){const o=tue+t.identifier.value;if(await this._extHostAuthentication.getSession(e,o,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(s)return!1;try{const a=i?g($ti,0,"Justification: {1}",t.displayName,i):void 0;return await this._extHostAuthentication.getSession(e,o,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Cn.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(const t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(i){this._logService.error("Fake Auth request failed"),this._logService.error(i)}}async _computeTokenLength(e,t,i){if(!this._allLanguageModelData.get(e))throw qg.NotFound(`Language model '${e}' is unknown.`);const o=fi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:y8.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:s,enabled:o}of e){const r=this._modelAccessList.get(i)??new $v;if(r.has(s)!==o){o?r.add(s):r.delete(s),this._modelAccessList.set(i,r);const c={from:i,to:s};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=T.signal(T.filter(this._onDidChangeModelAccess.event,o=>Cn.equals(o.from,e.identifier))),s=T.signal(this._onDidChangeProviders.event);return{get onDidChange(){return T.any(i,s)},canSendRequest(o){let r;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===o){r=l.metadata;break e}if(!r)return;if(!t._isUsingAuth(e.identifier,r))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(r.extension)}}}},dTe=XP,XP._idPool=1,XP);hTe=dTe=D([_(0,gr),_(1,Ze),_(2,JOe)],hTe);class Iat{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Ue.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,i){return this._proxy.$setPassword(e,t,i)}delete(e,t){return this._proxy.$deletePassword(e,t)}}const ZOe=ae("IExtHostSecretState");var Ik;class qti{constructor(e,t){kt(this,Ik);this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._id=Cn.toKey(e.identifier),st(this,Ik,t),se(this,Ik).onDidChangePassword(i=>{i.extensionId===this._id&&this._onDidChange.fire({key:i.key})})}get(e){return se(this,Ik).get(this._id,e)}store(e,t){return se(this,Ik).store(this._id,e,t)}delete(e){return se(this,Ik).delete(this._id,e)}}Ik=new WeakMap;let uTe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Ue.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===aR}getMessage(e,t){const{message:i,args:s,comment:o}=t;if(this.isDefaultLanguage)return w_e(i,s??{});let r=i;o&&o.length>0&&(r+=`/${Array.isArray(o)?o.join(""):o}`);const a=this.bundleCache.get(e)?.contents[r];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${r}`),w_e(a??i,s??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t;const i=await this.getBundleLocation(e);if(!i){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{const s=await this._proxy.$fetchBundleContents(i),o=JSON.parse(s);t=e.isBuiltin?o.contents?.bundle:o}catch(s){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${s.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:i})}async getBundleLocation(e){if(e.isBuiltin){const t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return P.revive(t)}return e.l10n?P.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};uTe=D([_(0,Sg),_(1,gr),_(2,Ze)],uTe);const eBe=ae("IExtHostLocalizationService"),tBe=ae("IExtHostManagedSockets");let gTe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Ue.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new Qti(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw new Error(`No socket factory with id ${e}`);const t=++this._remoteSocketIdCounter,i=await this._factory.makeConnection(),s=new Z;return this._managedRemoteSockets.set(t,new jti(t,i,s)),s.add(Ee(()=>this._managedRemoteSockets.delete(t))),s.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),s.dispose()})),s.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),s.dispose()})),s.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,ze.wrap(o)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){const t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};gTe=D([_(0,gr)],gTe);class Qti{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class jti extends ${constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var fTe;const e6e="vs/workbench/api/common/extHostExtensionService",Lat=ae("IHostUtils");let pTe=fTe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this._extHostManagedSockets=u,this._extHostLanguageModels=f,this._onDidChangeRemoteConnectionData=this._register(new I),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=i,this._initData=a,this._extHostWorkspace=s,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Ue.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Ue.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Ue.MainThreadExtensionService),this._almostReadyToRunExtensions=new Uh,this._readyToStartExtensionHost=new Uh,this._readyToRunExtensions=new Uh,this._eagerExtensionsActivated=new Uh,this._activationEventsReader=new Yti(this._initData.extensions.activationEvents),this._globalRegistry=new UI(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new $v(this._initData.extensions.myExtensions);this._myRegistry=new UI(this._activationEventsReader,Tat(this._globalRegistry,p)),Vu&&(this._logService.info(`Creating extension host with the following global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${dB(this._myRegistry)}`)),this._storage=new Dat(this._extHostContext,this._logService),this._secretState=new Iat(this._extHostContext),this._storagePath=c,this._instaService=e.createChild(new Dl([KOe,this._storage],[ZOe,this._secretState])),this._activator=this._register(new rTe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,w)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,EU(v),w)},actualActivateExtension:async(m,v)=>{if(UI.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new Vti;const w=this._myRegistry.getExtensionDescription(m);return this._activateExtension(w,v)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),vs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){bt(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(o=>o.identifier).filter(o=>this.isActivated(o)).map(o=>this._deactivate(o))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),_9&&f_e(s=>{this._logService.error(s)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Ta(5e3),i]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){const t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new Cn(t.identifier.value),extensionLocation:P.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{const i=this._activator.getActivatedExtension(e);if(i.activationFailed)return Promise.reject(i.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===_e.file&&this._hostUtils.fsRealpath){const t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));const i=await this._realPathCache.get(t);return P.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new Kti(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Su.forUris(i=>QQe.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const s=await this._realPathExtensionUri(i.extensionLocation);t.set(s,i)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;const i=this._activator.getActivatedExtension(e);if(!i)return t;try{typeof i.module.deactivate=="function"&&(t=Promise.resolve(i.module.deactivate()).then(void 0,s=>(this._logService.error(s),Promise.resolve(void 0))))}catch(s){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(s)}try{St(i.subscriptions)}catch(s){this._logService.error(`An error occurred when deactivating the subscriptions for extension '${e.value}':`),this._logService.error(s)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(i=>{const s=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,s.codeLoadingTime,s.activateCallTime,s.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",s),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,s){const o=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...s||{},outcome:i})}_doActivateExtension(e,t){const i=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const s=this._getEntryPoint(e);if(!s)return Promise.resolve(new Uti(G4.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value!==t.extensionId.value?`, root cause: ${t.extensionId.value}`:""}`),this._logService.flush();const o=new J7e(t.startup);return Promise.all([this._loadCommonJSModule(e,qt(e.extensionLocation,s),o),this._loadExtensionContext(e)]).then(r=>(vs(`code/extHost/willActivateExtension/${e.identifier.value}`),fTe._callActivate(this._logService,e.identifier,r[0],r[1],o))).then(r=>(vs(`code/extHost/didActivateExtension/${e.identifier.value}`),r))}_loadExtensionContext(e){const t=this._extHostLanguageModels.createLanguageModelAccessInformation(e),i=new zti(e,this._storage),s=new kat(e.identifier.value,!1,this._storage),o=new qti(e,this._secretState),r=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?WM.Test:WM.Development:WM.Production,a=this._initData.remote.isRemote?$I.Workspace:$I.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([i.whenReady,s.whenReady,this._storagePath.whenReady]).then(()=>{const c=this;let l,d;const h=Cd(e,"ipc")?this._initData.messagePorts?.get(Cn.toKey(e.identifier)):void 0;return Object.freeze({globalState:i,workspaceState:s,secrets:o,subscriptions:[],get languageModelAccessInformation(){return t},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(u){return D_e(e.extensionLocation.fsPath,u)},get storagePath(){return c._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return c._storagePath.globalValue(e).fsPath},get logPath(){return D_e(c._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return P.joinPath(c._initData.logsLocation,e.identifier.value)},get storageUri(){return c._storagePath.workspaceValue(e)},get globalStorageUri(){return c._storagePath.globalValue(e)},get extensionMode(){return r},get extension(){return l===void 0&&(l=new K3(c,e.identifier,e,a,!1)),l},get extensionRuntime(){return Je(e,"extensionRuntime"),c.extensionRuntime},get environmentVariableCollection(){return c._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!d){if(!h)return;const u=T.buffer(T.fromDOMEventEmitter(h,"message",f=>f.data));h.start(),d={onDidReceiveMessage:u,postMessage:h.postMessage.bind(h)}}return d}})})}static _callActivate(e,t,i,s,o){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,s,o).then(r=>new _ue(!1,null,o.build(),i,r,s.subscriptions))}static _callActivateOptional(e,t,i,s,o){if(typeof i.activate=="function")try{o.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const r=typeof global=="object"?global:self,a=i.activate.apply(r,[s]);return o.activateCallStop(),o.activateResolveStart(),Promise.resolve(a).then(c=>(o.activateResolveStop(),c))}catch(r){return Promise.reject(r)}else return Promise.resolve(i)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,i=>{this._logService.error(i)})}_activateAllStartupFinishedDeferred(e,t=0){const s=Date.now();HRe(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(SDt()),this._extHostConfiguration.getConfigProvider().then(e=>{const t=e.getConfiguration("extensions.experimental").get("deferredStartupFinishedActivation"),i=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(i);else for(const s of i)if(s.activationEvents)for(const o of s.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(s,o)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,r=>{this._logService.error(r)});this._register(this._extHostWorkspace.onDidChangeWorkspace(r=>this._handleWorkspaceContainsEagerExtensions(r.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),s=this._handleRemoteResolverEagerExtensions(),o=Promise.all([s,e,i]).then(()=>{});return Promise.race([o,Ta(1e4)]).then(()=>{this._activateAllStartupFinished()}),o}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;const i=!this._initData.remote.isRemote&&!!this._initData.remote.authority,s={logService:this._logService,folders:e.map(r=>r.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:r=>this._hostUtils.fsExists(r.fsPath),checkExists:(r,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(r,a,c)},o=await Zst(s,t);if(o)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:o.activationEvent}).then(void 0,r=>this._logService.error(r))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){const{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw new Error(g(e6e,0,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new J7e(!1));if(!i||typeof i.run!="function")throw new Error(g(e6e,1,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((s,o)=>{const r=(l,d)=>{l?(Vu&&this._logService.error("Test runner called back with error",l),o(l)):(Vu&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),s(typeof d=="number"&&d>0?1:0))},a=fv(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Vu&&this._logService.info("Test runner finished successfully."),s(0)}).catch(l=>{Vu&&this._logService.error("Test runner finished with error",l),o(l instanceof Error&&l.stack?l.stack:String(l))})})}_startExtensionHost(){if(this._started)throw new Error("Extension host is already started!");return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Ta(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info("Eager extensions activated")})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,Ee(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){const{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){const t=e.indexOf("+");if(t===-1)throw new OT("Not an authority that can be resolved!",Xd.InvalidAuthority);const i=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${i}`,!1),{authorityPrefix:i,resolver:this._resolvers[i]}}async $resolveAuthority(e,t){const i=ao.create(!1),s=()=>`[resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=b=>this._logService.info(`${s()}${b}`),r=b=>this._logService.warn(`${s()}${b}`),a=(b,C=void 0)=>this._logService.error(`${s()}${b}`,C),c=b=>{if(b instanceof OT)return{type:"error",error:{code:b._code,message:b._message,detail:b._detail}};throw b},l=async b=>{o(`activating resolver for ${b}...`);const{resolver:C,authorityPrefix:y}=await this._activateAndGetResolver(b);if(!C)throw a(`no resolver for ${y}`),new OT(`No remote extension installed to resolve ${y}.`,Xd.NoResolverFound);return{resolver:C,authorityPrefix:y,remoteAuthority:b}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async b=>{if(!(b instanceof OT)||b._code!==Xd.InvalidAuthority)throw b;return r(`resolving nested authorities failed: ${b.message}`),[await l(e)]})}catch(b){return c(b)}const u=new nQ;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[b,{authorityPrefix:C,resolver:y,remoteAuthority:S}]of h.entries())try{if(b===h.length-1)o("invoking final resolve()..."),vs(`code/extHost/willResolveAuthority/${C}`),f=await y.resolve(S,{resolveAttempt:t,execServer:p}),vs(`code/extHost/didResolveAuthorityOK/${C}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(y,m8.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${S}`),vs(`code/extHost/willResolveExecServer/${C}`),p=await y.resolveExecServer?.(S,{resolveAttempt:t,execServer:p}),!p)throw new OT(`Exec server was not available for ${S}`,Xd.NoResolverFound);vs(`code/extHost/didResolveExecServerOK/${C}`)}}catch(M){return vs(`code/extHost/didResolveAuthorityError/${C}`),a("returned an error",M),u.dispose(),c(M)}u.dispose();const m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},v={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};o(`returned ${m8.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let w;if(m8.isManagedResolvedAuthority(f)){const b=t;this._extHostManagedSockets.setFactory(b,f.makeConnection),w={authority:e,connectTo:new Ust(b),connectionToken:f.connectionToken}}else w={authority:e,connectTo:new Vst(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:w,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${Pne(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const s=P.revive(t);if(typeof i.getCanonicalURI>"u")return s;const o=await Zu(()=>i.getCanonicalURI(s));return o||s}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$startExtensionHost: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${dB(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===sC.Immediate?this._almostReadyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$deltaExtensions: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${dB(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){const t=ze.alloc(e),i=Math.random()%256;for(let s=0;sa.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=Tat(s,o);return{globalRegistry:s,myExtensions:r}}function i6e(n,e){return{id:n.identifier.value,name:n.name,extensionVersion:n.version,publisherDisplayName:n.publisher,activationEvents:n.activationEvents?n.activationEvents.join(","):null,isBuiltin:n.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function dB(n){return n.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const _L=ae("IExtHostExtensionService");var WR,Sq,HR;class K3{constructor(e,t,i,s,o){kt(this,WR);kt(this,Sq);kt(this,HR);st(this,WR,e),st(this,Sq,t),st(this,HR,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=d1(fv(i.extensionLocation)),this.packageJSON=i,this.extensionKind=s,this.isFromDifferentExtensionHost=o}get isActive(){return se(this,WR).isActivated(se(this,HR))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return se(this,WR).getExtensionExports(se(this,HR))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await se(this,WR).activateByIdWithErrors(se(this,HR),{startup:!1,extensionId:se(this,Sq),activationEvent:"api"}),this.exports}}WR=new WeakMap,Sq=new WeakMap,HR=new WeakMap;function Tat(n,e){return n.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class Kti{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}}class Yti{constructor(e){this._map=new $a,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(const t of Object.keys(e))this._map.set(t,e[t])}}var ca;(function(n){n.Unknown="unknown",n.Env="env",n.Config="config",n.Command="command",n.Input="input",n.ExtensionInstallFolder="extensionInstallFolder",n.WorkspaceFolder="workspaceFolder",n.Cwd="cwd",n.WorkspaceFolderBasename="workspaceFolderBasename",n.UserHome="userHome",n.LineNumber="lineNumber",n.SelectedText="selectedText",n.File="file",n.FileWorkspaceFolder="fileWorkspaceFolder",n.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",n.RelativeFile="relativeFile",n.RelativeFileDirname="relativeFileDirname",n.FileDirname="fileDirname",n.FileExtname="fileExtname",n.FileBasename="fileBasename",n.FileBasenameNoExtension="fileBasenameNoExtension",n.FileDirnameBasename="fileDirnameBasename",n.ExecPath="execPath",n.ExecInstallFolder="execInstallFolder",n.PathSeparator="pathSeparator",n.PathSeparatorAlias="/"})(ca||(ca={}));class If extends Error{constructor(e,t){super(t),this.variable=e}}const Lf="vs/workbench/services/configurationResolver/common/variableResolver",sR=class sR{constructor(e,t,i,s){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,s&&(this._envVariablesPromise=s.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Is){const t=Object.create(null);return Object.keys(e).forEach(i=>{t[i.toLowerCase()]=e[i]}),t}return e}resolveWithEnvironment(e,t,i){return this.recursiveResolve({env:this.prepareEnv(e),userHome:void 0},t?t.uri:void 0,i)}async resolveAsync(e,t){const i={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(i,e?e.uri:void 0,t)}async resolveAnyBase(e,t,i,s){const o=Vs(t);Is&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):ei&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):jr&&o.linux&&Object.keys(o.linux).forEach(a=>o[a]=o.linux[a]),delete o.windows,delete o.osx,delete o.linux;const r={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(r,e?e.uri:void 0,o,i,s)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const s=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,s),resolvedVariables:s}}resolveWithInteractionReplace(e,t,i,s){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,s){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(e,t){if(this._contributedVariables.has(e))throw new Error("Variable "+e+" is contributed twice.");this._contributedVariables.set(e,t)}async recursiveResolve(e,t,i,s,o){if(zt(i))return this.resolveString(e,t,i,s,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,s,o)));if(fo(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,s,o),await this.recursiveResolve(e,t,i[c],s,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,s,o){return Plt(i,sR.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(sR.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,s);return o?.set(a,c),c!==r&&zt(c)&&c.match(sR.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,s,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,s,o){let r;const a=i.split(":");a.length>1&&(i=a[0],r=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Ay(u);throw new If(h,g(Lf,0,"Variable {0} can not be resolved. Please open an editor.",t))},l=h=>{const u=c(h);if(this._context.getWorkspaceFolderPathForFile){const f=this._context.getWorkspaceFolderPathForFile();if(f)return Ay(f)}throw new If(h,g(Lf,1,"Variable {0}: can not find workspace folder of '{1}'.",t,yr(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new If(h,g(Lf,2,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(s)return s;throw this._context.getWorkspaceFolderCount()>1?new If(h,g(Lf,3,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new If(h,g(Lf,4,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Is?r.toLowerCase():r];if(zt(h))return h}return""}throw new If(ca.Env,g(Lf,5,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(s,r);if(dc(h))throw new If(ca.Config,g(Lf,6,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(fo(h))throw new If(ca.Config,g(Lf,7,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new If(ca.Config,g(Lf,8,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(ca.Command,t,r,o,"command");case"input":return this.resolveFromMap(ca.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new If(ca.ExtensionInstallFolder,g(Lf,9,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new If(ca.ExtensionInstallFolder,g(Lf,10,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Ay(this.fsPath(d(ca.WorkspaceFolder)));case"cwd":return s||r?Ay(this.fsPath(d(ca.Cwd))):kU();case"workspaceRootFolderName":case"workspaceFolderBasename":return Ay(yr(this.fsPath(d(ca.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new If(ca.UserHome,g(Lf,11,"Variable {0} can not be resolved. UserHome path is not defined",t))}case"lineNumber":{const h=this._context.getLineNumber();if(h)return h;throw new If(ca.LineNumber,g(Lf,12,"Variable {0} can not be resolved. Make sure to have a line selected in the active editor.",t))}case"selectedText":{const h=this._context.getSelectedText();if(h)return h;throw new If(ca.SelectedText,g(Lf,13,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(ca.File);case"fileWorkspaceFolder":return l(ca.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return yr(l(ca.FileWorkspaceFolderBasename));case"relativeFile":return s||r?LU(this.fsPath(d(ca.RelativeFile)),c(ca.RelativeFile)):c(ca.RelativeFile);case"relativeFileDirname":{const h=lS(c(ca.RelativeFileDirname));if(s||r){const u=LU(this.fsPath(d(ca.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return lS(c(ca.FileDirname));case"fileExtname":return T_(c(ca.FileExtname));case"fileBasename":return yr(c(ca.FileBasename));case"fileBasenameNoExtension":{const h=yr(c(ca.FileBasenameNoExtension));return h.slice(0,h.length-T_(h).length)}case"fileDirnameBasename":return yr(lS(c(ca.FileDirnameBasename)));case"execPath":{const h=this._context.getExecPath();return h||t}case"execInstallFolder":{const h=this._context.getAppRoot();return h||t}case"pathSeparator":case"/":return dg;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(ca.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,s,o){if(i&&s){const r=o===void 0?s[i]:s[o+":"+i];if(typeof r=="string")return r;throw new If(e,g(Lf,14,"Variable {0} can not be resolved because the command has no value.",t))}return t}};sR.VARIABLE_LHS="${",sR.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let mTe=sR;const iBe=ae("IExtHostVariableResolverProvider");class Jti extends mTe{constructor(e,t,i,s,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=s.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof gG||d.input instanceof Yhe)return d.input.modified;if(d.input instanceof Qhe||d.input instanceof Khe||d.input instanceof jhe)return d.input.uri}}}super({getFolderUri:l=>{const d=r.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>r.folders.length,getConfigurationValue:(l,d)=>o.getConfiguration(void 0,l).get(d),getAppRoot:()=>kU(),getExecPath:()=>IU.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return d1(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return d1(d.uri.fsPath)}}},getSelectedText:()=>{if(i){const l=i.activeEditor();if(l&&!l.selection.isEmpty)return l.document.getText(l.selection)}},getLineNumber:()=>{if(i){const l=i.activeEditor();if(l)return String(l.selection.end.line+1)}},getExtension:l=>e.getExtension(l)},void 0,a?Promise.resolve(a):void 0,Promise.resolve(IU))}}let _Te=class extends ${constructor(e,t,i,s,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=s,this.editorTabs=o,this._resolver=new Ka(async()=>{const r=await this.configurationService.getConfigProvider(),c={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async l=>{c.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new Jti(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};_Te=D([_(0,_L),_(1,dD),_(2,oj),_(3,hD),_(4,rj)],_Te);const Rat=ae("IExtHostDebugService");let vTe=class{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,i,s,o,r,a){this._workspaceService=t,this._extensionService=i,this._configurationService=s,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=new I,this._onDidTerminateDebugSession=new I,this._onDidChangeActiveDebugSession=new I,this._onDidReceiveDebugSessionCustomEvent=new I,this._debugServiceProxy=e.getProxy(Ue.MainThreadDebugService),this._onDidChangeBreakpoints=new I,this._onDidChangeActiveStackItem=new I,this._activeDebugConsole=new Zti(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(c=>{c.onDidChange(l=>{this.registerAllDebugTypes(c)}),this.registerAllDebugTypes(c)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const s=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return s?this.convertVisualizerTreeItem(e,s):void 0}registerDebugVisualizationTree(e,t,i){const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(o,i),this._debugServiceProxy.$registerDebugVisualizerTree(o,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(o),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){const i=this._debugVisualizationElements.get(t)?.item;return i?(await this._debugVisualizationTrees.get(e)?.getChildren?.(i))?.map(o=>this.convertVisualizerTreeItem(e,o))||[]:[]}async $editVisualizerTreeItem(e,t){const i=this._debugVisualizationElements.get(e);if(!i)return;const s=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,s||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const s of i)if(s)for(const o of s)i.push(this._debugVisualizationElements.get(o)?.children),this._debugVisualizationElements.delete(o)}convertVisualizerTreeItem(e,t){let i=this._debugVisualizationTreeItemIds.get(t);return i||(i=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,i),this._debugVisualizationElements.set(i,{provider:e,item:t})),xIe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let s=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(s+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),s+=`${o}ref=${i.sourceReference}`,P.parse(s)}else{if(i.path)return P.file(i.path);throw new Error("cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.")}}registerAllDebugTypes(e){const t=[];for(const i of e.getAllExtensionDescriptions())if(i.contributes){const s=i.contributes.debuggers;if(s&&s.length>0)for(const o of s)ojt(o)&&t.push(o.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){const e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){const i=this._visualizers.get(e);if(!i)throw new Error(`No debug visualizer found with id '${e}'`);let{v:s,provider:o,extensionId:r}=i;if(s.visualization||(s=await o.resolveDebugVisualization?.(s,t)||s,i.v=s),!s.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,s.visualization)}async $executeDebugVisualizerCommand(e){const t=this._visualizers.get(e);if(!t)throw new Error(`No debug visualizer found with id '${e}'`);const i=t.v.visualization;i&&"command"in i&&this._commands.executeCommand(i.command,...i.arguments||[])}hydrateVisualizationContext(e){const t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,i,s){const o=this.hydrateVisualizationContext(i),r=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(r);if(!o||!a)return[];const c=await a.provideDebugVisualization(o,s);return c?c.map(l=>{const d=++this._visualizerIdCounter;this._visualizers.set(d,{v:l,provider:a,extensionId:e});const h=l.iconPath?this.getIconPathOrClass(l.iconPath):void 0;return{id:d,name:l.name,iconClass:h?.iconClass,iconPath:h?.iconPath,visualization:this.serializeVisualization(e,l.visualization)}}):[]}$disposeDebugVisualizers(e){for(const t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,i){if(!e.contributes?.debugVisualizers?.some(r=>r.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(o,i),this._debugServiceProxy.$registerDebugVisualizer(s,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(s,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(o=>{const r=o.id;return this._breakpoints.has(r)?!1:(this._breakpoints.set(r,o),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],s=new Map;for(const o of t)if(o instanceof vI){let r=s.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},s.set(o.location.uri.toString(),r),i.push(r)),r.lines.push({id:o.id,enabled:o.enabled,condition:o.condition,hitCondition:o.hitCondition,logMessage:o.logMessage,line:o.location.range.start.line,character:o.location.range.start.character,mode:o.mode})}else o instanceof wI&&i.push({type:"function",id:o.id,enabled:o.enabled,hitCondition:o.hitCondition,logMessage:o.logMessage,condition:o.condition,functionName:o.functionName,mode:o.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(r=>this._breakpoints.delete(r.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(r=>r instanceof vI).map(r=>r.id),s=t.filter(r=>r instanceof wI).map(r=>r.id),o=t.filter(r=>r instanceof vse).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,s,o)}startDebugging(e,t,i){return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===nG.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,suppressDebugStatusbar:i.suppressDebugStatusbar??i.debugUI?.simple,suppressDebugToolbar:i.suppressDebugToolbar??i.debugUI?.simple,suppressDebugView:i.suppressDebugView??i.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,i){if(!t)return new oo(()=>{});const s=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:s,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,s),new oo(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(s)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new oo(()=>{});if(!this.definesDebugType(e,t))throw new Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw new Error("a DebugAdapterDescriptorFactory can only be registered once per a type.");const s=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:s,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,s),new oo(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(s)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new oo(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new oo(()=>{this._trackerFactories=this._trackerFactories.filter(s=>s.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const s=await this.getFolder(e);return s&&(i={uri:s.uri,name:s.name,index:s.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new tii(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,s=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(s.type),s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,s);if(!a)throw new Error(`Couldn't create a debug adapter for type '${s.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(s).then(l=>(l&&this._debugAdaptersTrackers.set(e,l),c.onMessage(async d=>{if(d.type==="request"&&d.command==="handshake"){const h=d,u={type:"response",seq:0,command:h.command,request_seq:h.seq,success:!0};this._signService||(this._signService=this.createSignService());try{if(this._signService){const f=await this._signService.sign(h.arguments.value);u.body={signature:f},c.sendResponse(u)}else throw new Error("no signer")}catch(f){u.success=!1,u.message=f.message,c.sendResponse(u)}}else l&&l.onDidSendMessage&&l.onDidSendMessage(d),d=Jot(d,!0),i._debugServiceProxy.$acceptDAMessage(e,d)}),c.onError(d=>{l&&l.onError&&l.onError(d),this._debugServiceProxy.$acceptDAError(e,d.name,d.message,d.stack)}),c.onExit(d=>{l&&l.onExit&&l.onExit(d??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,d??void 0,void 0)}),l&&l.onWillStartSession&&l.onWillStartSession(),c.startSession()))})}$sendDAMessage(e,t){t=Yot(t,!1);const i=this._debugAdaptersTrackers.get(e);i&&i.onWillReceiveMessage&&i.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){const t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();const i=this._debugAdapters.get(e);return this._debugAdapters.delete(e),i?i.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){const t=[],i=[],s=[];if(e.added)for(const o of e.added){const r=o.id;if(r&&!this._breakpoints.has(r)){let a;if(o.type==="function")a=new wI(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new vse(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=P.revive(o.uri);a=new vI(new _p(c,new Ps(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}x7t(a,r),this._breakpoints.set(r,a),t.push(a)}}if(e.removed)for(const o of e.removed){const r=this._breakpoints.get(o);r&&(this._breakpoints.delete(o),i.push(r))}if(e.changed){for(const o of e.changed)if(o.id){const r=this._breakpoints.get(o.id);if(r){if(r instanceof wI&&o.type==="function"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.functionName=o.functionName}else if(r instanceof vI&&o.type==="source"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.location=new _p(P.revive(o.uri),new Ps(o.line,o.character))}s.push(r)}}}this.fireBreakpointChanges(t,i,s)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new yot(i.api,e.threadId):t=new Cot(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return Zu(async()=>{const s=this.getConfigProviderByHandle(e);if(!s)throw new Error("no DebugConfigurationProvider found");if(!s.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return s.provideDebugConfigurations(o,i)}).then(s=>{if(!s)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return s})}$resolveDebugConfiguration(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const r=await this.getFolder(t);return o.resolveDebugConfiguration(r,i,s)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const r=await this.getFolder(t);return o.resolveDebugConfigurationWithSubstitutedVariables(r,i,s)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const s=await this.getSession(t);return this.getAdapterDescriptor(i,s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}'`);return this.convertToDto(o)})}async $acceptDebugSessionStarted(e){const t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){const t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){const s={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(s)}convertToDto(e){if(e instanceof j6)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof f4)return{type:"server",port:e.port,host:e.host};if(e instanceof K6)return{type:"pipeServer",path:e.path};if(e instanceof Y6)return{type:"implementation",implementation:e.implementation};throw new Error("convertToDto unexpected type")}getAdapterDescriptorFactoryByType(e){const t=this._adapterFactories.filter(i=>i.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){const t=this._adapterFactories.filter(i=>i.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){const t=this._configProviders.filter(i=>i.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){const i=e.contributes.debuggers;if(i&&i.length>0){for(const s of i)if(s.label&&s.type&&s.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,s=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>Zu(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(s).then(o=>{const r=Ui(o);if(r.length>0)return new eii(r)}),new Promise(o=>setTimeout(()=>o(void 0),1e3))]).catch(o=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new f4(i));if(e){const o=await this._extensionService.getExtensionRegistry();return Zu(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const s=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,s))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,i){(e.length>0||t.length>0||i.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:i}))}async getSession(e){if(e)if(typeof e=="string"){const t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){const i=await this.getFolder(e.folderUri),s=e.parent?this._debugSessions.get(e.parent):void 0;t=new Xti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,s?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw new Error("cannot find session")}getFolder(e){if(e){const t=P.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if("title"in t&&"command"in t)return{type:Ene.Command};if("treeId"in t)return{type:Ene.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,s;return"id"in t?s=$e.asClassName(t):i=t,{iconPath:i,iconClass:s}}getIconUris(e){if(e instanceof fg)return{id:e.id};const t=typeof e=="object"&&"dark"in e?e.dark:e,i=typeof e=="object"&&"light"in e?e.light:e;return{dark:typeof t=="string"?P.file(t):t,light:typeof i=="string"?P.file(i):i}}};vTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],vTe);class Xti{constructor(e,t,i,s,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=s,this._workspaceFolder=o,this._configuration=r,this._parentSession=a}get api(){const e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,i){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,i)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}}class Zti{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` -`)}})}}class eii{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(i=>i.onExit?i.onExit(e,t):void 0)}}class tii extends Got{constructor(e){super(),this.implementation=e,e.onDidSendMessage(t=>{this.acceptMessage(t)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}}let wTe=class extends vTe{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r,a)}};wTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],wTe);class iii{constructor(e,t,i){this.config=e,this.provider=t,this.sessionToken=i,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern,this.includePattern=e.includePattern&&_w(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&_w(e.excludePattern)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){const t=this.config.folderQueries||[];return new Promise((i,s)=>{const o=r=>{this.resultCount++,e(r)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(r=>{const a=r.toString(),c=yr(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(o,{base:r,basename:c})}),Promise.all(t.map(r=>this.searchInFolder(r,o))).then(r=>{i({limitHit:this.isLimitHit,stats:r[0]||void 0})},r=>{s(new Error(Ma(r)))})})}async searchInFolder(e,t){const i=new ai,s=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new Jst(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=ao.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},s,i.token),d=c.elapsed(),h=ao.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=qi.relative(e.folder.path,u.path);if(a){const p=yr(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(o,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(o,r,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=$ne(this.config.includePattern,e.includePattern),i=$ne(this.config.excludePattern,e.excludePattern);return{folder:e.folder,excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,maxResults:this.config.maxResults,session:this.sessionToken}}initDirectoryTree(){const e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,i,s){if(i===this.filePattern){const r=yr(this.filePattern);this.matchFile(s,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=yr(r),c=lS(r);let l=e[c];l||(l=e[c]=[],o(c)),l.push({base:t,relativePath:r,basename:a})}o(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,s){const o=this,r=this.filePattern;function a(c){const l=Z8t(()=>c.map(d=>d.basename));for(let d=0,h=c.length;d=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}}const vle=class vle{constructor(){this.sessions=new Map}fileSearch(e,t,i,s){const o=this.getSessionTokenSource(e.cacheKey),r=new iii(e,t,o&&o.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(r,vle.BATCH_SIZE,c,s).then(l=>({limitHit:l.limitHit,stats:l.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:l.stats}:void 0,messages:[]}))}clearCache(e){this.getSessionTokenSource(e)?.cancel()}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new ai),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:qt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,s){const o=s.onCancellationRequested(()=>{e.cancel()}),r=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(r).then(c=>(a.length&&i(a),o.dispose(),c),c=>(a.length&&i(a),o.dispose(),Promise.reject(c)))}};vle.BATCH_SIZE=512;let bTe=vle;class n6e{constructor(e,t,i){this.queryProviderPair=e,this.fileUtils=t,this.processType=i,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t){const i=this.query.folderQueries||[],s=new ai(t);return new Promise((o,r)=>{this.collector=new sii(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);Y3(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,s.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!Y3(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),s.token))).then(l=>{s.dispose(),this.collector.flush();const d=l.some(h=>!!h&&!!h.limitHit);o({limitHit:this.isLimitHit||d,messages:l.flatMap(h=>h?.message?Array.isArray(h.message)?h.message:[h.message]:[]),stats:{type:this.processType}})},l=>{s.dispose();const d=Ma(l);r(new Error(d))})})}resultSize(e){return Y3(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],s=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:s.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const s=new Jst(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===_e.file?X8t(()=>this.fileUtils.readdir(ma(l.uri))):void 0,h=lO(e.folder,l.uri);if(h){const u=s.includedInQuery(h,yr(h),d);NS(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===z1.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(nii(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(Y3(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}getSearchOptionsForFolder(e){const t=$ne(this.query.includePattern,e.includePattern),i=$ne(this.query.excludePattern,e.excludePattern),s={folder:P.from(e.folder),excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,encoding:e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??Number.MAX_SAFE_INTEGER,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(s.usePCRE2=this.query.usePCRE2),s}}function nii(n){return{isCaseSensitive:n.isCaseSensitive||!1,isRegExp:n.isRegExp||!1,isWordMatch:n.isWordMatch||!1,isMultiline:n.isMultiline||!1,pattern:n.pattern}}class sii{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new CTe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!_n(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(oii(e))}pushToCollector(){const e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}}function oii(n){return Y3(n)?{preview:{matches:u9(n.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:n.preview.text},ranges:u9(n.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:n.text,lineNumber:n.lineNumber}}function Y3(n){return!!n.preview}const wW=class wW{constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},wW.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=0))}};wW.TIMEOUT=4e3,wW.START_BATCH_AFTER_COUNT=50;let CTe=wW;const Mat=ae("IExtHostSearch");let yTe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Ue.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new bTe}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,t),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);const i=this._handlePool++;return this._aiTextSearchProvider.set(i,t),this._proxy.$registerAITextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,t),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}$provideFileSearchResults(e,t,i,s){const o=vme(i),r=this._fileSearchProvider.get(e);if(r)return this._fileSearchManager.fileSearch(o,r,a=>{this._proxy.$handleFileMatch(e,t,a.map(c=>c.resource))},s);throw new Error("3 unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,i){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,i,s){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`2 Unknown provider ${e}`);const r=vme(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$provideAITextSearchResults(e,t,i,s){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`1 Unknown provider ${e}`);const r=vme(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};yTe=D([_(0,gr),_(1,fue),_(2,Ze)],yTe);function vme(n){return{...n,folderQueries:n.folderQueries&&n.folderQueries.map(rii),extraFileResources:n.extraFileResources&&n.extraFileResources.map(e=>P.revive(e))}}function rii(n){return{...n,folder:P.revive(n.folder)}}var STe,ZP;let ATe=(ZP=class{getState(){const e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e){this._onDidChangeWindowState=new I,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=STe.InitialState,this._proxy=e.getProxy(Ue.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:t,isActive:i})=>{this.onDidChangeWindowProperty("focused",t),this.onDidChangeWindowProperty("active",i)})}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let i;if(typeof e=="string"){i=e;try{e=P.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Xv(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===_e.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Xv(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return P.from(i)}},STe=ZP,ZP.InitialState={focused:!0,active:!0},ZP);ATe=STe=D([_(0,gr)],ATe);const Nat=ae("IExtHostWindow");let Lre=class extends IYe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Or(i))),this._proxy=e.getProxy(Ue.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(P.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new aii(this._proxy,e,t,i)}};Lre=D([_(0,gr),_(1,Sg)],Lre);class aii extends ude{constructor(e,t,i,s){super(s?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,s).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){const i=[[e,t]];this.isLoggerCreated?this.doLog(i):this.buffer.push(...i)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}}const Pat=ae("IExtHostTerminalShellIntegration");let ETe=class extends ${constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=new I,this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=new I,this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=new I,this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(Ue.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,s]of this._activeShellIntegrations)s.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let s=this._activeShellIntegrations.get(e);s||(s=new cii(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,s),s.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),s.store.add(s.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),s.store.add(s.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),s.store.add(s.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=s.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:s.value})}$shellExecutionStart(e,t,i,s,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.startShellExecution(r,o)}$shellExecutionEnd(e,t,i,s,o){const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(lZ(t)?P.revive(t):t)}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};ETe=D([_(0,gr),_(1,Jz)],ETe);class cii extends ${get currentExecution(){return this._currentExecution}constructor(e,t){super(),this._terminal=e,this._onDidStartTerminalShellExecution=t,this._ignoreNextExecution=!1,this.store=this._register(new Z),this._onDidRequestChangeShellIntegration=this._register(new I),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new I),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new I),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event;const i=this;this.value={get cwd(){return i._cwd},executeCommand(s,o){let r=s;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:NM.High,isTrusted:!0},c=i.startShellExecution(a,i._cwd,!0).value;return i._ignoreNextExecution=!0,c}}}startShellExecution(e,t,i){if(this._ignoreNextExecution&&this._currentExecution)this._ignoreNextExecution=!1;else{this._currentExecution&&(this._currentExecution.endExecution(void 0),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0}));const s=this._currentExecution=new lii(e,t);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:s.value})):this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}return this._currentExecution}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){this._currentExecution&&(this._currentExecution.endExecution(e),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:t}),this._currentExecution=void 0)}setCwd(e){let t=!1;P.isUri(this._cwd)?t=!P.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value}))}}class lii{constructor(e,t){this._commandLine=e,this.cwd=t,this._ended=!1;const i=this;this.value={get commandLine(){return i._commandLine},get cwd(){return i.cwd},read(){return i._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._ended)return tg.EMPTY;this._dataStream=new dii}return this._dataStream.createIterable()}emitData(e){this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._dataStream=void 0,this._ended=!0}}class dii extends ${constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new Uh);const e=this._barrier;return new tg(async i=>{this._emitters.push(i),await e.wait()})}emitData(e){for(const t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open(),this._barrier=void 0}}ce(eBe,uTe,Kt.Delayed);ce(wp,Lre,Kt.Delayed);ce(mue,XLe,Kt.Delayed);ce(Yz,qLe,Kt.Eager);ce(JOe,lTe,Kt.Eager);ce(XOe,hTe,Kt.Eager);ce(hD,$Le,Kt.Eager);ce(gue,HLe,Kt.Eager);ce(Rat,wTe,Kt.Eager);ce(yat,zLe,Kt.Eager);ce(oj,KLe,Kt.Eager);ce(tBe,gTe,Kt.Eager);ce(Kz,hti,Kt.Eager);ce(bat,ULe,Kt.Delayed);ce(Mat,yTe,Kt.Eager);ce(KOe,Dat,Kt.Eager);ce(xat,sTe,Kt.Eager);ce(Jz,JLe,Kt.Eager);ce(Pat,ETe,Kt.Eager);ce(FOe,C0e,Kt.Eager);ce(Nat,ATe,Kt.Eager);ce(dD,VLe,Kt.Eager);ce(ZOe,Iat,Kt.Eager);ce(pue,GLe,Kt.Eager);ce(rj,oTe,Kt.Eager);ce(iBe,_Te,Kt.Eager);const wme="vs/workbench/api/common/extHostLogService";let xTe=class extends YXe{constructor(e,t,i){const s=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(wme,0,"Extension Host (Remote)"):e?g(wme,1,"Extension Host (Worker)"):g(wme,2,"Extension Host");super(t.createLogger(s,{name:o}))}};xTe=D([_(1,wp),_(2,Sg)],xTe);class s6e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ze),s=e.get(gr).getProxy(Ue.MainThreadErrors);f_e(o=>{t.error(o);const r=EU(o);s.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ze),i=e.get(gr),s=e.get(_L),o=e.get(pue),r=i.getProxy(Ue.MainThreadExtensionService),a=i.getProxy(Ue.MainThreadErrors),c=await s.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,w;for(const C of p)m+=` - at ${C.toString()}`,w=C.getFileName(),!v&&w&&(v=c.findSubstr(P.file(w)));const b=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:b}),b}const h=Symbol("prepareStackTrace wrapped");let u=d;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return u},set(f){if(f===d||!f||f[h]){u=f||d;return}u=function(p,m){return d(p,m),f.call(Error,p,m)},Object.assign(u,{[h]:!0})}}),f_e(f=>{t.error(f);const p=EU(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}r.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=o.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class nBe{constructor(e,t,i,s,o){this._hostUtils=i,this._rpcProtocol=new Bne(e,null,s),t=nBe._transform(t,this._rpcProtocol);const r=new Dl(...Hve());r.set(Sg,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(gr,new OYt(this._rpcProtocol)),r.set(fue,new gti(s)),r.set(Lat,i),r.set(Ze,new $i(xTe,[!0],!0)),r.set(wp,new $i(Lre,[],!0));const a=new P7(r,!0);_9&&a.invokeFunction(s6e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ze)),vs("code/extHost/didCreateServices"),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info("Extension host started"),this._logService.trace("initData",t),this._extensionService=a.invokeFunction(c=>c.get(_L)),this._extensionService.initialize(),_9&&a.invokeFunction(s6e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Ue.MainThreadExtensionService);return P.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Ue.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[P.revive(t),P.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(s=>{s.extensionLocation=P.revive(t.transformIncomingURIs(s.extensionLocation))}),e.environment.appRoot=P.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(s=>P.revive(t.transformIncomingURIs(s)))),e.environment.extensionTestsLocationURI=P.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=P.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=P.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=P.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=P.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=P.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class hii{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const s=this._relatedInformationProviders.get(e);if(!s)throw new Error("related information provider not found");return await s.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(s,i),this._proxy.$registerAiRelatedInformationProvider(s,t),new oo(()=>{this._proxy.$unregisterAiRelatedInformationProvider(s),this._relatedInformationProviders.delete(s)})}}const uii=[new Vn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of DocumentHighlight-instances.",fA(L4.to))),new Vn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[Et.Uri],new In("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(n,e)=>{if(iO(n))return;class t extends n4{static to(s){const o=new t(s.name,Sw.to(s.kind),s.containerName||"",new _p(e[0],at.to(s.range)));return o.detail=s.detail,o.range=o.location.range,o.selectionRange=at.to(s.selectionRange),o.children=s.children?s.children.map(t.to):[],o}}return n.map(t.to)})),new Vn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[Et.Uri,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[Et.Uri,Et.Range,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[Et.Uri,Et.Position,new Et("ch","Trigger character",n=>typeof n=="string",n=>n),new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location-instances.",fA(P_.to))),new Vn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Hover-instances.",fA(ooe.to))),new Vn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[Et.Uri,new Et("position","A position in a text document",n=>Array.isArray(n)&&n.every(e=>Ps.isPosition(e)),n=>n.map(Wr.from))],new In("A promise that resolves to an array of ranges.",n=>n.map(e=>{let t;for(const i of e.reverse())t=new r4(at.to(i),t);return t}))),new Vn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[Et.String.with("query","Search string")],new In("A promise that resolves to an array of SymbolInformation-instances.",n=>n.map(EG.to))),new Vn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of CallHierarchyItem-instances",n=>n.map(KF.to))),new Vn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyIncomingCall-instances",n=>n.map(eIe.to))),new Vn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",n=>n.map(tIe.to))),new Vn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[Et.Uri,Et.Position],new In("A promise that resolves to a range and placeholder text.",n=>{if(n)return{range:at.to(n.range),placeholder:n.text}})),new Vn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[Et.Uri,Et.Position,Et.String.with("newName","The new symbol name")],new In("A promise that resolves to a WorkspaceEdit.",n=>{if(n){if(n.rejectReason)throw new Error(n.rejectReason);return lf.to(n)}})),new Vn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[Et.Uri,Et.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new In("A promise that resolves to an array of DocumentLink-instances.",n=>n.map(zM.to))),new Vn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[Et.Uri],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[Et.Uri],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[Et.Uri,Et.Range.optional()],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[Et.Uri,Et.Range],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),Et.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new In("A promise that resolves to a CompletionList-instance.",(n,e,t)=>{if(!n)return new WF([]);const i=n.suggestions.map(s=>rIe.to(s,t));return new WF(i,n.incomplete)})),new Vn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new In("A promise that resolves to SignatureHelp.",n=>{if(n)return DG.to(n)})),new Vn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[Et.Uri,Et.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new In("A promise that resolves to an array of CodeLens-instances.",(n,e,t)=>fA(i=>new O6(at.to(i.range),i.command&&t.fromInternal(i.command)))(n))),new Vn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[Et.Uri,new Et("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",n=>rs.isRange(n),n=>XS.isSelection(n)?ZS.from(n):at.from(n)),Et.String.with("kind","Code action kind to return code actions for").optional(),Et.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new In("A promise that resolves to an array of Command-instances.",(n,e,t)=>fA(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const s=new F6(i.title,i.kind?new Ya(i.kind):void 0);return i.edit&&(s.edit=lf.to(i.edit)),i.command&&(s.command=t.fromInternal(i.command)),s.isPreferred=i.isPreferred,s}})(n))),new Vn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[Et.Uri],new In("A promise that resolves to an array of ColorInformation objects.",n=>n?n.map(e=>new z6(at.to(e.range),T4.to(e.color))):[])),new Vn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new Et("color","The color to show and insert",n=>n instanceof VF,T4.from),new Et("context","Context object with uri and range",n=>!0,n=>({uri:n.uri,range:at.from(n.range)}))],new In("A promise that resolves to an array of ColorPresentation objects.",n=>n?n.map(goe.to):[])),new Vn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[Et.Uri,Et.Range],new In("A promise that resolves to an array of Inlay objects",(n,e,t)=>n.map(aIe.to.bind(void 0,t)))),new Vn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[Et.Uri],new In("A promise that resolves to an array of FoldingRange objects",(n,e)=>{if(n)return n.map(poe.to)})),new Vn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new In("A promise that resolves to an array of NotebookContentProvider static info objects.",fA(n=>({viewType:n.viewType,displayName:n.displayName,options:{transientOutputs:n.options.transientOutputs,transientCellMetadata:n.options.transientCellMetadata,transientDocumentMetadata:n.options.transientDocumentMetadata},filenamePattern:n.filenamePattern.map(e=>voe.to(e))})))),new Vn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[Et.Uri,Et.Range,new Et("context","An InlineValueContext",n=>n&&typeof n.frameId=="number"&&n.stoppedLocation instanceof rs,n=>aoe.from(n))],new In("A promise that resolves to an array of InlineValue objects",n=>n.map(roe.to))),new Vn("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new Et("uriOrString","Uri-instance or string (only http/https)",n=>P.isUri(n)||typeof n=="string"&&L9(n,_e.http,_e.https),n=>n),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional(),Et.String.with("label","").optional()],In.Void),new Vn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[Et.Uri.with("resource","Resource to open"),Et.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional()],In.Void),new Vn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[Et.Uri.with("left","Left-hand side resource of the diff editor"),Et.Uri.with("right","Right-hand side resource of the diff editor"),Et.String.with("title","Human readable title for the diff editor").optional(),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="object",n=>n&&[yd.from(n.viewColumn),C8.from(n)]).optional()],In.Void),new Vn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[Et.String.with("title","Human readable title for the changes editor"),new Et("resourceList","List of resources to compare",n=>{for(const e of n){if(e.length!==3)return!1;const[t,i,s]=e;if(!P.isUri(t)||!P.isUri(i)&&i!==void 0&&i!==null||!P.isUri(s)&&s!==void 0&&s!==null)return!1}return!0},n=>n)],In.Void),new Vn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[Et.TestItem],In.Void),new Vn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[Et.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],In.Void),new Vn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[Et.String.with("name","The context key name"),new Et("value","The context key value",()=>!0,n=>n)],In.Void),new Vn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[Et.Uri,Et.StringArray,new Et("MappedEditsContext","Mapped Edits Context",n=>_oe.is(n),n=>_oe.from(n))],new In("A promise that resolves to a workspace edit or null",n=>n?lf.to(n):null)),new Vn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new Et("Run arguments","",n=>!0,n=>{if(n)return{initialRange:n.initialRange?at.from(n.initialRange):void 0,initialSelection:XS.isSelection(n.initialSelection)?ZS.from(n.initialSelection):void 0,message:n.message,autoSend:n.autoSend,position:n.position?Wr.from(n.position):void 0}})],In.Void)];class gii{static register(e){uii.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",ndt)}}function fA(n){return e=>{if(Array.isArray(e))return e.map(n)}}function bY(n){if(!Array.isArray(n))return;const e=[];for(const t of n)BQe(t)?e.push(xG.to(t)):e.push(P_.to(t));return e}let DTe=class{constructor(e,t){this._proxy=e.getProxy(Ue.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const s=new $h(lf.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(s,void 0,i?.isRefactoring??!1)}};DTe=D([_(0,gr)],DTe);class fii{constructor(e,t,i,s,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=s,this._sessionDisposables=o,this._stopWatch=ao.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this;this._stopWatch.reset();const i=(s,o)=>{if(typeof this._firstProgress>"u"&&"content"in s&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,s),a={report:c=>{r?.then(l=>{l&&(vp.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,NG.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,Sx.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,bIe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,s)};this._apiObject={markdown(s){t(this.markdown);const o=new Jhe(s),r=TG.from(o);return i(r),this},markdownWithVulnerabilities(s,o){t(this.markdown),o&&Je(e._extension,"chatParticipantAdditions");const r=new fG(s,o),a=Soe.from(r);return i(a),this},filetree(s,o){t(this.filetree);const r=new Xhe(s,o),a=RG.from(r);return i(a),this},anchor(s,o){t(this.anchor);const r=new Zhe(s,o),a=MG.from(r);return i(a),this},button(s){t(this.anchor);const o=new eue(s),r=PG.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(s,o){t(this.progress);const r=new Fot(s,o),a=o?wIe.from(r):F4.from(r);return i(a,o),this},warning(s){t(this.progress),Je(e._extension,"chatParticipantAdditions");const o=new _G(s),r=NG.from(o);return i(r),this},reference(s,o){if(t(this.reference),"variableName"in s&&Je(e._extension,"chatParticipantAdditions"),"variableName"in s&&!s.value){const r=e._request.variables.variables.find(a=>a.name===s.variableName);if(r){let a;if(r.references?.length)a=r.references.map(c=>({kind:"reference",reference:{variableName:s.variableName,value:c.reference}}));else{const c=new GI(s,o);a=[Sx.from(c)]}return a.forEach(c=>i(c)),this}}else{const r=new GI(s,o),a=Sx.from(r);i(a)}return this},textEdit(s,o){t(this.textEdit),Je(e._extension,"chatParticipantAdditions");const r=new vG(s,o),a=Eoe.from(r);return i(a),this},detectedParticipant(s,o){t(this.detectedParticipant),Je(e._extension,"chatParticipantAdditions");const r=new pG(s,o),a=Aoe.from(r);return i(a),this},confirmation(s,o,r){t(this.confirmation),Je(e._extension,"chatParticipantAdditions");const a=new _ke(s,o,r),c=vIe.from(a);return i(c),this},push(s){if(t(this.push),(s instanceof vG||s instanceof fG||s instanceof pG||s instanceof _G||s instanceof _ke)&&Je(e._extension,"chatParticipantAdditions"),s instanceof GI)this.reference(s.value,s.iconPath);else{const o=xoe.from(s,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const d9=class d9 extends ${constructor(e,t,i,s){super(),this._logService=t,this.commands=i,this.quality=s,this._agents=new Map,this._sessionDisposables=this._register(new Zo),this._completionDisposables=this._register(new Zo),this._proxy=e.getProxy(Ue.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const s=d9._idPool++,o=new o6e(e,this.quality,t,this._proxy,s,i);return this._agents.set(s,o),o.isAgentEnabled()&&this._proxy.$registerAgent(s,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,s){const o=d9._idPool++,r=new o6e(e,this.quality,t,this._proxy,o,s);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,s){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let r=this._sessionDisposables.get(t.sessionId);r||(r=new Z,this._sessionDisposables.set(t.sessionId,r));const a=new fii(o.extension,t,this._proxy,this.commands.converter,r);try{const c=await this.prepareHistoryTurns(t.agentId,i),l=o.invoke(CIe.to(t),{history:c},a.apiObject,s);return await dw(Promise.resolve(l).then(d=>{if(d?.metadata)try{JSON.stringify(d.metadata)}catch(u){const f=`result.metadata MUST be JSON.stringify-able. Got error: ${u.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${f}`,o.extension),{errorDetails:{message:f},timings:a.timings}}let h;return d?.errorDetails&&(h={...d.errorDetails,responseIsIncomplete:!0}),h?.responseIsRedacted&&Je(o.extension,"chatParticipantPrivate"),{errorDetails:h,timings:a.timings,metadata:d?.metadata}}),s)}catch(c){return this._logService.error(c,o.extension),c instanceof qg&&c.cause&&(c=c.cause),{errorDetails:{message:Ma(c),responseIsIncomplete:!0}}}finally{a.close()}}async prepareHistoryTurns(e,t){const i=[];for(const s of t.history){const o=rH.to(s.result),r=e===s.request.agentId?o:{...o,metadata:void 0};i.push(new Oot(s.request.message,s.request.command,s.request.variables.variables.map(Doe.to),s.request.agentId));const a=Ui(s.response.map(c=>xoe.toContent(c,this.commands.converter)));i.push(new Bot(a,r,s.request.agentId,s.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,s,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=await this.prepareHistoryTurns(r.id,s),c=rH.to(i);return(await r.provideFollowups(c,{history:a},o)).filter(l=>{const d=!l.participant||fi.some(this._agents.values(),h=>h.id===l.participant&&Cn.equals(h.extension.identifier,r.extension.identifier));return d||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${l.participant}`),d}).map(l=>LG.from(l,e))}$acceptFeedback(e,t,i,s){const o=this._agents.get(e);if(!o)return;const r=rH.to(t);let a;switch(i){case zV.Down:a=y4.Unhelpful;break;case zV.Up:a=y4.Helpful;break}o.acceptFeedback(Object.freeze(s?{result:r,kind:a,reportIssue:s}:{result:r,kind:a}))}$acceptAction(e,t,i){const s=this._agents.get(e);if(!s||i.action.kind==="vote")return;const o=SIe.to(t,i,this.commands.converter);o&&s.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const s=this._agents.get(e);if(!s)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await s.invokeCompletionProvider(t,i)).map(a=>yIe.from(a,this.commands.converter,o))}async $provideWelcomeMessage(e,t,i){const s=this._agents.get(e);if(s)return await s.provideWelcomeMessage(O4.to(t),i)}async $provideSampleQuestions(e,t,i){const s=this._agents.get(e);if(s)return(await s.provideSampleQuestions(O4.to(t),i)).map(o=>LG.from(o,void 0))}};d9._idPool=0;let kTe=d9;class o6e{constructor(e,t,i,s,o,r){this.extension=e,this.quality=t,this.id=i,this._proxy=s,this._handle=o,this._requestHandler=r,this._onDidReceiveFeedback=new I,this._onDidPerformAction=new I}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}isAgentEnabled(){return!(this.quality==="stable"&&!Cd(this.extension,"chatParticipantPrivate"))}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const s=await this._followupProvider.provideFollowups(e,t,i);return s?s.filter(o=>!(o&&"commandId"in o)).filter(o=>!(o&&"message"in o)):[]}async provideWelcomeMessage(e,t){if(!this._welcomeMessageProvider)return[];const i=await this._welcomeMessageProvider.provideWelcomeMessage(e,t);return i?i.map(s=>typeof s=="string"?s:Qs.from(s)):[]}async provideSampleQuestions(e,t){if(!this._welcomeMessageProvider||!this._welcomeMessageProvider.provideSampleQuestions)return[];const i=await this._welcomeMessageProvider.provideSampleQuestions(e,t);return i||[]}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{s.isAgentEnabled()&&(this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof P?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof fg?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Qs.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Qs.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Qs.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1)}))},s=this;return{get id(){return s.id},get iconPath(){return s._iconPath},set iconPath(o){s._iconPath=o,i()},get requestHandler(){return s._requestHandler},set requestHandler(o){Bt(typeof o=="function","Invalid request handler"),s._requestHandler=o},get followupProvider(){return s._followupProvider},set followupProvider(o){s._followupProvider=o,i()},get isDefault(){return Je(s.extension,"defaultChatParticipant"),s._isDefault},set isDefault(o){Je(s.extension,"defaultChatParticipant"),s._isDefault=o,i()},get helpTextPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix},set helpTextPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix},set helpTextPostfix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix=o,i()},get isSecondary(){return Je(s.extension,"defaultChatParticipant"),s._isSecondary},set isSecondary(o){Je(s.extension,"defaultChatParticipant"),s._isSecondary=o,i()},get supportIssueReporting(){return Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting},set supportIssueReporting(o){Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return s._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");s._proxy.$registerAgentCompletionsProvider(s._handle,s.id,o.triggerCharacters)}else s._proxy.$unregisterAgentCompletionsProvider(s._handle,s.id)},get participantVariableProvider(){return Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider},set welcomeMessageProvider(o){Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider},onDidPerformAction:Cd(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){s._requester=o,i()},get requester(){return s._requester},set supportsSlowReferences(o){Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences},dispose(){e=!0,s._followupProvider=void 0,s._onDidReceiveFeedback.dispose(),s._proxy.$unregisterAgent(s._handle)}}}invoke(e,t,i,s){return this._requestHandler(e,t,i,s)}}const wle=class wle{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Ue.MainThreadChatVariables)}async $resolveVariable(e,t,i,s){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Je(o.extension,"chatParticipantAdditions");const r=new pii(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,s);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},s);if(r&&r[0])return r[0].value}}catch(r){er(r)}}registerVariableResolver(e,t,i,s,o,r,a,c,l){const d=wle._idPool++,h=l?$e.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:s,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:s,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}attachContext(e,t,i){this._proxy.$attachContext(e,_p.isLocation(t)?yx.from(t):t,O4.from(i))}};wle._idPool=0;let ITe=wle;class pii{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this,i=s=>{this._proxy.$handleProgressChunk(this._requestId,s)};this._apiObject={progress(s){t(this.progress);const o=new mG(s),r=F4.from(o);return i(r),this},reference(s){t(this.reference);const o=new GI(s),r=Sx.from(o);return i(r),this},push(s){return t(this.push),s instanceof GI?i(Sx.from(s)):s instanceof mG&&i(F4.from(s)),this}}}return this._apiObject}}class mii{constructor(e){const t=e.getProxy(Ue.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const Fat="vscode-cdn.net",_ii=`vscode-resource.${Fat}`,LTe=`'self' https://*.${Fat}`;function O8(n,e){return n.scheme===_e.http||n.scheme===_e.https?n:(e&&e.authority&&e.isRemote&&n.scheme===_e.file&&(n=P.from({scheme:_e.vscodeRemote,authority:e.authority,path:n.path})),P.from({scheme:_e.https,authority:`${n.scheme}+${vii(n.authority)}.${_ii}`,path:n.path,fragment:n.fragment,query:n.query}))}function vii(n){return n.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=q.a&&t<=q.z||t>=q.A&&t<=q.Z||t>=q.Digit0&&t<=q.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class wii{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new Z,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const s=t.getVisibleTextEditors();for(const o of this._insets.values())s.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,s,o){let r;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){r=f;break}if(!r)throw new Error("not a visible editor");const a=this,c=this._handlePool++,l=new I,d=new I,h=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(f){return O8(f,a._remoteInfo)}get cspSource(){return LTe}set options(f){this._options=f,a._proxy.$setOptions(c,f)}get options(){return this._options}set html(f){this._html=f,a._proxy.$setHtml(c,f)}get html(){return this._html}get onDidReceiveMessage(){return l.event}postMessage(f){return a._proxy.$postMessage(c,f)}},u=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=h,this.onDidDispose=d.event}dispose(){a._insets.has(c)&&(a._insets.delete(c),a._proxy.$disposeEditorInset(c),d.fire(),d.dispose(),l.dispose())}};return this._proxy.$createEditorInset(c,r.id,r.value.document.uri,t+1,i,s||{},o.identifier,o.extensionLocation),this._insets.set(c,{editor:e,inset:u,onDidReceiveMessage:l}),u}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}function bii(n,e,t){const i=n.getProxy(Ue.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new $a,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===Fs.CommentController){const w=this._commentControllers.get(v.handle);return w?w.value:v}else if(v&&v.$mid===Fs.CommentThread){const w=v,b=this._commentControllers.get(w.commentControlHandle);if(!b)return w;const C=b.getCommentThread(w.commentThreadHandle);return C?C.value:w}else if(v&&(v.$mid===Fs.CommentThreadReply||v.$mid===Fs.CommentThreadInstance)){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);return b?v.$mid===Fs.CommentThreadInstance?b.value:{thread:b.value,text:v.text}:v}else if(v&&v.$mid===Fs.CommentNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.commentUniqueId,y=b.getCommentByUniqueId(C);return y||v}else if(v&&v.$mid===Fs.CommentThreadNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.text,y=v.commentUniqueId,S=b.getCommentByUniqueId(y);return S?(typeof S.body=="string"?S.body=C:S.body=new vp(C),S):v}return v}})}createCommentController(v,w,b){const C=f.handlePool++,y=new r(v,C,w,b);this._commentControllers.set(y.handle,y);const S=this._commentControllersByExtension.get(v.identifier)||[];return S.push(y),this._commentControllersByExtension.set(v.identifier,S),y.value}async $createCommentThreadTemplate(v,w,b,C){const y=this._commentControllers.get(v);y&&y.$createCommentThreadTemplate(w,b,C)}async $setActiveComment(v,w){const b=this._commentControllers.get(v);b&&b.$setActiveComment(w??void 0)}async $updateCommentThreadTemplate(v,w,b){const C=this._commentControllers.get(v);C&&C.$updateCommentThreadTemplate(w,b)}$deleteCommentThread(v,w){this._commentControllers.get(v)?.$deleteCommentThread(w)}async $provideCommentingRanges(v,w,b){const C=this._commentControllers.get(v);if(!C||!C.commentingRangeProvider)return Promise.resolve(void 0);const y=await t.ensureDocumentData(P.revive(w));return Zu(async()=>{const S=await C.commentingRangeProvider.provideCommentingRanges(y.document,b);let M;return Array.isArray(S)?M={ranges:S,fileComments:!1}:S?M={ranges:S.ranges||[],fileComments:S.fileComments||!1}:M=S??void 0,M}).then(S=>{let M;return S&&(M={ranges:S.ranges.map(k=>at.from(k)),fileComments:S.fileComments}),M})}$toggleReaction(v,w,b,C,y){const S=this._commentControllers.get(v);return!S||!S.reactionHandler?Promise.resolve(void 0):Zu(()=>{const M=S.getCommentThread(w);if(M){const k=M.getCommentByUniqueId(C.uniqueIdInThread);if(S!==void 0&&k&&S.reactionHandler)return S.reactionHandler(k,l(y))}return Promise.resolve(void 0)})}};f.handlePool=0;let s=f;const p=class p{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire()}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?(Je(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,w,b,C,y,S,M,k,F){this._commentControllerHandle=w,this._id=b,this._uri=C,this._range=y,this._comments=S,this.extensionDescription=M,this._isTemplate=k,this.handle=p._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new I,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new Dn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(w,this.handle,this._id,this._uri,at.from(this._range),M.identifier,this._isTemplate,F),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this.comments=S,this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(w,this.handle)}});const N=this;this.value={get uri(){return N.uri},get range(){return N.range},set range(z){N.range=z},get comments(){return N.comments},set comments(z){N.comments=z},get collapsibleState(){return N.collapsibleState},set collapsibleState(z){N.collapsibleState=z},get canReply(){return N.canReply},set canReply(z){N.canReply=z},get contextValue(){return N.contextValue},set contextValue(z){N.contextValue=z},get label(){return N.label},set label(z){N.label=z},get state(){return N.state},set state(z){N.state=z},dispose:()=>{N.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new Z);const v=b=>Object.prototype.hasOwnProperty.call(this.modifications,b),w={};v("range")&&(w.range=at.from(this._range)),v("label")&&(w.label=this.label),v("contextValue")&&(w.contextValue=this.contextValue??null),v("comments")&&(w.comments=this._comments.map(b=>a(this,b,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(w.collapseState=d(this._collapseState)),v("canReply")&&(w.canReply=this.canReply),v("state")&&(w.state=h(this._state)),v("applicability")&&(w.applicability=u(this._state)),v("isTemplate")&&(w.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,w)}getCommentByUniqueId(v){for(const w of this._commentsMap){const b=w[0],C=w[1];if(v===C)return b}}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};p._handlePool=0;let o=p;class r{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&Je(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return Je(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Je(this._extension,"activeComment"),this._activeThread}constructor(v,w,b,C){this._extension=v,this._handle=w,this._id=b,this._label=C,this._threads=new Map,i.$registerCommentController(this.handle,b,C,this._extension.identifier.value);const y=this;this.value=Object.freeze({id:y.id,label:y.label,get options(){return y.options},set options(S){y.options=S},get commentingRangeProvider(){return y.commentingRangeProvider},set commentingRangeProvider(S){y.commentingRangeProvider=S},get reactionHandler(){return y.reactionHandler},set reactionHandler(S){y.reactionHandler=S},get activeCommentThread(){return y.activeCommentThread},createCommentThread(S,M,k){return y.createCommentThread(S,M,k).value},dispose:()=>{y.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,w,b){w===void 0&&Je(this._extension,"fileComments");const C=new o(this.id,this.handle,void 0,v,w,b,this._extension,!1);return this._threads.set(C.handle,C),C}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const w=this._threads.get(v.commentThreadHandle);w&&(this._activeComment=v.uniqueIdInThread?w.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=w)}$createCommentThreadTemplate(v,w,b){const C=new o(this.id,this.handle,void 0,P.revive(v),at.to(w),[],this._extension,!0,b);return C.collapsibleState=zl.Expanded,this._threads.set(C.handle,C),C}$updateCommentThreadTemplate(v,w){const b=this._threads.get(v);b&&(b.range=at.to(w))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(m,v,w,b){let C=w.get(v);return C||(C=++m.commentHandle,w.set(v,C)),v.state!==void 0&&Je(b,"commentsDraftState"),v.reactions?.some(y=>y.reactors!==void 0)&&Je(b,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:C,body:typeof v.body=="string"?v.body:Qs.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(y=>c(y)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?rue(m.iconPath):void 0,count:m.count,hasReacted:m.authorHasReacted,reactors:m.reactors&&m.reactors.length>0&&typeof m.reactors[0]!="string"?m.reactors.map(v=>v.name):m.reactors}}function l(m){return{label:m.label||"",count:m.count||0,iconPath:m.iconPath?P.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case m4.Expanded:return zl.Expanded;case m4.Collapsed:return zl.Collapsed}return zl.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case _4.Unresolved:return hg.Unresolved;case _4.Resolved:return hg.Resolved}return hg.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case iG.Current:return kI.Current;case iG.Outdated:return kI.Outdated}return kI.Current}return new s}var UR,VR,Aq,Eq,xq,dy,zR,$R,GR,qR,Dq,KH,QR;class Cii{constructor(e,t,i,s,o,r,a){kt(this,UR);kt(this,VR);kt(this,Aq);kt(this,Eq);kt(this,xq);kt(this,dy);kt(this,zR);kt(this,$R);kt(this,GR);kt(this,qR);kt(this,Dq);kt(this,KH);kt(this,QR);st(this,zR,""),st(this,GR,!1),st(this,qR,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,st(this,QR,new I),this._onDidDispose=se(this,QR).event,st(this,UR,e),st(this,VR,t),st(this,$R,i),st(this,Eq,s),st(this,xq,o),st(this,dy,r),st(this,Dq,q4(r)),st(this,KH,yii(r)),st(this,Aq,a)}dispose(){st(this,GR,!0),se(this,QR).fire(),se(this,QR).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return st(this,qR,!0),O8(e,se(this,Eq))}get cspSource(){const e=se(this,dy).extensionLocation;if(e.scheme===_e.https||e.scheme===_e.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+LTe}return LTe}get html(){return this.assertNotDisposed(),se(this,zR)}set html(e){this.assertNotDisposed(),se(this,zR)!==e&&(st(this,zR,e),se(this,KH)&&!se(this,qR)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(st(this,qR,!0),se(this,Aq).report("Webview vscode-resource: uris",se(this,dy),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),se(this,VR).$setHtml(se(this,UR),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),se(this,$R)}set options(e){this.assertNotDisposed(),Io(se(this,$R),e)||se(this,VR).$setOptions(se(this,UR),Oat(se(this,dy),se(this,xq),e)),st(this,$R,e)}async postMessage(e){if(se(this,GR))return!1;const t=zot(e,{serializeBuffersForPostMessage:se(this,Dq)});return se(this,VR).$postMessage(se(this,UR),t.message,...t.buffers)}assertNotDisposed(){if(se(this,GR))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!se(this,KH))return e;const t=se(this,dy).extensionLocation?.scheme===_e.vscodeRemote,i=se(this,dy).extensionLocation.scheme===_e.vscodeRemote?se(this,dy).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}UR=new WeakMap,VR=new WeakMap,Aq=new WeakMap,Eq=new WeakMap,xq=new WeakMap,dy=new WeakMap,zR=new WeakMap,$R=new WeakMap,GR=new WeakMap,qR=new WeakMap,Dq=new WeakMap,KH=new WeakMap,QR=new WeakMap;function q4(n){try{const e=L6(I6(n.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function yii(n){try{const e=L6(I6(n.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class Sii extends ${constructor(e,t,i,s,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=s,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Ue.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const s=this.getWebview(e);if(s){const{message:o}=$ot(t,i.value);s._onMessageEmitter.fire(o)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const s=new Cii(e,this._webviewProxy,Aii(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,s);const o=s._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return s}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function Tre(n){return{id:n.identifier,location:n.extensionLocation}}function Oat(n,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||Eii(n,e)}}function Aii(n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots?.map(e=>P.from(e))}}function Eii(n,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),n.extensionLocation]}const ble=class ble{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){ble.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};ble.enableDebugLogging=!1;let F_=ble;class xii{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new F_("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=Rii(this.document.uri)+this._backupCounter++;return qt(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class Dii{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const s=this.key(e,t.uri);if(this._documents.has(s))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new xii(t,i);return this._documents.set(s,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var SI;(function(n){n[n.Text=0]="Text",n[n.Custom=1]="Custom"})(SI||(SI={}));class kii{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:SI.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:SI.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new oo(()=>this._providers.delete(e))}}class Iii{constructor(e,t,i,s,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=s,this._extHostWebviewPanels=o,this._editorProviders=new kii,this._documents=new Dii,this._proxy=e.getProxy(Ue.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,s){const o=new Z;return Lii(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(Tre(e),t,s.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},q4(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),CY(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(Tii(r)){const c=a.addEdit(r);this._proxy.$onDidEdit(r.document.uri,t,c,r.label)}else this._proxy.$onContentChange(r.document.uri,t)})),this._proxy.$registerCustomEditorProvider(Tre(e),t,s.webviewOptions||{},!!s.supportsMultipleEditorsPerDocument,q4(e))),oo.from(o,new oo(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,s,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==SI.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=P.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:s?.buffer},o);let l;return CY(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:CY(r.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==SI.Custom)throw new Error(`Invalid provider type for '${t}'`);const s=P.revive(e),{document:o}=this.getCustomDocumentEntry(t,s);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,s,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=yd.to(o),l=this._extHostWebview.createNewWebview(t,s.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,s.title,c,s.options,l,s.active),h=P.revive(e);switch(a.type){case SI.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case SI.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,r)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const s=this._editorProviders.get(i);if(!s)throw new Error(`No provider found for '${i}'`);if(!s.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const o=this._extHostWebviewPanels.getWebviewPanel(e);if(!o)throw new Error("No webview found");const r=P.revive(t),a=this._extHostDocuments.getDocument(r);await s.provider.moveCustomTextEditor(a,o,qe.None)}async $undo(e,t,i,s){return this.getCustomDocumentEntry(t,e).undo(i,s)}async $redo(e,t,i,s){return this.getCustomDocumentEntry(t,e).redo(i,s)}async $revert(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(s.document,i),s.disposeBackup()}async $onSave(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(s.document,i),s.disposeBackup()}async $onSaveAs(e,t,i,s){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,P.revive(i),s)}async $backup(e,t,i){const s=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(s.document,{destination:s.getNewBackupUri()},i);return s.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,P.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!CY(i))throw new Error("Custom document is not editable");return i}}function CY(n){return!!n.onDidChangeCustomDocument}function Lii(n){return typeof n.resolveCustomTextEditor=="function"}function Tii(n){return typeof n.undo=="function"&&typeof n.redo=="function"}function Rii(n){const e=n.scheme===_e.file||n.scheme===_e.untitled?n.fsPath:n.toString();return Ed(e)+""}var jD;const Mii="vs/workbench/api/common/extHostDiagnostics";var YA,Lk,bh;const LBe=class LBe{constructor(e,t,i,s,o,r,a,c){kt(this,YA);kt(this,Lk);kt(this,bh);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=s,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(s,i),st(this,bh,new wi(l=>r.getComparisonKey(l))),st(this,YA,a),st(this,Lk,c)}dispose(){this._isDisposed||(se(this,Lk).fire([...se(this,bh).keys()]),se(this,YA)?.$clear(this._owner),se(this,bh).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(P.isUri(e)){if(!t){this.delete(e);return}se(this,bh).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(LBe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&se(this,bh).get(r).length===0&&se(this,bh).delete(r),r=c,i.push(c),se(this,bh).set(c,[])),l)se(this,bh).get(c)?.push(...l);else{const d=se(this,bh).get(c);d&&(d.length=0)}}}if(se(this,Lk).fire(i),!se(this,YA))return;const s=[];let o=0;for(const r of i){let a=[];const c=se(this,bh).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Th.Error,Th.Warning,Th.Information,Th.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...k4.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ys.Info,message:g(Mii,0,"Not showing {0} further errors and warnings.",c.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=c.map(l=>({...k4.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(s.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}se(this,YA).$changeMany(this._owner,s)}delete(e){this._checkDisposed(),se(this,Lk).fire([e]),se(this,bh).delete(e),se(this,YA)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),se(this,Lk).fire([...se(this,bh).keys()]),se(this,bh).clear(),se(this,YA)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,s]of this)e.call(t,i,s,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of se(this,bh).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=se(this,bh).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(se(this,bh).get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()t[0].toString()?1:0}};YA=new WeakMap,Lk=new WeakMap,bh=new WeakMap;let Rre=LBe;var sx;let TTe=(sx=class{static _mapper(e){const t=new wi;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,s){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=s,this._collections=new Map,this._onDidChangeDiagnostics=new Fle({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=T.map(this._onDidChangeDiagnostics.event,jD._mapper),this._proxy=e.getProxy(Ue.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:s,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){s.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){s.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){s.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+jD._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+jD._idPool++;while(i.has(d))}return new class extends Rre{constructor(){super(t,d,jD._maxDiagnosticsTotal,jD._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,o),i.set(d,this)}dispose(){super.dispose(),i.delete(d)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const s of this._collections.values())s.forEach((o,r)=>{let a=t.get(o.toString());typeof a>"u"&&(a=i.length,t.set(o.toString(),a),i.push([o,[]])),i[a][1]=i[a][1].concat(...r)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new Rre(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(P.revive(t),i.map(k4.to))}},jD=sx,sx._idPool=0,sx._maxDiagnosticsPerFile=1e3,sx._maxDiagnosticsTotal=1.1*jD._maxDiagnosticsPerFile,sx);TTe=jD=D([_(1,Ze),_(2,Kz)],TTe);class Nii{constructor(e){this._proxy=e.getProxy(Ue.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Je(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(s=>P.revive(s)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?P.revive(t):void 0)}}const Cle=class Cle{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(_e).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=Cle._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let s;if(typeof t.onDidChange=="function"){let o;s=t.onDidChange(async r=>{if(r.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${r.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(r))return;o&&await o;const a=this.$provideTextDocumentContent(i,r).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(r);if(!l)return;const d=xw(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(bt).finally(()=>{o===a&&(o=void 0)});o=a})}return new oo(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),s&&(s.dispose(),s=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(P.revive(t),qe.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};Cle._handlePool=0;let RTe=Cle;class Pii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._callbacks=new td,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,s)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(s)&&s.push(r),r}}async $participateInSave(e,t){const i=P.revive(e);let s=!1;const o=setTimeout(()=>s=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(s)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:foe.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],s){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,s).then(()=>!0,r=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(r),!(r instanceof Error)||r.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,s){const o=[],r=Date.now(),{document:a,reason:c}=s,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw Nle("waitUntil can not be called async");o.push(Promise.resolve(h))}});try{t.apply(i,[d])}catch(h){return Promise.reject(h)}return new Promise((h,u)=>{const f=setTimeout(()=>u(new Error("timeout")),this._thresholds.timeout);return Promise.all(o).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-r}ms`),clearTimeout(f),h(p)}).catch(p=>{clearTimeout(f),u(p)})}).then(h=>{const u={edits:[]};for(const f of h)if(Array.isArray(f)&&f.every(p=>p instanceof qx))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&at.from(v),text:p,eol:m&&R4.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(u)):Promise.reject(new Error("concurrent_edits"))})}}class Fii{constructor(e,t){this._onDidAddDocument=new I,this._onDidRemoveDocument=new I,this._onDidChangeDocument=new I,this._onDidSaveDocument=new I,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new Z,this._documentLoader=new Map,this._proxy=e.getProxy(Ue.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const s of i)this._onDidRemoveDocument.fire(s.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const s of i)this._onDidAddDocument.fire(s.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e){const t=this._documentsAndEditors.getDocument(e);if(t)return Promise.resolve(t);let i=this._documentLoader.get(e.toString());return i||(i=this._proxy.$tryOpenDocument(e).then(s=>{this._documentLoader.delete(e.toString());const o=P.revive(s);return ws(this._documentsAndEditors.getDocument(o))},s=>(this._documentLoader.delete(e.toString()),Promise.reject(s))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>P.revive(t))}$acceptModelLanguageChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");this._onDidRemoveDocument.fire(s.document),s._acceptLanguageId(t),this._onDidAddDocument.fire(s.document)}$acceptModelSaved(e){const t=P.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptIsDirty(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const s=P.revive(e),o=this._documentsAndEditors.getDocument(s);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=l4.Undo:t.isRedoing&&(r=l4.Redo),this._onDidChangeDocument.fire(Xqe({document:o.document,contentChanges:t.changes.map(a=>({range:at.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){Dti(e,t)}}class Oii{constructor(e){this._provider=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const s=this._handlePool++;return this._proxy.$registerEmbeddingProvider(s,t),this._provider.set(s,{id:t,provider:i}),Ee(()=>{this._proxy.$unregisterEmbeddingProvider(s),this._provider.delete(s)})}async computeEmbeddings(e,t,i){i??=qe.None;let s=!1;typeof t=="string"&&(t=[t],s=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(s){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const s=this._provider.get(e);if(!s)return[];const o=await s.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Bii{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const s=this._AiEmbeddingVectorProviders.get(e);if(!s)throw new Error("Embedding vector provider not found");const o=await s.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(s,i),this._proxy.$registerAiEmbeddingVectorProvider(t,s),new oo(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(s),this._AiEmbeddingVectorProviders.delete(s)})}}class Wii{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,s,o=Oi.LastKnownState,r=Oi.LastKnownState;for(const a of e){let c=i?LS(i,a):0;for(c===0?s=Oi.Start:s=r;c{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(l)});const c=i.onDidChangeFile(l=>{const d=[];for(const h of l){const{uri:u,type:f}=h;if(u.scheme!==t)continue;let p;switch(f){case OM.Changed:p=Ko.UPDATED;break;case OM.Created:p=Ko.ADDED;break;case OM.Deleted:p=Ko.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(o,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(o),this._proxy.$unregisterProvider(o)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:s,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:s,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(P.revive(t))).then(i=>Mre._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(P.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(P.revive(t))).then(i=>ze.wrap(i))}$writeFile(e,t,i,s){return Promise.resolve(this._getFsProvider(e).writeFile(P.revive(t),i.buffer,s))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(P.revive(t),i))}$rename(e,t,i,s){return Promise.resolve(this._getFsProvider(e).rename(P.revive(t),P.revive(i),s))}$copy(e,t,i,s){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(P.revive(t),P.revive(i),s))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(P.revive(t)))}$watch(e,t,i,s){const o=this._getFsProvider(e).watch(P.revive(i),s);this._watches.set(t,o)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const s=this._getFsProvider(e);if(!s.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(s.open(P.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,s){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=ze.alloc(s);return Promise.resolve(o.read(t,i,r.buffer,0,s)).then(a=>r.slice(0,a))}$write(e,t,i,s){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,s.buffer,0,s.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}class Hii{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,s,o,r){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,r?.ignoreCreateEvents&&(this._config+=1),r?.ignoreChangeEvents&&(this._config+=2),r?.ignoreDeleteEvents&&(this._config+=4);const a=_w(o),c=typeof o=="string",l=r?.correlate,d=s(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!r?.ignoreCreateEvents)for(const u of h.created){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=oo.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,s,o){const r=oo.from();if(typeof i=="string"||s?.ignoreChangeEvents&&s?.ignoreCreateEvents&&s?.ignoreDeleteEvents)return r;const a=e.getProxy(Ue.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(mR)||i.pattern.includes(Gwe))&&(c=!0);let l;return o&&(s?.ignoreChangeEvents||s?.ignoreCreateEvents||s?.ignoreDeleteEvents)&&(l=JD.UPDATED|JD.ADDED|JD.DELETED,s?.ignoreChangeEvents&&(l&=~JD.UPDATED),s?.ignoreCreateEvents&&(l&=~JD.ADDED),s?.ignoreDeleteEvents&&(l&=~JD.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:s?.excludes??[],filter:l},!!o),oo.from({dispose:()=>a.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class Uii{constructor(e){this._events=e,this.session=this._events.session,this._created=new Ka(()=>this._events.created.map(P.revive)),this._changed=new Ka(()=>this._events.changed.map(P.revive)),this._deleted=new Ka(()=>this._events.deleted.map(P.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class Vii{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new I,this._onDidRenameFile=new I,this._onDidCreateFile=new I,this._onDidDeleteFile=new I,this._onWillRenameFile=new EI,this._onWillCreateFile=new EI,this._onWillDeleteFile=new EI,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,s){return new Hii(this._mainContext,e,t,this._onFileSystemEvent.event,Zp.from(i),s)}$onFileEvent(e){this._onFileSystemEvent.fire(new Uii(e))}$onDidRunFileOperation(e,t){switch(e){case Li.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:P.revive(i.source),newUri:P.revive(i.target)}))}));break;case Li.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break;case Li.CREATE:case Li.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,s,o)=>{const r=function(c){i.call(s,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,s){switch(e){case Li.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:P.revive(o.source),newUri:P.revive(o.target)}))},i,s);case Li.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>P.revive(o.target))},i,s);case Li.CREATE:case Li.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>P.revive(o.target))},i,s)}}async _fireWillEvent(e,t,i,s){const o=new Set,r=[];if(await e.fireAsync(t,s,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof q1&&(r.push([l.extension,h]),o.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),s.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=lf.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class zii{constructor(e,t,i,s,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=s;const r=new Vn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new Et("showOptions","Show Options",a=>!0,a=>a),new Et("resource","Interactive resource Uri",a=>!0,a=>a),new Et("controllerId","Notebook controller Id",a=>!0,a=>a),new Et("title","Interactive editor title",a=>!0,a=>a)],new In("Notebook and input URI",a=>{if(o.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return o.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,s){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class $ii{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}const Bat="vs/workbench/api/common/extHostLanguageFeatures";class Nre{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentSymbols(i,t);if(!iO(s))return s[0]instanceof s4?s.map(Zke.from):Nre._asDocumentSymbolTree(s)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((s,o)=>{let r=s.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(s.location.range.end)),r});const t=[],i=[];for(const s of e){const o={name:s.name||"!!MISSING: name!!",kind:Sw.from(s.kind),tags:s.tags?.map(Qx.from)||[],detail:"",containerName:s.containerName,range:at.from(s.location.range),selectionRange:at.from(s.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(O.containsRange(r.range,o.range)&&!O.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class yY{constructor(e,t,i,s,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=s,this._extTelemetry=o,this._logService=r,this._cache=new F_("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideCodeLenses(i,t);if(!s||t.isCancellationRequested)return;const o=this._cache.add(s),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;croe.from(a))}}class u6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideDocumentHighlights(s,o,i);if(Array.isArray(r))return r.map(L4.from)}}class g6e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,s){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Wr.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,s);if(Array.isArray(c))return c.map(nIe.from)}}class f6e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideLinkedEditingRanges(s,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Ui(r.ranges.map(at.from)),wordPattern:r.wordPattern}}}class p6e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideReferences(o,r,i,s);if(Array.isArray(a))return a.map(P_.from)}}const bW=class bW{constructor(e,t,i,s,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=s,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new F_("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,s){const o=this._documents.getDocument(e),r=mt.isISelection(t)?ZS.to(t):at.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>bW._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Ya(i.only):void 0,triggerKind:_Ie.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,s);if(!mo(l)||s.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fat.to(l)),a=rw.toDataTransfer(i,()=>{throw new tlt});if(await this._provider.prepareDocumentPaste(o,r,a,s),s.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof mse));return rw.from(c)}async providePasteEdits(e,t,i,s,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>at.to(u)),l=rw.toDataTransfer(s,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new u4(o.only):void 0,triggerKind:o.triggerKind},r);if(!d||r.isCancellationRequested)return[];const h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,0,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class m6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(s,t,i);if(Array.isArray(o))return o.map(nh.from)}}class bme{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,s){const o=this._documents.getDocument(e),r=at.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}async provideDocumentRangesFormattingEdits(e,t,i,s){Bt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(at.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}}class _6e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,s,o){const r=this._documents.getDocument(e),a=Wr.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,s,o);if(Array.isArray(c))return c.map(nh.from)}}class SY{constructor(e,t){this._provider=e,this._logService=t,this._cache=new F_("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!mo(i))return{symbols:[]};const s=this._cache.add(i),o={cacheId:s,symbols:[]};for(let r=0;ro.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(h9._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};h9.languageTriggerKindToVSCodeTriggerKind={[rF.Invoke]:tG.Invoke,[rF.Automatic]:tG.Automatic};let W8=h9;class Cme{constructor(e,t){this.resultId=e,this.tokens=t}}class Op{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=t!==0?this._previousResults.get(t):null;let r=typeof o?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(s,o.resultId,i):await this._provider.provideDocumentSemanticTokens(s,i);return o&&this._previousResults.delete(t),r?(r=Op._fixProvidedSemanticTokens(r),this._send(Op._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Op._isSemanticTokens(e)?Op._isCorrectSemanticTokens(e)?e:new GF(new Uint32Array(e.data),e.resultId):Op._isSemanticTokensEdits(e)?Op._isCorrectSemanticTokensEdits(e)?e:new _8(e.edits.map(t=>new pOe(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!Op._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,s=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(s,r);for(;a({start:s.start,deleteCount:s.deleteCount,data:s.data}))})}return null}}class v6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(s,at.to(t),i);return o?this._send(o):null}_send(e){return d6({id:0,type:"full",data:e.data})}}class $T{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=s,this._extension=o,this._cache=new F_("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=o.getWordRangeAtPosition(r)||new rs(r,r),c=a.with({end:r}),l=new ao,d=await this._provider.provideCompletionItems(o,r,s,oIe.to(i));if(!d||s.isCancellationRequested)return;const h=Array.isArray(d)?new WF(d):d,u=$T.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[aS.completions]:p,[aS.defaultRanges]:{replace:at.from(a),insert:at.from(c)},[aS.isIncomplete]:h.isIncomplete||void 0,[aS.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Qs.fromStrict(e.documentation),[Fi.sortText]:e.sortText!==e.label?e.sortText:void 0,[Fi.filterText]:e.filterText!==e.label?e.filterText:void 0,[Fi.preselect]:e.preselect||void 0,[Fi.insertTextRules]:e.keepWhitespace?cp.KeepWhitespace:cp.None,[Fi.commitCharacters]:e.commitCharacters?.join(""),[Fi.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(nh.from),[Fi.commandIdent]:r?.$ident,[Fi.commandId]:r?.id,[Fi.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Fi.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Fi.insertText]=e.insertText:e.insertText instanceof Q1&&(a[Fi.insertText]=e.insertText.value,a[Fi.insertTextRules]|=cp.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),rs.isRange(c)?a[Fi.range]=at.from(c):c&&(!i?.isEqual(c.inserting)||!s?.isEqual(c.replacing))&&(a[Fi.range]={insert:at.from(c.inserting),replace:at.from(c.replacing)}),a}}class J3{async provideInlineCompletions(e,t,i,s){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,s){}}class Gii extends J3{constructor(e,t,i,s){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this._isAdditionsProposedApiEnabled=Cd(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[Ub.Automatic]:p4.Automatic,[Ub.Explicit]:p4.Invoke}}get supportsHandleEvents(){return Cd(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:at.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},s);if(!a||s.isCancellationRequested)return;const c=Array.isArray(a)?a:a.items,l=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],d=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let h;return{pid:this._references.createReferenceId({dispose(){h?.dispose()},items:c}),items:c.map((f,p)=>{let m;f.command&&(h||(h=new Z),m=this._commands.toInternal(f.command,h));const v=f.insertText;return{insertText:typeof v=="string"?v:{snippet:v.value},filterText:f.filterText,range:f.range?at.from(f.range):void 0,command:m,idx:p,completeBracketPairs:this._isAdditionsProposedApiEnabled?f.completeBracketPairs:!1}}),commands:l.map(f=>(h||(h=new Z),this._commands.toInternal(f,h))),suppressSuggestions:!1,enableForwardStability:d}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const s=this._references.get(e)?.items[t];s&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(s,i)}handlePartialAccept(e,t,i,s){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,AIe.to(s)))}}class yme{async provideInlineEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(s,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!o||i.isCancellationRequested)return;let r;const a=this._references.createReferenceId({dispose(){r?.dispose()},item:o});let c;o.accepted&&(r||(r=new Z),c=this._commands.toInternal(o.accepted,r));let l;return o.rejected&&(r||(r=new Z),l=this._commands.toInternal(o.rejected,r)),{pid:a,text:o.text,range:at.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,s){this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this.languageTriggerKindToVSCodeTriggerKind={[MU.Automatic]:wG.Automatic,[MU.Invoke]:wG.Invoke}}}class Wat{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class Sme{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("SignatureHelp")}async provideSignatureHelp(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,s,a);if(c){const l=this._cache.add([c]);return{...DG.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=DG.to(e.activeSignatureHelp),s=this._cache.get(e.activeSignatureHelp.id,0);s?(t=s,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class AY{constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._logService=s,this._extension=o,this._cache=new F_("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const s=this._documents.getDocument(e),o=at.to(t),r=await this._provider.provideInlayHints(s,o,i);if(!Array.isArray(r)||r.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(r);this._disposables.set(a,new Z);const c={hints:[],cacheId:a};for(let l=0;li.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const s={label:"",cacheId:t,tooltip:Qs.fromStrict(e.tooltip),position:Wr.from(e.position),textEdits:e.textEdits&&e.textEdits.map(nh.from),kind:e.kind&&uoe.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")s.label=e.label;else{const o=[];s.label=o;for(const r of e.label){if(!r.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:r.value,tooltip:Qs.fromStrict(r.tooltip)};_p.isLocation(r.location)&&(a.location=P_.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return s}}class AI{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(s)||s.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:s.filter(AI._validateLink).map(zM.from)};{const o=this._cache.add(s),r={links:[],cacheId:o};for(let a=0;a5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveDocumentLink(i,t);if(!(!s||!AI._validateLink(s)))return zM.from(s)}releaseLinks(e){this._cache.delete(e)}}class Ame{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentColors(i,t);return Array.isArray(s)?s.map(r=>({color:T4.from(r.color),range:at.from(r.range)})):[]}async provideColorPresentations(e,t,i){const s=this._documents.getDocument(e),o=at.to(t.range),r=T4.to(t.color),a=await this._provider.provideColorPresentations(r,{document:s,range:o},i);if(Array.isArray(a))return a.map(goe.from)}}class w6e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(s,t,i);if(Array.isArray(o))return o.map(poe.from)}}class b6e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const s=this._documents.getDocument(e),o=t.map(Wr.to),r=await this._provider.provideSelectionRanges(s,o,i);if(!mo(r))return[];if(r.length!==o.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let c=0;cthis._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideCallsTo(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(s,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>at.from(a))}))}async provideCallsFrom(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(s,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>at.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=KF.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class q5{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new yz(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.prepareTypeHierarchy(s,o,i);if(!r)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(r)?r.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideSupertypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=$M.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class EY{constructor(e,t,i,s,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=o,this._cache=new F_("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,s,o){const r=this._documents.getDocument(t),a=Wr.to(i),c=rw.toDataTransfer(s,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(r,a,c,o);if(!l)return;const d=Kb(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,1,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind?.value,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class C6e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,s){const o=P.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:P.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>at.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,s);return l?lf.from(l):null}}class Q5{constructor(e,t){this.adapter=e,this.extension=t}}const Bl=class Bl{constructor(e,t,i,s,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=s,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Ue.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return D4.from(e,this._uriTransformer,t)}_createDisposable(e){return new oo(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Bl._handlePool++}async _withAdapter(e,t,i,s,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return s;const c=Date.now();r||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const l=i(a.adapter,a.extension);return Promise.resolve(l).catch(d=>{Na(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{r||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),qe.isCancellationToken(o)?qle(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new Q5(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,s){const o=this._addNewAdapter(new Nre(this._documents,i),e),r=s&&s.label||Bl._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,Nre,s=>s.provideDocumentSymbols(P.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new yY(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(s,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=oo.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,yY,s=>s.provideCodeLenses(P.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,yY,s=>s.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,yY,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const s=this._addNewAdapter(new r6e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDefinition(e,t,i,s){return this._withAdapter(e,r6e,o=>o.provideDefinition(P.revive(t),i,s),[],s)}registerDeclarationProvider(e,t,i){const s=this._addNewAdapter(new a6e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDeclaration(e,t,i,s){return this._withAdapter(e,a6e,o=>o.provideDeclaration(P.revive(t),i,s),[],s)}registerImplementationProvider(e,t,i){const s=this._addNewAdapter(new c6e(this._documents,i),e);return this._proxy.$registerImplementationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideImplementation(e,t,i,s){return this._withAdapter(e,c6e,o=>o.provideImplementation(P.revive(t),i,s),[],s)}registerTypeDefinitionProvider(e,t,i){const s=this._addNewAdapter(new l6e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideTypeDefinition(e,t,i,s){return this._withAdapter(e,l6e,o=>o.provideTypeDefinition(P.revive(t),i,s),[],s)}registerHoverProvider(e,t,i,s){const o=this._addNewAdapter(new B8(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,s,o){return this._withAdapter(e,B8,r=>r.provideHover(P.revive(t),i,s,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,B8,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,s){const o=this._addNewAdapter(new d6e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,s){return this._withAdapter(e,d6e,o=>o.provideEvaluatableExpression(P.revive(t),i,s),void 0,s)}registerInlineValuesProvider(e,t,i,s){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new h6e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(r,this._transformDocumentSelector(t,e),o);let a=this._createDisposable(r);if(o!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(o));a=oo.from(a,c)}return a}$provideInlineValues(e,t,i,s,o){return this._withAdapter(e,h6e,r=>r.provideInlineValues(P.revive(t),i,s,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new u6e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}registerMultiDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new g6e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentHighlights(e,t,i,s){return this._withAdapter(e,u6e,o=>o.provideDocumentHighlights(P.revive(t),i,s),void 0,s)}$provideMultiDocumentHighlights(e,t,i,s,o){return this._withAdapter(e,g6e,r=>r.provideMultiDocumentHighlights(P.revive(t),i,s.map(a=>P.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const s=this._addNewAdapter(new f6e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideLinkedEditingRanges(e,t,i,s){return this._withAdapter(e,f6e,async o=>{const r=await o.provideLinkedEditingRanges(P.revive(t),i,s);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Bl._serializeRegExp(r.wordPattern):void 0}},void 0,s)}registerReferenceProvider(e,t,i){const s=this._addNewAdapter(new p6e(this._documents,i),e);return this._proxy.$registerReferenceSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideReferences(e,t,i,s,o){return this._withAdapter(e,p6e,r=>r.provideReferences(P.revive(t),i,s,o),void 0,o)}registerCodeActionProvider(e,t,i,s){const o=new Z,r=this._addNewAdapter(new L2(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:s?.providedCodeActionKinds?.map(a=>a.value),documentation:s?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},Bl._extLabel(e),Bl._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,s,o){return this._withAdapter(e,L2,r=>r.provideCodeActions(P.revive(t),i,s,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,L2,s=>s.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,L2,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const s=this._addNewAdapter(new m6e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(s,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(s)}$provideDocumentFormattingEdits(e,t,i,s){return this._withAdapter(e,m6e,o=>o.provideDocumentFormattingEdits(P.revive(t),i,s),void 0,s)}registerDocumentRangeFormattingEditProvider(e,t,i){const s=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new bme(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,s),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,s,o){return this._withAdapter(e,bme,r=>r.provideDocumentRangeFormattingEdits(P.revive(t),i,s,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,s,o){return this._withAdapter(e,bme,r=>r.provideDocumentRangesFormattingEdits(P.revive(t),i,s,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,s){const o=this._addNewAdapter(new _6e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),s,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,s,o,r){return this._withAdapter(e,_6e,a=>a.provideOnTypeFormattingEdits(P.revive(t),i,s,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new SY(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,SY,s=>s.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,SY,s=>s.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,SY,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const s=this._addNewAdapter(new PR(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(s,this._transformDocumentSelector(t,e),PR.supportsResolving(i)),this._createDisposable(s)}$provideRenameEdits(e,t,i,s,o){return this._withAdapter(e,PR,r=>r.provideRenameEdits(P.revive(t),i,s,o),void 0,o)}$resolveRenameLocation(e,t,i,s){return this._withAdapter(e,PR,o=>o.resolveRenameLocation(P.revive(t),i,s),void 0,s)}registerNewSymbolNamesProvider(e,t,i){const s=this._addNewAdapter(new W8(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,W8,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,s,o){return this._withAdapter(e,W8,r=>r.provideNewSymbolNames(P.revive(t),i,s,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new Op(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=oo.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,s){return this._withAdapter(e,Op,o=>o.provideDocumentSemanticTokens(P.revive(t),i,s),null,s)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Op,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new v6e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,s){return this._withAdapter(e,v6e,o=>o.provideDocumentRangeSemanticTokens(P.revive(t),i,s),null,s)}registerCompletionItemProvider(e,t,i,s){const o=this._addNewAdapter(new $T(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),s,$T.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,s,o){return this._withAdapter(e,$T,r=>r.provideCompletionItems(P.revive(t),i,s,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,$T,s=>s.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,$T,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,s){const o=new Gii(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Cn.toKey(e.identifier.value),s?.yieldTo?.map(a=>Cn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,s,o){return this._withAdapter(e,J3,r=>r.provideInlineCompletions(P.revive(t),i,s,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,s){this._withAdapter(e,J3,async o=>{o.handleDidShowCompletionItem(t,i,s)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,s,o){this._withAdapter(e,J3,async r=>{r.handlePartialAccept(t,i,s,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,J3,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const s=new yme(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(s,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,s){return this._withAdapter(e,yme,o=>o.provideInlineEdits(P.revive(t),i,s),void 0,s)}$freeInlineEdit(e,t){this._withAdapter(e,yme,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,s){const o=Array.isArray(s)?{triggerCharacters:s,retriggerCharacters:[]}:s,r=this._addNewAdapter(new Sme(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,s,o){return this._withAdapter(e,Sme,r=>r.provideSignatureHelp(P.revive(t),i,s,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,Sme,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const s=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new AY(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",s,Bl._extLabel(e));let r=this._createDisposable(o);if(s!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(s));r=oo.from(r,a)}return r}$provideInlayHints(e,t,i,s){return this._withAdapter(e,AY,o=>o.provideInlayHints(P.revive(t),i,s),void 0,s)}$resolveInlayHint(e,t,i){return this._withAdapter(e,AY,s=>s.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,AY,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const s=this._addNewAdapter(new AI(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(s,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(s)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,AI,s=>s.provideLinks(P.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,AI,s=>s.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,AI,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const s=this._addNewAdapter(new Ame(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentColors(e,t,i){return this._withAdapter(e,Ame,s=>s.provideColors(P.revive(t),i),[],i)}$provideColorPresentations(e,t,i,s){return this._withAdapter(e,Ame,o=>o.provideColorPresentations(P.revive(t),i,s),void 0,s)}registerFoldingRangeProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new w6e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(s,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=oo.from(r,a)}return r}$provideFoldingRanges(e,t,i,s){return this._withAdapter(e,w6e,o=>o.provideFoldingRanges(P.revive(t),i,s),void 0,s)}registerSelectionRangeProvider(e,t,i){const s=this._addNewAdapter(new b6e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideSelectionRanges(e,t,i,s){return this._withAdapter(e,b6e,o=>o.provideSelectionRanges(P.revive(t),i,s),[],s)}registerCallHierarchyProvider(e,t,i){const s=this._addNewAdapter(new G5(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareCallHierarchy(e,t,i,s){return this._withAdapter(e,G5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideCallHierarchyIncomingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsTo(t,i,s),void 0,s)}$provideCallHierarchyOutgoingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsFrom(t,i,s),void 0,s)}$releaseCallHierarchy(e,t){this._withAdapter(e,G5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const s=this._addNewAdapter(new q5(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareTypeHierarchy(e,t,i,s){return this._withAdapter(e,q5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideTypeHierarchySupertypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSupertypes(t,i,s),void 0,s)}$provideTypeHierarchySubtypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSubtypes(t,i,s),void 0,s)}$releaseTypeHierarchy(e,t){this._withAdapter(e,q5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new EY(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),Cd(e,"documentPaste")&&s?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:s.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,s,o,r){return this._withAdapter(e,EY,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,P.revive(i),s,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,EY,s=>s.resolveDropEdit(t,i),{},void 0)}$releaseDropEdits(e,t){this._withAdapter(e,EY,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const s=this._addNewAdapter(new C6e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideMappedEdits(e,t,i,s,o){return this._withAdapter(e,C6e,r=>Promise.resolve(r.provideMappedEdits(t,i,s,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new $5(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerPasteEditProvider(o,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:s.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:s.copyMimeTypes,pasteMimeTypes:s.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,s,o){return this._withAdapter(e,$5,r=>r.prepareDocumentPaste(P.revive(t),i,s,o),void 0,o)}$providePasteEdits(e,t,i,s,o,r,a){return this._withAdapter(e,$5,c=>c.providePasteEdits(t,P.revive(i),s,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,$5,s=>s.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,$5,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Bl._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Bl._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Bl._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Bl._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Bl._serializeRegExp(e.beforeText),afterText:e.afterText?Bl._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Bl._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Bl._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>UF.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Bl._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:s}=i;if(s&&KRe(s))throw new Error(`Invalid language configuration: wordPattern '${s}' is not allowed to match the empty string.`);s?this._documents.setWordDefinitionFor(t,s):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const o=this._nextHandle(),r={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Bl._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Bl._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Bl._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Bl._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(o,t,r),this._createDisposable(o)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Bl._handlePool=0;let MTe=Bl;class qii{constructor(e,t,i,s){this._documents=t,this._commands=i,this._uriTransformer=s,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);const i=this._documents.getDocumentData(e);if(!i)throw new Error(`document '${e.toString()}' NOT found`);return i.document}async tokenAtPosition(e,t){const i=e.version,s=Wr.from(t),o=await this._proxy.$tokensAtPosition(e.uri,s),r={type:UE.Other,range:e.getWordRangeAtPosition(t)??new rs(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:at.to(o.range),type:Yke.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const s=this._handlePool++,o=this._proxy,r=this._ids,a=`${e.identifier.value}/${t}`;if(r.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);r.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:TM.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!r.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=PS(()=>{d.clear(),this._proxy.$setLanguageStatus(s,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:D4.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===TM.Error?nt.Error:c.severity===TM.Warning?nt.Warning:nt.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),o.$removeLanguageStatus(s),r.delete(a)},get id(){return c.id},get name(){return c.name},set name(f){c.name=f,h()},get selector(){return c.selector},set selector(f){c.selector=f,h()},get text(){return c.text},set text(f){c.text=f,h()},set text2(f){Je(e,"languageStatusText"),c.text=f,h()},get text2(){return Je(e,"languageStatusText"),c.text},get detail(){return c.detail},set detail(f){c.detail=f,h()},get severity(){return c.severity},set severity(f){c.severity=f,h()},get accessibilityInformation(){return c.accessibilityInformation},set accessibilityInformation(f){c.accessibilityInformation=f,h()},get command(){return c.command},set command(f){c.command=f,h()},get busy(){return c.busy},set busy(f){c.busy=f,h()}};return h(),u}}function Qii(n){return n&&n.title}let NTe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Ue.MainThreadMessageService)}showMessage(e,t,i,s,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof s=="string"||Qii(s)?a=[s,...o]:(r.modal=s?.modal,r.useCustom=s?.useCustom,r.detail=s?.detail,a=o),r.useCustom&&Je(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};NTe=D([_(1,Ze)],NTe);class Eme{constructor(e,t,i,s){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=s}asApiEvent(){return{range:new rS(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class PTe{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1}}constructor(e,t,i){this.notebook=e,this._extHostDocument=t,this._cellData=i,this.handle=i.handle,this.uri=P.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(Y1.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(M4.to(i.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){const e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw new Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);const i={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:kG.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(s){e._mime=s},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(i)}return this._apiCell}setOutputs(e){this._outputs=e.map(Y1.to)}setOutputItems(e,t,i){const s=i.map(N4.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...s),o.items.length>1&&o.items.every(r=>hot(r.mime)))){const r=new Map,a=[];o.items.forEach(c=>{let l;r.has(c.mime)?l=r.get(c.mime):(l=[],r.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),o.items.length=0,a.forEach(c=>{const l=p7t(r.get(c));o.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(M4.to(e))}setMime(e){}}const Sle=class Sle{constructor(e,t,i,s,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=s,this.handle=Sle._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=o.viewType,this._metadata=Object.freeze(o.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,o.cells]],!0,void 0),this._versionId=o.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){const e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===_e.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(i){return i=e._validateIndex(i),e._cells[i].apiCell},getCells(i){return(i?e._getCells(i):e._cells).map(o=>o.apiCell)},save(){return e._save()}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,i){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:i});const s={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===vd.ModelChange?this._spliceNotebookCells(a.changes,!1,s.contentChanges):a.kind===vd.Move?this._moveCells(a.index,a.length,a.newIdx,s.contentChanges):a.kind===vd.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===vd.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===vd.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===vd.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===vd.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),o.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const r=new Map;for(let a=0;a=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,i=e.end|0;return t<0&&(t=0),i>this._cells.length&&(i=this._cells.length),e.with({start:t,end:i})}_getCells(e){e=this._validateRange(e);const t=[];for(let i=e.start;i{const l=a[2].map(u=>{const f=new PTe(this,this._textDocumentsAndEditors,u);return t||o.push(PTe.asModelAddData(u)),f}),d=new Eme(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)r.push(u.uri),d.deletedItems.push(u.apiCell);s.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of s)i.push(a.asApiEvent())}_moveCells(e,t,i,s){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new Eme(e,t,o.map(a=>a.apiCell),[]),new Eme(i,0,[],o)];for(const a of r)s.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,s){this._cells[e].setOutputItems(t,i,s)}_changeCellLanguage(e,t){const i=this._cells[e];i.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(i.uri,t)}_changeCellMime(e,t){const i=this._cells[e];i.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}};Sle._handlePool=0;let FTe=Sle;const Ale=class Ale{constructor(e,t,i,s,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=s,this._viewColumn=r}get apiEditor(){if(!this._editor){const e=this;this._editor={get notebook(){return e.notebookData.apiNotebook},get selection(){return e._selections[0]},set selection(t){this.selections=[t]},get selections(){return e._selections},set selections(t){if(!Array.isArray(t)||!t.every(rS.isNotebookRange))throw Hi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,ES.from(t),i??aG.Default)},get viewColumn(){return e._viewColumn}},Ale.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(ES.from))}_acceptViewColumn(e){this._viewColumn=e}};Ale.apiEditorsToExtHost=new WeakMap;let gq=Ale;class jii extends ${constructor(e,t,i){super(),this._source=e,this._inputTextBuffer=t,this._outputs=i,this._outputTextBuffers=void 0}_getFullModelRange(e){const t=e.getLineCount();return new O(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw new Error("Illegal value for lineNumber");return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){const e=new o7;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:s}=t.create(zb.LF);this._inputTextBuffer=i,this._register(s)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new o7;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:s,disposable:o}=i.create(zb.LF);return this._register(o),s})),this._outputTextBuffers}findInInputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();if(!i)return[];const s=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(s,i,!0,5e3)}findInOutputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(s=>{const o=s.findMatchesLineByLine(this._getFullModelRange(s),i,!0,5e3);if(o.length!==0)return{textBuffer:s,matches:o}}).filter(s=>!!s):[]}}function y6e(n,e){let t=-1;const i=[];let s=[];return n.forEach(r=>{r.range.startLineNumber!==t&&s.length>0&&(i.push([...s]),s=[]),s.push(r),t=r.range.endLineNumber}),s.length>0&&i.push([...s]),i.map(r=>{const a=[],c=r[0].range.startLineNumber,l=r[r.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new Q8t(a.join(` +`)[0];const r={description:o,scope:t};this.descriptionMap.set(i,r),this._onDidChangeCollection.fire()}}getDescription(e){const t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){const t=this.getScopeKey(e);this.descriptionMap.delete(t)}}class Oti{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new I}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,i){this.collection.replace(e,t,i,this.scope)}append(e,t,i){this.collection.append(e,t,i,this.scope)}prepend(e,t,i){this.collection.prepend(e,t,i,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((i,s)=>e.call(t,s,i,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}}let JLe=class extends YLe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new tE}createTerminalFromOptions(e,t){throw new tE}};JLe=D([_(0,Yz),_(1,gr)],JLe);function Eat(n){if(!(!n||typeof n=="string"))return"id"in n?{id:n.id,color:n.color}:n}function Bti(n){return OU.isThemeColor(n)?n:void 0}function K7e(n){const e={...n};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const mue=ae("IExtHostApiDeprecationService");let XLe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Ue.MainThreadTelemetry)}report(e,t,i){const s=this.getUsageKey(e,t);this._reportedUsages.has(s)||(this._reportedUsages.add(s),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${i}`),this._telemetryShape.$publicLog2("extHostDeprecatedApiUsage",{extensionId:t.identifier.value,apiId:e}))}getUsageKey(e,t){return`${e}-${t.identifier.value}`}};XLe=D([_(0,gr),_(1,Ze)],XLe);var Dre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(Dre||(Dre={}));var kre;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(kre||(kre={}));var ZLe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(ZLe||(ZLe={}));var P8;(function(n){function e(s){if(s){const o=s;return o&&!!o.process}else return!1}n.is=e;function t(s){if(s==null)return;const o={process:s.process,args:s.args};return s.options&&(o.options=ZLe.from(s.options)),o}n.from=t;function i(s){if(s!=null)return new zF(s.process,s.args,s.options)}n.to=i})(P8||(P8={}));var eTe;(function(n){function e(i){if(i!=null)return i}n.from=e;function t(i){if(i!=null)return i}n.to=t})(eTe||(eTe={}));var F8;(function(n){function e(s){if(s){const o=s;return o&&(!!o.commandLine||!!o.command)}else return!1}n.is=e;function t(s){if(s==null)return;const o={};return s.commandLine!==void 0?o.commandLine=s.commandLine:(o.command=s.command,o.args=s.args),s.options&&(o.options=eTe.from(s.options)),o}n.from=t;function i(s){if(!(s==null||s.command===void 0&&s.commandLine===void 0))return s.commandLine?new j1(s.commandLine,s.options):new j1(s.command,s.args?s.args:[],s.options)}n.to=i})(F8||(F8={}));var Dx;(function(n){function e(s){if(s){const o=s;return o&&o.customExecution==="customExecution"}else return!1}n.is=e;function t(s){return{customExecution:"customExecution"}}n.from=t;function i(s,o){return o.get(s)}n.to=i})(Dx||(Dx={}));var tTe;(function(n){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}n.from=e})(tTe||(tTe={}));var yI;(function(n){function e(s,o){if(s==null)return[];const r=[];for(const a of s){const c=t(a,o);c&&r.push(c)}return r}n.fromMany=e;function t(s,o){if(s==null)return;let r;s.execution instanceof zF?r=P8.from(s.execution):s.execution instanceof j1?r=F8.from(s.execution):s.execution&&s.execution instanceof Ghe&&(r=Dx.from(s.execution));const a=Dre.from(s.definition);let c;return s.scope?typeof s.scope=="number"?c=s.scope:c=s.scope.uri:c=K1.Workspace,!a||!c?void 0:{_id:s._id,definition:a,name:s.name,source:{extensionId:o.identifier.value,label:s.source,scope:c},execution:r,isBackground:s.isBackground,group:tTe.from(s.group),presentationOptions:kre.from(s.presentationOptions),problemMatchers:s.problemMatchers,hasDefinedMatchers:s.hasDefinedMatchers,runOptions:s.runOptions?s.runOptions:{reevaluateOnRerun:!0},detail:s.detail}}n.from=t;async function i(s,o,r){if(s==null)return;let a;P8.is(s.execution)?a=P8.to(s.execution):F8.is(s.execution)?a=F8.to(s.execution):Dx.is(s.execution)&&(a=Dx.to(s._id,r));const c=Dre.to(s.definition);let l;if(s.source&&(s.source.scope!==void 0?typeof s.source.scope=="number"?l=s.source.scope:l=await o.resolveWorkspaceFolder(P.revive(s.source.scope)):l=K1.Workspace),!c||!l)return;const d=new G6(c,l,s.name,s.source.label,a,s.problemMatchers);return s.isBackground!==void 0&&(d.isBackground=s.isBackground),s.group!==void 0&&(d.group=d4.from(s.group._id),d.group&&s.group.isDefault&&(d.group=new d4(d.group.id,d.group.label),s.group.isDefault===!0&&(d.group.isDefault=s.group.isDefault))),s.presentationOptions&&(d.presentationOptions=kre.to(s.presentationOptions)),s._id&&(d._id=s._id),s.detail&&(d.detail=s.detail),d}n.to=i})(yI||(yI={}));var iTe;(function(n){function e(i){return i}n.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}n.to=t})(iTe||(iTe={}));var yq;class _me{constructor(e,t,i){kt(this,yq);this._id=t,this._task=i,st(this,yq,e)}get task(){return this._task}terminate(){se(this,yq).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}yq=new WeakMap;let nTe=class{constructor(e,t,i,s,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Ue.MainThreadTask),this._workspaceProvider=i,this._editorService=s,this._configurationService=o,this._terminalService=r,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=a,this._deprecationService=c,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,i){if(!i)return new oo(()=>{});const s=this.nextHandle();return this._handlers.set(s,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(s,t),new oo(()=>{this._handlers.delete(s),this._proxy.$unregisterTaskProvider(s)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(iTe.from(e)).then(async t=>{const i=[];for(const s of t){const o=await yI.to(s,this._workspaceProvider,this._providedCustomExecutions2);o&&i.push(o)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof _me))throw new Error("No valid task execution provided");return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,i){const s=this._providedCustomExecutions2.get(e.id);s&&(this._activeCustomExecutions2.set(e.id,s),this._terminalService.attachPtyToTerminal(t,await s.callback(i))),this._lastStartedTask=e.id,this._onDidExecuteTask.fire({execution:await this.getTaskExecution(e)})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;const t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){const t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}$provideTasks(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));const s=[],o=Zu(()=>i.provider.provideTasks(qe.None)).then(r=>this.provideTasksInternal(t,s,i,r));return new Promise(r=>{o.then(a=>{Promise.all(s).then(()=>{r(a)})})})}async $resolveTask(e,t){const i=this._handlers.get(e);if(!i)return Promise.reject(new Error("no handler found"));if(t.definition.type!==i.type)throw new Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${i.type}].`);const s=await yI.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!s)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(s,qe.None);if(!o)return;this.checkDeprecation(o,i);const r=yI.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==s.definition)throw new Error("Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.");return Dx.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const s=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(s)&&(this._notProvidedCustomExecutions.add(s),this._activeCustomExecutions2.set(s,t.execution)),this._providedCustomExecutions2.set(s,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new uc("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let s;return t?s=Promise.resolve(new _me(this,e.id,t)):s=yI.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new uc("Unexpected: Task does not exist.");return new _me(this,e.id,o)}),this._taskExecutionPromises.set(e.id,s),s.then(o=>(this._taskExecutions.set(e.id,o),o))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report("Task.constructor",t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));const i=this._notProvidedCustomExecutions.values();let s=i.next();for(;!s.done;)!this._activeCustomExecutions2.has(s.value)&&this._lastStartedTask!==s.value&&(this._providedCustomExecutions2.delete(s.value),this._notProvidedCustomExecutions.delete(s.value)),s=i.next()}};nTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,mue)],nTe);let sTe=class extends nTe{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,o,r,a,c),this.registerTaskSystem(_e.vscodeRemote,{scheme:_e.vscodeRemote,authority:"",platform:Kct(Hh.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=yI.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(Dx.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new tE;const s=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),s}provideTasksInternal(e,t,i,s){const o=[];if(s)for(const r of s){if(this.checkDeprecation(r,i),!r.definition||!e[r.definition.type]){const c=r.source?r.source:"No task source";this._logService.warn(`The task [${c}, ${r.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=yI.from(r,i.extension);a&&Dx.is(a.execution)?(o.push(a),t.push(this.addCustomExecution(a,r,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:o,extension:i.extension}}async resolveTaskInternal(e){if(Dx.is(e.execution))return e;this._logService.warn("Only custom execution tasks supported.")}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,i){}};sTe=D([_(0,gr),_(1,Sg),_(2,dD),_(3,oj),_(4,hD),_(5,Jz),_(6,Ze),_(7,mue)],sTe);const xat=ae("IExtHostTask"),rj=ae("IExtHostEditorTabs");class Y7e{constructor(e,t,i){this._activeTabIdGetter=i,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case Fa.TextInput:return new Qhe(P.revive(this._dto.input.uri));case Fa.TextDiffInput:return new gG(P.revive(this._dto.input.original),P.revive(this._dto.input.modified));case Fa.TextMergeInput:return new wOe(P.revive(this._dto.input.base),P.revive(this._dto.input.input1),P.revive(this._dto.input.input2),P.revive(this._dto.input.result));case Fa.CustomEditorInput:return new jhe(P.revive(this._dto.input.uri),this._dto.input.viewType);case Fa.WebviewEditorInput:return new bOe(this._dto.input.viewType);case Fa.NotebookInput:return new Khe(P.revive(this._dto.input.uri),this._dto.input.notebookType);case Fa.NotebookDiffInput:return new Yhe(P.revive(this._dto.input.original),P.revive(this._dto.input.modified),this._dto.input.notebookType);case Fa.TerminalEditorInput:return new COe;case Fa.InteractiveEditorInput:return new yOe(P.revive(this._dto.input.uri),P.revive(this._dto.input.inputBoxUri));case Fa.ChatEditorInput:return new SOe;case Fa.MultiDiffEditorInput:return new Not(this._dto.input.diffEditors.map(e=>new gG(P.revive(e.original),P.revive(e.modified))));default:return}}}class Wti{constructor(e,t){this._tabs=[],this._activeTabId="",this._dto=e,this._activeGroupIdGetter=t;for(const i of e.tabs)i.isActive&&(this._activeTabId=i.id),this._tabs.push(new Y7e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return yd.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(i=>i.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(i=>i.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===gu.TAB_OPEN){const i=new Y7e(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,i),e.tabDto.isActive&&(this._activeTabId=i.tabId),i}else if(e.kind===gu.TAB_CLOSE){const i=this._tabs.splice(e.index,1)[0];if(!i)throw new Error(`Tab close updated received for index ${e.index} which does not exist`);return i.tabId===this._activeTabId&&(this._activeTabId=""),i}else if(e.kind===gu.TAB_MOVE){if(e.oldIndex===void 0)throw new Error("Invalid old index on move IPC");const i=this._tabs.splice(e.oldIndex,1)[0];if(!i)throw new Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,i),i}const t=this._tabs.find(i=>i.tabId===e.tabDto.id);if(!t)throw new Error("INVALID tab");return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=""),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}}let oTe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Ue.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){const e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(i=>i.apiObject))},get activeTabGroup(){const i=e._activeGroupId;return ws(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,s)=>{const o=Array.isArray(i)?i:[i];return o.length?Hti(o[0])?this._closeGroups(o,s):this._closeTabs(o,s):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){const t=new Set(this._extHostTabGroups.map(l=>l.groupId)),i=new Set(e.map(l=>l.groupId)),s=Ple(t,i),o=this._extHostTabGroups.filter(l=>s.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new Wti(l,()=>this._activeGroupId);return s.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=ws(e.find(l=>l.isActive===!0)?.groupId);c!==void 0&&this._activeGroupId!==c&&(this._activeGroupId=c),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:o,changed:a}))}$acceptTabGroupUpdate(e){const t=this._extHostTabGroups.find(i=>i.groupId===e.groupId);if(!t)throw new Error("Update Group IPC call received before group creation.");t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){const t=this._extHostTabGroups.find(s=>s.groupId===e.groupId);if(!t)throw new Error("Update Tabs IPC call received before group creation.");const i=t.acceptTabOperation(e);switch(e.kind){case gu.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case gu.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case gu.TAB_MOVE:case gu.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[i.apiObject]}));return}}_findExtHostTabFromApi(e){for(const t of this._extHostTabGroups)for(const i of t.tabs)if(i.apiObject===e)return i}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){const i=[];for(const s of e){const o=this._findExtHostTabFromApi(s);if(!o)throw new Error("Tab close: Invalid tab not found!");i.push(o.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const s of e){const o=this._findExtHostTabGroupFromApi(s);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};oTe=D([_(0,gr)],oTe);function Hti(n){return n.tabs!==void 0}const _le=class _le{constructor(e,t,i,s){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=s}};_le.NONE=new _le(!1,-1,-1,-1);let G4=_le;class J7e{constructor(e){this._startup=e,this._codeLoadingStart=-1,this._codeLoadingStop=-1,this._activateCallStart=-1,this._activateCallStop=-1,this._activateResolveStart=-1,this._activateResolveStop=-1}_delta(e,t){return e===-1||t===-1?-1:t-e}build(){return new G4(this._startup,this._delta(this._codeLoadingStart,this._codeLoadingStop),this._delta(this._activateCallStart,this._activateCallStop),this._delta(this._activateResolveStart,this._activateResolveStop))}codeLoadingStart(){this._codeLoadingStart=Date.now()}codeLoadingStop(){this._codeLoadingStop=Date.now()}activateCallStart(){this._activateCallStart=Date.now()}activateCallStop(){this._activateCallStop=Date.now()}activateResolveStart(){this._activateResolveStart=Date.now()}activateResolveStop(){this._activateResolveStop=Date.now()}}class _ue{constructor(e,t,i,s,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=s,this.exports=o,this.subscriptions=r}}class Uti extends _ue{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,[])}}class Vti extends _ue{constructor(){super(!1,null,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}class Ire extends _ue{constructor(e){super(!0,e,G4.NONE,{activate:void 0,deactivate:void 0},void 0,[])}}let rTe=class{constructor(e,t,i,s){this._logService=s,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new $a,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(const[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){const e=[];for(const[t,i]of this._operations)e.push(i.wait());await Promise.all(e)}isActivated(e){const t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){const t=this._operations.get(e);if(!t||!t.value)throw new Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;const i=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(i.map(s=>({id:s.identifier,reason:{startup:t,extensionId:s.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){const i=this._registry.getExtensionDescription(e);if(!i)throw new Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:i.identifier,reason:t}])}async _activateExtensions(e){const t=e.filter(i=>!this.isActivated(i.id)).map(i=>this._handleActivationRequest(i));await Promise.all(t.map(i=>i.wait()))}_handleActivationRequest(e){if(this._operations.has(e.id))return this._operations.get(e.id);if(this._isHostExtension(e.id))return this._createAndSaveOperation(e,null,[],null);const t=this._registry.getExtensionDescription(e.id);if(!t){const o=new Error(`Cannot activate unknown extension '${e.id.value}'`),r=this._createAndSaveOperation(e,null,[],new Ire(o));return this._host.onExtensionActivationError(e.id,o,new UVe(e.id.value)),r}const i=[],s=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of s){if(this._isResolvedExtension(o))continue;const r=this._operations.get(o);if(r){i.push(r);continue}if(this._isHostExtension(o)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(o).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(o);if(a){if(!a.main&&!a.browser)continue;i.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}const c=t.displayName||t.identifier.value,l=new Error(`Cannot activate the '${c}' extension because it depends on unknown extension '${o}'`),d=this._createAndSaveOperation(e,t.displayName,[],new Ire(l));return this._host.onExtensionActivationError(t.identifier,l,new UVe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,s){const o=new aTe(e.id,t,e.reason,i,s,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return UI.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};rTe=D([_(3,Ze)],rTe);let aTe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,s,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=s,this._value=o,this._host=r,this._logService=a,this._barrier=new Uh,this._isDisposed=!1,this._initialize()}dispose(){this._isDisposed=!0}wait(){return this._barrier.wait()}async _initialize(){await this._waitForDepsThenActivate(),this._barrier.open()}async _waitForDepsThenActivate(){if(!this._value){for(;this._deps.length>0;){for(let e=0;e0&&await Promise.race(this._deps.map(e=>e.wait()))}await this._activate()}}async _activate(){try{this._value=await this._host.actualActivateExtension(this._id,this._reason)}catch(e){const t=new Error;if(e&&e.name&&(t.name=e.name),e&&e.message?t.message=`Activating extension '${this._id.value}' failed: ${e.message}.`:t.message=`Activating extension '${this._id.value}' failed: ${e}.`,e&&e.stack&&(t.stack=e.stack),this._value=new Ire(t),this._isDisposed&&Na(e))return;this._host.onExtensionActivationError(this._id,t,null),this._logService.error(`Activating extension ${this._id.value} failed due to an error:`),this._logService.error(e)}}};aTe=D([_(6,Ze)],aTe);class Dat{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Ue.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const s=await this._proxy.$initializeExtensionStorage(e,t);let o;return s&&(o=this.safeParseValue(e,t,s)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const s=this.safeParseValue(e,t,i);s&&this._onDidChangeStorage.fire({shared:e,key:t,value:s})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(s){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${s}`)}}}const KOe=ae("IExtHostStorage");class kat{constructor(e,t,i){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=i,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(s=>(this._value=s,this)),this._storageListener=this._storage.onDidChangeStorage(s=>{s.shared===this._shared&&s.key===this._id&&(this._value=s.value)}),this._scheduler=new yn(()=>{const s=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of s.values())o.complete()}catch(o){for(const r of s.values())r.error(o)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let i=this._value[e];return typeof i>"u"&&(i=t),i}update(e,t){this._value[e]=t;const i=this._deferredPromises.get(e);if(i!==void 0)return i.p;const s=new sd;return this._deferredPromises.set(e,s),this._scheduler.isScheduled()||this._scheduler.schedule(),s.p}dispose(){this._storageListener.dispose()}}class zti extends kat{setKeysForSync(e){this._storage.registerExtensionStorageKeysToSync({id:this._id,version:this._extension.version},e)}constructor(e,t){super(e.identifier.value,!0,t),this._extension=e}}const YOe=ae("IExtensionStoragePaths");let cTe=class{constructor(e,t,i){this._logService=t,this._extHostFileSystem=i,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(s=>this._value=s)}async _getWorkspaceStorageURI(e){return P.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);const e=this._workspace.id,t=await this._getWorkspaceStorageURI(e);try{return await this._extHostFileSystem.value.stat(t),this._logService.trace("[ExtHostStorage] storage dir already exists",t),t}catch{}try{return this._logService.trace("[ExtHostStorage] creating dir and metadata-file",t),await this._extHostFileSystem.value.createDirectory(t),await this._extHostFileSystem.value.writeFile(P.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:P.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(i){this._logService.error("[ExtHostStorage]",i);return}}workspaceValue(e){if(this._value)return P.joinPath(this._value,e.identifier.value)}globalValue(e){return P.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};cTe=D([_(0,Sg),_(1,Ze),_(2,gue)],cTe);const JOe=ae("IExtHostAuthentication");let lTe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new X7e,this._getSessionsTaskSingler=new X7e,this._proxy=e.getProxy(Ue.MainThreadAuthentication)}async getSession(e,t,i,s={}){const o=Cn.toKey(e.identifier),r=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${o} ${t} ${r}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,o,a,s)})}async getSessions(e,t,i){const s=Cn.toKey(e.identifier),o=[...i].sort().join(" ");return await this._getSessionsTaskSingler.getOrCreate(`${s} ${o}`,async()=>{await this._proxy.$ensureProvider(t);const r=e.displayName||e.name;return this._proxy.$getSessions(t,i,s,r)})}async removeSession(e,t){const i=this._authenticationProviders.get(e);return i?i.provider.removeSession(t):this._proxy.$removeSession(e,t)}registerAuthenticationProvider(e,t,i,s){if(this._authenticationProviders.get(e))throw new Error(`An authentication provider with id '${e}' is already registered.`);this._authenticationProviders.set(e,{label:t,provider:i,options:s??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,s?.supportsMultipleAccounts??!1),new oo(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const s=this._authenticationProviders.get(e);if(s)return await s.provider.createSession(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $removeSession(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.removeSession(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}async $getSessions(e,t){const i=this._authenticationProviders.get(e);if(i)return await i.provider.getSessions(t);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(tue)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};lTe=D([_(0,gr)],lTe);class X7e{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const s=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,s),s}}var dTe;const $ti="vs/workbench/api/common/extHostLanguageModels",XOe=ae("IExtHostLanguageModels");class Z7e{constructor(e,t){this.option=e,this.stream=new M9,this.stream=t??new M9}}class Gti{constructor(){this._responseStreams=new Map,this._defaultStream=new M9,this._isDone=!1,this._isStreaming=!1;const e=this;this.apiObject={text:e._defaultStream.asyncIterable}}*_streams(){if(this._responseStreams.size>0)for(const[,e]of this._responseStreams)yield e.stream;else yield this._defaultStream}handleFragment(e){if(this._isDone)return;this._isStreaming=!0;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new Z7e(e.index,this._defaultStream):t=new Z7e(e.index),this._responseStreams.set(e.index,t)),t.stream.emitOne(e.part)}get isStreaming(){return this._isStreaming}reject(e){this._isDone=!0;for(const t of this._streams())t.reject(e)}resolve(){this._isDone=!0;for(const e of this._streams())e.resolve()}}var XP;let hTe=(XP=class{constructor(e,t,i){this._logService=t,this._extHostAuthentication=i,this._onDidChangeModelAccess=new I,this._onDidChangeProviders=new I,this.onDidChangeProviders=this._onDidChangeProviders.event,this._languageModels=new Map,this._allLanguageModelData=new Map,this._modelAccessList=new $a,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,s){const o=dTe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;s.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof s.auth=="object"?s.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Cn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:s.vendor??Cn.toKey(e.identifier),name:s.name??"",family:s.family??"",version:s.version,maxInputTokens:s.maxInputTokens,maxOutputTokens:s.maxOutputTokens,auth:r,targetExtensions:s.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Cn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $provideLanguageModelResponse(e,t,i,s,o,r){const a=this._languageModels.get(e);if(!a)return;const c=new cf(async l=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}this._proxy.$handleProgressChunk(t,{index:l.index,part:l.part})});return a.provider.provideLanguageModelResponse(s.map(y8.to),o,Cn.toKey(i),c,r)}$provideTokenLength(e,t,i){const s=this._languageModels.get(e);return s?Promise.resolve(s.provider.provideTokenCount(t,i)):Promise.resolve(0)}$acceptChatModelMetadata(e){if(e.added)for(const{identifier:t,metadata:i}of e.added)this._allLanguageModelData.set(t,{metadata:i,apiObjects:new $a});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,s]of this._pendingRequest)s.languageModelId===t&&(s.res.reject(new Tc),this._pendingRequest.delete(i))}e.added?.forEach(t=>this._fakeAuthPopulate(t.metadata)),this._onDidChangeProviders.fire(void 0)}async selectLanguageModels(e,t){const i=await this._proxy.$selectChatModels({...t,extension:e.identifier}),s=[],o=this;for(const r of i){const a=this._allLanguageModelData.get(r);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:r,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._computeTokenLength(r,l,d??qe.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw qg.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??qe.None)}},a.apiObjects.set(e.identifier,c)),s.push(c)}return s}async _sendChatRequest(e,t,i,s,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw qg.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},s.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw qg.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);const l=Math.random()*1e6|0,d=this._proxy.$fetchResponse(a,t,l,r,s.modelOptions??{},o),h=new Uh,u=new Gti;this._pendingRequest.set(l,{languageModelId:t,res:u});let f;if(d.catch(p=>{h.isOpen()?u.reject(p):f=p}).finally(()=>{this._pendingRequest.delete(l),u.resolve(),h.open()}),await h.wait(),f)throw f.name===qg.name?f:new qg(`Language model '${t}' errored, check cause for more details`,"Unknown",f);return u.apiObject}_convertMessages(e,t){const i=[];for(const s of t)s.role===Iv.System&&Je(e,"languageModelSystem"),i.push(y8.from(s));return i}async $handleResponseFragment(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async _getAuthAccess(e,t,i,s){const o=tue+t.identifier.value;if(await this._extHostAuthentication.getSession(e,o,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(s)return!1;try{const a=i?g($ti,0,"Justification: {1}",t.displayName,i):void 0;return await this._extHostAuthentication.getSession(e,o,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Cn.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(const t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:""},void 0,!0)}catch(i){this._logService.error("Fake Auth request failed"),this._logService.error(i)}}async _computeTokenLength(e,t,i){if(!this._allLanguageModelData.get(e))throw qg.NotFound(`Language model '${e}' is unknown.`);const o=fi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:y8.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:s,enabled:o}of e){const r=this._modelAccessList.get(i)??new $v;if(r.has(s)!==o){o?r.add(s):r.delete(s),this._modelAccessList.set(i,r);const c={from:i,to:s};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=T.signal(T.filter(this._onDidChangeModelAccess.event,o=>Cn.equals(o.from,e.identifier))),s=T.signal(this._onDidChangeProviders.event);return{get onDidChange(){return T.any(i,s)},canSendRequest(o){let r;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===o){r=l.metadata;break e}if(!r)return;if(!t._isUsingAuth(e.identifier,r))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(r.extension)}}}},dTe=XP,XP._idPool=1,XP);hTe=dTe=D([_(0,gr),_(1,Ze),_(2,JOe)],hTe);class Iat{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Ue.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,i){return this._proxy.$setPassword(e,t,i)}delete(e,t){return this._proxy.$deletePassword(e,t)}}const ZOe=ae("IExtHostSecretState");var Ik;class qti{constructor(e,t){kt(this,Ik);this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._id=Cn.toKey(e.identifier),st(this,Ik,t),se(this,Ik).onDidChangePassword(i=>{i.extensionId===this._id&&this._onDidChange.fire({key:i.key})})}get(e){return se(this,Ik).get(this._id,e)}store(e,t){return se(this,Ik).store(this._id,e,t)}delete(e){return se(this,Ik).delete(this._id,e)}}Ik=new WeakMap;let uTe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Ue.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===aR}getMessage(e,t){const{message:i,args:s,comment:o}=t;if(this.isDefaultLanguage)return w_e(i,s??{});let r=i;o&&o.length>0&&(r+=`/${Array.isArray(o)?o.join(""):o}`);const a=this.bundleCache.get(e)?.contents[r];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${r}`),w_e(a??i,s??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t;const i=await this.getBundleLocation(e);if(!i){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{const s=await this._proxy.$fetchBundleContents(i),o=JSON.parse(s);t=e.isBuiltin?o.contents?.bundle:o}catch(s){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${s.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:i})}async getBundleLocation(e){if(e.isBuiltin){const t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return P.revive(t)}return e.l10n?P.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};uTe=D([_(0,Sg),_(1,gr),_(2,Ze)],uTe);const eBe=ae("IExtHostLocalizationService"),tBe=ae("IExtHostManagedSockets");let gTe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Ue.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new Qti(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw new Error(`No socket factory with id ${e}`);const t=++this._remoteSocketIdCounter,i=await this._factory.makeConnection(),s=new Z;return this._managedRemoteSockets.set(t,new jti(t,i,s)),s.add(Ee(()=>this._managedRemoteSockets.delete(t))),s.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),s.dispose()})),s.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),s.dispose()})),s.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,ze.wrap(o)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){const t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};gTe=D([_(0,gr)],gTe);class Qti{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class jti extends ${constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var fTe;const e6e="vs/workbench/api/common/extHostExtensionService",Lat=ae("IHostUtils");let pTe=fTe=class extends ${constructor(e,t,i,s,o,r,a,c,l,d,h,u,f){super(),this._extHostManagedSockets=u,this._extHostLanguageModels=f,this._onDidChangeRemoteConnectionData=this._register(new I),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=i,this._initData=a,this._extHostWorkspace=s,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Ue.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Ue.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Ue.MainThreadExtensionService),this._almostReadyToRunExtensions=new Uh,this._readyToStartExtensionHost=new Uh,this._readyToRunExtensions=new Uh,this._eagerExtensionsActivated=new Uh,this._activationEventsReader=new Yti(this._initData.extensions.activationEvents),this._globalRegistry=new UI(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new $v(this._initData.extensions.myExtensions);this._myRegistry=new UI(this._activationEventsReader,Tat(this._globalRegistry,p)),Vu&&(this._logService.info(`Creating extension host with the following global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${dB(this._myRegistry)}`)),this._storage=new Dat(this._extHostContext,this._logService),this._secretState=new Iat(this._extHostContext),this._storagePath=c,this._instaService=e.createChild(new Dl([KOe,this._storage],[ZOe,this._secretState])),this._activator=this._register(new rTe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,w)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,EU(v),w)},actualActivateExtension:async(m,v)=>{if(UI.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new Vti;const w=this._myRegistry.getExtensionDescription(m);return this._activateExtension(w,v)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),vs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){bt(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(o=>o.identifier).filter(o=>this.isActivated(o)).map(o=>this._deactivate(o))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),_9&&f_e(s=>{this._logService.error(s)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Ta(5e3),i]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){const t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new Cn(t.identifier.value),extensionLocation:P.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{const i=this._activator.getActivatedExtension(e);if(i.activationFailed)return Promise.reject(i.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===_e.file&&this._hostUtils.fsRealpath){const t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));const i=await this._realPathCache.get(t);return P.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new Kti(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Su.forUris(i=>QQe.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const s=await this._realPathExtensionUri(i.extensionLocation);t.set(s,i)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;const i=this._activator.getActivatedExtension(e);if(!i)return t;try{typeof i.module.deactivate=="function"&&(t=Promise.resolve(i.module.deactivate()).then(void 0,s=>(this._logService.error(s),Promise.resolve(void 0))))}catch(s){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(s)}try{St(i.subscriptions)}catch(s){this._logService.error(`An error occurred when deactivating the subscriptions for extension '${e.value}':`),this._logService.error(s)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(i=>{const s=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,s.codeLoadingTime,s.activateCallTime,s.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",s),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,s){const o=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...s||{},outcome:i})}_doActivateExtension(e,t){const i=i6e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const s=this._getEntryPoint(e);if(!s)return Promise.resolve(new Uti(G4.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value!==t.extensionId.value?`, root cause: ${t.extensionId.value}`:""}`),this._logService.flush();const o=new J7e(t.startup);return Promise.all([this._loadCommonJSModule(e,Qt(e.extensionLocation,s),o),this._loadExtensionContext(e)]).then(r=>(vs(`code/extHost/willActivateExtension/${e.identifier.value}`),fTe._callActivate(this._logService,e.identifier,r[0],r[1],o))).then(r=>(vs(`code/extHost/didActivateExtension/${e.identifier.value}`),r))}_loadExtensionContext(e){const t=this._extHostLanguageModels.createLanguageModelAccessInformation(e),i=new zti(e,this._storage),s=new kat(e.identifier.value,!1,this._storage),o=new qti(e,this._secretState),r=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?WM.Test:WM.Development:WM.Production,a=this._initData.remote.isRemote?$I.Workspace:$I.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([i.whenReady,s.whenReady,this._storagePath.whenReady]).then(()=>{const c=this;let l,d;const h=Cd(e,"ipc")?this._initData.messagePorts?.get(Cn.toKey(e.identifier)):void 0;return Object.freeze({globalState:i,workspaceState:s,secrets:o,subscriptions:[],get languageModelAccessInformation(){return t},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(u){return D_e(e.extensionLocation.fsPath,u)},get storagePath(){return c._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return c._storagePath.globalValue(e).fsPath},get logPath(){return D_e(c._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return P.joinPath(c._initData.logsLocation,e.identifier.value)},get storageUri(){return c._storagePath.workspaceValue(e)},get globalStorageUri(){return c._storagePath.globalValue(e)},get extensionMode(){return r},get extension(){return l===void 0&&(l=new K3(c,e.identifier,e,a,!1)),l},get extensionRuntime(){return Je(e,"extensionRuntime"),c.extensionRuntime},get environmentVariableCollection(){return c._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!d){if(!h)return;const u=T.buffer(T.fromDOMEventEmitter(h,"message",f=>f.data));h.start(),d={onDidReceiveMessage:u,postMessage:h.postMessage.bind(h)}}return d}})})}static _callActivate(e,t,i,s,o){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,s,o).then(r=>new _ue(!1,null,o.build(),i,r,s.subscriptions))}static _callActivateOptional(e,t,i,s,o){if(typeof i.activate=="function")try{o.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const r=typeof global=="object"?global:self,a=i.activate.apply(r,[s]);return o.activateCallStop(),o.activateResolveStart(),Promise.resolve(a).then(c=>(o.activateResolveStop(),c))}catch(r){return Promise.reject(r)}else return Promise.resolve(i)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,i=>{this._logService.error(i)})}_activateAllStartupFinishedDeferred(e,t=0){const s=Date.now();HRe(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(SDt()),this._extHostConfiguration.getConfigProvider().then(e=>{const t=e.getConfiguration("extensions.experimental").get("deferredStartupFinishedActivation"),i=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(i);else for(const s of i)if(s.activationEvents)for(const o of s.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(s,o)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,r=>{this._logService.error(r)});this._register(this._extHostWorkspace.onDidChangeWorkspace(r=>this._handleWorkspaceContainsEagerExtensions(r.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),s=this._handleRemoteResolverEagerExtensions(),o=Promise.all([s,e,i]).then(()=>{});return Promise.race([o,Ta(1e4)]).then(()=>{this._activateAllStartupFinished()}),o}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;const i=!this._initData.remote.isRemote&&!!this._initData.remote.authority,s={logService:this._logService,folders:e.map(r=>r.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:r=>this._hostUtils.fsExists(r.fsPath),checkExists:(r,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(r,a,c)},o=await Zst(s,t);if(o)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:o.activationEvent}).then(void 0,r=>this._logService.error(r))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){const{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw new Error(g(e6e,0,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new J7e(!1));if(!i||typeof i.run!="function")throw new Error(g(e6e,1,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((s,o)=>{const r=(l,d)=>{l?(Vu&&this._logService.error("Test runner called back with error",l),o(l)):(Vu&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),s(typeof d=="number"&&d>0?1:0))},a=fv(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Vu&&this._logService.info("Test runner finished successfully."),s(0)}).catch(l=>{Vu&&this._logService.error("Test runner finished with error",l),o(l instanceof Error&&l.stack?l.stack:String(l))})})}_startExtensionHost(){if(this._started)throw new Error("Extension host is already started!");return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Ta(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info("Eager extensions activated")})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,Ee(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){const{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){const t=e.indexOf("+");if(t===-1)throw new OT("Not an authority that can be resolved!",Xd.InvalidAuthority);const i=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${i}`,!1),{authorityPrefix:i,resolver:this._resolvers[i]}}async $resolveAuthority(e,t){const i=ao.create(!1),s=()=>`[resolveAuthority(${Pne(e)},${t})][${i.elapsed()}ms] `,o=b=>this._logService.info(`${s()}${b}`),r=b=>this._logService.warn(`${s()}${b}`),a=(b,C=void 0)=>this._logService.error(`${s()}${b}`,C),c=b=>{if(b instanceof OT)return{type:"error",error:{code:b._code,message:b._message,detail:b._detail}};throw b},l=async b=>{o(`activating resolver for ${b}...`);const{resolver:C,authorityPrefix:y}=await this._activateAndGetResolver(b);if(!C)throw a(`no resolver for ${y}`),new OT(`No remote extension installed to resolve ${y}.`,Xd.NoResolverFound);return{resolver:C,authorityPrefix:y,remoteAuthority:b}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async b=>{if(!(b instanceof OT)||b._code!==Xd.InvalidAuthority)throw b;return r(`resolving nested authorities failed: ${b.message}`),[await l(e)]})}catch(b){return c(b)}const u=new nQ;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[b,{authorityPrefix:C,resolver:y,remoteAuthority:S}]of h.entries())try{if(b===h.length-1)o("invoking final resolve()..."),vs(`code/extHost/willResolveAuthority/${C}`),f=await y.resolve(S,{resolveAttempt:t,execServer:p}),vs(`code/extHost/didResolveAuthorityOK/${C}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(y,m8.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${S}`),vs(`code/extHost/willResolveExecServer/${C}`),p=await y.resolveExecServer?.(S,{resolveAttempt:t,execServer:p}),!p)throw new OT(`Exec server was not available for ${S}`,Xd.NoResolverFound);vs(`code/extHost/didResolveExecServerOK/${C}`)}}catch(M){return vs(`code/extHost/didResolveAuthorityError/${C}`),a("returned an error",M),u.dispose(),c(M)}u.dispose();const m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},v={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};o(`returned ${m8.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let w;if(m8.isManagedResolvedAuthority(f)){const b=t;this._extHostManagedSockets.setFactory(b,f.makeConnection),w={authority:e,connectTo:new Ust(b),connectionToken:f.connectionToken}}else w={authority:e,connectTo:new Vst(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:w,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${Pne(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const s=P.revive(t);if(typeof i.getCanonicalURI>"u")return s;const o=await Zu(()=>i.getCanonicalURI(s));return o||s}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$startExtensionHost: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${dB(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===sC.Immediate?this._almostReadyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(i=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(r=>r.extensionLocation=P.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=t6e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),s=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(s),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Vu&&(this._logService.info(`$deltaExtensions: global extensions: ${dB(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${dB(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){const t=ze.alloc(e),i=Math.random()%256;for(let s=0;sa.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=Tat(s,o);return{globalRegistry:s,myExtensions:r}}function i6e(n,e){return{id:n.identifier.value,name:n.name,extensionVersion:n.version,publisherDisplayName:n.publisher,activationEvents:n.activationEvents?n.activationEvents.join(","):null,isBuiltin:n.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function dB(n){return n.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const _L=ae("IExtHostExtensionService");var WR,Sq,HR;class K3{constructor(e,t,i,s,o){kt(this,WR);kt(this,Sq);kt(this,HR);st(this,WR,e),st(this,Sq,t),st(this,HR,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=d1(fv(i.extensionLocation)),this.packageJSON=i,this.extensionKind=s,this.isFromDifferentExtensionHost=o}get isActive(){return se(this,WR).isActivated(se(this,HR))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return se(this,WR).getExtensionExports(se(this,HR))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await se(this,WR).activateByIdWithErrors(se(this,HR),{startup:!1,extensionId:se(this,Sq),activationEvent:"api"}),this.exports}}WR=new WeakMap,Sq=new WeakMap,HR=new WeakMap;function Tat(n,e){return n.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class Kti{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}}class Yti{constructor(e){this._map=new $a,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(const t of Object.keys(e))this._map.set(t,e[t])}}var ca;(function(n){n.Unknown="unknown",n.Env="env",n.Config="config",n.Command="command",n.Input="input",n.ExtensionInstallFolder="extensionInstallFolder",n.WorkspaceFolder="workspaceFolder",n.Cwd="cwd",n.WorkspaceFolderBasename="workspaceFolderBasename",n.UserHome="userHome",n.LineNumber="lineNumber",n.SelectedText="selectedText",n.File="file",n.FileWorkspaceFolder="fileWorkspaceFolder",n.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",n.RelativeFile="relativeFile",n.RelativeFileDirname="relativeFileDirname",n.FileDirname="fileDirname",n.FileExtname="fileExtname",n.FileBasename="fileBasename",n.FileBasenameNoExtension="fileBasenameNoExtension",n.FileDirnameBasename="fileDirnameBasename",n.ExecPath="execPath",n.ExecInstallFolder="execInstallFolder",n.PathSeparator="pathSeparator",n.PathSeparatorAlias="/"})(ca||(ca={}));class If extends Error{constructor(e,t){super(t),this.variable=e}}const Lf="vs/workbench/services/configurationResolver/common/variableResolver",sR=class sR{constructor(e,t,i,s){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,s&&(this._envVariablesPromise=s.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Is){const t=Object.create(null);return Object.keys(e).forEach(i=>{t[i.toLowerCase()]=e[i]}),t}return e}resolveWithEnvironment(e,t,i){return this.recursiveResolve({env:this.prepareEnv(e),userHome:void 0},t?t.uri:void 0,i)}async resolveAsync(e,t){const i={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(i,e?e.uri:void 0,t)}async resolveAnyBase(e,t,i,s){const o=Vs(t);Is&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):ei&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):jr&&o.linux&&Object.keys(o.linux).forEach(a=>o[a]=o.linux[a]),delete o.windows,delete o.osx,delete o.linux;const r={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(r,e?e.uri:void 0,o,i,s)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const s=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,s),resolvedVariables:s}}resolveWithInteractionReplace(e,t,i,s){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,s){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(e,t){if(this._contributedVariables.has(e))throw new Error("Variable "+e+" is contributed twice.");this._contributedVariables.set(e,t)}async recursiveResolve(e,t,i,s,o){if(zt(i))return this.resolveString(e,t,i,s,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,s,o)));if(fo(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,s,o),await this.recursiveResolve(e,t,i[c],s,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,s,o){return Plt(i,sR.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(sR.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,s);return o?.set(a,c),c!==r&&zt(c)&&c.match(sR.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,s,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,s,o){let r;const a=i.split(":");a.length>1&&(i=a[0],r=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Ay(u);throw new If(h,g(Lf,0,"Variable {0} can not be resolved. Please open an editor.",t))},l=h=>{const u=c(h);if(this._context.getWorkspaceFolderPathForFile){const f=this._context.getWorkspaceFolderPathForFile();if(f)return Ay(f)}throw new If(h,g(Lf,1,"Variable {0}: can not find workspace folder of '{1}'.",t,yr(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new If(h,g(Lf,2,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(s)return s;throw this._context.getWorkspaceFolderCount()>1?new If(h,g(Lf,3,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new If(h,g(Lf,4,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Is?r.toLowerCase():r];if(zt(h))return h}return""}throw new If(ca.Env,g(Lf,5,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(s,r);if(hc(h))throw new If(ca.Config,g(Lf,6,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(fo(h))throw new If(ca.Config,g(Lf,7,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new If(ca.Config,g(Lf,8,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(ca.Command,t,r,o,"command");case"input":return this.resolveFromMap(ca.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new If(ca.ExtensionInstallFolder,g(Lf,9,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new If(ca.ExtensionInstallFolder,g(Lf,10,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Ay(this.fsPath(d(ca.WorkspaceFolder)));case"cwd":return s||r?Ay(this.fsPath(d(ca.Cwd))):kU();case"workspaceRootFolderName":case"workspaceFolderBasename":return Ay(yr(this.fsPath(d(ca.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new If(ca.UserHome,g(Lf,11,"Variable {0} can not be resolved. UserHome path is not defined",t))}case"lineNumber":{const h=this._context.getLineNumber();if(h)return h;throw new If(ca.LineNumber,g(Lf,12,"Variable {0} can not be resolved. Make sure to have a line selected in the active editor.",t))}case"selectedText":{const h=this._context.getSelectedText();if(h)return h;throw new If(ca.SelectedText,g(Lf,13,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(ca.File);case"fileWorkspaceFolder":return l(ca.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return yr(l(ca.FileWorkspaceFolderBasename));case"relativeFile":return s||r?LU(this.fsPath(d(ca.RelativeFile)),c(ca.RelativeFile)):c(ca.RelativeFile);case"relativeFileDirname":{const h=lS(c(ca.RelativeFileDirname));if(s||r){const u=LU(this.fsPath(d(ca.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return lS(c(ca.FileDirname));case"fileExtname":return T_(c(ca.FileExtname));case"fileBasename":return yr(c(ca.FileBasename));case"fileBasenameNoExtension":{const h=yr(c(ca.FileBasenameNoExtension));return h.slice(0,h.length-T_(h).length)}case"fileDirnameBasename":return yr(lS(c(ca.FileDirnameBasename)));case"execPath":{const h=this._context.getExecPath();return h||t}case"execInstallFolder":{const h=this._context.getAppRoot();return h||t}case"pathSeparator":case"/":return dg;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(ca.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,s,o){if(i&&s){const r=o===void 0?s[i]:s[o+":"+i];if(typeof r=="string")return r;throw new If(e,g(Lf,14,"Variable {0} can not be resolved because the command has no value.",t))}return t}};sR.VARIABLE_LHS="${",sR.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let mTe=sR;const iBe=ae("IExtHostVariableResolverProvider");class Jti extends mTe{constructor(e,t,i,s,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=s.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof gG||d.input instanceof Yhe)return d.input.modified;if(d.input instanceof Qhe||d.input instanceof Khe||d.input instanceof jhe)return d.input.uri}}}super({getFolderUri:l=>{const d=r.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>r.folders.length,getConfigurationValue:(l,d)=>o.getConfiguration(void 0,l).get(d),getAppRoot:()=>kU(),getExecPath:()=>IU.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return d1(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return d1(d.uri.fsPath)}}},getSelectedText:()=>{if(i){const l=i.activeEditor();if(l&&!l.selection.isEmpty)return l.document.getText(l.selection)}},getLineNumber:()=>{if(i){const l=i.activeEditor();if(l)return String(l.selection.end.line+1)}},getExtension:l=>e.getExtension(l)},void 0,a?Promise.resolve(a):void 0,Promise.resolve(IU))}}let _Te=class extends ${constructor(e,t,i,s,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=s,this.editorTabs=o,this._resolver=new Ka(async()=>{const r=await this.configurationService.getConfigProvider(),c={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async l=>{c.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new Jti(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};_Te=D([_(0,_L),_(1,dD),_(2,oj),_(3,hD),_(4,rj)],_Te);const Rat=ae("IExtHostDebugService");let vTe=class{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,i,s,o,r,a){this._workspaceService=t,this._extensionService=i,this._configurationService=s,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=new I,this._onDidTerminateDebugSession=new I,this._onDidChangeActiveDebugSession=new I,this._onDidReceiveDebugSessionCustomEvent=new I,this._debugServiceProxy=e.getProxy(Ue.MainThreadDebugService),this._onDidChangeBreakpoints=new I,this._onDidChangeActiveStackItem=new I,this._activeDebugConsole=new Zti(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(c=>{c.onDidChange(l=>{this.registerAllDebugTypes(c)}),this.registerAllDebugTypes(c)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const s=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return s?this.convertVisualizerTreeItem(e,s):void 0}registerDebugVisualizationTree(e,t,i){const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(o,i),this._debugServiceProxy.$registerDebugVisualizerTree(o,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(o),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){const i=this._debugVisualizationElements.get(t)?.item;return i?(await this._debugVisualizationTrees.get(e)?.getChildren?.(i))?.map(o=>this.convertVisualizerTreeItem(e,o))||[]:[]}async $editVisualizerTreeItem(e,t){const i=this._debugVisualizationElements.get(e);if(!i)return;const s=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,s||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const s of i)if(s)for(const o of s)i.push(this._debugVisualizationElements.get(o)?.children),this._debugVisualizationElements.delete(o)}convertVisualizerTreeItem(e,t){let i=this._debugVisualizationTreeItemIds.get(t);return i||(i=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,i),this._debugVisualizationElements.set(i,{provider:e,item:t})),xIe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let s=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(s+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),s+=`${o}ref=${i.sourceReference}`,P.parse(s)}else{if(i.path)return P.file(i.path);throw new Error("cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.")}}registerAllDebugTypes(e){const t=[];for(const i of e.getAllExtensionDescriptions())if(i.contributes){const s=i.contributes.debuggers;if(s&&s.length>0)for(const o of s)ojt(o)&&t.push(o.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){const e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){const i=this._visualizers.get(e);if(!i)throw new Error(`No debug visualizer found with id '${e}'`);let{v:s,provider:o,extensionId:r}=i;if(s.visualization||(s=await o.resolveDebugVisualization?.(s,t)||s,i.v=s),!s.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,s.visualization)}async $executeDebugVisualizerCommand(e){const t=this._visualizers.get(e);if(!t)throw new Error(`No debug visualizer found with id '${e}'`);const i=t.v.visualization;i&&"command"in i&&this._commands.executeCommand(i.command,...i.arguments||[])}hydrateVisualizationContext(e){const t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,i,s){const o=this.hydrateVisualizationContext(i),r=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(r);if(!o||!a)return[];const c=await a.provideDebugVisualization(o,s);return c?c.map(l=>{const d=++this._visualizerIdCounter;this._visualizers.set(d,{v:l,provider:a,extensionId:e});const h=l.iconPath?this.getIconPathOrClass(l.iconPath):void 0;return{id:d,name:l.name,iconClass:h?.iconClass,iconPath:h?.iconPath,visualization:this.serializeVisualization(e,l.visualization)}}):[]}$disposeDebugVisualizers(e){for(const t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,i){if(!e.contributes?.debugVisualizers?.some(r=>r.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const s=Cn.toKey(e.identifier),o=this.extensionVisKey(s,t);if(this._debugVisualizationProviders.has(o))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(o,i),this._debugServiceProxy.$registerDebugVisualizer(s,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(s,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(o=>{const r=o.id;return this._breakpoints.has(r)?!1:(this._breakpoints.set(r,o),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],s=new Map;for(const o of t)if(o instanceof vI){let r=s.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},s.set(o.location.uri.toString(),r),i.push(r)),r.lines.push({id:o.id,enabled:o.enabled,condition:o.condition,hitCondition:o.hitCondition,logMessage:o.logMessage,line:o.location.range.start.line,character:o.location.range.start.character,mode:o.mode})}else o instanceof wI&&i.push({type:"function",id:o.id,enabled:o.enabled,hitCondition:o.hitCondition,logMessage:o.logMessage,condition:o.condition,functionName:o.functionName,mode:o.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(r=>this._breakpoints.delete(r.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(r=>r instanceof vI).map(r=>r.id),s=t.filter(r=>r instanceof wI).map(r=>r.id),o=t.filter(r=>r instanceof vse).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,s,o)}startDebugging(e,t,i){return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===nG.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,suppressDebugStatusbar:i.suppressDebugStatusbar??i.debugUI?.simple,suppressDebugToolbar:i.suppressDebugToolbar??i.debugUI?.simple,suppressDebugView:i.suppressDebugView??i.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,i){if(!t)return new oo(()=>{});const s=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:s,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,s),new oo(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(s)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new oo(()=>{});if(!this.definesDebugType(e,t))throw new Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw new Error("a DebugAdapterDescriptorFactory can only be registered once per a type.");const s=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:s,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,s),new oo(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(s)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new oo(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new oo(()=>{this._trackerFactories=this._trackerFactories.filter(s=>s.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const s=await this.getFolder(e);return s&&(i={uri:s.uri,name:s.name,index:s.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new tii(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,s=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(s.type),s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,s);if(!a)throw new Error(`Couldn't create a debug adapter for type '${s.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(s).then(l=>(l&&this._debugAdaptersTrackers.set(e,l),c.onMessage(async d=>{if(d.type==="request"&&d.command==="handshake"){const h=d,u={type:"response",seq:0,command:h.command,request_seq:h.seq,success:!0};this._signService||(this._signService=this.createSignService());try{if(this._signService){const f=await this._signService.sign(h.arguments.value);u.body={signature:f},c.sendResponse(u)}else throw new Error("no signer")}catch(f){u.success=!1,u.message=f.message,c.sendResponse(u)}}else l&&l.onDidSendMessage&&l.onDidSendMessage(d),d=Jot(d,!0),i._debugServiceProxy.$acceptDAMessage(e,d)}),c.onError(d=>{l&&l.onError&&l.onError(d),this._debugServiceProxy.$acceptDAError(e,d.name,d.message,d.stack)}),c.onExit(d=>{l&&l.onExit&&l.onExit(d??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,d??void 0,void 0)}),l&&l.onWillStartSession&&l.onWillStartSession(),c.startSession()))})}$sendDAMessage(e,t){t=Yot(t,!1);const i=this._debugAdaptersTrackers.get(e);i&&i.onWillReceiveMessage&&i.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){const t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();const i=this._debugAdapters.get(e);return this._debugAdapters.delete(e),i?i.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){const t=[],i=[],s=[];if(e.added)for(const o of e.added){const r=o.id;if(r&&!this._breakpoints.has(r)){let a;if(o.type==="function")a=new wI(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new vse(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=P.revive(o.uri);a=new vI(new _p(c,new Ps(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}x7t(a,r),this._breakpoints.set(r,a),t.push(a)}}if(e.removed)for(const o of e.removed){const r=this._breakpoints.get(o);r&&(this._breakpoints.delete(o),i.push(r))}if(e.changed){for(const o of e.changed)if(o.id){const r=this._breakpoints.get(o.id);if(r){if(r instanceof wI&&o.type==="function"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.functionName=o.functionName}else if(r instanceof vI&&o.type==="source"){const a=r;a.enabled=o.enabled,a.condition=o.condition,a.hitCondition=o.hitCondition,a.logMessage=o.logMessage,a.location=new _p(P.revive(o.uri),new Ps(o.line,o.character))}s.push(r)}}}this.fireBreakpointChanges(t,i,s)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new yot(i.api,e.threadId):t=new Cot(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return Zu(async()=>{const s=this.getConfigProviderByHandle(e);if(!s)throw new Error("no DebugConfigurationProvider found");if(!s.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return s.provideDebugConfigurations(o,i)}).then(s=>{if(!s)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return s})}$resolveDebugConfiguration(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const r=await this.getFolder(t);return o.resolveDebugConfiguration(r,i,s)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,s){return Zu(async()=>{const o=this.getConfigProviderByHandle(e);if(!o)throw new Error("no DebugConfigurationProvider found");if(!o.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const r=await this.getFolder(t);return o.resolveDebugConfigurationWithSubstitutedVariables(r,i,s)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const s=await this.getSession(t);return this.getAdapterDescriptor(i,s).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${s.type}'`);return this.convertToDto(o)})}async $acceptDebugSessionStarted(e){const t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){const t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){const s={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(s)}convertToDto(e){if(e instanceof j6)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof f4)return{type:"server",port:e.port,host:e.host};if(e instanceof K6)return{type:"pipeServer",path:e.path};if(e instanceof Y6)return{type:"implementation",implementation:e.implementation};throw new Error("convertToDto unexpected type")}getAdapterDescriptorFactoryByType(e){const t=this._adapterFactories.filter(i=>i.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){const t=this._adapterFactories.filter(i=>i.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){const t=this._configProviders.filter(i=>i.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){const i=e.contributes.debuggers;if(i&&i.length>0){for(const s of i)if(s.label&&s.type&&s.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,s=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>Zu(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(s).then(o=>{const r=Ui(o);if(r.length>0)return new eii(r)}),new Promise(o=>setTimeout(()=>o(void 0),1e3))]).catch(o=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new f4(i));if(e){const o=await this._extensionService.getExtensionRegistry();return Zu(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const s=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,s))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,i){(e.length>0||t.length>0||i.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:i}))}async getSession(e){if(e)if(typeof e=="string"){const t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){const i=await this.getFolder(e.folderUri),s=e.parent?this._debugSessions.get(e.parent):void 0;t=new Xti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,s?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw new Error("cannot find session")}getFolder(e){if(e){const t=P.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if("title"in t&&"command"in t)return{type:Ene.Command};if("treeId"in t)return{type:Ene.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,s;return"id"in t?s=$e.asClassName(t):i=t,{iconPath:i,iconClass:s}}getIconUris(e){if(e instanceof fg)return{id:e.id};const t=typeof e=="object"&&"dark"in e?e.dark:e,i=typeof e=="object"&&"light"in e?e.light:e;return{dark:typeof t=="string"?P.file(t):t,light:typeof i=="string"?P.file(i):i}}};vTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],vTe);class Xti{constructor(e,t,i,s,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=s,this._workspaceFolder=o,this._configuration=r,this._parentSession=a}get api(){const e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,i){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,i)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}}class Zti{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` +`)}})}}class eii{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(i=>i.onExit?i.onExit(e,t):void 0)}}class tii extends Got{constructor(e){super(),this.implementation=e,e.onDidSendMessage(t=>{this.acceptMessage(t)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}}let wTe=class extends vTe{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r,a)}};wTe=D([_(0,gr),_(1,dD),_(2,_L),_(3,hD),_(4,rj),_(5,iBe),_(6,Yz)],wTe);class iii{constructor(e,t,i){this.config=e,this.provider=t,this.sessionToken=i,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern,this.includePattern=e.includePattern&&_w(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&_w(e.excludePattern)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){const t=this.config.folderQueries||[];return new Promise((i,s)=>{const o=r=>{this.resultCount++,e(r)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(r=>{const a=r.toString(),c=yr(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(o,{base:r,basename:c})}),Promise.all(t.map(r=>this.searchInFolder(r,o))).then(r=>{i({limitHit:this.isLimitHit,stats:r[0]||void 0})},r=>{s(new Error(Ma(r)))})})}async searchInFolder(e,t){const i=new ai,s=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new Jst(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=ao.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},s,i.token),d=c.elapsed(),h=ao.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=Qi.relative(e.folder.path,u.path);if(a){const p=yr(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(o,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(o,r,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=$ne(this.config.includePattern,e.includePattern),i=$ne(this.config.excludePattern,e.excludePattern);return{folder:e.folder,excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,maxResults:this.config.maxResults,session:this.sessionToken}}initDirectoryTree(){const e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,i,s){if(i===this.filePattern){const r=yr(this.filePattern);this.matchFile(s,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=yr(r),c=lS(r);let l=e[c];l||(l=e[c]=[],o(c)),l.push({base:t,relativePath:r,basename:a})}o(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,s){const o=this,r=this.filePattern;function a(c){const l=Z8t(()=>c.map(d=>d.basename));for(let d=0,h=c.length;d=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}}const vle=class vle{constructor(){this.sessions=new Map}fileSearch(e,t,i,s){const o=this.getSessionTokenSource(e.cacheKey),r=new iii(e,t,o&&o.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(r,vle.BATCH_SIZE,c,s).then(l=>({limitHit:l.limitHit,stats:l.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:l.stats}:void 0,messages:[]}))}clearCache(e){this.getSessionTokenSource(e)?.cancel()}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new ai),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Qt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,s){const o=s.onCancellationRequested(()=>{e.cancel()}),r=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(r).then(c=>(a.length&&i(a),o.dispose(),c),c=>(a.length&&i(a),o.dispose(),Promise.reject(c)))}};vle.BATCH_SIZE=512;let bTe=vle;class n6e{constructor(e,t,i){this.queryProviderPair=e,this.fileUtils=t,this.processType=i,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t){const i=this.query.folderQueries||[],s=new ai(t);return new Promise((o,r)=>{this.collector=new sii(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);Y3(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,s.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!Y3(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),s.token))).then(l=>{s.dispose(),this.collector.flush();const d=l.some(h=>!!h&&!!h.limitHit);o({limitHit:this.isLimitHit||d,messages:l.flatMap(h=>h?.message?Array.isArray(h.message)?h.message:[h.message]:[]),stats:{type:this.processType}})},l=>{s.dispose();const d=Ma(l);r(new Error(d))})})}resultSize(e){return Y3(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],s=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:s.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const s=new Jst(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===_e.file?X8t(()=>this.fileUtils.readdir(ma(l.uri))):void 0,h=lO(e.folder,l.uri);if(h){const u=s.includedInQuery(h,yr(h),d);NS(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===z1.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(nii(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(Y3(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}getSearchOptionsForFolder(e){const t=$ne(this.query.includePattern,e.includePattern),i=$ne(this.query.excludePattern,e.excludePattern),s={folder:P.from(e.folder),excludes:i,includes:t,useIgnoreFiles:!e.disregardIgnoreFiles,useGlobalIgnoreFiles:!e.disregardGlobalIgnoreFiles,useParentIgnoreFiles:!e.disregardParentIgnoreFiles,followSymlinks:!e.ignoreSymlinks,encoding:e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??Number.MAX_SAFE_INTEGER,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(s.usePCRE2=this.query.usePCRE2),s}}function nii(n){return{isCaseSensitive:n.isCaseSensitive||!1,isRegExp:n.isRegExp||!1,isWordMatch:n.isWordMatch||!1,isMultiline:n.isMultiline||!1,pattern:n.pattern}}class sii{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new CTe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!_n(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(oii(e))}pushToCollector(){const e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}}function oii(n){return Y3(n)?{preview:{matches:u9(n.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:n.preview.text},ranges:u9(n.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:n.text,lineNumber:n.lineNumber}}function Y3(n){return!!n.preview}const wW=class wW{constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},wW.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=0))}};wW.TIMEOUT=4e3,wW.START_BATCH_AFTER_COUNT=50;let CTe=wW;const Mat=ae("IExtHostSearch");let yTe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Ue.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new bTe}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,t),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);const i=this._handlePool++;return this._aiTextSearchProvider.set(i,t),this._proxy.$registerAITextSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,t),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),Ee(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}$provideFileSearchResults(e,t,i,s){const o=vme(i),r=this._fileSearchProvider.get(e);if(r)return this._fileSearchManager.fileSearch(o,r,a=>{this._proxy.$handleFileMatch(e,t,a.map(c=>c.resource))},s);throw new Error("3 unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,i){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,i,s){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`2 Unknown provider ${e}`);const r=vme(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$provideAITextSearchResults(e,t,i,s){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`1 Unknown provider ${e}`);const r=vme(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),s)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new n6e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};yTe=D([_(0,gr),_(1,fue),_(2,Ze)],yTe);function vme(n){return{...n,folderQueries:n.folderQueries&&n.folderQueries.map(rii),extraFileResources:n.extraFileResources&&n.extraFileResources.map(e=>P.revive(e))}}function rii(n){return{...n,folder:P.revive(n.folder)}}var STe,ZP;let ATe=(ZP=class{getState(){const e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e){this._onDidChangeWindowState=new I,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=STe.InitialState,this._proxy=e.getProxy(Ue.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:t,isActive:i})=>{this.onDidChangeWindowProperty("focused",t),this.onDidChangeWindowProperty("active",i)})}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty("focused",e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty("active",e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let i;if(typeof e=="string"){i=e;try{e=P.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Xv(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===_e.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Xv(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return P.from(i)}},STe=ZP,ZP.InitialState={focused:!0,active:!0},ZP);ATe=STe=D([_(0,gr)],ATe);const Nat=ae("IExtHostWindow");let Lre=class extends IYe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Or(i))),this._proxy=e.getProxy(Ue.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(P.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new aii(this._proxy,e,t,i)}};Lre=D([_(0,gr),_(1,Sg)],Lre);class aii extends ude{constructor(e,t,i,s){super(s?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,s).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){const i=[[e,t]];this.isLoggerCreated?this.doLog(i):this.buffer.push(...i)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}}const Pat=ae("IExtHostTerminalShellIntegration");let ETe=class extends ${constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=new I,this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=new I,this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=new I,this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(Ue.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,s]of this._activeShellIntegrations)s.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let s=this._activeShellIntegrations.get(e);s||(s=new cii(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,s),s.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),s.store.add(s.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),s.store.add(s.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),s.store.add(s.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=s.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:s.value})}$shellExecutionStart(e,t,i,s,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.startShellExecution(r,o)}$shellExecutionEnd(e,t,i,s,o){const r={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(lZ(t)?P.revive(t):t)}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};ETe=D([_(0,gr),_(1,Jz)],ETe);class cii extends ${get currentExecution(){return this._currentExecution}constructor(e,t){super(),this._terminal=e,this._onDidStartTerminalShellExecution=t,this._ignoreNextExecution=!1,this.store=this._register(new Z),this._onDidRequestChangeShellIntegration=this._register(new I),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new I),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new I),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event;const i=this;this.value={get cwd(){return i._cwd},executeCommand(s,o){let r=s;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:NM.High,isTrusted:!0},c=i.startShellExecution(a,i._cwd,!0).value;return i._ignoreNextExecution=!0,c}}}startShellExecution(e,t,i){if(this._ignoreNextExecution&&this._currentExecution)this._ignoreNextExecution=!1;else{this._currentExecution&&(this._currentExecution.endExecution(void 0),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0}));const s=this._currentExecution=new lii(e,t);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:s.value})):this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}return this._currentExecution}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){this._currentExecution&&(this._currentExecution.endExecution(e),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:t}),this._currentExecution=void 0)}setCwd(e){let t=!1;P.isUri(this._cwd)?t=!P.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value}))}}class lii{constructor(e,t){this._commandLine=e,this.cwd=t,this._ended=!1;const i=this;this.value={get commandLine(){return i._commandLine},get cwd(){return i.cwd},read(){return i._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._ended)return tg.EMPTY;this._dataStream=new dii}return this._dataStream.createIterable()}emitData(e){this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._dataStream=void 0,this._ended=!0}}class dii extends ${constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new Uh);const e=this._barrier;return new tg(async i=>{this._emitters.push(i),await e.wait()})}emitData(e){for(const t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open(),this._barrier=void 0}}ce(eBe,uTe,Yt.Delayed);ce(wp,Lre,Yt.Delayed);ce(mue,XLe,Yt.Delayed);ce(Yz,qLe,Yt.Eager);ce(JOe,lTe,Yt.Eager);ce(XOe,hTe,Yt.Eager);ce(hD,$Le,Yt.Eager);ce(gue,HLe,Yt.Eager);ce(Rat,wTe,Yt.Eager);ce(yat,zLe,Yt.Eager);ce(oj,KLe,Yt.Eager);ce(tBe,gTe,Yt.Eager);ce(Kz,hti,Yt.Eager);ce(bat,ULe,Yt.Delayed);ce(Mat,yTe,Yt.Eager);ce(KOe,Dat,Yt.Eager);ce(xat,sTe,Yt.Eager);ce(Jz,JLe,Yt.Eager);ce(Pat,ETe,Yt.Eager);ce(FOe,C0e,Yt.Eager);ce(Nat,ATe,Yt.Eager);ce(dD,VLe,Yt.Eager);ce(ZOe,Iat,Yt.Eager);ce(pue,GLe,Yt.Eager);ce(rj,oTe,Yt.Eager);ce(iBe,_Te,Yt.Eager);const wme="vs/workbench/api/common/extHostLogService";let xTe=class extends YXe{constructor(e,t,i){const s=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(wme,0,"Extension Host (Remote)"):e?g(wme,1,"Extension Host (Worker)"):g(wme,2,"Extension Host");super(t.createLogger(s,{name:o}))}};xTe=D([_(1,wp),_(2,Sg)],xTe);class s6e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ze),s=e.get(gr).getProxy(Ue.MainThreadErrors);f_e(o=>{t.error(o);const r=EU(o);s.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ze),i=e.get(gr),s=e.get(_L),o=e.get(pue),r=i.getProxy(Ue.MainThreadExtensionService),a=i.getProxy(Ue.MainThreadErrors),c=await s.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,w;for(const C of p)m+=` + at ${C.toString()}`,w=C.getFileName(),!v&&w&&(v=c.findSubstr(P.file(w)));const b=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:b}),b}const h=Symbol("prepareStackTrace wrapped");let u=d;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return u},set(f){if(f===d||!f||f[h]){u=f||d;return}u=function(p,m){return d(p,m),f.call(Error,p,m)},Object.assign(u,{[h]:!0})}}),f_e(f=>{t.error(f);const p=EU(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}r.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=o.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class nBe{constructor(e,t,i,s,o){this._hostUtils=i,this._rpcProtocol=new Bne(e,null,s),t=nBe._transform(t,this._rpcProtocol);const r=new Dl(...Hve());r.set(Sg,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(gr,new OYt(this._rpcProtocol)),r.set(fue,new gti(s)),r.set(Lat,i),r.set(Ze,new Gi(xTe,[!0],!0)),r.set(wp,new Gi(Lre,[],!0));const a=new P7(r,!0);_9&&a.invokeFunction(s6e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ze)),vs("code/extHost/didCreateServices"),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info("Extension host started"),this._logService.trace("initData",t),this._extensionService=a.invokeFunction(c=>c.get(_L)),this._extensionService.initialize(),_9&&a.invokeFunction(s6e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Ue.MainThreadExtensionService);return P.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Ue.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[P.revive(t),P.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(s=>{s.extensionLocation=P.revive(t.transformIncomingURIs(s.extensionLocation))}),e.environment.appRoot=P.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(s=>P.revive(t.transformIncomingURIs(s)))),e.environment.extensionTestsLocationURI=P.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=P.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=P.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=P.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=P.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=P.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class hii{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const s=this._relatedInformationProviders.get(e);if(!s)throw new Error("related information provider not found");return await s.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(s,i),this._proxy.$registerAiRelatedInformationProvider(s,t),new oo(()=>{this._proxy.$unregisterAiRelatedInformationProvider(s),this._relatedInformationProviders.delete(s)})}}const uii=[new Vn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of DocumentHighlight-instances.",fA(L4.to))),new Vn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[Et.Uri],new In("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(n,e)=>{if(iO(n))return;class t extends n4{static to(s){const o=new t(s.name,Sw.to(s.kind),s.containerName||"",new _p(e[0],at.to(s.range)));return o.detail=s.detail,o.range=o.location.range,o.selectionRange=at.to(s.selectionRange),o.children=s.children?s.children.map(t.to):[],o}}return n.map(t.to)})),new Vn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[Et.Uri,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[Et.Uri,Et.Range,new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[Et.Uri,Et.Position,new Et("ch","Trigger character",n=>typeof n=="string",n=>n),new Et("options","Formatting options",n=>!0,n=>n)],new In("A promise that resolves to an array of TextEdits.",fA(nh.to))),new Vn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location or LocationLink instances.",bY)),new Vn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Location-instances.",fA(P_.to))),new Vn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[Et.Uri,Et.Position],new In("A promise that resolves to an array of Hover-instances.",fA(ooe.to))),new Vn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[Et.Uri,new Et("position","A position in a text document",n=>Array.isArray(n)&&n.every(e=>Ps.isPosition(e)),n=>n.map(Wr.from))],new In("A promise that resolves to an array of ranges.",n=>n.map(e=>{let t;for(const i of e.reverse())t=new r4(at.to(i),t);return t}))),new Vn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[Et.String.with("query","Search string")],new In("A promise that resolves to an array of SymbolInformation-instances.",n=>n.map(EG.to))),new Vn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of CallHierarchyItem-instances",n=>n.map(KF.to))),new Vn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyIncomingCall-instances",n=>n.map(eIe.to))),new Vn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[Et.CallHierarchyItem],new In("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",n=>n.map(tIe.to))),new Vn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[Et.Uri,Et.Position],new In("A promise that resolves to a range and placeholder text.",n=>{if(n)return{range:at.to(n.range),placeholder:n.text}})),new Vn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[Et.Uri,Et.Position,Et.String.with("newName","The new symbol name")],new In("A promise that resolves to a WorkspaceEdit.",n=>{if(n){if(n.rejectReason)throw new Error(n.rejectReason);return lf.to(n)}})),new Vn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[Et.Uri,Et.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new In("A promise that resolves to an array of DocumentLink-instances.",n=>n.map(zM.to))),new Vn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[Et.Uri],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[Et.Uri],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[Et.Uri,Et.Range.optional()],new In("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new yse(n.tokenTypes,n.tokenModifiers)})),new Vn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[Et.Uri,Et.Range],new In("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=Iie(n);if(e.type==="full")return new GF(e.data,void 0)})),new Vn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),Et.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new In("A promise that resolves to a CompletionList-instance.",(n,e,t)=>{if(!n)return new WF([]);const i=n.suggestions.map(s=>rIe.to(s,t));return new WF(i,n.incomplete)})),new Vn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[Et.Uri,Et.Position,Et.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new In("A promise that resolves to SignatureHelp.",n=>{if(n)return DG.to(n)})),new Vn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[Et.Uri,Et.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new In("A promise that resolves to an array of CodeLens-instances.",(n,e,t)=>fA(i=>new O6(at.to(i.range),i.command&&t.fromInternal(i.command)))(n))),new Vn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[Et.Uri,new Et("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",n=>rs.isRange(n),n=>XS.isSelection(n)?ZS.from(n):at.from(n)),Et.String.with("kind","Code action kind to return code actions for").optional(),Et.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new In("A promise that resolves to an array of Command-instances.",(n,e,t)=>fA(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const s=new F6(i.title,i.kind?new Ya(i.kind):void 0);return i.edit&&(s.edit=lf.to(i.edit)),i.command&&(s.command=t.fromInternal(i.command)),s.isPreferred=i.isPreferred,s}})(n))),new Vn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[Et.Uri],new In("A promise that resolves to an array of ColorInformation objects.",n=>n?n.map(e=>new z6(at.to(e.range),T4.to(e.color))):[])),new Vn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new Et("color","The color to show and insert",n=>n instanceof VF,T4.from),new Et("context","Context object with uri and range",n=>!0,n=>({uri:n.uri,range:at.from(n.range)}))],new In("A promise that resolves to an array of ColorPresentation objects.",n=>n?n.map(goe.to):[])),new Vn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[Et.Uri,Et.Range],new In("A promise that resolves to an array of Inlay objects",(n,e,t)=>n.map(aIe.to.bind(void 0,t)))),new Vn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[Et.Uri],new In("A promise that resolves to an array of FoldingRange objects",(n,e)=>{if(n)return n.map(poe.to)})),new Vn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new In("A promise that resolves to an array of NotebookContentProvider static info objects.",fA(n=>({viewType:n.viewType,displayName:n.displayName,options:{transientOutputs:n.options.transientOutputs,transientCellMetadata:n.options.transientCellMetadata,transientDocumentMetadata:n.options.transientDocumentMetadata},filenamePattern:n.filenamePattern.map(e=>voe.to(e))})))),new Vn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[Et.Uri,Et.Range,new Et("context","An InlineValueContext",n=>n&&typeof n.frameId=="number"&&n.stoppedLocation instanceof rs,n=>aoe.from(n))],new In("A promise that resolves to an array of InlineValue objects",n=>n.map(roe.to))),new Vn("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new Et("uriOrString","Uri-instance or string (only http/https)",n=>P.isUri(n)||typeof n=="string"&&L9(n,_e.http,_e.https),n=>n),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional(),Et.String.with("label","").optional()],In.Void),new Vn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[Et.Uri.with("resource","Resource to open"),Et.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[yd.from(n),void 0]:[yd.from(n.viewColumn),C8.from(n)])).optional()],In.Void),new Vn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[Et.Uri.with("left","Left-hand side resource of the diff editor"),Et.Uri.with("right","Right-hand side resource of the diff editor"),Et.String.with("title","Human readable title for the diff editor").optional(),new Et("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="object",n=>n&&[yd.from(n.viewColumn),C8.from(n)]).optional()],In.Void),new Vn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[Et.String.with("title","Human readable title for the changes editor"),new Et("resourceList","List of resources to compare",n=>{for(const e of n){if(e.length!==3)return!1;const[t,i,s]=e;if(!P.isUri(t)||!P.isUri(i)&&i!==void 0&&i!==null||!P.isUri(s)&&s!==void 0&&s!==null)return!1}return!0},n=>n)],In.Void),new Vn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[Et.Uri,Et.Position],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[Et.TypeHierarchyItem],new In("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map($M.to))),new Vn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[Et.TestItem],In.Void),new Vn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[Et.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],In.Void),new Vn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[Et.String.with("name","The context key name"),new Et("value","The context key value",()=>!0,n=>n)],In.Void),new Vn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[Et.Uri,Et.StringArray,new Et("MappedEditsContext","Mapped Edits Context",n=>_oe.is(n),n=>_oe.from(n))],new In("A promise that resolves to a workspace edit or null",n=>n?lf.to(n):null)),new Vn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new Et("Run arguments","",n=>!0,n=>{if(n)return{initialRange:n.initialRange?at.from(n.initialRange):void 0,initialSelection:XS.isSelection(n.initialSelection)?ZS.from(n.initialSelection):void 0,message:n.message,autoSend:n.autoSend,position:n.position?Wr.from(n.position):void 0}})],In.Void)];class gii{static register(e){uii.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",ndt)}}function fA(n){return e=>{if(Array.isArray(e))return e.map(n)}}function bY(n){if(!Array.isArray(n))return;const e=[];for(const t of n)BQe(t)?e.push(xG.to(t)):e.push(P_.to(t));return e}let DTe=class{constructor(e,t){this._proxy=e.getProxy(Ue.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const s=new $h(lf.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(s,void 0,i?.isRefactoring??!1)}};DTe=D([_(0,gr)],DTe);class fii{constructor(e,t,i,s,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=s,this._sessionDisposables=o,this._stopWatch=ao.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this;this._stopWatch.reset();const i=(s,o)=>{if(typeof this._firstProgress>"u"&&"content"in s&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,s),a={report:c=>{r?.then(l=>{l&&(vp.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,NG.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,Sx.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,bIe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,s)};this._apiObject={markdown(s){t(this.markdown);const o=new Jhe(s),r=TG.from(o);return i(r),this},markdownWithVulnerabilities(s,o){t(this.markdown),o&&Je(e._extension,"chatParticipantAdditions");const r=new fG(s,o),a=Soe.from(r);return i(a),this},filetree(s,o){t(this.filetree);const r=new Xhe(s,o),a=RG.from(r);return i(a),this},anchor(s,o){t(this.anchor);const r=new Zhe(s,o),a=MG.from(r);return i(a),this},button(s){t(this.anchor);const o=new eue(s),r=PG.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(s,o){t(this.progress);const r=new Fot(s,o),a=o?wIe.from(r):F4.from(r);return i(a,o),this},warning(s){t(this.progress),Je(e._extension,"chatParticipantAdditions");const o=new _G(s),r=NG.from(o);return i(r),this},reference(s,o){if(t(this.reference),"variableName"in s&&Je(e._extension,"chatParticipantAdditions"),"variableName"in s&&!s.value){const r=e._request.variables.variables.find(a=>a.name===s.variableName);if(r){let a;if(r.references?.length)a=r.references.map(c=>({kind:"reference",reference:{variableName:s.variableName,value:c.reference}}));else{const c=new GI(s,o);a=[Sx.from(c)]}return a.forEach(c=>i(c)),this}}else{const r=new GI(s,o),a=Sx.from(r);i(a)}return this},textEdit(s,o){t(this.textEdit),Je(e._extension,"chatParticipantAdditions");const r=new vG(s,o),a=Eoe.from(r);return i(a),this},detectedParticipant(s,o){t(this.detectedParticipant),Je(e._extension,"chatParticipantAdditions");const r=new pG(s,o),a=Aoe.from(r);return i(a),this},confirmation(s,o,r){t(this.confirmation),Je(e._extension,"chatParticipantAdditions");const a=new _ke(s,o,r),c=vIe.from(a);return i(c),this},push(s){if(t(this.push),(s instanceof vG||s instanceof fG||s instanceof pG||s instanceof _G||s instanceof _ke)&&Je(e._extension,"chatParticipantAdditions"),s instanceof GI)this.reference(s.value,s.iconPath);else{const o=xoe.from(s,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const d9=class d9 extends ${constructor(e,t,i,s){super(),this._logService=t,this.commands=i,this.quality=s,this._agents=new Map,this._sessionDisposables=this._register(new Zo),this._completionDisposables=this._register(new Zo),this._proxy=e.getProxy(Ue.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const s=d9._idPool++,o=new o6e(e,this.quality,t,this._proxy,s,i);return this._agents.set(s,o),o.isAgentEnabled()&&this._proxy.$registerAgent(s,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,s){const o=d9._idPool++,r=new o6e(e,this.quality,t,this._proxy,o,s);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,s){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let r=this._sessionDisposables.get(t.sessionId);r||(r=new Z,this._sessionDisposables.set(t.sessionId,r));const a=new fii(o.extension,t,this._proxy,this.commands.converter,r);try{const c=await this.prepareHistoryTurns(t.agentId,i),l=o.invoke(CIe.to(t),{history:c},a.apiObject,s);return await dw(Promise.resolve(l).then(d=>{if(d?.metadata)try{JSON.stringify(d.metadata)}catch(u){const f=`result.metadata MUST be JSON.stringify-able. Got error: ${u.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${f}`,o.extension),{errorDetails:{message:f},timings:a.timings}}let h;return d?.errorDetails&&(h={...d.errorDetails,responseIsIncomplete:!0}),h?.responseIsRedacted&&Je(o.extension,"chatParticipantPrivate"),{errorDetails:h,timings:a.timings,metadata:d?.metadata}}),s)}catch(c){return this._logService.error(c,o.extension),c instanceof qg&&c.cause&&(c=c.cause),{errorDetails:{message:Ma(c),responseIsIncomplete:!0}}}finally{a.close()}}async prepareHistoryTurns(e,t){const i=[];for(const s of t.history){const o=rH.to(s.result),r=e===s.request.agentId?o:{...o,metadata:void 0};i.push(new Oot(s.request.message,s.request.command,s.request.variables.variables.map(Doe.to),s.request.agentId));const a=Ui(s.response.map(c=>xoe.toContent(c,this.commands.converter)));i.push(new Bot(a,r,s.request.agentId,s.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,s,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=await this.prepareHistoryTurns(r.id,s),c=rH.to(i);return(await r.provideFollowups(c,{history:a},o)).filter(l=>{const d=!l.participant||fi.some(this._agents.values(),h=>h.id===l.participant&&Cn.equals(h.extension.identifier,r.extension.identifier));return d||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${l.participant}`),d}).map(l=>LG.from(l,e))}$acceptFeedback(e,t,i,s){const o=this._agents.get(e);if(!o)return;const r=rH.to(t);let a;switch(i){case zV.Down:a=y4.Unhelpful;break;case zV.Up:a=y4.Helpful;break}o.acceptFeedback(Object.freeze(s?{result:r,kind:a,reportIssue:s}:{result:r,kind:a}))}$acceptAction(e,t,i){const s=this._agents.get(e);if(!s||i.action.kind==="vote")return;const o=SIe.to(t,i,this.commands.converter);o&&s.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const s=this._agents.get(e);if(!s)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await s.invokeCompletionProvider(t,i)).map(a=>yIe.from(a,this.commands.converter,o))}async $provideWelcomeMessage(e,t,i){const s=this._agents.get(e);if(s)return await s.provideWelcomeMessage(O4.to(t),i)}async $provideSampleQuestions(e,t,i){const s=this._agents.get(e);if(s)return(await s.provideSampleQuestions(O4.to(t),i)).map(o=>LG.from(o,void 0))}};d9._idPool=0;let kTe=d9;class o6e{constructor(e,t,i,s,o,r){this.extension=e,this.quality=t,this.id=i,this._proxy=s,this._handle=o,this._requestHandler=r,this._onDidReceiveFeedback=new I,this._onDidPerformAction=new I}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}isAgentEnabled(){return!(this.quality==="stable"&&!Cd(this.extension,"chatParticipantPrivate"))}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const s=await this._followupProvider.provideFollowups(e,t,i);return s?s.filter(o=>!(o&&"commandId"in o)).filter(o=>!(o&&"message"in o)):[]}async provideWelcomeMessage(e,t){if(!this._welcomeMessageProvider)return[];const i=await this._welcomeMessageProvider.provideWelcomeMessage(e,t);return i?i.map(s=>typeof s=="string"?s:Qs.from(s)):[]}async provideSampleQuestions(e,t){if(!this._welcomeMessageProvider||!this._welcomeMessageProvider.provideSampleQuestions)return[];const i=await this._welcomeMessageProvider.provideSampleQuestions(e,t);return i||[]}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{s.isAgentEnabled()&&(this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof P?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof fg?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Qs.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Qs.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Qs.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1)}))},s=this;return{get id(){return s.id},get iconPath(){return s._iconPath},set iconPath(o){s._iconPath=o,i()},get requestHandler(){return s._requestHandler},set requestHandler(o){Bt(typeof o=="function","Invalid request handler"),s._requestHandler=o},get followupProvider(){return s._followupProvider},set followupProvider(o){s._followupProvider=o,i()},get isDefault(){return Je(s.extension,"defaultChatParticipant"),s._isDefault},set isDefault(o){Je(s.extension,"defaultChatParticipant"),s._isDefault=o,i()},get helpTextPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix},set helpTextPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix},set helpTextPostfix(o){Je(s.extension,"defaultChatParticipant"),s._helpTextPostfix=o,i()},get isSecondary(){return Je(s.extension,"defaultChatParticipant"),s._isSecondary},set isSecondary(o){Je(s.extension,"defaultChatParticipant"),s._isSecondary=o,i()},get supportIssueReporting(){return Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting},set supportIssueReporting(o){Je(s.extension,"chatParticipantPrivate"),s._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return s._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");s._proxy.$registerAgentCompletionsProvider(s._handle,s.id,o.triggerCharacters)}else s._proxy.$unregisterAgentCompletionsProvider(s._handle,s.id)},get participantVariableProvider(){return Je(s.extension,"chatParticipantAdditions"),s._agentVariableProvider},set welcomeMessageProvider(o){Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Je(s.extension,"defaultChatParticipant"),s._welcomeMessageProvider},onDidPerformAction:Cd(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){s._requester=o,i()},get requester(){return s._requester},set supportsSlowReferences(o){Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Je(s.extension,"chatParticipantPrivate"),s._supportsSlowReferences},dispose(){e=!0,s._followupProvider=void 0,s._onDidReceiveFeedback.dispose(),s._proxy.$unregisterAgent(s._handle)}}}invoke(e,t,i,s){return this._requestHandler(e,t,i,s)}}const wle=class wle{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Ue.MainThreadChatVariables)}async $resolveVariable(e,t,i,s){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Je(o.extension,"chatParticipantAdditions");const r=new pii(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,s);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},s);if(r&&r[0])return r[0].value}}catch(r){er(r)}}registerVariableResolver(e,t,i,s,o,r,a,c,l){const d=wle._idPool++,h=l?$e.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:s,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:s,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}attachContext(e,t,i){this._proxy.$attachContext(e,_p.isLocation(t)?yx.from(t):t,O4.from(i))}};wle._idPool=0;let ITe=wle;class pii{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(s){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,s),o}};const e=this,i=s=>{this._proxy.$handleProgressChunk(this._requestId,s)};this._apiObject={progress(s){t(this.progress);const o=new mG(s),r=F4.from(o);return i(r),this},reference(s){t(this.reference);const o=new GI(s),r=Sx.from(o);return i(r),this},push(s){return t(this.push),s instanceof GI?i(Sx.from(s)):s instanceof mG&&i(F4.from(s)),this}}}return this._apiObject}}class mii{constructor(e){const t=e.getProxy(Ue.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const Fat="vscode-cdn.net",_ii=`vscode-resource.${Fat}`,LTe=`'self' https://*.${Fat}`;function O8(n,e){return n.scheme===_e.http||n.scheme===_e.https?n:(e&&e.authority&&e.isRemote&&n.scheme===_e.file&&(n=P.from({scheme:_e.vscodeRemote,authority:e.authority,path:n.path})),P.from({scheme:_e.https,authority:`${n.scheme}+${vii(n.authority)}.${_ii}`,path:n.path,fragment:n.fragment,query:n.query}))}function vii(n){return n.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=Q.a&&t<=Q.z||t>=Q.A&&t<=Q.Z||t>=Q.Digit0&&t<=Q.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class wii{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new Z,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const s=t.getVisibleTextEditors();for(const o of this._insets.values())s.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,s,o){let r;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){r=f;break}if(!r)throw new Error("not a visible editor");const a=this,c=this._handlePool++,l=new I,d=new I,h=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(f){return O8(f,a._remoteInfo)}get cspSource(){return LTe}set options(f){this._options=f,a._proxy.$setOptions(c,f)}get options(){return this._options}set html(f){this._html=f,a._proxy.$setHtml(c,f)}get html(){return this._html}get onDidReceiveMessage(){return l.event}postMessage(f){return a._proxy.$postMessage(c,f)}},u=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=h,this.onDidDispose=d.event}dispose(){a._insets.has(c)&&(a._insets.delete(c),a._proxy.$disposeEditorInset(c),d.fire(),d.dispose(),l.dispose())}};return this._proxy.$createEditorInset(c,r.id,r.value.document.uri,t+1,i,s||{},o.identifier,o.extensionLocation),this._insets.set(c,{editor:e,inset:u,onDidReceiveMessage:l}),u}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}function bii(n,e,t){const i=n.getProxy(Ue.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new $a,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===Fs.CommentController){const w=this._commentControllers.get(v.handle);return w?w.value:v}else if(v&&v.$mid===Fs.CommentThread){const w=v,b=this._commentControllers.get(w.commentControlHandle);if(!b)return w;const C=b.getCommentThread(w.commentThreadHandle);return C?C.value:w}else if(v&&(v.$mid===Fs.CommentThreadReply||v.$mid===Fs.CommentThreadInstance)){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);return b?v.$mid===Fs.CommentThreadInstance?b.value:{thread:b.value,text:v.text}:v}else if(v&&v.$mid===Fs.CommentNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.commentUniqueId,y=b.getCommentByUniqueId(C);return y||v}else if(v&&v.$mid===Fs.CommentThreadNode){const w=this._commentControllers.get(v.thread.commentControlHandle);if(!w)return v;const b=w.getCommentThread(v.thread.commentThreadHandle);if(!b)return v;const C=v.text,y=v.commentUniqueId,S=b.getCommentByUniqueId(y);return S?(typeof S.body=="string"?S.body=C:S.body=new vp(C),S):v}return v}})}createCommentController(v,w,b){const C=f.handlePool++,y=new r(v,C,w,b);this._commentControllers.set(y.handle,y);const S=this._commentControllersByExtension.get(v.identifier)||[];return S.push(y),this._commentControllersByExtension.set(v.identifier,S),y.value}async $createCommentThreadTemplate(v,w,b,C){const y=this._commentControllers.get(v);y&&y.$createCommentThreadTemplate(w,b,C)}async $setActiveComment(v,w){const b=this._commentControllers.get(v);b&&b.$setActiveComment(w??void 0)}async $updateCommentThreadTemplate(v,w,b){const C=this._commentControllers.get(v);C&&C.$updateCommentThreadTemplate(w,b)}$deleteCommentThread(v,w){this._commentControllers.get(v)?.$deleteCommentThread(w)}async $provideCommentingRanges(v,w,b){const C=this._commentControllers.get(v);if(!C||!C.commentingRangeProvider)return Promise.resolve(void 0);const y=await t.ensureDocumentData(P.revive(w));return Zu(async()=>{const S=await C.commentingRangeProvider.provideCommentingRanges(y.document,b);let M;return Array.isArray(S)?M={ranges:S,fileComments:!1}:S?M={ranges:S.ranges||[],fileComments:S.fileComments||!1}:M=S??void 0,M}).then(S=>{let M;return S&&(M={ranges:S.ranges.map(k=>at.from(k)),fileComments:S.fileComments}),M})}$toggleReaction(v,w,b,C,y){const S=this._commentControllers.get(v);return!S||!S.reactionHandler?Promise.resolve(void 0):Zu(()=>{const M=S.getCommentThread(w);if(M){const k=M.getCommentByUniqueId(C.uniqueIdInThread);if(S!==void 0&&k&&S.reactionHandler)return S.reactionHandler(k,l(y))}return Promise.resolve(void 0)})}};f.handlePool=0;let s=f;const p=class p{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire()}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?(Je(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,w,b,C,y,S,M,k,F){this._commentControllerHandle=w,this._id=b,this._uri=C,this._range=y,this._comments=S,this.extensionDescription=M,this._isTemplate=k,this.handle=p._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new I,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new Dn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(w,this.handle,this._id,this._uri,at.from(this._range),M.identifier,this._isTemplate,F),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this.comments=S,this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(w,this.handle)}});const N=this;this.value={get uri(){return N.uri},get range(){return N.range},set range(z){N.range=z},get comments(){return N.comments},set comments(z){N.comments=z},get collapsibleState(){return N.collapsibleState},set collapsibleState(z){N.collapsibleState=z},get canReply(){return N.canReply},set canReply(z){N.canReply=z},get contextValue(){return N.contextValue},set contextValue(z){N.contextValue=z},get label(){return N.label},set label(z){N.label=z},get state(){return N.state},set state(z){N.state=z},dispose:()=>{N.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new Z);const v=b=>Object.prototype.hasOwnProperty.call(this.modifications,b),w={};v("range")&&(w.range=at.from(this._range)),v("label")&&(w.label=this.label),v("contextValue")&&(w.contextValue=this.contextValue??null),v("comments")&&(w.comments=this._comments.map(b=>a(this,b,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(w.collapseState=d(this._collapseState)),v("canReply")&&(w.canReply=this.canReply),v("state")&&(w.state=h(this._state)),v("applicability")&&(w.applicability=u(this._state)),v("isTemplate")&&(w.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,w)}getCommentByUniqueId(v){for(const w of this._commentsMap){const b=w[0],C=w[1];if(v===C)return b}}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};p._handlePool=0;let o=p;class r{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&Je(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return Je(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Je(this._extension,"activeComment"),this._activeThread}constructor(v,w,b,C){this._extension=v,this._handle=w,this._id=b,this._label=C,this._threads=new Map,i.$registerCommentController(this.handle,b,C,this._extension.identifier.value);const y=this;this.value=Object.freeze({id:y.id,label:y.label,get options(){return y.options},set options(S){y.options=S},get commentingRangeProvider(){return y.commentingRangeProvider},set commentingRangeProvider(S){y.commentingRangeProvider=S},get reactionHandler(){return y.reactionHandler},set reactionHandler(S){y.reactionHandler=S},get activeCommentThread(){return y.activeCommentThread},createCommentThread(S,M,k){return y.createCommentThread(S,M,k).value},dispose:()=>{y.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,w,b){w===void 0&&Je(this._extension,"fileComments");const C=new o(this.id,this.handle,void 0,v,w,b,this._extension,!1);return this._threads.set(C.handle,C),C}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const w=this._threads.get(v.commentThreadHandle);w&&(this._activeComment=v.uniqueIdInThread?w.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=w)}$createCommentThreadTemplate(v,w,b){const C=new o(this.id,this.handle,void 0,P.revive(v),at.to(w),[],this._extension,!0,b);return C.collapsibleState=zl.Expanded,this._threads.set(C.handle,C),C}$updateCommentThreadTemplate(v,w){const b=this._threads.get(v);b&&(b.range=at.to(w))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(m,v,w,b){let C=w.get(v);return C||(C=++m.commentHandle,w.set(v,C)),v.state!==void 0&&Je(b,"commentsDraftState"),v.reactions?.some(y=>y.reactors!==void 0)&&Je(b,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:C,body:typeof v.body=="string"?v.body:Qs.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(y=>c(y)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?rue(m.iconPath):void 0,count:m.count,hasReacted:m.authorHasReacted,reactors:m.reactors&&m.reactors.length>0&&typeof m.reactors[0]!="string"?m.reactors.map(v=>v.name):m.reactors}}function l(m){return{label:m.label||"",count:m.count||0,iconPath:m.iconPath?P.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case m4.Expanded:return zl.Expanded;case m4.Collapsed:return zl.Collapsed}return zl.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case _4.Unresolved:return hg.Unresolved;case _4.Resolved:return hg.Resolved}return hg.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case iG.Current:return kI.Current;case iG.Outdated:return kI.Outdated}return kI.Current}return new s}var UR,VR,Aq,Eq,xq,dy,zR,$R,GR,qR,Dq,KH,QR;class Cii{constructor(e,t,i,s,o,r,a){kt(this,UR);kt(this,VR);kt(this,Aq);kt(this,Eq);kt(this,xq);kt(this,dy);kt(this,zR);kt(this,$R);kt(this,GR);kt(this,qR);kt(this,Dq);kt(this,KH);kt(this,QR);st(this,zR,""),st(this,GR,!1),st(this,qR,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,st(this,QR,new I),this._onDidDispose=se(this,QR).event,st(this,UR,e),st(this,VR,t),st(this,$R,i),st(this,Eq,s),st(this,xq,o),st(this,dy,r),st(this,Dq,q4(r)),st(this,KH,yii(r)),st(this,Aq,a)}dispose(){st(this,GR,!0),se(this,QR).fire(),se(this,QR).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return st(this,qR,!0),O8(e,se(this,Eq))}get cspSource(){const e=se(this,dy).extensionLocation;if(e.scheme===_e.https||e.scheme===_e.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+LTe}return LTe}get html(){return this.assertNotDisposed(),se(this,zR)}set html(e){this.assertNotDisposed(),se(this,zR)!==e&&(st(this,zR,e),se(this,KH)&&!se(this,qR)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(st(this,qR,!0),se(this,Aq).report("Webview vscode-resource: uris",se(this,dy),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),se(this,VR).$setHtml(se(this,UR),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),se(this,$R)}set options(e){this.assertNotDisposed(),Io(se(this,$R),e)||se(this,VR).$setOptions(se(this,UR),Oat(se(this,dy),se(this,xq),e)),st(this,$R,e)}async postMessage(e){if(se(this,GR))return!1;const t=zot(e,{serializeBuffersForPostMessage:se(this,Dq)});return se(this,VR).$postMessage(se(this,UR),t.message,...t.buffers)}assertNotDisposed(){if(se(this,GR))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!se(this,KH))return e;const t=se(this,dy).extensionLocation?.scheme===_e.vscodeRemote,i=se(this,dy).extensionLocation.scheme===_e.vscodeRemote?se(this,dy).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,o,r,a,c,l)=>{const d=P.from({scheme:a||"file",path:decodeURIComponent(c)}),h=O8(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}UR=new WeakMap,VR=new WeakMap,Aq=new WeakMap,Eq=new WeakMap,xq=new WeakMap,dy=new WeakMap,zR=new WeakMap,$R=new WeakMap,GR=new WeakMap,qR=new WeakMap,Dq=new WeakMap,KH=new WeakMap,QR=new WeakMap;function q4(n){try{const e=L6(I6(n.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function yii(n){try{const e=L6(I6(n.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class Sii extends ${constructor(e,t,i,s,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=s,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Ue.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const s=this.getWebview(e);if(s){const{message:o}=$ot(t,i.value);s._onMessageEmitter.fire(o)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const s=new Cii(e,this._webviewProxy,Aii(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,s);const o=s._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return s}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function Tre(n){return{id:n.identifier,location:n.extensionLocation}}function Oat(n,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||Eii(n,e)}}function Aii(n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots?.map(e=>P.from(e))}}function Eii(n,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),n.extensionLocation]}const ble=class ble{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){ble.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};ble.enableDebugLogging=!1;let F_=ble;class xii{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new F_("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=Rii(this.document.uri)+this._backupCounter++;return Qt(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class Dii{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const s=this.key(e,t.uri);if(this._documents.has(s))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new xii(t,i);return this._documents.set(s,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var SI;(function(n){n[n.Text=0]="Text",n[n.Custom=1]="Custom"})(SI||(SI={}));class kii{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:SI.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:SI.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new oo(()=>this._providers.delete(e))}}class Iii{constructor(e,t,i,s,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=s,this._extHostWebviewPanels=o,this._editorProviders=new kii,this._documents=new Dii,this._proxy=e.getProxy(Ue.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,s){const o=new Z;return Lii(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(Tre(e),t,s.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},q4(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),CY(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(Tii(r)){const c=a.addEdit(r);this._proxy.$onDidEdit(r.document.uri,t,c,r.label)}else this._proxy.$onContentChange(r.document.uri,t)})),this._proxy.$registerCustomEditorProvider(Tre(e),t,s.webviewOptions||{},!!s.supportsMultipleEditorsPerDocument,q4(e))),oo.from(o,new oo(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,s,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==SI.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=P.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:s?.buffer},o);let l;return CY(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:CY(r.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==SI.Custom)throw new Error(`Invalid provider type for '${t}'`);const s=P.revive(e),{document:o}=this.getCustomDocumentEntry(t,s);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,s,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=yd.to(o),l=this._extHostWebview.createNewWebview(t,s.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,s.title,c,s.options,l,s.active),h=P.revive(e);switch(a.type){case SI.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case SI.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,r)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const s=this._editorProviders.get(i);if(!s)throw new Error(`No provider found for '${i}'`);if(!s.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const o=this._extHostWebviewPanels.getWebviewPanel(e);if(!o)throw new Error("No webview found");const r=P.revive(t),a=this._extHostDocuments.getDocument(r);await s.provider.moveCustomTextEditor(a,o,qe.None)}async $undo(e,t,i,s){return this.getCustomDocumentEntry(t,e).undo(i,s)}async $redo(e,t,i,s){return this.getCustomDocumentEntry(t,e).redo(i,s)}async $revert(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(s.document,i),s.disposeBackup()}async $onSave(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(s.document,i),s.disposeBackup()}async $onSaveAs(e,t,i,s){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,P.revive(i),s)}async $backup(e,t,i){const s=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(s.document,{destination:s.getNewBackupUri()},i);return s.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,P.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!CY(i))throw new Error("Custom document is not editable");return i}}function CY(n){return!!n.onDidChangeCustomDocument}function Lii(n){return typeof n.resolveCustomTextEditor=="function"}function Tii(n){return typeof n.undo=="function"&&typeof n.redo=="function"}function Rii(n){const e=n.scheme===_e.file||n.scheme===_e.untitled?n.fsPath:n.toString();return Ed(e)+""}var jD;const Mii="vs/workbench/api/common/extHostDiagnostics";var YA,Lk,bh;const LBe=class LBe{constructor(e,t,i,s,o,r,a,c){kt(this,YA);kt(this,Lk);kt(this,bh);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=s,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(s,i),st(this,bh,new wi(l=>r.getComparisonKey(l))),st(this,YA,a),st(this,Lk,c)}dispose(){this._isDisposed||(se(this,Lk).fire([...se(this,bh).keys()]),se(this,YA)?.$clear(this._owner),se(this,bh).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(P.isUri(e)){if(!t){this.delete(e);return}se(this,bh).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(LBe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&se(this,bh).get(r).length===0&&se(this,bh).delete(r),r=c,i.push(c),se(this,bh).set(c,[])),l)se(this,bh).get(c)?.push(...l);else{const d=se(this,bh).get(c);d&&(d.length=0)}}}if(se(this,Lk).fire(i),!se(this,YA))return;const s=[];let o=0;for(const r of i){let a=[];const c=se(this,bh).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Th.Error,Th.Warning,Th.Information,Th.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...k4.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ys.Info,message:g(Mii,0,"Not showing {0} further errors and warnings.",c.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=c.map(l=>({...k4.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(s.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}se(this,YA).$changeMany(this._owner,s)}delete(e){this._checkDisposed(),se(this,Lk).fire([e]),se(this,bh).delete(e),se(this,YA)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),se(this,Lk).fire([...se(this,bh).keys()]),se(this,bh).clear(),se(this,YA)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,s]of this)e.call(t,i,s,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of se(this,bh).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=se(this,bh).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(se(this,bh).get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()t[0].toString()?1:0}};YA=new WeakMap,Lk=new WeakMap,bh=new WeakMap;let Rre=LBe;var sx;let TTe=(sx=class{static _mapper(e){const t=new wi;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,s){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=s,this._collections=new Map,this._onDidChangeDiagnostics=new Fle({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=T.map(this._onDidChangeDiagnostics.event,jD._mapper),this._proxy=e.getProxy(Ue.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:s,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){s.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){s.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){s.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+jD._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+jD._idPool++;while(i.has(d))}return new class extends Rre{constructor(){super(t,d,jD._maxDiagnosticsTotal,jD._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,o),i.set(d,this)}dispose(){super.dispose(),i.delete(d)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const s of this._collections.values())s.forEach((o,r)=>{let a=t.get(o.toString());typeof a>"u"&&(a=i.length,t.set(o.toString(),a),i.push([o,[]])),i[a][1]=i[a][1].concat(...r)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new Rre(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(P.revive(t),i.map(k4.to))}},jD=sx,sx._idPool=0,sx._maxDiagnosticsPerFile=1e3,sx._maxDiagnosticsTotal=1.1*jD._maxDiagnosticsPerFile,sx);TTe=jD=D([_(1,Ze),_(2,Kz)],TTe);class Nii{constructor(e){this._proxy=e.getProxy(Ue.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Je(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(s=>P.revive(s)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?P.revive(t):void 0)}}const Cle=class Cle{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Ue.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(_e).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=Cle._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let s;if(typeof t.onDidChange=="function"){let o;s=t.onDidChange(async r=>{if(r.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${r.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(r))return;o&&await o;const a=this.$provideTextDocumentContent(i,r).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(r);if(!l)return;const d=xw(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(bt).finally(()=>{o===a&&(o=void 0)});o=a})}return new oo(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),s&&(s.dispose(),s=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(P.revive(t),qe.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};Cle._handlePool=0;let RTe=Cle;class Pii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._callbacks=new td,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,s)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(s)&&s.push(r),r}}async $participateInSave(e,t){const i=P.revive(e);let s=!1;const o=setTimeout(()=>s=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(s)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:foe.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],s){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,s).then(()=>!0,r=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(r),!(r instanceof Error)||r.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,s){const o=[],r=Date.now(),{document:a,reason:c}=s,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw Nle("waitUntil can not be called async");o.push(Promise.resolve(h))}});try{t.apply(i,[d])}catch(h){return Promise.reject(h)}return new Promise((h,u)=>{const f=setTimeout(()=>u(new Error("timeout")),this._thresholds.timeout);return Promise.all(o).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-r}ms`),clearTimeout(f),h(p)}).catch(p=>{clearTimeout(f),u(p)})}).then(h=>{const u={edits:[]};for(const f of h)if(Array.isArray(f)&&f.every(p=>p instanceof qx))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&at.from(v),text:p,eol:m&&R4.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(u)):Promise.reject(new Error("concurrent_edits"))})}}class Fii{constructor(e,t){this._onDidAddDocument=new I,this._onDidRemoveDocument=new I,this._onDidChangeDocument=new I,this._onDidSaveDocument=new I,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new Z,this._documentLoader=new Map,this._proxy=e.getProxy(Ue.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const s of i)this._onDidRemoveDocument.fire(s.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const s of i)this._onDidAddDocument.fire(s.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e){const t=this._documentsAndEditors.getDocument(e);if(t)return Promise.resolve(t);let i=this._documentLoader.get(e.toString());return i||(i=this._proxy.$tryOpenDocument(e).then(s=>{this._documentLoader.delete(e.toString());const o=P.revive(s);return ws(this._documentsAndEditors.getDocument(o))},s=>(this._documentLoader.delete(e.toString()),Promise.reject(s))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>P.revive(t))}$acceptModelLanguageChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");this._onDidRemoveDocument.fire(s.document),s._acceptLanguageId(t),this._onDidAddDocument.fire(s.document)}$acceptModelSaved(e){const t=P.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=P.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptIsDirty(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const s=P.revive(e),o=this._documentsAndEditors.getDocument(s);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=l4.Undo:t.isRedoing&&(r=l4.Redo),this._onDidChangeDocument.fire(Xqe({document:o.document,contentChanges:t.changes.map(a=>({range:at.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){Dti(e,t)}}class Oii{constructor(e){this._provider=new Map,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const s=this._handlePool++;return this._proxy.$registerEmbeddingProvider(s,t),this._provider.set(s,{id:t,provider:i}),Ee(()=>{this._proxy.$unregisterEmbeddingProvider(s),this._provider.delete(s)})}async computeEmbeddings(e,t,i){i??=qe.None;let s=!1;typeof t=="string"&&(t=[t],s=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(s){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const s=this._provider.get(e);if(!s)return[];const o=await s.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Bii{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Ue.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const s=this._AiEmbeddingVectorProviders.get(e);if(!s)throw new Error("Embedding vector provider not found");const o=await s.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(s,i),this._proxy.$registerAiEmbeddingVectorProvider(t,s),new oo(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(s),this._AiEmbeddingVectorProviders.delete(s)})}}class Wii{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,s,o=Oi.LastKnownState,r=Oi.LastKnownState;for(const a of e){let c=i?LS(i,a):0;for(c===0?s=Oi.Start:s=r;c{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(l)});const c=i.onDidChangeFile(l=>{const d=[];for(const h of l){const{uri:u,type:f}=h;if(u.scheme!==t)continue;let p;switch(f){case OM.Changed:p=Ko.UPDATED;break;case OM.Created:p=Ko.ADDED;break;case OM.Deleted:p=Ko.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(o,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(o),this._proxy.$unregisterProvider(o)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:s,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:s,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(P.revive(t))).then(i=>Mre._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(P.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(P.revive(t))).then(i=>ze.wrap(i))}$writeFile(e,t,i,s){return Promise.resolve(this._getFsProvider(e).writeFile(P.revive(t),i.buffer,s))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(P.revive(t),i))}$rename(e,t,i,s){return Promise.resolve(this._getFsProvider(e).rename(P.revive(t),P.revive(i),s))}$copy(e,t,i,s){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(P.revive(t),P.revive(i),s))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(P.revive(t)))}$watch(e,t,i,s){const o=this._getFsProvider(e).watch(P.revive(i),s);this._watches.set(t,o)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const s=this._getFsProvider(e);if(!s.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(s.open(P.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,s){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=ze.alloc(s);return Promise.resolve(o.read(t,i,r.buffer,0,s)).then(a=>r.slice(0,a))}$write(e,t,i,s){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,s.buffer,0,s.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}class Hii{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,s,o,r){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,r?.ignoreCreateEvents&&(this._config+=1),r?.ignoreChangeEvents&&(this._config+=2),r?.ignoreDeleteEvents&&(this._config+=4);const a=_w(o),c=typeof o=="string",l=r?.correlate,d=s(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!r?.ignoreCreateEvents)for(const u of h.created){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=P.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=oo.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,s,o){const r=oo.from();if(typeof i=="string"||s?.ignoreChangeEvents&&s?.ignoreCreateEvents&&s?.ignoreDeleteEvents)return r;const a=e.getProxy(Ue.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(mR)||i.pattern.includes(Gwe))&&(c=!0);let l;return o&&(s?.ignoreChangeEvents||s?.ignoreCreateEvents||s?.ignoreDeleteEvents)&&(l=JD.UPDATED|JD.ADDED|JD.DELETED,s?.ignoreChangeEvents&&(l&=~JD.UPDATED),s?.ignoreCreateEvents&&(l&=~JD.ADDED),s?.ignoreDeleteEvents&&(l&=~JD.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:s?.excludes??[],filter:l},!!o),oo.from({dispose:()=>a.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class Uii{constructor(e){this._events=e,this.session=this._events.session,this._created=new Ka(()=>this._events.created.map(P.revive)),this._changed=new Ka(()=>this._events.changed.map(P.revive)),this._deleted=new Ka(()=>this._events.deleted.map(P.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class Vii{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new I,this._onDidRenameFile=new I,this._onDidCreateFile=new I,this._onDidDeleteFile=new I,this._onWillRenameFile=new EI,this._onWillCreateFile=new EI,this._onWillDeleteFile=new EI,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,s){return new Hii(this._mainContext,e,t,this._onFileSystemEvent.event,Zp.from(i),s)}$onFileEvent(e){this._onFileSystemEvent.fire(new Uii(e))}$onDidRunFileOperation(e,t){switch(e){case Li.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:P.revive(i.source),newUri:P.revive(i.target)}))}));break;case Li.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break;case Li.CREATE:case Li.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>P.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,s,o)=>{const r=function(c){i.call(s,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,s){switch(e){case Li.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:P.revive(o.source),newUri:P.revive(o.target)}))},i,s);case Li.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>P.revive(o.target))},i,s);case Li.CREATE:case Li.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>P.revive(o.target))},i,s)}}async _fireWillEvent(e,t,i,s){const o=new Set,r=[];if(await e.fireAsync(t,s,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof q1&&(r.push([l.extension,h]),o.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),s.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=lf.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class zii{constructor(e,t,i,s,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=s;const r=new Vn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new Et("showOptions","Show Options",a=>!0,a=>a),new Et("resource","Interactive resource Uri",a=>!0,a=>a),new Et("controllerId","Notebook controller Id",a=>!0,a=>a),new Et("title","Interactive editor title",a=>!0,a=>a)],new In("Notebook and input URI",a=>{if(o.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return o.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:P.revive(a.notebookUri),inputUri:P.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,s){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class $ii{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Ue.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}const Bat="vs/workbench/api/common/extHostLanguageFeatures";class Nre{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentSymbols(i,t);if(!iO(s))return s[0]instanceof s4?s.map(Zke.from):Nre._asDocumentSymbolTree(s)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((s,o)=>{let r=s.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(s.location.range.end)),r});const t=[],i=[];for(const s of e){const o={name:s.name||"!!MISSING: name!!",kind:Sw.from(s.kind),tags:s.tags?.map(Qx.from)||[],detail:"",containerName:s.containerName,range:at.from(s.location.range),selectionRange:at.from(s.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(O.containsRange(r.range,o.range)&&!O.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class yY{constructor(e,t,i,s,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=s,this._extTelemetry=o,this._logService=r,this._cache=new F_("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideCodeLenses(i,t);if(!s||t.isCancellationRequested)return;const o=this._cache.add(s),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;croe.from(a))}}class u6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideDocumentHighlights(s,o,i);if(Array.isArray(r))return r.map(L4.from)}}class g6e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,s){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Wr.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,s);if(Array.isArray(c))return c.map(nIe.from)}}class f6e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.provideLinkedEditingRanges(s,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Ui(r.ranges.map(at.from)),wordPattern:r.wordPattern}}}class p6e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideReferences(o,r,i,s);if(Array.isArray(a))return a.map(P_.from)}}const bW=class bW{constructor(e,t,i,s,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=s,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new F_("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,s){const o=this._documents.getDocument(e),r=mt.isISelection(t)?ZS.to(t):at.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>bW._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Ya(i.only):void 0,triggerKind:_Ie.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,s);if(!mo(l)||s.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fat.to(l)),a=rw.toDataTransfer(i,()=>{throw new tlt});if(await this._provider.prepareDocumentPaste(o,r,a,s),s.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof mse));return rw.from(c)}async providePasteEdits(e,t,i,s,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>at.to(u)),l=rw.toDataTransfer(s,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new u4(o.only):void 0,triggerKind:o.triggerKind},r);if(!d||r.isCancellationRequested)return[];const h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,0,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class m6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(s,t,i);if(Array.isArray(o))return o.map(nh.from)}}class bme{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,s){const o=this._documents.getDocument(e),r=at.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}async provideDocumentRangesFormattingEdits(e,t,i,s){Bt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(at.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,s);if(Array.isArray(a))return a.map(nh.from)}}class _6e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,s,o){const r=this._documents.getDocument(e),a=Wr.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,s,o);if(Array.isArray(c))return c.map(nh.from)}}class SY{constructor(e,t){this._provider=e,this._logService=t,this._cache=new F_("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!mo(i))return{symbols:[]};const s=this._cache.add(i),o={cacheId:s,symbols:[]};for(let r=0;ro.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(h9._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};h9.languageTriggerKindToVSCodeTriggerKind={[rF.Invoke]:tG.Invoke,[rF.Automatic]:tG.Automatic};let W8=h9;class Cme{constructor(e,t){this.resultId=e,this.tokens=t}}class Op{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=t!==0?this._previousResults.get(t):null;let r=typeof o?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(s,o.resultId,i):await this._provider.provideDocumentSemanticTokens(s,i);return o&&this._previousResults.delete(t),r?(r=Op._fixProvidedSemanticTokens(r),this._send(Op._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Op._isSemanticTokens(e)?Op._isCorrectSemanticTokens(e)?e:new GF(new Uint32Array(e.data),e.resultId):Op._isSemanticTokensEdits(e)?Op._isCorrectSemanticTokensEdits(e)?e:new _8(e.edits.map(t=>new pOe(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!Op._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,s=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(s,r);for(;a({start:s.start,deleteCount:s.deleteCount,data:s.data}))})}return null}}class v6e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(s,at.to(t),i);return o?this._send(o):null}_send(e){return d6({id:0,type:"full",data:e.data})}}class $T{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=s,this._extension=o,this._cache=new F_("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=o.getWordRangeAtPosition(r)||new rs(r,r),c=a.with({end:r}),l=new ao,d=await this._provider.provideCompletionItems(o,r,s,oIe.to(i));if(!d||s.isCancellationRequested)return;const h=Array.isArray(d)?new WF(d):d,u=$T.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[aS.completions]:p,[aS.defaultRanges]:{replace:at.from(a),insert:at.from(c)},[aS.isIncomplete]:h.isIncomplete||void 0,[aS.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Qs.fromStrict(e.documentation),[Fi.sortText]:e.sortText!==e.label?e.sortText:void 0,[Fi.filterText]:e.filterText!==e.label?e.filterText:void 0,[Fi.preselect]:e.preselect||void 0,[Fi.insertTextRules]:e.keepWhitespace?cp.KeepWhitespace:cp.None,[Fi.commitCharacters]:e.commitCharacters?.join(""),[Fi.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(nh.from),[Fi.commandIdent]:r?.$ident,[Fi.commandId]:r?.id,[Fi.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Fi.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Fi.insertText]=e.insertText:e.insertText instanceof Q1&&(a[Fi.insertText]=e.insertText.value,a[Fi.insertTextRules]|=cp.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),rs.isRange(c)?a[Fi.range]=at.from(c):c&&(!i?.isEqual(c.inserting)||!s?.isEqual(c.replacing))&&(a[Fi.range]={insert:at.from(c.inserting),replace:at.from(c.replacing)}),a}}class J3{async provideInlineCompletions(e,t,i,s){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,s){}}class Gii extends J3{constructor(e,t,i,s){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this._isAdditionsProposedApiEnabled=Cd(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[Ub.Automatic]:p4.Automatic,[Ub.Explicit]:p4.Invoke}}get supportsHandleEvents(){return Cd(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:at.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},s);if(!a||s.isCancellationRequested)return;const c=Array.isArray(a)?a:a.items,l=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],d=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let h;return{pid:this._references.createReferenceId({dispose(){h?.dispose()},items:c}),items:c.map((f,p)=>{let m;f.command&&(h||(h=new Z),m=this._commands.toInternal(f.command,h));const v=f.insertText;return{insertText:typeof v=="string"?v:{snippet:v.value},filterText:f.filterText,range:f.range?at.from(f.range):void 0,command:m,idx:p,completeBracketPairs:this._isAdditionsProposedApiEnabled?f.completeBracketPairs:!1}}),commands:l.map(f=>(h||(h=new Z),this._commands.toInternal(f,h))),suppressSuggestions:!1,enableForwardStability:d}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const s=this._references.get(e)?.items[t];s&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(s,i)}handlePartialAccept(e,t,i,s){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,AIe.to(s)))}}class yme{async provideInlineEdits(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(s,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!o||i.isCancellationRequested)return;let r;const a=this._references.createReferenceId({dispose(){r?.dispose()},item:o});let c;o.accepted&&(r||(r=new Z),c=this._commands.toInternal(o.accepted,r));let l;return o.rejected&&(r||(r=new Z),l=this._commands.toInternal(o.rejected,r)),{pid:a,text:o.text,range:at.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,s){this._documents=t,this._provider=i,this._commands=s,this._references=new Wat,this.languageTriggerKindToVSCodeTriggerKind={[MU.Automatic]:wG.Automatic,[MU.Invoke]:wG.Invoke}}}class Wat{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class Sme{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("SignatureHelp")}async provideSignatureHelp(e,t,i,s){const o=this._documents.getDocument(e),r=Wr.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,s,a);if(c){const l=this._cache.add([c]);return{...DG.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=DG.to(e.activeSignatureHelp),s=this._cache.get(e.activeSignatureHelp.id,0);s?(t=s,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class AY{constructor(e,t,i,s,o){this._documents=e,this._commands=t,this._provider=i,this._logService=s,this._extension=o,this._cache=new F_("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const s=this._documents.getDocument(e),o=at.to(t),r=await this._provider.provideInlayHints(s,o,i);if(!Array.isArray(r)||r.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(r);this._disposables.set(a,new Z);const c={hints:[],cacheId:a};for(let l=0;li.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const s={label:"",cacheId:t,tooltip:Qs.fromStrict(e.tooltip),position:Wr.from(e.position),textEdits:e.textEdits&&e.textEdits.map(nh.from),kind:e.kind&&uoe.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")s.label=e.label;else{const o=[];s.label=o;for(const r of e.label){if(!r.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:r.value,tooltip:Qs.fromStrict(r.tooltip)};_p.isLocation(r.location)&&(a.location=P_.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return s}}class AI{constructor(e,t){this._documents=e,this._provider=t,this._cache=new F_("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(s)||s.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:s.filter(AI._validateLink).map(zM.from)};{const o=this._cache.add(s),r={links:[],cacheId:o};for(let a=0;a5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveDocumentLink(i,t);if(!(!s||!AI._validateLink(s)))return zM.from(s)}releaseLinks(e){this._cache.delete(e)}}class Ame{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentColors(i,t);return Array.isArray(s)?s.map(r=>({color:T4.from(r.color),range:at.from(r.range)})):[]}async provideColorPresentations(e,t,i){const s=this._documents.getDocument(e),o=at.to(t.range),r=T4.to(t.color),a=await this._provider.provideColorPresentations(r,{document:s,range:o},i);if(Array.isArray(a))return a.map(goe.from)}}class w6e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const s=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(s,t,i);if(Array.isArray(o))return o.map(poe.from)}}class b6e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const s=this._documents.getDocument(e),o=t.map(Wr.to),r=await this._provider.provideSelectionRanges(s,o,i);if(!mo(r))return[];if(r.length!==o.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let c=0;cthis._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideCallsTo(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(s,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>at.from(a))}))}async provideCallsFrom(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(s,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>at.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=KF.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class q5{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new yz(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),o=Wr.to(t),r=await this._provider.prepareTypeHierarchy(s,o,i);if(!r)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(r)?r.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,r)]}async provideSupertypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(s,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=$M.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class EY{constructor(e,t,i,s,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=o,this._cache=new F_("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,s,o){const r=this._documents.getDocument(t),a=Wr.to(i),c=rw.toDataTransfer(s,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(r,a,c,o);if(!l)return;const d=Kb(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(Bat,1,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:u.kind?.value,yieldTo:u.yieldTo?.map(p=>p.value),insertText:typeof u.insertText=="string"?u.insertText:{snippet:u.insertText.value},additionalEdit:u.additionalEdit?lf.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,s]=e,o=this._cache.get(i,s);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?lf.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class C6e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,s){const o=P.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:P.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>at.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,s);return l?lf.from(l):null}}class Q5{constructor(e,t){this.adapter=e,this.extension=t}}const Bl=class Bl{constructor(e,t,i,s,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=s,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Ue.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return D4.from(e,this._uriTransformer,t)}_createDisposable(e){return new oo(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Bl._handlePool++}async _withAdapter(e,t,i,s,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return s;const c=Date.now();r||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const l=i(a.adapter,a.extension);return Promise.resolve(l).catch(d=>{Na(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{r||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),qe.isCancellationToken(o)?qle(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new Q5(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,s){const o=this._addNewAdapter(new Nre(this._documents,i),e),r=s&&s.label||Bl._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,Nre,s=>s.provideDocumentSymbols(P.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new yY(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(s,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=oo.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,yY,s=>s.provideCodeLenses(P.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,yY,s=>s.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,yY,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const s=this._addNewAdapter(new r6e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDefinition(e,t,i,s){return this._withAdapter(e,r6e,o=>o.provideDefinition(P.revive(t),i,s),[],s)}registerDeclarationProvider(e,t,i){const s=this._addNewAdapter(new a6e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDeclaration(e,t,i,s){return this._withAdapter(e,a6e,o=>o.provideDeclaration(P.revive(t),i,s),[],s)}registerImplementationProvider(e,t,i){const s=this._addNewAdapter(new c6e(this._documents,i),e);return this._proxy.$registerImplementationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideImplementation(e,t,i,s){return this._withAdapter(e,c6e,o=>o.provideImplementation(P.revive(t),i,s),[],s)}registerTypeDefinitionProvider(e,t,i){const s=this._addNewAdapter(new l6e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideTypeDefinition(e,t,i,s){return this._withAdapter(e,l6e,o=>o.provideTypeDefinition(P.revive(t),i,s),[],s)}registerHoverProvider(e,t,i,s){const o=this._addNewAdapter(new B8(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,s,o){return this._withAdapter(e,B8,r=>r.provideHover(P.revive(t),i,s,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,B8,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,s){const o=this._addNewAdapter(new d6e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,s){return this._withAdapter(e,d6e,o=>o.provideEvaluatableExpression(P.revive(t),i,s),void 0,s)}registerInlineValuesProvider(e,t,i,s){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new h6e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(r,this._transformDocumentSelector(t,e),o);let a=this._createDisposable(r);if(o!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(o));a=oo.from(a,c)}return a}$provideInlineValues(e,t,i,s,o){return this._withAdapter(e,h6e,r=>r.provideInlineValues(P.revive(t),i,s,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new u6e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}registerMultiDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new g6e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentHighlights(e,t,i,s){return this._withAdapter(e,u6e,o=>o.provideDocumentHighlights(P.revive(t),i,s),void 0,s)}$provideMultiDocumentHighlights(e,t,i,s,o){return this._withAdapter(e,g6e,r=>r.provideMultiDocumentHighlights(P.revive(t),i,s.map(a=>P.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const s=this._addNewAdapter(new f6e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideLinkedEditingRanges(e,t,i,s){return this._withAdapter(e,f6e,async o=>{const r=await o.provideLinkedEditingRanges(P.revive(t),i,s);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Bl._serializeRegExp(r.wordPattern):void 0}},void 0,s)}registerReferenceProvider(e,t,i){const s=this._addNewAdapter(new p6e(this._documents,i),e);return this._proxy.$registerReferenceSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideReferences(e,t,i,s,o){return this._withAdapter(e,p6e,r=>r.provideReferences(P.revive(t),i,s,o),void 0,o)}registerCodeActionProvider(e,t,i,s){const o=new Z,r=this._addNewAdapter(new L2(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:s?.providedCodeActionKinds?.map(a=>a.value),documentation:s?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},Bl._extLabel(e),Bl._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,s,o){return this._withAdapter(e,L2,r=>r.provideCodeActions(P.revive(t),i,s,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,L2,s=>s.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,L2,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const s=this._addNewAdapter(new m6e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(s,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(s)}$provideDocumentFormattingEdits(e,t,i,s){return this._withAdapter(e,m6e,o=>o.provideDocumentFormattingEdits(P.revive(t),i,s),void 0,s)}registerDocumentRangeFormattingEditProvider(e,t,i){const s=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new bme(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,s),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,s,o){return this._withAdapter(e,bme,r=>r.provideDocumentRangeFormattingEdits(P.revive(t),i,s,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,s,o){return this._withAdapter(e,bme,r=>r.provideDocumentRangesFormattingEdits(P.revive(t),i,s,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,s){const o=this._addNewAdapter(new _6e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),s,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,s,o,r){return this._withAdapter(e,_6e,a=>a.provideOnTypeFormattingEdits(P.revive(t),i,s,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new SY(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,SY,s=>s.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,SY,s=>s.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,SY,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const s=this._addNewAdapter(new PR(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(s,this._transformDocumentSelector(t,e),PR.supportsResolving(i)),this._createDisposable(s)}$provideRenameEdits(e,t,i,s,o){return this._withAdapter(e,PR,r=>r.provideRenameEdits(P.revive(t),i,s,o),void 0,o)}$resolveRenameLocation(e,t,i,s){return this._withAdapter(e,PR,o=>o.resolveRenameLocation(P.revive(t),i,s),void 0,s)}registerNewSymbolNamesProvider(e,t,i){const s=this._addNewAdapter(new W8(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,W8,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,s,o){return this._withAdapter(e,W8,r=>r.provideNewSymbolNames(P.revive(t),i,s,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new Op(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=oo.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,s){return this._withAdapter(e,Op,o=>o.provideDocumentSemanticTokens(P.revive(t),i,s),null,s)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Op,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,s){const o=this._addNewAdapter(new v6e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),s),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,s){return this._withAdapter(e,v6e,o=>o.provideDocumentRangeSemanticTokens(P.revive(t),i,s),null,s)}registerCompletionItemProvider(e,t,i,s){const o=this._addNewAdapter(new $T(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),s,$T.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,s,o){return this._withAdapter(e,$T,r=>r.provideCompletionItems(P.revive(t),i,s,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,$T,s=>s.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,$T,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,s){const o=new Gii(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Cn.toKey(e.identifier.value),s?.yieldTo?.map(a=>Cn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,s,o){return this._withAdapter(e,J3,r=>r.provideInlineCompletions(P.revive(t),i,s,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,s){this._withAdapter(e,J3,async o=>{o.handleDidShowCompletionItem(t,i,s)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,s,o){this._withAdapter(e,J3,async r=>{r.handlePartialAccept(t,i,s,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,J3,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const s=new yme(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(s,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,s){return this._withAdapter(e,yme,o=>o.provideInlineEdits(P.revive(t),i,s),void 0,s)}$freeInlineEdit(e,t){this._withAdapter(e,yme,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,s){const o=Array.isArray(s)?{triggerCharacters:s,retriggerCharacters:[]}:s,r=this._addNewAdapter(new Sme(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,s,o){return this._withAdapter(e,Sme,r=>r.provideSignatureHelp(P.revive(t),i,s,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,Sme,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const s=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new AY(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",s,Bl._extLabel(e));let r=this._createDisposable(o);if(s!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(s));r=oo.from(r,a)}return r}$provideInlayHints(e,t,i,s){return this._withAdapter(e,AY,o=>o.provideInlayHints(P.revive(t),i,s),void 0,s)}$resolveInlayHint(e,t,i){return this._withAdapter(e,AY,s=>s.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,AY,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const s=this._addNewAdapter(new AI(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(s,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(s)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,AI,s=>s.provideLinks(P.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,AI,s=>s.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,AI,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const s=this._addNewAdapter(new Ame(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentColors(e,t,i){return this._withAdapter(e,Ame,s=>s.provideColors(P.revive(t),i),[],i)}$provideColorPresentations(e,t,i,s){return this._withAdapter(e,Ame,o=>o.provideColorPresentations(P.revive(t),i,s),void 0,s)}registerFoldingRangeProvider(e,t,i){const s=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(s,new Q5(new w6e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(s,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(s);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=oo.from(r,a)}return r}$provideFoldingRanges(e,t,i,s){return this._withAdapter(e,w6e,o=>o.provideFoldingRanges(P.revive(t),i,s),void 0,s)}registerSelectionRangeProvider(e,t,i){const s=this._addNewAdapter(new b6e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideSelectionRanges(e,t,i,s){return this._withAdapter(e,b6e,o=>o.provideSelectionRanges(P.revive(t),i,s),[],s)}registerCallHierarchyProvider(e,t,i){const s=this._addNewAdapter(new G5(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareCallHierarchy(e,t,i,s){return this._withAdapter(e,G5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideCallHierarchyIncomingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsTo(t,i,s),void 0,s)}$provideCallHierarchyOutgoingCalls(e,t,i,s){return this._withAdapter(e,G5,o=>o.provideCallsFrom(t,i,s),void 0,s)}$releaseCallHierarchy(e,t){this._withAdapter(e,G5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const s=this._addNewAdapter(new q5(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareTypeHierarchy(e,t,i,s){return this._withAdapter(e,q5,o=>Promise.resolve(o.prepareSession(P.revive(t),i,s)),void 0,s)}$provideTypeHierarchySupertypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSupertypes(t,i,s),void 0,s)}$provideTypeHierarchySubtypes(e,t,i,s){return this._withAdapter(e,q5,o=>o.provideSubtypes(t,i,s),void 0,s)}$releaseTypeHierarchy(e,t){this._withAdapter(e,q5,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new EY(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),Cd(e,"documentPaste")&&s?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:s.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,s,o,r){return this._withAdapter(e,EY,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,P.revive(i),s,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,EY,s=>s.resolveDropEdit(t,i),{},void 0)}$releaseDropEdits(e,t){this._withAdapter(e,EY,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const s=this._addNewAdapter(new C6e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideMappedEdits(e,t,i,s,o){return this._withAdapter(e,C6e,r=>Promise.resolve(r.provideMappedEdits(t,i,s,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,s){const o=this._nextHandle();return this._adapter.set(o,new Q5(new $5(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerPasteEditProvider(o,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:s.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:s.copyMimeTypes,pasteMimeTypes:s.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,s,o){return this._withAdapter(e,$5,r=>r.prepareDocumentPaste(P.revive(t),i,s,o),void 0,o)}$providePasteEdits(e,t,i,s,o,r,a){return this._withAdapter(e,$5,c=>c.providePasteEdits(t,P.revive(i),s,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,$5,s=>s.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,$5,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Bl._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Bl._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Bl._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Bl._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Bl._serializeRegExp(e.beforeText),afterText:e.afterText?Bl._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Bl._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Bl._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>UF.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Bl._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:s}=i;if(s&&KRe(s))throw new Error(`Invalid language configuration: wordPattern '${s}' is not allowed to match the empty string.`);s?this._documents.setWordDefinitionFor(t,s):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const o=this._nextHandle(),r={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Bl._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Bl._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Bl._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Bl._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(o,t,r),this._createDisposable(o)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Bl._handlePool=0;let MTe=Bl;class qii{constructor(e,t,i,s){this._documents=t,this._commands=i,this._uriTransformer=s,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Ue.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);const i=this._documents.getDocumentData(e);if(!i)throw new Error(`document '${e.toString()}' NOT found`);return i.document}async tokenAtPosition(e,t){const i=e.version,s=Wr.from(t),o=await this._proxy.$tokensAtPosition(e.uri,s),r={type:UE.Other,range:e.getWordRangeAtPosition(t)??new rs(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:at.to(o.range),type:Yke.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const s=this._handlePool++,o=this._proxy,r=this._ids,a=`${e.identifier.value}/${t}`;if(r.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);r.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:TM.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!r.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=PS(()=>{d.clear(),this._proxy.$setLanguageStatus(s,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:D4.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===TM.Error?nt.Error:c.severity===TM.Warning?nt.Warning:nt.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),o.$removeLanguageStatus(s),r.delete(a)},get id(){return c.id},get name(){return c.name},set name(f){c.name=f,h()},get selector(){return c.selector},set selector(f){c.selector=f,h()},get text(){return c.text},set text(f){c.text=f,h()},set text2(f){Je(e,"languageStatusText"),c.text=f,h()},get text2(){return Je(e,"languageStatusText"),c.text},get detail(){return c.detail},set detail(f){c.detail=f,h()},get severity(){return c.severity},set severity(f){c.severity=f,h()},get accessibilityInformation(){return c.accessibilityInformation},set accessibilityInformation(f){c.accessibilityInformation=f,h()},get command(){return c.command},set command(f){c.command=f,h()},get busy(){return c.busy},set busy(f){c.busy=f,h()}};return h(),u}}function Qii(n){return n&&n.title}let NTe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Ue.MainThreadMessageService)}showMessage(e,t,i,s,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof s=="string"||Qii(s)?a=[s,...o]:(r.modal=s?.modal,r.useCustom=s?.useCustom,r.detail=s?.detail,a=o),r.useCustom&&Je(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};NTe=D([_(1,Ze)],NTe);class Eme{constructor(e,t,i,s){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=s}asApiEvent(){return{range:new rS(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class PTe{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1}}constructor(e,t,i){this.notebook=e,this._extHostDocument=t,this._cellData=i,this.handle=i.handle,this.uri=P.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(Y1.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(M4.to(i.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){const e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw new Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);const i={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:kG.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(s){e._mime=s},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(i)}return this._apiCell}setOutputs(e){this._outputs=e.map(Y1.to)}setOutputItems(e,t,i){const s=i.map(N4.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...s),o.items.length>1&&o.items.every(r=>hot(r.mime)))){const r=new Map,a=[];o.items.forEach(c=>{let l;r.has(c.mime)?l=r.get(c.mime):(l=[],r.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),o.items.length=0,a.forEach(c=>{const l=p7t(r.get(c));o.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(M4.to(e))}setMime(e){}}const Sle=class Sle{constructor(e,t,i,s,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=s,this.handle=Sle._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=o.viewType,this._metadata=Object.freeze(o.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,o.cells]],!0,void 0),this._versionId=o.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){const e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===_e.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(i){return i=e._validateIndex(i),e._cells[i].apiCell},getCells(i){return(i?e._getCells(i):e._cells).map(o=>o.apiCell)},save(){return e._save()}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,i){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:i});const s={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===vd.ModelChange?this._spliceNotebookCells(a.changes,!1,s.contentChanges):a.kind===vd.Move?this._moveCells(a.index,a.length,a.newIdx,s.contentChanges):a.kind===vd.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===vd.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===vd.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===vd.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===vd.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===vd.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),o.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const r=new Map;for(let a=0;a=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,i=e.end|0;return t<0&&(t=0),i>this._cells.length&&(i=this._cells.length),e.with({start:t,end:i})}_getCells(e){e=this._validateRange(e);const t=[];for(let i=e.start;i{const l=a[2].map(u=>{const f=new PTe(this,this._textDocumentsAndEditors,u);return t||o.push(PTe.asModelAddData(u)),f}),d=new Eme(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)r.push(u.uri),d.deletedItems.push(u.apiCell);s.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of s)i.push(a.asApiEvent())}_moveCells(e,t,i,s){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new Eme(e,t,o.map(a=>a.apiCell),[]),new Eme(i,0,[],o)];for(const a of r)s.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,s){this._cells[e].setOutputItems(t,i,s)}_changeCellLanguage(e,t){const i=this._cells[e];i.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(i.uri,t)}_changeCellMime(e,t){const i=this._cells[e];i.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}};Sle._handlePool=0;let FTe=Sle;const Ale=class Ale{constructor(e,t,i,s,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=s,this._viewColumn=r}get apiEditor(){if(!this._editor){const e=this;this._editor={get notebook(){return e.notebookData.apiNotebook},get selection(){return e._selections[0]},set selection(t){this.selections=[t]},get selections(){return e._selections},set selections(t){if(!Array.isArray(t)||!t.every(rS.isNotebookRange))throw Hi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,ES.from(t),i??aG.Default)},get viewColumn(){return e._viewColumn}},Ale.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(ES.from))}_acceptViewColumn(e){this._viewColumn=e}};Ale.apiEditorsToExtHost=new WeakMap;let gq=Ale;class jii extends ${constructor(e,t,i){super(),this._source=e,this._inputTextBuffer=t,this._outputs=i,this._outputTextBuffers=void 0}_getFullModelRange(e){const t=e.getLineCount();return new O(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw new Error("Illegal value for lineNumber");return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){const e=new o7;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:s}=t.create(zb.LF);this._inputTextBuffer=i,this._register(s)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new o7;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:s,disposable:o}=i.create(zb.LF);return this._register(o),s})),this._outputTextBuffers}findInInputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();if(!i)return[];const s=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(s,i,!0,5e3)}findInOutputs(e){const i=new UA(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(s=>{const o=s.findMatchesLineByLine(this._getFullModelRange(s),i,!0,5e3);if(o.length!==0)return{textBuffer:s,matches:o}}).filter(s=>!!s):[]}}function y6e(n,e){let t=-1;const i=[];let s=[];return n.forEach(r=>{r.range.startLineNumber!==t&&s.length>0&&(i.push([...s]),s=[]),s.push(r),t=r.range.endLineNumber}),s.length>0&&i.push([...s]),i.map(r=>{const a=[],c=r[0].range.startLineNumber,l=r[r.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new Q8t(a.join(` `)+` -`,r.map(d=>new O(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const S6e="vs/workbench/api/common/extHostNotebook",oR=class oR{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,s,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=s,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new wi,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new I,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new I,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new I,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new I,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new F_("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Ue.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Ue.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Ue.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===Fs.NotebookCellActionContext){const l=c.notebookEditor?.notebookUri,d=c.cell.handle,u=this._documents.get(l)?.getCell(d);if(u)return u.apiCell}if(c&&c.$mid===Fs.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),oR._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(s=>voe.from(s)).filter(s=>s!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,exclusive:t.exclusive||!1}}registerNotebookCellStatusBarItemProvider(e,t,i){const s=oR._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?oR._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(s,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(s,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new oo(()=>{this._notebookStatusBarItemProviders.delete(s),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(s,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&ok.from(e.content)});return P.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),s=this._documents.get(P.revive(i));return ws(s?.apiNotebook)}async showNotebookDocument(e,t){P.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(ES.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const s=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=s&&this._editors.get(s)?.apiEditor;if(o)return o;throw s?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,s){const o=this._notebookStatusBarItemProviders.get(e),r=P.revive(t),a=this._documents.get(r);if(!a||!o)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await o.provideCellStatusBarItems(c.apiCell,s);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>gIe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,s,o){if(Xv(t))throw new Error("viewType cannot be empty or just whitespace");const r=this._handlePool++;return this._notebookSerializer.set(r,{viewType:t,serializer:i,options:s}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,pIe.from(s),oR._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.deserializeNotebook(t.buffer,i);return new $h(ok.from(o))}async $notebookToData(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.serializeNotebook(ok.to(t.value),i);return ze.wrap(o)}async $saveNotebook(e,t,i,s,o){const r=P.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${r.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(r);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(r.scheme))throw new Ah(g(S6e,0,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Xi.FILE_PERMISSION_DENIED);const l={metadata:YX(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new ej(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=YX(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,s),o.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,o);if(o.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${r.toString()}`),await this._extHostFileSystem.value.writeFile(r,d),this.trace(`Finished write versionId: ${i} ${r.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(r.scheme),u=await this._extHostFileSystem.value.stat(r),f={name:h.basename(r),isFile:(u.type&an.File)!==0,isDirectory:(u.type&an.Directory)!==0,isSymbolicLink:(u.type&an.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&vm.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&vm.Locked),etag:_ee({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,s,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new o1;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const w={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:z1.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(w,f,b=>{b.forEach(C=>{a.has(C)||s.some(S=>m.isFromSettings&&!S.isFromSettings?!1:S.filenamePatterns.some(M=>Wjt(M,C)))||a.add(C)})}).catch(b=>{if(b.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw b})}))))})(i,o,t);const l=new wi;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((w,b)=>w+b.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(b=>p.push({input:b.document.getText(),outputs:b.outputs.flatMap(C=>C.items.map(y=>y.data.toString()))}));else{const w=await this._extHostFileSystem.value.readFile(u),b=ze.fromString(w.toString()),C=await r.deserializeNotebook(b.buffer,o);if(o.isCancellationRequested)return;ok.from(C).cells.forEach(S=>p.push({input:S.source,outputs:S.outputs.flatMap(M=>M.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((w,b)=>{const C=t.contentPattern.pattern,y=new jii(w.input,void 0,w.outputs),S=y.findInInputs(C),M=y.findInOutputs(C),k=M.flatMap(F=>y6e(F.matches,F.textBuffer)).map((F,N)=>(F.webviewIndex=N,F));if(S.length>0||M.length>0){const F={index:b,contentResults:y6e(S,y.inputTextBuffer),webviewResults:k};f.push(F)}});const v={resource:u,cellResults:f};l.set(u,v);return}catch{return}});return await Promise.all(h),{limitHit:d,results:[...l.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==zv&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(s.apiNotebook));for(const o of this._editors.values())o.notebookData.uri.toString()===i.toString()&&this._editors.delete(o.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const s=P.revive(i.uri);if(this._documents.has(s))throw new Error(`adding EXISTING notebook ${s} `);const o=new FTe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,s,i);t.push(...i.cells.map(r=>PTe.asModelAddData(r))),this._documents.get(s)?.dispose(),this._documents.set(s,o),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(o.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=P.revive(t.documentUri),s=this._documents.get(i);s&&this._createExtHostEditor(s,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const s=t.has(i.id);i._acceptVisibility(s)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=Et.String.with("notebookType","A notebook type"),i=new Vn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new Et("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>ze.wrap(o))],new In("Notebook Data",o=>ok.to(o.value))),s=new Vn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new Et("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new $h(ok.from(o)))],new In("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(s)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};oR._notebookStatusBarItemProviderHandlePool=0;let OTe=oR;class Kii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._onWillSaveNotebookDocumentEvent=new EI}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,s)}}async $participateInSave(e,t,i){const s=P.revive(e),o=this._notebooksAndEditors.getNotebookDocument(s);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:foe.to(t)},i,async(c,l)=>{const d=Date.now(),h=await await Promise.resolve(c);Date.now()-d>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier),!i.isCancellationRequested&&h&&(h instanceof q1?r.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(r.length===0)return!0;const a={edits:[]};for(const c of r){const{edits:l}=lf.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(a))}}class Yii{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new I,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new I,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,s){const r=this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptModelChanged(t.value,i,s);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(P.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let BTe=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new I,this._onDidChangeNotebookEditorVisibleRanges=new I,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(ES.to)),t.selections&&i._acceptSelections(t.selections.selections.map(ES.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(yd.to(e[t]))}};BTe=D([_(0,Ze)],BTe);const Jii=100;let WTe=class{constructor(e,t,i,s,o){this._initData=t,this._extHostNotebook=i,this._commands=s,this._logService=o,this._activeExecutions=new wi,this._activeNotebookExecutions=new wi,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this._onDidChangeCellExecutionState=new I,this.onDidChangeNotebookCellExecutionState=this._onDidChangeCellExecutionState.event,this.id=0,this.variableStore={},this._proxy=e.getProxy(Ue.MainThreadNotebookKernels);const r=new Vn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new Et("options","Select kernel options",c=>!0,c=>{if(c&&"notebookEditor"in c&&"id"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);return{id:c.id,extension:c.extension,notebookEditorId:l}}else if(c&&"notebookEditor"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);if(l===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${c.notebookEditor.notebook.uri.toString()}`);return{notebookEditorId:l}}return c})],In.Void),a=new Vn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[Et.Uri],new In("A promise that resolves to an array of variables",(c,l)=>c.map(d=>({variable:{name:d.name,value:d.value,expression:d.expression,type:d.type,language:d.language},hasNamedChildren:d.hasNamedChildren,indexedChildrenCount:d.indexedChildrenCount}))));this._commands.registerApiCommand(r),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,s,o,r){for(const S of this._kernelData.values())if(S.controller.id===t&&Cn.equals(e.identifier,S.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,c=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const l=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`);let d=!1;const h=new I,u=new I,f={id:xY(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:s||e.identifier.value,preloads:r?r.map(woe.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(S=>{console.log(S),d=!0});let w=0;const b=()=>{if(d)return;const S=++w;Promise.resolve().then(()=>{S===w&&this._proxy.$updateKernel(a,f)})},C=new wi,y={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(S){f.label=S??e.displayName??e.name,b()},get detail(){return f.detail??""},set detail(S){f.detail=S,b()},get description(){return f.description??""},set description(S){f.description=S,b()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(S){f.supportedLanguages=S,b()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(S){f.supportsExecutionOrder=S,b()},get rendererScripts(){return f.preloads?f.preloads.map(woe.to):[]},get executeHandler(){return p},set executeHandler(S){p=S??l},get interruptHandler(){return m},set interruptHandler(S){m=S,f.supportsInterrupt=!!S,b()},set variableProvider(S){Je(e,"notebookVariableProvider"),v=S,f.hasVariableProvider=!!S,S?.onDidChangeVariables(M=>c._proxy.$variablesUpdated(M.uri)),b()},get variableProvider(){return v},createNotebookCellExecution(S){if(d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.notebook.uri.toString()}`);return c._createNotebookCellExecution(S,xY(e.identifier,this.id))},createNotebookExecution(S){if(Je(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.uri.toString()}`);return c._createNotebookExecution(S,xY(e.identifier,this.id))},dispose:()=>{d||(this._logService.trace(`NotebookController[${a}], DISPOSED`),d=!0,this._kernelData.delete(a),h.dispose(),u.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(S,M){M===cG.Hidden&&Je(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,S.uri,M)},onDidReceiveMessage:u.event,postMessage(S,M){return Je(e,"notebookMessaging"),c._proxy.$postMessage(a,M&&c._extHostNotebook.getIdByEditor(M),S)},asWebviewUri(S){return Je(e,"notebookMessaging"),O8(S,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:y,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:C}),y}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return xY(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,s=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),s._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const s=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?s:void 0,r=this;this._kernelSourceActionProviders.set(s,i),this._logService.trace(`NotebookKernelSourceActionProvider[${s}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(s,s,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(s),r._proxy.$removeKernelSourceActionProvider(s,s),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const s=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>fIe.from(r,this._commands.converter,s))}return[]}$acceptNotebookAssociation(e,t,i){const s=this._kernelData.get(e);if(s){const o=this._extHostNotebook.getNotebookDocument(P.revive(t));i?s.associatedNotebooks.set(o.uri,!0):s.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),s.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t)),r=[];for(const a of i){const c=o.getCell(a);c&&r.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,o.uri.toString(),r.length),await s.controller.executeHandler.call(s.controller,r,o.apiNotebook,s.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t));if(s.controller.interruptHandler)await s.controller.interruptHandler.call(s.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(s.controller.interruptHandler){const r=this._activeNotebookExecutions.get(o.uri);this._activeNotebookExecutions.delete(o.uri),i.length&&Array.isArray(r)&&r.length&&r.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,s,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(P.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(s!==void 0){if(h=this.variableStore[s],!h)return}else this.variableStore={};const u=o==="named"?lG.Named:lG.Indexed,f=d.provideVariables(l.apiNotebook,h,u,r,a);let p=0;for await(const m of f){if(a.isCancellationRequested)return;const v={id:this.id++,name:m.variable.name,value:m.variable.value,type:m.variable.type,interfaces:m.variable.interfaces,language:m.variable.language,expression:m.variable.expression,hasNamedChildren:m.hasNamedChildren,indexedChildrenCount:m.indexedChildrenCount,extensionId:c.extensionId.value};if(this.variableStore[v.id]=m.variable,this._proxy.$receiveVariable(t,v),p++>=Jii)return}}$acceptKernelMessageFromRenderer(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getEditorById(t);s.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(P.revive(e)).getCell(t);if(o){const r=i?uIe.to(i):qF.Idle;r!==void 0&&this._onDidChangeCellExecutionState.fire({cell:o.apiCell,state:r})}}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const s=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!s)throw new Error("invalid cell");if(this._activeExecutions.has(s.uri))throw new Error(`duplicate execution for ${s.uri}`);const o=new HTe(t,s,this._proxy);this._activeExecutions.set(s.uri,o);const r=o.onDidChangeState(()=>{o.state===hb.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(s.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),s=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(s)throw new Error(`duplicate cell execution for ${s.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new UTe(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===QA.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};WTe=D([_(4,Ze)],WTe);var hb;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(hb||(hb={}));const Ele=class Ele extends ${get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=Ele.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=hb.Init,this._tokenSource=this._register(new ai),this._collector=new Xii(10,s=>this.update(s)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new $h(t))}verifyStateForOutput(){if(this._state===hb.Init)throw new Error("Must call start before modifying cell output");if(this._state===hb.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=oG.ensureUniqueMimeTypes(t.items,!0);return i===t.items?Y1.from(t):Y1.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const s=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(Kb(e));return this.updateSoon({editType:CI.Output,cellHandle:s,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=oG.ensureUniqueMimeTypes(Kb(e),!0),this.updateSoon({editType:CI.OutputItems,items:e.map(N4.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:CI.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===hb.Resolved||e._state===hb.Started)throw new Error("Cannot call start again");e._state=hb.Started,e._onDidChangeState.fire(),e.update({editType:CI.ExecutionState,runStartTime:i})},end(i,s,o){if(e._state===hb.Resolved)throw new Error("Cannot call resolve twice");e._state=hb.Resolved,e._onDidChangeState.fire(),e._collector.flush();const r=o?{message:o.message,stack:o.stack,location:o?.location?{startLineNumber:o.location.start.line,startColumn:o.location.start.character,endLineNumber:o.location.end.line,endColumn:o.location.end.character}:void 0,uri:o.uri}:void 0;e._proxy.$completeExecution(e._handle,new $h({runEndTime:s,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!0)},replaceOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!1)},appendOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!0)},replaceOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!1)}})}};Ele.HANDLE=0;let HTe=Ele;var QA;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(QA||(QA={}));const xle=class xle extends ${get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=xle.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=QA.Init,this._tokenSource=this._register(new ai),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===QA.Resolved||this._state===QA.Started)throw new Error("Cannot call start again");this._state=QA.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===QA.Resolved)throw new Error("Cannot call resolve twice");this._state=QA.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};xle.HANDLE=0;let UTe=xle;class Xii{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new sd,this.startedTimer=Date.now(),Ta(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function xY(n,e){return`${n.value}/${e}`}class Zii{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Ue.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const s=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:s.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(s=>s.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(s,o,r)=>this.getOrCreateEmitterFor(t).event(s,o,r),postMessage:(s,o)=>{gq.apiEditorsToExtHost.has(s)&&([s,o]=[o,s]);const r=o&&gq.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,s)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new I({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class eni{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Ue.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Je(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),Ee(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,s){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,s)}async $readProfile(e,t,i){const s=this.handlers.get(e);if(!s)throw new Error(`Unknown handler with id: ${e}`);return s.readProfile(zt(t)?t:P.revive(t),i)}}class tni{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const s=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(s,{location:dIe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(er),this._withProgress(s,i,!!a)}_withProgress(e,t,i){let s;i&&(s=new ai,this._mapHandleToCancellationSource.set(e,s));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),s?.dispose()};let r;try{r=t(new VTe(this._proxy,e),i&&s?s.token:qe.None)}catch(a){throw o(e),a}return r.then(a=>o(e),a=>o(e)),r}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function ini(n,e){return n.message=e.message,typeof e.increment=="number"&&(typeof n.increment=="number"?n.increment+=e.increment:n.increment=e.increment),n}class VTe extends cf{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}VTe.__decorator=D([bxt(100,(n,e)=>ini(n,e),()=>Object.create(null))],VTe.prototype,"throttledReport",null);const Dle=class Dle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const s=P.revive(t),o=this.providers.get(e);return o?Zu(()=>o.provideOriginalResource(s,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,s){const o=Dle.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,D4.from(e,this.uriTransformer),i,s),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};Dle.handlePool=0;let zTe=Dle;function nni(n,e,t){const i=n.getProxy(Ue.MainThreadQuickOpen);class s{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,w=qe.None){this._onDidSelectItem=void 0;const b=Promise.resolve(m),C=++this._instances,y=i.$show(C,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},w),S={},M=y.then(()=>S);return Promise.race([M,b]).then(k=>{if(k===S)return;const F=Cd(p,"quickPickItemTooltip");return b.then(N=>{const z=[];for(let U=0;U{v.onDidSelectItem(N[U])}),i.$setItems(C,z),y.then(U=>{if(typeof U=="number")return N[U];if(Array.isArray(U))return U.map(J=>N[J])})})}).then(void 0,k=>{if(!Na(k))return i.$setError(C,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=qe.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Na(v))return Promise.reject(v)})}async $validateInput(p){if(!this._validateInput)return;const m=await this._validateInput(p);if(!m||typeof m=="string")return m;let v;switch(m.severity){case BM.Info:v=nt.Info;break;case BM.Warning:v=nt.Warning;break;case BM.Error:v=nt.Error;break;default:v=m.message?nt.Error:nt.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=qe.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const w=await this._workspace.getWorkspaceFolders2();if(w)return w.find(b=>b.uri.toString()===v.uri.toString())}createQuickPick(p){const m=new d(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}createInputBox(p){const m=new h(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}$onDidChangeValue(p,m){this._sessions.get(p)?._fireDidChangeValue(m)}$onDidAccept(p){this._sessions.get(p)?._fireDidAccept()}$onDidChangeActive(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeActive(m)}$onDidChangeSelection(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeSelection(m)}$onDidTriggerButton(p,m){this._sessions.get(p)?._fireDidTriggerButton(m)}$onDidTriggerItemButton(p,m,v){const w=this._sessions.get(p);w instanceof d&&w._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extensionId=p,this._onDidDispose=m,this._id=d._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new I,this._onDidChangeValueEmitter=new I,this._onDidTriggerButtonEmitter=new I,this._onDidHideEmitter=new I,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(p){this._title=p,this.update({title:p})}get step(){return this._steps}set step(p){this._steps=p,this.update({step:p})}get totalSteps(){return this._totalSteps}set totalSteps(p){this._totalSteps=p,this.update({totalSteps:p})}get enabled(){return this._enabled}set enabled(p){this._enabled=p,this.update({enabled:p})}get busy(){return this._busy}set busy(p){this._busy=p,this.update({busy:p})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(p){this._ignoreFocusOut=p,this.update({ignoreFocusOut:p})}get value(){return this._value}set value(p){this._value=p,this.update({value:p})}get placeholder(){return this._placeholder}set placeholder(p){this._placeholder=p,this.update({placeholder:p})}get buttons(){return this._buttons}set buttons(p){this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((m,v)=>{const w=m===v4.Back?-1:v;this._handlesToButtons.set(w,m)}),this.update({buttons:p.map((m,v)=>({...l(m.iconPath),tooltip:m.tooltip,handle:m===v4.Back?-1:v}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(p){this._value=p,this._onDidChangeValueEmitter.fire(p)}_fireDidTriggerButton(p){const m=this._handlesToButtons.get(p);m&&this._onDidTriggerButtonEmitter.fire(m)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=St(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(p){if(!this._disposed){for(const m of Object.keys(p)){const v=p[m];this._pendingUpdate[m]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};u._nextId=1;let o=u;function r(f){if(f instanceof fg)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?P.file(p):p,light:typeof m=="string"?P.file(m):m}}function a(f){return typeof f=="object"&&"light"in f?f.light:f}function c(f){return typeof f=="object"&&"dark"in f?f.dark:f}function l(f){const p=r(f);let m,v;return"id"in p?v=$e.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p.identifier,m),this.extension=p,this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new I,this._selectedItems=[],this._onDidChangeSelectionEmitter=new I,this._onDidTriggerItemButtonEmitter=new I,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(p){this._items=p.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),p.forEach((w,b)=>{this._handlesToItems.set(b,w),this._itemsToHandles.set(w,b)});const m=Cd(this.extension,"quickPickItemTooltip"),v=[];for(let w=0;w({...l(y.iconPath),tooltip:y.tooltip,handle:S}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(p){this._canSelectMany=p,this.update({canSelectMany:p})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(p){this._matchOnDescription=p,this.update({matchOnDescription:p})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(p){this._matchOnDetail=p,this.update({matchOnDetail:p})}get sortByLabel(){return this._sortByLabel}set sortByLabel(p){this._sortByLabel=p,this.update({sortByLabel:p})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(p){this._keepScrollPosition=p,this.update({keepScrollPosition:p})}get activeItems(){return this._activeItems}set activeItems(p){this._activeItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({activeItems:this._activeItems.map(m=>this._itemsToHandles.get(m))})}get selectedItems(){return this._selectedItems}set selectedItems(p){this._selectedItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({selectedItems:this._selectedItems.map(m=>this._itemsToHandles.get(m))})}_fireDidChangeActive(p){const m=Ui(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Ui(p.map(v=>this._handlesToItems.get(v)));this._selectedItems=m,this._onDidChangeSelectionEmitter.fire(m)}_fireDidTriggerItemButton(p,m){const v=this._handlesToItems.get(p);if(!v||!v.buttons||!v.buttons.length)return;const w=v.buttons[m];w&&this._onDidTriggerItemButtonEmitter.fire({button:w,item:v})}}class h extends o{constructor(p,m){super(p.identifier,m),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(p){this._password=p,this.update({password:p})}get prompt(){return this._prompt}set prompt(p){this._prompt=p,this.update({prompt:p})}get valueSelection(){return this._valueSelection}set valueSelection(p){this._valueSelection=p,this.update({valueSelection:p})}get validationMessage(){return this._validationMessage}set validationMessage(p){this._validationMessage=p,p?typeof p=="string"?this.update({validationMessage:p,severity:nt.Error}):this.update({validationMessage:p.message,severity:p.severity??nt.Error}):this.update({validationMessage:void 0,severity:nt.Ignore})}}return new s(e,t)}var $Te;function A6e(n){return n instanceof P}function sni(n,e){return n.scheme===_e.file&&e.scheme===_e.file&&jr?n.toString()===e.toString():n.toString().toLowerCase()===e.toString().toLowerCase()}function xme(n){if(n)return typeof n.iconPath=="string"?P.file(n.iconPath):P.isUri(n.iconPath)||$e.isThemeIcon(n.iconPath)?n.iconPath:void 0}function E6e(n){if(n.icon){if(P.isUri(n.icon))return n.icon;if($e.isThemeIcon(n.icon))return n.icon;{const e=n.icon;return{light:e.light,dark:e.dark}}}else return}function Dme(n,e){if(!n.iconPath&&!e.iconPath)return 0;if(n.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof n.iconPath=="string"?n.iconPath:P.isUri(n.iconPath)?n.iconPath.fsPath:n.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:P.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return yJ(t,i)}function oni(n,e){let t=0;if(n.strikeThrough!==e.strikeThrough)return n.strikeThrough?1:-1;if(n.faded!==e.faded)return n.faded?1:-1;if(n.tooltip!==e.tooltip)return(n.tooltip||"").localeCompare(e.tooltip||"");if(t=Dme(n,e),t!==0)return t;if(n.light&&e.light)t=Dme(n.light,e.light);else{if(n.light)return 1;if(e.light)return-1}if(t!==0)return t;if(n.dark&&e.dark)t=Dme(n.dark,e.dark);else{if(n.dark)return 1;if(e.dark)return-1}return t}function rni(n,e){if(n.command!==e.command)return n.commandse(this,hy).$setInputBoxValue(this._sourceControlHandle,e)),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this._sequencer.queue(async()=>se(this,hy).$setInputBoxPlaceholder(this._sourceControlHandle,e)),this._placeholder=e}get validateInput(){return Je(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if(Je(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this._sequencer.queue(async()=>se(this,hy).$setValidationProviderIsEnabled(this._sourceControlHandle,!!e))}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxEnablement(this._sourceControlHandle,e)))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxVisibility(this._sourceControlHandle,e)))}get document(){return Je(this._extension,"scmTextDocument"),se(this,kq).getDocument(this._documentUri)}showValidationMessage(e,t){Je(this._extension,"scmValidation"),this._sequencer.queue(async()=>se(this,hy).$showValidationMessage(this._sourceControlHandle,e,t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}}hy=new WeakMap,kq=new WeakMap;const kle=class kle{get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._sequencer.queue(async()=>this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e))}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._sequencer.queue(async()=>this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features))}get features(){return{hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(e,t,i,s,o,r,a,c){this._proxy=e,this._commands=t,this._sequencer=i,this._sourceControlHandle=s,this._id=o,this._label=r,this.multiDiffEditorEnableViewChanges=a,this._extension=c,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new I,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._hideWhenEmpty=void 0,this.handle=kle._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){const i=this._resourceStatesCommandsMap.get(e);return i?Zu(()=>this._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(x6e),i=PRe(this._resourceSnapshot,e,x6e).map(r=>{const a=r.toInsert.map(c=>{const l=this._resourceHandlePool++;this._resourceStatesMap.set(l,c);const d=c.resourceUri;let h;if(c.command)if(c.command.command==="vscode.open"||c.command.command==="vscode.diff"||c.command.command==="vscode.changes"){const F=new Z;h=this._commands.converter.toInternal(c.command,F),this._resourceStatesDisposablesMap.set(l,F)}else this._resourceStatesCommandsMap.set(l,c.command);const u=Cd(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=xme(c.decorations),v=c.decorations&&xme(c.decorations.light)||m,w=c.decorations&&xme(c.decorations.dark)||m,b=[v,w],C=c.decorations&&c.decorations.tooltip||"",y=c.decorations&&!!c.decorations.strikeThrough,S=c.decorations&&!!c.decorations.faded,M=c.contextValue||"";return{rawResource:[l,d,b,C,y,S,M,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),s=i.map(({start:r,deleteCount:a,toInsert:c})=>[r,a,c.map(l=>l.rawResource)]),o=i.reverse();for(const{start:r,deleteCount:a,toInsert:c}of o){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(r,a,...l);for(const h of d)this._resourceStatesMap.delete(h),this._resourceStatesCommandsMap.delete(h),this._resourceStatesDisposablesMap.get(h)?.dispose(),this._resourceStatesDisposablesMap.delete(h)}return this._resourceSnapshot=e,s}dispose(){this._disposed=!0,this._onDidDispose.fire()}};kle._handlePool=0;let GTe=kle;var Ch;const Ile=class Ile{constructor(e,t,i,s,o,r,a){kt(this,Ch);this._extension=e,this._commands=s,this._id=o,this._label=r,this._rootUri=a,this._sequencer=new Yht,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new Dn,this._commitTemplate=void 0,this._acceptInputDisposables=new Dn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new Dn,this._statusBarDisposables=new Dn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=Ile._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,st(this,Ch,i);const c=P.from({scheme:_e.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._sequencer.queue(()=>se(this,Ch).$registerSourceControl(this.handle,o,r,a,c)),this._inputBox=new dni(e,t,se(this,Ch),this._sequencer,this.handle,c)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{count:e})))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Cd(this._extension,"quickDiffProvider")&&(t=e?.label),this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t}))}get historyProvider(){return Je(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Je(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasHistoryProvider:!!e})),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,this._sequencer.queue(async()=>se(this,Ch).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup))}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{commitTemplate:e})))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new Z,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{acceptInputCommand:t}))}get actionButton(){return Je(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Je(this._extension,"scmActionButton"),this._actionButtonDisposables.value=new Z,this._actionButton=e;const t=e!==void 0?{command:this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),secondaryCommands:e.secondaryCommands?.map(i=>i.map(s=>this._commands.converter.toInternal(s,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{actionButton:t??null}))}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&lni(this._statusBarCommands,e))return;this._statusBarDisposables.value=new Z,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{statusBarCommands:t}))}get selected(){return this._selected}createResourceGroup(e,t,i){const s=Cd(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new GTe(se(this,Ch),this._commands,this._sequencer,this.handle,e,t,s,this._extension),r=T.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,s]of this.createdResourceGroups){s.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});T.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),this._sequencer.queue(async()=>se(this,Ch).$unregisterGroup(this.handle,i.handle))}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const r=i._takeResourceStateSnapshot();r.length>0&&t.push([i.handle,r]),this._groups.set(i.handle,i)}this._sequencer.queue(async()=>se(this,Ch).$registerGroups(this.handle,e,t)),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&this._sequencer.queue(async()=>se(this,Ch).$spliceResourceStates(this.handle,e)),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this._sequencer.queue(async()=>se(this,Ch).$unregisterSourceControl(this.handle))}};Ch=new WeakMap,Ile._handlePool=0;let eO=Ile;eO.__decorator=D([kNe(100)],eO.prototype,"eventuallyAddResourceGroups",null);eO.__decorator=D([kNe(100)],eO.prototype,"eventuallyUpdateResourceStates",null);var eF;let qTe=(eF=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,s){this._commands=t,this._extHostDocuments=i,this.logService=s,this._sourceControls=new Map,this._sourceControlsByExtension=new $a,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Ue.MainThreadSCM),this._telemetry=e.getProxy(Ue.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===Fs.ScmResource){const r=this._sourceControls.get(o.sourceControlHandle);if(!r)return o;const a=r.getResourceGroup(o.groupHandle);return a?a.getResourceState(o.handle):o}else if(o&&o.$mid===Fs.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===Fs.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,s){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,s),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=$Te._handlePool++,r=new eO(e,this._extHostDocuments,this._proxy,this._commands,t,i,s);this._sourceControls.set(o,r);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(r),this._sourceControlsByExtension.set(e.identifier,a),r}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const s=P.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,s.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Zu(()=>o.quickDiffProvider.provideOriginalResource(s,i)).then(r=>r||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,s){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const o=this._sourceControls.get(e);if(!o)return Promise.resolve(void 0);const r=o.getResourceGroup(t);return r?r.$executeResourceCommand(i,s):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const s=this._sourceControls.get(e);return!s||!s.inputBox.validateInput?Promise.resolve(void 0):Zu(()=>s.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Qs.fromStrict(o.message);return r?Promise.resolve([r,o.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemGroupCommonAncestor(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,s)??void 0}async $provideHistoryItems(e,t,i,s){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,s))?.map(a=>({...a,icon:E6e(a)}))??void 0}async $provideHistoryItemSummary(e,t,i,s){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,s);return r?{...r,icon:E6e(r)}:void 0}async $provideHistoryItemChanges(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,s)??void 0}},$Te=eF,eF._handlePool=0,eF);qTe=$Te=D([_(3,Ze)],qTe);const Lle=class Lle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:at.to(t.selection),resourceUri:P.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=Lle.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,D4.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};Lle.handlePool=0;let QTe=Lle;const Tle=class Tle{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Ue.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideSpeechToTextSession(r.token,i?{language:i}:void 0);a&&(o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideTextToSpeechSession(r.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const s=new Z,o=new ai;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(s.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),s.add(o.token.onCancellationRequested(()=>s.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const s=Tle.ID_POOL++;return this.providers.set(s,i),this.proxy.$registerProvider(s,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(s),this.providers.delete(s)})}};Tle.ID_POOL=1;let jTe=Tle;const Hat="vs/workbench/api/common/extHostStatusBar";var YH,JH;const rR=class rR{constructor(e,t,i,s,o,r=HE.Left,a){kt(this,YH);kt(this,JH);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,st(this,YH,e),st(this,JH,t),o&&s){this._entryId=S7t(s.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?HE.Left:HE.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(rR.ID_GEN++);this._extension=s,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(jc(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!rR.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new Z,typeof e=="string"?this._command={fromApi:e,internal:se(this,JH).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:se(this,JH).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,se(this,YH).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=g(Hat,0,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=rR.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const s=Qs.fromStrict(this._tooltip);se(this,YH).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,s,this._command?.internal,i,this._backgroundColor,this._alignment===HE.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};YH=new WeakMap,JH=new WeakMap,rR.ID_GEN=0,rR.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new g4("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new g4("statusBarItem.warningForeground")]]);let KTe=rR;class hni{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",HE.Left,Number.MIN_VALUE),this._item.name=g(Hat,1,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new oo(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class uni{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Ue.MainThreadStatusBar),this._commands=t,this._statusMessage=new hni(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,s){return new KTe(this._proxy,this._commands,this._existingItems,e,t,i,s)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let s;return typeof t=="number"?s=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new oo(()=>{i.dispose(),clearTimeout(s)})}}const ly="vs/workbench/contrib/testing/common/constants";var D6e;(function(n){n.ViewletId="workbench.view.extension.test",n.ExplorerViewId="workbench.view.testing",n.OutputPeekContributionId="editor.contrib.testingOutputPeek",n.DecorationsContributionId="editor.contrib.testingDecorations",n.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",n.CoverageViewId="workbench.view.testCoverage",n.ResultsPanelId="workbench.panel.testResults",n.ResultsViewId="workbench.panel.testResults.view",n.MessageLanguageId="vscodeInternalTestMessage"})(D6e||(D6e={}));var k6e;(function(n){n.List="list",n.Tree="true"})(k6e||(k6e={}));var I6e;(function(n){n.ByLocation="location",n.ByStatus="status",n.ByDuration="duration"})(I6e||(I6e={}));Xn.Errored+"",g(ly,0,"Errored"),Xn.Failed+"",g(ly,1,"Failed"),Xn.Passed+"",g(ly,2,"Passed"),Xn.Queued+"",g(ly,3,"Queued"),Xn.Running+"",g(ly,4,"Running"),Xn.Skipped+"",g(ly,5,"Skipped"),Xn.Unset+"",g(ly,6,"Not yet run");Yu.Debug+"",g(ly,8,"Debug"),Yu.Run+"",g(ly,9,"Run"),Yu.Coverage+"",g(ly,10,"Coverage");var YTe;(function(n){n.CancelTestRefreshAction="testing.cancelTestRefresh",n.CancelTestRunAction="testing.cancelRun",n.ClearTestResultsAction="testing.clearTestResults",n.CollapseAllAction="testing.collapseAll",n.ConfigureTestProfilesAction="testing.configureProfile",n.ContinousRunUsingForTest="testing.continuousRunUsingForTest",n.CoverageAtCursor="testing.coverageAtCursor",n.CoverageByUri="testing.coverage.uri",n.CoverageClear="testing.coverage.close",n.CoverageCurrentFile="testing.coverageCurrentFile",n.CoverageFilterToTest="testing.coverageFilterToTest",n.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",n.CoverageLastRun="testing.coverageLastRun",n.CoverageSelectedAction="testing.coverageSelected",n.CoverageToggleToolbar="testing.coverageToggleToolbar",n.CoverageViewChangeSorting="testing.coverageViewChangeSorting",n.DebugAction="testing.debug",n.DebugAllAction="testing.debugAll",n.DebugAtCursor="testing.debugAtCursor",n.DebugByUri="testing.debug.uri",n.DebugCurrentFile="testing.debugCurrentFile",n.DebugFailedTests="testing.debugFailTests",n.DebugLastRun="testing.debugLastRun",n.DebugSelectedAction="testing.debugSelected",n.FilterAction="workbench.actions.treeView.testExplorer.filter",n.GetExplorerSelection="_testing.getExplorerSelection",n.GetSelectedProfiles="testing.getSelectedProfiles",n.GoToTest="testing.editFocusedTest",n.HideTestAction="testing.hideTest",n.OpenCoverage="testing.openCoverage",n.OpenOutputPeek="testing.openOutputPeek",n.RefreshTestsAction="testing.refreshTests",n.ReRunFailedTests="testing.reRunFailTests",n.ReRunLastRun="testing.reRunLastRun",n.RunAction="testing.run",n.RunAllAction="testing.runAll",n.RunAllWithCoverageAction="testing.coverageAll",n.RunAtCursor="testing.runAtCursor",n.RunByUri="testing.run.uri",n.RunCurrentFile="testing.runCurrentFile",n.RunSelectedAction="testing.runSelected",n.RunUsingProfileAction="testing.runUsing",n.RunWithCoverageAction="testing.coverage",n.SearchForTestExtension="testing.searchForTestExtension",n.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",n.ShowMostRecentOutputAction="testing.showMostRecentOutput",n.StartContinousRun="testing.startContinuousRun",n.StopContinousRun="testing.stopContinuousRun",n.TestingSortByDurationAction="testing.sortByDuration",n.TestingSortByLocationAction="testing.sortByLocation",n.TestingSortByStatusAction="testing.sortByStatus",n.TestingViewAsListAction="testing.viewAsList",n.TestingViewAsTreeAction="testing.viewAsTree",n.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",n.ToggleInlineTestOutput="testing.toggleInlineTestOutput",n.UnhideAllTestsAction="testing.unhideAllTests",n.UnhideTestAction="testing.unhideTest"})(YTe||(YTe={}));let gni=0;const L6e=new WeakMap;let JTe=class extends ${constructor(e,t,i,s){super(),this.logService=t,this.commands=i,this.editors=s,this.resultsChangedEmitter=this._register(new I),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new I),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(Ue.MainThreadTesting),this.observer=new wni(this.proxy),this.runTracker=new mni(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case Fs.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(bn.root(a))?.collection.tree.get(a)?.actual??q7e(o)}case Fs.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(bn.root(c))?.collection.tree.get(c)?.actual??q7e({$mid:Fs.TestItemContext,tests:[r]}),message:P4.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(YTe.GetExplorerSelection),r=a=>{const c=this.controllers.get(bn.root(a));if(c)return bn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(yl)||[],exclude:o?.exclude.map(r).filter(yl)||[]}})}createTestController(e,t,i,s){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const o=new Z,r=o.add(new Ati(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d={items:r.root.children,get label(){return i},set label(u){i=u,r.root.label=u,l.$updateController(t,{label:i})},get refreshHandler(){return s},set refreshHandler(u){s=u,l.$updateController(t,{canRefresh:!!u})},get id(){return t},createRunProfile:(u,f,p,m,v,w)=>{let b=Ed(u);for(;a.has(b);)b++;return new Vat(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,b,u,f,p,m,v,w)},createTestItem(u,f,p){return new MO(t,u,f,p)},createTestRun:(u,f,p=!0)=>this.runTracker.createTestRun(e,t,r,u,f,p),invalidateTestResults:u=>{if(u===void 0)this.proxy.$markTestRetired(void 0);else{const f=u instanceof Array?u:[u];this.proxy.$markTestRetired(f.map(p=>bn.fromExtHostTestItem(p,t).toString()))}},set resolveHandler(u){r.resolveHandler=u},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}};l.$registerTestController(t,i,!!s),o.add(Ee(()=>l.$unregisterTestController(t)));const h={controller:d,collection:r,profiles:a,extension:e,activeProfiles:c};return this.controllers.set(t,h),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(u=>l.$publishDiff(t,u.map(x4.serialize)))),d}createTestObserver(){return this.observer.checkout()}async runTests(e,t=qe.None){const i=Uat(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const s=this.controllers.get(i.controllerId);if(!s)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,targets:[{testIds:e.include?.map(o=>bn.fromExtHostTestItem(o,s.collection.root.id).toString())??[s.collection.root.id],profileGroup:sBe[i.kind],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(o=>o.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t){return(await this.runTracker.getCoverageDetails(e,t))?.map(boe.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){const t=new Map;for(const[i,s]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=s.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!s.includes(l));for(const l of a)r.set(l,!0),o.activeProfiles.add(l);for(const l of c)r.set(l,!1),o.activeProfiles.delete(l);r.size&&t.set(i,r)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(t=>{const i=mIe.to(t);return L6e.set(i,t.id),i}).concat(this.results).sort((t,i)=>i.completedAt-t.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){const i=this.controllers.get(bn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>x4.deserialize({asCanonicalUri:i=>i},t)))}async $runControllerTests(e,t){return Promise.all(e.map(i=>this.runControllerTestRequest(i,!1,t)))}async $startContinuousRun(e,t){const i=new ai(t),s=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!s.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),s}async $provideTestFollowups(e,t){const i=this.results.find(r=>L6e.get(r)===e.resultId),s=i&&bni(bn.fromString(e.extId),i?.results);if(!s)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,s,e.taskIndex,e.messageIndex,t);a&&(o=o.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:o.map(r=>{const a=gni++;return this.testFollowups.set(a,r),{title:r.title,id:a}})}$disposeTestFollowups(e){for(const t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){const t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}async runControllerTestRequest(e,t,i){const s=this.controllers.get(e.controllerId);if(!s)return{};const{collection:o,profiles:r,extension:a}=s,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(yl),d=e.excludeExtIds.map(f=>s.collection.tree.get(f)).filter(yl).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===lb.IsChild));if(!l.length)return{};const h=new hG(l.some(f=>f.actual instanceof jOe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=Zjt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,fq.fromInternal(e,s.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await T.toPromise(u.onEnd)}}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}};JTe=D([_(0,gr),_(1,Ze)],JTe);const fni=1e4;var lk;(function(n){n[n.Running=0]="Running",n[n.Cancelling=1]="Cancelling",n[n.Ended=2]="Ended"})(lk||(lk={}));class pni extends ${get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,s,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=s,this.extension=o,this.state=lk.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new I),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new ai(r));const a=this._register(new yn(()=>this.forciblyEndTasks(),fni));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}cancel(){this.state===lk.Running?(this.cts.cancel(),this.state=lk.Cancelling):this.state===lk.Cancelling&&this.forciblyEndTasks()}getCoverageDetails(e,t){const[,i]=bn.fromString(e).path,s=this.publishedCoverage.get(e);if(!s)return[];const o=this.tasks.get(i);if(!o)throw new Error("unreachable: run task was not found");return this.profile?.loadDetailedCoverage?.(o.run,s,t)??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,s=Dr(),o=d=>(h,...u)=>{if(a){this.logService.warn(`Setting the state of test "${h.id}" is a no-op after the run ends.`);return}this.dto.isIncluded(h)&&(this.ensureTestIsKnown(h),d(h,...u))},r=(d,h)=>{const u=h instanceof Array?h.map(P4.from):[P4.from(h)];if(d.uri&&d.range){const f={range:at.from(d.range),uri:d.uri};for(const p of u)p.location=p.location||f}this.proxy.$appendTestMessagesInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),u)};let a=!1;const c=new Map,l={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:d=>{if(a)return;const h=d instanceof uG?d.testItem:void 0;let u;if(h){if(Je(this.extension,"attributableCoverage"),!this.dto.isIncluded(h))throw new Error("Attempted to `addCoverage` for a test item not included in the run");this.ensureTestIsKnown(h),u=c.get(h),u===void 0&&(u=c.size,c.set(h,u))}const f=d.uri.toString(),p=new bn(u!==void 0?[t,s,f,String(u)]:[t,s,f]).toString();this.publishedCoverage.set(p,d),this.proxy.$appendCoverage(t,s,boe.fromFile(i,p,d))},enqueued:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Queued)}),skipped:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Skipped)}),started:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Running)}),errored:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Errored,u)}),failed:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Failed,u)}),passed:o((d,h)=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,this.dto.controllerId).toString(),Xn.Passed,h)}),appendOutput:(d,h,u)=>{a||(u&&(this.dto.isIncluded(u)?this.ensureTestIsKnown(u):u=void 0),this.proxy.$appendOutputToRun(t,s,ze.fromString(d),h&&P_.from(h),u&&bn.fromExtHostTestItem(u,i).toString()))},end:()=>{a||(a=!0,c.clear(),this.proxy.$finishedTestRunTask(t,s),--this.running||this.markEnded())}};return this.running++,this.tasks.set(s,{run:l}),this.proxy.$startedTestRunTask(t,{id:s,name:e,running:!0}),l}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==lk.Ended&&(this.state=lk.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof MO))throw new eoe(e.id);if(this.sharedTestIds.has(bn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const s=J1.from(e);if(t.unshift(s),this.sharedTestIds.has(s.extId)||(this.sharedTestIds.add(s.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class mni{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t){const i=bn.root(e);return this.trackedById.get(i)?.getCoverageDetails(e,t)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(const[t,{id:i}]of this.tracked)i===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,i,s,o){return this.getTracker(t,i,s,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,s,o,r){const a=this.tracked.get(s);if(a)return a.createRun(o);const c=fq.fromPublic(t,i,s,r),l=Uat(s);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!s.continuous,profile:l&&{group:sBe[l.kind],id:l.profileId},exclude:s.exclude?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:s.include?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:s.preserveFocus??!0,persist:r});const d=this.getTracker(s,c,s.profile,e);return T.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,s,o){const r=new pni(t,this.proxy,this.logService,i,s,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const Uat=n=>{if(n.profile){if(!(n.profile instanceof Vat))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return n.profile}};class fq{static fromPublic(e,t,i,s){return new fq(e,Dr(),i.include?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[e],i.exclude?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[],s,t)}static fromInternal(e,t){return new fq(e.controllerId,e.runId,e.testIds,e.excludeExtIds,!0,t)}constructor(e,t,i,s,o,r){this.controllerId=e,this.id=t,this.isPersisted=o,this.colllection=r,this.includePrefix=i.map(a=>a+qf.Delimiter),this.excludePrefix=s.map(a=>a+qf.Delimiter)}isIncluded(e){const t=bn.fromExtHostTestItem(e,this.controllerId).toString()+qf.Delimiter;for(const i of this.excludePrefix)if(t===i||t.startsWith(i))return!1;for(const i of this.includePrefix)if(t===i||t.startsWith(i))return!0;return!1}}class _ni{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,J1.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.has(e)){this.added.delete(e);return}this.updated.delete(e);const t=bn.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){const{added:e,updated:t,removed:i}=this;return{get added(){return[...e].map(s=>s.revived)},get updated(){return[...t].map(s=>s.revived)},get removed(){return[...i].map(s=>s.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class vni extends tKt{constructor(){super(...arguments),this.changeEmitter=new I,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:J1.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new _ni(this.changeEmitter)}}class wni{constructor(e){this.proxy=e}checkout(){this.current||(this.current=this.createObserverData());const e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(t=>t.revived)},dispose:cw(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){const e=new vni({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const j5=(n,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(n.controllerId,n.profileId,i)};var ub,jR,Iq,Km,XH;class Vat{constructor(e,t,i,s,o,r,a,c,l,d=!1,h=void 0,u=!1){kt(this,ub);kt(this,jR);kt(this,Iq);kt(this,Km);kt(this,XH);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,st(this,ub,e),st(this,XH,t),st(this,jR,i),st(this,Iq,s),t.set(r,this);const f=sBe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),st(this,Km,{profileId:r,controllerId:o,tag:h?hC.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{se(this,Km)&&(se(this,ub).$publishTestRunProfile(se(this,Km)),st(this,Km,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,j5(this,se(this,ub),se(this,Km),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,j5(this,se(this,ub),se(this,Km),{supportsContinuousRun:e}))}get isDefault(){return se(this,jR).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?se(this,jR).add(this.profileId):se(this,jR).delete(this.profileId),j5(this,se(this,ub),se(this,Km),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,j5(this,se(this,ub),se(this,Km),{tag:e?hC.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,j5(this,se(this,ub),se(this,Km),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return T.chain(se(this,Iq),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(yl))}dispose(){se(this,XH)?.delete(this.profileId)&&(st(this,XH,void 0),se(this,ub).$removeTestProfile(this.controllerId,this.profileId)),st(this,Km,void 0)}}ub=new WeakMap,jR=new WeakMap,Iq=new WeakMap,Km=new WeakMap,XH=new WeakMap;const sBe={[HM.Coverage]:Yu.Coverage,[HM.Debug]:Yu.Debug,[HM.Run]:Yu.Run};function bni(n,e){for(let t=0;ts.id===n.path[t]);if(!i)return;if(t===n.path.length-1)return i;e=i.children}}class Cni{constructor(e,t){this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new I,this._onDidChangeTextEditorOptions=new I,this._onDidChangeTextEditorVisibleRanges=new I,this._onDidChangeTextEditorViewColumn=new I,this._onDidChangeActiveTextEditor=new I,this._onDidChangeVisibleTextEditors=new I,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(Ue.MainThreadTextEditors),this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i)),this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let s;typeof t=="number"?s={position:yd.from(t),preserveFocus:i}:typeof t=="object"?s={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:s={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,s),r=o&&this._extHostDocumentsAndEditors.getEditor(o);if(r)return r.value;throw o?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new jLe(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const s=t.selections.selections.map(ZS.to);i._acceptSelections(s)}if(t.visibleRanges){const s=Ui(t.visibleRanges.map(at.to));i._acceptVisibleRanges(s)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:oH.to(t.options.lineNumbers)}}),t.selections){const s=HF.fromValue(t.selections.source),o=t.selections.selections.map(ZS.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:s})}if(t.visibleRanges){const s=Ui(t.visibleRanges.map(at.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:s})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const s=yd.to(e[t]);i.value.viewColumn!==s&&(i._acceptViewColumn(s),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:s}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let XTe=class{constructor(e){this._actual=new Sse(uE.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=uE.Light;break;case"hcDark":t=uE.HighContrast;break;case"hcLight":t=uE.HighContrastLight;break;default:t=uE.Dark}this._actual=new Sse(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};XTe=D([_(0,gr)],XTe);class yni{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Ue.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,s)=>{if(i&&i.$mid===Fs.TimelineActionContext)if(this._providers.get(i.source)&&Cn.equals(s,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:P.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(T6e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,s){return this._providers.get(e)?.provider.provideTimeline(P.revive(t),i,s)}registerTimelineProvider(e,t,i,s){const o=new Z,r=this.convertTimelineItem(t.id,s,o).bind(this);let a;t.onDidChange&&(a=t.onDidChange(l=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...l,id:t.id}),this));const c=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(l,d,h){d?.resetCache&&(o.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=r(l,d);return{...u,source:t.id,items:u.items.map(f)}},dispose(){for(const l of c.values())l.get(t.id)?.clear();a?.dispose(),o.dispose()}},i)}convertTimelineItem(e,t,i){return(s,o)=>{let r;if(o?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=T6e(s);r=a.get(c),r===void 0&&(r=new Map,a.set(c,r))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;r?.set(d,a);let h,u,f;a.iconPath&&(c instanceof fg?f={id:c.id,color:c.color}:P.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return vp.isMarkdownString(l.tooltip)?p=Qs.from(l.tooltip):zt(l.tooltip)?p=l.tooltip:vp.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Qs.from(l.detail)):zt(l.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=l.detail),{...l,id:l.id??void 0,handle:d,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:h,iconDark:u,themeIcon:f,tooltip:p,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),Ee(()=>{for(const s of this._itemsBySourceAndUriMap.values())s.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function T6e(n){return n?.toString()}const Sni="vs/workbench/api/common/extHostTreeViews";function R6e(n,e){if(zt(n))return{label:n};if(n&&typeof n=="object"&&typeof n.label=="string"){let t;return Array.isArray(n.highlights)&&(t=n.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:n.label,highlights:t}}}class Ani extends ${constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new vPe;function s(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>s(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>s(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const s=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>s.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const s=t.dragAndDropController?.dropMimeTypes??[],o=t.dragAndDropController?.dragMimeTypes??[],r=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:s,dragMimeTypes:o,hasHandleDrag:r,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},d=this._proxy.$registerTreeViewDataProvider(e,l),h={get onDidCollapseElement(){return c.onDidCollapseElement},get onDidExpandElement(){return c.onDidExpandElement},get selection(){return c.selectedElements},get onDidChangeSelection(){return c.onDidChangeSelection},get activeItem(){return Je(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Je(i,"treeViewActiveItem"),c.onDidChangeActiveItem},get visible(){return c.visible},get onDidChangeVisibility(){return c.onDidChangeVisibility},get onDidChangeCheckboxState(){return c.onDidChangeCheckboxState},get message(){return c.message},set message(u){ah(u)&&Je(i,"treeViewMarkdownMessage"),c.message=u},get title(){return c.title},set title(u){c.title=u},get description(){return c.description},set description(u){c.description=u},get badge(){return c.badge},set badge(u){u!==void 0&&dke.isViewBadge(u)?c.badge={value:Math.floor(Math.abs(u.value)),tooltip:u.tooltip}:u===void 0&&(c.badge=void 0)},reveal:(u,f)=>c.reveal(u,f),dispose:async()=>{await d,this.treeViews.delete(e),c.dispose()}};return this._register(h),h}$getChildren(e,t){const i=this.treeViews.get(e);return i?i.getChildren(t):Promise.reject(new kC(e))}async $handleDrop(e,t,i,s,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new kC(e));const d=rw.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,o,r),l.onDrop(d,s,o)}async addAdditionalTransferItems(e,t,i,s,o){const r=this.treeDragAndDropService.removeDragOperationTransfer(o);if(r)(await r)?.forEach((a,c)=>{a&&e.set(c,a)});else if(o&&t.handleDrag){const a=t.handleDrag(i,e,s);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,s){const o=this.treeViews.get(e);if(!o)return Promise.reject(new kC(e));const r=await this.addAdditionalTransferItems(new h4,o,t,s,i);if(!(!r||s.isCancellationRequested))return rw.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new kC(e);return t.hasResolve}$resolve(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);return s.resolveTreeItem(t,i)}$setExpanded(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new kC(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new kC(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const s=this._register(new ZTe(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,s),s}convertArgument(e){const t=this.treeViews.get(e.$treeViewId);return t&&"$treeItemHandle"in e?t.getExtensionElement(e.$treeItemHandle):t&&"$focusedTreeItem"in e&&e.$focusedTreeItem?t.focusedElement:null}}const CW=class CW extends ${get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!dc(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,s,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=s,this.logService=o,this.extension=r,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new I),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new I),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new I),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new I),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new I),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new ai,r.contributes&&r.contributes.views)for(const d in r.contributes.views)for(const h of r.contributes.views[d])h.id===e&&(this._title=h.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(d=>{Array.isArray(d)&&d.length===0||this._onDidChangeData.fire({message:!1,element:d})}));let a,c;const l=T.debounce(this._onDidChangeData.event,(d,h)=>(d||(d={message:!1,elements:[]}),h.element!==!1&&(a||(a=new Promise(u=>c=u),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(h.element)?d.elements.push(...h.element):d.elements.push(h.element)),h.message&&(d.message=!0),d),200,!0);this._register(l(({message:d,elements:h})=>{h.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const u=c;return a=null,this.refresh(h).then(()=>u())})),d&&this.proxy.$setMessage(this.viewId,Qs.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(s=>s.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=dc(t.select)?!0:t.select,s=dc(t.focus)?!1:t.focus,o=dc(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(r=>this.resolveTreeNode(e,r[r.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:r.map(c=>c.item)},{select:i,focus:s,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:s,expand:o})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=Coe.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!Ls(this._selectedHandles,e);this._selectedHandles=e;const s=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),s&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const s=this.getExtensionElement(i.treeItemHandle);return s?{extensionItem:s,treeItem:await this.dataProvider.getTreeItem(s),newState:i.newState?Lb.Checked:Lb.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?Lb.Checked:Lb.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const s=[];for(const o of e){const r=this.getExtensionElement(o);r&&s.push(r)}if(!(!this.dndController?.handleDrag||s.length===0))return await this.dndController.handleDrag(s,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const s=t?this.getExtensionElement(t):void 0;if(!(!s&&t||!this.dndController?.handleDrop))return Zu(()=>this.dndController?.handleDrop?this.dndController.handleDrop(s,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const s=this.nodes.get(i);if(s){const o=await this.dataProvider.resolveTreeItem(s.extensionItem,i,t)??s.extensionItem;return this.validateTreeItem(o),s.item.tooltip=this.getTooltip(o.tooltip),s.item.command=this.getCommand(s.disposableStore,o.command),s.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(s=>(i.push(s),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):Zu(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Zu(()=>this.dataProvider.getTreeItem(e)).then(s=>this.createHandle(e,s,t,!0)).then(s=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(s);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${s} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new ai(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,s=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Ui(s||[]),r=await Promise.all(Ui(o).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=r.map((c,l)=>c?this.createAndRegisterTreeNode(o[l],c,i):null);return Ui(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ai,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(o=>this.nodes.get(o));for(const o of i)if(o&&!t.has(o.item.handle)){let r=o;for(;r&&r.parent&&i.findIndex(a=>r&&r.parent&&a&&a.item.handle===r.parent.item.handle)===-1;){const a=this.elements.get(r.parent.item.handle);r=a?this.nodes.get(a):void 0}r&&!r.parent&&t.add(o.item.handle)}const s=[];return t.forEach(o=>{const r=this.elements.get(o);if(r){const a=this.nodes.get(r);a&&(!a.parent||!t.has(a.parent.item.handle))&&s.push(o)}}),s}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(s=>{s&&(t[i]=s.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),Zu(()=>this.dataProvider.getTreeItem(t)).then(s=>{if(s){const o=this.createTreeNode(t,s,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const s=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(s.item.handle))throw new Error(g(Sni,0,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,s),this.addNodeToParentCache(s,i),s}getTooltip(e){return vp.isMarkdownString(e)?Qs.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,s;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,s=e.checkboxState.accessibilityInformation),{isChecked:t===Lb.Checked,tooltip:i,accessibilityInformation:s}}validateTreeItem(e){if(!q6.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const s=this._register(new Z),o=this.createHandle(e,t,i),r=this.getLightIconPath(t);return{item:{handle:o,parentHandle:i?i.item.handle:void 0,label:R6e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(s,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:dc(t.collapsibleState)?zI.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:s,dispose(){s.dispose()}}}getThemeIcon(e){return e.iconPath instanceof fg?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:s},o,r){if(t)return`${CW.ID_HANDLE_PREFIX}/${t}`;const a=R6e(i),c=o?o.item.handle:CW.LABEL_HANDLE_PREFIX;let l=a?a.label:s?ui(s):"";l=l.indexOf("/")!==-1?l.replace("/","//"):l;const d=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,h=this.getChildrenNodes(o)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,r||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg))return typeof e.iconPath=="string"||P.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return P.isUri(e)?e:P.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,s){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const o=this.getChildrenNodes(s)||[],r=o.filter(a=>a.item.handle===i.item.handle)[0];r&&o.splice(o.indexOf(r),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};CW.LABEL_HANDLE_PREFIX="0",CW.ID_HANDLE_PREFIX="1";let ZTe=CW;const Rle=class Rle{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Ue.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,s){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=s.schemes.find(r=>!Rle.supportedSchemes.has(r));if(o)throw new Error(`Scheme '${o}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,s.schemes,e,s.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener with id: ${e}`);const o=P.revive(t);return s.canOpenExternalUri(o,i)}async $openUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener id: '${e}'`);return s.openExternalUri(P.revive(t.resolvedUri),{sourceUri:P.revive(t.sourceUri)},i)}};Rle.supportedSchemes=new Set([_e.http,_e.https]);let eRe=Rle;const Mle=class Mle{constructor(e){this.handles=new $v,this.handlers=new Map,this._proxy=e.getProxy(Ue.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const s=Mle.HandlePool++;return this.handles.add(i),this.handlers.set(s,t),this._proxy.$registerUriHandler(s,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(s),this._proxy.$unregisterUriHandler(s)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(P.revive(t))}catch(s){bt(s)}return Promise.resolve(void 0)}async createAppUri(e){return P.revive(await this._proxy.$createAppUri(e))}};Mle.HandlePool=0;let tRe=Mle;var Tk,Rk,Lq,ZH,Tq,KR,eU,JA,tU,iU,Mk,nU,sU;class Eni extends ${constructor(t,i,s,o){super();kt(this,Tk);kt(this,Rk);kt(this,Lq);kt(this,ZH);kt(this,Tq);kt(this,KR);kt(this,eU);kt(this,JA);kt(this,tU);kt(this,iU);kt(this,Mk);kt(this,nU);kt(this,sU);st(this,JA,void 0),st(this,tU,!0),st(this,Mk,!1),st(this,nU,this._register(new I)),this.onDidDispose=se(this,nU).event,st(this,sU,this._register(new I)),this.onDidChangeViewState=se(this,sU).event,st(this,Tk,t),st(this,Rk,i),st(this,ZH,s),st(this,Lq,o.viewType),st(this,Tq,o.panelOptions),st(this,JA,o.viewColumn),st(this,KR,o.title),st(this,iU,o.active)}dispose(){se(this,Mk)||(st(this,Mk,!0),se(this,nU).fire(),se(this,Rk).$disposeWebview(se(this,Tk)),se(this,ZH).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),se(this,ZH)}get viewType(){return this.assertNotDisposed(),se(this,Lq)}get title(){return this.assertNotDisposed(),se(this,KR)}set title(t){this.assertNotDisposed(),se(this,KR)!==t&&(st(this,KR,t),se(this,Rk).$setTitle(se(this,Tk),t))}get iconPath(){return this.assertNotDisposed(),se(this,eU)}set iconPath(t){this.assertNotDisposed(),se(this,eU)!==t&&(st(this,eU,t),se(this,Rk).$setIconPath(se(this,Tk),P.isUri(t)?{light:t,dark:t}:t))}get options(){return se(this,Tq)}get viewColumn(){if(this.assertNotDisposed(),!(typeof se(this,JA)=="number"&&se(this,JA)<0))return se(this,JA)}get active(){return this.assertNotDisposed(),se(this,iU)}get visible(){return this.assertNotDisposed(),se(this,tU)}_updateViewState(t){se(this,Mk)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(st(this,iU,t.active),st(this,tU,t.visible),st(this,JA,t.viewColumn),se(this,sU).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),se(this,Rk).$reveal(se(this,Tk),{viewColumn:typeof t>"u"?void 0:yd.from(t),preserveFocus:!!i})}assertNotDisposed(){if(se(this,Mk))throw new Error("Webview is disposed")}}Tk=new WeakMap,Rk=new WeakMap,Lq=new WeakMap,ZH=new WeakMap,Tq=new WeakMap,KR=new WeakMap,eU=new WeakMap,JA=new WeakMap,tU=new WeakMap,iU=new WeakMap,Mk=new WeakMap,nU=new WeakMap,sU=new WeakMap;class oBe extends ${static newHandle(){return Dr()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,s,o={}){const r=typeof s=="object"?s.viewColumn:s,a={viewColumn:yd.from(r),preserveFocus:typeof s=="object"&&!!s.preserveFocus},c=q4(e),l=oBe.newHandle();this._proxy.$createWebviewPanel(Tre(e),l,t,{title:i,panelOptions:xni(o),webviewOptions:Oat(e,this.workspace,o),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,o,e);return this.createNewWebviewPanel(l,t,i,r,o,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,s)=>{const o=e[i],r=e[s];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const s=this.getWebviewPanel(i);if(!s)continue;const o=e[i];s._updateViewState({active:o.active,visible:o.visible,viewColumn:yd.to(o.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,s){const o=this._serializers.get(t);if(!o)throw new Error(`No serializer found for '${t}'`);const{serializer:r,extension:a}=o,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,s,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,s,o,r,a){const c=new Eni(e,this._proxy,r,{viewType:t,title:i,viewColumn:s,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function xni(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}var Nk,Pk,Rq,oU,Fk,YR,JR,rU,XR,aU,cU;class Dni extends ${constructor(t,i,s,o,r,a){super();kt(this,Nk);kt(this,Pk);kt(this,Rq);kt(this,oU);kt(this,Fk);kt(this,YR);kt(this,JR);kt(this,rU);kt(this,XR);kt(this,aU);kt(this,cU);st(this,Fk,!1),st(this,aU,this._register(new I)),this.onDidChangeVisibility=se(this,aU).event,st(this,cU,this._register(new I)),this.onDidDispose=se(this,cU).event,st(this,Rq,s),st(this,JR,o),st(this,Nk,t),st(this,Pk,i),st(this,oU,r),st(this,YR,a)}dispose(){se(this,Fk)||(st(this,Fk,!0),se(this,cU).fire(),se(this,oU).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),se(this,JR)}set title(t){this.assertNotDisposed(),se(this,JR)!==t&&(st(this,JR,t),se(this,Pk).$setWebviewViewTitle(se(this,Nk),t))}get description(){return this.assertNotDisposed(),se(this,rU)}set description(t){this.assertNotDisposed(),se(this,rU)!==t&&(st(this,rU,t),se(this,Pk).$setWebviewViewDescription(se(this,Nk),t))}get visible(){return se(this,YR)}get webview(){return se(this,oU)}get viewType(){return se(this,Rq)}_setVisible(t){t===se(this,YR)||se(this,Fk)||(st(this,YR,t),se(this,aU).fire())}get badge(){return this.assertNotDisposed(),se(this,XR)}set badge(t){this.assertNotDisposed(),!(t?.value===se(this,XR)?.value&&t?.tooltip===se(this,XR)?.tooltip)&&(st(this,XR,Coe.from(t)),se(this,Pk).$setWebviewViewBadge(se(this,Nk),t))}show(t){this.assertNotDisposed(),se(this,Pk).$show(se(this,Nk),!!t)}assertNotDisposed(){if(se(this,Fk))throw new Error("Webview is disposed")}}Nk=new WeakMap,Pk=new WeakMap,Rq=new WeakMap,oU=new WeakMap,Fk=new WeakMap,YR=new WeakMap,JR=new WeakMap,rU=new WeakMap,XR=new WeakMap,aU=new WeakMap,cU=new WeakMap;class kni{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,s){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(Tre(e),t,{retainContextWhenHidden:s?.retainContextWhenHidden,serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,s,o){const r=this._viewProviders.get(t);if(!r)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=r,l=this._extHostWebview.createNewWebview(e,{},c),d=new Dni(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:s},o)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}function Ini(n){const e=n.get(Sg),t=n.get(Kz),i=n.get(gue),s=n.get(_L),o=n.get(dD),r=n.get(pue),a=n.get(hD),c=n.get(fue),l=n.get(gr),d=n.get(KOe),h=n.get(YOe),u=n.get(wp),f=n.get(Ze),p=n.get(FOe),m=n.get(mue),v=n.get(Nat),w=n.get(ZOe),b=n.get(rj),C=n.get(tBe),y=n.get(JOe),S=n.get(XOe);l.set(et.ExtHostFileSystemInfo,t),l.set(et.ExtHostLogLevelServiceShape,u),l.set(et.ExtHostWorkspace,o),l.set(et.ExtHostConfiguration,a),l.set(et.ExtHostExtensionService,s),l.set(et.ExtHostStorage,d),l.set(et.ExtHostTunnelService,p),l.set(et.ExtHostWindow,v),l.set(et.ExtHostSecretState,w),l.set(et.ExtHostTelemetry,r),l.set(et.ExtHostEditorTabs,b),l.set(et.ExtHostManagedSockets,C),l.set(et.ExtHostAuthentication,y),l.set(et.ExtHostChatProvider,S);const M=l.set(et.ExtHostDecorations,n.get(yat)),k=l.set(et.ExtHostDocumentsAndEditors,n.get(oj)),F=l.set(et.ExtHostCommands,n.get(Yz)),N=l.set(et.ExtHostTerminalService,n.get(Jz)),z=l.set(et.ExtHostTerminalShellIntegration,n.get(Pat)),U=l.set(et.ExtHostDebugService,n.get(Rat)),J=l.set(et.ExtHostSearch,n.get(Mat)),j=l.set(et.ExtHostTask,n.get(xat)),re=l.set(et.ExtHostOutputService,n.get(bat)),me=l.set(et.ExtHostLocalization,n.get(eBe)),De=l.set(et.ExtHostUrls,new tRe(l)),Qe=l.set(et.ExtHostDocuments,new Fii(l,k)),Tt=l.set(et.ExtHostDocumentContentProviders,new RTe(l,k,f)),Oe=l.set(et.ExtHostDocumentSaveParticipant,new Pii(f,Qe,l.getProxy(Ue.MainThreadBulkEdits))),wt=l.set(et.ExtHostNotebook,new OTe(l,F,k,Qe,i,J,f)),Nt=l.set(et.ExtHostNotebookDocuments,new Yii(wt)),Yi=l.set(et.ExtHostNotebookEditors,new BTe(f,wt)),Vi=l.set(et.ExtHostNotebookKernels,new WTe(l,e,wt,F,f)),Gn=l.set(et.ExtHostNotebookRenderers,new Zii(l,wt)),Ro=l.set(et.ExtHostNotebookDocumentSaveParticipant,new Kii(f,wt,l.getProxy(Ue.MainThreadBulkEdits))),qn=l.set(et.ExtHostEditors,new Cni(l,k)),ec=l.set(et.ExtHostTreeViews,new Ani(l.getProxy(Ue.MainThreadTreeViews),F,f)),ys=l.set(et.ExtHostEditorInsets,new wii(l.getProxy(Ue.MainThreadEditorInsets),qn,e.remote)),mr=l.set(et.ExtHostDiagnostics,new TTe(l,f,t,k)),ba=l.set(et.ExtHostLanguages,new qii(l,Qe,F.converter,c)),ki=l.set(et.ExtHostLanguageFeatures,new MTe(l,c,Qe,F,mr,f,m,r)),gs=l.set(et.ExtHostFileSystem,new Mre(l,ki)),ir=l.set(et.ExtHostFileSystemEventService,new Vii(l,f,k)),Hn=l.set(et.ExtHostQuickOpen,nni(l,o,F)),_c=l.set(et.ExtHostSCM,new qTe(l,F,Qe,f)),gh=l.set(et.ExtHostQuickDiff,new zTe(l,c)),Qn=l.set(et.ExtHostShare,new QTe(l,c)),Yh=l.set(et.ExtHostComments,bii(l,F,Qe)),el=l.set(et.ExtHostProgress,new tni(l.getProxy(Ue.MainThreadProgress))),Tl=l.set(et.ExtHostLabelService,new $ii(l)),to=l.set(et.ExtHostTheming,new XTe(l)),Fc=l.set(et.ExtHostTimeline,new yni(l,F)),rd=l.set(et.ExtHostWebviews,new Sii(l,e.remote,o,f,m)),Jh=l.set(et.ExtHostWebviewPanels,new oBe(l,rd,o)),Af=l.set(et.ExtHostCustomEditors,new Iii(l,Qe,h,rd,Jh)),tl=l.set(et.ExtHostWebviewViews,new kni(l,rd)),Rl=l.set(et.ExtHostTesting,new JTe(l,f,F,k)),Xh=l.set(et.ExtHostUriOpeners,new eRe(l)),ul=l.set(et.ExtHostProfileContentHandlers,new eni(l));l.set(et.ExtHostInteractive,new zii(l,wt,k,F,f));const ad=l.set(et.ExtHostChatAgents2,new kTe(l,f,F,e.quality)),vc=l.set(et.ExtHostChatVariables,new ITe(l)),Ca=l.set(et.ExtHostAiRelatedInformation,new hii(l)),Ld=l.set(et.ExtHostAiEmbeddingVector,new Bii(l)),fh=l.set(et.ExtHostStatusBar,new uni(l,F.converter)),Fu=l.set(et.ExtHostSpeech,new jTe(l)),wc=l.set(et.ExtHostEmbeddings,new Oii(l)),Zh=Object.values(et);l.assertRegistered(Zh);const bc=new DTe(l,k),nr=new mii(l),Rs=new NTe(l,f),Ml=new Nii(l);return gii.register(F),function(Se,Mo,cd){function K(R){return(H,ie,je)=>{const pt=R(is=>{try{H.call(ie,is)}catch(Ss){er(new Error(`[ExtensionListenerError] Extension '${Se.identifier.value}' FAILED to handle event: ${Ss.toString()}`,{cause:Ss})),r.onExtensionError(Se.identifier,Ss)}});return je?.push(pt),pt}}const Le=function(){let R=!Se.isUnderDevelopment;function H(){R||(f.info(`Extension '${Se.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),R=!0)}return function ie(je){if(Array.isArray(je))je.forEach(ie);else if(typeof je=="string")H();else{const pt=je;typeof pt.scheme>"u"&&H(),typeof pt.exclusive=="boolean"&&Je(Se,"documentFiltersExclusive")}return je}}(),ri={getSession(R,H,ie){return typeof ie?.forceNewSession=="object"&&ie.forceNewSession.learnMore&&Je(Se,"authLearnMore"),y.getSession(Se,R,H,ie)},getSessions(R,H){return Je(Se,"authGetSessions"),y.getSessions(Se,R,H)},async hasSession(R,H){return Je(Se,"authSession"),!!await y.getSession(Se,R,H,{silent:!0})},get onDidChangeSessions(){return K(y.onDidChangeSessions)},registerAuthenticationProvider(R,H,ie,je){return y.registerAuthenticationProvider(R,H,ie,je)}},ts={registerCommand(R,H,ie){return F.registerCommand(!0,R,H,ie,void 0,Se)},registerTextEditorCommand(R,H,ie){return F.registerCommand(!0,R,(...je)=>{const pt=qn.getActiveTextEditor();if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}return pt.edit(is=>{H.apply(ie,[pt,is,...je])}).then(is=>{is||f.warn("Edits from command "+R+" were not applied.")},is=>{f.warn("An error occurred while running command "+R,is)})},void 0,void 0,Se)},registerDiffInformationCommand:(R,H,ie)=>(Je(Se,"diffCommand"),F.registerCommand(!0,R,async(...je)=>{const pt=k.activeEditor(!0);if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}const is=await qn.getDiffInformation(pt.id);H.apply(ie,[is,...je])},void 0,void 0,Se)),executeCommand(R,...H){return F.executeCommand(R,...H)},getCommands(R=!1){return F.getCommands(R)}},Os={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return nr.value},get shell(){return N.getDefaultShell(!1)},get onDidChangeShell(){return K(N.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return K(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Je(Se,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Je(Se,"telemetry"),K(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return Aat(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(R,H){return Sat.validateSender(R),r.instantiateLogger(Se,R,H)},openExternal(R,H){return v.openUri(R,{allowTunneling:!!e.remote.authority,allowContributedOpeners:H?.allowContributedOpeners})},async asExternalUri(R){if(R.scheme===e.environment.appUriScheme)return De.createAppUri(R);try{return await v.asExternalUri(R,{allowTunneling:!!e.remote.authority})}catch(H){if(Rx(R,_e.http)||Rx(R,_e.https))return R;throw H}},get remoteName(){return Wde(e.remote.authority)},get remoteAuthority(){return Je(Se,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return K(f.onDidChangeLogLevel)},get appQuality(){return Je(Se,"resolvers"),e.quality},get appCommit(){return Je(Se,"resolvers"),e.commit}},sr={createTestController(R,H,ie){return Rl.createTestController(Se,R,H,ie)},createTestObserver(){return Je(Se,"testObserver"),Rl.createTestObserver()},runTests(R){return Je(Se,"testObserver"),Rl.runTests(R)},registerTestFollowupProvider(R){return Je(Se,"testObserver"),Rl.registerTestFollowupProvider(R)},get onDidChangeTestResults(){return Je(Se,"testObserver"),K(Rl.onResultsChanged)},get testResults(){return Je(Se,"testObserver"),Rl.results}},ya=e.remote.isRemote?$I.Workspace:$I.UI,Cc={getExtension(R,H){Cd(Se,"extensionsAny")||(H=!1);const ie=Mo.mine.getExtensionDescription(R);if(ie)return new K3(s,Se.identifier,ie,ya,!1);if(H){const je=Mo.all.getExtensionDescription(R);if(je)return new K3(s,Se.identifier,je,ya,!0)}},get all(){const R=[];for(const H of Mo.mine.getAllExtensionDescriptions())R.push(new K3(s,Se.identifier,H,ya,!1));return R},get allAcrossExtensionHosts(){Je(Se,"extensionsAny");const R=new $v(Mo.mine.getAllExtensionDescriptions().map(ie=>ie.identifier)),H=[];for(const ie of Mo.all.getAllExtensionDescriptions()){const je=!R.has(ie.identifier);H.push(new K3(s,Se.identifier,ie,ya,je))}return H},get onDidChange(){return Cd(Se,"extensionsAny")?K(T.any(Mo.mine.onDidChange,Mo.all.onDidChange)):K(Mo.mine.onDidChange)}},Ou={createDiagnosticCollection(R){return mr.createDiagnosticCollection(Se.identifier,R)},get onDidChangeDiagnostics(){return K(mr.onDidChangeDiagnostics)},getDiagnostics:R=>mr.getDiagnostics(R),getLanguages(){return ba.getLanguages()},setTextDocumentLanguage(R,H){return ba.changeLanguage(R.uri,H)},match(R,H){const ie=hIe.from(R);let je;return FYe(ie)&&(je=wt.notebookDocuments.find(pt=>pt.apiNotebook.getCells().find(is=>is.document===H))?.apiNotebook),fde(ie,H.uri,H.languageId,!0,je?.uri,je?.notebookType)},registerCodeActionsProvider(R,H,ie){return ki.registerCodeActionProvider(Se,Le(R),H,ie)},registerDocumentPasteEditProvider(R,H,ie){return Je(Se,"documentPaste"),ki.registerDocumentPasteEditProvider(Se,Le(R),H,ie)},registerCodeLensProvider(R,H){return ki.registerCodeLensProvider(Se,Le(R),H)},registerDefinitionProvider(R,H){return ki.registerDefinitionProvider(Se,Le(R),H)},registerDeclarationProvider(R,H){return ki.registerDeclarationProvider(Se,Le(R),H)},registerImplementationProvider(R,H){return ki.registerImplementationProvider(Se,Le(R),H)},registerTypeDefinitionProvider(R,H){return ki.registerTypeDefinitionProvider(Se,Le(R),H)},registerHoverProvider(R,H){return ki.registerHoverProvider(Se,Le(R),H,Se.identifier)},registerEvaluatableExpressionProvider(R,H){return ki.registerEvaluatableExpressionProvider(Se,Le(R),H,Se.identifier)},registerInlineValuesProvider(R,H){return ki.registerInlineValuesProvider(Se,Le(R),H,Se.identifier)},registerDocumentHighlightProvider(R,H){return ki.registerDocumentHighlightProvider(Se,Le(R),H)},registerMultiDocumentHighlightProvider(R,H){return ki.registerMultiDocumentHighlightProvider(Se,Le(R),H)},registerLinkedEditingRangeProvider(R,H){return ki.registerLinkedEditingRangeProvider(Se,Le(R),H)},registerReferenceProvider(R,H){return ki.registerReferenceProvider(Se,Le(R),H)},registerRenameProvider(R,H){return ki.registerRenameProvider(Se,Le(R),H)},registerNewSymbolNamesProvider(R,H){return Je(Se,"newSymbolNamesProvider"),ki.registerNewSymbolNamesProvider(Se,Le(R),H)},registerDocumentSymbolProvider(R,H,ie){return ki.registerDocumentSymbolProvider(Se,Le(R),H,ie)},registerWorkspaceSymbolProvider(R){return ki.registerWorkspaceSymbolProvider(Se,R)},registerDocumentFormattingEditProvider(R,H){return ki.registerDocumentFormattingEditProvider(Se,Le(R),H)},registerDocumentRangeFormattingEditProvider(R,H){return ki.registerDocumentRangeFormattingEditProvider(Se,Le(R),H)},registerOnTypeFormattingEditProvider(R,H,ie,...je){return ki.registerOnTypeFormattingEditProvider(Se,Le(R),H,[ie].concat(je))},registerDocumentSemanticTokensProvider(R,H,ie){return ki.registerDocumentSemanticTokensProvider(Se,Le(R),H,ie)},registerDocumentRangeSemanticTokensProvider(R,H,ie){return ki.registerDocumentRangeSemanticTokensProvider(Se,Le(R),H,ie)},registerSignatureHelpProvider(R,H,ie,...je){return typeof ie=="object"?ki.registerSignatureHelpProvider(Se,Le(R),H,ie):ki.registerSignatureHelpProvider(Se,Le(R),H,typeof ie>"u"?[]:[ie,...je])},registerCompletionItemProvider(R,H,...ie){return ki.registerCompletionItemProvider(Se,Le(R),H,ie)},registerInlineCompletionItemProvider(R,H,ie){return H.handleDidShowCompletionItem&&Je(Se,"inlineCompletionsAdditions"),H.handleDidPartiallyAcceptCompletionItem&&Je(Se,"inlineCompletionsAdditions"),ie&&Je(Se,"inlineCompletionsAdditions"),ki.registerInlineCompletionsProvider(Se,Le(R),H,ie)},registerInlineEditProvider(R,H){return Je(Se,"inlineEdit"),ki.registerInlineEditProvider(Se,Le(R),H)},registerDocumentLinkProvider(R,H){return ki.registerDocumentLinkProvider(Se,Le(R),H)},registerColorProvider(R,H){return ki.registerColorProvider(Se,Le(R),H)},registerFoldingRangeProvider(R,H){return ki.registerFoldingRangeProvider(Se,Le(R),H)},registerSelectionRangeProvider(R,H){return ki.registerSelectionRangeProvider(Se,R,H)},registerCallHierarchyProvider(R,H){return ki.registerCallHierarchyProvider(Se,R,H)},registerTypeHierarchyProvider(R,H){return ki.registerTypeHierarchyProvider(Se,R,H)},setLanguageConfiguration:(R,H)=>ki.setLanguageConfiguration(Se,R,H),getTokenInformationAtPosition(R,H){return Je(Se,"tokenInformation"),ba.tokenAtPosition(R,H)},registerInlayHintsProvider(R,H){return ki.registerInlayHintsProvider(Se,R,H)},createLanguageStatusItem(R,H){return ba.createLanguageStatusItem(Se,R,H)},registerDocumentDropEditProvider(R,H,ie){return ki.registerDocumentOnDropEditProvider(Se,R,H,Cd(Se,"documentPaste")?ie:void 0)}},le={get activeTextEditor(){return qn.getActiveTextEditor()},get visibleTextEditors(){return qn.getVisibleTextEditors()},get activeTerminal(){return N.activeTerminal},get terminals(){return N.terminals},async showTextDocument(R,H,ie){P.isUri(R)&&R.scheme===_e.vscodeRemote&&!R.authority&&m.report("workspace.showTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority.");const je=await(P.isUri(R)?Promise.resolve(_r.openTextDocument(R)):Promise.resolve(R));return qn.showTextDocument(je,H,ie)},createTextEditorDecorationType(R){return qn.createTextEditorDecorationType(Se,R)},onDidChangeActiveTextEditor(R,H,ie){return K(qn.onDidChangeActiveTextEditor)(R,H,ie)},onDidChangeVisibleTextEditors(R,H,ie){return K(qn.onDidChangeVisibleTextEditors)(R,H,ie)},onDidChangeTextEditorSelection(R,H,ie){return K(qn.onDidChangeTextEditorSelection)(R,H,ie)},onDidChangeTextEditorOptions(R,H,ie){return K(qn.onDidChangeTextEditorOptions)(R,H,ie)},onDidChangeTextEditorVisibleRanges(R,H,ie){return K(qn.onDidChangeTextEditorVisibleRanges)(R,H,ie)},onDidChangeTextEditorViewColumn(R,H,ie){return K(qn.onDidChangeTextEditorViewColumn)(R,H,ie)},onDidCloseTerminal(R,H,ie){return K(N.onDidCloseTerminal)(R,H,ie)},onDidOpenTerminal(R,H,ie){return K(N.onDidOpenTerminal)(R,H,ie)},onDidChangeActiveTerminal(R,H,ie){return K(N.onDidChangeActiveTerminal)(R,H,ie)},onDidChangeTerminalDimensions(R,H,ie){return Je(Se,"terminalDimensions"),K(N.onDidChangeTerminalDimensions)(R,H,ie)},onDidChangeTerminalState(R,H,ie){return K(N.onDidChangeTerminalState)(R,H,ie)},onDidWriteTerminalData(R,H,ie){return Je(Se,"terminalDataWriteEvent"),K(N.onDidWriteTerminalData)(R,H,ie)},onDidExecuteTerminalCommand(R,H,ie){return Je(Se,"terminalExecuteCommandEvent"),K(N.onDidExecuteTerminalCommand)(R,H,ie)},onDidChangeTerminalShellIntegration(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidChangeTerminalShellIntegration)(R,H,ie)},onDidStartTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidStartTerminalShellExecution)(R,H,ie)},onDidEndTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidEndTerminalShellExecution)(R,H,ie)},get state(){return v.getState()},onDidChangeWindowState(R,H,ie){return K(v.onDidChangeWindowState)(R,H,ie)},showInformationMessage(R,...H){return Rs.showMessage(Se,nt.Info,R,H[0],H.slice(1))},showWarningMessage(R,...H){return Rs.showMessage(Se,nt.Warning,R,H[0],H.slice(1))},showErrorMessage(R,...H){return Rs.showMessage(Se,nt.Error,R,H[0],H.slice(1))},showQuickPick(R,H,ie){return Hn.showQuickPick(Se,R,H,ie)},showWorkspaceFolderPick(R){return Hn.showWorkspaceFolderPick(R)},showInputBox(R,H){return Hn.showInput(R,H)},showOpenDialog(R){return Ml.showOpenDialog(Se,R)},showSaveDialog(R){return Ml.showSaveDialog(R)},createStatusBarItem(R,H,ie){let je,pt,is;return typeof R=="string"?(je=R,pt=H,is=ie):(pt=R,is=H),fh.createStatusBarEntry(Se,je,pt,is)},setStatusBarMessage(R,H){return fh.setStatusBarMessage(R,H)},withScmProgress(R){return m.report("window.withScmProgress",Se,"Use 'withProgress' instead."),el.withProgress(Se,{location:VI.SourceControl},(H,ie)=>R({report(je){}}))},withProgress(R,H){return el.withProgress(Se,R,H)},createOutputChannel(R,H){return re.createOutputChannel(R,H,Se)},createWebviewPanel(R,H,ie,je){return Jh.createWebviewPanel(Se,R,H,ie,je)},createWebviewTextEditorInset(R,H,ie,je){return Je(Se,"editorInsets"),ys.createWebviewEditorInset(R,H,ie,je,Se)},createTerminal(R,H,ie){return typeof R=="object"?"pty"in R?N.createExtensionTerminal(R):N.createTerminalFromOptions(R):N.createTerminal(R,H,ie)},registerTerminalLinkProvider(R){return N.registerLinkProvider(R)},registerTerminalProfileProvider(R,H){return N.registerProfileProvider(Se,R,H)},registerTerminalQuickFixProvider(R,H){return Je(Se,"terminalQuickFixProvider"),N.registerTerminalQuickFixProvider(R,Se.identifier.value,H)},registerTreeDataProvider(R,H){return ec.registerTreeDataProvider(R,H,Se)},createTreeView(R,H){return ec.createTreeView(R,H,Se)},registerWebviewPanelSerializer:(R,H)=>Jh.registerWebviewPanelSerializer(Se,R,H),registerCustomEditorProvider:(R,H,ie={})=>Af.registerCustomEditorProvider(Se,R,H,ie),registerFileDecorationProvider(R){return M.registerFileDecorationProvider(R,Se)},registerUriHandler(R){return De.registerUriHandler(Se,R)},createQuickPick(){return Hn.createQuickPick(Se)},createInputBox(){return Hn.createInputBox(Se)},get activeColorTheme(){return to.activeColorTheme},onDidChangeActiveColorTheme(R,H,ie){return K(to.onDidChangeActiveColorTheme)(R,H,ie)},registerWebviewViewProvider(R,H,ie){return tl.registerWebviewViewProvider(Se,R,H,ie?.webviewOptions)},get activeNotebookEditor(){return wt.activeNotebookEditor},onDidChangeActiveNotebookEditor(R,H,ie){return K(wt.onDidChangeActiveNotebookEditor)(R,H,ie)},get visibleNotebookEditors(){return wt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return K(wt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(R,H,ie){return K(Yi.onDidChangeNotebookEditorSelection)(R,H,ie)},onDidChangeNotebookEditorVisibleRanges(R,H,ie){return K(Yi.onDidChangeNotebookEditorVisibleRanges)(R,H,ie)},showNotebookDocument(R,H){return wt.showNotebookDocument(R,H)},registerExternalUriOpener(R,H,ie){return Je(Se,"externalUriOpener"),Xh.registerExternalUriOpener(Se.identifier,R,H,ie)},registerProfileContentHandler(R,H){return Je(Se,"profileContentHandlers"),ul.registerProfileContentHandler(Se,R,H)},registerQuickDiffProvider(R,H,ie,je){return Je(Se,"quickDiffProvider"),gh.registerQuickDiffProvider(Le(R),H,ie,je)},get tabGroups(){return b.tabGroups},registerShareProvider(R,H){return Je(Se,"shareProvider"),Qn.registerShareProvider(Le(R),H)}},_r={get rootPath(){return m.report("workspace.rootPath",Se,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(R){throw new cR("rootPath")},getWorkspaceFolder(R){return o.getWorkspaceFolder(R)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(R){throw new cR("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(R){throw new cR("workspaceFile")},updateWorkspaceFolders:(R,H,...ie)=>o.updateWorkspaceFolders(Se,R,H||0,...ie),onDidChangeWorkspaceFolders:function(R,H,ie){return K(o.onDidChangeWorkspace)(R,H,ie)},asRelativePath:(R,H)=>o.getRelativePath(R,H),findFiles:(R,H,ie,je)=>o.findFiles(R,H,ie,Se.identifier,je),findFiles2:(R,H,ie)=>(Je(Se,"findFiles2"),o.findFiles2(R,H,Se.identifier,ie)),findTextInFiles:(R,H,ie,je)=>{Je(Se,"findTextInFiles");let pt,is;return typeof H=="object"?(pt=H,is=ie):(pt={},is=H,je=ie),o.findTextInFiles(R,pt||{},is,Se.identifier,je)},save:R=>o.save(R),saveAs:R=>o.saveAs(R),saveAll:R=>o.saveAll(R),applyEdit(R,H){return bc.applyWorkspaceEdit(R,Se,H)},createFileSystemWatcher:(R,H,ie,je)=>{let pt;return typeof H=="boolean"?pt={ignoreCreateEvents:!!H,ignoreChangeEvents:!!ie,ignoreDeleteEvents:!!je,correlate:!1}:H&&(Je(Se,"createFileSystemWatcher"),pt={...H,correlate:!0}),ir.createFileSystemWatcher(o,Se,R,pt)},get textDocuments(){return Qe.getAllDocumentData().map(R=>R.document)},set textDocuments(R){throw new cR("textDocuments")},openTextDocument(R){let H;const ie=R;if(typeof R=="string")H=Promise.resolve(P.file(R));else if(P.isUri(R))H=Promise.resolve(R);else if(!ie||typeof ie=="object")H=Qe.createDocumentData(ie);else throw new Error("illegal argument - uriOrFileNameOrOptions");return H.then(je=>(je.scheme===_e.vscodeRemote&&!je.authority&&m.report("workspace.openTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority."),Qe.ensureDocumentData(je).then(pt=>pt.document)))},onDidOpenTextDocument:(R,H,ie)=>K(Qe.onDidAddDocument)(R,H,ie),onDidCloseTextDocument:(R,H,ie)=>K(Qe.onDidRemoveDocument)(R,H,ie),onDidChangeTextDocument:(R,H,ie)=>K(Qe.onDidChangeDocument)(R,H,ie),onDidSaveTextDocument:(R,H,ie)=>K(Qe.onDidSaveDocument)(R,H,ie),onWillSaveTextDocument:(R,H,ie)=>K(Oe.getOnWillSaveTextDocumentEvent(Se))(R,H,ie),get notebookDocuments(){return wt.notebookDocuments.map(R=>R.apiNotebook)},async openNotebookDocument(R,H){let ie;if(P.isUri(R))ie=R,await wt.openNotebookDocument(R);else if(typeof R=="string")ie=P.revive(await wt.createNotebookDocument({viewType:R,content:H}));else throw new Error("Invalid arguments");return wt.getNotebookDocument(ie).apiNotebook},onDidSaveNotebookDocument(R,H,ie){return K(Nt.onDidSaveNotebookDocument)(R,H,ie)},onDidChangeNotebookDocument(R,H,ie){return K(Nt.onDidChangeNotebookDocument)(R,H,ie)},onWillSaveNotebookDocument(R,H,ie){return K(Ro.getOnWillSaveNotebookDocumentEvent(Se))(R,H,ie)},get onDidOpenNotebookDocument(){return K(wt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return K(wt.onDidCloseNotebookDocument)},registerNotebookSerializer(R,H,ie,je){return wt.registerNotebookSerializer(Se,R,H,ie,Cd(Se,"notebookLiveShare")?je:void 0)},onDidChangeConfiguration:(R,H,ie)=>K(cd.onDidChangeConfiguration)(R,H,ie),getConfiguration(R,H){return H=arguments.length===1?void 0:H,cd.getConfiguration(R,H,Se)},registerTextDocumentContentProvider(R,H){return Tt.registerTextDocumentContentProvider(R,H)},registerTaskProvider:(R,H)=>(m.report("window.registerTaskProvider",Se,"Use the corresponding function on the 'tasks' namespace instead"),j.registerTaskProvider(Se,R,H)),registerFileSystemProvider(R,H,ie){return pa(gs.registerFileSystemProvider(Se,R,H,ie),i.addFileSystemProvider(R,H,ie))},get fs(){return i.value},registerFileSearchProvider:(R,H)=>(Je(Se,"fileSearchProvider"),J.registerFileSearchProvider(R,H)),registerTextSearchProvider:(R,H)=>(Je(Se,"textSearchProvider"),J.registerTextSearchProvider(R,H)),registerAITextSearchProvider:(R,H)=>(Je(Se,"aiTextSearchProvider"),Je(Se,"textSearchProvider"),J.registerAITextSearchProvider(R,H)),registerRemoteAuthorityResolver:(R,H)=>(Je(Se,"resolvers"),s.registerRemoteAuthorityResolver(R,H)),registerResourceLabelFormatter:R=>(Je(Se,"resolvers"),Tl.$registerResourceLabelFormatter(R)),getRemoteExecServer:R=>(Je(Se,"resolvers"),s.getRemoteExecServer(R)),onDidCreateFiles:(R,H,ie)=>K(ir.onDidCreateFile)(R,H,ie),onDidDeleteFiles:(R,H,ie)=>K(ir.onDidDeleteFile)(R,H,ie),onDidRenameFiles:(R,H,ie)=>K(ir.onDidRenameFile)(R,H,ie),onWillCreateFiles:(R,H,ie)=>K(ir.getOnWillCreateFileEvent(Se))(R,H,ie),onWillDeleteFiles:(R,H,ie)=>K(ir.getOnWillDeleteFileEvent(Se))(R,H,ie),onWillRenameFiles:(R,H,ie)=>K(ir.getOnWillRenameFileEvent(Se))(R,H,ie),openTunnel:R=>(Je(Se,"tunnels"),p.openTunnel(Se,R).then(H=>{if(!H)throw new Error("cannot open tunnel");return H})),get tunnels(){return Je(Se,"tunnels"),p.getTunnels()},onDidChangeTunnels:(R,H,ie)=>(Je(Se,"tunnels"),K(p.onDidChangeTunnels)(R,H,ie)),registerPortAttributesProvider:(R,H)=>(Je(Se,"portsAttributes"),p.registerPortsAttributesProvider(R,H)),registerTunnelProvider:(R,H)=>(Je(Se,"tunnelFactory"),p.registerTunnelProvider(R,H)),registerTimelineProvider:(R,H)=>(Je(Se,"timeline"),Fc.registerTimelineProvider(R,H,Se.identifier,F.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:R=>(Je(Se,"workspaceTrust"),o.requestWorkspaceTrust(R)),onDidGrantWorkspaceTrust:(R,H,ie)=>K(o.onDidGrantWorkspaceTrust)(R,H,ie),registerEditSessionIdentityProvider:(R,H)=>(Je(Se,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(R,H)),onWillCreateEditSessionIdentity:(R,H,ie)=>(Je(Se,"editSessionIdentityProvider"),K(o.getOnWillCreateEditSessionIdentityEvent(Se))(R,H,ie)),registerCanonicalUriProvider:(R,H)=>(Je(Se,"canonicalUriProvider"),o.registerCanonicalUriProvider(R,H)),getCanonicalUri:(R,H,ie)=>(Je(Se,"canonicalUriProvider"),o.provideCanonicalUri(R,H,ie))},No={get inputBox(){return m.report("scm.inputBox",Se,"Use 'SourceControl.inputBox' instead"),_c.getLastInputBox(Se)},createSourceControl(R,H,ie){return _c.createSourceControl(Se,R,H,ie)}},mn={createCommentController(R,H){return Yh.createCommentController(Se,R,H)}},ve={get activeDebugSession(){return U.activeDebugSession},get activeDebugConsole(){return U.activeDebugConsole},get breakpoints(){return U.breakpoints},get activeStackItem(){return U.activeStackItem},registerDebugVisualizationProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationProvider(Se,R,H)},registerDebugVisualizationTreeProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationTree(Se,R,H)},onDidStartDebugSession(R,H,ie){return K(U.onDidStartDebugSession)(R,H,ie)},onDidTerminateDebugSession(R,H,ie){return K(U.onDidTerminateDebugSession)(R,H,ie)},onDidChangeActiveDebugSession(R,H,ie){return K(U.onDidChangeActiveDebugSession)(R,H,ie)},onDidReceiveDebugSessionCustomEvent(R,H,ie){return K(U.onDidReceiveDebugSessionCustomEvent)(R,H,ie)},onDidChangeBreakpoints(R,H,ie){return K(U.onDidChangeBreakpoints)(R,H,ie)},onDidChangeActiveStackItem(R,H,ie){return K(U.onDidChangeActiveStackItem)(R,H,ie)},registerDebugConfigurationProvider(R,H,ie){return U.registerDebugConfigurationProvider(R,H,ie||x6.Initial)},registerDebugAdapterDescriptorFactory(R,H){return U.registerDebugAdapterDescriptorFactory(Se,R,H)},registerDebugAdapterTrackerFactory(R,H){return U.registerDebugAdapterTrackerFactory(R,H)},startDebugging(R,H,ie){return!ie||typeof ie=="object"&&"configuration"in ie?U.startDebugging(R,H,{parentSession:ie}):U.startDebugging(R,H,ie||{})},stopDebugging(R){return U.stopDebugging(R)},addBreakpoints(R){return U.addBreakpoints(R)},removeBreakpoints(R){return U.removeBreakpoints(R)},asDebugSourceUri(R,H){return U.asDebugSourceUri(R,H)}},ct={registerTaskProvider:(R,H)=>j.registerTaskProvider(Se,R,H),fetchTasks:R=>j.fetchTasks(R),executeTask:R=>j.executeTask(Se,R),get taskExecutions(){return j.taskExecutions},onDidStartTask:(R,H,ie)=>K(j.onDidStartTask)(R,H,ie),onDidEndTask:(R,H,ie)=>K(j.onDidEndTask)(R,H,ie),onDidStartTaskProcess:(R,H,ie)=>K(j.onDidStartTaskProcess)(R,H,ie),onDidEndTaskProcess:(R,H,ie)=>K(j.onDidEndTaskProcess)(R,H,ie)},Ht={createNotebookController(R,H,ie,je,pt){return Vi.createNotebookController(Se,R,H,ie,je,Cd(Se,"notebookMessaging")?pt:void 0)},registerNotebookCellStatusBarItemProvider:(R,H)=>wt.registerNotebookCellStatusBarItemProvider(Se,R,H),createRendererMessaging(R){return Gn.createRendererMessaging(Se,R)},createNotebookControllerDetectionTask(R){return Je(Se,"notebookKernelSource"),Vi.createNotebookControllerDetectionTask(Se,R)},registerKernelSourceActionProvider(R,H){return Je(Se,"notebookKernelSource"),Vi.registerKernelSourceActionProvider(Se,R,H)},onDidChangeNotebookCellExecutionState(R,H,ie){return Je(Se,"notebookCellExecutionState"),K(Vi.onDidChangeNotebookCellExecutionState)(R,H,ie)}},Ei={t(...R){if(typeof R[0]=="string"){const H=R.shift(),ie=!R||typeof R[0]!="object"?R:R[0];return me.getMessage(Se.identifier.value,{message:H,args:ie})}return me.getMessage(Se.identifier.value,R[0])},get bundle(){return me.getBundle(Se.identifier.value)},get uri(){return me.getBundleUri(Se.identifier.value)}},Ut={_version:1,transferActiveChat(R){return Je(Se,"interactive"),ad.transferActiveChat(R)}},G={getRelatedInformation(R,H){return Je(Se,"aiRelatedInformation"),Ca.getRelatedInformation(Se,R,H)},registerRelatedInformationProvider(R,H){return Je(Se,"aiRelatedInformation"),Ca.registerRelatedInformationProvider(Se,R,H)},registerEmbeddingVectorProvider(R,H){return Je(Se,"aiRelatedInformation"),Ld.registerEmbeddingVectorProvider(Se,R,H)}},de={_version:1,registerChatResponseProvider(R,H,ie){return Je(Se,"chatProvider"),S.registerLanguageModel(Se,R,H,ie)},registerChatVariableResolver(R,H,ie,je,pt,is,Ss,ld){return Je(Se,"chatVariableResolver"),vc.registerVariableResolver(Se,R,H,ie,je,pt,is,Ss,ld?.id)},registerMappedEditsProvider(R,H){return Je(Se,"mappedEditsProvider"),ki.registerMappedEditsProvider(Se,R,H)},createChatParticipant(R,H){return ad.createChatAgent(Se,R,H)},createDynamicChatParticipant(R,H,ie){return Je(Se,"chatParticipantPrivate"),ad.createDynamicChatAgent(Se,R,H,ie)},attachContext(R,H,ie){return Je(Se,"chatVariableResolver"),vc.attachContext(R,H,ie)}},L={selectChatModels:R=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),Promise.resolve([])):S.selectLanguageModels(Se,R??{}),onDidChangeChatModels:(R,H,ie)=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),T.None(R,H,ie)):S.onDidChangeProviders(R,H,ie),get embeddingModels(){return Je(Se,"embeddings"),wc.embeddingsModels},onDidChangeEmbeddingModels:(R,H,ie)=>(Je(Se,"embeddings"),wc.onDidChange(R,H,ie)),registerEmbeddingsProvider(R,H){return Je(Se,"embeddings"),wc.registerEmbeddingsProvider(Se,R,H)},async computeEmbeddings(R,H,ie){return Je(Se,"embeddings"),wc.computeEmbeddings(R,H,ie)}},ne={registerSpeechProvider(R,H){return Je(Se,"speech"),Fu.registerProvider(Se.identifier,R,H)}};return{version:e.version,ai:G,authentication:ri,commands:ts,comments:mn,chat:de,debug:ve,env:Os,extensions:Cc,interactive:Ut,l10n:Ei,languages:Ou,lm:L,notebooks:Ht,scm:No,speech:ne,tasks:ct,tests:sr,window:le,workspace:_r,Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:gOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:fOe,CancellationError:Tc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ya,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CommentThreadApplicability:iG,CompletionItem:H6,CompletionItemKind:en,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:vm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,VerboseHover:ise,HoverVerbosityAction:lke,IndentAction:Ga,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:pOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TerminalShellExecutionCommandLineConfidence:NM,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentPasteTriggerKind:hke,DocumentDropEdit:_se,DocumentDropOrPasteEditKind:u4,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:mOe,NotebookRendererScript:vOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:_Oe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,NotebookVariablesRequestKind:lG,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,TestCoverageCount:kX,FileCoverage:uG,FileCoverage2:uG,StatementCoverage:Tot,BranchCoverage:Rot,DeclarationCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:wOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:bOe,TabInputTerminal:COe,TabInputInteractiveWindow:yOe,TabInputChat:SOe,TabInputTextMultiDiff:Not,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,DebugStackFrame:Cot,DebugThread:yot,RelatedInformationType:Nse,SpeechToTextStatus:Pse,TextToSpeechStatus:wke,PartialAcceptTriggerKind:IR,KeywordRecognitionStatus:Fse,ChatResponseMarkdownPart:Jhe,ChatResponseFileTreePart:Xhe,ChatResponseAnchorPart:Zhe,ChatResponseProgressPart:mG,ChatResponseProgressPart2:Fot,ChatResponseReferencePart:GI,ChatResponseWarningPart:_G,ChatResponseTextEditPart:vG,ChatResponseMarkdownWithVulnerabilitiesPart:fG,ChatResponseCommandButtonPart:eue,ChatResponseDetectedParticipantPart:pG,ChatResponseConfirmationPart:_ke,ChatRequestTurn:Oot,ChatResponseTurn:Bot,ChatLocation:cb,LanguageModelChatMessageRole:Iv,LanguageModelChatMessage:v8,LanguageModelChatMessage2:v8,LanguageModelChatSystemMessage:I7t,LanguageModelChatUserMessage:L7t,LanguageModelChatAssistantMessage:T7t,LanguageModelError:qg,NewSymbolName:D7t,NewSymbolNameTag:gke,NewSymbolNameTriggerKind:tG,InlineEdit:R7t,InlineEditTriggerKind:wG}}}var $X;let iRe=class{constructor(e,t,i,s,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=s,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),vs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();vs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new Lni(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(nRe)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(sRe,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};iRe=D([_(2,be),_(3,hD),_(4,_L),_(5,Sg),_(6,Ze)],iRe);var tF;let nRe=(tF=class{constructor(e){if(e.environment.appRoot&&$X.aliased.size){const t=Iu(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",s=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${s})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,s,o]=t,r=$X.aliased.get(s);if(r!==void 0)return console.warn(`${s} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},$X=tF,tF.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),tF);nRe=$X=D([_(0,Sg)],nRe);class Lni{constructor(e,t,i,s,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=s,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new $a}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let s=this._extApiImpl.get(i.identifier);return s||(s=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,s)),s}if(!this._defaultApiImpl){let s="";this._extensionPaths.forEach((o,r)=>s+=` ${r} -> ${o.identifier.value} +`,r.map(d=>new O(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const S6e="vs/workbench/api/common/extHostNotebook",oR=class oR{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,s,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=s,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new wi,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new I,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new I,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new I,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new I,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new F_("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Ue.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Ue.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Ue.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===Fs.NotebookCellActionContext){const l=c.notebookEditor?.notebookUri,d=c.cell.handle,u=this._documents.get(l)?.getCell(d);if(u)return u.apiCell}if(c&&c.$mid===Fs.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),oR._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(s=>voe.from(s)).filter(s=>s!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,exclusive:t.exclusive||!1}}registerNotebookCellStatusBarItemProvider(e,t,i){const s=oR._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?oR._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(s,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(s,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new oo(()=>{this._notebookStatusBarItemProviders.delete(s),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(s,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&ok.from(e.content)});return P.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),s=this._documents.get(P.revive(i));return ws(s?.apiNotebook)}async showNotebookDocument(e,t){P.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(ES.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const s=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=s&&this._editors.get(s)?.apiEditor;if(o)return o;throw s?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,s){const o=this._notebookStatusBarItemProviders.get(e),r=P.revive(t),a=this._documents.get(r);if(!a||!o)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await o.provideCellStatusBarItems(c.apiCell,s);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>gIe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,s,o){if(Xv(t))throw new Error("viewType cannot be empty or just whitespace");const r=this._handlePool++;return this._notebookSerializer.set(r,{viewType:t,serializer:i,options:s}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,pIe.from(s),oR._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.deserializeNotebook(t.buffer,i);return new $h(ok.from(o))}async $notebookToData(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const o=await s.serializer.serializeNotebook(ok.to(t.value),i);return ze.wrap(o)}async $saveNotebook(e,t,i,s,o){const r=P.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${r.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(r);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(r.scheme))throw new Ah(g(S6e,0,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Zi.FILE_PERMISSION_DENIED);const l={metadata:YX(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new ej(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=YX(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,s),o.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,o);if(o.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${r.toString()}`),await this._extHostFileSystem.value.writeFile(r,d),this.trace(`Finished write versionId: ${i} ${r.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(r.scheme),u=await this._extHostFileSystem.value.stat(r),f={name:h.basename(r),isFile:(u.type&an.File)!==0,isDirectory:(u.type&an.Directory)!==0,isSymbolicLink:(u.type&an.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&vm.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&vm.Locked),etag:_ee({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,s,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new o1;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const w={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:z1.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(w,f,b=>{b.forEach(C=>{a.has(C)||s.some(S=>m.isFromSettings&&!S.isFromSettings?!1:S.filenamePatterns.some(M=>Wjt(M,C)))||a.add(C)})}).catch(b=>{if(b.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw b})}))))})(i,o,t);const l=new wi;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((w,b)=>w+b.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(b=>p.push({input:b.document.getText(),outputs:b.outputs.flatMap(C=>C.items.map(y=>y.data.toString()))}));else{const w=await this._extHostFileSystem.value.readFile(u),b=ze.fromString(w.toString()),C=await r.deserializeNotebook(b.buffer,o);if(o.isCancellationRequested)return;ok.from(C).cells.forEach(S=>p.push({input:S.source,outputs:S.outputs.flatMap(M=>M.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((w,b)=>{const C=t.contentPattern.pattern,y=new jii(w.input,void 0,w.outputs),S=y.findInInputs(C),M=y.findInOutputs(C),k=M.flatMap(F=>y6e(F.matches,F.textBuffer)).map((F,N)=>(F.webviewIndex=N,F));if(S.length>0||M.length>0){const F={index:b,contentResults:y6e(S,y.inputTextBuffer),webviewResults:k};f.push(F)}});const v={resource:u,cellResults:f};l.set(u,v);return}catch{return}});return await Promise.all(h),{limitHit:d,results:[...l.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==zv&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(s.apiNotebook));for(const o of this._editors.values())o.notebookData.uri.toString()===i.toString()&&this._editors.delete(o.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const s=P.revive(i.uri);if(this._documents.has(s))throw new Error(`adding EXISTING notebook ${s} `);const o=new FTe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,s,i);t.push(...i.cells.map(r=>PTe.asModelAddData(r))),this._documents.get(s)?.dispose(),this._documents.set(s,o),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(o.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=P.revive(t.documentUri),s=this._documents.get(i);s&&this._createExtHostEditor(s,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const s=t.has(i.id);i._acceptVisibility(s)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=Et.String.with("notebookType","A notebook type"),i=new Vn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new Et("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>ze.wrap(o))],new In("Notebook Data",o=>ok.to(o.value))),s=new Vn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new Et("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new $h(ok.from(o)))],new In("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(s)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};oR._notebookStatusBarItemProviderHandlePool=0;let OTe=oR;class Kii{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._onWillSaveNotebookDocumentEvent=new EI}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,s)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,s)}}async $participateInSave(e,t,i){const s=P.revive(e),o=this._notebooksAndEditors.getNotebookDocument(s);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:foe.to(t)},i,async(c,l)=>{const d=Date.now(),h=await await Promise.resolve(c);Date.now()-d>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier),!i.isCancellationRequested&&h&&(h instanceof q1?r.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(r.length===0)return!0;const a={edits:[]};for(const c of r){const{edits:l}=lf.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new $h(a))}}class Yii{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new I,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new I,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,s){const r=this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptModelChanged(t.value,i,s);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(P.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(P.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let BTe=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new I,this._onDidChangeNotebookEditorVisibleRanges=new I,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(ES.to)),t.selections&&i._acceptSelections(t.selections.selections.map(ES.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(yd.to(e[t]))}};BTe=D([_(0,Ze)],BTe);const Jii=100;let WTe=class{constructor(e,t,i,s,o){this._initData=t,this._extHostNotebook=i,this._commands=s,this._logService=o,this._activeExecutions=new wi,this._activeNotebookExecutions=new wi,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this._onDidChangeCellExecutionState=new I,this.onDidChangeNotebookCellExecutionState=this._onDidChangeCellExecutionState.event,this.id=0,this.variableStore={},this._proxy=e.getProxy(Ue.MainThreadNotebookKernels);const r=new Vn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new Et("options","Select kernel options",c=>!0,c=>{if(c&&"notebookEditor"in c&&"id"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);return{id:c.id,extension:c.extension,notebookEditorId:l}}else if(c&&"notebookEditor"in c){const l=this._extHostNotebook.getIdByEditor(c.notebookEditor);if(l===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${c.notebookEditor.notebook.uri.toString()}`);return{notebookEditorId:l}}return c})],In.Void),a=new Vn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[Et.Uri],new In("A promise that resolves to an array of variables",(c,l)=>c.map(d=>({variable:{name:d.name,value:d.value,expression:d.expression,type:d.type,language:d.language},hasNamedChildren:d.hasNamedChildren,indexedChildrenCount:d.indexedChildrenCount}))));this._commands.registerApiCommand(r),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,s,o,r){for(const S of this._kernelData.values())if(S.controller.id===t&&Cn.equals(e.identifier,S.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,c=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const l=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`);let d=!1;const h=new I,u=new I,f={id:xY(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:s||e.identifier.value,preloads:r?r.map(woe.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(S=>{console.log(S),d=!0});let w=0;const b=()=>{if(d)return;const S=++w;Promise.resolve().then(()=>{S===w&&this._proxy.$updateKernel(a,f)})},C=new wi,y={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(S){f.label=S??e.displayName??e.name,b()},get detail(){return f.detail??""},set detail(S){f.detail=S,b()},get description(){return f.description??""},set description(S){f.description=S,b()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(S){f.supportedLanguages=S,b()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(S){f.supportsExecutionOrder=S,b()},get rendererScripts(){return f.preloads?f.preloads.map(woe.to):[]},get executeHandler(){return p},set executeHandler(S){p=S??l},get interruptHandler(){return m},set interruptHandler(S){m=S,f.supportsInterrupt=!!S,b()},set variableProvider(S){Je(e,"notebookVariableProvider"),v=S,f.hasVariableProvider=!!S,S?.onDidChangeVariables(M=>c._proxy.$variablesUpdated(M.uri)),b()},get variableProvider(){return v},createNotebookCellExecution(S){if(d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.notebook.uri.toString()}`);return c._createNotebookCellExecution(S,xY(e.identifier,this.id))},createNotebookExecution(S){if(Je(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!C.has(S.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(C.keys()).map(M=>M.toString())),new Error(`notebook controller is NOT associated to notebook: ${S.uri.toString()}`);return c._createNotebookExecution(S,xY(e.identifier,this.id))},dispose:()=>{d||(this._logService.trace(`NotebookController[${a}], DISPOSED`),d=!0,this._kernelData.delete(a),h.dispose(),u.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(S,M){M===cG.Hidden&&Je(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,S.uri,M)},onDidReceiveMessage:u.event,postMessage(S,M){return Je(e,"notebookMessaging"),c._proxy.$postMessage(a,M&&c._extHostNotebook.getIdByEditor(M),S)},asWebviewUri(S){return Je(e,"notebookMessaging"),O8(S,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:y,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:C}),y}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return xY(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,s=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),s._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const s=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?s:void 0,r=this;this._kernelSourceActionProviders.set(s,i),this._logService.trace(`NotebookKernelSourceActionProvider[${s}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(s,s,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(s),r._proxy.$removeKernelSourceActionProvider(s,s),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const s=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>fIe.from(r,this._commands.converter,s))}return[]}$acceptNotebookAssociation(e,t,i){const s=this._kernelData.get(e);if(s){const o=this._extHostNotebook.getNotebookDocument(P.revive(t));i?s.associatedNotebooks.set(o.uri,!0):s.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),s.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t)),r=[];for(const a of i){const c=o.getCell(a);c&&r.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,o.uri.toString(),r.length),await s.controller.executeHandler.call(s.controller,r,o.apiNotebook,s.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getNotebookDocument(P.revive(t));if(s.controller.interruptHandler)await s.controller.interruptHandler.call(s.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(s.controller.interruptHandler){const r=this._activeNotebookExecutions.get(o.uri);this._activeNotebookExecutions.delete(o.uri),i.length&&Array.isArray(r)&&r.length&&r.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,s,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(P.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(s!==void 0){if(h=this.variableStore[s],!h)return}else this.variableStore={};const u=o==="named"?lG.Named:lG.Indexed,f=d.provideVariables(l.apiNotebook,h,u,r,a);let p=0;for await(const m of f){if(a.isCancellationRequested)return;const v={id:this.id++,name:m.variable.name,value:m.variable.value,type:m.variable.type,interfaces:m.variable.interfaces,language:m.variable.language,expression:m.variable.expression,hasNamedChildren:m.hasNamedChildren,indexedChildrenCount:m.indexedChildrenCount,extensionId:c.extensionId.value};if(this.variableStore[v.id]=m.variable,this._proxy.$receiveVariable(t,v),p++>=Jii)return}}$acceptKernelMessageFromRenderer(e,t,i){const s=this._kernelData.get(e);if(!s)return;const o=this._extHostNotebook.getEditorById(t);s.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(P.revive(e)).getCell(t);if(o){const r=i?uIe.to(i):qF.Idle;r!==void 0&&this._onDidChangeCellExecutionState.fire({cell:o.apiCell,state:r})}}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const s=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!s)throw new Error("invalid cell");if(this._activeExecutions.has(s.uri))throw new Error(`duplicate execution for ${s.uri}`);const o=new HTe(t,s,this._proxy);this._activeExecutions.set(s.uri,o);const r=o.onDidChangeState(()=>{o.state===hb.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(s.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),s=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(s)throw new Error(`duplicate cell execution for ${s.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new UTe(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===QA.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};WTe=D([_(4,Ze)],WTe);var hb;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(hb||(hb={}));const Ele=class Ele extends ${get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=Ele.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=hb.Init,this._tokenSource=this._register(new ai),this._collector=new Xii(10,s=>this.update(s)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new $h(t))}verifyStateForOutput(){if(this._state===hb.Init)throw new Error("Must call start before modifying cell output");if(this._state===hb.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=oG.ensureUniqueMimeTypes(t.items,!0);return i===t.items?Y1.from(t):Y1.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const s=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(Kb(e));return this.updateSoon({editType:CI.Output,cellHandle:s,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=oG.ensureUniqueMimeTypes(Kb(e),!0),this.updateSoon({editType:CI.OutputItems,items:e.map(N4.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:CI.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===hb.Resolved||e._state===hb.Started)throw new Error("Cannot call start again");e._state=hb.Started,e._onDidChangeState.fire(),e.update({editType:CI.ExecutionState,runStartTime:i})},end(i,s,o){if(e._state===hb.Resolved)throw new Error("Cannot call resolve twice");e._state=hb.Resolved,e._onDidChangeState.fire(),e._collector.flush();const r=o?{message:o.message,stack:o.stack,location:o?.location?{startLineNumber:o.location.start.line,startColumn:o.location.start.character,endLineNumber:o.location.end.line,endColumn:o.location.end.character}:void 0,uri:o.uri}:void 0;e._proxy.$completeExecution(e._handle,new $h({runEndTime:s,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!0)},replaceOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!1)},appendOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!0)},replaceOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!1)}})}};Ele.HANDLE=0;let HTe=Ele;var QA;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(QA||(QA={}));const xle=class xle extends ${get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=xle.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=QA.Init,this._tokenSource=this._register(new ai),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===QA.Resolved||this._state===QA.Started)throw new Error("Cannot call start again");this._state=QA.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===QA.Resolved)throw new Error("Cannot call resolve twice");this._state=QA.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};xle.HANDLE=0;let UTe=xle;class Xii{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new sd,this.startedTimer=Date.now(),Ta(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function xY(n,e){return`${n.value}/${e}`}class Zii{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Ue.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const s=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:s.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(s=>s.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(s,o,r)=>this.getOrCreateEmitterFor(t).event(s,o,r),postMessage:(s,o)=>{gq.apiEditorsToExtHost.has(s)&&([s,o]=[o,s]);const r=o&&gq.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,s)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new I({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class eni{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Ue.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Je(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),Ee(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,s){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,s)}async $readProfile(e,t,i){const s=this.handlers.get(e);if(!s)throw new Error(`Unknown handler with id: ${e}`);return s.readProfile(zt(t)?t:P.revive(t),i)}}class tni{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const s=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(s,{location:dIe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(er),this._withProgress(s,i,!!a)}_withProgress(e,t,i){let s;i&&(s=new ai,this._mapHandleToCancellationSource.set(e,s));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),s?.dispose()};let r;try{r=t(new VTe(this._proxy,e),i&&s?s.token:qe.None)}catch(a){throw o(e),a}return r.then(a=>o(e),a=>o(e)),r}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function ini(n,e){return n.message=e.message,typeof e.increment=="number"&&(typeof n.increment=="number"?n.increment+=e.increment:n.increment=e.increment),n}class VTe extends cf{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}VTe.__decorator=D([bxt(100,(n,e)=>ini(n,e),()=>Object.create(null))],VTe.prototype,"throttledReport",null);const Dle=class Dle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const s=P.revive(t),o=this.providers.get(e);return o?Zu(()=>o.provideOriginalResource(s,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,s){const o=Dle.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,D4.from(e,this.uriTransformer),i,s),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};Dle.handlePool=0;let zTe=Dle;function nni(n,e,t){const i=n.getProxy(Ue.MainThreadQuickOpen);class s{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,w=qe.None){this._onDidSelectItem=void 0;const b=Promise.resolve(m),C=++this._instances,y=i.$show(C,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},w),S={},M=y.then(()=>S);return Promise.race([M,b]).then(k=>{if(k===S)return;const F=Cd(p,"quickPickItemTooltip");return b.then(N=>{const z=[];for(let U=0;U{v.onDidSelectItem(N[U])}),i.$setItems(C,z),y.then(U=>{if(typeof U=="number")return N[U];if(Array.isArray(U))return U.map(J=>N[J])})})}).then(void 0,k=>{if(!Na(k))return i.$setError(C,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=qe.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Na(v))return Promise.reject(v)})}async $validateInput(p){if(!this._validateInput)return;const m=await this._validateInput(p);if(!m||typeof m=="string")return m;let v;switch(m.severity){case BM.Info:v=nt.Info;break;case BM.Warning:v=nt.Warning;break;case BM.Error:v=nt.Error;break;default:v=m.message?nt.Error:nt.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=qe.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const w=await this._workspace.getWorkspaceFolders2();if(w)return w.find(b=>b.uri.toString()===v.uri.toString())}createQuickPick(p){const m=new d(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}createInputBox(p){const m=new h(p,()=>this._sessions.delete(m._id));return this._sessions.set(m._id,m),m}$onDidChangeValue(p,m){this._sessions.get(p)?._fireDidChangeValue(m)}$onDidAccept(p){this._sessions.get(p)?._fireDidAccept()}$onDidChangeActive(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeActive(m)}$onDidChangeSelection(p,m){const v=this._sessions.get(p);v instanceof d&&v._fireDidChangeSelection(m)}$onDidTriggerButton(p,m){this._sessions.get(p)?._fireDidTriggerButton(m)}$onDidTriggerItemButton(p,m,v){const w=this._sessions.get(p);w instanceof d&&w._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extensionId=p,this._onDidDispose=m,this._id=d._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new I,this._onDidChangeValueEmitter=new I,this._onDidTriggerButtonEmitter=new I,this._onDidHideEmitter=new I,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(p){this._title=p,this.update({title:p})}get step(){return this._steps}set step(p){this._steps=p,this.update({step:p})}get totalSteps(){return this._totalSteps}set totalSteps(p){this._totalSteps=p,this.update({totalSteps:p})}get enabled(){return this._enabled}set enabled(p){this._enabled=p,this.update({enabled:p})}get busy(){return this._busy}set busy(p){this._busy=p,this.update({busy:p})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(p){this._ignoreFocusOut=p,this.update({ignoreFocusOut:p})}get value(){return this._value}set value(p){this._value=p,this.update({value:p})}get placeholder(){return this._placeholder}set placeholder(p){this._placeholder=p,this.update({placeholder:p})}get buttons(){return this._buttons}set buttons(p){this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((m,v)=>{const w=m===v4.Back?-1:v;this._handlesToButtons.set(w,m)}),this.update({buttons:p.map((m,v)=>({...l(m.iconPath),tooltip:m.tooltip,handle:m===v4.Back?-1:v}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(p){this._value=p,this._onDidChangeValueEmitter.fire(p)}_fireDidTriggerButton(p){const m=this._handlesToButtons.get(p);m&&this._onDidTriggerButtonEmitter.fire(m)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=St(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(p){if(!this._disposed){for(const m of Object.keys(p)){const v=p[m];this._pendingUpdate[m]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};u._nextId=1;let o=u;function r(f){if(f instanceof fg)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?P.file(p):p,light:typeof m=="string"?P.file(m):m}}function a(f){return typeof f=="object"&&"light"in f?f.light:f}function c(f){return typeof f=="object"&&"dark"in f?f.dark:f}function l(f){const p=r(f);let m,v;return"id"in p?v=$e.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p.identifier,m),this.extension=p,this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new I,this._selectedItems=[],this._onDidChangeSelectionEmitter=new I,this._onDidTriggerItemButtonEmitter=new I,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(p){this._items=p.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),p.forEach((w,b)=>{this._handlesToItems.set(b,w),this._itemsToHandles.set(w,b)});const m=Cd(this.extension,"quickPickItemTooltip"),v=[];for(let w=0;w({...l(y.iconPath),tooltip:y.tooltip,handle:S}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(p){this._canSelectMany=p,this.update({canSelectMany:p})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(p){this._matchOnDescription=p,this.update({matchOnDescription:p})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(p){this._matchOnDetail=p,this.update({matchOnDetail:p})}get sortByLabel(){return this._sortByLabel}set sortByLabel(p){this._sortByLabel=p,this.update({sortByLabel:p})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(p){this._keepScrollPosition=p,this.update({keepScrollPosition:p})}get activeItems(){return this._activeItems}set activeItems(p){this._activeItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({activeItems:this._activeItems.map(m=>this._itemsToHandles.get(m))})}get selectedItems(){return this._selectedItems}set selectedItems(p){this._selectedItems=p.filter(m=>this._itemsToHandles.has(m)),this.update({selectedItems:this._selectedItems.map(m=>this._itemsToHandles.get(m))})}_fireDidChangeActive(p){const m=Ui(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Ui(p.map(v=>this._handlesToItems.get(v)));this._selectedItems=m,this._onDidChangeSelectionEmitter.fire(m)}_fireDidTriggerItemButton(p,m){const v=this._handlesToItems.get(p);if(!v||!v.buttons||!v.buttons.length)return;const w=v.buttons[m];w&&this._onDidTriggerItemButtonEmitter.fire({button:w,item:v})}}class h extends o{constructor(p,m){super(p.identifier,m),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(p){this._password=p,this.update({password:p})}get prompt(){return this._prompt}set prompt(p){this._prompt=p,this.update({prompt:p})}get valueSelection(){return this._valueSelection}set valueSelection(p){this._valueSelection=p,this.update({valueSelection:p})}get validationMessage(){return this._validationMessage}set validationMessage(p){this._validationMessage=p,p?typeof p=="string"?this.update({validationMessage:p,severity:nt.Error}):this.update({validationMessage:p.message,severity:p.severity??nt.Error}):this.update({validationMessage:void 0,severity:nt.Ignore})}}return new s(e,t)}var $Te;function A6e(n){return n instanceof P}function sni(n,e){return n.scheme===_e.file&&e.scheme===_e.file&&jr?n.toString()===e.toString():n.toString().toLowerCase()===e.toString().toLowerCase()}function xme(n){if(n)return typeof n.iconPath=="string"?P.file(n.iconPath):P.isUri(n.iconPath)||$e.isThemeIcon(n.iconPath)?n.iconPath:void 0}function E6e(n){if(n.icon){if(P.isUri(n.icon))return n.icon;if($e.isThemeIcon(n.icon))return n.icon;{const e=n.icon;return{light:e.light,dark:e.dark}}}else return}function Dme(n,e){if(!n.iconPath&&!e.iconPath)return 0;if(n.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof n.iconPath=="string"?n.iconPath:P.isUri(n.iconPath)?n.iconPath.fsPath:n.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:P.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return yJ(t,i)}function oni(n,e){let t=0;if(n.strikeThrough!==e.strikeThrough)return n.strikeThrough?1:-1;if(n.faded!==e.faded)return n.faded?1:-1;if(n.tooltip!==e.tooltip)return(n.tooltip||"").localeCompare(e.tooltip||"");if(t=Dme(n,e),t!==0)return t;if(n.light&&e.light)t=Dme(n.light,e.light);else{if(n.light)return 1;if(e.light)return-1}if(t!==0)return t;if(n.dark&&e.dark)t=Dme(n.dark,e.dark);else{if(n.dark)return 1;if(e.dark)return-1}return t}function rni(n,e){if(n.command!==e.command)return n.commandse(this,hy).$setInputBoxValue(this._sourceControlHandle,e)),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this._sequencer.queue(async()=>se(this,hy).$setInputBoxPlaceholder(this._sourceControlHandle,e)),this._placeholder=e}get validateInput(){return Je(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if(Je(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this._sequencer.queue(async()=>se(this,hy).$setValidationProviderIsEnabled(this._sourceControlHandle,!!e))}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxEnablement(this._sourceControlHandle,e)))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this._sequencer.queue(async()=>se(this,hy).$setInputBoxVisibility(this._sourceControlHandle,e)))}get document(){return Je(this._extension,"scmTextDocument"),se(this,kq).getDocument(this._documentUri)}showValidationMessage(e,t){Je(this._extension,"scmValidation"),this._sequencer.queue(async()=>se(this,hy).$showValidationMessage(this._sourceControlHandle,e,t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}}hy=new WeakMap,kq=new WeakMap;const kle=class kle{get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._sequencer.queue(async()=>this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e))}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._sequencer.queue(async()=>this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features))}get features(){return{hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(e,t,i,s,o,r,a,c){this._proxy=e,this._commands=t,this._sequencer=i,this._sourceControlHandle=s,this._id=o,this._label=r,this.multiDiffEditorEnableViewChanges=a,this._extension=c,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new I,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._hideWhenEmpty=void 0,this.handle=kle._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){const i=this._resourceStatesCommandsMap.get(e);return i?Zu(()=>this._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(x6e),i=PRe(this._resourceSnapshot,e,x6e).map(r=>{const a=r.toInsert.map(c=>{const l=this._resourceHandlePool++;this._resourceStatesMap.set(l,c);const d=c.resourceUri;let h;if(c.command)if(c.command.command==="vscode.open"||c.command.command==="vscode.diff"||c.command.command==="vscode.changes"){const F=new Z;h=this._commands.converter.toInternal(c.command,F),this._resourceStatesDisposablesMap.set(l,F)}else this._resourceStatesCommandsMap.set(l,c.command);const u=Cd(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=xme(c.decorations),v=c.decorations&&xme(c.decorations.light)||m,w=c.decorations&&xme(c.decorations.dark)||m,b=[v,w],C=c.decorations&&c.decorations.tooltip||"",y=c.decorations&&!!c.decorations.strikeThrough,S=c.decorations&&!!c.decorations.faded,M=c.contextValue||"";return{rawResource:[l,d,b,C,y,S,M,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),s=i.map(({start:r,deleteCount:a,toInsert:c})=>[r,a,c.map(l=>l.rawResource)]),o=i.reverse();for(const{start:r,deleteCount:a,toInsert:c}of o){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(r,a,...l);for(const h of d)this._resourceStatesMap.delete(h),this._resourceStatesCommandsMap.delete(h),this._resourceStatesDisposablesMap.get(h)?.dispose(),this._resourceStatesDisposablesMap.delete(h)}return this._resourceSnapshot=e,s}dispose(){this._disposed=!0,this._onDidDispose.fire()}};kle._handlePool=0;let GTe=kle;var Ch;const Ile=class Ile{constructor(e,t,i,s,o,r,a){kt(this,Ch);this._extension=e,this._commands=s,this._id=o,this._label=r,this._rootUri=a,this._sequencer=new Yht,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new Dn,this._commitTemplate=void 0,this._acceptInputDisposables=new Dn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new Dn,this._statusBarDisposables=new Dn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=Ile._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,st(this,Ch,i);const c=P.from({scheme:_e.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._sequencer.queue(()=>se(this,Ch).$registerSourceControl(this.handle,o,r,a,c)),this._inputBox=new dni(e,t,se(this,Ch),this._sequencer,this.handle,c)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{count:e})))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Cd(this._extension,"quickDiffProvider")&&(t=e?.label),this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t}))}get historyProvider(){return Je(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Je(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{hasHistoryProvider:!!e})),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,this._sequencer.queue(async()=>se(this,Ch).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup))}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{commitTemplate:e})))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new Z,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{acceptInputCommand:t}))}get actionButton(){return Je(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Je(this._extension,"scmActionButton"),this._actionButtonDisposables.value=new Z,this._actionButton=e;const t=e!==void 0?{command:this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),secondaryCommands:e.secondaryCommands?.map(i=>i.map(s=>this._commands.converter.toInternal(s,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{actionButton:t??null}))}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&lni(this._statusBarCommands,e))return;this._statusBarDisposables.value=new Z,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));this._sequencer.queue(async()=>se(this,Ch).$updateSourceControl(this.handle,{statusBarCommands:t}))}get selected(){return this._selected}createResourceGroup(e,t,i){const s=Cd(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new GTe(se(this,Ch),this._commands,this._sequencer,this.handle,e,t,s,this._extension),r=T.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,s]of this.createdResourceGroups){s.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});T.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),this._sequencer.queue(async()=>se(this,Ch).$unregisterGroup(this.handle,i.handle))}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const r=i._takeResourceStateSnapshot();r.length>0&&t.push([i.handle,r]),this._groups.set(i.handle,i)}this._sequencer.queue(async()=>se(this,Ch).$registerGroups(this.handle,e,t)),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&this._sequencer.queue(async()=>se(this,Ch).$spliceResourceStates(this.handle,e)),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this._sequencer.queue(async()=>se(this,Ch).$unregisterSourceControl(this.handle))}};Ch=new WeakMap,Ile._handlePool=0;let eO=Ile;eO.__decorator=D([kNe(100)],eO.prototype,"eventuallyAddResourceGroups",null);eO.__decorator=D([kNe(100)],eO.prototype,"eventuallyUpdateResourceStates",null);var eF;let qTe=(eF=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,s){this._commands=t,this._extHostDocuments=i,this.logService=s,this._sourceControls=new Map,this._sourceControlsByExtension=new $a,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Ue.MainThreadSCM),this._telemetry=e.getProxy(Ue.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===Fs.ScmResource){const r=this._sourceControls.get(o.sourceControlHandle);if(!r)return o;const a=r.getResourceGroup(o.groupHandle);return a?a.getResourceState(o.handle):o}else if(o&&o.$mid===Fs.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===Fs.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,s){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,s),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=$Te._handlePool++,r=new eO(e,this._extHostDocuments,this._proxy,this._commands,t,i,s);this._sourceControls.set(o,r);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(r),this._sourceControlsByExtension.set(e.identifier,a),r}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const s=P.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,s.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Zu(()=>o.quickDiffProvider.provideOriginalResource(s,i)).then(r=>r||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,s){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const o=this._sourceControls.get(e);if(!o)return Promise.resolve(void 0);const r=o.getResourceGroup(t);return r?r.$executeResourceCommand(i,s):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const s=this._sourceControls.get(e);return!s||!s.inputBox.validateInput?Promise.resolve(void 0):Zu(()=>s.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Qs.fromStrict(o.message);return r?Promise.resolve([r,o.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemGroupCommonAncestor(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,s)??void 0}async $provideHistoryItems(e,t,i,s){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,s))?.map(a=>({...a,icon:E6e(a)}))??void 0}async $provideHistoryItemSummary(e,t,i,s){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,s);return r?{...r,icon:E6e(r)}:void 0}async $provideHistoryItemChanges(e,t,i,s){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,s)??void 0}},$Te=eF,eF._handlePool=0,eF);qTe=$Te=D([_(3,Ze)],qTe);const Lle=class Lle{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Ue.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:at.to(t.selection),resourceUri:P.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=Lle.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,D4.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};Lle.handlePool=0;let QTe=Lle;const Tle=class Tle{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Ue.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideSpeechToTextSession(r.token,i?{language:i}:void 0);a&&(o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const s=this.providers.get(e);if(!s)return;const o=new Z,r=new ai;this.sessions.set(t,r);const a=await s.provideTextToSpeechSession(r.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),o.add(a.onDidChange(c=>{r.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),o.add(r.token.onCancellationRequested(()=>o.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const s=new Z,o=new ai;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(s.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),s.add(o.token.onCancellationRequested(()=>s.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const s=Tle.ID_POOL++;return this.providers.set(s,i),this.proxy.$registerProvider(s,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(s),this.providers.delete(s)})}};Tle.ID_POOL=1;let jTe=Tle;const Hat="vs/workbench/api/common/extHostStatusBar";var YH,JH;const rR=class rR{constructor(e,t,i,s,o,r=HE.Left,a){kt(this,YH);kt(this,JH);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,st(this,YH,e),st(this,JH,t),o&&s){this._entryId=S7t(s.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?HE.Left:HE.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(rR.ID_GEN++);this._extension=s,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(Kc(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!rR.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new Z,typeof e=="string"?this._command={fromApi:e,internal:se(this,JH).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:se(this,JH).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,se(this,YH).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=g(Hat,0,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=rR.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const s=Qs.fromStrict(this._tooltip);se(this,YH).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,s,this._command?.internal,i,this._backgroundColor,this._alignment===HE.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};YH=new WeakMap,JH=new WeakMap,rR.ID_GEN=0,rR.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new g4("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new g4("statusBarItem.warningForeground")]]);let KTe=rR;class hni{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",HE.Left,Number.MIN_VALUE),this._item.name=g(Hat,1,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new oo(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class uni{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Ue.MainThreadStatusBar),this._commands=t,this._statusMessage=new hni(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,s){return new KTe(this._proxy,this._commands,this._existingItems,e,t,i,s)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let s;return typeof t=="number"?s=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new oo(()=>{i.dispose(),clearTimeout(s)})}}const ly="vs/workbench/contrib/testing/common/constants";var D6e;(function(n){n.ViewletId="workbench.view.extension.test",n.ExplorerViewId="workbench.view.testing",n.OutputPeekContributionId="editor.contrib.testingOutputPeek",n.DecorationsContributionId="editor.contrib.testingDecorations",n.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",n.CoverageViewId="workbench.view.testCoverage",n.ResultsPanelId="workbench.panel.testResults",n.ResultsViewId="workbench.panel.testResults.view",n.MessageLanguageId="vscodeInternalTestMessage"})(D6e||(D6e={}));var k6e;(function(n){n.List="list",n.Tree="true"})(k6e||(k6e={}));var I6e;(function(n){n.ByLocation="location",n.ByStatus="status",n.ByDuration="duration"})(I6e||(I6e={}));Xn.Errored+"",g(ly,0,"Errored"),Xn.Failed+"",g(ly,1,"Failed"),Xn.Passed+"",g(ly,2,"Passed"),Xn.Queued+"",g(ly,3,"Queued"),Xn.Running+"",g(ly,4,"Running"),Xn.Skipped+"",g(ly,5,"Skipped"),Xn.Unset+"",g(ly,6,"Not yet run");Yu.Debug+"",g(ly,8,"Debug"),Yu.Run+"",g(ly,9,"Run"),Yu.Coverage+"",g(ly,10,"Coverage");var YTe;(function(n){n.CancelTestRefreshAction="testing.cancelTestRefresh",n.CancelTestRunAction="testing.cancelRun",n.ClearTestResultsAction="testing.clearTestResults",n.CollapseAllAction="testing.collapseAll",n.ConfigureTestProfilesAction="testing.configureProfile",n.ContinousRunUsingForTest="testing.continuousRunUsingForTest",n.CoverageAtCursor="testing.coverageAtCursor",n.CoverageByUri="testing.coverage.uri",n.CoverageClear="testing.coverage.close",n.CoverageCurrentFile="testing.coverageCurrentFile",n.CoverageFilterToTest="testing.coverageFilterToTest",n.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",n.CoverageLastRun="testing.coverageLastRun",n.CoverageSelectedAction="testing.coverageSelected",n.CoverageToggleToolbar="testing.coverageToggleToolbar",n.CoverageViewChangeSorting="testing.coverageViewChangeSorting",n.DebugAction="testing.debug",n.DebugAllAction="testing.debugAll",n.DebugAtCursor="testing.debugAtCursor",n.DebugByUri="testing.debug.uri",n.DebugCurrentFile="testing.debugCurrentFile",n.DebugFailedTests="testing.debugFailTests",n.DebugLastRun="testing.debugLastRun",n.DebugSelectedAction="testing.debugSelected",n.FilterAction="workbench.actions.treeView.testExplorer.filter",n.GetExplorerSelection="_testing.getExplorerSelection",n.GetSelectedProfiles="testing.getSelectedProfiles",n.GoToTest="testing.editFocusedTest",n.HideTestAction="testing.hideTest",n.OpenCoverage="testing.openCoverage",n.OpenOutputPeek="testing.openOutputPeek",n.RefreshTestsAction="testing.refreshTests",n.ReRunFailedTests="testing.reRunFailTests",n.ReRunLastRun="testing.reRunLastRun",n.RunAction="testing.run",n.RunAllAction="testing.runAll",n.RunAllWithCoverageAction="testing.coverageAll",n.RunAtCursor="testing.runAtCursor",n.RunByUri="testing.run.uri",n.RunCurrentFile="testing.runCurrentFile",n.RunSelectedAction="testing.runSelected",n.RunUsingProfileAction="testing.runUsing",n.RunWithCoverageAction="testing.coverage",n.SearchForTestExtension="testing.searchForTestExtension",n.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",n.ShowMostRecentOutputAction="testing.showMostRecentOutput",n.StartContinousRun="testing.startContinuousRun",n.StopContinousRun="testing.stopContinuousRun",n.TestingSortByDurationAction="testing.sortByDuration",n.TestingSortByLocationAction="testing.sortByLocation",n.TestingSortByStatusAction="testing.sortByStatus",n.TestingViewAsListAction="testing.viewAsList",n.TestingViewAsTreeAction="testing.viewAsTree",n.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",n.ToggleInlineTestOutput="testing.toggleInlineTestOutput",n.UnhideAllTestsAction="testing.unhideAllTests",n.UnhideTestAction="testing.unhideTest"})(YTe||(YTe={}));let gni=0;const L6e=new WeakMap;let JTe=class extends ${constructor(e,t,i,s){super(),this.logService=t,this.commands=i,this.editors=s,this.resultsChangedEmitter=this._register(new I),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new I),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(Ue.MainThreadTesting),this.observer=new wni(this.proxy),this.runTracker=new mni(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case Fs.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(bn.root(a))?.collection.tree.get(a)?.actual??q7e(o)}case Fs.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(bn.root(c))?.collection.tree.get(c)?.actual??q7e({$mid:Fs.TestItemContext,tests:[r]}),message:P4.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(YTe.GetExplorerSelection),r=a=>{const c=this.controllers.get(bn.root(a));if(c)return bn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(yl)||[],exclude:o?.exclude.map(r).filter(yl)||[]}})}createTestController(e,t,i,s){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const o=new Z,r=o.add(new Ati(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d={items:r.root.children,get label(){return i},set label(u){i=u,r.root.label=u,l.$updateController(t,{label:i})},get refreshHandler(){return s},set refreshHandler(u){s=u,l.$updateController(t,{canRefresh:!!u})},get id(){return t},createRunProfile:(u,f,p,m,v,w)=>{let b=Ed(u);for(;a.has(b);)b++;return new Vat(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,b,u,f,p,m,v,w)},createTestItem(u,f,p){return new MO(t,u,f,p)},createTestRun:(u,f,p=!0)=>this.runTracker.createTestRun(e,t,r,u,f,p),invalidateTestResults:u=>{if(u===void 0)this.proxy.$markTestRetired(void 0);else{const f=u instanceof Array?u:[u];this.proxy.$markTestRetired(f.map(p=>bn.fromExtHostTestItem(p,t).toString()))}},set resolveHandler(u){r.resolveHandler=u},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}};l.$registerTestController(t,i,!!s),o.add(Ee(()=>l.$unregisterTestController(t)));const h={controller:d,collection:r,profiles:a,extension:e,activeProfiles:c};return this.controllers.set(t,h),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(u=>l.$publishDiff(t,u.map(x4.serialize)))),d}createTestObserver(){return this.observer.checkout()}async runTests(e,t=qe.None){const i=Uat(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const s=this.controllers.get(i.controllerId);if(!s)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,targets:[{testIds:e.include?.map(o=>bn.fromExtHostTestItem(o,s.collection.root.id).toString())??[s.collection.root.id],profileGroup:sBe[i.kind],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(o=>o.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t){return(await this.runTracker.getCoverageDetails(e,t))?.map(boe.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){const t=new Map;for(const[i,s]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=s.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!s.includes(l));for(const l of a)r.set(l,!0),o.activeProfiles.add(l);for(const l of c)r.set(l,!1),o.activeProfiles.delete(l);r.size&&t.set(i,r)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(t=>{const i=mIe.to(t);return L6e.set(i,t.id),i}).concat(this.results).sort((t,i)=>i.completedAt-t.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){const i=this.controllers.get(bn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>x4.deserialize({asCanonicalUri:i=>i},t)))}async $runControllerTests(e,t){return Promise.all(e.map(i=>this.runControllerTestRequest(i,!1,t)))}async $startContinuousRun(e,t){const i=new ai(t),s=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!s.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),s}async $provideTestFollowups(e,t){const i=this.results.find(r=>L6e.get(r)===e.resultId),s=i&&bni(bn.fromString(e.extId),i?.results);if(!s)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,s,e.taskIndex,e.messageIndex,t);a&&(o=o.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:o.map(r=>{const a=gni++;return this.testFollowups.set(a,r),{title:r.title,id:a}})}$disposeTestFollowups(e){for(const t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){const t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}async runControllerTestRequest(e,t,i){const s=this.controllers.get(e.controllerId);if(!s)return{};const{collection:o,profiles:r,extension:a}=s,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(yl),d=e.excludeExtIds.map(f=>s.collection.tree.get(f)).filter(yl).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===lb.IsChild));if(!l.length)return{};const h=new hG(l.some(f=>f.actual instanceof jOe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=Zjt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,fq.fromInternal(e,s.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await T.toPromise(u.onEnd)}}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}};JTe=D([_(0,gr),_(1,Ze)],JTe);const fni=1e4;var lk;(function(n){n[n.Running=0]="Running",n[n.Cancelling=1]="Cancelling",n[n.Ended=2]="Ended"})(lk||(lk={}));class pni extends ${get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,s,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=s,this.extension=o,this.state=lk.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new I),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new ai(r));const a=this._register(new yn(()=>this.forciblyEndTasks(),fni));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}cancel(){this.state===lk.Running?(this.cts.cancel(),this.state=lk.Cancelling):this.state===lk.Cancelling&&this.forciblyEndTasks()}getCoverageDetails(e,t){const[,i]=bn.fromString(e).path,s=this.publishedCoverage.get(e);if(!s)return[];const o=this.tasks.get(i);if(!o)throw new Error("unreachable: run task was not found");return this.profile?.loadDetailedCoverage?.(o.run,s,t)??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,s=Dr(),o=d=>(h,...u)=>{if(a){this.logService.warn(`Setting the state of test "${h.id}" is a no-op after the run ends.`);return}this.dto.isIncluded(h)&&(this.ensureTestIsKnown(h),d(h,...u))},r=(d,h)=>{const u=h instanceof Array?h.map(P4.from):[P4.from(h)];if(d.uri&&d.range){const f={range:at.from(d.range),uri:d.uri};for(const p of u)p.location=p.location||f}this.proxy.$appendTestMessagesInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),u)};let a=!1;const c=new Map,l={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:d=>{if(a)return;const h=d instanceof uG?d.testItem:void 0;let u;if(h){if(Je(this.extension,"attributableCoverage"),!this.dto.isIncluded(h))throw new Error("Attempted to `addCoverage` for a test item not included in the run");this.ensureTestIsKnown(h),u=c.get(h),u===void 0&&(u=c.size,c.set(h,u))}const f=d.uri.toString(),p=new bn(u!==void 0?[t,s,f,String(u)]:[t,s,f]).toString();this.publishedCoverage.set(p,d),this.proxy.$appendCoverage(t,s,boe.fromFile(i,p,d))},enqueued:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Queued)}),skipped:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Skipped)}),started:o(d=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Running)}),errored:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Errored,u)}),failed:o((d,h,u)=>{r(d,h),this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,i).toString(),Xn.Failed,u)}),passed:o((d,h)=>{this.proxy.$updateTestStateInRun(t,s,bn.fromExtHostTestItem(d,this.dto.controllerId).toString(),Xn.Passed,h)}),appendOutput:(d,h,u)=>{a||(u&&(this.dto.isIncluded(u)?this.ensureTestIsKnown(u):u=void 0),this.proxy.$appendOutputToRun(t,s,ze.fromString(d),h&&P_.from(h),u&&bn.fromExtHostTestItem(u,i).toString()))},end:()=>{a||(a=!0,c.clear(),this.proxy.$finishedTestRunTask(t,s),--this.running||this.markEnded())}};return this.running++,this.tasks.set(s,{run:l}),this.proxy.$startedTestRunTask(t,{id:s,name:e,running:!0}),l}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==lk.Ended&&(this.state=lk.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof MO))throw new eoe(e.id);if(this.sharedTestIds.has(bn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const s=J1.from(e);if(t.unshift(s),this.sharedTestIds.has(s.extId)||(this.sharedTestIds.add(s.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class mni{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t){const i=bn.root(e);return this.trackedById.get(i)?.getCoverageDetails(e,t)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(const[t,{id:i}]of this.tracked)i===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,i,s,o){return this.getTracker(t,i,s,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,s,o,r){const a=this.tracked.get(s);if(a)return a.createRun(o);const c=fq.fromPublic(t,i,s,r),l=Uat(s);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!s.continuous,profile:l&&{group:sBe[l.kind],id:l.profileId},exclude:s.exclude?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:s.include?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:s.preserveFocus??!0,persist:r});const d=this.getTracker(s,c,s.profile,e);return T.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,s,o){const r=new pni(t,this.proxy,this.logService,i,s,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const Uat=n=>{if(n.profile){if(!(n.profile instanceof Vat))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return n.profile}};class fq{static fromPublic(e,t,i,s){return new fq(e,Dr(),i.include?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[e],i.exclude?.map(o=>bn.fromExtHostTestItem(o,e).toString())??[],s,t)}static fromInternal(e,t){return new fq(e.controllerId,e.runId,e.testIds,e.excludeExtIds,!0,t)}constructor(e,t,i,s,o,r){this.controllerId=e,this.id=t,this.isPersisted=o,this.colllection=r,this.includePrefix=i.map(a=>a+qf.Delimiter),this.excludePrefix=s.map(a=>a+qf.Delimiter)}isIncluded(e){const t=bn.fromExtHostTestItem(e,this.controllerId).toString()+qf.Delimiter;for(const i of this.excludePrefix)if(t===i||t.startsWith(i))return!1;for(const i of this.includePrefix)if(t===i||t.startsWith(i))return!0;return!1}}class _ni{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,J1.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.has(e)){this.added.delete(e);return}this.updated.delete(e);const t=bn.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){const{added:e,updated:t,removed:i}=this;return{get added(){return[...e].map(s=>s.revived)},get updated(){return[...t].map(s=>s.revived)},get removed(){return[...i].map(s=>s.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class vni extends tKt{constructor(){super(...arguments),this.changeEmitter=new I,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:J1.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new _ni(this.changeEmitter)}}class wni{constructor(e){this.proxy=e}checkout(){this.current||(this.current=this.createObserverData());const e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(t=>t.revived)},dispose:cw(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){const e=new vni({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const j5=(n,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(n.controllerId,n.profileId,i)};var ub,jR,Iq,Km,XH;class Vat{constructor(e,t,i,s,o,r,a,c,l,d=!1,h=void 0,u=!1){kt(this,ub);kt(this,jR);kt(this,Iq);kt(this,Km);kt(this,XH);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,st(this,ub,e),st(this,XH,t),st(this,jR,i),st(this,Iq,s),t.set(r,this);const f=sBe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),st(this,Km,{profileId:r,controllerId:o,tag:h?hC.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{se(this,Km)&&(se(this,ub).$publishTestRunProfile(se(this,Km)),st(this,Km,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,j5(this,se(this,ub),se(this,Km),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,j5(this,se(this,ub),se(this,Km),{supportsContinuousRun:e}))}get isDefault(){return se(this,jR).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?se(this,jR).add(this.profileId):se(this,jR).delete(this.profileId),j5(this,se(this,ub),se(this,Km),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,j5(this,se(this,ub),se(this,Km),{tag:e?hC.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,j5(this,se(this,ub),se(this,Km),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return T.chain(se(this,Iq),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(yl))}dispose(){se(this,XH)?.delete(this.profileId)&&(st(this,XH,void 0),se(this,ub).$removeTestProfile(this.controllerId,this.profileId)),st(this,Km,void 0)}}ub=new WeakMap,jR=new WeakMap,Iq=new WeakMap,Km=new WeakMap,XH=new WeakMap;const sBe={[HM.Coverage]:Yu.Coverage,[HM.Debug]:Yu.Debug,[HM.Run]:Yu.Run};function bni(n,e){for(let t=0;ts.id===n.path[t]);if(!i)return;if(t===n.path.length-1)return i;e=i.children}}class Cni{constructor(e,t){this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new I,this._onDidChangeTextEditorOptions=new I,this._onDidChangeTextEditorVisibleRanges=new I,this._onDidChangeTextEditorViewColumn=new I,this._onDidChangeActiveTextEditor=new I,this._onDidChangeVisibleTextEditors=new I,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(Ue.MainThreadTextEditors),this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i)),this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let s;typeof t=="number"?s={position:yd.from(t),preserveFocus:i}:typeof t=="object"?s={position:yd.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?at.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:s={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,s),r=o&&this._extHostDocumentsAndEditors.getEditor(o);if(r)return r.value;throw o?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new jLe(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const s=t.selections.selections.map(ZS.to);i._acceptSelections(s)}if(t.visibleRanges){const s=Ui(t.visibleRanges.map(at.to));i._acceptVisibleRanges(s)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:oH.to(t.options.lineNumbers)}}),t.selections){const s=HF.fromValue(t.selections.source),o=t.selections.selections.map(ZS.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:s})}if(t.visibleRanges){const s=Ui(t.visibleRanges.map(at.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:s})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const s=yd.to(e[t]);i.value.viewColumn!==s&&(i._acceptViewColumn(s),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:s}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let XTe=class{constructor(e){this._actual=new Sse(uE.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=uE.Light;break;case"hcDark":t=uE.HighContrast;break;case"hcLight":t=uE.HighContrastLight;break;default:t=uE.Dark}this._actual=new Sse(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};XTe=D([_(0,gr)],XTe);class yni{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Ue.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,s)=>{if(i&&i.$mid===Fs.TimelineActionContext)if(this._providers.get(i.source)&&Cn.equals(s,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:P.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(T6e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,s){return this._providers.get(e)?.provider.provideTimeline(P.revive(t),i,s)}registerTimelineProvider(e,t,i,s){const o=new Z,r=this.convertTimelineItem(t.id,s,o).bind(this);let a;t.onDidChange&&(a=t.onDidChange(l=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...l,id:t.id}),this));const c=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(l,d,h){d?.resetCache&&(o.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=r(l,d);return{...u,source:t.id,items:u.items.map(f)}},dispose(){for(const l of c.values())l.get(t.id)?.clear();a?.dispose(),o.dispose()}},i)}convertTimelineItem(e,t,i){return(s,o)=>{let r;if(o?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=T6e(s);r=a.get(c),r===void 0&&(r=new Map,a.set(c,r))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;r?.set(d,a);let h,u,f;a.iconPath&&(c instanceof fg?f={id:c.id,color:c.color}:P.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return vp.isMarkdownString(l.tooltip)?p=Qs.from(l.tooltip):zt(l.tooltip)?p=l.tooltip:vp.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Qs.from(l.detail)):zt(l.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=l.detail),{...l,id:l.id??void 0,handle:d,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:h,iconDark:u,themeIcon:f,tooltip:p,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),Ee(()=>{for(const s of this._itemsBySourceAndUriMap.values())s.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function T6e(n){return n?.toString()}const Sni="vs/workbench/api/common/extHostTreeViews";function R6e(n,e){if(zt(n))return{label:n};if(n&&typeof n=="object"&&typeof n.label=="string"){let t;return Array.isArray(n.highlights)&&(t=n.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:n.label,highlights:t}}}class Ani extends ${constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new vPe;function s(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>s(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>s(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const s=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>s.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const s=t.dragAndDropController?.dropMimeTypes??[],o=t.dragAndDropController?.dragMimeTypes??[],r=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:s,dragMimeTypes:o,hasHandleDrag:r,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},d=this._proxy.$registerTreeViewDataProvider(e,l),h={get onDidCollapseElement(){return c.onDidCollapseElement},get onDidExpandElement(){return c.onDidExpandElement},get selection(){return c.selectedElements},get onDidChangeSelection(){return c.onDidChangeSelection},get activeItem(){return Je(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Je(i,"treeViewActiveItem"),c.onDidChangeActiveItem},get visible(){return c.visible},get onDidChangeVisibility(){return c.onDidChangeVisibility},get onDidChangeCheckboxState(){return c.onDidChangeCheckboxState},get message(){return c.message},set message(u){ah(u)&&Je(i,"treeViewMarkdownMessage"),c.message=u},get title(){return c.title},set title(u){c.title=u},get description(){return c.description},set description(u){c.description=u},get badge(){return c.badge},set badge(u){u!==void 0&&dke.isViewBadge(u)?c.badge={value:Math.floor(Math.abs(u.value)),tooltip:u.tooltip}:u===void 0&&(c.badge=void 0)},reveal:(u,f)=>c.reveal(u,f),dispose:async()=>{await d,this.treeViews.delete(e),c.dispose()}};return this._register(h),h}$getChildren(e,t){const i=this.treeViews.get(e);return i?i.getChildren(t):Promise.reject(new kC(e))}async $handleDrop(e,t,i,s,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new kC(e));const d=rw.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,o,r),l.onDrop(d,s,o)}async addAdditionalTransferItems(e,t,i,s,o){const r=this.treeDragAndDropService.removeDragOperationTransfer(o);if(r)(await r)?.forEach((a,c)=>{a&&e.set(c,a)});else if(o&&t.handleDrag){const a=t.handleDrag(i,e,s);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,s){const o=this.treeViews.get(e);if(!o)return Promise.reject(new kC(e));const r=await this.addAdditionalTransferItems(new h4,o,t,s,i);if(!(!r||s.isCancellationRequested))return rw.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new kC(e);return t.hasResolve}$resolve(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);return s.resolveTreeItem(t,i)}$setExpanded(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const s=this.treeViews.get(e);if(!s)throw new kC(e);s.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new kC(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new kC(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const s=this._register(new ZTe(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,s),s}convertArgument(e){const t=this.treeViews.get(e.$treeViewId);return t&&"$treeItemHandle"in e?t.getExtensionElement(e.$treeItemHandle):t&&"$focusedTreeItem"in e&&e.$focusedTreeItem?t.focusedElement:null}}const CW=class CW extends ${get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!hc(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,s,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=s,this.logService=o,this.extension=r,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new I),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new I),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new I),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new I),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new I),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new I),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new ai,r.contributes&&r.contributes.views)for(const d in r.contributes.views)for(const h of r.contributes.views[d])h.id===e&&(this._title=h.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(d=>{Array.isArray(d)&&d.length===0||this._onDidChangeData.fire({message:!1,element:d})}));let a,c;const l=T.debounce(this._onDidChangeData.event,(d,h)=>(d||(d={message:!1,elements:[]}),h.element!==!1&&(a||(a=new Promise(u=>c=u),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(h.element)?d.elements.push(...h.element):d.elements.push(h.element)),h.message&&(d.message=!0),d),200,!0);this._register(l(({message:d,elements:h})=>{h.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const u=c;return a=null,this.refresh(h).then(()=>u())})),d&&this.proxy.$setMessage(this.viewId,Qs.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(s=>s.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=hc(t.select)?!0:t.select,s=hc(t.focus)?!1:t.focus,o=hc(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(r=>this.resolveTreeNode(e,r[r.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:r.map(c=>c.item)},{select:i,focus:s,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:s,expand:o})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=Coe.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!Ls(this._selectedHandles,e);this._selectedHandles=e;const s=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),s&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const s=this.getExtensionElement(i.treeItemHandle);return s?{extensionItem:s,treeItem:await this.dataProvider.getTreeItem(s),newState:i.newState?Lb.Checked:Lb.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?Lb.Checked:Lb.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const s=[];for(const o of e){const r=this.getExtensionElement(o);r&&s.push(r)}if(!(!this.dndController?.handleDrag||s.length===0))return await this.dndController.handleDrag(s,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const s=t?this.getExtensionElement(t):void 0;if(!(!s&&t||!this.dndController?.handleDrop))return Zu(()=>this.dndController?.handleDrop?this.dndController.handleDrop(s,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const s=this.nodes.get(i);if(s){const o=await this.dataProvider.resolveTreeItem(s.extensionItem,i,t)??s.extensionItem;return this.validateTreeItem(o),s.item.tooltip=this.getTooltip(o.tooltip),s.item.command=this.getCommand(s.disposableStore,o.command),s.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(s=>(i.push(s),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):Zu(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Zu(()=>this.dataProvider.getTreeItem(e)).then(s=>this.createHandle(e,s,t,!0)).then(s=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(s);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${s} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new ai(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,s=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Ui(s||[]),r=await Promise.all(Ui(o).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=r.map((c,l)=>c?this.createAndRegisterTreeNode(o[l],c,i):null);return Ui(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ai,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(o=>this.nodes.get(o));for(const o of i)if(o&&!t.has(o.item.handle)){let r=o;for(;r&&r.parent&&i.findIndex(a=>r&&r.parent&&a&&a.item.handle===r.parent.item.handle)===-1;){const a=this.elements.get(r.parent.item.handle);r=a?this.nodes.get(a):void 0}r&&!r.parent&&t.add(o.item.handle)}const s=[];return t.forEach(o=>{const r=this.elements.get(o);if(r){const a=this.nodes.get(r);a&&(!a.parent||!t.has(a.parent.item.handle))&&s.push(o)}}),s}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(s=>{s&&(t[i]=s.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),Zu(()=>this.dataProvider.getTreeItem(t)).then(s=>{if(s){const o=this.createTreeNode(t,s,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const s=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(s.item.handle))throw new Error(g(Sni,0,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,s),this.addNodeToParentCache(s,i),s}getTooltip(e){return vp.isMarkdownString(e)?Qs.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,s;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,s=e.checkboxState.accessibilityInformation),{isChecked:t===Lb.Checked,tooltip:i,accessibilityInformation:s}}validateTreeItem(e){if(!q6.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const s=this._register(new Z),o=this.createHandle(e,t,i),r=this.getLightIconPath(t);return{item:{handle:o,parentHandle:i?i.item.handle:void 0,label:R6e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(s,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:hc(t.collapsibleState)?zI.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:s,dispose(){s.dispose()}}}getThemeIcon(e){return e.iconPath instanceof fg?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:s},o,r){if(t)return`${CW.ID_HANDLE_PREFIX}/${t}`;const a=R6e(i),c=o?o.item.handle:CW.LABEL_HANDLE_PREFIX;let l=a?a.label:s?ui(s):"";l=l.indexOf("/")!==-1?l.replace("/","//"):l;const d=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,h=this.getChildrenNodes(o)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,r||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg))return typeof e.iconPath=="string"||P.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fg)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return P.isUri(e)?e:P.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,s){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const o=this.getChildrenNodes(s)||[],r=o.filter(a=>a.item.handle===i.item.handle)[0];r&&o.splice(o.indexOf(r),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};CW.LABEL_HANDLE_PREFIX="0",CW.ID_HANDLE_PREFIX="1";let ZTe=CW;const Rle=class Rle{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Ue.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,s){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=s.schemes.find(r=>!Rle.supportedSchemes.has(r));if(o)throw new Error(`Scheme '${o}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,s.schemes,e,s.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener with id: ${e}`);const o=P.revive(t);return s.canOpenExternalUri(o,i)}async $openUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener id: '${e}'`);return s.openExternalUri(P.revive(t.resolvedUri),{sourceUri:P.revive(t.sourceUri)},i)}};Rle.supportedSchemes=new Set([_e.http,_e.https]);let eRe=Rle;const Mle=class Mle{constructor(e){this.handles=new $v,this.handlers=new Map,this._proxy=e.getProxy(Ue.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const s=Mle.HandlePool++;return this.handles.add(i),this.handlers.set(s,t),this._proxy.$registerUriHandler(s,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(s),this._proxy.$unregisterUriHandler(s)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(P.revive(t))}catch(s){bt(s)}return Promise.resolve(void 0)}async createAppUri(e){return P.revive(await this._proxy.$createAppUri(e))}};Mle.HandlePool=0;let tRe=Mle;var Tk,Rk,Lq,ZH,Tq,KR,eU,JA,tU,iU,Mk,nU,sU;class Eni extends ${constructor(t,i,s,o){super();kt(this,Tk);kt(this,Rk);kt(this,Lq);kt(this,ZH);kt(this,Tq);kt(this,KR);kt(this,eU);kt(this,JA);kt(this,tU);kt(this,iU);kt(this,Mk);kt(this,nU);kt(this,sU);st(this,JA,void 0),st(this,tU,!0),st(this,Mk,!1),st(this,nU,this._register(new I)),this.onDidDispose=se(this,nU).event,st(this,sU,this._register(new I)),this.onDidChangeViewState=se(this,sU).event,st(this,Tk,t),st(this,Rk,i),st(this,ZH,s),st(this,Lq,o.viewType),st(this,Tq,o.panelOptions),st(this,JA,o.viewColumn),st(this,KR,o.title),st(this,iU,o.active)}dispose(){se(this,Mk)||(st(this,Mk,!0),se(this,nU).fire(),se(this,Rk).$disposeWebview(se(this,Tk)),se(this,ZH).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),se(this,ZH)}get viewType(){return this.assertNotDisposed(),se(this,Lq)}get title(){return this.assertNotDisposed(),se(this,KR)}set title(t){this.assertNotDisposed(),se(this,KR)!==t&&(st(this,KR,t),se(this,Rk).$setTitle(se(this,Tk),t))}get iconPath(){return this.assertNotDisposed(),se(this,eU)}set iconPath(t){this.assertNotDisposed(),se(this,eU)!==t&&(st(this,eU,t),se(this,Rk).$setIconPath(se(this,Tk),P.isUri(t)?{light:t,dark:t}:t))}get options(){return se(this,Tq)}get viewColumn(){if(this.assertNotDisposed(),!(typeof se(this,JA)=="number"&&se(this,JA)<0))return se(this,JA)}get active(){return this.assertNotDisposed(),se(this,iU)}get visible(){return this.assertNotDisposed(),se(this,tU)}_updateViewState(t){se(this,Mk)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(st(this,iU,t.active),st(this,tU,t.visible),st(this,JA,t.viewColumn),se(this,sU).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),se(this,Rk).$reveal(se(this,Tk),{viewColumn:typeof t>"u"?void 0:yd.from(t),preserveFocus:!!i})}assertNotDisposed(){if(se(this,Mk))throw new Error("Webview is disposed")}}Tk=new WeakMap,Rk=new WeakMap,Lq=new WeakMap,ZH=new WeakMap,Tq=new WeakMap,KR=new WeakMap,eU=new WeakMap,JA=new WeakMap,tU=new WeakMap,iU=new WeakMap,Mk=new WeakMap,nU=new WeakMap,sU=new WeakMap;class oBe extends ${static newHandle(){return Dr()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,s,o={}){const r=typeof s=="object"?s.viewColumn:s,a={viewColumn:yd.from(r),preserveFocus:typeof s=="object"&&!!s.preserveFocus},c=q4(e),l=oBe.newHandle();this._proxy.$createWebviewPanel(Tre(e),l,t,{title:i,panelOptions:xni(o),webviewOptions:Oat(e,this.workspace,o),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,o,e);return this.createNewWebviewPanel(l,t,i,r,o,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,s)=>{const o=e[i],r=e[s];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const s=this.getWebviewPanel(i);if(!s)continue;const o=e[i];s._updateViewState({active:o.active,visible:o.visible,viewColumn:yd.to(o.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,s){const o=this._serializers.get(t);if(!o)throw new Error(`No serializer found for '${t}'`);const{serializer:r,extension:a}=o,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,s,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,s,o,r,a){const c=new Eni(e,this._proxy,r,{viewType:t,title:i,viewColumn:s,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function xni(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}var Nk,Pk,Rq,oU,Fk,YR,JR,rU,XR,aU,cU;class Dni extends ${constructor(t,i,s,o,r,a){super();kt(this,Nk);kt(this,Pk);kt(this,Rq);kt(this,oU);kt(this,Fk);kt(this,YR);kt(this,JR);kt(this,rU);kt(this,XR);kt(this,aU);kt(this,cU);st(this,Fk,!1),st(this,aU,this._register(new I)),this.onDidChangeVisibility=se(this,aU).event,st(this,cU,this._register(new I)),this.onDidDispose=se(this,cU).event,st(this,Rq,s),st(this,JR,o),st(this,Nk,t),st(this,Pk,i),st(this,oU,r),st(this,YR,a)}dispose(){se(this,Fk)||(st(this,Fk,!0),se(this,cU).fire(),se(this,oU).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),se(this,JR)}set title(t){this.assertNotDisposed(),se(this,JR)!==t&&(st(this,JR,t),se(this,Pk).$setWebviewViewTitle(se(this,Nk),t))}get description(){return this.assertNotDisposed(),se(this,rU)}set description(t){this.assertNotDisposed(),se(this,rU)!==t&&(st(this,rU,t),se(this,Pk).$setWebviewViewDescription(se(this,Nk),t))}get visible(){return se(this,YR)}get webview(){return se(this,oU)}get viewType(){return se(this,Rq)}_setVisible(t){t===se(this,YR)||se(this,Fk)||(st(this,YR,t),se(this,aU).fire())}get badge(){return this.assertNotDisposed(),se(this,XR)}set badge(t){this.assertNotDisposed(),!(t?.value===se(this,XR)?.value&&t?.tooltip===se(this,XR)?.tooltip)&&(st(this,XR,Coe.from(t)),se(this,Pk).$setWebviewViewBadge(se(this,Nk),t))}show(t){this.assertNotDisposed(),se(this,Pk).$show(se(this,Nk),!!t)}assertNotDisposed(){if(se(this,Fk))throw new Error("Webview is disposed")}}Nk=new WeakMap,Pk=new WeakMap,Rq=new WeakMap,oU=new WeakMap,Fk=new WeakMap,YR=new WeakMap,JR=new WeakMap,rU=new WeakMap,XR=new WeakMap,aU=new WeakMap,cU=new WeakMap;class kni{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Ue.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,s){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(Tre(e),t,{retainContextWhenHidden:s?.retainContextWhenHidden,serializeBuffersForPostMessage:q4(e)}),new oo(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,s,o){const r=this._viewProviders.get(t);if(!r)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=r,l=this._extHostWebview.createNewWebview(e,{},c),d=new Dni(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:s},o)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}function Ini(n){const e=n.get(Sg),t=n.get(Kz),i=n.get(gue),s=n.get(_L),o=n.get(dD),r=n.get(pue),a=n.get(hD),c=n.get(fue),l=n.get(gr),d=n.get(KOe),h=n.get(YOe),u=n.get(wp),f=n.get(Ze),p=n.get(FOe),m=n.get(mue),v=n.get(Nat),w=n.get(ZOe),b=n.get(rj),C=n.get(tBe),y=n.get(JOe),S=n.get(XOe);l.set(et.ExtHostFileSystemInfo,t),l.set(et.ExtHostLogLevelServiceShape,u),l.set(et.ExtHostWorkspace,o),l.set(et.ExtHostConfiguration,a),l.set(et.ExtHostExtensionService,s),l.set(et.ExtHostStorage,d),l.set(et.ExtHostTunnelService,p),l.set(et.ExtHostWindow,v),l.set(et.ExtHostSecretState,w),l.set(et.ExtHostTelemetry,r),l.set(et.ExtHostEditorTabs,b),l.set(et.ExtHostManagedSockets,C),l.set(et.ExtHostAuthentication,y),l.set(et.ExtHostChatProvider,S);const M=l.set(et.ExtHostDecorations,n.get(yat)),k=l.set(et.ExtHostDocumentsAndEditors,n.get(oj)),F=l.set(et.ExtHostCommands,n.get(Yz)),N=l.set(et.ExtHostTerminalService,n.get(Jz)),z=l.set(et.ExtHostTerminalShellIntegration,n.get(Pat)),U=l.set(et.ExtHostDebugService,n.get(Rat)),J=l.set(et.ExtHostSearch,n.get(Mat)),j=l.set(et.ExtHostTask,n.get(xat)),re=l.set(et.ExtHostOutputService,n.get(bat)),me=l.set(et.ExtHostLocalization,n.get(eBe)),De=l.set(et.ExtHostUrls,new tRe(l)),Qe=l.set(et.ExtHostDocuments,new Fii(l,k)),Tt=l.set(et.ExtHostDocumentContentProviders,new RTe(l,k,f)),Oe=l.set(et.ExtHostDocumentSaveParticipant,new Pii(f,Qe,l.getProxy(Ue.MainThreadBulkEdits))),wt=l.set(et.ExtHostNotebook,new OTe(l,F,k,Qe,i,J,f)),Nt=l.set(et.ExtHostNotebookDocuments,new Yii(wt)),Ji=l.set(et.ExtHostNotebookEditors,new BTe(f,wt)),Vi=l.set(et.ExtHostNotebookKernels,new WTe(l,e,wt,F,f)),Gn=l.set(et.ExtHostNotebookRenderers,new Zii(l,wt)),Ro=l.set(et.ExtHostNotebookDocumentSaveParticipant,new Kii(f,wt,l.getProxy(Ue.MainThreadBulkEdits))),qn=l.set(et.ExtHostEditors,new Cni(l,k)),ec=l.set(et.ExtHostTreeViews,new Ani(l.getProxy(Ue.MainThreadTreeViews),F,f)),ys=l.set(et.ExtHostEditorInsets,new wii(l.getProxy(Ue.MainThreadEditorInsets),qn,e.remote)),mr=l.set(et.ExtHostDiagnostics,new TTe(l,f,t,k)),ba=l.set(et.ExtHostLanguages,new qii(l,Qe,F.converter,c)),ki=l.set(et.ExtHostLanguageFeatures,new MTe(l,c,Qe,F,mr,f,m,r)),gs=l.set(et.ExtHostFileSystem,new Mre(l,ki)),ir=l.set(et.ExtHostFileSystemEventService,new Vii(l,f,k)),Hn=l.set(et.ExtHostQuickOpen,nni(l,o,F)),vc=l.set(et.ExtHostSCM,new qTe(l,F,Qe,f)),gh=l.set(et.ExtHostQuickDiff,new zTe(l,c)),Qn=l.set(et.ExtHostShare,new QTe(l,c)),Yh=l.set(et.ExtHostComments,bii(l,F,Qe)),tl=l.set(et.ExtHostProgress,new tni(l.getProxy(Ue.MainThreadProgress))),Tl=l.set(et.ExtHostLabelService,new $ii(l)),to=l.set(et.ExtHostTheming,new XTe(l)),Fc=l.set(et.ExtHostTimeline,new yni(l,F)),rd=l.set(et.ExtHostWebviews,new Sii(l,e.remote,o,f,m)),Jh=l.set(et.ExtHostWebviewPanels,new oBe(l,rd,o)),Af=l.set(et.ExtHostCustomEditors,new Iii(l,Qe,h,rd,Jh)),il=l.set(et.ExtHostWebviewViews,new kni(l,rd)),Rl=l.set(et.ExtHostTesting,new JTe(l,f,F,k)),Xh=l.set(et.ExtHostUriOpeners,new eRe(l)),ul=l.set(et.ExtHostProfileContentHandlers,new eni(l));l.set(et.ExtHostInteractive,new zii(l,wt,k,F,f));const ad=l.set(et.ExtHostChatAgents2,new kTe(l,f,F,e.quality)),wc=l.set(et.ExtHostChatVariables,new ITe(l)),Ca=l.set(et.ExtHostAiRelatedInformation,new hii(l)),Ld=l.set(et.ExtHostAiEmbeddingVector,new Bii(l)),fh=l.set(et.ExtHostStatusBar,new uni(l,F.converter)),Fu=l.set(et.ExtHostSpeech,new jTe(l)),bc=l.set(et.ExtHostEmbeddings,new Oii(l)),Zh=Object.values(et);l.assertRegistered(Zh);const Cc=new DTe(l,k),nr=new mii(l),Rs=new NTe(l,f),Ml=new Nii(l);return gii.register(F),function(Se,Mo,cd){function K(R){return(H,ie,je)=>{const pt=R(is=>{try{H.call(ie,is)}catch(Ss){er(new Error(`[ExtensionListenerError] Extension '${Se.identifier.value}' FAILED to handle event: ${Ss.toString()}`,{cause:Ss})),r.onExtensionError(Se.identifier,Ss)}});return je?.push(pt),pt}}const Le=function(){let R=!Se.isUnderDevelopment;function H(){R||(f.info(`Extension '${Se.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),R=!0)}return function ie(je){if(Array.isArray(je))je.forEach(ie);else if(typeof je=="string")H();else{const pt=je;typeof pt.scheme>"u"&&H(),typeof pt.exclusive=="boolean"&&Je(Se,"documentFiltersExclusive")}return je}}(),ri={getSession(R,H,ie){return typeof ie?.forceNewSession=="object"&&ie.forceNewSession.learnMore&&Je(Se,"authLearnMore"),y.getSession(Se,R,H,ie)},getSessions(R,H){return Je(Se,"authGetSessions"),y.getSessions(Se,R,H)},async hasSession(R,H){return Je(Se,"authSession"),!!await y.getSession(Se,R,H,{silent:!0})},get onDidChangeSessions(){return K(y.onDidChangeSessions)},registerAuthenticationProvider(R,H,ie,je){return y.registerAuthenticationProvider(R,H,ie,je)}},ts={registerCommand(R,H,ie){return F.registerCommand(!0,R,H,ie,void 0,Se)},registerTextEditorCommand(R,H,ie){return F.registerCommand(!0,R,(...je)=>{const pt=qn.getActiveTextEditor();if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}return pt.edit(is=>{H.apply(ie,[pt,is,...je])}).then(is=>{is||f.warn("Edits from command "+R+" were not applied.")},is=>{f.warn("An error occurred while running command "+R,is)})},void 0,void 0,Se)},registerDiffInformationCommand:(R,H,ie)=>(Je(Se,"diffCommand"),F.registerCommand(!0,R,async(...je)=>{const pt=k.activeEditor(!0);if(!pt){f.warn("Cannot execute "+R+" because there is no active text editor.");return}const is=await qn.getDiffInformation(pt.id);H.apply(ie,[is,...je])},void 0,void 0,Se)),executeCommand(R,...H){return F.executeCommand(R,...H)},getCommands(R=!1){return F.getCommands(R)}},Os={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return nr.value},get shell(){return N.getDefaultShell(!1)},get onDidChangeShell(){return K(N.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return K(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Je(Se,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Je(Se,"telemetry"),K(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return Aat(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(R,H){return Sat.validateSender(R),r.instantiateLogger(Se,R,H)},openExternal(R,H){return v.openUri(R,{allowTunneling:!!e.remote.authority,allowContributedOpeners:H?.allowContributedOpeners})},async asExternalUri(R){if(R.scheme===e.environment.appUriScheme)return De.createAppUri(R);try{return await v.asExternalUri(R,{allowTunneling:!!e.remote.authority})}catch(H){if(Rx(R,_e.http)||Rx(R,_e.https))return R;throw H}},get remoteName(){return Wde(e.remote.authority)},get remoteAuthority(){return Je(Se,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return K(f.onDidChangeLogLevel)},get appQuality(){return Je(Se,"resolvers"),e.quality},get appCommit(){return Je(Se,"resolvers"),e.commit}},sr={createTestController(R,H,ie){return Rl.createTestController(Se,R,H,ie)},createTestObserver(){return Je(Se,"testObserver"),Rl.createTestObserver()},runTests(R){return Je(Se,"testObserver"),Rl.runTests(R)},registerTestFollowupProvider(R){return Je(Se,"testObserver"),Rl.registerTestFollowupProvider(R)},get onDidChangeTestResults(){return Je(Se,"testObserver"),K(Rl.onResultsChanged)},get testResults(){return Je(Se,"testObserver"),Rl.results}},ya=e.remote.isRemote?$I.Workspace:$I.UI,yc={getExtension(R,H){Cd(Se,"extensionsAny")||(H=!1);const ie=Mo.mine.getExtensionDescription(R);if(ie)return new K3(s,Se.identifier,ie,ya,!1);if(H){const je=Mo.all.getExtensionDescription(R);if(je)return new K3(s,Se.identifier,je,ya,!0)}},get all(){const R=[];for(const H of Mo.mine.getAllExtensionDescriptions())R.push(new K3(s,Se.identifier,H,ya,!1));return R},get allAcrossExtensionHosts(){Je(Se,"extensionsAny");const R=new $v(Mo.mine.getAllExtensionDescriptions().map(ie=>ie.identifier)),H=[];for(const ie of Mo.all.getAllExtensionDescriptions()){const je=!R.has(ie.identifier);H.push(new K3(s,Se.identifier,ie,ya,je))}return H},get onDidChange(){return Cd(Se,"extensionsAny")?K(T.any(Mo.mine.onDidChange,Mo.all.onDidChange)):K(Mo.mine.onDidChange)}},Ou={createDiagnosticCollection(R){return mr.createDiagnosticCollection(Se.identifier,R)},get onDidChangeDiagnostics(){return K(mr.onDidChangeDiagnostics)},getDiagnostics:R=>mr.getDiagnostics(R),getLanguages(){return ba.getLanguages()},setTextDocumentLanguage(R,H){return ba.changeLanguage(R.uri,H)},match(R,H){const ie=hIe.from(R);let je;return FYe(ie)&&(je=wt.notebookDocuments.find(pt=>pt.apiNotebook.getCells().find(is=>is.document===H))?.apiNotebook),fde(ie,H.uri,H.languageId,!0,je?.uri,je?.notebookType)},registerCodeActionsProvider(R,H,ie){return ki.registerCodeActionProvider(Se,Le(R),H,ie)},registerDocumentPasteEditProvider(R,H,ie){return Je(Se,"documentPaste"),ki.registerDocumentPasteEditProvider(Se,Le(R),H,ie)},registerCodeLensProvider(R,H){return ki.registerCodeLensProvider(Se,Le(R),H)},registerDefinitionProvider(R,H){return ki.registerDefinitionProvider(Se,Le(R),H)},registerDeclarationProvider(R,H){return ki.registerDeclarationProvider(Se,Le(R),H)},registerImplementationProvider(R,H){return ki.registerImplementationProvider(Se,Le(R),H)},registerTypeDefinitionProvider(R,H){return ki.registerTypeDefinitionProvider(Se,Le(R),H)},registerHoverProvider(R,H){return ki.registerHoverProvider(Se,Le(R),H,Se.identifier)},registerEvaluatableExpressionProvider(R,H){return ki.registerEvaluatableExpressionProvider(Se,Le(R),H,Se.identifier)},registerInlineValuesProvider(R,H){return ki.registerInlineValuesProvider(Se,Le(R),H,Se.identifier)},registerDocumentHighlightProvider(R,H){return ki.registerDocumentHighlightProvider(Se,Le(R),H)},registerMultiDocumentHighlightProvider(R,H){return ki.registerMultiDocumentHighlightProvider(Se,Le(R),H)},registerLinkedEditingRangeProvider(R,H){return ki.registerLinkedEditingRangeProvider(Se,Le(R),H)},registerReferenceProvider(R,H){return ki.registerReferenceProvider(Se,Le(R),H)},registerRenameProvider(R,H){return ki.registerRenameProvider(Se,Le(R),H)},registerNewSymbolNamesProvider(R,H){return Je(Se,"newSymbolNamesProvider"),ki.registerNewSymbolNamesProvider(Se,Le(R),H)},registerDocumentSymbolProvider(R,H,ie){return ki.registerDocumentSymbolProvider(Se,Le(R),H,ie)},registerWorkspaceSymbolProvider(R){return ki.registerWorkspaceSymbolProvider(Se,R)},registerDocumentFormattingEditProvider(R,H){return ki.registerDocumentFormattingEditProvider(Se,Le(R),H)},registerDocumentRangeFormattingEditProvider(R,H){return ki.registerDocumentRangeFormattingEditProvider(Se,Le(R),H)},registerOnTypeFormattingEditProvider(R,H,ie,...je){return ki.registerOnTypeFormattingEditProvider(Se,Le(R),H,[ie].concat(je))},registerDocumentSemanticTokensProvider(R,H,ie){return ki.registerDocumentSemanticTokensProvider(Se,Le(R),H,ie)},registerDocumentRangeSemanticTokensProvider(R,H,ie){return ki.registerDocumentRangeSemanticTokensProvider(Se,Le(R),H,ie)},registerSignatureHelpProvider(R,H,ie,...je){return typeof ie=="object"?ki.registerSignatureHelpProvider(Se,Le(R),H,ie):ki.registerSignatureHelpProvider(Se,Le(R),H,typeof ie>"u"?[]:[ie,...je])},registerCompletionItemProvider(R,H,...ie){return ki.registerCompletionItemProvider(Se,Le(R),H,ie)},registerInlineCompletionItemProvider(R,H,ie){return H.handleDidShowCompletionItem&&Je(Se,"inlineCompletionsAdditions"),H.handleDidPartiallyAcceptCompletionItem&&Je(Se,"inlineCompletionsAdditions"),ie&&Je(Se,"inlineCompletionsAdditions"),ki.registerInlineCompletionsProvider(Se,Le(R),H,ie)},registerInlineEditProvider(R,H){return Je(Se,"inlineEdit"),ki.registerInlineEditProvider(Se,Le(R),H)},registerDocumentLinkProvider(R,H){return ki.registerDocumentLinkProvider(Se,Le(R),H)},registerColorProvider(R,H){return ki.registerColorProvider(Se,Le(R),H)},registerFoldingRangeProvider(R,H){return ki.registerFoldingRangeProvider(Se,Le(R),H)},registerSelectionRangeProvider(R,H){return ki.registerSelectionRangeProvider(Se,R,H)},registerCallHierarchyProvider(R,H){return ki.registerCallHierarchyProvider(Se,R,H)},registerTypeHierarchyProvider(R,H){return ki.registerTypeHierarchyProvider(Se,R,H)},setLanguageConfiguration:(R,H)=>ki.setLanguageConfiguration(Se,R,H),getTokenInformationAtPosition(R,H){return Je(Se,"tokenInformation"),ba.tokenAtPosition(R,H)},registerInlayHintsProvider(R,H){return ki.registerInlayHintsProvider(Se,R,H)},createLanguageStatusItem(R,H){return ba.createLanguageStatusItem(Se,R,H)},registerDocumentDropEditProvider(R,H,ie){return ki.registerDocumentOnDropEditProvider(Se,R,H,Cd(Se,"documentPaste")?ie:void 0)}},le={get activeTextEditor(){return qn.getActiveTextEditor()},get visibleTextEditors(){return qn.getVisibleTextEditors()},get activeTerminal(){return N.activeTerminal},get terminals(){return N.terminals},async showTextDocument(R,H,ie){P.isUri(R)&&R.scheme===_e.vscodeRemote&&!R.authority&&m.report("workspace.showTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority.");const je=await(P.isUri(R)?Promise.resolve(_r.openTextDocument(R)):Promise.resolve(R));return qn.showTextDocument(je,H,ie)},createTextEditorDecorationType(R){return qn.createTextEditorDecorationType(Se,R)},onDidChangeActiveTextEditor(R,H,ie){return K(qn.onDidChangeActiveTextEditor)(R,H,ie)},onDidChangeVisibleTextEditors(R,H,ie){return K(qn.onDidChangeVisibleTextEditors)(R,H,ie)},onDidChangeTextEditorSelection(R,H,ie){return K(qn.onDidChangeTextEditorSelection)(R,H,ie)},onDidChangeTextEditorOptions(R,H,ie){return K(qn.onDidChangeTextEditorOptions)(R,H,ie)},onDidChangeTextEditorVisibleRanges(R,H,ie){return K(qn.onDidChangeTextEditorVisibleRanges)(R,H,ie)},onDidChangeTextEditorViewColumn(R,H,ie){return K(qn.onDidChangeTextEditorViewColumn)(R,H,ie)},onDidCloseTerminal(R,H,ie){return K(N.onDidCloseTerminal)(R,H,ie)},onDidOpenTerminal(R,H,ie){return K(N.onDidOpenTerminal)(R,H,ie)},onDidChangeActiveTerminal(R,H,ie){return K(N.onDidChangeActiveTerminal)(R,H,ie)},onDidChangeTerminalDimensions(R,H,ie){return Je(Se,"terminalDimensions"),K(N.onDidChangeTerminalDimensions)(R,H,ie)},onDidChangeTerminalState(R,H,ie){return K(N.onDidChangeTerminalState)(R,H,ie)},onDidWriteTerminalData(R,H,ie){return Je(Se,"terminalDataWriteEvent"),K(N.onDidWriteTerminalData)(R,H,ie)},onDidExecuteTerminalCommand(R,H,ie){return Je(Se,"terminalExecuteCommandEvent"),K(N.onDidExecuteTerminalCommand)(R,H,ie)},onDidChangeTerminalShellIntegration(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidChangeTerminalShellIntegration)(R,H,ie)},onDidStartTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidStartTerminalShellExecution)(R,H,ie)},onDidEndTerminalShellExecution(R,H,ie){return Je(Se,"terminalShellIntegration"),K(z.onDidEndTerminalShellExecution)(R,H,ie)},get state(){return v.getState()},onDidChangeWindowState(R,H,ie){return K(v.onDidChangeWindowState)(R,H,ie)},showInformationMessage(R,...H){return Rs.showMessage(Se,nt.Info,R,H[0],H.slice(1))},showWarningMessage(R,...H){return Rs.showMessage(Se,nt.Warning,R,H[0],H.slice(1))},showErrorMessage(R,...H){return Rs.showMessage(Se,nt.Error,R,H[0],H.slice(1))},showQuickPick(R,H,ie){return Hn.showQuickPick(Se,R,H,ie)},showWorkspaceFolderPick(R){return Hn.showWorkspaceFolderPick(R)},showInputBox(R,H){return Hn.showInput(R,H)},showOpenDialog(R){return Ml.showOpenDialog(Se,R)},showSaveDialog(R){return Ml.showSaveDialog(R)},createStatusBarItem(R,H,ie){let je,pt,is;return typeof R=="string"?(je=R,pt=H,is=ie):(pt=R,is=H),fh.createStatusBarEntry(Se,je,pt,is)},setStatusBarMessage(R,H){return fh.setStatusBarMessage(R,H)},withScmProgress(R){return m.report("window.withScmProgress",Se,"Use 'withProgress' instead."),tl.withProgress(Se,{location:VI.SourceControl},(H,ie)=>R({report(je){}}))},withProgress(R,H){return tl.withProgress(Se,R,H)},createOutputChannel(R,H){return re.createOutputChannel(R,H,Se)},createWebviewPanel(R,H,ie,je){return Jh.createWebviewPanel(Se,R,H,ie,je)},createWebviewTextEditorInset(R,H,ie,je){return Je(Se,"editorInsets"),ys.createWebviewEditorInset(R,H,ie,je,Se)},createTerminal(R,H,ie){return typeof R=="object"?"pty"in R?N.createExtensionTerminal(R):N.createTerminalFromOptions(R):N.createTerminal(R,H,ie)},registerTerminalLinkProvider(R){return N.registerLinkProvider(R)},registerTerminalProfileProvider(R,H){return N.registerProfileProvider(Se,R,H)},registerTerminalQuickFixProvider(R,H){return Je(Se,"terminalQuickFixProvider"),N.registerTerminalQuickFixProvider(R,Se.identifier.value,H)},registerTreeDataProvider(R,H){return ec.registerTreeDataProvider(R,H,Se)},createTreeView(R,H){return ec.createTreeView(R,H,Se)},registerWebviewPanelSerializer:(R,H)=>Jh.registerWebviewPanelSerializer(Se,R,H),registerCustomEditorProvider:(R,H,ie={})=>Af.registerCustomEditorProvider(Se,R,H,ie),registerFileDecorationProvider(R){return M.registerFileDecorationProvider(R,Se)},registerUriHandler(R){return De.registerUriHandler(Se,R)},createQuickPick(){return Hn.createQuickPick(Se)},createInputBox(){return Hn.createInputBox(Se)},get activeColorTheme(){return to.activeColorTheme},onDidChangeActiveColorTheme(R,H,ie){return K(to.onDidChangeActiveColorTheme)(R,H,ie)},registerWebviewViewProvider(R,H,ie){return il.registerWebviewViewProvider(Se,R,H,ie?.webviewOptions)},get activeNotebookEditor(){return wt.activeNotebookEditor},onDidChangeActiveNotebookEditor(R,H,ie){return K(wt.onDidChangeActiveNotebookEditor)(R,H,ie)},get visibleNotebookEditors(){return wt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return K(wt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(R,H,ie){return K(Ji.onDidChangeNotebookEditorSelection)(R,H,ie)},onDidChangeNotebookEditorVisibleRanges(R,H,ie){return K(Ji.onDidChangeNotebookEditorVisibleRanges)(R,H,ie)},showNotebookDocument(R,H){return wt.showNotebookDocument(R,H)},registerExternalUriOpener(R,H,ie){return Je(Se,"externalUriOpener"),Xh.registerExternalUriOpener(Se.identifier,R,H,ie)},registerProfileContentHandler(R,H){return Je(Se,"profileContentHandlers"),ul.registerProfileContentHandler(Se,R,H)},registerQuickDiffProvider(R,H,ie,je){return Je(Se,"quickDiffProvider"),gh.registerQuickDiffProvider(Le(R),H,ie,je)},get tabGroups(){return b.tabGroups},registerShareProvider(R,H){return Je(Se,"shareProvider"),Qn.registerShareProvider(Le(R),H)}},_r={get rootPath(){return m.report("workspace.rootPath",Se,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(R){throw new cR("rootPath")},getWorkspaceFolder(R){return o.getWorkspaceFolder(R)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(R){throw new cR("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(R){throw new cR("workspaceFile")},updateWorkspaceFolders:(R,H,...ie)=>o.updateWorkspaceFolders(Se,R,H||0,...ie),onDidChangeWorkspaceFolders:function(R,H,ie){return K(o.onDidChangeWorkspace)(R,H,ie)},asRelativePath:(R,H)=>o.getRelativePath(R,H),findFiles:(R,H,ie,je)=>o.findFiles(R,H,ie,Se.identifier,je),findFiles2:(R,H,ie)=>(Je(Se,"findFiles2"),o.findFiles2(R,H,Se.identifier,ie)),findTextInFiles:(R,H,ie,je)=>{Je(Se,"findTextInFiles");let pt,is;return typeof H=="object"?(pt=H,is=ie):(pt={},is=H,je=ie),o.findTextInFiles(R,pt||{},is,Se.identifier,je)},save:R=>o.save(R),saveAs:R=>o.saveAs(R),saveAll:R=>o.saveAll(R),applyEdit(R,H){return Cc.applyWorkspaceEdit(R,Se,H)},createFileSystemWatcher:(R,H,ie,je)=>{let pt;return typeof H=="boolean"?pt={ignoreCreateEvents:!!H,ignoreChangeEvents:!!ie,ignoreDeleteEvents:!!je,correlate:!1}:H&&(Je(Se,"createFileSystemWatcher"),pt={...H,correlate:!0}),ir.createFileSystemWatcher(o,Se,R,pt)},get textDocuments(){return Qe.getAllDocumentData().map(R=>R.document)},set textDocuments(R){throw new cR("textDocuments")},openTextDocument(R){let H;const ie=R;if(typeof R=="string")H=Promise.resolve(P.file(R));else if(P.isUri(R))H=Promise.resolve(R);else if(!ie||typeof ie=="object")H=Qe.createDocumentData(ie);else throw new Error("illegal argument - uriOrFileNameOrOptions");return H.then(je=>(je.scheme===_e.vscodeRemote&&!je.authority&&m.report("workspace.openTextDocument",Se,"A URI of 'vscode-remote' scheme requires an authority."),Qe.ensureDocumentData(je).then(pt=>pt.document)))},onDidOpenTextDocument:(R,H,ie)=>K(Qe.onDidAddDocument)(R,H,ie),onDidCloseTextDocument:(R,H,ie)=>K(Qe.onDidRemoveDocument)(R,H,ie),onDidChangeTextDocument:(R,H,ie)=>K(Qe.onDidChangeDocument)(R,H,ie),onDidSaveTextDocument:(R,H,ie)=>K(Qe.onDidSaveDocument)(R,H,ie),onWillSaveTextDocument:(R,H,ie)=>K(Oe.getOnWillSaveTextDocumentEvent(Se))(R,H,ie),get notebookDocuments(){return wt.notebookDocuments.map(R=>R.apiNotebook)},async openNotebookDocument(R,H){let ie;if(P.isUri(R))ie=R,await wt.openNotebookDocument(R);else if(typeof R=="string")ie=P.revive(await wt.createNotebookDocument({viewType:R,content:H}));else throw new Error("Invalid arguments");return wt.getNotebookDocument(ie).apiNotebook},onDidSaveNotebookDocument(R,H,ie){return K(Nt.onDidSaveNotebookDocument)(R,H,ie)},onDidChangeNotebookDocument(R,H,ie){return K(Nt.onDidChangeNotebookDocument)(R,H,ie)},onWillSaveNotebookDocument(R,H,ie){return K(Ro.getOnWillSaveNotebookDocumentEvent(Se))(R,H,ie)},get onDidOpenNotebookDocument(){return K(wt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return K(wt.onDidCloseNotebookDocument)},registerNotebookSerializer(R,H,ie,je){return wt.registerNotebookSerializer(Se,R,H,ie,Cd(Se,"notebookLiveShare")?je:void 0)},onDidChangeConfiguration:(R,H,ie)=>K(cd.onDidChangeConfiguration)(R,H,ie),getConfiguration(R,H){return H=arguments.length===1?void 0:H,cd.getConfiguration(R,H,Se)},registerTextDocumentContentProvider(R,H){return Tt.registerTextDocumentContentProvider(R,H)},registerTaskProvider:(R,H)=>(m.report("window.registerTaskProvider",Se,"Use the corresponding function on the 'tasks' namespace instead"),j.registerTaskProvider(Se,R,H)),registerFileSystemProvider(R,H,ie){return pa(gs.registerFileSystemProvider(Se,R,H,ie),i.addFileSystemProvider(R,H,ie))},get fs(){return i.value},registerFileSearchProvider:(R,H)=>(Je(Se,"fileSearchProvider"),J.registerFileSearchProvider(R,H)),registerTextSearchProvider:(R,H)=>(Je(Se,"textSearchProvider"),J.registerTextSearchProvider(R,H)),registerAITextSearchProvider:(R,H)=>(Je(Se,"aiTextSearchProvider"),Je(Se,"textSearchProvider"),J.registerAITextSearchProvider(R,H)),registerRemoteAuthorityResolver:(R,H)=>(Je(Se,"resolvers"),s.registerRemoteAuthorityResolver(R,H)),registerResourceLabelFormatter:R=>(Je(Se,"resolvers"),Tl.$registerResourceLabelFormatter(R)),getRemoteExecServer:R=>(Je(Se,"resolvers"),s.getRemoteExecServer(R)),onDidCreateFiles:(R,H,ie)=>K(ir.onDidCreateFile)(R,H,ie),onDidDeleteFiles:(R,H,ie)=>K(ir.onDidDeleteFile)(R,H,ie),onDidRenameFiles:(R,H,ie)=>K(ir.onDidRenameFile)(R,H,ie),onWillCreateFiles:(R,H,ie)=>K(ir.getOnWillCreateFileEvent(Se))(R,H,ie),onWillDeleteFiles:(R,H,ie)=>K(ir.getOnWillDeleteFileEvent(Se))(R,H,ie),onWillRenameFiles:(R,H,ie)=>K(ir.getOnWillRenameFileEvent(Se))(R,H,ie),openTunnel:R=>(Je(Se,"tunnels"),p.openTunnel(Se,R).then(H=>{if(!H)throw new Error("cannot open tunnel");return H})),get tunnels(){return Je(Se,"tunnels"),p.getTunnels()},onDidChangeTunnels:(R,H,ie)=>(Je(Se,"tunnels"),K(p.onDidChangeTunnels)(R,H,ie)),registerPortAttributesProvider:(R,H)=>(Je(Se,"portsAttributes"),p.registerPortsAttributesProvider(R,H)),registerTunnelProvider:(R,H)=>(Je(Se,"tunnelFactory"),p.registerTunnelProvider(R,H)),registerTimelineProvider:(R,H)=>(Je(Se,"timeline"),Fc.registerTimelineProvider(R,H,Se.identifier,F.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:R=>(Je(Se,"workspaceTrust"),o.requestWorkspaceTrust(R)),onDidGrantWorkspaceTrust:(R,H,ie)=>K(o.onDidGrantWorkspaceTrust)(R,H,ie),registerEditSessionIdentityProvider:(R,H)=>(Je(Se,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(R,H)),onWillCreateEditSessionIdentity:(R,H,ie)=>(Je(Se,"editSessionIdentityProvider"),K(o.getOnWillCreateEditSessionIdentityEvent(Se))(R,H,ie)),registerCanonicalUriProvider:(R,H)=>(Je(Se,"canonicalUriProvider"),o.registerCanonicalUriProvider(R,H)),getCanonicalUri:(R,H,ie)=>(Je(Se,"canonicalUriProvider"),o.provideCanonicalUri(R,H,ie))},No={get inputBox(){return m.report("scm.inputBox",Se,"Use 'SourceControl.inputBox' instead"),vc.getLastInputBox(Se)},createSourceControl(R,H,ie){return vc.createSourceControl(Se,R,H,ie)}},mn={createCommentController(R,H){return Yh.createCommentController(Se,R,H)}},ve={get activeDebugSession(){return U.activeDebugSession},get activeDebugConsole(){return U.activeDebugConsole},get breakpoints(){return U.breakpoints},get activeStackItem(){return U.activeStackItem},registerDebugVisualizationProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationProvider(Se,R,H)},registerDebugVisualizationTreeProvider(R,H){return Je(Se,"debugVisualization"),U.registerDebugVisualizationTree(Se,R,H)},onDidStartDebugSession(R,H,ie){return K(U.onDidStartDebugSession)(R,H,ie)},onDidTerminateDebugSession(R,H,ie){return K(U.onDidTerminateDebugSession)(R,H,ie)},onDidChangeActiveDebugSession(R,H,ie){return K(U.onDidChangeActiveDebugSession)(R,H,ie)},onDidReceiveDebugSessionCustomEvent(R,H,ie){return K(U.onDidReceiveDebugSessionCustomEvent)(R,H,ie)},onDidChangeBreakpoints(R,H,ie){return K(U.onDidChangeBreakpoints)(R,H,ie)},onDidChangeActiveStackItem(R,H,ie){return K(U.onDidChangeActiveStackItem)(R,H,ie)},registerDebugConfigurationProvider(R,H,ie){return U.registerDebugConfigurationProvider(R,H,ie||x6.Initial)},registerDebugAdapterDescriptorFactory(R,H){return U.registerDebugAdapterDescriptorFactory(Se,R,H)},registerDebugAdapterTrackerFactory(R,H){return U.registerDebugAdapterTrackerFactory(R,H)},startDebugging(R,H,ie){return!ie||typeof ie=="object"&&"configuration"in ie?U.startDebugging(R,H,{parentSession:ie}):U.startDebugging(R,H,ie||{})},stopDebugging(R){return U.stopDebugging(R)},addBreakpoints(R){return U.addBreakpoints(R)},removeBreakpoints(R){return U.removeBreakpoints(R)},asDebugSourceUri(R,H){return U.asDebugSourceUri(R,H)}},ct={registerTaskProvider:(R,H)=>j.registerTaskProvider(Se,R,H),fetchTasks:R=>j.fetchTasks(R),executeTask:R=>j.executeTask(Se,R),get taskExecutions(){return j.taskExecutions},onDidStartTask:(R,H,ie)=>K(j.onDidStartTask)(R,H,ie),onDidEndTask:(R,H,ie)=>K(j.onDidEndTask)(R,H,ie),onDidStartTaskProcess:(R,H,ie)=>K(j.onDidStartTaskProcess)(R,H,ie),onDidEndTaskProcess:(R,H,ie)=>K(j.onDidEndTaskProcess)(R,H,ie)},Ht={createNotebookController(R,H,ie,je,pt){return Vi.createNotebookController(Se,R,H,ie,je,Cd(Se,"notebookMessaging")?pt:void 0)},registerNotebookCellStatusBarItemProvider:(R,H)=>wt.registerNotebookCellStatusBarItemProvider(Se,R,H),createRendererMessaging(R){return Gn.createRendererMessaging(Se,R)},createNotebookControllerDetectionTask(R){return Je(Se,"notebookKernelSource"),Vi.createNotebookControllerDetectionTask(Se,R)},registerKernelSourceActionProvider(R,H){return Je(Se,"notebookKernelSource"),Vi.registerKernelSourceActionProvider(Se,R,H)},onDidChangeNotebookCellExecutionState(R,H,ie){return Je(Se,"notebookCellExecutionState"),K(Vi.onDidChangeNotebookCellExecutionState)(R,H,ie)}},Ei={t(...R){if(typeof R[0]=="string"){const H=R.shift(),ie=!R||typeof R[0]!="object"?R:R[0];return me.getMessage(Se.identifier.value,{message:H,args:ie})}return me.getMessage(Se.identifier.value,R[0])},get bundle(){return me.getBundle(Se.identifier.value)},get uri(){return me.getBundleUri(Se.identifier.value)}},Ut={_version:1,transferActiveChat(R){return Je(Se,"interactive"),ad.transferActiveChat(R)}},G={getRelatedInformation(R,H){return Je(Se,"aiRelatedInformation"),Ca.getRelatedInformation(Se,R,H)},registerRelatedInformationProvider(R,H){return Je(Se,"aiRelatedInformation"),Ca.registerRelatedInformationProvider(Se,R,H)},registerEmbeddingVectorProvider(R,H){return Je(Se,"aiRelatedInformation"),Ld.registerEmbeddingVectorProvider(Se,R,H)}},de={_version:1,registerChatResponseProvider(R,H,ie){return Je(Se,"chatProvider"),S.registerLanguageModel(Se,R,H,ie)},registerChatVariableResolver(R,H,ie,je,pt,is,Ss,ld){return Je(Se,"chatVariableResolver"),wc.registerVariableResolver(Se,R,H,ie,je,pt,is,Ss,ld?.id)},registerMappedEditsProvider(R,H){return Je(Se,"mappedEditsProvider"),ki.registerMappedEditsProvider(Se,R,H)},createChatParticipant(R,H){return ad.createChatAgent(Se,R,H)},createDynamicChatParticipant(R,H,ie){return Je(Se,"chatParticipantPrivate"),ad.createDynamicChatAgent(Se,R,H,ie)},attachContext(R,H,ie){return Je(Se,"chatVariableResolver"),wc.attachContext(R,H,ie)}},L={selectChatModels:R=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),Promise.resolve([])):S.selectLanguageModels(Se,R??{}),onDidChangeChatModels:(R,H,ie)=>e.quality==="stable"?(console.warn(`[${Cn.toKey(Se.identifier)}] This API is disabled in '${e.environment.appName}'-stable.`),T.None(R,H,ie)):S.onDidChangeProviders(R,H,ie),get embeddingModels(){return Je(Se,"embeddings"),bc.embeddingsModels},onDidChangeEmbeddingModels:(R,H,ie)=>(Je(Se,"embeddings"),bc.onDidChange(R,H,ie)),registerEmbeddingsProvider(R,H){return Je(Se,"embeddings"),bc.registerEmbeddingsProvider(Se,R,H)},async computeEmbeddings(R,H,ie){return Je(Se,"embeddings"),bc.computeEmbeddings(R,H,ie)}},ne={registerSpeechProvider(R,H){return Je(Se,"speech"),Fu.registerProvider(Se.identifier,R,H)}};return{version:e.version,ai:G,authentication:ri,commands:ts,comments:mn,chat:de,debug:ve,env:Os,extensions:yc,interactive:Ut,l10n:Ei,languages:Ou,lm:L,notebooks:Ht,scm:No,speech:ne,tasks:ct,tests:sr,window:le,workspace:_r,Breakpoint:$F,TerminalOutputAnchor:tse,ChatResultFeedbackKind:y4,ChatVariableLevel:Rse,ChatCompletionItem:Pot,CallHierarchyIncomingCall:gOe,CallHierarchyItem:$he,CallHierarchyOutgoingCall:fOe,CancellationError:Tc,CancellationTokenSource:ai,CandidatePortSource:UM,CodeAction:F6,CodeActionKind:Ya,CodeActionTriggerKind:o4,CodeLens:O6,Color:VF,ColorInformation:z6,ColorPresentation:$6,ColorThemeKind:uE,CommentMode:bse,CommentState:Cse,CommentThreadCollapsibleState:m4,CommentThreadState:_4,CommentThreadApplicability:iG,CompletionItem:H6,CompletionItemKind:nn,CompletionItemTag:a4,CompletionList:WF,CompletionTriggerKind:RM,ConfigurationTarget:PM,CustomExecution:Ghe,DebugAdapterExecutable:j6,DebugAdapterInlineImplementation:Y6,DebugAdapterNamedPipeServer:K6,DebugAdapterServer:f4,DebugConfigurationProviderTriggerKind:x6,DebugConsoleMode:nG,DebugVisualization:Eot,DecorationRangeBehavior:_I,Diagnostic:R6,DiagnosticRelatedInformation:e4,DiagnosticSeverity:Th,DiagnosticTag:mI,Disposable:oo,DocumentHighlight:N6,DocumentHighlightKind:t4,MultiDocumentHighlight:P6,DocumentLink:V6,DocumentSymbol:s4,EndOfLine:jv,EnvironmentVariableMutatorType:LM,EvaluatableExpression:J6,InlineValueText:X6,InlineValueVariableLookup:Z6,InlineValueEvaluatableExpression:eG,InlineCompletionTriggerKind:p4,EventEmitter:I,ExtensionKind:$I,ExtensionMode:WM,ExternalUriOpenerPriority:Dse,FileChangeType:OM,FileDecoration:sG,FileDecoration2:sG,FileSystemError:Wl,FileType:an,FilePermission:vm,FoldingRange:wse,FoldingRangeKind:vy,FunctionBreakpoint:wI,InlineCompletionItem:cse,InlineCompletionList:lse,Hover:M6,VerboseHover:ise,HoverVerbosityAction:lke,IndentAction:Ga,Location:_p,MarkdownString:vp,OverviewRulerLane:oh,ParameterInformation:nse,PortAutoForwardAction:Ise,Position:Ps,ProcessExecution:zF,ProgressLocation:VI,QuickInputButtons:v4,Range:rs,RelativePattern:FM,Selection:XS,SelectionRange:r4,SemanticTokens:GF,SemanticTokensBuilder:Sot,SemanticTokensEdit:pOe,SemanticTokensEdits:_8,SemanticTokensLegend:yse,ShellExecution:j1,ShellQuoting:pse,SignatureHelp:ose,SignatureHelpTriggerKind:rse,SignatureInformation:sse,SnippetString:Q1,SourceBreakpoint:vI,StandardTokenType:UE,StatusBarAlignment:HE,SymbolInformation:n4,SymbolKind:Gr,SymbolTag:i4,Task:G6,TaskGroup:d4,TaskPanelKind:fse,TaskRevealKind:gse,TaskScope:K1,TerminalLink:fot,TerminalQuickFixTerminalCommand:mot,TerminalQuickFixOpener:pot,TerminalLocation:use,TerminalProfile:_ot,TerminalExitReason:hse,TerminalShellExecutionCommandLineConfidence:NM,TextDocumentSaveReason:MM,TextEdit:qx,SnippetTextEdit:zhe,TextEditorCursorStyle:fa,TextEditorLineNumbersStyle:wv,TextEditorRevealType:U6,TextEditorSelectionChangeKind:HF,SyntaxTokenType:UF,TextDocumentChangeReason:l4,ThemeColor:g4,ThemeIcon:fg,TreeItem:q6,TreeItemCheckboxState:Lb,TreeItemCollapsibleState:zI,TypeHierarchyItem:qhe,UIKind:yw,Uri:P,ViewColumn:c4,WorkspaceEdit:q1,DocumentPasteTriggerKind:hke,DocumentDropEdit:_se,DocumentDropOrPasteEditKind:u4,DocumentPasteEdit:wot,InlayHint:W6,InlayHintLabelPart:B6,InlayHintKind:ase,RemoteAuthorityResolverError:OT,ResolvedAuthority:got,ManagedResolvedAuthority:m8,SourceControlInputBoxValidationType:dse,ExtensionRuntime:dG,TimelineItem:Ese,NotebookRange:rS,NotebookCellKind:bI,NotebookCellExecutionState:qF,NotebookCellData:ej,NotebookData:mOe,NotebookRendererScript:vOe,NotebookCellStatusBarAlignment:rG,NotebookEditorRevealType:aG,NotebookCellOutput:oG,NotebookCellOutputItem:_Oe,NotebookCellStatusBarItem:xot,NotebookControllerAffinity:Ase,NotebookControllerAffinity2:cG,NotebookEdit:T6,NotebookKernelSourceAction:Dot,NotebookVariablesRequestKind:lG,PortAttributes:Iot,LinkedEditingRanges:kot,TestResultState:xse,TestRunRequest:hG,TestMessage:b4,TestTag:C4,TestRunProfileKind:HM,TextSearchCompleteMessageType:zne,DataTransfer:h4,DataTransferItem:Q6,TestCoverageCount:kX,FileCoverage:uG,FileCoverage2:uG,StatementCoverage:Tot,BranchCoverage:Rot,DeclarationCoverage:Mot,WorkspaceTrustState:kse,LanguageStatusSeverity:TM,QuickPickItemKind:w4,InputBoxValidationSeverity:BM,TabInputText:Qhe,TabInputTextDiff:gG,TabInputTextMerge:wOe,TabInputCustom:jhe,TabInputNotebook:Khe,TabInputNotebookDiff:Yhe,TabInputWebview:bOe,TabInputTerminal:COe,TabInputInteractiveWindow:yOe,TabInputChat:SOe,TabInputTextMultiDiff:Not,TelemetryTrustedValue:qde,LogLevel:Pn,EditSessionIdentityMatch:Ose,InteractiveSessionVoteDirection:Lse,ChatCopyKind:Tse,InteractiveEditorResponseFeedbackKind:Mse,DebugStackFrame:Cot,DebugThread:yot,RelatedInformationType:Nse,SpeechToTextStatus:Pse,TextToSpeechStatus:wke,PartialAcceptTriggerKind:IR,KeywordRecognitionStatus:Fse,ChatResponseMarkdownPart:Jhe,ChatResponseFileTreePart:Xhe,ChatResponseAnchorPart:Zhe,ChatResponseProgressPart:mG,ChatResponseProgressPart2:Fot,ChatResponseReferencePart:GI,ChatResponseWarningPart:_G,ChatResponseTextEditPart:vG,ChatResponseMarkdownWithVulnerabilitiesPart:fG,ChatResponseCommandButtonPart:eue,ChatResponseDetectedParticipantPart:pG,ChatResponseConfirmationPart:_ke,ChatRequestTurn:Oot,ChatResponseTurn:Bot,ChatLocation:cb,LanguageModelChatMessageRole:Iv,LanguageModelChatMessage:v8,LanguageModelChatMessage2:v8,LanguageModelChatSystemMessage:I7t,LanguageModelChatUserMessage:L7t,LanguageModelChatAssistantMessage:T7t,LanguageModelError:qg,NewSymbolName:D7t,NewSymbolNameTag:gke,NewSymbolNameTriggerKind:tG,InlineEdit:R7t,InlineEditTriggerKind:wG}}}var $X;let iRe=class{constructor(e,t,i,s,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=s,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),vs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();vs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new Lni(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(nRe)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(sRe,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};iRe=D([_(2,be),_(3,hD),_(4,_L),_(5,Sg),_(6,Ze)],iRe);var tF;let nRe=(tF=class{constructor(e){if(e.environment.appRoot&&$X.aliased.size){const t=Iu(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",s=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${s})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,s,o]=t,r=$X.aliased.get(s);if(r!==void 0)return console.warn(`${s} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},$X=tF,tF.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),tF);nRe=$X=D([_(0,Sg)],nRe);class Lni{constructor(e,t,i,s,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=s,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new $a}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let s=this._extApiImpl.get(i.identifier);return s||(s=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,s)),s}if(!this._defaultApiImpl){let s="";this._extensionPaths.forEach((o,r)=>s+=` ${r} -> ${o.identifier.value} `),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: ${s}`),this._defaultApiImpl=this._apiFactory(Tet,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let sRe=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(Ue.MainThreadTelemetry);const s=i.getProxy(Ue.MainThreadWindow);this._impl=(o,r)=>{const a=P.parse(o);return r?this.callOriginal(o,r):a.scheme==="http"||a.scheme==="https"?s.$openUri(a,o,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?s.$openUri(a,o,{}):this.callOriginal(o,r)}}load(e,t,i){const s=this._extensionPaths.findSubstr(t);return s&&(this._extensionId=s.identifier.value,this.sendShimmingTelemetry()),this._original=i(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};sRe=D([_(2,gr)],sRe);let oRe=class{constructor(e,t){this._mainThreadConsole=e.getProxy(Ue.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){const i=this,s=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,s,arguments)}})}_handleConsoleCall(e,t,i,s){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:Rni(s,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,s)}};oRe=D([_(0,gr),_(1,Sg)],oRe);const Tni=1e5;function Rni(n,e){const t=[];if(n.length)for(let i=0;i"u")s="undefined";else if(s instanceof Error){const o=s;o.stack?s=o.stack:s=o.toString()}t.push(s)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` `).slice(3).join(` `)})}try{const i=Vct(t);return i.length>Tni?"Output omitted for a large object that exceeds the limits":i}catch(i){return`Output omitted for an object that cannot be inspected ('${i.toString()}')`}}let rRe=class extends oRe{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};rRe=D([_(0,gr),_(1,Sg)],rRe);class Mni extends iRe{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const s=i(e);if(s){e=s;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class Nni extends pTe{constructor(){super(...arguments),this.extensionRuntime=dG.Webworker}async _beforeAlmostReadyToRunExtensions(){_9&&this._instaService.createInstance(rRe),this._apiFactory=this._instaService.invokeFunction(Ini),this._fakeModules=this._instaService.createInstance(Mni,this._apiFactory,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark("code/extHost/didInitAPI"),await this._waitForDebuggerAttachment()}_getEntryPoint(e){return e.browser}async _loadCommonJSModule(e,t,i){t=t.with({path:Pni(t.path,".js")});const s=e?.identifier.value;s&&performance.mark(`code/extHost/willFetchExtensionCode/${s}`);const o=P.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),r=await fetch(o.toString(!0));if(s&&performance.mark(`code/extHost/didFetchExtensionCode/${s}`),r.status!==200)throw new Error(r.statusText);const a=await r.text(),c=`${t.toString(!0)}#vscode-extension`,l=`${a} -//# sourceURL=${c}`;let d;try{d=new Function("module","exports","require",l)}catch(p){throw console.error(s?`Loading code for extension ${s} failed: ${p.message}`:`Loading code failed: ${p.message}`),console.error(`${t.toString(!0)}${typeof p.line=="number"?` line ${p.line}`:""}${typeof p.column=="number"?` column ${p.column}`:""}`),console.error(p),p}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);const h={},u={exports:h},f=p=>{const m=this._fakeModules.getModule(p,t);if(m===void 0)throw new Error(`Cannot load module '${p}'`);return m};try{return i.codeLoadingStart(),s&&performance.mark(`code/extHost/willLoadExtensionCode/${s}`),d(u,h,f),u.exports!==h?u.exports:h}finally{s&&performance.mark(`code/extHost/didLoadExtensionCode/${s}`),i.codeLoadingStop()}}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;const t=Date.now()+e;for(;Date.now()o.getApi(r)),e}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i!=null&&this._productService.commit!=null&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===1?void 0:{configuration:t.configuration??void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:e.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===1,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};aRe=D([_(3,on),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,Ja),_(10,V_)],aRe);async function Wni(n){return(await zat.p)(n)}sJt(aRe);F4t(async n=>{n.get(ho),Wot(await Wni())});function Hni(n,e,t){return Promise.resolve(void 0)}function Uni(){return new Promise((n,e)=>{try{NJt({...Wei(Pv.file("/tmp")),...jei(Hni),...oti(),...dti()}).then(()=>{n()})}catch(t){e(t)}})}const Vni=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; +//# sourceURL=${c}`;let d;try{d=new Function("module","exports","require",l)}catch(p){throw console.error(s?`Loading code for extension ${s} failed: ${p.message}`:`Loading code failed: ${p.message}`),console.error(`${t.toString(!0)}${typeof p.line=="number"?` line ${p.line}`:""}${typeof p.column=="number"?` column ${p.column}`:""}`),console.error(p),p}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);const h={},u={exports:h},f=p=>{const m=this._fakeModules.getModule(p,t);if(m===void 0)throw new Error(`Cannot load module '${p}'`);return m};try{return i.codeLoadingStart(),s&&performance.mark(`code/extHost/willLoadExtensionCode/${s}`),d(u,h,f),u.exports!==h?u.exports:h}finally{s&&performance.mark(`code/extHost/didLoadExtensionCode/${s}`),i.codeLoadingStop()}}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;const t=Date.now()+e;for(;Date.now()o.getApi(r)),e}async _createExtHostInitData(){const e=await this._initDataProvider.getInitData();this.extensions=e.extensions;const t=this._contextService.getWorkspace(),i=this._productService.extensionsGallery?.nlsBaseUrl;let s;return i!=null&&this._productService.commit!=null&&!s1.isDefaultVariant()&&(s=P.joinPath(P.parse(i),this._productService.commit,this._productService.version,s1.value())),{commit:this._productService.commit,version:this._productService.version,quality:this._productService.quality,parentPid:0,environment:{isExtensionDevelopmentDebug:this._environmentService.debugRenderer,appName:this._productService.nameLong,appHost:this._productService.embedderIdentifier??(Jn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Gd,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:yPe(this._productService,this._environmentService),extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===1?void 0:{configuration:t.configuration??void 0,id:t.id,name:this._labelService.getWorkspaceLabel(t),transient:t.transient},consoleForward:{includeStack:!1,logNative:this._environmentService.debugRenderer},extensions:e.extensions.toSnapshot(),nlsBaseUrl:s,telemetryInfo:{sessionId:this._telemetryService.sessionId,machineId:this._telemetryService.machineId,firstSessionDate:this._telemetryService.firstSessionDate,msftInternal:this._telemetryService.msftInternal,sqmId:this._telemetryService.sqmId,devDeviceId:this._telemetryService.devDeviceId},logLevel:this._logService.getLevel(),loggers:[...this._loggerService.getRegisteredLoggers()],logsLocation:this._extensionHostLogsLocation,autoStart:this.startup===1,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Jn?yw.Web:yw.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};aRe=D([_(3,rn),_(4,Ti),_(5,eo),_(6,Ze),_(7,wp),_(8,Ow),_(9,Ja),_(10,V_)],aRe);async function Wni(n){return(await zat.p)(n)}sJt(aRe);F4t(async n=>{n.get(ho),Wot(await Wni())});function Hni(n,e,t){return Promise.resolve(void 0)}function Uni(){return new Promise((n,e)=>{try{NJt({...Wei(Pv.file("/tmp")),...jei(Hni),...oti(),...dti()}).then(()=>{n()})}catch(t){e(t)}})}const Vni=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; export component Demo { VerticalBox { alignment: start; @@ -990,7 +990,7 @@ export component Demo { ${JSON.stringify(Object.fromEntries(i))}`));return}const o=parseInt(s);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=o}const t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(s)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,mRe.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}YI.ReadableStreamMessageReader=Psi;var JI={};Object.defineProperty(JI,"__esModule",{value:!0});JI.WriteableStreamMessageWriter=JI.AbstractMessageWriter=JI.MessageWriter=void 0;const W6e=uD,X3=jd,Fsi=cj,H6e=tA,Osi="Content-Length: ",U6e=`\r `;var V6e;(function(n){function e(t){let i=t;return i&&X3.func(i.dispose)&&X3.func(i.onClose)&&X3.func(i.onError)&&X3.func(i.write)}n.is=e})(V6e||(JI.MessageWriter=V6e={}));class Kat{constructor(){this.errorEmitter=new H6e.Emitter,this.closeEmitter=new H6e.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${X3.string(e.message)?e.message:"unknown"}`)}}JI.AbstractMessageWriter=Kat;var vRe;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,W6e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,W6e.default)().applicationJson.encoder}}n.fromOptions=e})(vRe||(vRe={}));class Bsi extends Kat{constructor(e,t){super(),this.writable=e,this.options=vRe.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Fsi.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{const s=[];return s.push(Osi,i.byteLength.toString(),U6e),s.push(U6e),this.doWrite(e,s,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}JI.WriteableStreamMessageWriter=Bsi;var Cue={};Object.defineProperty(Cue,"__esModule",{value:!0});Cue.AbstractMessageBuffer=void 0;const Wsi=13,Hsi=10,Usi=`\r `;class Vsi{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,s=0,o=0;e:for(;ithis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],r=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,r}const t=this.allocNative(e);let i=0,s=0;for(;e>0;){const o=this._chunks[s];if(o.byteLength>e){const r=o.slice(0,e);t.set(r,i),i+=e,this._chunks[s]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}}Cue.AbstractMessageBuffer=Vsi;var Yat={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.ConnectionOptions=n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.RequestCancellationReceiverStrategy=n.IdCancellationReceiverStrategy=n.ConnectionStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=n.NullLogger=n.ProgressType=n.ProgressToken=void 0;const e=uD,t=jd,i=hn,s=kx,o=tA,r=X1;var a;(function(j){j.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(j){function re(me){return typeof me=="string"||typeof me=="number"}j.is=re})(c||(n.ProgressToken=c={}));var l;(function(j){j.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}n.ProgressType=d;var h;(function(j){function re(me){return t.func(me)}j.is=re})(h||(h={})),n.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var u;(function(j){j[j.Off=0]="Off",j[j.Messages=1]="Messages",j[j.Compact=2]="Compact",j[j.Verbose=3]="Verbose"})(u||(n.Trace=u={}));var f;(function(j){j.Off="off",j.Messages="messages",j.Compact="compact",j.Verbose="verbose"})(f||(n.TraceValues=f={})),function(j){function re(De){if(!t.string(De))return j.Off;switch(De=De.toLowerCase(),De){case"off":return j.Off;case"messages":return j.Messages;case"compact":return j.Compact;case"verbose":return j.Verbose;default:return j.Off}}j.fromString=re;function me(De){switch(De){case j.Off:return"off";case j.Messages:return"messages";case j.Compact:return"compact";case j.Verbose:return"verbose";default:return"off"}}j.toString=me}(u||(n.Trace=u={}));var p;(function(j){j.Text="text",j.JSON="json"})(p||(n.TraceFormat=p={})),function(j){function re(me){return t.string(me)?(me=me.toLowerCase(),me==="json"?j.JSON:j.Text):j.Text}j.fromString=re}(p||(n.TraceFormat=p={}));var m;(function(j){j.type=new i.NotificationType("$/setTrace")})(m||(n.SetTraceNotification=m={}));var v;(function(j){j.type=new i.NotificationType("$/logTrace")})(v||(n.LogTraceNotification=v={}));var w;(function(j){j[j.Closed=1]="Closed",j[j.Disposed=2]="Disposed",j[j.AlreadyListening=3]="AlreadyListening"})(w||(n.ConnectionErrors=w={}));class b extends Error{constructor(re,me){super(me),this.code=re,Object.setPrototypeOf(this,b.prototype)}}n.ConnectionError=b;var C;(function(j){function re(me){const De=me;return De&&t.func(De.cancelUndispatched)}j.is=re})(C||(n.ConnectionStrategy=C={}));var y;(function(j){function re(me){const De=me;return De&&(De.kind===void 0||De.kind==="id")&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(y||(n.IdCancellationReceiverStrategy=y={}));var S;(function(j){function re(me){const De=me;return De&&De.kind==="request"&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(S||(n.RequestCancellationReceiverStrategy=S={}));var M;(function(j){j.Message=Object.freeze({createCancellationTokenSource(me){return new r.CancellationTokenSource}});function re(me){return y.is(me)||S.is(me)}j.is=re})(M||(n.CancellationReceiverStrategy=M={}));var k;(function(j){j.Message=Object.freeze({sendCancellation(me,De){return me.sendNotification(a.type,{id:De})},cleanup(me){}});function re(me){const De=me;return De&&t.func(De.sendCancellation)&&t.func(De.cleanup)}j.is=re})(k||(n.CancellationSenderStrategy=k={}));var F;(function(j){j.Message=Object.freeze({receiver:M.Message,sender:k.Message});function re(me){const De=me;return De&&M.is(De.receiver)&&k.is(De.sender)}j.is=re})(F||(n.CancellationStrategy=F={}));var N;(function(j){function re(me){const De=me;return De&&t.func(De.handleMessage)}j.is=re})(N||(n.MessageStrategy=N={}));var z;(function(j){function re(me){const De=me;return De&&(F.is(De.cancellationStrategy)||C.is(De.connectionStrategy)||N.is(De.messageStrategy))}j.is=re})(z||(n.ConnectionOptions=z={}));var U;(function(j){j[j.New=1]="New",j[j.Listening=2]="Listening",j[j.Closed=3]="Closed",j[j.Disposed=4]="Disposed"})(U||(U={}));function J(j,re,me,De){const Qe=me!==void 0?me:n.NullLogger;let Tt=0,Oe=0,wt=0;const Nt="2.0";let Yi;const Vi=new Map;let Gn;const Ro=new Map,qn=new Map;let ec,ys=new s.LinkedMap,mr=new Map,ba=new Set,ki=new Map,gs=u.Off,ir=p.Text,Hn,_c=U.New;const gh=new o.Emitter,Qn=new o.Emitter,Yh=new o.Emitter,el=new o.Emitter,Tl=new o.Emitter,to=De&&De.cancellationStrategy?De.cancellationStrategy:F.Message;function Fc(ve){if(ve===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ve.toString()}function rd(ve){return ve===null?"res-unknown-"+(++wt).toString():"res-"+ve.toString()}function Jh(){return"not-"+(++Oe).toString()}function Af(ve,ct){i.Message.isRequest(ct)?ve.set(Fc(ct.id),ct):i.Message.isResponse(ct)?ve.set(rd(ct.id),ct):ve.set(Jh(),ct)}function tl(ve){}function Rl(){return _c===U.Listening}function Xh(){return _c===U.Closed}function ul(){return _c===U.Disposed}function ad(){(_c===U.New||_c===U.Listening)&&(_c=U.Closed,Qn.fire(void 0))}function vc(ve){gh.fire([ve,void 0,void 0])}function Ca(ve){gh.fire(ve)}j.onClose(ad),j.onError(vc),re.onClose(ad),re.onError(Ca);function Ld(){ec||ys.size===0||(ec=(0,e.default)().timer.setImmediate(()=>{ec=void 0,Fu()}))}function fh(ve){i.Message.isRequest(ve)?Zh(ve):i.Message.isNotification(ve)?nr(ve):i.Message.isResponse(ve)?bc(ve):Rs(ve)}function Fu(){if(ys.size===0)return;const ve=ys.shift();try{const ct=De?.messageStrategy;N.is(ct)?ct.handleMessage(ve,fh):fh(ve)}finally{Ld()}}const wc=ve=>{try{if(i.Message.isNotification(ve)&&ve.method===a.type.method){const ct=ve.params.id,Ht=Fc(ct),Ei=ys.get(Ht);if(i.Message.isRequest(Ei)){const G=De?.connectionStrategy,de=G&&G.cancelUndispatched?G.cancelUndispatched(Ei,tl):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ys.delete(Ht),ki.delete(ct),de.id=Ei.id,cd(de,ve.method,Date.now()),re.write(de).catch(()=>Qe.error("Sending response for canceled message failed."));return}}const Ut=ki.get(ct);if(Ut!==void 0){Ut.cancel(),Le(ve);return}else ba.add(ct)}Af(ys,ve)}finally{Ld()}};function Zh(ve){if(ul())return;function ct(ne,R,H){const ie={jsonrpc:Nt,id:ve.id};ne instanceof i.ResponseError?ie.error=ne.toJson():ie.result=ne===void 0?null:ne,cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ht(ne,R,H){const ie={jsonrpc:Nt,id:ve.id,error:ne.toJson()};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ei(ne,R,H){ne===void 0&&(ne=null);const ie={jsonrpc:Nt,id:ve.id,result:ne};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}K(ve);const Ut=Vi.get(ve.method);let G,de;Ut&&(G=Ut.type,de=Ut.handler);const L=Date.now();if(de||Yi){const ne=ve.id??String(Date.now()),R=y.is(to.receiver)?to.receiver.createCancellationTokenSource(ne):to.receiver.createCancellationTokenSource(ve);ve.id!==null&&ba.has(ve.id)&&R.cancel(),ve.id!==null&&ki.set(ne,R);try{let H;if(de)if(ve.params===void 0){if(G!==void 0&&G.numberOfParams!==0){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines ${G.numberOfParams} params but received none.`),ve.method,L);return}H=de(R.token)}else if(Array.isArray(ve.params)){if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byName){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by name but received parameters by position`),ve.method,L);return}H=de(...ve.params,R.token)}else{if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byPosition){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by position but received parameters by name`),ve.method,L);return}H=de(ve.params,R.token)}else Yi&&(H=Yi(ve.method,ve.params,R.token));const ie=H;H?ie.then?ie.then(je=>{ki.delete(ne),ct(je,ve.method,L)},je=>{ki.delete(ne),je instanceof i.ResponseError?Ht(je,ve.method,L):je&&t.string(je.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${je.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}):(ki.delete(ne),ct(H,ve.method,L)):(ki.delete(ne),Ei(H,ve.method,L))}catch(H){ki.delete(ne),H instanceof i.ResponseError?ct(H,ve.method,L):H&&t.string(H.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${H.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}}else Ht(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${ve.method}`),ve.method,L)}function bc(ve){if(!ul())if(ve.id===null)ve.error?Qe.error(`Received response message without id: Error is: +${d}`);const u=d.substr(0,h),f=d.substr(h+1).trim();a.set(e?u.toLowerCase():u,f)}return a}tryReadBody(e){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],r=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,r}const t=this.allocNative(e);let i=0,s=0;for(;e>0;){const o=this._chunks[s];if(o.byteLength>e){const r=o.slice(0,e);t.set(r,i),i+=e,this._chunks[s]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}}Cue.AbstractMessageBuffer=Vsi;var Yat={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.ConnectionOptions=n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.RequestCancellationReceiverStrategy=n.IdCancellationReceiverStrategy=n.ConnectionStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=n.NullLogger=n.ProgressType=n.ProgressToken=void 0;const e=uD,t=jd,i=hn,s=kx,o=tA,r=X1;var a;(function(j){j.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(j){function re(me){return typeof me=="string"||typeof me=="number"}j.is=re})(c||(n.ProgressToken=c={}));var l;(function(j){j.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}n.ProgressType=d;var h;(function(j){function re(me){return t.func(me)}j.is=re})(h||(h={})),n.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var u;(function(j){j[j.Off=0]="Off",j[j.Messages=1]="Messages",j[j.Compact=2]="Compact",j[j.Verbose=3]="Verbose"})(u||(n.Trace=u={}));var f;(function(j){j.Off="off",j.Messages="messages",j.Compact="compact",j.Verbose="verbose"})(f||(n.TraceValues=f={})),function(j){function re(De){if(!t.string(De))return j.Off;switch(De=De.toLowerCase(),De){case"off":return j.Off;case"messages":return j.Messages;case"compact":return j.Compact;case"verbose":return j.Verbose;default:return j.Off}}j.fromString=re;function me(De){switch(De){case j.Off:return"off";case j.Messages:return"messages";case j.Compact:return"compact";case j.Verbose:return"verbose";default:return"off"}}j.toString=me}(u||(n.Trace=u={}));var p;(function(j){j.Text="text",j.JSON="json"})(p||(n.TraceFormat=p={})),function(j){function re(me){return t.string(me)?(me=me.toLowerCase(),me==="json"?j.JSON:j.Text):j.Text}j.fromString=re}(p||(n.TraceFormat=p={}));var m;(function(j){j.type=new i.NotificationType("$/setTrace")})(m||(n.SetTraceNotification=m={}));var v;(function(j){j.type=new i.NotificationType("$/logTrace")})(v||(n.LogTraceNotification=v={}));var w;(function(j){j[j.Closed=1]="Closed",j[j.Disposed=2]="Disposed",j[j.AlreadyListening=3]="AlreadyListening"})(w||(n.ConnectionErrors=w={}));class b extends Error{constructor(re,me){super(me),this.code=re,Object.setPrototypeOf(this,b.prototype)}}n.ConnectionError=b;var C;(function(j){function re(me){const De=me;return De&&t.func(De.cancelUndispatched)}j.is=re})(C||(n.ConnectionStrategy=C={}));var y;(function(j){function re(me){const De=me;return De&&(De.kind===void 0||De.kind==="id")&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(y||(n.IdCancellationReceiverStrategy=y={}));var S;(function(j){function re(me){const De=me;return De&&De.kind==="request"&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=re})(S||(n.RequestCancellationReceiverStrategy=S={}));var M;(function(j){j.Message=Object.freeze({createCancellationTokenSource(me){return new r.CancellationTokenSource}});function re(me){return y.is(me)||S.is(me)}j.is=re})(M||(n.CancellationReceiverStrategy=M={}));var k;(function(j){j.Message=Object.freeze({sendCancellation(me,De){return me.sendNotification(a.type,{id:De})},cleanup(me){}});function re(me){const De=me;return De&&t.func(De.sendCancellation)&&t.func(De.cleanup)}j.is=re})(k||(n.CancellationSenderStrategy=k={}));var F;(function(j){j.Message=Object.freeze({receiver:M.Message,sender:k.Message});function re(me){const De=me;return De&&M.is(De.receiver)&&k.is(De.sender)}j.is=re})(F||(n.CancellationStrategy=F={}));var N;(function(j){function re(me){const De=me;return De&&t.func(De.handleMessage)}j.is=re})(N||(n.MessageStrategy=N={}));var z;(function(j){function re(me){const De=me;return De&&(F.is(De.cancellationStrategy)||C.is(De.connectionStrategy)||N.is(De.messageStrategy))}j.is=re})(z||(n.ConnectionOptions=z={}));var U;(function(j){j[j.New=1]="New",j[j.Listening=2]="Listening",j[j.Closed=3]="Closed",j[j.Disposed=4]="Disposed"})(U||(U={}));function J(j,re,me,De){const Qe=me!==void 0?me:n.NullLogger;let Tt=0,Oe=0,wt=0;const Nt="2.0";let Ji;const Vi=new Map;let Gn;const Ro=new Map,qn=new Map;let ec,ys=new s.LinkedMap,mr=new Map,ba=new Set,ki=new Map,gs=u.Off,ir=p.Text,Hn,vc=U.New;const gh=new o.Emitter,Qn=new o.Emitter,Yh=new o.Emitter,tl=new o.Emitter,Tl=new o.Emitter,to=De&&De.cancellationStrategy?De.cancellationStrategy:F.Message;function Fc(ve){if(ve===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ve.toString()}function rd(ve){return ve===null?"res-unknown-"+(++wt).toString():"res-"+ve.toString()}function Jh(){return"not-"+(++Oe).toString()}function Af(ve,ct){i.Message.isRequest(ct)?ve.set(Fc(ct.id),ct):i.Message.isResponse(ct)?ve.set(rd(ct.id),ct):ve.set(Jh(),ct)}function il(ve){}function Rl(){return vc===U.Listening}function Xh(){return vc===U.Closed}function ul(){return vc===U.Disposed}function ad(){(vc===U.New||vc===U.Listening)&&(vc=U.Closed,Qn.fire(void 0))}function wc(ve){gh.fire([ve,void 0,void 0])}function Ca(ve){gh.fire(ve)}j.onClose(ad),j.onError(wc),re.onClose(ad),re.onError(Ca);function Ld(){ec||ys.size===0||(ec=(0,e.default)().timer.setImmediate(()=>{ec=void 0,Fu()}))}function fh(ve){i.Message.isRequest(ve)?Zh(ve):i.Message.isNotification(ve)?nr(ve):i.Message.isResponse(ve)?Cc(ve):Rs(ve)}function Fu(){if(ys.size===0)return;const ve=ys.shift();try{const ct=De?.messageStrategy;N.is(ct)?ct.handleMessage(ve,fh):fh(ve)}finally{Ld()}}const bc=ve=>{try{if(i.Message.isNotification(ve)&&ve.method===a.type.method){const ct=ve.params.id,Ht=Fc(ct),Ei=ys.get(Ht);if(i.Message.isRequest(Ei)){const G=De?.connectionStrategy,de=G&&G.cancelUndispatched?G.cancelUndispatched(Ei,il):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ys.delete(Ht),ki.delete(ct),de.id=Ei.id,cd(de,ve.method,Date.now()),re.write(de).catch(()=>Qe.error("Sending response for canceled message failed."));return}}const Ut=ki.get(ct);if(Ut!==void 0){Ut.cancel(),Le(ve);return}else ba.add(ct)}Af(ys,ve)}finally{Ld()}};function Zh(ve){if(ul())return;function ct(ne,R,H){const ie={jsonrpc:Nt,id:ve.id};ne instanceof i.ResponseError?ie.error=ne.toJson():ie.result=ne===void 0?null:ne,cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ht(ne,R,H){const ie={jsonrpc:Nt,id:ve.id,error:ne.toJson()};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}function Ei(ne,R,H){ne===void 0&&(ne=null);const ie={jsonrpc:Nt,id:ve.id,result:ne};cd(ie,R,H),re.write(ie).catch(()=>Qe.error("Sending response failed."))}K(ve);const Ut=Vi.get(ve.method);let G,de;Ut&&(G=Ut.type,de=Ut.handler);const L=Date.now();if(de||Ji){const ne=ve.id??String(Date.now()),R=y.is(to.receiver)?to.receiver.createCancellationTokenSource(ne):to.receiver.createCancellationTokenSource(ve);ve.id!==null&&ba.has(ve.id)&&R.cancel(),ve.id!==null&&ki.set(ne,R);try{let H;if(de)if(ve.params===void 0){if(G!==void 0&&G.numberOfParams!==0){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines ${G.numberOfParams} params but received none.`),ve.method,L);return}H=de(R.token)}else if(Array.isArray(ve.params)){if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byName){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by name but received parameters by position`),ve.method,L);return}H=de(...ve.params,R.token)}else{if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byPosition){Ht(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${ve.method} defines parameters by position but received parameters by name`),ve.method,L);return}H=de(ve.params,R.token)}else Ji&&(H=Ji(ve.method,ve.params,R.token));const ie=H;H?ie.then?ie.then(je=>{ki.delete(ne),ct(je,ve.method,L)},je=>{ki.delete(ne),je instanceof i.ResponseError?Ht(je,ve.method,L):je&&t.string(je.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${je.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}):(ki.delete(ne),ct(H,ve.method,L)):(ki.delete(ne),Ei(H,ve.method,L))}catch(H){ki.delete(ne),H instanceof i.ResponseError?ct(H,ve.method,L):H&&t.string(H.message)?Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed with message: ${H.message}`),ve.method,L):Ht(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${ve.method} failed unexpectedly without providing any details.`),ve.method,L)}}else Ht(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${ve.method}`),ve.method,L)}function Cc(ve){if(!ul())if(ve.id===null)ve.error?Qe.error(`Received response message without id: Error is: ${JSON.stringify(ve.error,void 0,4)}`):Qe.error("Received response message without id. No further error information provided.");else{const ct=ve.id,Ht=mr.get(ct);if(ri(ve,Ht),Ht!==void 0){mr.delete(ct);try{if(ve.error){const Ei=ve.error;Ht.reject(new i.ResponseError(Ei.code,Ei.message,Ei.data))}else if(ve.result!==void 0)Ht.resolve(ve.result);else throw new Error("Should never happen.")}catch(Ei){Ei.message?Qe.error(`Response handler '${Ht.method}' failed with message: ${Ei.message}`):Qe.error(`Response handler '${Ht.method}' failed unexpectedly.`)}}}}function nr(ve){if(ul())return;let ct,Ht;if(ve.method===a.type.method){const Ei=ve.params.id;ba.delete(Ei),Le(ve);return}else{const Ei=Ro.get(ve.method);Ei&&(Ht=Ei.handler,ct=Ei.type)}if(Ht||Gn)try{if(Le(ve),Ht)if(ve.params===void 0)ct!==void 0&&ct.numberOfParams!==0&&ct.parameterStructures!==i.ParameterStructures.byName&&Qe.error(`Notification ${ve.method} defines ${ct.numberOfParams} params but received none.`),Ht();else if(Array.isArray(ve.params)){const Ei=ve.params;ve.method===l.type.method&&Ei.length===2&&c.is(Ei[0])?Ht({token:Ei[0],value:Ei[1]}):(ct!==void 0&&(ct.parameterStructures===i.ParameterStructures.byName&&Qe.error(`Notification ${ve.method} defines parameters by name but received parameters by position`),ct.numberOfParams!==ve.params.length&&Qe.error(`Notification ${ve.method} defines ${ct.numberOfParams} params but received ${Ei.length} arguments`)),Ht(...Ei))}else ct!==void 0&&ct.parameterStructures===i.ParameterStructures.byPosition&&Qe.error(`Notification ${ve.method} defines parameters by position but received parameters by name`),Ht(ve.params);else Gn&&Gn(ve.method,ve.params)}catch(Ei){Ei.message?Qe.error(`Notification handler '${ve.method}' failed with message: ${Ei.message}`):Qe.error(`Notification handler '${ve.method}' failed unexpectedly.`)}else Yh.fire(ve)}function Rs(ve){if(!ve){Qe.error("Received empty message.");return}Qe.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(ve,null,4)}`);const ct=ve;if(t.string(ct.id)||t.number(ct.id)){const Ht=ct.id,Ei=mr.get(Ht);Ei&&Ei.reject(new Error("The received response has neither a result nor an error property."))}}function Ml(ve){if(ve!=null)switch(gs){case u.Verbose:return JSON.stringify(ve,null,4);case u.Compact:return JSON.stringify(ve);default:return}}function Se(ve){if(!(gs===u.Off||!Hn))if(ir===p.Text){let ct;(gs===u.Verbose||gs===u.Compact)&&ve.params&&(ct=`Params: ${Ml(ve.params)} @@ -1016,14 +1016,14 @@ ${JSON.stringify(ve,null,4)}`);const ct=ve;if(t.string(ct.id)||t.number(ct.id)){ `:ve.error===void 0&&(Ht=`No result returned. -`)),ct){const Ei=ve.error?` Request failed: ${ve.error.message} (${ve.error.code}).`:"";Hn.log(`Received response '${ct.method} - (${ve.id})' in ${Date.now()-ct.timerStart}ms.${Ei}`,Ht)}else Hn.log(`Received response ${ve.id} without active response promise.`,Ht)}else ts("receive-response",ve)}function ts(ve,ct){if(!Hn||gs===u.Off)return;const Ht={isLSPMessage:!0,type:ve,message:ct,timestamp:Date.now()};Hn.log(Ht)}function Os(){if(Xh())throw new b(w.Closed,"Connection is closed.");if(ul())throw new b(w.Disposed,"Connection is disposed.")}function sr(){if(Rl())throw new b(w.AlreadyListening,"Connection is already listening")}function ya(){if(!Rl())throw new Error("Call listen() first.")}function Cc(ve){return ve===void 0?null:ve}function Ou(ve){if(ve!==null)return ve}function le(ve){return ve!=null&&!Array.isArray(ve)&&typeof ve=="object"}function _r(ve,ct){switch(ve){case i.ParameterStructures.auto:return le(ct)?Ou(ct):[Cc(ct)];case i.ParameterStructures.byName:if(!le(ct))throw new Error("Received parameters by name but param is not an object literal.");return Ou(ct);case i.ParameterStructures.byPosition:return[Cc(ct)];default:throw new Error(`Unknown parameter structure ${ve.toString()}`)}}function No(ve,ct){let Ht;const Ei=ve.numberOfParams;switch(Ei){case 0:Ht=void 0;break;case 1:Ht=_r(ve.parameterStructures,ct[0]);break;default:Ht=[];for(let Ut=0;Ut{Os();let Ht,Ei;if(t.string(ve)){Ht=ve;const G=ct[0];let de=0,L=i.ParameterStructures.auto;i.ParameterStructures.is(G)&&(de=1,L=G);let ne=ct.length;const R=ne-de;switch(R){case 0:Ei=void 0;break;case 1:Ei=_r(L,ct[de]);break;default:if(L===i.ParameterStructures.byName)throw new Error(`Received ${R} parameters for 'by Name' notification parameter structure.`);Ei=ct.slice(de,ne).map(H=>Cc(H));break}}else{const G=ct;Ht=ve.method,Ei=No(ve,G)}const Ut={jsonrpc:Nt,method:Ht,params:Ei};return Mo(Ut),re.write(Ut).catch(G=>{throw Qe.error("Sending notification failed."),G})},onNotification:(ve,ct)=>{Os();let Ht;return t.func(ve)?Gn=ve:ct&&(t.string(ve)?(Ht=ve,Ro.set(ve,{type:void 0,handler:ct})):(Ht=ve.method,Ro.set(ve.method,{type:ve,handler:ct}))),{dispose:()=>{Ht!==void 0?Ro.delete(Ht):Gn=void 0}}},onProgress:(ve,ct,Ht)=>{if(qn.has(ct))throw new Error(`Progress handler for token ${ct} already registered`);return qn.set(ct,Ht),{dispose:()=>{qn.delete(ct)}}},sendProgress:(ve,ct,Ht)=>mn.sendNotification(l.type,{token:ct,value:Ht}),onUnhandledProgress:el.event,sendRequest:(ve,...ct)=>{Os(),ya();let Ht,Ei,Ut;if(t.string(ve)){Ht=ve;const ne=ct[0],R=ct[ct.length-1];let H=0,ie=i.ParameterStructures.auto;i.ParameterStructures.is(ne)&&(H=1,ie=ne);let je=ct.length;r.CancellationToken.is(R)&&(je=je-1,Ut=R);const pt=je-H;switch(pt){case 0:Ei=void 0;break;case 1:Ei=_r(ie,ct[H]);break;default:if(ie===i.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Ei=ct.slice(H,je).map(is=>Cc(is));break}}else{const ne=ct;Ht=ve.method,Ei=No(ve,ne);const R=ve.numberOfParams;Ut=r.CancellationToken.is(ne[R])?ne[R]:void 0}const G=Tt++;let de;Ut&&(de=Ut.onCancellationRequested(()=>{const ne=to.sender.sendCancellation(mn,G);return ne===void 0?(Qe.log(`Received no promise from cancellation strategy when cancelling id ${G}`),Promise.resolve()):ne.catch(()=>{Qe.log(`Sending cancellation messages for id ${G} failed`)})}));const L={jsonrpc:Nt,id:G,method:Ht,params:Ei};return Se(L),typeof to.sender.enableCancellation=="function"&&to.sender.enableCancellation(L),new Promise(async(ne,R)=>{const H=pt=>{ne(pt),to.sender.cleanup(G),de?.dispose()},ie=pt=>{R(pt),to.sender.cleanup(G),de?.dispose()},je={method:Ht,timerStart:Date.now(),resolve:H,reject:ie};try{await re.write(L),mr.set(G,je)}catch(pt){throw Qe.error("Sending request failed."),je.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(ve,ct)=>{Os();let Ht=null;return h.is(ve)?(Ht=void 0,Yi=ve):t.string(ve)?(Ht=null,ct!==void 0&&(Ht=ve,Vi.set(ve,{handler:ct,type:void 0}))):ct!==void 0&&(Ht=ve.method,Vi.set(ve.method,{type:ve,handler:ct})),{dispose:()=>{Ht!==null&&(Ht!==void 0?Vi.delete(Ht):Yi=void 0)}}},hasPendingResponse:()=>mr.size>0,trace:async(ve,ct,Ht)=>{let Ei=!1,Ut=p.Text;Ht!==void 0&&(t.boolean(Ht)?Ei=Ht:(Ei=Ht.sendNotification||!1,Ut=Ht.traceFormat||p.Text)),gs=ve,ir=Ut,gs===u.Off?Hn=void 0:Hn=ct,Ei&&!Xh()&&!ul()&&await mn.sendNotification(m.type,{value:u.toString(ve)})},onError:gh.event,onClose:Qn.event,onUnhandledNotification:Yh.event,onDispose:Tl.event,end:()=>{re.end()},dispose:()=>{if(ul())return;_c=U.Disposed,Tl.fire(void 0);const ve=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const ct of mr.values())ct.reject(ve);mr=new Map,ki=new Map,ba=new Set,ys=new s.LinkedMap,t.func(re.dispose)&&re.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Os(),sr(),_c=U.Listening,j.listen(wc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return mn.onNotification(v.type,ve=>{if(gs===u.Off||!Hn)return;const ct=gs===u.Verbose||gs===u.Compact;Hn.log(ve.message,ct?ve.verbose:void 0)}),mn.onNotification(l.type,ve=>{const ct=qn.get(ve.token);ct?ct(ve.value):el.fire(ve)}),mn}n.createMessageConnection=J})(Yat);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressType=n.ProgressToken=n.createMessageConnection=n.NullLogger=n.ConnectionOptions=n.ConnectionStrategy=n.AbstractMessageBuffer=n.WriteableStreamMessageWriter=n.AbstractMessageWriter=n.MessageWriter=n.ReadableStreamMessageReader=n.AbstractMessageReader=n.MessageReader=n.SharedArrayReceiverStrategy=n.SharedArraySenderStrategy=n.CancellationToken=n.CancellationTokenSource=n.Emitter=n.Event=n.Disposable=n.LRUCache=n.Touch=n.LinkedMap=n.ParameterStructures=n.NotificationType9=n.NotificationType8=n.NotificationType7=n.NotificationType6=n.NotificationType5=n.NotificationType4=n.NotificationType3=n.NotificationType2=n.NotificationType1=n.NotificationType0=n.NotificationType=n.ErrorCodes=n.ResponseError=n.RequestType9=n.RequestType8=n.RequestType7=n.RequestType6=n.RequestType5=n.RequestType4=n.RequestType3=n.RequestType2=n.RequestType1=n.RequestType0=n.RequestType=n.Message=n.RAL=void 0,n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=void 0;const e=hn;Object.defineProperty(n,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(n,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(n,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(n,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(n,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(n,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(n,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(n,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(n,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(n,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(n,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(n,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(n,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(n,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(n,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(n,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(n,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(n,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(n,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(n,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(n,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(n,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(n,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(n,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(n,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(n,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=kx;Object.defineProperty(n,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(n,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(n,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=wue;Object.defineProperty(n,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=tA;Object.defineProperty(n,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(n,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const o=X1;Object.defineProperty(n,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(n,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=Q4;Object.defineProperty(n,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(n,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=YI;Object.defineProperty(n,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(n,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(n,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=JI;Object.defineProperty(n,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(n,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(n,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=Cue;Object.defineProperty(n,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Yat;Object.defineProperty(n,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(n,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(n,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(n,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(n,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(n,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(n,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(n,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(n,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(n,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(n,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(n,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(n,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(n,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(n,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(n,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(n,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=uD;n.RAL=h.default})(Fre);Object.defineProperty(aBe,"__esModule",{value:!0});const Ry=Fre;class yue extends Ry.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return yue.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}yue.emptyBuffer=new Uint8Array(0);class zsi{constructor(e){this.socket=e,this._onData=new Ry.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(s=>{this._onData.fire(new Uint8Array(s))},()=>{(0,Ry.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class $si{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,t){if(typeof e=="string"){if(t!==void 0&&t!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Gsi=new TextEncoder,Jat=Object.freeze({messageBuffer:Object.freeze({create:n=>new yue(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Gsi.encode(JSON.stringify(n,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{if(!(n instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(n)))}})}),stream:Object.freeze({asReadableStream:n=>new zsi(n),asWritableStream:n=>new $si(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){const i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){const t=setTimeout(n,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(n,e,...t){const i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function wRe(){return Jat}(function(n){function e(){Ry.RAL.install(Jat)}n.install=e})(wRe||(wRe={}));aBe.default=wRe;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var u=Object.getOwnPropertyDescriptor(l,d);(!u||("get"in u?!l.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,u)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),t=sh&&sh.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.BrowserMessageWriter=n.BrowserMessageReader=void 0,aBe.default.install();const s=Fre;t(Fre,n);class o extends s.AbstractMessageReader{constructor(l){super(),this._onData=new s.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}n.BrowserMessageReader=o;class r extends s.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}n.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=s.NullLogger),s.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,s.createMessageConnection)(c,l,d,h)}n.createMessageConnection=a})(NO);var z6e=NO,Xat={};const lBe=$at(IZt);var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ProtocolNotificationType=Jo.ProtocolNotificationType0=Jo.ProtocolRequestType=Jo.ProtocolRequestType0=Jo.RegistrationType=Jo.MessageDirection=void 0;const j4=NO;var $6e;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})($6e||(Jo.MessageDirection=$6e={}));class qsi{constructor(e){this.method=e}}Jo.RegistrationType=qsi;class Qsi extends j4.RequestType0{constructor(e){super(e)}}Jo.ProtocolRequestType0=Qsi;class jsi extends j4.RequestType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolRequestType=jsi;class Ksi extends j4.NotificationType0{constructor(e){super(e)}}Jo.ProtocolNotificationType0=Ksi;class Ysi extends j4.NotificationType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolNotificationType=Ysi;var Zat={},jl={};Object.defineProperty(jl,"__esModule",{value:!0});jl.objectLiteral=jl.typedArray=jl.stringArray=jl.array=jl.func=jl.error=jl.number=jl.string=jl.boolean=void 0;function Jsi(n){return n===!0||n===!1}jl.boolean=Jsi;function ect(n){return typeof n=="string"||n instanceof String}jl.string=ect;function Xsi(n){return typeof n=="number"||n instanceof Number}jl.number=Xsi;function Zsi(n){return n instanceof Error}jl.error=Zsi;function eoi(n){return typeof n=="function"}jl.func=eoi;function tct(n){return Array.isArray(n)}jl.array=tct;function toi(n){return tct(n)&&n.every(e=>ect(e))}jl.stringArray=toi;function ioi(n,e){return Array.isArray(n)&&n.every(e)}jl.typedArray=ioi;function noi(n){return n!==null&&typeof n=="object"}jl.objectLiteral=noi;var Sue={};Object.defineProperty(Sue,"__esModule",{value:!0});Sue.ImplementationRequest=void 0;const G6e=Jo;var q6e;(function(n){n.method="textDocument/implementation",n.messageDirection=G6e.MessageDirection.clientToServer,n.type=new G6e.ProtocolRequestType(n.method)})(q6e||(Sue.ImplementationRequest=q6e={}));var Aue={};Object.defineProperty(Aue,"__esModule",{value:!0});Aue.TypeDefinitionRequest=void 0;const Q6e=Jo;var j6e;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=Q6e.MessageDirection.clientToServer,n.type=new Q6e.ProtocolRequestType(n.method)})(j6e||(Aue.TypeDefinitionRequest=j6e={}));var K4={};Object.defineProperty(K4,"__esModule",{value:!0});K4.DidChangeWorkspaceFoldersNotification=K4.WorkspaceFoldersRequest=void 0;const Bre=Jo;var K6e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Bre.MessageDirection.serverToClient,n.type=new Bre.ProtocolRequestType0(n.method)})(K6e||(K4.WorkspaceFoldersRequest=K6e={}));var Y6e;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Bre.MessageDirection.clientToServer,n.type=new Bre.ProtocolNotificationType(n.method)})(Y6e||(K4.DidChangeWorkspaceFoldersNotification=Y6e={}));var Eue={};Object.defineProperty(Eue,"__esModule",{value:!0});Eue.ConfigurationRequest=void 0;const J6e=Jo;var X6e;(function(n){n.method="workspace/configuration",n.messageDirection=J6e.MessageDirection.serverToClient,n.type=new J6e.ProtocolRequestType(n.method)})(X6e||(Eue.ConfigurationRequest=X6e={}));var Y4={};Object.defineProperty(Y4,"__esModule",{value:!0});Y4.ColorPresentationRequest=Y4.DocumentColorRequest=void 0;const Wre=Jo;var Z6e;(function(n){n.method="textDocument/documentColor",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(Z6e||(Y4.DocumentColorRequest=Z6e={}));var eGe;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(eGe||(Y4.ColorPresentationRequest=eGe={}));var J4={};Object.defineProperty(J4,"__esModule",{value:!0});J4.FoldingRangeRefreshRequest=J4.FoldingRangeRequest=void 0;const Hre=Jo;var tGe;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Hre.MessageDirection.clientToServer,n.type=new Hre.ProtocolRequestType(n.method)})(tGe||(J4.FoldingRangeRequest=tGe={}));var iGe;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Hre.MessageDirection.serverToClient,n.type=new Hre.ProtocolRequestType0(n.method)})(iGe||(J4.FoldingRangeRefreshRequest=iGe={}));var xue={};Object.defineProperty(xue,"__esModule",{value:!0});xue.DeclarationRequest=void 0;const nGe=Jo;var sGe;(function(n){n.method="textDocument/declaration",n.messageDirection=nGe.MessageDirection.clientToServer,n.type=new nGe.ProtocolRequestType(n.method)})(sGe||(xue.DeclarationRequest=sGe={}));var Due={};Object.defineProperty(Due,"__esModule",{value:!0});Due.SelectionRangeRequest=void 0;const oGe=Jo;var rGe;(function(n){n.method="textDocument/selectionRange",n.messageDirection=oGe.MessageDirection.clientToServer,n.type=new oGe.ProtocolRequestType(n.method)})(rGe||(Due.SelectionRangeRequest=rGe={}));var XI={};Object.defineProperty(XI,"__esModule",{value:!0});XI.WorkDoneProgressCancelNotification=XI.WorkDoneProgressCreateRequest=XI.WorkDoneProgress=void 0;const soi=NO,Ure=Jo;var aGe;(function(n){n.type=new soi.ProgressType;function e(t){return t===n.type}n.is=e})(aGe||(XI.WorkDoneProgress=aGe={}));var cGe;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Ure.MessageDirection.serverToClient,n.type=new Ure.ProtocolRequestType(n.method)})(cGe||(XI.WorkDoneProgressCreateRequest=cGe={}));var lGe;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Ure.MessageDirection.clientToServer,n.type=new Ure.ProtocolNotificationType(n.method)})(lGe||(XI.WorkDoneProgressCancelNotification=lGe={}));var ZI={};Object.defineProperty(ZI,"__esModule",{value:!0});ZI.CallHierarchyOutgoingCallsRequest=ZI.CallHierarchyIncomingCallsRequest=ZI.CallHierarchyPrepareRequest=void 0;const X4=Jo;var dGe;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(dGe||(ZI.CallHierarchyPrepareRequest=dGe={}));var hGe;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(hGe||(ZI.CallHierarchyIncomingCallsRequest=hGe={}));var uGe;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(uGe||(ZI.CallHierarchyOutgoingCallsRequest=uGe={}));var em={};Object.defineProperty(em,"__esModule",{value:!0});em.SemanticTokensRefreshRequest=em.SemanticTokensRangeRequest=em.SemanticTokensDeltaRequest=em.SemanticTokensRequest=em.SemanticTokensRegistrationType=em.TokenFormat=void 0;const Yx=Jo;var gGe;(function(n){n.Relative="relative"})(gGe||(em.TokenFormat=gGe={}));var mq;(function(n){n.method="textDocument/semanticTokens",n.type=new Yx.RegistrationType(n.method)})(mq||(em.SemanticTokensRegistrationType=mq={}));var fGe;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(fGe||(em.SemanticTokensRequest=fGe={}));var pGe;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(pGe||(em.SemanticTokensDeltaRequest=pGe={}));var mGe;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(mGe||(em.SemanticTokensRangeRequest=mGe={}));var _Ge;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Yx.MessageDirection.serverToClient,n.type=new Yx.ProtocolRequestType0(n.method)})(_Ge||(em.SemanticTokensRefreshRequest=_Ge={}));var kue={};Object.defineProperty(kue,"__esModule",{value:!0});kue.ShowDocumentRequest=void 0;const vGe=Jo;var wGe;(function(n){n.method="window/showDocument",n.messageDirection=vGe.MessageDirection.serverToClient,n.type=new vGe.ProtocolRequestType(n.method)})(wGe||(kue.ShowDocumentRequest=wGe={}));var Iue={};Object.defineProperty(Iue,"__esModule",{value:!0});Iue.LinkedEditingRangeRequest=void 0;const bGe=Jo;var CGe;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=bGe.MessageDirection.clientToServer,n.type=new bGe.ProtocolRequestType(n.method)})(CGe||(Iue.LinkedEditingRangeRequest=CGe={}));var jg={};Object.defineProperty(jg,"__esModule",{value:!0});jg.WillDeleteFilesRequest=jg.DidDeleteFilesNotification=jg.DidRenameFilesNotification=jg.WillRenameFilesRequest=jg.DidCreateFilesNotification=jg.WillCreateFilesRequest=jg.FileOperationPatternKind=void 0;const Ew=Jo;var yGe;(function(n){n.file="file",n.folder="folder"})(yGe||(jg.FileOperationPatternKind=yGe={}));var SGe;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(SGe||(jg.WillCreateFilesRequest=SGe={}));var AGe;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(AGe||(jg.DidCreateFilesNotification=AGe={}));var EGe;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(EGe||(jg.WillRenameFilesRequest=EGe={}));var xGe;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(xGe||(jg.DidRenameFilesNotification=xGe={}));var DGe;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(DGe||(jg.DidDeleteFilesNotification=DGe={}));var kGe;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(kGe||(jg.WillDeleteFilesRequest=kGe={}));var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.MonikerRequest=e0.MonikerKind=e0.UniquenessLevel=void 0;const IGe=Jo;var LGe;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(LGe||(e0.UniquenessLevel=LGe={}));var TGe;(function(n){n.$import="import",n.$export="export",n.local="local"})(TGe||(e0.MonikerKind=TGe={}));var RGe;(function(n){n.method="textDocument/moniker",n.messageDirection=IGe.MessageDirection.clientToServer,n.type=new IGe.ProtocolRequestType(n.method)})(RGe||(e0.MonikerRequest=RGe={}));var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.TypeHierarchySubtypesRequest=t0.TypeHierarchySupertypesRequest=t0.TypeHierarchyPrepareRequest=void 0;const Z4=Jo;var MGe;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(MGe||(t0.TypeHierarchyPrepareRequest=MGe={}));var NGe;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(NGe||(t0.TypeHierarchySupertypesRequest=NGe={}));var PGe;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(PGe||(t0.TypeHierarchySubtypesRequest=PGe={}));var ez={};Object.defineProperty(ez,"__esModule",{value:!0});ez.InlineValueRefreshRequest=ez.InlineValueRequest=void 0;const Vre=Jo;var FGe;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Vre.MessageDirection.clientToServer,n.type=new Vre.ProtocolRequestType(n.method)})(FGe||(ez.InlineValueRequest=FGe={}));var OGe;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Vre.MessageDirection.serverToClient,n.type=new Vre.ProtocolRequestType0(n.method)})(OGe||(ez.InlineValueRefreshRequest=OGe={}));var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.InlayHintRefreshRequest=i0.InlayHintResolveRequest=i0.InlayHintRequest=void 0;const tz=Jo;var BGe;(function(n){n.method="textDocument/inlayHint",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(BGe||(i0.InlayHintRequest=BGe={}));var WGe;(function(n){n.method="inlayHint/resolve",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(WGe||(i0.InlayHintResolveRequest=WGe={}));var HGe;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=tz.MessageDirection.serverToClient,n.type=new tz.ProtocolRequestType0(n.method)})(HGe||(i0.InlayHintRefreshRequest=HGe={}));var Fv={};Object.defineProperty(Fv,"__esModule",{value:!0});Fv.DiagnosticRefreshRequest=Fv.WorkspaceDiagnosticRequest=Fv.DocumentDiagnosticRequest=Fv.DocumentDiagnosticReportKind=Fv.DiagnosticServerCancellationData=void 0;const ict=NO,ooi=jl,iz=Jo;var UGe;(function(n){function e(t){const i=t;return i&&ooi.boolean(i.retriggerRequest)}n.is=e})(UGe||(Fv.DiagnosticServerCancellationData=UGe={}));var VGe;(function(n){n.Full="full",n.Unchanged="unchanged"})(VGe||(Fv.DocumentDiagnosticReportKind=VGe={}));var zGe;(function(n){n.method="textDocument/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})(zGe||(Fv.DocumentDiagnosticRequest=zGe={}));var $Ge;(function(n){n.method="workspace/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})($Ge||(Fv.WorkspaceDiagnosticRequest=$Ge={}));var GGe;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=iz.MessageDirection.serverToClient,n.type=new iz.ProtocolRequestType0(n.method)})(GGe||(Fv.DiagnosticRefreshRequest=GGe={}));var Ql={};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.DidCloseNotebookDocumentNotification=Ql.DidSaveNotebookDocumentNotification=Ql.DidChangeNotebookDocumentNotification=Ql.NotebookCellArrayChange=Ql.DidOpenNotebookDocumentNotification=Ql.NotebookDocumentSyncRegistrationType=Ql.NotebookDocument=Ql.NotebookCell=Ql.ExecutionSummary=Ql.NotebookCellKind=void 0;const _q=lBe,Hb=jl,iA=Jo;var bRe;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(bRe||(Ql.NotebookCellKind=bRe={}));var CRe;(function(n){function e(s,o){const r={executionOrder:s};return(o===!0||o===!1)&&(r.success=o),r}n.create=e;function t(s){const o=s;return Hb.objectLiteral(o)&&_q.uinteger.is(o.executionOrder)&&(o.success===void 0||Hb.boolean(o.success))}n.is=t;function i(s,o){return s===o?!0:s==null||o===null||o===void 0?!1:s.executionOrder===o.executionOrder&&s.success===o.success}n.equals=i})(CRe||(Ql.ExecutionSummary=CRe={}));var zre;(function(n){function e(o,r){return{kind:o,document:r}}n.create=e;function t(o){const r=o;return Hb.objectLiteral(r)&&bRe.is(r.kind)&&_q.DocumentUri.is(r.document)&&(r.metadata===void 0||Hb.objectLiteral(r.metadata))}n.is=t;function i(o,r){const a=new Set;return o.document!==r.document&&a.add("document"),o.kind!==r.kind&&a.add("kind"),o.executionSummary!==r.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||r.metadata!==void 0)&&!s(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!CRe.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function s(o,r){if(o===r)return!0;if(o==null||r===null||r===void 0||typeof o!=typeof r||typeof o!="object")return!1;const a=Array.isArray(o),c=Array.isArray(r);if(a!==c)return!1;if(a&&c){if(o.length!==r.length)return!1;for(let l=0;l0}le.hasId=_r})(Tt||(n.StaticRegistrationOptions=Tt={}));var Oe;(function(le){function _r(No){const mn=No;return mn&&(mn.documentSelector===null||J.is(mn.documentSelector))}le.is=_r})(Oe||(n.TextDocumentRegistrationOptions=Oe={}));var wt;(function(le){function _r(mn){const ve=mn;return i.objectLiteral(ve)&&(ve.workDoneProgress===void 0||i.boolean(ve.workDoneProgress))}le.is=_r;function No(mn){const ve=mn;return ve&&i.boolean(ve.workDoneProgress)}le.hasWorkDoneProgress=No})(wt||(n.WorkDoneProgressOptions=wt={}));var Nt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Nt||(n.InitializeRequest=Nt={}));var Yi;(function(le){le.unknownProtocolVersion=1})(Yi||(n.InitializeErrorCodes=Yi={}));var Vi;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Vi||(n.InitializedNotification=Vi={}));var Gn;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(Gn||(n.ShutdownRequest=Gn={}));var Ro;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(Ro||(n.ExitNotification=Ro={}));var qn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(qn||(n.DidChangeConfigurationNotification=qn={}));var ec;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(ec||(n.MessageType=ec={}));var ys;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ys||(n.ShowMessageNotification=ys={}));var mr;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(mr||(n.ShowMessageRequest=mr={}));var ba;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ba||(n.LogMessageNotification=ba={}));var ki;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ki||(n.TelemetryEventNotification=ki={}));var gs;(function(le){le.None=0,le.Full=1,le.Incremental=2})(gs||(n.TextDocumentSyncKind=gs={}));var ir;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(ir||(n.DidOpenTextDocumentNotification=ir={}));var Hn;(function(le){function _r(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}le.isIncremental=_r;function No(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}le.isFull=No})(Hn||(n.TextDocumentContentChangeEvent=Hn={}));var _c;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(_c||(n.DidChangeTextDocumentNotification=_c={}));var gh;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(gh||(n.DidCloseTextDocumentNotification=gh={}));var Qn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Qn||(n.DidSaveTextDocumentNotification=Qn={}));var Yh;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(Yh||(n.TextDocumentSaveReason=Yh={}));var el;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(el||(n.WillSaveTextDocumentNotification=el={}));var Tl;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Tl||(n.WillSaveTextDocumentWaitUntilRequest=Tl={}));var to;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(to||(n.DidChangeWatchedFilesNotification=to={}));var Fc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(Fc||(n.FileChangeType=Fc={}));var rd;(function(le){function _r(No){const mn=No;return i.objectLiteral(mn)&&(t.URI.is(mn.baseUri)||t.WorkspaceFolder.is(mn.baseUri))&&i.string(mn.pattern)}le.is=_r})(rd||(n.RelativePattern=rd={}));var Jh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(Jh||(n.WatchKind=Jh={}));var Af;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Af||(n.PublishDiagnosticsNotification=Af={}));var tl;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(tl||(n.CompletionTriggerKind=tl={}));var Rl;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rl||(n.CompletionRequest=Rl={}));var Xh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Xh||(n.CompletionResolveRequest=Xh={}));var ul;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ul||(n.HoverRequest=ul={}));var ad;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(ad||(n.SignatureHelpTriggerKind=ad={}));var vc;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(vc||(n.SignatureHelpRequest=vc={}));var Ca;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ca||(n.DefinitionRequest=Ca={}));var Ld;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ld||(n.ReferencesRequest=Ld={}));var fh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(fh||(n.DocumentHighlightRequest=fh={}));var Fu;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Fu||(n.DocumentSymbolRequest=Fu={}));var wc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(wc||(n.CodeActionRequest=wc={}));var Zh;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Zh||(n.CodeActionResolveRequest=Zh={}));var bc;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(bc||(n.WorkspaceSymbolRequest=bc={}));var nr;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nr||(n.WorkspaceSymbolResolveRequest=nr={}));var Rs;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rs||(n.CodeLensRequest=Rs={}));var Ml;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ml||(n.CodeLensResolveRequest=Ml={}));var Se;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Se||(n.CodeLensRefreshRequest=Se={}));var Mo;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Mo||(n.DocumentLinkRequest=Mo={}));var cd;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(cd||(n.DocumentLinkResolveRequest=cd={}));var K;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(K||(n.DocumentFormattingRequest=K={}));var Le;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Le||(n.DocumentRangeFormattingRequest=Le={}));var ri;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ri||(n.DocumentRangesFormattingRequest=ri={}));var ts;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ts||(n.DocumentOnTypeFormattingRequest=ts={}));var Os;(function(le){le.Identifier=1})(Os||(n.PrepareSupportDefaultBehavior=Os={}));var sr;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(sr||(n.RenameRequest=sr={}));var ya;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ya||(n.PrepareRenameRequest=ya={}));var Cc;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Cc||(n.ExecuteCommandRequest=Cc={}));var Ou;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ou||(n.ApplyWorkspaceEditRequest=Ou={}))})(Zat);var Tue={};Object.defineProperty(Tue,"__esModule",{value:!0});Tue.createProtocolConnection=void 0;const eqe=NO;function roi(n,e,t,i){return eqe.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,eqe.createMessageConnection)(n,e,t,i)}Tue.createProtocolConnection=roi;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.LSPErrorCodes=n.createProtocolConnection=void 0,t(NO,n),t(lBe,n),t(Jo,n),t(Zat,n);var i=Tue;Object.defineProperty(n,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var s;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(s||(n.LSPErrorCodes=s={}))})(Xat);(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.createProtocolConnection=void 0;const i=z6e;t(z6e,n),t(Xat,n);function s(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}n.createProtocolConnection=s})(Ts);var $n={};const as=$at(MQt);var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.asPromise=ea.thenable=ea.typedArray=ea.stringArray=ea.array=ea.func=ea.error=ea.number=ea.string=ea.boolean=void 0;function aoi(n){return n===!0||n===!1}ea.boolean=aoi;function nct(n){return typeof n=="string"||n instanceof String}ea.string=nct;function coi(n){return typeof n=="number"||n instanceof Number}ea.number=coi;function loi(n){return n instanceof Error}ea.error=loi;function sct(n){return typeof n=="function"}ea.func=sct;function oct(n){return Array.isArray(n)}ea.array=oct;function doi(n){return oct(n)&&n.every(e=>nct(e))}ea.stringArray=doi;function hoi(n,e){return Array.isArray(n)&&n.every(e)}ea.typedArray=hoi;function rct(n){return n&&sct(n.then)}ea.thenable=rct;function uoi(n){return n instanceof Promise?n:rct(n)?new Promise((e,t)=>{n.then(i=>e(i),i=>t(i))}):Promise.resolve(n)}ea.asPromise=uoi;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.generateUuid=Er.parse=Er.isUUID=Er.v4=Er.empty=void 0;class dBe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class bo extends dBe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return bo._oneOf(bo._chars)}constructor(){super([bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-","4",bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._oneOf(bo._timeHighBits),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex()].join(""))}}bo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];bo._timeHighBits=["8","9","a","b"];Er.empty=new dBe("00000000-0000-0000-0000-000000000000");function act(){return new bo}Er.v4=act;const goi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function cct(n){return goi.test(n)}Er.isUUID=cct;function foi(n){if(!cct(n))throw new Error("invalid uuid");return new dBe(n)}Er.parse=foi;function poi(){return act().asHex()}Er.generateUuid=poi;Object.defineProperty($n,"__esModule",{value:!0});$n.WorkspaceFeature=$n.TextDocumentLanguageFeature=$n.TextDocumentEventFeature=$n.DynamicDocumentFeature=$n.DynamicFeature=$n.StaticFeature=$n.ensure=$n.LSPCancellationError=void 0;const YM=as,Ime=Ts,Jf=ea,tqe=Er;class moi extends YM.CancellationError{constructor(e){super(),this.data=e}}$n.LSPCancellationError=moi;function _oi(n,e){return n[e]===void 0&&(n[e]={}),n[e]}$n.ensure=_oi;var iqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))}n.is=e})(iqe||($n.StaticFeature=iqe={}));var nqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))&&Jf.func(i.register)&&Jf.func(i.unregister)&&i.registrationType!==void 0}n.is=e})(nqe||($n.DynamicFeature=nqe={}));class hBe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const s of e){t++;for(const o of YM.workspace.textDocuments)if(YM.languages.match(s,o)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}const i=t>0;return{kind:"document",id:this.registrationType.method,registrations:i,matches:!1}}}$n.DynamicDocumentFeature=hBe;class voi extends hBe{static textDocumentFilter(e,t){for(const i of e)if(YM.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,s,o,r,a){super(e),this._event=t,this._type=i,this._middleware=s,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new YM.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(i=>{this._client.error(`Sending document notification ${this._type.method} failed.`,i)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){const t=async i=>{const s=this._createParams(i);await this._client.sendNotification(this._type,s),this.notificationSent(this.getTextDocument(i),this._type,s)};if(this.matches(e)){const i=this._middleware();return i?i(e,s=>t(s)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(const t of this._selectors.values())if(YM.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}$n.TextDocumentEventFeature=voi;class woi extends hBe{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(const e of this._registrations.values()){const t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(Ime.TextDocumentRegistrationOptions.is(t)){const i=Ime.StaticRegistrationOptions.hasId(t)?t.id:tqe.generateUuid(),s=t.documentSelector??e;if(s)return[i,Object.assign({},t,{documentSelector:s})]}else if(Jf.boolean(t)&&t===!0||Ime.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[tqe.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(const t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&YM.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(i),e)>0)return t.provider}}getAllProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.TextDocumentLanguageFeature=woi;class boi{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){const e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){const t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.WorkspaceFeature=boi;var Ix={};const Coi=typeof process=="object"&&process&&process.platform==="win32";var yoi=Coi?{sep:"\\"}:{sep:"/"},Soi=lct;function lct(n,e,t){n instanceof RegExp&&(n=sqe(n,t)),e instanceof RegExp&&(e=sqe(e,t));var i=dct(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function sqe(n,e){var t=e.match(n);return t?t[0]:null}lct.range=dct;function dct(n,e,t){var i,s,o,r,a,c=t.indexOf(n),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(n,d+1)):i.length==1?a=[i.pop(),l]:(s=i.pop(),s=0?c:l;i.length&&(a=[o,r])}return a}var hct=Soi,Aoi=Doi,uct="\0SLASH"+Math.random()+"\0",gct="\0OPEN"+Math.random()+"\0",uBe="\0CLOSE"+Math.random()+"\0",fct="\0COMMA"+Math.random()+"\0",pct="\0PERIOD"+Math.random()+"\0";function Lme(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function Eoi(n){return n.split("\\\\").join(uct).split("\\{").join(gct).split("\\}").join(uBe).split("\\,").join(fct).split("\\.").join(pct)}function xoi(n){return n.split(uct).join("\\").split(gct).join("{").split(uBe).join("}").split(fct).join(",").split(pct).join(".")}function mct(n){if(!n)return[""];var e=[],t=hct("{","}",n);if(!t)return n.split(",");var i=t.pre,s=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+s+"}";var a=mct(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function Doi(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Z3(Eoi(n),!0).map(xoi)):[]}function koi(n){return"{"+n+"}"}function Ioi(n){return/^-?0\d/.test(n)}function Loi(n,e){return n<=e}function Toi(n,e){return n>=e}function Z3(n,e){var t=[],i=hct("{","}",n);if(!i)return[n];var s=i.pre,o=i.post.length?Z3(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+uBe+i.post,Z3(n)):[n];var u;if(d)u=i.body.split(/\.\./);else if(u=mct(i.body),u.length===1&&(u=Z3(u[0],!1).map(koi),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=Lme(u[0]),m=Lme(u[1]),v=Math.max(u[0].length,u[1].length),w=u.length==3?Math.abs(Lme(u[2])):1,b=Loi,C=m0){var F=new Array(k+1).join("0");S<0?M="-"+F+M.slice(1):M=F+M}}f.push(M)}}else{f=[];for(var N=0;N($re(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Mue(e,t).match(n));var Rue=D_;const yRe=yoi;D_.sep=yRe.sep;const Jw=Symbol("globstar **");D_.GLOBSTAR=Jw;const Roi=Aoi,oqe={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},SRe="[^/]",Tme=SRe+"*?",Moi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Noi="(?:(?!(?:\\/|^)\\.).)*?",_ct=n=>n.split("").reduce((e,t)=>(e[t]=!0,e),{}),rqe=_ct("().*{}+?[]^$\\!"),Poi=_ct("[.("),aqe=/\/+/;D_.filter=(n,e={})=>(t,i,s)=>D_(t,n,e);const SD=(n,e={})=>{const t={};return Object.keys(n).forEach(i=>t[i]=n[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};D_.defaults=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return D_;const e=D_,t=(i,s,o)=>e(i,s,SD(n,o));return t.Minimatch=class extends e.Minimatch{constructor(s,o){super(s,SD(n,o))}},t.Minimatch.defaults=i=>e.defaults(SD(n,i)).Minimatch,t.filter=(i,s)=>e.filter(i,SD(n,s)),t.defaults=i=>e.defaults(SD(n,i)),t.makeRe=(i,s)=>e.makeRe(i,SD(n,s)),t.braceExpand=(i,s)=>e.braceExpand(i,SD(n,s)),t.match=(i,s,o)=>e.match(i,s,SD(n,o)),t};D_.braceExpand=(n,e)=>vct(n,e);const vct=(n,e={})=>($re(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:Roi(n)),Foi=1024*64,$re=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>Foi)throw new TypeError("pattern is too long")},Rme=Symbol("subparse");D_.makeRe=(n,e)=>new Mue(n,e||{}).makeRe();D_.match=(n,e,t={})=>{const i=new Mue(e,t);return n=n.filter(s=>i.match(s)),i.options.nonull&&!n.length&&n.push(e),n};const Ooi=n=>n.replace(/\\(.)/g,"$1"),Boi=n=>n.replace(/\\([^-\]])/g,"$1"),Woi=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Hoi=n=>n.replace(/[[\]\\]/g,"\\$&");class Mue{constructor(e,t){$re(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let i=this.globSet=this.braceExpand();t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,i),i=this.globParts=i.map(s=>s.split(aqe)),this.debug(this.pattern,i),i=i.map((s,o,r)=>s.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(s=>s.indexOf(!1)===-1),this.debug(this.pattern,i),this.set=i}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,i=0;for(let s=0;s{Os();let Ht,Ei;if(t.string(ve)){Ht=ve;const G=ct[0];let de=0,L=i.ParameterStructures.auto;i.ParameterStructures.is(G)&&(de=1,L=G);let ne=ct.length;const R=ne-de;switch(R){case 0:Ei=void 0;break;case 1:Ei=_r(L,ct[de]);break;default:if(L===i.ParameterStructures.byName)throw new Error(`Received ${R} parameters for 'by Name' notification parameter structure.`);Ei=ct.slice(de,ne).map(H=>yc(H));break}}else{const G=ct;Ht=ve.method,Ei=No(ve,G)}const Ut={jsonrpc:Nt,method:Ht,params:Ei};return Mo(Ut),re.write(Ut).catch(G=>{throw Qe.error("Sending notification failed."),G})},onNotification:(ve,ct)=>{Os();let Ht;return t.func(ve)?Gn=ve:ct&&(t.string(ve)?(Ht=ve,Ro.set(ve,{type:void 0,handler:ct})):(Ht=ve.method,Ro.set(ve.method,{type:ve,handler:ct}))),{dispose:()=>{Ht!==void 0?Ro.delete(Ht):Gn=void 0}}},onProgress:(ve,ct,Ht)=>{if(qn.has(ct))throw new Error(`Progress handler for token ${ct} already registered`);return qn.set(ct,Ht),{dispose:()=>{qn.delete(ct)}}},sendProgress:(ve,ct,Ht)=>mn.sendNotification(l.type,{token:ct,value:Ht}),onUnhandledProgress:tl.event,sendRequest:(ve,...ct)=>{Os(),ya();let Ht,Ei,Ut;if(t.string(ve)){Ht=ve;const ne=ct[0],R=ct[ct.length-1];let H=0,ie=i.ParameterStructures.auto;i.ParameterStructures.is(ne)&&(H=1,ie=ne);let je=ct.length;r.CancellationToken.is(R)&&(je=je-1,Ut=R);const pt=je-H;switch(pt){case 0:Ei=void 0;break;case 1:Ei=_r(ie,ct[H]);break;default:if(ie===i.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Ei=ct.slice(H,je).map(is=>yc(is));break}}else{const ne=ct;Ht=ve.method,Ei=No(ve,ne);const R=ve.numberOfParams;Ut=r.CancellationToken.is(ne[R])?ne[R]:void 0}const G=Tt++;let de;Ut&&(de=Ut.onCancellationRequested(()=>{const ne=to.sender.sendCancellation(mn,G);return ne===void 0?(Qe.log(`Received no promise from cancellation strategy when cancelling id ${G}`),Promise.resolve()):ne.catch(()=>{Qe.log(`Sending cancellation messages for id ${G} failed`)})}));const L={jsonrpc:Nt,id:G,method:Ht,params:Ei};return Se(L),typeof to.sender.enableCancellation=="function"&&to.sender.enableCancellation(L),new Promise(async(ne,R)=>{const H=pt=>{ne(pt),to.sender.cleanup(G),de?.dispose()},ie=pt=>{R(pt),to.sender.cleanup(G),de?.dispose()},je={method:Ht,timerStart:Date.now(),resolve:H,reject:ie};try{await re.write(L),mr.set(G,je)}catch(pt){throw Qe.error("Sending request failed."),je.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},onRequest:(ve,ct)=>{Os();let Ht=null;return h.is(ve)?(Ht=void 0,Ji=ve):t.string(ve)?(Ht=null,ct!==void 0&&(Ht=ve,Vi.set(ve,{handler:ct,type:void 0}))):ct!==void 0&&(Ht=ve.method,Vi.set(ve.method,{type:ve,handler:ct})),{dispose:()=>{Ht!==null&&(Ht!==void 0?Vi.delete(Ht):Ji=void 0)}}},hasPendingResponse:()=>mr.size>0,trace:async(ve,ct,Ht)=>{let Ei=!1,Ut=p.Text;Ht!==void 0&&(t.boolean(Ht)?Ei=Ht:(Ei=Ht.sendNotification||!1,Ut=Ht.traceFormat||p.Text)),gs=ve,ir=Ut,gs===u.Off?Hn=void 0:Hn=ct,Ei&&!Xh()&&!ul()&&await mn.sendNotification(m.type,{value:u.toString(ve)})},onError:gh.event,onClose:Qn.event,onUnhandledNotification:Yh.event,onDispose:Tl.event,end:()=>{re.end()},dispose:()=>{if(ul())return;vc=U.Disposed,Tl.fire(void 0);const ve=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const ct of mr.values())ct.reject(ve);mr=new Map,ki=new Map,ba=new Set,ys=new s.LinkedMap,t.func(re.dispose)&&re.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Os(),sr(),vc=U.Listening,j.listen(bc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return mn.onNotification(v.type,ve=>{if(gs===u.Off||!Hn)return;const ct=gs===u.Verbose||gs===u.Compact;Hn.log(ve.message,ct?ve.verbose:void 0)}),mn.onNotification(l.type,ve=>{const ct=qn.get(ve.token);ct?ct(ve.value):tl.fire(ve)}),mn}n.createMessageConnection=J})(Yat);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressType=n.ProgressToken=n.createMessageConnection=n.NullLogger=n.ConnectionOptions=n.ConnectionStrategy=n.AbstractMessageBuffer=n.WriteableStreamMessageWriter=n.AbstractMessageWriter=n.MessageWriter=n.ReadableStreamMessageReader=n.AbstractMessageReader=n.MessageReader=n.SharedArrayReceiverStrategy=n.SharedArraySenderStrategy=n.CancellationToken=n.CancellationTokenSource=n.Emitter=n.Event=n.Disposable=n.LRUCache=n.Touch=n.LinkedMap=n.ParameterStructures=n.NotificationType9=n.NotificationType8=n.NotificationType7=n.NotificationType6=n.NotificationType5=n.NotificationType4=n.NotificationType3=n.NotificationType2=n.NotificationType1=n.NotificationType0=n.NotificationType=n.ErrorCodes=n.ResponseError=n.RequestType9=n.RequestType8=n.RequestType7=n.RequestType6=n.RequestType5=n.RequestType4=n.RequestType3=n.RequestType2=n.RequestType1=n.RequestType0=n.RequestType=n.Message=n.RAL=void 0,n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=void 0;const e=hn;Object.defineProperty(n,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(n,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(n,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(n,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(n,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(n,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(n,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(n,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(n,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(n,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(n,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(n,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(n,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(n,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(n,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(n,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(n,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(n,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(n,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(n,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(n,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(n,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(n,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(n,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(n,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(n,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=kx;Object.defineProperty(n,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(n,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(n,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=wue;Object.defineProperty(n,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const s=tA;Object.defineProperty(n,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(n,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});const o=X1;Object.defineProperty(n,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(n,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=Q4;Object.defineProperty(n,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(n,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=YI;Object.defineProperty(n,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(n,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(n,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=JI;Object.defineProperty(n,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(n,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(n,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=Cue;Object.defineProperty(n,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Yat;Object.defineProperty(n,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(n,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(n,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(n,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(n,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(n,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(n,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(n,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(n,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(n,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(n,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(n,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(n,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(n,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(n,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(n,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(n,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=uD;n.RAL=h.default})(Fre);Object.defineProperty(aBe,"__esModule",{value:!0});const Ry=Fre;class yue extends Ry.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return yue.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}yue.emptyBuffer=new Uint8Array(0);class zsi{constructor(e){this.socket=e,this._onData=new Ry.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(s=>{this._onData.fire(new Uint8Array(s))},()=>{(0,Ry.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class $si{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Ry.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Ry.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Ry.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,t){if(typeof e=="string"){if(t!==void 0&&t!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Gsi=new TextEncoder,Jat=Object.freeze({messageBuffer:Object.freeze({create:n=>new yue(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Gsi.encode(JSON.stringify(n,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{if(!(n instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(n)))}})}),stream:Object.freeze({asReadableStream:n=>new zsi(n),asWritableStream:n=>new $si(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){const i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){const t=setTimeout(n,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(n,e,...t){const i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function wRe(){return Jat}(function(n){function e(){Ry.RAL.install(Jat)}n.install=e})(wRe||(wRe={}));aBe.default=wRe;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(c,l,d,h){h===void 0&&(h=d);var u=Object.getOwnPropertyDescriptor(l,d);(!u||("get"in u?!l.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(c,h,u)}:function(c,l,d,h){h===void 0&&(h=d),c[h]=l[d]}),t=sh&&sh.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.BrowserMessageWriter=n.BrowserMessageReader=void 0,aBe.default.install();const s=Fre;t(Fre,n);class o extends s.AbstractMessageReader{constructor(l){super(),this._onData=new s.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},l.addEventListener("error",d=>this.fireError(d)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}n.BrowserMessageReader=o;class r extends s.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",d=>this.fireError(d))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(d){return this.handleError(d,l),Promise.reject(d)}}handleError(l,d){this.errorCount++,this.fireError(l,d,this.errorCount)}end(){}}n.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=s.NullLogger),s.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,s.createMessageConnection)(c,l,d,h)}n.createMessageConnection=a})(NO);var z6e=NO,Xat={};const lBe=$at(IZt);var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ProtocolNotificationType=Jo.ProtocolNotificationType0=Jo.ProtocolRequestType=Jo.ProtocolRequestType0=Jo.RegistrationType=Jo.MessageDirection=void 0;const j4=NO;var $6e;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})($6e||(Jo.MessageDirection=$6e={}));class qsi{constructor(e){this.method=e}}Jo.RegistrationType=qsi;class Qsi extends j4.RequestType0{constructor(e){super(e)}}Jo.ProtocolRequestType0=Qsi;class jsi extends j4.RequestType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolRequestType=jsi;class Ksi extends j4.NotificationType0{constructor(e){super(e)}}Jo.ProtocolNotificationType0=Ksi;class Ysi extends j4.NotificationType{constructor(e){super(e,j4.ParameterStructures.byName)}}Jo.ProtocolNotificationType=Ysi;var Zat={},jl={};Object.defineProperty(jl,"__esModule",{value:!0});jl.objectLiteral=jl.typedArray=jl.stringArray=jl.array=jl.func=jl.error=jl.number=jl.string=jl.boolean=void 0;function Jsi(n){return n===!0||n===!1}jl.boolean=Jsi;function ect(n){return typeof n=="string"||n instanceof String}jl.string=ect;function Xsi(n){return typeof n=="number"||n instanceof Number}jl.number=Xsi;function Zsi(n){return n instanceof Error}jl.error=Zsi;function eoi(n){return typeof n=="function"}jl.func=eoi;function tct(n){return Array.isArray(n)}jl.array=tct;function toi(n){return tct(n)&&n.every(e=>ect(e))}jl.stringArray=toi;function ioi(n,e){return Array.isArray(n)&&n.every(e)}jl.typedArray=ioi;function noi(n){return n!==null&&typeof n=="object"}jl.objectLiteral=noi;var Sue={};Object.defineProperty(Sue,"__esModule",{value:!0});Sue.ImplementationRequest=void 0;const G6e=Jo;var q6e;(function(n){n.method="textDocument/implementation",n.messageDirection=G6e.MessageDirection.clientToServer,n.type=new G6e.ProtocolRequestType(n.method)})(q6e||(Sue.ImplementationRequest=q6e={}));var Aue={};Object.defineProperty(Aue,"__esModule",{value:!0});Aue.TypeDefinitionRequest=void 0;const Q6e=Jo;var j6e;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=Q6e.MessageDirection.clientToServer,n.type=new Q6e.ProtocolRequestType(n.method)})(j6e||(Aue.TypeDefinitionRequest=j6e={}));var K4={};Object.defineProperty(K4,"__esModule",{value:!0});K4.DidChangeWorkspaceFoldersNotification=K4.WorkspaceFoldersRequest=void 0;const Bre=Jo;var K6e;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Bre.MessageDirection.serverToClient,n.type=new Bre.ProtocolRequestType0(n.method)})(K6e||(K4.WorkspaceFoldersRequest=K6e={}));var Y6e;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Bre.MessageDirection.clientToServer,n.type=new Bre.ProtocolNotificationType(n.method)})(Y6e||(K4.DidChangeWorkspaceFoldersNotification=Y6e={}));var Eue={};Object.defineProperty(Eue,"__esModule",{value:!0});Eue.ConfigurationRequest=void 0;const J6e=Jo;var X6e;(function(n){n.method="workspace/configuration",n.messageDirection=J6e.MessageDirection.serverToClient,n.type=new J6e.ProtocolRequestType(n.method)})(X6e||(Eue.ConfigurationRequest=X6e={}));var Y4={};Object.defineProperty(Y4,"__esModule",{value:!0});Y4.ColorPresentationRequest=Y4.DocumentColorRequest=void 0;const Wre=Jo;var Z6e;(function(n){n.method="textDocument/documentColor",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(Z6e||(Y4.DocumentColorRequest=Z6e={}));var eGe;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Wre.MessageDirection.clientToServer,n.type=new Wre.ProtocolRequestType(n.method)})(eGe||(Y4.ColorPresentationRequest=eGe={}));var J4={};Object.defineProperty(J4,"__esModule",{value:!0});J4.FoldingRangeRefreshRequest=J4.FoldingRangeRequest=void 0;const Hre=Jo;var tGe;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Hre.MessageDirection.clientToServer,n.type=new Hre.ProtocolRequestType(n.method)})(tGe||(J4.FoldingRangeRequest=tGe={}));var iGe;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Hre.MessageDirection.serverToClient,n.type=new Hre.ProtocolRequestType0(n.method)})(iGe||(J4.FoldingRangeRefreshRequest=iGe={}));var xue={};Object.defineProperty(xue,"__esModule",{value:!0});xue.DeclarationRequest=void 0;const nGe=Jo;var sGe;(function(n){n.method="textDocument/declaration",n.messageDirection=nGe.MessageDirection.clientToServer,n.type=new nGe.ProtocolRequestType(n.method)})(sGe||(xue.DeclarationRequest=sGe={}));var Due={};Object.defineProperty(Due,"__esModule",{value:!0});Due.SelectionRangeRequest=void 0;const oGe=Jo;var rGe;(function(n){n.method="textDocument/selectionRange",n.messageDirection=oGe.MessageDirection.clientToServer,n.type=new oGe.ProtocolRequestType(n.method)})(rGe||(Due.SelectionRangeRequest=rGe={}));var XI={};Object.defineProperty(XI,"__esModule",{value:!0});XI.WorkDoneProgressCancelNotification=XI.WorkDoneProgressCreateRequest=XI.WorkDoneProgress=void 0;const soi=NO,Ure=Jo;var aGe;(function(n){n.type=new soi.ProgressType;function e(t){return t===n.type}n.is=e})(aGe||(XI.WorkDoneProgress=aGe={}));var cGe;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Ure.MessageDirection.serverToClient,n.type=new Ure.ProtocolRequestType(n.method)})(cGe||(XI.WorkDoneProgressCreateRequest=cGe={}));var lGe;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Ure.MessageDirection.clientToServer,n.type=new Ure.ProtocolNotificationType(n.method)})(lGe||(XI.WorkDoneProgressCancelNotification=lGe={}));var ZI={};Object.defineProperty(ZI,"__esModule",{value:!0});ZI.CallHierarchyOutgoingCallsRequest=ZI.CallHierarchyIncomingCallsRequest=ZI.CallHierarchyPrepareRequest=void 0;const X4=Jo;var dGe;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(dGe||(ZI.CallHierarchyPrepareRequest=dGe={}));var hGe;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(hGe||(ZI.CallHierarchyIncomingCallsRequest=hGe={}));var uGe;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=X4.MessageDirection.clientToServer,n.type=new X4.ProtocolRequestType(n.method)})(uGe||(ZI.CallHierarchyOutgoingCallsRequest=uGe={}));var em={};Object.defineProperty(em,"__esModule",{value:!0});em.SemanticTokensRefreshRequest=em.SemanticTokensRangeRequest=em.SemanticTokensDeltaRequest=em.SemanticTokensRequest=em.SemanticTokensRegistrationType=em.TokenFormat=void 0;const Yx=Jo;var gGe;(function(n){n.Relative="relative"})(gGe||(em.TokenFormat=gGe={}));var mq;(function(n){n.method="textDocument/semanticTokens",n.type=new Yx.RegistrationType(n.method)})(mq||(em.SemanticTokensRegistrationType=mq={}));var fGe;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(fGe||(em.SemanticTokensRequest=fGe={}));var pGe;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(pGe||(em.SemanticTokensDeltaRequest=pGe={}));var mGe;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Yx.MessageDirection.clientToServer,n.type=new Yx.ProtocolRequestType(n.method),n.registrationMethod=mq.method})(mGe||(em.SemanticTokensRangeRequest=mGe={}));var _Ge;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Yx.MessageDirection.serverToClient,n.type=new Yx.ProtocolRequestType0(n.method)})(_Ge||(em.SemanticTokensRefreshRequest=_Ge={}));var kue={};Object.defineProperty(kue,"__esModule",{value:!0});kue.ShowDocumentRequest=void 0;const vGe=Jo;var wGe;(function(n){n.method="window/showDocument",n.messageDirection=vGe.MessageDirection.serverToClient,n.type=new vGe.ProtocolRequestType(n.method)})(wGe||(kue.ShowDocumentRequest=wGe={}));var Iue={};Object.defineProperty(Iue,"__esModule",{value:!0});Iue.LinkedEditingRangeRequest=void 0;const bGe=Jo;var CGe;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=bGe.MessageDirection.clientToServer,n.type=new bGe.ProtocolRequestType(n.method)})(CGe||(Iue.LinkedEditingRangeRequest=CGe={}));var jg={};Object.defineProperty(jg,"__esModule",{value:!0});jg.WillDeleteFilesRequest=jg.DidDeleteFilesNotification=jg.DidRenameFilesNotification=jg.WillRenameFilesRequest=jg.DidCreateFilesNotification=jg.WillCreateFilesRequest=jg.FileOperationPatternKind=void 0;const Ew=Jo;var yGe;(function(n){n.file="file",n.folder="folder"})(yGe||(jg.FileOperationPatternKind=yGe={}));var SGe;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(SGe||(jg.WillCreateFilesRequest=SGe={}));var AGe;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(AGe||(jg.DidCreateFilesNotification=AGe={}));var EGe;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(EGe||(jg.WillRenameFilesRequest=EGe={}));var xGe;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(xGe||(jg.DidRenameFilesNotification=xGe={}));var DGe;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolNotificationType(n.method)})(DGe||(jg.DidDeleteFilesNotification=DGe={}));var kGe;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ew.MessageDirection.clientToServer,n.type=new Ew.ProtocolRequestType(n.method)})(kGe||(jg.WillDeleteFilesRequest=kGe={}));var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.MonikerRequest=e0.MonikerKind=e0.UniquenessLevel=void 0;const IGe=Jo;var LGe;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(LGe||(e0.UniquenessLevel=LGe={}));var TGe;(function(n){n.$import="import",n.$export="export",n.local="local"})(TGe||(e0.MonikerKind=TGe={}));var RGe;(function(n){n.method="textDocument/moniker",n.messageDirection=IGe.MessageDirection.clientToServer,n.type=new IGe.ProtocolRequestType(n.method)})(RGe||(e0.MonikerRequest=RGe={}));var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.TypeHierarchySubtypesRequest=t0.TypeHierarchySupertypesRequest=t0.TypeHierarchyPrepareRequest=void 0;const Z4=Jo;var MGe;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(MGe||(t0.TypeHierarchyPrepareRequest=MGe={}));var NGe;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(NGe||(t0.TypeHierarchySupertypesRequest=NGe={}));var PGe;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Z4.MessageDirection.clientToServer,n.type=new Z4.ProtocolRequestType(n.method)})(PGe||(t0.TypeHierarchySubtypesRequest=PGe={}));var ez={};Object.defineProperty(ez,"__esModule",{value:!0});ez.InlineValueRefreshRequest=ez.InlineValueRequest=void 0;const Vre=Jo;var FGe;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Vre.MessageDirection.clientToServer,n.type=new Vre.ProtocolRequestType(n.method)})(FGe||(ez.InlineValueRequest=FGe={}));var OGe;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Vre.MessageDirection.serverToClient,n.type=new Vre.ProtocolRequestType0(n.method)})(OGe||(ez.InlineValueRefreshRequest=OGe={}));var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.InlayHintRefreshRequest=i0.InlayHintResolveRequest=i0.InlayHintRequest=void 0;const tz=Jo;var BGe;(function(n){n.method="textDocument/inlayHint",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(BGe||(i0.InlayHintRequest=BGe={}));var WGe;(function(n){n.method="inlayHint/resolve",n.messageDirection=tz.MessageDirection.clientToServer,n.type=new tz.ProtocolRequestType(n.method)})(WGe||(i0.InlayHintResolveRequest=WGe={}));var HGe;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=tz.MessageDirection.serverToClient,n.type=new tz.ProtocolRequestType0(n.method)})(HGe||(i0.InlayHintRefreshRequest=HGe={}));var Fv={};Object.defineProperty(Fv,"__esModule",{value:!0});Fv.DiagnosticRefreshRequest=Fv.WorkspaceDiagnosticRequest=Fv.DocumentDiagnosticRequest=Fv.DocumentDiagnosticReportKind=Fv.DiagnosticServerCancellationData=void 0;const ict=NO,ooi=jl,iz=Jo;var UGe;(function(n){function e(t){const i=t;return i&&ooi.boolean(i.retriggerRequest)}n.is=e})(UGe||(Fv.DiagnosticServerCancellationData=UGe={}));var VGe;(function(n){n.Full="full",n.Unchanged="unchanged"})(VGe||(Fv.DocumentDiagnosticReportKind=VGe={}));var zGe;(function(n){n.method="textDocument/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})(zGe||(Fv.DocumentDiagnosticRequest=zGe={}));var $Ge;(function(n){n.method="workspace/diagnostic",n.messageDirection=iz.MessageDirection.clientToServer,n.type=new iz.ProtocolRequestType(n.method),n.partialResult=new ict.ProgressType})($Ge||(Fv.WorkspaceDiagnosticRequest=$Ge={}));var GGe;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=iz.MessageDirection.serverToClient,n.type=new iz.ProtocolRequestType0(n.method)})(GGe||(Fv.DiagnosticRefreshRequest=GGe={}));var Ql={};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.DidCloseNotebookDocumentNotification=Ql.DidSaveNotebookDocumentNotification=Ql.DidChangeNotebookDocumentNotification=Ql.NotebookCellArrayChange=Ql.DidOpenNotebookDocumentNotification=Ql.NotebookDocumentSyncRegistrationType=Ql.NotebookDocument=Ql.NotebookCell=Ql.ExecutionSummary=Ql.NotebookCellKind=void 0;const _q=lBe,Hb=jl,iA=Jo;var bRe;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(bRe||(Ql.NotebookCellKind=bRe={}));var CRe;(function(n){function e(s,o){const r={executionOrder:s};return(o===!0||o===!1)&&(r.success=o),r}n.create=e;function t(s){const o=s;return Hb.objectLiteral(o)&&_q.uinteger.is(o.executionOrder)&&(o.success===void 0||Hb.boolean(o.success))}n.is=t;function i(s,o){return s===o?!0:s==null||o===null||o===void 0?!1:s.executionOrder===o.executionOrder&&s.success===o.success}n.equals=i})(CRe||(Ql.ExecutionSummary=CRe={}));var zre;(function(n){function e(o,r){return{kind:o,document:r}}n.create=e;function t(o){const r=o;return Hb.objectLiteral(r)&&bRe.is(r.kind)&&_q.DocumentUri.is(r.document)&&(r.metadata===void 0||Hb.objectLiteral(r.metadata))}n.is=t;function i(o,r){const a=new Set;return o.document!==r.document&&a.add("document"),o.kind!==r.kind&&a.add("kind"),o.executionSummary!==r.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||r.metadata!==void 0)&&!s(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!CRe.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function s(o,r){if(o===r)return!0;if(o==null||r===null||r===void 0||typeof o!=typeof r||typeof o!="object")return!1;const a=Array.isArray(o),c=Array.isArray(r);if(a!==c)return!1;if(a&&c){if(o.length!==r.length)return!1;for(let l=0;l0}le.hasId=_r})(Tt||(n.StaticRegistrationOptions=Tt={}));var Oe;(function(le){function _r(No){const mn=No;return mn&&(mn.documentSelector===null||J.is(mn.documentSelector))}le.is=_r})(Oe||(n.TextDocumentRegistrationOptions=Oe={}));var wt;(function(le){function _r(mn){const ve=mn;return i.objectLiteral(ve)&&(ve.workDoneProgress===void 0||i.boolean(ve.workDoneProgress))}le.is=_r;function No(mn){const ve=mn;return ve&&i.boolean(ve.workDoneProgress)}le.hasWorkDoneProgress=No})(wt||(n.WorkDoneProgressOptions=wt={}));var Nt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Nt||(n.InitializeRequest=Nt={}));var Ji;(function(le){le.unknownProtocolVersion=1})(Ji||(n.InitializeErrorCodes=Ji={}));var Vi;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Vi||(n.InitializedNotification=Vi={}));var Gn;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(Gn||(n.ShutdownRequest=Gn={}));var Ro;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(Ro||(n.ExitNotification=Ro={}));var qn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(qn||(n.DidChangeConfigurationNotification=qn={}));var ec;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(ec||(n.MessageType=ec={}));var ys;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ys||(n.ShowMessageNotification=ys={}));var mr;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(mr||(n.ShowMessageRequest=mr={}));var ba;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ba||(n.LogMessageNotification=ba={}));var ki;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ki||(n.TelemetryEventNotification=ki={}));var gs;(function(le){le.None=0,le.Full=1,le.Incremental=2})(gs||(n.TextDocumentSyncKind=gs={}));var ir;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(ir||(n.DidOpenTextDocumentNotification=ir={}));var Hn;(function(le){function _r(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}le.isIncremental=_r;function No(mn){let ve=mn;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}le.isFull=No})(Hn||(n.TextDocumentContentChangeEvent=Hn={}));var vc;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(vc||(n.DidChangeTextDocumentNotification=vc={}));var gh;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(gh||(n.DidCloseTextDocumentNotification=gh={}));var Qn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Qn||(n.DidSaveTextDocumentNotification=Qn={}));var Yh;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(Yh||(n.TextDocumentSaveReason=Yh={}));var tl;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(tl||(n.WillSaveTextDocumentNotification=tl={}));var Tl;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Tl||(n.WillSaveTextDocumentWaitUntilRequest=Tl={}));var to;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(to||(n.DidChangeWatchedFilesNotification=to={}));var Fc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(Fc||(n.FileChangeType=Fc={}));var rd;(function(le){function _r(No){const mn=No;return i.objectLiteral(mn)&&(t.URI.is(mn.baseUri)||t.WorkspaceFolder.is(mn.baseUri))&&i.string(mn.pattern)}le.is=_r})(rd||(n.RelativePattern=rd={}));var Jh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(Jh||(n.WatchKind=Jh={}));var Af;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Af||(n.PublishDiagnosticsNotification=Af={}));var il;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(il||(n.CompletionTriggerKind=il={}));var Rl;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rl||(n.CompletionRequest=Rl={}));var Xh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Xh||(n.CompletionResolveRequest=Xh={}));var ul;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ul||(n.HoverRequest=ul={}));var ad;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(ad||(n.SignatureHelpTriggerKind=ad={}));var wc;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(wc||(n.SignatureHelpRequest=wc={}));var Ca;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ca||(n.DefinitionRequest=Ca={}));var Ld;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ld||(n.ReferencesRequest=Ld={}));var fh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(fh||(n.DocumentHighlightRequest=fh={}));var Fu;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Fu||(n.DocumentSymbolRequest=Fu={}));var bc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(bc||(n.CodeActionRequest=bc={}));var Zh;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Zh||(n.CodeActionResolveRequest=Zh={}));var Cc;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Cc||(n.WorkspaceSymbolRequest=Cc={}));var nr;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nr||(n.WorkspaceSymbolResolveRequest=nr={}));var Rs;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Rs||(n.CodeLensRequest=Rs={}));var Ml;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ml||(n.CodeLensResolveRequest=Ml={}));var Se;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Se||(n.CodeLensRefreshRequest=Se={}));var Mo;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Mo||(n.DocumentLinkRequest=Mo={}));var cd;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(cd||(n.DocumentLinkResolveRequest=cd={}));var K;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(K||(n.DocumentFormattingRequest=K={}));var Le;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Le||(n.DocumentRangeFormattingRequest=Le={}));var ri;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ri||(n.DocumentRangesFormattingRequest=ri={}));var ts;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ts||(n.DocumentOnTypeFormattingRequest=ts={}));var Os;(function(le){le.Identifier=1})(Os||(n.PrepareSupportDefaultBehavior=Os={}));var sr;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(sr||(n.RenameRequest=sr={}));var ya;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ya||(n.PrepareRenameRequest=ya={}));var yc;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(yc||(n.ExecuteCommandRequest=yc={}));var Ou;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ou||(n.ApplyWorkspaceEditRequest=Ou={}))})(Zat);var Tue={};Object.defineProperty(Tue,"__esModule",{value:!0});Tue.createProtocolConnection=void 0;const eqe=NO;function roi(n,e,t,i){return eqe.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,eqe.createMessageConnection)(n,e,t,i)}Tue.createProtocolConnection=roi;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.LSPErrorCodes=n.createProtocolConnection=void 0,t(NO,n),t(lBe,n),t(Jo,n),t(Zat,n);var i=Tue;Object.defineProperty(n,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var s;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(s||(n.LSPErrorCodes=s={}))})(Xat);(function(n){var e=sh&&sh.__createBinding||(Object.create?function(o,r,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(r,a);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[a]}}),Object.defineProperty(o,c,l)}:function(o,r,a,c){c===void 0&&(c=a),o[c]=r[a]}),t=sh&&sh.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.createProtocolConnection=void 0;const i=z6e;t(z6e,n),t(Xat,n);function s(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}n.createProtocolConnection=s})(Ts);var $n={};const as=$at(MQt);var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.asPromise=ea.thenable=ea.typedArray=ea.stringArray=ea.array=ea.func=ea.error=ea.number=ea.string=ea.boolean=void 0;function aoi(n){return n===!0||n===!1}ea.boolean=aoi;function nct(n){return typeof n=="string"||n instanceof String}ea.string=nct;function coi(n){return typeof n=="number"||n instanceof Number}ea.number=coi;function loi(n){return n instanceof Error}ea.error=loi;function sct(n){return typeof n=="function"}ea.func=sct;function oct(n){return Array.isArray(n)}ea.array=oct;function doi(n){return oct(n)&&n.every(e=>nct(e))}ea.stringArray=doi;function hoi(n,e){return Array.isArray(n)&&n.every(e)}ea.typedArray=hoi;function rct(n){return n&&sct(n.then)}ea.thenable=rct;function uoi(n){return n instanceof Promise?n:rct(n)?new Promise((e,t)=>{n.then(i=>e(i),i=>t(i))}):Promise.resolve(n)}ea.asPromise=uoi;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.generateUuid=Er.parse=Er.isUUID=Er.v4=Er.empty=void 0;class dBe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class bo extends dBe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return bo._oneOf(bo._chars)}constructor(){super([bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-","4",bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._oneOf(bo._timeHighBits),bo._randomHex(),bo._randomHex(),bo._randomHex(),"-",bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex(),bo._randomHex()].join(""))}}bo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];bo._timeHighBits=["8","9","a","b"];Er.empty=new dBe("00000000-0000-0000-0000-000000000000");function act(){return new bo}Er.v4=act;const goi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function cct(n){return goi.test(n)}Er.isUUID=cct;function foi(n){if(!cct(n))throw new Error("invalid uuid");return new dBe(n)}Er.parse=foi;function poi(){return act().asHex()}Er.generateUuid=poi;Object.defineProperty($n,"__esModule",{value:!0});$n.WorkspaceFeature=$n.TextDocumentLanguageFeature=$n.TextDocumentEventFeature=$n.DynamicDocumentFeature=$n.DynamicFeature=$n.StaticFeature=$n.ensure=$n.LSPCancellationError=void 0;const YM=as,Ime=Ts,Jf=ea,tqe=Er;class moi extends YM.CancellationError{constructor(e){super(),this.data=e}}$n.LSPCancellationError=moi;function _oi(n,e){return n[e]===void 0&&(n[e]={}),n[e]}$n.ensure=_oi;var iqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))}n.is=e})(iqe||($n.StaticFeature=iqe={}));var nqe;(function(n){function e(t){const i=t;return i!=null&&Jf.func(i.fillClientCapabilities)&&Jf.func(i.initialize)&&Jf.func(i.getState)&&Jf.func(i.clear)&&(i.fillInitializeParams===void 0||Jf.func(i.fillInitializeParams))&&Jf.func(i.register)&&Jf.func(i.unregister)&&i.registrationType!==void 0}n.is=e})(nqe||($n.DynamicFeature=nqe={}));class hBe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const s of e){t++;for(const o of YM.workspace.textDocuments)if(YM.languages.match(s,o)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}const i=t>0;return{kind:"document",id:this.registrationType.method,registrations:i,matches:!1}}}$n.DynamicDocumentFeature=hBe;class voi extends hBe{static textDocumentFilter(e,t){for(const i of e)if(YM.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,s,o,r,a){super(e),this._event=t,this._type=i,this._middleware=s,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new YM.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(i=>{this._client.error(`Sending document notification ${this._type.method} failed.`,i)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){const t=async i=>{const s=this._createParams(i);await this._client.sendNotification(this._type,s),this.notificationSent(this.getTextDocument(i),this._type,s)};if(this.matches(e)){const i=this._middleware();return i?i(e,s=>t(s)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(const t of this._selectors.values())if(YM.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}$n.TextDocumentEventFeature=voi;class woi extends hBe{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(const e of this._registrations.values()){const t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(Ime.TextDocumentRegistrationOptions.is(t)){const i=Ime.StaticRegistrationOptions.hasId(t)?t.id:tqe.generateUuid(),s=t.documentSelector??e;if(s)return[i,Object.assign({},t,{documentSelector:s})]}else if(Jf.boolean(t)&&t===!0||Ime.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[tqe.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Jf.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(const t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&YM.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(i),e)>0)return t.provider}}getAllProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.TextDocumentLanguageFeature=woi;class boi{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){const e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){const t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}$n.WorkspaceFeature=boi;var Ix={};const Coi=typeof process=="object"&&process&&process.platform==="win32";var yoi=Coi?{sep:"\\"}:{sep:"/"},Soi=lct;function lct(n,e,t){n instanceof RegExp&&(n=sqe(n,t)),e instanceof RegExp&&(e=sqe(e,t));var i=dct(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function sqe(n,e){var t=e.match(n);return t?t[0]:null}lct.range=dct;function dct(n,e,t){var i,s,o,r,a,c=t.indexOf(n),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(n,d+1)):i.length==1?a=[i.pop(),l]:(s=i.pop(),s=0?c:l;i.length&&(a=[o,r])}return a}var hct=Soi,Aoi=Doi,uct="\0SLASH"+Math.random()+"\0",gct="\0OPEN"+Math.random()+"\0",uBe="\0CLOSE"+Math.random()+"\0",fct="\0COMMA"+Math.random()+"\0",pct="\0PERIOD"+Math.random()+"\0";function Lme(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function Eoi(n){return n.split("\\\\").join(uct).split("\\{").join(gct).split("\\}").join(uBe).split("\\,").join(fct).split("\\.").join(pct)}function xoi(n){return n.split(uct).join("\\").split(gct).join("{").split(uBe).join("}").split(fct).join(",").split(pct).join(".")}function mct(n){if(!n)return[""];var e=[],t=hct("{","}",n);if(!t)return n.split(",");var i=t.pre,s=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+s+"}";var a=mct(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function Doi(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Z3(Eoi(n),!0).map(xoi)):[]}function koi(n){return"{"+n+"}"}function Ioi(n){return/^-?0\d/.test(n)}function Loi(n,e){return n<=e}function Toi(n,e){return n>=e}function Z3(n,e){var t=[],i=hct("{","}",n);if(!i)return[n];var s=i.pre,o=i.post.length?Z3(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+uBe+i.post,Z3(n)):[n];var u;if(d)u=i.body.split(/\.\./);else if(u=mct(i.body),u.length===1&&(u=Z3(u[0],!1).map(koi),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=Lme(u[0]),m=Lme(u[1]),v=Math.max(u[0].length,u[1].length),w=u.length==3?Math.abs(Lme(u[2])):1,b=Loi,C=m0){var F=new Array(k+1).join("0");S<0?M="-"+F+M.slice(1):M=F+M}}f.push(M)}}else{f=[];for(var N=0;N($re(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Mue(e,t).match(n));var Rue=D_;const yRe=yoi;D_.sep=yRe.sep;const Jw=Symbol("globstar **");D_.GLOBSTAR=Jw;const Roi=Aoi,oqe={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},SRe="[^/]",Tme=SRe+"*?",Moi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Noi="(?:(?!(?:\\/|^)\\.).)*?",_ct=n=>n.split("").reduce((e,t)=>(e[t]=!0,e),{}),rqe=_ct("().*{}+?[]^$\\!"),Poi=_ct("[.("),aqe=/\/+/;D_.filter=(n,e={})=>(t,i,s)=>D_(t,n,e);const SD=(n,e={})=>{const t={};return Object.keys(n).forEach(i=>t[i]=n[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};D_.defaults=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return D_;const e=D_,t=(i,s,o)=>e(i,s,SD(n,o));return t.Minimatch=class extends e.Minimatch{constructor(s,o){super(s,SD(n,o))}},t.Minimatch.defaults=i=>e.defaults(SD(n,i)).Minimatch,t.filter=(i,s)=>e.filter(i,SD(n,s)),t.defaults=i=>e.defaults(SD(n,i)),t.makeRe=(i,s)=>e.makeRe(i,SD(n,s)),t.braceExpand=(i,s)=>e.braceExpand(i,SD(n,s)),t.match=(i,s,o)=>e.match(i,s,SD(n,o)),t};D_.braceExpand=(n,e)=>vct(n,e);const vct=(n,e={})=>($re(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:Roi(n)),Foi=1024*64,$re=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>Foi)throw new TypeError("pattern is too long")},Rme=Symbol("subparse");D_.makeRe=(n,e)=>new Mue(n,e||{}).makeRe();D_.match=(n,e,t={})=>{const i=new Mue(e,t);return n=n.filter(s=>i.match(s)),i.options.nonull&&!n.length&&n.push(e),n};const Ooi=n=>n.replace(/\\(.)/g,"$1"),Boi=n=>n.replace(/\\([^-\]])/g,"$1"),Woi=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Hoi=n=>n.replace(/[[\]\\]/g,"\\$&");class Mue{constructor(e,t){$re(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let i=this.globSet=this.braceExpand();t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,i),i=this.globParts=i.map(s=>s.split(aqe)),this.debug(this.pattern,i),i=i.map((s,o,r)=>s.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(s=>s.indexOf(!1)===-1),this.debug(this.pattern,i),this.set=i}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,i=0;for(let s=0;s>> no match, partial?`,e,h,t,u),h===a))}var p;if(typeof l=="string"?(p=d===l,this.debug("string match",l,d,p)):(p=d.match(l),this.debug("pattern match",l,d,p)),!p)return!1}if(o===a&&r===c)return!0;if(o===a)return i;if(r===c)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return vct(this.pattern,this.options)}parse(e,t){$re(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Jw;if(e==="")return"";let s="",o=!1,r=!1;const a=[],c=[];let l,d=!1,h=-1,u=-1,f,p,m,v=e.charAt(0)===".",w=i.dot||v;const b=()=>v?"":w?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=k=>k.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=()=>{if(l){switch(l){case"*":s+=Tme,o=!0;break;case"?":s+=SRe,o=!0;break;default:s+="\\"+l;break}this.debug("clearStateChar %j %j",l,s),l=!1}};for(let k=0,F;k(U||(U="\\"),z+z+U+"|")),this.debug(`tail=%j - %s`,k,k,p,s);const F=p.type==="*"?Tme:p.type==="?"?SRe:"\\"+p.type;o=!0,s=s.slice(0,p.reStart)+F+"\\("+k}y(),r&&(s+="\\\\");const S=Poi[s.charAt(0)];for(let k=c.length-1;k>-1;k--){const F=c[k],N=s.slice(0,F.reStart),z=s.slice(F.reStart,F.reEnd-8);let U=s.slice(F.reEnd);const J=s.slice(F.reEnd-8,F.reEnd)+U,j=N.split(")").length,re=N.split("(").length-j;let me=U;for(let Qe=0;Qe(r=r.map(a=>typeof a=="string"?Woi(a):a===Jw?Jw:a._src).reduce((a,c)=>(a[a.length-1]===Jw&&c===Jw||a.push(c),a),[]),r.forEach((a,c)=>{a!==Jw||r[c-1]===Jw||(c===0?r.length>1?r[c+1]="(?:\\/|"+i+"\\/)?"+r[c+1]:r[c]=i:c===r.length-1?r[c-1]+="(?:\\/|"+i+")?":(r[c-1]+="(?:\\/|\\/"+i+"\\/)"+r[c+1],r[c+1]=Jw))}),r.filter(a=>a!==Jw).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,s)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const i=this.options;yRe.sep!=="/"&&(e=e.split(yRe.sep).join("/")),e=e.split(aqe),this.debug(this.pattern,"split",e);const s=this.set;this.debug(this.pattern,"set",s);let o;for(let r=e.length-1;r>=0&&(o=e[r],!o);r--);for(let r=0;r{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,s=new Set;H8.fillTabResources(s);const o=new Set,r=new Set(s);for(const a of i.values())s.has(a)?r.delete(a):o.add(a);if(this.open=s,o.size>0){const a=new Set;for(const c of o)a.add(Qo.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(Qo.Uri.parse(c));this._onOpen.fire(a)}};Qo.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=Qo.window.tabGroups.onDidChangeTabs(e):this.disposable={dispose:()=>{}}}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof Qo.Uri?Qo.window.activeTextEditor?.document.uri===e:Qo.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof Qo.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return H8.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const s of Qo.window.tabGroups.all)for(const o of s.tabs){const r=o.input;let a;r instanceof Qo.TabInputText?a=r.uri:r instanceof Qo.TabInputTextDiff?a=r.modified:r instanceof Qo.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Nh;(function(n){n[n.document=1]="document",n[n.workspace=2]="workspace"})(Nh||(Nh={}));var GE;(function(n){function e(t){return t instanceof Qo.Uri?t.toString():t.uri.toString()}n.asKey=e})(GE||(GE={}));class zoi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const s=e===Nh.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof Qo.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=s.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},s.set(o,c)),c}update(e,t,i,s){const o=e===Nh.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof Qo.Uri?[t.toString(),t,i,s]:[t.uri.toString(),t.uri,t.version,i];let d=o.get(r);d===void 0?(d={document:a,pulledVersion:c,resultId:l},o.set(r,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=GE.asKey(t);(e===Nh.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).get(i)?.resultId}getAllResultIds(){const e=[];for(let[t,i]of this.workspacePullStates)this.documentPullStates.has(t)&&(i=this.documentPullStates.get(t)),i.resultId!==void 0&&e.push({uri:t,value:i.resultId});return e}}class $oi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new Qo.EventEmitter,this.provider=this.createProvider(),this.diagnostics=Qo.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new zoi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof Qo.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(i.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},s=>{this.client.error(`Document pull failed for text document ${i.toString()}`,s,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri,s=i?e:e.uri,o=s.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Nh.document,e,t):this.documentStates.track(Nh.document,e);if(r===void 0){const c=new Qo.CancellationTokenSource;this.openRequests.set(o,{state:kg.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:lv.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof ARe.LSPCancellationError&&ql.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:kg.outDated,document:e}),d===void 0&&h instanceof Qo.CancellationError)d={state:kg.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(o),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${o}`),this.diagnostics.delete(s);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Nh.document,e);return}if(d.state===kg.outDated)return;l!==void 0&&(l.kind===lv.DocumentDiagnosticReportKind.full&&this.diagnostics.set(s,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===kg.reschedule&&this.pull(e)}else r.state===kg.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:kg.reschedule,document:r.document})):r.state===kg.outDated&&this.openRequests.set(o,{state:kg.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof Qo.Uri?e:e.uri,i=t.toString(),s=this.openRequests.get(i);this.options.workspaceDiagnostics?s!==void 0?this.openRequests.set(i,{state:kg.reschedule,document:e}):this.pull(e,()=>{this.forget(Nh.document,e)}):(s!==void 0&&(s.state===kg.active&&s.tokenSource.cancel(),this.openRequests.set(i,{state:kg.outDated,document:e})),this.diagnostics.delete(t),this.forget(Nh.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof ARe.LSPCancellationError)&&!ql.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new Qo.CancellationTokenSource;const e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(const i of t.items)i.kind===lv.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Nh.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Nh.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,s)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof Qo.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(ql.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:h.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,l,h,{kind:lv.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,s,o):o(t,i,s)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,s)=>{const o=async l=>l.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,i)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},r=l=>{const d=[];for(const h of l)d.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return d},a=(l,d)=>{const h=(0,Voi.generateUuid)(),u=this.client.onProgress(ql.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){s(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(w){this.client.error("Converting workspace diagnostics failed.",w)}s(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(ql.WorkspaceDiagnosticRequest.type,f,d).then(async p=>{if(d.isCancellationRequested)return{items:[]};const m={items:[]};for(const v of p.items)m.items.push(await o(v));return u.dispose(),s(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,s,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===kg.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:kg.outDated,document:t.document});this.diagnostics.dispose()}}class Goi{constructor(e){this.diagnosticRequestor=e,this.documents=new ql.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=GE.asKey(e);this.documents.has(t)||(this.documents.set(t,e,ql.Touch.Last),this.trigger())}remove(e){const t=GE.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,ql.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=GE.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,ql.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument!==void 0?GE.asKey(this.endDocument):void 0}}class qoi{constructor(e,t,i){const s=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(s.match!==void 0)return s.match(m,p);for(const v of m)if(ql.TextDocumentFilter.is(v)){if(typeof v=="string"||v.language!==void 0&&v.language!=="*"||v.scheme!==void 0&&v.scheme!=="*"&&v.scheme!==p.scheme)return!1;if(v.pattern!==void 0){const w=new Uoi.Minimatch(v.pattern,{noext:!0});if(!w.makeRe()||!w.match(p.fsPath))return!1}}return!0},c=p=>p instanceof Qo.Uri?a(p):Qo.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof Qo.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new $oi(e,t,i),this.backgroundScheduler=new Goi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=Qo.window.activeTextEditor?.document,Qo.window.onDidChangeActiveTextEditor(p=>{const m=this.activeTextDocument;this.activeTextDocument=p?.document,m!==void 0&&d(m),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});const h=e.getFeature(ql.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Nh.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Nh.document,m))continue;const v=m.toString();let w;for(const b of Qo.workspace.textDocuments)if(v===b.uri.toString()){w=b;break}w!==void 0&&c(w)&&this.diagnosticRequestor.pull(w,()=>{d(w)})}}));const u=new Set;for(const p of Qo.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(s.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(s.onChange===!0){const p=e.getFeature(ql.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onType))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(s.onSave===!0){const p=e.getFeature(ql.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onSave))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(ql.DidCloseTextDocumentNotification.method);r.push(f.onNotificationSent(p=>{this.cleanUpDocument(p.textDocument)})),t.onClose(p=>{for(const m of p)this.cleanUpDocument(m)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(const p of Qo.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=Qo.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Nh.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class Qoi extends ARe.TextDocumentLanguageFeature{constructor(e){super(e,ql.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=DY(DY(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,DY(DY(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(ql.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[s,o]=this.getRegistration(t,e.diagnosticProvider);!s||!o||this.register({id:s,registerOptions:o})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new H8);const t=new qoi(this._client,this.tabs,e);return[t.disposable,t]}}Ix.DiagnosticFeature=Qoi;var mu={},Nue={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});vu.forEach=vu.mapAsync=vu.map=vu.clearTestMode=vu.setTestMode=vu.Semaphore=vu.Delayer=void 0;const lj=Ts;class joi{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,lj.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}}vu.Delayer=joi;class Koi{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,lj.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}vu.Semaphore=Koi;let gBe=!1;function Yoi(){gBe=!0}vu.setTestMode=Yoi;function Joi(){gBe=!1}vu.clearTestMode=Joi;const cqe=15;class fBe{constructor(e=cqe){this.yieldAfter=gBe===!0?Math.max(e,2):Math.max(e,cqe),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){const e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}}async function Xoi(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.map=Xoi;async function Zoi(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.mapAsync=Zoi;async function eri(n,e,t,i){if(n.length===0)return;const s=new fBe(i?.yieldAfter);function o(a){s.start();for(let c=a;c{(0,lj.RAL)().timer.setImmediate(()=>{a(o(r))})})}vu.forEach=eri;var Pue={};Object.defineProperty(Pue,"__esModule",{value:!0});const tri=as;class iri extends tri.CompletionItem{constructor(e){super(e)}}Pue.default=iri;var Fue={};Object.defineProperty(Fue,"__esModule",{value:!0});const nri=as;class sri extends nri.CodeLens{constructor(e){super(e)}}Fue.default=sri;var Oue={};Object.defineProperty(Oue,"__esModule",{value:!0});const ori=as;class rri extends ori.DocumentLink{constructor(e,t){super(e,t)}}Oue.default=rri;var Bue={};Object.defineProperty(Bue,"__esModule",{value:!0});const ari=as;class cri extends ari.CodeAction{constructor(e,t){super(e),this.data=t}}Bue.default=cri;var tO={};Object.defineProperty(tO,"__esModule",{value:!0});tO.ProtocolDiagnostic=tO.DiagnosticCode=void 0;const lri=as,Mme=ea;var lqe;(function(n){function e(t){const i=t;return i!=null&&(Mme.number(i.value)||Mme.string(i.value))&&Mme.string(i.target)}n.is=e})(lqe||(tO.DiagnosticCode=lqe={}));class dri extends lri.Diagnostic{constructor(e,t,i,s){super(e,t,i),this.data=s,this.hasDiagnosticCode=!1}}tO.ProtocolDiagnostic=dri;var Wue={};Object.defineProperty(Wue,"__esModule",{value:!0});const hri=as;class uri extends hri.CallHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Wue.default=uri;var Hue={};Object.defineProperty(Hue,"__esModule",{value:!0});const gri=as;class fri extends gri.TypeHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Hue.default=fri;var Uue={};Object.defineProperty(Uue,"__esModule",{value:!0});const kY=as;class pri extends kY.SymbolInformation{constructor(e,t,i,s,o){const r=!(s instanceof kY.Uri);super(e,t,i,r?s:new kY.Location(s,new kY.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}Uue.default=pri;var Vue={};Object.defineProperty(Vue,"__esModule",{value:!0});const mri=as;class _ri extends mri.InlayHint{constructor(e,t,i){super(e,t,i)}}Vue.default=_ri;Object.defineProperty(Nue,"__esModule",{value:!0});Nue.createConverter=void 0;const Td=as,Ms=Ts,OL=ea,dqe=vu,vri=Pue,wri=Fue,bri=Oue,hqe=Bue,uqe=tO,Cri=Wue,yri=Hue,Sri=Uue,Ari=Vue;var ERe;(function(n){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}n.is=e})(ERe||(ERe={}));function Eri(n){const t=n||(K=>K.toString());function i(K){return t(K)}function s(K){return{uri:t(K.uri)}}function o(K){return{uri:t(K.uri),languageId:K.languageId,version:K.version,text:K.getText()}}function r(K){return{uri:t(K.uri),version:K.version}}function a(K){return{textDocument:o(K)}}function c(K){const Le=K;return!!Le.document&&!!Le.contentChanges}function l(K){const Le=K;return!!Le.uri&&!!Le.version}function d(K,Le,ri){if(l(K))return{textDocument:{uri:t(K.uri),version:K.version},contentChanges:[{text:K.getText()}]};if(c(K)){const ts=Le,Os=ri;return{textDocument:{uri:t(ts),version:Os},contentChanges:K.contentChanges.map(ya=>{const Cc=ya.range;return{range:{start:{line:Cc.start.line,character:Cc.start.character},end:{line:Cc.end.line,character:Cc.end.character}},rangeLength:ya.rangeLength,text:ya.text}})}}else throw Error("Unsupported text document change parameter")}function h(K){return{textDocument:s(K)}}function u(K,Le=!1){let ri={textDocument:s(K)};return Le&&(ri.text=K.getText()),ri}function f(K){switch(K){case Td.TextDocumentSaveReason.Manual:return Ms.TextDocumentSaveReason.Manual;case Td.TextDocumentSaveReason.AfterDelay:return Ms.TextDocumentSaveReason.AfterDelay;case Td.TextDocumentSaveReason.FocusOut:return Ms.TextDocumentSaveReason.FocusOut}return Ms.TextDocumentSaveReason.Manual}function p(K){return{textDocument:s(K.document),reason:f(K.reason)}}function m(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function v(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function w(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function b(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function C(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function y(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function S(K,Le){return{textDocument:s(K),position:me(Le)}}function M(K){switch(K){case Td.CompletionTriggerKind.TriggerCharacter:return Ms.CompletionTriggerKind.TriggerCharacter;case Td.CompletionTriggerKind.TriggerForIncompleteCompletions:return Ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return Ms.CompletionTriggerKind.Invoked}}function k(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{triggerKind:M(ri.triggerKind),triggerCharacter:ri.triggerCharacter}}}function F(K){switch(K){case Td.SignatureHelpTriggerKind.Invoke:return Ms.SignatureHelpTriggerKind.Invoked;case Td.SignatureHelpTriggerKind.TriggerCharacter:return Ms.SignatureHelpTriggerKind.TriggerCharacter;case Td.SignatureHelpTriggerKind.ContentChange:return Ms.SignatureHelpTriggerKind.ContentChange}}function N(K){return{label:K.label}}function z(K){return K.map(N)}function U(K){return{label:K.label,parameters:z(K.parameters)}}function J(K){return K.map(U)}function j(K){return K===void 0?K:{signatures:J(K.signatures),activeSignature:K.activeSignature,activeParameter:K.activeParameter}}function re(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{isRetrigger:ri.isRetrigger,triggerCharacter:ri.triggerCharacter,triggerKind:F(ri.triggerKind),activeSignatureHelp:j(ri.activeSignatureHelp)}}}function me(K){return{line:K.line,character:K.character}}function De(K){return K==null?K:{line:K.line>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.line,character:K.character>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.character}}function Qe(K,Le){return dqe.map(K,De,Le)}function Tt(K){return K.map(De)}function Oe(K){return K==null?K:{start:De(K.start),end:De(K.end)}}function wt(K){return K.map(Oe)}function Nt(K){return K==null?K:Ms.Location.create(i(K.uri),Oe(K.range))}function Yi(K){switch(K){case Td.DiagnosticSeverity.Error:return Ms.DiagnosticSeverity.Error;case Td.DiagnosticSeverity.Warning:return Ms.DiagnosticSeverity.Warning;case Td.DiagnosticSeverity.Information:return Ms.DiagnosticSeverity.Information;case Td.DiagnosticSeverity.Hint:return Ms.DiagnosticSeverity.Hint}}function Vi(K){if(!K)return;let Le=[];for(let ri of K){let ts=Gn(ri);ts!==void 0&&Le.push(ts)}return Le.length>0?Le:void 0}function Gn(K){switch(K){case Td.DiagnosticTag.Unnecessary:return Ms.DiagnosticTag.Unnecessary;case Td.DiagnosticTag.Deprecated:return Ms.DiagnosticTag.Deprecated;default:return}}function Ro(K){return{message:K.message,location:Nt(K.location)}}function qn(K){return K.map(Ro)}function ec(K){if(K!=null)return OL.number(K)||OL.string(K)?K:{value:K.value,target:i(K.target)}}function ys(K){const Le=Ms.Diagnostic.create(Oe(K.range),K.message),ri=K instanceof uqe.ProtocolDiagnostic?K:void 0;ri!==void 0&&ri.data!==void 0&&(Le.data=ri.data);const ts=ec(K.code);return uqe.DiagnosticCode.is(ts)?ri!==void 0&&ri.hasDiagnosticCode?Le.code=ts:(Le.code=ts.value,Le.codeDescription={href:ts.target}):Le.code=ts,OL.number(K.severity)&&(Le.severity=Yi(K.severity)),Array.isArray(K.tags)&&(Le.tags=Vi(K.tags)),K.relatedInformation&&(Le.relatedInformation=qn(K.relatedInformation)),K.source&&(Le.source=K.source),Le}function mr(K,Le){return K==null?K:dqe.map(K,ys,Le)}function ba(K){return K==null?K:K.map(ys)}function ki(K,Le){switch(K){case"$string":return Le;case Ms.MarkupKind.PlainText:return{kind:K,value:Le};case Ms.MarkupKind.Markdown:return{kind:K,value:Le.value};default:return`Unsupported Markup content received. Kind is: ${K}`}}function gs(K){switch(K){case Td.CompletionItemTag.Deprecated:return Ms.CompletionItemTag.Deprecated}}function ir(K){if(K===void 0)return K;const Le=[];for(let ri of K){const ts=gs(ri);ts!==void 0&&Le.push(ts)}return Le}function Hn(K,Le){return Le!==void 0?Le:K+1}function _c(K,Le=!1){let ri,ts;OL.string(K.label)?ri=K.label:(ri=K.label.label,Le&&(K.label.detail!==void 0||K.label.description!==void 0)&&(ts={detail:K.label.detail,description:K.label.description}));let Os={label:ri};ts!==void 0&&(Os.labelDetails=ts);let sr=K instanceof vri.default?K:void 0;K.detail&&(Os.detail=K.detail),K.documentation&&(!sr||sr.documentationFormat==="$string"?Os.documentation=K.documentation:Os.documentation=ki(sr.documentationFormat,K.documentation)),K.filterText&&(Os.filterText=K.filterText),gh(Os,K),OL.number(K.kind)&&(Os.kind=Hn(K.kind,sr&&sr.originalItemKind)),K.sortText&&(Os.sortText=K.sortText),K.additionalTextEdits&&(Os.additionalTextEdits=el(K.additionalTextEdits)),K.commitCharacters&&(Os.commitCharacters=K.commitCharacters.slice()),K.command&&(Os.command=Ca(K.command)),(K.preselect===!0||K.preselect===!1)&&(Os.preselect=K.preselect);const ya=ir(K.tags);if(sr){if(sr.data!==void 0&&(Os.data=sr.data),sr.deprecated===!0||sr.deprecated===!1){if(sr.deprecated===!0&&ya!==void 0&&ya.length>0){const Cc=ya.indexOf(Td.CompletionItemTag.Deprecated);Cc!==-1&&ya.splice(Cc,1)}Os.deprecated=sr.deprecated}sr.insertTextMode!==void 0&&(Os.insertTextMode=sr.insertTextMode)}return ya!==void 0&&ya.length>0&&(Os.tags=ya),Os.insertTextMode===void 0&&K.keepWhitespace===!0&&(Os.insertTextMode=Ms.InsertTextMode.adjustIndentation),Os}function gh(K,Le){let ri=Ms.InsertTextFormat.PlainText,ts,Os;Le.textEdit?(ts=Le.textEdit.newText,Os=Le.textEdit.range):Le.insertText instanceof Td.SnippetString?(ri=Ms.InsertTextFormat.Snippet,ts=Le.insertText.value):ts=Le.insertText,Le.range&&(Os=Le.range),K.insertTextFormat=ri,Le.fromEdit&&ts!==void 0&&Os!==void 0?K.textEdit=Qn(ts,Os):K.insertText=ts}function Qn(K,Le){return ERe.is(Le)?Ms.InsertReplaceEdit.create(K,Oe(Le.inserting),Oe(Le.replacing)):{newText:K,range:Oe(Le)}}function Yh(K){return{range:Oe(K.range),newText:K.newText}}function el(K){return K==null?K:K.map(Yh)}function Tl(K){return K<=Td.SymbolKind.TypeParameter?K+1:Ms.SymbolKind.Property}function to(K){return K}function Fc(K){return K.map(to)}function rd(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{includeDeclaration:ri.includeDeclaration}}}async function Jh(K,Le){let ri=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(ri.data=K.data),K.kind!==void 0&&(ri.kind=ul(K.kind)),K.diagnostics!==void 0&&(ri.diagnostics=await mr(K.diagnostics,Le)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(ri.command=Ca(K.command)),K.isPreferred!==void 0&&(ri.isPreferred=K.isPreferred),K.disabled!==void 0&&(ri.disabled={reason:K.disabled.reason}),ri}function Af(K){let Le=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(Le.data=K.data),K.kind!==void 0&&(Le.kind=ul(K.kind)),K.diagnostics!==void 0&&(Le.diagnostics=ba(K.diagnostics)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(Le.command=Ca(K.command)),K.isPreferred!==void 0&&(Le.isPreferred=K.isPreferred),K.disabled!==void 0&&(Le.disabled={reason:K.disabled.reason}),Le}async function tl(K,Le){if(K==null)return K;let ri;return K.only&&OL.string(K.only.value)&&(ri=[K.only.value]),Ms.CodeActionContext.create(await mr(K.diagnostics,Le),ri,Xh(K.triggerKind))}function Rl(K){if(K==null)return K;let Le;return K.only&&OL.string(K.only.value)&&(Le=[K.only.value]),Ms.CodeActionContext.create(ba(K.diagnostics),Le,Xh(K.triggerKind))}function Xh(K){switch(K){case Td.CodeActionTriggerKind.Invoke:return Ms.CodeActionTriggerKind.Invoked;case Td.CodeActionTriggerKind.Automatic:return Ms.CodeActionTriggerKind.Automatic;default:return}}function ul(K){if(K!=null)return K.value}function ad(K){return K==null?K:Ms.InlineValueContext.create(K.frameId,Oe(K.stoppedLocation))}function vc(K,Le,ri){return{context:Ms.InlineCompletionContext.create(ri.triggerKind,ri.selectedCompletionInfo),textDocument:s(K),position:De(Le)}}function Ca(K){let Le=Ms.Command.create(K.title,K.command);return K.arguments&&(Le.arguments=K.arguments),Le}function Ld(K){let Le=Ms.CodeLens.create(Oe(K.range));return K.command&&(Le.command=Ca(K.command)),K instanceof wri.default&&K.data&&(Le.data=K.data),Le}function fh(K,Le){const ri={tabSize:K.tabSize,insertSpaces:K.insertSpaces};return Le.trimTrailingWhitespace&&(ri.trimTrailingWhitespace=!0),Le.trimFinalNewlines&&(ri.trimFinalNewlines=!0),Le.insertFinalNewline&&(ri.insertFinalNewline=!0),ri}function Fu(K){return{textDocument:s(K)}}function wc(K){return{textDocument:s(K)}}function Zh(K){let Le=Ms.DocumentLink.create(Oe(K.range));K.target&&(Le.target=i(K.target)),K.tooltip!==void 0&&(Le.tooltip=K.tooltip);let ri=K instanceof bri.default?K:void 0;return ri&&ri.data&&(Le.data=ri.data),Le}function bc(K){return{textDocument:s(K)}}function nr(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Fc(K.tags)),K instanceof Cri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Rs(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Fc(K.tags)),K instanceof yri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Ml(K){const Le=K instanceof Sri.default?{name:K.name,kind:Tl(K.kind),location:K.hasRange?Nt(K.location):{uri:t(K.location.uri)},data:K.data}:{name:K.name,kind:Tl(K.kind),location:Nt(K.location)};return K.tags!==void 0&&(Le.tags=Fc(K.tags)),K.containerName!==""&&(Le.containerName=K.containerName),Le}function Se(K){const Le=typeof K.label=="string"?K.label:K.label.map(Mo),ri=Ms.InlayHint.create(De(K.position),Le);return K.kind!==void 0&&(ri.kind=K.kind),K.textEdits!==void 0&&(ri.textEdits=el(K.textEdits)),K.tooltip!==void 0&&(ri.tooltip=cd(K.tooltip)),K.paddingLeft!==void 0&&(ri.paddingLeft=K.paddingLeft),K.paddingRight!==void 0&&(ri.paddingRight=K.paddingRight),K instanceof Ari.default&&K.data!==void 0&&(ri.data=K.data),ri}function Mo(K){const Le=Ms.InlayHintLabelPart.create(K.value);return K.location!==void 0&&(Le.location=Nt(K.location)),K.command!==void 0&&(Le.command=Ca(K.command)),K.tooltip!==void 0&&(Le.tooltip=cd(K.tooltip)),Le}function cd(K){return typeof K=="string"?K:{kind:Ms.MarkupKind.Markdown,value:K.value}}return{asUri:i,asTextDocumentIdentifier:s,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:w,asWillCreateFilesParams:b,asWillRenameFilesParams:C,asWillDeleteFilesParams:y,asTextDocumentPositionParams:S,asCompletionParams:k,asSignatureHelpParams:re,asWorkerPosition:me,asRange:Oe,asRanges:wt,asPosition:De,asPositions:Qe,asPositionsSync:Tt,asLocation:Nt,asDiagnosticSeverity:Yi,asDiagnosticTag:Gn,asDiagnostic:ys,asDiagnostics:mr,asDiagnosticsSync:ba,asCompletionItem:_c,asTextEdit:Yh,asSymbolKind:Tl,asSymbolTag:to,asSymbolTags:Fc,asReferenceParams:rd,asCodeAction:Jh,asCodeActionSync:Af,asCodeActionContext:tl,asCodeActionContextSync:Rl,asInlineValueContext:ad,asCommand:Ca,asCodeLens:Ld,asFormattingOptions:fh,asDocumentSymbolParams:Fu,asCodeLensParams:wc,asDocumentLink:Zh,asDocumentLinkParams:bc,asCallHierarchyItem:nr,asTypeHierarchyItem:Rs,asInlayHint:Se,asWorkspaceSymbol:Ml,asInlineCompletionParams:vc}}Nue.createConverter=Eri;var zue={};Object.defineProperty(zue,"__esModule",{value:!0});zue.createConverter=void 0;const li=as,Kn=Ts,dv=ea,kr=vu,xri=Pue,Dri=Fue,kri=Oue,Iri=Bue,gqe=tO,Lri=Wue,Tri=Hue,Rri=Uue,Mri=Vue,fqe=Ts;var qre;(function(n){function e(t){let i=t;return i&&dv.string(i.language)&&dv.string(i.value)}n.is=e})(qre||(qre={}));function Nri(n,e,t){const s=n||(L=>li.Uri.parse(L));function o(L){return s(L)}function r(L){const ne=[];for(const R of L)if(typeof R=="string")ne.push(R);else if(fqe.NotebookCellTextDocumentFilter.is(R))if(typeof R.notebook=="string")ne.push({notebookType:R.notebook,language:R.language});else{const H=R.notebook.notebookType??"*";ne.push({notebookType:H,scheme:R.notebook.scheme,pattern:R.notebook.pattern,language:R.language})}else fqe.TextDocumentFilter.is(R)&&ne.push({language:R.language,scheme:R.scheme,pattern:R.pattern});return ne}async function a(L,ne){return kr.map(L,l,ne)}function c(L){const ne=new Array(L.length);for(let R=0;R0?ne:void 0}function u(L){switch(L){case Kn.DiagnosticTag.Unnecessary:return li.DiagnosticTag.Unnecessary;case Kn.DiagnosticTag.Deprecated:return li.DiagnosticTag.Deprecated;default:return}}function f(L){return L?new li.Position(L.line,L.character):void 0}function p(L){return L?new li.Range(L.start.line,L.start.character,L.end.line,L.end.character):void 0}async function m(L,ne){return kr.map(L,R=>new li.Range(R.start.line,R.start.character,R.end.line,R.end.character),ne)}function v(L){if(L==null)return li.DiagnosticSeverity.Error;switch(L){case Kn.DiagnosticSeverity.Error:return li.DiagnosticSeverity.Error;case Kn.DiagnosticSeverity.Warning:return li.DiagnosticSeverity.Warning;case Kn.DiagnosticSeverity.Information:return li.DiagnosticSeverity.Information;case Kn.DiagnosticSeverity.Hint:return li.DiagnosticSeverity.Hint}return li.DiagnosticSeverity.Error}function w(L){if(dv.string(L))return C(L);if(qre.is(L))return C().appendCodeblock(L.value,L.language);if(Array.isArray(L)){let ne=[];for(let R of L){let H=C();qre.is(R)?H.appendCodeblock(R.value,R.language):H.appendMarkdown(R),ne.push(H)}return ne}else return C(L)}function b(L){if(dv.string(L))return L;switch(L.kind){case Kn.MarkupKind.Markdown:return C(L.value);case Kn.MarkupKind.PlainText:return L.value;default:return`Unsupported Markup content received. Kind is: ${L.kind}`}}function C(L){let ne;if(L===void 0||typeof L=="string")ne=new li.MarkdownString(L);else switch(L.kind){case Kn.MarkupKind.Markdown:ne=new li.MarkdownString(L.value);break;case Kn.MarkupKind.PlainText:ne=new li.MarkdownString,ne.appendText(L.value);break;default:ne=new li.MarkdownString,ne.appendText(`Unsupported Markup content received. Kind is: ${L.kind}`);break}return ne.isTrusted=e,ne.supportHtml=t,ne}function y(L){if(L)return new li.Hover(w(L.contents),p(L.range))}async function S(L,ne,R){if(!L)return;if(Array.isArray(L))return kr.map(L,is=>z(is,ne),R);const H=L,{defaultRange:ie,commitCharacters:je}=M(H,ne),pt=await kr.map(H.items,is=>z(is,je,ie,H.itemDefaults?.insertTextMode,H.itemDefaults?.insertTextFormat,H.itemDefaults?.data),R);return new li.CompletionList(pt,H.isIncomplete)}function M(L,ne){const R=L.itemDefaults?.editRange,H=L.itemDefaults?.commitCharacters??ne;return Kn.Range.is(R)?{defaultRange:p(R),commitCharacters:H}:R!==void 0?{defaultRange:{inserting:p(R.insert),replacing:p(R.replace)},commitCharacters:H}:{defaultRange:void 0,commitCharacters:H}}function k(L){return Kn.CompletionItemKind.Text<=L&&L<=Kn.CompletionItemKind.TypeParameter?[L-1,void 0]:[li.CompletionItemKind.Text,L]}function F(L){switch(L){case Kn.CompletionItemTag.Deprecated:return li.CompletionItemTag.Deprecated}}function N(L){if(L==null)return[];const ne=[];for(const R of L){const H=F(R);H!==void 0&&ne.push(H)}return ne}function z(L,ne,R,H,ie,je){const pt=N(L.tags),is=U(L),Ss=new xri.default(is);L.detail&&(Ss.detail=L.detail),L.documentation&&(Ss.documentation=b(L.documentation),Ss.documentationFormat=dv.string(L.documentation)?"$string":L.documentation.kind),L.filterText&&(Ss.filterText=L.filterText);const ld=J(L,R,ie);if(ld&&(Ss.insertText=ld.text,Ss.range=ld.range,Ss.fromEdit=ld.fromEdit),dv.number(L.kind)){let[Act,NBe]=k(L.kind);Ss.kind=Act,NBe&&(Ss.originalItemKind=NBe)}L.sortText&&(Ss.sortText=L.sortText),L.additionalTextEdits&&(Ss.additionalTextEdits=De(L.additionalTextEdits));const Eg=L.commitCharacters!==void 0?dv.stringArray(L.commitCharacters)?L.commitCharacters:void 0:ne;Eg&&(Ss.commitCharacters=Eg.slice()),L.command&&(Ss.command=el(L.command)),(L.deprecated===!0||L.deprecated===!1)&&(Ss.deprecated=L.deprecated,L.deprecated===!0&&pt.push(li.CompletionItemTag.Deprecated)),(L.preselect===!0||L.preselect===!1)&&(Ss.preselect=L.preselect);const Bw=L.data??je;Bw!==void 0&&(Ss.data=Bw),pt.length>0&&(Ss.tags=pt);const bge=L.insertTextMode??H;return bge!==void 0&&(Ss.insertTextMode=bge,bge===Kn.InsertTextMode.asIs&&(Ss.keepWhitespace=!0)),Ss}function U(L){return Kn.CompletionItemLabelDetails.is(L.labelDetails)?{label:L.label,detail:L.labelDetails.detail,description:L.labelDetails.description}:L.label}function J(L,ne,R){const H=L.insertTextFormat??R;if(L.textEdit!==void 0||ne!==void 0){const[ie,je]=L.textEdit!==void 0?j(L.textEdit):[ne,L.textEditText??L.label];return H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(je),range:ie,fromEdit:!0}:{text:je,range:ie,fromEdit:!0}}else return L.insertText?H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(L.insertText),fromEdit:!1}:{text:L.insertText,fromEdit:!1}:void 0}function j(L){return Kn.InsertReplaceEdit.is(L)?[{inserting:p(L.insert),replacing:p(L.replace)},L.newText]:[p(L.range),L.newText]}function re(L){if(L)return new li.TextEdit(p(L.range),L.newText)}async function me(L,ne){if(L)return kr.map(L,re,ne)}function De(L){if(!L)return;const ne=new Array(L.length);for(let R=0;R0){let R=[];for(let H of L.children)R.push(Qn(H));ne.children=R}return ne}function Yh(L,ne){L.tags=Hn(ne.tags),ne.deprecated&&(L.tags?L.tags.includes(li.SymbolTag.Deprecated)||(L.tags=L.tags.concat(li.SymbolTag.Deprecated)):L.tags=[li.SymbolTag.Deprecated])}function el(L){let ne={title:L.title,command:L.command};return L.arguments&&(ne.arguments=L.arguments),ne}async function Tl(L,ne){if(L)return kr.map(L,el,ne)}const to=new Map;to.set(Kn.CodeActionKind.Empty,li.CodeActionKind.Empty),to.set(Kn.CodeActionKind.QuickFix,li.CodeActionKind.QuickFix),to.set(Kn.CodeActionKind.Refactor,li.CodeActionKind.Refactor),to.set(Kn.CodeActionKind.RefactorExtract,li.CodeActionKind.RefactorExtract),to.set(Kn.CodeActionKind.RefactorInline,li.CodeActionKind.RefactorInline),to.set(Kn.CodeActionKind.RefactorRewrite,li.CodeActionKind.RefactorRewrite),to.set(Kn.CodeActionKind.Source,li.CodeActionKind.Source),to.set(Kn.CodeActionKind.SourceOrganizeImports,li.CodeActionKind.SourceOrganizeImports);function Fc(L){if(L==null)return;let ne=to.get(L);if(ne)return ne;let R=L.split(".");ne=li.CodeActionKind.Empty;for(let H of R)ne=ne.append(H);return ne}function rd(L){if(L!=null)return L.map(ne=>Fc(ne))}async function Jh(L,ne){if(L==null)return;let R=new Iri.default(L.title,L.data);return L.kind!==void 0&&(R.kind=Fc(L.kind)),L.diagnostics!==void 0&&(R.diagnostics=c(L.diagnostics)),L.edit!==void 0&&(R.edit=await Xh(L.edit,ne)),L.command!==void 0&&(R.command=el(L.command)),L.isPreferred!==void 0&&(R.isPreferred=L.isPreferred),L.disabled!==void 0&&(R.disabled={reason:L.disabled.reason}),R}function Af(L,ne){return kr.mapAsync(L,async R=>Kn.Command.is(R)?el(R):Jh(R,ne),ne)}function tl(L){if(!L)return;let ne=new Dri.default(p(L.range));return L.command&&(ne.command=el(L.command)),L.data!==void 0&&L.data!==null&&(ne.data=L.data),ne}async function Rl(L,ne){if(L)return kr.map(L,tl,ne)}async function Xh(L,ne){if(!L)return;const R=new Map;if(L.changeAnnotations!==void 0){const je=L.changeAnnotations;await kr.forEach(Object.keys(je),pt=>{const is=ul(je[pt]);R.set(pt,is)},ne)}const H=je=>{if(je!==void 0)return R.get(je)},ie=new li.WorkspaceEdit;if(L.documentChanges){const je=L.documentChanges;await kr.forEach(je,pt=>{if(Kn.CreateFile.is(pt))ie.createFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.RenameFile.is(pt))ie.renameFile(s(pt.oldUri),s(pt.newUri),pt.options,H(pt.annotationId));else if(Kn.DeleteFile.is(pt))ie.deleteFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.TextDocumentEdit.is(pt)){const is=s(pt.textDocument.uri);for(const Ss of pt.edits)Kn.AnnotatedTextEdit.is(Ss)?ie.replace(is,p(Ss.range),Ss.newText,H(Ss.annotationId)):ie.replace(is,p(Ss.range),Ss.newText)}else throw new Error(`Unknown workspace edit change received: -${JSON.stringify(pt,void 0,4)}`)},ne)}else if(L.changes){const je=L.changes;await kr.forEach(Object.keys(je),pt=>{ie.set(s(pt),De(je[pt]))},ne)}return ie}function ul(L){if(L!==void 0)return{label:L.label,needsConfirmation:!!L.needsConfirmation,description:L.description}}function ad(L){let ne=p(L.range),R=L.target?o(L.target):void 0,H=new kri.default(ne,R);return L.tooltip!==void 0&&(H.tooltip=L.tooltip),L.data!==void 0&&L.data!==null&&(H.data=L.data),H}async function vc(L,ne){if(L)return kr.map(L,ad,ne)}function Ca(L){return new li.Color(L.red,L.green,L.blue,L.alpha)}function Ld(L){return new li.ColorInformation(p(L.range),Ca(L.color))}async function fh(L,ne){if(L)return kr.map(L,Ld,ne)}function Fu(L){let ne=new li.ColorPresentation(L.label);return ne.additionalTextEdits=De(L.additionalTextEdits),L.textEdit&&(ne.textEdit=re(L.textEdit)),ne}async function wc(L,ne){if(L)return kr.map(L,Fu,ne)}function Zh(L){if(L)switch(L){case Kn.FoldingRangeKind.Comment:return li.FoldingRangeKind.Comment;case Kn.FoldingRangeKind.Imports:return li.FoldingRangeKind.Imports;case Kn.FoldingRangeKind.Region:return li.FoldingRangeKind.Region}}function bc(L){return new li.FoldingRange(L.startLine,L.endLine,Zh(L.kind))}async function nr(L,ne){if(L)return kr.map(L,bc,ne)}function Rs(L){return new li.SelectionRange(p(L.range),L.parent?Rs(L.parent):void 0)}async function Ml(L,ne){return Array.isArray(L)?kr.map(L,Rs,ne):[]}function Se(L){return Kn.InlineValueText.is(L)?new li.InlineValueText(p(L.range),L.text):Kn.InlineValueVariableLookup.is(L)?new li.InlineValueVariableLookup(p(L.range),L.variableName,L.caseSensitiveLookup):new li.InlineValueEvaluatableExpression(p(L.range),L.expression)}async function Mo(L,ne){return Array.isArray(L)?kr.map(L,Se,ne):[]}async function cd(L,ne){const R=typeof L.label=="string"?L.label:await kr.map(L.label,K,ne),H=new Mri.default(f(L.position),R);return L.kind!==void 0&&(H.kind=L.kind),L.textEdits!==void 0&&(H.textEdits=await me(L.textEdits,ne)),L.tooltip!==void 0&&(H.tooltip=Le(L.tooltip)),L.paddingLeft!==void 0&&(H.paddingLeft=L.paddingLeft),L.paddingRight!==void 0&&(H.paddingRight=L.paddingRight),L.data!==void 0&&(H.data=L.data),H}function K(L){const ne=new li.InlayHintLabelPart(L.value);return L.location!==void 0&&(ne.location=Yi(L.location)),L.tooltip!==void 0&&(ne.tooltip=Le(L.tooltip)),L.command!==void 0&&(ne.command=el(L.command)),ne}function Le(L){return typeof L=="string"?L:C(L)}async function ri(L,ne){if(Array.isArray(L))return kr.mapAsync(L,cd,ne)}function ts(L){if(L===null)return;const ne=new Lri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Os(L,ne){if(L!==null)return kr.map(L,ts,ne)}async function sr(L,ne){return new li.CallHierarchyIncomingCall(ts(L.from),await m(L.fromRanges,ne))}async function ya(L,ne){if(L!==null)return kr.mapAsync(L,sr,ne)}async function Cc(L,ne){return new li.CallHierarchyOutgoingCall(ts(L.to),await m(L.fromRanges,ne))}async function Ou(L,ne){if(L!==null)return kr.mapAsync(L,Cc,ne)}async function le(L,ne){if(L!=null)return new li.SemanticTokens(new Uint32Array(L.data),L.resultId)}function _r(L){return new li.SemanticTokensEdit(L.start,L.deleteCount,L.data!==void 0?new Uint32Array(L.data):void 0)}async function No(L,ne){if(L!=null)return new li.SemanticTokensEdits(L.edits.map(_r),L.resultId)}function mn(L){return L}async function ve(L,ne){if(L!=null)return new li.LinkedEditingRanges(await m(L.ranges,ne),ct(L.wordPattern))}function ct(L){if(L!=null)return new RegExp(L)}function Ht(L){if(L===null)return;let ne=new Tri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Ei(L,ne){if(L!==null)return kr.map(L,Ht,ne)}function Ut(L){if(dv.string(L))return L;if(Kn.RelativePattern.is(L)){if(Kn.URI.is(L.baseUri))return new li.RelativePattern(o(L.baseUri),L.pattern);if(Kn.WorkspaceFolder.is(L.baseUri)){const ne=li.workspace.getWorkspaceFolder(o(L.baseUri.uri));return ne!==void 0?new li.RelativePattern(ne,L.pattern):void 0}}}async function G(L,ne){if(!L)return;if(Array.isArray(L))return kr.map(L,ie=>de(ie),ne);const R=L,H=await kr.map(R.items,ie=>de(ie),ne);return new li.InlineCompletionList(H)}function de(L){let ne;typeof L.insertText=="string"?ne=L.insertText:ne=new li.SnippetString(L.insertText.value);let R;L.command&&(R=el(L.command));const H=new li.InlineCompletionItem(ne,p(L.range),R);return L.filterText&&(H.filterText=L.filterText),H}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:y,asCompletionResult:S,asCompletionItem:z,asTextEdit:re,asTextEdits:me,asSignatureHelp:Qe,asSignatureInformations:Tt,asSignatureInformation:Oe,asParameterInformations:wt,asParameterInformation:Nt,asDeclarationResult:Vi,asDefinitionResult:Gn,asLocation:Yi,asReferences:ec,asDocumentHighlights:ys,asDocumentHighlight:mr,asDocumentHighlightKind:ba,asSymbolKind:gs,asSymbolTag:ir,asSymbolTags:Hn,asSymbolInformations:ki,asSymbolInformation:_c,asDocumentSymbols:gh,asDocumentSymbol:Qn,asCommand:el,asCommands:Tl,asCodeAction:Jh,asCodeActionKind:Fc,asCodeActionKinds:rd,asCodeActionResult:Af,asCodeLens:tl,asCodeLenses:Rl,asWorkspaceEdit:Xh,asDocumentLink:ad,asDocumentLinks:vc,asFoldingRangeKind:Zh,asFoldingRange:bc,asFoldingRanges:nr,asColor:Ca,asColorInformation:Ld,asColorInformations:fh,asColorPresentation:Fu,asColorPresentations:wc,asSelectionRange:Rs,asSelectionRanges:Ml,asInlineValue:Se,asInlineValues:Mo,asInlayHint:cd,asInlayHints:ri,asSemanticTokensLegend:mn,asSemanticTokens:le,asSemanticTokensEdit:_r,asSemanticTokensEdits:No,asCallHierarchyItem:ts,asCallHierarchyItems:Os,asCallHierarchyIncomingCall:sr,asCallHierarchyIncomingCalls:ya,asCallHierarchyOutgoingCall:Cc,asCallHierarchyOutgoingCalls:Ou,asLinkedEditingRanges:ve,asTypeHierarchyItem:Ht,asTypeHierarchyItems:Ei,asGlobPattern:Ut,asInlineCompletionResult:G,asInlineCompletionItem:de}}zue.createConverter=Nri;var dj={};Object.defineProperty(dj,"__esModule",{value:!0});dj.ProgressPart=void 0;const pqe=as,mqe=Ts,_qe=ea;class Pri{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(mqe.WorkDoneProgress.type,this._token,s=>{switch(s.kind){case"begin":this.begin(s);break;case"report":this.report(s);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&pqe.window.withProgress({location:pqe.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,i)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=i,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(mqe.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((s,o)=>{this._resolve=s,this._reject=o})})}report(e){if(this._infinite&&_qe.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(_qe.number(e.percentage)){const t=Math.max(0,Math.min(e.percentage,100)),i=Math.max(0,t-this._reported);this._reported+=i,this._progress!==void 0&&this._progress.report({message:e.message,increment:i})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}}dj.ProgressPart=Pri;var $ue={};Object.defineProperty($ue,"__esModule",{value:!0});$ue.NotebookDocumentSyncFeature=void 0;const Og=as,Fri=Rue,qE=Ts,Ori=Er,vqe=ea;function wqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}var T2;(function(n){(function(e){function t(h,u){return{version:h.version,uri:u.asUri(h.uri)}}e.asVersionedNotebookDocumentIdentifier=t;function i(h,u,f){const p=qE.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,s(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function s(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=s;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=qE.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=o(h.metadata)),h.executionSummary!==void 0&&vqe.number(h.executionSummary.executionOrder)&&vqe.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case Og.NotebookCellKind.Markup:return qE.NotebookCellKind.Markup;case Og.NotebookCellKind.Code:return qE.NotebookCellKind.Code}}function c(h,u){if(h.has(u))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(u)){const f=[];for(const p of u)if(p!==null&&typeof p=="object"||Array.isArray(p))f.push(c(h,p));else{if(p instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");f.push(p)}return f}else{const f=Object.keys(u),p=Object.create(null);for(const m of f){const v=u[m];if(v!==null&&typeof v=="object"||Array.isArray(v))p[m]=c(h,v);else{if(v instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");p[m]=v}}return p}}function l(h,u){const f=u.asChangeTextDocumentParams(h,h.document.uri,h.document.version);return{document:f.textDocument,changes:f.contentChanges}}e.asTextContentChange=l;function d(h,u){const f=Object.create(null);if(h.metadata&&(f.metadata=n.c2p.asMetadata(h.metadata)),h.cells!==void 0){const p=Object.create(null),m=h.cells;m.structure&&(p.structure={array:{start:m.structure.array.start,deleteCount:m.structure.array.deleteCount,cells:m.structure.array.cells!==void 0?m.structure.array.cells.map(v=>n.c2p.asNotebookCell(v,u)):void 0},didOpen:m.structure.didOpen!==void 0?m.structure.didOpen.map(v=>u.asOpenTextDocumentParams(v.document).textDocument):void 0,didClose:m.structure.didClose!==void 0?m.structure.didClose.map(v=>u.asCloseTextDocumentParams(v.document).textDocument):void 0}),m.data!==void 0&&(p.data=m.data.map(v=>n.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>n.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(n.c2p||(n.c2p={}))})(T2||(T2={}));var xRe;(function(n){function e(a,c,l){const d=a.length,h=c.length;let u=0;for(;u=0&&p>=0&&t(a[f],c[p],l);)f--,p--;const m=f+1-u,v=u===p+1?void 0:c.slice(u,p+1);return v!==void 0?{start:u,deleteCount:m,cells:v}:{start:u,deleteCount:m}}else return ui.document.uri.toString()))}}n.create=e})(jre||(jre={}));class IY{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)),Og.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of Og.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);Og.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&Og.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),Og.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of Og.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return Og.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(Og.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),s=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(s&&o||!s&&!o)return;if(s){const r=this.getMatchingCells(e);if(r!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,r);a!==void 0&&this.doSendChange(a,r).catch(()=>{})}}}else s&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){Og.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){const i=this.notebookSyncInfo.get(e.uri.toString());if(i===void 0)return;const s=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===s.toString());if(o!==-1)if(o===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const r=i.cells.slice(),a=r.splice(o,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:o,deleteCount:1},didClose:a}}},r).catch(()=>{})}}dispose(){for(const e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),i=this.notebookSyncInfo.get(e.uri.toString())){if(i!==void 0)if(t!==void 0){const s=this.asNotebookDocumentChangeEvent(e,void 0,i,t);s!==void 0&&this.doSendChange(s,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){const t=e.notebook,i=this.notebookSyncInfo.get(t.uri.toString());if(i===void 0){if(e.contentChanges.length===0)return;const s=this.getMatchingCells(t);if(s===void 0)return;this.didOpen(t,s,i)}else{const s=this.getMatchingCells(t);if(s===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,s);o!==void 0&&this.doSendChange(o,s).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;const i=e.getCells().filter(s=>t.uris.has(s.document.uri.toString()));this.doSendClose(e,i).catch(()=>{})}async sendDidOpenNotebookDocument(e){const t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){const i=async(o,r)=>{const a=T2.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(qE.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),jre.create(t)),s?.didOpen!==void 0?s.didOpen(e,t,i):i(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){const i=async o=>{try{await this.client.sendNotification(qE.DidChangeNotebookDocumentNotification.type,{notebookDocument:T2.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:T2.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},s=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),jre.create(t??[])),s?.didChange!==void 0?s?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async s=>{try{await this.client.sendNotification(qE.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(s.uri)}})}catch(o){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",o),o}},i=this.client.middleware?.notebooks;return i?.didSave!==void 0?i.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){const i=async(o,r)=>{try{await this.client.sendNotification(qE.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(o.uri)},cellTextDocuments:r.map(a=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(a.document))})}catch(a){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",a),a}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),s?.didClose!==void 0?s.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,s){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=T2.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(s.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)r.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(o.cells=o.cells??{},o.cells.data=a)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&i!==void 0&&s!==void 0){const a=i.cells,c=s,l=xRe.computeDiff(a,c,!1);let d,h;if(l!==void 0){d=l.cells===void 0?new Map:new Map(l.cells.map(p=>[p.document.uri.toString(),p])),h=l.deleteCount===0?new Map:new Map(a.slice(l.start,l.start+l.deleteCount).map(p=>[p.document.uri.toString(),p]));for(const p of Array.from(h.keys()))d.has(p)&&(h.delete(p),d.delete(p));o.cells=o.cells??{};const u=[],f=[];if(d.size>0||h.size>0){for(const p of d.values())u.push(p);for(const p of h.values())f.push(p)}o.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(o).length>1?o:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(const i of this.options.notebookSelector)if(i.notebook===void 0||DRe.matchNotebook(i.notebook,e)){const s=this.filterCells(e,t,i.cells);return s.length===0?void 0:s}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const s=i!==void 0?t.filter(o=>{const r=o.document.languageId;return i.some(a=>a.language==="*"||r===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,s):s}}class FR{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=qE.NotebookDocumentSyncRegistrationType.type,Og.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didOpenNotebookCellTextDocument(i,s)}),Og.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==FR.CellScheme)return;const[s]=this.findNotebookDocumentAndCell(i);if(s!==void 0)for(const o of this.registrations.values())o instanceof IY&&o.didChangeNotebookCellTextDocument(s,t)}),Og.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didCloseNotebookCellTextDocument(i,s)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(const e of this.registrations.values()){const t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){const t=wqe(wqe(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??Ori.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new IY(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){const t=this.registrations.get(e);t&&t.dispose()}clear(){for(const e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==FR.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&Og.languages.match(this.dedicatedChannel,e)>0)return!0;for(const t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(const t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){const t=e.uri.toString();for(const i of Og.workspace.notebookDocuments)for(const s of i.getCells())if(s.document.uri.toString()===t)return[i,s];return[void 0,void 0]}}$ue.NotebookDocumentSyncFeature=FR;FR.CellScheme="vscode-notebook-cell";var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.SyncConfigurationFeature=n0.toJSONObject=n0.ConfigurationFeature=void 0;const dH=as,e$=Ts,Bri=ea,Wri=Er,bqe=$n;class Hri{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(e$.ConfigurationRequest.type,(t,i)=>{let s=r=>{let a=[];for(let c of r.items){let l=c.scopeUri!==void 0&&c.scopeUri!==null?this._client.protocol2CodeConverter.asUri(c.scopeUri):void 0;a.push(this.getConfiguration(l,c.section!==null?c.section:void 0))}return a},o=e.middleware.workspace;return o&&o.configuration?o.configuration(t,i,s):s(t)})}getConfiguration(e,t){let i=null;if(t){let s=t.lastIndexOf(".");if(s===-1)i=JM(dH.workspace.getConfiguration(void 0,e).get(t));else{let o=dH.workspace.getConfiguration(t.substr(0,s),e);o&&(i=JM(o.get(t.substr(s+1))))}}else{let s=dH.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(s))s.has(o)&&(i[o]=JM(s.get(o)))}return i===void 0&&(i=null),i}clear(){}}n0.ConfigurationFeature=Hri;function JM(n){if(n){if(Array.isArray(n))return n.map(JM);if(typeof n=="object"){const e=Object.create(null);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=JM(n[t]));return e}}return n}n0.toJSONObject=JM;class Uri{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return e$.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,bqe.ensure)((0,bqe.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Wri.generateUuid(),registerOptions:{section:e}})}register(e){let t=dH.workspace.onDidChangeConfiguration(i=>{this.onDidChangeConfiguration(e.registerOptions.section,i)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(const e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let i;if(Bri.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const s=async r=>r===void 0?this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,s):s(i)).catch(r=>{this._client.error(`Sending notification ${e$.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=dH.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=dH.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(s,l)[l[l.length-1]]=JM(c)}}return s}}n0.SyncConfigurationFeature=Uri;var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.DidSaveTextDocumentFeature=tm.WillSaveWaitUntilFeature=tm.WillSaveFeature=tm.DidChangeTextDocumentFeature=tm.DidCloseTextDocumentFeature=tm.DidOpenTextDocumentFeature=void 0;const g_=as,rc=Ts,Al=$n,Xz=Er;class Vri extends Al.TextDocumentEventFeature{constructor(e,t){super(e,g_.workspace.onDidOpenTextDocument,rc.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return rc.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);g_.workspace.textDocuments.forEach(i=>{const s=i.uri.toString();if(!this._syncedDocuments.has(s)&&g_.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));(o.didOpen?o.didOpen(i,r):r(i)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)}),this._syncedDocuments.set(s,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}tm.DidOpenTextDocumentFeature=Vri;class zri extends Al.TextDocumentEventFeature{constructor(e,t,i){super(e,g_.workspace.onDidCloseTextDocument,rc.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,s=>e.code2ProtocolConverter.asCloseTextDocumentParams(s),s=>s,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return rc.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,i)}unregister(e){const t=this._selectors.get(e);super.unregister(e);const i=this._selectors.values();this._syncedDocuments.forEach(s=>{if(g_.languages.match(t,s)>0&&!this._selectorFilter(i,s)&&!this._client.hasDedicatedTextSynchronizationFeature(s)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(s.uri.toString()),(o.didClose?o.didClose(s,r):r(s)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}tm.DidCloseTextDocumentFeature=zri;class $ri extends Al.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new g_.EventEmitter,this._onPendingChangeAdded=new g_.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=rc.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return rc.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==rc.TextDocumentSyncKind.None&&this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=g_.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(const e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;const t=e.document.uri,i=e.document.version,s=[];for(const o of this._changeData.values())if(g_.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===rc.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(rc.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,rc.DidChangeTextDocumentNotification.type,l)};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===rc.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(s).then(void 0,o=>{throw this._client.error(`Sending document notification ${rc.DidChangeTextDocumentNotification.type.method} failed`,o),o})}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=rc.TextDocumentSyncKind.None;else{this._syncKind=rc.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===rc.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=rc.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(const i of this._pendingTextDocumentChanges)e.has(i[0])||(t.push(i[1]),this._pendingTextDocumentChanges.delete(i[0]))}return t}getProvider(e){for(const t of this._changeData.values())if(g_.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==rc.TextDocumentSyncKind.Full)switch(e){case rc.TextDocumentSyncKind.Full:this._syncKind=e;break;case rc.TextDocumentSyncKind.Incremental:this._syncKind===rc.TextDocumentSyncKind.None&&(this._syncKind=rc.TextDocumentSyncKind.Incremental);break}}}tm.DidChangeTextDocumentFeature=$ri;class Gri extends Al.TextDocumentEventFeature{constructor(e){super(e,g_.workspace.onWillSaveTextDocument,rc.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Al.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return rc.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}tm.WillSaveFeature=Gri;class qri extends Al.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return rc.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=g_.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Al.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=s=>this._client.sendRequest(rc.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(s)).then(async o=>{let r=await this._client.protocol2CodeConverter.asTextEdits(o);return r===void 0?[]:r});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}}tm.WillSaveWaitUntilFeature=qri;class Qri extends Al.TextDocumentEventFeature{constructor(e){super(e,g_.workspace.onDidSaveTextDocument,rc.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Al.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return rc.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const s=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},s)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}tm.DidSaveTextDocumentFeature=Qri;var Gue={};Object.defineProperty(Gue,"__esModule",{value:!0});Gue.CompletionItemFeature=void 0;const jri=as,Go=Ts,Nme=$n,Kri=Er,Yri=[Go.CompletionItemKind.Text,Go.CompletionItemKind.Method,Go.CompletionItemKind.Function,Go.CompletionItemKind.Constructor,Go.CompletionItemKind.Field,Go.CompletionItemKind.Variable,Go.CompletionItemKind.Class,Go.CompletionItemKind.Interface,Go.CompletionItemKind.Module,Go.CompletionItemKind.Property,Go.CompletionItemKind.Unit,Go.CompletionItemKind.Value,Go.CompletionItemKind.Enum,Go.CompletionItemKind.Keyword,Go.CompletionItemKind.Snippet,Go.CompletionItemKind.Color,Go.CompletionItemKind.File,Go.CompletionItemKind.Reference,Go.CompletionItemKind.Folder,Go.CompletionItemKind.EnumMember,Go.CompletionItemKind.Constant,Go.CompletionItemKind.Struct,Go.CompletionItemKind.Event,Go.CompletionItemKind.Operator,Go.CompletionItemKind.TypeParameter];class Jri extends Nme.TextDocumentLanguageFeature{constructor(e){super(e,Go.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Nme.ensure)((0,Nme.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[Go.MarkupKind.Markdown,Go.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[Go.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[Go.InsertTextMode.asIs,Go.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=Go.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Yri},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:Kri.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],s=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,w)=>h.sendRequest(Go.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),w).then(b=>w.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(b,s,w),b=>h.handleFailedRequest(Go.CompletionRequest.type,w,b,null));return u.provideCompletionItem?u.provideCompletionItem(a,c,d,l,f):f(a,c,d,l)},resolveCompletionItem:e.resolveProvider?(a,c)=>{const l=this._client,d=this._client.middleware,h=(u,f)=>l.sendRequest(Go.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(Go.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[jri.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}Gue.CompletionItemFeature=Jri;var que={};Object.defineProperty(que,"__esModule",{value:!0});que.HoverFeature=void 0;const Xri=as,K5=Ts,Pme=$n,Zri=Er;class eai extends Pme.TextDocumentLanguageFeature{constructor(e){super(e,K5.HoverRequest.type)}fillClientCapabilities(e){const t=(0,Pme.ensure)((0,Pme.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[K5.MarkupKind.Markdown,K5.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:Zri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(K5.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(K5.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Xri.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}que.HoverFeature=eai;var Que={};Object.defineProperty(Que,"__esModule",{value:!0});Que.DefinitionFeature=void 0;const tai=as,Fme=Ts,Ome=$n,iai=Er;class nai extends Ome.TextDocumentLanguageFeature{constructor(e){super(e,Fme.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Ome.ensure)((0,Ome.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:iai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Fme.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Fme.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return tai.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Que.DefinitionFeature=nai;var jue={};Object.defineProperty(jue,"__esModule",{value:!0});jue.SignatureHelpFeature=void 0;const Cqe=as,Y5=Ts,Bme=$n,sai=Er;class oai extends Bme.TextDocumentLanguageFeature{constructor(e){super(e,Y5.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Bme.ensure)((0,Bme.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[Y5.MarkupKind.Markdown,Y5.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.signatureHelpProvider);i&&this.register({id:sai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,s,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(Y5.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(Y5.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,s,r,o,c):c(i,s,r,o)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){const i=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){const s=e.triggerCharacters||[];return Cqe.languages.registerSignatureHelpProvider(i,t,...s)}else{const s={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return Cqe.languages.registerSignatureHelpProvider(i,t,s)}}}jue.SignatureHelpFeature=oai;var Kue={};Object.defineProperty(Kue,"__esModule",{value:!0});Kue.DocumentHighlightFeature=void 0;const rai=as,Wme=Ts,Hme=$n,aai=Er;class cai extends Hme.TextDocumentLanguageFeature{constructor(e){super(e,Wme.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Hme.ensure)((0,Hme.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:aai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Wme.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(Wme.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(s,o,r,c):c(s,o,r)}};return[rai.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Kue.DocumentHighlightFeature=cai;var pBe={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DocumentSymbolFeature=n.SupportedSymbolTags=n.SupportedSymbolKinds=void 0;const e=as,t=Ts,i=$n,s=Er;n.SupportedSymbolKinds=[t.SymbolKind.File,t.SymbolKind.Module,t.SymbolKind.Namespace,t.SymbolKind.Package,t.SymbolKind.Class,t.SymbolKind.Method,t.SymbolKind.Property,t.SymbolKind.Field,t.SymbolKind.Constructor,t.SymbolKind.Enum,t.SymbolKind.Interface,t.SymbolKind.Function,t.SymbolKind.Variable,t.SymbolKind.Constant,t.SymbolKind.String,t.SymbolKind.Number,t.SymbolKind.Boolean,t.SymbolKind.Array,t.SymbolKind.Object,t.SymbolKind.Key,t.SymbolKind.Null,t.SymbolKind.EnumMember,t.SymbolKind.Struct,t.SymbolKind.Event,t.SymbolKind.Operator,t.SymbolKind.TypeParameter],n.SupportedSymbolTags=[t.SymbolTag.Deprecated];class o extends i.TextDocumentLanguageFeature{constructor(a){super(a,t.DocumentSymbolRequest.type)}fillClientCapabilities(a){let c=(0,i.ensure)((0,i.ensure)(a,"textDocument"),"documentSymbol");c.dynamicRegistration=!0,c.symbolKind={valueSet:n.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:n.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:s.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,w)=>{try{const b=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),w);if(w.isCancellationRequested||b===void 0||b===null)return null;if(b.length===0)return[];{const C=b[0];return t.DocumentSymbol.is(C)?await f.protocol2CodeConverter.asDocumentSymbols(b,w):await f.protocol2CodeConverter.asSymbolInformations(b,w)}}catch(b){return f.handleFailedRequest(t.DocumentSymbolRequest.type,w,b,null)}},m=f.middleware;return m.provideDocumentSymbols?m.provideDocumentSymbols(h,u,p):p(h,u)}},d=a.label!==void 0?{label:a.label}:void 0;return[e.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(c),l,d),l]}}n.DocumentSymbolFeature=o})(pBe);var Yue={};Object.defineProperty(Yue,"__esModule",{value:!0});Yue.WorkspaceSymbolFeature=void 0;const lai=as,J5=Ts,Ume=$n,yqe=pBe,dai=Er;class hai extends Ume.WorkspaceFeature{constructor(e){super(e,J5.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Ume.ensure)((0,Ume.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:yqe.SupportedSymbolKinds},t.tagSupport={valueSet:yqe.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:dai.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(J5.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,s,r):r(i,s)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(J5.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,s,r):r(i,s)}:void 0};return[lai.languages.registerWorkspaceSymbolProvider(t),t]}}Yue.WorkspaceSymbolFeature=hai;var Jue={};Object.defineProperty(Jue,"__esModule",{value:!0});Jue.ReferencesFeature=void 0;const uai=as,Vme=Ts,zme=$n,gai=Er;class fai extends zme.TextDocumentLanguageFeature{constructor(e){super(e,Vme.ReferencesRequest.type)}fillClientCapabilities(e){(0,zme.ensure)((0,zme.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:gai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(Vme.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(Vme.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(s,o,r,a,l):l(s,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return uai.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Jue.ReferencesFeature=fai;var Xue={};Object.defineProperty(Xue,"__esModule",{value:!0});Xue.CodeActionFeature=void 0;const pai=as,Wm=Ts,mai=Er,$me=$n;class _ai extends $me.TextDocumentLanguageFeature{constructor(e){super(e,Wm.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,$me.ensure)((0,$me.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Wm.CodeActionKind.Empty,Wm.CodeActionKind.QuickFix,Wm.CodeActionKind.Refactor,Wm.CodeActionKind.RefactorExtract,Wm.CodeActionKind.RefactorInline,Wm.CodeActionKind.RefactorRewrite,Wm.CodeActionKind.Source,Wm.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:mai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(s,o,r,a)=>{const c=this._client,l=async(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),context:c.code2ProtocolConverter.asCodeActionContextSync(f)};return c.sendRequest(Wm.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Wm.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(s,o,r,a,l):l(s,o,r,a)},resolveCodeAction:e.resolveProvider?(s,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(Wm.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(Wm.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(s,o,c):c(s,o)}:void 0};return[pai.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}Xue.CodeActionFeature=_ai;var Zue={};Object.defineProperty(Zue,"__esModule",{value:!0});Zue.CodeLensFeature=void 0;const Sqe=as,hB=Ts,vai=Er,X5=$n;class wai extends X5.TextDocumentLanguageFeature{constructor(e){super(e,hB.CodeLensRequest.type)}fillClientCapabilities(e){(0,X5.ensure)((0,X5.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,X5.ensure)((0,X5.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(hB.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const s=this.getRegistrationOptions(t,e.codeLensProvider);s&&this.register({id:vai.generateUuid(),registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Sqe.EventEmitter,s={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(hB.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(o,r,c):c(o,r)},resolveCodeLens:e.resolveProvider?(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(hB.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[Sqe.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeCodeLensEmitter:i}]}}Zue.CodeLensFeature=wai;var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.DocumentOnTypeFormattingFeature=s0.DocumentRangeFormattingFeature=s0.DocumentFormattingFeature=void 0;const ege=as,Rb=Ts,mBe=Er,Lx=$n;var sz;(function(n){function e(t){const i=ege.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}n.fromConfiguration=e})(sz||(sz={}));class bai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,sz.fromConfiguration(d))};return a.sendRequest(Rb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(Rb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(s,o,r,c):c(s,o,r)}};return[ege.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentFormattingFeature=bai;class Cai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(s,o,r,a,l):l(s,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:c.code2ProtocolConverter.asRanges(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(s,o,r,a,l):l(s,o,r,a)}),[ege.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentRangeFormattingFeature=Cai;class yai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(o,r,a,c,l)=>{const d=this._client,h=(f,p,m,v,w)=>{let b={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,sz.fromConfiguration(f))};return d.sendRequest(Rb.DocumentOnTypeFormattingRequest.type,b,w).then(C=>w.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(C,w),C=>d.handleFailedRequest(Rb.DocumentOnTypeFormattingRequest.type,w,C,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},s=e.moreTriggerCharacter||[];return[ege.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...s),i]}}s0.DocumentOnTypeFormattingFeature=yai;var tge={};Object.defineProperty(tge,"__esModule",{value:!0});tge.RenameFeature=void 0;const Sai=as,BL=Ts,Aai=Er,Aqe=ea,Gme=$n;class Eai extends Gme.TextDocumentLanguageFeature{constructor(e){super(e,BL.RenameRequest.type)}fillClientCapabilities(e){let t=(0,Gme.ensure)((0,Gme.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=BL.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(Aqe.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Aai.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{let m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),position:c.code2ProtocolConverter.asPosition(u),newName:f};return c.sendRequest(BL.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(BL.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(s,o,r,a,l):l(s,o,r,a)},prepareRename:e.prepareProvider?(s,o,r)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(BL.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:BL.Range.is(p)?a.protocol2CodeConverter.asRange(p):this.isDefaultBehavior(p)?p.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):p&&BL.Range.is(p.range)?{range:a.protocol2CodeConverter.asRange(p.range),placeholder:p.placeholder}:Promise.reject(new Error("The element can't be renamed.")),p=>{throw typeof p.message=="string"?new Error(p.message):new Error("The element can't be renamed.")})},l=a.middleware;return l.prepareRename?l.prepareRename(s,o,r,c):c(s,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Sai.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&Aqe.boolean(t.defaultBehavior)}}tge.RenameFeature=Eai;var ige={};Object.defineProperty(ige,"__esModule",{value:!0});ige.DocumentLinkFeature=void 0;const xai=as,Z5=Ts,qme=$n,Dai=Er;class kai extends qme.TextDocumentLanguageFeature{constructor(e){super(e,Z5.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,qme.ensure)((0,qme.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:Dai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(s,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(Z5.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(Z5.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(s,o,a):a(s,o)},resolveDocumentLink:e.resolveProvider?(s,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(Z5.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(Z5.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(s,o,a):a(s,o)}:void 0};return[xai.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}ige.DocumentLinkFeature=kai;var nge={};Object.defineProperty(nge,"__esModule",{value:!0});nge.ExecuteCommandFeature=void 0;const Iai=as,Qme=Ts,Lai=Er,Eqe=$n;class Tai{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return Qme.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Eqe.ensure)((0,Eqe.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Lai.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,s=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(Qme.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(Qme.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Iai.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,s):s(r,a)));this._commands.set(e.id,o)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}}nge.ExecuteCommandFeature=Tai;var sge={};Object.defineProperty(sge,"__esModule",{value:!0});sge.FileSystemWatcherFeature=void 0;const Rai=as,WL=Ts,LY=$n;class Mai{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return WL.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;const t=[];for(const i of e.registerOptions.watchers){const s=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(s===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&WL.WatchKind.Create)!==0,r=(i.kind&WL.WatchKind.Change)!==0,a=(i.kind&WL.WatchKind.Delete)!==0);const c=Rai.workspace.createFileSystemWatcher(s,!o,!r,!a);this.hookListeners(c,o,r,a,t),t.push(c)}this._watchers.set(e.id,t)}registerRaw(e,t){let i=[];for(let s of t)this.hookListeners(s,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,s,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Changed}),null,o),s&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}sge.FileSystemWatcherFeature=Mai;var oge={};Object.defineProperty(oge,"__esModule",{value:!0});oge.ColorProviderFeature=void 0;const Nai=as,e3=Ts,jme=$n;class Pai extends jme.TextDocumentLanguageFeature{constructor(e){super(e,e3.DocumentColorRequest.type)}fillClientCapabilities(e){(0,jme.ensure)((0,jme.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.colorProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={color:d,textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:a.code2ProtocolConverter.asRange(h.range)};return a.sendRequest(e3.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(e3.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(s,o,r,c):c(s,o,r)},provideDocumentColors:(s,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(e3.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(e3.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(s,o,a):a(s,o)}};return[Nai.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}oge.ColorProviderFeature=Pai;var rge={};Object.defineProperty(rge,"__esModule",{value:!0});rge.ImplementationFeature=void 0;const Fai=as,Kme=Ts,Yme=$n;class Oai extends Yme.TextDocumentLanguageFeature{constructor(e){super(e,Kme.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Yme.ensure)((0,Yme.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.implementationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Kme.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Kme.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Fai.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rge.ImplementationFeature=Oai;var age={};Object.defineProperty(age,"__esModule",{value:!0});age.TypeDefinitionFeature=void 0;const Bai=as,Jme=Ts,t3=$n;class Wai extends t3.TextDocumentLanguageFeature{constructor(e){super(e,Jme.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.typeDefinitionProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Jme.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Jme.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Bai.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}age.TypeDefinitionFeature=Wai;var oz={};Object.defineProperty(oz,"__esModule",{value:!0});oz.WorkspaceFoldersFeature=oz.arrayDiff=void 0;const Hai=Er,TY=as,i3=Ts;function Xme(n,e){if(n!=null)return n[e]}function kRe(n,e){return n.filter(t=>e.indexOf(t)<0)}oz.arrayDiff=kRe;class Uai{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return i3.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=TY.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){const t=this._client;t.onRequest(i3.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=TY.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(o,r):r()});const i=Xme(Xme(Xme(e,"workspace"),"workspaceFolders"),"changeNotifications");let s;typeof i=="string"?s=i:i===!0&&(s=Hai.generateUuid()),s&&this.register({id:s,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=kRe(this._initialFolders,e),s=kRe(e,this._initialFolders);(s.length>0||i.length>0)&&(t=this.doSendEvent(s,i))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(i=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(s=>this.asProtocol(s)),removed:t.map(s=>this.asProtocol(s))}};return this._client.sendNotification(i3.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,s=TY.workspace.onDidChangeWorkspaceFolders(o=>{let r=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(o,r):r(o)).catch(l=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,s),this.sendInitialEvent(TY.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}oz.WorkspaceFoldersFeature=Uai;var cge={};Object.defineProperty(cge,"__esModule",{value:!0});cge.FoldingRangeFeature=void 0;const xqe=as,HL=Ts,n3=$n;class Vai extends n3.TextDocumentLanguageFeature{constructor(e){super(e,HL.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,n3.ensure)((0,n3.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[HL.FoldingRangeKind.Comment,HL.FoldingRangeKind.Imports,HL.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,n3.ensure)((0,n3.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(HL.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,s]=this.getRegistration(t,e.foldingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new xqe.EventEmitter,s={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(o,r,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(HL.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(HL.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[xqe.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeFoldingRange:i}]}}cge.FoldingRangeFeature=Vai;var lge={};Object.defineProperty(lge,"__esModule",{value:!0});lge.DeclarationFeature=void 0;const zai=as,Zme=Ts,e_e=$n;class $ai extends e_e.TextDocumentLanguageFeature{constructor(e){super(e,Zme.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,e_e.ensure)((0,e_e.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.declarationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Zme.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Zme.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return zai.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lge.DeclarationFeature=$ai;var dge={};Object.defineProperty(dge,"__esModule",{value:!0});dge.SelectionRangeFeature=void 0;const Gai=as,t_e=Ts,i_e=$n;class qai extends i_e.TextDocumentLanguageFeature{constructor(e){super(e,t_e.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,i_e.ensure)((0,i_e.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.selectionRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(s,o,r)=>{const a=this._client,c=async(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),positions:a.code2ProtocolConverter.asPositionsSync(h,u)};return a.sendRequest(t_e.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(t_e.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Gai.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}dge.SelectionRangeFeature=qai;var hge={};Object.defineProperty(hge,"__esModule",{value:!0});hge.ProgressFeature=void 0;const Dqe=Ts,Qai=dj;function jai(n,e){return n[e]===void 0&&(n[e]=Object.create(null)),n[e]}class Kai{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:Dqe.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){jai(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=s=>{this.activeParts.delete(s)},i=s=>{this.activeParts.add(new Qai.ProgressPart(this._client,s.token,t))};e.onRequest(Dqe.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}hge.ProgressFeature=Kai;var uge={};Object.defineProperty(uge,"__esModule",{value:!0});uge.CallHierarchyFeature=void 0;const Yai=as,gT=Ts,n_e=$n;class Jai{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(gT.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>s.handleFailedRequest(gT.CallHierarchyPrepareRequest.type,l,h,null))};return o.prepareCallHierarchy?o.prepareCallHierarchy(e,t,i,r):r(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyIncomingCallsRequest.type,a,l,null))};return s.provideCallHierarchyIncomingCalls?s.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return s.provideCallHierarchyOutgoingCalls?s.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class Xai extends n_e.TextDocumentLanguageFeature{constructor(e){super(e,gT.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,n_e.ensure)((0,n_e.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.callHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new Jai(t);return[Yai.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}uge.CallHierarchyFeature=Xai;var gge={};Object.defineProperty(gge,"__esModule",{value:!0});gge.SemanticTokensFeature=void 0;const RY=as,Bs=Ts,s3=$n,Zai=ea;class eci extends s3.TextDocumentLanguageFeature{constructor(e){super(e,Bs.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,s3.ensure)((0,s3.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Bs.SemanticTokenTypes.namespace,Bs.SemanticTokenTypes.type,Bs.SemanticTokenTypes.class,Bs.SemanticTokenTypes.enum,Bs.SemanticTokenTypes.interface,Bs.SemanticTokenTypes.struct,Bs.SemanticTokenTypes.typeParameter,Bs.SemanticTokenTypes.parameter,Bs.SemanticTokenTypes.variable,Bs.SemanticTokenTypes.property,Bs.SemanticTokenTypes.enumMember,Bs.SemanticTokenTypes.event,Bs.SemanticTokenTypes.function,Bs.SemanticTokenTypes.method,Bs.SemanticTokenTypes.macro,Bs.SemanticTokenTypes.keyword,Bs.SemanticTokenTypes.modifier,Bs.SemanticTokenTypes.comment,Bs.SemanticTokenTypes.string,Bs.SemanticTokenTypes.number,Bs.SemanticTokenTypes.regexp,Bs.SemanticTokenTypes.operator,Bs.SemanticTokenTypes.decorator],t.tokenModifiers=[Bs.SemanticTokenModifiers.declaration,Bs.SemanticTokenModifiers.definition,Bs.SemanticTokenModifiers.readonly,Bs.SemanticTokenModifiers.static,Bs.SemanticTokenModifiers.deprecated,Bs.SemanticTokenModifiers.abstract,Bs.SemanticTokenModifiers.async,Bs.SemanticTokenModifiers.modification,Bs.SemanticTokenModifiers.documentation,Bs.SemanticTokenModifiers.defaultLibrary],t.formats=[Bs.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,s3.ensure)((0,s3.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Bs.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[s,o]=this.getRegistration(t,e.semanticTokensProvider);!s||!o||this.register({id:s,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=Zai.boolean(e.full)?e.full:e.full!==void 0,s=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new RY.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,w=(b,C)=>{const y={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(b)};return m.sendRequest(Bs.SemanticTokensRequest.type,y,C).then(S=>C.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(S,C),S=>m.handleFailedRequest(Bs.SemanticTokensRequest.type,C,S,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,w):w(f,p)},provideDocumentSemanticTokensEdits:s?(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),previousResultId:y};return v.sendRequest(Bs.SemanticTokensDeltaRequest.type,M,S).then(async k=>S.isCancellationRequested?null:Bs.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,S):await v.protocol2CodeConverter.asSemanticTokensEdits(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensDeltaRequest.type,S,k,null))};return w.provideDocumentSemanticTokensEdits?w.provideDocumentSemanticTokensEdits(f,p,m,b):b(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),range:v.code2ProtocolConverter.asRange(y)};return v.sendRequest(Bs.SemanticTokensRangeRequest.type,M,S).then(k=>S.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensRangeRequest.type,S,k,null))};return w.provideDocumentRangeSemanticTokens?w.provideDocumentRangeSemanticTokens(f,p,m,b):b(f,p,m)}}:void 0,l=[],d=this._client,h=d.protocol2CodeConverter.asSemanticTokensLegend(e.legend),u=d.protocol2CodeConverter.asDocumentSelector(t);return r!==void 0&&l.push(RY.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(RY.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new RY.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}gge.SemanticTokensFeature=eci;var im={};Object.defineProperty(im,"__esModule",{value:!0});im.WillDeleteFilesFeature=im.WillRenameFilesFeature=im.WillCreateFilesFeature=im.DidDeleteFilesFeature=im.DidRenameFilesFeature=im.DidCreateFilesFeature=void 0;const Jv=as,tci=Rue,Tx=Ts,ici=Er;function kqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}function nci(n,e){return n[e]}function Iqe(n,e,t){n[e]=t}class XM{constructor(e,t,i,s,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=s,this._serverCapability=o,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){const t=kqe(kqe(e,"workspace"),"fileOperations");Iqe(t,"dynamicRegistration",!0),Iqe(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?nci(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:ici.generateUuid(),registerOptions:{filters:i.filters}})}catch(s){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${s}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const s=new tci.Minimatch(i.pattern.glob,XM.asMinimatchOptions(i.pattern.options));if(!s.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:s,kind:i.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return XM.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async o=>{const r=t(o),a=r.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==r.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(r);if(d===void 0)return this._client.error(`Failed to determine file type for ${r.toString()}.`),!0;if(d===Jv.FileType.File&&l.kind===Tx.FileOperationPatternKind.file||d===Jv.FileType.Directory&&l.kind===Tx.FileOperationPatternKind.folder)return!0}else if(l.kind===Tx.FileOperationPatternKind.folder&&await XM.getFileType(r)===Jv.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),s=e.files.filter((o,r)=>i[r]);return{...e,files:s}}static async getFileType(e){try{return(await Jv.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class wct extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._notificationType=i,this._accessUri=r,this._createParams=a}async send(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=async s=>this._client.sendNotification(this._notificationType,this._createParams(s));return this.doSend(t,i)}}}class bct extends wct{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){const t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);const i=await XM.getFileType(e);return i&&this._fsPathFileTypes.set(t,i),i}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}}class sci extends wct{constructor(e){super(e,Jv.workspace.onDidCreateFiles,Tx.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.didCreateFiles?i.didCreateFiles(e,t):t(e)}}im.DidCreateFilesFeature=sci;class oci extends bct{constructor(e){super(e,Jv.workspace.onDidRenameFiles,Tx.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didRenameFiles?i.didRenameFiles(e,t):t(e)}}im.DidRenameFilesFeature=oci;class rci extends bct{constructor(e){super(e,Jv.workspace.onDidDeleteFiles,Tx.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didDeleteFiles?i.didDeleteFiles(e,t):t(e)}}im.DidDeleteFilesFeature=rci;class _Be extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._requestType=i,this._accessUri=r,this._createParams=a}async send(e){const t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=s=>this._client.sendRequest(this._requestType,this._createParams(s),s.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class aci extends _Be{constructor(e){super(e,Jv.workspace.onWillCreateFiles,Tx.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willCreateFiles?i.willCreateFiles(e,t):t(e)}}im.WillCreateFilesFeature=aci;class cci extends _Be{constructor(e){super(e,Jv.workspace.onWillRenameFiles,Tx.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willRenameFiles?i.willRenameFiles(e,t):t(e)}}im.WillRenameFilesFeature=cci;class lci extends _Be{constructor(e){super(e,Jv.workspace.onWillDeleteFiles,Tx.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willDeleteFiles?i.willDeleteFiles(e,t):t(e)}}im.WillDeleteFilesFeature=lci;var fge={};Object.defineProperty(fge,"__esModule",{value:!0});fge.LinkedEditingFeature=void 0;const dci=as,s_e=Ts,o_e=$n;class hci extends o_e.TextDocumentLanguageFeature{constructor(e){super(e,s_e.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,o_e.ensure)((0,o_e.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(s_e.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(s_e.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return dci.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}fge.LinkedEditingFeature=hci;var pge={};Object.defineProperty(pge,"__esModule",{value:!0});pge.TypeHierarchyFeature=void 0;const uci=as,fT=Ts,r_e=$n;class gci{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(fT.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>s.handleFailedRequest(fT.TypeHierarchyPrepareRequest.type,l,h,null))};return o.prepareTypeHierarchy?o.prepareTypeHierarchy(e,t,i,r):r(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySupertypesRequest.type,a,l,null))};return s.provideTypeHierarchySupertypes?s.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySubtypesRequest.type,a,l,null))};return s.provideTypeHierarchySubtypes?s.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class fci extends r_e.TextDocumentLanguageFeature{constructor(e){super(e,fT.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,r_e.ensure)((0,r_e.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.typeHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new gci(t);return[uci.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}pge.TypeHierarchyFeature=fci;var mge={};Object.defineProperty(mge,"__esModule",{value:!0});mge.InlineValueFeature=void 0;const Lqe=as,MY=Ts,o3=$n;class pci extends o3.TextDocumentLanguageFeature{constructor(e){super(e,MY.InlineValueRequest.type)}fillClientCapabilities(e){(0,o3.ensure)((0,o3.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,o3.ensure)((0,o3.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(MY.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,s]=this.getRegistration(t,e.inlineValueProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Lqe.EventEmitter,s={onDidChangeInlineValues:i.event,provideInlineValues:(o,r,a,c)=>{const l=this._client,d=(u,f,p,m)=>{const v={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(u),range:l.code2ProtocolConverter.asRange(f),context:l.code2ProtocolConverter.asInlineValueContext(p)};return l.sendRequest(MY.InlineValueRequest.type,v,m).then(w=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(w,m),w=>l.handleFailedRequest(MY.InlineValueRequest.type,m,w,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,s),{provider:s,onDidChangeInlineValues:i}]}registerProvider(e,t){return Lqe.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}mge.InlineValueFeature=pci;var _ge={};Object.defineProperty(_ge,"__esModule",{value:!0});_ge.InlayHintsFeature=void 0;const Tqe=as,uB=Ts,r3=$n;class mci extends r3.TextDocumentLanguageFeature{constructor(e){super(e,uB.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,r3.ensure)((0,r3.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,r3.ensure)((0,r3.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(uB.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,s]=this.getRegistration(t,e.inlayHintProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Tqe.EventEmitter,s={onDidChangeInlayHints:i.event,provideInlayHints:(o,r,a)=>{const c=this._client,l=async(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u)};try{const m=await c.sendRequest(uB.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(uB.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return s.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(uB.InlayHintResolveRequest.type,a.code2ProtocolConverter.asInlayHint(d),h);if(h.isCancellationRequested)return null;const f=a.protocol2CodeConverter.asInlayHint(u,h);return h.isCancellationRequested?null:f}catch(u){return a.handleFailedRequest(uB.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,s),{provider:s,onDidChangeInlayHints:i}]}registerProvider(e,t){return Tqe.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}_ge.InlayHintsFeature=mci;var vge={};Object.defineProperty(vge,"__esModule",{value:!0});vge.InlineCompletionItemFeature=void 0;const _ci=as,a_e=Ts,c_e=$n,vci=Er;class wci extends c_e.TextDocumentLanguageFeature{constructor(e){super(e,a_e.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,c_e.ensure)((0,c_e.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:vci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(s,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(a_e.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(a_e.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(s,o,r,a,d):d(s,o,r,a)}};return[_ci.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}vge.InlineCompletionItemFeature=wci;Object.defineProperty(mu,"__esModule",{value:!0});mu.ProposedFeatures=Cct=mu.BaseLanguageClient=mu.MessageTransports=mu.SuspendMode=mu.State=mu.CloseAction=mu.ErrorAction=mu.RevealOutputChannelOn=void 0;const ra=as,Ft=Ts,bci=Nue,Cci=zue,rb=ea,NY=vu,Rqe=Er,yci=dj,Vw=$n,Sci=Ix,Mqe=$ue,Nqe=n0,gB=tm,Aci=Gue,Eci=que,xci=Que,Dci=jue,kci=Kue,Ici=pBe,Lci=Yue,Tci=Jue,Rci=Xue,Mci=Zue,l_e=s0,Nci=tge,Pci=ige,Fci=nge,Oci=sge,Bci=oge,Wci=rge,Hci=age,Uci=oz,Vci=cge,zci=lge,$ci=dge,Gci=hge,qci=uge,Qci=gge,fB=im,jci=fge,Kci=pge,Yci=mge,Jci=_ge,Xci=vge;var GT;(function(n){n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error",n[n.Never=4]="Never"})(GT||(mu.RevealOutputChannelOn=GT={}));var vq;(function(n){n[n.Continue=1]="Continue",n[n.Shutdown=2]="Shutdown"})(vq||(mu.ErrorAction=vq={}));var o0;(function(n){n[n.DoNotRestart=1]="DoNotRestart",n[n.Restart=2]="Restart"})(o0||(mu.CloseAction=o0={}));var U8;(function(n){n[n.Stopped=1]="Stopped",n[n.Starting=3]="Starting",n[n.Running=2]="Running"})(U8||(mu.State=U8={}));var Pqe;(function(n){n.off="off",n.on="on"})(Pqe||(mu.SuspendMode=Pqe={}));var IRe;(function(n){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&rb.stringArray(t.enabledCommands)?t:!1}n.sanitizeIsTrusted=e})(IRe||(IRe={}));class Zci{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:vq.Continue}:{action:vq.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:o0.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:o0.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:o0.Restart})}}var wo;(function(n){n.Initial="initial",n.Starting="starting",n.StartFailed="startFailed",n.Running="running",n.Stopping="stopping",n.Stopped="stopped"})(wo||(wo={}));var Fqe;(function(n){function e(t){return t&&Ft.MessageReader.is(t.reader)&&Ft.MessageWriter.is(t.writer)}n.is=e})(Fqe||(mu.MessageTransports=Fqe={}));class ZM{constructor(e,t,i){this._traceFormat=Ft.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new NY.Semaphore(1),this._id=e,this._name=t,i=i||{};const s={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(s.isTrusted=IRe.sanitizeIsTrusted(i.markdown.isTrusted),s.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??GT.Error,stdioEncoding:i.stdioEncoding??"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler??this.createDefaultErrorHandler(i.connectionOptions?.maxRestartCount),middleware:i.middleware??{},uriConverters:i.uriConverters,workspaceFolder:i.workspaceFolder,connectionOptions:i.connectionOptions,markdown:s,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=wo.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,i.outputChannel?(this._outputChannel=i.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=i.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new NY.Semaphore(1),this._pendingChangeDelayer=new NY.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new NY.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new Ft.Emitter,this._stateChangeEmitter=new Ft.Emitter,this._trace=Ft.Trace.Off,this._tracer={log:(o,r)=>{rb.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=bci.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=Cci.createConverter(i.uriConverters?i.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=ra.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){switch(this.$state){case wo.Starting:return U8.Starting;case wo.Running:return U8.Running;default:return U8.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const s=this._clientOptions.middleware?.sendRequest;if(s!==void 0){let o,r;return t.length===1?Ft.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),s(e,o,r,(a,c,l)=>{const d=[];return c!==void 0&&d.push(c),l!==void 0&&d.push(l),i.sendRequest(a,...d)})}else return i.sendRequest(e,...t)}onRequest(e,t){const i=typeof e=="string"?e:e.method;this._requestHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._requestDisposables.set(i,s.onRequest(e,t)),o={dispose:()=>{const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full;let s;i&&typeof e!="string"&&e.method===Ft.DidOpenTextDocumentNotification.method&&(s=t?.textDocument.uri,this._pendingOpenNotifications.add(s));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),s!==void 0&&this._pendingOpenNotifications.delete(s);const r=this._clientOptions.middleware?.sendNotification;return r?r(e,o.sendNotification.bind(o),t):o.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._notificationDisposables.set(i,s.onNotification(e,t)),o={dispose:()=>{const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}async sendProgress(e,t,i){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(s){throw this.error(`Sending progress for token ${t} failed.`,s),s}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const s=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=Ft.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return s!==void 0?(this._progressDisposables.set(t,s.onProgress(e,t,a)),o={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new Zci(this,e??4)}async setTrace(e){this._trace=e;const t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof Ft.ResponseError){const t=e;return` Message: ${t.message} + %s`,k,k,p,s);const F=p.type==="*"?Tme:p.type==="?"?SRe:"\\"+p.type;o=!0,s=s.slice(0,p.reStart)+F+"\\("+k}y(),r&&(s+="\\\\");const S=Poi[s.charAt(0)];for(let k=c.length-1;k>-1;k--){const F=c[k],N=s.slice(0,F.reStart),z=s.slice(F.reStart,F.reEnd-8);let U=s.slice(F.reEnd);const J=s.slice(F.reEnd-8,F.reEnd)+U,j=N.split(")").length,re=N.split("(").length-j;let me=U;for(let Qe=0;Qe(r=r.map(a=>typeof a=="string"?Woi(a):a===Jw?Jw:a._src).reduce((a,c)=>(a[a.length-1]===Jw&&c===Jw||a.push(c),a),[]),r.forEach((a,c)=>{a!==Jw||r[c-1]===Jw||(c===0?r.length>1?r[c+1]="(?:\\/|"+i+"\\/)?"+r[c+1]:r[c]=i:c===r.length-1?r[c-1]+="(?:\\/|"+i+")?":(r[c-1]+="(?:\\/|\\/"+i+"\\/)"+r[c+1],r[c+1]=Jw))}),r.filter(a=>a!==Jw).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,s)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const i=this.options;yRe.sep!=="/"&&(e=e.split(yRe.sep).join("/")),e=e.split(aqe),this.debug(this.pattern,"split",e);const s=this.set;this.debug(this.pattern,"set",s);let o;for(let r=e.length-1;r>=0&&(o=e[r],!o);r--);for(let r=0;r{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,s=new Set;H8.fillTabResources(s);const o=new Set,r=new Set(s);for(const a of i.values())s.has(a)?r.delete(a):o.add(a);if(this.open=s,o.size>0){const a=new Set;for(const c of o)a.add(Qo.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(Qo.Uri.parse(c));this._onOpen.fire(a)}};Qo.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=Qo.window.tabGroups.onDidChangeTabs(e):this.disposable={dispose:()=>{}}}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof Qo.Uri?Qo.window.activeTextEditor?.document.uri===e:Qo.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof Qo.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return H8.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const s of Qo.window.tabGroups.all)for(const o of s.tabs){const r=o.input;let a;r instanceof Qo.TabInputText?a=r.uri:r instanceof Qo.TabInputTextDiff?a=r.modified:r instanceof Qo.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Nh;(function(n){n[n.document=1]="document",n[n.workspace=2]="workspace"})(Nh||(Nh={}));var GE;(function(n){function e(t){return t instanceof Qo.Uri?t.toString():t.uri.toString()}n.asKey=e})(GE||(GE={}));class zoi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const s=e===Nh.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof Qo.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=s.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},s.set(o,c)),c}update(e,t,i,s){const o=e===Nh.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof Qo.Uri?[t.toString(),t,i,s]:[t.uri.toString(),t.uri,t.version,i];let d=o.get(r);d===void 0?(d={document:a,pulledVersion:c,resultId:l},o.set(r,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=GE.asKey(t);(e===Nh.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=GE.asKey(t);return(e===Nh.document?this.documentPullStates:this.workspacePullStates).get(i)?.resultId}getAllResultIds(){const e=[];for(let[t,i]of this.workspacePullStates)this.documentPullStates.has(t)&&(i=this.documentPullStates.get(t)),i.resultId!==void 0&&e.push({uri:t,value:i.resultId});return e}}class $oi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new Qo.EventEmitter,this.provider=this.createProvider(),this.diagnostics=Qo.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new zoi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof Qo.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(i.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},s=>{this.client.error(`Document pull failed for text document ${i.toString()}`,s,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof Qo.Uri,s=i?e:e.uri,o=s.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Nh.document,e,t):this.documentStates.track(Nh.document,e);if(r===void 0){const c=new Qo.CancellationTokenSource;this.openRequests.set(o,{state:kg.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:lv.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof ARe.LSPCancellationError&&ql.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:kg.outDated,document:e}),d===void 0&&h instanceof Qo.CancellationError)d={state:kg.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(o),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${o}`),this.diagnostics.delete(s);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Nh.document,e);return}if(d.state===kg.outDated)return;l!==void 0&&(l.kind===lv.DocumentDiagnosticReportKind.full&&this.diagnostics.set(s,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===kg.reschedule&&this.pull(e)}else r.state===kg.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:kg.reschedule,document:r.document})):r.state===kg.outDated&&this.openRequests.set(o,{state:kg.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof Qo.Uri?e:e.uri,i=t.toString(),s=this.openRequests.get(i);this.options.workspaceDiagnostics?s!==void 0?this.openRequests.set(i,{state:kg.reschedule,document:e}):this.pull(e,()=>{this.forget(Nh.document,e)}):(s!==void 0&&(s.state===kg.active&&s.tokenSource.cancel(),this.openRequests.set(i,{state:kg.outDated,document:e})),this.diagnostics.delete(t),this.forget(Nh.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof ARe.LSPCancellationError)&&!ql.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,ql.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new Qo.CancellationTokenSource;const e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(const i of t.items)i.kind===lv.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Nh.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Nh.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,s)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof Qo.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(ql.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:lv.DocumentDiagnosticReportKind.full,items:[]}:h.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,l,h,{kind:lv.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,s,o):o(t,i,s)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,s)=>{const o=async l=>l.kind===ql.DocumentDiagnosticReportKind.Full?{kind:lv.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,i)}:{kind:lv.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},r=l=>{const d=[];for(const h of l)d.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return d},a=(l,d)=>{const h=(0,Voi.generateUuid)(),u=this.client.onProgress(ql.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){s(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(w){this.client.error("Converting workspace diagnostics failed.",w)}s(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(ql.WorkspaceDiagnosticRequest.type,f,d).then(async p=>{if(d.isCancellationRequested)return{items:[]};const m={items:[]};for(const v of p.items)m.items.push(await o(v));return u.dispose(),s(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(ql.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,s,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===kg.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:kg.outDated,document:t.document});this.diagnostics.dispose()}}class Goi{constructor(e){this.diagnosticRequestor=e,this.documents=new ql.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=GE.asKey(e);this.documents.has(t)||(this.documents.set(t,e,ql.Touch.Last),this.trigger())}remove(e){const t=GE.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,ql.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=GE.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,ql.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument!==void 0?GE.asKey(this.endDocument):void 0}}class qoi{constructor(e,t,i){const s=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(s.match!==void 0)return s.match(m,p);for(const v of m)if(ql.TextDocumentFilter.is(v)){if(typeof v=="string"||v.language!==void 0&&v.language!=="*"||v.scheme!==void 0&&v.scheme!=="*"&&v.scheme!==p.scheme)return!1;if(v.pattern!==void 0){const w=new Uoi.Minimatch(v.pattern,{noext:!0});if(!w.makeRe()||!w.match(p.fsPath))return!1}}return!0},c=p=>p instanceof Qo.Uri?a(p):Qo.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof Qo.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new $oi(e,t,i),this.backgroundScheduler=new Goi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=Qo.window.activeTextEditor?.document,Qo.window.onDidChangeActiveTextEditor(p=>{const m=this.activeTextDocument;this.activeTextDocument=p?.document,m!==void 0&&d(m),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});const h=e.getFeature(ql.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Nh.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Nh.document,m))continue;const v=m.toString();let w;for(const b of Qo.workspace.textDocuments)if(v===b.uri.toString()){w=b;break}w!==void 0&&c(w)&&this.diagnosticRequestor.pull(w,()=>{d(w)})}}));const u=new Set;for(const p of Qo.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(s.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(s.onChange===!0){const p=e.getFeature(ql.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onType))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(s.onSave===!0){const p=e.getFeature(ql.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(s.filter===void 0||!s.filter(v,Gre.onSave))&&this.diagnosticRequestor.knows(Nh.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(ql.DidCloseTextDocumentNotification.method);r.push(f.onNotificationSent(p=>{this.cleanUpDocument(p.textDocument)})),t.onClose(p=>{for(const m of p)this.cleanUpDocument(m)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(const p of Qo.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=Qo.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Nh.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class Qoi extends ARe.TextDocumentLanguageFeature{constructor(e){super(e,ql.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=DY(DY(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,DY(DY(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(ql.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[s,o]=this.getRegistration(t,e.diagnosticProvider);!s||!o||this.register({id:s,registerOptions:o})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new H8);const t=new qoi(this._client,this.tabs,e);return[t.disposable,t]}}Ix.DiagnosticFeature=Qoi;var mu={},Nue={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});vu.forEach=vu.mapAsync=vu.map=vu.clearTestMode=vu.setTestMode=vu.Semaphore=vu.Delayer=void 0;const lj=Ts;class joi{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,lj.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}}vu.Delayer=joi;class Koi{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,lj.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}vu.Semaphore=Koi;let gBe=!1;function Yoi(){gBe=!0}vu.setTestMode=Yoi;function Joi(){gBe=!1}vu.clearTestMode=Joi;const cqe=15;class fBe{constructor(e=cqe){this.yieldAfter=gBe===!0?Math.max(e,2):Math.max(e,cqe),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){const e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}}async function Xoi(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.map=Xoi;async function Zoi(n,e,t,i){if(n.length===0)return[];const s=new Array(n.length),o=new fBe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,lj.RAL)().timer.setImmediate(()=>{c(r(a))})});return s}vu.mapAsync=Zoi;async function eri(n,e,t,i){if(n.length===0)return;const s=new fBe(i?.yieldAfter);function o(a){s.start();for(let c=a;c{(0,lj.RAL)().timer.setImmediate(()=>{a(o(r))})})}vu.forEach=eri;var Pue={};Object.defineProperty(Pue,"__esModule",{value:!0});const tri=as;class iri extends tri.CompletionItem{constructor(e){super(e)}}Pue.default=iri;var Fue={};Object.defineProperty(Fue,"__esModule",{value:!0});const nri=as;class sri extends nri.CodeLens{constructor(e){super(e)}}Fue.default=sri;var Oue={};Object.defineProperty(Oue,"__esModule",{value:!0});const ori=as;class rri extends ori.DocumentLink{constructor(e,t){super(e,t)}}Oue.default=rri;var Bue={};Object.defineProperty(Bue,"__esModule",{value:!0});const ari=as;class cri extends ari.CodeAction{constructor(e,t){super(e),this.data=t}}Bue.default=cri;var tO={};Object.defineProperty(tO,"__esModule",{value:!0});tO.ProtocolDiagnostic=tO.DiagnosticCode=void 0;const lri=as,Mme=ea;var lqe;(function(n){function e(t){const i=t;return i!=null&&(Mme.number(i.value)||Mme.string(i.value))&&Mme.string(i.target)}n.is=e})(lqe||(tO.DiagnosticCode=lqe={}));class dri extends lri.Diagnostic{constructor(e,t,i,s){super(e,t,i),this.data=s,this.hasDiagnosticCode=!1}}tO.ProtocolDiagnostic=dri;var Wue={};Object.defineProperty(Wue,"__esModule",{value:!0});const hri=as;class uri extends hri.CallHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Wue.default=uri;var Hue={};Object.defineProperty(Hue,"__esModule",{value:!0});const gri=as;class fri extends gri.TypeHierarchyItem{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o,r),a!==void 0&&(this.data=a)}}Hue.default=fri;var Uue={};Object.defineProperty(Uue,"__esModule",{value:!0});const kY=as;class pri extends kY.SymbolInformation{constructor(e,t,i,s,o){const r=!(s instanceof kY.Uri);super(e,t,i,r?s:new kY.Location(s,new kY.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}Uue.default=pri;var Vue={};Object.defineProperty(Vue,"__esModule",{value:!0});const mri=as;class _ri extends mri.InlayHint{constructor(e,t,i){super(e,t,i)}}Vue.default=_ri;Object.defineProperty(Nue,"__esModule",{value:!0});Nue.createConverter=void 0;const Td=as,Ms=Ts,OL=ea,dqe=vu,vri=Pue,wri=Fue,bri=Oue,hqe=Bue,uqe=tO,Cri=Wue,yri=Hue,Sri=Uue,Ari=Vue;var ERe;(function(n){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}n.is=e})(ERe||(ERe={}));function Eri(n){const t=n||(K=>K.toString());function i(K){return t(K)}function s(K){return{uri:t(K.uri)}}function o(K){return{uri:t(K.uri),languageId:K.languageId,version:K.version,text:K.getText()}}function r(K){return{uri:t(K.uri),version:K.version}}function a(K){return{textDocument:o(K)}}function c(K){const Le=K;return!!Le.document&&!!Le.contentChanges}function l(K){const Le=K;return!!Le.uri&&!!Le.version}function d(K,Le,ri){if(l(K))return{textDocument:{uri:t(K.uri),version:K.version},contentChanges:[{text:K.getText()}]};if(c(K)){const ts=Le,Os=ri;return{textDocument:{uri:t(ts),version:Os},contentChanges:K.contentChanges.map(ya=>{const yc=ya.range;return{range:{start:{line:yc.start.line,character:yc.start.character},end:{line:yc.end.line,character:yc.end.character}},rangeLength:ya.rangeLength,text:ya.text}})}}else throw Error("Unsupported text document change parameter")}function h(K){return{textDocument:s(K)}}function u(K,Le=!1){let ri={textDocument:s(K)};return Le&&(ri.text=K.getText()),ri}function f(K){switch(K){case Td.TextDocumentSaveReason.Manual:return Ms.TextDocumentSaveReason.Manual;case Td.TextDocumentSaveReason.AfterDelay:return Ms.TextDocumentSaveReason.AfterDelay;case Td.TextDocumentSaveReason.FocusOut:return Ms.TextDocumentSaveReason.FocusOut}return Ms.TextDocumentSaveReason.Manual}function p(K){return{textDocument:s(K.document),reason:f(K.reason)}}function m(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function v(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function w(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function b(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function C(K){return{files:K.files.map(Le=>({oldUri:t(Le.oldUri),newUri:t(Le.newUri)}))}}function y(K){return{files:K.files.map(Le=>({uri:t(Le)}))}}function S(K,Le){return{textDocument:s(K),position:me(Le)}}function M(K){switch(K){case Td.CompletionTriggerKind.TriggerCharacter:return Ms.CompletionTriggerKind.TriggerCharacter;case Td.CompletionTriggerKind.TriggerForIncompleteCompletions:return Ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return Ms.CompletionTriggerKind.Invoked}}function k(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{triggerKind:M(ri.triggerKind),triggerCharacter:ri.triggerCharacter}}}function F(K){switch(K){case Td.SignatureHelpTriggerKind.Invoke:return Ms.SignatureHelpTriggerKind.Invoked;case Td.SignatureHelpTriggerKind.TriggerCharacter:return Ms.SignatureHelpTriggerKind.TriggerCharacter;case Td.SignatureHelpTriggerKind.ContentChange:return Ms.SignatureHelpTriggerKind.ContentChange}}function N(K){return{label:K.label}}function z(K){return K.map(N)}function U(K){return{label:K.label,parameters:z(K.parameters)}}function J(K){return K.map(U)}function j(K){return K===void 0?K:{signatures:J(K.signatures),activeSignature:K.activeSignature,activeParameter:K.activeParameter}}function re(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{isRetrigger:ri.isRetrigger,triggerCharacter:ri.triggerCharacter,triggerKind:F(ri.triggerKind),activeSignatureHelp:j(ri.activeSignatureHelp)}}}function me(K){return{line:K.line,character:K.character}}function De(K){return K==null?K:{line:K.line>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.line,character:K.character>Ms.uinteger.MAX_VALUE?Ms.uinteger.MAX_VALUE:K.character}}function Qe(K,Le){return dqe.map(K,De,Le)}function Tt(K){return K.map(De)}function Oe(K){return K==null?K:{start:De(K.start),end:De(K.end)}}function wt(K){return K.map(Oe)}function Nt(K){return K==null?K:Ms.Location.create(i(K.uri),Oe(K.range))}function Ji(K){switch(K){case Td.DiagnosticSeverity.Error:return Ms.DiagnosticSeverity.Error;case Td.DiagnosticSeverity.Warning:return Ms.DiagnosticSeverity.Warning;case Td.DiagnosticSeverity.Information:return Ms.DiagnosticSeverity.Information;case Td.DiagnosticSeverity.Hint:return Ms.DiagnosticSeverity.Hint}}function Vi(K){if(!K)return;let Le=[];for(let ri of K){let ts=Gn(ri);ts!==void 0&&Le.push(ts)}return Le.length>0?Le:void 0}function Gn(K){switch(K){case Td.DiagnosticTag.Unnecessary:return Ms.DiagnosticTag.Unnecessary;case Td.DiagnosticTag.Deprecated:return Ms.DiagnosticTag.Deprecated;default:return}}function Ro(K){return{message:K.message,location:Nt(K.location)}}function qn(K){return K.map(Ro)}function ec(K){if(K!=null)return OL.number(K)||OL.string(K)?K:{value:K.value,target:i(K.target)}}function ys(K){const Le=Ms.Diagnostic.create(Oe(K.range),K.message),ri=K instanceof uqe.ProtocolDiagnostic?K:void 0;ri!==void 0&&ri.data!==void 0&&(Le.data=ri.data);const ts=ec(K.code);return uqe.DiagnosticCode.is(ts)?ri!==void 0&&ri.hasDiagnosticCode?Le.code=ts:(Le.code=ts.value,Le.codeDescription={href:ts.target}):Le.code=ts,OL.number(K.severity)&&(Le.severity=Ji(K.severity)),Array.isArray(K.tags)&&(Le.tags=Vi(K.tags)),K.relatedInformation&&(Le.relatedInformation=qn(K.relatedInformation)),K.source&&(Le.source=K.source),Le}function mr(K,Le){return K==null?K:dqe.map(K,ys,Le)}function ba(K){return K==null?K:K.map(ys)}function ki(K,Le){switch(K){case"$string":return Le;case Ms.MarkupKind.PlainText:return{kind:K,value:Le};case Ms.MarkupKind.Markdown:return{kind:K,value:Le.value};default:return`Unsupported Markup content received. Kind is: ${K}`}}function gs(K){switch(K){case Td.CompletionItemTag.Deprecated:return Ms.CompletionItemTag.Deprecated}}function ir(K){if(K===void 0)return K;const Le=[];for(let ri of K){const ts=gs(ri);ts!==void 0&&Le.push(ts)}return Le}function Hn(K,Le){return Le!==void 0?Le:K+1}function vc(K,Le=!1){let ri,ts;OL.string(K.label)?ri=K.label:(ri=K.label.label,Le&&(K.label.detail!==void 0||K.label.description!==void 0)&&(ts={detail:K.label.detail,description:K.label.description}));let Os={label:ri};ts!==void 0&&(Os.labelDetails=ts);let sr=K instanceof vri.default?K:void 0;K.detail&&(Os.detail=K.detail),K.documentation&&(!sr||sr.documentationFormat==="$string"?Os.documentation=K.documentation:Os.documentation=ki(sr.documentationFormat,K.documentation)),K.filterText&&(Os.filterText=K.filterText),gh(Os,K),OL.number(K.kind)&&(Os.kind=Hn(K.kind,sr&&sr.originalItemKind)),K.sortText&&(Os.sortText=K.sortText),K.additionalTextEdits&&(Os.additionalTextEdits=tl(K.additionalTextEdits)),K.commitCharacters&&(Os.commitCharacters=K.commitCharacters.slice()),K.command&&(Os.command=Ca(K.command)),(K.preselect===!0||K.preselect===!1)&&(Os.preselect=K.preselect);const ya=ir(K.tags);if(sr){if(sr.data!==void 0&&(Os.data=sr.data),sr.deprecated===!0||sr.deprecated===!1){if(sr.deprecated===!0&&ya!==void 0&&ya.length>0){const yc=ya.indexOf(Td.CompletionItemTag.Deprecated);yc!==-1&&ya.splice(yc,1)}Os.deprecated=sr.deprecated}sr.insertTextMode!==void 0&&(Os.insertTextMode=sr.insertTextMode)}return ya!==void 0&&ya.length>0&&(Os.tags=ya),Os.insertTextMode===void 0&&K.keepWhitespace===!0&&(Os.insertTextMode=Ms.InsertTextMode.adjustIndentation),Os}function gh(K,Le){let ri=Ms.InsertTextFormat.PlainText,ts,Os;Le.textEdit?(ts=Le.textEdit.newText,Os=Le.textEdit.range):Le.insertText instanceof Td.SnippetString?(ri=Ms.InsertTextFormat.Snippet,ts=Le.insertText.value):ts=Le.insertText,Le.range&&(Os=Le.range),K.insertTextFormat=ri,Le.fromEdit&&ts!==void 0&&Os!==void 0?K.textEdit=Qn(ts,Os):K.insertText=ts}function Qn(K,Le){return ERe.is(Le)?Ms.InsertReplaceEdit.create(K,Oe(Le.inserting),Oe(Le.replacing)):{newText:K,range:Oe(Le)}}function Yh(K){return{range:Oe(K.range),newText:K.newText}}function tl(K){return K==null?K:K.map(Yh)}function Tl(K){return K<=Td.SymbolKind.TypeParameter?K+1:Ms.SymbolKind.Property}function to(K){return K}function Fc(K){return K.map(to)}function rd(K,Le,ri){return{textDocument:s(K),position:me(Le),context:{includeDeclaration:ri.includeDeclaration}}}async function Jh(K,Le){let ri=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(ri.data=K.data),K.kind!==void 0&&(ri.kind=ul(K.kind)),K.diagnostics!==void 0&&(ri.diagnostics=await mr(K.diagnostics,Le)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(ri.command=Ca(K.command)),K.isPreferred!==void 0&&(ri.isPreferred=K.isPreferred),K.disabled!==void 0&&(ri.disabled={reason:K.disabled.reason}),ri}function Af(K){let Le=Ms.CodeAction.create(K.title);if(K instanceof hqe.default&&K.data!==void 0&&(Le.data=K.data),K.kind!==void 0&&(Le.kind=ul(K.kind)),K.diagnostics!==void 0&&(Le.diagnostics=ba(K.diagnostics)),K.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return K.command!==void 0&&(Le.command=Ca(K.command)),K.isPreferred!==void 0&&(Le.isPreferred=K.isPreferred),K.disabled!==void 0&&(Le.disabled={reason:K.disabled.reason}),Le}async function il(K,Le){if(K==null)return K;let ri;return K.only&&OL.string(K.only.value)&&(ri=[K.only.value]),Ms.CodeActionContext.create(await mr(K.diagnostics,Le),ri,Xh(K.triggerKind))}function Rl(K){if(K==null)return K;let Le;return K.only&&OL.string(K.only.value)&&(Le=[K.only.value]),Ms.CodeActionContext.create(ba(K.diagnostics),Le,Xh(K.triggerKind))}function Xh(K){switch(K){case Td.CodeActionTriggerKind.Invoke:return Ms.CodeActionTriggerKind.Invoked;case Td.CodeActionTriggerKind.Automatic:return Ms.CodeActionTriggerKind.Automatic;default:return}}function ul(K){if(K!=null)return K.value}function ad(K){return K==null?K:Ms.InlineValueContext.create(K.frameId,Oe(K.stoppedLocation))}function wc(K,Le,ri){return{context:Ms.InlineCompletionContext.create(ri.triggerKind,ri.selectedCompletionInfo),textDocument:s(K),position:De(Le)}}function Ca(K){let Le=Ms.Command.create(K.title,K.command);return K.arguments&&(Le.arguments=K.arguments),Le}function Ld(K){let Le=Ms.CodeLens.create(Oe(K.range));return K.command&&(Le.command=Ca(K.command)),K instanceof wri.default&&K.data&&(Le.data=K.data),Le}function fh(K,Le){const ri={tabSize:K.tabSize,insertSpaces:K.insertSpaces};return Le.trimTrailingWhitespace&&(ri.trimTrailingWhitespace=!0),Le.trimFinalNewlines&&(ri.trimFinalNewlines=!0),Le.insertFinalNewline&&(ri.insertFinalNewline=!0),ri}function Fu(K){return{textDocument:s(K)}}function bc(K){return{textDocument:s(K)}}function Zh(K){let Le=Ms.DocumentLink.create(Oe(K.range));K.target&&(Le.target=i(K.target)),K.tooltip!==void 0&&(Le.tooltip=K.tooltip);let ri=K instanceof bri.default?K:void 0;return ri&&ri.data&&(Le.data=ri.data),Le}function Cc(K){return{textDocument:s(K)}}function nr(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Fc(K.tags)),K instanceof Cri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Rs(K){const Le={name:K.name,kind:Tl(K.kind),uri:i(K.uri),range:Oe(K.range),selectionRange:Oe(K.selectionRange)};return K.detail!==void 0&&K.detail.length>0&&(Le.detail=K.detail),K.tags!==void 0&&(Le.tags=Fc(K.tags)),K instanceof yri.default&&K.data!==void 0&&(Le.data=K.data),Le}function Ml(K){const Le=K instanceof Sri.default?{name:K.name,kind:Tl(K.kind),location:K.hasRange?Nt(K.location):{uri:t(K.location.uri)},data:K.data}:{name:K.name,kind:Tl(K.kind),location:Nt(K.location)};return K.tags!==void 0&&(Le.tags=Fc(K.tags)),K.containerName!==""&&(Le.containerName=K.containerName),Le}function Se(K){const Le=typeof K.label=="string"?K.label:K.label.map(Mo),ri=Ms.InlayHint.create(De(K.position),Le);return K.kind!==void 0&&(ri.kind=K.kind),K.textEdits!==void 0&&(ri.textEdits=tl(K.textEdits)),K.tooltip!==void 0&&(ri.tooltip=cd(K.tooltip)),K.paddingLeft!==void 0&&(ri.paddingLeft=K.paddingLeft),K.paddingRight!==void 0&&(ri.paddingRight=K.paddingRight),K instanceof Ari.default&&K.data!==void 0&&(ri.data=K.data),ri}function Mo(K){const Le=Ms.InlayHintLabelPart.create(K.value);return K.location!==void 0&&(Le.location=Nt(K.location)),K.command!==void 0&&(Le.command=Ca(K.command)),K.tooltip!==void 0&&(Le.tooltip=cd(K.tooltip)),Le}function cd(K){return typeof K=="string"?K:{kind:Ms.MarkupKind.Markdown,value:K.value}}return{asUri:i,asTextDocumentIdentifier:s,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:w,asWillCreateFilesParams:b,asWillRenameFilesParams:C,asWillDeleteFilesParams:y,asTextDocumentPositionParams:S,asCompletionParams:k,asSignatureHelpParams:re,asWorkerPosition:me,asRange:Oe,asRanges:wt,asPosition:De,asPositions:Qe,asPositionsSync:Tt,asLocation:Nt,asDiagnosticSeverity:Ji,asDiagnosticTag:Gn,asDiagnostic:ys,asDiagnostics:mr,asDiagnosticsSync:ba,asCompletionItem:vc,asTextEdit:Yh,asSymbolKind:Tl,asSymbolTag:to,asSymbolTags:Fc,asReferenceParams:rd,asCodeAction:Jh,asCodeActionSync:Af,asCodeActionContext:il,asCodeActionContextSync:Rl,asInlineValueContext:ad,asCommand:Ca,asCodeLens:Ld,asFormattingOptions:fh,asDocumentSymbolParams:Fu,asCodeLensParams:bc,asDocumentLink:Zh,asDocumentLinkParams:Cc,asCallHierarchyItem:nr,asTypeHierarchyItem:Rs,asInlayHint:Se,asWorkspaceSymbol:Ml,asInlineCompletionParams:wc}}Nue.createConverter=Eri;var zue={};Object.defineProperty(zue,"__esModule",{value:!0});zue.createConverter=void 0;const li=as,Kn=Ts,dv=ea,kr=vu,xri=Pue,Dri=Fue,kri=Oue,Iri=Bue,gqe=tO,Lri=Wue,Tri=Hue,Rri=Uue,Mri=Vue,fqe=Ts;var qre;(function(n){function e(t){let i=t;return i&&dv.string(i.language)&&dv.string(i.value)}n.is=e})(qre||(qre={}));function Nri(n,e,t){const s=n||(L=>li.Uri.parse(L));function o(L){return s(L)}function r(L){const ne=[];for(const R of L)if(typeof R=="string")ne.push(R);else if(fqe.NotebookCellTextDocumentFilter.is(R))if(typeof R.notebook=="string")ne.push({notebookType:R.notebook,language:R.language});else{const H=R.notebook.notebookType??"*";ne.push({notebookType:H,scheme:R.notebook.scheme,pattern:R.notebook.pattern,language:R.language})}else fqe.TextDocumentFilter.is(R)&&ne.push({language:R.language,scheme:R.scheme,pattern:R.pattern});return ne}async function a(L,ne){return kr.map(L,l,ne)}function c(L){const ne=new Array(L.length);for(let R=0;R0?ne:void 0}function u(L){switch(L){case Kn.DiagnosticTag.Unnecessary:return li.DiagnosticTag.Unnecessary;case Kn.DiagnosticTag.Deprecated:return li.DiagnosticTag.Deprecated;default:return}}function f(L){return L?new li.Position(L.line,L.character):void 0}function p(L){return L?new li.Range(L.start.line,L.start.character,L.end.line,L.end.character):void 0}async function m(L,ne){return kr.map(L,R=>new li.Range(R.start.line,R.start.character,R.end.line,R.end.character),ne)}function v(L){if(L==null)return li.DiagnosticSeverity.Error;switch(L){case Kn.DiagnosticSeverity.Error:return li.DiagnosticSeverity.Error;case Kn.DiagnosticSeverity.Warning:return li.DiagnosticSeverity.Warning;case Kn.DiagnosticSeverity.Information:return li.DiagnosticSeverity.Information;case Kn.DiagnosticSeverity.Hint:return li.DiagnosticSeverity.Hint}return li.DiagnosticSeverity.Error}function w(L){if(dv.string(L))return C(L);if(qre.is(L))return C().appendCodeblock(L.value,L.language);if(Array.isArray(L)){let ne=[];for(let R of L){let H=C();qre.is(R)?H.appendCodeblock(R.value,R.language):H.appendMarkdown(R),ne.push(H)}return ne}else return C(L)}function b(L){if(dv.string(L))return L;switch(L.kind){case Kn.MarkupKind.Markdown:return C(L.value);case Kn.MarkupKind.PlainText:return L.value;default:return`Unsupported Markup content received. Kind is: ${L.kind}`}}function C(L){let ne;if(L===void 0||typeof L=="string")ne=new li.MarkdownString(L);else switch(L.kind){case Kn.MarkupKind.Markdown:ne=new li.MarkdownString(L.value);break;case Kn.MarkupKind.PlainText:ne=new li.MarkdownString,ne.appendText(L.value);break;default:ne=new li.MarkdownString,ne.appendText(`Unsupported Markup content received. Kind is: ${L.kind}`);break}return ne.isTrusted=e,ne.supportHtml=t,ne}function y(L){if(L)return new li.Hover(w(L.contents),p(L.range))}async function S(L,ne,R){if(!L)return;if(Array.isArray(L))return kr.map(L,is=>z(is,ne),R);const H=L,{defaultRange:ie,commitCharacters:je}=M(H,ne),pt=await kr.map(H.items,is=>z(is,je,ie,H.itemDefaults?.insertTextMode,H.itemDefaults?.insertTextFormat,H.itemDefaults?.data),R);return new li.CompletionList(pt,H.isIncomplete)}function M(L,ne){const R=L.itemDefaults?.editRange,H=L.itemDefaults?.commitCharacters??ne;return Kn.Range.is(R)?{defaultRange:p(R),commitCharacters:H}:R!==void 0?{defaultRange:{inserting:p(R.insert),replacing:p(R.replace)},commitCharacters:H}:{defaultRange:void 0,commitCharacters:H}}function k(L){return Kn.CompletionItemKind.Text<=L&&L<=Kn.CompletionItemKind.TypeParameter?[L-1,void 0]:[li.CompletionItemKind.Text,L]}function F(L){switch(L){case Kn.CompletionItemTag.Deprecated:return li.CompletionItemTag.Deprecated}}function N(L){if(L==null)return[];const ne=[];for(const R of L){const H=F(R);H!==void 0&&ne.push(H)}return ne}function z(L,ne,R,H,ie,je){const pt=N(L.tags),is=U(L),Ss=new xri.default(is);L.detail&&(Ss.detail=L.detail),L.documentation&&(Ss.documentation=b(L.documentation),Ss.documentationFormat=dv.string(L.documentation)?"$string":L.documentation.kind),L.filterText&&(Ss.filterText=L.filterText);const ld=J(L,R,ie);if(ld&&(Ss.insertText=ld.text,Ss.range=ld.range,Ss.fromEdit=ld.fromEdit),dv.number(L.kind)){let[Act,NBe]=k(L.kind);Ss.kind=Act,NBe&&(Ss.originalItemKind=NBe)}L.sortText&&(Ss.sortText=L.sortText),L.additionalTextEdits&&(Ss.additionalTextEdits=De(L.additionalTextEdits));const Eg=L.commitCharacters!==void 0?dv.stringArray(L.commitCharacters)?L.commitCharacters:void 0:ne;Eg&&(Ss.commitCharacters=Eg.slice()),L.command&&(Ss.command=tl(L.command)),(L.deprecated===!0||L.deprecated===!1)&&(Ss.deprecated=L.deprecated,L.deprecated===!0&&pt.push(li.CompletionItemTag.Deprecated)),(L.preselect===!0||L.preselect===!1)&&(Ss.preselect=L.preselect);const Bw=L.data??je;Bw!==void 0&&(Ss.data=Bw),pt.length>0&&(Ss.tags=pt);const bge=L.insertTextMode??H;return bge!==void 0&&(Ss.insertTextMode=bge,bge===Kn.InsertTextMode.asIs&&(Ss.keepWhitespace=!0)),Ss}function U(L){return Kn.CompletionItemLabelDetails.is(L.labelDetails)?{label:L.label,detail:L.labelDetails.detail,description:L.labelDetails.description}:L.label}function J(L,ne,R){const H=L.insertTextFormat??R;if(L.textEdit!==void 0||ne!==void 0){const[ie,je]=L.textEdit!==void 0?j(L.textEdit):[ne,L.textEditText??L.label];return H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(je),range:ie,fromEdit:!0}:{text:je,range:ie,fromEdit:!0}}else return L.insertText?H===Kn.InsertTextFormat.Snippet?{text:new li.SnippetString(L.insertText),fromEdit:!1}:{text:L.insertText,fromEdit:!1}:void 0}function j(L){return Kn.InsertReplaceEdit.is(L)?[{inserting:p(L.insert),replacing:p(L.replace)},L.newText]:[p(L.range),L.newText]}function re(L){if(L)return new li.TextEdit(p(L.range),L.newText)}async function me(L,ne){if(L)return kr.map(L,re,ne)}function De(L){if(!L)return;const ne=new Array(L.length);for(let R=0;R0){let R=[];for(let H of L.children)R.push(Qn(H));ne.children=R}return ne}function Yh(L,ne){L.tags=Hn(ne.tags),ne.deprecated&&(L.tags?L.tags.includes(li.SymbolTag.Deprecated)||(L.tags=L.tags.concat(li.SymbolTag.Deprecated)):L.tags=[li.SymbolTag.Deprecated])}function tl(L){let ne={title:L.title,command:L.command};return L.arguments&&(ne.arguments=L.arguments),ne}async function Tl(L,ne){if(L)return kr.map(L,tl,ne)}const to=new Map;to.set(Kn.CodeActionKind.Empty,li.CodeActionKind.Empty),to.set(Kn.CodeActionKind.QuickFix,li.CodeActionKind.QuickFix),to.set(Kn.CodeActionKind.Refactor,li.CodeActionKind.Refactor),to.set(Kn.CodeActionKind.RefactorExtract,li.CodeActionKind.RefactorExtract),to.set(Kn.CodeActionKind.RefactorInline,li.CodeActionKind.RefactorInline),to.set(Kn.CodeActionKind.RefactorRewrite,li.CodeActionKind.RefactorRewrite),to.set(Kn.CodeActionKind.Source,li.CodeActionKind.Source),to.set(Kn.CodeActionKind.SourceOrganizeImports,li.CodeActionKind.SourceOrganizeImports);function Fc(L){if(L==null)return;let ne=to.get(L);if(ne)return ne;let R=L.split(".");ne=li.CodeActionKind.Empty;for(let H of R)ne=ne.append(H);return ne}function rd(L){if(L!=null)return L.map(ne=>Fc(ne))}async function Jh(L,ne){if(L==null)return;let R=new Iri.default(L.title,L.data);return L.kind!==void 0&&(R.kind=Fc(L.kind)),L.diagnostics!==void 0&&(R.diagnostics=c(L.diagnostics)),L.edit!==void 0&&(R.edit=await Xh(L.edit,ne)),L.command!==void 0&&(R.command=tl(L.command)),L.isPreferred!==void 0&&(R.isPreferred=L.isPreferred),L.disabled!==void 0&&(R.disabled={reason:L.disabled.reason}),R}function Af(L,ne){return kr.mapAsync(L,async R=>Kn.Command.is(R)?tl(R):Jh(R,ne),ne)}function il(L){if(!L)return;let ne=new Dri.default(p(L.range));return L.command&&(ne.command=tl(L.command)),L.data!==void 0&&L.data!==null&&(ne.data=L.data),ne}async function Rl(L,ne){if(L)return kr.map(L,il,ne)}async function Xh(L,ne){if(!L)return;const R=new Map;if(L.changeAnnotations!==void 0){const je=L.changeAnnotations;await kr.forEach(Object.keys(je),pt=>{const is=ul(je[pt]);R.set(pt,is)},ne)}const H=je=>{if(je!==void 0)return R.get(je)},ie=new li.WorkspaceEdit;if(L.documentChanges){const je=L.documentChanges;await kr.forEach(je,pt=>{if(Kn.CreateFile.is(pt))ie.createFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.RenameFile.is(pt))ie.renameFile(s(pt.oldUri),s(pt.newUri),pt.options,H(pt.annotationId));else if(Kn.DeleteFile.is(pt))ie.deleteFile(s(pt.uri),pt.options,H(pt.annotationId));else if(Kn.TextDocumentEdit.is(pt)){const is=s(pt.textDocument.uri);for(const Ss of pt.edits)Kn.AnnotatedTextEdit.is(Ss)?ie.replace(is,p(Ss.range),Ss.newText,H(Ss.annotationId)):ie.replace(is,p(Ss.range),Ss.newText)}else throw new Error(`Unknown workspace edit change received: +${JSON.stringify(pt,void 0,4)}`)},ne)}else if(L.changes){const je=L.changes;await kr.forEach(Object.keys(je),pt=>{ie.set(s(pt),De(je[pt]))},ne)}return ie}function ul(L){if(L!==void 0)return{label:L.label,needsConfirmation:!!L.needsConfirmation,description:L.description}}function ad(L){let ne=p(L.range),R=L.target?o(L.target):void 0,H=new kri.default(ne,R);return L.tooltip!==void 0&&(H.tooltip=L.tooltip),L.data!==void 0&&L.data!==null&&(H.data=L.data),H}async function wc(L,ne){if(L)return kr.map(L,ad,ne)}function Ca(L){return new li.Color(L.red,L.green,L.blue,L.alpha)}function Ld(L){return new li.ColorInformation(p(L.range),Ca(L.color))}async function fh(L,ne){if(L)return kr.map(L,Ld,ne)}function Fu(L){let ne=new li.ColorPresentation(L.label);return ne.additionalTextEdits=De(L.additionalTextEdits),L.textEdit&&(ne.textEdit=re(L.textEdit)),ne}async function bc(L,ne){if(L)return kr.map(L,Fu,ne)}function Zh(L){if(L)switch(L){case Kn.FoldingRangeKind.Comment:return li.FoldingRangeKind.Comment;case Kn.FoldingRangeKind.Imports:return li.FoldingRangeKind.Imports;case Kn.FoldingRangeKind.Region:return li.FoldingRangeKind.Region}}function Cc(L){return new li.FoldingRange(L.startLine,L.endLine,Zh(L.kind))}async function nr(L,ne){if(L)return kr.map(L,Cc,ne)}function Rs(L){return new li.SelectionRange(p(L.range),L.parent?Rs(L.parent):void 0)}async function Ml(L,ne){return Array.isArray(L)?kr.map(L,Rs,ne):[]}function Se(L){return Kn.InlineValueText.is(L)?new li.InlineValueText(p(L.range),L.text):Kn.InlineValueVariableLookup.is(L)?new li.InlineValueVariableLookup(p(L.range),L.variableName,L.caseSensitiveLookup):new li.InlineValueEvaluatableExpression(p(L.range),L.expression)}async function Mo(L,ne){return Array.isArray(L)?kr.map(L,Se,ne):[]}async function cd(L,ne){const R=typeof L.label=="string"?L.label:await kr.map(L.label,K,ne),H=new Mri.default(f(L.position),R);return L.kind!==void 0&&(H.kind=L.kind),L.textEdits!==void 0&&(H.textEdits=await me(L.textEdits,ne)),L.tooltip!==void 0&&(H.tooltip=Le(L.tooltip)),L.paddingLeft!==void 0&&(H.paddingLeft=L.paddingLeft),L.paddingRight!==void 0&&(H.paddingRight=L.paddingRight),L.data!==void 0&&(H.data=L.data),H}function K(L){const ne=new li.InlayHintLabelPart(L.value);return L.location!==void 0&&(ne.location=Ji(L.location)),L.tooltip!==void 0&&(ne.tooltip=Le(L.tooltip)),L.command!==void 0&&(ne.command=tl(L.command)),ne}function Le(L){return typeof L=="string"?L:C(L)}async function ri(L,ne){if(Array.isArray(L))return kr.mapAsync(L,cd,ne)}function ts(L){if(L===null)return;const ne=new Lri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Os(L,ne){if(L!==null)return kr.map(L,ts,ne)}async function sr(L,ne){return new li.CallHierarchyIncomingCall(ts(L.from),await m(L.fromRanges,ne))}async function ya(L,ne){if(L!==null)return kr.mapAsync(L,sr,ne)}async function yc(L,ne){return new li.CallHierarchyOutgoingCall(ts(L.to),await m(L.fromRanges,ne))}async function Ou(L,ne){if(L!==null)return kr.mapAsync(L,yc,ne)}async function le(L,ne){if(L!=null)return new li.SemanticTokens(new Uint32Array(L.data),L.resultId)}function _r(L){return new li.SemanticTokensEdit(L.start,L.deleteCount,L.data!==void 0?new Uint32Array(L.data):void 0)}async function No(L,ne){if(L!=null)return new li.SemanticTokensEdits(L.edits.map(_r),L.resultId)}function mn(L){return L}async function ve(L,ne){if(L!=null)return new li.LinkedEditingRanges(await m(L.ranges,ne),ct(L.wordPattern))}function ct(L){if(L!=null)return new RegExp(L)}function Ht(L){if(L===null)return;let ne=new Tri.default(gs(L.kind),L.name,L.detail||"",o(L.uri),p(L.range),p(L.selectionRange),L.data);return L.tags!==void 0&&(ne.tags=Hn(L.tags)),ne}async function Ei(L,ne){if(L!==null)return kr.map(L,Ht,ne)}function Ut(L){if(dv.string(L))return L;if(Kn.RelativePattern.is(L)){if(Kn.URI.is(L.baseUri))return new li.RelativePattern(o(L.baseUri),L.pattern);if(Kn.WorkspaceFolder.is(L.baseUri)){const ne=li.workspace.getWorkspaceFolder(o(L.baseUri.uri));return ne!==void 0?new li.RelativePattern(ne,L.pattern):void 0}}}async function G(L,ne){if(!L)return;if(Array.isArray(L))return kr.map(L,ie=>de(ie),ne);const R=L,H=await kr.map(R.items,ie=>de(ie),ne);return new li.InlineCompletionList(H)}function de(L){let ne;typeof L.insertText=="string"?ne=L.insertText:ne=new li.SnippetString(L.insertText.value);let R;L.command&&(R=tl(L.command));const H=new li.InlineCompletionItem(ne,p(L.range),R);return L.filterText&&(H.filterText=L.filterText),H}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:y,asCompletionResult:S,asCompletionItem:z,asTextEdit:re,asTextEdits:me,asSignatureHelp:Qe,asSignatureInformations:Tt,asSignatureInformation:Oe,asParameterInformations:wt,asParameterInformation:Nt,asDeclarationResult:Vi,asDefinitionResult:Gn,asLocation:Ji,asReferences:ec,asDocumentHighlights:ys,asDocumentHighlight:mr,asDocumentHighlightKind:ba,asSymbolKind:gs,asSymbolTag:ir,asSymbolTags:Hn,asSymbolInformations:ki,asSymbolInformation:vc,asDocumentSymbols:gh,asDocumentSymbol:Qn,asCommand:tl,asCommands:Tl,asCodeAction:Jh,asCodeActionKind:Fc,asCodeActionKinds:rd,asCodeActionResult:Af,asCodeLens:il,asCodeLenses:Rl,asWorkspaceEdit:Xh,asDocumentLink:ad,asDocumentLinks:wc,asFoldingRangeKind:Zh,asFoldingRange:Cc,asFoldingRanges:nr,asColor:Ca,asColorInformation:Ld,asColorInformations:fh,asColorPresentation:Fu,asColorPresentations:bc,asSelectionRange:Rs,asSelectionRanges:Ml,asInlineValue:Se,asInlineValues:Mo,asInlayHint:cd,asInlayHints:ri,asSemanticTokensLegend:mn,asSemanticTokens:le,asSemanticTokensEdit:_r,asSemanticTokensEdits:No,asCallHierarchyItem:ts,asCallHierarchyItems:Os,asCallHierarchyIncomingCall:sr,asCallHierarchyIncomingCalls:ya,asCallHierarchyOutgoingCall:yc,asCallHierarchyOutgoingCalls:Ou,asLinkedEditingRanges:ve,asTypeHierarchyItem:Ht,asTypeHierarchyItems:Ei,asGlobPattern:Ut,asInlineCompletionResult:G,asInlineCompletionItem:de}}zue.createConverter=Nri;var dj={};Object.defineProperty(dj,"__esModule",{value:!0});dj.ProgressPart=void 0;const pqe=as,mqe=Ts,_qe=ea;class Pri{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(mqe.WorkDoneProgress.type,this._token,s=>{switch(s.kind){case"begin":this.begin(s);break;case"report":this.report(s);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&pqe.window.withProgress({location:pqe.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,i)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=i,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(mqe.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((s,o)=>{this._resolve=s,this._reject=o})})}report(e){if(this._infinite&&_qe.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(_qe.number(e.percentage)){const t=Math.max(0,Math.min(e.percentage,100)),i=Math.max(0,t-this._reported);this._reported+=i,this._progress!==void 0&&this._progress.report({message:e.message,increment:i})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}}dj.ProgressPart=Pri;var $ue={};Object.defineProperty($ue,"__esModule",{value:!0});$ue.NotebookDocumentSyncFeature=void 0;const Og=as,Fri=Rue,qE=Ts,Ori=Er,vqe=ea;function wqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}var T2;(function(n){(function(e){function t(h,u){return{version:h.version,uri:u.asUri(h.uri)}}e.asVersionedNotebookDocumentIdentifier=t;function i(h,u,f){const p=qE.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,s(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function s(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=s;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=qE.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=o(h.metadata)),h.executionSummary!==void 0&&vqe.number(h.executionSummary.executionOrder)&&vqe.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case Og.NotebookCellKind.Markup:return qE.NotebookCellKind.Markup;case Og.NotebookCellKind.Code:return qE.NotebookCellKind.Code}}function c(h,u){if(h.has(u))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(u)){const f=[];for(const p of u)if(p!==null&&typeof p=="object"||Array.isArray(p))f.push(c(h,p));else{if(p instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");f.push(p)}return f}else{const f=Object.keys(u),p=Object.create(null);for(const m of f){const v=u[m];if(v!==null&&typeof v=="object"||Array.isArray(v))p[m]=c(h,v);else{if(v instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");p[m]=v}}return p}}function l(h,u){const f=u.asChangeTextDocumentParams(h,h.document.uri,h.document.version);return{document:f.textDocument,changes:f.contentChanges}}e.asTextContentChange=l;function d(h,u){const f=Object.create(null);if(h.metadata&&(f.metadata=n.c2p.asMetadata(h.metadata)),h.cells!==void 0){const p=Object.create(null),m=h.cells;m.structure&&(p.structure={array:{start:m.structure.array.start,deleteCount:m.structure.array.deleteCount,cells:m.structure.array.cells!==void 0?m.structure.array.cells.map(v=>n.c2p.asNotebookCell(v,u)):void 0},didOpen:m.structure.didOpen!==void 0?m.structure.didOpen.map(v=>u.asOpenTextDocumentParams(v.document).textDocument):void 0,didClose:m.structure.didClose!==void 0?m.structure.didClose.map(v=>u.asCloseTextDocumentParams(v.document).textDocument):void 0}),m.data!==void 0&&(p.data=m.data.map(v=>n.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>n.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(n.c2p||(n.c2p={}))})(T2||(T2={}));var xRe;(function(n){function e(a,c,l){const d=a.length,h=c.length;let u=0;for(;u=0&&p>=0&&t(a[f],c[p],l);)f--,p--;const m=f+1-u,v=u===p+1?void 0:c.slice(u,p+1);return v!==void 0?{start:u,deleteCount:m,cells:v}:{start:u,deleteCount:m}}else return ui.document.uri.toString()))}}n.create=e})(jre||(jre={}));class IY{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)),Og.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of Og.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);Og.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&Og.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),Og.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of Og.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return Og.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(Og.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),s=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(s&&o||!s&&!o)return;if(s){const r=this.getMatchingCells(e);if(r!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,r);a!==void 0&&this.doSendChange(a,r).catch(()=>{})}}}else s&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){Og.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){const i=this.notebookSyncInfo.get(e.uri.toString());if(i===void 0)return;const s=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===s.toString());if(o!==-1)if(o===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const r=i.cells.slice(),a=r.splice(o,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:o,deleteCount:1},didClose:a}}},r).catch(()=>{})}}dispose(){for(const e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),i=this.notebookSyncInfo.get(e.uri.toString())){if(i!==void 0)if(t!==void 0){const s=this.asNotebookDocumentChangeEvent(e,void 0,i,t);s!==void 0&&this.doSendChange(s,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){const t=e.notebook,i=this.notebookSyncInfo.get(t.uri.toString());if(i===void 0){if(e.contentChanges.length===0)return;const s=this.getMatchingCells(t);if(s===void 0)return;this.didOpen(t,s,i)}else{const s=this.getMatchingCells(t);if(s===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,s);o!==void 0&&this.doSendChange(o,s).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;const i=e.getCells().filter(s=>t.uris.has(s.document.uri.toString()));this.doSendClose(e,i).catch(()=>{})}async sendDidOpenNotebookDocument(e){const t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){const i=async(o,r)=>{const a=T2.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(qE.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),jre.create(t)),s?.didOpen!==void 0?s.didOpen(e,t,i):i(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){const i=async o=>{try{await this.client.sendNotification(qE.DidChangeNotebookDocumentNotification.type,{notebookDocument:T2.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:T2.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},s=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),jre.create(t??[])),s?.didChange!==void 0?s?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async s=>{try{await this.client.sendNotification(qE.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(s.uri)}})}catch(o){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",o),o}},i=this.client.middleware?.notebooks;return i?.didSave!==void 0?i.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){const i=async(o,r)=>{try{await this.client.sendNotification(qE.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(o.uri)},cellTextDocuments:r.map(a=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(a.document))})}catch(a){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",a),a}},s=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),s?.didClose!==void 0?s.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,s){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=T2.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(s.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)r.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(o.cells=o.cells??{},o.cells.data=a)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&i!==void 0&&s!==void 0){const a=i.cells,c=s,l=xRe.computeDiff(a,c,!1);let d,h;if(l!==void 0){d=l.cells===void 0?new Map:new Map(l.cells.map(p=>[p.document.uri.toString(),p])),h=l.deleteCount===0?new Map:new Map(a.slice(l.start,l.start+l.deleteCount).map(p=>[p.document.uri.toString(),p]));for(const p of Array.from(h.keys()))d.has(p)&&(h.delete(p),d.delete(p));o.cells=o.cells??{};const u=[],f=[];if(d.size>0||h.size>0){for(const p of d.values())u.push(p);for(const p of h.values())f.push(p)}o.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(o).length>1?o:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(const i of this.options.notebookSelector)if(i.notebook===void 0||DRe.matchNotebook(i.notebook,e)){const s=this.filterCells(e,t,i.cells);return s.length===0?void 0:s}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const s=i!==void 0?t.filter(o=>{const r=o.document.languageId;return i.some(a=>a.language==="*"||r===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,s):s}}class FR{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=qE.NotebookDocumentSyncRegistrationType.type,Og.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didOpenNotebookCellTextDocument(i,s)}),Og.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==FR.CellScheme)return;const[s]=this.findNotebookDocumentAndCell(i);if(s!==void 0)for(const o of this.registrations.values())o instanceof IY&&o.didChangeNotebookCellTextDocument(s,t)}),Og.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==FR.CellScheme)return;const[i,s]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||s===void 0))for(const o of this.registrations.values())o instanceof IY&&o.didCloseNotebookCellTextDocument(i,s)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(const e of this.registrations.values()){const t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){const t=wqe(wqe(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Qre.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??Ori.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new IY(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){const t=this.registrations.get(e);t&&t.dispose()}clear(){for(const e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==FR.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&Og.languages.match(this.dedicatedChannel,e)>0)return!0;for(const t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(const t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){const t=e.uri.toString();for(const i of Og.workspace.notebookDocuments)for(const s of i.getCells())if(s.document.uri.toString()===t)return[i,s];return[void 0,void 0]}}$ue.NotebookDocumentSyncFeature=FR;FR.CellScheme="vscode-notebook-cell";var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.SyncConfigurationFeature=n0.toJSONObject=n0.ConfigurationFeature=void 0;const dH=as,e$=Ts,Bri=ea,Wri=Er,bqe=$n;class Hri{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(e$.ConfigurationRequest.type,(t,i)=>{let s=r=>{let a=[];for(let c of r.items){let l=c.scopeUri!==void 0&&c.scopeUri!==null?this._client.protocol2CodeConverter.asUri(c.scopeUri):void 0;a.push(this.getConfiguration(l,c.section!==null?c.section:void 0))}return a},o=e.middleware.workspace;return o&&o.configuration?o.configuration(t,i,s):s(t)})}getConfiguration(e,t){let i=null;if(t){let s=t.lastIndexOf(".");if(s===-1)i=JM(dH.workspace.getConfiguration(void 0,e).get(t));else{let o=dH.workspace.getConfiguration(t.substr(0,s),e);o&&(i=JM(o.get(t.substr(s+1))))}}else{let s=dH.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(s))s.has(o)&&(i[o]=JM(s.get(o)))}return i===void 0&&(i=null),i}clear(){}}n0.ConfigurationFeature=Hri;function JM(n){if(n){if(Array.isArray(n))return n.map(JM);if(typeof n=="object"){const e=Object.create(null);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=JM(n[t]));return e}}return n}n0.toJSONObject=JM;class Uri{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return e$.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,bqe.ensure)((0,bqe.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Wri.generateUuid(),registerOptions:{section:e}})}register(e){let t=dH.workspace.onDidChangeConfiguration(i=>{this.onDidChangeConfiguration(e.registerOptions.section,i)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(const e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let i;if(Bri.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const s=async r=>r===void 0?this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(e$.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,s):s(i)).catch(r=>{this._client.error(`Sending notification ${e$.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=dH.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=dH.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(s,l)[l[l.length-1]]=JM(c)}}return s}}n0.SyncConfigurationFeature=Uri;var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.DidSaveTextDocumentFeature=tm.WillSaveWaitUntilFeature=tm.WillSaveFeature=tm.DidChangeTextDocumentFeature=tm.DidCloseTextDocumentFeature=tm.DidOpenTextDocumentFeature=void 0;const g_=as,ac=Ts,Al=$n,Xz=Er;class Vri extends Al.TextDocumentEventFeature{constructor(e,t){super(e,g_.workspace.onDidOpenTextDocument,ac.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return ac.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);g_.workspace.textDocuments.forEach(i=>{const s=i.uri.toString();if(!this._syncedDocuments.has(s)&&g_.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));(o.didOpen?o.didOpen(i,r):r(i)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)}),this._syncedDocuments.set(s,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}tm.DidOpenTextDocumentFeature=Vri;class zri extends Al.TextDocumentEventFeature{constructor(e,t,i){super(e,g_.workspace.onDidCloseTextDocument,ac.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,s=>e.code2ProtocolConverter.asCloseTextDocumentParams(s),s=>s,Al.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return ac.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,i)}unregister(e){const t=this._selectors.get(e);super.unregister(e);const i=this._selectors.values();this._syncedDocuments.forEach(s=>{if(g_.languages.match(t,s)>0&&!this._selectorFilter(i,s)&&!this._client.hasDedicatedTextSynchronizationFeature(s)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(s.uri.toString()),(o.didClose?o.didClose(s,r):r(s)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}tm.DidCloseTextDocumentFeature=zri;class $ri extends Al.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new g_.EventEmitter,this._onPendingChangeAdded=new g_.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=ac.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return ac.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==ac.TextDocumentSyncKind.None&&this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=g_.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(const e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;const t=e.document.uri,i=e.document.version,s=[];for(const o of this._changeData.values())if(g_.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===ac.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(ac.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,ac.DidChangeTextDocumentNotification.type,l)};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===ac.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};s.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(s).then(void 0,o=>{throw this._client.error(`Sending document notification ${ac.DidChangeTextDocumentNotification.type.method} failed`,o),o})}notificationSent(e,t,i){this._onNotificationSent.fire({textDocument:e,type:t,params:i})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=ac.TextDocumentSyncKind.None;else{this._syncKind=ac.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===ac.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=ac.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(const i of this._pendingTextDocumentChanges)e.has(i[0])||(t.push(i[1]),this._pendingTextDocumentChanges.delete(i[0]))}return t}getProvider(e){for(const t of this._changeData.values())if(g_.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==ac.TextDocumentSyncKind.Full)switch(e){case ac.TextDocumentSyncKind.Full:this._syncKind=e;break;case ac.TextDocumentSyncKind.Incremental:this._syncKind===ac.TextDocumentSyncKind.None&&(this._syncKind=ac.TextDocumentSyncKind.Incremental);break}}}tm.DidChangeTextDocumentFeature=$ri;class Gri extends Al.TextDocumentEventFeature{constructor(e){super(e,g_.workspace.onWillSaveTextDocument,ac.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Al.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return ac.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}tm.WillSaveFeature=Gri;class qri extends Al.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return ac.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:Xz.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=g_.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Al.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=s=>this._client.sendRequest(ac.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(s)).then(async o=>{let r=await this._client.protocol2CodeConverter.asTextEdits(o);return r===void 0?[]:r});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}}tm.WillSaveWaitUntilFeature=qri;class Qri extends Al.TextDocumentEventFeature{constructor(e){super(e,g_.workspace.onDidSaveTextDocument,ac.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Al.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return ac.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Al.ensure)((0,Al.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const s=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:Xz.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},s)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}tm.DidSaveTextDocumentFeature=Qri;var Gue={};Object.defineProperty(Gue,"__esModule",{value:!0});Gue.CompletionItemFeature=void 0;const jri=as,Go=Ts,Nme=$n,Kri=Er,Yri=[Go.CompletionItemKind.Text,Go.CompletionItemKind.Method,Go.CompletionItemKind.Function,Go.CompletionItemKind.Constructor,Go.CompletionItemKind.Field,Go.CompletionItemKind.Variable,Go.CompletionItemKind.Class,Go.CompletionItemKind.Interface,Go.CompletionItemKind.Module,Go.CompletionItemKind.Property,Go.CompletionItemKind.Unit,Go.CompletionItemKind.Value,Go.CompletionItemKind.Enum,Go.CompletionItemKind.Keyword,Go.CompletionItemKind.Snippet,Go.CompletionItemKind.Color,Go.CompletionItemKind.File,Go.CompletionItemKind.Reference,Go.CompletionItemKind.Folder,Go.CompletionItemKind.EnumMember,Go.CompletionItemKind.Constant,Go.CompletionItemKind.Struct,Go.CompletionItemKind.Event,Go.CompletionItemKind.Operator,Go.CompletionItemKind.TypeParameter];class Jri extends Nme.TextDocumentLanguageFeature{constructor(e){super(e,Go.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Nme.ensure)((0,Nme.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[Go.MarkupKind.Markdown,Go.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[Go.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[Go.InsertTextMode.asIs,Go.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=Go.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Yri},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:Kri.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],s=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,w)=>h.sendRequest(Go.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),w).then(b=>w.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(b,s,w),b=>h.handleFailedRequest(Go.CompletionRequest.type,w,b,null));return u.provideCompletionItem?u.provideCompletionItem(a,c,d,l,f):f(a,c,d,l)},resolveCompletionItem:e.resolveProvider?(a,c)=>{const l=this._client,d=this._client.middleware,h=(u,f)=>l.sendRequest(Go.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(Go.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[jri.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}Gue.CompletionItemFeature=Jri;var que={};Object.defineProperty(que,"__esModule",{value:!0});que.HoverFeature=void 0;const Xri=as,K5=Ts,Pme=$n,Zri=Er;class eai extends Pme.TextDocumentLanguageFeature{constructor(e){super(e,K5.HoverRequest.type)}fillClientCapabilities(e){const t=(0,Pme.ensure)((0,Pme.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[K5.MarkupKind.Markdown,K5.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:Zri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(K5.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(K5.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Xri.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}que.HoverFeature=eai;var Que={};Object.defineProperty(Que,"__esModule",{value:!0});Que.DefinitionFeature=void 0;const tai=as,Fme=Ts,Ome=$n,iai=Er;class nai extends Ome.TextDocumentLanguageFeature{constructor(e){super(e,Fme.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Ome.ensure)((0,Ome.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:iai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Fme.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Fme.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return tai.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Que.DefinitionFeature=nai;var jue={};Object.defineProperty(jue,"__esModule",{value:!0});jue.SignatureHelpFeature=void 0;const Cqe=as,Y5=Ts,Bme=$n,sai=Er;class oai extends Bme.TextDocumentLanguageFeature{constructor(e){super(e,Y5.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Bme.ensure)((0,Bme.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[Y5.MarkupKind.Markdown,Y5.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.signatureHelpProvider);i&&this.register({id:sai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,s,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(Y5.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(Y5.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,s,r,o,c):c(i,s,r,o)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){const i=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){const s=e.triggerCharacters||[];return Cqe.languages.registerSignatureHelpProvider(i,t,...s)}else{const s={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return Cqe.languages.registerSignatureHelpProvider(i,t,s)}}}jue.SignatureHelpFeature=oai;var Kue={};Object.defineProperty(Kue,"__esModule",{value:!0});Kue.DocumentHighlightFeature=void 0;const rai=as,Wme=Ts,Hme=$n,aai=Er;class cai extends Hme.TextDocumentLanguageFeature{constructor(e){super(e,Wme.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Hme.ensure)((0,Hme.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:aai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Wme.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(Wme.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(s,o,r,c):c(s,o,r)}};return[rai.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Kue.DocumentHighlightFeature=cai;var pBe={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DocumentSymbolFeature=n.SupportedSymbolTags=n.SupportedSymbolKinds=void 0;const e=as,t=Ts,i=$n,s=Er;n.SupportedSymbolKinds=[t.SymbolKind.File,t.SymbolKind.Module,t.SymbolKind.Namespace,t.SymbolKind.Package,t.SymbolKind.Class,t.SymbolKind.Method,t.SymbolKind.Property,t.SymbolKind.Field,t.SymbolKind.Constructor,t.SymbolKind.Enum,t.SymbolKind.Interface,t.SymbolKind.Function,t.SymbolKind.Variable,t.SymbolKind.Constant,t.SymbolKind.String,t.SymbolKind.Number,t.SymbolKind.Boolean,t.SymbolKind.Array,t.SymbolKind.Object,t.SymbolKind.Key,t.SymbolKind.Null,t.SymbolKind.EnumMember,t.SymbolKind.Struct,t.SymbolKind.Event,t.SymbolKind.Operator,t.SymbolKind.TypeParameter],n.SupportedSymbolTags=[t.SymbolTag.Deprecated];class o extends i.TextDocumentLanguageFeature{constructor(a){super(a,t.DocumentSymbolRequest.type)}fillClientCapabilities(a){let c=(0,i.ensure)((0,i.ensure)(a,"textDocument"),"documentSymbol");c.dynamicRegistration=!0,c.symbolKind={valueSet:n.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:n.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:s.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,w)=>{try{const b=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),w);if(w.isCancellationRequested||b===void 0||b===null)return null;if(b.length===0)return[];{const C=b[0];return t.DocumentSymbol.is(C)?await f.protocol2CodeConverter.asDocumentSymbols(b,w):await f.protocol2CodeConverter.asSymbolInformations(b,w)}}catch(b){return f.handleFailedRequest(t.DocumentSymbolRequest.type,w,b,null)}},m=f.middleware;return m.provideDocumentSymbols?m.provideDocumentSymbols(h,u,p):p(h,u)}},d=a.label!==void 0?{label:a.label}:void 0;return[e.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(c),l,d),l]}}n.DocumentSymbolFeature=o})(pBe);var Yue={};Object.defineProperty(Yue,"__esModule",{value:!0});Yue.WorkspaceSymbolFeature=void 0;const lai=as,J5=Ts,Ume=$n,yqe=pBe,dai=Er;class hai extends Ume.WorkspaceFeature{constructor(e){super(e,J5.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Ume.ensure)((0,Ume.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:yqe.SupportedSymbolKinds},t.tagSupport={valueSet:yqe.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:dai.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(J5.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,s,r):r(i,s)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,s)=>{const o=this._client,r=(c,l)=>o.sendRequest(J5.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(J5.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,s,r):r(i,s)}:void 0};return[lai.languages.registerWorkspaceSymbolProvider(t),t]}}Yue.WorkspaceSymbolFeature=hai;var Jue={};Object.defineProperty(Jue,"__esModule",{value:!0});Jue.ReferencesFeature=void 0;const uai=as,Vme=Ts,zme=$n,gai=Er;class fai extends zme.TextDocumentLanguageFeature{constructor(e){super(e,Vme.ReferencesRequest.type)}fillClientCapabilities(e){(0,zme.ensure)((0,zme.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:gai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(Vme.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(Vme.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(s,o,r,a,l):l(s,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return uai.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Jue.ReferencesFeature=fai;var Xue={};Object.defineProperty(Xue,"__esModule",{value:!0});Xue.CodeActionFeature=void 0;const pai=as,Wm=Ts,mai=Er,$me=$n;class _ai extends $me.TextDocumentLanguageFeature{constructor(e){super(e,Wm.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,$me.ensure)((0,$me.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Wm.CodeActionKind.Empty,Wm.CodeActionKind.QuickFix,Wm.CodeActionKind.Refactor,Wm.CodeActionKind.RefactorExtract,Wm.CodeActionKind.RefactorInline,Wm.CodeActionKind.RefactorRewrite,Wm.CodeActionKind.Source,Wm.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:mai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(s,o,r,a)=>{const c=this._client,l=async(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),context:c.code2ProtocolConverter.asCodeActionContextSync(f)};return c.sendRequest(Wm.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Wm.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(s,o,r,a,l):l(s,o,r,a)},resolveCodeAction:e.resolveProvider?(s,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(Wm.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(Wm.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(s,o,c):c(s,o)}:void 0};return[pai.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}Xue.CodeActionFeature=_ai;var Zue={};Object.defineProperty(Zue,"__esModule",{value:!0});Zue.CodeLensFeature=void 0;const Sqe=as,hB=Ts,vai=Er,X5=$n;class wai extends X5.TextDocumentLanguageFeature{constructor(e){super(e,hB.CodeLensRequest.type)}fillClientCapabilities(e){(0,X5.ensure)((0,X5.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,X5.ensure)((0,X5.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(hB.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const s=this.getRegistrationOptions(t,e.codeLensProvider);s&&this.register({id:vai.generateUuid(),registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Sqe.EventEmitter,s={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(hB.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(o,r,c):c(o,r)},resolveCodeLens:e.resolveProvider?(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(hB.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(hB.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[Sqe.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeCodeLensEmitter:i}]}}Zue.CodeLensFeature=wai;var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.DocumentOnTypeFormattingFeature=s0.DocumentRangeFormattingFeature=s0.DocumentFormattingFeature=void 0;const ege=as,Rb=Ts,mBe=Er,Lx=$n;var sz;(function(n){function e(t){const i=ege.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}n.fromConfiguration=e})(sz||(sz={}));class bai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,sz.fromConfiguration(d))};return a.sendRequest(Rb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(Rb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(s,o,r,c):c(s,o,r)}};return[ege.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentFormattingFeature=bai;class Cai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(s,o,r,a,l):l(s,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{const m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:c.code2ProtocolConverter.asRanges(u),options:c.code2ProtocolConverter.asFormattingOptions(f,sz.fromConfiguration(h))};return c.sendRequest(Rb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(Rb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(s,o,r,a,l):l(s,o,r,a)}),[ege.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}s0.DocumentRangeFormattingFeature=Cai;class yai extends Lx.TextDocumentLanguageFeature{constructor(e){super(e,Rb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,Lx.ensure)((0,Lx.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:mBe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(o,r,a,c,l)=>{const d=this._client,h=(f,p,m,v,w)=>{let b={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,sz.fromConfiguration(f))};return d.sendRequest(Rb.DocumentOnTypeFormattingRequest.type,b,w).then(C=>w.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(C,w),C=>d.handleFailedRequest(Rb.DocumentOnTypeFormattingRequest.type,w,C,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},s=e.moreTriggerCharacter||[];return[ege.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...s),i]}}s0.DocumentOnTypeFormattingFeature=yai;var tge={};Object.defineProperty(tge,"__esModule",{value:!0});tge.RenameFeature=void 0;const Sai=as,BL=Ts,Aai=Er,Aqe=ea,Gme=$n;class Eai extends Gme.TextDocumentLanguageFeature{constructor(e){super(e,BL.RenameRequest.type)}fillClientCapabilities(e){let t=(0,Gme.ensure)((0,Gme.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=BL.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(Aqe.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Aai.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(s,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>{let m={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),position:c.code2ProtocolConverter.asPosition(u),newName:f};return c.sendRequest(BL.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(BL.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(s,o,r,a,l):l(s,o,r,a)},prepareRename:e.prepareProvider?(s,o,r)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(BL.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:BL.Range.is(p)?a.protocol2CodeConverter.asRange(p):this.isDefaultBehavior(p)?p.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):p&&BL.Range.is(p.range)?{range:a.protocol2CodeConverter.asRange(p.range),placeholder:p.placeholder}:Promise.reject(new Error("The element can't be renamed.")),p=>{throw typeof p.message=="string"?new Error(p.message):new Error("The element can't be renamed.")})},l=a.middleware;return l.prepareRename?l.prepareRename(s,o,r,c):c(s,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Sai.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&Aqe.boolean(t.defaultBehavior)}}tge.RenameFeature=Eai;var ige={};Object.defineProperty(ige,"__esModule",{value:!0});ige.DocumentLinkFeature=void 0;const xai=as,Z5=Ts,qme=$n,Dai=Er;class kai extends qme.TextDocumentLanguageFeature{constructor(e){super(e,Z5.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,qme.ensure)((0,qme.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:Dai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(s,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(Z5.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(Z5.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(s,o,a):a(s,o)},resolveDocumentLink:e.resolveProvider?(s,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(Z5.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(Z5.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(s,o,a):a(s,o)}:void 0};return[xai.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}ige.DocumentLinkFeature=kai;var nge={};Object.defineProperty(nge,"__esModule",{value:!0});nge.ExecuteCommandFeature=void 0;const Iai=as,Qme=Ts,Lai=Er,Eqe=$n;class Tai{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return Qme.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Eqe.ensure)((0,Eqe.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Lai.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,s=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(Qme.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(Qme.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Iai.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,s):s(r,a)));this._commands.set(e.id,o)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}}nge.ExecuteCommandFeature=Tai;var sge={};Object.defineProperty(sge,"__esModule",{value:!0});sge.FileSystemWatcherFeature=void 0;const Rai=as,WL=Ts,LY=$n;class Mai{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return WL.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,LY.ensure)((0,LY.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;const t=[];for(const i of e.registerOptions.watchers){const s=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(s===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&WL.WatchKind.Create)!==0,r=(i.kind&WL.WatchKind.Change)!==0,a=(i.kind&WL.WatchKind.Delete)!==0);const c=Rai.workspace.createFileSystemWatcher(s,!o,!r,!a);this.hookListeners(c,o,r,a,t),t.push(c)}this._watchers.set(e.id,t)}registerRaw(e,t){let i=[];for(let s of t)this.hookListeners(s,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,s,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Changed}),null,o),s&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:WL.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}sge.FileSystemWatcherFeature=Mai;var oge={};Object.defineProperty(oge,"__esModule",{value:!0});oge.ColorProviderFeature=void 0;const Nai=as,e3=Ts,jme=$n;class Pai extends jme.TextDocumentLanguageFeature{constructor(e){super(e,e3.DocumentColorRequest.type)}fillClientCapabilities(e){(0,jme.ensure)((0,jme.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.colorProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(s,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={color:d,textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:a.code2ProtocolConverter.asRange(h.range)};return a.sendRequest(e3.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(e3.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(s,o,r,c):c(s,o,r)},provideDocumentColors:(s,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(e3.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(e3.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(s,o,a):a(s,o)}};return[Nai.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}oge.ColorProviderFeature=Pai;var rge={};Object.defineProperty(rge,"__esModule",{value:!0});rge.ImplementationFeature=void 0;const Fai=as,Kme=Ts,Yme=$n;class Oai extends Yme.TextDocumentLanguageFeature{constructor(e){super(e,Kme.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Yme.ensure)((0,Yme.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.implementationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Kme.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Kme.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Fai.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rge.ImplementationFeature=Oai;var age={};Object.defineProperty(age,"__esModule",{value:!0});age.TypeDefinitionFeature=void 0;const Bai=as,Jme=Ts,t3=$n;class Wai extends t3.TextDocumentLanguageFeature{constructor(e){super(e,Jme.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,t3.ensure)((0,t3.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.typeDefinitionProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Jme.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Jme.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Bai.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}age.TypeDefinitionFeature=Wai;var oz={};Object.defineProperty(oz,"__esModule",{value:!0});oz.WorkspaceFoldersFeature=oz.arrayDiff=void 0;const Hai=Er,TY=as,i3=Ts;function Xme(n,e){if(n!=null)return n[e]}function kRe(n,e){return n.filter(t=>e.indexOf(t)<0)}oz.arrayDiff=kRe;class Uai{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return i3.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=TY.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){const t=this._client;t.onRequest(i3.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=TY.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(o,r):r()});const i=Xme(Xme(Xme(e,"workspace"),"workspaceFolders"),"changeNotifications");let s;typeof i=="string"?s=i:i===!0&&(s=Hai.generateUuid()),s&&this.register({id:s,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=kRe(this._initialFolders,e),s=kRe(e,this._initialFolders);(s.length>0||i.length>0)&&(t=this.doSendEvent(s,i))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(i=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(s=>this.asProtocol(s)),removed:t.map(s=>this.asProtocol(s))}};return this._client.sendNotification(i3.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,s=TY.workspace.onDidChangeWorkspaceFolders(o=>{let r=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(o,r):r(o)).catch(l=>{this._client.error(`Sending notification ${i3.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,s),this.sendInitialEvent(TY.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}oz.WorkspaceFoldersFeature=Uai;var cge={};Object.defineProperty(cge,"__esModule",{value:!0});cge.FoldingRangeFeature=void 0;const xqe=as,HL=Ts,n3=$n;class Vai extends n3.TextDocumentLanguageFeature{constructor(e){super(e,HL.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,n3.ensure)((0,n3.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[HL.FoldingRangeKind.Comment,HL.FoldingRangeKind.Imports,HL.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,n3.ensure)((0,n3.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(HL.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,s]=this.getRegistration(t,e.foldingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new xqe.EventEmitter,s={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(o,r,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(HL.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(HL.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[xqe.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),s),{provider:s,onDidChangeFoldingRange:i}]}}cge.FoldingRangeFeature=Vai;var lge={};Object.defineProperty(lge,"__esModule",{value:!0});lge.DeclarationFeature=void 0;const zai=as,Zme=Ts,e_e=$n;class $ai extends e_e.TextDocumentLanguageFeature{constructor(e){super(e,Zme.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,e_e.ensure)((0,e_e.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.declarationProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Zme.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Zme.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return zai.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lge.DeclarationFeature=$ai;var dge={};Object.defineProperty(dge,"__esModule",{value:!0});dge.SelectionRangeFeature=void 0;const Gai=as,t_e=Ts,i_e=$n;class qai extends i_e.TextDocumentLanguageFeature{constructor(e){super(e,t_e.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,i_e.ensure)((0,i_e.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.selectionRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(s,o,r)=>{const a=this._client,c=async(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),positions:a.code2ProtocolConverter.asPositionsSync(h,u)};return a.sendRequest(t_e.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(t_e.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Gai.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}dge.SelectionRangeFeature=qai;var hge={};Object.defineProperty(hge,"__esModule",{value:!0});hge.ProgressFeature=void 0;const Dqe=Ts,Qai=dj;function jai(n,e){return n[e]===void 0&&(n[e]=Object.create(null)),n[e]}class Kai{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:Dqe.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){jai(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=s=>{this.activeParts.delete(s)},i=s=>{this.activeParts.add(new Qai.ProgressPart(this._client,s.token,t))};e.onRequest(Dqe.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}hge.ProgressFeature=Kai;var uge={};Object.defineProperty(uge,"__esModule",{value:!0});uge.CallHierarchyFeature=void 0;const Yai=as,gT=Ts,n_e=$n;class Jai{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(gT.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>s.handleFailedRequest(gT.CallHierarchyPrepareRequest.type,l,h,null))};return o.prepareCallHierarchy?o.prepareCallHierarchy(e,t,i,r):r(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyIncomingCallsRequest.type,a,l,null))};return s.provideCallHierarchyIncomingCalls?s.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(gT.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(gT.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return s.provideCallHierarchyOutgoingCalls?s.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class Xai extends n_e.TextDocumentLanguageFeature{constructor(e){super(e,gT.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,n_e.ensure)((0,n_e.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.callHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new Jai(t);return[Yai.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}uge.CallHierarchyFeature=Xai;var gge={};Object.defineProperty(gge,"__esModule",{value:!0});gge.SemanticTokensFeature=void 0;const RY=as,Bs=Ts,s3=$n,Zai=ea;class eci extends s3.TextDocumentLanguageFeature{constructor(e){super(e,Bs.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,s3.ensure)((0,s3.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Bs.SemanticTokenTypes.namespace,Bs.SemanticTokenTypes.type,Bs.SemanticTokenTypes.class,Bs.SemanticTokenTypes.enum,Bs.SemanticTokenTypes.interface,Bs.SemanticTokenTypes.struct,Bs.SemanticTokenTypes.typeParameter,Bs.SemanticTokenTypes.parameter,Bs.SemanticTokenTypes.variable,Bs.SemanticTokenTypes.property,Bs.SemanticTokenTypes.enumMember,Bs.SemanticTokenTypes.event,Bs.SemanticTokenTypes.function,Bs.SemanticTokenTypes.method,Bs.SemanticTokenTypes.macro,Bs.SemanticTokenTypes.keyword,Bs.SemanticTokenTypes.modifier,Bs.SemanticTokenTypes.comment,Bs.SemanticTokenTypes.string,Bs.SemanticTokenTypes.number,Bs.SemanticTokenTypes.regexp,Bs.SemanticTokenTypes.operator,Bs.SemanticTokenTypes.decorator],t.tokenModifiers=[Bs.SemanticTokenModifiers.declaration,Bs.SemanticTokenModifiers.definition,Bs.SemanticTokenModifiers.readonly,Bs.SemanticTokenModifiers.static,Bs.SemanticTokenModifiers.deprecated,Bs.SemanticTokenModifiers.abstract,Bs.SemanticTokenModifiers.async,Bs.SemanticTokenModifiers.modification,Bs.SemanticTokenModifiers.documentation,Bs.SemanticTokenModifiers.defaultLibrary],t.formats=[Bs.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,s3.ensure)((0,s3.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Bs.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[s,o]=this.getRegistration(t,e.semanticTokensProvider);!s||!o||this.register({id:s,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=Zai.boolean(e.full)?e.full:e.full!==void 0,s=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new RY.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,w=(b,C)=>{const y={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(b)};return m.sendRequest(Bs.SemanticTokensRequest.type,y,C).then(S=>C.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(S,C),S=>m.handleFailedRequest(Bs.SemanticTokensRequest.type,C,S,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,w):w(f,p)},provideDocumentSemanticTokensEdits:s?(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),previousResultId:y};return v.sendRequest(Bs.SemanticTokensDeltaRequest.type,M,S).then(async k=>S.isCancellationRequested?null:Bs.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,S):await v.protocol2CodeConverter.asSemanticTokensEdits(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensDeltaRequest.type,S,k,null))};return w.provideDocumentSemanticTokensEdits?w.provideDocumentSemanticTokensEdits(f,p,m,b):b(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,w=v.middleware,b=(C,y,S)=>{const M={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C),range:v.code2ProtocolConverter.asRange(y)};return v.sendRequest(Bs.SemanticTokensRangeRequest.type,M,S).then(k=>S.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,S),k=>v.handleFailedRequest(Bs.SemanticTokensRangeRequest.type,S,k,null))};return w.provideDocumentRangeSemanticTokens?w.provideDocumentRangeSemanticTokens(f,p,m,b):b(f,p,m)}}:void 0,l=[],d=this._client,h=d.protocol2CodeConverter.asSemanticTokensLegend(e.legend),u=d.protocol2CodeConverter.asDocumentSelector(t);return r!==void 0&&l.push(RY.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(RY.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new RY.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}gge.SemanticTokensFeature=eci;var im={};Object.defineProperty(im,"__esModule",{value:!0});im.WillDeleteFilesFeature=im.WillRenameFilesFeature=im.WillCreateFilesFeature=im.DidDeleteFilesFeature=im.DidRenameFilesFeature=im.DidCreateFilesFeature=void 0;const Jv=as,tci=Rue,Tx=Ts,ici=Er;function kqe(n,e){return n[e]===void 0&&(n[e]={}),n[e]}function nci(n,e){return n[e]}function Iqe(n,e,t){n[e]=t}class XM{constructor(e,t,i,s,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=s,this._serverCapability=o,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){const t=kqe(kqe(e,"workspace"),"fileOperations");Iqe(t,"dynamicRegistration",!0),Iqe(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?nci(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:ici.generateUuid(),registerOptions:{filters:i.filters}})}catch(s){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${s}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const s=new tci.Minimatch(i.pattern.glob,XM.asMinimatchOptions(i.pattern.options));if(!s.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:s,kind:i.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return XM.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async o=>{const r=t(o),a=r.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==r.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(r);if(d===void 0)return this._client.error(`Failed to determine file type for ${r.toString()}.`),!0;if(d===Jv.FileType.File&&l.kind===Tx.FileOperationPatternKind.file||d===Jv.FileType.Directory&&l.kind===Tx.FileOperationPatternKind.folder)return!0}else if(l.kind===Tx.FileOperationPatternKind.folder&&await XM.getFileType(r)===Jv.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),s=e.files.filter((o,r)=>i[r]);return{...e,files:s}}static async getFileType(e){try{return(await Jv.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class wct extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._notificationType=i,this._accessUri=r,this._createParams=a}async send(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=async s=>this._client.sendNotification(this._notificationType,this._createParams(s));return this.doSend(t,i)}}}class bct extends wct{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){const t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);const i=await XM.getFileType(e);return i&&this._fsPathFileTypes.set(t,i),i}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}}class sci extends wct{constructor(e){super(e,Jv.workspace.onDidCreateFiles,Tx.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.didCreateFiles?i.didCreateFiles(e,t):t(e)}}im.DidCreateFilesFeature=sci;class oci extends bct{constructor(e){super(e,Jv.workspace.onDidRenameFiles,Tx.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didRenameFiles?i.didRenameFiles(e,t):t(e)}}im.DidRenameFilesFeature=oci;class rci extends bct{constructor(e){super(e,Jv.workspace.onDidDeleteFiles,Tx.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=Jv.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();const i=this._client.middleware.workspace;return i?.didDeleteFiles?i.didDeleteFiles(e,t):t(e)}}im.DidDeleteFilesFeature=rci;class _Be extends XM{constructor(e,t,i,s,o,r,a){super(e,t,i,s,o),this._requestType=i,this._accessUri=r,this._createParams=a}async send(e){const t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){const t=await this.filter(e,this._accessUri);if(t.files.length){const i=s=>this._client.sendRequest(this._requestType,this._createParams(s),s.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class aci extends _Be{constructor(e){super(e,Jv.workspace.onWillCreateFiles,Tx.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willCreateFiles?i.willCreateFiles(e,t):t(e)}}im.WillCreateFilesFeature=aci;class cci extends _Be{constructor(e){super(e,Jv.workspace.onWillRenameFiles,Tx.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willRenameFiles?i.willRenameFiles(e,t):t(e)}}im.WillRenameFilesFeature=cci;class lci extends _Be{constructor(e){super(e,Jv.workspace.onWillDeleteFiles,Tx.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){const i=this._client.middleware.workspace;return i?.willDeleteFiles?i.willDeleteFiles(e,t):t(e)}}im.WillDeleteFilesFeature=lci;var fge={};Object.defineProperty(fge,"__esModule",{value:!0});fge.LinkedEditingFeature=void 0;const dci=as,s_e=Ts,o_e=$n;class hci extends o_e.TextDocumentLanguageFeature{constructor(e){super(e,s_e.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,o_e.ensure)((0,o_e.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,s]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(s,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(s_e.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(s_e.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(s,o,r,c):c(s,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return dci.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}fge.LinkedEditingFeature=hci;var pge={};Object.defineProperty(pge,"__esModule",{value:!0});pge.TypeHierarchyFeature=void 0;const uci=as,fT=Ts,r_e=$n;class gci{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const s=this.client,o=this.middleware,r=(a,c,l)=>{const d=s.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return s.sendRequest(fT.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:s.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>s.handleFailedRequest(fT.TypeHierarchyPrepareRequest.type,l,h,null))};return o.prepareTypeHierarchy?o.prepareTypeHierarchy(e,t,i,r):r(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySupertypesRequest.type,a,l,null))};return s.provideTypeHierarchySupertypes?s.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,s=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(fT.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(fT.TypeHierarchySubtypesRequest.type,a,l,null))};return s.provideTypeHierarchySubtypes?s.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class fci extends r_e.TextDocumentLanguageFeature{constructor(e){super(e,fT.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,r_e.ensure)((0,r_e.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,s]=this.getRegistration(t,e.typeHierarchyProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=this._client,i=new gci(t);return[uci.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}pge.TypeHierarchyFeature=fci;var mge={};Object.defineProperty(mge,"__esModule",{value:!0});mge.InlineValueFeature=void 0;const Lqe=as,MY=Ts,o3=$n;class pci extends o3.TextDocumentLanguageFeature{constructor(e){super(e,MY.InlineValueRequest.type)}fillClientCapabilities(e){(0,o3.ensure)((0,o3.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,o3.ensure)((0,o3.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(MY.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,s]=this.getRegistration(t,e.inlineValueProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Lqe.EventEmitter,s={onDidChangeInlineValues:i.event,provideInlineValues:(o,r,a,c)=>{const l=this._client,d=(u,f,p,m)=>{const v={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(u),range:l.code2ProtocolConverter.asRange(f),context:l.code2ProtocolConverter.asInlineValueContext(p)};return l.sendRequest(MY.InlineValueRequest.type,v,m).then(w=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(w,m),w=>l.handleFailedRequest(MY.InlineValueRequest.type,m,w,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,s),{provider:s,onDidChangeInlineValues:i}]}registerProvider(e,t){return Lqe.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}mge.InlineValueFeature=pci;var _ge={};Object.defineProperty(_ge,"__esModule",{value:!0});_ge.InlayHintsFeature=void 0;const Tqe=as,uB=Ts,r3=$n;class mci extends r3.TextDocumentLanguageFeature{constructor(e){super(e,uB.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,r3.ensure)((0,r3.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,r3.ensure)((0,r3.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(uB.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,s]=this.getRegistration(t,e.inlayHintProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){const t=e.documentSelector,i=new Tqe.EventEmitter,s={onDidChangeInlayHints:i.event,provideInlayHints:(o,r,a)=>{const c=this._client,l=async(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h),range:c.code2ProtocolConverter.asRange(u)};try{const m=await c.sendRequest(uB.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(uB.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return s.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(uB.InlayHintResolveRequest.type,a.code2ProtocolConverter.asInlayHint(d),h);if(h.isCancellationRequested)return null;const f=a.protocol2CodeConverter.asInlayHint(u,h);return h.isCancellationRequested?null:f}catch(u){return a.handleFailedRequest(uB.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,s),{provider:s,onDidChangeInlayHints:i}]}registerProvider(e,t){return Tqe.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}_ge.InlayHintsFeature=mci;var vge={};Object.defineProperty(vge,"__esModule",{value:!0});vge.InlineCompletionItemFeature=void 0;const _ci=as,a_e=Ts,c_e=$n,vci=Er;class wci extends c_e.TextDocumentLanguageFeature{constructor(e){super(e,a_e.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,c_e.ensure)((0,c_e.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:vci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(s,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(a_e.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(a_e.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(s,o,r,a,d):d(s,o,r,a)}};return[_ci.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}vge.InlineCompletionItemFeature=wci;Object.defineProperty(mu,"__esModule",{value:!0});mu.ProposedFeatures=Cct=mu.BaseLanguageClient=mu.MessageTransports=mu.SuspendMode=mu.State=mu.CloseAction=mu.ErrorAction=mu.RevealOutputChannelOn=void 0;const ra=as,Ft=Ts,bci=Nue,Cci=zue,rb=ea,NY=vu,Rqe=Er,yci=dj,Vw=$n,Sci=Ix,Mqe=$ue,Nqe=n0,gB=tm,Aci=Gue,Eci=que,xci=Que,Dci=jue,kci=Kue,Ici=pBe,Lci=Yue,Tci=Jue,Rci=Xue,Mci=Zue,l_e=s0,Nci=tge,Pci=ige,Fci=nge,Oci=sge,Bci=oge,Wci=rge,Hci=age,Uci=oz,Vci=cge,zci=lge,$ci=dge,Gci=hge,qci=uge,Qci=gge,fB=im,jci=fge,Kci=pge,Yci=mge,Jci=_ge,Xci=vge;var GT;(function(n){n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error",n[n.Never=4]="Never"})(GT||(mu.RevealOutputChannelOn=GT={}));var vq;(function(n){n[n.Continue=1]="Continue",n[n.Shutdown=2]="Shutdown"})(vq||(mu.ErrorAction=vq={}));var o0;(function(n){n[n.DoNotRestart=1]="DoNotRestart",n[n.Restart=2]="Restart"})(o0||(mu.CloseAction=o0={}));var U8;(function(n){n[n.Stopped=1]="Stopped",n[n.Starting=3]="Starting",n[n.Running=2]="Running"})(U8||(mu.State=U8={}));var Pqe;(function(n){n.off="off",n.on="on"})(Pqe||(mu.SuspendMode=Pqe={}));var IRe;(function(n){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&rb.stringArray(t.enabledCommands)?t:!1}n.sanitizeIsTrusted=e})(IRe||(IRe={}));class Zci{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:vq.Continue}:{action:vq.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:o0.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:o0.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:o0.Restart})}}var wo;(function(n){n.Initial="initial",n.Starting="starting",n.StartFailed="startFailed",n.Running="running",n.Stopping="stopping",n.Stopped="stopped"})(wo||(wo={}));var Fqe;(function(n){function e(t){return t&&Ft.MessageReader.is(t.reader)&&Ft.MessageWriter.is(t.writer)}n.is=e})(Fqe||(mu.MessageTransports=Fqe={}));class ZM{constructor(e,t,i){this._traceFormat=Ft.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new NY.Semaphore(1),this._id=e,this._name=t,i=i||{};const s={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(s.isTrusted=IRe.sanitizeIsTrusted(i.markdown.isTrusted),s.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??GT.Error,stdioEncoding:i.stdioEncoding??"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler??this.createDefaultErrorHandler(i.connectionOptions?.maxRestartCount),middleware:i.middleware??{},uriConverters:i.uriConverters,workspaceFolder:i.workspaceFolder,connectionOptions:i.connectionOptions,markdown:s,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=wo.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,i.outputChannel?(this._outputChannel=i.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=i.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new NY.Semaphore(1),this._pendingChangeDelayer=new NY.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new NY.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new Ft.Emitter,this._stateChangeEmitter=new Ft.Emitter,this._trace=Ft.Trace.Off,this._tracer={log:(o,r)=>{rb.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=bci.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=Cci.createConverter(i.uriConverters?i.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=ra.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){switch(this.$state){case wo.Starting:return U8.Starting;case wo.Running:return U8.Running;default:return U8.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const s=this._clientOptions.middleware?.sendRequest;if(s!==void 0){let o,r;return t.length===1?Ft.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),s(e,o,r,(a,c,l)=>{const d=[];return c!==void 0&&d.push(c),l!==void 0&&d.push(l),i.sendRequest(a,...d)})}else return i.sendRequest(e,...t)}onRequest(e,t){const i=typeof e=="string"?e:e.method;this._requestHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._requestDisposables.set(i,s.onRequest(e,t)),o={dispose:()=>{const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);const r=this._requestDisposables.get(i);r!==void 0&&(r.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===Ft.TextDocumentSyncKind.Full;let s;i&&typeof e!="string"&&e.method===Ft.DidOpenTextDocumentNotification.method&&(s=t?.textDocument.uri,this._pendingOpenNotifications.add(s));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),s!==void 0&&this._pendingOpenNotifications.delete(s);const r=this._clientOptions.middleware?.sendNotification;return r?r(e,o.sendNotification.bind(o),t):o.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const s=this.activeConnection();let o;return s!==void 0?(this._notificationDisposables.set(i,s.onNotification(e,t)),o={dispose:()=>{const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);const r=this._notificationDisposables.get(i);r!==void 0&&(r.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}async sendProgress(e,t,i){if(this.$state===wo.StartFailed||this.$state===wo.Stopping||this.$state===wo.Stopped)return Promise.reject(new Ft.ResponseError(Ft.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(s){throw this.error(`Sending progress for token ${t} failed.`,s),s}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const s=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=Ft.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return s!==void 0?(this._progressDisposables.set(t,s.onProgress(e,t,a)),o={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new Zci(this,e??4)}async setTrace(e){this._trace=e;const t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof Ft.ResponseError){const t=e;return` Message: ${t.message} Code: ${t.code} ${t.data?` `+t.data.toString():""}`}return e instanceof Error?rb.string(e.stack)?e.stack:e.message:rb.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Debug,GT.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Info,GT.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Warning,GT.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(Ft.MessageType.Error,GT.Error,"Error",e,t,i)}logOutputMessage(e,t,i,s,o,r){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${s}`),o!=null&&this.outputChannel.appendLine(this.data2String(o)),(r==="force"||r&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,s)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===Ft.MessageType.Error?ra.window.showErrorMessage:e===Ft.MessageType.Warning?ra.window.showWarningMessage:ra.window.showInformationMessage)(t,"Go to output").then(s=>{s!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===wo.Initial||this.$state===wo.Stopping||this.$state===wo.Stopped}needsStop(){return this.$state===wo.Starting||this.$state===wo.Running}activeConnection(){return this.$state===wo.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===wo.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===wo.Stopping)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;const[e,t,i]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?ra.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):ra.languages.createDiagnosticCollection());for(const[s,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(s)||this._pendingNotificationHandlers.set(s,o);for(const[s,o]of this._requestHandlers)this._pendingRequestHandlers.has(s)||this._pendingRequestHandlers.set(s,o);for(const[s,o]of this._progressHandlers)this._pendingProgressHandlers.has(s)||this._pendingProgressHandlers.set(s,o);this.$state=wo.Starting;try{const s=await this.createConnection();s.onNotification(Ft.LogMessageNotification.type,o=>{switch(o.type){case Ft.MessageType.Error:this.error(o.message,void 0,!1);break;case Ft.MessageType.Warning:this.warn(o.message,void 0,!1);break;case Ft.MessageType.Info:this.info(o.message,void 0,!1);break;case Ft.MessageType.Debug:this.debug(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),s.onNotification(Ft.ShowMessageNotification.type,o=>{switch(o.type){case Ft.MessageType.Error:ra.window.showErrorMessage(o.message);break;case Ft.MessageType.Warning:ra.window.showWarningMessage(o.message);break;case Ft.MessageType.Info:ra.window.showInformationMessage(o.message);break;default:ra.window.showInformationMessage(o.message)}}),s.onRequest(Ft.ShowMessageRequest.type,o=>{let r;switch(o.type){case Ft.MessageType.Error:r=ra.window.showErrorMessage;break;case Ft.MessageType.Warning:r=ra.window.showWarningMessage;break;case Ft.MessageType.Info:r=ra.window.showInformationMessage;break;default:r=ra.window.showInformationMessage}let a=o.actions||[];return r(o.message,...a)}),s.onNotification(Ft.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),s.onRequest(Ft.ShowDocumentRequest.type,async o=>{const r=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await ra.env.openExternal(l)};{const d={};return c.selection!==void 0&&(d.selection=this.protocol2CodeConverter.asRange(c.selection)),c.takeFocus===void 0||c.takeFocus===!1?d.preserveFocus=!0:c.takeFocus===!0&&(d.preserveFocus=!1),await ra.window.showTextDocument(l,d),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(o,r):r(o)}),s.listen(),await this.initialize(s),t()}catch(s){this.$state=wo.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,s,"force"),i(s)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((s,o)=>{e=s,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);const t=this._clientOptions.initializationOptions,[i,s]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],o={processId:null,clientInfo:{name:ra.env.appName,version:ra.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(ra.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:rb.func(t)?t():t,trace:Ft.Trace.toString(this._trace),workspaceFolders:s};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const r=Rqe.generateUuid(),a=new yci.ProgressPart(e,r);o.workDoneToken=r;try{const c=await this.doInitialize(e,o);return a.done(),c}catch(c){throw a.cancel(),c}}else return this.doInitialize(e,o)}async doInitialize(e,t){try{const i=await e.initialize(t);if(i.capabilities.positionEncoding!==void 0&&i.capabilities.positionEncoding!==Ft.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=wo.Running;let s;rb.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===Ft.TextDocumentSyncKind.None?s={openClose:!1,change:Ft.TextDocumentSyncKind.None,save:void 0}:s={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!==void 0&&i.capabilities.textDocumentSync!==null&&(s=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:s}),e.onNotification(Ft.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(Ft.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(Ft.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(Ft.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o));for(const[o,r]of this._pendingNotificationHandlers)this._notificationDisposables.set(o,e.onNotification(o,r));this._pendingNotificationHandlers.clear();for(const[o,r]of this._pendingRequestHandlers)this._requestDisposables.set(o,e.onRequest(o,r));this._pendingRequestHandlers.clear();for(const[o,r]of this._pendingProgressHandlers)this._progressDisposables.set(o,e.onProgress(r.type,o,r.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(Ft.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),i}catch(i){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(i)?this.initialize(e):this.stop():i instanceof Ft.ResponseError&&i.data&&i.data.retry?ra.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(s=>{s&&s.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&ra.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=ra.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t){if(this.$state===wo.Stopped||this.$state===wo.Initial)return;if(this.$state===wo.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}const i=this.activeConnection();if(i===void 0||this.$state!==wo.Running)throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=wo.Stopping,this.cleanUp(e);const s=new Promise(r=>{(0,Ft.RAL)().timer.setTimeout(r,t)}),o=(async r=>(await r.shutdown(),await r.exit(),r))(i);return this._onStop=Promise.race([s,o]).then(r=>{if(r!==void 0)r.end(),r.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},r=>{throw this.error("Stopping server failed",r,!1),r}).finally(()=>{this.$state=wo.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();const t=this._listeners.splice(0,this._listeners.length);for(const i of t)i.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(const i of Array.from(this._features.entries()).map(s=>s[1]).reverse())i.clear();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){const t=this;async function i(o){return t._fileEvents.push(o),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(Ft.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const s=this.clientOptions.middleware?.workspace;(s?.didChangeWatchedFile?s.didChangeWatchedFile(e,i):i(e)).catch(o=>{t.error("Notify file events failed.",o)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{const t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(const i of t){const s=this.code2ProtocolConverter.asChangeTextDocumentParams(i);await e.sendNotification(Ft.DidChangeTextDocumentNotification.type,s),this._didChangeTextDocumentFeature.notificationSent(i,Ft.DidChangeTextDocumentNotification.type,s)}}catch(t){throw this.error("Sending pending changes failed",t,!1),t}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{const e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error("Delivering pending changes failed",e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;const t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,Ft.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;const e=this._diagnosticQueue.entries().next();if(e.done===!0)return;const[t,i]=e.value;this._diagnosticQueue.delete(t);const s=new ra.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:s},this._p2c.asDiagnostics(i,s.token).then(o=>{if(!s.token.isCancellationRequested){const r=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(r,o,(c,l)=>this.setDiagnostics(c,l)):this.setDiagnostics(r,o)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return ra.env.language}async $start(){if(this.$state===wo.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();const e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(s,o,r)=>{this.handleConnectionError(s,o,r).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(s=>this.error("Handling connection close failed",s))};const i=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=tli(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===wo.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:o0.DoNotRestart};if(this.$state!==wo.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===o0.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp("stop"),this.$state===wo.Starting?this.$state=wo.StartFailed:this.$state=wo.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===o0.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=wo.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,i){const s=await this._clientOptions.errorHandler.error(e,t,i);s.action===vq.Shutdown?(this.error(s.message??`Client ${this._name}: connection to server is erroring. ${e.message} Shutting down server.`,void 0,s.handled===!0?!1:"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)})):this.error(s.message??`Client ${this._name}: connection to server is erroring. -${e.message}`,void 0,s.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(ra.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=ra.workspace.getConfiguration(this._id);let s=Ft.Trace.Off,o=Ft.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?s=Ft.Trace.fromString(r):(s=Ft.Trace.fromString(i.get("trace.server.verbosity","off")),o=Ft.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=s,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(r=>{this.error("Updating trace failed with error",r,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;rb.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(Ft.DidChangeWatchedFilesNotification.type.method).registerRaw(Rqe.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Vw.DynamicFeature.is(e)){const t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){const t=this.getFeature(Ft.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Mqe.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new Nqe.ConfigurationFeature(this)),this.registerFeature(new gB.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new gB.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new gB.WillSaveFeature(this)),this.registerFeature(new gB.WillSaveWaitUntilFeature(this)),this.registerFeature(new gB.DidSaveTextDocumentFeature(this)),this.registerFeature(new gB.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Oci.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Aci.CompletionItemFeature(this)),this.registerFeature(new Eci.HoverFeature(this)),this.registerFeature(new Dci.SignatureHelpFeature(this)),this.registerFeature(new xci.DefinitionFeature(this)),this.registerFeature(new Tci.ReferencesFeature(this)),this.registerFeature(new kci.DocumentHighlightFeature(this)),this.registerFeature(new Ici.DocumentSymbolFeature(this)),this.registerFeature(new Lci.WorkspaceSymbolFeature(this)),this.registerFeature(new Rci.CodeActionFeature(this)),this.registerFeature(new Mci.CodeLensFeature(this)),this.registerFeature(new l_e.DocumentFormattingFeature(this)),this.registerFeature(new l_e.DocumentRangeFormattingFeature(this)),this.registerFeature(new l_e.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Nci.RenameFeature(this)),this.registerFeature(new Pci.DocumentLinkFeature(this)),this.registerFeature(new Fci.ExecuteCommandFeature(this)),this.registerFeature(new Nqe.SyncConfigurationFeature(this)),this.registerFeature(new Hci.TypeDefinitionFeature(this)),this.registerFeature(new Wci.ImplementationFeature(this)),this.registerFeature(new Bci.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Uci.WorkspaceFoldersFeature(this)),this.registerFeature(new Vci.FoldingRangeFeature(this)),this.registerFeature(new zci.DeclarationFeature(this)),this.registerFeature(new $ci.SelectionRangeFeature(this)),this.registerFeature(new Gci.ProgressFeature(this)),this.registerFeature(new qci.CallHierarchyFeature(this)),this.registerFeature(new Qci.SemanticTokensFeature(this)),this.registerFeature(new jci.LinkedEditingFeature(this)),this.registerFeature(new fB.DidCreateFilesFeature(this)),this.registerFeature(new fB.DidRenameFilesFeature(this)),this.registerFeature(new fB.DidDeleteFilesFeature(this)),this.registerFeature(new fB.WillCreateFilesFeature(this)),this.registerFeature(new fB.WillRenameFilesFeature(this)),this.registerFeature(new fB.WillDeleteFilesFeature(this)),this.registerFeature(new Kci.TypeHierarchyFeature(this)),this.registerFeature(new Yci.InlineValueFeature(this)),this.registerFeature(new Jci.InlayHintsFeature(this)),this.registerFeature(new Sci.DiagnosticFeature(this)),this.registerFeature(new Mqe.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(LRe.createAll(this))}fillInitializeParams(e){for(let t of this._features)rb.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,Vw.ensure)(e,"workspace").applyEdit=!0;const t=(0,Vw.ensure)((0,Vw.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[Ft.ResourceOperationKind.Create,Ft.ResourceOperationKind.Rename,Ft.ResourceOperationKind.Delete],t.failureHandling=Ft.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,Vw.ensure)((0,Vw.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[Ft.DiagnosticTag.Unnecessary,Ft.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const s=(0,Vw.ensure)(e,"window"),o=(0,Vw.ensure)(s,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,Vw.ensure)(s,"showDocument");r.support=!0;const a=(0,Vw.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(ZM.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let c of this._features)c.fillClientCapabilities(e);return e}initializeFeatures(e){const t=this._clientOptions.documentSelector;for(const i of this._features)rb.func(i.preInitialize)&&i.preInitialize(this._capabilities,t);for(const i of this._features)i.initialize(this._capabilities,t)}async handleRegistrationRequest(e){const t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,i=>this.doRegisterCapability(i)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(const t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(const t of e.registrations){const i=this._dynamicFeatures.get(t.method);if(i===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));const s=t.registerOptions??{};s.documentSelector=s.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:s};try{i.register(o)}catch(r){return Promise.reject(r)}}}async handleUnregistrationRequest(e){const t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,i=>this.doUnregisterCapability(i)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(const t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;const i=this._dynamicFeatures.get(t.method);if(!i)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));i.unregister(t.id)}}async handleApplyWorkspaceEdit(e){const t=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),s=new Map;ra.workspace.textDocuments.forEach(r=>s.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(Ft.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=s.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):rb.asPromise(ra.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,s,o=!0){if(i instanceof Ft.ResponseError){if(i.code===Ft.ErrorCodes.PendingResponseRejected||i.code===Ft.ErrorCodes.ConnectionInactive)return s;if(i.code===Ft.LSPErrorCodes.RequestCancelled||i.code===Ft.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return s;throw i.data!==void 0?new Vw.LSPCancellationError(i.data):new ra.CancellationError}else if(i.code===Ft.LSPErrorCodes.ContentModified){if(ZM.RequestsToCancelOnContentModified.has(e.method)||ZM.CancellableResolveCalls.has(e.method))throw new ra.CancellationError;return s}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Cct=mu.BaseLanguageClient=ZM;ZM.RequestsToCancelOnContentModified=new Set([Ft.SemanticTokensRequest.method,Ft.SemanticTokensRangeRequest.method,Ft.SemanticTokensDeltaRequest.method]);ZM.CancellableResolveCalls=new Set([Ft.CompletionResolveRequest.method,Ft.CodeLensResolveRequest.method,Ft.CodeActionResolveRequest.method,Ft.InlayHintResolveRequest.method,Ft.DocumentLinkResolveRequest.method,Ft.WorkspaceSymbolResolveRequest.method]);class eli{error(e){(0,Ft.RAL)().console.error(e)}warn(e){(0,Ft.RAL)().console.warn(e)}info(e){(0,Ft.RAL)().console.info(e)}log(e){(0,Ft.RAL)().console.log(e)}}function tli(n,e,t,i,s){const o=new eli,r=(0,Ft.createProtocolConnection)(n,e,o,s);return r.onError(c=>{t(c[0],c[1],c[2])}),r.onClose(i),{listen:()=>r.listen(),sendRequest:r.sendRequest,onRequest:r.onRequest,hasPendingResponse:r.hasPendingResponse,sendNotification:r.sendNotification,onNotification:r.onNotification,onProgress:r.onProgress,sendProgress:r.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:Ft.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(rb.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(Ft.InitializeRequest.type,c),shutdown:()=>r.sendRequest(Ft.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(Ft.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var LRe;(function(n){function e(t){return[new Xci.InlineCompletionItemFeature(t)]}n.createAll=e})(LRe||(mu.ProposedFeatures=LRe={}));(function(n){var e=sh&&sh.__createBinding||(Object.create?function(s,o,r,a){a===void 0&&(a=r);var c=Object.getOwnPropertyDescriptor(o,r);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(s,a,c)}:function(s,o,r,a){a===void 0&&(a=r),s[a]=o[r]}),t=sh&&sh.__exportStar||function(s,o){for(var r in s)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,s,r)};Object.defineProperty(n,"__esModule",{value:!0}),n.DiagnosticPullMode=n.vsdiag=void 0,t(Ts,n),t($n,n);var i=Ix;Object.defineProperty(n,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(n,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(mu,n)})(hRe);var Kre=Ts;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(r,a,c,l){l===void 0&&(l=c);var d=Object.getOwnPropertyDescriptor(a,c);(!d||("get"in d?!a.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(r,l,d)}:function(r,a,c,l){l===void 0&&(l=c),r[l]=a[c]}),t=sh&&sh.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.LanguageClient=void 0;const i=hRe,s=Kre;t(Kre,n),t(hRe,n);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new s.BrowserMessageReader(this.worker),l=new s.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}n.LanguageClient=o})(dRe);class ili extends Cct{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:s}){super(e??t.toLowerCase(),t,i),this.connectionProvider=s}createMessageTransports(e){return this.connectionProvider.get(e)}}let Jt;const pE=new Array(128).fill(void 0);pE.push(void 0,null,!0,!1);function Q(n){return pE[n]}let V8=pE.length;function nli(n){n<132||(pE[n]=V8,V8=n)}function c_(n){const e=Q(n);return nli(n),e}let xc=0,t$=null;function qX(){return(t$===null||t$.byteLength===0)&&(t$=new Uint8Array(Jt.memory.buffer)),t$}const QX=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sli=typeof QX.encodeInto=="function"?function(n,e){return QX.encodeInto(n,e)}:function(n,e){const t=QX.encode(n);return e.set(t),{read:n.length,written:t.length}};function nl(n,e,t){if(t===void 0){const a=QX.encode(n),c=e(a.length,1)>>>0;return qX().subarray(c,c+a.length).set(a),xc=a.length,c}let i=n.length,s=e(i,1)>>>0;const o=qX();let r=0;for(;r127)break;o[s+r]=a}if(r!==i){r!==0&&(n=n.slice(r)),s=t(s,i,i=r+n.length*3,1)>>>0;const a=qX().subarray(s+r,s+i),c=sli(n,a);r+=c.written,s=t(s,i,r,1)>>>0}return xc=r,s}function $s(n){return n==null}let pT=null;function tn(){return(pT===null||pT.buffer.detached===!0||pT.buffer.detached===void 0&&pT.buffer!==Jt.memory.buffer)&&(pT=new DataView(Jt.memory.buffer)),pT}function tt(n){V8===pE.length&&pE.push(pE.length+1);const e=V8;return V8=pE[e],pE[e]=n,e}const yct=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yct.decode();function no(n,e){return n=n>>>0,yct.decode(qX().subarray(n,n+e))}function TRe(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const s=n.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=n.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(n)){const s=n.length;let o="[";s>0&&(o+=TRe(n[0]));for(let r=1;r1)i=t[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:i}const Yre=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{Jt.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function a3(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;try{return i(s.a,s.b,...r)}finally{--s.cnt===0&&(Jt.__wbindgen_export_2.get(s.dtor)(s.a,s.b),s.a=0,Yre.unregister(s))}};return o.original=s,Yre.register(o,s,s),o}function c3(n,e,t){Jt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h165a31a3f6a17f4a(n,e,tt(t))}function zw(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;const a=s.a;s.a=0;try{return i(a,s.b,...r)}finally{--s.cnt===0?(Jt.__wbindgen_export_2.get(s.dtor)(a,s.b),Yre.unregister(s)):s.a=a}};return o.original=s,Yre.register(o,s,s),o}function Oqe(n,e){Jt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha4cf337f3953c47d(n,e)}function AD(n,e,t){Jt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00347670c924a916(n,e,tt(t))}function Bqe(n,e,t,i){Jt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he42a58d92d86f1d0(n,e,tt(t),tt(i))}function rn(n,e){try{return n.apply(this,e)}catch(t){Jt.__wbindgen_exn_store(tt(t))}}function oli(){try{const t=Jt.__wbindgen_add_to_stack_pointer(-16);Jt.run_event_loop(t);var n=tn().getInt32(t+4*0,!0),e=tn().getInt32(t+4*1,!0);if(e)throw c_(n)}finally{Jt.__wbindgen_add_to_stack_pointer(16)}}let i$=null;function rli(){return(i$===null||i$.byteLength===0)&&(i$=new Float32Array(Jt.memory.buffer)),i$}function PY(n,e){return n=n>>>0,rli().subarray(n/4,n/4+e)}const Wqe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>Jt.__wbg_previewconnector_free(n>>>0,1));class wge{static __wrap(e){e=e>>>0;const t=Object.create(wge.prototype);return t.__wbg_ptr=e,Wqe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wqe.unregister(this),e}free(){const e=this.__destroy_into_raw();Jt.__wbg_previewconnector_free(e,0)}static create(e,t,i,s){try{const c=Jt.__wbindgen_add_to_stack_pointer(-16),l=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),d=xc;Jt.previewconnector_create(c,tt(e),tt(t),l,d,s);var o=tn().getInt32(c+4*0,!0),r=tn().getInt32(c+4*1,!0),a=tn().getInt32(c+4*2,!0);if(a)throw c_(r);return c_(o)}finally{Jt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=Jt.previewconnector_current_style(this.__wbg_ptr);return c_(e)}show_ui(){try{const s=Jt.__wbindgen_add_to_stack_pointer(-16);Jt.previewconnector_show_ui(s,this.__wbg_ptr);var e=tn().getInt32(s+4*0,!0),t=tn().getInt32(s+4*1,!0),i=tn().getInt32(s+4*2,!0);if(i)throw c_(t);return c_(e)}finally{Jt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const s=Jt.__wbindgen_add_to_stack_pointer(-16);Jt.previewconnector_process_lsp_to_preview_message(s,this.__wbg_ptr,tt(e));var t=tn().getInt32(s+4*0,!0),i=tn().getInt32(s+4*1,!0);if(i)throw c_(t)}finally{Jt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>Jt.__wbg_slintserver_free(n>>>0,1));async function ali(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(i){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function cli(){const n={};return n.wbg={},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return tt(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=Q(t).stack,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,s;try{i=e,s=t,console.error(no(e,t))}finally{Jt.__wbindgen_free(i,s,1)}},n.wbg.__wbindgen_object_drop_ref=function(e){c_(e)},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return Q(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return Q(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=Q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=Q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=Q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=Q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){Q(e).attachShader(Q(t),Q(i))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){Q(e).attachShader(Q(t),Q(i))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,s,o){Q(e).bindAttribLocation(Q(t),i>>>0,no(s,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,s,o){Q(e).bindAttribLocation(Q(t),i>>>0,no(s,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){Q(e).linkProgram(Q(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){Q(e).linkProgram(Q(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const s=Q(e).getProgramParameter(Q(t),i>>>0);return tt(s)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const s=Q(e).getProgramParameter(Q(t),i>>>0);return tt(s)},n.wbg.__wbindgen_boolean_get=function(e){const t=Q(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){Q(e).detachShader(Q(t),Q(i))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){Q(e).detachShader(Q(t),Q(i))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const s=Q(t).getProgramInfoLog(Q(i));var o=$s(s)?0:nl(s,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),r=xc;tn().setInt32(e+4*1,r,!0),tn().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const s=Q(t).getProgramInfoLog(Q(i));var o=$s(s)?0:nl(s,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),r=xc;tn().setInt32(e+4*1,r,!0),tn().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=Q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=Q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,s){Q(e).shaderSource(Q(t),no(i,s))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,s){Q(e).shaderSource(Q(t),no(i,s))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){Q(e).compileShader(Q(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){Q(e).compileShader(Q(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const s=Q(e).getShaderParameter(Q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const s=Q(e).getShaderParameter(Q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const s=Q(t).getShaderInfoLog(Q(i));var o=$s(s)?0:nl(s,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),r=xc;tn().setInt32(e+4*1,r,!0),tn().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const s=Q(t).getShaderInfoLog(Q(i));var o=$s(s)?0:nl(s,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),r=xc;tn().setInt32(e+4*1,r,!0),tn().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,s){Q(e).uniform2fv(Q(t),PY(i,s))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,s){Q(e).uniform2fv(Q(t),PY(i,s))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){Q(e).deleteFramebuffer(Q(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){Q(e).deleteFramebuffer(Q(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){Q(e).deleteRenderbuffer(Q(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){Q(e).deleteRenderbuffer(Q(t))},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return tt(e)},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){Q(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){Q(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return rn(function(e,t,i,s){const o=Q(e).getContext(no(t,i),Q(s));return $s(o)?0:tt(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=Q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=Q(e).getSupportedExtensions();return $s(t)?0:tt(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return Q(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=Q(e)[t>>>0];return tt(i)},n.wbg.__wbindgen_string_get=function(e,t){const i=Q(t),s=typeof i=="string"?i:void 0;var o=$s(s)?0:nl(s,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),r=xc;tn().setInt32(e+4*1,r,!0),tn().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return rn(function(e,t){const i=Q(e).getParameter(t>>>0);return tt(i)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=Q(e).createVertexArrayOES();return $s(t)?0:tt(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=Q(e).createVertexArray();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=Q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=Q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return Q(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return Q(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=Q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=Q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,s,o,r){Q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,Q(o),r)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,s,o,r){Q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,Q(o),r)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=Q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=Q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,s,o){Q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,s,o){Q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,s,o){Q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,Q(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,s,o){Q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,Q(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return Q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return Q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,s,o){Q(e).scissor(t,i,s,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,s,o){Q(e).scissor(t,i,s,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,s,o){Q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,s,o){Q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){Q(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){Q(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,s){Q(e).uniform4fv(Q(t),PY(i,s))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,s){Q(e).uniform4fv(Q(t),PY(i,s))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){Q(e).deleteTexture(Q(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){Q(e).deleteTexture(Q(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){Q(e).deleteShader(Q(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){Q(e).deleteShader(Q(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){Q(e).deleteProgram(Q(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){Q(e).deleteProgram(Q(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){Q(e).useProgram(Q(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){Q(e).useProgram(Q(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){Q(e).bindBuffer(t>>>0,Q(i))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){Q(e).bindBuffer(t>>>0,Q(i))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){Q(e).bindFramebuffer(t>>>0,Q(i))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){Q(e).bindFramebuffer(t>>>0,Q(i))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){Q(e).bindRenderbuffer(t>>>0,Q(i))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){Q(e).bindRenderbuffer(t>>>0,Q(i))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){Q(e).bindVertexArray(Q(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){Q(e).bindVertexArrayOES(Q(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){Q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){Q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){Q(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){Q(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){Q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){Q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,s){Q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,s){Q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){Q(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){Q(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){Q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){Q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,s){const o=Q(e).getUniformLocation(Q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,s){const o=Q(e).getUniformLocation(Q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){Q(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){Q(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return rn(function(e,t,i,s,o,r,a,c,l,d){Q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return rn(function(e,t,i,s,o,r,a,c,l,d){Q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){Q(e).uniform1i(Q(t),i)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){Q(e).uniform1i(Q(t),i)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,s,o){Q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,s,o){Q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){Q(e).bindTexture(t>>>0,Q(i))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){Q(e).bindTexture(t>>>0,Q(i))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){Q(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){Q(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,s){Q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,s){Q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return rn(function(e,t,i,s,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return rn(function(e,t,i,s,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return rn(function(e,t,i,s,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,d)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,s,o,r,a){Q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,s,o,r,a){Q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,s,o){Q(e).viewport(t,i,s,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,s,o){Q(e).viewport(t,i,s,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,s){Q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,s){Q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){Q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){Q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,s){Q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,s){Q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,s,o){Q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,s,o){Q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return Q(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=Q(e).document;return $s(t)?0:tt(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const s=Q(e).getElementById(no(t,i));return $s(s)?0:tt(s)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=Q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){Q(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){Q(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return Q(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return Q(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=Q(e).dataset;return tt(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,s){const o=Q(t)[no(i,s)];var r=$s(o)?0:nl(o,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),a=xc;tn().setInt32(e+4*1,a,!0),tn().setInt32(e+4*0,r,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=Q(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=Q(e).style;return tt(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return Q(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return Q(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return Q(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return Q(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return rn(function(e,t){Q(e).before(Q(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=Q(e);return tt(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){Q(e).value=no(t,i)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=Q(t).data;var s=$s(i)?0:nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return Q(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=Q(t).inputType,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){Q(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return Q(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=Q(t).key,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return Q(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return Q(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return Q(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return Q(e).getModifierState(no(t,i))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return Q(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=Q(e).clipboardData;return $s(t)?0:tt(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return rn(function(e,t,i,s){const o=Q(t).getData(no(i,s)),r=nl(o,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),a=xc;tn().setInt32(e+4*1,a,!0),tn().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=Q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){Q(e).font=no(t,i)},n.wbg.__wbindgen_string_new=function(e,t){const i=no(e,t);return tt(i)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){Q(e).fillStyle=Q(t)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return Q(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return Q(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=Q(t).currentSrc,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=Q(t).src,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return rn(function(){const e=new Image;return tt(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){Q(e).crossOrigin=t===0?void 0:no(t,i)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){Q(e).onload=Q(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){Q(e).src=no(t,i)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return tt(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return Q(e).getTime()},n.wbg.__wbindgen_number_new=function(e){return tt(e)},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(Q(e));return tt(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return Q(e).getTimezoneOffset()},n.wbg.__wbg_log_5766f8130e3dc687=function(e,t){console.log(no(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){Q(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){Q(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){Q(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){Q(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,s){Q(e).bufferData(t>>>0,Q(i),s>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,s){Q(e).bufferData(t>>>0,Q(i),s>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,s,o){Q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,s,o){Q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){Q(e).deleteVertexArray(Q(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){Q(e).deleteVertexArrayOES(Q(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){Q(e).deleteBuffer(Q(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){Q(e).deleteBuffer(Q(t))},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return rn(function(e,t,i,s,o,r,a,c){Q(e).readPixels(t,i,s,o,r>>>0,a>>>0,Q(c))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return rn(function(e,t,i,s,o,r,a,c){Q(e).readPixels(t,i,s,o,r>>>0,a>>>0,Q(c))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){Q(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){Q(e).height=t>>>0},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return rn(function(e,t,i,s,o,r,a,c){Q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,Q(c))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return rn(function(e,t,i,s,o,r,a,c){Q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,Q(c))},arguments)},n.wbg.__wbg_next_f9cb570345655b9a=function(){return rn(function(e){const t=Q(e).next();return tt(t)},arguments)},n.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return Q(e).done},n.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=Q(e).value;return tt(t)},n.wbg.__wbg_iterator_888179a48810a9fe=function(){return tt(Symbol.iterator)},n.wbg.__wbg_get_224d16597dbbfd96=function(){return rn(function(e,t){const i=Reflect.get(Q(e),Q(t));return tt(i)},arguments)},n.wbg.__wbindgen_is_function=function(e){return typeof Q(e)=="function"},n.wbg.__wbindgen_is_object=function(e){const t=Q(e);return typeof t=="object"&&t!==null},n.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=Q(e).next;return tt(t)},n.wbg.__wbg_call_1084a111329e68ce=function(){return rn(function(e,t){const i=Q(e).call(Q(t));return tt(i)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return rn(function(e,t,i){const s=Q(e).call(Q(t),Q(i));return tt(s)},arguments)},n.wbg.__wbg_call_c6fe275aaa60da79=function(){return rn(function(e,t,i,s){const o=Q(e).call(Q(t),Q(i),Q(s));return tt(o)},arguments)},n.wbg.__wbindgen_memory=function(){const e=Jt.memory;return tt(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=Q(e).buffer;return tt(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const s=new Uint8Array(Q(e),t>>>0,i>>>0);return tt(s)},n.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return Q(e).length},n.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(Q(e));return tt(t)},n.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){Q(e).set(Q(t),i>>>0)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return rn(function(e,t,i){return Reflect.set(Q(e),Q(t),Q(i))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return rn(function(){const e=self.self;return tt(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return rn(function(){const e=window.window;return tt(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return rn(function(){const e=globalThis.globalThis;return tt(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return rn(function(){const e=global.global;return tt(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return Q(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(no(e,t));return tt(i)},n.wbg.__wbindgen_error_new=function(e,t){const i=new Error(no(e,t));return tt(i)},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return Q(e)==Q(t)},n.wbg.__wbindgen_number_get=function(e,t){const i=Q(t),s=typeof i=="number"?i:void 0;tn().setFloat64(e+8*1,$s(s)?0:s,!0),tn().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=Q(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=Q(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(Q(e));return tt(t)},n.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(Q(e))},n.wbg.__wbindgen_as_number=function(e){return+Q(e)},n.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(Q(t)),s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbindgen_bigint_from_i64=function(e){return tt(e)},n.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return tt(t)},n.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(Q(e))},n.wbg.__wbindgen_is_string=function(e){return typeof Q(e)=="string"},n.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=Q(e)[Q(t)];return tt(i)},n.wbg.__wbindgen_in=function(e,t){return Q(e)in Q(t)},n.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const s=Q(e).set(Q(t),Q(i));return tt(s)},n.wbg.__wbg_set_f975102236d3c502=function(e,t,i){Q(e)[c_(t)]=c_(i)},n.wbg.__wbg_new_8608a2b51a5f6737=function(){return tt(new Map)},n.wbg.__wbg_previewconnector_new=function(e){const t=wge.__wrap(e);return tt(t)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return tt(e)},n.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){Q(e)[t>>>0]=c_(i)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},s=(r,a)=>{const c=i.a;i.a=0;try{return Bqe(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(s);return tt(o)}finally{i.a=i.b=0}},n.wbg.__wbindgen_is_bigint=function(e){return typeof Q(e)=="bigint"},n.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=Q(t),s=typeof i=="bigint"?i:void 0;tn().setBigInt64(e+8*1,$s(s)?BigInt(0):s,!0),tn().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbindgen_jsval_eq=function(e,t){return Q(e)===Q(t)},n.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=Q(e)instanceof Map}catch{t=!1}return t},n.wbg.__wbindgen_throw=function(e,t){throw new Error(no(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const i=TRe(Q(t)),s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=Q(e).queueMicrotask;return tt(t)},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(Q(e));return tt(t)},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const s=Q(e).then(Q(t),Q(i));return tt(s)},n.wbg.__wbindgen_cb_drop=function(e){const t=c_(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=Q(e).then(Q(t));return tt(i)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(Q(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return rn(function(e,t,i){const s=Q(e).getExtension(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return rn(function(e,t,i){const s=Q(e).matchMedia(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return rn(function(e,t){Q(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return rn(function(e,t){return Q(e).setTimeout(Q(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return rn(function(e,t,i){const s=Q(e).createElement(no(t,i));return tt(s)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return rn(function(e,t,i){return Q(e).matches(no(t,i))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return rn(function(e,t,i,s,o){Q(e).setAttribute(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return rn(function(e){Q(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return rn(function(e,t,i,s,o){Q(e).fillText(no(t,i),s,o)},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return rn(function(e,t,i){const s=Q(e).getContext(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return rn(function(e,t){Q(e).addListener(Q(t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return rn(function(e,t,i,s,o){Q(e).setProperty(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return rn(function(e,t){URL.revokeObjectURL(no(e,t))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=Q(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_setData_41207994e2d54785=function(){return rn(function(e,t,i,s,o){Q(e).setData(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return rn(function(e,t,i,s){Q(e).addEventListener(no(t,i),Q(s))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return rn(function(e,t,i,s){Q(e).removeEventListener(no(t,i),Q(s))},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return rn(function(e,t){Q(e).postMessage(Q(t))},arguments)},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=Q(t).data;var s=$s(i)?0:nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return rn(function(){const e=new AbortController;return tt(e)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return rn(function(){const e=new MessageChannel;return tt(e)},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=Q(e).performance;return tt(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return Q(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return Q(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return Q(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=Q(e).scheduler;return tt(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=Q(e).signal;return tt(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const s=Q(e).postTask(Q(t),Q(i));return tt(s)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=Q(e).catch(Q(t));return tt(i)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=Q(e).port1;return tt(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){Q(e).onmessage=Q(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){Q(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=Q(e).port2;return tt(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return rn(function(e,t){return Q(e).requestIdleCallback(Q(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return rn(function(e,t,i){return Q(e).setTimeout(Q(t),i)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(Q(e),Q(t));return tt(i)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(Q(e));return tt(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return rn(function(e,t,i){Q(e).postMessage(Q(t),Q(i))},arguments)},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return Q(e).isIntersecting},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return Q(e).matches},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=Q(t).pointerType,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return Q(e).pointerId},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return rn(function(e,t){Q(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return Q(e).pressure},n.wbg.__wbg_buttons_a302533e27733599=function(e){return Q(e).buttons},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return Q(e).persisted},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=Q(e).contentRect;return tt(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return Q(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return Q(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=Q(e).devicePixelContentBoxSize;return tt(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return Q(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return Q(e).blockSize},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return rn(function(e,t){const i=new Worker(no(e,t));return tt(i)},arguments)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){Q(e).type=no(t,i)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return rn(function(e,t){const i=new Blob(Q(e),Q(t));return tt(i)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return rn(function(e,t){const i=URL.createObjectURL(Q(t)),s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return tt(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(Q(e),Q(t));return tt(i)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=Q(e).Window;return tt(t)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(Q(e),Q(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){Q(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){Q(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){Q(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){Q(e).close()},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=Q(e).navigator;return tt(t)},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=Q(e).userAgentData;return $s(t)?0:tt(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=Q(e).brands;return tt(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=Q(t).brand,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return rn(function(e,t){const i=Q(t).userAgent,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(c_(e))},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){Q(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){Q(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){Q(e).cancel()},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){Q(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=Q(e).requestFullscreen();return tt(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=Q(e).webkitFullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=Q(e).fullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(Q(e),Q(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const s=Q(e).animate(Q(t),Q(i));return tt(s)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){Q(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return rn(function(e,t){Q(e).removeListener(Q(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return Q(e).contains(Q(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){Q(e).unobserve(Q(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){Q(e).observe(Q(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){Q(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){Q(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return rn(function(e,t,i,s){const o=Q(t).getPropertyValue(no(i,s)),r=nl(o,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),a=xc;tn().setInt32(e+4*1,a,!0),tn().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return rn(function(e,t,i,s){const o=Q(t).removeProperty(no(i,s)),r=nl(o,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),a=xc;tn().setInt32(e+4*1,a,!0),tn().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=Q(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=Q(e).body;return $s(t)?0:tt(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return rn(function(e,t){const i=Q(e).appendChild(Q(t));return tt(i)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return rn(function(e,t){const i=Q(e).getComputedStyle(Q(t));return $s(i)?0:tt(i)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=Q(e).activeElement;return $s(t)?0:tt(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return rn(function(e){const t=new ResizeObserver(Q(e));return tt(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){Q(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){Q(e).observe(Q(t),Q(i))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return rn(function(e){const t=new IntersectionObserver(Q(e));return tt(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){Q(e).observe(Q(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=Q(e).getBoundingClientRect();return tt(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return Q(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return Q(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return rn(function(e,t){return Q(e).requestAnimationFrame(Q(t))},arguments)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=Q(e).scheduler;return tt(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=Q(e).getCoalescedEvents;return tt(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=Q(e).requestFullscreen;return tt(t)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=Q(e).requestIdleCallback;return tt(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return Q(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return Q(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return Q(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return Q(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return Q(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return Q(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=Q(t).code,s=nl(i,Jt.__wbindgen_malloc,Jt.__wbindgen_realloc),o=xc;tn().setInt32(e+4*1,o,!0),tn().setInt32(e+4*0,s,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return Q(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return Q(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return Q(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return Q(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return Q(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return Q(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=Q(e).getCoalescedEvents();return tt(t)},n.wbg.__wbindgen_closure_wrapper3679=function(e,t,i){const s=a3(e,t,1370,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3681=function(e,t,i){const s=a3(e,t,1370,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3682=function(e,t,i){const s=a3(e,t,1370,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3683=function(e,t,i){const s=a3(e,t,1370,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3684=function(e,t,i){const s=a3(e,t,1370,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper5998=function(e,t,i){const s=zw(e,t,1596,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper11542=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12709=function(e,t,i){const s=zw(e,t,1596,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper12743=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12748=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12754=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12765=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12777=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12833=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12840=function(e,t,i){const s=zw(e,t,1596,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12849=function(e,t,i){const s=zw(e,t,1596,Bqe);return tt(s)},n}function lli(n,e){return Jt=n.exports,Sct.__wbindgen_wasm_module=e,pT=null,i$=null,t$=null,Jt}async function Sct(n){if(Jt!==void 0)return Jt;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_lsp_wasm_bg-Bl5KSn92.wasm",import.meta.url).href,import.meta.url));const e=cli();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:i}=await ali(await n,e);return lli(t,i)}function dli(n){return new ili({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:dRe.ErrorAction.Continue}),closed:()=>({action:dRe.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(n)}})}var gU,fU;class hli{constructor(){kt(this,gU);kt(this,fU);const e=new Worker(new URL(""+new URL("lsp_worker-CM7hixNl.js",import.meta.url).href,import.meta.url),{type:"module"});st(this,fU,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),st(this,gU,Sct())}async wait_for_lsp(){const e=se(this,fU);st(this,fU,null);const t=se(this,gU);st(this,gU,null);const[i,s]=await Promise.all([t,e]);return Promise.resolve(new gli(s))}}gU=new WeakMap,fU=new WeakMap;var pU;class uli{constructor(e){kt(this,pU);st(this,pU,e)}show_ui(){return se(this,pU).show_ui()}current_style(){return se(this,pU).current_style()}}pU=new WeakMap;var Wq,Hq,mU,tM,iM,_U,nM;class gli{constructor(e){kt(this,Wq,null);kt(this,Hq,null);kt(this,mU);kt(this,tM);kt(this,iM);kt(this,_U);kt(this,nM,null);st(this,tM,e),st(this,mU,(s,o)=>!0);const t=new qni(new Kre.BrowserMessageReader(se(this,tM)),s=>{if(s.method==="slint/lsp_to_preview"){const r=s.params;return se(this,nM)?.process_lsp_to_preview_message(r),!0}if(s.method==="slint/load_file"){const o=s,r=o.params[0];return this.read_url(r).then(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:"",error:void 0})}),!0}if(s.method==="window/showDocument"){const o=s,r=o.params,a=r.selection?.start||{line:1,character:1},c=se(this,mU).call(this,r.uri,a);return i.write({jsonrpc:o.jsonrpc,id:o.id,result:{success:c},error:void 0}),!0}return!1}),i=new Kre.BrowserMessageWriter(se(this,tM));st(this,iM,t),st(this,_U,i)}get lsp_worker(){return se(this,tM)}get lsp_reader(){return se(this,iM)}get lsp_writer(){return se(this,_U)}set file_reader(e){st(this,Hq,e)}set show_document_callback(e){st(this,mU,e)}read_url(e){var t;try{return((t=se(this,Hq))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=se(this,Wq);if(e===null){const t=dli({reader:se(this,iM),writer:se(this,_U)});st(this,Wq,t),t.start(),se(this,iM).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(se(this,nM)===null){try{oli()}catch{}const s=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");st(this,nM,await wge.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,s==="1"))}return new uli(se(this,nM))}}Wq=new WeakMap,Hq=new WeakMap,mU=new WeakMap,tM=new WeakMap,iM=new WeakMap,_U=new WeakMap,nM=new WeakMap;const FY="canvas";var sM;const MBe=class MBe extends ot{constructor(t,i,s){super({node:MBe.createNode()});kt(this,sM,null);this.setFlag(ot.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,s).then(o=>{st(this,sM,o),se(this,sM).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(FY);r.style.width="100%",r.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=FY,i.className=FY,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return se(this,sM)?se(this,sM).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(FY);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};sM=new WeakMap;let RRe=MBe;const fli=new hli,f_=new eA;function pli(n){const e=new aw({commands:f_});e.title.label="Open Demo";for(const t of n.known_demos()){const i="slint:set_demo_"+t[1];f_.addCommand(i,{label:t[1],execute:()=>n.set_demo(t[0])}),e.addItem({command:i})}return e}function mli(){const n=new aw({commands:f_});return n.title.label="Settings",f_.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{jrt()}}),n.addItem({command:"slint:store_github_token"}),n}function _li(n,e){const t=new aw({commands:f_});return t.title.label="Project",f_.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");n.project_from_url(i)}}),f_.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),f_.addCommand("slint:add_file",{label:"Add File",iconClass:"fa-regular fa-file",mnemonic:1,execute:()=>{let i=prompt("Please enter the file name");i!=null&&(i.endsWith(".slint")||(i=i+".slint"),n.add_empty_file_to_project(i))}}),f_.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:pli(n)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:vli(n,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:mli()}),t}function vli(n,e){const t=new aw({commands:f_});return t.title.label="Share",f_.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>n.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",n.current_editor_content),i.set("style",e.current_style());const s=new URL(window.location.toString());s.search=i.toString(),C7e(s.toString())}}),f_.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>n.open_document_urls.length>0,execute:async()=>{let i=K1e();i||await jrt(),i=K1e(),i?await MZt((s,o)=>{FZt(n,s,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),C7e(r,c.toString())}).catch(r=>RZt(r))}):alert("You need a github access token set up to export as a gist.")}}),t.addItem({command:"slint:create_gist"}),t.addItem({command:"slint:copy_permalink"}),t}const wli=new URLSearchParams(window.location.search),bli=wli.get("style");function Cli(n){const e=new lRe(n),t=new RRe(n,o=>e.map_url(o),bli??""),i=new lq;i.id="menuBar",i.addMenu(_li(e,t));const s=new $4({orientation:"horizontal"});s.id="main",s.addWidget(e),s.addWidget(t),window.onresize=()=>{s.update()},document.addEventListener("keydown",o=>{f_.processKeydownEvent(o)}),ot.attach(i,document.body),ot.attach(s,document.body)}function yli(){Uni().then(n=>{fli.wait_for_lsp().then(e=>{Cli(e),document.body.getElementsByClassName("loader")[0].remove()}).catch(e=>{console.info("LSP fail:",e);const t=document.createElement("div");t.className="browser-error",t.innerHTML="

    Failed to start the slint language server

    ",document.body.getElementsByClassName("loader")[0].remove(),document.body.appendChild(t)})}).catch(n=>{console.info("Monaco fail:",n)})}window.onload=yli;export{sh as c,PEi as g}; +${e.message}`,void 0,s.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(ra.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=ra.workspace.getConfiguration(this._id);let s=Ft.Trace.Off,o=Ft.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?s=Ft.Trace.fromString(r):(s=Ft.Trace.fromString(i.get("trace.server.verbosity","off")),o=Ft.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=s,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(r=>{this.error("Updating trace failed with error",r,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;rb.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(Ft.DidChangeWatchedFilesNotification.type.method).registerRaw(Rqe.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Vw.DynamicFeature.is(e)){const t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){const t=this.getFeature(Ft.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Mqe.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new Nqe.ConfigurationFeature(this)),this.registerFeature(new gB.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new gB.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new gB.WillSaveFeature(this)),this.registerFeature(new gB.WillSaveWaitUntilFeature(this)),this.registerFeature(new gB.DidSaveTextDocumentFeature(this)),this.registerFeature(new gB.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Oci.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Aci.CompletionItemFeature(this)),this.registerFeature(new Eci.HoverFeature(this)),this.registerFeature(new Dci.SignatureHelpFeature(this)),this.registerFeature(new xci.DefinitionFeature(this)),this.registerFeature(new Tci.ReferencesFeature(this)),this.registerFeature(new kci.DocumentHighlightFeature(this)),this.registerFeature(new Ici.DocumentSymbolFeature(this)),this.registerFeature(new Lci.WorkspaceSymbolFeature(this)),this.registerFeature(new Rci.CodeActionFeature(this)),this.registerFeature(new Mci.CodeLensFeature(this)),this.registerFeature(new l_e.DocumentFormattingFeature(this)),this.registerFeature(new l_e.DocumentRangeFormattingFeature(this)),this.registerFeature(new l_e.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Nci.RenameFeature(this)),this.registerFeature(new Pci.DocumentLinkFeature(this)),this.registerFeature(new Fci.ExecuteCommandFeature(this)),this.registerFeature(new Nqe.SyncConfigurationFeature(this)),this.registerFeature(new Hci.TypeDefinitionFeature(this)),this.registerFeature(new Wci.ImplementationFeature(this)),this.registerFeature(new Bci.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Uci.WorkspaceFoldersFeature(this)),this.registerFeature(new Vci.FoldingRangeFeature(this)),this.registerFeature(new zci.DeclarationFeature(this)),this.registerFeature(new $ci.SelectionRangeFeature(this)),this.registerFeature(new Gci.ProgressFeature(this)),this.registerFeature(new qci.CallHierarchyFeature(this)),this.registerFeature(new Qci.SemanticTokensFeature(this)),this.registerFeature(new jci.LinkedEditingFeature(this)),this.registerFeature(new fB.DidCreateFilesFeature(this)),this.registerFeature(new fB.DidRenameFilesFeature(this)),this.registerFeature(new fB.DidDeleteFilesFeature(this)),this.registerFeature(new fB.WillCreateFilesFeature(this)),this.registerFeature(new fB.WillRenameFilesFeature(this)),this.registerFeature(new fB.WillDeleteFilesFeature(this)),this.registerFeature(new Kci.TypeHierarchyFeature(this)),this.registerFeature(new Yci.InlineValueFeature(this)),this.registerFeature(new Jci.InlayHintsFeature(this)),this.registerFeature(new Sci.DiagnosticFeature(this)),this.registerFeature(new Mqe.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(LRe.createAll(this))}fillInitializeParams(e){for(let t of this._features)rb.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,Vw.ensure)(e,"workspace").applyEdit=!0;const t=(0,Vw.ensure)((0,Vw.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[Ft.ResourceOperationKind.Create,Ft.ResourceOperationKind.Rename,Ft.ResourceOperationKind.Delete],t.failureHandling=Ft.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,Vw.ensure)((0,Vw.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[Ft.DiagnosticTag.Unnecessary,Ft.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const s=(0,Vw.ensure)(e,"window"),o=(0,Vw.ensure)(s,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,Vw.ensure)(s,"showDocument");r.support=!0;const a=(0,Vw.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(ZM.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let c of this._features)c.fillClientCapabilities(e);return e}initializeFeatures(e){const t=this._clientOptions.documentSelector;for(const i of this._features)rb.func(i.preInitialize)&&i.preInitialize(this._capabilities,t);for(const i of this._features)i.initialize(this._capabilities,t)}async handleRegistrationRequest(e){const t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,i=>this.doRegisterCapability(i)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(const t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(const t of e.registrations){const i=this._dynamicFeatures.get(t.method);if(i===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));const s=t.registerOptions??{};s.documentSelector=s.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:s};try{i.register(o)}catch(r){return Promise.reject(r)}}}async handleUnregistrationRequest(e){const t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,i=>this.doUnregisterCapability(i)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(const t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;const i=this._dynamicFeatures.get(t.method);if(!i)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));i.unregister(t.id)}}async handleApplyWorkspaceEdit(e){const t=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),s=new Map;ra.workspace.textDocuments.forEach(r=>s.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(Ft.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=s.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):rb.asPromise(ra.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,s,o=!0){if(i instanceof Ft.ResponseError){if(i.code===Ft.ErrorCodes.PendingResponseRejected||i.code===Ft.ErrorCodes.ConnectionInactive)return s;if(i.code===Ft.LSPErrorCodes.RequestCancelled||i.code===Ft.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return s;throw i.data!==void 0?new Vw.LSPCancellationError(i.data):new ra.CancellationError}else if(i.code===Ft.LSPErrorCodes.ContentModified){if(ZM.RequestsToCancelOnContentModified.has(e.method)||ZM.CancellableResolveCalls.has(e.method))throw new ra.CancellationError;return s}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Cct=mu.BaseLanguageClient=ZM;ZM.RequestsToCancelOnContentModified=new Set([Ft.SemanticTokensRequest.method,Ft.SemanticTokensRangeRequest.method,Ft.SemanticTokensDeltaRequest.method]);ZM.CancellableResolveCalls=new Set([Ft.CompletionResolveRequest.method,Ft.CodeLensResolveRequest.method,Ft.CodeActionResolveRequest.method,Ft.InlayHintResolveRequest.method,Ft.DocumentLinkResolveRequest.method,Ft.WorkspaceSymbolResolveRequest.method]);class eli{error(e){(0,Ft.RAL)().console.error(e)}warn(e){(0,Ft.RAL)().console.warn(e)}info(e){(0,Ft.RAL)().console.info(e)}log(e){(0,Ft.RAL)().console.log(e)}}function tli(n,e,t,i,s){const o=new eli,r=(0,Ft.createProtocolConnection)(n,e,o,s);return r.onError(c=>{t(c[0],c[1],c[2])}),r.onClose(i),{listen:()=>r.listen(),sendRequest:r.sendRequest,onRequest:r.onRequest,hasPendingResponse:r.hasPendingResponse,sendNotification:r.sendNotification,onNotification:r.onNotification,onProgress:r.onProgress,sendProgress:r.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:Ft.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(rb.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(Ft.InitializeRequest.type,c),shutdown:()=>r.sendRequest(Ft.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(Ft.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var LRe;(function(n){function e(t){return[new Xci.InlineCompletionItemFeature(t)]}n.createAll=e})(LRe||(mu.ProposedFeatures=LRe={}));(function(n){var e=sh&&sh.__createBinding||(Object.create?function(s,o,r,a){a===void 0&&(a=r);var c=Object.getOwnPropertyDescriptor(o,r);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(s,a,c)}:function(s,o,r,a){a===void 0&&(a=r),s[a]=o[r]}),t=sh&&sh.__exportStar||function(s,o){for(var r in s)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,s,r)};Object.defineProperty(n,"__esModule",{value:!0}),n.DiagnosticPullMode=n.vsdiag=void 0,t(Ts,n),t($n,n);var i=Ix;Object.defineProperty(n,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(n,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(mu,n)})(hRe);var Kre=Ts;(function(n){var e=sh&&sh.__createBinding||(Object.create?function(r,a,c,l){l===void 0&&(l=c);var d=Object.getOwnPropertyDescriptor(a,c);(!d||("get"in d?!a.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(r,l,d)}:function(r,a,c,l){l===void 0&&(l=c),r[l]=a[c]}),t=sh&&sh.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.LanguageClient=void 0;const i=hRe,s=Kre;t(Kre,n),t(hRe,n);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new s.BrowserMessageReader(this.worker),l=new s.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}n.LanguageClient=o})(dRe);class ili extends Cct{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:s}){super(e??t.toLowerCase(),t,i),this.connectionProvider=s}createMessageTransports(e){return this.connectionProvider.get(e)}}let qt;const pE=new Array(128).fill(void 0);pE.push(void 0,null,!0,!1);function q(n){return pE[n]}let V8=pE.length;function nli(n){n<132||(pE[n]=V8,V8=n)}function c_(n){const e=q(n);return nli(n),e}let oc=0,t$=null;function qX(){return(t$===null||t$.byteLength===0)&&(t$=new Uint8Array(qt.memory.buffer)),t$}const QX=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},sli=typeof QX.encodeInto=="function"?function(n,e){return QX.encodeInto(n,e)}:function(n,e){const t=QX.encode(n);return e.set(t),{read:n.length,written:t.length}};function Oc(n,e,t){if(t===void 0){const a=QX.encode(n),c=e(a.length,1)>>>0;return qX().subarray(c,c+a.length).set(a),oc=a.length,c}let i=n.length,s=e(i,1)>>>0;const o=qX();let r=0;for(;r127)break;o[s+r]=a}if(r!==i){r!==0&&(n=n.slice(r)),s=t(s,i,i=r+n.length*3,1)>>>0;const a=qX().subarray(s+r,s+i),c=sli(n,a);r+=c.written,s=t(s,i,r,1)>>>0}return oc=r,s}function $s(n){return n==null}let pT=null;function zi(){return(pT===null||pT.buffer.detached===!0||pT.buffer.detached===void 0&&pT.buffer!==qt.memory.buffer)&&(pT=new DataView(qt.memory.buffer)),pT}function tt(n){V8===pE.length&&pE.push(pE.length+1);const e=V8;return V8=pE[e],pE[e]=n,e}const yct=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yct.decode();function no(n,e){return n=n>>>0,yct.decode(qX().subarray(n,n+e))}function TRe(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const s=n.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=n.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(n)){const s=n.length;let o="[";s>0&&(o+=TRe(n[0]));for(let r=1;r1)i=t[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +${n.stack}`:i}const Yre=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{qt.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function a3(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;try{return i(s.a,s.b,...r)}finally{--s.cnt===0&&(qt.__wbindgen_export_2.get(s.dtor)(s.a,s.b),s.a=0,Yre.unregister(s))}};return o.original=s,Yre.register(o,s,s),o}function c3(n,e,t){qt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ed87396e433cd37(n,e,tt(t))}function zw(n,e,t,i){const s={a:n,b:e,cnt:1,dtor:t},o=(...r)=>{s.cnt++;const a=s.a;s.a=0;try{return i(a,s.b,...r)}finally{--s.cnt===0?(qt.__wbindgen_export_2.get(s.dtor)(a,s.b),Yre.unregister(s)):s.a=a}};return o.original=s,Yre.register(o,s,s),o}function Oqe(n,e){qt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0fc81412f5e8f282(n,e)}function AD(n,e,t){qt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00347670c924a916(n,e,tt(t))}function Bqe(n,e,t,i){qt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he42a58d92d86f1d0(n,e,tt(t),tt(i))}function tn(n,e){try{return n.apply(this,e)}catch(t){qt.__wbindgen_exn_store(tt(t))}}function oli(){try{const t=qt.__wbindgen_add_to_stack_pointer(-16);qt.run_event_loop(t);var n=zi().getInt32(t+4*0,!0),e=zi().getInt32(t+4*1,!0);if(e)throw c_(n)}finally{qt.__wbindgen_add_to_stack_pointer(16)}}let i$=null;function rli(){return(i$===null||i$.byteLength===0)&&(i$=new Float32Array(qt.memory.buffer)),i$}function PY(n,e){return n=n>>>0,rli().subarray(n/4,n/4+e)}const Wqe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>qt.__wbg_previewconnector_free(n>>>0,1));class wge{static __wrap(e){e=e>>>0;const t=Object.create(wge.prototype);return t.__wbg_ptr=e,Wqe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wqe.unregister(this),e}free(){const e=this.__destroy_into_raw();qt.__wbg_previewconnector_free(e,0)}static create(e,t,i,s){try{const c=qt.__wbindgen_add_to_stack_pointer(-16),l=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),d=oc;qt.previewconnector_create(c,tt(e),tt(t),l,d,s);var o=zi().getInt32(c+4*0,!0),r=zi().getInt32(c+4*1,!0),a=zi().getInt32(c+4*2,!0);if(a)throw c_(r);return c_(o)}finally{qt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=qt.previewconnector_current_style(this.__wbg_ptr);return c_(e)}show_ui(){try{const s=qt.__wbindgen_add_to_stack_pointer(-16);qt.previewconnector_show_ui(s,this.__wbg_ptr);var e=zi().getInt32(s+4*0,!0),t=zi().getInt32(s+4*1,!0),i=zi().getInt32(s+4*2,!0);if(i)throw c_(t);return c_(e)}finally{qt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const s=qt.__wbindgen_add_to_stack_pointer(-16);qt.previewconnector_process_lsp_to_preview_message(s,this.__wbg_ptr,tt(e));var t=zi().getInt32(s+4*0,!0),i=zi().getInt32(s+4*1,!0);if(i)throw c_(t)}finally{qt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>qt.__wbg_slintserver_free(n>>>0,1));async function ali(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(i){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function cli(){const n={};return n.wbg={},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return tt(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,s;try{i=e,s=t,console.error(no(e,t))}finally{qt.__wbindgen_free(i,s,1)}},n.wbg.__wbindgen_object_drop_ref=function(e){c_(e)},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return q(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return q(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return $s(t)?0:tt(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){q(e).attachShader(q(t),q(i))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){q(e).attachShader(q(t),q(i))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,s,o){q(e).bindAttribLocation(q(t),i>>>0,no(s,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,s,o){q(e).bindAttribLocation(q(t),i>>>0,no(s,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){q(e).linkProgram(q(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){q(e).linkProgram(q(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const s=q(e).getProgramParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const s=q(e).getProgramParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbindgen_boolean_get=function(e){const t=q(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){q(e).detachShader(q(t),q(i))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){q(e).detachShader(q(t),q(i))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const s=q(t).getProgramInfoLog(q(i));var o=$s(s)?0:Oc(s,qt.__wbindgen_malloc,qt.__wbindgen_realloc),r=oc;zi().setInt32(e+4*1,r,!0),zi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const s=q(t).getProgramInfoLog(q(i));var o=$s(s)?0:Oc(s,qt.__wbindgen_malloc,qt.__wbindgen_realloc),r=oc;zi().setInt32(e+4*1,r,!0),zi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return $s(i)?0:tt(i)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,s){q(e).shaderSource(q(t),no(i,s))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,s){q(e).shaderSource(q(t),no(i,s))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){q(e).compileShader(q(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){q(e).compileShader(q(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const s=q(e).getShaderParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const s=q(e).getShaderParameter(q(t),i>>>0);return tt(s)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const s=q(t).getShaderInfoLog(q(i));var o=$s(s)?0:Oc(s,qt.__wbindgen_malloc,qt.__wbindgen_realloc),r=oc;zi().setInt32(e+4*1,r,!0),zi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const s=q(t).getShaderInfoLog(q(i));var o=$s(s)?0:Oc(s,qt.__wbindgen_malloc,qt.__wbindgen_realloc),r=oc;zi().setInt32(e+4*1,r,!0),zi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,s){q(e).uniform2fv(q(t),PY(i,s))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,s){q(e).uniform2fv(q(t),PY(i,s))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){q(e).deleteFramebuffer(q(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){q(e).deleteFramebuffer(q(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){q(e).deleteRenderbuffer(q(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){q(e).deleteRenderbuffer(q(t))},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return tt(e)},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){q(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){q(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return tn(function(e,t,i,s){const o=q(e).getContext(no(t,i),q(s));return $s(o)?0:tt(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=q(e).getSupportedExtensions();return $s(t)?0:tt(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return q(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=q(e)[t>>>0];return tt(i)},n.wbg.__wbindgen_string_get=function(e,t){const i=q(t),s=typeof i=="string"?i:void 0;var o=$s(s)?0:Oc(s,qt.__wbindgen_malloc,qt.__wbindgen_realloc),r=oc;zi().setInt32(e+4*1,r,!0),zi().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return tn(function(e,t){const i=q(e).getParameter(t>>>0);return tt(i)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return $s(t)?0:tt(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return q(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return q(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,s,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,q(o),r)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,s,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,s>>>0,q(o),r)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return $s(t)?0:tt(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,s,o){q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,s,o){q(e).renderbufferStorage(t>>>0,i>>>0,s,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,s,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,q(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,s,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,s>>>0,q(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,s,o){q(e).scissor(t,i,s,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,s,o){q(e).scissor(t,i,s,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,s,o){q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,s,o){q(e).clearColor(t,i,s,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){q(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){q(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,s){q(e).uniform4fv(q(t),PY(i,s))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,s){q(e).uniform4fv(q(t),PY(i,s))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){q(e).deleteTexture(q(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){q(e).deleteTexture(q(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){q(e).deleteShader(q(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){q(e).deleteShader(q(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){q(e).deleteProgram(q(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){q(e).deleteProgram(q(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){q(e).useProgram(q(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){q(e).useProgram(q(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){q(e).bindVertexArray(q(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){q(e).bindVertexArrayOES(q(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){q(e).pixelStorei(t>>>0,i)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){q(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){q(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){q(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,s){q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,s){q(e).drawArrays(t>>>0,i,s)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){q(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){q(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){q(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,s){const o=q(e).getUniformLocation(q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,s){const o=q(e).getUniformLocation(q(t),no(i,s));return $s(o)?0:tt(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){q(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){q(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){q(e).uniform1i(q(t),i)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){q(e).uniform1i(q(t),i)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,s,o){q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,s,o){q(e).colorMask(t!==0,i!==0,s!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){q(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){q(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,s){q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,s){q(e).texParameteri(t>>>0,i>>>0,s)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,q(d))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return tn(function(e,t,i,s,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,s,o,r,a,c>>>0,l>>>0,d)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,s,o,r,a){q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,s,o,r,a){q(e).vertexAttribPointer(t>>>0,i,s>>>0,o!==0,r,a)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,s,o){q(e).viewport(t,i,s,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,s,o){q(e).viewport(t,i,s,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,s){q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,s){q(e).stencilFunc(t>>>0,i,s>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){q(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,s){q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,s){q(e).stencilOp(t>>>0,i>>>0,s>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,s,o){q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,s,o){q(e).stencilOpSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return q(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=q(e).document;return $s(t)?0:tt(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const s=q(e).getElementById(no(t,i));return $s(s)?0:tt(s)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){q(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){q(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return q(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return q(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=q(e).dataset;return tt(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,s){const o=q(t)[no(i,s)];var r=$s(o)?0:Oc(o,qt.__wbindgen_malloc,qt.__wbindgen_realloc),a=oc;zi().setInt32(e+4*1,a,!0),zi().setInt32(e+4*0,r,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=q(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=q(e).style;return tt(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return q(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return q(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return q(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return q(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return tn(function(e,t){q(e).before(q(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return tt(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=no(t,i)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var s=$s(i)?0:Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return q(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=q(t).inputType,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){q(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return q(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=q(t).key,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return q(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return q(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return q(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return q(e).getModifierState(no(t,i))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return q(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=q(e).clipboardData;return $s(t)?0:tt(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return tn(function(e,t,i,s){const o=q(t).getData(no(i,s)),r=Oc(o,qt.__wbindgen_malloc,qt.__wbindgen_realloc),a=oc;zi().setInt32(e+4*1,a,!0),zi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){q(e).font=no(t,i)},n.wbg.__wbindgen_string_new=function(e,t){const i=no(e,t);return tt(i)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){q(e).fillStyle=q(t)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return q(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return q(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=q(t).currentSrc,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return tn(function(){const e=new Image;return tt(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:no(t,i)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){q(e).onload=q(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){q(e).src=no(t,i)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return tt(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},n.wbg.__wbindgen_number_new=function(e){return tt(e)},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return tt(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},n.wbg.__wbg_log_5766f8130e3dc687=function(e,t){console.log(no(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){q(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){q(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){q(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){q(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,s){q(e).bufferData(t>>>0,q(i),s>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,s){q(e).bufferData(t>>>0,q(i),s>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,s,o){q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,s,o){q(e).blendFuncSeparate(t>>>0,i>>>0,s>>>0,o>>>0)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){q(e).deleteVertexArray(q(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){q(e).deleteVertexArrayOES(q(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){q(e).deleteBuffer(q(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){q(e).deleteBuffer(q(t))},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).readPixels(t,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).readPixels(t,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){q(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){q(e).height=t>>>0},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return tn(function(e,t,i,s,o,r,a,c){q(e).texSubImage2D(t>>>0,i,s,o,r>>>0,a>>>0,q(c))},arguments)},n.wbg.__wbg_next_f9cb570345655b9a=function(){return tn(function(e){const t=q(e).next();return tt(t)},arguments)},n.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return q(e).done},n.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=q(e).value;return tt(t)},n.wbg.__wbg_iterator_888179a48810a9fe=function(){return tt(Symbol.iterator)},n.wbg.__wbg_get_224d16597dbbfd96=function(){return tn(function(e,t){const i=Reflect.get(q(e),q(t));return tt(i)},arguments)},n.wbg.__wbindgen_is_function=function(e){return typeof q(e)=="function"},n.wbg.__wbindgen_is_object=function(e){const t=q(e);return typeof t=="object"&&t!==null},n.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=q(e).next;return tt(t)},n.wbg.__wbg_call_1084a111329e68ce=function(){return tn(function(e,t){const i=q(e).call(q(t));return tt(i)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return tn(function(e,t,i){const s=q(e).call(q(t),q(i));return tt(s)},arguments)},n.wbg.__wbg_call_c6fe275aaa60da79=function(){return tn(function(e,t,i,s){const o=q(e).call(q(t),q(i),q(s));return tt(o)},arguments)},n.wbg.__wbindgen_memory=function(){const e=qt.memory;return tt(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return tt(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const s=new Uint8Array(q(e),t>>>0,i>>>0);return tt(s)},n.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return q(e).length},n.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(q(e));return tt(t)},n.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return tn(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return tn(function(){const e=self.self;return tt(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return tn(function(){const e=window.window;return tt(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return tn(function(){const e=globalThis.globalThis;return tt(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return tn(function(){const e=global.global;return tt(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return q(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(no(e,t));return tt(i)},n.wbg.__wbindgen_error_new=function(e,t){const i=new Error(no(e,t));return tt(i)},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return q(e)==q(t)},n.wbg.__wbindgen_number_get=function(e,t){const i=q(t),s=typeof i=="number"?i:void 0;zi().setFloat64(e+8*1,$s(s)?0:s,!0),zi().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=q(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=q(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(q(e));return tt(t)},n.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(q(e))},n.wbg.__wbindgen_as_number=function(e){return+q(e)},n.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(q(t)),s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},n.wbg.__wbindgen_is_bigint=function(e){return typeof q(e)=="bigint"},n.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=q(t),s=typeof i=="bigint"?i:void 0;zi().setBigInt64(e+8*1,$s(s)?BigInt(0):s,!0),zi().setInt32(e+4*0,!$s(s),!0)},n.wbg.__wbindgen_bigint_from_i64=function(e){return tt(e)},n.wbg.__wbindgen_jsval_eq=function(e,t){return q(e)===q(t)},n.wbg.__wbindgen_in=function(e,t){return q(e)in q(t)},n.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=q(e)instanceof Map}catch{t=!1}return t},n.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return tt(t)},n.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return tt(i)},n.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},n.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const s=q(e).set(q(t),q(i));return tt(s)},n.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[c_(t)]=c_(i)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return tt(e)},n.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=c_(i)},n.wbg.__wbg_new_8608a2b51a5f6737=function(){return tt(new Map)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},s=(r,a)=>{const c=i.a;i.a=0;try{return Bqe(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(s);return tt(o)}finally{i.a=i.b=0}},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return tt(t)},n.wbg.__wbg_platform_509d898d9dce4c23=function(){return tn(function(e,t){const i=q(t).platform,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_previewconnector_new=function(e){const t=wge.__wrap(e);return tt(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(no(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const i=TRe(q(t)),s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return tt(t)},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return tt(t)},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const s=q(e).then(q(t),q(i));return tt(s)},n.wbg.__wbindgen_cb_drop=function(e){const t=c_(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return tt(i)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return tn(function(e,t,i){const s=q(e).getExtension(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return tn(function(e,t,i){const s=q(e).matchMedia(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return tn(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return tn(function(e,t){return q(e).setTimeout(q(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return tn(function(e,t,i){const s=q(e).createElement(no(t,i));return tt(s)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return tn(function(e,t,i){return q(e).matches(no(t,i))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return tn(function(e,t,i,s,o){q(e).setAttribute(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return tn(function(e){q(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return tn(function(e,t,i,s,o){q(e).fillText(no(t,i),s,o)},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return tn(function(e,t,i){const s=q(e).getContext(no(t,i));return $s(s)?0:tt(s)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return tn(function(e,t){q(e).addListener(q(t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return tn(function(e,t,i,s,o){q(e).setProperty(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return tn(function(e,t){URL.revokeObjectURL(no(e,t))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=q(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_setData_41207994e2d54785=function(){return tn(function(e,t,i,s,o){q(e).setData(no(t,i),no(s,o))},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return tn(function(e,t,i,s){q(e).addEventListener(no(t,i),q(s))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return tn(function(e,t,i,s){q(e).removeEventListener(no(t,i),q(s))},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return tn(function(e,t){q(e).postMessage(q(t))},arguments)},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var s=$s(i)?0:Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return tn(function(){const e=new AbortController;return tt(e)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return tn(function(){const e=new MessageChannel;return tt(e)},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return tt(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return q(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return q(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return q(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=q(e).scheduler;return tt(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return tt(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const s=q(e).postTask(q(t),q(i));return tt(s)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return tt(i)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return tt(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){q(e).onmessage=q(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){q(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=q(e).port2;return tt(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return tn(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return tn(function(e,t,i){return q(e).setTimeout(q(t),i)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(q(e),q(t));return tt(i)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return tt(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return tn(function(e,t,i){q(e).postMessage(q(t),q(i))},arguments)},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=q(t).pointerType,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return tn(function(e,t){q(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},n.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return tt(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return q(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return q(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=q(e).devicePixelContentBoxSize;return tt(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return q(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return q(e).blockSize},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return tn(function(e,t){const i=new Worker(no(e,t));return tt(i)},arguments)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=no(t,i)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return tn(function(e,t){const i=new Blob(q(e),q(t));return tt(i)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return tn(function(e,t){const i=URL.createObjectURL(q(t)),s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return tt(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return tt(i)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return tt(t)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(q(e),q(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){q(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){q(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){q(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){q(e).close()},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=q(e).userAgentData;return $s(t)?0:tt(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return tt(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return tn(function(e,t){const i=q(t).userAgent,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},arguments)},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(c_(e))},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){q(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){q(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){q(e).cancel()},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return tt(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return $s(t)?0:tt(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(q(e),q(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const s=q(e).animate(q(t),q(i));return tt(s)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return tn(function(e,t){q(e).removeListener(q(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return q(e).contains(q(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){q(e).unobserve(q(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){q(e).observe(q(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){q(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){q(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return tn(function(e,t,i,s){const o=q(t).getPropertyValue(no(i,s)),r=Oc(o,qt.__wbindgen_malloc,qt.__wbindgen_realloc),a=oc;zi().setInt32(e+4*1,a,!0),zi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return tn(function(e,t,i,s){const o=q(t).removeProperty(no(i,s)),r=Oc(o,qt.__wbindgen_malloc,qt.__wbindgen_realloc),a=oc;zi().setInt32(e+4*1,a,!0),zi().setInt32(e+4*0,r,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=q(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=q(e).body;return $s(t)?0:tt(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return tn(function(e,t){const i=q(e).appendChild(q(t));return tt(i)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return tn(function(e,t){const i=q(e).getComputedStyle(q(t));return $s(i)?0:tt(i)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return $s(t)?0:tt(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return tn(function(e){const t=new ResizeObserver(q(e));return tt(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){q(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){q(e).observe(q(t),q(i))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return tn(function(e){const t=new IntersectionObserver(q(e));return tt(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){q(e).observe(q(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=q(e).getBoundingClientRect();return tt(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return q(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return q(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return tn(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return tt(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return tt(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return tt(t)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return tt(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return q(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return q(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return q(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return q(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return q(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return q(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=q(t).code,s=Oc(i,qt.__wbindgen_malloc,qt.__wbindgen_realloc),o=oc;zi().setInt32(e+4*1,o,!0),zi().setInt32(e+4*0,s,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return q(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return q(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return q(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return q(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return q(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return q(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=q(e).getCoalescedEvents();return tt(t)},n.wbg.__wbindgen_closure_wrapper3682=function(e,t,i){const s=a3(e,t,1371,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3684=function(e,t,i){const s=a3(e,t,1371,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3685=function(e,t,i){const s=a3(e,t,1371,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3686=function(e,t,i){const s=a3(e,t,1371,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper3687=function(e,t,i){const s=a3(e,t,1371,c3);return tt(s)},n.wbg.__wbindgen_closure_wrapper6015=function(e,t,i){const s=zw(e,t,1598,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper11558=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12725=function(e,t,i){const s=zw(e,t,1598,Oqe);return tt(s)},n.wbg.__wbindgen_closure_wrapper12759=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12764=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12770=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12781=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12793=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12849=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12856=function(e,t,i){const s=zw(e,t,1598,AD);return tt(s)},n.wbg.__wbindgen_closure_wrapper12865=function(e,t,i){const s=zw(e,t,1598,Bqe);return tt(s)},n}function lli(n,e){return qt=n.exports,Sct.__wbindgen_wasm_module=e,pT=null,i$=null,t$=null,qt}async function Sct(n){if(qt!==void 0)return qt;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_lsp_wasm_bg-DXvQhfqz.wasm",import.meta.url).href,import.meta.url));const e=cli();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:i}=await ali(await n,e);return lli(t,i)}function dli(n){return new ili({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:dRe.ErrorAction.Continue}),closed:()=>({action:dRe.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(n)}})}var gU,fU;class hli{constructor(){kt(this,gU);kt(this,fU);const e=new Worker(new URL(""+new URL("lsp_worker-BcLzH45z.js",import.meta.url).href,import.meta.url),{type:"module"});st(this,fU,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),st(this,gU,Sct())}async wait_for_lsp(){const e=se(this,fU);st(this,fU,null);const t=se(this,gU);st(this,gU,null);const[i,s]=await Promise.all([t,e]);return Promise.resolve(new gli(s))}}gU=new WeakMap,fU=new WeakMap;var pU;class uli{constructor(e){kt(this,pU);st(this,pU,e)}show_ui(){return se(this,pU).show_ui()}current_style(){return se(this,pU).current_style()}}pU=new WeakMap;var Wq,Hq,mU,tM,iM,_U,nM;class gli{constructor(e){kt(this,Wq,null);kt(this,Hq,null);kt(this,mU);kt(this,tM);kt(this,iM);kt(this,_U);kt(this,nM,null);st(this,tM,e),st(this,mU,(s,o)=>!0);const t=new qni(new Kre.BrowserMessageReader(se(this,tM)),s=>{if(s.method==="slint/lsp_to_preview"){const r=s.params;return se(this,nM)?.process_lsp_to_preview_message(r),!0}if(s.method==="slint/load_file"){const o=s,r=o.params[0];return this.read_url(r).then(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:o.jsonrpc,id:o.id,result:"",error:void 0})}),!0}if(s.method==="window/showDocument"){const o=s,r=o.params,a=r.selection?.start||{line:1,character:1},c=se(this,mU).call(this,r.uri,a);return i.write({jsonrpc:o.jsonrpc,id:o.id,result:{success:c},error:void 0}),!0}return!1}),i=new Kre.BrowserMessageWriter(se(this,tM));st(this,iM,t),st(this,_U,i)}get lsp_worker(){return se(this,tM)}get lsp_reader(){return se(this,iM)}get lsp_writer(){return se(this,_U)}set file_reader(e){st(this,Hq,e)}set show_document_callback(e){st(this,mU,e)}read_url(e){var t;try{return((t=se(this,Hq))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=se(this,Wq);if(e===null){const t=dli({reader:se(this,iM),writer:se(this,_U)});st(this,Wq,t),t.start(),se(this,iM).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(se(this,nM)===null){try{oli()}catch{}const s=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");st(this,nM,await wge.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,s==="1"))}return new uli(se(this,nM))}}Wq=new WeakMap,Hq=new WeakMap,mU=new WeakMap,tM=new WeakMap,iM=new WeakMap,_U=new WeakMap,nM=new WeakMap;const FY="canvas";var sM;const MBe=class MBe extends ot{constructor(t,i,s){super({node:MBe.createNode()});kt(this,sM,null);this.setFlag(ot.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,s).then(o=>{st(this,sM,o),se(this,sM).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(FY);r.style.width="100%",r.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=FY,i.className=FY,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return se(this,sM)?se(this,sM).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(FY);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};sM=new WeakMap;let RRe=MBe;const fli=new hli,f_=new eA;function pli(n){const e=new aw({commands:f_});e.title.label="Open Demo";for(const t of n.known_demos()){const i="slint:set_demo_"+t[1];f_.addCommand(i,{label:t[1],execute:()=>n.set_demo(t[0])}),e.addItem({command:i})}return e}function mli(){const n=new aw({commands:f_});return n.title.label="Settings",f_.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{jrt()}}),n.addItem({command:"slint:store_github_token"}),n}function _li(n,e){const t=new aw({commands:f_});return t.title.label="Project",f_.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");n.project_from_url(i)}}),f_.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),f_.addCommand("slint:add_file",{label:"Add File",iconClass:"fa-regular fa-file",mnemonic:1,execute:()=>{let i=prompt("Please enter the file name");i!=null&&(i.endsWith(".slint")||(i=i+".slint"),n.add_empty_file_to_project(i))}}),f_.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:pli(n)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:vli(n,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:mli()}),t}function vli(n,e){const t=new aw({commands:f_});return t.title.label="Share",f_.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>n.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",n.current_editor_content),i.set("style",e.current_style());const s=new URL(window.location.toString());s.search=i.toString(),C7e(s.toString())}}),f_.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>n.open_document_urls.length>0,execute:async()=>{let i=K1e();i||await jrt(),i=K1e(),i?await MZt((s,o)=>{FZt(n,s,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),C7e(r,c.toString())}).catch(r=>RZt(r))}):alert("You need a github access token set up to export as a gist.")}}),t.addItem({command:"slint:create_gist"}),t.addItem({command:"slint:copy_permalink"}),t}const wli=new URLSearchParams(window.location.search),bli=wli.get("style");function Cli(n){const e=new lRe(n),t=new RRe(n,o=>e.map_url(o),bli??""),i=new lq;i.id="menuBar",i.addMenu(_li(e,t));const s=new $4({orientation:"horizontal"});s.id="main",s.addWidget(e),s.addWidget(t),window.onresize=()=>{s.update()},document.addEventListener("keydown",o=>{f_.processKeydownEvent(o)}),ot.attach(i,document.body),ot.attach(s,document.body)}function yli(){Uni().then(n=>{fli.wait_for_lsp().then(e=>{Cli(e),document.body.getElementsByClassName("loader")[0].remove()}).catch(e=>{console.info("LSP fail:",e);const t=document.createElement("div");t.className="browser-error",t.innerHTML="

    Failed to start the slint language server

    ",document.body.getElementsByClassName("loader")[0].remove(),document.body.appendChild(t)})}).catch(n=>{console.info("Monaco fail:",n)})}window.onload=yli;export{sh as c,PEi as g}; diff --git a/snapshots/master/editor/assets/lsp_worker-CM7hixNl.js b/snapshots/master/editor/assets/lsp_worker-BcLzH45z.js similarity index 77% rename from snapshots/master/editor/assets/lsp_worker-CM7hixNl.js rename to snapshots/master/editor/assets/lsp_worker-BcLzH45z.js index daa27ea1f..35cc8cbd7 100644 --- a/snapshots/master/editor/assets/lsp_worker-CM7hixNl.js +++ b/snapshots/master/editor/assets/lsp_worker-BcLzH45z.js @@ -1,25 +1,25 @@ -(function(){"use strict";let p;const Ve=new Array(128).fill(void 0);Ve.push(void 0,null,!0,!1);function s(t){return Ve[t]}let Gt=Ve.length;function $c(t){t<132||(Ve[t]=Gt,Gt=t)}function fe(t){const e=s(t);return $c(t),e}let V=0,Zt=null;function Mn(){return(Zt===null||Zt.byteLength===0)&&(Zt=new Uint8Array(p.memory.buffer)),Zt}const On=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hc=typeof On.encodeInto=="function"?function(t,e){return On.encodeInto(t,e)}:function(t,e){const n=On.encode(t);return e.set(n),{read:t.length,written:n.length}};function X(t,e,n){if(n===void 0){const d=On.encode(t),f=e(d.length,1)>>>0;return Mn().subarray(f,f+d.length).set(d),V=d.length,f}let r=t.length,i=e(r,1)>>>0;const o=Mn();let c=0;for(;c127)break;o[i+c]=d}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;const d=Mn().subarray(i+c,i+r),f=Hc(t,d);c+=f.written,i=n(i,r,c,1)>>>0}return V=c,i}function j(t){return t==null}let mt=null;function k(){return(mt===null||mt.buffer.detached===!0||mt.buffer.detached===void 0&&mt.buffer!==p.memory.buffer)&&(mt=new DataView(p.memory.buffer)),mt}function g(t){Gt===Ve.length&&Ve.push(Ve.length+1);const e=Gt;return Gt=Ve[e],Ve[e]=t,e}const yo=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yo.decode();function F(t,e){return t=t>>>0,yo.decode(Mn().subarray(t,t+e))}function Vr(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){const i=t.length;let o="[";i>0&&(o+=Vr(t[0]));for(let c=1;c1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}const En=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{p.__wbindgen_export_2.get(t.dtor)(t.a,t.b)});function en(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;try{return r(i.a,i.b,...c)}finally{--i.cnt===0&&(p.__wbindgen_export_2.get(i.dtor)(i.a,i.b),i.a=0,En.unregister(i))}};return o.original=i,En.register(o,i,i),o}function tn(t,e,n){p._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h165a31a3f6a17f4a(t,e,g(n))}function Ee(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;const d=i.a;i.a=0;try{return r(d,i.b,...c)}finally{--i.cnt===0?(p.__wbindgen_export_2.get(i.dtor)(d,i.b),En.unregister(i)):i.a=d}};return o.original=i,En.register(o,i,i),o}function vo(t,e){p._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha4cf337f3953c47d(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00347670c924a916(t,e,g(n))}function Ro(t,e,n,r){p._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he42a58d92d86f1d0(t,e,g(n),g(r))}function C(t,e){try{return t.apply(this,e)}catch(n){p.__wbindgen_exn_store(g(n))}}function xc(t,e,n,r){try{const d=p.__wbindgen_add_to_stack_pointer(-16);p.create(d,g(t),g(e),g(n),g(r));var i=k().getInt32(d+4*0,!0),o=k().getInt32(d+4*1,!0),c=k().getInt32(d+4*2,!0);if(c)throw fe(o);return Jr.__wrap(i)}finally{p.__wbindgen_add_to_stack_pointer(16)}}let nn=null;function zc(){return(nn===null||nn.byteLength===0)&&(nn=new Float32Array(p.memory.buffer)),nn}function Nn(t,e){return t=t>>>0,zc().subarray(t/4,t/4+e)}const Do=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_previewconnector_free(t>>>0,1));class Ur{static __wrap(e){e=e>>>0;const n=Object.create(Ur.prototype);return n.__wbg_ptr=e,Do.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Do.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_previewconnector_free(e,0)}static create(e,n,r,i){try{const f=p.__wbindgen_add_to_stack_pointer(-16),_=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),w=V;p.previewconnector_create(f,g(e),g(n),_,w,i);var o=k().getInt32(f+4*0,!0),c=k().getInt32(f+4*1,!0),d=k().getInt32(f+4*2,!0);if(d)throw fe(c);return fe(o)}finally{p.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=p.previewconnector_current_style(this.__wbg_ptr);return fe(e)}show_ui(){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_show_ui(i,this.__wbg_ptr);var e=k().getInt32(i+4*0,!0),n=k().getInt32(i+4*1,!0),r=k().getInt32(i+4*2,!0);if(r)throw fe(n);return fe(e)}finally{p.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_process_lsp_to_preview_message(i,this.__wbg_ptr,g(e));var n=k().getInt32(i+4*0,!0),r=k().getInt32(i+4*1,!0);if(r)throw fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}}const To=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_slintserver_free(t>>>0,1));class Jr{static __wrap(e){e=e>>>0;const n=Object.create(Jr.prototype);return n.__wbg_ptr=e,To.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,To.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_slintserver_free(e,0)}process_preview_to_lsp_message(e){const n=p.slintserver_process_preview_to_lsp_message(this.__wbg_ptr,g(e));return fe(n)}server_initialize_result(e){try{const o=p.__wbindgen_add_to_stack_pointer(-16);p.slintserver_server_initialize_result(o,this.__wbg_ptr,g(e));var n=k().getInt32(o+4*0,!0),r=k().getInt32(o+4*1,!0),i=k().getInt32(o+4*2,!0);if(i)throw fe(r);return fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}reload_document(e,n,r){const i=X(e,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V,c=p.slintserver_reload_document(this.__wbg_ptr,i,o,g(n),r);return fe(c)}handle_request(e,n,r){const i=X(n,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V,c=p.slintserver_handle_request(this.__wbg_ptr,g(e),i,o,g(r));return fe(c)}reload_config(){const e=p.slintserver_reload_config(this.__wbg_ptr);return fe(e)}}async function Bc(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function Vc(){const t={};return t.wbg={},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return g(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=s(n).stack,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(F(e,n))}finally{p.__wbindgen_free(r,i,1)}},t.wbg.__wbindgen_object_drop_ref=function(e){fe(e)},t.wbg.__wbg_width_ac5901de11cd9abc=function(e){return s(e).width},t.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return s(e).height},t.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbindgen_boolean_get=function(e){const n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:X(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=V;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:X(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=V;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_createShader_af087106532661d9=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:X(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=V;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:X(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=V;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return g(e)},t.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,n){s(e).stencil=n!==0},t.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,n){s(e).antialias=n!==0},t.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return C(function(e,n,r,i){const o=s(e).getContext(F(n,r),s(i));return j(o)?0:g(o)},arguments)},t.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let n;try{n=s(e)instanceof WebGL2RenderingContext}catch{n=!1}return n},t.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const n=s(e).getSupportedExtensions();return j(n)?0:g(n)},t.wbg.__wbg_length_ae22078168b726f5=function(e){return s(e).length},t.wbg.__wbg_get_3baa728f9d58d3f6=function(e,n){const r=s(e)[n>>>0];return g(r)},t.wbg.__wbindgen_string_get=function(e,n){const r=s(n),i=typeof r=="string"?r:void 0;var o=j(i)?0:X(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=V;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getParameter_cfaed180705b9280=function(){return C(function(e,n){const r=s(e).getParameter(n>>>0);return g(r)},arguments)},t.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const n=s(e).createVertexArrayOES();return j(n)?0:g(n)},t.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const n=s(e).createVertexArray();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return s(e).getError()},t.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return s(e).getError()},t.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_scissor_d06b14c4966727fa=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,n){s(e).bindVertexArray(s(n))},t.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,n){s(e).bindVertexArrayOES(s(n))},t.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_disable_d73e59fee5b5e973=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disable_8908871f2334e76b=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_enable_68b3fa03a633259a=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enable_541ed84c1e7d269d=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return C(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return C(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texParameteri_531d0268109950ba=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return C(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return C(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return C(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,w)},arguments)},t.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_viewport_536c78dd69c44351=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilMask_702162181d88081f=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilOp_2418383669ca9228=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return s(e).devicePixelRatio},t.wbg.__wbg_document_8554450897a855b9=function(e){const n=s(e).document;return j(n)?0:g(n)},t.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,n,r){const i=s(e).getElementById(F(n,r));return j(i)?0:g(i)},t.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let n;try{n=s(e)instanceof HTMLCanvasElement}catch{n=!1}return n},t.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return s(e).clientWidth},t.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return s(e).clientHeight},t.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const n=s(e).dataset;return g(n)},t.wbg.__wbg_get_9a60fce5bf7da364=function(e,n,r,i){const o=s(n)[F(r,i)];var c=j(o)?0:X(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=V;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},t.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let n;try{n=s(e)instanceof HTMLInputElement}catch{n=!1}return n},t.wbg.__wbg_style_e06c9e03355741e9=function(e){const n=s(e).style;return g(n)},t.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return s(e).offsetLeft},t.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return s(e).offsetTop},t.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return s(e).offsetWidth},t.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return s(e).offsetHeight},t.wbg.__wbg_before_ac3792b457802cbf=function(){return C(function(e,n){s(e).before(s(n))},arguments)},t.wbg.__wbindgen_object_clone_ref=function(e){const n=s(e);return g(n)},t.wbg.__wbg_setvalue_688819688274bec0=function(e,n,r){s(e).value=F(n,r)},t.wbg.__wbg_data_edba00a6420faae3=function(e,n){const r=s(n).data;var i=j(r)?0:X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return s(e).isComposing},t.wbg.__wbg_inputType_dc144c8251b0d194=function(e,n){const r=s(n).inputType,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){s(e).preventDefault()},t.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return s(e).isComposing},t.wbg.__wbg_key_a626396efbca2b95=function(e,n){const r=s(n).key,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return s(e).altKey},t.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,n,r){return s(e).getModifierState(F(n,r))},t.wbg.__wbg_repeat_8451a79b3608855b=function(e){return s(e).repeat},t.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const n=s(e).clipboardData;return j(n)?0:g(n)},t.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return C(function(e,n,r,i){const o=s(n).getData(F(r,i)),c=X(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=V;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let n;try{n=s(e)instanceof CanvasRenderingContext2D}catch{n=!1}return n},t.wbg.__wbg_setfont_931e1f36bec6a342=function(e,n,r){s(e).font=F(n,r)},t.wbg.__wbindgen_string_new=function(e,n){const r=F(e,n);return g(r)},t.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,n){s(e).fillStyle=s(n)},t.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return s(e).naturalWidth},t.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return s(e).naturalHeight},t.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,n){const r=s(n).currentSrc,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_src_707c2de7cbb580c7=function(e,n){const r=s(n).src,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_0d5e77f348d88b87=function(){return C(function(){const e=new Image;return g(e)},arguments)},t.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,n,r){s(e).crossOrigin=n===0?void 0:F(n,r)},t.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,n){s(e).onload=s(n)},t.wbg.__wbg_setsrc_129ba95151116b01=function(e,n,r){s(e).src=F(n,r)},t.wbg.__wbg_new0_65387337a95cf44d=function(){return g(new Date)},t.wbg.__wbg_getTime_91058879093a1589=function(e){return s(e).getTime()},t.wbg.__wbindgen_number_new=function(e){return g(e)},t.wbg.__wbg_new_7982fb43cfca37ae=function(e){const n=new Date(s(e));return g(n)},t.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return s(e).getTimezoneOffset()},t.wbg.__wbg_log_5766f8130e3dc687=function(e,n){console.log(F(e,n))},t.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_bufferData_0db2a74470353a96=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_bufferData_94ce174a81b32961=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,n){s(e).deleteVertexArray(s(n))},t.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,n){s(e).deleteVertexArrayOES(s(n))},t.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return C(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return C(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_setwidth_84b579903fae1a52=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_6ae385769cc2e592=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return C(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return C(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_next_f9cb570345655b9a=function(){return C(function(e){const n=s(e).next();return g(n)},arguments)},t.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return s(e).done},t.wbg.__wbg_value_6d39332ab4788d86=function(e){const n=s(e).value;return g(n)},t.wbg.__wbg_iterator_888179a48810a9fe=function(){return g(Symbol.iterator)},t.wbg.__wbg_get_224d16597dbbfd96=function(){return C(function(e,n){const r=Reflect.get(s(e),s(n));return g(r)},arguments)},t.wbg.__wbindgen_is_function=function(e){return typeof s(e)=="function"},t.wbg.__wbindgen_is_object=function(e){const n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_next_de3e9db4440638b2=function(e){const n=s(e).next;return g(n)},t.wbg.__wbg_call_1084a111329e68ce=function(){return C(function(e,n){const r=s(e).call(s(n));return g(r)},arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return C(function(e,n,r){const i=s(e).call(s(n),s(r));return g(i)},arguments)},t.wbg.__wbg_call_c6fe275aaa60da79=function(){return C(function(e,n,r,i){const o=s(e).call(s(n),s(r),s(i));return g(o)},arguments)},t.wbg.__wbindgen_memory=function(){const e=p.memory;return g(e)},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const n=s(e).buffer;return g(n)},t.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,n,r){const i=new Uint8Array(s(e),n>>>0,r>>>0);return g(i)},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return s(e).length},t.wbg.__wbg_new_ea1883e1e5e86686=function(e){const n=new Uint8Array(s(e));return g(n)},t.wbg.__wbg_set_d1e79e2388520f18=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbg_set_eacc7d73fefaafdf=function(){return C(function(e,n,r){return Reflect.set(s(e),s(n),s(r))},arguments)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return C(function(){const e=self.self;return g(e)},arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return C(function(){const e=window.window;return g(e)},arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return C(function(){const e=globalThis.globalThis;return g(e)},arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return C(function(){const e=global.global;return g(e)},arguments)},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,n){const r=new Function(F(e,n));return g(r)},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(F(e,n));return g(r)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_number_get=function(e,n){const r=s(n),i=typeof r=="number"?r:void 0;k().setFloat64(e+8*1,j(i)?0:i,!0),k().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const n=Object.entries(s(e));return g(n)},t.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(s(e))},t.wbg.__wbindgen_as_number=function(e){return+s(e)},t.wbg.__wbg_String_b9412f8799faab3e=function(e,n){const r=String(s(n)),i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,n){const r=s(e)[s(n)];return g(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbg_set_49185437f0ab06f8=function(e,n,r){const i=s(e).set(s(n),s(r));return g(i)},t.wbg.__wbg_set_f975102236d3c502=function(e,n,r){s(e)[fe(n)]=fe(r)},t.wbg.__wbg_new_8608a2b51a5f6737=function(){return g(new Map)},t.wbg.__wbg_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(n)},t.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return g(e)},t.wbg.__wbg_set_673dda6c73d19609=function(e,n,r){s(e)[n>>>0]=fe(r)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,n){try{var r={a:e,b:n},i=(c,d)=>{const f=r.a;r.a=0;try{return Ro(f,r.b,c,d)}finally{r.a=f}};const o=new Promise(i);return g(o)}finally{r.a=r.b=0}},t.wbg.__wbindgen_is_bigint=function(e){return typeof s(e)=="bigint"},t.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const r=s(n),i=typeof r=="bigint"?r:void 0;k().setBigInt64(e+8*1,j(i)?BigInt(0):i,!0),k().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbindgen_jsval_eq=function(e,n){return s(e)===s(n)},t.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let n;try{n=s(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbindgen_throw=function(e,n){throw new Error(F(e,n))},t.wbg.__wbindgen_debug_string=function(e,n){const r=Vr(s(n)),i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const n=s(e).queueMicrotask;return g(n)},t.wbg.__wbg_resolve_570458cb99d56a43=function(e){const n=Promise.resolve(s(e));return g(n)},t.wbg.__wbg_then_876bb3c633745cc6=function(e,n,r){const i=s(e).then(s(n),s(r));return g(i)},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_then_95e6edc0f89b73b1=function(e,n){const r=s(e).then(s(n));return g(r)},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(s(e))},t.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return C(function(e,n,r){const i=s(e).getExtension(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return C(function(e,n,r){const i=s(e).matchMedia(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return C(function(e,n){s(e).cancelAnimationFrame(n)},arguments)},t.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return C(function(e,n){return s(e).setTimeout(s(n))},arguments)},t.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return C(function(e,n,r){const i=s(e).createElement(F(n,r));return g(i)},arguments)},t.wbg.__wbg_matches_212d57a200ff58f8=function(){return C(function(e,n,r){return s(e).matches(F(n,r))},arguments)},t.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return C(function(e,n,r,i,o){s(e).setAttribute(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_focus_06621101cc79f5d8=function(){return C(function(e){s(e).focus()},arguments)},t.wbg.__wbg_fillText_ae0445d1930428dd=function(){return C(function(e,n,r,i,o){s(e).fillText(F(n,r),i,o)},arguments)},t.wbg.__wbg_getContext_69ec873410cbba3c=function(){return C(function(e,n,r){const i=s(e).getContext(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return C(function(e,n){s(e).addListener(s(n))},arguments)},t.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return C(function(e,n,r,i,o){s(e).setProperty(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return C(function(e,n){URL.revokeObjectURL(F(e,n))},arguments)},t.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let n;try{n=s(e)instanceof Window}catch{n=!1}return n},t.wbg.__wbg_setData_41207994e2d54785=function(){return C(function(e,n,r,i,o){s(e).setData(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return C(function(e,n,r,i){s(e).addEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return C(function(e,n,r,i){s(e).removeEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return C(function(e,n){s(e).postMessage(s(n))},arguments)},t.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,n){const r=s(n).data;var i=j(r)?0:X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_ebf2727385ee825c=function(){return C(function(){const e=new AbortController;return g(e)},arguments)},t.wbg.__wbg_new_40ff2b042829bc58=function(){return C(function(){const e=new MessageChannel;return g(e)},arguments)},t.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const n=s(e).performance;return g(n)},t.wbg.__wbg_now_abd80e969af37148=function(e){return s(e).now()},t.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return s(e).movementX},t.wbg.__wbg_movementY_3064817f736e8151=function(e){return s(e).movementY},t.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const n=s(e).signal;return g(n)},t.wbg.__wbg_postTask_99464245f349be5a=function(e,n,r){const i=s(e).postTask(s(n),s(r));return g(i)},t.wbg.__wbg_catch_a279b1da46d132d8=function(e,n){const r=s(e).catch(s(n));return g(r)},t.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const n=s(e).port1;return g(n)},t.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,n){s(e).onmessage=s(n)},t.wbg.__wbg_start_f642a950f6c98a0e=function(e){s(e).start()},t.wbg.__wbg_port2_7d887905fa4a6677=function(e){const n=s(e).port2;return g(n)},t.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return C(function(e,n){return s(e).requestIdleCallback(s(n))},arguments)},t.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return C(function(e,n,r){return s(e).setTimeout(s(n),r)},arguments)},t.wbg.__wbg_of_99c2a118200b1e62=function(e,n){const r=Array.of(s(e),s(n));return g(r)},t.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const n=Array.of(s(e));return g(n)},t.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return C(function(e,n,r){s(e).postMessage(s(n),s(r))},arguments)},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,n){const r=s(n).pointerType,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return s(e).pointerId},t.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return C(function(e,n){s(e).setPointerCapture(n)},arguments)},t.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return s(e).pressure},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return s(e).persisted},t.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const n=s(e).contentRect;return g(n)},t.wbg.__wbg_width_e7964a50b174d035=function(e){return s(e).width},t.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return s(e).height},t.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const n=s(e).devicePixelContentBoxSize;return g(n)},t.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return s(e).inlineSize},t.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return s(e).blockSize},t.wbg.__wbg_new_25d9d4e2932d816f=function(){return C(function(e,n){const r=new Worker(F(e,n));return g(r)},arguments)},t.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,n,r){s(e).type=F(n,r)},t.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return C(function(e,n){const r=new Blob(s(e),s(n));return g(r)},arguments)},t.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return C(function(e,n){const r=URL.createObjectURL(s(n)),i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return g(e)},t.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,n){const r=Object.getOwnPropertyDescriptor(s(e),s(n));return g(r)},t.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const n=s(e).Window;return g(n)},t.wbg.__wbg_error_9ce09486992d3ac5=function(e,n){console.error(s(e),s(n))},t.wbg.__wbg_abort_8659d889a7877ae3=function(e){s(e).abort()},t.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,n){s(e).cancelIdleCallback(n>>>0)},t.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,n){s(e).clearTimeout(n)},t.wbg.__wbg_close_87d69f9e9fe928c3=function(e){s(e).close()},t.wbg.__wbg_navigator_6210380287bf8581=function(e){const n=s(e).navigator;return g(n)},t.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const n=s(e).userAgentData;return j(n)?0:g(n)},t.wbg.__wbg_brands_982de08b35281a98=function(e){const n=s(e).brands;return g(n)},t.wbg.__wbg_brand_cdcf0249d44027a8=function(e,n){const r=s(n).brand,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return C(function(e,n){const r=s(n).userAgent,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},t.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){s(e).disconnect()},t.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){s(e).disconnect()},t.wbg.__wbg_cancel_cba86749f45f30ae=function(e){s(e).cancel()},t.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){s(e).webkitRequestFullscreen()},t.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const n=s(e).requestFullscreen();return g(n)},t.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const n=s(e).webkitFullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const n=s(e).fullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_is_009b1ef508712fda=function(e,n){return Object.is(s(e),s(n))},t.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,n,r){const i=s(e).animate(s(n),s(r));return g(i)},t.wbg.__wbg_play_5896e5851ba90aa2=function(e){s(e).play()},t.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return C(function(e,n){s(e).removeListener(s(n))},arguments)},t.wbg.__wbg_contains_4f87c5405416b4fd=function(e,n){return s(e).contains(s(n))},t.wbg.__wbg_unobserve_e67452df241a602d=function(e,n){s(e).unobserve(s(n))},t.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){s(e).webkitExitFullscreen()},t.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){s(e).exitFullscreen()},t.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return C(function(e,n,r,i){const o=s(n).getPropertyValue(F(r,i)),c=X(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=V;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return C(function(e,n,r,i){const o=s(n).removeProperty(F(r,i)),c=X(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=V;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const n=s(e).visibilityState;return{hidden:0,visible:1}[n]??2},t.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const n=s(e).body;return j(n)?0:g(n)},t.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return C(function(e,n){const r=s(e).appendChild(s(n));return g(r)},arguments)},t.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return C(function(e,n){const r=s(e).getComputedStyle(s(n));return j(r)?0:g(r)},arguments)},t.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const n=s(e).activeElement;return j(n)?0:g(n)},t.wbg.__wbg_new_42acb42ec2ace97c=function(){return C(function(e){const n=new ResizeObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,n){s(e).box=["border-box","content-box","device-pixel-content-box"][n]},t.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,n,r){s(e).observe(s(n),s(r))},t.wbg.__wbg_new_d0c6c2df51a6d903=function(){return C(function(e){const n=new IntersectionObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_observe_c901133fbef21560=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const n=s(e).getBoundingClientRect();return g(n)},t.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return s(e).x},t.wbg.__wbg_y_bd4e2c0613413655=function(e){return s(e).y},t.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return C(function(e,n){return s(e).requestAnimationFrame(s(n))},arguments)},t.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;return g(n)},t.wbg.__wbg_button_460cdec9f2512a91=function(e){return s(e).button},t.wbg.__wbg_offsetX_294898d040917c6b=function(e){return s(e).offsetX},t.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return s(e).offsetY},t.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return s(e).deltaX},t.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return s(e).deltaY},t.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return s(e).deltaMode},t.wbg.__wbg_code_01dc6af887ca9ecb=function(e,n){const r=s(n).code,i=X(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=V;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return s(e).location},t.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return s(e).metaKey},t.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return s(e).altKey},t.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return s(e).metaKey},t.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const n=s(e).getCoalescedEvents();return g(n)},t.wbg.__wbindgen_closure_wrapper3679=function(e,n,r){const i=en(e,n,1370,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3681=function(e,n,r){const i=en(e,n,1370,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3682=function(e,n,r){const i=en(e,n,1370,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3683=function(e,n,r){const i=en(e,n,1370,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3684=function(e,n,r){const i=en(e,n,1370,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper5998=function(e,n,r){const i=Ee(e,n,1596,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper11542=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12709=function(e,n,r){const i=Ee(e,n,1596,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12743=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12748=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12754=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12765=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12777=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12833=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12840=function(e,n,r){const i=Ee(e,n,1596,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12849=function(e,n,r){const i=Ee(e,n,1596,Ro);return g(i)},t}function Uc(t,e){return p=t.exports,Po.__wbindgen_wasm_module=e,mt=null,nn=null,Zt=null,p}async function Po(t){if(p!==void 0)return p;typeof t<"u"&&Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof t>"u"&&(t=new URL(""+new URL("slint_lsp_wasm_bg-Bl5KSn92.wasm",self.location.href).href,self.location.href));const e=Vc();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bc(await t,e);return Uc(n,r)}var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var ko={},Xr={},Ue={},ie={},wt={},Qr={},jn={},q={},le={};Object.defineProperty(le,"__esModule",{value:!0}),le.stringArray=le.array=le.func=le.error=le.number=le.string=le.boolean=void 0;function Xc(t){return t===!0||t===!1}le.boolean=Xc;function So(t){return typeof t=="string"||t instanceof String}le.string=So;function Qc(t){return typeof t=="number"||t instanceof Number}le.number=Qc;function Kc(t){return t instanceof Error}le.error=Kc;function Yc(t){return typeof t=="function"}le.func=Yc;function Co(t){return Array.isArray(t)}le.array=Co;function Gc(t){return Co(t)&&t.every(e=>So(e))}le.stringArray=Gc,Object.defineProperty(q,"__esModule",{value:!0}),q.Message=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType=q.RequestType0=q.AbstractMessageSignature=q.ParameterStructures=q.ResponseError=q.ErrorCodes=void 0;const pt=le;var Kr;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Kr||(q.ErrorCodes=Kr={}));class Yr extends Error{constructor(e,n,r){super(n),this.code=pt.number(e)?e:Kr.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Yr.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}q.ResponseError=Yr;class pe{constructor(e){this.kind=e}static is(e){return e===pe.auto||e===pe.byName||e===pe.byPosition}toString(){return this.kind}}q.ParameterStructures=pe,pe.auto=new pe("auto"),pe.byPosition=new pe("byPosition"),pe.byName=new pe("byName");class K{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return pe.auto}}q.AbstractMessageSignature=K;class Zc extends K{constructor(e){super(e,0)}}q.RequestType0=Zc;class ea extends K{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType=ea;class ta extends K{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType1=ta;class na extends K{constructor(e){super(e,2)}}q.RequestType2=na;class ra extends K{constructor(e){super(e,3)}}q.RequestType3=ra;class ia extends K{constructor(e){super(e,4)}}q.RequestType4=ia;class oa extends K{constructor(e){super(e,5)}}q.RequestType5=oa;class sa extends K{constructor(e){super(e,6)}}q.RequestType6=sa;class ca extends K{constructor(e){super(e,7)}}q.RequestType7=ca;class aa extends K{constructor(e){super(e,8)}}q.RequestType8=aa;class ua extends K{constructor(e){super(e,9)}}q.RequestType9=ua;class da extends K{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType=da;class la extends K{constructor(e){super(e,0)}}q.NotificationType0=la;class fa extends K{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType1=fa;class ga extends K{constructor(e){super(e,2)}}q.NotificationType2=ga;class _a extends K{constructor(e){super(e,3)}}q.NotificationType3=_a;class ba extends K{constructor(e){super(e,4)}}q.NotificationType4=ba;class ha extends K{constructor(e){super(e,5)}}q.NotificationType5=ha;class ma extends K{constructor(e){super(e,6)}}q.NotificationType6=ma;class wa extends K{constructor(e){super(e,7)}}q.NotificationType7=wa;class pa extends K{constructor(e){super(e,8)}}q.NotificationType8=pa;class ya extends K{constructor(e){super(e,9)}}q.NotificationType9=ya;var qo;(function(t){function e(i){const o=i;return o&&pt.string(o.method)&&(pt.string(o.id)||pt.number(o.id))}t.isRequest=e;function n(i){const o=i;return o&&pt.string(o.method)&&i.id===void 0}t.isNotification=n;function r(i){const o=i;return o&&(o.result!==void 0||!!o.error)&&(pt.string(o.id)||pt.number(o.id)||o.id===null)}t.isResponse=r})(qo||(q.Message=qo={}));var Je={},Mo;Object.defineProperty(Je,"__esModule",{value:!0}),Je.LRUCache=Je.LinkedMap=Je.Touch=void 0;var ye;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(ye||(Je.Touch=ye={}));class Oo{constructor(){this[Mo]="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(e){return this._map.has(e)}get(e,n=ye.None){const r=this._map.get(e);if(r)return n!==ye.None&&this.touch(r,n),r.value}set(e,n,r=ye.None){let i=this._map.get(e);if(i)i.value=n,r!==ye.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case ye.None:this.addItemLast(i);break;case ye.First:this.addItemFirst(i);break;case ye.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Mo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ye.First&&n!==ye.Last)){if(n===ye.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===ye.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}Je.LinkedMap=Oo;class va extends Oo{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=ye.AsNew){return super.get(e,n)}peek(e){return super.get(e,ye.None)}set(e,n){return super.set(e,n,ye.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Je.LRUCache=va;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.Disposable=void 0;var Eo;(function(t){function e(n){return{dispose:n}}t.create=e})(Eo||(Fn.Disposable=Eo={}));var Ae={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});let Gr;function Zr(){if(Gr===void 0)throw new Error("No runtime abstraction layer installed");return Gr}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Gr=n}t.install=e})(Zr||(Zr={})),Xe.default=Zr,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.Emitter=Ae.Event=void 0;const Ra=Xe;var No;(function(t){const e={dispose(){}};t.None=function(){return e}})(No||(Ae.Event=No={}));class Da{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i{this._callbacks||(this._callbacks=new Da),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=In._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Ae.Emitter=In,In._noop=function(){};var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.CancellationTokenSource=et.CancellationToken=void 0;const Ta=Xe,Pa=le,ei=Ae;var An;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ei.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ei.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||Pa.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(An||(et.CancellationToken=An={}));const ka=Object.freeze(function(t,e){const n=(0,Ta.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class jo{constructor(){this._isCancelled=!1}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?ka:(this._emitter||(this._emitter=new ei.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Sa{get token(){return this._token||(this._token=new jo),this._token}cancel(){this._token?this._token.cancel():this._token=An.Cancelled}dispose(){this._token?this._token instanceof jo&&this._token.dispose():this._token=An.None}}et.CancellationTokenSource=Sa;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.SharedArrayReceiverStrategy=qt.SharedArraySenderStrategy=void 0;const Ca=et;var rn;(function(t){t.Continue=0,t.Cancelled=1})(rn||(rn={}));class qa{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=rn.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,rn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}qt.SharedArraySenderStrategy=qa;class Ma{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===rn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oa{constructor(e){this.token=new Ma(e)}cancel(){}dispose(){}}class Ea{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new Ca.CancellationTokenSource:new Oa(n)}}qt.SharedArrayReceiverStrategy=Ea;var tt={},on={};Object.defineProperty(on,"__esModule",{value:!0}),on.Semaphore=void 0;const Na=Xe;class ja{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Na.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}on.Semaphore=ja,Object.defineProperty(tt,"__esModule",{value:!0}),tt.ReadableStreamMessageReader=tt.AbstractMessageReader=tt.MessageReader=void 0;const ti=Xe,Mt=le,ni=Ae,Fa=on;var Fo;(function(t){function e(n){let r=n;return r&&Mt.func(r.listen)&&Mt.func(r.dispose)&&Mt.func(r.onError)&&Mt.func(r.onClose)&&Mt.func(r.onPartialMessage)}t.is=e})(Fo||(tt.MessageReader=Fo={}));class Io{constructor(){this.errorEmitter=new ni.Emitter,this.closeEmitter=new ni.Emitter,this.partialMessageEmitter=new ni.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Mt.string(e.message)?e.message:"unknown"}`)}}tt.AbstractMessageReader=Io;var ri;(function(t){function e(n){let r,i;const o=new Map;let c;const d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(const f of n.contentDecoders)o.set(f.name,f);if(n.contentTypeDecoder!==void 0&&(c=n.contentTypeDecoder,d.set(c.name,c)),n.contentTypeDecoders!==void 0)for(const f of n.contentTypeDecoders)d.set(f.name,f)}return c===void 0&&(c=(0,ti.default)().applicationJson.decoder,d.set(c.name,c)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:c,contentTypeDecoders:d}}t.fromOptions=e})(ri||(ri={}));class Ia extends Io{constructor(e,n){super(),this.readable=e,this.options=ri.fromOptions(n),this.buffer=(0,ti.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Fa.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property. +(function(){"use strict";let p;const Ve=new Array(128).fill(void 0);Ve.push(void 0,null,!0,!1);function s(t){return Ve[t]}let Gt=Ve.length;function $c(t){t<132||(Ve[t]=Gt,Gt=t)}function fe(t){const e=s(t);return $c(t),e}let B=0,Zt=null;function Mn(){return(Zt===null||Zt.byteLength===0)&&(Zt=new Uint8Array(p.memory.buffer)),Zt}const On=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hc=typeof On.encodeInto=="function"?function(t,e){return On.encodeInto(t,e)}:function(t,e){const n=On.encode(t);return e.set(n),{read:t.length,written:n.length}};function J(t,e,n){if(n===void 0){const d=On.encode(t),f=e(d.length,1)>>>0;return Mn().subarray(f,f+d.length).set(d),B=d.length,f}let r=t.length,i=e(r,1)>>>0;const o=Mn();let c=0;for(;c127)break;o[i+c]=d}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;const d=Mn().subarray(i+c,i+r),f=Hc(t,d);c+=f.written,i=n(i,r,c,1)>>>0}return B=c,i}function j(t){return t==null}let mt=null;function k(){return(mt===null||mt.buffer.detached===!0||mt.buffer.detached===void 0&&mt.buffer!==p.memory.buffer)&&(mt=new DataView(p.memory.buffer)),mt}function g(t){Gt===Ve.length&&Ve.push(Ve.length+1);const e=Gt;return Gt=Ve[e],Ve[e]=t,e}const yo=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&yo.decode();function F(t,e){return t=t>>>0,yo.decode(Mn().subarray(t,t+e))}function Vr(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){const i=t.length;let o="[";i>0&&(o+=Vr(t[0]));for(let c=1;c1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} +${t.stack}`:r}const En=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>{p.__wbindgen_export_2.get(t.dtor)(t.a,t.b)});function en(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;try{return r(i.a,i.b,...c)}finally{--i.cnt===0&&(p.__wbindgen_export_2.get(i.dtor)(i.a,i.b),i.a=0,En.unregister(i))}};return o.original=i,En.register(o,i,i),o}function tn(t,e,n){p._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ed87396e433cd37(t,e,g(n))}function Ee(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...c)=>{i.cnt++;const d=i.a;i.a=0;try{return r(d,i.b,...c)}finally{--i.cnt===0?(p.__wbindgen_export_2.get(i.dtor)(d,i.b),En.unregister(i)):i.a=d}};return o.original=i,En.register(o,i,i),o}function vo(t,e){p._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0fc81412f5e8f282(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h00347670c924a916(t,e,g(n))}function Ro(t,e,n,r){p._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he42a58d92d86f1d0(t,e,g(n),g(r))}function S(t,e){try{return t.apply(this,e)}catch(n){p.__wbindgen_exn_store(g(n))}}function xc(t,e,n,r){try{const d=p.__wbindgen_add_to_stack_pointer(-16);p.create(d,g(t),g(e),g(n),g(r));var i=k().getInt32(d+4*0,!0),o=k().getInt32(d+4*1,!0),c=k().getInt32(d+4*2,!0);if(c)throw fe(o);return Jr.__wrap(i)}finally{p.__wbindgen_add_to_stack_pointer(16)}}let nn=null;function zc(){return(nn===null||nn.byteLength===0)&&(nn=new Float32Array(p.memory.buffer)),nn}function Nn(t,e){return t=t>>>0,zc().subarray(t/4,t/4+e)}const Do=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_previewconnector_free(t>>>0,1));class Ur{static __wrap(e){e=e>>>0;const n=Object.create(Ur.prototype);return n.__wbg_ptr=e,Do.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Do.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_previewconnector_free(e,0)}static create(e,n,r,i){try{const f=p.__wbindgen_add_to_stack_pointer(-16),_=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),w=B;p.previewconnector_create(f,g(e),g(n),_,w,i);var o=k().getInt32(f+4*0,!0),c=k().getInt32(f+4*1,!0),d=k().getInt32(f+4*2,!0);if(d)throw fe(c);return fe(o)}finally{p.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=p.previewconnector_current_style(this.__wbg_ptr);return fe(e)}show_ui(){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_show_ui(i,this.__wbg_ptr);var e=k().getInt32(i+4*0,!0),n=k().getInt32(i+4*1,!0),r=k().getInt32(i+4*2,!0);if(r)throw fe(n);return fe(e)}finally{p.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const i=p.__wbindgen_add_to_stack_pointer(-16);p.previewconnector_process_lsp_to_preview_message(i,this.__wbg_ptr,g(e));var n=k().getInt32(i+4*0,!0),r=k().getInt32(i+4*1,!0);if(r)throw fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}}const To=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>p.__wbg_slintserver_free(t>>>0,1));class Jr{static __wrap(e){e=e>>>0;const n=Object.create(Jr.prototype);return n.__wbg_ptr=e,To.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,To.unregister(this),e}free(){const e=this.__destroy_into_raw();p.__wbg_slintserver_free(e,0)}process_preview_to_lsp_message(e){const n=p.slintserver_process_preview_to_lsp_message(this.__wbg_ptr,g(e));return fe(n)}server_initialize_result(e){try{const o=p.__wbindgen_add_to_stack_pointer(-16);p.slintserver_server_initialize_result(o,this.__wbg_ptr,g(e));var n=k().getInt32(o+4*0,!0),r=k().getInt32(o+4*1,!0),i=k().getInt32(o+4*2,!0);if(i)throw fe(r);return fe(n)}finally{p.__wbindgen_add_to_stack_pointer(16)}}reload_document(e,n,r){const i=J(e,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_reload_document(this.__wbg_ptr,i,o,g(n),r);return fe(c)}handle_request(e,n,r){const i=J(n,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B,c=p.slintserver_handle_request(this.__wbg_ptr,g(e),i,o,g(r));return fe(c)}reload_config(){const e=p.slintserver_reload_config(this.__wbg_ptr);return fe(e)}}async function Bc(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function Vc(){const t={};return t.wbg={},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return g(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=s(n).stack,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(F(e,n))}finally{p.__wbindgen_free(r,i,1)}},t.wbg.__wbindgen_object_drop_ref=function(e){fe(e)},t.wbg.__wbg_width_ac5901de11cd9abc=function(e){return s(e).width},t.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return s(e).height},t.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const n=s(e).createTexture();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const n=s(e).createProgram();return j(n)?0:g(n)},t.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,n,r){s(e).attachShader(s(n),s(r))},t.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,n,r,i,o){s(e).bindAttribLocation(s(n),r>>>0,F(i,o))},t.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,n){s(e).linkProgram(s(n))},t.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,n,r){const i=s(e).getProgramParameter(s(n),r>>>0);return g(i)},t.wbg.__wbindgen_boolean_get=function(e){const n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,n,r){s(e).detachShader(s(n),s(r))},t.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:J(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,n,r){const i=s(n).getProgramInfoLog(s(r));var o=j(i)?0:J(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_createShader_af087106532661d9=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,n){const r=s(e).createShader(n>>>0);return j(r)?0:g(r)},t.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,n,r,i){s(e).shaderSource(s(n),F(r,i))},t.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,n){s(e).compileShader(s(n))},t.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,n,r){const i=s(e).getShaderParameter(s(n),r>>>0);return g(i)},t.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:J(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,n,r){const i=s(n).getShaderInfoLog(s(r));var o=j(i)?0:J(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,n,r,i){s(e).uniform2fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,n){s(e).deleteFramebuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,n){s(e).deleteRenderbuffer(s(n))},t.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return g(e)},t.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,n){s(e).stencil=n!==0},t.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,n){s(e).antialias=n!==0},t.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return S(function(e,n,r,i){const o=s(e).getContext(F(n,r),s(i));return j(o)?0:g(o)},arguments)},t.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let n;try{n=s(e)instanceof WebGL2RenderingContext}catch{n=!1}return n},t.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const n=s(e).getSupportedExtensions();return j(n)?0:g(n)},t.wbg.__wbg_length_ae22078168b726f5=function(e){return s(e).length},t.wbg.__wbg_get_3baa728f9d58d3f6=function(e,n){const r=s(e)[n>>>0];return g(r)},t.wbg.__wbindgen_string_get=function(e,n){const r=s(n),i=typeof r=="string"?r:void 0;var o=j(i)?0:J(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;k().setInt32(e+4*1,c,!0),k().setInt32(e+4*0,o,!0)},t.wbg.__wbg_getParameter_cfaed180705b9280=function(){return S(function(e,n){const r=s(e).getParameter(n>>>0);return g(r)},arguments)},t.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const n=s(e).createVertexArrayOES();return j(n)?0:g(n)},t.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const n=s(e).createVertexArray();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const n=s(e).createBuffer();return j(n)?0:g(n)},t.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return s(e).getError()},t.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return s(e).getError()},t.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const n=s(e).createFramebuffer();return j(n)?0:g(n)},t.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,n,r,i,o,c){s(e).framebufferTexture2D(n>>>0,r>>>0,i>>>0,s(o),c)},t.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const n=s(e).createRenderbuffer();return j(n)?0:g(n)},t.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,n,r,i,o){s(e).renderbufferStorage(n>>>0,r>>>0,i,o)},t.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,n,r,i,o){s(e).framebufferRenderbuffer(n>>>0,r>>>0,i>>>0,s(o))},t.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,n){return s(e).checkFramebufferStatus(n>>>0)},t.wbg.__wbg_scissor_d06b14c4966727fa=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,n,r,i,o){s(e).scissor(n,r,i,o)},t.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,n,r,i,o){s(e).clearColor(n,r,i,o)},t.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,n){s(e).clear(n>>>0)},t.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,n,r,i){s(e).uniform4fv(s(n),Nn(r,i))},t.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,n){s(e).deleteTexture(s(n))},t.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,n){s(e).deleteShader(s(n))},t.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,n){s(e).deleteProgram(s(n))},t.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,n){s(e).useProgram(s(n))},t.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,n,r){s(e).bindBuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,n,r){s(e).bindFramebuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,n,r){s(e).bindRenderbuffer(n>>>0,s(r))},t.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,n){s(e).bindVertexArray(s(n))},t.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,n){s(e).bindVertexArrayOES(s(n))},t.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,n,r){s(e).pixelStorei(n>>>0,r)},t.wbg.__wbg_disable_d73e59fee5b5e973=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disable_8908871f2334e76b=function(e,n){s(e).disable(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,n){s(e).disableVertexAttribArray(n>>>0)},t.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,n,r,i){s(e).drawArrays(n>>>0,r,i)},t.wbg.__wbg_enable_68b3fa03a633259a=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enable_541ed84c1e7d269d=function(e,n){s(e).enable(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,n){s(e).enableVertexAttribArray(n>>>0)},t.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,n,r,i){const o=s(e).getUniformLocation(s(n),F(r,i));return j(o)?0:g(o)},t.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,n){s(e).generateMipmap(n>>>0)},t.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,n,r){s(e).uniform1i(s(n),r)},t.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,n,r,i,o){s(e).colorMask(n!==0,r!==0,i!==0,o!==0)},t.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,n,r){s(e).bindTexture(n>>>0,s(r))},t.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,n){s(e).activeTexture(n>>>0)},t.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texParameteri_531d0268109950ba=function(e,n,r,i){s(e).texParameteri(n>>>0,r>>>0,i)},t.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,s(w))},arguments)},t.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return S(function(e,n,r,i,o,c,d,f,_,w){s(e).texSubImage2D(n>>>0,r,i,o,c,d,f>>>0,_>>>0,w)},arguments)},t.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,n,r,i,o,c,d){s(e).vertexAttribPointer(n>>>0,r,i>>>0,o!==0,c,d)},t.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_viewport_536c78dd69c44351=function(e,n,r,i,o){s(e).viewport(n,r,i,o)},t.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,n,r,i){s(e).stencilFunc(n>>>0,r,i>>>0)},t.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilMask_702162181d88081f=function(e,n){s(e).stencilMask(n>>>0)},t.wbg.__wbg_stencilOp_2418383669ca9228=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,n,r,i){s(e).stencilOp(n>>>0,r>>>0,i>>>0)},t.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,n,r,i,o){s(e).stencilOpSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return s(e).devicePixelRatio},t.wbg.__wbg_document_8554450897a855b9=function(e){const n=s(e).document;return j(n)?0:g(n)},t.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,n,r){const i=s(e).getElementById(F(n,r));return j(i)?0:g(i)},t.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let n;try{n=s(e)instanceof HTMLCanvasElement}catch{n=!1}return n},t.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return s(e).clientWidth},t.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return s(e).clientHeight},t.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const n=s(e).dataset;return g(n)},t.wbg.__wbg_get_9a60fce5bf7da364=function(e,n,r,i){const o=s(n)[F(r,i)];var c=j(o)?0:J(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},t.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let n;try{n=s(e)instanceof HTMLInputElement}catch{n=!1}return n},t.wbg.__wbg_style_e06c9e03355741e9=function(e){const n=s(e).style;return g(n)},t.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return s(e).offsetLeft},t.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return s(e).offsetTop},t.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return s(e).offsetWidth},t.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return s(e).offsetHeight},t.wbg.__wbg_before_ac3792b457802cbf=function(){return S(function(e,n){s(e).before(s(n))},arguments)},t.wbg.__wbindgen_object_clone_ref=function(e){const n=s(e);return g(n)},t.wbg.__wbg_setvalue_688819688274bec0=function(e,n,r){s(e).value=F(n,r)},t.wbg.__wbg_data_edba00a6420faae3=function(e,n){const r=s(n).data;var i=j(r)?0:J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return s(e).isComposing},t.wbg.__wbg_inputType_dc144c8251b0d194=function(e,n){const r=s(n).inputType,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){s(e).preventDefault()},t.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return s(e).isComposing},t.wbg.__wbg_key_a626396efbca2b95=function(e,n){const r=s(n).key,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return s(e).altKey},t.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,n,r){return s(e).getModifierState(F(n,r))},t.wbg.__wbg_repeat_8451a79b3608855b=function(e){return s(e).repeat},t.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const n=s(e).clipboardData;return j(n)?0:g(n)},t.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return S(function(e,n,r,i){const o=s(n).getData(F(r,i)),c=J(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let n;try{n=s(e)instanceof CanvasRenderingContext2D}catch{n=!1}return n},t.wbg.__wbg_setfont_931e1f36bec6a342=function(e,n,r){s(e).font=F(n,r)},t.wbg.__wbindgen_string_new=function(e,n){const r=F(e,n);return g(r)},t.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,n){s(e).fillStyle=s(n)},t.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return s(e).naturalWidth},t.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return s(e).naturalHeight},t.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,n){const r=s(n).currentSrc,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_src_707c2de7cbb580c7=function(e,n){const r=s(n).src,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_0d5e77f348d88b87=function(){return S(function(){const e=new Image;return g(e)},arguments)},t.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,n,r){s(e).crossOrigin=n===0?void 0:F(n,r)},t.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,n){s(e).onload=s(n)},t.wbg.__wbg_setsrc_129ba95151116b01=function(e,n,r){s(e).src=F(n,r)},t.wbg.__wbg_new0_65387337a95cf44d=function(){return g(new Date)},t.wbg.__wbg_getTime_91058879093a1589=function(e){return s(e).getTime()},t.wbg.__wbindgen_number_new=function(e){return g(e)},t.wbg.__wbg_new_7982fb43cfca37ae=function(e){const n=new Date(s(e));return g(n)},t.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return s(e).getTimezoneOffset()},t.wbg.__wbg_log_5766f8130e3dc687=function(e,n){console.log(F(e,n))},t.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,n){s(e).cullFace(n>>>0)},t.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,n){s(e).frontFace(n>>>0)},t.wbg.__wbg_bufferData_0db2a74470353a96=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_bufferData_94ce174a81b32961=function(e,n,r,i){s(e).bufferData(n>>>0,s(r),i>>>0)},t.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,n,r,i,o){s(e).blendFuncSeparate(n>>>0,r>>>0,i>>>0,o>>>0)},t.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,n){s(e).deleteVertexArray(s(n))},t.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,n){s(e).deleteVertexArrayOES(s(n))},t.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,n){s(e).deleteBuffer(s(n))},t.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return S(function(e,n,r,i,o,c,d,f){s(e).readPixels(n,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_setwidth_84b579903fae1a52=function(e,n){s(e).width=n>>>0},t.wbg.__wbg_setheight_6ae385769cc2e592=function(e,n){s(e).height=n>>>0},t.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return S(function(e,n,r,i,o,c,d,f){s(e).texSubImage2D(n>>>0,r,i,o,c>>>0,d>>>0,s(f))},arguments)},t.wbg.__wbg_next_f9cb570345655b9a=function(){return S(function(e){const n=s(e).next();return g(n)},arguments)},t.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return s(e).done},t.wbg.__wbg_value_6d39332ab4788d86=function(e){const n=s(e).value;return g(n)},t.wbg.__wbg_iterator_888179a48810a9fe=function(){return g(Symbol.iterator)},t.wbg.__wbg_get_224d16597dbbfd96=function(){return S(function(e,n){const r=Reflect.get(s(e),s(n));return g(r)},arguments)},t.wbg.__wbindgen_is_function=function(e){return typeof s(e)=="function"},t.wbg.__wbindgen_is_object=function(e){const n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_next_de3e9db4440638b2=function(e){const n=s(e).next;return g(n)},t.wbg.__wbg_call_1084a111329e68ce=function(){return S(function(e,n){const r=s(e).call(s(n));return g(r)},arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return S(function(e,n,r){const i=s(e).call(s(n),s(r));return g(i)},arguments)},t.wbg.__wbg_call_c6fe275aaa60da79=function(){return S(function(e,n,r,i){const o=s(e).call(s(n),s(r),s(i));return g(o)},arguments)},t.wbg.__wbindgen_memory=function(){const e=p.memory;return g(e)},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const n=s(e).buffer;return g(n)},t.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,n,r){const i=new Uint8Array(s(e),n>>>0,r>>>0);return g(i)},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return s(e).length},t.wbg.__wbg_new_ea1883e1e5e86686=function(e){const n=new Uint8Array(s(e));return g(n)},t.wbg.__wbg_set_d1e79e2388520f18=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbg_set_eacc7d73fefaafdf=function(){return S(function(e,n,r){return Reflect.set(s(e),s(n),s(r))},arguments)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return S(function(){const e=self.self;return g(e)},arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return S(function(){const e=window.window;return g(e)},arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return S(function(){const e=globalThis.globalThis;return g(e)},arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return S(function(){const e=global.global;return g(e)},arguments)},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,n){const r=new Function(F(e,n));return g(r)},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(F(e,n));return g(r)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_number_get=function(e,n){const r=s(n),i=typeof r=="number"?r:void 0;k().setFloat64(e+8*1,j(i)?0:i,!0),k().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const n=Object.entries(s(e));return g(n)},t.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(s(e))},t.wbg.__wbindgen_as_number=function(e){return+s(e)},t.wbg.__wbg_String_b9412f8799faab3e=function(e,n){const r=String(s(n)),i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},t.wbg.__wbindgen_is_bigint=function(e){return typeof s(e)=="bigint"},t.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const r=s(n),i=typeof r=="bigint"?r:void 0;k().setBigInt64(e+8*1,j(i)?BigInt(0):i,!0),k().setInt32(e+4*0,!j(i),!0)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},t.wbg.__wbindgen_jsval_eq=function(e,n){return s(e)===s(n)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let n;try{n=s(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,n){const r=s(e)[s(n)];return g(r)},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbg_set_49185437f0ab06f8=function(e,n,r){const i=s(e).set(s(n),s(r));return g(i)},t.wbg.__wbg_set_f975102236d3c502=function(e,n,r){s(e)[fe(n)]=fe(r)},t.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return g(e)},t.wbg.__wbg_set_673dda6c73d19609=function(e,n,r){s(e)[n>>>0]=fe(r)},t.wbg.__wbg_new_8608a2b51a5f6737=function(){return g(new Map)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,n){try{var r={a:e,b:n},i=(c,d)=>{const f=r.a;r.a=0;try{return Ro(f,r.b,c,d)}finally{r.a=f}};const o=new Promise(i);return g(o)}finally{r.a=r.b=0}},t.wbg.__wbg_navigator_6210380287bf8581=function(e){const n=s(e).navigator;return g(n)},t.wbg.__wbg_platform_509d898d9dce4c23=function(){return S(function(e,n){const r=s(n).platform,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(n)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(F(e,n))},t.wbg.__wbindgen_debug_string=function(e,n){const r=Vr(s(n)),i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const n=s(e).queueMicrotask;return g(n)},t.wbg.__wbg_resolve_570458cb99d56a43=function(e){const n=Promise.resolve(s(e));return g(n)},t.wbg.__wbg_then_876bb3c633745cc6=function(e,n,r){const i=s(e).then(s(n),s(r));return g(i)},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_then_95e6edc0f89b73b1=function(e,n){const r=s(e).then(s(n));return g(r)},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(s(e))},t.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return S(function(e,n,r){const i=s(e).getExtension(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return S(function(e,n,r){const i=s(e).matchMedia(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return S(function(e,n){s(e).cancelAnimationFrame(n)},arguments)},t.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return S(function(e,n){return s(e).setTimeout(s(n))},arguments)},t.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return S(function(e,n,r){const i=s(e).createElement(F(n,r));return g(i)},arguments)},t.wbg.__wbg_matches_212d57a200ff58f8=function(){return S(function(e,n,r){return s(e).matches(F(n,r))},arguments)},t.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return S(function(e,n,r,i,o){s(e).setAttribute(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_focus_06621101cc79f5d8=function(){return S(function(e){s(e).focus()},arguments)},t.wbg.__wbg_fillText_ae0445d1930428dd=function(){return S(function(e,n,r,i,o){s(e).fillText(F(n,r),i,o)},arguments)},t.wbg.__wbg_getContext_69ec873410cbba3c=function(){return S(function(e,n,r){const i=s(e).getContext(F(n,r));return j(i)?0:g(i)},arguments)},t.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return S(function(e,n){s(e).addListener(s(n))},arguments)},t.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return S(function(e,n,r,i,o){s(e).setProperty(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return S(function(e,n){URL.revokeObjectURL(F(e,n))},arguments)},t.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let n;try{n=s(e)instanceof Window}catch{n=!1}return n},t.wbg.__wbg_setData_41207994e2d54785=function(){return S(function(e,n,r,i,o){s(e).setData(F(n,r),F(i,o))},arguments)},t.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return S(function(e,n,r,i){s(e).addEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return S(function(e,n,r,i){s(e).removeEventListener(F(n,r),s(i))},arguments)},t.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return S(function(e,n){s(e).postMessage(s(n))},arguments)},t.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,n){const r=s(n).data;var i=j(r)?0:J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_new_ebf2727385ee825c=function(){return S(function(){const e=new AbortController;return g(e)},arguments)},t.wbg.__wbg_new_40ff2b042829bc58=function(){return S(function(){const e=new MessageChannel;return g(e)},arguments)},t.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const n=s(e).performance;return g(n)},t.wbg.__wbg_now_abd80e969af37148=function(e){return s(e).now()},t.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return s(e).movementX},t.wbg.__wbg_movementY_3064817f736e8151=function(e){return s(e).movementY},t.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const n=s(e).signal;return g(n)},t.wbg.__wbg_postTask_99464245f349be5a=function(e,n,r){const i=s(e).postTask(s(n),s(r));return g(i)},t.wbg.__wbg_catch_a279b1da46d132d8=function(e,n){const r=s(e).catch(s(n));return g(r)},t.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const n=s(e).port1;return g(n)},t.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,n){s(e).onmessage=s(n)},t.wbg.__wbg_start_f642a950f6c98a0e=function(e){s(e).start()},t.wbg.__wbg_port2_7d887905fa4a6677=function(e){const n=s(e).port2;return g(n)},t.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return S(function(e,n){return s(e).requestIdleCallback(s(n))},arguments)},t.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return S(function(e,n,r){return s(e).setTimeout(s(n),r)},arguments)},t.wbg.__wbg_of_99c2a118200b1e62=function(e,n){const r=Array.of(s(e),s(n));return g(r)},t.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const n=Array.of(s(e));return g(n)},t.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return S(function(e,n,r){s(e).postMessage(s(n),s(r))},arguments)},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,n){const r=s(n).pointerType,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return s(e).pointerId},t.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return S(function(e,n){s(e).setPointerCapture(n)},arguments)},t.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return s(e).pressure},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return s(e).persisted},t.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const n=s(e).contentRect;return g(n)},t.wbg.__wbg_width_e7964a50b174d035=function(e){return s(e).width},t.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return s(e).height},t.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const n=s(e).devicePixelContentBoxSize;return g(n)},t.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return s(e).inlineSize},t.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return s(e).blockSize},t.wbg.__wbg_new_25d9d4e2932d816f=function(){return S(function(e,n){const r=new Worker(F(e,n));return g(r)},arguments)},t.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,n,r){s(e).type=F(n,r)},t.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return S(function(e,n){const r=new Blob(s(e),s(n));return g(r)},arguments)},t.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return S(function(e,n){const r=URL.createObjectURL(s(n)),i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return g(e)},t.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,n){const r=Object.getOwnPropertyDescriptor(s(e),s(n));return g(r)},t.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const n=s(e).Window;return g(n)},t.wbg.__wbg_error_9ce09486992d3ac5=function(e,n){console.error(s(e),s(n))},t.wbg.__wbg_abort_8659d889a7877ae3=function(e){s(e).abort()},t.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,n){s(e).cancelIdleCallback(n>>>0)},t.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,n){s(e).clearTimeout(n)},t.wbg.__wbg_close_87d69f9e9fe928c3=function(e){s(e).close()},t.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const n=s(e).userAgentData;return j(n)?0:g(n)},t.wbg.__wbg_brands_982de08b35281a98=function(e){const n=s(e).brands;return g(n)},t.wbg.__wbg_brand_cdcf0249d44027a8=function(e,n){const r=s(n).brand,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return S(function(e,n){const r=s(n).userAgent,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},arguments)},t.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},t.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){s(e).disconnect()},t.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){s(e).disconnect()},t.wbg.__wbg_cancel_cba86749f45f30ae=function(e){s(e).cancel()},t.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){s(e).webkitRequestFullscreen()},t.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const n=s(e).requestFullscreen();return g(n)},t.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const n=s(e).webkitFullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const n=s(e).fullscreenElement;return j(n)?0:g(n)},t.wbg.__wbg_is_009b1ef508712fda=function(e,n){return Object.is(s(e),s(n))},t.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,n,r){const i=s(e).animate(s(n),s(r));return g(i)},t.wbg.__wbg_play_5896e5851ba90aa2=function(e){s(e).play()},t.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return S(function(e,n){s(e).removeListener(s(n))},arguments)},t.wbg.__wbg_contains_4f87c5405416b4fd=function(e,n){return s(e).contains(s(n))},t.wbg.__wbg_unobserve_e67452df241a602d=function(e,n){s(e).unobserve(s(n))},t.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){s(e).webkitExitFullscreen()},t.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){s(e).exitFullscreen()},t.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return S(function(e,n,r,i){const o=s(n).getPropertyValue(F(r,i)),c=J(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return S(function(e,n,r,i){const o=s(n).removeProperty(F(r,i)),c=J(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;k().setInt32(e+4*1,d,!0),k().setInt32(e+4*0,c,!0)},arguments)},t.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const n=s(e).visibilityState;return{hidden:0,visible:1}[n]??2},t.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const n=s(e).body;return j(n)?0:g(n)},t.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return S(function(e,n){const r=s(e).appendChild(s(n));return g(r)},arguments)},t.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return S(function(e,n){const r=s(e).getComputedStyle(s(n));return j(r)?0:g(r)},arguments)},t.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const n=s(e).activeElement;return j(n)?0:g(n)},t.wbg.__wbg_new_42acb42ec2ace97c=function(){return S(function(e){const n=new ResizeObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,n){s(e).box=["border-box","content-box","device-pixel-content-box"][n]},t.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,n,r){s(e).observe(s(n),s(r))},t.wbg.__wbg_new_d0c6c2df51a6d903=function(){return S(function(e){const n=new IntersectionObserver(s(e));return g(n)},arguments)},t.wbg.__wbg_observe_c901133fbef21560=function(e,n){s(e).observe(s(n))},t.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const n=s(e).getBoundingClientRect();return g(n)},t.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return s(e).x},t.wbg.__wbg_y_bd4e2c0613413655=function(e){return s(e).y},t.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return S(function(e,n){return s(e).requestAnimationFrame(s(n))},arguments)},t.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const n=s(e).scheduler;return g(n)},t.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;return g(n)},t.wbg.__wbg_button_460cdec9f2512a91=function(e){return s(e).button},t.wbg.__wbg_offsetX_294898d040917c6b=function(e){return s(e).offsetX},t.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return s(e).offsetY},t.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return s(e).deltaX},t.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return s(e).deltaY},t.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return s(e).deltaMode},t.wbg.__wbg_code_01dc6af887ca9ecb=function(e,n){const r=s(n).code,i=J(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;k().setInt32(e+4*1,o,!0),k().setInt32(e+4*0,i,!0)},t.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return s(e).location},t.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return s(e).metaKey},t.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return s(e).shiftKey},t.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return s(e).ctrlKey},t.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return s(e).altKey},t.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return s(e).metaKey},t.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const n=s(e).getCoalescedEvents();return g(n)},t.wbg.__wbindgen_closure_wrapper3682=function(e,n,r){const i=en(e,n,1371,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3684=function(e,n,r){const i=en(e,n,1371,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3685=function(e,n,r){const i=en(e,n,1371,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3686=function(e,n,r){const i=en(e,n,1371,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper3687=function(e,n,r){const i=en(e,n,1371,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6015=function(e,n,r){const i=Ee(e,n,1598,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper11558=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12725=function(e,n,r){const i=Ee(e,n,1598,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12759=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12764=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12770=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12781=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12793=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12849=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12856=function(e,n,r){const i=Ee(e,n,1598,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper12865=function(e,n,r){const i=Ee(e,n,1598,Ro);return g(i)},t}function Uc(t,e){return p=t.exports,Po.__wbindgen_wasm_module=e,mt=null,nn=null,Zt=null,p}async function Po(t){if(p!==void 0)return p;typeof t<"u"&&Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof t>"u"&&(t=new URL(""+new URL("slint_lsp_wasm_bg-DXvQhfqz.wasm",self.location.href).href,self.location.href));const e=Vc();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bc(await t,e);return Uc(n,r)}var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var ko={},Xr={},Ue={},ie={},wt={},Qr={},jn={},q={},le={};Object.defineProperty(le,"__esModule",{value:!0}),le.stringArray=le.array=le.func=le.error=le.number=le.string=le.boolean=void 0;function Xc(t){return t===!0||t===!1}le.boolean=Xc;function So(t){return typeof t=="string"||t instanceof String}le.string=So;function Qc(t){return typeof t=="number"||t instanceof Number}le.number=Qc;function Yc(t){return t instanceof Error}le.error=Yc;function Kc(t){return typeof t=="function"}le.func=Kc;function Co(t){return Array.isArray(t)}le.array=Co;function Gc(t){return Co(t)&&t.every(e=>So(e))}le.stringArray=Gc,Object.defineProperty(q,"__esModule",{value:!0}),q.Message=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType=q.RequestType0=q.AbstractMessageSignature=q.ParameterStructures=q.ResponseError=q.ErrorCodes=void 0;const pt=le;var Yr;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Yr||(q.ErrorCodes=Yr={}));class Kr extends Error{constructor(e,n,r){super(n),this.code=pt.number(e)?e:Yr.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Kr.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}q.ResponseError=Kr;class pe{constructor(e){this.kind=e}static is(e){return e===pe.auto||e===pe.byName||e===pe.byPosition}toString(){return this.kind}}q.ParameterStructures=pe,pe.auto=new pe("auto"),pe.byPosition=new pe("byPosition"),pe.byName=new pe("byName");class Y{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return pe.auto}}q.AbstractMessageSignature=Y;class Zc extends Y{constructor(e){super(e,0)}}q.RequestType0=Zc;class ea extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType=ea;class ta extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.RequestType1=ta;class na extends Y{constructor(e){super(e,2)}}q.RequestType2=na;class ra extends Y{constructor(e){super(e,3)}}q.RequestType3=ra;class ia extends Y{constructor(e){super(e,4)}}q.RequestType4=ia;class oa extends Y{constructor(e){super(e,5)}}q.RequestType5=oa;class sa extends Y{constructor(e){super(e,6)}}q.RequestType6=sa;class ca extends Y{constructor(e){super(e,7)}}q.RequestType7=ca;class aa extends Y{constructor(e){super(e,8)}}q.RequestType8=aa;class ua extends Y{constructor(e){super(e,9)}}q.RequestType9=ua;class da extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType=da;class la extends Y{constructor(e){super(e,0)}}q.NotificationType0=la;class fa extends Y{constructor(e,n=pe.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}q.NotificationType1=fa;class ga extends Y{constructor(e){super(e,2)}}q.NotificationType2=ga;class _a extends Y{constructor(e){super(e,3)}}q.NotificationType3=_a;class ba extends Y{constructor(e){super(e,4)}}q.NotificationType4=ba;class ha extends Y{constructor(e){super(e,5)}}q.NotificationType5=ha;class ma extends Y{constructor(e){super(e,6)}}q.NotificationType6=ma;class wa extends Y{constructor(e){super(e,7)}}q.NotificationType7=wa;class pa extends Y{constructor(e){super(e,8)}}q.NotificationType8=pa;class ya extends Y{constructor(e){super(e,9)}}q.NotificationType9=ya;var qo;(function(t){function e(i){const o=i;return o&&pt.string(o.method)&&(pt.string(o.id)||pt.number(o.id))}t.isRequest=e;function n(i){const o=i;return o&&pt.string(o.method)&&i.id===void 0}t.isNotification=n;function r(i){const o=i;return o&&(o.result!==void 0||!!o.error)&&(pt.string(o.id)||pt.number(o.id)||o.id===null)}t.isResponse=r})(qo||(q.Message=qo={}));var Je={},Mo;Object.defineProperty(Je,"__esModule",{value:!0}),Je.LRUCache=Je.LinkedMap=Je.Touch=void 0;var ye;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(ye||(Je.Touch=ye={}));class Oo{constructor(){this[Mo]="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(e){return this._map.has(e)}get(e,n=ye.None){const r=this._map.get(e);if(r)return n!==ye.None&&this.touch(r,n),r.value}set(e,n,r=ye.None){let i=this._map.get(e);if(i)i.value=n,r!==ye.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case ye.None:this.addItemLast(i);break;case ye.First:this.addItemFirst(i);break;case ye.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const e=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Mo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ye.First&&n!==ye.Last)){if(n===ye.First){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===ye.Last){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}Je.LinkedMap=Oo;class va extends Oo{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=ye.AsNew){return super.get(e,n)}peek(e){return super.get(e,ye.None)}set(e,n){return super.set(e,n,ye.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Je.LRUCache=va;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.Disposable=void 0;var Eo;(function(t){function e(n){return{dispose:n}}t.create=e})(Eo||(Fn.Disposable=Eo={}));var Ae={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});let Gr;function Zr(){if(Gr===void 0)throw new Error("No runtime abstraction layer installed");return Gr}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Gr=n}t.install=e})(Zr||(Zr={})),Xe.default=Zr,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.Emitter=Ae.Event=void 0;const Ra=Xe;var No;(function(t){const e={dispose(){}};t.None=function(){return e}})(No||(Ae.Event=No={}));class Da{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i{this._callbacks||(this._callbacks=new Da),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=In._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Ae.Emitter=In,In._noop=function(){};var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.CancellationTokenSource=et.CancellationToken=void 0;const Ta=Xe,Pa=le,ei=Ae;var An;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ei.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ei.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||Pa.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(An||(et.CancellationToken=An={}));const ka=Object.freeze(function(t,e){const n=(0,Ta.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class jo{constructor(){this._isCancelled=!1}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?ka:(this._emitter||(this._emitter=new ei.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Sa{get token(){return this._token||(this._token=new jo),this._token}cancel(){this._token?this._token.cancel():this._token=An.Cancelled}dispose(){this._token?this._token instanceof jo&&this._token.dispose():this._token=An.None}}et.CancellationTokenSource=Sa;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.SharedArrayReceiverStrategy=qt.SharedArraySenderStrategy=void 0;const Ca=et;var rn;(function(t){t.Continue=0,t.Cancelled=1})(rn||(rn={}));class qa{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=rn.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,rn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}qt.SharedArraySenderStrategy=qa;class Ma{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===rn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oa{constructor(e){this.token=new Ma(e)}cancel(){}dispose(){}}class Ea{constructor(){this.kind="request"}createCancellationTokenSource(e){const n=e.$cancellationData;return n===void 0?new Ca.CancellationTokenSource:new Oa(n)}}qt.SharedArrayReceiverStrategy=Ea;var tt={},on={};Object.defineProperty(on,"__esModule",{value:!0}),on.Semaphore=void 0;const Na=Xe;class ja{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Na.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}}on.Semaphore=ja,Object.defineProperty(tt,"__esModule",{value:!0}),tt.ReadableStreamMessageReader=tt.AbstractMessageReader=tt.MessageReader=void 0;const ti=Xe,Mt=le,ni=Ae,Fa=on;var Fo;(function(t){function e(n){let r=n;return r&&Mt.func(r.listen)&&Mt.func(r.dispose)&&Mt.func(r.onError)&&Mt.func(r.onClose)&&Mt.func(r.onPartialMessage)}t.is=e})(Fo||(tt.MessageReader=Fo={}));class Io{constructor(){this.errorEmitter=new ni.Emitter,this.closeEmitter=new ni.Emitter,this.partialMessageEmitter=new ni.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Mt.string(e.message)?e.message:"unknown"}`)}}tt.AbstractMessageReader=Io;var ri;(function(t){function e(n){let r,i;const o=new Map;let c;const d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(const f of n.contentDecoders)o.set(f.name,f);if(n.contentTypeDecoder!==void 0&&(c=n.contentTypeDecoder,d.set(c.name,c)),n.contentTypeDecoders!==void 0)for(const f of n.contentTypeDecoders)d.set(f.name,f)}return c===void 0&&(c=(0,ti.default)().applicationJson.decoder,d.set(c.name,c)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:c,contentTypeDecoders:d}}t.fromOptions=e})(ri||(ri={}));class Ia extends Io{constructor(e,n){super(),this.readable=e,this.options=ri.fromOptions(n),this.buffer=(0,ti.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Fa.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property. ${JSON.stringify(Object.fromEntries(r))}`));return}const o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}const n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ti.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}tt.ReadableStreamMessageReader=Ia;var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.WriteableStreamMessageWriter=nt.AbstractMessageWriter=nt.MessageWriter=void 0;const Ao=Xe,sn=le,Aa=on,Lo=Ae,La="Content-Length: ",Wo=`\r `;var $o;(function(t){function e(n){let r=n;return r&&sn.func(r.dispose)&&sn.func(r.onClose)&&sn.func(r.onError)&&sn.func(r.write)}t.is=e})($o||(nt.MessageWriter=$o={}));class Ho{constructor(){this.errorEmitter=new Lo.Emitter,this.closeEmitter=new Lo.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${sn.string(e.message)?e.message:"unknown"}`)}}nt.AbstractMessageWriter=Ho;var ii;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Ao.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Ao.default)().applicationJson.encoder}}t.fromOptions=e})(ii||(ii={}));class Wa extends Ho{constructor(e,n){super(),this.writable=e,this.options=ii.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Aa.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{const i=[];return i.push(La,r.byteLength.toString(),Wo),i.push(Wo),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}}nt.WriteableStreamMessageWriter=Wa;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.AbstractMessageBuffer=void 0;const $a=13,Ha=10,xa=`\r `;class za{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;rthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],c=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,c}const n=this.allocNative(e);let r=0,i=0;for(;e>0;){const o=this._chunks[i];if(o.byteLength>e){const c=o.slice(0,e);n.set(c,r),r+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else n.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return n}}Ln.AbstractMessageBuffer=za;var xo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Xe,n=le,r=q,i=Je,o=Ae,c=et;var d;(function(y){y.type=new r.NotificationType("$/cancelRequest")})(d||(d={}));var f;(function(y){function I(A){return typeof A=="string"||typeof A=="number"}y.is=I})(f||(t.ProgressToken=f={}));var _;(function(y){y.type=new r.NotificationType("$/progress")})(_||(_={}));class w{constructor(){}}t.ProgressType=w;var P;(function(y){function I(A){return n.func(A)}y.is=I})(P||(P={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var v;(function(y){y[y.Off=0]="Off",y[y.Messages=1]="Messages",y[y.Compact=2]="Compact",y[y.Verbose=3]="Verbose"})(v||(t.Trace=v={}));var M;(function(y){y.Off="off",y.Messages="messages",y.Compact="compact",y.Verbose="verbose"})(M||(t.TraceValues=M={})),function(y){function I(O){if(!n.string(O))return y.Off;switch(O=O.toLowerCase(),O){case"off":return y.Off;case"messages":return y.Messages;case"compact":return y.Compact;case"verbose":return y.Verbose;default:return y.Off}}y.fromString=I;function A(O){switch(O){case y.Off:return"off";case y.Messages:return"messages";case y.Compact:return"compact";case y.Verbose:return"verbose";default:return"off"}}y.toString=A}(v||(t.Trace=v={}));var W;(function(y){y.Text="text",y.JSON="json"})(W||(t.TraceFormat=W={})),function(y){function I(A){return n.string(A)?(A=A.toLowerCase(),A==="json"?y.JSON:y.Text):y.Text}y.fromString=I}(W||(t.TraceFormat=W={}));var be;(function(y){y.type=new r.NotificationType("$/setTrace")})(be||(t.SetTraceNotification=be={}));var me;(function(y){y.type=new r.NotificationType("$/logTrace")})(me||(t.LogTraceNotification=me={}));var $;(function(y){y[y.Closed=1]="Closed",y[y.Disposed=2]="Disposed",y[y.AlreadyListening=3]="AlreadyListening"})($||(t.ConnectionErrors=$={}));class b extends Error{constructor(I,A){super(A),this.code=I,Object.setPrototypeOf(this,b.prototype)}}t.ConnectionError=b;var h;(function(y){function I(A){const O=A;return O&&n.func(O.cancelUndispatched)}y.is=I})(h||(t.ConnectionStrategy=h={}));var T;(function(y){function I(A){const O=A;return O&&(O.kind===void 0||O.kind==="id")&&n.func(O.createCancellationTokenSource)&&(O.dispose===void 0||n.func(O.dispose))}y.is=I})(T||(t.IdCancellationReceiverStrategy=T={}));var ge;(function(y){function I(A){const O=A;return O&&O.kind==="request"&&n.func(O.createCancellationTokenSource)&&(O.dispose===void 0||n.func(O.dispose))}y.is=I})(ge||(t.RequestCancellationReceiverStrategy=ge={}));var se;(function(y){y.Message=Object.freeze({createCancellationTokenSource(A){return new c.CancellationTokenSource}});function I(A){return T.is(A)||ge.is(A)}y.is=I})(se||(t.CancellationReceiverStrategy=se={}));var we;(function(y){y.Message=Object.freeze({sendCancellation(A,O){return A.sendNotification(d.type,{id:O})},cleanup(A){}});function I(A){const O=A;return O&&n.func(O.sendCancellation)&&n.func(O.cleanup)}y.is=I})(we||(t.CancellationSenderStrategy=we={}));var Jt;(function(y){y.Message=Object.freeze({receiver:se.Message,sender:we.Message});function I(A){const O=A;return O&&se.is(O.receiver)&&we.is(O.sender)}y.is=I})(Jt||(t.CancellationStrategy=Jt={}));var lt;(function(y){function I(A){const O=A;return O&&n.func(O.handleMessage)}y.is=I})(lt||(t.MessageStrategy=lt={}));var Xt;(function(y){function I(A){const O=A;return O&&(Jt.is(O.cancellationStrategy)||h.is(O.connectionStrategy)||lt.is(O.messageStrategy))}y.is=I})(Xt||(t.ConnectionOptions=Xt={}));var Re;(function(y){y[y.New=1]="New",y[y.Listening=2]="Listening",y[y.Closed=3]="Closed",y[y.Disposed=4]="Disposed"})(Re||(Re={}));function wn(y,I,A,O){const Y=A!==void 0?A:t.NullLogger;let Tr=0,Pr=0,kr=0;const ft="2.0";let gt;const Tt=new Map;let _t;const Pt=new Map,kt=new Map;let Qt,He=new i.LinkedMap,xe=new Map,St=new Set,Oe=new Map,U=v.Off,ze=W.Text,ne,je=Re.New;const Kt=new o.Emitter,pn=new o.Emitter,yn=new o.Emitter,vn=new o.Emitter,Rn=new o.Emitter,Fe=O&&O.cancellationStrategy?O.cancellationStrategy:Jt.Message;function Dn(u){if(u===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+u.toString()}function Sr(u){return u===null?"res-unknown-"+(++kr).toString():"res-"+u.toString()}function Cr(){return"not-"+(++Pr).toString()}function qr(u,m){r.Message.isRequest(m)?u.set(Dn(m.id),m):r.Message.isResponse(m)?u.set(Sr(m.id),m):u.set(Cr(),m)}function Mr(u){}function Tn(){return je===Re.Listening}function Pn(){return je===Re.Closed}function Ye(){return je===Re.Disposed}function kn(){(je===Re.New||je===Re.Listening)&&(je=Re.Closed,pn.fire(void 0))}function Or(u){Kt.fire([u,void 0,void 0])}function Er(u){Kt.fire(u)}y.onClose(kn),y.onError(Or),I.onClose(kn),I.onError(Er);function Sn(){Qt||He.size===0||(Qt=(0,e.default)().timer.setImmediate(()=>{Qt=void 0,Nr()}))}function Cn(u){r.Message.isRequest(u)?Fr(u):r.Message.isNotification(u)?Ar(u):r.Message.isResponse(u)?Ir(u):Lr(u)}function Nr(){if(He.size===0)return;const u=He.shift();try{const m=O?.messageStrategy;lt.is(m)?m.handleMessage(u,Cn):Cn(u)}finally{Sn()}}const jr=u=>{try{if(r.Message.isNotification(u)&&u.method===d.type.method){const m=u.params.id,R=Dn(m),S=He.get(R);if(r.Message.isRequest(S)){const J=O?.connectionStrategy,re=J&&J.cancelUndispatched?J.cancelUndispatched(S,Mr):void 0;if(re&&(re.error!==void 0||re.result!==void 0)){He.delete(R),Oe.delete(m),re.id=S.id,Ct(re,u.method,Date.now()),I.write(re).catch(()=>Y.error("Sending response for canceled message failed."));return}}const Q=Oe.get(m);if(Q!==void 0){Q.cancel(),Yt(u);return}else St.add(m)}qr(He,u)}finally{Sn()}};function Fr(u){if(Ye())return;function m(x,G,B){const _e={jsonrpc:ft,id:u.id};x instanceof r.ResponseError?_e.error=x.toJson():_e.result=x===void 0?null:x,Ct(_e,G,B),I.write(_e).catch(()=>Y.error("Sending response failed."))}function R(x,G,B){const _e={jsonrpc:ft,id:u.id,error:x.toJson()};Ct(_e,G,B),I.write(_e).catch(()=>Y.error("Sending response failed."))}function S(x,G,B){x===void 0&&(x=null);const _e={jsonrpc:ft,id:u.id,result:x};Ct(_e,G,B),I.write(_e).catch(()=>Y.error("Sending response failed."))}Hr(u);const Q=Tt.get(u.method);let J,re;Q&&(J=Q.type,re=Q.handler);const ue=Date.now();if(re||gt){const x=u.id??String(Date.now()),G=T.is(Fe.receiver)?Fe.receiver.createCancellationTokenSource(x):Fe.receiver.createCancellationTokenSource(u);u.id!==null&&St.has(u.id)&&G.cancel(),u.id!==null&&Oe.set(x,G);try{let B;if(re)if(u.params===void 0){if(J!==void 0&&J.numberOfParams!==0){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines ${J.numberOfParams} params but received none.`),u.method,ue);return}B=re(G.token)}else if(Array.isArray(u.params)){if(J!==void 0&&J.parameterStructures===r.ParameterStructures.byName){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines parameters by name but received parameters by position`),u.method,ue);return}B=re(...u.params,G.token)}else{if(J!==void 0&&J.parameterStructures===r.ParameterStructures.byPosition){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines parameters by position but received parameters by name`),u.method,ue);return}B=re(u.params,G.token)}else gt&&(B=gt(u.method,u.params,G.token));const _e=B;B?_e.then?_e.then(De=>{Oe.delete(x),m(De,u.method,ue)},De=>{Oe.delete(x),De instanceof r.ResponseError?R(De,u.method,ue):De&&n.string(De.message)?R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed with message: ${De.message}`),u.method,ue):R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed unexpectedly without providing any details.`),u.method,ue)}):(Oe.delete(x),m(B,u.method,ue)):(Oe.delete(x),S(B,u.method,ue))}catch(B){Oe.delete(x),B instanceof r.ResponseError?m(B,u.method,ue):B&&n.string(B.message)?R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed with message: ${B.message}`),u.method,ue):R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed unexpectedly without providing any details.`),u.method,ue)}}else R(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${u.method}`),u.method,ue)}function Ir(u){if(!Ye())if(u.id===null)u.error?Y.error(`Received response message without id: Error is: -${JSON.stringify(u.error,void 0,4)}`):Y.error("Received response message without id. No further error information provided.");else{const m=u.id,R=xe.get(m);if(xr(u,R),R!==void 0){xe.delete(m);try{if(u.error){const S=u.error;R.reject(new r.ResponseError(S.code,S.message,S.data))}else if(u.result!==void 0)R.resolve(u.result);else throw new Error("Should never happen.")}catch(S){S.message?Y.error(`Response handler '${R.method}' failed with message: ${S.message}`):Y.error(`Response handler '${R.method}' failed unexpectedly.`)}}}}function Ar(u){if(Ye())return;let m,R;if(u.method===d.type.method){const S=u.params.id;St.delete(S),Yt(u);return}else{const S=Pt.get(u.method);S&&(R=S.handler,m=S.type)}if(R||_t)try{if(Yt(u),R)if(u.params===void 0)m!==void 0&&m.numberOfParams!==0&&m.parameterStructures!==r.ParameterStructures.byName&&Y.error(`Notification ${u.method} defines ${m.numberOfParams} params but received none.`),R();else if(Array.isArray(u.params)){const S=u.params;u.method===_.type.method&&S.length===2&&f.is(S[0])?R({token:S[0],value:S[1]}):(m!==void 0&&(m.parameterStructures===r.ParameterStructures.byName&&Y.error(`Notification ${u.method} defines parameters by name but received parameters by position`),m.numberOfParams!==u.params.length&&Y.error(`Notification ${u.method} defines ${m.numberOfParams} params but received ${S.length} arguments`)),R(...S))}else m!==void 0&&m.parameterStructures===r.ParameterStructures.byPosition&&Y.error(`Notification ${u.method} defines parameters by position but received parameters by name`),R(u.params);else _t&&_t(u.method,u.params)}catch(S){S.message?Y.error(`Notification handler '${u.method}' failed with message: ${S.message}`):Y.error(`Notification handler '${u.method}' failed unexpectedly.`)}else yn.fire(u)}function Lr(u){if(!u){Y.error("Received empty message.");return}Y.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(u,null,4)}`);const m=u;if(n.string(m.id)||n.number(m.id)){const R=m.id,S=xe.get(R);S&&S.reject(new Error("The received response has neither a result nor an error property."))}}function Ie(u){if(u!=null)switch(U){case v.Verbose:return JSON.stringify(u,null,4);case v.Compact:return JSON.stringify(u);default:return}}function Wr(u){if(!(U===v.Off||!ne))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&u.params&&(m=`Params: ${Ie(u.params)} +${w}`);const v=w.substr(0,P),M=w.substr(P+1).trim();d.set(e?v.toLowerCase():v,M)}return d}tryReadBody(e){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){const o=this._chunks[0],c=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,c}const n=this.allocNative(e);let r=0,i=0;for(;e>0;){const o=this._chunks[i];if(o.byteLength>e){const c=o.slice(0,e);n.set(c,r),r+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else n.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return n}}Ln.AbstractMessageBuffer=za;var xo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Xe,n=le,r=q,i=Je,o=Ae,c=et;var d;(function(y){y.type=new r.NotificationType("$/cancelRequest")})(d||(d={}));var f;(function(y){function I(A){return typeof A=="string"||typeof A=="number"}y.is=I})(f||(t.ProgressToken=f={}));var _;(function(y){y.type=new r.NotificationType("$/progress")})(_||(_={}));class w{constructor(){}}t.ProgressType=w;var P;(function(y){function I(A){return n.func(A)}y.is=I})(P||(P={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var v;(function(y){y[y.Off=0]="Off",y[y.Messages=1]="Messages",y[y.Compact=2]="Compact",y[y.Verbose=3]="Verbose"})(v||(t.Trace=v={}));var M;(function(y){y.Off="off",y.Messages="messages",y.Compact="compact",y.Verbose="verbose"})(M||(t.TraceValues=M={})),function(y){function I(O){if(!n.string(O))return y.Off;switch(O=O.toLowerCase(),O){case"off":return y.Off;case"messages":return y.Messages;case"compact":return y.Compact;case"verbose":return y.Verbose;default:return y.Off}}y.fromString=I;function A(O){switch(O){case y.Off:return"off";case y.Messages:return"messages";case y.Compact:return"compact";case y.Verbose:return"verbose";default:return"off"}}y.toString=A}(v||(t.Trace=v={}));var W;(function(y){y.Text="text",y.JSON="json"})(W||(t.TraceFormat=W={})),function(y){function I(A){return n.string(A)?(A=A.toLowerCase(),A==="json"?y.JSON:y.Text):y.Text}y.fromString=I}(W||(t.TraceFormat=W={}));var be;(function(y){y.type=new r.NotificationType("$/setTrace")})(be||(t.SetTraceNotification=be={}));var me;(function(y){y.type=new r.NotificationType("$/logTrace")})(me||(t.LogTraceNotification=me={}));var $;(function(y){y[y.Closed=1]="Closed",y[y.Disposed=2]="Disposed",y[y.AlreadyListening=3]="AlreadyListening"})($||(t.ConnectionErrors=$={}));class b extends Error{constructor(I,A){super(A),this.code=I,Object.setPrototypeOf(this,b.prototype)}}t.ConnectionError=b;var h;(function(y){function I(A){const O=A;return O&&n.func(O.cancelUndispatched)}y.is=I})(h||(t.ConnectionStrategy=h={}));var T;(function(y){function I(A){const O=A;return O&&(O.kind===void 0||O.kind==="id")&&n.func(O.createCancellationTokenSource)&&(O.dispose===void 0||n.func(O.dispose))}y.is=I})(T||(t.IdCancellationReceiverStrategy=T={}));var ge;(function(y){function I(A){const O=A;return O&&O.kind==="request"&&n.func(O.createCancellationTokenSource)&&(O.dispose===void 0||n.func(O.dispose))}y.is=I})(ge||(t.RequestCancellationReceiverStrategy=ge={}));var se;(function(y){y.Message=Object.freeze({createCancellationTokenSource(A){return new c.CancellationTokenSource}});function I(A){return T.is(A)||ge.is(A)}y.is=I})(se||(t.CancellationReceiverStrategy=se={}));var we;(function(y){y.Message=Object.freeze({sendCancellation(A,O){return A.sendNotification(d.type,{id:O})},cleanup(A){}});function I(A){const O=A;return O&&n.func(O.sendCancellation)&&n.func(O.cleanup)}y.is=I})(we||(t.CancellationSenderStrategy=we={}));var Jt;(function(y){y.Message=Object.freeze({receiver:se.Message,sender:we.Message});function I(A){const O=A;return O&&se.is(O.receiver)&&we.is(O.sender)}y.is=I})(Jt||(t.CancellationStrategy=Jt={}));var lt;(function(y){function I(A){const O=A;return O&&n.func(O.handleMessage)}y.is=I})(lt||(t.MessageStrategy=lt={}));var Xt;(function(y){function I(A){const O=A;return O&&(Jt.is(O.cancellationStrategy)||h.is(O.connectionStrategy)||lt.is(O.messageStrategy))}y.is=I})(Xt||(t.ConnectionOptions=Xt={}));var Re;(function(y){y[y.New=1]="New",y[y.Listening=2]="Listening",y[y.Closed=3]="Closed",y[y.Disposed=4]="Disposed"})(Re||(Re={}));function wn(y,I,A,O){const K=A!==void 0?A:t.NullLogger;let Tr=0,Pr=0,kr=0;const ft="2.0";let gt;const Tt=new Map;let _t;const Pt=new Map,kt=new Map;let Qt,He=new i.LinkedMap,xe=new Map,St=new Set,Oe=new Map,U=v.Off,ze=W.Text,ne,je=Re.New;const Yt=new o.Emitter,pn=new o.Emitter,yn=new o.Emitter,vn=new o.Emitter,Rn=new o.Emitter,Fe=O&&O.cancellationStrategy?O.cancellationStrategy:Jt.Message;function Dn(u){if(u===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+u.toString()}function Sr(u){return u===null?"res-unknown-"+(++kr).toString():"res-"+u.toString()}function Cr(){return"not-"+(++Pr).toString()}function qr(u,m){r.Message.isRequest(m)?u.set(Dn(m.id),m):r.Message.isResponse(m)?u.set(Sr(m.id),m):u.set(Cr(),m)}function Mr(u){}function Tn(){return je===Re.Listening}function Pn(){return je===Re.Closed}function Ke(){return je===Re.Disposed}function kn(){(je===Re.New||je===Re.Listening)&&(je=Re.Closed,pn.fire(void 0))}function Or(u){Yt.fire([u,void 0,void 0])}function Er(u){Yt.fire(u)}y.onClose(kn),y.onError(Or),I.onClose(kn),I.onError(Er);function Sn(){Qt||He.size===0||(Qt=(0,e.default)().timer.setImmediate(()=>{Qt=void 0,Nr()}))}function Cn(u){r.Message.isRequest(u)?Fr(u):r.Message.isNotification(u)?Ar(u):r.Message.isResponse(u)?Ir(u):Lr(u)}function Nr(){if(He.size===0)return;const u=He.shift();try{const m=O?.messageStrategy;lt.is(m)?m.handleMessage(u,Cn):Cn(u)}finally{Sn()}}const jr=u=>{try{if(r.Message.isNotification(u)&&u.method===d.type.method){const m=u.params.id,R=Dn(m),C=He.get(R);if(r.Message.isRequest(C)){const X=O?.connectionStrategy,re=X&&X.cancelUndispatched?X.cancelUndispatched(C,Mr):void 0;if(re&&(re.error!==void 0||re.result!==void 0)){He.delete(R),Oe.delete(m),re.id=C.id,Ct(re,u.method,Date.now()),I.write(re).catch(()=>K.error("Sending response for canceled message failed."));return}}const Q=Oe.get(m);if(Q!==void 0){Q.cancel(),Kt(u);return}else St.add(m)}qr(He,u)}finally{Sn()}};function Fr(u){if(Ke())return;function m(x,G,V){const _e={jsonrpc:ft,id:u.id};x instanceof r.ResponseError?_e.error=x.toJson():_e.result=x===void 0?null:x,Ct(_e,G,V),I.write(_e).catch(()=>K.error("Sending response failed."))}function R(x,G,V){const _e={jsonrpc:ft,id:u.id,error:x.toJson()};Ct(_e,G,V),I.write(_e).catch(()=>K.error("Sending response failed."))}function C(x,G,V){x===void 0&&(x=null);const _e={jsonrpc:ft,id:u.id,result:x};Ct(_e,G,V),I.write(_e).catch(()=>K.error("Sending response failed."))}Hr(u);const Q=Tt.get(u.method);let X,re;Q&&(X=Q.type,re=Q.handler);const ue=Date.now();if(re||gt){const x=u.id??String(Date.now()),G=T.is(Fe.receiver)?Fe.receiver.createCancellationTokenSource(x):Fe.receiver.createCancellationTokenSource(u);u.id!==null&&St.has(u.id)&&G.cancel(),u.id!==null&&Oe.set(x,G);try{let V;if(re)if(u.params===void 0){if(X!==void 0&&X.numberOfParams!==0){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines ${X.numberOfParams} params but received none.`),u.method,ue);return}V=re(G.token)}else if(Array.isArray(u.params)){if(X!==void 0&&X.parameterStructures===r.ParameterStructures.byName){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines parameters by name but received parameters by position`),u.method,ue);return}V=re(...u.params,G.token)}else{if(X!==void 0&&X.parameterStructures===r.ParameterStructures.byPosition){R(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${u.method} defines parameters by position but received parameters by name`),u.method,ue);return}V=re(u.params,G.token)}else gt&&(V=gt(u.method,u.params,G.token));const _e=V;V?_e.then?_e.then(De=>{Oe.delete(x),m(De,u.method,ue)},De=>{Oe.delete(x),De instanceof r.ResponseError?R(De,u.method,ue):De&&n.string(De.message)?R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed with message: ${De.message}`),u.method,ue):R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed unexpectedly without providing any details.`),u.method,ue)}):(Oe.delete(x),m(V,u.method,ue)):(Oe.delete(x),C(V,u.method,ue))}catch(V){Oe.delete(x),V instanceof r.ResponseError?m(V,u.method,ue):V&&n.string(V.message)?R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed with message: ${V.message}`),u.method,ue):R(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${u.method} failed unexpectedly without providing any details.`),u.method,ue)}}else R(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${u.method}`),u.method,ue)}function Ir(u){if(!Ke())if(u.id===null)u.error?K.error(`Received response message without id: Error is: +${JSON.stringify(u.error,void 0,4)}`):K.error("Received response message without id. No further error information provided.");else{const m=u.id,R=xe.get(m);if(xr(u,R),R!==void 0){xe.delete(m);try{if(u.error){const C=u.error;R.reject(new r.ResponseError(C.code,C.message,C.data))}else if(u.result!==void 0)R.resolve(u.result);else throw new Error("Should never happen.")}catch(C){C.message?K.error(`Response handler '${R.method}' failed with message: ${C.message}`):K.error(`Response handler '${R.method}' failed unexpectedly.`)}}}}function Ar(u){if(Ke())return;let m,R;if(u.method===d.type.method){const C=u.params.id;St.delete(C),Kt(u);return}else{const C=Pt.get(u.method);C&&(R=C.handler,m=C.type)}if(R||_t)try{if(Kt(u),R)if(u.params===void 0)m!==void 0&&m.numberOfParams!==0&&m.parameterStructures!==r.ParameterStructures.byName&&K.error(`Notification ${u.method} defines ${m.numberOfParams} params but received none.`),R();else if(Array.isArray(u.params)){const C=u.params;u.method===_.type.method&&C.length===2&&f.is(C[0])?R({token:C[0],value:C[1]}):(m!==void 0&&(m.parameterStructures===r.ParameterStructures.byName&&K.error(`Notification ${u.method} defines parameters by name but received parameters by position`),m.numberOfParams!==u.params.length&&K.error(`Notification ${u.method} defines ${m.numberOfParams} params but received ${C.length} arguments`)),R(...C))}else m!==void 0&&m.parameterStructures===r.ParameterStructures.byPosition&&K.error(`Notification ${u.method} defines parameters by position but received parameters by name`),R(u.params);else _t&&_t(u.method,u.params)}catch(C){C.message?K.error(`Notification handler '${u.method}' failed with message: ${C.message}`):K.error(`Notification handler '${u.method}' failed unexpectedly.`)}else yn.fire(u)}function Lr(u){if(!u){K.error("Received empty message.");return}K.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(u,null,4)}`);const m=u;if(n.string(m.id)||n.number(m.id)){const R=m.id,C=xe.get(R);C&&C.reject(new Error("The received response has neither a result nor an error property."))}}function Ie(u){if(u!=null)switch(U){case v.Verbose:return JSON.stringify(u,null,4);case v.Compact:return JSON.stringify(u);default:return}}function Wr(u){if(!(U===v.Off||!ne))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&u.params&&(m=`Params: ${Ie(u.params)} `),ne.log(`Sending request '${u.method} - (${u.id})'.`,m)}else Ge("send-request",u)}function $r(u){if(!(U===v.Off||!ne))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&(u.params?m=`Params: ${Ie(u.params)} `:m=`No parameters provided. -`),ne.log(`Sending notification '${u.method}'.`,m)}else Ge("send-notification",u)}function Ct(u,m,R){if(!(U===v.Off||!ne))if(ze===W.Text){let S;(U===v.Verbose||U===v.Compact)&&(u.error&&u.error.data?S=`Error data: ${Ie(u.error.data)} +`),ne.log(`Sending notification '${u.method}'.`,m)}else Ge("send-notification",u)}function Ct(u,m,R){if(!(U===v.Off||!ne))if(ze===W.Text){let C;(U===v.Verbose||U===v.Compact)&&(u.error&&u.error.data?C=`Error data: ${Ie(u.error.data)} -`:u.result?S=`Result: ${Ie(u.result)} +`:u.result?C=`Result: ${Ie(u.result)} -`:u.error===void 0&&(S=`No result returned. +`:u.error===void 0&&(C=`No result returned. -`)),ne.log(`Sending response '${m} - (${u.id})'. Processing request took ${Date.now()-R}ms`,S)}else Ge("send-response",u)}function Hr(u){if(!(U===v.Off||!ne))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&u.params&&(m=`Params: ${Ie(u.params)} +`)),ne.log(`Sending response '${m} - (${u.id})'. Processing request took ${Date.now()-R}ms`,C)}else Ge("send-response",u)}function Hr(u){if(!(U===v.Off||!ne))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&u.params&&(m=`Params: ${Ie(u.params)} -`),ne.log(`Received request '${u.method} - (${u.id})'.`,m)}else Ge("receive-request",u)}function Yt(u){if(!(U===v.Off||!ne||u.method===me.type.method))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&(u.params?m=`Params: ${Ie(u.params)} +`),ne.log(`Received request '${u.method} - (${u.id})'.`,m)}else Ge("receive-request",u)}function Kt(u){if(!(U===v.Off||!ne||u.method===me.type.method))if(ze===W.Text){let m;(U===v.Verbose||U===v.Compact)&&(u.params?m=`Params: ${Ie(u.params)} `:m=`No parameters provided. @@ -29,8 +29,8 @@ ${JSON.stringify(u,null,4)}`);const m=u;if(n.string(m.id)||n.number(m.id)){const `:u.error===void 0&&(R=`No result returned. -`)),m){const S=u.error?` Request failed: ${u.error.message} (${u.error.code}).`:"";ne.log(`Received response '${m.method} - (${u.id})' in ${Date.now()-m.timerStart}ms.${S}`,R)}else ne.log(`Received response ${u.id} without active response promise.`,R)}else Ge("receive-response",u)}function Ge(u,m){if(!ne||U===v.Off)return;const R={isLSPMessage:!0,type:u,message:m,timestamp:Date.now()};ne.log(R)}function bt(){if(Pn())throw new b($.Closed,"Connection is closed.");if(Ye())throw new b($.Disposed,"Connection is disposed.")}function zr(){if(Tn())throw new b($.AlreadyListening,"Connection is already listening")}function Br(){if(!Tn())throw new Error("Call listen() first.")}function ht(u){return u===void 0?null:u}function qn(u){if(u!==null)return u}function a(u){return u!=null&&!Array.isArray(u)&&typeof u=="object"}function ce(u,m){switch(u){case r.ParameterStructures.auto:return a(m)?qn(m):[ht(m)];case r.ParameterStructures.byName:if(!a(m))throw new Error("Received parameters by name but param is not an object literal.");return qn(m);case r.ParameterStructures.byPosition:return[ht(m)];default:throw new Error(`Unknown parameter structure ${u.toString()}`)}}function ae(u,m){let R;const S=u.numberOfParams;switch(S){case 0:R=void 0;break;case 1:R=ce(u.parameterStructures,m[0]);break;default:R=[];for(let Q=0;Q{bt();let R,S;if(n.string(u)){R=u;const J=m[0];let re=0,ue=r.ParameterStructures.auto;r.ParameterStructures.is(J)&&(re=1,ue=J);let x=m.length;const G=x-re;switch(G){case 0:S=void 0;break;case 1:S=ce(ue,m[re]);break;default:if(ue===r.ParameterStructures.byName)throw new Error(`Received ${G} parameters for 'by Name' notification parameter structure.`);S=m.slice(re,x).map(B=>ht(B));break}}else{const J=m;R=u.method,S=ae(u,J)}const Q={jsonrpc:ft,method:R,params:S};return $r(Q),I.write(Q).catch(J=>{throw Y.error("Sending notification failed."),J})},onNotification:(u,m)=>{bt();let R;return n.func(u)?_t=u:m&&(n.string(u)?(R=u,Pt.set(u,{type:void 0,handler:m})):(R=u.method,Pt.set(u.method,{type:u,handler:m}))),{dispose:()=>{R!==void 0?Pt.delete(R):_t=void 0}}},onProgress:(u,m,R)=>{if(kt.has(m))throw new Error(`Progress handler for token ${m} already registered`);return kt.set(m,R),{dispose:()=>{kt.delete(m)}}},sendProgress:(u,m,R)=>E.sendNotification(_.type,{token:m,value:R}),onUnhandledProgress:vn.event,sendRequest:(u,...m)=>{bt(),Br();let R,S,Q;if(n.string(u)){R=u;const x=m[0],G=m[m.length-1];let B=0,_e=r.ParameterStructures.auto;r.ParameterStructures.is(x)&&(B=1,_e=x);let De=m.length;c.CancellationToken.is(G)&&(De=De-1,Q=G);const Be=De-B;switch(Be){case 0:S=void 0;break;case 1:S=ce(_e,m[B]);break;default:if(_e===r.ParameterStructures.byName)throw new Error(`Received ${Be} parameters for 'by Name' request parameter structure.`);S=m.slice(B,De).map(hd=>ht(hd));break}}else{const x=m;R=u.method,S=ae(u,x);const G=u.numberOfParams;Q=c.CancellationToken.is(x[G])?x[G]:void 0}const J=Tr++;let re;Q&&(re=Q.onCancellationRequested(()=>{const x=Fe.sender.sendCancellation(E,J);return x===void 0?(Y.log(`Received no promise from cancellation strategy when cancelling id ${J}`),Promise.resolve()):x.catch(()=>{Y.log(`Sending cancellation messages for id ${J} failed`)})}));const ue={jsonrpc:ft,id:J,method:R,params:S};return Wr(ue),typeof Fe.sender.enableCancellation=="function"&&Fe.sender.enableCancellation(ue),new Promise(async(x,G)=>{const B=Be=>{x(Be),Fe.sender.cleanup(J),re?.dispose()},_e=Be=>{G(Be),Fe.sender.cleanup(J),re?.dispose()},De={method:R,timerStart:Date.now(),resolve:B,reject:_e};try{await I.write(ue),xe.set(J,De)}catch(Be){throw Y.error("Sending request failed."),De.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Be.message?Be.message:"Unknown reason")),Be}})},onRequest:(u,m)=>{bt();let R=null;return P.is(u)?(R=void 0,gt=u):n.string(u)?(R=null,m!==void 0&&(R=u,Tt.set(u,{handler:m,type:void 0}))):m!==void 0&&(R=u.method,Tt.set(u.method,{type:u,handler:m})),{dispose:()=>{R!==null&&(R!==void 0?Tt.delete(R):gt=void 0)}}},hasPendingResponse:()=>xe.size>0,trace:async(u,m,R)=>{let S=!1,Q=W.Text;R!==void 0&&(n.boolean(R)?S=R:(S=R.sendNotification||!1,Q=R.traceFormat||W.Text)),U=u,ze=Q,U===v.Off?ne=void 0:ne=m,S&&!Pn()&&!Ye()&&await E.sendNotification(be.type,{value:v.toString(u)})},onError:Kt.event,onClose:pn.event,onUnhandledNotification:yn.event,onDispose:Rn.event,end:()=>{I.end()},dispose:()=>{if(Ye())return;je=Re.Disposed,Rn.fire(void 0);const u=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const m of xe.values())m.reject(u);xe=new Map,Oe=new Map,St=new Set,He=new i.LinkedMap,n.func(I.dispose)&&I.dispose(),n.func(y.dispose)&&y.dispose()},listen:()=>{bt(),zr(),je=Re.Listening,y.listen(jr)},inspect:()=>{(0,e.default)().console.log("inspect")}};return E.onNotification(me.type,u=>{if(U===v.Off||!ne)return;const m=U===v.Verbose||U===v.Compact;ne.log(u.message,m?u.verbose:void 0)}),E.onNotification(_.type,u=>{const m=kt.get(u.token);m?m(u.value):vn.fire(u)}),E}t.createMessageConnection=wn})(xo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=q;Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=Je;Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=Fn;Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ae;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=et;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const c=qt;Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return c.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return c.SharedArrayReceiverStrategy}});const d=tt;Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return d.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return d.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return d.ReadableStreamMessageReader}});const f=nt;Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return f.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return f.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return f.WriteableStreamMessageWriter}});const _=Ln;Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return _.AbstractMessageBuffer}});const w=xo;Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}});const P=Xe;t.RAL=P.default}(jn),Object.defineProperty(Qr,"__esModule",{value:!0});const Le=jn;class Wn extends Le.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Wn.emptyBuffer}fromString(e,n){return new TextEncoder().encode(e)}toString(e,n){return n==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e:e.slice(0,n)}allocNative(e){return new Uint8Array(e)}}Wn.emptyBuffer=new Uint8Array(0);class Ba{constructor(e){this.socket=e,this._onData=new Le.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Le.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Le.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Le.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Le.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Va{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Le.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Le.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Le.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,n){if(typeof e=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Ua=new TextEncoder,zo=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wn(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Ua.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new Ba(t),asWritableStream:t=>new Va(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function oi(){return zo}(function(t){function e(){Le.RAL.install(zo)}t.install=e})(oi||(oi={})),Qr.default=oi,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,P){P===void 0&&(P=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,P,v)}:function(f,_,w,P){P===void 0&&(P=w),f[P]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Qr.default.install();const i=jn;n(jn,t);class o extends i.AbstractMessageReader{constructor(_){super(),this._onData=new i.Emitter,this._messageListener=w=>{this._onData.fire(w.data)},_.addEventListener("error",w=>this.fireError(w)),_.onmessage=this._messageListener}listen(_){return this._onData.event(_)}}t.BrowserMessageReader=o;class c extends i.AbstractMessageWriter{constructor(_){super(),this.port=_,this.errorCount=0,_.addEventListener("error",w=>this.fireError(w))}write(_){try{return this.port.postMessage(_),Promise.resolve()}catch(w){return this.handleError(w,_),Promise.reject(w)}}handleError(_,w){this.errorCount++,this.fireError(_,w,this.errorCount)}end(){}}t.BrowserMessageWriter=c;function d(f,_,w,P){return w===void 0&&(w=i.NullLogger),i.ConnectionStrategy.is(P)&&(P={connectionStrategy:P}),(0,i.createMessageConnection)(f,_,w,P)}t.createMessageConnection=d}(wt);var Bo=wt,Vo={},si;(function(t){function e(n){return typeof n=="string"}t.is=e})(si||(si={}));var $n;(function(t){function e(n){return typeof n=="string"}t.is=e})($n||($n={}));var ci;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ci||(ci={}));var cn;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(cn||(cn={}));var ke;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=cn.MAX_VALUE),i===Number.MAX_VALUE&&(i=cn.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&l.uinteger(i.line)&&l.uinteger(i.character)}t.is=n})(ke||(ke={}));var Z;(function(t){function e(r,i,o,c){if(l.uinteger(r)&&l.uinteger(i)&&l.uinteger(o)&&l.uinteger(c))return{start:ke.create(r,i),end:ke.create(o,c)};if(ke.is(r)&&ke.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${c}]`)}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&ke.is(i.start)&&ke.is(i.end)}t.is=n})(Z||(Z={}));var an;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.range)&&(l.string(i.uri)||l.undefined(i.uri))}t.is=n})(an||(an={}));var ai;(function(t){function e(r,i,o,c){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:c}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.targetRange)&&l.string(i.targetUri)&&Z.is(i.targetSelectionRange)&&(Z.is(i.originSelectionRange)||l.undefined(i.originSelectionRange))}t.is=n})(ai||(ai={}));var Hn;(function(t){function e(r,i,o,c){return{red:r,green:i,blue:o,alpha:c}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.numberRange(i.red,0,1)&&l.numberRange(i.green,0,1)&&l.numberRange(i.blue,0,1)&&l.numberRange(i.alpha,0,1)}t.is=n})(Hn||(Hn={}));var ui;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&Z.is(i.range)&&Hn.is(i.color)}t.is=n})(ui||(ui={}));var di;(function(t){function e(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.string(i.label)&&(l.undefined(i.textEdit)||We.is(i))&&(l.undefined(i.additionalTextEdits)||l.typedArray(i.additionalTextEdits,We.is))}t.is=n})(di||(di={}));var li;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(li||(li={}));var fi;(function(t){function e(r,i,o,c,d,f){const _={startLine:r,endLine:i};return l.defined(o)&&(_.startCharacter=o),l.defined(c)&&(_.endCharacter=c),l.defined(d)&&(_.kind=d),l.defined(f)&&(_.collapsedText=f),_}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.uinteger(i.startLine)&&l.uinteger(i.startLine)&&(l.undefined(i.startCharacter)||l.uinteger(i.startCharacter))&&(l.undefined(i.endCharacter)||l.uinteger(i.endCharacter))&&(l.undefined(i.kind)||l.string(i.kind))}t.is=n})(fi||(fi={}));var xn;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&an.is(i.location)&&l.string(i.message)}t.is=n})(xn||(xn={}));var gi;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(gi||(gi={}));var _i;(function(t){t.Unnecessary=1,t.Deprecated=2})(_i||(_i={}));var bi;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&l.string(r.href)}t.is=e})(bi||(bi={}));var un;(function(t){function e(r,i,o,c,d,f){let _={range:r,message:i};return l.defined(o)&&(_.severity=o),l.defined(c)&&(_.code=c),l.defined(d)&&(_.source=d),l.defined(f)&&(_.relatedInformation=f),_}t.create=e;function n(r){var i;let o=r;return l.defined(o)&&Z.is(o.range)&&l.string(o.message)&&(l.number(o.severity)||l.undefined(o.severity))&&(l.integer(o.code)||l.string(o.code)||l.undefined(o.code))&&(l.undefined(o.codeDescription)||l.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(l.string(o.source)||l.undefined(o.source))&&(l.undefined(o.relatedInformation)||l.typedArray(o.relatedInformation,xn.is))}t.is=n})(un||(un={}));var yt;(function(t){function e(r,i,...o){let c={title:r,command:i};return l.defined(o)&&o.length>0&&(c.arguments=o),c}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.title)&&l.string(i.command)}t.is=n})(yt||(yt={}));var We;(function(t){function e(o,c){return{range:o,newText:c}}t.replace=e;function n(o,c){return{range:{start:o,end:o},newText:c}}t.insert=n;function r(o){return{range:o,newText:""}}t.del=r;function i(o){const c=o;return l.objectLiteral(c)&&l.string(c.newText)&&Z.is(c.range)}t.is=i})(We||(We={}));var vt;(function(t){function e(r,i,o){const c={label:r};return i!==void 0&&(c.needsConfirmation=i),o!==void 0&&(c.description=o),c}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.string(i.label)&&(l.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(l.string(i.description)||i.description===void 0)}t.is=n})(vt||(vt={}));var he;(function(t){function e(n){const r=n;return l.string(r)}t.is=e})(he||(he={}));var Qe;(function(t){function e(o,c,d){return{range:o,newText:c,annotationId:d}}t.replace=e;function n(o,c,d){return{range:{start:o,end:o},newText:c,annotationId:d}}t.insert=n;function r(o,c){return{range:o,newText:"",annotationId:c}}t.del=r;function i(o){const c=o;return We.is(c)&&(vt.is(c.annotationId)||he.is(c.annotationId))}t.is=i})(Qe||(Qe={}));var dn;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&ln.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(dn||(dn={}));var Ot;(function(t){function e(r,i,o){let c={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(c.options=i),o!==void 0&&(c.annotationId=o),c}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&l.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||l.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||l.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Ot||(Ot={}));var Et;(function(t){function e(r,i,o,c){let d={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(d.options=o),c!==void 0&&(d.annotationId=c),d}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&l.string(i.oldUri)&&l.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||l.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||l.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Et||(Et={}));var Nt;(function(t){function e(r,i,o){let c={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(c.options=i),o!==void 0&&(c.annotationId=o),c}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&l.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||l.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||l.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Nt||(Nt={}));var zn;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>l.string(i.kind)?Ot.is(i)||Et.is(i)||Nt.is(i):dn.is(i)))}t.is=e})(zn||(zn={}));class Bn{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,o;if(r===void 0?i=We.insert(e,n):he.is(r)?(o=r,i=Qe.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=Qe.insert(e,n,o)),this.edits.push(i),o!==void 0)return o}replace(e,n,r){let i,o;if(r===void 0?i=We.replace(e,n):he.is(r)?(o=r,i=Qe.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=Qe.replace(e,n,o)),this.edits.push(i),o!==void 0)return o}delete(e,n){let r,i;if(n===void 0?r=We.del(e):he.is(n)?(i=n,r=Qe.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Qe.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class Uo{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,n){let r;if(he.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class Ja{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Uo(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if(dn.is(n)){const r=new Bn(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new Bn(e.changes[n]);this._textEditChanges[n]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(ln.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],o={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(o),r=new Bn(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new Bn(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Uo,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vt.is(n)||he.is(n)?i=n:r=n;let o,c;if(i===void 0?o=Ot.create(e,r):(c=he.is(i)?i:this._changeAnnotations.manage(i),o=Ot.create(e,r,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;vt.is(r)||he.is(r)?o=r:i=r;let c,d;if(o===void 0?c=Et.create(e,n,i):(d=he.is(o)?o:this._changeAnnotations.manage(o),c=Et.create(e,n,i,d)),this._workspaceEdit.documentChanges.push(c),d!==void 0)return d}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vt.is(n)||he.is(n)?i=n:r=n;let o,c;if(i===void 0?o=Nt.create(e,r):(c=he.is(i)?i:this._changeAnnotations.manage(i),o=Nt.create(e,r,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}}var hi;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)}t.is=n})(hi||(hi={}));var mi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&l.integer(i.version)}t.is=n})(mi||(mi={}));var ln;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&(i.version===null||l.integer(i.version))}t.is=n})(ln||(ln={}));var wi;(function(t){function e(r,i,o,c){return{uri:r,languageId:i,version:o,text:c}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&l.string(i.languageId)&&l.integer(i.version)&&l.string(i.text)}t.is=n})(wi||(wi={}));var Vn;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Vn||(Vn={}));var jt;(function(t){function e(n){const r=n;return l.objectLiteral(n)&&Vn.is(r.kind)&&l.string(r.value)}t.is=e})(jt||(jt={}));var pi;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(pi||(pi={}));var yi;(function(t){t.PlainText=1,t.Snippet=2})(yi||(yi={}));var vi;(function(t){t.Deprecated=1})(vi||(vi={}));var Ri;(function(t){function e(r,i,o){return{newText:r,insert:i,replace:o}}t.create=e;function n(r){const i=r;return i&&l.string(i.newText)&&Z.is(i.insert)&&Z.is(i.replace)}t.is=n})(Ri||(Ri={}));var Di;(function(t){t.asIs=1,t.adjustIndentation=2})(Di||(Di={}));var Ti;(function(t){function e(n){const r=n;return r&&(l.string(r.detail)||r.detail===void 0)&&(l.string(r.description)||r.description===void 0)}t.is=e})(Ti||(Ti={}));var Pi;(function(t){function e(n){return{label:n}}t.create=e})(Pi||(Pi={}));var ki;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(ki||(ki={}));var fn;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return l.string(i)||l.objectLiteral(i)&&l.string(i.language)&&l.string(i.value)}t.is=n})(fn||(fn={}));var Si;(function(t){function e(n){let r=n;return!!r&&l.objectLiteral(r)&&(jt.is(r.contents)||fn.is(r.contents)||l.typedArray(r.contents,fn.is))&&(n.range===void 0||Z.is(n.range))}t.is=e})(Si||(Si={}));var Ci;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(Ci||(Ci={}));var qi;(function(t){function e(n,r,...i){let o={label:n};return l.defined(r)&&(o.documentation=r),l.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(qi||(qi={}));var Mi;(function(t){t.Text=1,t.Read=2,t.Write=3})(Mi||(Mi={}));var Oi;(function(t){function e(n,r){let i={range:n};return l.number(r)&&(i.kind=r),i}t.create=e})(Oi||(Oi={}));var Ei;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ei||(Ei={}));var Ni;(function(t){t.Deprecated=1})(Ni||(Ni={}));var ji;(function(t){function e(n,r,i,o,c){let d={name:n,kind:r,location:{uri:o,range:i}};return c&&(d.containerName=c),d}t.create=e})(ji||(ji={}));var Fi;(function(t){function e(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(Fi||(Fi={}));var Ii;(function(t){function e(r,i,o,c,d,f){let _={name:r,detail:i,kind:o,range:c,selectionRange:d};return f!==void 0&&(_.children=f),_}t.create=e;function n(r){let i=r;return i&&l.string(i.name)&&l.number(i.kind)&&Z.is(i.range)&&Z.is(i.selectionRange)&&(i.detail===void 0||l.string(i.detail))&&(i.deprecated===void 0||l.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(Ii||(Ii={}));var Ai;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Ai||(Ai={}));var gn;(function(t){t.Invoked=1,t.Automatic=2})(gn||(gn={}));var Li;(function(t){function e(r,i,o){let c={diagnostics:r};return i!=null&&(c.only=i),o!=null&&(c.triggerKind=o),c}t.create=e;function n(r){let i=r;return l.defined(i)&&l.typedArray(i.diagnostics,un.is)&&(i.only===void 0||l.typedArray(i.only,l.string))&&(i.triggerKind===void 0||i.triggerKind===gn.Invoked||i.triggerKind===gn.Automatic)}t.is=n})(Li||(Li={}));var Wi;(function(t){function e(r,i,o){let c={title:r},d=!0;return typeof i=="string"?(d=!1,c.kind=i):yt.is(i)?c.command=i:c.edit=i,d&&o!==void 0&&(c.kind=o),c}t.create=e;function n(r){let i=r;return i&&l.string(i.title)&&(i.diagnostics===void 0||l.typedArray(i.diagnostics,un.is))&&(i.kind===void 0||l.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||yt.is(i.command))&&(i.isPreferred===void 0||l.boolean(i.isPreferred))&&(i.edit===void 0||zn.is(i.edit))}t.is=n})(Wi||(Wi={}));var $i;(function(t){function e(r,i){let o={range:r};return l.defined(i)&&(o.data=i),o}t.create=e;function n(r){let i=r;return l.defined(i)&&Z.is(i.range)&&(l.undefined(i.command)||yt.is(i.command))}t.is=n})($i||($i={}));var Hi;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.uinteger(i.tabSize)&&l.boolean(i.insertSpaces)}t.is=n})(Hi||(Hi={}));var xi;(function(t){function e(r,i,o){return{range:r,target:i,data:o}}t.create=e;function n(r){let i=r;return l.defined(i)&&Z.is(i.range)&&(l.undefined(i.target)||l.string(i.target))}t.is=n})(xi||(xi={}));var zi;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(zi||(zi={}));var Bi;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Bi||(Bi={}));var Vi;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Vi||(Vi={}));var Ui;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(Ui||(Ui={}));var Ji;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&l.string(i.text)}t.is=n})(Ji||(Ji={}));var Xi;(function(t){function e(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&l.boolean(i.caseSensitiveLookup)&&(l.string(i.variableName)||i.variableName===void 0)}t.is=n})(Xi||(Xi={}));var Qi;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&(l.string(i.expression)||i.expression===void 0)}t.is=n})(Qi||(Qi={}));var Ki;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return l.defined(i)&&Z.is(r.stoppedLocation)}t.is=n})(Ki||(Ki={}));var Un;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Un||(Un={}));var Jn;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&(i.tooltip===void 0||l.string(i.tooltip)||jt.is(i.tooltip))&&(i.location===void 0||an.is(i.location))&&(i.command===void 0||yt.is(i.command))}t.is=n})(Jn||(Jn={}));var Yi;(function(t){function e(r,i,o){const c={position:r,label:i};return o!==void 0&&(c.kind=o),c}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&ke.is(i.position)&&(l.string(i.label)||l.typedArray(i.label,Jn.is))&&(i.kind===void 0||Un.is(i.kind))&&i.textEdits===void 0||l.typedArray(i.textEdits,We.is)&&(i.tooltip===void 0||l.string(i.tooltip)||jt.is(i.tooltip))&&(i.paddingLeft===void 0||l.boolean(i.paddingLeft))&&(i.paddingRight===void 0||l.boolean(i.paddingRight))}t.is=n})(Yi||(Yi={}));var Gi;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Gi||(Gi={}));var Zi;(function(t){function e(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}t.create=e})(Zi||(Zi={}));var eo;(function(t){function e(n){return{items:n}}t.create=e})(eo||(eo={}));var to;(function(t){t.Invoked=0,t.Automatic=1})(to||(to={}));var no;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(no||(no={}));var ro;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(ro||(ro={}));var io;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&$n.is(r.uri)&&l.string(r.name)}t.is=e})(io||(io={}));const Xa=[` +`)),m){const C=u.error?` Request failed: ${u.error.message} (${u.error.code}).`:"";ne.log(`Received response '${m.method} - (${u.id})' in ${Date.now()-m.timerStart}ms.${C}`,R)}else ne.log(`Received response ${u.id} without active response promise.`,R)}else Ge("receive-response",u)}function Ge(u,m){if(!ne||U===v.Off)return;const R={isLSPMessage:!0,type:u,message:m,timestamp:Date.now()};ne.log(R)}function bt(){if(Pn())throw new b($.Closed,"Connection is closed.");if(Ke())throw new b($.Disposed,"Connection is disposed.")}function zr(){if(Tn())throw new b($.AlreadyListening,"Connection is already listening")}function Br(){if(!Tn())throw new Error("Call listen() first.")}function ht(u){return u===void 0?null:u}function qn(u){if(u!==null)return u}function a(u){return u!=null&&!Array.isArray(u)&&typeof u=="object"}function ce(u,m){switch(u){case r.ParameterStructures.auto:return a(m)?qn(m):[ht(m)];case r.ParameterStructures.byName:if(!a(m))throw new Error("Received parameters by name but param is not an object literal.");return qn(m);case r.ParameterStructures.byPosition:return[ht(m)];default:throw new Error(`Unknown parameter structure ${u.toString()}`)}}function ae(u,m){let R;const C=u.numberOfParams;switch(C){case 0:R=void 0;break;case 1:R=ce(u.parameterStructures,m[0]);break;default:R=[];for(let Q=0;Q{bt();let R,C;if(n.string(u)){R=u;const X=m[0];let re=0,ue=r.ParameterStructures.auto;r.ParameterStructures.is(X)&&(re=1,ue=X);let x=m.length;const G=x-re;switch(G){case 0:C=void 0;break;case 1:C=ce(ue,m[re]);break;default:if(ue===r.ParameterStructures.byName)throw new Error(`Received ${G} parameters for 'by Name' notification parameter structure.`);C=m.slice(re,x).map(V=>ht(V));break}}else{const X=m;R=u.method,C=ae(u,X)}const Q={jsonrpc:ft,method:R,params:C};return $r(Q),I.write(Q).catch(X=>{throw K.error("Sending notification failed."),X})},onNotification:(u,m)=>{bt();let R;return n.func(u)?_t=u:m&&(n.string(u)?(R=u,Pt.set(u,{type:void 0,handler:m})):(R=u.method,Pt.set(u.method,{type:u,handler:m}))),{dispose:()=>{R!==void 0?Pt.delete(R):_t=void 0}}},onProgress:(u,m,R)=>{if(kt.has(m))throw new Error(`Progress handler for token ${m} already registered`);return kt.set(m,R),{dispose:()=>{kt.delete(m)}}},sendProgress:(u,m,R)=>E.sendNotification(_.type,{token:m,value:R}),onUnhandledProgress:vn.event,sendRequest:(u,...m)=>{bt(),Br();let R,C,Q;if(n.string(u)){R=u;const x=m[0],G=m[m.length-1];let V=0,_e=r.ParameterStructures.auto;r.ParameterStructures.is(x)&&(V=1,_e=x);let De=m.length;c.CancellationToken.is(G)&&(De=De-1,Q=G);const Be=De-V;switch(Be){case 0:C=void 0;break;case 1:C=ce(_e,m[V]);break;default:if(_e===r.ParameterStructures.byName)throw new Error(`Received ${Be} parameters for 'by Name' request parameter structure.`);C=m.slice(V,De).map(hd=>ht(hd));break}}else{const x=m;R=u.method,C=ae(u,x);const G=u.numberOfParams;Q=c.CancellationToken.is(x[G])?x[G]:void 0}const X=Tr++;let re;Q&&(re=Q.onCancellationRequested(()=>{const x=Fe.sender.sendCancellation(E,X);return x===void 0?(K.log(`Received no promise from cancellation strategy when cancelling id ${X}`),Promise.resolve()):x.catch(()=>{K.log(`Sending cancellation messages for id ${X} failed`)})}));const ue={jsonrpc:ft,id:X,method:R,params:C};return Wr(ue),typeof Fe.sender.enableCancellation=="function"&&Fe.sender.enableCancellation(ue),new Promise(async(x,G)=>{const V=Be=>{x(Be),Fe.sender.cleanup(X),re?.dispose()},_e=Be=>{G(Be),Fe.sender.cleanup(X),re?.dispose()},De={method:R,timerStart:Date.now(),resolve:V,reject:_e};try{await I.write(ue),xe.set(X,De)}catch(Be){throw K.error("Sending request failed."),De.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Be.message?Be.message:"Unknown reason")),Be}})},onRequest:(u,m)=>{bt();let R=null;return P.is(u)?(R=void 0,gt=u):n.string(u)?(R=null,m!==void 0&&(R=u,Tt.set(u,{handler:m,type:void 0}))):m!==void 0&&(R=u.method,Tt.set(u.method,{type:u,handler:m})),{dispose:()=>{R!==null&&(R!==void 0?Tt.delete(R):gt=void 0)}}},hasPendingResponse:()=>xe.size>0,trace:async(u,m,R)=>{let C=!1,Q=W.Text;R!==void 0&&(n.boolean(R)?C=R:(C=R.sendNotification||!1,Q=R.traceFormat||W.Text)),U=u,ze=Q,U===v.Off?ne=void 0:ne=m,C&&!Pn()&&!Ke()&&await E.sendNotification(be.type,{value:v.toString(u)})},onError:Yt.event,onClose:pn.event,onUnhandledNotification:yn.event,onDispose:Rn.event,end:()=>{I.end()},dispose:()=>{if(Ke())return;je=Re.Disposed,Rn.fire(void 0);const u=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const m of xe.values())m.reject(u);xe=new Map,Oe=new Map,St=new Set,He=new i.LinkedMap,n.func(I.dispose)&&I.dispose(),n.func(y.dispose)&&y.dispose()},listen:()=>{bt(),zr(),je=Re.Listening,y.listen(jr)},inspect:()=>{(0,e.default)().console.log("inspect")}};return E.onNotification(me.type,u=>{if(U===v.Off||!ne)return;const m=U===v.Verbose||U===v.Compact;ne.log(u.message,m?u.verbose:void 0)}),E.onNotification(_.type,u=>{const m=kt.get(u.token);m?m(u.value):vn.fire(u)}),E}t.createMessageConnection=wn})(xo),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=q;Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=Je;Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=Fn;Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ae;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=et;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const c=qt;Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return c.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return c.SharedArrayReceiverStrategy}});const d=tt;Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return d.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return d.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return d.ReadableStreamMessageReader}});const f=nt;Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return f.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return f.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return f.WriteableStreamMessageWriter}});const _=Ln;Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return _.AbstractMessageBuffer}});const w=xo;Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}});const P=Xe;t.RAL=P.default}(jn),Object.defineProperty(Qr,"__esModule",{value:!0});const Le=jn;class Wn extends Le.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Wn.emptyBuffer}fromString(e,n){return new TextEncoder().encode(e)}toString(e,n){return n==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e:e.slice(0,n)}allocNative(e){return new Uint8Array(e)}}Wn.emptyBuffer=new Uint8Array(0);class Ba{constructor(e){this.socket=e,this._onData=new Le.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Le.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Le.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Le.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Le.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Va{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Le.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Le.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Le.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,n){if(typeof e=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const Ua=new TextEncoder,zo=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wn(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(Ua.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new Ba(t),asWritableStream:t=>new Va(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function oi(){return zo}(function(t){function e(){Le.RAL.install(zo)}t.install=e})(oi||(oi={})),Qr.default=oi,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,P){P===void 0&&(P=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,P,v)}:function(f,_,w,P){P===void 0&&(P=w),f[P]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,Qr.default.install();const i=jn;n(jn,t);class o extends i.AbstractMessageReader{constructor(_){super(),this._onData=new i.Emitter,this._messageListener=w=>{this._onData.fire(w.data)},_.addEventListener("error",w=>this.fireError(w)),_.onmessage=this._messageListener}listen(_){return this._onData.event(_)}}t.BrowserMessageReader=o;class c extends i.AbstractMessageWriter{constructor(_){super(),this.port=_,this.errorCount=0,_.addEventListener("error",w=>this.fireError(w))}write(_){try{return this.port.postMessage(_),Promise.resolve()}catch(w){return this.handleError(w,_),Promise.reject(w)}}handleError(_,w){this.errorCount++,this.fireError(_,w,this.errorCount)}end(){}}t.BrowserMessageWriter=c;function d(f,_,w,P){return w===void 0&&(w=i.NullLogger),i.ConnectionStrategy.is(P)&&(P={connectionStrategy:P}),(0,i.createMessageConnection)(f,_,w,P)}t.createMessageConnection=d}(wt);var Bo=wt,Vo={},si;(function(t){function e(n){return typeof n=="string"}t.is=e})(si||(si={}));var $n;(function(t){function e(n){return typeof n=="string"}t.is=e})($n||($n={}));var ci;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ci||(ci={}));var cn;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(cn||(cn={}));var ke;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=cn.MAX_VALUE),i===Number.MAX_VALUE&&(i=cn.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&l.uinteger(i.line)&&l.uinteger(i.character)}t.is=n})(ke||(ke={}));var Z;(function(t){function e(r,i,o,c){if(l.uinteger(r)&&l.uinteger(i)&&l.uinteger(o)&&l.uinteger(c))return{start:ke.create(r,i),end:ke.create(o,c)};if(ke.is(r)&&ke.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${c}]`)}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&ke.is(i.start)&&ke.is(i.end)}t.is=n})(Z||(Z={}));var an;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.range)&&(l.string(i.uri)||l.undefined(i.uri))}t.is=n})(an||(an={}));var ai;(function(t){function e(r,i,o,c){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:c}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.targetRange)&&l.string(i.targetUri)&&Z.is(i.targetSelectionRange)&&(Z.is(i.originSelectionRange)||l.undefined(i.originSelectionRange))}t.is=n})(ai||(ai={}));var Hn;(function(t){function e(r,i,o,c){return{red:r,green:i,blue:o,alpha:c}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.numberRange(i.red,0,1)&&l.numberRange(i.green,0,1)&&l.numberRange(i.blue,0,1)&&l.numberRange(i.alpha,0,1)}t.is=n})(Hn||(Hn={}));var ui;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&Z.is(i.range)&&Hn.is(i.color)}t.is=n})(ui||(ui={}));var di;(function(t){function e(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.string(i.label)&&(l.undefined(i.textEdit)||We.is(i))&&(l.undefined(i.additionalTextEdits)||l.typedArray(i.additionalTextEdits,We.is))}t.is=n})(di||(di={}));var li;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(li||(li={}));var fi;(function(t){function e(r,i,o,c,d,f){const _={startLine:r,endLine:i};return l.defined(o)&&(_.startCharacter=o),l.defined(c)&&(_.endCharacter=c),l.defined(d)&&(_.kind=d),l.defined(f)&&(_.collapsedText=f),_}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.uinteger(i.startLine)&&l.uinteger(i.startLine)&&(l.undefined(i.startCharacter)||l.uinteger(i.startCharacter))&&(l.undefined(i.endCharacter)||l.uinteger(i.endCharacter))&&(l.undefined(i.kind)||l.string(i.kind))}t.is=n})(fi||(fi={}));var xn;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&an.is(i.location)&&l.string(i.message)}t.is=n})(xn||(xn={}));var gi;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(gi||(gi={}));var _i;(function(t){t.Unnecessary=1,t.Deprecated=2})(_i||(_i={}));var bi;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&l.string(r.href)}t.is=e})(bi||(bi={}));var un;(function(t){function e(r,i,o,c,d,f){let _={range:r,message:i};return l.defined(o)&&(_.severity=o),l.defined(c)&&(_.code=c),l.defined(d)&&(_.source=d),l.defined(f)&&(_.relatedInformation=f),_}t.create=e;function n(r){var i;let o=r;return l.defined(o)&&Z.is(o.range)&&l.string(o.message)&&(l.number(o.severity)||l.undefined(o.severity))&&(l.integer(o.code)||l.string(o.code)||l.undefined(o.code))&&(l.undefined(o.codeDescription)||l.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(l.string(o.source)||l.undefined(o.source))&&(l.undefined(o.relatedInformation)||l.typedArray(o.relatedInformation,xn.is))}t.is=n})(un||(un={}));var yt;(function(t){function e(r,i,...o){let c={title:r,command:i};return l.defined(o)&&o.length>0&&(c.arguments=o),c}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.title)&&l.string(i.command)}t.is=n})(yt||(yt={}));var We;(function(t){function e(o,c){return{range:o,newText:c}}t.replace=e;function n(o,c){return{range:{start:o,end:o},newText:c}}t.insert=n;function r(o){return{range:o,newText:""}}t.del=r;function i(o){const c=o;return l.objectLiteral(c)&&l.string(c.newText)&&Z.is(c.range)}t.is=i})(We||(We={}));var vt;(function(t){function e(r,i,o){const c={label:r};return i!==void 0&&(c.needsConfirmation=i),o!==void 0&&(c.description=o),c}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&l.string(i.label)&&(l.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(l.string(i.description)||i.description===void 0)}t.is=n})(vt||(vt={}));var he;(function(t){function e(n){const r=n;return l.string(r)}t.is=e})(he||(he={}));var Qe;(function(t){function e(o,c,d){return{range:o,newText:c,annotationId:d}}t.replace=e;function n(o,c,d){return{range:{start:o,end:o},newText:c,annotationId:d}}t.insert=n;function r(o,c){return{range:o,newText:"",annotationId:c}}t.del=r;function i(o){const c=o;return We.is(c)&&(vt.is(c.annotationId)||he.is(c.annotationId))}t.is=i})(Qe||(Qe={}));var dn;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&ln.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(dn||(dn={}));var Ot;(function(t){function e(r,i,o){let c={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(c.options=i),o!==void 0&&(c.annotationId=o),c}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&l.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||l.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||l.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Ot||(Ot={}));var Et;(function(t){function e(r,i,o,c){let d={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(d.options=o),c!==void 0&&(d.annotationId=c),d}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&l.string(i.oldUri)&&l.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||l.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||l.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Et||(Et={}));var Nt;(function(t){function e(r,i,o){let c={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(c.options=i),o!==void 0&&(c.annotationId=o),c}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&l.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||l.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||l.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||he.is(i.annotationId))}t.is=n})(Nt||(Nt={}));var zn;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>l.string(i.kind)?Ot.is(i)||Et.is(i)||Nt.is(i):dn.is(i)))}t.is=e})(zn||(zn={}));class Bn{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,o;if(r===void 0?i=We.insert(e,n):he.is(r)?(o=r,i=Qe.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=Qe.insert(e,n,o)),this.edits.push(i),o!==void 0)return o}replace(e,n,r){let i,o;if(r===void 0?i=We.replace(e,n):he.is(r)?(o=r,i=Qe.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=Qe.replace(e,n,o)),this.edits.push(i),o!==void 0)return o}delete(e,n){let r,i;if(n===void 0?r=We.del(e):he.is(n)?(i=n,r=Qe.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Qe.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class Uo{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,n){let r;if(he.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class Ja{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Uo(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if(dn.is(n)){const r=new Bn(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new Bn(e.changes[n]);this._textEditChanges[n]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(ln.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],o={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(o),r=new Bn(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new Bn(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Uo,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vt.is(n)||he.is(n)?i=n:r=n;let o,c;if(i===void 0?o=Ot.create(e,r):(c=he.is(i)?i:this._changeAnnotations.manage(i),o=Ot.create(e,r,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;vt.is(r)||he.is(r)?o=r:i=r;let c,d;if(o===void 0?c=Et.create(e,n,i):(d=he.is(o)?o:this._changeAnnotations.manage(o),c=Et.create(e,n,i,d)),this._workspaceEdit.documentChanges.push(c),d!==void 0)return d}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vt.is(n)||he.is(n)?i=n:r=n;let o,c;if(i===void 0?o=Nt.create(e,r):(c=he.is(i)?i:this._changeAnnotations.manage(i),o=Nt.create(e,r,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}}var hi;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)}t.is=n})(hi||(hi={}));var mi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&l.integer(i.version)}t.is=n})(mi||(mi={}));var ln;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&(i.version===null||l.integer(i.version))}t.is=n})(ln||(ln={}));var wi;(function(t){function e(r,i,o,c){return{uri:r,languageId:i,version:o,text:c}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.string(i.uri)&&l.string(i.languageId)&&l.integer(i.version)&&l.string(i.text)}t.is=n})(wi||(wi={}));var Vn;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Vn||(Vn={}));var jt;(function(t){function e(n){const r=n;return l.objectLiteral(n)&&Vn.is(r.kind)&&l.string(r.value)}t.is=e})(jt||(jt={}));var pi;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(pi||(pi={}));var yi;(function(t){t.PlainText=1,t.Snippet=2})(yi||(yi={}));var vi;(function(t){t.Deprecated=1})(vi||(vi={}));var Ri;(function(t){function e(r,i,o){return{newText:r,insert:i,replace:o}}t.create=e;function n(r){const i=r;return i&&l.string(i.newText)&&Z.is(i.insert)&&Z.is(i.replace)}t.is=n})(Ri||(Ri={}));var Di;(function(t){t.asIs=1,t.adjustIndentation=2})(Di||(Di={}));var Ti;(function(t){function e(n){const r=n;return r&&(l.string(r.detail)||r.detail===void 0)&&(l.string(r.description)||r.description===void 0)}t.is=e})(Ti||(Ti={}));var Pi;(function(t){function e(n){return{label:n}}t.create=e})(Pi||(Pi={}));var ki;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(ki||(ki={}));var fn;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return l.string(i)||l.objectLiteral(i)&&l.string(i.language)&&l.string(i.value)}t.is=n})(fn||(fn={}));var Si;(function(t){function e(n){let r=n;return!!r&&l.objectLiteral(r)&&(jt.is(r.contents)||fn.is(r.contents)||l.typedArray(r.contents,fn.is))&&(n.range===void 0||Z.is(n.range))}t.is=e})(Si||(Si={}));var Ci;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(Ci||(Ci={}));var qi;(function(t){function e(n,r,...i){let o={label:n};return l.defined(r)&&(o.documentation=r),l.defined(i)?o.parameters=i:o.parameters=[],o}t.create=e})(qi||(qi={}));var Mi;(function(t){t.Text=1,t.Read=2,t.Write=3})(Mi||(Mi={}));var Oi;(function(t){function e(n,r){let i={range:n};return l.number(r)&&(i.kind=r),i}t.create=e})(Oi||(Oi={}));var Ei;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ei||(Ei={}));var Ni;(function(t){t.Deprecated=1})(Ni||(Ni={}));var ji;(function(t){function e(n,r,i,o,c){let d={name:n,kind:r,location:{uri:o,range:i}};return c&&(d.containerName=c),d}t.create=e})(ji||(ji={}));var Fi;(function(t){function e(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(Fi||(Fi={}));var Ii;(function(t){function e(r,i,o,c,d,f){let _={name:r,detail:i,kind:o,range:c,selectionRange:d};return f!==void 0&&(_.children=f),_}t.create=e;function n(r){let i=r;return i&&l.string(i.name)&&l.number(i.kind)&&Z.is(i.range)&&Z.is(i.selectionRange)&&(i.detail===void 0||l.string(i.detail))&&(i.deprecated===void 0||l.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(Ii||(Ii={}));var Ai;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Ai||(Ai={}));var gn;(function(t){t.Invoked=1,t.Automatic=2})(gn||(gn={}));var Li;(function(t){function e(r,i,o){let c={diagnostics:r};return i!=null&&(c.only=i),o!=null&&(c.triggerKind=o),c}t.create=e;function n(r){let i=r;return l.defined(i)&&l.typedArray(i.diagnostics,un.is)&&(i.only===void 0||l.typedArray(i.only,l.string))&&(i.triggerKind===void 0||i.triggerKind===gn.Invoked||i.triggerKind===gn.Automatic)}t.is=n})(Li||(Li={}));var Wi;(function(t){function e(r,i,o){let c={title:r},d=!0;return typeof i=="string"?(d=!1,c.kind=i):yt.is(i)?c.command=i:c.edit=i,d&&o!==void 0&&(c.kind=o),c}t.create=e;function n(r){let i=r;return i&&l.string(i.title)&&(i.diagnostics===void 0||l.typedArray(i.diagnostics,un.is))&&(i.kind===void 0||l.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||yt.is(i.command))&&(i.isPreferred===void 0||l.boolean(i.isPreferred))&&(i.edit===void 0||zn.is(i.edit))}t.is=n})(Wi||(Wi={}));var $i;(function(t){function e(r,i){let o={range:r};return l.defined(i)&&(o.data=i),o}t.create=e;function n(r){let i=r;return l.defined(i)&&Z.is(i.range)&&(l.undefined(i.command)||yt.is(i.command))}t.is=n})($i||($i={}));var Hi;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return l.defined(i)&&l.uinteger(i.tabSize)&&l.boolean(i.insertSpaces)}t.is=n})(Hi||(Hi={}));var xi;(function(t){function e(r,i,o){return{range:r,target:i,data:o}}t.create=e;function n(r){let i=r;return l.defined(i)&&Z.is(i.range)&&(l.undefined(i.target)||l.string(i.target))}t.is=n})(xi||(xi={}));var zi;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return l.objectLiteral(i)&&Z.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(zi||(zi={}));var Bi;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Bi||(Bi={}));var Vi;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Vi||(Vi={}));var Ui;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(Ui||(Ui={}));var Ji;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&l.string(i.text)}t.is=n})(Ji||(Ji={}));var Xi;(function(t){function e(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&l.boolean(i.caseSensitiveLookup)&&(l.string(i.variableName)||i.variableName===void 0)}t.is=n})(Xi||(Xi={}));var Qi;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Z.is(i.range)&&(l.string(i.expression)||i.expression===void 0)}t.is=n})(Qi||(Qi={}));var Yi;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return l.defined(i)&&Z.is(r.stoppedLocation)}t.is=n})(Yi||(Yi={}));var Un;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Un||(Un={}));var Jn;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&(i.tooltip===void 0||l.string(i.tooltip)||jt.is(i.tooltip))&&(i.location===void 0||an.is(i.location))&&(i.command===void 0||yt.is(i.command))}t.is=n})(Jn||(Jn={}));var Ki;(function(t){function e(r,i,o){const c={position:r,label:i};return o!==void 0&&(c.kind=o),c}t.create=e;function n(r){const i=r;return l.objectLiteral(i)&&ke.is(i.position)&&(l.string(i.label)||l.typedArray(i.label,Jn.is))&&(i.kind===void 0||Un.is(i.kind))&&i.textEdits===void 0||l.typedArray(i.textEdits,We.is)&&(i.tooltip===void 0||l.string(i.tooltip)||jt.is(i.tooltip))&&(i.paddingLeft===void 0||l.boolean(i.paddingLeft))&&(i.paddingRight===void 0||l.boolean(i.paddingRight))}t.is=n})(Ki||(Ki={}));var Gi;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Gi||(Gi={}));var Zi;(function(t){function e(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}t.create=e})(Zi||(Zi={}));var eo;(function(t){function e(n){return{items:n}}t.create=e})(eo||(eo={}));var to;(function(t){t.Invoked=0,t.Automatic=1})(to||(to={}));var no;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(no||(no={}));var ro;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(ro||(ro={}));var io;(function(t){function e(n){const r=n;return l.objectLiteral(r)&&$n.is(r.uri)&&l.string(r.name)}t.is=e})(io||(io={}));const Xa=[` `,`\r `,"\r"];var oo;(function(t){function e(o,c,d,f){return new Qa(o,c,d,f)}t.create=e;function n(o){let c=o;return!!(l.defined(c)&&l.string(c.uri)&&(l.undefined(c.languageId)||l.string(c.languageId))&&l.uinteger(c.lineCount)&&l.func(c.getText)&&l.func(c.positionAt)&&l.func(c.offsetAt))}t.is=n;function r(o,c){let d=o.getText(),f=i(c,(w,P)=>{let v=w.range.start.line-P.range.start.line;return v===0?w.range.start.character-P.range.start.character:v}),_=d.length;for(let w=f.length-1;w>=0;w--){let P=f[w],v=o.offsetAt(P.range.start),M=o.offsetAt(P.range.end);if(M<=_)d=d.substring(0,v)+P.newText+d.substring(M,d.length);else throw new Error("Overlapping edit");_=v}return d}t.applyEdits=r;function i(o,c){if(o.length<=1)return o;const d=o.length/2|0,f=o.slice(0,d),_=o.slice(d);i(f,c),i(_,c);let w=0,P=0,v=0;for(;w0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ke.create(0,e);for(;re?i=c:r=c+1}let o=r-1;return ke.create(o,e-n[o])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(M){return M===!0||M===!1}t.boolean=i;function o(M){return e.call(M)==="[object String]"}t.string=o;function c(M){return e.call(M)==="[object Number]"}t.number=c;function d(M,W,be){return e.call(M)==="[object Number]"&&W<=M&&M<=be}t.numberRange=d;function f(M){return e.call(M)==="[object Number]"&&-2147483648<=M&&M<=2147483647}t.integer=f;function _(M){return e.call(M)==="[object Number]"&&0<=M&&M<=2147483647}t.uinteger=_;function w(M){return e.call(M)==="[object Function]"}t.func=w;function P(M){return M!==null&&typeof M=="object"}t.objectLiteral=P;function v(M,W){return Array.isArray(M)&&M.every(W)}t.typedArray=v})(l||(l={}));var Ka=Object.freeze({__proto__:null,get AnnotatedTextEdit(){return Qe},get ChangeAnnotation(){return vt},get ChangeAnnotationIdentifier(){return he},get CodeAction(){return Wi},get CodeActionContext(){return Li},get CodeActionKind(){return Ai},get CodeActionTriggerKind(){return gn},get CodeDescription(){return bi},get CodeLens(){return $i},get Color(){return Hn},get ColorInformation(){return ui},get ColorPresentation(){return di},get Command(){return yt},get CompletionItem(){return Pi},get CompletionItemKind(){return pi},get CompletionItemLabelDetails(){return Ti},get CompletionItemTag(){return vi},get CompletionList(){return ki},get CreateFile(){return Ot},get DeleteFile(){return Nt},get Diagnostic(){return un},get DiagnosticRelatedInformation(){return xn},get DiagnosticSeverity(){return gi},get DiagnosticTag(){return _i},get DocumentHighlight(){return Oi},get DocumentHighlightKind(){return Mi},get DocumentLink(){return xi},get DocumentSymbol(){return Ii},get DocumentUri(){return si},EOL:Xa,get FoldingRange(){return fi},get FoldingRangeKind(){return li},get FormattingOptions(){return Hi},get Hover(){return Si},get InlayHint(){return Yi},get InlayHintKind(){return Un},get InlayHintLabelPart(){return Jn},get InlineCompletionContext(){return ro},get InlineCompletionItem(){return Zi},get InlineCompletionList(){return eo},get InlineCompletionTriggerKind(){return to},get InlineValueContext(){return Ki},get InlineValueEvaluatableExpression(){return Qi},get InlineValueText(){return Ji},get InlineValueVariableLookup(){return Xi},get InsertReplaceEdit(){return Ri},get InsertTextFormat(){return yi},get InsertTextMode(){return Di},get Location(){return an},get LocationLink(){return ai},get MarkedString(){return fn},get MarkupContent(){return jt},get MarkupKind(){return Vn},get OptionalVersionedTextDocumentIdentifier(){return ln},get ParameterInformation(){return Ci},get Position(){return ke},get Range(){return Z},get RenameFile(){return Et},get SelectedCompletionInfo(){return no},get SelectionRange(){return zi},get SemanticTokenModifiers(){return Vi},get SemanticTokenTypes(){return Bi},get SemanticTokens(){return Ui},get SignatureInformation(){return qi},get StringValue(){return Gi},get SymbolInformation(){return ji},get SymbolKind(){return Ei},get SymbolTag(){return Ni},get TextDocument(){return oo},get TextDocumentEdit(){return dn},get TextDocumentIdentifier(){return hi},get TextDocumentItem(){return wi},get TextEdit(){return We},get URI(){return $n},get VersionedTextDocumentIdentifier(){return mi},WorkspaceChange:Ja,get WorkspaceEdit(){return zn},get WorkspaceFolder(){return io},get WorkspaceSymbol(){return Fi},get integer(){return ci},get uinteger(){return cn}}),so=Jc(Ka),H={};Object.defineProperty(H,"__esModule",{value:!0}),H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const Ft=wt;var Jo;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Jo||(H.MessageDirection=Jo={}));class Ya{constructor(e){this.method=e}}H.RegistrationType=Ya;class Ga extends Ft.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=Ga;class Za extends Ft.RequestType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolRequestType=Za;class eu extends Ft.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=eu;class tu extends Ft.NotificationType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolNotificationType=tu;var Xo={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.objectLiteral=ee.typedArray=ee.stringArray=ee.array=ee.func=ee.error=ee.number=ee.string=ee.boolean=void 0;function nu(t){return t===!0||t===!1}ee.boolean=nu;function Qo(t){return typeof t=="string"||t instanceof String}ee.string=Qo;function ru(t){return typeof t=="number"||t instanceof Number}ee.number=ru;function iu(t){return t instanceof Error}ee.error=iu;function ou(t){return typeof t=="function"}ee.func=ou;function Ko(t){return Array.isArray(t)}ee.array=Ko;function su(t){return Ko(t)&&t.every(e=>Qo(e))}ee.stringArray=su;function cu(t,e){return Array.isArray(t)&&t.every(e)}ee.typedArray=cu;function au(t){return t!==null&&typeof t=="object"}ee.objectLiteral=au;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ImplementationRequest=void 0;const Yo=H;var Go;(function(t){t.method="textDocument/implementation",t.messageDirection=Yo.MessageDirection.clientToServer,t.type=new Yo.ProtocolRequestType(t.method)})(Go||(Xn.ImplementationRequest=Go={}));var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.TypeDefinitionRequest=void 0;const Zo=H;var es;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(es||(Qn.TypeDefinitionRequest=es={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.DidChangeWorkspaceFoldersNotification=It.WorkspaceFoldersRequest=void 0;const Kn=H;var ts;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Kn.MessageDirection.serverToClient,t.type=new Kn.ProtocolRequestType0(t.method)})(ts||(It.WorkspaceFoldersRequest=ts={}));var ns;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Kn.MessageDirection.clientToServer,t.type=new Kn.ProtocolNotificationType(t.method)})(ns||(It.DidChangeWorkspaceFoldersNotification=ns={}));var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.ConfigurationRequest=void 0;const rs=H;var is;(function(t){t.method="workspace/configuration",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(is||(Yn.ConfigurationRequest=is={}));var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.ColorPresentationRequest=At.DocumentColorRequest=void 0;const Gn=H;var os;(function(t){t.method="textDocument/documentColor",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(os||(At.DocumentColorRequest=os={}));var ss;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(ss||(At.ColorPresentationRequest=ss={}));var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.FoldingRangeRefreshRequest=Lt.FoldingRangeRequest=void 0;const Zn=H;var cs;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Zn.MessageDirection.clientToServer,t.type=new Zn.ProtocolRequestType(t.method)})(cs||(Lt.FoldingRangeRequest=cs={}));var as;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Zn.MessageDirection.serverToClient,t.type=new Zn.ProtocolRequestType0(t.method)})(as||(Lt.FoldingRangeRefreshRequest=as={}));var er={};Object.defineProperty(er,"__esModule",{value:!0}),er.DeclarationRequest=void 0;const us=H;var ds;(function(t){t.method="textDocument/declaration",t.messageDirection=us.MessageDirection.clientToServer,t.type=new us.ProtocolRequestType(t.method)})(ds||(er.DeclarationRequest=ds={}));var tr={};Object.defineProperty(tr,"__esModule",{value:!0}),tr.SelectionRangeRequest=void 0;const ls=H;var fs;(function(t){t.method="textDocument/selectionRange",t.messageDirection=ls.MessageDirection.clientToServer,t.type=new ls.ProtocolRequestType(t.method)})(fs||(tr.SelectionRangeRequest=fs={}));var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.WorkDoneProgressCancelNotification=rt.WorkDoneProgressCreateRequest=rt.WorkDoneProgress=void 0;const uu=wt,nr=H;var gs;(function(t){t.type=new uu.ProgressType;function e(n){return n===t.type}t.is=e})(gs||(rt.WorkDoneProgress=gs={}));var _s;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=nr.MessageDirection.serverToClient,t.type=new nr.ProtocolRequestType(t.method)})(_s||(rt.WorkDoneProgressCreateRequest=_s={}));var bs;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=nr.MessageDirection.clientToServer,t.type=new nr.ProtocolNotificationType(t.method)})(bs||(rt.WorkDoneProgressCancelNotification=bs={}));var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.CallHierarchyOutgoingCallsRequest=it.CallHierarchyIncomingCallsRequest=it.CallHierarchyPrepareRequest=void 0;const Wt=H;var hs;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(hs||(it.CallHierarchyPrepareRequest=hs={}));var ms;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ms||(it.CallHierarchyIncomingCallsRequest=ms={}));var ws;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ws||(it.CallHierarchyOutgoingCallsRequest=ws={}));var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.SemanticTokensRefreshRequest=Te.SemanticTokensRangeRequest=Te.SemanticTokensDeltaRequest=Te.SemanticTokensRequest=Te.SemanticTokensRegistrationType=Te.TokenFormat=void 0;const Ke=H;var ps;(function(t){t.Relative="relative"})(ps||(Te.TokenFormat=ps={}));var _n;(function(t){t.method="textDocument/semanticTokens",t.type=new Ke.RegistrationType(t.method)})(_n||(Te.SemanticTokensRegistrationType=_n={}));var ys;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ke.MessageDirection.clientToServer,t.type=new Ke.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(ys||(Te.SemanticTokensRequest=ys={}));var vs;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ke.MessageDirection.clientToServer,t.type=new Ke.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(vs||(Te.SemanticTokensDeltaRequest=vs={}));var Rs;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ke.MessageDirection.clientToServer,t.type=new Ke.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(Rs||(Te.SemanticTokensRangeRequest=Rs={}));var Ds;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ke.MessageDirection.serverToClient,t.type=new Ke.ProtocolRequestType0(t.method)})(Ds||(Te.SemanticTokensRefreshRequest=Ds={}));var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.ShowDocumentRequest=void 0;const Ts=H;var Ps;(function(t){t.method="window/showDocument",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType(t.method)})(Ps||(rr.ShowDocumentRequest=Ps={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.LinkedEditingRangeRequest=void 0;const ks=H;var Ss;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(Ss||(ir.LinkedEditingRangeRequest=Ss={}));var ve={};Object.defineProperty(ve,"__esModule",{value:!0}),ve.WillDeleteFilesRequest=ve.DidDeleteFilesNotification=ve.DidRenameFilesNotification=ve.WillRenameFilesRequest=ve.DidCreateFilesNotification=ve.WillCreateFilesRequest=ve.FileOperationPatternKind=void 0;const Se=H;var Cs;(function(t){t.file="file",t.folder="folder"})(Cs||(ve.FileOperationPatternKind=Cs={}));var qs;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(qs||(ve.WillCreateFilesRequest=qs={}));var Ms;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ms||(ve.DidCreateFilesNotification=Ms={}));var Os;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(Os||(ve.WillRenameFilesRequest=Os={}));var Es;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Es||(ve.DidRenameFilesNotification=Es={}));var Ns;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ns||(ve.DidDeleteFilesNotification=Ns={}));var js;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(js||(ve.WillDeleteFilesRequest=js={}));var ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.MonikerRequest=ot.MonikerKind=ot.UniquenessLevel=void 0;const Fs=H;var Is;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Is||(ot.UniquenessLevel=Is={}));var As;(function(t){t.$import="import",t.$export="export",t.local="local"})(As||(ot.MonikerKind=As={}));var Ls;(function(t){t.method="textDocument/moniker",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(Ls||(ot.MonikerRequest=Ls={}));var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.TypeHierarchySubtypesRequest=st.TypeHierarchySupertypesRequest=st.TypeHierarchyPrepareRequest=void 0;const $t=H;var Ws;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Ws||(st.TypeHierarchyPrepareRequest=Ws={}));var $s;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})($s||(st.TypeHierarchySupertypesRequest=$s={}));var Hs;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Hs||(st.TypeHierarchySubtypesRequest=Hs={}));var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.InlineValueRefreshRequest=Ht.InlineValueRequest=void 0;const or=H;var xs;(function(t){t.method="textDocument/inlineValue",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolRequestType(t.method)})(xs||(Ht.InlineValueRequest=xs={}));var zs;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=or.MessageDirection.serverToClient,t.type=new or.ProtocolRequestType0(t.method)})(zs||(Ht.InlineValueRefreshRequest=zs={}));var ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.InlayHintRefreshRequest=ct.InlayHintResolveRequest=ct.InlayHintRequest=void 0;const xt=H;var Bs;(function(t){t.method="textDocument/inlayHint",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Bs||(ct.InlayHintRequest=Bs={}));var Vs;(function(t){t.method="inlayHint/resolve",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Vs||(ct.InlayHintResolveRequest=Vs={}));var Us;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=xt.MessageDirection.serverToClient,t.type=new xt.ProtocolRequestType0(t.method)})(Us||(ct.InlayHintRefreshRequest=Us={}));var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DiagnosticRefreshRequest=Ce.WorkspaceDiagnosticRequest=Ce.DocumentDiagnosticRequest=Ce.DocumentDiagnosticReportKind=Ce.DiagnosticServerCancellationData=void 0;const Js=wt,du=ee,zt=H;var Xs;(function(t){function e(n){const r=n;return r&&du.boolean(r.retriggerRequest)}t.is=e})(Xs||(Ce.DiagnosticServerCancellationData=Xs={}));var Qs;(function(t){t.Full="full",t.Unchanged="unchanged"})(Qs||(Ce.DocumentDiagnosticReportKind=Qs={}));var Ks;(function(t){t.method="textDocument/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ks||(Ce.DocumentDiagnosticRequest=Ks={}));var Ys;(function(t){t.method="workspace/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ys||(Ce.WorkspaceDiagnosticRequest=Ys={}));var Gs;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=zt.MessageDirection.serverToClient,t.type=new zt.ProtocolRequestType0(t.method)})(Gs||(Ce.DiagnosticRefreshRequest=Gs={}));var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.DidCloseNotebookDocumentNotification=te.DidSaveNotebookDocumentNotification=te.DidChangeNotebookDocumentNotification=te.NotebookCellArrayChange=te.DidOpenNotebookDocumentNotification=te.NotebookDocumentSyncRegistrationType=te.NotebookDocument=te.NotebookCell=te.ExecutionSummary=te.NotebookCellKind=void 0;const bn=so,Ne=ee,$e=H;var co;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(co||(te.NotebookCellKind=co={}));var ao;(function(t){function e(i,o){const c={executionOrder:i};return(o===!0||o===!1)&&(c.success=o),c}t.create=e;function n(i){const o=i;return Ne.objectLiteral(o)&&bn.uinteger.is(o.executionOrder)&&(o.success===void 0||Ne.boolean(o.success))}t.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=r})(ao||(te.ExecutionSummary=ao={}));var sr;(function(t){function e(o,c){return{kind:o,document:c}}t.create=e;function n(o){const c=o;return Ne.objectLiteral(c)&&co.is(c.kind)&&bn.DocumentUri.is(c.document)&&(c.metadata===void 0||Ne.objectLiteral(c.metadata))}t.is=n;function r(o,c){const d=new Set;return o.document!==c.document&&d.add("document"),o.kind!==c.kind&&d.add("kind"),o.executionSummary!==c.executionSummary&&d.add("executionSummary"),(o.metadata!==void 0||c.metadata!==void 0)&&!i(o.metadata,c.metadata)&&d.add("metadata"),(o.executionSummary!==void 0||c.executionSummary!==void 0)&&!ao.equals(o.executionSummary,c.executionSummary)&&d.add("executionSummary"),d}t.diff=r;function i(o,c){if(o===c)return!0;if(o==null||c===null||c===void 0||typeof o!=typeof c||typeof o!="object")return!1;const d=Array.isArray(o),f=Array.isArray(c);if(d!==f)return!1;if(d&&f){if(o.length!==c.length)return!1;for(let _=0;_0}a.hasId=ce})(Tr||(t.StaticRegistrationOptions=Tr={}));var Pr;(function(a){function ce(ae){const E=ae;return E&&(E.documentSelector===null||wn.is(E.documentSelector))}a.is=ce})(Pr||(t.TextDocumentRegistrationOptions=Pr={}));var kr;(function(a){function ce(E){const u=E;return r.objectLiteral(u)&&(u.workDoneProgress===void 0||r.boolean(u.workDoneProgress))}a.is=ce;function ae(E){const u=E;return u&&r.boolean(u.workDoneProgress)}a.hasWorkDoneProgress=ae})(kr||(t.WorkDoneProgressOptions=kr={}));var ft;(function(a){a.method="initialize",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ft||(t.InitializeRequest=ft={}));var gt;(function(a){a.unknownProtocolVersion=1})(gt||(t.InitializeErrorCodes=gt={}));var Tt;(function(a){a.method="initialized",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Tt||(t.InitializedNotification=Tt={}));var _t;(function(a){a.method="shutdown",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType0(a.method)})(_t||(t.ShutdownRequest=_t={}));var Pt;(function(a){a.method="exit",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType0(a.method)})(Pt||(t.ExitNotification=Pt={}));var kt;(function(a){a.method="workspace/didChangeConfiguration",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(kt||(t.DidChangeConfigurationNotification=kt={}));var Qt;(function(a){a.Error=1,a.Warning=2,a.Info=3,a.Log=4,a.Debug=5})(Qt||(t.MessageType=Qt={}));var He;(function(a){a.method="window/showMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(He||(t.ShowMessageNotification=He={}));var xe;(function(a){a.method="window/showMessageRequest",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(xe||(t.ShowMessageRequest=xe={}));var St;(function(a){a.method="window/logMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(St||(t.LogMessageNotification=St={}));var Oe;(function(a){a.method="telemetry/event",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(Oe||(t.TelemetryEventNotification=Oe={}));var U;(function(a){a.None=0,a.Full=1,a.Incremental=2})(U||(t.TextDocumentSyncKind=U={}));var ze;(function(a){a.method="textDocument/didOpen",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(ze||(t.DidOpenTextDocumentNotification=ze={}));var ne;(function(a){function ce(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range!==void 0&&(u.rangeLength===void 0||typeof u.rangeLength=="number")}a.isIncremental=ce;function ae(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range===void 0&&u.rangeLength===void 0}a.isFull=ae})(ne||(t.TextDocumentContentChangeEvent=ne={}));var je;(function(a){a.method="textDocument/didChange",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(je||(t.DidChangeTextDocumentNotification=je={}));var Kt;(function(a){a.method="textDocument/didClose",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Kt||(t.DidCloseTextDocumentNotification=Kt={}));var pn;(function(a){a.method="textDocument/didSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(pn||(t.DidSaveTextDocumentNotification=pn={}));var yn;(function(a){a.Manual=1,a.AfterDelay=2,a.FocusOut=3})(yn||(t.TextDocumentSaveReason=yn={}));var vn;(function(a){a.method="textDocument/willSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(vn||(t.WillSaveTextDocumentNotification=vn={}));var Rn;(function(a){a.method="textDocument/willSaveWaitUntil",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Rn||(t.WillSaveTextDocumentWaitUntilRequest=Rn={}));var Fe;(function(a){a.method="workspace/didChangeWatchedFiles",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Fe||(t.DidChangeWatchedFilesNotification=Fe={}));var Dn;(function(a){a.Created=1,a.Changed=2,a.Deleted=3})(Dn||(t.FileChangeType=Dn={}));var Sr;(function(a){function ce(ae){const E=ae;return r.objectLiteral(E)&&(n.URI.is(E.baseUri)||n.WorkspaceFolder.is(E.baseUri))&&r.string(E.pattern)}a.is=ce})(Sr||(t.RelativePattern=Sr={}));var Cr;(function(a){a.Create=1,a.Change=2,a.Delete=4})(Cr||(t.WatchKind=Cr={}));var qr;(function(a){a.method="textDocument/publishDiagnostics",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(qr||(t.PublishDiagnosticsNotification=qr={}));var Mr;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.TriggerForIncompleteCompletions=3})(Mr||(t.CompletionTriggerKind=Mr={}));var Tn;(function(a){a.method="textDocument/completion",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Tn||(t.CompletionRequest=Tn={}));var Pn;(function(a){a.method="completionItem/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Pn||(t.CompletionResolveRequest=Pn={}));var Ye;(function(a){a.method="textDocument/hover",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ye||(t.HoverRequest=Ye={}));var kn;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.ContentChange=3})(kn||(t.SignatureHelpTriggerKind=kn={}));var Or;(function(a){a.method="textDocument/signatureHelp",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Or||(t.SignatureHelpRequest=Or={}));var Er;(function(a){a.method="textDocument/definition",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Er||(t.DefinitionRequest=Er={}));var Sn;(function(a){a.method="textDocument/references",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Sn||(t.ReferencesRequest=Sn={}));var Cn;(function(a){a.method="textDocument/documentHighlight",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Cn||(t.DocumentHighlightRequest=Cn={}));var Nr;(function(a){a.method="textDocument/documentSymbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Nr||(t.DocumentSymbolRequest=Nr={}));var jr;(function(a){a.method="textDocument/codeAction",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(jr||(t.CodeActionRequest=jr={}));var Fr;(function(a){a.method="codeAction/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Fr||(t.CodeActionResolveRequest=Fr={}));var Ir;(function(a){a.method="workspace/symbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ir||(t.WorkspaceSymbolRequest=Ir={}));var Ar;(function(a){a.method="workspaceSymbol/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ar||(t.WorkspaceSymbolResolveRequest=Ar={}));var Lr;(function(a){a.method="textDocument/codeLens",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Lr||(t.CodeLensRequest=Lr={}));var Ie;(function(a){a.method="codeLens/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ie||(t.CodeLensResolveRequest=Ie={}));var Wr;(function(a){a.method="workspace/codeLens/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(Wr||(t.CodeLensRefreshRequest=Wr={}));var $r;(function(a){a.method="textDocument/documentLink",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})($r||(t.DocumentLinkRequest=$r={}));var Ct;(function(a){a.method="documentLink/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ct||(t.DocumentLinkResolveRequest=Ct={}));var Hr;(function(a){a.method="textDocument/formatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Hr||(t.DocumentFormattingRequest=Hr={}));var Yt;(function(a){a.method="textDocument/rangeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Yt||(t.DocumentRangeFormattingRequest=Yt={}));var xr;(function(a){a.method="textDocument/rangesFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(xr||(t.DocumentRangesFormattingRequest=xr={}));var Ge;(function(a){a.method="textDocument/onTypeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ge||(t.DocumentOnTypeFormattingRequest=Ge={}));var bt;(function(a){a.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var zr;(function(a){a.method="textDocument/rename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(zr||(t.RenameRequest=zr={}));var Br;(function(a){a.method="textDocument/prepareRename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Br||(t.PrepareRenameRequest=Br={}));var ht;(function(a){a.method="workspace/executeCommand",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ht||(t.ExecuteCommandRequest=ht={}));var qn;(function(a){a.method="workspace/applyEdit",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType("workspace/applyEdit")})(qn||(t.ApplyWorkspaceEditRequest=qn={}))}(Xo);var ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.createProtocolConnection=void 0;const cc=wt;function lu(t,e,n,r){return cc.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,cc.createMessageConnection)(t,e,n,r)}ar.createProtocolConnection=lu,function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(wt,t),n(so,t),n(H,t),n(Xo,t);var r=ar;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Vo),function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Bo;n(Bo,t),n(Vo,t);function i(o,c,d,f){return(0,r.createMessageConnection)(o,c,d,f)}t.createProtocolConnection=i}(ie),Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SemanticTokensBuilder=Ue.SemanticTokensDiff=Ue.SemanticTokensFeature=void 0;const ur=ie,fu=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ur.SemanticTokensRefreshRequest.type),on:e=>{const n=ur.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{const n=ur.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{const n=ur.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ue.SemanticTokensFeature=fu;class ac{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){const e=this.originalSequence.length,n=this.modifiedSequence.length;let r=0;for(;r=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i0&&(c-=this._prevLine,c===0&&(d-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=d,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new ac(this._prevData,this._data).computeDiff()}:this.build()}}Ue.SemanticTokensBuilder=gu;var dr={};Object.defineProperty(dr,"__esModule",{value:!0}),dr.InlineCompletionFeature=void 0;const _u=ie,bu=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(_u.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};dr.InlineCompletionFeature=bu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.TextDocuments=void 0;const Rt=ie;class hu{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Rt.Emitter,this._onDidOpen=new Rt.Emitter,this._onDidClose=new Rt.Emitter,this._onDidSave=new Rt.Emitter,this._onWillSave=new Rt.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Rt.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);const c=Object.freeze({document:o});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,o=r.contentChanges;if(o.length===0)return;const{version:c}=i;if(c==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let d=this._syncedDocuments.get(i.uri);d!==void 0&&(d=this._configuration.update(d,o,c),this._syncedDocuments.set(i.uri,d),this._onDidChangeContent.fire(Object.freeze({document:d})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Rt.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}hn.TextDocuments=hu;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NotebookDocuments=Dt.NotebookSyncFeature=void 0;const qe=ie,uc=hn,mu=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(qe.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(qe.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(qe.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(qe.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Dt.NotebookSyncFeature=mu;class Vt{onDidOpenTextDocument(e){return this.openHandler=e,qe.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qe.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qe.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Vt.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Vt.NULL_DISPOSE}onDidSaveTextDocument(){return Vt.NULL_DISPOSE}}Vt.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class wu{constructor(e){e instanceof uc.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new uc.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qe.Emitter,this._onDidChange=new qe.Emitter,this._onDidSave=new qe.Emitter,this._onDidClose=new qe.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){const n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const n=new Vt,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;const c=o.metadata;let d=!1;const f=i.change;f.metadata!==void 0&&(d=!0,o.metadata=f.metadata);const _=[],w=[],P=[],v=[];if(f.cells!==void 0){const $=f.cells;if($.structure!==void 0){const b=$.structure.array;if(o.cells.splice(b.start,b.deleteCount,...b.cells!==void 0?b.cells:[]),$.structure.didOpen!==void 0)for(const h of $.structure.didOpen)n.openTextDocument({textDocument:h}),_.push(h.uri);if($.structure.didClose)for(const h of $.structure.didClose)n.closeTextDocument({textDocument:h}),w.push(h.uri)}if($.data!==void 0){const b=new Map($.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){const T=b.get(o.cells[h].document);if(T!==void 0){const ge=o.cells.splice(h,1,T);if(P.push({old:ge[0],new:T}),b.delete(T.document),b.size===0)break}}}if($.textContent!==void 0)for(const b of $.textContent)n.changeTextDocument({textDocument:b.document,contentChanges:b.changes}),v.push(b.document.uri)}this.updateCellMap(o);const M={notebookDocument:o};d&&(M.metadata={old:c,new:o.metadata});const W=[];for(const $ of _)W.push(this.getNotebookCell($));const be=[];for(const $ of w)be.push(this.getNotebookCell($));const me=[];for(const $ of v)me.push(this.getNotebookCell($));(W.length>0||be.length>0||P.length>0||me.length>0)&&(M.cells={added:W,removed:be,changed:{data:P,textContent:me}}),(M.metadata!==void 0||M.cells!==void 0)&&this._onDidChange.fire(M)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(const c of i.cellTextDocuments)n.closeTextDocument({textDocument:c});this.notebookDocuments.delete(i.notebookDocument.uri);for(const c of o.cells)this.notebookCellMap.delete(c.document)}})),qe.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}Dt.NotebookDocuments=wu;var z={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.thenable=oe.typedArray=oe.stringArray=oe.array=oe.func=oe.error=oe.number=oe.string=oe.boolean=void 0;function pu(t){return t===!0||t===!1}oe.boolean=pu;function dc(t){return typeof t=="string"||t instanceof String}oe.string=dc;function yu(t){return typeof t=="number"||t instanceof Number}oe.number=yu;function vu(t){return t instanceof Error}oe.error=vu;function lc(t){return typeof t=="function"}oe.func=lc;function fc(t){return Array.isArray(t)}oe.array=fc;function Ru(t){return fc(t)&&t.every(e=>dc(e))}oe.stringArray=Ru;function Du(t,e){return Array.isArray(t)&&t.every(e)}oe.typedArray=Du;function Tu(t){return t&&lc(t.then)}oe.thenable=Tu;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.generateUuid=Pe.parse=Pe.isUUID=Pe.v4=Pe.empty=void 0;class uo{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class L extends uo{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return L._oneOf(L._chars)}constructor(){super([L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-","4",L._randomHex(),L._randomHex(),L._randomHex(),"-",L._oneOf(L._timeHighBits),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex()].join(""))}}L._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],L._timeHighBits=["8","9","a","b"],Pe.empty=new uo("00000000-0000-0000-0000-000000000000");function gc(){return new L}Pe.v4=gc;const Pu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _c(t){return Pu.test(t)}Pe.isUUID=_c;function ku(t){if(!_c(t))throw new Error("invalid uuid");return new uo(t)}Pe.parse=ku;function Su(){return gc().asHex()}Pe.generateUuid=Su;var at={};Object.defineProperty(at,"__esModule",{value:!0}),at.attachPartialResult=at.ProgressFeature=at.attachWorkDone=void 0;const ut=ie,Cu=Pe;class dt{constructor(e,n){this._connection=e,this._token=n,dt.Instances.set(this._token,this)}begin(e,n,r,i){let o={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,o)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,r)}done(){dt.Instances.delete(this._token),this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,{kind:"end"})}}dt.Instances=new Map;class bc extends dt{constructor(e,n){super(e,n),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class lo{constructor(){}begin(){}report(){}done(){}}class hc extends lo{constructor(){super(),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function qu(t,e){if(e===void 0||e.workDoneToken===void 0)return new lo;const n=e.workDoneToken;return delete e.workDoneToken,new dt(t,n)}at.attachWorkDone=qu;const Mu=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ut.WorkDoneProgressCancelNotification.type,n=>{let r=dt.Instances.get(n.token);(r instanceof bc||r instanceof hc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new lo:new dt(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Cu.generateUuid)();return this.connection.sendRequest(ut.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bc(this.connection,e))}else return Promise.resolve(new hc)}};at.ProgressFeature=Mu;var fo;(function(t){t.type=new ut.ProgressType})(fo||(fo={}));class Ou{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(fo.type,this._token,e)}}function Eu(t,e){if(e===void 0||e.partialResultToken===void 0)return;const n=e.partialResultToken;return delete e.partialResultToken,new Ou(t,n)}at.attachPartialResult=Eu;var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.ConfigurationFeature=void 0;const Nu=ie,ju=oe,Fu=t=>class extends t{getConfiguration(e){return e?ju.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Nu.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};lr.ConfigurationFeature=Fu;var fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.WorkspaceFoldersFeature=void 0;const gr=ie,Iu=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new gr.Emitter,this.connection.onNotification(gr.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);const n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(gr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(gr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};fr.WorkspaceFoldersFeature=Iu;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.CallHierarchyFeature=void 0;const go=ie,Au=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(go.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{const n=go.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{const n=go.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};_r.CallHierarchyFeature=Au;var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.ShowDocumentFeature=void 0;const Lu=ie,Wu=t=>class extends t{showDocument(e){return this.connection.sendRequest(Lu.ShowDocumentRequest.type,e)}};br.ShowDocumentFeature=Wu;var hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.FileOperationsFeature=void 0;const Ut=ie,$u=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ut.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ut.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ut.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ut.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ut.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ut.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};hr.FileOperationsFeature=$u;var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.LinkedEditingRangeFeature=void 0;const Hu=ie,xu=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Hu.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};mr.LinkedEditingRangeFeature=xu;var wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.TypeHierarchyFeature=void 0;const _o=ie,zu=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(_o.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{const n=_o.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{const n=_o.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wr.TypeHierarchyFeature=zu;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.InlineValueFeature=void 0;const mc=ie,Bu=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(mc.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(mc.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};pr.InlineValueFeature=Bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.FoldingRangeFeature=void 0;const wc=ie,Vu=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(wc.FoldingRangeRefreshRequest.type),on:e=>{const n=wc.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};yr.FoldingRangeFeature=Vu;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.InlayHintFeature=void 0;const bo=ie,Uu=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(bo.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(bo.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(bo.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};vr.InlayHintFeature=Uu;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.DiagnosticFeature=void 0;const mn=ie,Ju=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(mn.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(mn.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(mn.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.WorkspaceDiagnosticRequest.partialResult,n)))}}};Rr.DiagnosticFeature=Ju;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.MonikerFeature=void 0;const Xu=ie,Qu=t=>class extends t{get moniker(){return{on:e=>{const n=Xu.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Dr.MonikerFeature=Qu,Object.defineProperty(z,"__esModule",{value:!0}),z.createConnection=z.combineFeatures=z.combineNotebooksFeatures=z.combineLanguagesFeatures=z.combineWorkspaceFeatures=z.combineWindowFeatures=z.combineClientFeatures=z.combineTracerFeatures=z.combineTelemetryFeatures=z.combineConsoleFeatures=z._NotebooksImpl=z._LanguagesImpl=z.BulkUnregistration=z.BulkRegistration=z.ErrorMessageTracker=void 0;const D=ie,Me=oe,ho=Pe,N=at,Ku=lr,Yu=fr,Gu=_r,Zu=Ue,ed=br,td=hr,nd=mr,rd=wr,id=pr,od=yr,sd=vr,cd=Rr,ad=Dt,ud=Dr;function mo(t){if(t!==null)return t}class dd{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}}z.ErrorMessageTracker=dd;class pc{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(D.MessageType.Error,e)}warn(e){this.send(D.MessageType.Warning,e)}info(e){this.send(D.MessageType.Info,e)}log(e){this.send(D.MessageType.Log,e)}debug(e){this.send(D.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(D.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,D.RAL)().console.error("Sending log message failed")})}}class ld{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:D.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showWarningMessage(e,...n){let r={type:D.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showInformationMessage(e,...n){let r={type:D.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}}const yc=(0,ed.ShowDocumentFeature)((0,N.ProgressFeature)(ld));var vc;(function(t){function e(){return new Rc}t.create=e})(vc||(z.BulkRegistration=vc={}));class Rc{constructor(){this._registrations=[],this._registered=new Set}add(e,n){const r=Me.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);const i=ho.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}}var Dc;(function(t){function e(){return new wo(void 0,[])}t.create=e})(Dc||(z.BulkUnregistration=Dc={}));class wo{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(D.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){const n=Me.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(D.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}}class Tc{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Rc?this.registerMany(e):e instanceof wo?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){const i=Me.string(n)?n:n.method,o=ho.generateUuid();let c={registrations:[{id:o,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(D.RegistrationRequest.type,c).then(d=>(e.add({id:o,method:i}),e),d=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(d)))}registerSingle2(e,n){const r=Me.string(e)?e:e.method,i=ho.generateUuid();let o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(D.RegistrationRequest.type,o).then(c=>D.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(c)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(D.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(D.RegistrationRequest.type,n).then(()=>new wo(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}}class fd{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(D.ApplyWorkspaceEditRequest.type,r)}}const Pc=(0,td.FileOperationsFeature)((0,Yu.WorkspaceFoldersFeature)((0,Ku.ConfigurationFeature)(fd)));class kc{constructor(){this._trace=D.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==D.Trace.Off&&this.connection.sendNotification(D.LogTraceNotification.type,{message:e,verbose:this._trace===D.Trace.Verbose?n:void 0}).catch(()=>{})}}class Sc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(D.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class Cc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._LanguagesImpl=Cc;const qc=(0,od.FoldingRangeFeature)((0,ud.MonikerFeature)((0,cd.DiagnosticFeature)((0,sd.InlayHintFeature)((0,id.InlineValueFeature)((0,rd.TypeHierarchyFeature)((0,nd.LinkedEditingRangeFeature)((0,Zu.SemanticTokensFeature)((0,Gu.CallHierarchyFeature)(Cc)))))))));class Mc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._NotebooksImpl=Mc;const Oc=(0,ad.NotebookSyncFeature)(Mc);function Ec(t,e){return function(n){return e(t(n))}}z.combineConsoleFeatures=Ec;function Nc(t,e){return function(n){return e(t(n))}}z.combineTelemetryFeatures=Nc;function jc(t,e){return function(n){return e(t(n))}}z.combineTracerFeatures=jc;function Fc(t,e){return function(n){return e(t(n))}}z.combineClientFeatures=Fc;function Ic(t,e){return function(n){return e(t(n))}}z.combineWindowFeatures=Ic;function Ac(t,e){return function(n){return e(t(n))}}z.combineWorkspaceFeatures=Ac;function Lc(t,e){return function(n){return e(t(n))}}z.combineLanguagesFeatures=Lc;function Wc(t,e){return function(n){return e(t(n))}}z.combineNotebooksFeatures=Wc;function gd(t,e){function n(i,o,c){return i&&o?c(i,o):i||o}return{__brand:"features",console:n(t.console,e.console,Ec),tracer:n(t.tracer,e.tracer,jc),telemetry:n(t.telemetry,e.telemetry,Nc),client:n(t.client,e.client,Fc),window:n(t.window,e.window,Ic),workspace:n(t.workspace,e.workspace,Ac),languages:n(t.languages,e.languages,Lc),notebooks:n(t.notebooks,e.notebooks,Wc)}}z.combineFeatures=gd;function _d(t,e,n){const r=n&&n.console?new(n.console(pc)):new pc,i=t(r);r.rawAttach(i);const o=n&&n.tracer?new(n.tracer(kc)):new kc,c=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,d=n&&n.client?new(n.client(Tc)):new Tc,f=n&&n.window?new(n.window(yc)):new yc,_=n&&n.workspace?new(n.workspace(Pc)):new Pc,w=n&&n.languages?new(n.languages(qc)):new qc,P=n&&n.notebooks?new(n.notebooks(Oc)):new Oc,v=[r,o,c,d,f,_,w,P];function M(b){return b instanceof Promise?b:Me.thenable(b)?new Promise((h,T)=>{b.then(ge=>h(ge),ge=>T(ge))}):Promise.resolve(b)}let W,be,me,$={listen:()=>i.listen(),sendRequest:(b,...h)=>i.sendRequest(Me.string(b)?b:b.method,...h),onRequest:(b,h)=>i.onRequest(b,h),sendNotification:(b,h)=>{const T=Me.string(b)?b:b.method;return i.sendNotification(T,h)},onNotification:(b,h)=>i.onNotification(b,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:b=>(be=b,{dispose:()=>{be=void 0}}),onInitialized:b=>i.onNotification(D.InitializedNotification.type,b),onShutdown:b=>(W=b,{dispose:()=>{W=void 0}}),onExit:b=>(me=b,{dispose:()=>{me=void 0}}),get console(){return r},get telemetry(){return c},get tracer(){return o},get client(){return d},get window(){return f},get workspace(){return _},get languages(){return w},get notebooks(){return P},onDidChangeConfiguration:b=>i.onNotification(D.DidChangeConfigurationNotification.type,b),onDidChangeWatchedFiles:b=>i.onNotification(D.DidChangeWatchedFilesNotification.type,b),__textDocumentSync:void 0,onDidOpenTextDocument:b=>i.onNotification(D.DidOpenTextDocumentNotification.type,b),onDidChangeTextDocument:b=>i.onNotification(D.DidChangeTextDocumentNotification.type,b),onDidCloseTextDocument:b=>i.onNotification(D.DidCloseTextDocumentNotification.type,b),onWillSaveTextDocument:b=>i.onNotification(D.WillSaveTextDocumentNotification.type,b),onWillSaveTextDocumentWaitUntil:b=>i.onRequest(D.WillSaveTextDocumentWaitUntilRequest.type,b),onDidSaveTextDocument:b=>i.onNotification(D.DidSaveTextDocumentNotification.type,b),sendDiagnostics:b=>i.sendNotification(D.PublishDiagnosticsNotification.type,b),onHover:b=>i.onRequest(D.HoverRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onCompletion:b=>i.onRequest(D.CompletionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCompletionResolve:b=>i.onRequest(D.CompletionResolveRequest.type,b),onSignatureHelp:b=>i.onRequest(D.SignatureHelpRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDeclaration:b=>i.onRequest(D.DeclarationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDefinition:b=>i.onRequest(D.DefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onTypeDefinition:b=>i.onRequest(D.TypeDefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onImplementation:b=>i.onRequest(D.ImplementationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onReferences:b=>i.onRequest(D.ReferencesRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentHighlight:b=>i.onRequest(D.DocumentHighlightRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentSymbol:b=>i.onRequest(D.DocumentSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbol:b=>i.onRequest(D.WorkspaceSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:b=>i.onRequest(D.WorkspaceSymbolResolveRequest.type,b),onCodeAction:b=>i.onRequest(D.CodeActionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeActionResolve:b=>i.onRequest(D.CodeActionResolveRequest.type,(h,T)=>b(h,T)),onCodeLens:b=>i.onRequest(D.CodeLensRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeLensResolve:b=>i.onRequest(D.CodeLensResolveRequest.type,(h,T)=>b(h,T)),onDocumentFormatting:b=>i.onRequest(D.DocumentFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:b=>i.onRequest(D.DocumentRangeFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:b=>i.onRequest(D.DocumentOnTypeFormattingRequest.type,(h,T)=>b(h,T)),onRenameRequest:b=>i.onRequest(D.RenameRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onPrepareRename:b=>i.onRequest(D.PrepareRenameRequest.type,(h,T)=>b(h,T)),onDocumentLinks:b=>i.onRequest(D.DocumentLinkRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentLinkResolve:b=>i.onRequest(D.DocumentLinkResolveRequest.type,(h,T)=>b(h,T)),onDocumentColor:b=>i.onRequest(D.DocumentColorRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onColorPresentation:b=>i.onRequest(D.ColorPresentationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onFoldingRanges:b=>i.onRequest(D.FoldingRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onSelectionRanges:b=>i.onRequest(D.SelectionRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onExecuteCommand:b=>i.onRequest(D.ExecuteCommandRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let b of v)b.attach($);return i.onRequest(D.InitializeRequest.type,b=>{e.initialize(b),Me.string(b.trace)&&(o.trace=D.Trace.fromString(b.trace));for(let h of v)h.initialize(b.capabilities);if(be){let h=be(b,new D.CancellationTokenSource().token,(0,N.attachWorkDone)(i,b),void 0);return M(h).then(T=>{if(T instanceof D.ResponseError)return T;let ge=T;ge||(ge={capabilities:{}});let se=ge.capabilities;se||(se={},ge.capabilities=se),se.textDocumentSync===void 0||se.textDocumentSync===null?se.textDocumentSync=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None:!Me.number(se.textDocumentSync)&&!Me.number(se.textDocumentSync.change)&&(se.textDocumentSync.change=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None);for(let we of v)we.fillServerCapabilities(se);return ge})}else{let h={capabilities:{textDocumentSync:D.TextDocumentSyncKind.None}};for(let T of v)T.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(D.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,W)return W(new D.CancellationTokenSource().token)}),i.onNotification(D.ExitNotification.type,()=>{try{me&&me()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(D.SetTraceNotification.type,b=>{o.trace=D.Trace.fromString(b.value)}),$}z.createConnection=_d,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,P){P===void 0&&(P=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,P,v)}:function(f,_,w,P){P===void 0&&(P=w),f[P]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Ue;Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=dr;n(ie,t);const o=hn;Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const c=Dt;Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),n(z,t);var d;(function(f){f.all={__brand:"features",languages:i.InlineCompletionFeature}})(d||(t.ProposedFeatures=d={}))}(Xr);var bd=ie;(function(t){var e=de&&de.__createBinding||(Object.create?function(d,f,_,w){w===void 0&&(w=_);var P=Object.getOwnPropertyDescriptor(f,_);(!P||("get"in P?!f.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(d,w,P)}:function(d,f,_,w){w===void 0&&(w=_),d[w]=f[_]}),n=de&&de.__exportStar||function(d,f){for(var _ in d)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&e(f,d,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=void 0;const r=Xr;n(bd,t),n(Xr,t);let i=!1;const o={initialize:d=>{},get shutdownReceived(){return i},set shutdownReceived(d){i=d},exit:d=>{}};function c(d,f,_,w){let P,v,M,W;d!==void 0&&d.__brand==="features"&&(P=d,d=f,f=_,_=w),r.ConnectionStrategy.is(d)||r.ConnectionOptions.is(d)?W=d:(v=d,M=f,W=_);const be=me=>(0,r.createProtocolConnection)(v,M,me,W);return(0,r.createConnection)(be,o,P)}t.createConnection=c})(ko);var po=ko;Po().then(()=>{const t=new po.BrowserMessageReader(self),e=new po.BrowserMessageWriter(self);let n;const r=po.createConnection(t,e);function i(d,f){return r.sendNotification(d,f),!0}async function o(d,f){return await r.sendRequest(d,f)}async function c(d){return await r.sendRequest("slint/load_file",d)}r.onInitialize(d=>(n=xc(d,i,o,c),n.server_initialize_result(d.capabilities))),r.onRequest(async(d,f,_)=>await n.handle_request(_,d,f)),r.onNotification("slint/preview_to_lsp",async d=>{await n.process_preview_to_lsp_message(d)}),r.onDidChangeTextDocument(async d=>{await n.reload_document(d.contentChanges[d.contentChanges.length-1].text,d.textDocument.uri,d.textDocument.version)}),r.onDidOpenTextDocument(async d=>{await n.reload_document(d.textDocument.text,d.textDocument.uri,d.textDocument.version)}),r.onDidChangeConfiguration(async d=>{await n.reload_config()}),r.listen(),self.postMessage("OK")})})(); +`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ke.create(0,e);for(;re?i=c:r=c+1}let o=r-1;return ke.create(o,e-n[o])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(M){return M===!0||M===!1}t.boolean=i;function o(M){return e.call(M)==="[object String]"}t.string=o;function c(M){return e.call(M)==="[object Number]"}t.number=c;function d(M,W,be){return e.call(M)==="[object Number]"&&W<=M&&M<=be}t.numberRange=d;function f(M){return e.call(M)==="[object Number]"&&-2147483648<=M&&M<=2147483647}t.integer=f;function _(M){return e.call(M)==="[object Number]"&&0<=M&&M<=2147483647}t.uinteger=_;function w(M){return e.call(M)==="[object Function]"}t.func=w;function P(M){return M!==null&&typeof M=="object"}t.objectLiteral=P;function v(M,W){return Array.isArray(M)&&M.every(W)}t.typedArray=v})(l||(l={}));var Ya=Object.freeze({__proto__:null,get AnnotatedTextEdit(){return Qe},get ChangeAnnotation(){return vt},get ChangeAnnotationIdentifier(){return he},get CodeAction(){return Wi},get CodeActionContext(){return Li},get CodeActionKind(){return Ai},get CodeActionTriggerKind(){return gn},get CodeDescription(){return bi},get CodeLens(){return $i},get Color(){return Hn},get ColorInformation(){return ui},get ColorPresentation(){return di},get Command(){return yt},get CompletionItem(){return Pi},get CompletionItemKind(){return pi},get CompletionItemLabelDetails(){return Ti},get CompletionItemTag(){return vi},get CompletionList(){return ki},get CreateFile(){return Ot},get DeleteFile(){return Nt},get Diagnostic(){return un},get DiagnosticRelatedInformation(){return xn},get DiagnosticSeverity(){return gi},get DiagnosticTag(){return _i},get DocumentHighlight(){return Oi},get DocumentHighlightKind(){return Mi},get DocumentLink(){return xi},get DocumentSymbol(){return Ii},get DocumentUri(){return si},EOL:Xa,get FoldingRange(){return fi},get FoldingRangeKind(){return li},get FormattingOptions(){return Hi},get Hover(){return Si},get InlayHint(){return Ki},get InlayHintKind(){return Un},get InlayHintLabelPart(){return Jn},get InlineCompletionContext(){return ro},get InlineCompletionItem(){return Zi},get InlineCompletionList(){return eo},get InlineCompletionTriggerKind(){return to},get InlineValueContext(){return Yi},get InlineValueEvaluatableExpression(){return Qi},get InlineValueText(){return Ji},get InlineValueVariableLookup(){return Xi},get InsertReplaceEdit(){return Ri},get InsertTextFormat(){return yi},get InsertTextMode(){return Di},get Location(){return an},get LocationLink(){return ai},get MarkedString(){return fn},get MarkupContent(){return jt},get MarkupKind(){return Vn},get OptionalVersionedTextDocumentIdentifier(){return ln},get ParameterInformation(){return Ci},get Position(){return ke},get Range(){return Z},get RenameFile(){return Et},get SelectedCompletionInfo(){return no},get SelectionRange(){return zi},get SemanticTokenModifiers(){return Vi},get SemanticTokenTypes(){return Bi},get SemanticTokens(){return Ui},get SignatureInformation(){return qi},get StringValue(){return Gi},get SymbolInformation(){return ji},get SymbolKind(){return Ei},get SymbolTag(){return Ni},get TextDocument(){return oo},get TextDocumentEdit(){return dn},get TextDocumentIdentifier(){return hi},get TextDocumentItem(){return wi},get TextEdit(){return We},get URI(){return $n},get VersionedTextDocumentIdentifier(){return mi},WorkspaceChange:Ja,get WorkspaceEdit(){return zn},get WorkspaceFolder(){return io},get WorkspaceSymbol(){return Fi},get integer(){return ci},get uinteger(){return cn}}),so=Jc(Ya),H={};Object.defineProperty(H,"__esModule",{value:!0}),H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const Ft=wt;var Jo;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Jo||(H.MessageDirection=Jo={}));class Ka{constructor(e){this.method=e}}H.RegistrationType=Ka;class Ga extends Ft.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=Ga;class Za extends Ft.RequestType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolRequestType=Za;class eu extends Ft.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=eu;class tu extends Ft.NotificationType{constructor(e){super(e,Ft.ParameterStructures.byName)}}H.ProtocolNotificationType=tu;var Xo={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.objectLiteral=ee.typedArray=ee.stringArray=ee.array=ee.func=ee.error=ee.number=ee.string=ee.boolean=void 0;function nu(t){return t===!0||t===!1}ee.boolean=nu;function Qo(t){return typeof t=="string"||t instanceof String}ee.string=Qo;function ru(t){return typeof t=="number"||t instanceof Number}ee.number=ru;function iu(t){return t instanceof Error}ee.error=iu;function ou(t){return typeof t=="function"}ee.func=ou;function Yo(t){return Array.isArray(t)}ee.array=Yo;function su(t){return Yo(t)&&t.every(e=>Qo(e))}ee.stringArray=su;function cu(t,e){return Array.isArray(t)&&t.every(e)}ee.typedArray=cu;function au(t){return t!==null&&typeof t=="object"}ee.objectLiteral=au;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ImplementationRequest=void 0;const Ko=H;var Go;(function(t){t.method="textDocument/implementation",t.messageDirection=Ko.MessageDirection.clientToServer,t.type=new Ko.ProtocolRequestType(t.method)})(Go||(Xn.ImplementationRequest=Go={}));var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.TypeDefinitionRequest=void 0;const Zo=H;var es;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(es||(Qn.TypeDefinitionRequest=es={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.DidChangeWorkspaceFoldersNotification=It.WorkspaceFoldersRequest=void 0;const Yn=H;var ts;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Yn.MessageDirection.serverToClient,t.type=new Yn.ProtocolRequestType0(t.method)})(ts||(It.WorkspaceFoldersRequest=ts={}));var ns;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Yn.MessageDirection.clientToServer,t.type=new Yn.ProtocolNotificationType(t.method)})(ns||(It.DidChangeWorkspaceFoldersNotification=ns={}));var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.ConfigurationRequest=void 0;const rs=H;var is;(function(t){t.method="workspace/configuration",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(is||(Kn.ConfigurationRequest=is={}));var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.ColorPresentationRequest=At.DocumentColorRequest=void 0;const Gn=H;var os;(function(t){t.method="textDocument/documentColor",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(os||(At.DocumentColorRequest=os={}));var ss;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Gn.MessageDirection.clientToServer,t.type=new Gn.ProtocolRequestType(t.method)})(ss||(At.ColorPresentationRequest=ss={}));var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.FoldingRangeRefreshRequest=Lt.FoldingRangeRequest=void 0;const Zn=H;var cs;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Zn.MessageDirection.clientToServer,t.type=new Zn.ProtocolRequestType(t.method)})(cs||(Lt.FoldingRangeRequest=cs={}));var as;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Zn.MessageDirection.serverToClient,t.type=new Zn.ProtocolRequestType0(t.method)})(as||(Lt.FoldingRangeRefreshRequest=as={}));var er={};Object.defineProperty(er,"__esModule",{value:!0}),er.DeclarationRequest=void 0;const us=H;var ds;(function(t){t.method="textDocument/declaration",t.messageDirection=us.MessageDirection.clientToServer,t.type=new us.ProtocolRequestType(t.method)})(ds||(er.DeclarationRequest=ds={}));var tr={};Object.defineProperty(tr,"__esModule",{value:!0}),tr.SelectionRangeRequest=void 0;const ls=H;var fs;(function(t){t.method="textDocument/selectionRange",t.messageDirection=ls.MessageDirection.clientToServer,t.type=new ls.ProtocolRequestType(t.method)})(fs||(tr.SelectionRangeRequest=fs={}));var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.WorkDoneProgressCancelNotification=rt.WorkDoneProgressCreateRequest=rt.WorkDoneProgress=void 0;const uu=wt,nr=H;var gs;(function(t){t.type=new uu.ProgressType;function e(n){return n===t.type}t.is=e})(gs||(rt.WorkDoneProgress=gs={}));var _s;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=nr.MessageDirection.serverToClient,t.type=new nr.ProtocolRequestType(t.method)})(_s||(rt.WorkDoneProgressCreateRequest=_s={}));var bs;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=nr.MessageDirection.clientToServer,t.type=new nr.ProtocolNotificationType(t.method)})(bs||(rt.WorkDoneProgressCancelNotification=bs={}));var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.CallHierarchyOutgoingCallsRequest=it.CallHierarchyIncomingCallsRequest=it.CallHierarchyPrepareRequest=void 0;const Wt=H;var hs;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(hs||(it.CallHierarchyPrepareRequest=hs={}));var ms;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ms||(it.CallHierarchyIncomingCallsRequest=ms={}));var ws;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wt.MessageDirection.clientToServer,t.type=new Wt.ProtocolRequestType(t.method)})(ws||(it.CallHierarchyOutgoingCallsRequest=ws={}));var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.SemanticTokensRefreshRequest=Te.SemanticTokensRangeRequest=Te.SemanticTokensDeltaRequest=Te.SemanticTokensRequest=Te.SemanticTokensRegistrationType=Te.TokenFormat=void 0;const Ye=H;var ps;(function(t){t.Relative="relative"})(ps||(Te.TokenFormat=ps={}));var _n;(function(t){t.method="textDocument/semanticTokens",t.type=new Ye.RegistrationType(t.method)})(_n||(Te.SemanticTokensRegistrationType=_n={}));var ys;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(ys||(Te.SemanticTokensRequest=ys={}));var vs;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(vs||(Te.SemanticTokensDeltaRequest=vs={}));var Rs;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ye.MessageDirection.clientToServer,t.type=new Ye.ProtocolRequestType(t.method),t.registrationMethod=_n.method})(Rs||(Te.SemanticTokensRangeRequest=Rs={}));var Ds;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ye.MessageDirection.serverToClient,t.type=new Ye.ProtocolRequestType0(t.method)})(Ds||(Te.SemanticTokensRefreshRequest=Ds={}));var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.ShowDocumentRequest=void 0;const Ts=H;var Ps;(function(t){t.method="window/showDocument",t.messageDirection=Ts.MessageDirection.serverToClient,t.type=new Ts.ProtocolRequestType(t.method)})(Ps||(rr.ShowDocumentRequest=Ps={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.LinkedEditingRangeRequest=void 0;const ks=H;var Ss;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(Ss||(ir.LinkedEditingRangeRequest=Ss={}));var ve={};Object.defineProperty(ve,"__esModule",{value:!0}),ve.WillDeleteFilesRequest=ve.DidDeleteFilesNotification=ve.DidRenameFilesNotification=ve.WillRenameFilesRequest=ve.DidCreateFilesNotification=ve.WillCreateFilesRequest=ve.FileOperationPatternKind=void 0;const Se=H;var Cs;(function(t){t.file="file",t.folder="folder"})(Cs||(ve.FileOperationPatternKind=Cs={}));var qs;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(qs||(ve.WillCreateFilesRequest=qs={}));var Ms;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ms||(ve.DidCreateFilesNotification=Ms={}));var Os;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(Os||(ve.WillRenameFilesRequest=Os={}));var Es;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Es||(ve.DidRenameFilesNotification=Es={}));var Ns;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolNotificationType(t.method)})(Ns||(ve.DidDeleteFilesNotification=Ns={}));var js;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Se.MessageDirection.clientToServer,t.type=new Se.ProtocolRequestType(t.method)})(js||(ve.WillDeleteFilesRequest=js={}));var ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.MonikerRequest=ot.MonikerKind=ot.UniquenessLevel=void 0;const Fs=H;var Is;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Is||(ot.UniquenessLevel=Is={}));var As;(function(t){t.$import="import",t.$export="export",t.local="local"})(As||(ot.MonikerKind=As={}));var Ls;(function(t){t.method="textDocument/moniker",t.messageDirection=Fs.MessageDirection.clientToServer,t.type=new Fs.ProtocolRequestType(t.method)})(Ls||(ot.MonikerRequest=Ls={}));var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.TypeHierarchySubtypesRequest=st.TypeHierarchySupertypesRequest=st.TypeHierarchyPrepareRequest=void 0;const $t=H;var Ws;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Ws||(st.TypeHierarchyPrepareRequest=Ws={}));var $s;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})($s||(st.TypeHierarchySupertypesRequest=$s={}));var Hs;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=$t.MessageDirection.clientToServer,t.type=new $t.ProtocolRequestType(t.method)})(Hs||(st.TypeHierarchySubtypesRequest=Hs={}));var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.InlineValueRefreshRequest=Ht.InlineValueRequest=void 0;const or=H;var xs;(function(t){t.method="textDocument/inlineValue",t.messageDirection=or.MessageDirection.clientToServer,t.type=new or.ProtocolRequestType(t.method)})(xs||(Ht.InlineValueRequest=xs={}));var zs;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=or.MessageDirection.serverToClient,t.type=new or.ProtocolRequestType0(t.method)})(zs||(Ht.InlineValueRefreshRequest=zs={}));var ct={};Object.defineProperty(ct,"__esModule",{value:!0}),ct.InlayHintRefreshRequest=ct.InlayHintResolveRequest=ct.InlayHintRequest=void 0;const xt=H;var Bs;(function(t){t.method="textDocument/inlayHint",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Bs||(ct.InlayHintRequest=Bs={}));var Vs;(function(t){t.method="inlayHint/resolve",t.messageDirection=xt.MessageDirection.clientToServer,t.type=new xt.ProtocolRequestType(t.method)})(Vs||(ct.InlayHintResolveRequest=Vs={}));var Us;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=xt.MessageDirection.serverToClient,t.type=new xt.ProtocolRequestType0(t.method)})(Us||(ct.InlayHintRefreshRequest=Us={}));var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DiagnosticRefreshRequest=Ce.WorkspaceDiagnosticRequest=Ce.DocumentDiagnosticRequest=Ce.DocumentDiagnosticReportKind=Ce.DiagnosticServerCancellationData=void 0;const Js=wt,du=ee,zt=H;var Xs;(function(t){function e(n){const r=n;return r&&du.boolean(r.retriggerRequest)}t.is=e})(Xs||(Ce.DiagnosticServerCancellationData=Xs={}));var Qs;(function(t){t.Full="full",t.Unchanged="unchanged"})(Qs||(Ce.DocumentDiagnosticReportKind=Qs={}));var Ys;(function(t){t.method="textDocument/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ys||(Ce.DocumentDiagnosticRequest=Ys={}));var Ks;(function(t){t.method="workspace/diagnostic",t.messageDirection=zt.MessageDirection.clientToServer,t.type=new zt.ProtocolRequestType(t.method),t.partialResult=new Js.ProgressType})(Ks||(Ce.WorkspaceDiagnosticRequest=Ks={}));var Gs;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=zt.MessageDirection.serverToClient,t.type=new zt.ProtocolRequestType0(t.method)})(Gs||(Ce.DiagnosticRefreshRequest=Gs={}));var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.DidCloseNotebookDocumentNotification=te.DidSaveNotebookDocumentNotification=te.DidChangeNotebookDocumentNotification=te.NotebookCellArrayChange=te.DidOpenNotebookDocumentNotification=te.NotebookDocumentSyncRegistrationType=te.NotebookDocument=te.NotebookCell=te.ExecutionSummary=te.NotebookCellKind=void 0;const bn=so,Ne=ee,$e=H;var co;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(co||(te.NotebookCellKind=co={}));var ao;(function(t){function e(i,o){const c={executionOrder:i};return(o===!0||o===!1)&&(c.success=o),c}t.create=e;function n(i){const o=i;return Ne.objectLiteral(o)&&bn.uinteger.is(o.executionOrder)&&(o.success===void 0||Ne.boolean(o.success))}t.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=r})(ao||(te.ExecutionSummary=ao={}));var sr;(function(t){function e(o,c){return{kind:o,document:c}}t.create=e;function n(o){const c=o;return Ne.objectLiteral(c)&&co.is(c.kind)&&bn.DocumentUri.is(c.document)&&(c.metadata===void 0||Ne.objectLiteral(c.metadata))}t.is=n;function r(o,c){const d=new Set;return o.document!==c.document&&d.add("document"),o.kind!==c.kind&&d.add("kind"),o.executionSummary!==c.executionSummary&&d.add("executionSummary"),(o.metadata!==void 0||c.metadata!==void 0)&&!i(o.metadata,c.metadata)&&d.add("metadata"),(o.executionSummary!==void 0||c.executionSummary!==void 0)&&!ao.equals(o.executionSummary,c.executionSummary)&&d.add("executionSummary"),d}t.diff=r;function i(o,c){if(o===c)return!0;if(o==null||c===null||c===void 0||typeof o!=typeof c||typeof o!="object")return!1;const d=Array.isArray(o),f=Array.isArray(c);if(d!==f)return!1;if(d&&f){if(o.length!==c.length)return!1;for(let _=0;_0}a.hasId=ce})(Tr||(t.StaticRegistrationOptions=Tr={}));var Pr;(function(a){function ce(ae){const E=ae;return E&&(E.documentSelector===null||wn.is(E.documentSelector))}a.is=ce})(Pr||(t.TextDocumentRegistrationOptions=Pr={}));var kr;(function(a){function ce(E){const u=E;return r.objectLiteral(u)&&(u.workDoneProgress===void 0||r.boolean(u.workDoneProgress))}a.is=ce;function ae(E){const u=E;return u&&r.boolean(u.workDoneProgress)}a.hasWorkDoneProgress=ae})(kr||(t.WorkDoneProgressOptions=kr={}));var ft;(function(a){a.method="initialize",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ft||(t.InitializeRequest=ft={}));var gt;(function(a){a.unknownProtocolVersion=1})(gt||(t.InitializeErrorCodes=gt={}));var Tt;(function(a){a.method="initialized",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Tt||(t.InitializedNotification=Tt={}));var _t;(function(a){a.method="shutdown",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType0(a.method)})(_t||(t.ShutdownRequest=_t={}));var Pt;(function(a){a.method="exit",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType0(a.method)})(Pt||(t.ExitNotification=Pt={}));var kt;(function(a){a.method="workspace/didChangeConfiguration",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(kt||(t.DidChangeConfigurationNotification=kt={}));var Qt;(function(a){a.Error=1,a.Warning=2,a.Info=3,a.Log=4,a.Debug=5})(Qt||(t.MessageType=Qt={}));var He;(function(a){a.method="window/showMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(He||(t.ShowMessageNotification=He={}));var xe;(function(a){a.method="window/showMessageRequest",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType(a.method)})(xe||(t.ShowMessageRequest=xe={}));var St;(function(a){a.method="window/logMessage",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(St||(t.LogMessageNotification=St={}));var Oe;(function(a){a.method="telemetry/event",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(Oe||(t.TelemetryEventNotification=Oe={}));var U;(function(a){a.None=0,a.Full=1,a.Incremental=2})(U||(t.TextDocumentSyncKind=U={}));var ze;(function(a){a.method="textDocument/didOpen",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(ze||(t.DidOpenTextDocumentNotification=ze={}));var ne;(function(a){function ce(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range!==void 0&&(u.rangeLength===void 0||typeof u.rangeLength=="number")}a.isIncremental=ce;function ae(E){let u=E;return u!=null&&typeof u.text=="string"&&u.range===void 0&&u.rangeLength===void 0}a.isFull=ae})(ne||(t.TextDocumentContentChangeEvent=ne={}));var je;(function(a){a.method="textDocument/didChange",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(je||(t.DidChangeTextDocumentNotification=je={}));var Yt;(function(a){a.method="textDocument/didClose",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Yt||(t.DidCloseTextDocumentNotification=Yt={}));var pn;(function(a){a.method="textDocument/didSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(pn||(t.DidSaveTextDocumentNotification=pn={}));var yn;(function(a){a.Manual=1,a.AfterDelay=2,a.FocusOut=3})(yn||(t.TextDocumentSaveReason=yn={}));var vn;(function(a){a.method="textDocument/willSave",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(vn||(t.WillSaveTextDocumentNotification=vn={}));var Rn;(function(a){a.method="textDocument/willSaveWaitUntil",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Rn||(t.WillSaveTextDocumentWaitUntilRequest=Rn={}));var Fe;(function(a){a.method="workspace/didChangeWatchedFiles",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolNotificationType(a.method)})(Fe||(t.DidChangeWatchedFilesNotification=Fe={}));var Dn;(function(a){a.Created=1,a.Changed=2,a.Deleted=3})(Dn||(t.FileChangeType=Dn={}));var Sr;(function(a){function ce(ae){const E=ae;return r.objectLiteral(E)&&(n.URI.is(E.baseUri)||n.WorkspaceFolder.is(E.baseUri))&&r.string(E.pattern)}a.is=ce})(Sr||(t.RelativePattern=Sr={}));var Cr;(function(a){a.Create=1,a.Change=2,a.Delete=4})(Cr||(t.WatchKind=Cr={}));var qr;(function(a){a.method="textDocument/publishDiagnostics",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolNotificationType(a.method)})(qr||(t.PublishDiagnosticsNotification=qr={}));var Mr;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.TriggerForIncompleteCompletions=3})(Mr||(t.CompletionTriggerKind=Mr={}));var Tn;(function(a){a.method="textDocument/completion",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Tn||(t.CompletionRequest=Tn={}));var Pn;(function(a){a.method="completionItem/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Pn||(t.CompletionResolveRequest=Pn={}));var Ke;(function(a){a.method="textDocument/hover",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ke||(t.HoverRequest=Ke={}));var kn;(function(a){a.Invoked=1,a.TriggerCharacter=2,a.ContentChange=3})(kn||(t.SignatureHelpTriggerKind=kn={}));var Or;(function(a){a.method="textDocument/signatureHelp",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Or||(t.SignatureHelpRequest=Or={}));var Er;(function(a){a.method="textDocument/definition",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Er||(t.DefinitionRequest=Er={}));var Sn;(function(a){a.method="textDocument/references",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Sn||(t.ReferencesRequest=Sn={}));var Cn;(function(a){a.method="textDocument/documentHighlight",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Cn||(t.DocumentHighlightRequest=Cn={}));var Nr;(function(a){a.method="textDocument/documentSymbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Nr||(t.DocumentSymbolRequest=Nr={}));var jr;(function(a){a.method="textDocument/codeAction",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(jr||(t.CodeActionRequest=jr={}));var Fr;(function(a){a.method="codeAction/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Fr||(t.CodeActionResolveRequest=Fr={}));var Ir;(function(a){a.method="workspace/symbol",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ir||(t.WorkspaceSymbolRequest=Ir={}));var Ar;(function(a){a.method="workspaceSymbol/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ar||(t.WorkspaceSymbolResolveRequest=Ar={}));var Lr;(function(a){a.method="textDocument/codeLens",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Lr||(t.CodeLensRequest=Lr={}));var Ie;(function(a){a.method="codeLens/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ie||(t.CodeLensResolveRequest=Ie={}));var Wr;(function(a){a.method="workspace/codeLens/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(Wr||(t.CodeLensRefreshRequest=Wr={}));var $r;(function(a){a.method="textDocument/documentLink",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})($r||(t.DocumentLinkRequest=$r={}));var Ct;(function(a){a.method="documentLink/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ct||(t.DocumentLinkResolveRequest=Ct={}));var Hr;(function(a){a.method="textDocument/formatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Hr||(t.DocumentFormattingRequest=Hr={}));var Kt;(function(a){a.method="textDocument/rangeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Kt||(t.DocumentRangeFormattingRequest=Kt={}));var xr;(function(a){a.method="textDocument/rangesFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(xr||(t.DocumentRangesFormattingRequest=xr={}));var Ge;(function(a){a.method="textDocument/onTypeFormatting",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Ge||(t.DocumentOnTypeFormattingRequest=Ge={}));var bt;(function(a){a.Identifier=1})(bt||(t.PrepareSupportDefaultBehavior=bt={}));var zr;(function(a){a.method="textDocument/rename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(zr||(t.RenameRequest=zr={}));var Br;(function(a){a.method="textDocument/prepareRename",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(Br||(t.PrepareRenameRequest=Br={}));var ht;(function(a){a.method="workspace/executeCommand",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(ht||(t.ExecuteCommandRequest=ht={}));var qn;(function(a){a.method="workspace/applyEdit",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType("workspace/applyEdit")})(qn||(t.ApplyWorkspaceEditRequest=qn={}))}(Xo);var ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.createProtocolConnection=void 0;const cc=wt;function lu(t,e,n,r){return cc.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,cc.createMessageConnection)(t,e,n,r)}ar.createProtocolConnection=lu,function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(wt,t),n(so,t),n(H,t),n(Xo,t);var r=ar;Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Vo),function(t){var e=de&&de.__createBinding||(Object.create?function(o,c,d,f){f===void 0&&(f=d);var _=Object.getOwnPropertyDescriptor(c,d);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(o,f,_)}:function(o,c,d,f){f===void 0&&(f=d),o[f]=c[d]}),n=de&&de.__exportStar||function(o,c){for(var d in o)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&e(c,o,d)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Bo;n(Bo,t),n(Vo,t);function i(o,c,d,f){return(0,r.createMessageConnection)(o,c,d,f)}t.createProtocolConnection=i}(ie),Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SemanticTokensBuilder=Ue.SemanticTokensDiff=Ue.SemanticTokensFeature=void 0;const ur=ie,fu=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ur.SemanticTokensRefreshRequest.type),on:e=>{const n=ur.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{const n=ur.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{const n=ur.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ue.SemanticTokensFeature=fu;class ac{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){const e=this.originalSequence.length,n=this.modifiedSequence.length;let r=0;for(;r=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i0&&(c-=this._prevLine,c===0&&(d-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=d,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new ac(this._prevData,this._data).computeDiff()}:this.build()}}Ue.SemanticTokensBuilder=gu;var dr={};Object.defineProperty(dr,"__esModule",{value:!0}),dr.InlineCompletionFeature=void 0;const _u=ie,bu=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(_u.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};dr.InlineCompletionFeature=bu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.TextDocuments=void 0;const Rt=ie;class hu{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Rt.Emitter,this._onDidOpen=new Rt.Emitter,this._onDidClose=new Rt.Emitter,this._onDidSave=new Rt.Emitter,this._onWillSave=new Rt.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Rt.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);const c=Object.freeze({document:o});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,o=r.contentChanges;if(o.length===0)return;const{version:c}=i;if(c==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let d=this._syncedDocuments.get(i.uri);d!==void 0&&(d=this._configuration.update(d,o,c),this._syncedDocuments.set(i.uri,d),this._onDidChangeContent.fire(Object.freeze({document:d})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Rt.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}hn.TextDocuments=hu;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NotebookDocuments=Dt.NotebookSyncFeature=void 0;const qe=ie,uc=hn,mu=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(qe.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(qe.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(qe.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(qe.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Dt.NotebookSyncFeature=mu;class Vt{onDidOpenTextDocument(e){return this.openHandler=e,qe.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qe.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qe.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Vt.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Vt.NULL_DISPOSE}onDidSaveTextDocument(){return Vt.NULL_DISPOSE}}Vt.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class wu{constructor(e){e instanceof uc.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new uc.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qe.Emitter,this._onDidChange=new qe.Emitter,this._onDidSave=new qe.Emitter,this._onDidClose=new qe.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){const n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const n=new Vt,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;const c=o.metadata;let d=!1;const f=i.change;f.metadata!==void 0&&(d=!0,o.metadata=f.metadata);const _=[],w=[],P=[],v=[];if(f.cells!==void 0){const $=f.cells;if($.structure!==void 0){const b=$.structure.array;if(o.cells.splice(b.start,b.deleteCount,...b.cells!==void 0?b.cells:[]),$.structure.didOpen!==void 0)for(const h of $.structure.didOpen)n.openTextDocument({textDocument:h}),_.push(h.uri);if($.structure.didClose)for(const h of $.structure.didClose)n.closeTextDocument({textDocument:h}),w.push(h.uri)}if($.data!==void 0){const b=new Map($.data.map(h=>[h.document,h]));for(let h=0;h<=o.cells.length;h++){const T=b.get(o.cells[h].document);if(T!==void 0){const ge=o.cells.splice(h,1,T);if(P.push({old:ge[0],new:T}),b.delete(T.document),b.size===0)break}}}if($.textContent!==void 0)for(const b of $.textContent)n.changeTextDocument({textDocument:b.document,contentChanges:b.changes}),v.push(b.document.uri)}this.updateCellMap(o);const M={notebookDocument:o};d&&(M.metadata={old:c,new:o.metadata});const W=[];for(const $ of _)W.push(this.getNotebookCell($));const be=[];for(const $ of w)be.push(this.getNotebookCell($));const me=[];for(const $ of v)me.push(this.getNotebookCell($));(W.length>0||be.length>0||P.length>0||me.length>0)&&(M.cells={added:W,removed:be,changed:{data:P,textContent:me}}),(M.metadata!==void 0||M.cells!==void 0)&&this._onDidChange.fire(M)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(const c of i.cellTextDocuments)n.closeTextDocument({textDocument:c});this.notebookDocuments.delete(i.notebookDocument.uri);for(const c of o.cells)this.notebookCellMap.delete(c.document)}})),qe.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}Dt.NotebookDocuments=wu;var z={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.thenable=oe.typedArray=oe.stringArray=oe.array=oe.func=oe.error=oe.number=oe.string=oe.boolean=void 0;function pu(t){return t===!0||t===!1}oe.boolean=pu;function dc(t){return typeof t=="string"||t instanceof String}oe.string=dc;function yu(t){return typeof t=="number"||t instanceof Number}oe.number=yu;function vu(t){return t instanceof Error}oe.error=vu;function lc(t){return typeof t=="function"}oe.func=lc;function fc(t){return Array.isArray(t)}oe.array=fc;function Ru(t){return fc(t)&&t.every(e=>dc(e))}oe.stringArray=Ru;function Du(t,e){return Array.isArray(t)&&t.every(e)}oe.typedArray=Du;function Tu(t){return t&&lc(t.then)}oe.thenable=Tu;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.generateUuid=Pe.parse=Pe.isUUID=Pe.v4=Pe.empty=void 0;class uo{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class L extends uo{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return L._oneOf(L._chars)}constructor(){super([L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),"-","4",L._randomHex(),L._randomHex(),L._randomHex(),"-",L._oneOf(L._timeHighBits),L._randomHex(),L._randomHex(),L._randomHex(),"-",L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex(),L._randomHex()].join(""))}}L._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],L._timeHighBits=["8","9","a","b"],Pe.empty=new uo("00000000-0000-0000-0000-000000000000");function gc(){return new L}Pe.v4=gc;const Pu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _c(t){return Pu.test(t)}Pe.isUUID=_c;function ku(t){if(!_c(t))throw new Error("invalid uuid");return new uo(t)}Pe.parse=ku;function Su(){return gc().asHex()}Pe.generateUuid=Su;var at={};Object.defineProperty(at,"__esModule",{value:!0}),at.attachPartialResult=at.ProgressFeature=at.attachWorkDone=void 0;const ut=ie,Cu=Pe;class dt{constructor(e,n){this._connection=e,this._token=n,dt.Instances.set(this._token,this)}begin(e,n,r,i){let o={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,o)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,r)}done(){dt.Instances.delete(this._token),this._connection.sendProgress(ut.WorkDoneProgress.type,this._token,{kind:"end"})}}dt.Instances=new Map;class bc extends dt{constructor(e,n){super(e,n),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class lo{constructor(){}begin(){}report(){}done(){}}class hc extends lo{constructor(){super(),this._source=new ut.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function qu(t,e){if(e===void 0||e.workDoneToken===void 0)return new lo;const n=e.workDoneToken;return delete e.workDoneToken,new dt(t,n)}at.attachWorkDone=qu;const Mu=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ut.WorkDoneProgressCancelNotification.type,n=>{let r=dt.Instances.get(n.token);(r instanceof bc||r instanceof hc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new lo:new dt(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Cu.generateUuid)();return this.connection.sendRequest(ut.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new bc(this.connection,e))}else return Promise.resolve(new hc)}};at.ProgressFeature=Mu;var fo;(function(t){t.type=new ut.ProgressType})(fo||(fo={}));class Ou{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(fo.type,this._token,e)}}function Eu(t,e){if(e===void 0||e.partialResultToken===void 0)return;const n=e.partialResultToken;return delete e.partialResultToken,new Ou(t,n)}at.attachPartialResult=Eu;var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.ConfigurationFeature=void 0;const Nu=ie,ju=oe,Fu=t=>class extends t{getConfiguration(e){return e?ju.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Nu.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};lr.ConfigurationFeature=Fu;var fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.WorkspaceFoldersFeature=void 0;const gr=ie,Iu=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new gr.Emitter,this.connection.onNotification(gr.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);const n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(gr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(gr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};fr.WorkspaceFoldersFeature=Iu;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.CallHierarchyFeature=void 0;const go=ie,Au=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(go.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{const n=go.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{const n=go.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};_r.CallHierarchyFeature=Au;var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.ShowDocumentFeature=void 0;const Lu=ie,Wu=t=>class extends t{showDocument(e){return this.connection.sendRequest(Lu.ShowDocumentRequest.type,e)}};br.ShowDocumentFeature=Wu;var hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.FileOperationsFeature=void 0;const Ut=ie,$u=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ut.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ut.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ut.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ut.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ut.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ut.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};hr.FileOperationsFeature=$u;var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.LinkedEditingRangeFeature=void 0;const Hu=ie,xu=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Hu.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};mr.LinkedEditingRangeFeature=xu;var wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.TypeHierarchyFeature=void 0;const _o=ie,zu=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(_o.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{const n=_o.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{const n=_o.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wr.TypeHierarchyFeature=zu;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.InlineValueFeature=void 0;const mc=ie,Bu=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(mc.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(mc.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};pr.InlineValueFeature=Bu;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.FoldingRangeFeature=void 0;const wc=ie,Vu=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(wc.FoldingRangeRefreshRequest.type),on:e=>{const n=wc.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};yr.FoldingRangeFeature=Vu;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.InlayHintFeature=void 0;const bo=ie,Uu=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(bo.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(bo.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(bo.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};vr.InlayHintFeature=Uu;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.DiagnosticFeature=void 0;const mn=ie,Ju=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(mn.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(mn.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(mn.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(mn.WorkspaceDiagnosticRequest.partialResult,n)))}}};Rr.DiagnosticFeature=Ju;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.MonikerFeature=void 0;const Xu=ie,Qu=t=>class extends t{get moniker(){return{on:e=>{const n=Xu.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Dr.MonikerFeature=Qu,Object.defineProperty(z,"__esModule",{value:!0}),z.createConnection=z.combineFeatures=z.combineNotebooksFeatures=z.combineLanguagesFeatures=z.combineWorkspaceFeatures=z.combineWindowFeatures=z.combineClientFeatures=z.combineTracerFeatures=z.combineTelemetryFeatures=z.combineConsoleFeatures=z._NotebooksImpl=z._LanguagesImpl=z.BulkUnregistration=z.BulkRegistration=z.ErrorMessageTracker=void 0;const D=ie,Me=oe,ho=Pe,N=at,Yu=lr,Ku=fr,Gu=_r,Zu=Ue,ed=br,td=hr,nd=mr,rd=wr,id=pr,od=yr,sd=vr,cd=Rr,ad=Dt,ud=Dr;function mo(t){if(t!==null)return t}class dd{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}}z.ErrorMessageTracker=dd;class pc{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(D.MessageType.Error,e)}warn(e){this.send(D.MessageType.Warning,e)}info(e){this.send(D.MessageType.Info,e)}log(e){this.send(D.MessageType.Log,e)}debug(e){this.send(D.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(D.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,D.RAL)().console.error("Sending log message failed")})}}class ld{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:D.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showWarningMessage(e,...n){let r={type:D.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}showInformationMessage(e,...n){let r={type:D.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(D.ShowMessageRequest.type,r).then(mo)}}const yc=(0,ed.ShowDocumentFeature)((0,N.ProgressFeature)(ld));var vc;(function(t){function e(){return new Rc}t.create=e})(vc||(z.BulkRegistration=vc={}));class Rc{constructor(){this._registrations=[],this._registered=new Set}add(e,n){const r=Me.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);const i=ho.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}}var Dc;(function(t){function e(){return new wo(void 0,[])}t.create=e})(Dc||(z.BulkUnregistration=Dc={}));class wo{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(D.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){const n=Me.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(D.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}}class Tc{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Rc?this.registerMany(e):e instanceof wo?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){const i=Me.string(n)?n:n.method,o=ho.generateUuid();let c={registrations:[{id:o,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(D.RegistrationRequest.type,c).then(d=>(e.add({id:o,method:i}),e),d=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(d)))}registerSingle2(e,n){const r=Me.string(e)?e:e.method,i=ho.generateUuid();let o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(D.RegistrationRequest.type,o).then(c=>D.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(c)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(D.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(D.RegistrationRequest.type,n).then(()=>new wo(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}}class fd{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(D.ApplyWorkspaceEditRequest.type,r)}}const Pc=(0,td.FileOperationsFeature)((0,Ku.WorkspaceFoldersFeature)((0,Yu.ConfigurationFeature)(fd)));class kc{constructor(){this._trace=D.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==D.Trace.Off&&this.connection.sendNotification(D.LogTraceNotification.type,{message:e,verbose:this._trace===D.Trace.Verbose?n:void 0}).catch(()=>{})}}class Sc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(D.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class Cc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._LanguagesImpl=Cc;const qc=(0,od.FoldingRangeFeature)((0,ud.MonikerFeature)((0,cd.DiagnosticFeature)((0,sd.InlayHintFeature)((0,id.InlineValueFeature)((0,rd.TypeHierarchyFeature)((0,nd.LinkedEditingRangeFeature)((0,Zu.SemanticTokensFeature)((0,Gu.CallHierarchyFeature)(Cc)))))))));class Mc{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,N.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,N.attachPartialResult)(this.connection,n)}}z._NotebooksImpl=Mc;const Oc=(0,ad.NotebookSyncFeature)(Mc);function Ec(t,e){return function(n){return e(t(n))}}z.combineConsoleFeatures=Ec;function Nc(t,e){return function(n){return e(t(n))}}z.combineTelemetryFeatures=Nc;function jc(t,e){return function(n){return e(t(n))}}z.combineTracerFeatures=jc;function Fc(t,e){return function(n){return e(t(n))}}z.combineClientFeatures=Fc;function Ic(t,e){return function(n){return e(t(n))}}z.combineWindowFeatures=Ic;function Ac(t,e){return function(n){return e(t(n))}}z.combineWorkspaceFeatures=Ac;function Lc(t,e){return function(n){return e(t(n))}}z.combineLanguagesFeatures=Lc;function Wc(t,e){return function(n){return e(t(n))}}z.combineNotebooksFeatures=Wc;function gd(t,e){function n(i,o,c){return i&&o?c(i,o):i||o}return{__brand:"features",console:n(t.console,e.console,Ec),tracer:n(t.tracer,e.tracer,jc),telemetry:n(t.telemetry,e.telemetry,Nc),client:n(t.client,e.client,Fc),window:n(t.window,e.window,Ic),workspace:n(t.workspace,e.workspace,Ac),languages:n(t.languages,e.languages,Lc),notebooks:n(t.notebooks,e.notebooks,Wc)}}z.combineFeatures=gd;function _d(t,e,n){const r=n&&n.console?new(n.console(pc)):new pc,i=t(r);r.rawAttach(i);const o=n&&n.tracer?new(n.tracer(kc)):new kc,c=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,d=n&&n.client?new(n.client(Tc)):new Tc,f=n&&n.window?new(n.window(yc)):new yc,_=n&&n.workspace?new(n.workspace(Pc)):new Pc,w=n&&n.languages?new(n.languages(qc)):new qc,P=n&&n.notebooks?new(n.notebooks(Oc)):new Oc,v=[r,o,c,d,f,_,w,P];function M(b){return b instanceof Promise?b:Me.thenable(b)?new Promise((h,T)=>{b.then(ge=>h(ge),ge=>T(ge))}):Promise.resolve(b)}let W,be,me,$={listen:()=>i.listen(),sendRequest:(b,...h)=>i.sendRequest(Me.string(b)?b:b.method,...h),onRequest:(b,h)=>i.onRequest(b,h),sendNotification:(b,h)=>{const T=Me.string(b)?b:b.method;return i.sendNotification(T,h)},onNotification:(b,h)=>i.onNotification(b,h),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:b=>(be=b,{dispose:()=>{be=void 0}}),onInitialized:b=>i.onNotification(D.InitializedNotification.type,b),onShutdown:b=>(W=b,{dispose:()=>{W=void 0}}),onExit:b=>(me=b,{dispose:()=>{me=void 0}}),get console(){return r},get telemetry(){return c},get tracer(){return o},get client(){return d},get window(){return f},get workspace(){return _},get languages(){return w},get notebooks(){return P},onDidChangeConfiguration:b=>i.onNotification(D.DidChangeConfigurationNotification.type,b),onDidChangeWatchedFiles:b=>i.onNotification(D.DidChangeWatchedFilesNotification.type,b),__textDocumentSync:void 0,onDidOpenTextDocument:b=>i.onNotification(D.DidOpenTextDocumentNotification.type,b),onDidChangeTextDocument:b=>i.onNotification(D.DidChangeTextDocumentNotification.type,b),onDidCloseTextDocument:b=>i.onNotification(D.DidCloseTextDocumentNotification.type,b),onWillSaveTextDocument:b=>i.onNotification(D.WillSaveTextDocumentNotification.type,b),onWillSaveTextDocumentWaitUntil:b=>i.onRequest(D.WillSaveTextDocumentWaitUntilRequest.type,b),onDidSaveTextDocument:b=>i.onNotification(D.DidSaveTextDocumentNotification.type,b),sendDiagnostics:b=>i.sendNotification(D.PublishDiagnosticsNotification.type,b),onHover:b=>i.onRequest(D.HoverRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onCompletion:b=>i.onRequest(D.CompletionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCompletionResolve:b=>i.onRequest(D.CompletionResolveRequest.type,b),onSignatureHelp:b=>i.onRequest(D.SignatureHelpRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDeclaration:b=>i.onRequest(D.DeclarationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDefinition:b=>i.onRequest(D.DefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onTypeDefinition:b=>i.onRequest(D.TypeDefinitionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onImplementation:b=>i.onRequest(D.ImplementationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onReferences:b=>i.onRequest(D.ReferencesRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentHighlight:b=>i.onRequest(D.DocumentHighlightRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentSymbol:b=>i.onRequest(D.DocumentSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbol:b=>i.onRequest(D.WorkspaceSymbolRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onWorkspaceSymbolResolve:b=>i.onRequest(D.WorkspaceSymbolResolveRequest.type,b),onCodeAction:b=>i.onRequest(D.CodeActionRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeActionResolve:b=>i.onRequest(D.CodeActionResolveRequest.type,(h,T)=>b(h,T)),onCodeLens:b=>i.onRequest(D.CodeLensRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onCodeLensResolve:b=>i.onRequest(D.CodeLensResolveRequest.type,(h,T)=>b(h,T)),onDocumentFormatting:b=>i.onRequest(D.DocumentFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentRangeFormatting:b=>i.onRequest(D.DocumentRangeFormattingRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onDocumentOnTypeFormatting:b=>i.onRequest(D.DocumentOnTypeFormattingRequest.type,(h,T)=>b(h,T)),onRenameRequest:b=>i.onRequest(D.RenameRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),onPrepareRename:b=>i.onRequest(D.PrepareRenameRequest.type,(h,T)=>b(h,T)),onDocumentLinks:b=>i.onRequest(D.DocumentLinkRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onDocumentLinkResolve:b=>i.onRequest(D.DocumentLinkResolveRequest.type,(h,T)=>b(h,T)),onDocumentColor:b=>i.onRequest(D.DocumentColorRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onColorPresentation:b=>i.onRequest(D.ColorPresentationRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onFoldingRanges:b=>i.onRequest(D.FoldingRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onSelectionRanges:b=>i.onRequest(D.SelectionRangeRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),(0,N.attachPartialResult)(i,h))),onExecuteCommand:b=>i.onRequest(D.ExecuteCommandRequest.type,(h,T)=>b(h,T,(0,N.attachWorkDone)(i,h),void 0)),dispose:()=>i.dispose()};for(let b of v)b.attach($);return i.onRequest(D.InitializeRequest.type,b=>{e.initialize(b),Me.string(b.trace)&&(o.trace=D.Trace.fromString(b.trace));for(let h of v)h.initialize(b.capabilities);if(be){let h=be(b,new D.CancellationTokenSource().token,(0,N.attachWorkDone)(i,b),void 0);return M(h).then(T=>{if(T instanceof D.ResponseError)return T;let ge=T;ge||(ge={capabilities:{}});let se=ge.capabilities;se||(se={},ge.capabilities=se),se.textDocumentSync===void 0||se.textDocumentSync===null?se.textDocumentSync=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None:!Me.number(se.textDocumentSync)&&!Me.number(se.textDocumentSync.change)&&(se.textDocumentSync.change=Me.number($.__textDocumentSync)?$.__textDocumentSync:D.TextDocumentSyncKind.None);for(let we of v)we.fillServerCapabilities(se);return ge})}else{let h={capabilities:{textDocumentSync:D.TextDocumentSyncKind.None}};for(let T of v)T.fillServerCapabilities(h.capabilities);return h}}),i.onRequest(D.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,W)return W(new D.CancellationTokenSource().token)}),i.onNotification(D.ExitNotification.type,()=>{try{me&&me()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(D.SetTraceNotification.type,b=>{o.trace=D.Trace.fromString(b.value)}),$}z.createConnection=_d,function(t){var e=de&&de.__createBinding||(Object.create?function(f,_,w,P){P===void 0&&(P=w);var v=Object.getOwnPropertyDescriptor(_,w);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(f,P,v)}:function(f,_,w,P){P===void 0&&(P=w),f[P]=_[w]}),n=de&&de.__exportStar||function(f,_){for(var w in f)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&e(_,f,w)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Ue;Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=dr;n(ie,t);const o=hn;Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const c=Dt;Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),n(z,t);var d;(function(f){f.all={__brand:"features",languages:i.InlineCompletionFeature}})(d||(t.ProposedFeatures=d={}))}(Xr);var bd=ie;(function(t){var e=de&&de.__createBinding||(Object.create?function(d,f,_,w){w===void 0&&(w=_);var P=Object.getOwnPropertyDescriptor(f,_);(!P||("get"in P?!f.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(d,w,P)}:function(d,f,_,w){w===void 0&&(w=_),d[w]=f[_]}),n=de&&de.__exportStar||function(d,f){for(var _ in d)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&e(f,d,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=void 0;const r=Xr;n(bd,t),n(Xr,t);let i=!1;const o={initialize:d=>{},get shutdownReceived(){return i},set shutdownReceived(d){i=d},exit:d=>{}};function c(d,f,_,w){let P,v,M,W;d!==void 0&&d.__brand==="features"&&(P=d,d=f,f=_,_=w),r.ConnectionStrategy.is(d)||r.ConnectionOptions.is(d)?W=d:(v=d,M=f,W=_);const be=me=>(0,r.createProtocolConnection)(v,M,me,W);return(0,r.createConnection)(be,o,P)}t.createConnection=c})(ko);var po=ko;Po().then(()=>{const t=new po.BrowserMessageReader(self),e=new po.BrowserMessageWriter(self);let n;const r=po.createConnection(t,e);function i(d,f){return r.sendNotification(d,f),!0}async function o(d,f){return await r.sendRequest(d,f)}async function c(d){return await r.sendRequest("slint/load_file",d)}r.onInitialize(d=>(n=xc(d,i,o,c),n.server_initialize_result(d.capabilities))),r.onRequest(async(d,f,_)=>await n.handle_request(_,d,f)),r.onNotification("slint/preview_to_lsp",async d=>{await n.process_preview_to_lsp_message(d)}),r.onDidChangeTextDocument(async d=>{await n.reload_document(d.contentChanges[d.contentChanges.length-1].text,d.textDocument.uri,d.textDocument.version)}),r.onDidOpenTextDocument(async d=>{await n.reload_document(d.textDocument.text,d.textDocument.uri,d.textDocument.version)}),r.onDidChangeConfiguration(async d=>{await n.reload_config()}),r.listen(),self.postMessage("OK")})})(); diff --git a/snapshots/master/editor/assets/preview-D9OCQUww.js b/snapshots/master/editor/assets/preview-BtwPtDcf.js similarity index 97% rename from snapshots/master/editor/assets/preview-D9OCQUww.js rename to snapshots/master/editor/assets/preview-BtwPtDcf.js index 984b11e31..3c301c7cf 100644 --- a/snapshots/master/editor/assets/preview-D9OCQUww.js +++ b/snapshots/master/editor/assets/preview-BtwPtDcf.js @@ -1,5 +1,5 @@ import"./modulepreload-polyfill-B5Qt9EMX.js";let a;const v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);function r(n){return v[n]}let C=v.length;function Z(n){n<132||(v[n]=C,C=n)}function h(n){const e=r(n);return Z(n),e}const J=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&J.decode();let T=null;function M(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(a.memory.buffer)),T}function s(n,e){return n=n>>>0,J.decode(M().subarray(n,n+e))}function b(n){C===v.length&&v.push(v.length+1);const e=C;return C=v[e],v[e]=n,e}let l=0;const L=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ee=typeof L.encodeInto=="function"?function(n,e){return L.encodeInto(n,e)}:function(n,e){const t=L.encode(n);return e.set(t),{read:n.length,written:t.length}};function m(n,e,t){if(t===void 0){const g=L.encode(n),d=e(g.length,1)>>>0;return M().subarray(d,d+g.length).set(g),l=g.length,d}let _=n.length,c=e(_,1)>>>0;const o=M();let i=0;for(;i<_;i++){const g=n.charCodeAt(i);if(g>127)break;o[c+i]=g}if(i!==_){i!==0&&(n=n.slice(i)),c=t(c,_,_=i+n.length*3,1)>>>0;const g=M().subarray(c+i,c+_),d=ee(n,g);i+=d.written,c=t(c,_,i,1)>>>0}return l=i,c}function w(n){return n==null}let A=null;function u(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==a.memory.buffer)&&(A=new DataView(a.memory.buffer)),A}function B(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const c=n.description;return c==null?"Symbol":`Symbol(${c})`}if(e=="function"){const c=n.name;return typeof c=="string"&&c.length>0?`Function(${c})`:"Function"}if(Array.isArray(n)){const c=n.length;let o="[";c>0&&(o+=B(n[0]));for(let i=1;i1)_=t[1];else return toString.call(n);if(_=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:_}const D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{a.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function k(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;try{return _(c.a,c.b,...i)}finally{--c.cnt===0&&(a.__wbindgen_export_2.get(c.dtor)(c.a,c.b),c.a=0,D.unregister(c))}};return o.original=c,D.register(o,c,c),o}function P(n,e,t){a._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h82a6f63249bd7768(n,e,b(t))}function x(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;const g=c.a;c.a=0;try{return _(g,c.b,...i)}finally{--c.cnt===0?(a.__wbindgen_export_2.get(c.dtor)(g,c.b),D.unregister(c)):c.a=g}};return o.original=c,D.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h23dead3cb4f050af(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1e02abbd643bc2ce(n,e,b(t))}function X(n,e,t,_){a._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5c9859796c2ccbbc(n,e,b(t),b(_))}function f(n,e){try{return n.apply(this,e)}catch(t){a.__wbindgen_exn_store(b(t))}}function te(n,e,t,_){const c=m(n,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l,i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l,d=m(t,a.__wbindgen_malloc,a.__wbindgen_realloc),p=l,y=a.compile_from_string_with_style(c,o,i,g,d,p,w(_)?0:b(_));return h(y)}function ne(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);return n.ptr}let R=null;function re(){return(R===null||R.byteLength===0)&&(R=new Float32Array(a.memory.buffer)),R}function O(n,e){return n=n>>>0,re().subarray(n/4,n/4+e)}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_compilationresult_free(n>>>0,1));class V{static __wrap(e){e=e>>>0;const t=Object.create(V.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_compilationresult_free(e,0)}get component(){const e=a.compilationresult_component(this.__wbg_ptr);return e===0?void 0:z.__wrap(e)}get diagnostics(){const e=a.compilationresult_diagnostics(this.__wbg_ptr);return h(e)}get error_string(){let e,t;try{const o=a.__wbindgen_add_to_stack_pointer(-16);a.compilationresult_error_string(o,this.__wbg_ptr);var _=u().getInt32(o+4*0,!0),c=u().getInt32(o+4*1,!0);return e=_,t=c,s(_,c)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(e,t,1)}}}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedcompiledcomp_free(n>>>0,1));class z{static __wrap(e){e=e>>>0;const t=Object.create(z.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedcompiledcomp_free(e,0)}run(e){const t=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),_=l;a.wrappedcompiledcomp_run(this.__wbg_ptr,t,_)}create(e){try{const o=a.__wbindgen_add_to_stack_pointer(-16),i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;a.wrappedcompiledcomp_create(o,this.__wbg_ptr,i,g);var t=u().getInt32(o+4*0,!0),_=u().getInt32(o+4*1,!0),c=u().getInt32(o+4*2,!0);if(c)throw h(_);return h(t)}finally{a.__wbindgen_add_to_stack_pointer(16)}}create_with_existing_window(e){try{const i=a.__wbindgen_add_to_stack_pointer(-16);ne(e,W);var t=e.__destroy_into_raw();a.wrappedcompiledcomp_create_with_existing_window(i,this.__wbg_ptr,t);var _=u().getInt32(i+4*0,!0),c=u().getInt32(i+4*1,!0),o=u().getInt32(i+4*2,!0);if(o)throw h(c);return h(_)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}const G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedinstance_free(n>>>0,1));class W{static __wrap(e){e=e>>>0;const t=Object.create(W.prototype);return t.__wbg_ptr=e,G.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedinstance_free(e,0)}show(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_show(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}hide(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_hide(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}async function _e(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(_){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_);else throw _}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function ce(){const n={};return n.wbg={},n.wbg.__wbindgen_object_drop_ref=function(e){h(e)},n.wbg.__wbindgen_string_new=function(e,t){const _=s(e,t);return b(_)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return b(e)},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return b(e)},n.wbg.__wbindgen_number_new=function(e){return b(e)},n.wbg.__wbg_push_37c89022f34c01ca=function(e,t){return r(e).push(r(t))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return b(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const _=r(t).stack,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let _,c;try{_=e,c=t,console.error(s(e,t))}finally{a.__wbindgen_free(_,c,1)}},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return r(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return r(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbindgen_boolean_get=function(e){const t=r(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){r(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){r(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return f(function(e,t,_,c){const o=r(e).getContext(s(t,_),r(c));return w(o)?0:b(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=r(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=r(e).getSupportedExtensions();return w(t)?0:b(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return r(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const _=r(e)[t>>>0];return b(_)},n.wbg.__wbindgen_string_get=function(e,t){const _=r(t),c=typeof _=="string"?_:void 0;var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return f(function(e,t){const _=r(e).getParameter(t>>>0);return b(_)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=r(e).createVertexArrayOES();return w(t)?0:b(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=r(e).createVertexArray();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return r(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return r(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){r(e).bindVertexArray(r(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){r(e).bindVertexArrayOES(r(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,y)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return r(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=r(e).document;return w(t)?0:b(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,_){const c=r(e).getElementById(s(t,_));return w(c)?0:b(c)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=r(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return r(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return r(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=r(e).dataset;return b(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,_,c){const o=r(t)[s(_,c)];var i=w(o)?0:m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=r(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=r(e).style;return b(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return r(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return r(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return r(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return r(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return f(function(e,t){r(e).before(r(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=r(e);return b(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,_){r(e).value=s(t,_)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return r(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const _=r(t).inputType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){r(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return r(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const _=r(t).key,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return r(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,_){return r(e).getModifierState(s(t,_))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return r(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=r(e).clipboardData;return w(t)?0:b(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return f(function(e,t,_,c){const o=r(t).getData(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=r(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,_){r(e).font=s(t,_)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){r(e).fillStyle=r(t)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return r(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return r(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const _=r(t).currentSrc,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const _=r(t).src,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return f(function(){const e=new Image;return b(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,_){r(e).crossOrigin=t===0?void 0:s(t,_)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){r(e).onload=r(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,_){r(e).src=s(t,_)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return b(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return r(e).getTime()},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(r(e));return b(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return r(e).getTimezoneOffset()},n.wbg.__wbg_log_5766f8130e3dc687=function(e,t){console.log(s(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){r(e).deleteVertexArray(r(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){r(e).deleteVertexArrayOES(r(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_call_1084a111329e68ce=function(){return f(function(e,t){const _=r(e).call(r(t));return b(_)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return f(function(e,t,_){const c=r(e).call(r(t),r(_));return b(c)},arguments)},n.wbg.__wbindgen_memory=function(){const e=a.memory;return b(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=r(e).buffer;return b(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,_){const c=new Uint8Array(r(e),t>>>0,_>>>0);return b(c)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return f(function(e,t,_){return Reflect.set(r(e),r(t),r(_))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return f(function(){const e=self.self;return b(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return f(function(){const e=window.window;return b(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return f(function(){const e=globalThis.globalThis;return b(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return f(function(){const e=global.global;return b(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return r(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const _=new Function(s(e,t));return b(_)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var _={a:e,b:t},c=(i,g)=>{const d=_.a;_.a=0;try{return X(d,_.b,i,g)}finally{_.a=d}};const o=new Promise(c);return b(o)}finally{_.a=_.b=0}},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_wrappedinstance_new=function(e){const t=W.__wrap(e);return b(t)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(s(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const _=B(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=r(e).queueMicrotask;return b(t)},n.wbg.__wbindgen_is_function=function(e){return typeof r(e)=="function"},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(r(e));return b(t)},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const _=r(e).then(r(t));return b(_)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(r(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return f(function(e,t,_){const c=r(e).getExtension(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return f(function(e,t,_){const c=r(e).matchMedia(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return f(function(e,t){r(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return f(function(e,t){return r(e).setTimeout(r(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return f(function(e,t,_){const c=r(e).createElement(s(t,_));return b(c)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return f(function(e,t,_){return r(e).matches(s(t,_))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return f(function(e,t,_,c,o){r(e).setAttribute(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return f(function(e){r(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return f(function(e,t,_,c,o){r(e).fillText(s(t,_),c,o)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return f(function(e,t){r(e).addListener(r(t))},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return f(function(e,t,_){const c=r(e).getContext(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return f(function(){const e=new MessageChannel;return b(e)},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return f(function(e,t){r(e).postMessage(r(t))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return f(function(e,t){URL.revokeObjectURL(s(e,t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return f(function(e,t,_,c,o){r(e).setProperty(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_setData_41207994e2d54785=function(){return f(function(e,t,_,c,o){r(e).setData(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=r(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return f(function(){const e=new AbortController;return b(e)},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return f(function(e,t,_,c){r(e).addEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return f(function(e,t,_,c){r(e).removeEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=r(e).performance;return b(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return r(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return r(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return r(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=r(e).signal;return b(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,_){const c=r(e).postTask(r(t),r(_));return b(c)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const _=r(e).catch(r(t));return b(_)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=r(e).port1;return b(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){r(e).onmessage=r(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){r(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=r(e).port2;return b(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return f(function(e,t){return r(e).requestIdleCallback(r(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return f(function(e,t,_){return r(e).setTimeout(r(t),_)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const _=Array.of(r(e),r(t));return b(_)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(r(e));return b(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return f(function(e,t,_){r(e).postMessage(r(t),r(_))},arguments)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const _=r(t).pointerType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return r(e).persisted},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=r(e).contentRect;return b(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return r(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return r(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=r(e).devicePixelContentBoxSize;return b(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return r(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return r(e).blockSize},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return b(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const _=Object.getOwnPropertyDescriptor(r(e),r(t));return b(_)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=r(e).Window;return b(t)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,_){r(e).type=s(t,_)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return f(function(e,t){const _=new Blob(r(e),r(t));return b(_)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return f(function(e,t){const _=URL.createObjectURL(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(r(e),r(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){r(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){r(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){r(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){r(e).close()},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=r(e).navigator;return b(t)},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=r(e).userAgentData;return w(t)?0:b(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=r(e).brands;return b(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const _=r(t).brand,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return f(function(e,t){const _=r(t).userAgent,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(h(e))},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){r(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){r(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){r(e).cancel()},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){r(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=r(e).requestFullscreen();return b(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=r(e).webkitFullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=r(e).fullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(r(e),r(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,_){const c=r(e).animate(r(t),r(_));return b(c)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){r(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return f(function(e,t){r(e).removeListener(r(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return r(e).contains(r(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){r(e).unobserve(r(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){r(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){r(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return f(function(e,t,_,c){const o=r(t).getPropertyValue(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return f(function(e,t,_,c){const o=r(t).removeProperty(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=r(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=r(e).body;return w(t)?0:b(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return f(function(e,t){const _=r(e).appendChild(r(t));return b(_)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return f(function(e,t){const _=r(e).getComputedStyle(r(t));return w(_)?0:b(_)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=r(e).activeElement;return w(t)?0:b(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return f(function(e){const t=new ResizeObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){r(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,_){r(e).observe(r(t),r(_))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return f(function(e){const t=new IntersectionObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=r(e).getBoundingClientRect();return b(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return r(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return r(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return f(function(e,t){return r(e).requestAnimationFrame(r(t))},arguments)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return r(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return r(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return r(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return r(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return r(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return r(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const _=r(t).code,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return r(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return r(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return r(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return r(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=r(e).getCoalescedEvents();return b(t)},n.wbg.__wbindgen_closure_wrapper1181=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1183=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1184=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1185=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1186=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3357=function(e,t,_){const c=x(e,t,377,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6367=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8459=function(e,t,_){const c=x(e,t,377,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8493=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8504=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8515=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8520=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8528=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8543=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8551=function(e,t,_){const c=x(e,t,377,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8567=function(e,t,_){const c=x(e,t,377,X);return b(c)},n}function oe(n,e){return a=n.exports,Q.__wbindgen_wasm_module=e,A=null,R=null,T=null,a}async function Q(n){if(a!==void 0)return a;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_wasm_interpreter_bg-CE_9x5LD.wasm",import.meta.url).href,import.meta.url));const e=ce();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await _e(await n,e);return oe(t,_)}(async function(){await Q();let n="";const e=new Map;let t=` +${n.stack}`:_}const D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{a.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function k(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;try{return _(c.a,c.b,...i)}finally{--c.cnt===0&&(a.__wbindgen_export_2.get(c.dtor)(c.a,c.b),c.a=0,D.unregister(c))}};return o.original=c,D.register(o,c,c),o}function P(n,e,t){a._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h614507d81906b248(n,e,b(t))}function x(n,e,t,_){const c={a:n,b:e,cnt:1,dtor:t},o=(...i)=>{c.cnt++;const g=c.a;c.a=0;try{return _(g,c.b,...i)}finally{--c.cnt===0?(a.__wbindgen_export_2.get(c.dtor)(g,c.b),D.unregister(c)):c.a=g}};return o.original=c,D.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h23dead3cb4f050af(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1e02abbd643bc2ce(n,e,b(t))}function X(n,e,t,_){a._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5c9859796c2ccbbc(n,e,b(t),b(_))}function f(n,e){try{return n.apply(this,e)}catch(t){a.__wbindgen_exn_store(b(t))}}function te(n,e,t,_){const c=m(n,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l,i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l,d=m(t,a.__wbindgen_malloc,a.__wbindgen_realloc),p=l,y=a.compile_from_string_with_style(c,o,i,g,d,p,w(_)?0:b(_));return h(y)}function ne(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);return n.ptr}let R=null;function re(){return(R===null||R.byteLength===0)&&(R=new Float32Array(a.memory.buffer)),R}function O(n,e){return n=n>>>0,re().subarray(n/4,n/4+e)}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_compilationresult_free(n>>>0,1));class V{static __wrap(e){e=e>>>0;const t=Object.create(V.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_compilationresult_free(e,0)}get component(){const e=a.compilationresult_component(this.__wbg_ptr);return e===0?void 0:z.__wrap(e)}get diagnostics(){const e=a.compilationresult_diagnostics(this.__wbg_ptr);return h(e)}get error_string(){let e,t;try{const o=a.__wbindgen_add_to_stack_pointer(-16);a.compilationresult_error_string(o,this.__wbg_ptr);var _=u().getInt32(o+4*0,!0),c=u().getInt32(o+4*1,!0);return e=_,t=c,s(_,c)}finally{a.__wbindgen_add_to_stack_pointer(16),a.__wbindgen_free(e,t,1)}}}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedcompiledcomp_free(n>>>0,1));class z{static __wrap(e){e=e>>>0;const t=Object.create(z.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedcompiledcomp_free(e,0)}run(e){const t=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),_=l;a.wrappedcompiledcomp_run(this.__wbg_ptr,t,_)}create(e){try{const o=a.__wbindgen_add_to_stack_pointer(-16),i=m(e,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;a.wrappedcompiledcomp_create(o,this.__wbg_ptr,i,g);var t=u().getInt32(o+4*0,!0),_=u().getInt32(o+4*1,!0),c=u().getInt32(o+4*2,!0);if(c)throw h(_);return h(t)}finally{a.__wbindgen_add_to_stack_pointer(16)}}create_with_existing_window(e){try{const i=a.__wbindgen_add_to_stack_pointer(-16);ne(e,W);var t=e.__destroy_into_raw();a.wrappedcompiledcomp_create_with_existing_window(i,this.__wbg_ptr,t);var _=u().getInt32(i+4*0,!0),c=u().getInt32(i+4*1,!0),o=u().getInt32(i+4*2,!0);if(o)throw h(c);return h(_)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}const G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>a.__wbg_wrappedinstance_free(n>>>0,1));class W{static __wrap(e){e=e>>>0;const t=Object.create(W.prototype);return t.__wbg_ptr=e,G.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){const e=this.__destroy_into_raw();a.__wbg_wrappedinstance_free(e,0)}show(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_show(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}hide(){try{const c=a.__wbindgen_add_to_stack_pointer(-16);a.wrappedinstance_hide(c,this.__wbg_ptr);var e=u().getInt32(c+4*0,!0),t=u().getInt32(c+4*1,!0),_=u().getInt32(c+4*2,!0);if(_)throw h(t);return h(e)}finally{a.__wbindgen_add_to_stack_pointer(16)}}}async function _e(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(_){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_);else throw _}const t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function ce(){const n={};return n.wbg={},n.wbg.__wbindgen_object_drop_ref=function(e){h(e)},n.wbg.__wbindgen_string_new=function(e,t){const _=s(e,t);return b(_)},n.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return b(e)},n.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return b(e)},n.wbg.__wbindgen_number_new=function(e){return b(e)},n.wbg.__wbg_push_37c89022f34c01ca=function(e,t){return r(e).push(r(t))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return b(e)},n.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const _=r(t).stack,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let _,c;try{_=e,c=t,console.error(s(e,t))}finally{a.__wbindgen_free(_,c,1)}},n.wbg.__wbg_width_ac5901de11cd9abc=function(e){return r(e).width},n.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return r(e).height},n.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=r(e).createTexture();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=r(e).createProgram();return w(t)?0:b(t)},n.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,_){r(e).attachShader(r(t),r(_))},n.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,_,c,o){r(e).bindAttribLocation(r(t),_>>>0,s(c,o))},n.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){r(e).linkProgram(r(t))},n.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,_){const c=r(e).getProgramParameter(r(t),_>>>0);return b(c)},n.wbg.__wbindgen_boolean_get=function(e){const t=r(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,_){r(e).detachShader(r(t),r(_))},n.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,_){const c=r(t).getProgramInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_createShader_af087106532661d9=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const _=r(e).createShader(t>>>0);return w(_)?0:b(_)},n.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,_,c){r(e).shaderSource(r(t),s(_,c))},n.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){r(e).compileShader(r(t))},n.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,_){const c=r(e).getShaderParameter(r(t),_>>>0);return b(c)},n.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,_){const c=r(t).getShaderInfoLog(r(_));var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,_,c){r(e).uniform2fv(r(t),O(_,c))},n.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){r(e).deleteFramebuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){r(e).deleteRenderbuffer(r(t))},n.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){r(e).stencil=t!==0},n.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){r(e).antialias=t!==0},n.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return f(function(e,t,_,c){const o=r(e).getContext(s(t,_),r(c));return w(o)?0:b(o)},arguments)},n.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=r(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},n.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=r(e).getSupportedExtensions();return w(t)?0:b(t)},n.wbg.__wbg_length_ae22078168b726f5=function(e){return r(e).length},n.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const _=r(e)[t>>>0];return b(_)},n.wbg.__wbindgen_string_get=function(e,t){const _=r(t),c=typeof _=="string"?_:void 0;var o=w(c)?0:m(c,a.__wbindgen_malloc,a.__wbindgen_realloc),i=l;u().setInt32(e+4*1,i,!0),u().setInt32(e+4*0,o,!0)},n.wbg.__wbg_getParameter_cfaed180705b9280=function(){return f(function(e,t){const _=r(e).getParameter(t>>>0);return b(_)},arguments)},n.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=r(e).createVertexArrayOES();return w(t)?0:b(t)},n.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=r(e).createVertexArray();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=r(e).createBuffer();return w(t)?0:b(t)},n.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return r(e).getError()},n.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return r(e).getError()},n.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=r(e).createFramebuffer();return w(t)?0:b(t)},n.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,_,c,o,i){r(e).framebufferTexture2D(t>>>0,_>>>0,c>>>0,r(o),i)},n.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=r(e).createRenderbuffer();return w(t)?0:b(t)},n.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,_,c,o){r(e).renderbufferStorage(t>>>0,_>>>0,c,o)},n.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,_,c,o){r(e).framebufferRenderbuffer(t>>>0,_>>>0,c>>>0,r(o))},n.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return r(e).checkFramebufferStatus(t>>>0)},n.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,_,c,o){r(e).scissor(t,_,c,o)},n.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,_,c,o){r(e).clearColor(t,_,c,o)},n.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){r(e).clear(t>>>0)},n.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,_,c){r(e).uniform4fv(r(t),O(_,c))},n.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){r(e).deleteTexture(r(t))},n.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){r(e).deleteShader(r(t))},n.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){r(e).deleteProgram(r(t))},n.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){r(e).useProgram(r(t))},n.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,_){r(e).bindBuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,_){r(e).bindFramebuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,_){r(e).bindRenderbuffer(t>>>0,r(_))},n.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){r(e).bindVertexArray(r(t))},n.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){r(e).bindVertexArrayOES(r(t))},n.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,_){r(e).pixelStorei(t>>>0,_)},n.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disable_8908871f2334e76b=function(e,t){r(e).disable(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){r(e).disableVertexAttribArray(t>>>0)},n.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,_,c){r(e).drawArrays(t>>>0,_,c)},n.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){r(e).enable(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){r(e).enableVertexAttribArray(t>>>0)},n.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,_,c){const o=r(e).getUniformLocation(r(t),s(_,c));return w(o)?0:b(o)},n.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){r(e).generateMipmap(t>>>0)},n.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,_){r(e).uniform1i(r(t),_)},n.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,_,c,o){r(e).colorMask(t!==0,_!==0,c!==0,o!==0)},n.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,_){r(e).bindTexture(t>>>0,r(_))},n.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){r(e).activeTexture(t>>>0)},n.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,_,c){r(e).texParameteri(t>>>0,_>>>0,c)},n.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,r(y))},arguments)},n.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return f(function(e,t,_,c,o,i,g,d,p,y){r(e).texSubImage2D(t>>>0,_,c,o,i,g,d>>>0,p>>>0,y)},arguments)},n.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,_,c,o,i,g){r(e).vertexAttribPointer(t>>>0,_,c>>>0,o!==0,i,g)},n.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,_,c,o){r(e).viewport(t,_,c,o)},n.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,_,c){r(e).stencilFunc(t>>>0,_,c>>>0)},n.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){r(e).stencilMask(t>>>0)},n.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,_,c){r(e).stencilOp(t>>>0,_>>>0,c>>>0)},n.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,_,c,o){r(e).stencilOpSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return r(e).devicePixelRatio},n.wbg.__wbg_document_8554450897a855b9=function(e){const t=r(e).document;return w(t)?0:b(t)},n.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,_){const c=r(e).getElementById(s(t,_));return w(c)?0:b(c)},n.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=r(e)instanceof HTMLCanvasElement}catch{t=!1}return t},n.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return r(e).clientWidth},n.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return r(e).clientHeight},n.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=r(e).dataset;return b(t)},n.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,_,c){const o=r(t)[s(_,c)];var i=w(o)?0:m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},n.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=r(e)instanceof HTMLInputElement}catch{t=!1}return t},n.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=r(e).style;return b(t)},n.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return r(e).offsetLeft},n.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return r(e).offsetTop},n.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return r(e).offsetWidth},n.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return r(e).offsetHeight},n.wbg.__wbg_before_ac3792b457802cbf=function(){return f(function(e,t){r(e).before(r(t))},arguments)},n.wbg.__wbindgen_object_clone_ref=function(e){const t=r(e);return b(t)},n.wbg.__wbg_setvalue_688819688274bec0=function(e,t,_){r(e).value=s(t,_)},n.wbg.__wbg_data_edba00a6420faae3=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return r(e).isComposing},n.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const _=r(t).inputType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){r(e).preventDefault()},n.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return r(e).isComposing},n.wbg.__wbg_key_a626396efbca2b95=function(e,t){const _=r(t).key,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return r(e).altKey},n.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,_){return r(e).getModifierState(s(t,_))},n.wbg.__wbg_repeat_8451a79b3608855b=function(e){return r(e).repeat},n.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=r(e).clipboardData;return w(t)?0:b(t)},n.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return f(function(e,t,_,c){const o=r(t).getData(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=r(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},n.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,_){r(e).font=s(t,_)},n.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){r(e).fillStyle=r(t)},n.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return r(e).naturalWidth},n.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return r(e).naturalHeight},n.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const _=r(t).currentSrc,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const _=r(t).src,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_0d5e77f348d88b87=function(){return f(function(){const e=new Image;return b(e)},arguments)},n.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,_){r(e).crossOrigin=t===0?void 0:s(t,_)},n.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){r(e).onload=r(t)},n.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,_){r(e).src=s(t,_)},n.wbg.__wbg_new0_65387337a95cf44d=function(){return b(new Date)},n.wbg.__wbg_getTime_91058879093a1589=function(e){return r(e).getTime()},n.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(r(e));return b(t)},n.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return r(e).getTimezoneOffset()},n.wbg.__wbg_log_5766f8130e3dc687=function(e,t){console.log(s(e,t))},n.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){r(e).cullFace(t>>>0)},n.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){r(e).frontFace(t>>>0)},n.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,_,c){r(e).bufferData(t>>>0,r(_),c>>>0)},n.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,_,c,o){r(e).blendFuncSeparate(t>>>0,_>>>0,c>>>0,o>>>0)},n.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){r(e).deleteVertexArray(r(t))},n.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){r(e).deleteVertexArrayOES(r(t))},n.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){r(e).deleteBuffer(r(t))},n.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return f(function(e,t,_,c,o,i,g,d){r(e).readPixels(t,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){r(e).width=t>>>0},n.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){r(e).height=t>>>0},n.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return f(function(e,t,_,c,o,i,g,d){r(e).texSubImage2D(t>>>0,_,c,o,i>>>0,g>>>0,r(d))},arguments)},n.wbg.__wbg_call_1084a111329e68ce=function(){return f(function(e,t){const _=r(e).call(r(t));return b(_)},arguments)},n.wbg.__wbg_call_89af060b4e1523f2=function(){return f(function(e,t,_){const c=r(e).call(r(t),r(_));return b(c)},arguments)},n.wbg.__wbindgen_memory=function(){const e=a.memory;return b(e)},n.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=r(e).buffer;return b(t)},n.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,_){const c=new Uint8Array(r(e),t>>>0,_>>>0);return b(c)},n.wbg.__wbg_set_eacc7d73fefaafdf=function(){return f(function(e,t,_){return Reflect.set(r(e),r(t),r(_))},arguments)},n.wbg.__wbg_self_3093d5d1f7bcb682=function(){return f(function(){const e=self.self;return b(e)},arguments)},n.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return f(function(){const e=window.window;return b(e)},arguments)},n.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return f(function(){const e=globalThis.globalThis;return b(e)},arguments)},n.wbg.__wbg_global_e5a3fe56f8be9485=function(){return f(function(){const e=global.global;return b(e)},arguments)},n.wbg.__wbindgen_is_undefined=function(e){return r(e)===void 0},n.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const _=new Function(s(e,t));return b(_)},n.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var _={a:e,b:t},c=(i,g)=>{const d=_.a;_.a=0;try{return X(d,_.b,i,g)}finally{_.a=d}};const o=new Promise(c);return b(o)}finally{_.a=_.b=0}},n.wbg.__wbg_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_wrappedinstance_new=function(e){const t=W.__wrap(e);return b(t)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},n.wbg.__wbindgen_throw=function(e,t){throw new Error(s(e,t))},n.wbg.__wbindgen_debug_string=function(e,t){const _=B(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=r(e).queueMicrotask;return b(t)},n.wbg.__wbindgen_is_function=function(e){return typeof r(e)=="function"},n.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(r(e));return b(t)},n.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const _=r(e).then(r(t));return b(_)},n.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(r(e))},n.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return f(function(e,t,_){const c=r(e).getExtension(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return f(function(e,t,_){const c=r(e).matchMedia(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return f(function(e,t){r(e).cancelAnimationFrame(t)},arguments)},n.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return f(function(e,t){return r(e).setTimeout(r(t))},arguments)},n.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return f(function(e,t,_){const c=r(e).createElement(s(t,_));return b(c)},arguments)},n.wbg.__wbg_matches_212d57a200ff58f8=function(){return f(function(e,t,_){return r(e).matches(s(t,_))},arguments)},n.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return f(function(e,t,_,c,o){r(e).setAttribute(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_focus_06621101cc79f5d8=function(){return f(function(e){r(e).focus()},arguments)},n.wbg.__wbg_fillText_ae0445d1930428dd=function(){return f(function(e,t,_,c,o){r(e).fillText(s(t,_),c,o)},arguments)},n.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return f(function(e,t){r(e).addListener(r(t))},arguments)},n.wbg.__wbg_getContext_69ec873410cbba3c=function(){return f(function(e,t,_){const c=r(e).getContext(s(t,_));return w(c)?0:b(c)},arguments)},n.wbg.__wbg_new_40ff2b042829bc58=function(){return f(function(){const e=new MessageChannel;return b(e)},arguments)},n.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return f(function(e,t){r(e).postMessage(r(t))},arguments)},n.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return f(function(e,t){URL.revokeObjectURL(s(e,t))},arguments)},n.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return f(function(e,t,_,c,o){r(e).setProperty(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_setData_41207994e2d54785=function(){return f(function(e,t,_,c,o){r(e).setData(s(t,_),s(c,o))},arguments)},n.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=r(e)instanceof Window}catch{t=!1}return t},n.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const _=r(t).data;var c=w(_)?0:m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_new_ebf2727385ee825c=function(){return f(function(){const e=new AbortController;return b(e)},arguments)},n.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return f(function(e,t,_,c){r(e).addEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return f(function(e,t,_,c){r(e).removeEventListener(s(t,_),r(c))},arguments)},n.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=r(e).performance;return b(t)},n.wbg.__wbg_now_abd80e969af37148=function(e){return r(e).now()},n.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return r(e).movementX},n.wbg.__wbg_movementY_3064817f736e8151=function(e){return r(e).movementY},n.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=r(e).signal;return b(t)},n.wbg.__wbg_postTask_99464245f349be5a=function(e,t,_){const c=r(e).postTask(r(t),r(_));return b(c)},n.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const _=r(e).catch(r(t));return b(_)},n.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=r(e).port1;return b(t)},n.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){r(e).onmessage=r(t)},n.wbg.__wbg_start_f642a950f6c98a0e=function(e){r(e).start()},n.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=r(e).port2;return b(t)},n.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return f(function(e,t){return r(e).requestIdleCallback(r(t))},arguments)},n.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return f(function(e,t,_){return r(e).setTimeout(r(t),_)},arguments)},n.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const _=Array.of(r(e),r(t));return b(_)},n.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(r(e));return b(t)},n.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return f(function(e,t,_){r(e).postMessage(r(t),r(_))},arguments)},n.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const _=r(t).pointerType,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return r(e).persisted},n.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=r(e).contentRect;return b(t)},n.wbg.__wbg_width_e7964a50b174d035=function(e){return r(e).width},n.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return r(e).height},n.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=r(e).devicePixelContentBoxSize;return b(t)},n.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return r(e).inlineSize},n.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return r(e).blockSize},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return b(e)},n.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const _=Object.getOwnPropertyDescriptor(r(e),r(t));return b(_)},n.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=r(e).Window;return b(t)},n.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,_){r(e).type=s(t,_)},n.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return f(function(e,t){const _=new Blob(r(e),r(t));return b(_)},arguments)},n.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return f(function(e,t){const _=URL.createObjectURL(r(t)),c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},n.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(r(e),r(t))},n.wbg.__wbg_abort_8659d889a7877ae3=function(e){r(e).abort()},n.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){r(e).cancelIdleCallback(t>>>0)},n.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){r(e).clearTimeout(t)},n.wbg.__wbg_close_87d69f9e9fe928c3=function(e){r(e).close()},n.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=r(e).navigator;return b(t)},n.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=r(e).userAgentData;return w(t)?0:b(t)},n.wbg.__wbg_brands_982de08b35281a98=function(e){const t=r(e).brands;return b(t)},n.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const _=r(t).brand,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return f(function(e,t){const _=r(t).userAgent,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},arguments)},n.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(h(e))},n.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){r(e).disconnect()},n.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){r(e).disconnect()},n.wbg.__wbg_cancel_cba86749f45f30ae=function(e){r(e).cancel()},n.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){r(e).webkitRequestFullscreen()},n.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=r(e).requestFullscreen();return b(t)},n.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=r(e).webkitFullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=r(e).fullscreenElement;return w(t)?0:b(t)},n.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(r(e),r(t))},n.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,_){const c=r(e).animate(r(t),r(_));return b(c)},n.wbg.__wbg_play_5896e5851ba90aa2=function(e){r(e).play()},n.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return f(function(e,t){r(e).removeListener(r(t))},arguments)},n.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return r(e).contains(r(t))},n.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){r(e).unobserve(r(t))},n.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){r(e).webkitExitFullscreen()},n.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){r(e).exitFullscreen()},n.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return f(function(e,t,_,c){const o=r(t).getPropertyValue(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return f(function(e,t,_,c){const o=r(t).removeProperty(s(_,c)),i=m(o,a.__wbindgen_malloc,a.__wbindgen_realloc),g=l;u().setInt32(e+4*1,g,!0),u().setInt32(e+4*0,i,!0)},arguments)},n.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=r(e).visibilityState;return{hidden:0,visible:1}[t]??2},n.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=r(e).body;return w(t)?0:b(t)},n.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return f(function(e,t){const _=r(e).appendChild(r(t));return b(_)},arguments)},n.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return f(function(e,t){const _=r(e).getComputedStyle(r(t));return w(_)?0:b(_)},arguments)},n.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=r(e).activeElement;return w(t)?0:b(t)},n.wbg.__wbg_new_42acb42ec2ace97c=function(){return f(function(e){const t=new ResizeObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){r(e).box=["border-box","content-box","device-pixel-content-box"][t]},n.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,_){r(e).observe(r(t),r(_))},n.wbg.__wbg_new_d0c6c2df51a6d903=function(){return f(function(e){const t=new IntersectionObserver(r(e));return b(t)},arguments)},n.wbg.__wbg_observe_c901133fbef21560=function(e,t){r(e).observe(r(t))},n.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=r(e).getBoundingClientRect();return b(t)},n.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return r(e).x},n.wbg.__wbg_y_bd4e2c0613413655=function(e){return r(e).y},n.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return f(function(e,t){return r(e).requestAnimationFrame(r(t))},arguments)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_button_460cdec9f2512a91=function(e){return r(e).button},n.wbg.__wbg_offsetX_294898d040917c6b=function(e){return r(e).offsetX},n.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return r(e).offsetY},n.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return r(e).deltaX},n.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return r(e).deltaY},n.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return r(e).deltaMode},n.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const _=r(t).code,c=m(_,a.__wbindgen_malloc,a.__wbindgen_realloc),o=l;u().setInt32(e+4*1,o,!0),u().setInt32(e+4*0,c,!0)},n.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return r(e).location},n.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return r(e).metaKey},n.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return r(e).shiftKey},n.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return r(e).ctrlKey},n.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return r(e).altKey},n.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return r(e).metaKey},n.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=r(e).getCoalescedEvents();return b(t)},n.wbg.__wbindgen_closure_wrapper1182=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1184=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1185=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1186=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1187=function(e,t,_){const c=k(e,t,166,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3362=function(e,t,_){const c=x(e,t,379,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6368=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8459=function(e,t,_){const c=x(e,t,379,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8493=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8504=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8515=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8520=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8528=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8543=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8551=function(e,t,_){const c=x(e,t,379,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8567=function(e,t,_){const c=x(e,t,379,X);return b(c)},n}function oe(n,e){return a=n.exports,Q.__wbindgen_wasm_module=e,A=null,R=null,T=null,a}async function Q(n){if(a!==void 0)return a;typeof n<"u"&&Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof n>"u"&&(n=new URL(""+new URL("slint_wasm_interpreter_bg-Cvm7FsJl.wasm",import.meta.url).href,import.meta.url));const e=ce();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await _e(await n,e);return oe(t,_)}(async function(){await Q();let n="";const e=new Map;let t=` import { SpinBox, Button, CheckBox, Slider, GroupBox } from "std-widgets.slint"; export Demo := Window { width: 300px; // Width in logical pixels. All 'px' units are automatically scaled with screen resolution. diff --git a/snapshots/master/editor/assets/slint_lsp_wasm_bg-Bl5KSn92.wasm b/snapshots/master/editor/assets/slint_lsp_wasm_bg-DXvQhfqz.wasm similarity index 64% rename from snapshots/master/editor/assets/slint_lsp_wasm_bg-Bl5KSn92.wasm rename to snapshots/master/editor/assets/slint_lsp_wasm_bg-DXvQhfqz.wasm index 98fd3a36f..42e88ace8 100644 Binary files a/snapshots/master/editor/assets/slint_lsp_wasm_bg-Bl5KSn92.wasm and b/snapshots/master/editor/assets/slint_lsp_wasm_bg-DXvQhfqz.wasm differ diff --git a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-CE_9x5LD.wasm b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-Cvm7FsJl.wasm similarity index 70% rename from snapshots/master/editor/assets/slint_wasm_interpreter_bg-CE_9x5LD.wasm rename to snapshots/master/editor/assets/slint_wasm_interpreter_bg-Cvm7FsJl.wasm index c81f065bd..b86ca4547 100644 Binary files a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-CE_9x5LD.wasm and b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-Cvm7FsJl.wasm differ diff --git a/snapshots/master/editor/index.html b/snapshots/master/editor/index.html index b5d05c793..4840edbc1 100644 --- a/snapshots/master/editor/index.html +++ b/snapshots/master/editor/index.html @@ -21,7 +21,7 @@ href="https://slint.dev/assets/img/favicon.svg" /> - + diff --git a/snapshots/master/editor/preview.html b/snapshots/master/editor/preview.html index ad3eaa908..93152a3b2 100644 --- a/snapshots/master/editor/preview.html +++ b/snapshots/master/editor/preview.html @@ -31,7 +31,7 @@ touch-action: none; } - + diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts index 74857c66f..36fe08e22 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.d.ts @@ -124,7 +124,7 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h82a6f63249bd7768: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h614507d81906b248: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h23dead3cb4f050af: (a: number, b: number) => void; readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1e02abbd643bc2ce: (a: number, b: number, c: number) => void; readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5c9859796c2ccbbc: (a: number, b: number, c: number, d: number) => void; diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js index fc8879d17..6a235a140 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js @@ -209,7 +209,7 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_26(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h82a6f63249bd7768(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h614507d81906b248(arg0, arg1, addHeapObject(arg2)); } function makeMutClosure(arg0, arg1, dtor, f) { @@ -1947,11 +1947,7 @@ function __wbg_get_imports() { const ret = getObject(arg0).getCoalescedEvents(); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1181 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 166, __wbg_adapter_26); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_closure_wrapper1183 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1182 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 166, __wbg_adapter_26); return addHeapObject(ret); }; @@ -1967,48 +1963,52 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 166, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3357 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper1187 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 166, __wbg_adapter_26); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_closure_wrapper3362 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6367 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper6368 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8459 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_37); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_37); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8493 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8504 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8515 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8520 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8528 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8543 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8551 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_40); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_40); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper8567 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 377, __wbg_adapter_59); + const ret = makeMutClosure(arg0, arg1, 379, __wbg_adapter_59); return addHeapObject(ret); }; diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm index c81f065bd..b86ca4547 100644 Binary files a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm and b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm differ diff --git a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts index 3c9ab2ca6..8963f3faa 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm.d.ts @@ -23,7 +23,7 @@ export function run_event_loop(a: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h82a6f63249bd7768(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h614507d81906b248(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h23dead3cb4f050af(a: number, b: number): void; export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1e02abbd643bc2ce(a: number, b: number, c: number): void; export function _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5c9859796c2ccbbc(a: number, b: number, c: number, d: number): void;